/* * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./node_modules/@dannadori/voice-changer-client-js/dist/index.js": /*!***********************************************************************!*\ !*** ./node_modules/@dannadori/voice-changer-client-js/dist/index.js ***! \***********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { eval("/*! For license information please see index.js.LICENSE.txt */\n!function(e,t){if(true)module.exports=t(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));else { var n, i; }}(\"undefined\"!=typeof self?self:this,(__WEBPACK_EXTERNAL_MODULE__8156__=>(()=>{var __webpack_modules__={1446:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.AwsCrc32=void 0;var n=i(655),r=i(1359),s=i(4079),o=function(){function e(){this.crc32=new s.Crc32}return e.prototype.update=function(e){(0,r.isEmptyData)(e)||this.crc32.update((0,r.convertToBuffer)(e))},e.prototype.digest=function(){return n.__awaiter(this,void 0,void 0,(function(){return n.__generator(this,(function(e){return[2,(0,r.numToUint8)(this.crc32.digest())]}))}))},e.prototype.reset=function(){this.crc32=new s.Crc32},e}();t.AwsCrc32=o},4079:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.AwsCrc32=t.Crc32=t.crc32=void 0;var n=i(655),r=i(1359);t.crc32=function(e){return(new s).update(e).digest()};var s=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(e){var t,i;try{for(var r=n.__values(e),s=r.next();!s.done;s=r.next()){var a=s.value;this.checksum=this.checksum>>>8^o[255&(this.checksum^a)]}}catch(e){t={error:e}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return this},e.prototype.digest=function(){return(4294967295^this.checksum)>>>0},e}();t.Crc32=s;var o=(0,r.uint32ArrayFrom)([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),a=i(1446);Object.defineProperty(t,\"AwsCrc32\",{enumerable:!0,get:function(){return a.AwsCrc32}})},8229:(e,t,i)=>{\"use strict\";var n=i(8764).lW;Object.defineProperty(t,\"__esModule\",{value:!0}),t.convertToBuffer=void 0;var r=i(470),s=void 0!==n&&n.from?function(e){return n.from(e,\"utf8\")}:r.fromUtf8;t.convertToBuffer=function(e){return e instanceof Uint8Array?e:\"string\"==typeof e?s(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}},1359:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var n=i(8229);Object.defineProperty(t,\"convertToBuffer\",{enumerable:!0,get:function(){return n.convertToBuffer}});var r=i(701);Object.defineProperty(t,\"isEmptyData\",{enumerable:!0,get:function(){return r.isEmptyData}});var s=i(6251);Object.defineProperty(t,\"numToUint8\",{enumerable:!0,get:function(){return s.numToUint8}});var o=i(3340);Object.defineProperty(t,\"uint32ArrayFrom\",{enumerable:!0,get:function(){return o.uint32ArrayFrom}})},701:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return\"string\"==typeof e?0===e.length:0===e.byteLength}},6251:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},3340:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),i=0;i{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0})},6665:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0})},5470:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0})},969:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0})},5287:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isMsWindow=void 0;var i=[\"decrypt\",\"digest\",\"encrypt\",\"exportKey\",\"generateKey\",\"importKey\",\"sign\",\"verify\"];t.isMsWindow=function(e){if(function(e){return\"MSInputMethodContext\"in e&&\"msCrypto\"in e}(e)&&void 0!==e.msCrypto.subtle){var t=e.msCrypto,n=t.getRandomValues,r=t.subtle;return i.map((function(e){return r[e]})).concat(n).every((function(e){return\"function\"==typeof e}))}return!1}},87:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=i(655);n.__exportStar(i(8260),t),n.__exportStar(i(6665),t),n.__exportStar(i(5470),t),n.__exportStar(i(969),t),n.__exportStar(i(5287),t)},7333:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.EMPTY_DATA_SHA_256=t.SHA_256_HMAC_ALGO=t.SHA_256_HASH=void 0,t.SHA_256_HASH={name:\"SHA-256\"},t.SHA_256_HMAC_ALGO={name:\"HMAC\",hash:t.SHA_256_HASH},t.EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])},2769:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.Sha256=void 0;var n=i(3479),r=i(8889),s=i(3137),o=i(21),a=i(87),c=i(6495),d=i(2037),l=function(){function e(e){(0,o.supportsWebCrypto)((0,c.locateWindow)())?this.hash=new r.Sha256(e):(0,a.isMsWindow)((0,c.locateWindow)())?this.hash=new n.Sha256(e):this.hash=new s.Sha256(e)}return e.prototype.update=function(e,t){this.hash.update((0,d.convertToBuffer)(e))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e}();t.Sha256=l},3479:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.Sha256=void 0;var n=i(8036),r=i(7333),s=i(470),o=i(6495),a=function(){function e(e){this.secret=e,this.reset()}return e.prototype.update=function(e){var t=this;(0,n.isEmptyData)(e)||(this.operation=this.operation.then((function(i){return i.onerror=function(){t.operation=Promise.reject(new Error(\"Error encountered updating hash\"))},i.process(c(e)),i})),this.operation.catch((function(){})))},e.prototype.digest=function(){return this.operation.then((function(e){return new Promise((function(t,i){e.onerror=function(){i(new Error(\"Error encountered finalizing hash\"))},e.oncomplete=function(){e.result&&t(new Uint8Array(e.result)),i(new Error(\"Error encountered finalizing hash\"))},e.finish()}))}))},e.prototype.reset=function(){var e;this.secret?(this.operation=(e=this.secret,new Promise((function(t,i){var n=(0,o.locateWindow)().msCrypto.subtle.importKey(\"raw\",c(e),r.SHA_256_HMAC_ALGO,!1,[\"sign\"]);n.oncomplete=function(){n.result&&t(n.result),i(new Error(\"ImportKey completed without importing key.\"))},n.onerror=function(){i(new Error(\"ImportKey failed to import key.\"))}}))).then((function(e){return(0,o.locateWindow)().msCrypto.subtle.sign(r.SHA_256_HMAC_ALGO,e)})),this.operation.catch((function(){}))):this.operation=Promise.resolve((0,o.locateWindow)().msCrypto.subtle.digest(\"SHA-256\"))},e}();function c(e){return\"string\"==typeof e?(0,s.fromUtf8)(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=a},7643:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.WebCryptoSha256=t.Ie11Sha256=void 0,i(655).__exportStar(i(2769),t);var n=i(3479);Object.defineProperty(t,\"Ie11Sha256\",{enumerable:!0,get:function(){return n.Sha256}});var r=i(8889);Object.defineProperty(t,\"WebCryptoSha256\",{enumerable:!0,get:function(){return r.Sha256}})},8036:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return\"string\"==typeof e?0===e.length:0===e.byteLength}},8889:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.Sha256=void 0;var n=i(2037),r=i(7333),s=i(6495),o=function(){function e(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return e.prototype.update=function(e){if(!(0,n.isEmptyData)(e)){var t=(0,n.convertToBuffer)(e),i=new Uint8Array(this.toHash.byteLength+t.byteLength);i.set(this.toHash,0),i.set(t,this.toHash.byteLength),this.toHash=i}},e.prototype.digest=function(){var e=this;return this.key?this.key.then((function(t){return(0,s.locateWindow)().crypto.subtle.sign(r.SHA_256_HMAC_ALGO,t,e.toHash).then((function(e){return new Uint8Array(e)}))})):(0,n.isEmptyData)(this.toHash)?Promise.resolve(r.EMPTY_DATA_SHA_256):Promise.resolve().then((function(){return(0,s.locateWindow)().crypto.subtle.digest(r.SHA_256_HASH,e.toHash)})).then((function(e){return Promise.resolve(new Uint8Array(e))}))},e.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&void 0!==this.secret&&(this.key=new Promise((function(t,i){(0,s.locateWindow)().crypto.subtle.importKey(\"raw\",(0,n.convertToBuffer)(e.secret),r.SHA_256_HMAC_ALGO,!1,[\"sign\"]).then(t,i)})),this.key.catch((function(){})))},e}();t.Sha256=o},9558:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.RawSha256=void 0;var n=i(4750),r=function(){function e(){this.state=Int32Array.from(n.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error(\"Attempted to update an already finished hash.\");var t=0,i=e.byteLength;if(this.bytesHashed+=i,8*this.bytesHashed>n.MAX_HASHABLE_LENGTH)throw new Error(\"Cannot hash more than 2^53 - 1 bits\");for(;i>0;)this.buffer[this.bufferLength++]=e[t++],i--,this.bufferLength===n.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),i=this.bufferLength;if(t.setUint8(this.bufferLength++,128),i%n.BLOCK_SIZE>=n.BLOCK_SIZE-8){for(var r=this.bufferLength;r>>24&255,s[4*r+1]=this.state[r]>>>16&255,s[4*r+2]=this.state[r]>>>8&255,s[4*r+3]=this.state[r]>>>0&255;return s},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,i=t[0],r=t[1],s=t[2],o=t[3],a=t[4],c=t[5],d=t[6],l=t[7],u=0;u>>17|h<<15)^(h>>>19|h<<13)^h>>>10,m=((h=this.temp[u-15])>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;this.temp[u]=(p+this.temp[u-7]|0)+(m+this.temp[u-16]|0)}var f=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&c^~a&d)|0)+(l+(n.KEY[u]+this.temp[u]|0)|0)|0,g=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&r^i&s^r&s)|0;l=d,d=c,c=a,a=o+f|0,o=s,s=r,r=i,i=f+g|0}t[0]+=i,t[1]+=r,t[2]+=s,t[3]+=o,t[4]+=a,t[5]+=c,t[6]+=d,t[7]+=l},e}();t.RawSha256=r},4750:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.MAX_HASHABLE_LENGTH=t.INIT=t.KEY=t.DIGEST_LENGTH=t.BLOCK_SIZE=void 0,t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},3137:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),i(655).__exportStar(i(3020),t)},3020:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.Sha256=void 0;var n=i(655),r=i(4750),s=i(9558),o=i(2037),a=function(){function e(e){this.secret=e,this.hash=new s.RawSha256,this.reset()}return e.prototype.update=function(e){if(!(0,o.isEmptyData)(e)&&!this.error)try{this.hash.update((0,o.convertToBuffer)(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return n.__awaiter(this,void 0,void 0,(function(){return n.__generator(this,(function(e){return[2,this.digestSync()]}))}))},e.prototype.reset=function(){if(this.hash=new s.RawSha256,this.secret){this.outer=new s.RawSha256;var e=function(e){var t=(0,o.convertToBuffer)(e);if(t.byteLength>r.BLOCK_SIZE){var i=new s.RawSha256;i.update(t),t=i.digest()}var n=new Uint8Array(r.BLOCK_SIZE);return n.set(t),n}(this.secret),t=new Uint8Array(r.BLOCK_SIZE);t.set(e);for(var i=0;i{\"use strict\";var n=i(8764).lW;Object.defineProperty(t,\"__esModule\",{value:!0}),t.convertToBuffer=void 0;var r=i(470),s=void 0!==n&&n.from?function(e){return n.from(e,\"utf8\")}:r.fromUtf8;t.convertToBuffer=function(e){return e instanceof Uint8Array?e:\"string\"==typeof e?s(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}},2037:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var n=i(6867);Object.defineProperty(t,\"convertToBuffer\",{enumerable:!0,get:function(){return n.convertToBuffer}});var r=i(5355);Object.defineProperty(t,\"isEmptyData\",{enumerable:!0,get:function(){return r.isEmptyData}});var s=i(9921);Object.defineProperty(t,\"numToUint8\",{enumerable:!0,get:function(){return s.numToUint8}});var o=i(4935);Object.defineProperty(t,\"uint32ArrayFrom\",{enumerable:!0,get:function(){return o.uint32ArrayFrom}})},5355:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return\"string\"==typeof e?0===e.length:0===e.byteLength}},9921:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},4935:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),i=0;i{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.RawSha256=void 0;var n=i(6532),r=function(){function e(){this.state=Int32Array.from(n.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error(\"Attempted to update an already finished hash.\");var t=0,i=e.byteLength;if(this.bytesHashed+=i,8*this.bytesHashed>n.MAX_HASHABLE_LENGTH)throw new Error(\"Cannot hash more than 2^53 - 1 bits\");for(;i>0;)this.buffer[this.bufferLength++]=e[t++],i--,this.bufferLength===n.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),i=this.bufferLength;if(t.setUint8(this.bufferLength++,128),i%n.BLOCK_SIZE>=n.BLOCK_SIZE-8){for(var r=this.bufferLength;r>>24&255,s[4*r+1]=this.state[r]>>>16&255,s[4*r+2]=this.state[r]>>>8&255,s[4*r+3]=this.state[r]>>>0&255;return s},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,i=t[0],r=t[1],s=t[2],o=t[3],a=t[4],c=t[5],d=t[6],l=t[7],u=0;u>>17|h<<15)^(h>>>19|h<<13)^h>>>10,m=((h=this.temp[u-15])>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;this.temp[u]=(p+this.temp[u-7]|0)+(m+this.temp[u-16]|0)}var f=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&c^~a&d)|0)+(l+(n.KEY[u]+this.temp[u]|0)|0)|0,g=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&r^i&s^r&s)|0;l=d,d=c,c=a,a=o+f|0,o=s,s=r,r=i,i=f+g|0}t[0]+=i,t[1]+=r,t[2]+=s,t[3]+=o,t[4]+=a,t[5]+=c,t[6]+=d,t[7]+=l},e}();t.RawSha256=r},6532:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.MAX_HASHABLE_LENGTH=t.INIT=t.KEY=t.DIGEST_LENGTH=t.BLOCK_SIZE=void 0,t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},1938:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),i(655).__exportStar(i(5430),t)},5430:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.Sha256=void 0;var n=i(655),r=i(6532),s=i(914),o=i(7658),a=function(){function e(e){if(this.hash=new s.RawSha256,e){this.outer=new s.RawSha256;var t=function(e){var t=(0,o.convertToBuffer)(e);if(t.byteLength>r.BLOCK_SIZE){var i=new s.RawSha256;i.update(t),t=i.digest()}var n=new Uint8Array(r.BLOCK_SIZE);return n.set(t),n}(e),i=new Uint8Array(r.BLOCK_SIZE);i.set(t);for(var n=0;n{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),i(655).__exportStar(i(7787),t)},7787:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.supportsZeroByteGCM=t.supportsSubtleCrypto=t.supportsSecureRandom=t.supportsWebCrypto=void 0;var n=i(655),r=[\"decrypt\",\"digest\",\"encrypt\",\"exportKey\",\"generateKey\",\"importKey\",\"sign\",\"verify\"];function s(e){return\"object\"==typeof e&&\"object\"==typeof e.crypto&&\"function\"==typeof e.crypto.getRandomValues}function o(e){return e&&r.every((function(t){return\"function\"==typeof e[t]}))}t.supportsWebCrypto=function(e){return!(!s(e)||\"object\"!=typeof e.crypto.subtle)&&o(e.crypto.subtle)},t.supportsSecureRandom=s,t.supportsSubtleCrypto=o,t.supportsZeroByteGCM=function(e){return n.__awaiter(this,void 0,void 0,(function(){var t;return n.__generator(this,(function(i){switch(i.label){case 0:if(!o(e))return[2,!1];i.label=1;case 1:return i.trys.push([1,4,,5]),[4,e.generateKey({name:\"AES-GCM\",length:128},!1,[\"encrypt\"])];case 2:return t=i.sent(),[4,e.encrypt({name:\"AES-GCM\",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},t,new Uint8Array(0))];case 3:return[2,16===i.sent().byteLength];case 4:return i.sent(),[2,!1];case 5:return[2]}}))}))}},1106:(e,t,i)=>{\"use strict\";var n=i(8764).lW;Object.defineProperty(t,\"__esModule\",{value:!0}),t.convertToBuffer=void 0;var r=i(470),s=void 0!==n&&n.from?function(e){return n.from(e,\"utf8\")}:r.fromUtf8;t.convertToBuffer=function(e){return e instanceof Uint8Array?e:\"string\"==typeof e?s(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}},7658:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var n=i(1106);Object.defineProperty(t,\"convertToBuffer\",{enumerable:!0,get:function(){return n.convertToBuffer}});var r=i(4304);Object.defineProperty(t,\"isEmptyData\",{enumerable:!0,get:function(){return r.isEmptyData}});var s=i(2174);Object.defineProperty(t,\"numToUint8\",{enumerable:!0,get:function(){return s.numToUint8}});var o=i(1558);Object.defineProperty(t,\"uint32ArrayFrom\",{enumerable:!0,get:function(){return o.uint32ArrayFrom}})},4304:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return\"string\"==typeof e?0===e.length:0===e.byteLength}},2174:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},1558:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),i=0;i{\"use strict\";i.r(t),i.d(t,{$Command:()=>di,AllowNotifications:()=>hn,AssociateChannelFlowCommand:()=>ys,BadRequestException:()=>fn,BatchChannelMembershipsFilterSensitiveLog:()=>Ln,BatchCreateChannelMembershipCommand:()=>ws,BatchCreateChannelMembershipResponseFilterSensitiveLog:()=>Un,ChannelAssociatedWithFlowSummaryFilterSensitiveLog:()=>jn,ChannelBanFilterSensitiveLog:()=>zn,ChannelBanSummaryFilterSensitiveLog:()=>$n,ChannelFilterSensitiveLog:()=>Vn,ChannelFlowCallbackCommand:()=>Cs,ChannelFlowCallbackRequestFilterSensitiveLog:()=>Jn,ChannelFlowFilterSensitiveLog:()=>Hn,ChannelFlowSummaryFilterSensitiveLog:()=>Qn,ChannelMembershipFilterSensitiveLog:()=>Zn,ChannelMembershipForAppInstanceUserSummaryFilterSensitiveLog:()=>Yn,ChannelMembershipPreferencesFilterSensitiveLog:()=>tr,ChannelMembershipSummaryFilterSensitiveLog:()=>ir,ChannelMembershipType:()=>pn,ChannelMessageCallbackFilterSensitiveLog:()=>Gn,ChannelMessageFilterSensitiveLog:()=>nr,ChannelMessagePersistenceType:()=>_n,ChannelMessageStatus:()=>Pn,ChannelMessageSummaryFilterSensitiveLog:()=>rr,ChannelMessageType:()=>On,ChannelMode:()=>In,ChannelModeratedByAppInstanceUserSummaryFilterSensitiveLog:()=>sr,ChannelModeratorFilterSensitiveLog:()=>or,ChannelModeratorSummaryFilterSensitiveLog:()=>ar,ChannelPrivacy:()=>Tn,ChannelSummaryFilterSensitiveLog:()=>Xn,ChimeSDKMessaging:()=>bo,ChimeSDKMessagingClient:()=>ln,ChimeSDKMessagingServiceException:()=>un,ConflictException:()=>gn,CreateChannelBanCommand:()=>ks,CreateChannelBanResponseFilterSensitiveLog:()=>lr,CreateChannelCommand:()=>Es,CreateChannelFlowCommand:()=>Is,CreateChannelFlowRequestFilterSensitiveLog:()=>ur,CreateChannelMembershipCommand:()=>Ts,CreateChannelMembershipResponseFilterSensitiveLog:()=>hr,CreateChannelModeratorCommand:()=>As,CreateChannelModeratorResponseFilterSensitiveLog:()=>pr,CreateChannelRequestFilterSensitiveLog:()=>dr,DeleteChannelBanCommand:()=>Ms,DeleteChannelCommand:()=>xs,DeleteChannelFlowCommand:()=>_s,DeleteChannelMembershipCommand:()=>Ps,DeleteChannelMessageCommand:()=>Os,DeleteChannelModeratorCommand:()=>Rs,DeleteMessagingStreamingConfigurationsCommand:()=>Ds,DescribeChannelBanCommand:()=>Ns,DescribeChannelBanResponseFilterSensitiveLog:()=>fr,DescribeChannelCommand:()=>Fs,DescribeChannelFlowCommand:()=>Bs,DescribeChannelFlowResponseFilterSensitiveLog:()=>gr,DescribeChannelMembershipCommand:()=>Ls,DescribeChannelMembershipForAppInstanceUserCommand:()=>Us,DescribeChannelMembershipForAppInstanceUserResponseFilterSensitiveLog:()=>Sr,DescribeChannelMembershipResponseFilterSensitiveLog:()=>vr,DescribeChannelModeratedByAppInstanceUserCommand:()=>Vs,DescribeChannelModeratedByAppInstanceUserResponseFilterSensitiveLog:()=>br,DescribeChannelModeratorCommand:()=>js,DescribeChannelModeratorResponseFilterSensitiveLog:()=>yr,DescribeChannelResponseFilterSensitiveLog:()=>mr,DisassociateChannelFlowCommand:()=>zs,ErrorCode:()=>mn,ExpirationCriterion:()=>En,FallbackAction:()=>Mn,ForbiddenException:()=>vn,GetChannelMembershipPreferencesCommand:()=>$s,GetChannelMembershipPreferencesResponseFilterSensitiveLog:()=>wr,GetChannelMessageCommand:()=>Ws,GetChannelMessageResponseFilterSensitiveLog:()=>Cr,GetChannelMessageStatusCommand:()=>Hs,GetMessagingSessionEndpointCommand:()=>qs,GetMessagingStreamingConfigurationsCommand:()=>Ks,IdentityFilterSensitiveLog:()=>Bn,InvocationType:()=>An,ListChannelBansCommand:()=>Gs,ListChannelBansRequestFilterSensitiveLog:()=>kr,ListChannelBansResponseFilterSensitiveLog:()=>Er,ListChannelFlowsCommand:()=>Js,ListChannelFlowsRequestFilterSensitiveLog:()=>Ir,ListChannelFlowsResponseFilterSensitiveLog:()=>Tr,ListChannelMembershipsCommand:()=>Qs,ListChannelMembershipsForAppInstanceUserCommand:()=>Zs,ListChannelMembershipsForAppInstanceUserRequestFilterSensitiveLog:()=>xr,ListChannelMembershipsForAppInstanceUserResponseFilterSensitiveLog:()=>_r,ListChannelMembershipsRequestFilterSensitiveLog:()=>Ar,ListChannelMembershipsResponseFilterSensitiveLog:()=>Mr,ListChannelMessagesCommand:()=>Xs,ListChannelMessagesRequestFilterSensitiveLog:()=>Pr,ListChannelMessagesResponseFilterSensitiveLog:()=>Or,ListChannelModeratorsCommand:()=>Ys,ListChannelModeratorsRequestFilterSensitiveLog:()=>Rr,ListChannelModeratorsResponseFilterSensitiveLog:()=>Dr,ListChannelsAssociatedWithChannelFlowCommand:()=>eo,ListChannelsAssociatedWithChannelFlowRequestFilterSensitiveLog:()=>Br,ListChannelsAssociatedWithChannelFlowResponseFilterSensitiveLog:()=>Lr,ListChannelsCommand:()=>to,ListChannelsModeratedByAppInstanceUserCommand:()=>io,ListChannelsModeratedByAppInstanceUserRequestFilterSensitiveLog:()=>Ur,ListChannelsModeratedByAppInstanceUserResponseFilterSensitiveLog:()=>Vr,ListChannelsRequestFilterSensitiveLog:()=>Nr,ListChannelsResponseFilterSensitiveLog:()=>Fr,ListSubChannelsCommand:()=>no,ListSubChannelsRequestFilterSensitiveLog:()=>jr,ListSubChannelsResponseFilterSensitiveLog:()=>zr,ListTagsForResourceCommand:()=>ro,ListTagsForResourceResponseFilterSensitiveLog:()=>$r,MessageAttributeValueFilterSensitiveLog:()=>qn,MessagingDataType:()=>Rn,NotFoundException:()=>Sn,ProcessorFilterSensitiveLog:()=>Wn,PushNotificationConfigurationFilterSensitiveLog:()=>Kn,PushNotificationPreferencesFilterSensitiveLog:()=>er,PushNotificationType:()=>xn,PutChannelExpirationSettingsCommand:()=>so,PutChannelMembershipPreferencesCommand:()=>oo,PutChannelMembershipPreferencesRequestFilterSensitiveLog:()=>Wr,PutChannelMembershipPreferencesResponseFilterSensitiveLog:()=>Hr,PutMessagingStreamingConfigurationsCommand:()=>ao,RedactChannelMessageCommand:()=>co,ResourceLimitExceededException:()=>kn,SearchChannelsCommand:()=>lo,SearchChannelsRequestFilterSensitiveLog:()=>qr,SearchChannelsResponseFilterSensitiveLog:()=>Kr,SearchFieldKey:()=>Nn,SearchFieldOperator:()=>Fn,SendChannelMessageCommand:()=>uo,SendChannelMessageRequestFilterSensitiveLog:()=>Gr,ServiceFailureException:()=>bn,ServiceUnavailableException:()=>yn,SortOrder:()=>Dn,TagFilterSensitiveLog:()=>cr,TagResourceCommand:()=>ho,TagResourceRequestFilterSensitiveLog:()=>Jr,ThrottledClientException:()=>wn,UnauthorizedClientException:()=>Cn,UntagResourceCommand:()=>po,UntagResourceRequestFilterSensitiveLog:()=>Qr,UpdateChannelCommand:()=>mo,UpdateChannelFlowCommand:()=>fo,UpdateChannelFlowRequestFilterSensitiveLog:()=>Xr,UpdateChannelMessageCommand:()=>go,UpdateChannelMessageRequestFilterSensitiveLog:()=>Yr,UpdateChannelReadMarkerCommand:()=>vo,UpdateChannelRequestFilterSensitiveLog:()=>Zr,__Client:()=>Yt,paginateListChannelBans:()=>wo,paginateListChannelFlows:()=>ko,paginateListChannelMemberships:()=>Ao,paginateListChannelMembershipsForAppInstanceUser:()=>Io,paginateListChannelMessages:()=>xo,paginateListChannelModerators:()=>Po,paginateListChannels:()=>Bo,paginateListChannelsAssociatedWithChannelFlow:()=>Ro,paginateListChannelsModeratedByAppInstanceUser:()=>No,paginateListSubChannels:()=>Uo,paginateSearchChannels:()=>jo});var n={};i.r(n),i.d(n,{getUserAgentPrefix:()=>ke,isVirtualHostableS3Bucket:()=>Pe,parseArn:()=>Oe,partition:()=>ye,setPartitionInfo:()=>we,useDefaultPartitionInfo:()=>Ce});var r,s,o,a,c,d={};i.r(d),i.d(d,{aws:()=>n,booleanEquals:()=>Re,getAttr:()=>De,isSet:()=>Ne,isValidHostLabel:()=>_e,not:()=>Fe,parseURL:()=>Ue,stringEquals:()=>Ve,substring:()=>je,uriEncode:()=>ze}),function(e){e.HEADER=\"header\",e.QUERY=\"query\"}(r||(r={})),function(e){e.HTTP=\"http\",e.HTTPS=\"https\"}(s||(s={})),(c=o||(o={}))[c.HEADER=0]=\"HEADER\",c[c.TRAILER=1]=\"TRAILER\",function(e){e.HTTP_0_9=\"http/0.9\",e.HTTP_1_0=\"http/1.0\",e.TDS_8_0=\"tds/8.0\"}(a||(a={}));class l{constructor(e){this.method=e.method||\"GET\",this.hostname=e.hostname||\"localhost\",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?\":\"!==e.protocol.slice(-1)?`${e.protocol}:`:e.protocol:\"https:\",this.path=e.path?\"/\"!==e.path.charAt(0)?`/${e.path}`:e.path:\"/\",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static isInstance(e){if(!e)return!1;const t=e;return\"method\"in t&&\"protocol\"in t&&\"hostname\"in t&&\"path\"in t&&\"object\"==typeof t.query&&\"object\"==typeof t.headers}clone(){const e=new l({...this,headers:{...this.headers}});var t;return e.query&&(e.query=(t=e.query,Object.keys(t).reduce(((e,i)=>{const n=t[i];return{...e,[i]:Array.isArray(n)?[...n]:n}}),{}))),e}}class u{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return\"number\"==typeof t.statusCode&&\"object\"==typeof t.headers}}const h={name:\"hostHeaderMiddleware\",step:\"build\",priority:\"low\",tags:[\"HOST\"],override:!0},p={name:\"loggerMiddleware\",tags:[\"LOGGER\"],step:\"initialize\",override:!0},m=\"X-Amzn-Trace-Id\",f={step:\"build\",tags:[\"RECURSION_DETECTION\"],name:\"recursionDetectionMiddleware\",override:!0,priority:\"low\"},g=(e,t,i)=>{let n,r,s,o=!1;const a=async()=>{r||(r=e());try{n=await r,s=!0,o=!1}finally{r=void 0}return n};return void 0===t?async e=>(s&&!e?.forceRefresh||(n=await a()),n):async e=>(s&&!e?.forceRefresh||(n=await a()),o?n:i&&!i(n)?(o=!0,n):t(n)?(await a(),n):n)};i(4079);const v={},S={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();1===t.length&&(t=`0${t}`),v[e]=t,S[t]=e}function b(e){let t=\"\";for(let i=0;i0x8000000000000000||e<-0x8000000000000000)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let i=7,n=Math.abs(Math.round(e));i>-1&&n>0;i--,n/=256)t[i]=n;return e<0&&w(t),new y(t)}valueOf(){const e=this.bytes.slice(0),t=128&e[0];return t&&w(e),parseInt(b(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function w(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,0===e[t]);t--);}class C{constructor(e,t){this.toUtf8=e,this.fromUtf8=t}format(e){const t=[];for(const i of Object.keys(e)){const n=this.fromUtf8(i);t.push(Uint8Array.from([n.byteLength]),n,this.formatHeaderValue(e[i]))}const i=new Uint8Array(t.reduce(((e,t)=>e+t.byteLength),0));let n=0;for(const e of t)i.set(e,n),n+=e.byteLength;return i}formatHeaderValue(e){switch(e.type){case\"boolean\":return Uint8Array.from([e.value?0:1]);case\"byte\":return Uint8Array.from([2,e.value]);case\"short\":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case\"integer\":const i=new DataView(new ArrayBuffer(5));return i.setUint8(0,4),i.setInt32(1,e.value,!1),new Uint8Array(i.buffer);case\"long\":const n=new Uint8Array(9);return n[0]=5,n.set(e.value.bytes,1),n;case\"binary\":const r=new DataView(new ArrayBuffer(3+e.value.byteLength));r.setUint8(0,6),r.setUint16(1,e.value.byteLength,!1);const s=new Uint8Array(r.buffer);return s.set(e.value,3),s;case\"string\":const o=this.fromUtf8(e.value),a=new DataView(new ArrayBuffer(3+o.byteLength));a.setUint8(0,7),a.setUint16(1,o.byteLength,!1);const c=new Uint8Array(a.buffer);return c.set(o,3),c;case\"timestamp\":const d=new Uint8Array(9);return d[0]=8,d.set(y.fromNumber(e.value.valueOf()).bytes,1),d;case\"uuid\":if(!R.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const l=new Uint8Array(17);return l[0]=9,l.set(function(e){if(e.length%2!=0)throw new Error(\"Hex encoded strings must have an even number length\");const t=new Uint8Array(e.length/2);for(let i=0;i{if(\"function\"==typeof e)return e;const t=Promise.resolve(e);return()=>t},N=e=>new TextDecoder(\"utf-8\").decode(e),F=e=>(new TextEncoder).encode(e),B=e=>\"string\"==typeof e?F(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),L=\"X-Amz-Date\",U=\"X-Amz-Signature\",V=\"X-Amz-Security-Token\",j=\"authorization\",z=L.toLowerCase(),$=[j,z,\"date\"],W=U.toLowerCase(),H=\"x-amz-content-sha256\",q=V.toLowerCase(),K={authorization:!0,\"cache-control\":!0,connection:!0,expect:!0,from:!0,\"keep-alive\":!0,\"max-forwards\":!0,pragma:!0,referer:!0,te:!0,trailer:!0,\"transfer-encoding\":!0,upgrade:!0,\"user-agent\":!0,\"x-amzn-trace-id\":!0},G=/^proxy-/,J=/^sec-/,Q=\"AWS4-HMAC-SHA256\",Z=\"AWS4-HMAC-SHA256-PAYLOAD\",X=\"aws4_request\",Y={},ee=[],te=(e,t,i)=>`${e}/${t}/${i}/${X}`,ie=(e,t,i)=>{const n=new e(t);return n.update(B(i)),n.digest()},ne=({headers:e},t,i)=>{const n={};for(const r of Object.keys(e).sort()){if(null==e[r])continue;const s=r.toLowerCase();(s in K||t?.has(s)||G.test(s)||J.test(s))&&(!i||i&&!i.has(s))||(n[s]=e[r].trim().replace(/\\s+/g,\" \"))}return n},re=e=>encodeURIComponent(e).replace(/[!'()*]/g,se),se=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`,oe=async({headers:e,body:t},i)=>{for(const t of Object.keys(e))if(t.toLowerCase()===H)return e[t];if(null==t)return\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\";if(\"string\"==typeof t||ArrayBuffer.isView(t)||(n=t,\"function\"==typeof ArrayBuffer&&n instanceof ArrayBuffer||\"[object ArrayBuffer]\"===Object.prototype.toString.call(n))){const e=new i;return e.update(B(t)),b(await e.digest())}var n;return\"UNSIGNED-PAYLOAD\"},ae=({headers:e,query:t,...i})=>({...i,headers:{...e},query:t?ce(t):void 0}),ce=e=>Object.keys(e).reduce(((t,i)=>{const n=e[i];return{...t,[i]:Array.isArray(n)?[...n]:n}}),{}),de=e=>{e=\"function\"==typeof e.clone?e.clone():ae(e);for(const t of Object.keys(e.headers))$.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e};class le{constructor({applyChecksum:e,credentials:t,region:i,service:n,sha256:r,uriEscapePath:s=!0}){this.headerMarshaller=new C(N,F),this.service=n,this.sha256=r,this.uriEscapePath=s,this.applyChecksum=\"boolean\"!=typeof e||e,this.regionProvider=D(i),this.credentialProvider=D(t)}async presign(e,t={}){const{signingDate:i=new Date,expiresIn:n=3600,unsignableHeaders:r,unhoistableHeaders:s,signableHeaders:o,signingRegion:a,signingService:c}=t,d=await this.credentialProvider();this.validateResolvedCredentials(d);const l=a??await this.regionProvider(),{longDate:u,shortDate:h}=ue(i);if(n>604800)return Promise.reject(\"Signature version 4 presigned URLs must have an expiration date less than one week in the future\");const p=te(h,l,c??this.service),m=((e,t={})=>{const{headers:i,query:n={}}=\"function\"==typeof e.clone?e.clone():ae(e);for(const e of Object.keys(i)){const r=e.toLowerCase();\"x-amz-\"!==r.slice(0,6)||t.unhoistableHeaders?.has(r)||(n[e]=i[e],delete i[e])}return{...e,headers:i,query:n}})(de(e),{unhoistableHeaders:s});d.sessionToken&&(m.query[V]=d.sessionToken),m.query[\"X-Amz-Algorithm\"]=Q,m.query[\"X-Amz-Credential\"]=`${d.accessKeyId}/${p}`,m.query[L]=u,m.query[\"X-Amz-Expires\"]=n.toString(10);const f=ne(m,r,o);return m.query[\"X-Amz-SignedHeaders\"]=he(f),m.query[U]=await this.getSignature(u,p,this.getSigningKey(d,l,h,c),this.createCanonicalRequest(m,f,await oe(e,this.sha256))),m}async sign(e,t){return\"string\"==typeof e?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:i=new Date,priorSignature:n,signingRegion:r,signingService:s}){const o=r??await this.regionProvider(),{shortDate:a,longDate:c}=ue(i),d=te(a,o,s??this.service),l=await oe({headers:{},body:t},this.sha256),u=new this.sha256;u.update(e);const h=b(await u.digest()),p=[Z,c,d,n,h,l].join(\"\\n\");return this.signString(p,{signingDate:i,signingRegion:o,signingService:s})}async signMessage(e,{signingDate:t=new Date,signingRegion:i,signingService:n}){return this.signEvent({headers:this.headerMarshaller.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:i,signingService:n,priorSignature:e.priorSignature}).then((t=>({message:e.message,signature:t})))}async signString(e,{signingDate:t=new Date,signingRegion:i,signingService:n}={}){const r=await this.credentialProvider();this.validateResolvedCredentials(r);const s=i??await this.regionProvider(),{shortDate:o}=ue(t),a=new this.sha256(await this.getSigningKey(r,s,o,n));return a.update(B(e)),b(await a.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:i,unsignableHeaders:n,signingRegion:r,signingService:s}={}){const o=await this.credentialProvider();this.validateResolvedCredentials(o);const a=r??await this.regionProvider(),c=de(e),{longDate:d,shortDate:l}=ue(t),u=te(l,a,s??this.service);c.headers[z]=d,o.sessionToken&&(c.headers[q]=o.sessionToken);const h=await oe(c,this.sha256);!((e,t)=>{e=e.toLowerCase();for(const i of Object.keys(t))if(e===i.toLowerCase())return!0;return!1})(H,c.headers)&&this.applyChecksum&&(c.headers[H]=h);const p=ne(c,n,i),m=await this.getSignature(d,u,this.getSigningKey(o,a,l,s),this.createCanonicalRequest(c,p,h));return c.headers[j]=`${Q} Credential=${o.accessKeyId}/${u}, SignedHeaders=${he(p)}, Signature=${m}`,c}createCanonicalRequest(e,t,i){const n=Object.keys(t).sort();return`${e.method}\\n${this.getCanonicalPath(e)}\\n${(({query:e={}})=>{const t=[],i={};for(const n of Object.keys(e).sort()){if(n.toLowerCase()===W)continue;t.push(n);const r=e[n];\"string\"==typeof r?i[n]=`${re(n)}=${re(r)}`:Array.isArray(r)&&(i[n]=r.slice(0).sort().reduce(((e,t)=>e.concat([`${re(n)}=${re(t)}`])),[]).join(\"&\"))}return t.map((e=>i[e])).filter((e=>e)).join(\"&\")})(e)}\\n${n.map((e=>`${e}:${t[e]}`)).join(\"\\n\")}\\n\\n${n.join(\";\")}\\n${i}`}async createStringToSign(e,t,i){const n=new this.sha256;n.update(B(i));const r=await n.digest();return`${Q}\\n${e}\\n${t}\\n${b(r)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const i of e.split(\"/\"))0!==i?.length&&\".\"!==i&&(\"..\"===i?t.pop():t.push(i));const i=`${e?.startsWith(\"/\")?\"/\":\"\"}${t.join(\"/\")}${t.length>0&&e?.endsWith(\"/\")?\"/\":\"\"}`;return encodeURIComponent(i).replace(/%2F/g,\"/\")}return e}async getSignature(e,t,i,n){const r=await this.createStringToSign(e,t,n),s=new this.sha256(await i);return s.update(B(r)),b(await s.digest())}getSigningKey(e,t,i,n){return(async(e,t,i,n,r)=>{const s=`${i}:${n}:${r}:${b(await ie(e,t.secretAccessKey,t.accessKeyId))}:${t.sessionToken}`;if(s in Y)return Y[s];for(ee.push(s);ee.length>50;)delete Y[ee.shift()];let o=`AWS4${t.secretAccessKey}`;for(const t of[i,n,r,X])o=await ie(e,o,t);return Y[s]=o})(this.sha256,e,i,t,n||this.service)}validateResolvedCredentials(e){if(\"object\"!=typeof e||\"string\"!=typeof e.accessKeyId||\"string\"!=typeof e.secretAccessKey)throw new Error(\"Resolved credential object is not valid\")}}const ue=e=>{const t=(i=e,(e=>\"number\"==typeof e?new Date(1e3*e):\"string\"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e)(i).toISOString().replace(/\\.\\d{3}Z$/,\"Z\")).replace(/[\\-:]/g,\"\");var i;return{longDate:t,shortDate:t.slice(0,8)}},he=e=>Object.keys(e).sort().join(\";\"),pe=e=>new Date(Date.now()+e),me=(e,t)=>{const i=Date.parse(e);return((e,t)=>Math.abs(pe(t).getTime()-e)>=3e5)(i,t)?i-Date.now():t},fe=e=>u.isInstance(e)?e.headers?.date??e.headers?.Date:void 0,ge={name:\"awsAuthMiddleware\",tags:[\"SIGNATURE\",\"AWSAUTH\"],relation:\"after\",toMiddleware:\"retryMiddleware\",override:!0},ve=JSON.parse('{\"partitions\":[{\"id\":\"aws\",\"outputs\":{\"dnsSuffix\":\"amazonaws.com\",\"dualStackDnsSuffix\":\"api.aws\",\"name\":\"aws\",\"supportsDualStack\":true,\"supportsFIPS\":true},\"regionRegex\":\"^(us|eu|ap|sa|ca|me|af)\\\\\\\\-\\\\\\\\w+\\\\\\\\-\\\\\\\\d+$\",\"regions\":{\"af-south-1\":{\"description\":\"Africa (Cape Town)\"},\"ap-east-1\":{\"description\":\"Asia Pacific (Hong Kong)\"},\"ap-northeast-1\":{\"description\":\"Asia Pacific (Tokyo)\"},\"ap-northeast-2\":{\"description\":\"Asia Pacific (Seoul)\"},\"ap-northeast-3\":{\"description\":\"Asia Pacific (Osaka)\"},\"ap-south-1\":{\"description\":\"Asia Pacific (Mumbai)\"},\"ap-south-2\":{\"description\":\"Asia Pacific (Hyderabad)\"},\"ap-southeast-1\":{\"description\":\"Asia Pacific (Singapore)\"},\"ap-southeast-2\":{\"description\":\"Asia Pacific (Sydney)\"},\"ap-southeast-3\":{\"description\":\"Asia Pacific (Jakarta)\"},\"ap-southeast-4\":{\"description\":\"Asia Pacific (Melbourne)\"},\"aws-global\":{\"description\":\"AWS Standard global region\"},\"ca-central-1\":{\"description\":\"Canada (Central)\"},\"eu-central-1\":{\"description\":\"Europe (Frankfurt)\"},\"eu-central-2\":{\"description\":\"Europe (Zurich)\"},\"eu-north-1\":{\"description\":\"Europe (Stockholm)\"},\"eu-south-1\":{\"description\":\"Europe (Milan)\"},\"eu-south-2\":{\"description\":\"Europe (Spain)\"},\"eu-west-1\":{\"description\":\"Europe (Ireland)\"},\"eu-west-2\":{\"description\":\"Europe (London)\"},\"eu-west-3\":{\"description\":\"Europe (Paris)\"},\"me-central-1\":{\"description\":\"Middle East (UAE)\"},\"me-south-1\":{\"description\":\"Middle East (Bahrain)\"},\"sa-east-1\":{\"description\":\"South America (Sao Paulo)\"},\"us-east-1\":{\"description\":\"US East (N. Virginia)\"},\"us-east-2\":{\"description\":\"US East (Ohio)\"},\"us-west-1\":{\"description\":\"US West (N. California)\"},\"us-west-2\":{\"description\":\"US West (Oregon)\"}}},{\"id\":\"aws-cn\",\"outputs\":{\"dnsSuffix\":\"amazonaws.com.cn\",\"dualStackDnsSuffix\":\"api.amazonwebservices.com.cn\",\"name\":\"aws-cn\",\"supportsDualStack\":true,\"supportsFIPS\":true},\"regionRegex\":\"^cn\\\\\\\\-\\\\\\\\w+\\\\\\\\-\\\\\\\\d+$\",\"regions\":{\"aws-cn-global\":{\"description\":\"AWS China global region\"},\"cn-north-1\":{\"description\":\"China (Beijing)\"},\"cn-northwest-1\":{\"description\":\"China (Ningxia)\"}}},{\"id\":\"aws-us-gov\",\"outputs\":{\"dnsSuffix\":\"amazonaws.com\",\"dualStackDnsSuffix\":\"api.aws\",\"name\":\"aws-us-gov\",\"supportsDualStack\":true,\"supportsFIPS\":true},\"regionRegex\":\"^us\\\\\\\\-gov\\\\\\\\-\\\\\\\\w+\\\\\\\\-\\\\\\\\d+$\",\"regions\":{\"aws-us-gov-global\":{\"description\":\"AWS GovCloud (US) global region\"},\"us-gov-east-1\":{\"description\":\"AWS GovCloud (US-East)\"},\"us-gov-west-1\":{\"description\":\"AWS GovCloud (US-West)\"}}},{\"id\":\"aws-iso\",\"outputs\":{\"dnsSuffix\":\"c2s.ic.gov\",\"dualStackDnsSuffix\":\"c2s.ic.gov\",\"name\":\"aws-iso\",\"supportsDualStack\":false,\"supportsFIPS\":true},\"regionRegex\":\"^us\\\\\\\\-iso\\\\\\\\-\\\\\\\\w+\\\\\\\\-\\\\\\\\d+$\",\"regions\":{\"aws-iso-global\":{\"description\":\"AWS ISO (US) global region\"},\"us-iso-east-1\":{\"description\":\"US ISO East\"},\"us-iso-west-1\":{\"description\":\"US ISO WEST\"}}},{\"id\":\"aws-iso-b\",\"outputs\":{\"dnsSuffix\":\"sc2s.sgov.gov\",\"dualStackDnsSuffix\":\"sc2s.sgov.gov\",\"name\":\"aws-iso-b\",\"supportsDualStack\":false,\"supportsFIPS\":true},\"regionRegex\":\"^us\\\\\\\\-isob\\\\\\\\-\\\\\\\\w+\\\\\\\\-\\\\\\\\d+$\",\"regions\":{\"aws-iso-b-global\":{\"description\":\"AWS ISOB (US) global region\"},\"us-isob-east-1\":{\"description\":\"US ISOB East (Ohio)\"}}},{\"id\":\"aws-iso-e\",\"outputs\":{\"dnsSuffix\":\"cloud.adc-e.uk\",\"dualStackDnsSuffix\":\"cloud.adc-e.uk\",\"name\":\"aws-iso-e\",\"supportsDualStack\":false,\"supportsFIPS\":true},\"regionRegex\":\"^eu\\\\\\\\-isoe\\\\\\\\-\\\\\\\\w+\\\\\\\\-\\\\\\\\d+$\",\"regions\":{}},{\"id\":\"aws-iso-f\",\"outputs\":{\"dnsSuffix\":\"csp.hci.ic.gov\",\"dualStackDnsSuffix\":\"csp.hci.ic.gov\",\"name\":\"aws-iso-f\",\"supportsDualStack\":false,\"supportsFIPS\":true},\"regionRegex\":\"^us\\\\\\\\-isof\\\\\\\\-\\\\\\\\w+\\\\\\\\-\\\\\\\\d+$\",\"regions\":{}}],\"version\":\"1.1\"}');let Se=ve,be=\"\";const ye=e=>{const{partitions:t}=Se;for(const i of t){const{regions:t,outputs:n}=i;for(const[i,r]of Object.entries(t))if(i===e)return{...n,...r}}for(const i of t){const{regionRegex:t,outputs:n}=i;if(new RegExp(t).test(e))return{...n}}const i=t.find((e=>\"aws\"===e.id));if(!i)throw new Error(\"Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.\");return{...i.outputs}},we=(e,t=\"\")=>{Se=e,be=t},Ce=()=>{we(ve,\"\")},ke=()=>be,Ee=\"endpoints\";function Ie(e){return\"object\"!=typeof e||null==e?e:\"ref\"in e?`$${Ie(e.ref)}`:\"fn\"in e?`${e.fn}(${(e.argv||[]).map(Ie).join(\", \")})`:JSON.stringify(e,null,2)}class Te extends Error{constructor(e){super(e),this.name=\"EndpointError\"}}const Ae=new RegExp(\"^(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]\\\\d|\\\\d)(?:\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]\\\\d|\\\\d)){3}$\"),Me=e=>Ae.test(e)||e.startsWith(\"[\")&&e.endsWith(\"]\"),xe=new RegExp(\"^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$\"),_e=(e,t=!1)=>{if(!t)return xe.test(e);const i=e.split(\".\");for(const e of i)if(!_e(e))return!1;return!0},Pe=(e,t=!1)=>{if(t){for(const t of e.split(\".\"))if(!Pe(t))return!1;return!0}return!(!_e(e)||e.length<3||e.length>63||e!==e.toLowerCase()||Me(e))},Oe=e=>{const t=e.split(\":\");if(t.length<6)return null;const[i,n,r,s,o,...a]=t;return\"arn\"!==i||\"\"===n||\"\"===r||\"\"===a[0]?null:{partition:n,service:r,region:s,accountId:o,resourceId:a[0].includes(\"/\")?a[0].split(\"/\"):a}},Re=(e,t)=>e===t,De=(e,t)=>(e=>{const t=e.split(\".\"),i=[];for(const n of t){const t=n.indexOf(\"[\");if(-1!==t){if(n.indexOf(\"]\")!==n.length-1)throw new Te(`Path: '${e}' does not end with ']'`);const r=n.slice(t+1,-1);if(Number.isNaN(parseInt(r)))throw new Te(`Invalid array index: '${r}' in path: '${e}'`);0!==t&&i.push(n.slice(0,t)),i.push(r)}else i.push(n)}return i})(t).reduce(((i,n)=>{if(\"object\"!=typeof i)throw new Te(`Index '${n}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(i)?i[parseInt(n)]:i[n]}),e),Ne=e=>null!=e,Fe=e=>!e;var Be;!function(e){e.AAAA=\"AAAA\",e.A=\"A\"}(Be||(Be={}));const Le={[s.HTTP]:80,[s.HTTPS]:443},Ue=e=>{const t=(()=>{try{if(e instanceof URL)return e;if(\"object\"==typeof e&&\"hostname\"in e){const{hostname:t,port:i,protocol:n=\"\",path:r=\"\",query:s={}}=e,o=new URL(`${n}//${t}${i?`:${i}`:\"\"}${r}`);return o.search=Object.entries(s).map((([e,t])=>`${e}=${t}`)).join(\"&\"),o}return new URL(e)}catch(e){return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;const i=t.href,{host:n,hostname:r,pathname:o,protocol:a,search:c}=t;if(c)return null;const d=a.slice(0,-1);if(!Object.values(s).includes(d))return null;const l=Me(r);return{scheme:d,authority:`${n}${i.includes(`${n}:${Le[d]}`)||\"string\"==typeof e&&e.includes(`${n}:${Le[d]}`)?`:${Le[d]}`:\"\"}`,path:o,normalizedPath:o.endsWith(\"/\")?o:`${o}/`,isIp:l}},Ve=(e,t)=>e===t,je=(e,t,i,n)=>t>=i||e.lengthencodeURIComponent(e).replace(/[!*'()]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),$e=(e,t)=>{const i=[],n={...t.endpointParams,...t.referenceRecord};let r=0;for(;r{if(\"string\"==typeof e)return $e(e,i);if(e.fn)return He(e,i);if(e.ref)return(({ref:e},t)=>({...t.endpointParams,...t.referenceRecord}[e]))(e,i);throw new Te(`'${t}': ${String(e)} is not a string, function or reference.`)},He=({fn:e,argv:t},i)=>{const n=t.map((e=>[\"boolean\",\"number\"].includes(typeof e)?e:We(e,\"arg\",i)));return e.split(\".\").reduce(((e,t)=>e[t]),d)(...n)},qe=({assign:e,...t},i)=>{if(e&&e in i.referenceRecord)throw new Te(`'${e}' is already defined in Reference Record.`);const n=He(t,i);return i.logger?.debug?.(Ee,`evaluateCondition: ${Ie(t)} = ${Ie(n)}`),{result:\"\"===n||!!n,...null!=e&&{toAssign:{name:e,value:n}}}},Ke=(e=[],t)=>{const i={};for(const n of e){const{result:e,toAssign:r}=qe(n,{...t,referenceRecord:{...t.referenceRecord,...i}});if(!e)return{result:e};r&&(i[r.name]=r.value,t.logger?.debug?.(Ee,`assign: ${r.name} := ${Ie(r.value)}`))}return{result:!0,referenceRecord:i}},Ge=(e,t)=>Object.entries(e).reduce(((e,[i,n])=>({...e,[i]:n.map((e=>{const n=We(e,\"Header value entry\",t);if(\"string\"!=typeof n)throw new Te(`Header '${i}' value '${n}' is not a string`);return n}))})),{}),Je=(e,t)=>{if(Array.isArray(e))return e.map((e=>Je(e,t)));switch(typeof e){case\"string\":return $e(e,t);case\"object\":if(null===e)throw new Te(`Unexpected endpoint property: ${e}`);return Qe(e,t);case\"boolean\":return e;default:throw new Te(\"Unexpected endpoint property type: \"+typeof e)}},Qe=(e,t)=>Object.entries(e).reduce(((e,[i,n])=>({...e,[i]:Je(n,t)})),{}),Ze=(e,t)=>{const i=We(e,\"Endpoint URL\",t);if(\"string\"==typeof i)try{return new URL(i)}catch(e){throw console.error(`Failed to construct URL with ${i}`,e),e}throw new Te(\"Endpoint URL must be a string, got \"+typeof i)},Xe=(e,t)=>{const{conditions:i,endpoint:n}=e,{result:r,referenceRecord:s}=Ke(i,t);if(!r)return;const o={...t,referenceRecord:{...t.referenceRecord,...s}},{url:a,properties:c,headers:d}=n;return t.logger?.debug?.(Ee,`Resolving endpoint from template: ${Ie(n)}`),{...null!=d&&{headers:Ge(d,o)},...null!=c&&{properties:Qe(c,o)},url:Ze(a,o)}},Ye=(e,t)=>{const{conditions:i,error:n}=e,{result:r,referenceRecord:s}=Ke(i,t);if(r)throw new Te(We(n,\"Error\",{...t,referenceRecord:{...t.referenceRecord,...s}}))},et=(e,t)=>{const{conditions:i,rules:n}=e,{result:r,referenceRecord:s}=Ke(i,t);if(r)return tt(n,{...t,referenceRecord:{...t.referenceRecord,...s}})},tt=(e,t)=>{for(const i of e)if(\"endpoint\"===i.type){const e=Xe(i,t);if(e)return e}else if(\"error\"===i.type)Ye(i,t);else{if(\"tree\"!==i.type)throw new Te(`Unknown endpoint rule: ${i}`);{const e=et(i,t);if(e)return e}}throw new Te(\"Rules evaluation failed\")},it=\"user-agent\",nt=\"x-amz-user-agent\",rt=/[^\\!\\$\\%\\&\\'\\*\\+\\-\\.\\^\\_\\`\\|\\~\\d\\w]/g,st=/[^\\!\\$\\%\\&\\'\\*\\+\\-\\.\\^\\_\\`\\|\\~\\d\\w\\#]/g,ot=e=>{const t=e[0].split(\"/\").map((e=>e.replace(rt,\"-\"))).join(\"/\"),i=e[1]?.replace(st,\"-\"),n=t.indexOf(\"/\"),r=t.substring(0,n);let s=t.substring(n+1);return\"api\"===r&&(s=s.toLowerCase()),[r,s,i].filter((e=>e&&e.length>0)).reduce(((e,t,i)=>{switch(i){case 0:return t;case 1:return`${e}/${t}`;default:return`${e}#${t}`}}),\"\")},at={name:\"getUserAgentMiddleware\",step:\"build\",priority:\"low\",tags:[\"SET_USER_AGENT\",\"USER_AGENT\"],override:!0};var ct;!function(e){e.ENV=\"env\",e.CONFIG=\"shared config entry\"}(ct||(ct={}));const dt=e=>\"string\"==typeof e&&(e.startsWith(\"fips-\")||e.endsWith(\"-fips\")),lt=e=>dt(e)?[\"fips-aws-global\",\"aws-fips\"].includes(e)?\"us-east-1\":e.replace(/fips-(dkr-|prod-)?|-fips/,\"\"):e,ut=\"content-length\",ht={step:\"build\",tags:[\"SET_CONTENT_LENGTH\",\"CONTENT_LENGTH\"],name:\"contentLengthMiddleware\",override:!0},pt={name:\"deserializerMiddleware\",step:\"deserialize\",tags:[\"DESERIALIZER\"],override:!0},mt={name:\"serializerMiddleware\",step:\"serialize\",tags:[\"SERIALIZER\"],override:!0};function ft(e,t,i){return{applyToStack:n=>{n.add(((e,t)=>(i,n)=>async n=>{const{response:r}=await i(n);try{return{response:r,output:await t(r,e)}}catch(e){if(Object.defineProperty(e,\"$response\",{value:r}),!(\"$metadata\"in e)){const t=\"Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.\";e.message+=\"\\n \"+t}throw e}})(e,i),pt),n.add(((e,t)=>(i,n)=>async r=>{const s=n.endpointV2?.url&&e.urlParser?async()=>e.urlParser(n.endpointV2.url):e.endpoint;if(!s)throw new Error(\"No valid endpoint provider available.\");const o=await t(r.input,{...e,endpoint:s});return i({...r,request:o})})(e,t),mt)}}}const gt=/^[a-z0-9][a-z0-9\\.\\-]{1,61}[a-z0-9]$/,vt=/(\\d+\\.){3}\\d+/,St=/\\.\\./,bt=(e,t,i)=>{const n=async()=>{const n=i[e]??i[t];return\"function\"==typeof n?n():n};return\"endpoint\"===e||\"endpoint\"===t?async()=>{const e=await n();if(e&&\"object\"==typeof e){if(\"url\"in e)return e.url.href;if(\"hostname\"in e){const{protocol:t,hostname:i,port:n,path:r}=e;return`${t}//${i}${n?\":\"+n:\"\"}${r}`}}return e}:n},yt=async(e,t,i)=>{const n={},r=t?.getEndpointParameterInstructions?.()||{};for(const[t,s]of Object.entries(r))switch(s.type){case\"staticContextParams\":n[t]=s.value;break;case\"contextParams\":n[t]=e[s.name];break;case\"clientContextParams\":case\"builtInParams\":n[t]=await bt(s.name,t,i)();break;default:throw new Error(\"Unrecognized endpoint parameter instruction: \"+JSON.stringify(s))}return 0===Object.keys(r).length&&Object.assign(n,i),\"s3\"===String(i.serviceId).toLowerCase()&&await(async e=>{const t=e?.Bucket||\"\";if(\"string\"==typeof e.Bucket&&(e.Bucket=t.replace(/#/g,encodeURIComponent(\"#\")).replace(/\\?/g,encodeURIComponent(\"?\"))),(e=>{const[t,i,n,r,s,o]=e.split(\":\"),a=\"arn\"===t&&e.split(\":\").length>=6,c=5===[t,i,n,s,o].filter(Boolean).length;if(a&&!c)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return!!(\"arn\"===t&&i&&n&&s&&o)})(t)){if(!0===e.ForcePathStyle)throw new Error(\"Path-style addressing cannot be used with ARN buckets\")}else i=t,(!gt.test(i)||vt.test(i)||St.test(i)||-1!==t.indexOf(\".\")&&!String(e.Endpoint).startsWith(\"http:\")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);var i;return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e})(n),n},wt={step:\"serialize\",tags:[\"ENDPOINT_PARAMETERS\",\"ENDPOINT_V2\",\"ENDPOINT\"],name:\"endpointV2Middleware\",override:!0,relation:\"before\",toMiddleware:mt.name},Ct=(e,t)=>({applyToStack:i=>{i.addRelativeTo((({config:e,instructions:t})=>(i,n)=>async r=>{const s=await(async(e,t,i,n)=>{const r=await yt(e,t,i);if(\"function\"!=typeof i.endpointProvider)throw new Error(\"config.endpointProvider is not set.\");return i.endpointProvider(r,n)})(r.input,{getEndpointParameterInstructions:()=>t},{...e},n);n.endpointV2=s,n.authSchemes=s.properties?.authSchemes;const o=n.authSchemes?.[0];return o&&(n.signing_region=o.signingRegion,n.signing_service=o.signingName),i({...r})})({config:e,instructions:t}),wt)}}),kt=e=>{if(\"string\"==typeof e)return kt(new URL(e));const{hostname:t,pathname:i,port:n,protocol:r,search:s}=e;let o;return s&&(o=function(e){const t={};if(e=e.replace(/^\\?/,\"\"))for(const i of e.split(\"&\")){let[e,n=null]=i.split(\"=\");e=decodeURIComponent(e),n&&(n=decodeURIComponent(n)),e in t?Array.isArray(t[e])?t[e].push(n):t[e]=[t[e],n]:t[e]=n}return t}(s)),{hostname:t,port:n?parseInt(n):void 0,protocol:r,path:i,query:o}};var Et,It;(It=Et||(Et={})).STANDARD=\"standard\",It.ADAPTIVE=\"adaptive\";const Tt=Et.STANDARD,At=[\"BandwidthLimitExceeded\",\"EC2ThrottledException\",\"LimitExceededException\",\"PriorRequestNotComplete\",\"ProvisionedThroughputExceededException\",\"RequestLimitExceeded\",\"RequestThrottled\",\"RequestThrottledException\",\"SlowDown\",\"ThrottledException\",\"Throttling\",\"ThrottlingException\",\"TooManyRequestsException\",\"TransactionInProgressException\"],Mt=[\"TimeoutError\",\"RequestTimeout\",\"RequestTimeoutException\"],xt=[500,502,503,504],_t=[\"ECONNRESET\",\"ECONNREFUSED\",\"EPIPE\",\"ETIMEDOUT\"],Pt=e=>429===e.$metadata?.httpStatusCode||At.includes(e.name)||1==e.$retryable?.throttling,Ot=e=>Mt.includes(e.name)||_t.includes(e?.code||\"\")||xt.includes(e.$metadata?.httpStatusCode||0);class Rt{constructor(e){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8;const t=this.getCurrentTimeInSeconds();this.lastThrottleTime=t,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.currentCapacity){const t=(e-this.currentCapacity)/this.fillRate*1e3;await new Promise((e=>setTimeout(e,t)))}this.currentCapacity=this.currentCapacity-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp)return void(this.lastTimestamp=e);const t=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+t),this.lastTimestamp=e}updateClientSendingRate(e){let t;if(this.updateMeasuredRate(),Pt(e)){const e=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=e,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(e),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const i=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(i)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(2*e)/2;if(this.requestCount++,t>this.lastTxRateBucket){const e=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(e*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}const Dt=({retryDelay:e,retryCount:t,retryCost:i})=>({getRetryCount:()=>t,getRetryDelay:()=>Math.min(2e4,e),getRetryCost:()=>i});class Nt{constructor(e){this.maxAttempts=e,this.mode=Et.STANDARD,this.capacity=500,this.retryBackoffStrategy=(()=>{let e=100;return{computeNextBackoffDelay:t=>Math.floor(Math.min(2e4,Math.random()*2**t*e)),setDelayBase:t=>{e=t}}})(),this.maxAttemptsProvider=\"function\"==typeof e?e:async()=>e}async acquireInitialRetryToken(e){return Dt({retryDelay:100,retryCount:0})}async refreshRetryTokenForRetry(e,t){const i=await this.getMaxAttempts();if(this.shouldRetry(e,t,i)){const i=t.errorType;this.retryBackoffStrategy.setDelayBase(\"THROTTLING\"===i?500:100);const n=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),r=t.retryAfterHint?Math.max(t.retryAfterHint.getTime()-Date.now()||0,n):n,s=this.getCapacityCost(i);return this.capacity-=s,Dt({retryDelay:r,retryCount:e.getRetryCount()+1,retryCost:s})}throw new Error(\"No retry token available\")}recordSuccess(e){this.capacity=Math.max(500,this.capacity+(e.getRetryCost()??1))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(e){return console.warn(\"Max attempts provider could not resolve. Using default of 3\"),3}}shouldRetry(e,t,i){return e.getRetryCount()+1=this.getCapacityCost(t.errorType)&&this.isRetryableError(t.errorType)}getCapacityCost(e){return\"TRANSIENT\"===e?10:5}isRetryableError(e){return\"THROTTLING\"===e||\"TRANSIENT\"===e}}class Ft{constructor(e,t){this.maxAttemptsProvider=e,this.mode=Et.ADAPTIVE;const{rateLimiter:i}=t??{};this.rateLimiter=i??new Rt,this.standardRetryStrategy=new Nt(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}var Bt,Lt=new Uint8Array(16);function Ut(){if(!Bt&&!(Bt=\"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 Bt(Lt)}const Vt=/^(?:[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 jt=[],zt=0;zt<256;++zt)jt.push((zt+256).toString(16).substr(1));const $t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(jt[e[t+0]]+jt[e[t+1]]+jt[e[t+2]]+jt[e[t+3]]+\"-\"+jt[e[t+4]]+jt[e[t+5]]+\"-\"+jt[e[t+6]]+jt[e[t+7]]+\"-\"+jt[e[t+8]]+jt[e[t+9]]+\"-\"+jt[e[t+10]]+jt[e[t+11]]+jt[e[t+12]]+jt[e[t+13]]+jt[e[t+14]]+jt[e[t+15]]).toLowerCase();if(!function(e){return\"string\"==typeof e&&Vt.test(e)}(i))throw TypeError(\"Stringified UUID is invalid\");return i},Wt=function(e,t,i){var n=(e=e||{}).random||(e.rng||Ut)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(var r=0;r<16;++r)t[i+r]=n[r];return t}return $t(n)},Ht=e=>{const t={errorType:qt(e)},i=Gt(e.$response);return i&&(t.retryAfterHint=i),t},qt=e=>Pt(e)?\"THROTTLING\":Ot(e)?\"TRANSIENT\":(e=>{if(void 0!==e.$metadata?.httpStatusCode){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!Ot(e)}return!1})(e)?\"SERVER_ERROR\":\"CLIENT_ERROR\",Kt={name:\"retryMiddleware\",tags:[\"RETRY\"],step:\"finalizeRequest\",priority:\"high\",override:!0},Gt=e=>{if(!u.isInstance(e))return;const t=Object.keys(e.headers).find((e=>\"retry-after\"===e.toLowerCase()));if(!t)return;const i=e.headers[t],n=Number(i);return Number.isNaN(n)?new Date(i):new Date(1e3*n)};class Jt{trace(){}debug(){}info(){}warn(){}error(){}}const Qt=()=>{let e=[],t=[];const i=new Set,n=i=>(e.forEach((e=>{i.add(e.middleware,{...e})})),t.forEach((e=>{i.addRelativeTo(e.middleware,{...e})})),i),r=e=>{const t=[];return e.before.forEach((e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...r(e))})),t.push(e),e.after.reverse().forEach((e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...r(e))})),t},s=(i=!1)=>{const n=[],s=[],o={};e.forEach((e=>{const t={...e,before:[],after:[]};t.name&&(o[t.name]=t),n.push(t)})),t.forEach((e=>{const t={...e,before:[],after:[]};t.name&&(o[t.name]=t),s.push(t)})),s.forEach((e=>{if(e.toMiddleware){const t=o[e.toMiddleware];if(void 0===t){if(i)return;throw new Error(`${e.toMiddleware} is not found when adding ${e.name||\"anonymous\"} middleware ${e.relation} ${e.toMiddleware}`)}\"after\"===e.relation&&t.after.push(e),\"before\"===e.relation&&t.before.push(e)}}));const a=(c=n,c.sort(((e,t)=>Zt[t.step]-Zt[e.step]||Xt[t.priority||\"normal\"]-Xt[e.priority||\"normal\"]))).map(r).reduce(((e,t)=>(e.push(...t),e)),[]);var c;return a},o={add:(t,n={})=>{const{name:r,override:s}=n,o={step:\"initialize\",priority:\"normal\",middleware:t,...n};if(r){if(i.has(r)){if(!s)throw new Error(`Duplicate middleware name '${r}'`);const t=e.findIndex((e=>e.name===r)),i=e[t];if(i.step!==o.step||i.priority!==o.priority)throw new Error(`\"${r}\" middleware with ${i.priority} priority in ${i.step} step cannot be overridden by same-name middleware with ${o.priority} priority in ${o.step} step.`);e.splice(t,1)}i.add(r)}e.push(o)},addRelativeTo:(e,n)=>{const{name:r,override:s}=n,o={middleware:e,...n};if(r){if(i.has(r)){if(!s)throw new Error(`Duplicate middleware name '${r}'`);const e=t.findIndex((e=>e.name===r)),i=t[e];if(i.toMiddleware!==o.toMiddleware||i.relation!==o.relation)throw new Error(`\"${r}\" middleware ${i.relation} \"${i.toMiddleware}\" middleware cannot be overridden by same-name middleware ${o.relation} \"${o.toMiddleware}\" middleware.`);t.splice(e,1)}i.add(r)}t.push(o)},clone:()=>n(Qt()),use:e=>{e.applyToStack(o)},remove:n=>\"string\"==typeof n?(n=>{let r=!1;const s=e=>!e.name||e.name!==n||(r=!0,i.delete(n),!1);return e=e.filter(s),t=t.filter(s),r})(n):(n=>{let r=!1;const s=e=>e.middleware!==n||(r=!0,e.name&&i.delete(e.name),!1);return e=e.filter(s),t=t.filter(s),r})(n),removeByTag:n=>{let r=!1;const s=e=>{const{tags:t,name:s}=e;return!t||!t.includes(n)||(s&&i.delete(s),r=!0,!1)};return e=e.filter(s),t=t.filter(s),r},concat:e=>{const t=n(Qt());return t.use(e),t},applyToStack:n,identify:()=>s(!0).map((e=>e.name+\": \"+(e.tags||[]).join(\",\"))),resolve:(e,t)=>{for(const i of s().map((e=>e.middleware)).reverse())e=i(e,t);return e}};return o},Zt={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Xt={high:3,normal:2,low:1};class Yt{constructor(e){this.middlewareStack=Qt(),this.config=e}send(e,t,i){const n=\"function\"!=typeof t?t:void 0,r=\"function\"==typeof t?t:i,s=e.resolveMiddleware(this.middlewareStack,this.config,n);if(!r)return s(e).then((e=>e.output));s(e).then((e=>r(null,e.output)),(e=>r(e))).catch((()=>{}))}destroy(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()}}const ei={},ti=new Array(64);for(let e=0,t=\"A\".charCodeAt(0),i=\"Z\".charCodeAt(0);e+t<=i;e++){const i=String.fromCharCode(e+t);ei[i]=e,ti[e]=i}for(let e=0,t=\"a\".charCodeAt(0),i=\"z\".charCodeAt(0);e+t<=i;e++){const i=String.fromCharCode(e+t),n=e+26;ei[i]=n,ti[n]=i}for(let e=0;e<10;e++){ei[e.toString(10)]=e+52;const t=e.toString(10),i=e+52;ei[t]=i,ti[i]=t}ei[\"+\"]=62,ti[62]=\"+\",ei[\"/\"]=63,ti[63]=\"/\";const ii=e=>{let t=e.length/4*3;\"==\"===e.slice(-2)?t-=2:\"=\"===e.slice(-1)&&t--;const i=new ArrayBuffer(t),n=new DataView(i);for(let t=0;t>=6;const s=t/4*3;i>>=r%8;const o=Math.floor(r/8);for(let e=0;e>t)}}return new Uint8Array(i)};function ni(e){let t=\"\";for(let i=0;i>i]}t+=\"==\".slice(0,4-s)}return t}class ri extends Uint8Array{static fromString(e,t=\"utf-8\"){if(\"string\"==typeof e)return function(e,t){return\"base64\"===t?ri.mutate(ii(e)):ri.mutate(F(e))}(e,t);throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}static mutate(e){return Object.setPrototypeOf(e,ri.prototype),e}transformToString(e=\"utf-8\"){return function(e,t=\"utf-8\"){return\"base64\"===t?ni(e):N(e)}(this,e)}}function si(e=0){return new Promise(((t,i)=>{e&&setTimeout((()=>{const t=new Error(`Request did not complete within ${e} ms`);t.name=\"TimeoutError\",i(t)}),e)}))}class oi{constructor(e){\"function\"==typeof e?this.configProvider=e().then((e=>e||{})):(this.config=e??{},this.configProvider=Promise.resolve(this.config))}destroy(){}async handle(e,{abortSignal:t}={}){this.config||(this.config=await this.configProvider);const i=this.config.requestTimeout;if(t?.aborted){const e=new Error(\"Request aborted\");return e.name=\"AbortError\",Promise.reject(e)}let n=e.path;const r=function(e){const t=[];for(let i of Object.keys(e).sort()){const n=e[i];if(i=re(i),Array.isArray(n))for(let e=0,r=n.length;e{const t=e.headers,i={};for(const e of t.entries())i[e[0]]=e[1];return null!=e.body?{response:new u({headers:i,reason:e.statusText,statusCode:e.status,body:e.body})}:e.blob().then((t=>({response:new u({headers:i,reason:e.statusText,statusCode:e.status,body:t})})))})),si(i)];return t&&h.push(new Promise(((e,i)=>{t.onabort=()=>{const e=new Error(\"Request aborted\");e.name=\"AbortError\",i(e)}}))),Promise.race(h)}}const ai=e=>\"function\"==typeof Blob&&e instanceof Blob?async function(e){const t=await function(e){return new Promise(((t,i)=>{const n=new FileReader;n.onloadend=()=>{if(2!==n.readyState)return i(new Error(\"Reader aborted too early\"));const e=n.result??\"\",r=e.indexOf(\",\"),s=r>-1?r+1:e.length;t(e.substring(s))},n.onabort=()=>i(new Error(\"Read aborted\")),n.onerror=()=>i(n.error),n.readAsDataURL(e)}))}(e),i=ii(t);return new Uint8Array(i)}(e):async function(e){let t=new Uint8Array(0);const i=e.getReader();let n=!1;for(;!n;){const{done:e,value:r}=await i.read();if(r){const e=t;t=new Uint8Array(e.length+r.length),t.set(e),t.set(r,e.length)}n=e}return t}(e),ci=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return ri.mutate(e);if(!e)return ri.mutate(new Uint8Array);const i=t.streamCollector(e);return ri.mutate(await i)};class di{constructor(){this.middlewareStack=Qt()}}const li=\"***SensitiveInformation***\",ui=e=>{if(null!=e){if(\"number\"==typeof e){if(0!==e&&1!==e||bi.warn(Si(`Expected boolean, got ${typeof e}: ${e}`)),0===e)return!1;if(1===e)return!0}if(\"string\"==typeof e){const t=e.toLowerCase();if(\"false\"!==t&&\"true\"!==t||bi.warn(Si(`Expected boolean, got ${typeof e}: ${e}`)),\"false\"===t)return!1;if(\"true\"===t)return!0}if(\"boolean\"==typeof e)return e;throw new TypeError(`Expected boolean, got ${typeof e}: ${e}`)}},hi=e=>{if(null!=e){if(\"string\"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&bi.warn(Si(`Expected number but observed string: ${e}`)),t}if(\"number\"==typeof e)return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},pi=(Math.ceil(2**127*(2-2**-23)),(e,t)=>{if(null==e){if(t)throw new TypeError(`Expected a non-null value for ${t}`);throw new TypeError(\"Expected a non-null value\")}return e}),mi=e=>{if(null==e)return;if(\"object\"==typeof e&&!Array.isArray(e))return e;const t=Array.isArray(e)?\"array\":typeof e;throw new TypeError(`Expected object, got ${t}: ${e}`)},fi=e=>{if(null!=e){if(\"string\"==typeof e)return e;if([\"boolean\",\"number\",\"bigint\"].includes(typeof e))return bi.warn(Si(`Expected string, got ${typeof e}: ${e}`)),String(e);throw new TypeError(`Expected string, got ${typeof e}: ${e}`)}},gi=/(-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)|(-?Infinity)|(NaN)/g,vi=e=>{const t=e.match(gi);if(null===t||t[0].length!==e.length)throw new TypeError(\"Expected real number, got implicit NaN\");return parseFloat(e)},Si=e=>String(new TypeError(e).stack||e).split(\"\\n\").slice(0,5).filter((e=>!e.includes(\"stackTraceWarning\"))).join(\"\\n\"),bi={warn:console.warn},yi=e=>{if(null==e)return;let t;if(\"number\"==typeof e)t=e;else{if(\"string\"!=typeof e)throw new TypeError(\"Epoch timestamps must be expressed as floating point numbers or their string representation\");t=(e=>hi(\"string\"==typeof e?vi(e):e))(e)}if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError(\"Epoch timestamps must be valid, non-Infinite, non-NaN numerics\");return new Date(Math.round(1e3*t))};class wi extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,wi.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}}const Ci=(e,t={})=>{Object.entries(t).filter((([,e])=>void 0!==e)).forEach((([t,i])=>{null!=e[t]&&\"\"!==e[t]||(e[t]=i)}));const i=e.message||e.Message||\"UnknownError\";return e.message=i,delete e.Message,e},ki=e=>{switch(e){case\"standard\":case\"cross-region\":return{retryMode:\"standard\",connectionTimeout:3100};case\"in-region\":return{retryMode:\"standard\",connectionTimeout:1100};case\"mobile\":return{retryMode:\"standard\",connectionTimeout:3e4};default:return{}}},Ei=function(){const e=Object.getPrototypeOf(this).constructor,t=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(t,e.prototype),t};function Ii(e,t,i){let n,r,s;if(void 0===t&&void 0===i)n={},s=e;else{if(n=e,\"function\"==typeof t)return r=t,s=i,Ai(n,r,s);s=t}for(const e of Object.keys(s))Array.isArray(s[e])?Mi(n,null,s,e):n[e]=s[e];return n}Ei.prototype=Object.create(String.prototype,{constructor:{value:Ei,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(Ei,String);const Ti=(e,t)=>{const i={};for(const n in t)Mi(i,e,t,n);return i},Ai=(e,t,i)=>Ii(e,Object.entries(i).reduce(((e,[i,n])=>(Array.isArray(n)?e[i]=n:e[i]=\"function\"==typeof n?[t,n()]:[t,n],e)),{})),Mi=(e,t,i,n)=>{if(null!==t){let r=i[n];\"function\"==typeof r&&(r=[,r]);const[s=xi,o=_i,a=n]=r;return void((\"function\"==typeof s&&s(t[a])||\"function\"!=typeof s&&s)&&(e[n]=o(t[a])))}let[r,s]=i[n];if(\"function\"==typeof s){let t;const i=void 0===r&&null!=(t=s()),o=\"function\"==typeof r&&!!r(void 0)||\"function\"!=typeof r&&!!r;i?e[n]=t:o&&(e[n]=s())}else{const t=void 0===r&&null!=s,i=\"function\"==typeof r&&!!r(s)||\"function\"!=typeof r&&!!r;(t||i)&&(e[n]=s)}},xi=e=>null!=e,_i=e=>e;function Pi(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return\"%\"+e.charCodeAt(0).toString(16).toUpperCase()}))}const Oi=(e,t,i,n,r,s)=>{if(null==t||void 0===t[i])throw new Error(\"No value provided for input HTTP label: \"+i+\".\");{const t=n();if(t.length<=0)throw new Error(\"Empty value provided for input HTTP label: \"+i+\".\");e=e.replace(r,s?t.split(\"/\").map((e=>Pi(e))).join(\"/\"):Pi(t))}return e},Ri=e=>{if(null==e)return{};if(Array.isArray(e))return e.filter((e=>null!=e));if(\"object\"==typeof e){const t={};for(const i of Object.keys(e))null!=e[i]&&(t[i]=Ri(e[i]));return t}return e};var Di=i(7643),Ni=i(1206),Fi=i.n(Ni);const Bi=({serviceId:e,clientVersion:t})=>async()=>{const i=\"undefined\"!=typeof window&&window?.navigator?.userAgent?Fi().parse(window.navigator.userAgent):void 0,n=[[\"aws-sdk-js\",t],[\"ua\",\"2.0\"],[`os/${i?.os?.name||\"other\"}`,i?.os?.version],[\"lang/js\"],[\"md/browser\",`${i?.browser?.name??\"unknown\"}_${i?.browser?.version??\"unknown\"}`]];return e&&n.push([`api/${e}`,t]),n},Li=e=>{if(\"string\"==typeof e){let t=e.length;for(let i=t-1;i>=0;i--){const n=e.charCodeAt(i);n>127&&n<=2047?t++:n>2047&&n<=65535&&(t+=2),n>=56320&&n<=57343&&i--}return t}if(\"number\"==typeof e.byteLength)return e.byteLength;if(\"number\"==typeof e.size)return e.size;throw new Error(`Body Length computation failed for ${e}`)},Ui=\"required\",Vi=\"fn\",ji=\"argv\",zi=\"ref\",$i=\"isSet\",Wi=\"tree\",Hi=\"error\",qi=\"endpoint\",Ki=\"PartitionResult\",Gi={[Ui]:!1,type:\"String\"},Ji={[Ui]:!0,default:!1,type:\"Boolean\"},Qi={[zi]:\"Endpoint\"},Zi={[Vi]:\"booleanEquals\",[ji]:[{[zi]:\"UseFIPS\"},!0]},Xi={[Vi]:\"booleanEquals\",[ji]:[{[zi]:\"UseDualStack\"},!0]},Yi={},en={[Vi]:\"booleanEquals\",[ji]:[!0,{[Vi]:\"getAttr\",[ji]:[{[zi]:Ki},\"supportsFIPS\"]}]},tn={[Vi]:\"booleanEquals\",[ji]:[!0,{[Vi]:\"getAttr\",[ji]:[{[zi]:Ki},\"supportsDualStack\"]}]},nn=[Zi],rn=[Xi],sn=[{[zi]:\"Region\"}],on={version:\"1.0\",parameters:{Region:Gi,UseDualStack:Ji,UseFIPS:Ji,Endpoint:Gi},rules:[{conditions:[{[Vi]:$i,[ji]:[Qi]}],type:Wi,rules:[{conditions:nn,error:\"Invalid Configuration: FIPS and custom endpoint are not supported\",type:Hi},{type:Wi,rules:[{conditions:rn,error:\"Invalid Configuration: Dualstack and custom endpoint are not supported\",type:Hi},{endpoint:{url:Qi,properties:Yi,headers:Yi},type:qi}]}]},{type:Wi,rules:[{conditions:[{[Vi]:$i,[ji]:sn}],type:Wi,rules:[{conditions:[{[Vi]:\"aws.partition\",[ji]:sn,assign:Ki}],type:Wi,rules:[{conditions:[Zi,Xi],type:Wi,rules:[{conditions:[en,tn],type:Wi,rules:[{type:Wi,rules:[{endpoint:{url:\"https://messaging-chime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\",properties:Yi,headers:Yi},type:qi}]}]},{error:\"FIPS and DualStack are enabled, but this partition does not support one or both\",type:Hi}]},{conditions:nn,type:Wi,rules:[{conditions:[en],type:Wi,rules:[{type:Wi,rules:[{endpoint:{url:\"https://messaging-chime-fips.{Region}.{PartitionResult#dnsSuffix}\",properties:Yi,headers:Yi},type:qi}]}]},{error:\"FIPS is enabled but this partition does not support FIPS\",type:Hi}]},{conditions:rn,type:Wi,rules:[{conditions:[tn],type:Wi,rules:[{type:Wi,rules:[{endpoint:{url:\"https://messaging-chime.{Region}.{PartitionResult#dualStackDnsSuffix}\",properties:Yi,headers:Yi},type:qi}]}]},{error:\"DualStack is enabled but this partition does not support DualStack\",type:Hi}]},{type:Wi,rules:[{endpoint:{url:\"https://messaging-chime.{Region}.{PartitionResult#dnsSuffix}\",properties:Yi,headers:Yi},type:qi}]}]}]},{error:\"Invalid Configuration: Missing Region\",type:Hi}]}]},an=(e,t={})=>((e,t)=>{const{endpointParams:i,logger:n}=t,{parameters:r,rules:s}=e;t.logger?.debug?.(`${Ee} Initial EndpointParams: ${Ie(i)}`);const o=Object.entries(r).filter((([,e])=>null!=e.default)).map((([e,t])=>[e,t.default]));if(o.length>0)for(const[e,t]of o)i[e]=i[e]??t;const a=Object.entries(r).filter((([,e])=>e.required)).map((([e])=>e));for(const e of a)if(null==i[e])throw new Te(`Missing required parameter: '${e}'`);const c=tt(s,{endpointParams:i,logger:n,referenceRecord:{}});if(t.endpointParams?.Endpoint)try{const e=new URL(t.endpointParams.Endpoint),{protocol:i,port:n}=e;c.url.protocol=i,c.url.port=n}catch(e){}return t.logger?.debug?.(`${Ee} Resolved endpoint: ${Ie(c)}`),c})(on,{endpointParams:e,logger:t.logger}),cn=[\"in-region\",\"cross-region\",\"mobile\",\"standard\",\"legacy\"],dn=e=>{const t=(({defaultsMode:e}={})=>g((async()=>{const t=\"function\"==typeof e?await e():e;switch(t?.toLowerCase()){case\"auto\":return Promise.resolve((()=>{const e=\"undefined\"!=typeof window&&window?.navigator?.userAgent?Fi().parse(window.navigator.userAgent):void 0,t=e?.platform?.type;return\"tablet\"===t||\"mobile\"===t})()?\"mobile\":\"standard\");case\"mobile\":case\"in-region\":case\"cross-region\":case\"standard\":case\"legacy\":return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve(\"legacy\");default:throw new Error(`Invalid parameter for \"defaultsMode\", expect ${cn.join(\", \")}, got ${t}`)}})))(e),i=()=>t().then(ki),n=(e=>({apiVersion:\"2021-05-15\",base64Decoder:e?.base64Decoder??ii,base64Encoder:e?.base64Encoder??ni,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??an,logger:e?.logger??new Jt,serviceId:e?.serviceId??\"Chime SDK Messaging\",urlParser:e?.urlParser??kt,utf8Decoder:e?.utf8Decoder??F,utf8Encoder:e?.utf8Encoder??N}))(e);return{...n,...e,runtime:\"browser\",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??Li,credentialDefaultProvider:e?.credentialDefaultProvider??(e=>()=>Promise.reject(new Error(\"Credential is missing\"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??Bi({serviceId:n.serviceId,clientVersion:\"3.370.0\"}),maxAttempts:e?.maxAttempts??3,region:e?.region??(\"Region is missing\",()=>Promise.reject(\"Region is missing\")),requestHandler:e?.requestHandler??new oi(i),retryMode:e?.retryMode??(async()=>(await i()).retryMode||Tt),sha256:e?.sha256??Di.Sha256,streamCollector:e?.streamCollector??ai,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(!1)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(!1))}};class ln extends Yt{constructor(e){var t;const i=(e=>{const{region:t,useFipsEndpoint:i}=e;if(!t)throw new Error(\"Region is missing\");return{...e,region:async()=>{if(\"string\"==typeof t)return lt(t);const e=await t();return lt(e)},useFipsEndpoint:async()=>{const e=\"string\"==typeof t?t:await t();return!!dt(e)||(\"function\"!=typeof i?Promise.resolve(!!i):i())}}})((t=dn(e),{...t,useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:\"chime\"})),n=(e=>{const{retryStrategy:t}=e,i=D(e.maxAttempts??3);return{...e,maxAttempts:i,retryStrategy:async()=>t||(await D(e.retryMode)()===Et.ADAPTIVE?new Ft(i):new Nt(i))}})((e=>{const t=e.tls??!0,{endpoint:i}=e,n=null!=i?async()=>(e=>\"object\"==typeof e?\"url\"in e?kt(e.url):e:kt(e))(await D(i)()):void 0,r=!!i;return{...e,endpoint:n,tls:t,isCustomEndpoint:r,useDualstackEndpoint:D(e.useDualstackEndpoint??!1),useFipsEndpoint:D(e.useFipsEndpoint??!1)}})(i)),r=(e=>{const t=e.credentials?\"function\"==typeof(s=e.credentials)?g(s,(e=>void 0!==e.expiration&&e.expiration.getTime()-Date.now()<3e5),(e=>void 0!==e.expiration)):D(s):e.credentialDefaultProvider(e),{signingEscapePath:i=!0,systemClockOffset:n=e.systemClockOffset||0,sha256:r}=e;var s;let o;return o=e.signer?D(e.signer):e.regionInfoProvider?()=>D(e.region)().then((async t=>[await e.regionInfoProvider(t,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},t])).then((([n,s])=>{const{signingRegion:o,signingService:a}=n;e.signingRegion=e.signingRegion||o||s,e.signingName=e.signingName||a||e.serviceId;const c={...e,credentials:t,region:e.signingRegion,service:e.signingName,sha256:r,uriEscapePath:i};return new(e.signerConstructor||le)(c)})):async n=>{const s=(n=Object.assign({},{name:\"sigv4\",signingName:e.signingName||e.defaultSigningName,signingRegion:await D(e.region)(),properties:{}},n)).signingRegion,o=n.signingName;e.signingRegion=e.signingRegion||s,e.signingName=e.signingName||o||e.serviceId;const a={...e,credentials:t,region:e.signingRegion,service:e.signingName,sha256:r,uriEscapePath:i};return new(e.signerConstructor||le)(a)},{...e,systemClockOffset:n,signingEscapePath:i,credentials:t,signer:o}})(n),s=(o=r,{...o,customUserAgent:\"string\"==typeof o.customUserAgent?[[o.customUserAgent]]:o.customUserAgent});var o,a;super(s),this.config=s,this.middlewareStack.use((e=>({applyToStack:t=>{t.add((e=>(t,i)=>async n=>{let r=await e.retryStrategy();const s=await e.maxAttempts();if(!(e=>void 0!==e.acquireInitialRetryToken&&void 0!==e.refreshRetryTokenForRetry&&void 0!==e.recordSuccess)(r))return r?.mode&&(i.userAgent=[...i.userAgent||[],[\"cfg/retry-mode\",r.mode]]),r.retry(t,n);{let e=await r.acquireInitialRetryToken(i.partition_id),a=new Error,c=0,d=0;const{request:u}=n;for(l.isInstance(u)&&(u.headers[\"amz-sdk-invocation-id\"]=Wt());;)try{l.isInstance(u)&&(u.headers[\"amz-sdk-request\"]=`attempt=${c+1}; max=${s}`);const{response:i,output:o}=await t(n);return r.recordSuccess(e),o.$metadata.attempts=c+1,o.$metadata.totalRetryDelay=d,{response:i,output:o}}catch(t){const i=Ht(t);a=(o=t)instanceof Error?o:o instanceof Object?Object.assign(new Error,o):\"string\"==typeof o?new Error(o):new Error(`AWS SDK error wrapper for ${o}`);try{e=await r.refreshRetryTokenForRetry(e,i)}catch(e){throw a.$metadata||(a.$metadata={}),a.$metadata.attempts=c+1,a.$metadata.totalRetryDelay=d,a}c=e.getRetryCount();const n=e.getRetryDelay();d+=n,await new Promise((e=>setTimeout(e,n)))}}var o})(e),Kt)}}))(this.config)),this.middlewareStack.use((e=>({applyToStack:t=>{var i;t.add((i=e.bodyLengthChecker,e=>async t=>{const n=t.request;if(l.isInstance(n)){const{body:e,headers:t}=n;if(e&&-1===Object.keys(t).map((e=>e.toLowerCase())).indexOf(ut))try{const t=i(e);n.headers={...n.headers,[ut]:String(t)}}catch(e){}}return e({...t,request:n})}),ht)}}))(this.config)),this.middlewareStack.use((e=>({applyToStack:t=>{t.add((e=>t=>async i=>{if(!l.isInstance(i.request))return t(i);const{request:n}=i,{handlerProtocol:r=\"\"}=e.requestHandler.metadata||{};if(r.indexOf(\"h2\")>=0&&!n.headers[\":authority\"])delete n.headers.host,n.headers[\":authority\"]=\"\";else if(!n.headers.host){let e=n.hostname;null!=n.port&&(e+=`:${n.port}`),n.headers.host=e}return t(i)})(e),h)}}))(this.config)),this.middlewareStack.use((this.config,{applyToStack:e=>{e.add(((e,t)=>async i=>{try{const n=await e(i),{clientName:r,commandName:s,logger:o,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:c,overrideOutputFilterSensitiveLog:d}=a,l=c??t.inputFilterSensitiveLog,u=d??t.outputFilterSensitiveLog,{$metadata:h,...p}=n.output;return o?.info?.({clientName:r,commandName:s,input:l(i.input),output:u(p),metadata:h}),n}catch(e){const{clientName:n,commandName:r,logger:s,dynamoDbDocumentClientOptions:o={}}=t,{overrideInputFilterSensitiveLog:a}=o,c=a??t.inputFilterSensitiveLog;throw s?.error?.({clientName:n,commandName:r,input:c(i.input),error:e,metadata:e.$metadata}),e}}),p)}})),this.middlewareStack.use((e=>({applyToStack:t=>{t.add((e=>t=>async i=>{const{request:n}=i;if(!l.isInstance(n)||\"node\"!==e.runtime||n.headers.hasOwnProperty(m))return t(i);const r=process.env.AWS_LAMBDA_FUNCTION_NAME,s=process.env._X_AMZN_TRACE_ID,o=e=>\"string\"==typeof e&&e.length>0;return o(r)&&o(s)&&(n.headers[m]=s),t({...i,request:n})})(e),f)}}))(this.config)),this.middlewareStack.use((e=>({applyToStack:t=>{t.addRelativeTo((e=>(t,i)=>async function(n){if(!l.isInstance(n.request))return t(n);const r=i.endpointV2?.properties?.authSchemes?.[0],s=\"sigv4a\"===r?.name?r?.signingRegionSet?.join(\",\"):void 0,o=await e.signer(r),a=await t({...n,request:await o.sign(n.request,{signingDate:pe(e.systemClockOffset),signingRegion:s||i.signing_region,signingService:i.signing_service})}).catch((t=>{const i=t.ServerTime??fe(t.$response);throw i&&(e.systemClockOffset=me(i,e.systemClockOffset)),t})),c=fe(a.response);return c&&(e.systemClockOffset=me(c,e.systemClockOffset)),a})(e),ge)}}))(this.config)),this.middlewareStack.use((a=this.config,{applyToStack:e=>{var t;e.add((t=a,(e,i)=>async n=>{const{request:r}=n;if(!l.isInstance(r))return e(n);const{headers:s}=r,o=i?.userAgent?.map(ot)||[],a=(await t.defaultUserAgentProvider()).map(ot),c=t?.customUserAgent?.map(ot)||[],d=ke(),u=(d?[d]:[]).concat([...a,...o,...c]).join(\" \"),h=[...a.filter((e=>e.startsWith(\"aws-sdk-\"))),...c].join(\" \");return\"browser\"!==t.runtime?(h&&(s[nt]=s[nt]?`${s[it]} ${h}`:h),s[it]=u):s[nt]=u,e({...n,request:r})}),at)}}))}destroy(){super.destroy()}}class un extends wi{constructor(e){super(e),Object.setPrototypeOf(this,un.prototype)}}const hn={ALL:\"ALL\",FILTERED:\"FILTERED\",NONE:\"NONE\"},pn={DEFAULT:\"DEFAULT\",HIDDEN:\"HIDDEN\"},mn={AccessDenied:\"AccessDenied\",BadRequest:\"BadRequest\",Conflict:\"Conflict\",Forbidden:\"Forbidden\",NotFound:\"NotFound\",PhoneNumberAssociationsExist:\"PhoneNumberAssociationsExist\",PreconditionFailed:\"PreconditionFailed\",ResourceLimitExceeded:\"ResourceLimitExceeded\",ServiceFailure:\"ServiceFailure\",ServiceUnavailable:\"ServiceUnavailable\",Throttled:\"Throttled\",Throttling:\"Throttling\",Unauthorized:\"Unauthorized\",Unprocessable:\"Unprocessable\",VoiceConnectorGroupAssociationsExist:\"VoiceConnectorGroupAssociationsExist\"};class fn extends un{constructor(e){super({name:\"BadRequestException\",$fault:\"client\",...e}),this.name=\"BadRequestException\",this.$fault=\"client\",Object.setPrototypeOf(this,fn.prototype),this.Code=e.Code,this.Message=e.Message}}class gn extends un{constructor(e){super({name:\"ConflictException\",$fault:\"client\",...e}),this.name=\"ConflictException\",this.$fault=\"client\",Object.setPrototypeOf(this,gn.prototype),this.Code=e.Code,this.Message=e.Message}}class vn extends un{constructor(e){super({name:\"ForbiddenException\",$fault:\"client\",...e}),this.name=\"ForbiddenException\",this.$fault=\"client\",Object.setPrototypeOf(this,vn.prototype),this.Code=e.Code,this.Message=e.Message}}class Sn extends un{constructor(e){super({name:\"NotFoundException\",$fault:\"client\",...e}),this.name=\"NotFoundException\",this.$fault=\"client\",Object.setPrototypeOf(this,Sn.prototype),this.Code=e.Code,this.Message=e.Message}}class bn extends un{constructor(e){super({name:\"ServiceFailureException\",$fault:\"server\",...e}),this.name=\"ServiceFailureException\",this.$fault=\"server\",Object.setPrototypeOf(this,bn.prototype),this.Code=e.Code,this.Message=e.Message}}class yn extends un{constructor(e){super({name:\"ServiceUnavailableException\",$fault:\"server\",...e}),this.name=\"ServiceUnavailableException\",this.$fault=\"server\",Object.setPrototypeOf(this,yn.prototype),this.Code=e.Code,this.Message=e.Message}}class wn extends un{constructor(e){super({name:\"ThrottledClientException\",$fault:\"client\",...e}),this.name=\"ThrottledClientException\",this.$fault=\"client\",Object.setPrototypeOf(this,wn.prototype),this.Code=e.Code,this.Message=e.Message}}class Cn extends un{constructor(e){super({name:\"UnauthorizedClientException\",$fault:\"client\",...e}),this.name=\"UnauthorizedClientException\",this.$fault=\"client\",Object.setPrototypeOf(this,Cn.prototype),this.Code=e.Code,this.Message=e.Message}}class kn extends un{constructor(e){super({name:\"ResourceLimitExceededException\",$fault:\"client\",...e}),this.name=\"ResourceLimitExceededException\",this.$fault=\"client\",Object.setPrototypeOf(this,kn.prototype),this.Code=e.Code,this.Message=e.Message}}const En={CREATED_TIMESTAMP:\"CREATED_TIMESTAMP\",LAST_MESSAGE_TIMESTAMP:\"LAST_MESSAGE_TIMESTAMP\"},In={RESTRICTED:\"RESTRICTED\",UNRESTRICTED:\"UNRESTRICTED\"},Tn={PRIVATE:\"PRIVATE\",PUBLIC:\"PUBLIC\"},An={ASYNC:\"ASYNC\"},Mn={ABORT:\"ABORT\",CONTINUE:\"CONTINUE\"},xn={DEFAULT:\"DEFAULT\",VOIP:\"VOIP\"},_n={NON_PERSISTENT:\"NON_PERSISTENT\",PERSISTENT:\"PERSISTENT\"},Pn={DENIED:\"DENIED\",FAILED:\"FAILED\",PENDING:\"PENDING\",SENT:\"SENT\"},On={CONTROL:\"CONTROL\",STANDARD:\"STANDARD\"},Rn={Channel:\"Channel\",ChannelMessage:\"ChannelMessage\"},Dn={ASCENDING:\"ASCENDING\",DESCENDING:\"DESCENDING\"},Nn={MEMBERS:\"MEMBERS\"},Fn={EQUALS:\"EQUALS\",INCLUDES:\"INCLUDES\"},Bn=e=>({...e,...e.Name&&{Name:li}}),Ln=e=>({...e,...e.InvitedBy&&{InvitedBy:Bn(e.InvitedBy)},...e.Members&&{Members:e.Members.map((e=>Bn(e)))}}),Un=e=>({...e,...e.BatchChannelMemberships&&{BatchChannelMemberships:Ln(e.BatchChannelMemberships)}}),Vn=e=>({...e,...e.Name&&{Name:li},...e.Metadata&&{Metadata:li},...e.CreatedBy&&{CreatedBy:Bn(e.CreatedBy)}}),jn=e=>({...e,...e.Name&&{Name:li},...e.Metadata&&{Metadata:li}}),zn=e=>({...e,...e.Member&&{Member:Bn(e.Member)},...e.CreatedBy&&{CreatedBy:Bn(e.CreatedBy)}}),$n=e=>({...e,...e.Member&&{Member:Bn(e.Member)}}),Wn=e=>({...e,...e.Name&&{Name:li}}),Hn=e=>({...e,...e.Processors&&{Processors:e.Processors.map((e=>Wn(e)))},...e.Name&&{Name:li}}),qn=e=>({...e,...e.StringValues&&{StringValues:li}}),Kn=e=>({...e,...e.Title&&{Title:li},...e.Body&&{Body:li}}),Gn=e=>({...e,...e.Content&&{Content:li},...e.Metadata&&{Metadata:li},...e.PushNotification&&{PushNotification:Kn(e.PushNotification)},...e.MessageAttributes&&{MessageAttributes:Object.entries(e.MessageAttributes).reduce(((e,[t,i])=>(e[t]=qn(i),e)),{})},...e.ContentType&&{ContentType:li}}),Jn=e=>({...e,...e.ChannelMessage&&{ChannelMessage:Gn(e.ChannelMessage)}}),Qn=e=>({...e,...e.Name&&{Name:li},...e.Processors&&{Processors:e.Processors.map((e=>Wn(e)))}}),Zn=e=>({...e,...e.InvitedBy&&{InvitedBy:Bn(e.InvitedBy)},...e.Member&&{Member:Bn(e.Member)}}),Xn=e=>({...e,...e.Name&&{Name:li},...e.Metadata&&{Metadata:li}}),Yn=e=>({...e,...e.ChannelSummary&&{ChannelSummary:Xn(e.ChannelSummary)}}),er=e=>({...e,...e.FilterRule&&{FilterRule:li}}),tr=e=>({...e,...e.PushNotifications&&{PushNotifications:er(e.PushNotifications)}}),ir=e=>({...e,...e.Member&&{Member:Bn(e.Member)}}),nr=e=>({...e,...e.Content&&{Content:li},...e.Metadata&&{Metadata:li},...e.Sender&&{Sender:Bn(e.Sender)},...e.MessageAttributes&&{MessageAttributes:Object.entries(e.MessageAttributes).reduce(((e,[t,i])=>(e[t]=qn(i),e)),{})},...e.ContentType&&{ContentType:li}}),rr=e=>({...e,...e.Content&&{Content:li},...e.Metadata&&{Metadata:li},...e.Sender&&{Sender:Bn(e.Sender)},...e.MessageAttributes&&{MessageAttributes:Object.entries(e.MessageAttributes).reduce(((e,[t,i])=>(e[t]=qn(i),e)),{})},...e.ContentType&&{ContentType:li}}),sr=e=>({...e,...e.ChannelSummary&&{ChannelSummary:Xn(e.ChannelSummary)}}),or=e=>({...e,...e.Moderator&&{Moderator:Bn(e.Moderator)},...e.CreatedBy&&{CreatedBy:Bn(e.CreatedBy)}}),ar=e=>({...e,...e.Moderator&&{Moderator:Bn(e.Moderator)}}),cr=e=>({...e,...e.Key&&{Key:li},...e.Value&&{Value:li}}),dr=e=>({...e,...e.Name&&{Name:li},...e.Metadata&&{Metadata:li},...e.ClientRequestToken&&{ClientRequestToken:li},...e.Tags&&{Tags:e.Tags.map((e=>cr(e)))},...e.ChannelId&&{ChannelId:li}}),lr=e=>({...e,...e.Member&&{Member:Bn(e.Member)}}),ur=e=>({...e,...e.Processors&&{Processors:e.Processors.map((e=>Wn(e)))},...e.Name&&{Name:li},...e.Tags&&{Tags:e.Tags.map((e=>cr(e)))},...e.ClientRequestToken&&{ClientRequestToken:li}}),hr=e=>({...e,...e.Member&&{Member:Bn(e.Member)}}),pr=e=>({...e,...e.ChannelModerator&&{ChannelModerator:Bn(e.ChannelModerator)}}),mr=e=>({...e,...e.Channel&&{Channel:Vn(e.Channel)}}),fr=e=>({...e,...e.ChannelBan&&{ChannelBan:zn(e.ChannelBan)}}),gr=e=>({...e,...e.ChannelFlow&&{ChannelFlow:Hn(e.ChannelFlow)}}),vr=e=>({...e,...e.ChannelMembership&&{ChannelMembership:Zn(e.ChannelMembership)}}),Sr=e=>({...e,...e.ChannelMembership&&{ChannelMembership:Yn(e.ChannelMembership)}}),br=e=>({...e,...e.Channel&&{Channel:sr(e.Channel)}}),yr=e=>({...e,...e.ChannelModerator&&{ChannelModerator:or(e.ChannelModerator)}}),wr=e=>({...e,...e.Member&&{Member:Bn(e.Member)},...e.Preferences&&{Preferences:tr(e.Preferences)}}),Cr=e=>({...e,...e.ChannelMessage&&{ChannelMessage:nr(e.ChannelMessage)}}),kr=e=>({...e,...e.NextToken&&{NextToken:li}}),Er=e=>({...e,...e.NextToken&&{NextToken:li},...e.ChannelBans&&{ChannelBans:e.ChannelBans.map((e=>$n(e)))}}),Ir=e=>({...e,...e.NextToken&&{NextToken:li}}),Tr=e=>({...e,...e.ChannelFlows&&{ChannelFlows:e.ChannelFlows.map((e=>Qn(e)))},...e.NextToken&&{NextToken:li}}),Ar=e=>({...e,...e.NextToken&&{NextToken:li}}),Mr=e=>({...e,...e.ChannelMemberships&&{ChannelMemberships:e.ChannelMemberships.map((e=>ir(e)))},...e.NextToken&&{NextToken:li}}),xr=e=>({...e,...e.NextToken&&{NextToken:li}}),_r=e=>({...e,...e.ChannelMemberships&&{ChannelMemberships:e.ChannelMemberships.map((e=>Yn(e)))},...e.NextToken&&{NextToken:li}}),Pr=e=>({...e,...e.NextToken&&{NextToken:li}}),Or=e=>({...e,...e.NextToken&&{NextToken:li},...e.ChannelMessages&&{ChannelMessages:e.ChannelMessages.map((e=>rr(e)))}}),Rr=e=>({...e,...e.NextToken&&{NextToken:li}}),Dr=e=>({...e,...e.NextToken&&{NextToken:li},...e.ChannelModerators&&{ChannelModerators:e.ChannelModerators.map((e=>ar(e)))}}),Nr=e=>({...e,...e.NextToken&&{NextToken:li}}),Fr=e=>({...e,...e.Channels&&{Channels:e.Channels.map((e=>Xn(e)))},...e.NextToken&&{NextToken:li}}),Br=e=>({...e,...e.NextToken&&{NextToken:li}}),Lr=e=>({...e,...e.Channels&&{Channels:e.Channels.map((e=>jn(e)))},...e.NextToken&&{NextToken:li}}),Ur=e=>({...e,...e.NextToken&&{NextToken:li}}),Vr=e=>({...e,...e.Channels&&{Channels:e.Channels.map((e=>sr(e)))},...e.NextToken&&{NextToken:li}}),jr=e=>({...e,...e.NextToken&&{NextToken:li}}),zr=e=>({...e,...e.NextToken&&{NextToken:li}}),$r=e=>({...e,...e.Tags&&{Tags:e.Tags.map((e=>cr(e)))}}),Wr=e=>({...e,...e.Preferences&&{Preferences:tr(e.Preferences)}}),Hr=e=>({...e,...e.Member&&{Member:Bn(e.Member)},...e.Preferences&&{Preferences:tr(e.Preferences)}}),qr=e=>({...e,...e.NextToken&&{NextToken:li}}),Kr=e=>({...e,...e.Channels&&{Channels:e.Channels.map((e=>Xn(e)))},...e.NextToken&&{NextToken:li}}),Gr=e=>({...e,...e.Content&&{Content:li},...e.Metadata&&{Metadata:li},...e.ClientRequestToken&&{ClientRequestToken:li},...e.PushNotification&&{PushNotification:Kn(e.PushNotification)},...e.MessageAttributes&&{MessageAttributes:Object.entries(e.MessageAttributes).reduce(((e,[t,i])=>(e[t]=qn(i),e)),{})},...e.ContentType&&{ContentType:li}}),Jr=e=>({...e,...e.Tags&&{Tags:e.Tags.map((e=>cr(e)))}}),Qr=e=>({...e,...e.TagKeys&&{TagKeys:li}}),Zr=e=>({...e,...e.Name&&{Name:li},...e.Metadata&&{Metadata:li}}),Xr=e=>({...e,...e.Processors&&{Processors:e.Processors.map((e=>Wn(e)))},...e.Name&&{Name:li}}),Yr=e=>({...e,...e.Content&&{Content:li},...e.Metadata&&{Metadata:li},...e.ContentType&&{ContentType:li}}),es=(ts=un,({output:e,parsedBody:t,errorCode:i})=>{(({output:e,parsedBody:t,exceptionCtor:i,errorCode:n})=>{const r=(e=>({httpStatusCode:e.statusCode,requestId:e.headers[\"x-amzn-requestid\"]??e.headers[\"x-amzn-request-id\"]??e.headers[\"x-amz-request-id\"],extendedRequestId:e.headers[\"x-amz-id-2\"],cfId:e.headers[\"x-amz-cf-id\"]}))(e),s=r.httpStatusCode?r.httpStatusCode+\"\":void 0,o=new i({name:t?.code||t?.Code||n||s||\"UnknownError\",$fault:\"client\",$metadata:r});throw Ci(o,t)})({output:e,parsedBody:t,exceptionCtor:ts,errorCode:i})});var ts;const is=async(e,t)=>{const i=Ii({}),n=e.body,r=Ti(n,{Code:fi,Message:fi});Object.assign(i,r);const s=new fn({$metadata:fs(e),...i});return Ci(s,e.body)},ns=async(e,t)=>{const i=Ii({}),n=e.body,r=Ti(n,{Code:fi,Message:fi});Object.assign(i,r);const s=new gn({$metadata:fs(e),...i});return Ci(s,e.body)},rs=async(e,t)=>{const i=Ii({}),n=e.body,r=Ti(n,{Code:fi,Message:fi});Object.assign(i,r);const s=new vn({$metadata:fs(e),...i});return Ci(s,e.body)},ss=async(e,t)=>{const i=Ii({}),n=e.body,r=Ti(n,{Code:fi,Message:fi});Object.assign(i,r);const s=new Sn({$metadata:fs(e),...i});return Ci(s,e.body)},os=async(e,t)=>{const i=Ii({}),n=e.body,r=Ti(n,{Code:fi,Message:fi});Object.assign(i,r);const s=new kn({$metadata:fs(e),...i});return Ci(s,e.body)},as=async(e,t)=>{const i=Ii({}),n=e.body,r=Ti(n,{Code:fi,Message:fi});Object.assign(i,r);const s=new bn({$metadata:fs(e),...i});return Ci(s,e.body)},cs=async(e,t)=>{const i=Ii({}),n=e.body,r=Ti(n,{Code:fi,Message:fi});Object.assign(i,r);const s=new yn({$metadata:fs(e),...i});return Ci(s,e.body)},ds=async(e,t)=>{const i=Ii({}),n=e.body,r=Ti(n,{Code:fi,Message:fi});Object.assign(i,r);const s=new wn({$metadata:fs(e),...i});return Ci(s,e.body)},ls=async(e,t)=>{const i=Ii({}),n=e.body,r=Ti(n,{Code:fi,Message:fi});Object.assign(i,r);const s=new Cn({$metadata:fs(e),...i});return Ci(s,e.body)},us=(e,t)=>Ti(e,{AppInstanceUserMembershipSummary:e=>((e,t)=>Ti(e,{ReadMarkerTimestamp:e=>pi(yi(hi(e))),SubChannelId:fi,Type:fi}))(e),ChannelSummary:e=>ps(e,t)}),hs=(e,t)=>Ti(e,{ChannelSummary:e=>ps(e,t)}),ps=(e,t)=>Ti(e,{ChannelArn:fi,LastMessageTimestamp:e=>pi(yi(hi(e))),Metadata:fi,Mode:fi,Name:fi,Privacy:fi}),ms=(e,t)=>{const i=(e||[]).filter((e=>null!=e)).map((e=>ps(e,t)));return i},fs=e=>({httpStatusCode:e.statusCode,requestId:e.headers[\"x-amzn-requestid\"]??e.headers[\"x-amzn-request-id\"]??e.headers[\"x-amz-request-id\"],extendedRequestId:e.headers[\"x-amz-id-2\"],cfId:e.headers[\"x-amz-cf-id\"]}),gs=e=>!(null==e||\"\"===e||Object.getOwnPropertyNames(e).includes(\"length\")&&0==e.length||Object.getOwnPropertyNames(e).includes(\"size\")&&0==e.size),vs=(e,t)=>((e,t)=>ci(e,t).then((e=>t.utf8Encoder(e))))(e,t).then((e=>e.length?JSON.parse(e):{})),Ss=async(e,t)=>{const i=await vs(e,t);return i.message=i.message??i.Message,i},bs=(e,t)=>{const i=e=>{let t=e;return\"number\"==typeof t&&(t=t.toString()),t.indexOf(\",\")>=0&&(t=t.split(\",\")[0]),t.indexOf(\":\")>=0&&(t=t.split(\":\")[0]),t.indexOf(\"#\")>=0&&(t=t.split(\"#\")[1]),t},n=(r=e.headers,\"x-amzn-errortype\",Object.keys(r).find((e=>e.toLowerCase()===\"x-amzn-errortype\".toLowerCase())));var r;return void 0!==n?i(e.headers[n]):void 0!==t.code?i(t.code):void 0!==t.__type?i(t.__type):void 0};class ys extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,ys.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"AssociateChannelFlowCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer});let a,c=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/channel-flow`;return c=Oi(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=JSON.stringify(Ti(e,{ChannelFlowArn:[]})),new l({protocol:n,hostname:i,port:r,method:\"PUT\",headers:o,path:c,body:a})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await ss(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)});return await ci(e.body,t),i})(e,t)}}class ws extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,ws.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"BatchCreateChannelMembershipCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:Un},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/memberships`;a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Ii({operation:[,\"batch-create\"]});let d;return d=JSON.stringify(Ti(e,{MemberArns:e=>Ri(e),SubChannelId:[],Type:[]})),new l({protocol:n,hostname:i,port:r,method:\"POST\",headers:o,path:a,query:c,body:d})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await ss(i,t);case\"ResourceLimitExceededException\":case\"com.amazonaws.chimesdkmessaging#ResourceLimitExceededException\":throw await os(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{BatchChannelMemberships:Ri,Errors:Ri});return Object.assign(i,r),i})(e,t)}}class Cs extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Cs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ChannelFlowCallbackCommand\",inputFilterSensitiveLog:Jn,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint();let o=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}`;o=Oi(o,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const a=Ii({operation:[,\"channel-flow-callback\"]});let c;return c=JSON.stringify(Ti(e,{CallbackId:[!0,e=>e??Wt()],ChannelMessage:e=>Ri(e),DeleteResource:[]})),new l({protocol:n,hostname:i,port:r,method:\"POST\",headers:{\"content-type\":\"application/json\"},path:o,query:a,body:c})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{CallbackId:fi,ChannelArn:fi});return Object.assign(i,r),i})(e,t)}}class ks extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,ks.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"CreateChannelBanCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:lr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer});let a,c=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/bans`;return c=Oi(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=JSON.stringify(Ti(e,{MemberArn:[]})),new l({protocol:n,hostname:i,port:r,method:\"POST\",headers:o,path:c,body:a})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(201!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ResourceLimitExceededException\":case\"com.amazonaws.chimesdkmessaging#ResourceLimitExceededException\":throw await os(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi,Member:Ri});return Object.assign(i,r),i})(e,t)}}class Es extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Es.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"CreateChannelCommand\",inputFilterSensitiveLog:dr,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer}),a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels`;let c;return c=JSON.stringify(Ti(e,{AppInstanceArn:[],ChannelId:[],ClientRequestToken:[!0,e=>e??Wt()],ElasticChannelConfiguration:e=>Ri(e),ExpirationSettings:e=>Ri(e),MemberArns:e=>Ri(e),Metadata:[],Mode:[],ModeratorArns:e=>Ri(e),Name:[],Privacy:[],Tags:e=>Ri(e)})),new l({protocol:n,hostname:i,port:r,method:\"POST\",headers:o,path:a,body:c})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(201!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ResourceLimitExceededException\":case\"com.amazonaws.chimesdkmessaging#ResourceLimitExceededException\":throw await os(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi});return Object.assign(i,r),i})(e,t)}}class Is extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Is.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"CreateChannelFlowCommand\",inputFilterSensitiveLog:ur,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channel-flows`;let a;return a=JSON.stringify(Ti(e,{AppInstanceArn:[],ClientRequestToken:[!0,e=>e??Wt()],Name:[],Processors:e=>Ri(e),Tags:e=>Ri(e)})),new l({protocol:n,hostname:i,port:r,method:\"POST\",headers:{\"content-type\":\"application/json\"},path:o,body:a})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(201!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ResourceLimitExceededException\":case\"com.amazonaws.chimesdkmessaging#ResourceLimitExceededException\":throw await os(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelFlowArn:fi});return Object.assign(i,r),i})(e,t)}}class Ts extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Ts.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"CreateChannelMembershipCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:hr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer});let a,c=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/memberships`;return c=Oi(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=JSON.stringify(Ti(e,{MemberArn:[],SubChannelId:[],Type:[]})),new l({protocol:n,hostname:i,port:r,method:\"POST\",headers:o,path:c,body:a})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(201!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await ss(i,t);case\"ResourceLimitExceededException\":case\"com.amazonaws.chimesdkmessaging#ResourceLimitExceededException\":throw await os(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi,Member:Ri,SubChannelId:fi});return Object.assign(i,r),i})(e,t)}}class As extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,As.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"CreateChannelModeratorCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:pr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer});let a,c=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/moderators`;return c=Oi(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=JSON.stringify(Ti(e,{ChannelModeratorArn:[]})),new l({protocol:n,hostname:i,port:r,method:\"POST\",headers:o,path:c,body:a})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(201!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ResourceLimitExceededException\":case\"com.amazonaws.chimesdkmessaging#ResourceLimitExceededException\":throw await os(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi,ChannelModerator:Ri});return Object.assign(i,r),i})(e,t)}}class Ms extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Ms.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DeleteChannelBanCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/bans/{MemberArn}`;return a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=Oi(a,e,\"MemberArn\",(()=>e.MemberArn),\"{MemberArn}\",!1),new l({protocol:n,hostname:i,port:r,method:\"DELETE\",headers:o,path:a,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(204!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)});return await ci(e.body,t),i})(e,t)}}class xs extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,xs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DeleteChannelCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}`;return a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),new l({protocol:n,hostname:i,port:r,method:\"DELETE\",headers:o,path:a,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(204!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)});return await ci(e.body,t),i})(e,t)}}class _s extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,_s.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DeleteChannelFlowCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint();let o=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channel-flows/{ChannelFlowArn}`;return o=Oi(o,e,\"ChannelFlowArn\",(()=>e.ChannelFlowArn),\"{ChannelFlowArn}\",!1),new l({protocol:n,hostname:i,port:r,method:\"DELETE\",headers:{},path:o,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(204!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)});return await ci(e.body,t),i})(e,t)}}class Ps extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Ps.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DeleteChannelMembershipCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/memberships/{MemberArn}`;a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=Oi(a,e,\"MemberArn\",(()=>e.MemberArn),\"{MemberArn}\",!1);const c=Ii({\"sub-channel-id\":[,e.SubChannelId]});return new l({protocol:n,hostname:i,port:r,method:\"DELETE\",headers:o,path:a,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(204!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)});return await ci(e.body,t),i})(e,t)}}class Os extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Os.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DeleteChannelMessageCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/messages/{MessageId}`;a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=Oi(a,e,\"MessageId\",(()=>e.MessageId),\"{MessageId}\",!1);const c=Ii({\"sub-channel-id\":[,e.SubChannelId]});return new l({protocol:n,hostname:i,port:r,method:\"DELETE\",headers:o,path:a,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(204!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)});return await ci(e.body,t),i})(e,t)}}class Rs extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Rs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DeleteChannelModeratorCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/moderators/{ChannelModeratorArn}`;return a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=Oi(a,e,\"ChannelModeratorArn\",(()=>e.ChannelModeratorArn),\"{ChannelModeratorArn}\",!1),new l({protocol:n,hostname:i,port:r,method:\"DELETE\",headers:o,path:a,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(204!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)});return await ci(e.body,t),i})(e,t)}}class Ds extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Ds.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DeleteMessagingStreamingConfigurationsCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint();let o=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/app-instances/{AppInstanceArn}/streaming-configurations`;return o=Oi(o,e,\"AppInstanceArn\",(()=>e.AppInstanceArn),\"{AppInstanceArn}\",!1),new l({protocol:n,hostname:i,port:r,method:\"DELETE\",headers:{},path:o,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(204!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)});return await ci(e.body,t),i})(e,t)}}class Ns extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Ns.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DescribeChannelBanCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:fr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/bans/{MemberArn}`;return a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=Oi(a,e,\"MemberArn\",(()=>e.MemberArn),\"{MemberArn}\",!1),new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await ss(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelBan:e=>((e,t)=>Ti(e,{ChannelArn:fi,CreatedBy:Ri,CreatedTimestamp:e=>pi(yi(hi(e))),Member:Ri}))(e)});return Object.assign(i,r),i})(e,t)}}class Fs extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Fs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DescribeChannelCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:mr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}`;return a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{Channel:e=>((e,t)=>Ti(e,{ChannelArn:fi,ChannelFlowArn:fi,CreatedBy:Ri,CreatedTimestamp:e=>pi(yi(hi(e))),ElasticChannelConfiguration:Ri,ExpirationSettings:Ri,LastMessageTimestamp:e=>pi(yi(hi(e))),LastUpdatedTimestamp:e=>pi(yi(hi(e))),Metadata:fi,Mode:fi,Name:fi,Privacy:fi}))(e)});return Object.assign(i,r),i})(e,t)}}class Bs extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Bs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DescribeChannelFlowCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:gr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint();let o=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channel-flows/{ChannelFlowArn}`;return o=Oi(o,e,\"ChannelFlowArn\",(()=>e.ChannelFlowArn),\"{ChannelFlowArn}\",!1),new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:{},path:o,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelFlow:e=>((e,t)=>Ti(e,{ChannelFlowArn:fi,CreatedTimestamp:e=>pi(yi(hi(e))),LastUpdatedTimestamp:e=>pi(yi(hi(e))),Name:fi,Processors:Ri}))(e)});return Object.assign(i,r),i})(e,t)}}class Ls extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Ls.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DescribeChannelMembershipCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:vr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/memberships/{MemberArn}`;a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=Oi(a,e,\"MemberArn\",(()=>e.MemberArn),\"{MemberArn}\",!1);const c=Ii({\"sub-channel-id\":[,e.SubChannelId]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await ss(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelMembership:e=>((e,t)=>Ti(e,{ChannelArn:fi,CreatedTimestamp:e=>pi(yi(hi(e))),InvitedBy:Ri,LastUpdatedTimestamp:e=>pi(yi(hi(e))),Member:Ri,SubChannelId:fi,Type:fi}))(e)});return Object.assign(i,r),i})(e,t)}}class Us extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Us.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DescribeChannelMembershipForAppInstanceUserCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:Sr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}`;a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Ii({scope:[,\"app-instance-user-membership\"],\"app-instance-user-arn\":[,pi(e.AppInstanceUserArn,\"AppInstanceUserArn\")]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelMembership:e=>us(e,t)});return Object.assign(i,r),i})(e,t)}}class Vs extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Vs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DescribeChannelModeratedByAppInstanceUserCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:br},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}`;a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Ii({scope:[,\"app-instance-user-moderated-channel\"],\"app-instance-user-arn\":[,pi(e.AppInstanceUserArn,\"AppInstanceUserArn\")]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{Channel:e=>hs(e,t)});return Object.assign(i,r),i})(e,t)}}class js extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,js.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DescribeChannelModeratorCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:yr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/moderators/{ChannelModeratorArn}`;return a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=Oi(a,e,\"ChannelModeratorArn\",(()=>e.ChannelModeratorArn),\"{ChannelModeratorArn}\",!1),new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await ss(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelModerator:e=>((e,t)=>Ti(e,{ChannelArn:fi,CreatedBy:Ri,CreatedTimestamp:e=>pi(yi(hi(e))),Moderator:Ri}))(e)});return Object.assign(i,r),i})(e,t)}}class zs extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,zs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DisassociateChannelFlowCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/channel-flow/{ChannelFlowArn}`;return a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=Oi(a,e,\"ChannelFlowArn\",(()=>e.ChannelFlowArn),\"{ChannelFlowArn}\",!1),new l({protocol:n,hostname:i,port:r,method:\"DELETE\",headers:o,path:a,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(204!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await ss(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)});return await ci(e.body,t),i})(e,t)}}class $s extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,$s.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"GetChannelMembershipPreferencesCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:wr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/memberships/{MemberArn}/preferences`;return a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=Oi(a,e,\"MemberArn\",(()=>e.MemberArn),\"{MemberArn}\",!1),new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi,Member:Ri,Preferences:Ri});return Object.assign(i,r),i})(e,t)}}class Ws extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Ws.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"GetChannelMessageCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:Cr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/messages/{MessageId}`;a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=Oi(a,e,\"MessageId\",(()=>e.MessageId),\"{MessageId}\",!1);const c=Ii({\"sub-channel-id\":[,e.SubChannelId]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await ss(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelMessage:e=>((e,t)=>Ti(e,{ChannelArn:fi,Content:fi,ContentType:fi,CreatedTimestamp:e=>pi(yi(hi(e))),LastEditedTimestamp:e=>pi(yi(hi(e))),LastUpdatedTimestamp:e=>pi(yi(hi(e))),MessageAttributes:Ri,MessageId:fi,Metadata:fi,Persistence:fi,Redacted:ui,Sender:Ri,Status:Ri,SubChannelId:fi,Target:Ri,Type:fi}))(e)});return Object.assign(i,r),i})(e,t)}}class Hs extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Hs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"GetChannelMessageStatusCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/messages/{MessageId}`;a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=Oi(a,e,\"MessageId\",(()=>e.MessageId),\"{MessageId}\",!1);const c=Ii({scope:[,\"message-status\"],\"sub-channel-id\":[,e.SubChannelId]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{Status:Ri});return Object.assign(i,r),i})(e,t)}}class qs extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,qs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"GetMessagingSessionEndpointCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/endpoints/messaging-session`;let a;return a=\"\",new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:{\"content-type\":\"application/json\"},path:o,body:\"\"})})(0,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{Endpoint:Ri});return Object.assign(i,r),i})(e,t)}}class Ks extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Ks.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"GetMessagingStreamingConfigurationsCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint();let o=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/app-instances/{AppInstanceArn}/streaming-configurations`;return o=Oi(o,e,\"AppInstanceArn\",(()=>e.AppInstanceArn),\"{AppInstanceArn}\",!1),new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:{},path:o,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await ss(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{StreamingConfigurations:Ri});return Object.assign(i,r),i})(e,t)}}class Gs extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Gs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelBansCommand\",inputFilterSensitiveLog:kr,outputFilterSensitiveLog:Er},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/bans`;a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Ii({\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi,ChannelBans:Ri,NextToken:fi});return Object.assign(i,r),i})(e,t)}}class Js extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Js.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelFlowsCommand\",inputFilterSensitiveLog:Ir,outputFilterSensitiveLog:Tr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channel-flows`,a=Ii({\"app-instance-arn\":[,pi(e.AppInstanceArn,\"AppInstanceArn\")],\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:{},path:o,query:a,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelFlows:Ri,NextToken:fi});return Object.assign(i,r),i})(e,t)}}class Qs extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Qs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelMembershipsCommand\",inputFilterSensitiveLog:Ar,outputFilterSensitiveLog:Mr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/memberships`;a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Ii({type:[,e.Type],\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken],\"sub-channel-id\":[,e.SubChannelId]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi,ChannelMemberships:Ri,NextToken:fi});return Object.assign(i,r),i})(e,t)}}class Zs extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Zs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelMembershipsForAppInstanceUserCommand\",inputFilterSensitiveLog:xr,outputFilterSensitiveLog:_r},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer}),a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels`,c=Ii({scope:[,\"app-instance-user-memberships\"],\"app-instance-user-arn\":[,e.AppInstanceUserArn],\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelMemberships:e=>((e,t)=>{const i=(e||[]).filter((e=>null!=e)).map((e=>us(e,t)));return i})(e,t),NextToken:fi});return Object.assign(i,r),i})(e,t)}}class Xs extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Xs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelMessagesCommand\",inputFilterSensitiveLog:Pr,outputFilterSensitiveLog:Or},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/messages`;a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Ii({\"sort-order\":[,e.SortOrder],\"not-before\":[()=>void 0!==e.NotBefore,()=>(e.NotBefore.toISOString().split(\".\")[0]+\"Z\").toString()],\"not-after\":[()=>void 0!==e.NotAfter,()=>(e.NotAfter.toISOString().split(\".\")[0]+\"Z\").toString()],\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken],\"sub-channel-id\":[,e.SubChannelId]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi,ChannelMessages:e=>((e,t)=>{const i=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>Ti(e,{Content:fi,ContentType:fi,CreatedTimestamp:e=>pi(yi(hi(e))),LastEditedTimestamp:e=>pi(yi(hi(e))),LastUpdatedTimestamp:e=>pi(yi(hi(e))),MessageAttributes:Ri,MessageId:fi,Metadata:fi,Redacted:ui,Sender:Ri,Status:Ri,Target:Ri,Type:fi}))(e)));return i})(e),NextToken:fi,SubChannelId:fi});return Object.assign(i,r),i})(e,t)}}class Ys extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,Ys.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelModeratorsCommand\",inputFilterSensitiveLog:Rr,outputFilterSensitiveLog:Dr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/moderators`;a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Ii({\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi,ChannelModerators:Ri,NextToken:fi});return Object.assign(i,r),i})(e,t)}}class eo extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,eo.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelsAssociatedWithChannelFlowCommand\",inputFilterSensitiveLog:Br,outputFilterSensitiveLog:Lr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels`,a=Ii({scope:[,\"channel-flow-associations\"],\"channel-flow-arn\":[,pi(e.ChannelFlowArn,\"ChannelFlowArn\")],\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:{},path:o,query:a,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{Channels:Ri,NextToken:fi});return Object.assign(i,r),i})(e,t)}}class to extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,to.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelsCommand\",inputFilterSensitiveLog:Nr,outputFilterSensitiveLog:Fr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer}),a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels`,c=Ii({\"app-instance-arn\":[,pi(e.AppInstanceArn,\"AppInstanceArn\")],privacy:[,e.Privacy],\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{Channels:e=>ms(e,t),NextToken:fi});return Object.assign(i,r),i})(e,t)}}class io extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,io.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelsModeratedByAppInstanceUserCommand\",inputFilterSensitiveLog:Ur,outputFilterSensitiveLog:Vr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer}),a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels`,c=Ii({scope:[,\"app-instance-user-moderated-channels\"],\"app-instance-user-arn\":[,e.AppInstanceUserArn],\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{Channels:e=>((e,t)=>{const i=(e||[]).filter((e=>null!=e)).map((e=>hs(e,t)));return i})(e,t),NextToken:fi});return Object.assign(i,r),i})(e,t)}}class no extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,no.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListSubChannelsCommand\",inputFilterSensitiveLog:jr,outputFilterSensitiveLog:zr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/subchannels`;a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Ii({\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:o,path:a,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi,NextToken:fi,SubChannels:Ri});return Object.assign(i,r),i})(e,t)}}class ro extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,ro.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListTagsForResourceCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:$r},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/tags`,a=Ii({arn:[,pi(e.ResourceARN,\"ResourceARN\")]});return new l({protocol:n,hostname:i,port:r,method:\"GET\",headers:{},path:o,query:a,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{Tags:Ri});return Object.assign(i,r),i})(e,t)}}class so extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,so.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"PutChannelExpirationSettingsCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer});let a,c=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/expiration-settings`;return c=Oi(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=JSON.stringify(Ti(e,{ExpirationSettings:e=>Ri(e)})),new l({protocol:n,hostname:i,port:r,method:\"PUT\",headers:o,path:c,body:a})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi,ExpirationSettings:Ri});return Object.assign(i,r),i})(e,t)}}class oo extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,oo.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"PutChannelMembershipPreferencesCommand\",inputFilterSensitiveLog:Wr,outputFilterSensitiveLog:Hr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer});let a,c=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/memberships/{MemberArn}/preferences`;return c=Oi(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),c=Oi(c,e,\"MemberArn\",(()=>e.MemberArn),\"{MemberArn}\",!1),a=JSON.stringify(Ti(e,{Preferences:e=>Ri(e)})),new l({protocol:n,hostname:i,port:r,method:\"PUT\",headers:o,path:c,body:a})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi,Member:Ri,Preferences:Ri});return Object.assign(i,r),i})(e,t)}}class ao extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,ao.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"PutMessagingStreamingConfigurationsCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint();let o,a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/app-instances/{AppInstanceArn}/streaming-configurations`;return a=Oi(a,e,\"AppInstanceArn\",(()=>e.AppInstanceArn),\"{AppInstanceArn}\",!1),o=JSON.stringify(Ti(e,{StreamingConfigurations:e=>Ri(e)})),new l({protocol:n,hostname:i,port:r,method:\"PUT\",headers:{\"content-type\":\"application/json\"},path:a,body:o})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await ss(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{StreamingConfigurations:Ri});return Object.assign(i,r),i})(e,t)}}class co extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,co.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"RedactChannelMessageCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/messages/{MessageId}`;a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=Oi(a,e,\"MessageId\",(()=>e.MessageId),\"{MessageId}\",!1);const c=Ii({operation:[,\"redact\"]});let d;return d=JSON.stringify(Ti(e,{SubChannelId:[]})),new l({protocol:n,hostname:i,port:r,method:\"POST\",headers:o,path:a,query:c,body:d})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi,MessageId:fi,SubChannelId:fi});return Object.assign(i,r),i})(e,t)}}class lo extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,lo.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"SearchChannelsCommand\",inputFilterSensitiveLog:qr,outputFilterSensitiveLog:Kr},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer}),a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels`,c=Ii({operation:[,\"search\"],\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});let d;return d=JSON.stringify(Ti(e,{Fields:e=>Ri(e)})),new l({protocol:n,hostname:i,port:r,method:\"POST\",headers:o,path:a,query:c,body:d})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{Channels:e=>ms(e,t),NextToken:fi});return Object.assign(i,r),i})(e,t)}}class uo extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,uo.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"SendChannelMessageCommand\",inputFilterSensitiveLog:Gr,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer});let a,c=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/messages`;return c=Oi(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=JSON.stringify(Ti(e,{ClientRequestToken:[!0,e=>e??Wt()],Content:[],ContentType:[],MessageAttributes:e=>Ri(e),Metadata:[],Persistence:[],PushNotification:e=>Ri(e),SubChannelId:[],Target:e=>Ri(e),Type:[]})),new l({protocol:n,hostname:i,port:r,method:\"POST\",headers:o,path:c,body:a})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(201!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi,MessageId:fi,Status:Ri,SubChannelId:fi});return Object.assign(i,r),i})(e,t)}}class ho extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,ho.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"TagResourceCommand\",inputFilterSensitiveLog:Jr,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/tags`,a=Ii({operation:[,\"tag-resource\"]});let c;return c=JSON.stringify(Ti(e,{ResourceARN:[],Tags:e=>Ri(e)})),new l({protocol:n,hostname:i,port:r,method:\"POST\",headers:{\"content-type\":\"application/json\"},path:o,query:a,body:c})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(204!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ResourceLimitExceededException\":case\"com.amazonaws.chimesdkmessaging#ResourceLimitExceededException\":throw await os(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)});return await ci(e.body,t),i})(e,t)}}class po extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,po.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"UntagResourceCommand\",inputFilterSensitiveLog:Qr,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/tags`,a=Ii({operation:[,\"untag-resource\"]});let c;return c=JSON.stringify(Ti(e,{ResourceARN:[],TagKeys:e=>Ri(e)})),new l({protocol:n,hostname:i,port:r,method:\"POST\",headers:{\"content-type\":\"application/json\"},path:o,query:a,body:c})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(204!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)});return await ci(e.body,t),i})(e,t)}}class mo extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,mo.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"UpdateChannelCommand\",inputFilterSensitiveLog:Zr,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer});let a,c=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}`;return c=Oi(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=JSON.stringify(Ti(e,{Metadata:[],Mode:[],Name:[]})),new l({protocol:n,hostname:i,port:r,method:\"PUT\",headers:o,path:c,body:a})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi});return Object.assign(i,r),i})(e,t)}}class fo extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,fo.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"UpdateChannelFlowCommand\",inputFilterSensitiveLog:Xr,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint();let o,a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channel-flows/{ChannelFlowArn}`;return a=Oi(a,e,\"ChannelFlowArn\",(()=>e.ChannelFlowArn),\"{ChannelFlowArn}\",!1),o=JSON.stringify(Ti(e,{Name:[],Processors:e=>Ri(e)})),new l({protocol:n,hostname:i,port:r,method:\"PUT\",headers:{\"content-type\":\"application/json\"},path:a,body:o})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelFlowArn:fi});return Object.assign(i,r),i})(e,t)}}class go extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,go.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"UpdateChannelMessageCommand\",inputFilterSensitiveLog:Yr,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer});let a,c=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/messages/{MessageId}`;return c=Oi(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),c=Oi(c,e,\"MessageId\",(()=>e.MessageId),\"{MessageId}\",!1),a=JSON.stringify(Ti(e,{Content:[],ContentType:[],Metadata:[],SubChannelId:[]})),new l({protocol:n,hostname:i,port:r,method:\"PUT\",headers:o,path:c,body:a})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi,MessageId:fi,Status:Ri,SubChannelId:fi});return Object.assign(i,r),i})(e,t)}}class vo extends di{static getEndpointParameterInstructions(){return{UseFIPS:{type:\"builtInParams\",name:\"useFipsEndpoint\"},Endpoint:{type:\"builtInParams\",name:\"endpoint\"},Region:{type:\"builtInParams\",name:\"region\"},UseDualStack:{type:\"builtInParams\",name:\"useDualstackEndpoint\"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,i){this.middlewareStack.use(ft(t,this.serialize,this.deserialize)),this.middlewareStack.use(Ct(t,vo.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"UpdateChannelReadMarkerCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:o}=t;return n.resolve((e=>o.handle(e.request,i||{})),s)}serialize(e,t){return(async(e,t)=>{const{hostname:i,protocol:n=\"https\",port:r,path:s}=await t.endpoint(),o=Ii({},gs,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/readMarker`;return a=Oi(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),new l({protocol:n,hostname:i,port:r,method:\"PUT\",headers:o,path:a,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const i={...e,body:await Ss(e.body,t)},n=bs(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await is(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await ns(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await rs(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await as(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await cs(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await ds(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await ls(i,t);default:const r=i.body;return es({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Ii({$metadata:fs(e)}),n=pi(mi(await vs(e.body,t)),\"body\"),r=Ti(n,{ChannelArn:fi});return Object.assign(i,r),i})(e,t)}}const So={AssociateChannelFlowCommand:ys,BatchCreateChannelMembershipCommand:ws,ChannelFlowCallbackCommand:Cs,CreateChannelCommand:Es,CreateChannelBanCommand:ks,CreateChannelFlowCommand:Is,CreateChannelMembershipCommand:Ts,CreateChannelModeratorCommand:As,DeleteChannelCommand:xs,DeleteChannelBanCommand:Ms,DeleteChannelFlowCommand:_s,DeleteChannelMembershipCommand:Ps,DeleteChannelMessageCommand:Os,DeleteChannelModeratorCommand:Rs,DeleteMessagingStreamingConfigurationsCommand:Ds,DescribeChannelCommand:Fs,DescribeChannelBanCommand:Ns,DescribeChannelFlowCommand:Bs,DescribeChannelMembershipCommand:Ls,DescribeChannelMembershipForAppInstanceUserCommand:Us,DescribeChannelModeratedByAppInstanceUserCommand:Vs,DescribeChannelModeratorCommand:js,DisassociateChannelFlowCommand:zs,GetChannelMembershipPreferencesCommand:$s,GetChannelMessageCommand:Ws,GetChannelMessageStatusCommand:Hs,GetMessagingSessionEndpointCommand:qs,GetMessagingStreamingConfigurationsCommand:Ks,ListChannelBansCommand:Gs,ListChannelFlowsCommand:Js,ListChannelMembershipsCommand:Qs,ListChannelMembershipsForAppInstanceUserCommand:Zs,ListChannelMessagesCommand:Xs,ListChannelModeratorsCommand:Ys,ListChannelsCommand:to,ListChannelsAssociatedWithChannelFlowCommand:eo,ListChannelsModeratedByAppInstanceUserCommand:io,ListSubChannelsCommand:no,ListTagsForResourceCommand:ro,PutChannelExpirationSettingsCommand:so,PutChannelMembershipPreferencesCommand:oo,PutMessagingStreamingConfigurationsCommand:ao,RedactChannelMessageCommand:co,SearchChannelsCommand:lo,SendChannelMessageCommand:uo,TagResourceCommand:ho,UntagResourceCommand:po,UpdateChannelCommand:mo,UpdateChannelFlowCommand:fo,UpdateChannelMessageCommand:go,UpdateChannelReadMarkerCommand:vo};class bo extends ln{}((e,t)=>{for(const i of Object.keys(e)){const n=e[i],r=async function(e,t,i){const r=new n(e);if(\"function\"==typeof t)this.send(r,t);else{if(\"function\"!=typeof i)return this.send(r,t);if(\"object\"!=typeof t)throw new Error(\"Expected http options but got \"+typeof t);this.send(r,t||{},i)}},s=(i[0].toLowerCase()+i.slice(1)).replace(/Command$/,\"\");t.prototype[s]=r}})(So,bo);const yo=async(e,t,...i)=>await e.send(new Gs(t),...i);async function*wo(e,t,...i){let n,r=e.startingToken||void 0,s=!0;for(;s;){if(t.NextToken=r,t.MaxResults=e.pageSize,!(e.client instanceof ln))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await yo(e.client,t,...i),yield n;const o=r;r=n.NextToken,s=!(!r||e.stopOnSameToken&&r===o)}}const Co=async(e,t,...i)=>await e.send(new Js(t),...i);async function*ko(e,t,...i){let n,r=e.startingToken||void 0,s=!0;for(;s;){if(t.NextToken=r,t.MaxResults=e.pageSize,!(e.client instanceof ln))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await Co(e.client,t,...i),yield n;const o=r;r=n.NextToken,s=!(!r||e.stopOnSameToken&&r===o)}}const Eo=async(e,t,...i)=>await e.send(new Zs(t),...i);async function*Io(e,t,...i){let n,r=e.startingToken||void 0,s=!0;for(;s;){if(t.NextToken=r,t.MaxResults=e.pageSize,!(e.client instanceof ln))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await Eo(e.client,t,...i),yield n;const o=r;r=n.NextToken,s=!(!r||e.stopOnSameToken&&r===o)}}const To=async(e,t,...i)=>await e.send(new Qs(t),...i);async function*Ao(e,t,...i){let n,r=e.startingToken||void 0,s=!0;for(;s;){if(t.NextToken=r,t.MaxResults=e.pageSize,!(e.client instanceof ln))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await To(e.client,t,...i),yield n;const o=r;r=n.NextToken,s=!(!r||e.stopOnSameToken&&r===o)}}const Mo=async(e,t,...i)=>await e.send(new Xs(t),...i);async function*xo(e,t,...i){let n,r=e.startingToken||void 0,s=!0;for(;s;){if(t.NextToken=r,t.MaxResults=e.pageSize,!(e.client instanceof ln))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await Mo(e.client,t,...i),yield n;const o=r;r=n.NextToken,s=!(!r||e.stopOnSameToken&&r===o)}}const _o=async(e,t,...i)=>await e.send(new Ys(t),...i);async function*Po(e,t,...i){let n,r=e.startingToken||void 0,s=!0;for(;s;){if(t.NextToken=r,t.MaxResults=e.pageSize,!(e.client instanceof ln))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await _o(e.client,t,...i),yield n;const o=r;r=n.NextToken,s=!(!r||e.stopOnSameToken&&r===o)}}const Oo=async(e,t,...i)=>await e.send(new eo(t),...i);async function*Ro(e,t,...i){let n,r=e.startingToken||void 0,s=!0;for(;s;){if(t.NextToken=r,t.MaxResults=e.pageSize,!(e.client instanceof ln))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await Oo(e.client,t,...i),yield n;const o=r;r=n.NextToken,s=!(!r||e.stopOnSameToken&&r===o)}}const Do=async(e,t,...i)=>await e.send(new io(t),...i);async function*No(e,t,...i){let n,r=e.startingToken||void 0,s=!0;for(;s;){if(t.NextToken=r,t.MaxResults=e.pageSize,!(e.client instanceof ln))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await Do(e.client,t,...i),yield n;const o=r;r=n.NextToken,s=!(!r||e.stopOnSameToken&&r===o)}}const Fo=async(e,t,...i)=>await e.send(new to(t),...i);async function*Bo(e,t,...i){let n,r=e.startingToken||void 0,s=!0;for(;s;){if(t.NextToken=r,t.MaxResults=e.pageSize,!(e.client instanceof ln))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await Fo(e.client,t,...i),yield n;const o=r;r=n.NextToken,s=!(!r||e.stopOnSameToken&&r===o)}}const Lo=async(e,t,...i)=>await e.send(new no(t),...i);async function*Uo(e,t,...i){let n,r=e.startingToken||void 0,s=!0;for(;s;){if(t.NextToken=r,t.MaxResults=e.pageSize,!(e.client instanceof ln))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await Lo(e.client,t,...i),yield n;const o=r;r=n.NextToken,s=!(!r||e.stopOnSameToken&&r===o)}}const Vo=async(e,t,...i)=>await e.send(new lo(t),...i);async function*jo(e,t,...i){let n,r=e.startingToken||void 0,s=!0;for(;s;){if(t.NextToken=r,t.MaxResults=e.pageSize,!(e.client instanceof ln))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await Vo(e.client,t,...i),yield n;const o=r;r=n.NextToken,s=!(!r||e.stopOnSameToken&&r===o)}}},3538:(e,t,i)=>{\"use strict\";i.r(t),i.d(t,{fromHex:()=>s,toHex:()=>o});const n={},r={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();1===t.length&&(t=`0${t}`),n[e]=t,r[t]=e}function s(e){if(e.length%2!=0)throw new Error(\"Hex encoded strings must have an even number length\");const t=new Uint8Array(e.length/2);for(let i=0;i{\"use strict\";i.r(t),i.d(t,{locateWindow:()=>r});const n={};function r(){return\"undefined\"!=typeof window?window:\"undefined\"!=typeof self?self:n}},470:(e,t,i)=>{\"use strict\";i.r(t),i.d(t,{fromUtf8:()=>n,toUtf8:()=>r});const n=e=>\"function\"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):(e=>{const t=[];for(let i=0,n=e.length;i>6|192,63&n|128);else if(i+1>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else t.push(n>>12|224,n>>6&63|128,63&n|128)}return Uint8Array.from(t)})(e),r=e=>\"function\"==typeof TextDecoder?function(e){return new TextDecoder(\"utf-8\").decode(e)}(e):(e=>{let t=\"\";for(let i=0,n=e.length;ie.toString(16))).join(\"%\");t+=decodeURIComponent(r)}else t+=String.fromCharCode((15&n)<<12|(63&e[++i])<<6|63&e[++i])}return t})(e)},4537:e=>{\"use strict\";e.exports=function(e,t){for(var i=new Array(arguments.length-1),n=0,r=2,s=!0;r{\"use strict\";var i=t;i.length=function(e){var t=e.length;if(!t)return 0;for(var i=0;--t%4>1&&\"=\"===e.charAt(t);)++i;return Math.ceil(3*e.length)/4-i};for(var n=new Array(64),r=new Array(123),s=0;s<64;)r[n[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(e,t,i){for(var r,s=null,o=[],a=0,c=0;t>2],r=(3&d)<<4,c=1;break;case 1:o[a++]=n[r|d>>4],r=(15&d)<<2,c=2;break;case 2:o[a++]=n[r|d>>6],o[a++]=n[63&d],c=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0)}return c&&(o[a++]=n[r],o[a++]=61,1===c&&(o[a++]=61)),s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join(\"\")):String.fromCharCode.apply(String,o.slice(0,a))};var o=\"invalid encoding\";i.decode=function(e,t,i){for(var n,s=i,a=0,c=0;c1)break;if(void 0===(d=r[d]))throw Error(o);switch(a){case 0:n=d,a=1;break;case 1:t[i++]=n<<2|(48&d)>>4,n=d,a=2;break;case 2:t[i++]=(15&n)<<4|(60&d)>>2,n=d,a=3;break;case 3:t[i++]=(3&n)<<6|d,a=0}}if(1===a)throw Error(o);return i-s},i.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},9211:e=>{\"use strict\";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,i){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:i||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var i=this._listeners[e],n=0;n{\"use strict\";function t(e){return\"undefined\"!=typeof Float32Array?function(){var t=new Float32Array([-0]),i=new Uint8Array(t.buffer),n=128===i[3];function r(e,n,r){t[0]=e,n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3]}function s(e,n,r){t[0]=e,n[r]=i[3],n[r+1]=i[2],n[r+2]=i[1],n[r+3]=i[0]}function o(e,n){return i[0]=e[n],i[1]=e[n+1],i[2]=e[n+2],i[3]=e[n+3],t[0]}function a(e,n){return i[3]=e[n],i[2]=e[n+1],i[1]=e[n+2],i[0]=e[n+3],t[0]}e.writeFloatLE=n?r:s,e.writeFloatBE=n?s:r,e.readFloatLE=n?o:a,e.readFloatBE=n?a:o}():function(){function t(e,t,i,n){var r=t<0?1:0;if(r&&(t=-t),0===t)e(1/t>0?0:2147483648,i,n);else if(isNaN(t))e(2143289344,i,n);else if(t>34028234663852886e22)e((r<<31|2139095040)>>>0,i,n);else if(t<11754943508222875e-54)e((r<<31|Math.round(t/1401298464324817e-60))>>>0,i,n);else{var s=Math.floor(Math.log(t)/Math.LN2);e((r<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,i,n)}}function o(e,t,i){var n=e(t,i),r=2*(n>>31)+1,s=n>>>23&255,o=8388607&n;return 255===s?o?NaN:r*(1/0):0===s?1401298464324817e-60*r*o:r*Math.pow(2,s-150)*(o+8388608)}e.writeFloatLE=t.bind(null,i),e.writeFloatBE=t.bind(null,n),e.readFloatLE=o.bind(null,r),e.readFloatBE=o.bind(null,s)}(),\"undefined\"!=typeof Float64Array?function(){var t=new Float64Array([-0]),i=new Uint8Array(t.buffer),n=128===i[7];function r(e,n,r){t[0]=e,n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3],n[r+4]=i[4],n[r+5]=i[5],n[r+6]=i[6],n[r+7]=i[7]}function s(e,n,r){t[0]=e,n[r]=i[7],n[r+1]=i[6],n[r+2]=i[5],n[r+3]=i[4],n[r+4]=i[3],n[r+5]=i[2],n[r+6]=i[1],n[r+7]=i[0]}function o(e,n){return i[0]=e[n],i[1]=e[n+1],i[2]=e[n+2],i[3]=e[n+3],i[4]=e[n+4],i[5]=e[n+5],i[6]=e[n+6],i[7]=e[n+7],t[0]}function a(e,n){return i[7]=e[n],i[6]=e[n+1],i[5]=e[n+2],i[4]=e[n+3],i[3]=e[n+4],i[2]=e[n+5],i[1]=e[n+6],i[0]=e[n+7],t[0]}e.writeDoubleLE=n?r:s,e.writeDoubleBE=n?s:r,e.readDoubleLE=n?o:a,e.readDoubleBE=n?a:o}():function(){function t(e,t,i,n,r,s){var o=n<0?1:0;if(o&&(n=-n),0===n)e(0,r,s+t),e(1/n>0?0:2147483648,r,s+i);else if(isNaN(n))e(0,r,s+t),e(2146959360,r,s+i);else if(n>17976931348623157e292)e(0,r,s+t),e((o<<31|2146435072)>>>0,r,s+i);else{var a;if(n<22250738585072014e-324)e((a=n/5e-324)>>>0,r,s+t),e((o<<31|a/4294967296)>>>0,r,s+i);else{var c=Math.floor(Math.log(n)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=n*Math.pow(2,-c))>>>0,r,s+t),e((o<<31|c+1023<<20|1048576*a&1048575)>>>0,r,s+i)}}}function o(e,t,i,n,r){var s=e(n,r+t),o=e(n,r+i),a=2*(o>>31)+1,c=o>>>20&2047,d=4294967296*(1048575&o)+s;return 2047===c?d?NaN:a*(1/0):0===c?5e-324*a*d:a*Math.pow(2,c-1075)*(d+4503599627370496)}e.writeDoubleLE=t.bind(null,i,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=o.bind(null,r,0,4),e.readDoubleBE=o.bind(null,s,4,0)}(),e}function i(e,t,i){t[i]=255&e,t[i+1]=e>>>8&255,t[i+2]=e>>>16&255,t[i+3]=e>>>24}function n(e,t,i){t[i]=e>>>24,t[i+1]=e>>>16&255,t[i+2]=e>>>8&255,t[i+3]=255&e}function r(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:module=>{\"use strict\";function inquire(moduleName){try{var mod=eval(\"quire\".replace(/^/,\"re\"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},6662:e=>{\"use strict\";e.exports=function(e,t,i){var n=i||8192,r=n>>>1,s=null,o=n;return function(i){if(i<1||i>r)return e(i);o+i>n&&(s=e(n),o=0);var a=t.call(s,o,o+=i);return 7&o&&(o=1+(7|o)),a}}},4997:(e,t)=>{\"use strict\";var i=t;i.length=function(e){for(var t=0,i=0,n=0;n191&&n<224?s[o++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[o++]=55296+(n>>10),s[o++]=56320+(1023&n)):s[o++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,s)),o=0);return r?(o&&r.push(String.fromCharCode.apply(String,s.slice(0,o))),r.join(\"\")):String.fromCharCode.apply(String,s.slice(0,o))},i.write=function(e,t,i){for(var n,r,s=i,o=0;o>6|192,t[i++]=63&n|128):55296==(64512&n)&&56320==(64512&(r=e.charCodeAt(o+1)))?(n=65536+((1023&n)<<10)+(1023&r),++o,t[i++]=n>>18|240,t[i++]=n>>12&63|128,t[i++]=n>>6&63|128,t[i++]=63&n|128):(t[i++]=n>>12|224,t[i++]=n>>6&63|128,t[i++]=63&n|128);return i-s}},8320:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(3922);t.default=class{constructor(e,t,i,n=1e3,r=200){this.realtimeController=e,this.selfAttendeeId=t,this.hasBandwidthPriorityCallback=i,this.waitIntervalMs=n,this.updateIntervalMs=r,this.speakerScores={},this.speakerMuteState={},this.detectorCallbackToHandler=new Map,this.detectorCallbackToScoresTimer=new Map,this.detectorCallbackToActivityTimer=new Map,this.hasBandwidthPriority=!1,this.mostRecentUpdateTimestamp={}}needUpdate(e){return!this.activeSpeakers||0===this.speakerScores[e]&&this.activeSpeakers.includes(e)||this.speakerScores[e]>0&&!this.activeSpeakers.includes(e)}updateActiveSpeakers(e,t,i){if(!this.needUpdate(i))return;const n=[],r=Object.keys(this.speakerScores);for(let e=0;et.activeScore-e.activeScore)).filter((function(e){return e.activeScore>0})).map((function(e){return e.attendeeId}));this.activeSpeakers=s,t(s);const o=s.length>0&&s[0]===this.selfAttendeeId&&e.prioritizeVideoSendBandwidthForActiveSpeaker();this.hasBandwidthPriority!==o&&(this.hasBandwidthPriority=o,this.hasBandwidthPriorityCallback(o))}updateScore(e,t,i,n,r){const s=e.calculateScore(i,n,r);this.speakerScores[i]!==s&&(this.speakerScores[i]=s,this.mostRecentUpdateTimestamp[i]=Date.now(),this.updateActiveSpeakers(e,t,i))}subscribe(e,t,i,n){const s=(i,n)=>{if(!n)return this.speakerScores[i]=0,this.mostRecentUpdateTimestamp[i]=Date.now(),void this.updateActiveSpeakers(e,t,i);this.realtimeController.realtimeSubscribeToVolumeIndicator(i,((i,n,r,s)=>{this.mostRecentUpdateTimestamp[i]=Date.now(),null!==r&&(this.speakerMuteState[i]=r),this.updateScore(e,t,i,n,r)}))};this.detectorCallbackToHandler.set(t,s);const o=new r.default(this.updateIntervalMs);if(o.start((()=>{for(const i in this.speakerScores)Date.now()-this.mostRecentUpdateTimestamp[i]>this.waitIntervalMs&&this.updateScore(e,t,i,0,this.speakerMuteState[i])})),this.detectorCallbackToActivityTimer.set(t,o),i&&n){const e=new r.default(n);e.start((()=>{i(this.speakerScores)})),this.detectorCallbackToScoresTimer.set(t,e)}this.realtimeController.realtimeSubscribeToAttendeeIdPresence(s)}unsubscribe(e){const t=this.detectorCallbackToHandler.get(e);this.detectorCallbackToHandler.delete(e),t&&this.realtimeController.realtimeUnsubscribeToAttendeeIdPresence(t);const i=this.detectorCallbackToActivityTimer.get(e);i&&(i.stop(),this.detectorCallbackToActivityTimer.delete(e));const n=this.detectorCallbackToScoresTimer.get(e);n&&(n.stop(),this.detectorCallbackToHandler.delete(e))}destroy(){return n(this,void 0,void 0,(function*(){for(const e of this.detectorCallbackToHandler.values())this.realtimeController.realtimeUnsubscribeToAttendeeIdPresence(e);for(const e of this.detectorCallbackToActivityTimer.values())e.stop();for(const e of this.detectorCallbackToScoresTimer.values())e.stop();this.detectorCallbackToHandler.clear(),this.detectorCallbackToActivityTimer.clear(),this.detectorCallbackToScoresTimer.clear()}))}}},2363:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e=.9,t=.01,i=.2,n=.2){this.speakerWeight=e,this.cutoffThreshold=t,this.silenceThreshold=i,this.takeoverRate=n,this.volumes={}}calculateScore(e,t,i){(i||null===t)&&(t=0),this.volumes.hasOwnProperty(e)||(this.volumes[e]=0),t=t>this.silenceThreshold?1:0;const n=this.volumes[e]*this.speakerWeight+t*(1-this.speakerWeight);this.volumes[e]=n;for(const i in this.volumes)i!==e&&(this.volumes[i]=Math.max(this.volumes[i]-this.takeoverRate*t,0));return n{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});class i{constructor(e,t){this.appName=e,this.appVersion=t}static create(e,t){const n=/^[a-zA-Z0-9]+[a-zA-Z0-9_-]*[a-zA-Z0-9]+$/g;if(!e||e.length>32)throw new Error(\"appName should be a valid string and 1 to 32 characters in length\");if(!n.test(e))throw new Error(`appName must satisfy ${n} regular expression`);if(!t||t.length>32)throw new Error(\"appVersion should be a valid string and 1 to 32 characters in length\");if(!/^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/gm.test(t))throw new Error(\"appVersion must satisfy Semantic Versioning format\");return new i(e,t)}}t.default=i},7602:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{}},6802:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(543),s=i(7797);t.default=class{constructor(e){this.logger=e,this.audioDevice=null,this.audioElement=null,this.audioStream=null,this.browserBehavior=new r.default,this.observers=new Set}bindAudioElement(e){return n(this,void 0,void 0,(function*(){if(!e)throw new Error(`Cannot bind audio element: ${e}`);return this.audioElement=e,this.audioElement.autoplay=!0,this.bindAudioMix()}))}unbindAudioElement(){this.audioElement&&(this.audioElement.srcObject=null,this.audioElement=null,this.forEachObserver((e=>{this.audioStream&&e.meetingAudioStreamBecameInactive(this.audioStream)})))}bindAudioStream(e){return n(this,void 0,void 0,(function*(){if(e){this.audioStream=e;try{yield this.bindAudioMix()}catch(e){this.logger&&this.logger.warn(`Failed to bind audio stream: ${e}`)}}}))}bindAudioDevice(e){return n(this,void 0,void 0,(function*(){if(e&&!this.browserBehavior.supportsSetSinkId())throw new Error(\"Cannot select audio output device. This browser does not support setSinkId.\");return this.audioDevice=e,this.bindAudioMix()}))}forEachObserver(e){for(const t of this.observers)s.default.nextTick((()=>{e(t)}))}bindAudioMix(){var e,t;return n(this,void 0,void 0,(function*(){if(!this.audioElement)return;const i=this.audioElement.srcObject;this.audioStream&&(this.audioElement.srcObject=this.audioStream),i!==this.audioStream&&this.forEachObserver((e=>{i&&e.meetingAudioStreamBecameInactive(i),this.audioStream&&e.meetingAudioStreamBecameActive(this.audioStream)}));const n=(null===(e=this.audioDevice)||void 0===e?void 0:e.deviceId)!==this.audioElement.sinkId;if(n&&void 0===this.audioElement.sinkId)throw new Error(\"Cannot select audio output device. This browser does not support setSinkId.\");const r=this.audioDevice?this.audioDevice.deviceId:\"\";if(r===this.audioElement.sinkId)return;const s=this.audioElement,o=this.audioStream;if(this.browserBehavior.hasChromiumWebRTC()&&(s.srcObject=null),n)try{yield s.setSinkId(r)}catch(e){throw null===(t=this.logger)||void 0===t||t.error(`Failed to set sinkId for audio element: ${e}`),e}this.browserBehavior.hasChromiumWebRTC()&&(s.srcObject=o)}))}getCurrentMeetingAudioStream(){return n(this,void 0,void 0,(function*(){return this.audioStream}))}addAudioMixObserver(e){return n(this,void 0,void 0,(function*(){this.observers.add(e)}))}removeAudioMixObserver(e){return n(this,void 0,void 0,(function*(){this.observers.delete(e)}))}audioOutputDidChange(e){return n(this,void 0,void 0,(function*(){return this.logger.info(\"Receive an audio output change event\"),this.bindAudioDevice(e)}))}}},3765:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});class i{constructor(e=null){this.audioBitrateBps=e}static fullbandSpeechMono(){return new i(4e4)}static fullbandMusicMono(){return new i(64e3)}static fullbandMusicStereo(){return new i(128e3)}isStereo(){return 128e3===this.audioBitrateBps}}t.default=i},1876:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.DEFAULT_VIDEO_SUBSCRIPTION_LIMIT=void 0,t.DEFAULT_VIDEO_SUBSCRIPTION_LIMIT=25,t.default=class{constructor(){this.logger=null,this.browserBehavior=null,this.meetingSessionConfiguration=null,this.signalingClient=null,this.peer=null,this.previousSdpOffer=null,this.sdpOfferInit=null,this.audioVideoController=null,this.realtimeController=null,this.videoTileController=null,this.mediaStreamBroker=null,this.activeAudioInput=void 0,this.activeVideoInput=void 0,this.audioMixController=null,this.transceiverController=null,this.indexFrame=null,this.iceCandidates=[],this.iceCandidateHandler=null,this.iceGatheringStateEventHandler=null,this.sdpAnswer=null,this.turnCredentials=null,this.reconnectController=null,this.removableObservers=[],this.audioProfile=null,this.videoStreamIndex=null,this.videoDownlinkBandwidthPolicy=null,this.videoUplinkBandwidthPolicy=null,this.lastKnownVideoAvailability=null,this.videoCaptureAndEncodeParameter=null,this.videosToReceive=null,this.lastVideosToReceive=null,this.videoSubscriptions=null,this.lastVideoSubscriptionConfiguration=new Map,this.videoSubscriptionLimit=t.DEFAULT_VIDEO_SUBSCRIPTION_LIMIT,this.previousSdpAnswerAsString=\"\",this.serverSupportsCompression=!1,this.videoSendCodecPreferences=[],this.currentVideoSendCodec=void 0,this.meetingSupportedVideoSendCodecPreferences=void 0,this.videosPaused=null,this.videoDuplexMode=null,this.volumeIndicatorAdapter=null,this.statsCollector=null,this.connectionMonitor=null,this.videoInputAttachedTimestampMs=0,this.audioDeviceInformation={},this.videoDeviceInformation={},this.enableSimulcast=!1,this.eventController=null,this.signalingOpenDurationMs=null,this.iceGatheringDurationMs=null,this.startAudioVideoTimestamp=null,this.attendeePresenceDurationMs=null,this.meetingStartDurationMs=null,this.poorConnectionCount=0,this.maxVideoTileCount=0,this.startTimeMs=null}resetConnectionSpecificState(){this.peer&&this.peer.close(),this.peer=null,this.previousSdpOffer=null,this.sdpOfferInit=null,void 0!==this.transceiverController&&this.transceiverController.reset(),this.indexFrame=null,this.iceCandidates=[],this.iceCandidateHandler=null,this.sdpAnswer=null,this.turnCredentials=null,this.videoDownlinkBandwidthPolicy.reset(),this.videoUplinkBandwidthPolicy.reset&&this.videoUplinkBandwidthPolicy.reset(),this.lastVideosToReceive=null,this.lastVideoSubscriptionConfiguration=new Map,this.videoSubscriptions=null,this.videoSubscriptionLimit=t.DEFAULT_VIDEO_SUBSCRIPTION_LIMIT,this.previousSdpAnswerAsString=\"\",this.serverSupportsCompression=!1,this.currentVideoSendCodec=void 0,this.meetingSupportedVideoSendCodecPreferences=void 0,this.videoDuplexMode=null}}},9059:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(8320),s=i(6802),o=i(3765),a=i(543),c=i(6688),d=i(8581),l=i(3789),u=i(5687),h=i(5723),p=i(214),m=i(7500),f=i(983),g=i(7797),v=i(9678),S=i(3860),b=i(9553),y=i(3013),w=i(1208),C=i(7103),k=i(9416),E=i(9101),I=i(289),T=i(8597),A=i(8358),M=i(3216),x=i(7408),_=i(5054),P=i(1129),O=i(6240),R=i(1960),D=i(6180),N=i(2748),F=i(1981),B=i(4543),L=i(8556),U=i(9945),V=i(1209),j=i(6274),z=i(5547),$=i(120),W=i(9560),H=i(9485),q=i(7079),K=i(4833),G=i(5275),J=i(5924),Q=i(250),Z=i(6171),X=i(365),Y=i(7377),ee=i(5785),te=i(9354),ie=i(8660),ne=i(1133),re=i(5185),se=i(2880),oe=i(1819),ae=i(1508),ce=i(1318),de=i(4242),le=i(2958),ue=i(4922),he=i(4450),pe=i(4442),me=i(9751),fe=i(1876);class ge{constructor(e,t,i,n,r,a){this._audioProfile=new o.default,this.connectionHealthData=new c.default,this.observerQueue=new Set,this.meetingSessionContext=new fe.default,this.enableSimulcast=!1,this.useUpdateTransceiverControllerForUplink=!1,this.totalRetryCount=0,this.startAudioVideoTimestamp=0,this.mayNeedRenegotiationForSimulcastLayerChange=!1,this.promotedToPrimaryMeeting=!1,this.hasGetRTCPeerConnectionStatsDeprecationMessageBeenSent=!1,this.receiveIndexTask=void 0,this.monitorTask=void 0,this.destroyed=!1,this._logger=t,this.sessionStateController=new v.default(this._logger),this._configuration=e,this._webSocketAdapter=i,this._realtimeController=new f.default(n),this._realtimeController.realtimeSetLocalAttendeeId(e.credentials.attendeeId,e.credentials.externalUserId),this._mediaStreamBroker=n,this._reconnectController=r,this._videoTileController=new le.default(new ue.default,this,this._logger),this._audioMixController=new s.default(this._logger),this._mediaStreamBroker.addMediaStreamBrokerObserver(this._audioMixController),this.meetingSessionContext.logger=this._logger,this._eventController=a}destroy(){return n(this,void 0,void 0,(function*(){this.observerQueue.clear(),this._mediaStreamBroker.removeMediaStreamBrokerObserver(this._audioMixController),this.destroyed=!0}))}get configuration(){return this._configuration}get realtimeController(){return this._realtimeController}get activeSpeakerDetector(){return this._activeSpeakerDetector||(this._activeSpeakerDetector=new r.default(this._realtimeController,this._configuration.credentials.attendeeId,this.handleHasBandwidthPriority.bind(this))),this._activeSpeakerDetector}get videoTileController(){return this._videoTileController}get audioMixController(){return this._audioMixController}get logger(){return this._logger}get rtcPeerConnection(){return this.meetingSessionContext&&this.meetingSessionContext.peer||null}get mediaStreamBroker(){return this._mediaStreamBroker}get eventController(){return this._eventController}getRTCPeerConnectionStats(e){return this.hasGetRTCPeerConnectionStatsDeprecationMessageBeenSent||(this.logger.warn(\"The `getRTCPeerConnectionStats()` is on its way to be deprecated. It makes an additional call to the `getStats` API and therefore may cause slight performance degradation. Please use the new API `clientMetricReport.getRTCStatsReport()` returned by `metricsDidReceive(clientMetricReport)` callback instead.\"),this.hasGetRTCPeerConnectionStatsDeprecationMessageBeenSent=!0),this.rtcPeerConnection?this.rtcPeerConnection.getStats(e):null}setAudioProfile(e){this._audioProfile=e}addObserver(e){this.logger.info(\"adding meeting observer\"),this.observerQueue.add(e)}removeObserver(e){this.logger.info(\"removing meeting observer\"),this.observerQueue.delete(e)}forEachObserver(e){for(const t of this.observerQueue)g.default.nextTick((()=>{this.observerQueue.has(t)&&e(t)}))}initSignalingClient(){this.connectionHealthData.reset(),this.meetingSessionContext.signalingClient||(this.meetingSessionContext=new fe.default,this.meetingSessionContext.logger=this.logger,this.meetingSessionContext.eventController=this.eventController,this.meetingSessionContext.browserBehavior=new a.default,this.meetingSessionContext.videoSendCodecPreferences=this.videoSendCodecPreferences,this.meetingSessionContext.meetingSessionConfiguration=this.configuration,this.meetingSessionContext.signalingClient=new w.default(this._webSocketAdapter,this.logger))}uninstallPreStartObserver(){this.meetingSessionContext.signalingClient.removeObserver(this.preStartObserver),this.preStartObserver=void 0}prestart(){return this.logger.info(\"Pre-connecting signaling connection.\"),this.createOrReuseSignalingTask().run().then((()=>{const e=()=>n(this,void 0,void 0,(function*(){this.logger.info(\"Early connection closed; discarding signaling task.\"),this.signalingTask=void 0,this.uninstallPreStartObserver()}));this.preStartObserver={handleSignalingClientEvent(t){t.type===k.default.WebSocketClosed&&e()}},this.meetingSessionContext.signalingClient.registerObserver(this.preStartObserver)})).catch((e=>{this.logger.error(`Signaling task pre-start failed: ${e}`),this.signalingTask=void 0}))}start(e){this.startReturningPromise(e).then((()=>{this.logger.info(\"start completed\")})).catch((e=>{this.logger.error(`start failed: ${e}`)}))}startReturningPromise(e){return!0===(null==e?void 0:e.signalingOnly)?this.prestart():(this.activeSpeakerDetector,new Promise(((e,t)=>{this.sessionStateController.perform(S.default.Connect,(()=>{this.actionConnect(!1).then(e).catch(t)}))})))}connectWithPromises(e){const t=this.meetingSessionContext;this.monitorTask=new F.default(t,this.configuration.connectionHealthPolicyConfiguration,this.connectionHealthData);const i=this.monitorTask.once(),n=new V.default(t).once();this.receiveIndexTask=new W.default(t),this.monitorTask.pauseResubscribeCheck(),this.receiveIndexTask.pauseIngestion();const r=new q.default(this.logger,\"Signaling\",[this.createOrReuseSignalingTask(),new N.default(t),new H.default(t),new R.default(t),new z.default(t),this.receiveIndexTask]).once(),s=new _.default(t).once(r),o=new A.default(t).once(s,n),a=new P.default(t).once(o),c=new K.default(t).once(a),d=new O.default(t).once(c),l=new J.default(t).once(d),u=new j.default(t).once(l);return new q.default(this.logger,this.wrapTaskName(\"AudioVideoStart\"),[i,((e,t)=>new Q.default(this.logger,t,e))(this.configuration.connectionTimeoutMs,new q.default(this.logger,\"Peer\",[l,u,e?new Q.default(this.logger,new L.default(this.logger,\"FinalizeConnection\",[new Z.default(t),new G.default(t)]),this.meetingSessionContext.meetingSessionConfiguration.attendeePresenceTimeoutMs):new G.default(t)]))])}actionConnect(e){var t;return n(this,void 0,void 0,(function*(){this.initSignalingClient(),this.uninstallPreStartObserver(),this.meetingSessionContext.mediaStreamBroker=this._mediaStreamBroker,this.meetingSessionContext.realtimeController=this._realtimeController,this.meetingSessionContext.audioMixController=this._audioMixController,this.meetingSessionContext.audioVideoController=this,this.enableSimulcast=this.configuration.enableSimulcastForUnifiedPlanChromiumBasedBrowsers&&(new a.default).hasChromiumWebRTC();const i=!!this.configuration.urls.audioHostURL;if(i?this.enableSimulcast?(this.logger.info(\"Using transceiver controller with simulcast support\"),new p.default(this.configuration.credentials.attendeeId).hasModality(p.default.MODALITY_CONTENT)?this.meetingSessionContext.transceiverController=new Y.default(this.logger,this.meetingSessionContext.browserBehavior):this.meetingSessionContext.transceiverController=new ee.default(this.logger,this.meetingSessionContext.browserBehavior)):(this.logger.info(\"Using default transceiver controller\"),this.meetingSessionContext.transceiverController=new X.default(this.logger,this.meetingSessionContext.browserBehavior)):(this.logger.info(\"Using video only transceiver controller\"),this.meetingSessionContext.transceiverController=new te.default(this.logger,this.meetingSessionContext.browserBehavior)),this.meetingSessionContext.volumeIndicatorAdapter=new me.default(this.logger,this._realtimeController,ge.MIN_VOLUME_DECIBELS,ge.MAX_VOLUME_DECIBELS,this.configuration.credentials.attendeeId),this.meetingSessionContext.videoTileController=this._videoTileController,this.meetingSessionContext.videoDownlinkBandwidthPolicy=this.configuration.videoDownlinkBandwidthPolicy,this.meetingSessionContext.videoUplinkBandwidthPolicy=this.configuration.videoUplinkBandwidthPolicy,this.meetingSessionContext.enableSimulcast=this.enableSimulcast,this.enableSimulcast){let e=this.meetingSessionContext.videoUplinkBandwidthPolicy;e||(e=new he.default(this.configuration.credentials.attendeeId,this.meetingSessionContext.logger),this.meetingSessionContext.videoUplinkBandwidthPolicy=e),e.addObserver(this),this.meetingSessionContext.videoDownlinkBandwidthPolicy||(this.meetingSessionContext.videoDownlinkBandwidthPolicy=new se.default(this.meetingSessionContext.logger)),this.meetingSessionContext.videoStreamIndex=new de.default(this.logger)}else this.meetingSessionContext.enableSimulcast=!1,this.meetingSessionContext.videoStreamIndex=new ce.default(this.logger),this.meetingSessionContext.videoUplinkBandwidthPolicy||(this.meetingSessionContext.videoUplinkBandwidthPolicy=new pe.default(this.configuration.credentials.attendeeId,!this.meetingSessionContext.browserBehavior.disableResolutionScaleDown(),this.meetingSessionContext.logger,this.meetingSessionContext.browserBehavior)),this.meetingSessionContext.videoDownlinkBandwidthPolicy||(this.meetingSessionContext.videoDownlinkBandwidthPolicy=new re.default(this.configuration.credentials.attendeeId)),this.meetingSessionContext.videoUplinkBandwidthPolicy.setTransceiverController&&this.meetingSessionContext.videoUplinkBandwidthPolicy.updateTransceiverController&&(this.useUpdateTransceiverControllerForUplink=!0,this.meetingSessionContext.videoUplinkBandwidthPolicy.setTransceiverController(this.meetingSessionContext.transceiverController)),this.meetingSessionContext.audioProfile=this._audioProfile;this.meetingSessionContext.videoUplinkBandwidthPolicy&&this.maxUplinkBandwidthKbps&&this.meetingSessionContext.videoUplinkBandwidthPolicy.setIdealMaxBandwidthKbps(this.maxUplinkBandwidthKbps),this.meetingSessionContext.videoDownlinkBandwidthPolicy.bindToTileController&&this.meetingSessionContext.videoDownlinkBandwidthPolicy.bindToTileController(this._videoTileController),this.meetingSessionContext.videoDownlinkBandwidthPolicy.setWantsResubscribeObserver&&this.meetingSessionContext.videoDownlinkBandwidthPolicy.setWantsResubscribeObserver((()=>this.update({needsRenegotiation:!1}))),this.meetingSessionContext.lastKnownVideoAvailability=new h.default,this.meetingSessionContext.videoCaptureAndEncodeParameter=new ne.default(0,0,0,0,!1),this.meetingSessionContext.videosToReceive=new ae.default,this.meetingSessionContext.videosPaused=new ae.default,this.meetingSessionContext.statsCollector=new T.default(this,this.logger),this.meetingSessionContext.connectionMonitor=new d.default(this,this._realtimeController,this.connectionHealthData,new m.default(this.meetingSessionContext.signalingClient,ge.PING_PONG_INTERVAL_MS,this.logger),this.meetingSessionContext.statsCollector),this.meetingSessionContext.reconnectController=this._reconnectController,this.meetingSessionContext.videoDeviceInformation={},e||(this.totalRetryCount=0,this._reconnectController.reset(),this.startAudioVideoTimestamp=Date.now(),this.forEachObserver((e=>{ie.Maybe.of(e.audioVideoDidStartConnecting).map((t=>t.bind(e)(!1)))})),null===(t=this.eventController)||void 0===t||t.publishEvent(\"meetingStartRequested\")),this.meetingSessionContext.startAudioVideoTimestamp=this.startAudioVideoTimestamp,this._reconnectController.hasStartedConnectionAttempt()?this._reconnectController.startedConnectionAttempt(!1):this._reconnectController.startedConnectionAttempt(!0);const r=i&&this.meetingSessionContext.meetingSessionConfiguration.attendeePresenceTimeoutMs>0;this.logger.info(\"Needs to wait for attendee presence? \"+r);const s=this.connectWithPromises(r);try{yield s.run(),this.connectionHealthData.setConnectionStartTime(),this._mediaStreamBroker.addMediaStreamBrokerObserver(this),this.sessionStateController.perform(S.default.FinishConnecting,(()=>{this.eventController&&(this.meetingSessionContext.meetingStartDurationMs=Date.now()-this.startAudioVideoTimestamp,this.eventController.publishEvent(\"meetingStartSucceeded\",{maxVideoTileCount:this.meetingSessionContext.maxVideoTileCount,poorConnectionCount:this.meetingSessionContext.poorConnectionCount,retryCount:this.totalRetryCount,signalingOpenDurationMs:this.meetingSessionContext.signalingOpenDurationMs,iceGatheringDurationMs:this.meetingSessionContext.iceGatheringDurationMs,meetingStartDurationMs:this.meetingSessionContext.meetingStartDurationMs})),this.meetingSessionContext.startTimeMs=Date.now(),this.actionFinishConnecting()}))}catch(e){this.signalingTask=void 0;const t=new l.default(this.getMeetingStatusCode(e)||u.default.TaskFailed);if(this.logger.info(`Start failed: ${t} due to error ${e}.`),this.sessionStateController.state()===b.default.NotConnected)return void this.logger.info(\"Start failed and not connected. Not cleaning up.\");this.sessionStateController.perform(S.default.Fail,(()=>n(this,void 0,void 0,(function*(){yield this.actionDisconnect(t,!0,e),this.handleMeetingSessionStatus(t,e)||this.notifyStop(t,e)}))))}}))}createOrReuseSignalingTask(){return this.signalingTask||(this.initSignalingClient(),this.signalingTask=new Q.default(this.logger,new B.default(this.meetingSessionContext),this.configuration.connectionTimeoutMs).once()),this.signalingTask}actionFinishConnecting(){this.signalingTask=void 0,this.meetingSessionContext.videoDuplexMode=I.SdkStreamServiceType.RX,this.meetingSessionContext.enableSimulcast||(this.useUpdateTransceiverControllerForUplink?this.meetingSessionContext.videoUplinkBandwidthPolicy.updateTransceiverController():this.enforceBandwidthLimitationForSender(this.meetingSessionContext.videoCaptureAndEncodeParameter.encodeBitrates()[0])),this.forEachObserver((e=>{ie.Maybe.of(e.audioVideoDidStart).map((t=>t.bind(e)()))})),this._reconnectController.reset(),this.receiveIndexTask.resumeIngestion(),this.monitorTask.resumeResubscribeCheck()}stopReturningPromise(){var e;return this.sessionStateController.state()===b.default.NotConnected?(null===(e=this.meetingSessionContext.signalingClient)||void 0===e||e.closeConnection(),this.cleanUpMediaStreamsAfterStop(),Promise.resolve()):new Promise(((e,t)=>{this.sessionStateController.perform(S.default.Disconnect,(()=>{this._reconnectController.disableReconnect(),this.logger.info(\"attendee left meeting, session will not be reconnected\"),this.actionDisconnect(new l.default(u.default.Left),!1,null).then(e).catch(t)}))}))}stop(){this.stopReturningPromise()}actionDisconnect(e,t,i){return n(this,void 0,void 0,(function*(){try{yield new q.default(this.logger,this.wrapTaskName(\"AudioVideoStop\"),[new Q.default(this.logger,new D.default(this.meetingSessionContext),this.configuration.connectionTimeoutMs)]).run()}catch(e){this.logger.info(\"fail to stop\")}try{const e=[new Q.default(this.logger,new x.default(this.meetingSessionContext),this.configuration.connectionTimeoutMs)];this.cleanUpMediaStreamsAfterStop(),yield new q.default(this.logger,this.wrapTaskName(\"AudioVideoClean\"),e).run()}catch(e){this.logger.info(\"fail to clean\")}this.sessionStateController.perform(S.default.FinishDisconnecting,(()=>{t||this.notifyStop(e,i)}))}))}update(e={needsRenegotiation:!0}){let t=e.needsRenegotiation;if(t||(t=void 0===this.meetingSessionContext.peer),t||(t=!this.updateRemoteVideosFromPolicy()),t||(t=!this.updateLocalVideoFromPolicy()),this.meetingSessionContext.lastVideosToReceive=this.meetingSessionContext.videosToReceive,!t)return this.logger.info(\"Update request does not require resubscribe\"),this.actionFinishUpdating(),!0;this.logger.info(\"Update request requires resubscribe\");const i=this.sessionStateController.perform(S.default.Update,(()=>{this.actionUpdateWithRenegotiation(!0)}));return i===y.default.Transitioned||i===y.default.DeferredTransition}updateRemoteVideosFromPolicy(){if(this.meetingSessionContext.videoDownlinkBandwidthPolicy&&void 0!==this.meetingSessionContext.videoDownlinkBandwidthPolicy.getVideoPreferences&&void 0!==this.meetingSessionContext.videoDownlinkBandwidthPolicy.getServerSideNetworkAdaption&&!C.serverSideNetworkAdaptionIsNoneOrDefault(this.meetingSessionContext.videoDownlinkBandwidthPolicy.getServerSideNetworkAdaption())){if(!this.sendRemoteVideoUpdate())return!1;if(this.meetingSessionContext.videoDownlinkBandwidthPolicy.getServerSideNetworkAdaption()===C.default.BandwidthProbingAndRemoteVideoQualityAdaption)return this.isNotAddingOrRemovingStreams()}return this.updateRemoteVideosIfNotAddingOrRemovingStreams()}updateRemoteVideosIfNotAddingOrRemovingStreams(){const e=this.detectChangesInVideosToReceive();if(void 0===e)return!1;const t=e.added,i=e.simulcastStreamUpdates,n=e.removed,r=this.meetingSessionContext,s=[];for(const[e,t]of i.entries()){const i=new E.default;if(i.streamId=t,i.attendeeId=r.videoStreamIndex.attendeeIdForStreamId(t),i.mid=r.transceiverController.getMidForStreamId(e),void 0===i.mid)return this.logger.info(`No MID found for stream ID ${e}, cannot update stream without renegotiation`),!1;if(s.push(i),r.transceiverController.setStreamIdForMid(i.mid,t),r.videoStreamIndex.overrideStreamIdMappings(e,t),r.videoTileController.haveVideoTileForAttendeeId(i.attendeeId)){const e=r.videoTileController.getVideoTileForAttendeeId(i.attendeeId);if(!e.setStreamId)return!1;e.setStreamId(t)}}return 0!==s.length&&r.signalingClient.remoteVideoUpdate(s,[]),0===t.length&&0===n.length&&(r.videoStreamIndex.subscribeFrameSent(),!0)}detectChangesInVideosToReceive(){const e=this.meetingSessionContext;if(null===e.videosToReceive)return;if(!(e.transceiverController&&e.transceiverController.getMidForStreamId&&e.transceiverController.setStreamIdForMid&&e.videosToReceive.forEach&&e.signalingClient.remoteVideoUpdate&&e.videoStreamIndex.overrideStreamIdMappings))return;let t=[];const i=new Map;let n=[];if(null===e.lastVideosToReceive)t=e.videosToReceive.array();else{const r=e.videoStreamIndex;e.videosToReceive.forEach((n=>{if(e.lastVideosToReceive.contain(n))return;let s=!1;e.lastVideosToReceive.forEach((e=>{s||r.StreamIdsInSameGroup(e,n)&&(i.set(e,n),s=!0)})),s||t.push(n)})),n=e.lastVideosToReceive.array().filter((t=>{const n=e.videosToReceive.contain(t),r=i.has(t);return!n&&!r}))}return this.logger.info(`Request to update remote videos with added: ${t}, updated: ${[...i.entries()]}, removed: ${n}`),{added:t,removed:n,simulcastStreamUpdates:i}}isNotAddingOrRemovingStreams(){const e=this.detectChangesInVideosToReceive();if(void 0===e)return!1;const t=e.added,i=e.removed;return 0===t.length&&0===i.length}sendRemoteVideoUpdate(){const e=this.meetingSessionContext;if(null===e.videosToReceive)return!1;const t=e.videosToReceive.array().map((t=>e.videoStreamIndex.groupIdForStreamId(t))),i=oe.convertVideoPreferencesToSignalingClientVideoSubscriptionConfiguration(e,t,e.videoDownlinkBandwidthPolicy.getVideoPreferences()),n=new Map,r=[];for(const t of i){let i=!1;if(e.lastVideoSubscriptionConfiguration.has(t.groupId)){const n=e.lastVideoSubscriptionConfiguration.get(t.groupId);t.equals(n)||(this.logger.debug(`${JSON.stringify(t)} does not equal ${JSON.stringify(n)}, sending update`),i=!0)}else i=!0;n.set(t.groupId,t),i&&r.push(t)}e.lastVideoSubscriptionConfiguration=n;const s=[];if(null!==e.lastVideosToReceive){const i=new Set(t);for(const t of e.lastVideosToReceive.array()){const n=e.videoStreamIndex.groupIdForStreamId(t);if(!i.has(n)){const t=e.transceiverController.getMidForGroupId(n);if(void 0===t){e.logger.warn(`Could not find MID for group ID to remove: ${n}`);continue}s.push(t)}}}return 0===r.length&&0===s.length||e.signalingClient.remoteVideoUpdate(r,s),!0}updateLocalVideoFromPolicy(){if(this.meetingSessionContext.enableSimulcast){const e=this.meetingSessionContext.videoUplinkBandwidthPolicy.chooseEncodingParameters();if(this.mayNeedRenegotiationForSimulcastLayerChange&&!this.negotiatedBitrateLayersAllocationRtpHeaderExtension())return this.logger.info(\"Needs regenotiation for local video simulcast layer change\"),this.mayNeedRenegotiationForSimulcastLayerChange=!1,!1;this.meetingSessionContext.transceiverController.setEncodingParameters(e)}else this.meetingSessionContext.videoCaptureAndEncodeParameter=this.meetingSessionContext.videoUplinkBandwidthPolicy.chooseCaptureAndEncodeParameters();return this.logger.info(\"Updated local video from policy without renegotiation\"),!0}negotiatedBitrateLayersAllocationRtpHeaderExtension(){if(!this.meetingSessionContext.transceiverController.localVideoTransceiver())return!1;const e=this.meetingSessionContext.transceiverController.localVideoTransceiver().sender.getParameters();return!(!e||!e.headerExtensions)&&e.headerExtensions.some((e=>\"http://www.webrtc.org/experiments/rtp-hdrext/video-layers-allocation00\"===e.uri))}restartLocalVideo(e){const t=()=>n(this,void 0,void 0,(function*(){this._videoTileController.hasStartedLocalVideoTile()&&(this.logger.info(\"stopping local video tile prior to local video restart\"),this._videoTileController.stopLocalVideoTile(),this.logger.info(\"preparing local video restart update\"),yield this.actionUpdateWithRenegotiation(!1),this.logger.info(\"starting local video tile for local video restart\"),this._videoTileController.startLocalVideoTile()),this.logger.info(\"finalizing local video restart update\"),yield this.actionUpdateWithRenegotiation(!0),e()})),i=this.sessionStateController.perform(S.default.Update,(()=>{t()}));return i===y.default.Transitioned||i===y.default.DeferredTransition}replaceLocalVideo(e){return n(this,void 0,void 0,(function*(){if(!e||e.getVideoTracks().length<1)throw new Error(\"could not acquire video track\");if(!this.meetingSessionContext||!this.meetingSessionContext.peer)throw new Error(\"no active meeting and peer connection\");const t=this.meetingSessionContext.videoTileController.getLocalVideoTile();if(t){const i=t.state(),n=e.getVideoTracks()[0].getSettings();t.bindVideoStream(i.boundAttendeeId,!0,e,n.width,n.height,i.streamId,i.boundExternalUserId)}yield this.meetingSessionContext.transceiverController.setVideoInput(e.getVideoTracks()[0]),this.meetingSessionContext.activeVideoInput=e,this.logger.info(\"Local video input is updated\")}))}replaceLocalAudio(e){return n(this,void 0,void 0,(function*(){if(!e||e.getAudioTracks().length<1)throw new Error(\"could not acquire audio track\");if(!this.meetingSessionContext||!this.meetingSessionContext.peer)throw new Error(\"no active meeting and peer connection\");if(this.connectionHealthData.reset(),this.connectionHealthData.setConnectionStartTime(),!(yield this.meetingSessionContext.transceiverController.replaceAudioTrack(e.getAudioTracks()[0])))throw new Error(\"Failed to replace audio track\");this.meetingSessionContext.activeAudioInput=e,this.logger.info(\"Local audio input is updated\")}))}actionUpdateWithRenegotiation(e){return n(this,void 0,void 0,(function*(){this.monitorTask.pauseResubscribeCheck(),this.receiveIndexTask.pauseIngestion();try{yield new q.default(this.logger,this.wrapTaskName(\"AudioVideoUpdate\"),[new $.default(this.meetingSessionContext),new Q.default(this.logger,new q.default(this.logger,\"UpdateSession\",[new A.default(this.meetingSessionContext),new P.default(this.meetingSessionContext),new K.default(this.meetingSessionContext),new O.default(this.meetingSessionContext),new J.default(this.meetingSessionContext),new G.default(this.meetingSessionContext)]),this.configuration.connectionTimeoutMs)]).run(),e&&this.sessionStateController.perform(S.default.FinishUpdating,(()=>{this.actionFinishUpdating()}))}catch(e){this.sessionStateController.perform(S.default.FinishUpdating,(()=>{const t=new l.default(this.getMeetingStatusCode(e)||u.default.TaskFailed);t.statusCode()!==u.default.IncompatibleSDP&&this.logger.info(\"failed to update audio-video session\"),this.handleMeetingSessionStatus(t,e)}))}}))}notifyStop(e,t){var i;if(this.forEachObserver((t=>{ie.Maybe.of(t.audioVideoDidStop).map((i=>i.bind(t)(e)))})),this.promotedToPrimaryMeeting&&t&&this.forEachObserver((e=>{this.promotedToPrimaryMeeting=!1,ie.Maybe.of(e.audioVideoWasDemotedFromPrimaryMeeting).map((t=>t.bind(e)(new l.default(u.default.SignalingInternalServerError))))})),this.eventController){const{signalingOpenDurationMs:n,poorConnectionCount:r,startTimeMs:s,iceGatheringDurationMs:o,attendeePresenceDurationMs:a,meetingStartDurationMs:c}=this.meetingSessionContext,d={maxVideoTileCount:this.meetingSessionContext.maxVideoTileCount,meetingDurationMs:null===s?0:Math.round(Date.now()-s),meetingStatus:u.default[e.statusCode()],signalingOpenDurationMs:n,iceGatheringDurationMs:o,attendeePresenceDurationMs:a,poorConnectionCount:r,meetingStartDurationMs:c,retryCount:this.totalRetryCount},l=t&&t.message||(null===(i=e.toString)||void 0===i?void 0:i.call(e))||\"\";0===d.meetingDurationMs?(d.meetingErrorMessage=l,delete d.meetingDurationMs,delete d.attendeePresenceDurationMs,delete d.meetingStartDurationMs,this.eventController.publishEvent(\"meetingStartFailed\",d)):e.isFailure()||e.isAudioConnectionFailure()?(d.meetingErrorMessage=l,this.eventController.publishEvent(\"meetingFailed\",d)):this.eventController.publishEvent(\"meetingEnded\",d)}}actionFinishUpdating(){if(!this.meetingSessionContext.enableSimulcast)if(this.useUpdateTransceiverControllerForUplink)this.meetingSessionContext.videoUplinkBandwidthPolicy.updateTransceiverController();else{const e=this.meetingSessionContext.videoCaptureAndEncodeParameter.encodeBitrates()[0];this.enforceBandwidthLimitationForSender(e)}this.monitorTask.resumeResubscribeCheck(),this.receiveIndexTask.resumeIngestion(),this.logger.info(\"updated audio-video session\")}reconnect(e,t){const i=this._reconnectController.retryWithBackoff((()=>n(this,void 0,void 0,(function*(){this.sessionStateController.state()===b.default.NotConnected?this.sessionStateController.perform(S.default.Connect,(()=>{this.actionConnect(!0)})):this.sessionStateController.perform(S.default.Reconnect,(()=>{this.actionReconnect(e)})),this.totalRetryCount+=1}))),(()=>{this.logger.info(\"canceled retry\")}));return i||this.sessionStateController.perform(S.default.Fail,(()=>{this.actionDisconnect(e,!1,t)})),i}actionReconnect(e){return n(this,void 0,void 0,(function*(){this._reconnectController.hasStartedConnectionAttempt()||(this._reconnectController.startedConnectionAttempt(!1),this.forEachObserver((e=>{ie.Maybe.of(e.audioVideoDidStartConnecting).map((t=>t.bind(e)(!0)))}))),this.meetingSessionContext.volumeIndicatorAdapter.onReconnect(),this.connectionHealthData.reset();try{yield new q.default(this.logger,this.wrapTaskName(\"AudioVideoReconnect\"),[new Q.default(this.logger,new q.default(this.logger,\"Media\",[new M.default(this.meetingSessionContext),new q.default(this.logger,\"Signaling\",[new B.default(this.meetingSessionContext),new R.default(this.meetingSessionContext),new z.default(this.meetingSessionContext)]),new _.default(this.meetingSessionContext)]),this.configuration.connectionTimeoutMs),new $.default(this.meetingSessionContext),new Q.default(this.logger,new q.default(this.logger,\"UpdateSession\",[new A.default(this.meetingSessionContext),new P.default(this.meetingSessionContext),new K.default(this.meetingSessionContext),new O.default(this.meetingSessionContext),new J.default(this.meetingSessionContext),new G.default(this.meetingSessionContext)]),this.configuration.connectionTimeoutMs)]).run(),this.sessionStateController.perform(S.default.FinishConnecting,(()=>{if(this.eventController){const{signalingOpenDurationMs:t,poorConnectionCount:i,startTimeMs:n,iceGatheringDurationMs:r,attendeePresenceDurationMs:s,meetingStartDurationMs:o}=this.meetingSessionContext,a={maxVideoTileCount:this.meetingSessionContext.maxVideoTileCount,meetingDurationMs:Math.round(Date.now()-n),meetingStatus:u.default[e.statusCode()],signalingOpenDurationMs:t,iceGatheringDurationMs:r,attendeePresenceDurationMs:s,poorConnectionCount:i,meetingStartDurationMs:o,retryCount:this.totalRetryCount};this.eventController.publishEvent(\"meetingReconnected\",a)}this.actionFinishConnecting()}))}catch(e){this.sessionStateController.perform(S.default.FinishConnecting,(()=>{this.logger.info(\"failed to reconnect audio-video session\");const t=new l.default(this.getMeetingStatusCode(e)||u.default.TaskFailed);this.handleMeetingSessionStatus(t,e)}))}this.connectionHealthData.setConnectionStartTime()}))}wrapTaskName(e){return`${e}/${this.configuration.meetingId}/${this.configuration.credentials.attendeeId}`}cleanUpMediaStreamsAfterStop(){this._mediaStreamBroker.removeMediaStreamBrokerObserver(this),this.meetingSessionContext.activeAudioInput=void 0,this.meetingSessionContext.activeVideoInput=void 0}getMeetingStatusCode(e){const t=/the meeting status code: (\\d+)/.exec(e&&e.message);return t&&t.length>1?Number.parseInt(t[1],10):null}enforceBandwidthLimitationForSender(e){return n(this,void 0,void 0,(function*(){yield this.meetingSessionContext.transceiverController.setVideoSendingBitrateKbps(e)}))}handleMeetingSessionStatus(e,t){if(this.logger.info(`handling status: ${u.default[e.statusCode()]}`),e.isTerminal()||this.meetingSessionContext.statsCollector&&this.meetingSessionContext.statsCollector.logMeetingSessionStatus(e),e.statusCode()===u.default.IncompatibleSDP)return this.restartLocalVideo((()=>{this.logger.info(\"handled incompatible SDP by attempting to restart video\")})),!0;if(e.statusCode()===u.default.VideoCallSwitchToViewOnly)return this._videoTileController.removeLocalVideoTile(),this.forEachObserver((e=>{ie.Maybe.of(e.videoSendDidBecomeUnavailable).map((t=>t.bind(e)()))})),!1;if(e.statusCode()===u.default.AudioVideoWasRemovedFromPrimaryMeeting)return this.forEachObserver((t=>{ie.Maybe.of(t.audioVideoWasDemotedFromPrimaryMeeting).map((i=>i.bind(t)(e)))})),!1;if(e.isTerminal()&&(this.logger.error(\"session will not be reconnected\"),this.meetingSessionContext.reconnectController&&this.meetingSessionContext.reconnectController.disableReconnect()),(e.isFailure()||e.isTerminal())&&this.meetingSessionContext.reconnectController){const i=this.reconnect(e,t);return i?this.logger.warn(`will retry due to status code ${u.default[e.statusCode()]}${t?` and error: ${t.message}`:\"\"}`):this.logger.error(`failed with status code ${u.default[e.statusCode()]}${t?` and error: ${t.message}`:\"\"}`),i}return!1}setVideoMaxBandwidthKbps(e){if(e<=0)throw new Error(\"Max bandwidth kbps has to be greater than 0\");this.meetingSessionContext&&this.meetingSessionContext.videoUplinkBandwidthPolicy&&(this.logger.info(`video send has ideal max bandwidth ${e} kbps`),this.meetingSessionContext.videoUplinkBandwidthPolicy.setIdealMaxBandwidthKbps(e)),this.maxUplinkBandwidthKbps=e}handleHasBandwidthPriority(e){return n(this,void 0,void 0,(function*(){if(this.meetingSessionContext&&this.meetingSessionContext.videoUplinkBandwidthPolicy&&!this.meetingSessionContext.enableSimulcast){if(this.useUpdateTransceiverControllerForUplink)return this.meetingSessionContext.videoUplinkBandwidthPolicy.setHasBandwidthPriority(e),void(yield this.meetingSessionContext.videoUplinkBandwidthPolicy.updateTransceiverController());const t=this.meetingSessionContext.videoUplinkBandwidthPolicy.maxBandwidthKbps();this.meetingSessionContext.videoUplinkBandwidthPolicy.setHasBandwidthPriority(e);const i=this.meetingSessionContext.videoUplinkBandwidthPolicy.maxBandwidthKbps();t!==i&&(this.logger.info(`video send bandwidth priority ${e} max has changed from ${t} kbps to ${i} kbps`),yield this.enforceBandwidthLimitationForSender(i))}}))}pauseReceivingStream(e){this.meetingSessionContext&&this.meetingSessionContext.signalingClient&&this.meetingSessionContext.signalingClient.pause([e])}resumeReceivingStream(e){this.meetingSessionContext&&this.meetingSessionContext.signalingClient&&this.meetingSessionContext.signalingClient.resume([e])}setVideoCodecSendPreferences(e){this.videoSendCodecPreferences=e,this.meetingSessionContext.videoSendCodecPreferences=e,this.update({needsRenegotiation:!0})}getRemoteVideoSources(){const{videoStreamIndex:e}=this.meetingSessionContext;if(!e)return this.logger.info(\"meeting has not started\"),[];const t=this.configuration.credentials.attendeeId;return e.allVideoSendingSourcesExcludingSelf(t)}encodingSimulcastLayersDidChange(e){this.mayNeedRenegotiationForSimulcastLayerChange=!0,this.forEachObserver((t=>{ie.Maybe.of(t.encodingSimulcastLayersDidChange).map((i=>i.bind(t)(e)))}))}promoteToPrimaryMeeting(e){return this.actionPromoteToPrimaryMeeting(e)}actionPromoteToPrimaryMeeting(e){return n(this,void 0,void 0,(function*(){let t=new l.default(u.default.SignalingRequestFailed);return yield new q.default(this.logger,this.wrapTaskName(\"PromoteToPrimaryMeeting\"),[new Q.default(this.logger,new U.default(this.meetingSessionContext,e,(e=>{t=e})),this.configuration.connectionTimeoutMs)]).run(),this.promotedToPrimaryMeeting=t.statusCode()===u.default.OK,t}))}demoteFromPrimaryMeeting(){this.meetingSessionContext.signalingClient.demoteFromPrimaryMeeting(),this.forEachObserver((e=>{ie.Maybe.of(e.audioVideoWasDemotedFromPrimaryMeeting).map((t=>t.bind(e)(new l.default(u.default.OK))))}))}videoInputDidChange(e){return n(this,void 0,void 0,(function*(){this.logger.info(\"Receive a video input change event\"),this.meetingSessionContext&&this.meetingSessionContext.peer?this._videoTileController.hasStartedLocalVideoTile()&&(e?yield this.replaceLocalVideo(e):this._videoTileController.stopLocalVideoTile()):this.logger.info(\"Skip updating video input because there is no active meeting and peer connection\")}))}audioInputDidChange(e){return n(this,void 0,void 0,(function*(){if(this.logger.info(\"Receive an audio input change event\"),this.meetingSessionContext&&this.meetingSessionContext.peer){if(!e)try{e=yield this.mediaStreamBroker.acquireAudioInputStream()}catch(e){return void this.logger.error(\"Could not acquire audio track from mediaStreamBroker\")}yield this.replaceLocalAudio(e)}else this.logger.info(\"Skip updating audio input because there is no active meeting and peer connection\")}))}}t.default=ge,ge.MIN_VOLUME_DECIBELS=-42,ge.MAX_VOLUME_DECIBELS=-14,ge.PING_PONG_INTERVAL_MS=1e4},9836:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(8434),r=i(3831),s=i(209),o=i(4015),a=i(589),c=i(8015),d=i(3789),l=i(5687),u=i(6057),h=i(9141),p=i(7631),m=i(9059);class f extends m.default{constructor(e){const t=new a.default;t.meetingId=\"\",t.externalMeetingId=\"\",t.credentials=new c.default,t.credentials.attendeeId=\"\",t.credentials.joinToken=\"\",t.urls=new u.default,t.urls.turnControlURL=\"\",t.urls.audioHostURL=\"\",t.urls.signalingURL=\"wss://localhost/\";const i=new s.default;super(e||t,i,new p.default(new s.default),new o.default,new h.default(0,new n.default(0,0,0)),new r.default(e||t,i))}setAudioProfile(e){}start(){}stop(){}promoteToPrimaryMeeting(e){return Promise.resolve(new d.default(l.default.OK))}demoteFromPrimaryMeeting(){}}t.default=f},8538:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(7170);t.default=class{constructor(e,t,i,n,r,s){this.audioVideoController=e,this.videoTileController=t,this.realtimeController=i,this.audioMixController=n,this.deviceController=r,this.contentShareController=s}addObserver(e){this.audioVideoController.addObserver(e),this.trace(\"addObserver\")}removeObserver(e){this.audioVideoController.removeObserver(e),this.trace(\"removeObserver\")}setAudioProfile(e){this.trace(\"setAudioProfile\",e),this.audioVideoController.setAudioProfile(e)}start(e){this.audioVideoController.start(e),this.trace(\"start\")}stop(){this.audioVideoController.stop(),this.trace(\"stop\")}getRTCPeerConnectionStats(e){return this.trace(\"getRTCPeerConnectionStats\",e?e.id:null),this.audioVideoController.getRTCPeerConnectionStats(e)}bindAudioElement(e){const t=this.audioMixController.bindAudioElement(e);return this.trace(\"bindAudioElement\",e.id,t),t}unbindAudioElement(){this.audioMixController.unbindAudioElement(),this.trace(\"unbindAudioElement\")}getCurrentMeetingAudioStream(){return this.trace(\"getCurrentConferenceStream\"),this.audioMixController.getCurrentMeetingAudioStream()}addAudioMixObserver(e){this.trace(\"addAudioMixObserver\"),this.audioMixController.addAudioMixObserver(e)}removeAudioMixObserver(e){this.trace(\"removeAudioMixObserver\"),this.audioMixController.removeAudioMixObserver(e)}bindVideoElement(e,t){this.videoTileController.bindVideoElement(e,t),this.trace(\"bindVideoElement\",{tileId:e,videoElementId:t.id})}unbindVideoElement(e,t=!0){this.videoTileController.unbindVideoElement(e,t),this.trace(\"unbindVideoElement\",{tileId:e,cleanUpVideoElement:t})}startLocalVideoTile(){const e=this.videoTileController.startLocalVideoTile();return this.trace(\"startLocalVideoTile\",null,e),e}stopLocalVideoTile(){this.videoTileController.stopLocalVideoTile(),this.trace(\"stopLocalVideoTile\")}hasStartedLocalVideoTile(){const e=this.videoTileController.hasStartedLocalVideoTile();return this.trace(\"hasStartedLocalVideoTile\",null,e),e}removeLocalVideoTile(){this.videoTileController.removeLocalVideoTile(),this.trace(\"removeLocalVideoTile\")}getLocalVideoTile(){const e=this.videoTileController.getLocalVideoTile();return this.trace(\"getLocalVideoTile\"),e}pauseVideoTile(e){this.videoTileController.pauseVideoTile(e),this.trace(\"pauseVideoTile\",e)}unpauseVideoTile(e){this.videoTileController.unpauseVideoTile(e),this.trace(\"unpauseVideoTile\",e)}getVideoTile(e){const t=this.videoTileController.getVideoTile(e);return this.trace(\"getVideoTile\",e),t}getAllRemoteVideoTiles(){const e=this.videoTileController.getAllRemoteVideoTiles();return this.trace(\"getAllRemoteVideoTiles\"),e}getAllVideoTiles(){const e=this.videoTileController.getAllVideoTiles();return this.trace(\"getAllVideoTiles\"),e}addVideoTile(){const e=this.videoTileController.addVideoTile();return this.trace(\"addVideoTile\",null,e.state()),e}removeVideoTile(e){this.videoTileController.removeVideoTile(e),this.trace(\"removeVideoTile\",e)}removeVideoTilesByAttendeeId(e){const t=this.videoTileController.removeVideoTilesByAttendeeId(e);return this.trace(\"removeVideoTilesByAttendeeId\",e,t),t}removeAllVideoTiles(){this.videoTileController.removeAllVideoTiles(),this.trace(\"removeAllVideoTiles\")}captureVideoTile(e){const t=this.videoTileController.captureVideoTile(e);return this.trace(\"captureVideoTile\",e),t}realtimeSubscribeToAttendeeIdPresence(e){this.realtimeController.realtimeSubscribeToAttendeeIdPresence(e),this.trace(\"realtimeSubscribeToAttendeeIdPresence\")}realtimeUnsubscribeToAttendeeIdPresence(e){this.realtimeController.realtimeUnsubscribeToAttendeeIdPresence(e),this.trace(\"realtimeUnsubscribeToAttendeeIdPresence\")}realtimeSetCanUnmuteLocalAudio(e){this.realtimeController.realtimeSetCanUnmuteLocalAudio(e),this.trace(\"realtimeSetCanUnmuteLocalAudio\",e)}realtimeSubscribeToSetCanUnmuteLocalAudio(e){this.realtimeController.realtimeSubscribeToSetCanUnmuteLocalAudio(e),this.trace(\"realtimeSubscribeToSetCanUnmuteLocalAudio\")}realtimeUnsubscribeToSetCanUnmuteLocalAudio(e){this.realtimeController.realtimeUnsubscribeToSetCanUnmuteLocalAudio(e),this.trace(\"realtimeUnsubscribeToSetCanUnmuteLocalAudio\")}realtimeCanUnmuteLocalAudio(){const e=this.realtimeController.realtimeCanUnmuteLocalAudio();return this.trace(\"realtimeCanUnmuteLocalAudio\",null,e),e}realtimeMuteLocalAudio(){this.realtimeController.realtimeMuteLocalAudio(),this.trace(\"realtimeMuteLocalAudio\")}realtimeUnmuteLocalAudio(){const e=this.realtimeController.realtimeUnmuteLocalAudio();return this.trace(\"realtimeUnmuteLocalAudio\"),e}realtimeSubscribeToMuteAndUnmuteLocalAudio(e){this.realtimeController.realtimeSubscribeToMuteAndUnmuteLocalAudio(e),this.trace(\"realtimeSubscribeToMuteAndUnmuteLocalAudio\")}realtimeUnsubscribeToMuteAndUnmuteLocalAudio(e){this.realtimeController.realtimeUnsubscribeToMuteAndUnmuteLocalAudio(e),this.trace(\"realtimeUnsubscribeToMuteAndUnmuteLocalAudio\")}realtimeIsLocalAudioMuted(){const e=this.realtimeController.realtimeIsLocalAudioMuted();return this.trace(\"realtimeIsLocalAudioMuted\"),e}realtimeSubscribeToVolumeIndicator(e,t){this.realtimeController.realtimeSubscribeToVolumeIndicator(e,t),this.trace(\"realtimeSubscribeToVolumeIndicator\",e)}realtimeUnsubscribeFromVolumeIndicator(e,t){this.realtimeController.realtimeUnsubscribeFromVolumeIndicator(e,t),this.trace(\"realtimeUnsubscribeFromVolumeIndicator\",e,t)}realtimeSubscribeToLocalSignalStrengthChange(e){this.realtimeController.realtimeSubscribeToLocalSignalStrengthChange(e),this.trace(\"realtimeSubscribeToLocalSignalStrengthChange\")}realtimeUnsubscribeToLocalSignalStrengthChange(e){this.realtimeController.realtimeUnsubscribeToLocalSignalStrengthChange(e),this.trace(\"realtimeUnsubscribeToLocalSignalStrengthChange\")}realtimeSendDataMessage(e,t,i){this.realtimeController.realtimeSendDataMessage(e,t,i),this.trace(\"realtimeSendDataMessage\")}realtimeSubscribeToReceiveDataMessage(e,t){this.realtimeController.realtimeSubscribeToReceiveDataMessage(e,t),this.trace(\"realtimeSubscribeToReceiveDataMessage\")}realtimeUnsubscribeFromReceiveDataMessage(e){this.realtimeController.realtimeUnsubscribeFromReceiveDataMessage(e),this.trace(\"realtimeUnsubscribeFromReceiveDataMessage\")}realtimeSubscribeToFatalError(e){this.realtimeController.realtimeSubscribeToFatalError(e),this.trace(\"realtimeSubscribeToFatalError\")}realtimeUnsubscribeToFatalError(e){this.realtimeController.realtimeUnsubscribeToFatalError(e),this.trace(\"realtimeUnsubscribeToFatalError\")}subscribeToActiveSpeakerDetector(e,t,i,n){this.audioVideoController.activeSpeakerDetector.subscribe(e,t,i,n),this.trace(\"subscribeToActiveSpeakerDetector\")}unsubscribeFromActiveSpeakerDetector(e){this.audioVideoController.activeSpeakerDetector.unsubscribe(e),this.trace(\"unsubscribeFromActiveSpeakerDetector\")}listAudioInputDevices(e=!1){return n(this,void 0,void 0,(function*(){const t=yield this.deviceController.listAudioInputDevices(e);return this.trace(\"listAudioInputDevices\",e,t),t}))}listVideoInputDevices(e=!1){return n(this,void 0,void 0,(function*(){const t=yield this.deviceController.listVideoInputDevices(e);return this.trace(\"listVideoInputDevices\",e,t),t}))}listAudioOutputDevices(e=!1){return n(this,void 0,void 0,(function*(){const t=yield this.deviceController.listAudioOutputDevices(e);return this.trace(\"listAudioOutputDevices\",e,t),t}))}startAudioInput(e){return n(this,void 0,void 0,(function*(){return this.trace(\"startAudioInput\",e),this.deviceController.startAudioInput(e)}))}stopAudioInput(){return n(this,void 0,void 0,(function*(){return this.trace(\"stopAudioInput\"),this.deviceController.stopAudioInput()}))}startVideoInput(e){return n(this,void 0,void 0,(function*(){return r.isVideoTransformDevice(e)?this.trace(\"startVideoInput with transform device\"):this.trace(\"startVideoInput\",e),this.deviceController.startVideoInput(e)}))}stopVideoInput(){return n(this,void 0,void 0,(function*(){return this.trace(\"stopVideoInput\"),this.deviceController.stopVideoInput()}))}chooseAudioOutput(e){const t=this.deviceController.chooseAudioOutput(e);return this.trace(\"chooseAudioOutput\",e),t}addDeviceChangeObserver(e){this.deviceController.addDeviceChangeObserver(e),this.trace(\"addDeviceChangeObserver\")}removeDeviceChangeObserver(e){this.deviceController.removeDeviceChangeObserver(e),this.trace(\"removeDeviceChangeObserver\")}createAnalyserNodeForAudioInput(){const e=this.deviceController.createAnalyserNodeForAudioInput();return this.trace(\"createAnalyserNodeForAudioInput\"),e}startVideoPreviewForVideoInput(e){this.deviceController.startVideoPreviewForVideoInput(e),this.trace(\"startVideoPreviewForVideoInput\",e.id)}stopVideoPreviewForVideoInput(e){this.deviceController.stopVideoPreviewForVideoInput(e),this.trace(\"stopVideoPreviewForVideoInput\",e.id)}setDeviceLabelTrigger(e){this.deviceController.setDeviceLabelTrigger(e),this.trace(\"setDeviceLabelTrigger\")}mixIntoAudioInput(e){const t=this.deviceController.mixIntoAudioInput(e);return this.trace(\"mixIntoAudioInput\",e.id),t}chooseVideoInputQuality(e,t,i){this.deviceController.chooseVideoInputQuality(e,t,i),this.trace(\"chooseVideoInputQuality\",{width:e,height:t,frameRate:i})}setVideoMaxBandwidthKbps(e){this.audioVideoController.setVideoMaxBandwidthKbps(e),this.trace(\"setVideoMaxBandwidthKbps\",e)}setVideoCodecSendPreferences(e){this.audioVideoController.setVideoCodecSendPreferences(e),this.trace(\"setVideoCodecSendPreferences\",e)}getVideoInputQualitySettings(){const e=this.deviceController.getVideoInputQualitySettings();return this.trace(\"getVideoInputQualitySettings\"),e}setContentAudioProfile(e){this.trace(\"setContentAudioProfile\",e),this.contentShareController.setContentAudioProfile(e)}enableSimulcastForContentShare(e,t){this.trace(\"enableSimulcastForContentShare\"),this.contentShareController.enableSimulcastForContentShare(e,t)}startContentShare(e){const t=this.contentShareController.startContentShare(e);return this.trace(\"startContentShare\"),t}startContentShareFromScreenCapture(e,t){const i=this.contentShareController.startContentShareFromScreenCapture(e,t);return this.trace(\"startContentShareFromScreenCapture\"),i}pauseContentShare(){this.contentShareController.pauseContentShare(),this.trace(\"pauseContentShare\")}unpauseContentShare(){this.contentShareController.unpauseContentShare(),this.trace(\"unpauseContentShare\")}stopContentShare(){this.contentShareController.stopContentShare(),this.trace(\"stopContentShare\")}addContentShareObserver(e){this.contentShareController.addContentShareObserver(e),this.trace(\"addContentShareObserver\")}removeContentShareObserver(e){this.contentShareController.removeContentShareObserver(e),this.trace(\"removeContentShareObserver\")}setContentShareVideoCodecPreferences(e){this.contentShareController.setContentShareVideoCodecPreferences(e),this.trace(\"setContentShareVideoCodecPreferences\")}trace(e,t,i){let n=`API/DefaultAudioVideoFacade/${this.audioVideoController.configuration.meetingId}/${this.audioVideoController.configuration.credentials.attendeeId}/${e}`;void 0!==t&&(n+=` ${JSON.stringify(t)}`),void 0!==i&&(n+=` -> ${JSON.stringify(i)}`),this.audioVideoController.logger.info(n)}getRemoteVideoSources(){const e=this.audioVideoController.getRemoteVideoSources();return this.trace(\"getRemoteVideoSources\",null,e),e}get transcriptionController(){return this.realtimeController.transcriptionController}promoteToPrimaryMeeting(e){this.audioVideoController.removeObserver(this),this.audioVideoController.addObserver(this);const t=this.audioVideoController.promoteToPrimaryMeeting(e);return this.trace(\"promoteToPrimaryMeeting\",null,t),t}demoteFromPrimaryMeeting(){this.trace(\"demoteFromPrimaryMeeting\"),this.audioVideoController.demoteFromPrimaryMeeting()}audioVideoWasDemotedFromPrimaryMeeting(e){this.contentShareController.stopContentShare(),this.audioVideoController.removeObserver(this)}}},179:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(8074),s=i(9734);class o extends r.default{constructor(e,t){super(e,t),this.blurCanvas=document.createElement(\"canvas\"),this.blurCanvasCtx=this.blurCanvas.getContext(\"2d\"),this.blurCanvas.width=this.spec.model.input.width,this.blurCanvas.height=this.spec.model.input.height,this.logger.info(\"BackgroundBlur processor using builtin blur\")}drawImageWithMask(e,t){const i=this.blurredImage,{canvasCtx:n,targetCanvas:r}=this,{width:s,height:o}=r;t&&i?(this.scaledCanvas.getContext(\"2d\").putImageData(t,0,0),this.blurCanvasCtx.putImageData(this.blurredImage,0,0),n.save(),n.clearRect(0,0,s,o),n.drawImage(this.scaledCanvas,0,0,s,o),n.globalCompositeOperation=\"source-in\",n.drawImage(e,0,0,s,o),n.globalCompositeOperation=\"destination-over\",n.drawImage(this.blurCanvas,0,0,s,o),n.restore()):n.clearRect(0,0,s,o)}setBlurStrength(e){if(super.setBlurStrength(e),this.worker){this.modelInitialized=!1,this.worker.postMessage({msg:\"destroy\"});const e=this.spec.model;this.worker.postMessage({msg:\"loadModel\",payload:{modelUrl:e.path,inputHeight:e.input.height,inputWidth:e.input.width,inputChannels:4,modelRangeMin:e.input.range[0],modelRangeMax:e.input.range[1],blurPixels:this.blurAmount}})}}setBlurPixels(){this.blurAmount=s.BlurStrengthMapper.getBlurAmount(this._blurStrength,{height:540}),this.logger.info(`background blur amount set to ${this.blurAmount}`)}handleInitialize(e){if(this.logger.info(`received initialize message: ${this.stringify(e)}`),!e.payload)return this.logger.error(\"failed to initialize module\"),void this.initWorkerPromise.reject(new Error(\"failed to initialize the module\"));const t=this.spec.model;this.worker.postMessage({msg:\"loadModel\",payload:{modelUrl:t.path,inputHeight:t.input.height,inputWidth:t.input.width,inputChannels:4,modelRangeMin:t.input.range[0],modelRangeMax:t.input.range[1],blurPixels:this.blurAmount}}),this.initWorkerPromise.resolve({})}handlePredict(e){this.blurredImage=e.payload.blurOutput,super.handlePredict(e)}destroy(){const e=Object.create(null,{destroy:{get:()=>super.destroy}});var t;return n(this,void 0,void 0,(function*(){e.destroy.call(this),null===(t=this.blurCanvas)||void 0===t||t.remove(),this.blurCanvas=void 0}))}}t.default=o},8074:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(1851),s=i(9734),o=i(9852);class a extends r.default{constructor(e,t){super(\"background blur\",e,t,new o.default),this.blurAmount=0,this.setBlurStrength(t.blurStrength),this.logger.info(\"BackgroundBlur processor successfully created\"),this.logger.info(`BackgroundBlur spec: ${this.stringify(this.spec)}`),this.logger.info(`BackgroundBlur options: ${this.stringify(t)}`)}validateOptions(e){if(super.validateOptions(e),!e.blurStrength)throw new Error(\"processor has null options - blurStrength\")}initOnFirstExecution(){this.setBlurPixels()}drawImageWithMask(e,t){t||(t=new ImageData(this.spec.model.input.width,this.spec.model.input.height)),this.scaledCanvas.getContext(\"2d\").putImageData(t,0,0);const{canvasCtx:i,targetCanvas:n}=this,{width:r,height:s}=n;i.save(),i.clearRect(0,0,r,s),i.drawImage(this.scaledCanvas,0,0,r,s),i.globalCompositeOperation=\"source-in\",i.drawImage(e,0,0,r,s),i.globalCompositeOperation=\"destination-over\",i.filter=`blur(${this.blurAmount}px)`,i.drawImage(e,0,0,n.width,n.height),i.restore()}setBlurStrength(e){this._blurStrength=e,this.logger.info(`blur strength set to ${this._blurStrength}`),this.setBlurPixels()}setBlurPixels(){this.blurAmount=s.BlurStrengthMapper.getBlurAmount(this._blurStrength,{height:this.sourceHeight}),this.logger.info(`background blur amount set to ${this.blurAmount}`)}addObserver(e){this.delegate.addObserver(e)}removeObserver(e){this.delegate.removeObserver(e)}static isSupported(){return n(this,void 0,void 0,(function*(){const e=document.createElement(\"canvas\"),t=void 0!==e.getContext(\"2d\").filter;return e.remove(),t}))}setEventController(e){this.eventController?this.eventController=e:(this.eventController=e,this.publishBackgroundFilterEvent())}publishBackgroundFilterEvent(){const e={backgroundBlurEnabled:\"true\",backgroundBlurStrength:this._blurStrength,backgroundReplacementEnabled:\"false\",backgroundFilterVersion:1};this.eventController.publishEvent(\"backgroundFilterConfigSelected\",e)}}t.default=a},9734:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.BlurStrengthMapper=void 0;class i{static getBlurAmount(e,t){if(e<=0)throw new Error(`invalid value for blur strength: ${e}`);return Math.round(e*t.height/this.BLUR_STRENGTH_DIVISOR)}}t.BlurStrengthMapper=i,i.BLUR_STRENGTH_DIVISOR=540,t.default={LOW:7,MEDIUM:15,HIGH:30}},1260:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(4243),s=i(8030),o=i(813),a=i(2801),c=i(179),d=i(8074),l=i(9734);class u extends a.default{setBlurStrength(){}loadAssets(){return n(this,void 0,void 0,(function*(){}))}addObserver(){}removeObserver(){}}class h extends r.default{static create(e,t){return n(this,void 0,void 0,(function*(){e=h.resolveSpec(e),t=h.resolveOptions(t);const{logger:i}=t,n=yield h.isSupported(e,t);if(i.info(`processor is ${n?\"\":\"not\"} supported`),!n)return i.warn(\"Using no-op processor because background blur is not supported\"),new u;let r;return(yield d.default.isSupported())?(i.info(\"Using browser-provided background blur\"),r=new d.default(e,t)):(i.info(\"Using built-in background blur\"),r=new c.default(e,t)),yield r.loadAssets(),r}))}static resolveOptions(e={}){let t=Object.assign({},e);return t.blurStrength||(t.blurStrength=l.default.MEDIUM),t.logger||(t.logger=new s.default(\"BackgroundBlurProcessor\",o.default.INFO)),t=super.resolveOptions(t),t}static isSupported(e,t){return e=h.resolveSpec(e),t=h.resolveOptions(t),super.isSupported(e,t)}}t.default=h},9852:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(4627);class r extends n.default{}t.default=r},22:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});class i{constructor(){this.path=null,this.input=null,this.output=null}static builder(){return new i}withDefaultModel(){return this.withSelfieSegmentationDefaults()}withSelfieSegmentationDefaults(){return this.path=\"https://static.sdkassets.chime.aws/bgblur/models/selfie_segmentation_landscape.tflite\",this.input={height:144,width:256,range:[0,1],channels:3},this.output={height:144,width:256,range:[0,1],channels:1},this}withPath(e){return this.path=e,this}withInput(e){return this.input=e,this}withOutput(e){return this.output=e,this}validate(){if(!this.path)throw new Error(\"model spec path is not set\");if(!this.input)throw new Error(\"model spec input is not set\");if(!this.output)throw new Error(\"model spec output is not set\")}build(){return this.validate(),{path:this.path,input:this.input,output:this.output}}}t.default=i},3368:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e,t,i,n){this.delegate=e,this.reportingPeriodMillis=t,this.filterCPUUtilization=i,this.logger=n,this._processingFilter=!0,this.lastReportedEventTimestamp=0,this.lastFilterCompleteTimestamp=0,this.filterTotalMillis=0,this.filterCount=0,this.framerate=0,this.filterDurationNotifyMillis=0,this.setSegmentationDuration()}reportEvent(e){const t=e-this.lastReportedEventTimestamp;if(t>=this.reportingPeriodMillis){const i=this.filterCount,n=this.filterTotalMillis;if(this.filterCount=0,this.filterTotalMillis=0,this.lastReportedEventTimestamp=e,0===this.framerate||0===i)return;const r=Math.round(n/i),s=Math.round(this.framerate*(t/1e3))-i,o=Math.round(100*n/t);r>=this.filterDurationNotifyMillis&&this.delegate.filterFrameDurationHigh({framesDropped:s,avgFilterDurationMillis:r,framerate:this.framerate,periodMillis:t}),o>=this.filterCPUUtilization&&this.delegate.filterCPUUtilizationHigh({cpuUtilization:o,filterMillis:n,periodMillis:t})}}setSegmentationDuration(){this.filterDurationNotifyMillis=Math.round(1e3/this.framerate*.8)}frameReceived(e){e!==this.framerate&&(this.framerate=e,this.logger.info(`frame counter setting frame rate to ${this.framerate}`),this.setSegmentationDuration());const t=Date.now();this.reportEvent(t)}filterSubmitted(){this._processingFilter=!0,this.lastFilterCompleteTimestamp=Date.now()}filterComplete(){this.filterTotalMillis+=Date.now()-this.lastFilterCompleteTimestamp,this._processingFilter=!1,this.filterCount++}get processingSegment(){return this._processingFilter}}},1851:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0}),t.BackgroundFilterMonitor=void 0;const r=i(5021),s=i(9807),o=i(3368);class a{constructor(){this.value=void 0,this.resolve=null}whenNext(){return this.promise||(this.promise=new Promise((e=>this.resolve=e))),this.promise}next(e){this.value=e,this.resolve(e),delete this.promise}}class c{constructor(e,t,i,n,r){this.targetCanvas=document.createElement(\"canvas\"),this.canvasCtx=this.targetCanvas.getContext(\"2d\"),this.canvasVideoFrameBuffer=new s.default(this.targetCanvas),this.mask$=new a,this.sourceWidth=0,this.sourceHeight=0,this.frameNumber=0,this.videoFramesPerFilterUpdate=1,this.initWorkerPromise=c.createWorkerPromise(),this.loadModelPromise=c.createWorkerPromise(),this.modelInitialized=!1,this.destroyed=!1,this.filterType=e,this.validateSpec(t),this.validateOptions(i),this.spec=t,this.logger=i.logger,this.delegate=n,this.initCPUMonitor(i),this.eventController=r}static createWorkerPromise(){const e={resolve:null,reject:null,promise:null};return e.promise=new Promise(((t,i)=>{e.resolve=t,e.reject=i})),e}validateSpec(e){if(!e)throw new Error(\"processor has null spec\");if(!e.model)throw new Error(\"processor spec has null model\");if(!e.paths)throw new Error(\"processor spec has null paths\")}validateOptions(e){if(!e)throw new Error(\"processor has null options\");if(!e.logger)throw new Error(\"processor has null options - logger\");if(!e.reportingPeriodMillis)throw new Error(\"processor has null options - reportingPeriodMillis\");if(!e.filterCPUUtilization)throw new Error(\"processor has null options - filterCPUUtilization\")}initCPUMonitor(e){this.videoFramesPerFilterUpdate=1,this.frameCounter=new o.default(this.delegate,e.reportingPeriodMillis,e.filterCPUUtilization,this.logger),this.cpuMonitor=new d(5e3,{reduceCPUUtilization:()=>{this.updateVideoFramesPerFilterUpdate(Math.min(this.videoFramesPerFilterUpdate+1,10))},increaseCPUUtilization:()=>{this.updateVideoFramesPerFilterUpdate(Math.max(this.videoFramesPerFilterUpdate-1,1))}}),this.delegate.addObserver(this.cpuMonitor)}stringify(e){return JSON.stringify(e,null,2)}handleInitialize(e){if(this.logger.info(`received initialize message: ${this.stringify(e)}`),!e.payload)return this.logger.error(\"failed to initialize module\"),void this.initWorkerPromise.reject(new Error(\"failed to initialize the module\"));const t=this.spec.model;this.worker.postMessage({msg:\"loadModel\",payload:{modelUrl:t.path,inputHeight:t.input.height,inputWidth:t.input.width,inputChannels:4,modelRangeMin:t.input.range[0],modelRangeMax:t.input.range[1],blurPixels:0}}),this.initWorkerPromise.resolve({})}handleLoadModel(e){if(this.logger.info(`received load model message: ${this.stringify(e)}`),2!==e.payload)return this.logger.error(\"failed to load model! status: \"+e.payload),void this.loadModelPromise.reject(new Error(\"failed to load model! status: \"+e.payload));this.modelInitialized=!0,this.loadModelPromise.resolve({})}handlePredict(e){this.mask$.next(e.payload.output)}handleWorkerEvent(e){const t=e.data;switch(t.msg){case\"initialize\":this.handleInitialize(t);break;case\"loadModel\":this.handleLoadModel(t);break;case\"predict\":this.handlePredict(t);break;default:this.logger.info(`unexpected event msg: ${this.stringify(t)}`)}}loadAssets(){return n(this,void 0,void 0,(function*(){this.logger.info(\"start initializing the processor\");try{this.worker=yield r.loadWorker(this.spec.paths.worker,\"BackgroundFilterWorker\",{},null),this.worker.addEventListener(\"message\",(e=>this.handleWorkerEvent(e))),this.worker.postMessage({msg:\"initialize\",payload:{wasmPath:this.spec.paths.wasm,simdPath:this.spec.paths.simd}}),yield this.initWorkerPromise.promise,this.logger.info(`successfully initialized the ${this.filterType} worker`),yield this.loadModelPromise.promise,this.logger.info(`successfully loaded ${this.filterType} worker segmentation model`)}catch(e){throw new Error(`could not initialize the ${this.filterType} video frame processor due to '${e.message}'`)}this.logger.info(`successfully initialized the ${this.filterType} processor`)}))}process(e){return n(this,void 0,void 0,(function*(){if(this.destroyed)return e;this.frameCounter.frameReceived(e[0].framerate),this.cpuMonitor.frameReceived();const t=e[0].asCanvasElement();if(!t)return e;if(!this.modelInitialized)return e[0]=this.canvasVideoFrameBuffer,e;const i=t.width,n=t.height;if(0===i||0===n)return e;0===this.sourceWidth&&(this.sourceWidth=i,this.sourceHeight=n,this.targetCanvas.width=this.sourceWidth,this.targetCanvas.height=this.sourceHeight,this.logger.info(`${this.filterType} source width: ${this.sourceWidth}`),this.logger.info(`${this.filterType} source height: ${this.sourceHeight}`),this.initOnFirstExecution()),this.sourceWidth===i&&this.sourceHeight===n||(this.sourceWidth=i,this.sourceHeight=n,this.targetCanvas.width=this.sourceWidth,this.targetCanvas.height=this.sourceHeight);try{this.frameCounter.filterSubmitted();let e=this.mask$.value;const i=this.spec.model.input.width/t.width,n=this.spec.model.input.height/t.height;void 0===this.scaledCanvas&&(this.scaledCanvas=document.createElement(\"canvas\"),this.scaledCanvas.width=this.spec.model.input.width,this.scaledCanvas.height=this.spec.model.input.height);const r=this.scaledCanvas.getContext(\"2d\");r.save(),r.scale(i,n),r.drawImage(t,0,0),r.restore();const s=r.getImageData(0,0,this.scaledCanvas.width,this.scaledCanvas.height);if(this.frameNumber%this.videoFramesPerFilterUpdate==0){const t=this.mask$.whenNext();this.worker.postMessage({msg:\"predict\",payload:s},[s.data.buffer]),e=yield t}this.destroyed||this.drawImageWithMask(t,e)}catch(t){return this.logger.error(`could not process ${this.filterType} frame buffer due to ${t}`),e}finally{this.frameCounter.filterComplete(),this.frameNumber++}return e[0]=this.canvasVideoFrameBuffer,e}))}updateVideoFramesPerFilterUpdate(e){e!==this.videoFramesPerFilterUpdate&&(this.videoFramesPerFilterUpdate=e,this.logger.info(`Adjusting filter rate to compensate for CPU utilization. Filter rate is ${this.videoFramesPerFilterUpdate} video frames per filter.`))}destroy(){var e,t,i,r;return n(this,void 0,void 0,(function*(){this.destroyed=!0,this.delegate.removeObserver(this.cpuMonitor),this.canvasVideoFrameBuffer.destroy(),null===(e=this.worker)||void 0===e||e.postMessage({msg:\"destroy\"}),null===(t=this.worker)||void 0===t||t.postMessage({msg:\"stop\"}),null===(i=this.targetCanvas)||void 0===i||i.remove(),this.targetCanvas=void 0,null===(r=this.scaledCanvas)||void 0===r||r.remove(),this.scaledCanvas=void 0,this.logger.info(`${this.filterType} frame process destroyed`)}))}}t.default=c;class d{constructor(e,t){this.monitoringPeriodMillis=e,this.observer=t,this.lastCPUChangeTimestamp=0}filterCPUUtilizationHigh(){const e=Date.now();e-this.lastCPUChangeTimestamp>=this.monitoringPeriodMillis&&(this.lastCPUChangeTimestamp=e,this.observer.reduceCPUUtilization())}frameReceived(){const e=Date.now();e-this.lastCPUChangeTimestamp>=2*this.monitoringPeriodMillis&&(this.lastCPUChangeTimestamp=e,this.observer.increaseCPUUtilization())}}t.BackgroundFilterMonitor=d},4243:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(5021),s=i(9424),o=i(22),a=i(543),c=i(4046),d=()=>o.default.builder().withSelfieSegmentationDefaults().build(),l=\"https://static.sdkassets.chime.aws\",u={worker:`${l}/bgblur/workers/worker.js`,wasm:`${l}/bgblur/wasm/_cwt-wasm.wasm`,simd:`${l}/bgblur/wasm/_cwt-wasm-simd.wasm`};t.default=class{static defaultAssetSpec(){const e=c.default.sdkVersionSemVer;return{assetGroup:`sdk-${e.major}.${e.minor}`}}static createUrlWithParams(e,t){const i=new URL(e),n=Object.keys(t);for(const e of n)void 0!==t[e]&&i.searchParams.set(e,t[e]);return i.toString()}static resolveSpec(e){const{paths:t=u,model:i=d(),assetGroup:n=this.defaultAssetSpec().assetGroup,revisionID:r=this.defaultAssetSpec().revisionID}=e||{},s={assetGroup:n,revisionID:r,sdk:encodeURIComponent(c.default.sdkVersion),ua:encodeURIComponent(c.default.sdkUserAgentLowResolution)};return t.worker=this.createUrlWithParams(t.worker,s),t.wasm=this.createUrlWithParams(t.wasm,s),t.simd=this.createUrlWithParams(t.simd,s),i.path=this.createUrlWithParams(i.path,s),{paths:t,model:i,assetGroup:n,revisionID:r}}static resolveOptions(e){return e.reportingPeriodMillis||(e.reportingPeriodMillis=1e3),e.filterCPUUtilization?(e.filterCPUUtilization<0||e.filterCPUUtilization>100)&&(e.logger.warn(\"filterCPUUtilization must be set to a range between 0 and 100 percent. Falling back to default of 30 percent\"),e.filterCPUUtilization=30):e.filterCPUUtilization=30,e}static isSupported(e,t){const{logger:i}=t;return\"undefined\"==typeof globalThis?(i.info(\"Browser does not have globalThis.\"),Promise.resolve(!1)):(new a.default).supportsBackgroundFilter()?s.supportsWASM(globalThis,i)?this.supportsBackgroundFilter(globalThis,e,i):(i.info(\"Browser does not support WASM.\"),Promise.resolve(!1)):(i.info(\"Browser is not supported.\"),Promise.resolve(!1))}static supportsBackgroundFilter(e=globalThis,t,i){return n(this,void 0,void 0,(function*(){if(!s.supportsWorker(e,i))return i.info(\"Browser does not support web workers.\"),!1;const n=t.paths.worker;try{const e=yield r.loadWorker(n,\"BackgroundFilterWorker\",{},null);try{e.terminate()}catch(e){i.info(`Failed to terminate worker. ${e.message}`)}return!0}catch(e){return i.info(`Failed to fetch and instantiate test worker ${e.message}`),!1}}))}}},4627:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(){this.observers=new Set}addObserver(e){this.observers.add(e)}removeObserver(e){this.observers.delete(e)}filterFrameDurationHigh(e){var t;for(const i of this.observers)null===(t=i.filterFrameDurationHigh)||void 0===t||t.call(i,e)}filterCPUUtilizationHigh(e){var t;for(const i of this.observers)null===(t=i.filterCPUUtilizationHigh)||void 0===t||t.call(i,e)}}},9392:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(1851),s=i(1447);class o extends r.default{constructor(e,t){super(\"background replacement\",e,t,new s.default),this.replacementBlob=t.imageBlob,this.logger.info(\"BackgroundReplacement processor successfully created\"),this.logger.info(`BackgroundReplacement spec: ${this.stringify(this.spec)}`),this.logger.info(`BackgroundReplacement options: ${this.stringify(t)}`)}setImageBlob(e){return n(this,void 0,void 0,(function*(){this.replacementBlob=e,this.replacementImage=yield o.loadImage(this.createReplacementObjectUrl())}))}initOnFirstExecution(){}drawImageWithMask(e,t){t||(t=new ImageData(this.spec.model.input.width,this.spec.model.input.height)),this.scaledCanvas.getContext(\"2d\").putImageData(t,0,0);const{canvasCtx:i,targetCanvas:n}=this,{width:r,height:s}=n;i.save(),i.clearRect(0,0,r,s),i.drawImage(this.scaledCanvas,0,0,r,s),i.globalCompositeOperation=\"source-in\",i.drawImage(e,0,0,r,s),i.globalCompositeOperation=\"destination-over\",i.drawImage(this.replacementImage,0,0,n.width,n.height),i.restore()}static loadImageExecutor(e,t,i){const n=new Image;n.crossOrigin=\"Anonymous\",n.addEventListener(\"load\",(()=>{e(n)}),!1),n.addEventListener(\"error\",(e=>{t(new Error(`Could not load replacement image ${n.src}: ${e.message}`))}),!1),n.src=i}static loadImage(e){return n(this,void 0,void 0,(function*(){return new Promise(((t,i)=>this.loadImageExecutor(t,i,e)))}))}revokeReplacementObjectUrl(){this.replacementObjectUrl&&URL.revokeObjectURL(this.replacementObjectUrl)}createReplacementObjectUrl(){return this.revokeReplacementObjectUrl(),this.replacementObjectUrl=URL.createObjectURL(this.replacementBlob),this.replacementObjectUrl}loadAssets(){const e=Object.create(null,{loadAssets:{get:()=>super.loadAssets}});return n(this,void 0,void 0,(function*(){this.replacementImage=yield o.loadImage(this.createReplacementObjectUrl()),e.loadAssets.call(this)}))}addObserver(e){this.delegate.addObserver(e)}removeObserver(e){this.delegate.removeObserver(e)}destroy(){const e=Object.create(null,{destroy:{get:()=>super.destroy}});return n(this,void 0,void 0,(function*(){e.destroy.call(this),this.revokeReplacementObjectUrl()}))}setEventController(e){this.eventController?this.eventController=e:(this.eventController=e,this.publishBackgroundFilterEvent())}publishBackgroundFilterEvent(){this.eventController.publishEvent(\"backgroundFilterConfigSelected\",{backgroundBlurEnabled:\"false\",backgroundBlurStrength:\"low\",backgroundReplacementEnabled:\"true\",backgroundFilterVersion:1})}}t.default=o},9854:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(4243),s=i(8030),o=i(813),a=i(2801),c=i(9392);class d extends a.default{loadAssets(){return n(this,void 0,void 0,(function*(){}))}addObserver(){}removeObserver(){}setImageBlob(){return n(this,void 0,void 0,(function*(){}))}}class l extends r.default{static create(e,t){return n(this,void 0,void 0,(function*(){e=this.resolveSpec(e),t=this.resolveOptions(t),yield this.resolveOptionsAsync(t);const{logger:i}=t;if(!(yield l.isSupported(e,t)))return i.warn(\"Using no-op processor because background replacement is not supported\"),new d;i.info(\"Using background replacement filter\");const n=new c.default(e,t);return yield n.loadAssets(),n}))}static resolveOptions(e={}){const t=Object.assign({},e);return t.logger||(t.logger=new s.default(\"BackgroundReplacementProcessor\",o.default.INFO)),super.resolveOptions(t)}static resolveOptionsAsync(e){return n(this,void 0,void 0,(function*(){if(!e.imageBlob){const t=document.createElement(\"canvas\");t.width=100,t.height=100;const i=t.getContext(\"2d\");i.fillStyle=\"blue\",i.fillRect(0,0,100,100);const n=yield new Promise((e=>{t.toBlob(e)}));e.imageBlob=n}}))}static isSupported(e,t){const i=Object.create(null,{isSupported:{get:()=>super.isSupported}});return n(this,void 0,void 0,(function*(){e=this.resolveSpec(e),t=this.resolveOptions(t),yield this.resolveOptionsAsync(t);const n=t.imageBlob,r=URL.createObjectURL(n);try{yield c.default.loadImage(r)}catch(e){return t.logger.info(`Failed to fetch load replacement image ${e.message}`),!1}finally{URL.revokeObjectURL(r)}return i.isSupported.call(this,e,t)}))}}t.default=l},1447:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(4627);class r extends n.default{}t.default=r},8434:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e,t,i){this.fixedWaitMs=e,this.shortBackoffMs=t,this.longBackoffMs=i,this.currentRetry=0,this.fixedWaitMs<0&&(this.fixedWaitMs=0),this.shortBackoffMs<0&&(this.shortBackoffMs=0),this.longBackoffMs<0&&(this.longBackoffMs=0),this.reset()}reset(){this.currentRetry=0}nextBackoffAmountMs(){const e=Math.random()*Math.min(this.longBackoffMs,this.shortBackoffMs*Math.pow(2,this.currentRetry))+this.fixedWaitMs;return this.currentRetry+=1,e}}},5640:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(8434),r=i(7300);t.default=class{constructor(e,t,i){this.fixedWaitMs=e,this.shortBackoffMs=t,this.longBackoffMs=i}create(){return new n.default(this.fixedWaitMs,this.shortBackoffMs,this.longBackoffMs)}createWithLimit(e){return new r.default(this.fixedWaitMs,this.shortBackoffMs,this.longBackoffMs,e)}}},7300:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(8434);class r extends n.default{constructor(e,t,i,n){super(e,t,i),this.limit=n,this.attempts=0}nextBackoffAmountMs(){if(this.attempts++,this.attempts>this.limit)throw new Error(\"retry limit exceeded\");return super.nextBackoffAmountMs()}}t.default=r},543:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(3631),s=i(2238);class o{constructor(){this.FALLBACK_BROWSER={type:\"browser\",name:\"unknown\",version:\"unknown\",os:\"unknown\"},this.browser=r.detect()||this.FALLBACK_BROWSER,this.uaParserResult=navigator&&navigator.userAgent?new s.UAParser(navigator.userAgent).getResult():null,this.browserSupport={chrome:78,\"edge-chromium\":79,electron:7,firefox:75,ios:13,safari:13,opera:66,samsung:12,crios:86,fxios:23,\"ios-webview\":605,\"chromium-webview\":92},this.browserName={chrome:\"Google Chrome\",\"edge-chromium\":\"Microsoft Edge\",electron:\"Electron\",firefox:\"Mozilla Firefox\",ios:\"Safari iOS\",safari:\"Safari\",opera:\"Opera\",samsung:\"Samsung Internet\",crios:\"Chrome iOS\",fxios:\"Firefox iOS\",\"ios-webview\":\"WKWebView iOS\",\"chromium-webview\":\"Chrome WebView\"},this.chromeLike=[\"chrome\",\"edge-chromium\",\"chromium-webview\",\"opera\",\"samsung\"],this.webkitBrowsers=[\"crios\",\"fxios\",\"safari\",\"ios\",\"ios-webview\",\"edge-ios\"]}version(){return this.browser.version}majorVersion(){return null!==this.version()?parseInt(this.version().split(\".\")[0]):-1}osMajorVersion(){return parseInt(this.uaParserResult.os.version.split(\".\")[0])}name(){return this.browser.name}hasChromiumWebRTC(){for(const e of this.chromeLike)if(e===this.browser.name)return!0;return!1}hasWebKitWebRTC(){for(const e of this.webkitBrowsers)if(e===this.browser.name)return!0;return!1}hasFirefoxWebRTC(){return this.isFirefox()}requiresPlaybackLatencyHintForAudioContext(){return-1!==navigator.userAgent.indexOf(\"Windows\")}supportsCanvasCapturedStreamPlayback(){return!this.isIOSSafari()&&!this.isIOSChrome()&&!this.isIOSFirefox()&&!this.isIOSEdge()||this.isIOSSafari()&&this.majorVersion()>=o.MIN_IOS_SUPPORT_CANVAS_STREAM_PLAYBACK||this.majorVersion()>=o.MIN_IOS_NON_SAFARI_SUPPORT_CANVAS_STREAM_PLAYBACK}supportsBackgroundFilter(){return(\"safari\"!==this.name()||15!==this.majorVersion())&&!!this.supportsCanvasCapturedStreamPlayback()}supportsVideoLayersAllocationRtpHeaderExtension(){return this.hasChromiumWebRTC()}requiresResolutionAlignment(e,t){return this.isAndroid()&&this.isPixel3()?[64*Math.ceil(e/64),64*Math.ceil(t/64)]:[e,t]}requiresCheckForSdpConnectionAttributes(){return!this.isIOSSafari()&&!this.isIOSChrome()&&!this.isIOSFirefox()}requiresIceCandidateGatheringTimeoutWorkaround(){return this.hasChromiumWebRTC()}requiresBundlePolicy(){return\"max-bundle\"}requiresNoExactMediaStreamConstraints(){return this.isSamsungInternet()}requiresGroupIdMediaStreamConstraints(){return this.isSamsungInternet()}getDisplayMediaAudioCaptureSupport(){return this.isChrome()||this.isEdge()}doesNotSupportMediaDeviceLabels(){return\"chromium-webview\"===this.browser.name}isSupported(){return!(!this.browserSupport[this.browser.name]||this.majorVersion()e.includes(\"a=rtpmap:\"))).map((e=>e.replace(/.* /,\"\").replace(/\\/.*/,\"\"))).filter(((e,t,i)=>i.indexOf(e)===t)).filter((e=>\"rtx\"!==e&&\"red\"!==e&&\"ulpfec\"!==e))}))}supportsSetSinkId(){return\"setSinkId\"in HTMLAudioElement.prototype}disableResolutionScaleDown(){return this.isAndroid()}disable480pResolutionScaleDown(){return/( Chrome\\/98\\.)/i.test(navigator.userAgent)&&this.browser.os.startsWith(\"Windows\")}requiresDisablingH264Encoding(){return(this.isIOSSafari()||this.isIOSChrome()||this.isIOSFirefox())&&(\"15.1.0\"===this.version()||/( OS 15_1)/i.test(navigator.userAgent))}requiresVideoPlayWorkaround(){return this.isSafari()}isVideoFxSupportedBrowser(){return this.supportsBackgroundFilter()}isIOSSafari(){return\"ios\"===this.browser.name||\"ios-webview\"===this.browser.name||\"safari\"===this.browser.name&&/( Mac )/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1}isSafari(){return\"safari\"===this.browser.name||this.isIOSSafari()}isFirefox(){return\"firefox\"===this.browser.name}isIOSFirefox(){return\"fxios\"===this.browser.name}isIOSChrome(){return\"crios\"===this.browser.name}isChrome(){return\"chrome\"===this.browser.name}isEdge(){return\"edge-chromium\"===this.browser.name}isIOSEdge(){return\"edge-ios\"===this.browser.name}isSamsungInternet(){return\"samsung\"===this.browser.name}isAndroid(){return/(android)/i.test(navigator.userAgent)}isPixel3(){return/( pixel 3)/i.test(navigator.userAgent)}}t.default=o,o.MIN_IOS_SUPPORT_CANVAS_STREAM_PLAYBACK=16,o.MIN_IOS_NON_SAFARI_SUPPORT_CANVAS_STREAM_PLAYBACK=106},4571:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(289),r=i(6196),s=i(9496),o=i(2306);class a{constructor(e,t,i){this.logger=e,this.videoStreamIndex=t,this.selfAttendeeId=i,this.globalMetricReport=new o.default,this.streamMetricReports={},this.rtcStatsReport={},this.currentTimestampMs=0,this.previousTimestampMs=0,this.currentSsrcs={},this.overriddenObservableMetrics=new Map,this.identityValue=(e,t)=>{const i=t?this.streamMetricReports[t]:this.globalMetricReport;return Number(i.currentMetrics[e])},this.decoderLossPercent=(e,t)=>{const i=this.streamMetricReports[t],n=i.currentMetrics.concealedSamples-(i.previousMetrics.concealedSamples||0),r=i.currentMetrics.totalSamplesReceived-(i.previousMetrics.totalSamplesReceived||0);return r<=0||r-n<=0?0:n/r*100},this.packetLossPercent=(e,t)=>{const i=this.streamMetricReports[t],n=i.currentMetrics[e]-(i.previousMetrics[e]||0),r=i.currentMetrics.packetsLost-(i.previousMetrics.packetsLost||0),s=n+r;return s<=0||r<=0?0:100*r/s},this.jitterBufferMs=(e,t)=>{const i=this.streamMetricReports[t],n=i.currentMetrics.jitterBufferDelay-(i.previousMetrics.jitterBufferDelay||0),r=i.currentMetrics.jitterBufferEmittedCount-(i.previousMetrics.jitterBufferEmittedCount||0);return n<=0||r<=0?0:n/r*1e3},this.countPerSecond=(e,t)=>{const i=t?this.streamMetricReports[t]:this.globalMetricReport;let n=(this.currentTimestampMs-this.previousTimestampMs)/1e3;if(n<=0)return 0;this.previousTimestampMs<=0&&(n=1);const r=i.currentMetrics[e]-(i.previousMetrics[e]||0);return r<=0?0:Math.trunc(r/n)},this.bitsPerSecond=(e,t)=>{const i=t?this.streamMetricReports[t]:this.globalMetricReport;let n=(this.currentTimestampMs-this.previousTimestampMs)/1e3;if(n<=0)return 0;this.previousTimestampMs<=0&&(n=1);const r=8*(i.currentMetrics[e]-(i.previousMetrics[e]||0));return r<=0?0:Math.trunc(r/n)},this.secondsToMilliseconds=(e,t)=>{const i=t?this.streamMetricReports[t]:this.globalMetricReport;return Number(1e3*i.currentMetrics[e])},this.averageTimeSpentPerSecondInMilliseconds=(e,t)=>{const i=t?this.streamMetricReports[t]:this.globalMetricReport;let n=(this.currentTimestampMs-this.previousTimestampMs)/1e3;if(n<=0)return 0;this.previousTimestampMs<=0&&(n=1);const r=i.currentMetrics[e]-(i.previousMetrics[e]||0);return r<=0?0:1e3*r/n},this.isHardwareImplementation=(e,t)=>{const i=this.streamMetricReports[t],n=String(i.currentStringMetrics[e]),r=n.includes(\"ExternalDecoder\")||n.includes(\"ExternalEncoder\")||n.includes(\"EncodeAccelerator\")||n.includes(\"DecodeAccelerator\"),s=n.includes(\"fallback from\");return r&&!s?1:0},this.globalMetricMap={retransmittedBytesSent:{transform:this.identityValue,type:n.SdkMetric.Type.VIDEO_RETRANSMIT_BITRATE},totalEncodedBytesTarget:{transform:this.identityValue,type:n.SdkMetric.Type.VIDEO_TARGET_ENCODER_BITRATE},totalPacketSendDelay:{transform:this.identityValue,type:n.SdkMetric.Type.VIDEO_BUCKET_DELAY_MS},packetsDiscardedOnSend:{transform:this.countPerSecond,type:n.SdkMetric.Type.SOCKET_DISCARDED_PPS},availableIncomingBitrate:{transform:this.identityValue,type:n.SdkMetric.Type.VIDEO_AVAILABLE_RECEIVE_BANDWIDTH},availableOutgoingBitrate:{transform:this.identityValue,type:n.SdkMetric.Type.VIDEO_AVAILABLE_SEND_BANDWIDTH},currentRoundTripTime:{transform:this.secondsToMilliseconds,type:n.SdkMetric.Type.STUN_RTT_MS}},this.audioUpstreamMetricMap={jitter:{transform:this.secondsToMilliseconds,type:n.SdkMetric.Type.RTC_MIC_JITTER_MS},packetsSent:{transform:this.countPerSecond,type:n.SdkMetric.Type.RTC_MIC_PPS},bytesSent:{transform:this.bitsPerSecond,type:n.SdkMetric.Type.RTC_MIC_BITRATE},roundTripTime:{transform:this.secondsToMilliseconds,type:n.SdkMetric.Type.RTC_MIC_RTT_MS},packetsLost:{transform:this.packetLossPercent,type:n.SdkMetric.Type.RTC_MIC_FRACTION_PACKET_LOST_PERCENT,source:\"packetsSent\"}},this.audioDownstreamMetricMap={concealedSamples:{transform:this.countPerSecond},totalSamplesReceived:{transform:this.countPerSecond},decoderLoss:{transform:this.decoderLossPercent,type:n.SdkMetric.Type.RTC_SPK_FRACTION_DECODER_LOSS_PERCENT},packetsReceived:{transform:this.countPerSecond,type:n.SdkMetric.Type.RTC_SPK_PPS},packetsLost:{transform:this.packetLossPercent,type:n.SdkMetric.Type.RTC_SPK_FRACTION_PACKET_LOST_PERCENT,source:\"packetsReceived\"},jitter:{transform:this.secondsToMilliseconds,type:n.SdkMetric.Type.RTC_SPK_JITTER_MS},jitterBufferDelay:{transform:this.countPerSecond},jitterBufferEmittedCount:{transform:this.countPerSecond},jitterBufferMs:{transform:this.jitterBufferMs,type:n.SdkMetric.Type.RTC_SPK_JITTER_BUFFER_MS},bytesReceived:{transform:this.bitsPerSecond,type:n.SdkMetric.Type.RTC_SPK_BITRATE}},this.videoUpstreamMetricMap={roundTripTime:{transform:this.secondsToMilliseconds,type:n.SdkMetric.Type.VIDEO_SENT_RTT_MS},nackCount:{transform:this.countPerSecond,type:n.SdkMetric.Type.VIDEO_NACKS_RECEIVED},pliCount:{transform:this.countPerSecond,type:n.SdkMetric.Type.VIDEO_PLIS_RECEIVED},firCount:{transform:this.countPerSecond,type:n.SdkMetric.Type.VIDEO_FIRS_RECEIVED},framesPerSecond:{transform:this.identityValue,type:n.SdkMetric.Type.VIDEO_INPUT_FPS},framesEncoded:{transform:this.countPerSecond,type:n.SdkMetric.Type.VIDEO_ENCODE_FPS},packetsSent:{transform:this.countPerSecond,type:n.SdkMetric.Type.VIDEO_SENT_PPS},packetsLost:{transform:this.packetLossPercent,type:n.SdkMetric.Type.VIDEO_SENT_FRACTION_PACKET_LOST_PERCENT,source:\"packetsSent\"},bytesSent:{transform:this.bitsPerSecond,type:n.SdkMetric.Type.VIDEO_SENT_BITRATE},qpSum:{transform:this.countPerSecond,type:n.SdkMetric.Type.VIDEO_SENT_QP_SUM},frameHeight:{transform:this.identityValue,type:n.SdkMetric.Type.VIDEO_ENCODE_HEIGHT},frameWidth:{transform:this.identityValue,type:n.SdkMetric.Type.VIDEO_ENCODE_WIDTH},jitter:{transform:this.secondsToMilliseconds},totalEncodeTime:{transform:this.averageTimeSpentPerSecondInMilliseconds,type:n.SdkMetric.Type.VIDEO_ENCODE_MS},encoderImplementation:{transform:this.isHardwareImplementation,type:n.SdkMetric.Type.VIDEO_ENCODER_IS_HARDWARE}},this.videoDownstreamMetricMap={packetsReceived:{transform:this.countPerSecond,type:n.SdkMetric.Type.VIDEO_RECEIVED_PPS},packetsLost:{transform:this.packetLossPercent,type:n.SdkMetric.Type.VIDEO_RECEIVED_FRACTION_PACKET_LOST_PERCENT,source:\"packetsReceived\"},framesReceived:{transform:this.identityValue,type:n.SdkMetric.Type.VIDEO_RECEIVED_FPS},framesDecoded:{transform:this.countPerSecond,type:n.SdkMetric.Type.VIDEO_DECODE_FPS},nackCount:{transform:this.countPerSecond,type:n.SdkMetric.Type.VIDEO_NACKS_SENT},firCount:{transform:this.countPerSecond,type:n.SdkMetric.Type.VIDEO_FIRS_SENT},pliCount:{transform:this.countPerSecond,type:n.SdkMetric.Type.VIDEO_PLIS_SENT},bytesReceived:{transform:this.bitsPerSecond,type:n.SdkMetric.Type.VIDEO_RECEIVED_BITRATE},jitter:{transform:this.secondsToMilliseconds,type:n.SdkMetric.Type.VIDEO_RECEIVED_JITTER_MS},jitterBufferDelay:{transform:this.countPerSecond},jitterBufferEmittedCount:{transform:this.countPerSecond},jitterBufferMs:{transform:this.jitterBufferMs,type:n.SdkMetric.Type.VIDEO_JITTER_BUFFER_MS},qpSum:{transform:this.countPerSecond,type:n.SdkMetric.Type.VIDEO_RECEIVED_QP_SUM},frameHeight:{transform:this.identityValue,type:n.SdkMetric.Type.VIDEO_DECODE_HEIGHT},frameWidth:{transform:this.identityValue,type:n.SdkMetric.Type.VIDEO_DECODE_WIDTH},totalDecodeTime:{transform:this.averageTimeSpentPerSecondInMilliseconds,type:n.SdkMetric.Type.VIDEO_DECODE_MS},decoderImplementation:{transform:this.isHardwareImplementation,type:n.SdkMetric.Type.VIDEO_DECODER_IS_HARDWARE}},this.streamDimensionMap={encoderImplementation:n.SdkStreamDimension.Type.VIDEO_ENCODER_NAME,decoderImplementation:n.SdkStreamDimension.Type.VIDEO_DECODER_NAME},this.observableVideoMetricSpec={videoUpstreamBitrate:{source:\"bytesSent\",media:s.default.VIDEO,dir:r.default.UPSTREAM},videoUpstreamPacketsSent:{source:\"packetsSent\",media:s.default.VIDEO,dir:r.default.UPSTREAM},videoUpstreamPacketLossPercent:{source:\"packetsLost\",media:s.default.VIDEO,dir:r.default.UPSTREAM},videoUpstreamFramesEncodedPerSecond:{source:\"framesEncoded\",media:s.default.VIDEO,dir:r.default.UPSTREAM},videoUpstreamFrameHeight:{source:\"frameHeight\",media:s.default.VIDEO,dir:r.default.UPSTREAM},videoUpstreamFrameWidth:{source:\"frameWidth\",media:s.default.VIDEO,dir:r.default.UPSTREAM},videoUpstreamJitterMs:{source:\"jitter\",media:s.default.VIDEO,dir:r.default.UPSTREAM},videoUpstreamRoundTripTimeMs:{source:\"roundTripTime\",media:s.default.VIDEO,dir:r.default.UPSTREAM},videoDownstreamBitrate:{source:\"bytesReceived\",media:s.default.VIDEO,dir:r.default.DOWNSTREAM},videoDownstreamPacketLossPercent:{source:\"packetsLost\",media:s.default.VIDEO,dir:r.default.DOWNSTREAM},videoDownstreamPacketsReceived:{source:\"packetsReceived\",media:s.default.VIDEO,dir:r.default.DOWNSTREAM},videoDownstreamFramesDecodedPerSecond:{source:\"framesDecoded\",media:s.default.VIDEO,dir:r.default.DOWNSTREAM},videoDownstreamFrameHeight:{source:\"frameHeight\",media:s.default.VIDEO,dir:r.default.DOWNSTREAM},videoDownstreamFrameWidth:{source:\"frameWidth\",media:s.default.VIDEO,dir:r.default.DOWNSTREAM},videoDownstreamJitterMs:{source:\"jitter\",media:s.default.VIDEO,dir:r.default.DOWNSTREAM},videoDownstreamDelayMs:{source:\"jitterBufferMs\",media:s.default.VIDEO,dir:r.default.DOWNSTREAM}},this.observableMetricSpec={audioPacketsReceived:{source:\"packetsReceived\",media:s.default.AUDIO,dir:r.default.DOWNSTREAM},audioPacketsReceivedFractionLoss:{source:\"packetsLost\",media:s.default.AUDIO,dir:r.default.DOWNSTREAM},audioDecoderLoss:{source:\"decoderLoss\",media:s.default.AUDIO,dir:r.default.DOWNSTREAM},audioPacketsSent:{source:\"packetsSent\",media:s.default.AUDIO,dir:r.default.UPSTREAM},audioPacketLossPercent:{source:\"packetsLost\",media:s.default.AUDIO,dir:r.default.UPSTREAM},audioUpstreamRoundTripTimeMs:{source:\"roundTripTime\",media:s.default.AUDIO,dir:r.default.UPSTREAM},videoUpstreamBitrate:{source:\"bytesSent\",media:s.default.VIDEO,dir:r.default.UPSTREAM},videoPacketSentPerSecond:{source:\"packetsSent\",media:s.default.VIDEO,dir:r.default.UPSTREAM},audioSpeakerDelayMs:{source:\"jitterBufferMs\",media:s.default.AUDIO,dir:r.default.DOWNSTREAM},audioUpstreamJitterMs:{source:\"jitter\",media:s.default.AUDIO,dir:r.default.UPSTREAM},audioDownstreamJitterMs:{source:\"jitter\",media:s.default.AUDIO,dir:r.default.DOWNSTREAM},nackCountReceivedPerSecond:{source:\"nackCount\",media:s.default.VIDEO,dir:r.default.UPSTREAM},availableOutgoingBitrate:{source:\"availableOutgoingBitrate\"},availableIncomingBitrate:{source:\"availableIncomingBitrate\"},currentRoundTripTimeMs:{source:\"currentRoundTripTime\"}}}getMetricMap(e,t){switch(e){case s.default.AUDIO:switch(t){case r.default.UPSTREAM:return this.audioUpstreamMetricMap;case r.default.DOWNSTREAM:return this.audioDownstreamMetricMap}case s.default.VIDEO:switch(t){case r.default.UPSTREAM:return this.videoUpstreamMetricMap;case r.default.DOWNSTREAM:return this.videoDownstreamMetricMap}default:return this.globalMetricMap}}getStreamDimensionMap(){return this.streamDimensionMap}getObservableMetricValue(e){if(this.overriddenObservableMetrics.has(e))return this.overriddenObservableMetrics.get(e);const t=this.observableMetricSpec[e],i=this.getMetricMap(t.media,t.dir)[t.source],{transform:n,source:r}=i;if(!t.hasOwnProperty(\"media\"))return n(r||t.source);for(const e in this.streamMetricReports){const i=this.streamMetricReports[e];if(i.direction===t.dir&&i.mediaType===t.media)return n(r||t.source,Number(e))}return 0}getObservableVideoMetricValue(e,t){const i=this.observableVideoMetricSpec[e],n=this.getMetricMap(i.media,i.dir)[i.source],{transform:r,source:s}=n;return r(s||i.source,t)}getObservableMetrics(){const e={};for(const t in this.observableMetricSpec)e[t]=this.getObservableMetricValue(t);return e}getObservableVideoMetrics(){const e={};if(!this.videoStreamIndex||!this.selfAttendeeId)return this.logger.error(\"Need to define VideoStreamIndex and selfAttendeeId if using getObservableVideoMetrics API\"),e;for(const t in this.streamMetricReports)if(this.streamMetricReports[t].mediaType===s.default.VIDEO){const i={};for(const e in this.observableVideoMetricSpec)if(this.observableVideoMetricSpec[e].dir===this.streamMetricReports[t].direction){const n=this.getObservableVideoMetricValue(e,Number(t));isNaN(n)||(i[e]=n)}const n=this.streamMetricReports[t].groupId,r=this.streamMetricReports[t].streamId;let s=\"\";s=void 0!==this.videoStreamIndex.attendeeIdForGroupId?n?this.videoStreamIndex.attendeeIdForGroupId(n):this.selfAttendeeId:r?this.videoStreamIndex.attendeeIdForStreamId(r):this.selfAttendeeId,e[s]=e[s]?e[s]:{},e[s][t]=i}return e}getRTCStatsReport(){return this.rtcStatsReport}clone(){const e=new a(this.logger,this.videoStreamIndex,this.selfAttendeeId);return e.globalMetricReport=this.globalMetricReport,e.streamMetricReports=this.streamMetricReports,e.rtcStatsReport=this.rtcStatsReport,e.currentTimestampMs=this.currentTimestampMs,e.previousTimestampMs=this.previousTimestampMs,e.overriddenObservableMetrics=this.overriddenObservableMetrics,e}print(){const e={globalMetricReport:this.globalMetricReport,streamMetricReports:this.streamMetricReports,currentTimestampMs:this.currentTimestampMs,previousTimestampMs:this.previousTimestampMs};this.logger.debug((()=>`Client Metric Report: ${JSON.stringify(e)}`))}removeDestroyedSsrcs(){for(const e in this.streamMetricReports)this.currentSsrcs[e]||delete this.streamMetricReports[e]}overrideObservableMetric(e,t){this.overriddenObservableMetrics.set(e,t)}}t.default=a},6196:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.ClientMetricReportDirection=void 0,function(e){e[e.UPSTREAM=0]=\"UPSTREAM\",e[e.DOWNSTREAM=1]=\"DOWNSTREAM\"}(i=t.ClientMetricReportDirection||(t.ClientMetricReportDirection={})),t.default=i},9496:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.ClientMetricReportMediaType=void 0,function(e){e[e.AUDIO=0]=\"AUDIO\",e[e.VIDEO=1]=\"VIDEO\"}(i=t.ClientMetricReportMediaType||(t.ClientMetricReportMediaType={})),t.default=i},2770:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{}},2306:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(){this.previousMetrics={},this.currentMetrics={},this.currentStringMetrics={}}}},2811:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(){this.previousMetrics={},this.currentMetrics={},this.currentStringMetrics={}}}},3940:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e,t,i){this.minHealth=e.minHealth,this.maxHealth=e.maxHealth,this.currentHealth=e.initialHealth,this.currentData=t.clone(),this.name=i}minimumHealth(){return this.minHealth}maximumHealth(){return this.maxHealth}health(){return this.maximumHealth()}update(e){this.currentData=e}getConnectionHealthData(){return this.currentData.clone()}healthy(){return this.health()>this.minimumHealth()}healthIfChanged(){const e=this.health();return e!==this.currentHealth?(this.currentHealth=e,e):null}}},6688:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});class i{constructor(){this.connectionStartTimestampMs=0,this.consecutiveStatsWithNoPackets=0,this.consecutiveStatsWithNoAudioPacketsSent=0,this.lastPacketLossInboundTimestampMs=0,this.lastGoodSignalTimestampMs=0,this.lastWeakSignalTimestampMs=0,this.lastNoSignalTimestampMs=0,this.consecutiveMissedPongs=0,this.packetsReceivedInLastMinute=[],this.fractionPacketsLostInboundInLastMinute=[],this.audioSpeakerDelayMs=0,this.connectionStartTimestampMs=Date.now(),this.lastGoodSignalTimestampMs=Date.now()}static isTimestampRecent(e,t){return Date.now(){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(){this.minHealth=0,this.maxHealth=1,this.initialHealth=1,this.connectionUnhealthyThreshold=25,this.noSignalThresholdTimeMs=1e4,this.connectionWaitTimeMs=1e4,this.zeroBarsNoSignalTimeMs=5e3,this.oneBarWeakSignalTimeMs=5e3,this.twoBarsTimeMs=5e3,this.threeBarsTimeMs=1e4,this.fourBarsTimeMs=2e4,this.fiveBarsTimeMs=6e4,this.cooldownTimeMs=6e4,this.pastSamplesToConsider=15,this.goodSignalTimeMs=15e3,this.fractionalLoss=.5,this.packetsExpected=50,this.maximumTimesToWarn=2,this.missedPongsLowerThreshold=1,this.missedPongsUpperThreshold=4,this.maximumAudioDelayMs=6e4,this.maximumAudioDelayDataPoints=10,this.sendingAudioFailureSamplesToConsider=2,this.sendingAudioFailureInitialWaitTimeMs=3e3}}},9708:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(3940);class r extends n.default{constructor(e,t,i){super(t,i,\"Reconnection Health\"),this.logger=e,this.audioDelayPointsOverMaximum=0,r.CONNECTION_UNHEALTHY_THRESHOLD=t.connectionUnhealthyThreshold,r.CONNECTION_WAIT_TIME_MS=t.connectionWaitTimeMs,r.MISSED_PONGS_THRESHOLD=t.missedPongsUpperThreshold,r.MAXIMUM_AUDIO_DELAY_MS=t.maximumAudioDelayMs,r.MAXIMUM_AUDIO_DELAY_DATA_POINTS=t.maximumAudioDelayDataPoints}health(){if(this.currentData.isConnectionStartRecent(r.CONNECTION_WAIT_TIME_MS))return 1;const e=this.currentData.consecutiveStatsWithNoPackets>=r.CONNECTION_UNHEALTHY_THRESHOLD,t=this.currentData.consecutiveMissedPongs>=r.MISSED_PONGS_THRESHOLD;this.currentData.audioSpeakerDelayMs>r.MAXIMUM_AUDIO_DELAY_MS?this.audioDelayPointsOverMaximum+=1:this.audioDelayPointsOverMaximum=0;const i=this.audioDelayPointsOverMaximum>r.MAXIMUM_AUDIO_DELAY_DATA_POINTS;return i&&(this.audioDelayPointsOverMaximum=0),e||t||i?(this.logger.warn(`reconnection recommended due to: no packets received: ${e}, missed pongs: ${t}, bad audio delay: ${i}`),0):1}}t.default=r},2977:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(3940);class r extends n.default{constructor(e,t,i){super(t,i,\"Sending Audio Health\"),this.logger=e,this.sendingAudioFailureSamplesToConsider=t.sendingAudioFailureSamplesToConsider>0?t.sendingAudioFailureSamplesToConsider:1,this.sendingAudioFailureInitialWaitTimeMs=t.sendingAudioFailureInitialWaitTimeMs,this.maximumTimesToWarn=t.maximumTimesToWarn,this.coolDownTimeMs=t.cooldownTimeMs,this.lastWarnTimestampMs=0,this.warnCount=0}isSendingAudioUnhealthy(){const e=!this.currentData.isConnectionStartRecent(this.sendingAudioFailureInitialWaitTimeMs),t=this.currentData.consecutiveStatsWithNoAudioPacketsSent>=this.sendingAudioFailureSamplesToConsider;return e&&t}health(){if(this.isSendingAudioUnhealthy()){const e=Date.now()-this.lastWarnTimestampMsthis.minimumHealth()&&!e?(this.logger.warn(`Sending Audio is unhealthy for ${this.sendingAudioFailureSamplesToConsider} seconds consecutively.`),this.warnCount++,this.warnCount>this.maximumTimesToWarn?(this.logger.warn(\"SendingAudioFailure health policy maximum warnings breached. Falling back to reporting healthy.\"),this.maximumHealth()):(this.lastWarnTimestampMs=Date.now(),this.minimumHealth())):this.currentHealth}return this.maximumHealth()}}t.default=r},1922:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(3940);class r extends n.default{constructor(e,t){super(e,t,\"Unusable Audio Warning\"),this.coolDownTimeMs=e.cooldownTimeMs,this.pastSamplesToConsider=e.pastSamplesToConsider,this.fractionalLoss=e.fractionalLoss,this.packetsExpected=e.packetsExpected,this.maximumTimesToWarn=e.maximumTimesToWarn,this.lastWarnTimestampMs=0,this.warnCount=0}calculateFractionalLoss(){if(this.currentData.packetsReceivedInLastMinute.length=this.fractionalLoss?0!==this.currentHealth&&(this.lastWarnTimestampMs=Date.now(),this.warnCount++,this.warnCount>this.maximumTimesToWarn)?1:0:1}}t.default=r},8581:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(8660);t.default=class{constructor(e,t,i,n,r){this.audioVideoController=e,this.realtimeController=t,this.connectionHealthData=i,this.pingPong=n,this.statsCollector=r,this.isActive=!1,this.hasSeenValidPacketMetricsBefore=!1,this.realtimeController.realtimeSubscribeToLocalSignalStrengthChange((e=>{this.isActive&&this.receiveSignalStrengthChange(e)}))}start(){this.isActive=!0,this.pingPong.addObserver(this),this.pingPong.start(),this.audioVideoController.addObserver(this)}stop(){this.isActive=!1,this.pingPong.removeObserver(this),this.pingPong.stop(),this.audioVideoController.removeObserver(this)}receiveSignalStrengthChange(e){0===e?this.connectionHealthData.setLastNoSignalTimestampMs(Date.now()):e<=.5?this.connectionHealthData.setLastWeakSignalTimestampMs(Date.now()):this.connectionHealthData.setLastGoodSignalTimestampMs(Date.now()),this.updateConnectionHealth()}didReceivePong(e,t,i){this.connectionHealthData.setConsecutiveMissedPongs(0),this.statsCollector.logLatency(\"ping_pong\",t),this.statsCollector.logLatency(\"ping_pong_clock_skew\",i),this.updateConnectionHealth()}didMissPongs(){this.connectionHealthData.setConsecutiveMissedPongs(this.connectionHealthData.consecutiveMissedPongs+1),this.updateConnectionHealth()}metricsDidReceive(e){let t=0,i=0;const n=e.getObservableMetrics(),r=n.audioPacketsReceived,s=n.audioPacketsReceivedFractionLoss,o=n.audioSpeakerDelayMs;\"number\"!=typeof o||isNaN(o)||this.connectionHealthData.setAudioSpeakerDelayMs(o),\"number\"==typeof r&&\"number\"==typeof s&&(t=r,i=s,t<0||i<0||(this.addToMinuteWindow(this.connectionHealthData.packetsReceivedInLastMinute,t),this.addToMinuteWindow(this.connectionHealthData.fractionPacketsLostInboundInLastMinute,i),t>0?(this.hasSeenValidPacketMetricsBefore=!0,this.connectionHealthData.setConsecutiveStatsWithNoPackets(0)):this.hasSeenValidPacketMetricsBefore&&this.connectionHealthData.setConsecutiveStatsWithNoPackets(this.connectionHealthData.consecutiveStatsWithNoPackets+1),(0===t||i>0)&&this.connectionHealthData.setLastPacketLossInboundTimestampMs(Date.now()),\"number\"==typeof n.audioPacketsSent&&this.updateAudioPacketsSentInConnectionHealth(n.audioPacketsSent),this.updateConnectionHealth()))}updateAudioPacketsSentInConnectionHealth(e){e>0?this.connectionHealthData.setConsecutiveStatsWithNoAudioPacketsSent(0):this.connectionHealthData.setConsecutiveStatsWithNoAudioPacketsSent(this.connectionHealthData.consecutiveStatsWithNoAudioPacketsSent+1)}addToMinuteWindow(e,t){e.unshift(t),e.length>60&&e.pop()}updateConnectionHealth(){this.audioVideoController.forEachObserver((e=>{n.Maybe.of(e.connectionHealthDidChange).map((t=>t.bind(e)(this.connectionHealthData.clone())))}))}}},8890:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e.Modality=\"#content\"}(i||(i={})),t.default=i},8370:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(543),s=i(4142);class o{constructor(e){this.logger=e}get mediaStream(){return this._mediaStream}set mediaStream(e){this._mediaStream=e}acquireAudioInputStream(){return n(this,void 0,void 0,(function*(){return 0===this._mediaStream.getAudioTracks().length?(this.logger.info(\"No audio stream available. Synthesizing an audio stream.\"),s.default.synthesizeAudioDevice(0)):this._mediaStream}))}acquireVideoInputStream(){return n(this,void 0,void 0,(function*(){return this._mediaStream}))}acquireDisplayInputStream(e){return n(this,void 0,void 0,(function*(){return e&&e.video&&e.video.mandatory&&e.video.mandatory.chromeMediaSource&&e.video.mandatory.chromeMediaSourceId?navigator.mediaDevices.getUserMedia(e):navigator.mediaDevices.getDisplayMedia(e)}))}acquireScreenCaptureDisplayInputStream(e,t){return n(this,void 0,void 0,(function*(){return this.acquireDisplayInputStream(this.screenCaptureDisplayMediaConstraints(e,t))}))}screenCaptureDisplayMediaConstraints(e,t){return{audio:!(e||!(new r.default).getDisplayMediaAudioCaptureSupport()),video:Object.assign(Object.assign({},!e&&{frameRate:{max:t||o.defaultFrameRate}}),e&&{mandatory:{chromeMediaSource:\"desktop\",chromeMediaSourceId:e,maxFrameRate:t||o.defaultFrameRate}})}}toggleMediaStream(e){let t=!1;if(this.mediaStream)for(let i=0;i{this.stopContentShare()}));this.contentAudioVideo.start()}}))}startContentShareFromScreenCapture(e,t){return n(this,void 0,void 0,(function*(){const i=yield this.mediaStreamBroker.acquireScreenCaptureDisplayInputStream(e,t);return yield this.startContentShare(i),i}))}pauseContentShare(){this.mediaStreamBroker.toggleMediaStream(!1)&&this.forEachContentShareObserver((e=>{c.Maybe.of(e.contentShareDidPause).map((t=>t.call(e)))}))}unpauseContentShare(){this.mediaStreamBroker.toggleMediaStream(!0)&&this.forEachContentShareObserver((e=>{c.Maybe.of(e.contentShareDidUnpause).map((t=>t.call(e)))}))}setContentShareVideoCodecPreferences(e){this.contentAudioVideo.setVideoCodecSendPreferences(e)}destroy(){return n(this,void 0,void 0,(function*(){this.contentAudioVideo&&(this.destroyed=!0,this.contentAudioVideo.removeObserver(this),this.stopContentShare(),this.observerQueue.clear(),this.contentAudioVideo=void 0,this.attendeeAudioVideo=void 0,this.mediaStreamBroker=void 0)}))}stopContentShare(){this.contentAudioVideo.stop(),this.mediaStreamBroker.cleanup()}addContentShareObserver(e){this.observerQueue.add(e)}removeContentShareObserver(e){this.observerQueue.delete(e)}forEachContentShareObserver(e){for(const t of this.observerQueue)a.default.nextTick((()=>{this.observerQueue.has(t)&&e(t)}))}audioVideoDidStart(){this.mediaStreamBroker.mediaStream.getVideoTracks().length>0&&this.contentAudioVideo.videoTileController.startLocalVideoTile()}audioVideoDidStop(e){this.mediaStreamBroker.cleanup(),this.contentShareTile&&(this.attendeeAudioVideo.videoTileController.removeVideoTile(this.contentShareTile.id()),this.contentShareTile=null),this.forEachContentShareObserver((e=>{c.Maybe.of(e.contentShareDidStop).map((t=>t.call(e)))}))}setupContentShareEvents(){this.attendeeAudioVideo.realtimeController.realtimeSubscribeToAttendeeIdPresence(((e,t,i,n)=>{const r=new o.default(e).hasModality(o.default.MODALITY_CONTENT),s=new o.default(e).base()===this.attendeeAudioVideo.configuration.credentials.attendeeId;if(!r||!s||!t||this.contentShareTile)return;const a=this.mediaStreamBroker.mediaStream;if(null==a?void 0:a.getVideoTracks().length){this.contentShareTile=this.attendeeAudioVideo.videoTileController.addVideoTile();const e=a.getVideoTracks()[0];let t,i;if(e.getSettings){const n=e.getSettings();t=n.width,i=n.height}else{const n=e.getCapabilities();t=n.width,i=n.height}this.contentShareTile.bindVideoStream(this.contentAudioVideo.configuration.credentials.attendeeId,!1,a,t,i,null,this.contentAudioVideo.configuration.credentials.externalUserId)}this.forEachContentShareObserver((e=>{c.Maybe.of(e.contentShareDidStart).map((t=>t.call(e)))}))}))}}},7237:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});class n{static register(){\"document\"in i.g&&document.addEventListener&&n.shouldRegisterCSPMonitor&&(n.added||(document.addEventListener(\"securitypolicyviolation\",n.listener),n.added=!0))}static unregister(){\"document\"in i.g&&document.removeEventListener&&(document.removeEventListener(\"securitypolicyviolation\",n.listener),n.loggers=new Set,n.added=!1)}static disable(){n.shouldRegisterCSPMonitor=!1,n.unregister()}static addLogger(e){e&&n.loggers.add(e)}static removeLogger(e){e&&n.loggers.delete(e)}}t.default=n,n.loggers=new Set,n.shouldRegisterCSPMonitor=!0,n.added=!1,n.listener=e=>{const t=`Security Policy Violation\\nBlocked URI: ${e.blockedURI}\\nViolated Directive: ${e.violatedDirective}\\nOriginal Policy: ${e.originalPolicy}\\nDocument URI: ${e.documentURI}\\nSource File: ${e.sourceFile}\\nLine No.: ${e.lineNumber}\\n`;for(const e of n.loggers)e.error(t);0===n.loggers.size&&console.error(t)}},1018:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e,t,i,n,r,s){this.timestampMs=e,this.topic=t,this.data=i,this.senderAttendeeId=n,this.senderExternalUserId=r,this.throttled=!!s}text(){return(new TextDecoder).decode(this.data)}json(){return JSON.parse((new TextDecoder).decode(this.data))}}},146:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isDestroyable=void 0,t.isDestroyable=function(e){return e&&\"destroy\"in e}},1746:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isAudioTransformDevice=void 0,t.isAudioTransformDevice=function(e){return!!e&&\"object\"==typeof e&&\"mute\"in e&&\"stop\"in e&&\"intrinsicDevice\"in e}},4142:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(543),s=i(6354),o=i(7797),a=i(1515),c=i(8660),d=i(7673),l=i(3327),u=i(1746),h=i(8128),p=i(5348),m=i(1238),f=i(3110),g=i(4842),v=i(6991),S=i(6950),b=i(4500),y=i(7170);class w{constructor(e,t,i=new r.default,n){this.logger=e,this.browserBehavior=i,this.eventController=n,this.deviceInfoCache=null,this.activeDevices={audio:null,video:null},this.chosenVideoTransformDevice=null,this.audioOutputDeviceId=void 0,this.deviceChangeObservers=new Set,this.mediaStreamBrokerObservers=new Set,this.deviceLabelTrigger=()=>navigator.mediaDevices.getUserMedia({audio:!0,video:!0}),this.audioInputDestinationNode=null,this.audioInputSourceNode=null,this.videoInputQualitySettings=null,this.useWebAudio=!1,this.useMediaConstraintsFallback=!0,this.audioInputTaskQueue=new a.default,this.videoInputTaskQueue=new a.default,this.muted=!1,this.mediaStreamMuteObserver=(e,t)=>{for(const i of this.deviceChangeObservers)o.default.nextTick((()=>{this.deviceChangeObservers.has(i)&&i.audioInputMuteStateChanged&&i.audioInputMuteStateChanged(e,t)}))},this.alreadyHandlingDeviceChange=!1;const{enableWebAudio:c=!1,useMediaConstraintsFallback:d=!0}=t||{};this.useWebAudio=c,this.useMediaConstraintsFallback=d,this.videoInputQualitySettings=new b.default(w.defaultVideoWidth,w.defaultVideoHeight,w.defaultVideoFrameRate);const l=this.browserBehavior.requiresResolutionAlignment(this.videoInputQualitySettings.videoWidth,this.videoInputQualitySettings.videoHeight);this.videoInputQualitySettings.videoWidth=l[0],this.videoInputQualitySettings.videoHeight=l[1],this.logger.info(`DefaultDeviceController video dimension ${this.videoInputQualitySettings.videoWidth} x ${this.videoInputQualitySettings.videoHeight}`);try{this.mediaDeviceWrapper=(new s.default).create();const e=navigator.mediaDevices.getSupportedConstraints();this.logger.info(`Supported Constraints in this browser ${JSON.stringify(e)}`)}catch(t){e.error(t.message)}}isWatchingForDeviceChanges(){return!!this.onDeviceChangeCallback}ensureWatchingDeviceChanges(){var e;this.isWatchingForDeviceChanges()||(this.logger.info(\"Starting devicechange listener.\"),this.onDeviceChangeCallback=()=>{this.logger.info(\"Device change event callback is triggered\"),this.handleDeviceChange()},null===(e=this.mediaDeviceWrapper)||void 0===e||e.addEventListener(\"devicechange\",this.onDeviceChangeCallback))}stopWatchingDeviceChanges(){var e;this.isWatchingForDeviceChanges()&&(this.logger.info(\"Stopping devicechange listener.\"),null===(e=this.mediaDeviceWrapper)||void 0===e||e.removeEventListener(\"devicechange\",this.onDeviceChangeCallback),this.onDeviceChangeCallback=void 0)}shouldObserveDeviceChanges(){return!!this.deviceChangeObservers.size||(this.activeDevices.audio&&null!==this.activeDevices.audio.constraints||this.activeDevices.video&&null!==this.activeDevices.video.constraints||!!this.audioOutputDeviceId)}watchForDeviceChangesIfNecessary(){this.shouldObserveDeviceChanges()?this.ensureWatchingDeviceChanges():this.stopWatchingDeviceChanges()}destroy(){return n(this,void 0,void 0,(function*(){this.stopWatchingDeviceChanges(),yield this.stopAudioInput(),yield this.stopVideoInput()}))}listAudioInputDevices(e=!1){return n(this,void 0,void 0,(function*(){const t=yield this.listDevicesOfKind(\"audioinput\",e);return this.trace(\"listAudioInputDevices\",e,t),t}))}listVideoInputDevices(e=!1){return n(this,void 0,void 0,(function*(){const t=yield this.listDevicesOfKind(\"videoinput\",e);return this.trace(\"listVideoInputDevices\",e,t),t}))}listAudioOutputDevices(e=!1){return n(this,void 0,void 0,(function*(){const t=yield this.listDevicesOfKind(\"audiooutput\",e);return this.trace(\"listAudioOutputDevices\",e,t),t}))}pushAudioMeetingStateForPermissions(e){var t;null===(t=this.eventController)||void 0===t||t.publishEvent(void 0===e?\"audioInputUnselected\":\"audioInputSelected\")}pushVideoMeetingStateForPermissions(e){var t;null===(t=this.eventController)||void 0===t||t.publishEvent(void 0===e?\"videoInputUnselected\":\"videoInputSelected\")}startAudioInput(e){return n(this,void 0,void 0,(function*(){return yield this.audioInputTaskQueue.add((()=>this.startAudioInputTask(e)))}))}startAudioInputTask(e){var t;return n(this,void 0,void 0,(function*(){if(void 0!==e)try{return u.isAudioTransformDevice(e)?(this.logger.info(`Choosing transform input device ${e}`),yield this.chooseAudioTransformInputDevice(e)):(this.logger.info(`Choosing intrinsic audio input device ${e}`),this.removeTransform(),yield this.chooseInputIntrinsicDevice(\"audio\",e)),this.trace(\"startAudioInputDevice\",e,\"success\"),this.useWebAudio?(this.attachAudioInputStreamToAudioContext(this.activeDevices.audio.stream),this.pushAudioMeetingStateForPermissions(this.getMediaStreamDestinationNode().stream),yield null===(t=this.transform)||void 0===t?void 0:t.device.mute(this.muted),this.getMediaStreamDestinationNode().stream):(this.publishAudioInputDidChangeEvent(this.activeDevices.audio.stream),this.activeDevices.audio.stream)}catch(e){throw e}else this.logger.error(\"Audio input device cannot be undefined\")}))}stopAudioInput(){return n(this,void 0,void 0,(function*(){return this.audioInputTaskQueue.add((()=>this.stopAudioInputTask()))}))}stopAudioInputTask(){return n(this,void 0,void 0,(function*(){try{if(this.useWebAudio)return void this.releaseAudioTransformStream();this.stopTracksAndRemoveCallbacks(\"audio\")}finally{this.watchForDeviceChangesIfNecessary(),this.publishAudioInputDidChangeEvent(void 0)}}))}chooseAudioTransformInputDevice(e){var t;return n(this,void 0,void 0,(function*(){if((null===(t=this.transform)||void 0===t?void 0:t.device)===e)return;if(!this.useWebAudio)throw new Error(\"Cannot apply transform device without enabling Web Audio.\");const i=w.getAudioContext();if(i instanceof OfflineAudioContext);else switch(i.state){case\"running\":break;case\"closed\":throw new Error(\"Cannot choose a transform device with a closed audio context.\");case\"suspended\":yield i.resume()}let n;try{n=yield e.createAudioNode(i)}catch(e){throw this.logger.error(`Unable to create transform device node: ${e}.`),e}const r=yield e.intrinsicDevice();yield this.chooseInputIntrinsicDevice(\"audio\",r),this.logger.debug(`Got inner stream: ${r}.`),this.setTransform(e,n)}))}chooseVideoTransformInputDevice(e){var t;return n(this,void 0,void 0,(function*(){if(this.eventController&&e instanceof d.default&&e.passEventControllerToProcessors(this.eventController),e===this.chosenVideoTransformDevice)return void this.logger.info(\"Reselecting same VideoTransformDevice\");const i=this.chosenVideoTransformDevice;i&&this.logger.info(\"Switched from previous VideoTransformDevice\");const n=!!i,r=yield e.intrinsicDevice();if(!this.isMediaStreamReusableByDeviceId(null===(t=this.activeDevices.video)||void 0===t?void 0:t.stream,r))return this.logger.info(\"video transform device needs new intrinsic device\"),n&&i.onOutputStreamDisconnect(),this.chosenVideoTransformDevice=e,this.activeDevices.video=null,yield this.chooseInputIntrinsicDevice(\"video\",r),this.logger.info(\"apply processors to transform\"),void(yield this.chosenVideoTransformDevice.transformStream(this.activeDevices.video.stream));this.chosenVideoTransformDevice=e,this.logger.info(\"video transform device uses previous stream\"),this.logger.info(\"apply processors to transform\"),yield e.transformStream(this.activeDevices.video.stream)}))}startVideoInput(e){return n(this,void 0,void 0,(function*(){return yield this.videoInputTaskQueue.add((()=>this.startVideoInputTask(e)))}))}startVideoInputTask(e){return n(this,void 0,void 0,(function*(){if(e)try{return y.isVideoTransformDevice(e)?(this.logger.info(`Choosing video transform device ${e}`),yield this.chooseVideoTransformInputDevice(e),this.publishVideoInputDidChangeEvent(this.chosenVideoTransformDevice.outputMediaStream),this.chosenVideoTransformDevice.outputMediaStream):(this.chosenVideoInputIsTransformDevice()&&(this.chosenVideoTransformDevice.onOutputStreamDisconnect(),this.chosenVideoTransformDevice=null),yield this.chooseInputIntrinsicDevice(\"video\",e),this.trace(\"startVideoInputDevice\",e),this.publishVideoInputDidChangeEvent(this.activeDevices.video.stream),this.activeDevices.video.stream)}catch(e){throw e}else this.logger.error(\"Invalid video input device\")}))}stopVideoInput(){return n(this,void 0,void 0,(function*(){return this.videoInputTaskQueue.add((()=>this.stopVideoInputTask()))}))}stopVideoInputTask(){return n(this,void 0,void 0,(function*(){try{if(this.chosenVideoInputIsTransformDevice())return void this.releaseVideoTransformStream();this.stopTracksAndRemoveCallbacks(\"video\")}finally{this.watchForDeviceChangesIfNecessary(),this.publishVideoInputDidChangeEvent(void 0)}}))}chooseAudioOutput(e){return n(this,void 0,void 0,(function*(){this.audioOutputDeviceId=e,this.watchForDeviceChangesIfNecessary();const t=this.deviceInfoFromDeviceId(\"audiooutput\",this.audioOutputDeviceId);this.publishAudioOutputDidChangeEvent(t),this.trace(\"chooseAudioOutput\",e,null)}))}addDeviceChangeObserver(e){this.logger.info(\"adding device change observer\"),this.deviceChangeObservers.add(e),this.watchForDeviceChangesIfNecessary(),this.trace(\"addDeviceChangeObserver\")}removeDeviceChangeObserver(e){this.logger.info(\"removing device change observer\"),this.deviceChangeObservers.delete(e),this.watchForDeviceChangesIfNecessary(),this.trace(\"removeDeviceChangeObserver\")}createAnalyserNodeForAudioInput(){var e,t;if(!this.activeDevices.audio)return null;const i=null===(t=null===(e=this.transform)||void 0===e?void 0:e.nodes)||void 0===t?void 0:t.end;if(i){const e=i.context.createAnalyser();return e.removeOriginalInputs=()=>{try{i.disconnect(e)}catch(e){}},i.connect(e),e}return this.createAnalyserNodeForRawAudioInput()}createAnalyserNodeForRawAudioInput(){return this.activeDevices.audio?this.createAnalyserNodeForStream(this.activeDevices.audio.stream):null}createAnalyserNodeForStream(e){const t=w.getAudioContext(),i=t.createAnalyser(),n=t.createMediaStreamSource(e);return n.connect(i),this.trace(\"createAnalyserNodeForAudioInput\"),i.removeOriginalInputs=()=>{try{n.disconnect(i)}catch(e){}},i}startVideoPreviewForVideoInput(e){if(!this.activeDevices.video)return this.logger.warn(\"cannot bind video preview since video input device has not been chosen\"),void this.trace(\"startVideoPreviewForVideoInput\",e.id);l.default.connectVideoStreamToVideoElement(this.chosenVideoTransformDevice?this.chosenVideoTransformDevice.outputMediaStream:this.activeDevices.video.stream,e,!0),this.trace(\"startVideoPreviewForVideoInput\",e.id)}stopVideoPreviewForVideoInput(e){l.default.disconnectVideoStreamFromVideoElement(e,!1),this.trace(\"stopVideoPreviewForVideoInput\",e.id)}setDeviceLabelTrigger(e){if(this.deviceInfoCache)for(const e of this.deviceInfoCache)if(!e.label){this.deviceInfoCache=null;break}this.deviceLabelTrigger=e,this.trace(\"setDeviceLabelTrigger\")}mixIntoAudioInput(e){let t=null;return this.useWebAudio?(t=w.getAudioContext().createMediaStreamSource(e),t.connect(this.getMediaStreamOutputNode())):this.logger.warn(\"WebAudio is not enabled, mixIntoAudioInput will not work\"),this.trace(\"mixIntoAudioInput\",e.id),t}chooseVideoInputQuality(e,t,i){const n=this.browserBehavior.requiresResolutionAlignment(e,t);this.videoInputQualitySettings=new b.default(n[0],n[1],i)}getVideoInputQualitySettings(){return this.videoInputQualitySettings}acquireAudioInputStream(){return n(this,void 0,void 0,(function*(){return this.activeDevices.audio||(this.logger.info(\"No audio device chosen, creating empty audio device\"),yield this.startAudioInput(null)),this.useWebAudio?this.getMediaStreamDestinationNode().stream:this.activeDevices.audio.stream}))}acquireVideoInputStream(){return n(this,void 0,void 0,(function*(){if(!this.activeDevices.video)throw new Error(\"No video device chosen\");return this.chosenVideoInputIsTransformDevice()?this.chosenVideoTransformDevice.outputMediaStream:this.activeDevices.video.stream}))}acquireDisplayInputStream(e){return n(this,void 0,void 0,(function*(){throw new Error(\"unsupported\")}))}releaseAudioTransformStream(){this.logger.info(\"Stopping audio track for Web Audio graph\"),this.stopTracksAndRemoveCallbacks(\"audio\"),this.logger.info(\"Removing audio transform, if there is one.\"),this.removeTransform(),this.audioInputSourceNode&&(this.audioInputSourceNode.disconnect(),this.audioInputSourceNode=void 0),this.audioInputDestinationNode&&(this.audioInputDestinationNode.disconnect(),this.audioInputDestinationNode=void 0)}releaseVideoTransformStream(){this.logger.info(\"Stopping video track for transform\"),this.stopTracksAndRemoveCallbacks(\"video\"),this.logger.info(\"Disconnecting video transform\"),this.chosenVideoTransformDevice.onOutputStreamDisconnect(),this.chosenVideoTransformDevice=null}stopTracksAndRemoveCallbacks(e){const t=this.activeDevices[e];if(!t)return;const i=t.endedCallback,n=t.trackMuteCallback,r=t.trackUnmuteCallback;for(const s of t.stream.getTracks())s.stop(),i&&s.removeEventListener(\"ended\",i),n&&s.removeEventListener(\"mute\",n),r&&s.removeEventListener(\"unmute\",r),delete t.endedCallback,delete t.trackMuteCallback,delete t.trackUnmuteCallback,delete this.activeDevices[e]}chosenVideoInputIsTransformDevice(){return!!this.chosenVideoTransformDevice}muteLocalAudioInputStream(){this.toggleLocalAudioInputStream(!1)}unmuteLocalAudioInputStream(){this.toggleLocalAudioInputStream(!0)}toggleLocalAudioInputStream(e){var t;let i=this.activeDevices.audio;if(this.useWebAudio&&(i=this.getMediaStreamDestinationNode()),i){for(const t of i.stream.getTracks())t.enabled!==e&&(t.enabled=e);this.muted!==!e&&(this.muted=!e,null===(t=this.transform)||void 0===t||t.device.mute(this.muted))}}static getIntrinsicDeviceId(e){if(!e)return;if(\"string\"==typeof e)return e;if(e.id)return e.id;const t=e.deviceId;if(!t)return;if(\"string\"==typeof t||Array.isArray(t))return t;const i=t;return\"string\"==typeof i.exact||Array.isArray(i.exact)?i.exact:void 0}static createEmptyAudioDevice(){return w.synthesizeAudioDevice(0)}static synthesizeAudioDevice(e){const t=w.getAudioContext(),i=t.createMediaStreamDestination();if(e){const n=t.createGain();n.gain.value=.1,n.connect(i);const r=t.createOscillator();r.frequency.value=e,r.connect(n),r.start()}else{const e=t.createBufferSource();try{e.buffer=t.createBuffer(1,5*t.sampleRate,t.sampleRate)}catch(i){if(!i||\"NotSupportedError\"!==i.name)throw i;e.buffer=t.createBuffer(1,5*w.defaultSampleRate,w.defaultSampleRate)}e.buffer.getChannelData(0)[0]=3e-4,e.loop=!0,e.connect(i),e.start()}return i.stream}listDevicesOfKind(e,t){return n(this,void 0,void 0,(function*(){return!t&&null!==this.deviceInfoCache&&this.isWatchingForDeviceChanges()||(yield this.updateDeviceInfoCacheFromBrowser()),this.listCachedDevicesOfKind(e)}))}updateDeviceInfoCacheFromBrowser(){var e,t;return n(this,void 0,void 0,(function*(){if(\"undefined\"==typeof MediaDeviceInfo)return void(this.deviceInfoCache=[]);let i=yield navigator.mediaDevices.enumerateDevices(),n=!0;for(const e of i)if(!e.label){n=!1;break}if(!n)try{this.logger.info(\"attempting to trigger media device labels since they are hidden\");const e=yield this.deviceLabelTrigger();i=yield navigator.mediaDevices.enumerateDevices();for(const t of e.getTracks())t.stop()}catch(i){this.logger.info(\"unable to get media device labels\"),null===(e=this.eventController)||void 0===e||e.publishEvent(\"audioInputFailed\",{audioInputErrorMessage:this.getErrorMessage(i)}),null===(t=this.eventController)||void 0===t||t.publishEvent(\"videoInputFailed\",{videoInputErrorMessage:this.getErrorMessage(i)})}this.logger.debug(`Update device info cache with devices: ${JSON.stringify(i)}`),this.deviceInfoCache=i}))}listCachedDevicesOfKind(e){const t=[];if(this.deviceInfoCache)for(const i of this.deviceInfoCache)i.kind===e&&t.push(i);return t}handleDeviceChange(){return n(this,void 0,void 0,(function*(){if(null===this.deviceInfoCache)return;if(this.alreadyHandlingDeviceChange)return void o.default.nextTick((()=>{this.handleDeviceChange()}));this.alreadyHandlingDeviceChange=!0;const e=this.listCachedDevicesOfKind(\"audioinput\"),t=this.listCachedDevicesOfKind(\"videoinput\"),i=this.listCachedDevicesOfKind(\"audiooutput\");yield this.updateDeviceInfoCacheFromBrowser();const n=this.listCachedDevicesOfKind(\"audioinput\"),r=this.listCachedDevicesOfKind(\"videoinput\"),s=this.listCachedDevicesOfKind(\"audiooutput\");this.forEachObserver((o=>{this.areDeviceListsEqual(e,n)||c.Maybe.of(o.audioInputsChanged).map((e=>e.bind(o)(n))),this.areDeviceListsEqual(t,r)||c.Maybe.of(o.videoInputsChanged).map((e=>e.bind(o)(r))),this.areDeviceListsEqual(i,s)||c.Maybe.of(o.audioOutputsChanged).map((e=>e.bind(o)(s)))})),this.alreadyHandlingDeviceChange=!1}))}handleDeviceStreamEnded(e,t){return n(this,void 0,void 0,(function*(){try{\"audio\"===e?(this.logger.warn(\"Audio input device which was active is no longer available, resetting to null device\"),yield this.startAudioInput(null)):(this.logger.warn(\"Video input device which was active is no longer available, stopping video\"),yield this.stopVideoInput())}catch(e){this.logger.error(\"Failed to choose null device after stream ended.\")}\"audio\"===e?this.forEachObserver((e=>{c.Maybe.of(e.audioInputStreamEnded).map((i=>i.bind(e)(t)))})):this.forEachObserver((e=>{c.Maybe.of(e.videoInputStreamEnded).map((i=>i.bind(e)(t)))}))}))}forEachObserver(e){for(const t of this.deviceChangeObservers)o.default.nextTick((()=>{this.deviceChangeObservers.has(t)&&e(t)}))}forEachMediaStreamBrokerObserver(e){for(const t of this.mediaStreamBrokerObservers)e(t)}areDeviceListsEqual(e,t){return JSON.stringify(e.map((e=>JSON.stringify(e))).sort())===JSON.stringify(t.map((e=>JSON.stringify(e))).sort())}intrinsicDeviceAsMediaStream(e){return e&&e.id?e:null}hasSameMediaStreamId(e,t,i){var n,r,s,o;let a;return\"audio\"===e?(a=null==i?void 0:i.audio.streamId,!!a&&a===(null===(r=null===(n=t.constraints)||void 0===n?void 0:n.audio)||void 0===r?void 0:r.streamId)):(a=null==i?void 0:i.video.streamId,!!a&&a===(null===(o=null===(s=null==t?void 0:t.constraints)||void 0===s?void 0:s.video)||void 0===o?void 0:o.streamId))}hasSameGroupId(e,t,i){if(\"\"===e)return!0;const n=w.getIntrinsicDeviceId(i);return this.logger.debug(`Checking deviceIds ${n} of type ${typeof n} with groupId ${e}`),\"string\"==typeof n&&e===this.getGroupIdFromDeviceId(t,n)}getGroupIdFromDeviceId(e,t){if(null!==this.deviceInfoCache){const i=this.listCachedDevicesOfKind(`${e}input`).find((e=>e.deviceId===t));if(i&&i.groupId)return this.logger.debug(`GroupId of deviceId ${t} found in cache is ${i.groupId}`),i.groupId}return this.logger.debug(`GroupId of deviceId ${t} found in cache is empty`),\"\"}handleGetUserMediaError(e,t){if(!e)throw new p.default(e);switch(e.name){case\"NotReadableError\":case\"TrackStartError\":throw new f.default(e);case\"NotFoundError\":case\"DevicesNotFoundError\":throw new m.default(e);case\"NotAllowedError\":case\"PermissionDeniedError\":case\"SecurityError\":throw t&&t{this.activeDevices[e]&&this.activeDevices[e].stream===t.stream&&(this.handleDeviceStreamEnded(e,n),delete t.endedCallback)},r.addEventListener(\"ended\",t.endedCallback,{once:!0})),\"audio\"===e){const e=t.stream.getAudioTracks()[0];if(e){const i=e.getSettings().deviceId||t.stream;t.trackMuteCallback=()=>{this.mediaStreamMuteObserver(i,!0)},t.trackUnmuteCallback=()=>{this.mediaStreamMuteObserver(i,!1)},e.addEventListener(\"mute\",t.trackMuteCallback,{once:!1}),e.addEventListener(\"unmute\",t.trackUnmuteCallback,{once:!1}),this.logger.debug(\"Notifying mute state after selection\"),e.muted?t.trackMuteCallback():t.trackUnmuteCallback()}}}))}calculateMediaStreamConstraints(e,t,i,n){if(n&&1===this.listCachedDevicesOfKind(`${e}input`).length)return!0;const r={};return this.browserBehavior.requiresNoExactMediaStreamConstraints()?r.deviceId=t:r.deviceId={exact:t},i&&(r.groupId=i),n?r:\"video\"===e?(r.width={ideal:this.videoInputQualitySettings.videoWidth},r.height={ideal:this.videoInputQualitySettings.videoHeight},r.frameRate={ideal:this.videoInputQualitySettings.videoFrameRate},r):(this.supportSampleRateConstraint()&&(r.sampleRate={ideal:w.defaultSampleRate}),this.supportSampleSizeConstraint()&&(r.sampleSize={ideal:w.defaultSampleSize}),this.supportChannelCountConstraint()&&(r.channelCount={ideal:w.defaultChannelCount}),Object.assign({echoCancellation:!0,googEchoCancellation:!0,googEchoCancellation2:!0,googAutoGainControl:!0,googAutoGainControl2:!0,googNoiseSuppression:!0,googNoiseSuppression2:!0,googHighpassFilter:!0},r))}getMediaStreamConstraintsFromTrackConstraints(e,t){return\"audio\"===e?{audio:t}:{video:t}}getMediaStreamConstraints(e,t,i=!1){let n={};if(!t)return null;const r=this.intrinsicDeviceAsMediaStream(t);if(r)return n.streamId=r.id,this.getMediaStreamConstraintsFromTrackConstraints(e,n);if(\"string\"==typeof t){let r=\"\";return this.browserBehavior.requiresGroupIdMediaStreamConstraints()&&(null!==this.deviceInfoCache?r=this.getGroupIdFromDeviceId(e,t):this.logger.error(\"Device cache is not populated. Please make sure to call list devices first\")),n=this.calculateMediaStreamConstraints(e,t,r,i),this.getMediaStreamConstraintsFromTrackConstraints(e,n)}return function(e){return\"object\"==typeof e&&\"deviceId\"in e&&\"groupId\"in e&&\"kind\"in e&&\"label\"in e}(t)?(n=this.calculateMediaStreamConstraints(e,t.deviceId,t.groupId,i),this.getMediaStreamConstraintsFromTrackConstraints(e,n)):(n=t,this.getMediaStreamConstraintsFromTrackConstraints(e,n))}deviceInfoFromDeviceId(e,t){if(null===this.deviceInfoCache)return null;for(const i of this.deviceInfoCache)if(i.kind===e&&i.deviceId===t)return i;return null}hasAppliedTransform(){return!!this.transform}isMediaStreamReusableByDeviceId(e,t){if(!e||!e.active||!t)return!1;if(t.id)return e.id===t.id;const i=this.getMediaTrackSettings(e);if(!i.deviceId)return!1;const n=w.getIntrinsicDeviceId(t);return\"string\"==typeof n&&i.deviceId===n}getMediaTrackSettings(e){var t;return null===(t=e.getTracks()[0])||void 0===t?void 0:t.getSettings()}reconnectAudioInputs(){if(!this.audioInputSourceNode)return;this.audioInputSourceNode.disconnect();const e=this.getMediaStreamOutputNode();this.audioInputSourceNode.connect(e)}setTransform(e,t){var i,n;null===(n=null===(i=this.transform)||void 0===i?void 0:i.nodes)||void 0===n||n.end.disconnect(),this.transform={nodes:t,device:e};const r=null==t?void 0:t.end,s=this.getMediaStreamDestinationNode();this.logger.debug(`Connecting transform node ${r} to destination ${s}.`),null==r||r.connect(s),this.reconnectAudioInputs()}removeTransform(){var e;const t=this.transform;if(t)return null===(e=this.transform.nodes)||void 0===e||e.end.disconnect(),this.transform=void 0,this.reconnectAudioInputs(),t}attachAudioInputStreamToAudioContext(e){var t;null===(t=this.audioInputSourceNode)||void 0===t||t.disconnect(),this.audioInputSourceNode=w.getAudioContext().createMediaStreamSource(e);const i=this.getMediaStreamOutputNode();this.audioInputSourceNode.connect(i)}getMediaStreamDestinationNode(){return this.audioInputDestinationNode||(this.audioInputDestinationNode=w.getAudioContext().createMediaStreamDestination()),this.audioInputDestinationNode}getMediaStreamOutputNode(){var e,t;return(null===(t=null===(e=this.transform)||void 0===e?void 0:e.nodes)||void 0===t?void 0:t.start)||this.getMediaStreamDestinationNode()}static setDefaultLatencyHint(e){w.defaultLatencyHint=e}static getAudioContext(){if(!w.audioContext){const e={};navigator.mediaDevices.getSupportedConstraints().sampleRate&&(e.sampleRate=w.defaultSampleRate),(new r.default).requiresPlaybackLatencyHintForAudioContext()&&(e.latencyHint=\"playback\"),w.defaultLatencyHint&&(e.latencyHint=w.defaultLatencyHint),w.audioContext=new(window.AudioContext||window.webkitAudioContext)(e)}return w.audioContext}static closeAudioContext(){if(w.audioContext)try{w.audioContext.close()}catch(e){}w.audioContext=null}addMediaStreamBrokerObserver(e){this.mediaStreamBrokerObservers.add(e)}removeMediaStreamBrokerObserver(e){this.mediaStreamBrokerObservers.delete(e)}publishVideoInputDidChangeEvent(e){this.forEachMediaStreamBrokerObserver((t=>{t.videoInputDidChange&&t.videoInputDidChange(e)})),this.pushVideoMeetingStateForPermissions(e)}publishAudioInputDidChangeEvent(e){this.forEachMediaStreamBrokerObserver((t=>{t.audioInputDidChange&&t.audioInputDidChange(e)})),this.pushAudioMeetingStateForPermissions(e)}publishAudioOutputDidChangeEvent(e){this.forEachMediaStreamBrokerObserver((t=>{t.audioOutputDidChange&&t.audioOutputDidChange(e)}))}supportSampleRateConstraint(){return this.useWebAudio&&!!navigator.mediaDevices.getSupportedConstraints().sampleRate}supportSampleSizeConstraint(){return this.useWebAudio&&!!navigator.mediaDevices.getSupportedConstraints().sampleSize}supportChannelCountConstraint(){return this.useWebAudio&&!!navigator.mediaDevices.getSupportedConstraints().channelCount}trace(e,t,i){let n=`API/DefaultDeviceController/${e}`;void 0!==t&&(n+=` ${JSON.stringify(t)}`),void 0!==i&&(n+=` -> ${JSON.stringify(i)}`),this.logger.info(n)}}t.default=w,w.permissionDeniedOriginDetectionThresholdMs=500,w.defaultVideoWidth=960,w.defaultVideoHeight=540,w.defaultVideoFrameRate=15,w.defaultSampleRate=48e3,w.defaultSampleSize=16,w.defaultChannelCount=1,w.audioContext=null},8128:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(){this.groupId=\"\"}matchesConstraints(e){return JSON.stringify(this.constraints)===JSON.stringify(e)}}},5348:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});class i extends Error{constructor(e,t){super(t||\"Error fetching device.\"),this.cause=e,this.name=\"GetUserMediaError\"}}t.default=i},6154:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0}),t.NoOpDeviceControllerWithEventController=void 0;const r=i(4015);class s extends r.default{constructor(e){super(),this.destroyed=!1}destroy(){return n(this,void 0,void 0,(function*(){this.destroyed=!0}))}listAudioInputDevices(){return Promise.resolve([])}listVideoInputDevices(){return Promise.resolve([])}listAudioOutputDevices(){return Promise.resolve([])}startAudioInput(e){return Promise.reject()}stopAudioInput(){return Promise.resolve()}startVideoInput(e){return Promise.reject()}stopVideoInput(){return Promise.resolve()}chooseAudioOutput(e){return Promise.reject()}addDeviceChangeObserver(e){}removeDeviceChangeObserver(e){}createAnalyserNodeForAudioInput(){return null}startVideoPreviewForVideoInput(e){}stopVideoPreviewForVideoInput(e){}setDeviceLabelTrigger(e){}mixIntoAudioInput(e){return null}chooseVideoInputQuality(e,t,i){}getVideoInputQualitySettings(){return null}}t.default=s,t.NoOpDeviceControllerWithEventController=class extends s{constructor(e){super(),this.eventController=e}}},1238:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(5348);class r extends n.default{constructor(e){super(e),this.name=\"NotFoundError\"}}t.default=r},3110:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(5348);class r extends n.default{constructor(e){super(e),this.name=\"NotReadableError\"}}t.default=r},4842:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(5348);class r extends n.default{constructor(e,t){super(e),this.constraint=t,this.name=\"OverconstrainedError\"}}t.default=r},6991:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(5348);class r extends n.default{constructor(e,t){super(e,t),this.name=\"PermissionDeniedError\"}}t.default=r},7786:function(e,t){\"use strict\";var i=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e){this.inner=e}mute(e){return i(this,void 0,void 0,(function*(){}))}stop(){var e;return i(this,void 0,void 0,(function*(){null===(e=this.node)||void 0===e||e.disconnect()}))}intrinsicDevice(){return i(this,void 0,void 0,(function*(){return this.inner}))}createAudioNode(e){var t;return i(this,void 0,void 0,(function*(){return null===(t=this.node)||void 0===t||t.disconnect(),this.node=yield this.createSingleAudioNode(e),{start:this.node,end:this.node}}))}}},6950:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(5348);class r extends n.default{constructor(e){super(e),this.name=\"TypeError\"}}t.default=r},4500:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e,t,i){this.videoWidth=e,this.videoHeight=t,this.videoFrameRate=i}}},7170:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isVideoTransformDevice=void 0,t.isVideoTransformDevice=function(e){return!!e&&\"object\"==typeof e&&\"transformStream\"in e&&\"stop\"in e&&\"intrinsicDevice\"in e}},8236:function(e,t){\"use strict\";var i=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e,t){if(this.devicePixelRatioSource=e,this.observerQueue=new Set,this.mediaQueryListener=()=>{this.observerQueue.forEach((e=>{e.devicePixelRatioChanged(this.devicePixelRatioSource.devicePixelRatio())}))},\"undefined\"==typeof window)return;const i=matchMedia(`(resolution: ${this.devicePixelRatioSource.devicePixelRatio()}dppx)`);\"function\"==typeof i.addEventListener?(i.addEventListener(\"change\",this.mediaQueryListener),this.mediaQueryList=i):\"function\"==typeof i.addListener?(i.addListener(this.mediaQueryListener),this.mediaQueryList=i):t.warn(\"ignoring DefaultDevicePixelRatioMonitor\")}destroy(){return i(this,void 0,void 0,(function*(){this.mediaQueryList&&(\"function\"==typeof this.mediaQueryList.addEventListener?this.mediaQueryList.removeEventListener(\"change\",this.mediaQueryListener):this.mediaQueryList.removeListener(this.mediaQueryListener)),delete this.mediaQueryListener,this.observerQueue.clear()}))}registerObserver(e){this.observerQueue.add(e),e.devicePixelRatioChanged(this.devicePixelRatioSource.devicePixelRatio())}removeObserver(e){this.observerQueue.delete(e)}}},9190:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{devicePixelRatio(){return\"undefined\"!=typeof window&&window&&window.devicePixelRatio?window.devicePixelRatio:1}}},3520:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},r=this&&this.__rest||function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&\"function\"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r({type:e.type,v:e.v,payloads:[...e.payloads]}),this.sendEvents=()=>n(this,void 0,void 0,(function*(){if(this.lock)return;const e=this.getItems(this.flushSize);if(0===e.length)return;this.lock=!0;const t=this.makeRequestBody(e);let i=!1;const n=Date.now();\"firefox\"===this.metadata.browserName.toLowerCase()&&this.cancellableEvents.set(n,e);try{this.logger.debug(`Event Reporting - InMemoryJSONEventBuffer - sendEvents - sending body ${t}`);const e=yield this.send(t);if(this.cancellableEvents.delete(n),e.ok)try{const i=yield e.json();this.logger.debug(`Event Reporting - InMemoryJSONEventBuffer - sendEvents - send successful events: ${t} message: ${JSON.stringify(i)}`)}catch(e){this.logger.warn(`Event Reporting - InMemoryJSONEventBuffer - sendEvents error reading OK response ${e} for events ${t}`)}else this.logger.error(`Event Reporting - InMemoryJSONEventBuffer - sendEvents - Failed to send events ${t} with response status ${e.status}`),i=!0}catch(e){i=!0,this.logger.warn(`Event Reporting - InMemoryJSONEventBuffer - sendEvents - Error in sending events ${t} to the ingestion endpoint ${e}`)}finally{this.lock=!1}i&&(this.cancellableEvents.delete(n),this.failedIngestionEvents.push(...e))}));const c=new a.default(o).getParserResult(),{browserMajorVersion:d}=c,l=r(c,[\"browserMajorVersion\"]),u=t.toJSON(),{type:h,v:p}=u,m=r(u,[\"type\",\"v\"]);this.authenticationToken=t.getAuthenticationToken(),this.metadata=Object.assign(Object.assign({},l),m),Object.keys(this.metadata).forEach((e=>this.attributesToFilter.push(e))),this.type=h,this.v=p,this.ingestionURL=i,this.logger=o,this.importantEvents=new Set(s);const{maxBufferCapacityKb:f,totalBufferItems:g,flushSize:v,flushIntervalMs:S,retryCountLimit:b}=e;this.maxBufferCapacityBytes=1024*f,this.totalBufferItems=g,this.maxBufferItemCapacityBytes=Math.round(this.maxBufferCapacityBytes/g),this.flushIntervalMs=S,this.flushSize=v,this.retryCountLimit=b,this.currentIngestionEvent=this.initializeAndGetCurrentIngestionEvent(),this.beaconEventListener=e=>this.beaconEventHandler(e),this.addEventListeners()}addEventListeners(){this.beaconEventListener&&\"window\"in i.g&&window.addEventListener&&\"document\"in i.g&&document.addEventListener&&(this.logger.debug(\"Event Reporting - InMemoryJSONEventBuffer - addEventListeners - adding pagehide and visibility change event listeners\"),window.addEventListener(\"pagehide\",this.beaconEventListener),document.addEventListener(\"visibilitychange\",this.beaconEventListener))}beaconEventHandler(e){(\"visibilitychange\"===e.type&&\"hidden\"===document.visibilityState||\"pagehide\"===e.type)&&(this.logger.debug(\"Event Reporting - InMemoryJSONEventBuffer - beaconEventHandler is triggered calling sendBeacon\"),this.sendBeacon())}removeEventListeners(){this.beaconEventListener&&\"window\"in i.g&&window.removeEventListener&&\"document\"in i.g&&document.removeEventListener&&(window.removeEventListener(\"pagehide\",this.beaconEventListener),document.removeEventListener(\"visibilitychange\",this.beaconEventListener),this.logger.debug(\"Event Reporting - InMemoryJSONEventBuffer - removeEventListeners - removing pagehide and visibility change event listeners\"))}start(){var e;this.removeEventListeners(),this.addEventListeners(),null===(e=this.intervalScheduler)||void 0===e||e.stop(),this.intervalScheduler=new o.default(this.flushIntervalMs),this.intervalScheduler.start((()=>this.sendEvents()))}stop(){var e;null===(e=this.intervalScheduler)||void 0===e||e.stop(),this.intervalScheduler=void 0,this.sendBeacon(),this.removeEventListeners()}addItem(e){return n(this,void 0,void 0,(function*(){this.logger.debug(`Event Reporting - InMemoryJSONEventBuffer - addItem - received event ${JSON.stringify(e)}`);const{name:t,ts:i,attributes:n}=e,r=n&&this.filterAttributes(n,this.attributesToFilter),s=Object.assign({name:t,ts:i},r);this.logger.debug(`Event Reporting - InMemoryJSONEventBuffer - addItem - event after filtering attributes ${JSON.stringify(s)}`);const o=this.getSize(s);if(o>d.MAX_ITEM_SIZE_BYTES_ALLOWED)throw new Error(`Event Reporting - Item to be added has size ${o} bytes. Item cannot exceed max item size allowed of ${d.MAX_ITEM_SIZE_BYTES_ALLOWED} bytes.`);if(this.importantEvents.has(t))return this.logger.debug(`Event Reporting - InMemoryJSONEventBuffer - addItem - sending important event ${JSON.stringify(s)}`),void this.sendEventImmediately({name:t,ts:i,attributes:r});if(this.isFull())throw this.logger.warn(\"Event Reporting - Event buffer is full\"),new Error(\"Buffer full\");if(this.currentIngestionEvent.payloads.push(s),this.ingestionEventSize+=o,this.bufferItemThresholdReached(o)){const e=this.deepCopyCurrentIngestionEvent(this.currentIngestionEvent);this.buffer.push(e),this.bufferSize+=this.ingestionEventSize,this.currentIngestionEvent=this.initializeAndGetCurrentIngestionEvent(),this.logger.debug(`Event Reporting - InMemoryJSONEventBuffer - addItem - buffer item threshold reached updated buffer ${JSON.stringify(this.buffer)}`)}}))}filterAttributes(e,t){const i=new Set(t);return Object.keys(e).filter((e=>i.has(e))).forEach((t=>delete e[t])),e}initializeAndGetCurrentIngestionEvent(){const e={type:this.type,v:this.v,payloads:[]};return this.ingestionEventSize=this.getSize(e),e}bufferItemThresholdReached(e){return e+this.ingestionEventSize>=this.maxBufferItemCapacityBytes||this.currentIngestionEvent.payloads.length===d.MAX_PAYLOAD_ITEMS}getSize(e){let t=0;if(\"object\"==typeof e)for(const[i,n]of Object.entries(e))t+=this.getPrimitiveSize(i),t+=this.getSize(n);else t+=this.getPrimitiveSize(e);return t}getPrimitiveSize(e){let t=0;return\"string\"==typeof e?t+=2*e.length:\"number\"==typeof e&&(t+=8),t}isFull(){return this.bufferSize===this.maxBufferCapacityBytes||this.buffer.length===this.totalBufferItems}isEmpty(){return 0===this.buffer.length||0===this.bufferSize}getItems(e,t=0){return this.isEmpty()?[]:(e=Math.min(this.buffer.length,e+1),this.buffer.splice(t,e))}makeBeaconRequestBody(e){const t={metadata:this.metadata,events:e,authorization:this.authenticationToken};return JSON.stringify(t)}makeRequestBody(e){const t={metadata:this.metadata,events:e};return JSON.stringify(t)}sendEventImmediately(e){return n(this,void 0,void 0,(function*(){this.logger.debug(`Event Reporting - InMemoryJSONEventBuffer - sendEventImmediately - important event received ${JSON.stringify(e)}`);const{name:t,ts:i,attributes:n}=e,r={type:this.type,v:this.v,payloads:[Object.assign({name:t,ts:i},n)]};let s=!1,o=null;const a=this.makeRequestBody([r]);try{if(o=yield this.send(a),o.ok){try{const e=yield o.json();this.logger.debug(`Event Reporting - InMemoryJSONEventBuffer - sendEventImmediately - send successful event: ${a}, message: ${JSON.stringify(e)}`)}catch(e){this.logger.warn(`Event Reporting - InMemoryJSONEventBuffer - sendEventImmediately - Error reading OK response ${e} for event ${a}`)}return}this.logger.error(`Event Reporting - InMemoryJSONEventBuffer - sendEventImmediately - Failed to send an important event ${a} with response status ${o.status}`),s=!0}catch(e){this.logger.warn(`Event Reporting - There may be a failure in sending an important event ${a} to the ingestion endpoint ${e}.`),s=!0;try{if(\"firefox\"===this.metadata.browserName.toLowerCase()){const e=this.makeBeaconRequestBody([r]);this.logger.debug(`Event Reporting - InMemoryJSONEventBuffer - sendEventImmediately - beaconing data out ${e}`),s=!navigator.sendBeacon(`${this.ingestionURL}?beacon=1`,e)}}catch(e){this.logger.warn(`Event Reporting - Error sending beacon for an important event ${a}`),s=!0}}s&&(this.logger.debug(`Event Reporting - InMemoryJSONEventBuffer - sendEventImmediately - pushing to failed events ${a}`),this.failedIngestionEvents.push(r))}))}send(e){return n(this,void 0,void 0,(function*(){const t=new s.default(d.RETRY_FIXED_BACKOFF_WAIT_MS,d.RETRY_SHORT_BACKOFF_MS,d.RETRY_LONG_BACKOFF_MS);try{let i=0;for(;i0){const t=this.deepCopyCurrentIngestionEvent(this.currentIngestionEvent);e.push(t),this.logger.debug(`Event Reporting - InMemoryJSONEventBuffer - sendBeacon - clearing out current ingestion event ${JSON.stringify(t)}`),this.currentIngestionEvent=this.initializeAndGetCurrentIngestionEvent()}if(this.failedIngestionEvents.length>0){const t=this.failedIngestionEvents.map((e=>this.deepCopyCurrentIngestionEvent(e)));e.push(...t),this.logger.debug(`Event Reporting - InMemoryJSONEventBuffer - sendBeacon - clearing out any failed ingestion event ${JSON.stringify(t)}`),this.failedIngestionEvents=[]}if(this.cancellableEvents.size>0&&(this.cancellableEvents.forEach((t=>{e.push(...t),this.logger.debug(`Event Reporting - InMemoryJSONEventBuffer - sendBeacon - clearing out each cancellable event ${JSON.stringify(t)}`)})),this.cancellableEvents.clear()),0===e.length)return;const t=this.makeBeaconRequestBody(e);this.logger.debug(`Event Reporting - InMemoryJSONEventBuffer - sendBeacon - beacon data to send ${t}`);try{navigator.sendBeacon(`${this.ingestionURL}?beacon=1`,t)||this.logger.warn(`Event Reporting - Browser failed to queue beacon data ${t}`)}catch(e){this.logger.warn(`Event Reporting - Sending beacon data ${t} failed with error ${e}`)}}))}reset(){this.maxBufferCapacityBytes=0,this.totalBufferItems=0,this.buffer=[],this.bufferSize=0,this.maxBufferItemCapacityBytes=0,this.ingestionEventSize=0,this.flushIntervalMs=0,this.flushSize=0,this.failedIngestionEvents=[],this.lock=!1,this.beaconEventListener=void 0,this.cancellableEvents.clear()}destroy(){return n(this,void 0,void 0,(function*(){this.stop(),this.reset()}))}}t.default=d,d.SENDING_FAILURE_CODES=new Set([408,429,500,502,503,504]),d.RETRY_FIXED_BACKOFF_WAIT_MS=0,d.RETRY_SHORT_BACKOFF_MS=1e3,d.RETRY_LONG_BACKOFF_MS=15e3,d.MAX_PAYLOAD_ITEMS=2,d.MAX_ITEM_SIZE_BYTES_ALLOWED=3e3},7700:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e=5e3,t=2,i=64,n=100,r=15){this.flushIntervalMs=e,this.flushSize=t,this.maxBufferCapacityKb=i,this.totalBufferItems=n,this.retryCountLimit=r}}},3831:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(2238),s=i(146),o=i(5680),a=i(6366),c=i(9385),d=i(7797),l=i(4046),u=i(731);class h{constructor(e,t,i){var n,s,o,a,c,d,l;this.meetingHistoryStates=[],this.observerSet=new Set,this.destroyed=!1,this.logger=t,this.configuration=e,this.setupEventReporter(e,t,i);try{this.parserResult=navigator&&navigator.userAgent?new r.UAParser(navigator.userAgent).getResult():null}catch(e){this.logger.error(e.message)}this.browserMajorVersion=(null===(o=null===(s=null===(n=this.parserResult)||void 0===n?void 0:n.browser)||void 0===s?void 0:s.version)||void 0===o?void 0:o.split(\".\")[0])||h.UNAVAILABLE,this.browserName=(null===(a=this.parserResult)||void 0===a?void 0:a.browser.name)||h.UNAVAILABLE,this.browserVersion=(null===(c=this.parserResult)||void 0===c?void 0:c.browser.version)||h.UNAVAILABLE,this.deviceName=[(null===(d=this.parserResult)||void 0===d?void 0:d.device.vendor)||\"\",(null===(l=this.parserResult)||void 0===l?void 0:l.device.model)||\"\"].join(\" \").trim()||h.UNAVAILABLE}addObserver(e){this.observerSet.add(e)}removeObserver(e){this.observerSet.delete(e)}forEachObserver(e){for(const t of this.observerSet)d.default.nextTick((()=>{this.observerSet.has(t)&&e(t)}))}publishEvent(e,t){return n(this,void 0,void 0,(function*(){const i=Date.now();this.meetingHistoryStates.push({name:e,timestampMs:i});const n=Object.freeze(Object.assign(this.getAttributes(i),t));this.forEachObserver((t=>{t.eventDidReceive(e,n)})),this.reportEvent(e,i,t)}))}reportEvent(e,t,i){var r;return n(this,void 0,void 0,(function*(){let n;try{i&&(n=u.default(i)),yield null===(r=this.eventReporter)||void 0===r?void 0:r.reportEvent(t,e,n)}catch(e){this.logger.error(`Error reporting event ${e}`)}}))}setupEventReporter(e,t,i){if(i)this._eventReporter=i;else if(e.urls){const i=e.urls.eventIngestionURL;if(i){this.logger.info(\"Event ingestion URL is present in the configuration\");const{meetingId:n,credentials:{attendeeId:r,joinToken:s}}=e,d=new c.default(n,r,s),l=new o.default(d,i);this._eventReporter=new a.default(l,t)}}}getAttributes(e){var t,i;return{attendeeId:this.configuration.credentials.attendeeId,browserMajorVersion:this.browserMajorVersion,browserName:this.browserName,browserVersion:this.browserVersion,deviceName:this.deviceName,externalMeetingId:\"string\"==typeof this.configuration.externalMeetingId?this.configuration.externalMeetingId:\"\",externalUserId:this.configuration.credentials.externalUserId,meetingHistory:this.meetingHistoryStates,meetingId:this.configuration.meetingId,osName:(null===(t=this.parserResult)||void 0===t?void 0:t.os.name)||h.UNAVAILABLE,osVersion:(null===(i=this.parserResult)||void 0===i?void 0:i.os.version)||h.UNAVAILABLE,sdkVersion:l.default.sdkVersion,sdkName:l.default.sdkName,timestampMs:e}}get eventReporter(){return this._eventReporter}destroy(){return n(this,void 0,void 0,(function*(){s.isDestroyable(this.eventReporter)&&(yield this.eventReporter.destroy()),this.logger=void 0,this.configuration=void 0,this._eventReporter=void 0,this.destroyed=!0}))}}t.default=h,h.UNAVAILABLE=\"Unavailable\"},731:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=e=>{const t={};for(const[i,n]of Object.entries(e))if(null!=n&&\"\"!==n){if(\"number\"!=typeof n&&\"string\"!=typeof n)throw new TypeError(\"Unhandled type received while flattening attributes.\");t[i]=n}return t}},5680:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(7700);t.default=class{constructor(e,t,i=new n.default){this.eventsClientConfiguration=e,this.ingestionURL=t,this.eventBufferConfiguration=i}}},6366:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(146),s=i(3520);t.default=class{constructor(e,t){this.reportingEvents=!1,this.importantEvents=[\"meetingEnded\",\"meetingFailed\",\"meetingStartFailed\",\"audioInputFailed\",\"videoInputFailed\",\"meetingStartSucceeded\"],this.destroyed=!1;const{eventsClientConfiguration:i,ingestionURL:n,eventBufferConfiguration:r}=e,{eventsToIgnore:o}=i;this.eventBuffer=new s.default(r,i,n,this.importantEvents,t),this.logger=t,this.eventsToIgnore=o,this.start()}start(){if(!this.reportingEvents)try{this.eventBuffer.start(),this.logger.info(\"Event reporting started\"),this.reportingEvents=!0}catch(e){this.logger.error(`Event Reporting - Error starting the event buffer ${e}`)}}stop(){if(this.reportingEvents)try{this.eventBuffer.stop(),this.logger.info(\"Event reporting stopped\"),this.reportingEvents=!1}catch(e){this.logger.error(`Event Reporting - Error stopping the event buffer ${e}`)}}reportEvent(e,t,i){return n(this,void 0,void 0,(function*(){if(this.logger.debug(`Event Reporting - DefaultMeetingEventReporter - event received in reportEvent ${e}, ${t}, ${JSON.stringify(i)}`),this.eventsToIgnore.includes(t))this.logger.debug(`Event Reporting - DefaultMeetingEventReporter - ${t} event will be ignored as it is in events to ignore`);else try{this.logger.debug(\"Event Reporting - DefaultMeetingEventReporter - adding item to event buffer\"),yield this.eventBuffer.addItem({ts:e,name:t,attributes:i})}catch(e){this.logger.error(`Event Reporting - Error adding event to buffer ${e}`)}}))}destroy(){return n(this,void 0,void 0,(function*(){this.destroyed=!0,this.stop(),r.isDestroyable(this.eventBuffer)&&this.eventBuffer.destroy(),this.eventBuffer=void 0}))}}},732:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(){}reportEvent(e,t,i){}start(){}stop(){}}},9385:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e,t,i,n=[]){this.type=\"Meet\",this.v=1,this.meetingId=e,this.attendeeId=t,this.eventsToIgnore=n,this.authenticationToken=i}getAuthenticationToken(){return this.authenticationToken}toJSON(){const e={};return e.type=this.type,e.v=this.v,e.meetingId=this.meetingId,e.attendeeId=this.attendeeId,e}}},3204:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.DefaultEventController=t.DefaultDevicePixelRatioMonitor=t.DefaultDeviceController=t.DefaultContentShareController=t.DefaultBrowserBehavior=t.DefaultAudioVideoFacade=t.DefaultAudioVideoController=t.DefaultAudioMixController=t.DefaultActiveSpeakerPolicy=t.DefaultActiveSpeakerDetector=t.DataMessage=t.CreateSDPTask=t.CreatePeerConnectionTask=t.ContentShareMediaStreamBroker=t.ContentShareConstants=t.ConsoleLogger=t.ConnectionHealthPolicyConfiguration=t.ConnectionHealthData=t.ClientVideoStreamReceivingReport=t.ClientMetricReportMediaType=t.ClientMetricReportDirection=t.ClientMetricReport=t.CleanStoppedSessionTask=t.CleanRestartedSessionTask=t.CheckVideoInputFeedback=t.CheckVideoConnectivityFeedback=t.CheckNetworkUDPConnectivityFeedback=t.CheckNetworkTCPConnectivityFeedback=t.CheckContentShareConnectivityFeedback=t.CheckCameraResolutionFeedback=t.CheckAudioOutputFeedback=t.CheckAudioInputFeedback=t.CheckAudioConnectivityFeedback=t.CanvasVideoFrameBuffer=t.CSPMonitor=t.BitrateParameters=t.BaseTask=t.BaseConnectionHealthPolicy=t.BackgroundReplacementVideoFrameProcessor=t.BackgroundFilterVideoFrameProcessor=t.BackgroundBlurVideoFrameProcessor=t.BackgroundBlurStrength=t.AudioVideoControllerState=t.AudioProfile=t.AudioLogEvent=t.Attendee=t.AttachMediaInputTask=t.AsyncScheduler=t.ApplicationMetadata=t.AllHighestVideoBandwidthPolicy=void 0,t.MeetingSessionCredentials=t.MeetingSessionConfiguration=t.MeetingReadinessCheckerConfiguration=t.MeetingEventsClientConfiguration=t.MediaDeviceProxyHandler=t.Maybe=t.LogLevel=t.Log=t.ListenForVolumeIndicatorsTask=t.LeaveAndReceiveLeaveAckTask=t.JoinAndReceiveIndexTask=t.IntervalScheduler=t.InMemoryJSONEventBuffer=t.GlobalMetricReport=t.GetUserMediaError=t.FullJitterLimitedBackoff=t.FullJitterBackoffFactory=t.FullJitterBackoff=t.FinishGatheringICECandidatesTask=t.EventIngestionConfiguration=t.EventBufferConfiguration=t.DeviceSelection=t.DevicePixelRatioWindowSource=t.DefaultWebSocketAdapter=t.DefaultVolumeIndicatorAdapter=t.DefaultVideoTransformDevice=t.DefaultVideoTileFactory=t.DefaultVideoTileController=t.DefaultVideoTile=t.DefaultVideoStreamIndex=t.DefaultVideoStreamIdSet=t.DefaultVideoFrameProcessorPipeline=t.DefaultVideoCaptureAndEncodeParameter=t.DefaultUserAgentParser=t.DefaultTranscriptionController=t.DefaultTransceiverController=t.DefaultSimulcastUplinkPolicyForContentShare=t.DefaultSimulcastUplinkPolicy=t.DefaultSignalingClient=t.DefaultSigV4=t.DefaultSessionStateController=t.DefaultReconnectController=t.DefaultRealtimeController=t.DefaultPingPong=t.DefaultModality=t.DefaultMessagingSession=t.DefaultMeetingSession=t.DefaultMeetingReadinessChecker=t.DefaultMeetingEventReporter=t.DefaultMediaDeviceFactory=void 0,t.SDPCandidateType=t.SDP=t.RunnableTask=t.ReconnectionHealthPolicy=t.ReceiveVideoStreamIndexTask=t.ReceiveVideoInputTask=t.ReceiveTURNCredentialsTask=t.ReceiveRemoteVideoPauseResumeTask=t.ReceiveAudioInputTask=t.RealtimeVolumeIndicator=t.RealtimeState=t.RealtimeAttendeePositionInFrame=t.PromoteToPrimaryMeetingTask=t.PromiseQueue=t.PrefetchSortBy=t.PrefetchOn=t.PermissionDeniedError=t.ParallelGroupTask=t.POSTLogger=t.OverconstrainedError=t.OpenSignalingConnectionTask=t.OnceTask=t.NotReadableError=t.NotFoundError=t.None=t.NoVideoUplinkBandwidthPolicy=t.NoVideoDownlinkBandwidthPolicy=t.NoOpVideoFrameProcessor=t.NoOpVideoElementFactory=t.NoOpTask=t.NoOpMediaStreamBroker=t.NoOpLogger=t.NoOpEventReporter=t.NoOpDeviceController=t.NoOpDebugLogger=t.NoOpAudioVideoController=t.NScaleVideoUplinkBandwidthPolicy=t.MutableVideoPreferences=t.MultiLogger=t.MonitorTask=t.ModelSpecBuilder=t.MessagingSessionConfiguration=t.Message=t.MeetingSessionVideoAvailability=t.MeetingSessionURLs=t.MeetingSessionTURNCredentials=t.MeetingSessionStatusCode=t.MeetingSessionStatus=t.MeetingSessionLifecycleEventCondition=t.MeetingSessionLifecycleEvent=void 0,t.VideoPriorityBasedPolicy=t.VideoPreferences=t.VideoPreference=t.VideoOnlyTransceiverController=t.VideoLogEvent=t.VideoFxProcessor=t.VideoCodecCapability=t.VideoAdaptiveProbePolicy=t.Versioning=t.UnusableAudioWarningConnectionHealthPolicy=t.TypeError=t.TranscriptionStatusType=t.TranscriptionStatus=t.TranscriptResult=t.TranscriptLanguageWithScore=t.TranscriptItemType=t.TranscriptItem=t.TranscriptEntity=t.TranscriptAlternative=t.Transcript=t.TimeoutTask=t.TimeoutScheduler=t.TaskStatus=t.TargetDisplaySize=t.SubscribeAndReceiveSubscribeAckTask=t.StreamMetricReport=t.Some=t.SingleNodeAudioTransformDevice=t.SimulcastVideoStreamIndex=t.SimulcastTransceiverController=t.SimulcastLayers=t.SimulcastContentShareTransceiverController=t.SignalingClientVideoSubscriptionConfiguration=t.SignalingClientSubscribe=t.SignalingClientJoin=t.SignalingClientEventType=t.SignalingClientEvent=t.SignalingClientConnectionRequest=t.SignalingAndMetricsConnectionMonitor=t.SetRemoteDescriptionTask=t.SetLocalDescriptionTask=t.SessionStateControllerTransitionResult=t.SessionStateControllerState=t.SessionStateControllerDeferPriority=t.SessionStateControllerAction=t.ServerSideNetworkAdaption=t.SerialGroupTask=t.SendingAudioFailureConnectionHealthPolicy=t.SendAndReceiveDataMessagesTask=t.SDPMediaSection=void 0,t.isVideoTransformDevice=t.isDestroyable=t.isAudioTransformDevice=t.ZLIBTextCompressor=t.WebSocketReadyState=t.WaitForAttendeePresenceTask=t.VoiceFocusTransformDevice=t.VoiceFocusDeviceTransformer=t.VideoTileState=t.VideoStreamDescription=t.VideoSource=t.VideoQualitySettings=t.VideoPriorityBasedPolicyConfig=void 0;const n=i(5185);t.AllHighestVideoBandwidthPolicy=n.default;const r=i(7535);t.ApplicationMetadata=r.default;const s=i(7797);t.AsyncScheduler=s.default;const o=i(8358);t.AttachMediaInputTask=o.default;const a=i(7602);t.Attendee=a.default;const c=i(9880);t.AudioLogEvent=c.default;const d=i(3765);t.AudioProfile=d.default;const l=i(1876);t.AudioVideoControllerState=l.default;const u=i(9734);t.BackgroundBlurStrength=u.default;const h=i(1260);t.BackgroundBlurVideoFrameProcessor=h.default;const p=i(4243);t.BackgroundFilterVideoFrameProcessor=p.default;const m=i(9854);t.BackgroundReplacementVideoFrameProcessor=m.default;const f=i(3940);t.BaseConnectionHealthPolicy=f.default;const g=i(1789);t.BaseTask=g.default;const v=i(9394);t.BitrateParameters=v.default;const S=i(7237);t.CSPMonitor=S.default;const b=i(9807);t.CanvasVideoFrameBuffer=b.default;const y=i(2084);t.CheckAudioConnectivityFeedback=y.default;const w=i(8892);t.CheckAudioInputFeedback=w.default;const C=i(9333);t.CheckAudioOutputFeedback=C.default;const k=i(1087);t.CheckCameraResolutionFeedback=k.default;const E=i(2606);t.CheckContentShareConnectivityFeedback=E.default;const I=i(7415);t.CheckNetworkTCPConnectivityFeedback=I.default;const T=i(4299);t.CheckNetworkUDPConnectivityFeedback=T.default;const A=i(6818);t.CheckVideoConnectivityFeedback=A.default;const M=i(1737);t.CheckVideoInputFeedback=M.default;const x=i(3216);t.CleanRestartedSessionTask=x.default;const _=i(7408);t.CleanStoppedSessionTask=_.default;const P=i(4571);t.ClientMetricReport=P.default;const O=i(6196);t.ClientMetricReportDirection=O.default;const R=i(9496);t.ClientMetricReportMediaType=R.default;const D=i(2770);t.ClientVideoStreamReceivingReport=D.default;const N=i(6688);t.ConnectionHealthData=N.default;const F=i(3731);t.ConnectionHealthPolicyConfiguration=F.default;const B=i(8030);t.ConsoleLogger=B.default;const L=i(8890);t.ContentShareConstants=L.default;const U=i(8370);t.ContentShareMediaStreamBroker=U.default;const V=i(5054);t.CreatePeerConnectionTask=V.default;const j=i(1129);t.CreateSDPTask=j.default;const z=i(1018);t.DataMessage=z.default;const $=i(8320);t.DefaultActiveSpeakerDetector=$.default;const W=i(2363);t.DefaultActiveSpeakerPolicy=W.default;const H=i(6802);t.DefaultAudioMixController=H.default;const q=i(9059);t.DefaultAudioVideoController=q.default;const K=i(8538);t.DefaultAudioVideoFacade=K.default;const G=i(543);t.DefaultBrowserBehavior=G.default;const J=i(8023);t.DefaultContentShareController=J.default;const Q=i(4142);t.DefaultDeviceController=Q.default;const Z=i(8236);t.DefaultDevicePixelRatioMonitor=Z.default;const X=i(3831);t.DefaultEventController=X.default;const Y=i(6354);t.DefaultMediaDeviceFactory=Y.default;const ee=i(6366);t.DefaultMeetingEventReporter=ee.default;const te=i(3980);t.DefaultMeetingReadinessChecker=te.default;const ie=i(4202);t.DefaultMeetingSession=ie.default;const ne=i(8947);t.DefaultMessagingSession=ne.default;const re=i(214);t.DefaultModality=re.default;const se=i(7500);t.DefaultPingPong=se.default;const oe=i(983);t.DefaultRealtimeController=oe.default;const ae=i(9141);t.DefaultReconnectController=ae.default;const ce=i(9678);t.DefaultSessionStateController=ce.default;const de=i(334);t.DefaultSigV4=de.default;const le=i(1208);t.DefaultSignalingClient=le.default;const ue=i(4450);t.DefaultSimulcastUplinkPolicy=ue.default;const he=i(3879);t.DefaultSimulcastUplinkPolicyForContentShare=he.default;const pe=i(365);t.DefaultTransceiverController=pe.default;const me=i(5308);t.DefaultTranscriptionController=me.default;const fe=i(8627);t.DefaultUserAgentParser=fe.default;const ge=i(1133);t.DefaultVideoCaptureAndEncodeParameter=ge.default;const ve=i(8919);t.DefaultVideoFrameProcessorPipeline=ve.default;const Se=i(1508);t.DefaultVideoStreamIdSet=Se.default;const be=i(1318);t.DefaultVideoStreamIndex=be.default;const ye=i(3327);t.DefaultVideoTile=ye.default;const we=i(2958);t.DefaultVideoTileController=we.default;const Ce=i(4922);t.DefaultVideoTileFactory=Ce.default;const ke=i(7673);t.DefaultVideoTransformDevice=ke.default;const Ee=i(9751);t.DefaultVolumeIndicatorAdapter=Ee.default;const Ie=i(7631);t.DefaultWebSocketAdapter=Ie.default;const Te=i(9190);t.DevicePixelRatioWindowSource=Te.default;const Ae=i(8128);t.DeviceSelection=Ae.default;const Me=i(7700);t.EventBufferConfiguration=Me.default;const xe=i(5680);t.EventIngestionConfiguration=xe.default;const _e=i(6240);t.FinishGatheringICECandidatesTask=_e.default;const Pe=i(8434);t.FullJitterBackoff=Pe.default;const Oe=i(5640);t.FullJitterBackoffFactory=Oe.default;const Re=i(7300);t.FullJitterLimitedBackoff=Re.default;const De=i(5348);t.GetUserMediaError=De.default;const Ne=i(2306);t.GlobalMetricReport=Ne.default;const Fe=i(3520);t.InMemoryJSONEventBuffer=Fe.default;const Be=i(3922);t.IntervalScheduler=Be.default;const Le=i(1960);t.JoinAndReceiveIndexTask=Le.default;const Ue=i(6180);t.LeaveAndReceiveLeaveAckTask=Ue.default;const Ve=i(2748);t.ListenForVolumeIndicatorsTask=Ve.default;const je=i(293);t.Log=je.default;const ze=i(813);t.LogLevel=ze.default;const $e=i(4236);t.MediaDeviceProxyHandler=$e.default;const We=i(9385);t.MeetingEventsClientConfiguration=We.default;const He=i(3990);t.MeetingReadinessCheckerConfiguration=He.default;const qe=i(589);t.MeetingSessionConfiguration=qe.default;const Ke=i(8015);t.MeetingSessionCredentials=Ke.default;const Ge=i(7604);t.MeetingSessionLifecycleEvent=Ge.default;const Je=i(1296);t.MeetingSessionLifecycleEventCondition=Je.default;const Qe=i(3789);t.MeetingSessionStatus=Qe.default;const Ze=i(5687);t.MeetingSessionStatusCode=Ze.default;const Xe=i(7215);t.MeetingSessionTURNCredentials=Xe.default;const Ye=i(6057);t.MeetingSessionURLs=Ye.default;const et=i(5723);t.MeetingSessionVideoAvailability=et.default;const tt=i(9358);t.Message=tt.default;const it=i(4323);t.MessagingSessionConfiguration=it.default;const nt=i(22);t.ModelSpecBuilder=nt.default;const rt=i(1981);t.MonitorTask=rt.default;const st=i(9938);t.MultiLogger=st.default;const ot=i(4442);t.NScaleVideoUplinkBandwidthPolicy=ot.default;const at=i(9836);t.NoOpAudioVideoController=at.default;const ct=i(209);t.NoOpDebugLogger=ct.default;const dt=i(6154);t.NoOpDeviceController=dt.default;const lt=i(732);t.NoOpEventReporter=lt.default;const ut=i(7434);t.NoOpLogger=ut.default;const ht=i(4015);t.NoOpMediaStreamBroker=ht.default;const pt=i(8831);t.NoOpTask=pt.default;const mt=i(3663);t.NoOpVideoElementFactory=mt.default;const ft=i(2801);t.NoOpVideoFrameProcessor=ft.default;const gt=i(5319);t.NoVideoDownlinkBandwidthPolicy=gt.default;const vt=i(657);t.NoVideoUplinkBandwidthPolicy=vt.default;const St=i(1238);t.NotFoundError=St.default;const bt=i(3110);t.NotReadableError=bt.default;const yt=i(1124);t.OnceTask=yt.default;const wt=i(4543);t.OpenSignalingConnectionTask=wt.default;const Ct=i(4842);t.OverconstrainedError=Ct.default;const kt=i(5013);t.POSTLogger=kt.default;const Et=i(8556);t.ParallelGroupTask=Et.default;const It=i(6991);t.PermissionDeniedError=It.default;const Tt=i(106);t.PrefetchOn=Tt.default;const At=i(3938);t.PrefetchSortBy=At.default;const Mt=i(1515);t.PromiseQueue=Mt.default;const xt=i(9945);t.PromoteToPrimaryMeetingTask=xt.default;const _t=i(5910);t.RealtimeAttendeePositionInFrame=_t.default;const Pt=i(9825);t.RealtimeState=Pt.default;const Ot=i(9576);t.RealtimeVolumeIndicator=Ot.default;const Rt=i(1209);t.ReceiveAudioInputTask=Rt.default;const Dt=i(6274);t.ReceiveRemoteVideoPauseResumeTask=Dt.default;const Nt=i(5547);t.ReceiveTURNCredentialsTask=Nt.default;const Ft=i(120);t.ReceiveVideoInputTask=Ft.default;const Bt=i(9560);t.ReceiveVideoStreamIndexTask=Bt.default;const Lt=i(9708);t.ReconnectionHealthPolicy=Lt.default;const Ut=i(4191);t.RunnableTask=Ut.default;const Vt=i(326);t.SDP=Vt.default;const jt=i(4076);t.SDPCandidateType=jt.default;const zt=i(1944);t.SDPMediaSection=zt.default;const $t=i(9485);t.SendAndReceiveDataMessagesTask=$t.default;const Wt=i(2977);t.SendingAudioFailureConnectionHealthPolicy=Wt.default;const Ht=i(7079);t.SerialGroupTask=Ht.default;const qt=i(7103);t.ServerSideNetworkAdaption=qt.default;const Kt=i(3860);t.SessionStateControllerAction=Kt.default;const Gt=i(6850);t.SessionStateControllerDeferPriority=Gt.default;const Jt=i(9553);t.SessionStateControllerState=Jt.default;const Qt=i(3013);t.SessionStateControllerTransitionResult=Qt.default;const Zt=i(4833);t.SetLocalDescriptionTask=Zt.default;const Xt=i(5275);t.SetRemoteDescriptionTask=Xt.default;const Yt=i(8581);t.SignalingAndMetricsConnectionMonitor=Yt.default;const ei=i(3920);t.SignalingClientConnectionRequest=ei.default;const ti=i(2902);t.SignalingClientEvent=ti.default;const ii=i(9416);t.SignalingClientEventType=ii.default;const ni=i(2168);t.SignalingClientJoin=ni.default;const ri=i(6729);t.SignalingClientSubscribe=ri.default;const si=i(9101);t.SignalingClientVideoSubscriptionConfiguration=si.default;const oi=i(7377);t.SimulcastContentShareTransceiverController=oi.default;const ai=i(7606);t.SimulcastLayers=ai.default;const ci=i(5785);t.SimulcastTransceiverController=ci.default;const di=i(4242);t.SimulcastVideoStreamIndex=di.default;const li=i(7786);t.SingleNodeAudioTransformDevice=li.default;const ui=i(2811);t.StreamMetricReport=ui.default;const hi=i(5924);t.SubscribeAndReceiveSubscribeAckTask=hi.default;const pi=i(2721);t.TargetDisplaySize=pi.default;const mi=i(4456);t.TaskStatus=mi.default;const fi=i(4929);t.TimeoutScheduler=fi.default;const gi=i(250);t.TimeoutTask=gi.default;const vi=i(4739);t.Transcript=vi.default;const Si=i(2471);t.TranscriptAlternative=Si.default;const bi=i(7210);t.TranscriptEntity=bi.default;const yi=i(1741);t.TranscriptItem=yi.default;const wi=i(6864);t.TranscriptItemType=wi.default;const Ci=i(9063);t.TranscriptLanguageWithScore=Ci.default;const ki=i(5323);t.TranscriptResult=ki.default;const Ei=i(1288);t.TranscriptionStatus=Ei.default;const Ii=i(1326);t.TranscriptionStatusType=Ii.default;const Ti=i(6950);t.TypeError=Ti.default;const Ai=i(1922);t.UnusableAudioWarningConnectionHealthPolicy=Ai.default;const Mi=i(4046);t.Versioning=Mi.default;const xi=i(2880);t.VideoAdaptiveProbePolicy=xi.default;const _i=i(2330);t.VideoCodecCapability=_i.default;const Pi=i(7746);t.VideoFxProcessor=Pi.default;const Oi=i(155);t.VideoLogEvent=Oi.default;const Ri=i(9354);t.VideoOnlyTransceiverController=Ri.default;const Di=i(1754);t.VideoPreference=Di.default;const Ni=i(1819);t.VideoPreferences=Ni.default;const Fi=i(4992);t.VideoPriorityBasedPolicy=Fi.default;const Bi=i(1034);t.VideoPriorityBasedPolicyConfig=Bi.default;const Li=i(4500);t.VideoQualitySettings=Li.default;const Ui=i(60);t.VideoSource=Ui.default;const Vi=i(6876);t.VideoStreamDescription=Vi.default;const ji=i(7804);t.VideoTileState=ji.default;const zi=i(2497);t.VoiceFocusDeviceTransformer=zi.default;const $i=i(8878);t.VoiceFocusTransformDevice=$i.default;const Wi=i(6171);t.WaitForAttendeePresenceTask=Wi.default;const Hi=i(7387);t.WebSocketReadyState=Hi.default;const qi=i(3320);t.ZLIBTextCompressor=qi.default;const Ki=i(1819);Object.defineProperty(t,\"MutableVideoPreferences\",{enumerable:!0,get:function(){return Ki.MutableVideoPreferences}});const Gi=i(8660);Object.defineProperty(t,\"Some\",{enumerable:!0,get:function(){return Gi.Some}}),Object.defineProperty(t,\"None\",{enumerable:!0,get:function(){return Gi.None}}),Object.defineProperty(t,\"Maybe\",{enumerable:!0,get:function(){return Gi.Maybe}});const Ji=i(1746);Object.defineProperty(t,\"isAudioTransformDevice\",{enumerable:!0,get:function(){return Ji.isAudioTransformDevice}});const Qi=i(146);Object.defineProperty(t,\"isDestroyable\",{enumerable:!0,get:function(){return Qi.isDestroyable}});const Zi=i(7170);Object.defineProperty(t,\"isVideoTransformDevice\",{enumerable:!0,get:function(){return Zi.isVideoTransformDevice}})},8030:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(813);t.default=class{constructor(e,t=n.default.WARN){this.name=e,this.level=t}info(e){this.log(n.default.INFO,e)}warn(e){this.log(n.default.WARN,e)}error(e){this.log(n.default.ERROR,e)}debug(e){n.default.DEBUG{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e,t,i,n){this.sequenceNumber=e,this.message=t,this.timestampMs=i,this.logLevel=n}}},813:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.LogLevel=void 0,function(e){e[e.DEBUG=0]=\"DEBUG\",e[e.INFO=1]=\"INFO\",e[e.WARN=2]=\"WARN\",e[e.ERROR=3]=\"ERROR\",e[e.OFF=4]=\"OFF\"}(i=t.LogLevel||(t.LogLevel={})),t.default=i},9938:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(813);t.default=class{constructor(...e){this._loggers=e}info(e){for(const t of this._loggers)t.info(e)}warn(e){for(const t of this._loggers)t.warn(e)}error(e){for(const t of this._loggers)t.error(e)}debug(e){let t,i;i=\"string\"==typeof e?e:e?()=>(t||(t=e()),t):\"\"+e;for(const e of this._loggers)e.debug(i)}setLogLevel(e){for(const t of this._loggers)t.setLogLevel(e)}getLogLevel(){for(const e of this._loggers)return e.getLogLevel();return n.default.OFF}}},209:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(813),r=i(7434);class s extends r.default{constructor(){super(n.default.DEBUG)}}t.default=s},7434:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(813);t.default=class{constructor(e=n.default.OFF){this.level=e}info(e){}warn(e){}error(e){}debug(e){n.default.DEBUG{this.stop()},this.addEventListener()}addEventListener(){this.eventListener&&\"window\"in i.g&&window.addEventListener&&window.addEventListener(\"unload\",this.eventListener)}removeEventListener(){this.eventListener&&\"window\"in i.g&&window.removeEventListener&&window.removeEventListener(\"unload\",this.eventListener)}debug(e){o.default.DEBUGn(this,void 0,void 0,(function*(){if(!0===this.lock||0===this.getLogCaptureSize())return;this.lock=!0;const e=this.logCapture.slice(0,this.batchSize),t=this.makeRequestBody(e);try{200===(yield fetch(this.url,Object.assign({method:\"POST\",body:t},this.headers?{headers:this.headers}:{}))).status&&(this.logCapture=this.logCapture.slice(e.length))}catch(e){console.warn(\"[POSTLogger] \"+e.message)}finally{this.lock=!1}}))))}stop(){var e;null===(e=this.intervalScheduler)||void 0===e||e.stop(),this.intervalScheduler=void 0,this.removeEventListener();const t=this.makeRequestBody(this.logCapture);navigator.sendBeacon(this.url,t)}destroy(){return n(this,void 0,void 0,(function*(){this.stop(),this.metadata=void 0,this.headers=void 0,this.logCapture=[],this.sequenceNumber=0,this.lock=!1,this.batchSize=0,this.intervalMs=0,this.url=void 0}))}makeRequestBody(e){return JSON.stringify(Object.assign(Object.assign({},this.metadata),{logs:e}))}log(e,t){if(e{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(4236);t.default=class{constructor(){this.isMediaDevicesSupported=\"undefined\"!=typeof navigator&&!!navigator.mediaDevices}create(){if(this.isMediaDevicesSupported)return new Proxy(navigator.mediaDevices,new n.default);throw new Error(\"navigator.mediaDevices is not supported\")}}},4236:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(7797),s=i(3922);class o{constructor(){this.scheduler=null,this.devices=null,this.deviceChangeListeners=new Set,this.get=(e,t,i)=>{if(!Reflect.has(e,t))return;if(!(\"ondevicechange\"in navigator.mediaDevices)){if(\"addEventListener\"===t)return this.patchAddEventListener(e,t,i);if(\"removeEventListener\"===t)return this.patchRemoveEventListener(e,t,i)}const n=Reflect.get(e,t,i);return\"function\"==typeof n?n.bind(e):n},this.patchAddEventListener=(e,t,i)=>{const n=Reflect.get(e,t,i);return(t,i,r)=>{if(\"devicechange\"!==t)return Reflect.apply(n,e,[t,i,r]);this.deviceChangeListeners.add(i),this.scheduler||(this.scheduler=new s.default(o.INTERVAL_MS),this.scheduler.start(this.pollDeviceLists))}},this.patchRemoveEventListener=(e,t,i)=>{const n=Reflect.get(e,t,i);return(t,i,r)=>{if(\"devicechange\"!==t)return Reflect.apply(n,e,[t,i,r]);this.deviceChangeListeners.delete(i),0===this.deviceChangeListeners.size&&this.scheduler&&(this.scheduler.stop(),this.scheduler=null)}},this.pollDeviceLists=()=>n(this,void 0,void 0,(function*(){const e=yield this.sortedDeviceList();this.devices&&(e.length!==this.devices.length||e.some(((e,t)=>e.deviceId!==this.devices[t].deviceId)))&&this.handleDeviceChangeEvent(),this.devices=e}))}sortedDeviceList(){return n(this,void 0,void 0,(function*(){return(yield navigator.mediaDevices.enumerateDevices()).sort(((e,t)=>e.deviceIdt.deviceId?-1:0))}))}handleDeviceChangeEvent(){for(const e of this.deviceChangeListeners)r.default.nextTick((()=>{if(this.deviceChangeListeners.has(e)){const t=new Event(\"devicechange\");\"function\"==typeof e?e(t):e.handleEvent(t)}}))}}t.default=o,o.INTERVAL_MS=1e3},4015:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{acquireAudioInputStream(){return Promise.reject()}acquireVideoInputStream(){return Promise.reject()}acquireDisplayInputStream(e){return Promise.reject()}muteLocalAudioInputStream(){}unmuteLocalAudioInputStream(){}addMediaStreamBrokerObserver(e){}removeMediaStreamBrokerObserver(e){}}},2084:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.CheckAudioConnectivityFeedback=void 0,function(e){e[e.Succeeded=0]=\"Succeeded\",e[e.AudioInputRequestFailed=1]=\"AudioInputRequestFailed\",e[e.AudioInputPermissionDenied=2]=\"AudioInputPermissionDenied\",e[e.ConnectionFailed=3]=\"ConnectionFailed\",e[e.AudioNotReceived=4]=\"AudioNotReceived\"}(i=t.CheckAudioConnectivityFeedback||(t.CheckAudioConnectivityFeedback={})),t.default=i},8892:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.CheckAudioInputFeedback=void 0,function(e){e[e.Succeeded=0]=\"Succeeded\",e[e.Failed=1]=\"Failed\",e[e.PermissionDenied=2]=\"PermissionDenied\"}(i=t.CheckAudioInputFeedback||(t.CheckAudioInputFeedback={})),t.default=i},9333:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.CheckAudioOutputFeedback=void 0,function(e){e[e.Succeeded=0]=\"Succeeded\",e[e.Failed=1]=\"Failed\"}(i=t.CheckAudioOutputFeedback||(t.CheckAudioOutputFeedback={})),t.default=i},1087:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.CheckCameraResolutionFeedback=void 0,function(e){e[e.Succeeded=0]=\"Succeeded\",e[e.Failed=1]=\"Failed\",e[e.ResolutionNotSupported=2]=\"ResolutionNotSupported\",e[e.PermissionDenied=3]=\"PermissionDenied\"}(i=t.CheckCameraResolutionFeedback||(t.CheckCameraResolutionFeedback={})),t.default=i},2606:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.CheckContentShareConnectivityFeedback=void 0,function(e){e[e.Succeeded=0]=\"Succeeded\",e[e.Failed=1]=\"Failed\",e[e.PermissionDenied=2]=\"PermissionDenied\",e[e.TimedOut=3]=\"TimedOut\",e[e.ConnectionFailed=4]=\"ConnectionFailed\"}(i=t.CheckContentShareConnectivityFeedback||(t.CheckContentShareConnectivityFeedback={})),t.default=i},7415:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.CheckNetworkTCPConnectivityFeedback=void 0,function(e){e[e.Succeeded=0]=\"Succeeded\",e[e.MeetingSessionURLsNotInitialized=1]=\"MeetingSessionURLsNotInitialized\",e[e.ConnectionFailed=2]=\"ConnectionFailed\",e[e.ICENegotiationFailed=3]=\"ICENegotiationFailed\"}(i=t.CheckNetworkTCPConnectivityFeedback||(t.CheckNetworkTCPConnectivityFeedback={})),t.default=i},4299:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.CheckNetworkUDPConnectivityFeedback=void 0,function(e){e[e.Succeeded=0]=\"Succeeded\",e[e.MeetingSessionURLsNotInitialized=1]=\"MeetingSessionURLsNotInitialized\",e[e.ConnectionFailed=2]=\"ConnectionFailed\",e[e.ICENegotiationFailed=3]=\"ICENegotiationFailed\"}(i=t.CheckNetworkUDPConnectivityFeedback||(t.CheckNetworkUDPConnectivityFeedback={})),t.default=i},6818:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.CheckVideoConnectivityFeedback=void 0,function(e){e[e.Succeeded=0]=\"Succeeded\",e[e.VideoInputRequestFailed=1]=\"VideoInputRequestFailed\",e[e.VideoInputPermissionDenied=2]=\"VideoInputPermissionDenied\",e[e.ConnectionFailed=3]=\"ConnectionFailed\",e[e.VideoNotSent=4]=\"VideoNotSent\"}(i=t.CheckVideoConnectivityFeedback||(t.CheckVideoConnectivityFeedback={})),t.default=i},1737:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.CheckVideoInputFeedback=void 0,function(e){e[e.Succeeded=0]=\"Succeeded\",e[e.Failed=1]=\"Failed\",e[e.PermissionDenied=2]=\"PermissionDenied\"}(i=t.CheckVideoInputFeedback||(t.CheckVideoInputFeedback={})),t.default=i},3980:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(6802),s=i(543),o=i(4142),a=i(6991),c=i(1789),d=i(250),l=i(2084),u=i(8892),h=i(9333),p=i(1087),m=i(2606),f=i(7415),g=i(4299),v=i(6818),S=i(1737),b=i(3990);class y{constructor(e,t,i=new b.default){this.logger=e,this.meetingSession=t,this.configuration=i,this.browserBehavior=new s.default}static delay(e){return n(this,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,e)))}))}checkAudioInput(e){return n(this,void 0,void 0,(function*(){try{return yield this.meetingSession.audioVideo.startAudioInput(e),yield this.meetingSession.audioVideo.stopAudioInput(),u.default.Succeeded}catch(e){return this.logger.error(`MeetingReadinessChecker: Audio input check failed with error ${e}`),e instanceof a.default?u.default.PermissionDenied:u.default.Failed}}))}checkAudioOutput(e,t,i=null){return n(this,void 0,void 0,(function*(){try{const n=e?o.default.getIntrinsicDeviceId(e):\"\";return yield this.playTone(n,this.configuration.audioOutputFrequency,i),(yield t())?h.default.Succeeded:h.default.Failed}catch(e){return this.logger.error(`MeetingReadinessChecker: Audio output check failed with error: ${e}`),h.default.Failed}finally{this.stopTone()}}))}playTone(e,t,i){return n(this,void 0,void 0,(function*(){const n=this.configuration.audioOutputGain;this.oscillatorNode&&this.stopTone(),this.audioContext=o.default.getAudioContext(),this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=0,this.oscillatorNode=this.audioContext.createOscillator(),this.oscillatorNode.frequency.value=t,this.oscillatorNode.connect(this.gainNode),this.destinationStream=this.audioContext.createMediaStreamDestination(),this.gainNode.connect(this.destinationStream);const s=this.audioContext.currentTime+.1;this.gainNode.gain.linearRampToValueAtTime(0,s),this.gainNode.gain.linearRampToValueAtTime(n,s+.1),this.oscillatorNode.start();const a=new r.default(this.logger);try{this.browserBehavior.supportsSetSinkId()&&(yield a.bindAudioDevice({deviceId:e}))}catch(e){this.logger.error(`Failed to bind audio device: ${e}`)}try{yield a.bindAudioElement(i||new Audio)}catch(e){this.logger.error(`Failed to bind audio element: ${e}`)}yield a.bindAudioStream(this.destinationStream.stream)}))}stopTone(){if(!(this.audioContext&&this.gainNode&&this.oscillatorNode&&this.destinationStream))return;const e=this.configuration.audioOutputGain,t=this.audioContext.currentTime;this.gainNode.gain.linearRampToValueAtTime(e,t+.1+1),this.gainNode.gain.linearRampToValueAtTime(0,t+.2+1),this.oscillatorNode.stop(),this.oscillatorNode.disconnect(this.gainNode),this.gainNode.disconnect(this.destinationStream),this.oscillatorNode=null,this.gainNode=null,this.destinationStream=null}checkVideoInput(e){return n(this,void 0,void 0,(function*(){try{return yield this.meetingSession.audioVideo.startVideoInput(e),yield this.meetingSession.audioVideo.stopVideoInput(),S.default.Succeeded}catch(e){return this.logger.error(`MeetingReadinessChecker: Video check failed with error ${e}`),e instanceof a.default?S.default.PermissionDenied:S.default.Failed}}))}checkCameraResolution(e,t,i){return n(this,void 0,void 0,(function*(){let n;try{const r=o.default.getIntrinsicDeviceId(e),s={video:this.calculateVideoConstraint(r,t,i)};n=yield navigator.mediaDevices.getUserMedia(s)}catch(e){return this.logger.error(`MeetingReadinessChecker: Camera resolution check with width: ${t} height ${i} failed with error ${e}`),e&&\"OverconstrainedError\"===e.name?p.default.ResolutionNotSupported:e&&\"NotAllowedError\"===e.name?p.default.PermissionDenied:p.default.Failed}finally{n&&n.getTracks().forEach((function(e){e.stop()}))}return p.default.Succeeded}))}calculateVideoConstraint(e,t,i){const n=this.browserBehavior.requiresResolutionAlignment(t,i),r={};return this.browserBehavior.requiresNoExactMediaStreamConstraints()?(r.deviceId=e,r.width=t,r.height=i):(r.deviceId={exact:e},r.width={exact:n[0]},r.height={exact:n[1]}),r}checkContentShareConnectivity(e){return n(this,void 0,void 0,(function*(){let t=!1,i=!1;const r={contentShareDidStart:()=>{t=!0}},s={audioVideoDidStart:()=>{i=!0}};try{return this.meetingSession.audioVideo.addObserver(s),this.meetingSession.audioVideo.start(),this.meetingSession.audioVideo.addContentShareObserver(r),yield this.meetingSession.audioVideo.startContentShareFromScreenCapture(e),yield this.executeTimeoutTask((()=>n(this,void 0,void 0,(function*(){return i&&t})))),i?(yield this.stopMeeting(),t?m.default.Succeeded:m.default.TimedOut):m.default.ConnectionFailed}catch(e){return this.logger.error(`MeetingReadinessChecker: Content share check failed with error ${e}`),\"NotAllowedError\"===e.name?m.default.PermissionDenied:m.default.Failed}finally{this.meetingSession.audioVideo.removeObserver(s),this.meetingSession.audioVideo.stopContentShare(),this.meetingSession.audioVideo.removeContentShareObserver(r)}}))}checkAudioConnectivity(e){return n(this,void 0,void 0,(function*(){let t=!1;const i={packetsReceived:0},r=this.meetingSession.audioVideo,s={metricsDidReceive(e){e.getRTCStatsReport().forEach((e=>{\"inbound-rtp\"===e.type&&\"audio\"===e.mediaType&&(i.packetsReceived=e.packetsReceived)}))}},o=(e,i,n,r)=>{e===this.meetingSession.configuration.credentials.attendeeId&&i&&(t=!0)};try{yield r.startAudioInput(e)}catch(e){return this.logger.error(`MeetingReadinessChecker: Failed to get audio input device with error ${e}`),e instanceof a.default?l.default.AudioInputPermissionDenied:l.default.AudioInputRequestFailed}return r.realtimeSubscribeToAttendeeIdPresence(o),r.addObserver(s),(yield this.startMeeting())?(yield this.executeTimeoutTask((()=>n(this,void 0,void 0,(function*(){return this.isAudioConnectionSuccessful(t,i)})))),r.removeObserver(s),r.realtimeUnsubscribeToAttendeeIdPresence(o),yield this.stopMeeting(),yield this.meetingSession.audioVideo.stopAudioInput(),this.isAudioConnectionSuccessful(t,i)?l.default.Succeeded:l.default.AudioNotReceived):(r.removeObserver(s),r.realtimeUnsubscribeToAttendeeIdPresence(o),yield this.meetingSession.audioVideo.stopAudioInput(),l.default.ConnectionFailed)}))}checkVideoConnectivity(e){return n(this,void 0,void 0,(function*(){const t=this.meetingSession.audioVideo;let i=0;const r={metricsDidReceive(e){e.getRTCStatsReport().forEach((e=>{\"outbound-rtp\"===e.type&&\"video\"===e.mediaType&&(i=e.packetsSent)}))}};try{yield t.startVideoInput(e)}catch(e){return this.logger.error(`MeetingReadinessChecker: Failed to get video input device with error ${e}`),e instanceof a.default?v.default.VideoInputPermissionDenied:v.default.VideoInputRequestFailed}return t.addObserver(r),(yield this.startMeeting())?(t.startLocalVideoTile(),yield this.executeTimeoutTask((()=>n(this,void 0,void 0,(function*(){return i>0})))),yield t.stopVideoInput(),yield this.stopMeeting(),t.removeObserver(r),i<=0?v.default.VideoNotSent:v.default.Succeeded):v.default.ConnectionFailed}))}checkNetworkUDPConnectivity(){return n(this,void 0,void 0,(function*(){let e=!1;const t={metricsDidReceive(t){t.getRTCStatsReport().forEach((t=>{\"candidate-pair\"===t.type&&\"succeeded\"===t.state&&(e=!0)}))}};try{this.originalURLRewriter=this.meetingSession.configuration.urls.urlRewriter}catch(e){return this.logger.error(`MeetingSessionConfiguration.urls doesn't exist. Error: ${e}`),g.default.MeetingSessionURLsNotInitialized}this.meetingSession.configuration.urls.urlRewriter=e=>{const t=this.originalURLRewriter(e);return t.includes(\"transport=tcp\")?\"\":t};const i=this.meetingSession.audioVideo;return i.addObserver(t),(yield this.startMeeting())?(yield this.executeTimeoutTask((()=>n(this,void 0,void 0,(function*(){return e})))),this.meetingSession.configuration.urls.urlRewriter=this.originalURLRewriter,yield this.stopMeeting(),i.removeObserver(t),e?g.default.Succeeded:g.default.ICENegotiationFailed):(this.meetingSession.configuration.urls.urlRewriter=this.originalURLRewriter,g.default.ConnectionFailed)}))}checkNetworkTCPConnectivity(){return n(this,void 0,void 0,(function*(){let e=!1;const t={metricsDidReceive(t){t.getRTCStatsReport().forEach((t=>{\"candidate-pair\"===t.type&&\"succeeded\"===t.state&&(e=!0)}))}};try{this.originalURLRewriter=this.meetingSession.configuration.urls.urlRewriter}catch(e){return this.logger.error(`MeetingSessionConfiguration.urls doesn't exist. Error: ${e}`),f.default.MeetingSessionURLsNotInitialized}this.meetingSession.configuration.urls.urlRewriter=e=>{const t=this.originalURLRewriter(e);return t.includes(\"transport=udp\")?\"\":t};const i=this.meetingSession.audioVideo;return i.addObserver(t),(yield this.startMeeting())?(yield this.executeTimeoutTask((()=>n(this,void 0,void 0,(function*(){return e})))),this.meetingSession.configuration.urls.urlRewriter=this.originalURLRewriter,yield this.stopMeeting(),i.removeObserver(t),e?f.default.Succeeded:f.default.ICENegotiationFailed):(this.meetingSession.configuration.urls.urlRewriter=this.originalURLRewriter,f.default.ConnectionFailed)}))}startMeeting(){return n(this,void 0,void 0,(function*(){let e=!1;const t={audioVideoDidStart:()=>{e=!0}};return this.meetingSession.audioVideo.addObserver(t),this.meetingSession.audioVideo.start(),yield this.executeTimeoutTask((()=>n(this,void 0,void 0,(function*(){return e})))),this.meetingSession.audioVideo.removeObserver(t),e}))}stopMeeting(){return n(this,void 0,void 0,(function*(){let e=!1;const t={audioVideoDidStop:t=>{e=!0}};return this.meetingSession.audioVideo.addObserver(t),this.meetingSession.audioVideo.stop(),yield this.executeTimeoutTask((()=>n(this,void 0,void 0,(function*(){return e})))),this.meetingSession.audioVideo.removeObserver(t),e}))}executeTimeoutTask(e){return n(this,void 0,void 0,(function*(){let t=!1;class i extends c.default{constructor(e,t){super(e),this.waitDurationMs=t,this.isCancelled=!1}cancel(){this.isCancelled=!0}run(){return n(this,void 0,void 0,(function*(){for(;!this.isCancelled;){if(yield e()){t=!0;break}yield y.delay(this.waitDurationMs)}}))}}const r=new d.default(this.logger,new i(this.logger,this.configuration.waitDurationMs),this.configuration.timeoutMs);return yield r.run(),t}))}isAudioConnectionSuccessful(e,t){return e&&t.packetsReceived>0}}t.default=y},3990:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(){this.timeoutMs=1e4,this.waitDurationMs=3e3,this.audioOutputFrequency=440,this.audioOutputGain=.1}}},4202:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(9059),s=i(8538),o=i(8434),a=i(543),c=i(8370),d=i(8023),l=i(7237),u=i(146),h=i(3831),p=i(9141),m=i(7631);t.default=class{constructor(e,t,i,n){this._eventController=n,this._configuration=e,this._logger=t,this.checkBrowserSupportAndFeatureConfiguration(),l.default.addLogger(this._logger),l.default.register(),this._eventController||(this._eventController=new h.default(e,t)),i.eventController||(i.eventController=this.eventController),this.audioVideoController=new r.default(this._configuration,this._logger,new m.default(this._logger),i,new p.default(this._configuration.reconnectTimeoutMs,new o.default(this._configuration.reconnectFixedWaitMs,this._configuration.reconnectShortBackOffMs,this._configuration.reconnectLongBackOffMs)),this.eventController),this._deviceController=i;const a=new c.default(this._logger);this.contentShareController=new d.default(a,new r.default(d.default.createContentShareMeetingSessionConfigure(this._configuration),this._logger,new m.default(this._logger),a,new p.default(this._configuration.reconnectTimeoutMs,new o.default(this._configuration.reconnectFixedWaitMs,this._configuration.reconnectShortBackOffMs,this._configuration.reconnectLongBackOffMs))),this.audioVideoController),this.audioVideoFacade=new s.default(this.audioVideoController,this.audioVideoController.videoTileController,this.audioVideoController.realtimeController,this.audioVideoController.audioMixController,this._deviceController,this.contentShareController)}get configuration(){return this._configuration}get logger(){return this._logger}get audioVideo(){return this.audioVideoFacade}get contentShare(){return this.contentShareController}get deviceController(){return this._deviceController}get eventController(){return this._eventController}destroy(){return n(this,void 0,void 0,(function*(){u.isDestroyable(this.contentShareController)&&(yield this.contentShareController.destroy()),u.isDestroyable(this.audioVideoController)&&(yield this.audioVideoController.destroy()),u.isDestroyable(this.eventController)&&(yield this.eventController.destroy()),l.default.removeLogger(this._logger),this._logger=void 0,this._configuration=void 0,this._deviceController=void 0,this.audioVideoFacade=void 0,this.audioVideoController=void 0,this.contentShareController=void 0,this._eventController=void 0}))}checkBrowserSupportAndFeatureConfiguration(){const e=new a.default,t=`${e.name()} ${e.majorVersion()} (${e.version()})`;if(this.logger.info(`browser is ${t}`),e.isSupported()||this.logger.warn(`this browser is not currently supported. Stability may suffer. Supported browsers are: ${e.supportString()}.`),this._configuration.videoUplinkBandwidthPolicy)if(this.isSimulcastUplinkPolicy(this._configuration.videoUplinkBandwidthPolicy)){if(!e.hasChromiumWebRTC())throw new Error(\"Simulcast is only supported on Chromium-based browsers\");this._configuration.enableSimulcastForUnifiedPlanChromiumBasedBrowsers=!0}else this._configuration.enableSimulcastForUnifiedPlanChromiumBasedBrowsers=!1;this._configuration.enableSimulcastForUnifiedPlanChromiumBasedBrowsers&&(e.hasChromiumWebRTC()?this.logger.info(`Simulcast is enabled for ${e.name()}`):(this._configuration.enableSimulcastForUnifiedPlanChromiumBasedBrowsers=!1,this.logger.info(\"Simulcast is only supported on Chromium-based browsers\")))}isSimulcastUplinkPolicy(e){return!(!e||!e.addObserver)}}},589:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(3731),r=i(8690),s=i(8015),o=i(6057);t.default=class{constructor(e,t){this.meetingId=null,this.externalMeetingId=null,this.credentials=null,this.urls=null,this.connectionTimeoutMs=15e3,this.attendeePresenceTimeoutMs=0,this.connectionHealthPolicyConfiguration=new n.default,this.reconnectTimeoutMs=12e4,this.reconnectFixedWaitMs=0,this.reconnectShortBackOffMs=1e3,this.reconnectLongBackOffMs=5e3,this.enableSimulcastForUnifiedPlanChromiumBasedBrowsers=!1,this.videoDownlinkBandwidthPolicy=null,this.videoUplinkBandwidthPolicy=null,this.keepLastFrameWhenPaused=!1,this.disablePeriodicKeyframeRequestOnContentSender=!1,e&&((e=r.toLowerCasePropertyNames(e)).meeting&&(e=e.meeting),this.meetingId=e.meetingid,this.externalMeetingId=e.externalmeetingid,this.urls=new o.default,this.urls.audioHostURL=e.mediaplacement.audiohosturl,this.urls.signalingURL=e.mediaplacement.signalingurl,this.urls.turnControlURL=e.mediaplacement.turncontrolurl,e.mediaplacement.eventingestionurl&&(this.urls.eventIngestionURL=e.mediaplacement.eventingestionurl)),t&&((t=r.toLowerCasePropertyNames(t)).attendee&&(t=t.attendee),this.credentials=new s.default,this.credentials.attendeeId=t.attendeeid,this.credentials.externalUserId=t.externaluserid,this.credentials.joinToken=t.jointoken)}}},8015:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(){this.attendeeId=null,this.externalUserId=null,this.joinToken=null}toJSON(){return{attendeeId:this.attendeeId,joinToken:null===this.joinToken?null:\"\"}}}},7604:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.MeetingSessionLifecycleEvent=void 0,function(e){e[e.Connecting=0]=\"Connecting\",e[e.Started=1]=\"Started\",e[e.Stopped=2]=\"Stopped\"}(i=t.MeetingSessionLifecycleEvent||(t.MeetingSessionLifecycleEvent={})),t.default=i},1296:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.MeetingSessionLifecycleEventCondition=void 0,function(e){e[e.ConnectingNew=0]=\"ConnectingNew\",e[e.ReconnectingExisting=1]=\"ReconnectingExisting\",e[e.StartedNew=2]=\"StartedNew\",e[e.StartedExisting=3]=\"StartedExisting\",e[e.StartedAfterReconnect=4]=\"StartedAfterReconnect\",e[e.StoppedCleanly=5]=\"StoppedCleanly\",e[e.StoppedWithFailure=6]=\"StoppedWithFailure\"}(i=t.MeetingSessionLifecycleEventCondition||(t.MeetingSessionLifecycleEventCondition={})),t.default=i},3789:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(289),r=i(5687);class s{constructor(e){this._statusCode=e}statusCode(){return this._statusCode}isFailure(){switch(this._statusCode){case r.default.AudioAuthenticationRejected:case r.default.AudioCallAtCapacity:case r.default.AudioInternalServerError:case r.default.AudioServiceUnavailable:case r.default.AudioDisconnected:case r.default.VideoCallAtSourceCapacity:case r.default.SignalingBadRequest:case r.default.SignalingInternalServerError:case r.default.SignalingRequestFailed:case r.default.ICEGatheringTimeoutWorkaround:case r.default.ConnectionHealthReconnect:case r.default.RealtimeApiFailed:case r.default.TaskFailed:case r.default.NoAttendeePresent:return!0;default:return!1}}isTerminal(){switch(this._statusCode){case r.default.Left:case r.default.AudioJoinedFromAnotherDevice:case r.default.AudioAuthenticationRejected:case r.default.AudioCallAtCapacity:case r.default.MeetingEnded:case r.default.AudioDisconnected:case r.default.TURNCredentialsForbidden:case r.default.SignalingBadRequest:case r.default.SignalingRequestFailed:case r.default.VideoCallAtSourceCapacity:case r.default.RealtimeApiFailed:case r.default.AudioAttendeeRemoved:return!0;default:return!1}}isAudioConnectionFailure(){switch(this._statusCode){case r.default.AudioAuthenticationRejected:case r.default.AudioInternalServerError:case r.default.AudioServiceUnavailable:case r.default.ICEGatheringTimeoutWorkaround:case r.default.SignalingBadRequest:case r.default.SignalingInternalServerError:case r.default.SignalingRequestFailed:case r.default.RealtimeApiFailed:case r.default.NoAttendeePresent:return!0;default:return!1}}toString(){switch(this._statusCode){case r.default.OK:return\"Everything is OK so far.\";case r.default.Left:return\"The attendee left the meeting.\";case r.default.AudioJoinedFromAnotherDevice:return\"The attendee joined from another device.\";case r.default.AudioAuthenticationRejected:return\"The meeting rejected the attendee.\";case r.default.AudioCallAtCapacity:return\"The attendee couldn't join because the meeting was at capacity.\";case r.default.MeetingEnded:return\"The meeting ended.\";case r.default.AudioInternalServerError:case r.default.AudioServiceUnavailable:case r.default.AudioDisconnected:return\"The audio connection failed.\";case r.default.VideoCallSwitchToViewOnly:return\"The attendee couldn't start the local video because the maximum video capacity was reached.\";case r.default.VideoCallAtSourceCapacity:return\"The connection failed due to an internal server error.\";case r.default.SignalingBadRequest:case r.default.SignalingInternalServerError:case r.default.SignalingRequestFailed:return\"The signaling connection failed.\";case r.default.ICEGatheringTimeoutWorkaround:return\"Gathering ICE candidates timed out. In Chrome, this might indicate that the browser is in a bad state after reconnecting to VPN.\";case r.default.ConnectionHealthReconnect:return\"The meeting was reconnected.\";case r.default.RealtimeApiFailed:return\"The real-time API failed. This status code might indicate that the callback you passed to the real-time API threw an exception.\";case r.default.TaskFailed:return\"The connection failed. See the error message for more details.\";case r.default.IncompatibleSDP:return\"The connection failed due to incompatible SDP.\";case r.default.TURNCredentialsForbidden:return\"The meeting ended, or the attendee was removed.\";case r.default.NoAttendeePresent:return\"The attendee was not present.\";case r.default.AudioAttendeeRemoved:return\"The meeting ended because attendee removed.\";case r.default.AudioVideoWasRemovedFromPrimaryMeeting:return\"The Primary meeting credentials provided are no longer valid. chime::DeleteAttendee may have been called on them.\";case r.default.AudioDisconnectAudio:return\"The audio connection failed.\";default:{const e=this._statusCode;throw new Error(`Unhandled case: ${e}`)}}}static fromSignalFrame(e){return e.error&&e.error.status?this.fromSignalingStatus(e.error.status):e.type===n.SdkSignalFrame.Type.AUDIO_STATUS?e.audioStatus?this.fromAudioStatus(e.audioStatus.audioStatus):new s(r.default.SignalingRequestFailed):e.type===n.SdkSignalFrame.Type.PRIMARY_MEETING_LEAVE?new s(r.default.AudioVideoWasRemovedFromPrimaryMeeting):new s(r.default.OK)}static fromAudioStatus(e){switch(e){case 200:return new s(r.default.OK);case 301:return new s(r.default.AudioJoinedFromAnotherDevice);case 302:return new s(r.default.AudioDisconnectAudio);case 403:return new s(r.default.AudioAuthenticationRejected);case 409:return new s(r.default.AudioCallAtCapacity);case 410:return new s(r.default.MeetingEnded);case 411:return new s(r.default.AudioAttendeeRemoved);case 500:return new s(r.default.AudioInternalServerError);case 503:return new s(r.default.AudioServiceUnavailable);default:return 2===Math.floor(e/100)?new s(r.default.OK):new s(r.default.AudioDisconnected)}}static fromSignalingStatus(e){switch(e){case 206:return new s(r.default.VideoCallSwitchToViewOnly);case 509:return new s(r.default.VideoCallAtSourceCapacity);case 403:return new s(r.default.AudioAuthenticationRejected);case 409:return new s(r.default.AudioCallAtCapacity);default:switch(Math.floor(e/100)){case 2:return new s(r.default.OK);case 4:return new s(r.default.SignalingBadRequest);case 5:return new s(r.default.SignalingInternalServerError);default:return new s(r.default.SignalingRequestFailed)}}}}t.default=s},5687:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.MeetingSessionStatusCode=void 0,function(e){e[e.OK=0]=\"OK\",e[e.Left=1]=\"Left\",e[e.AudioJoinedFromAnotherDevice=2]=\"AudioJoinedFromAnotherDevice\",e[e.AudioAuthenticationRejected=3]=\"AudioAuthenticationRejected\",e[e.AudioCallAtCapacity=4]=\"AudioCallAtCapacity\",e[e.MeetingEnded=5]=\"MeetingEnded\",e[e.AudioInternalServerError=6]=\"AudioInternalServerError\",e[e.AudioServiceUnavailable=7]=\"AudioServiceUnavailable\",e[e.AudioDisconnected=8]=\"AudioDisconnected\",e[e.VideoCallSwitchToViewOnly=9]=\"VideoCallSwitchToViewOnly\",e[e.VideoCallAtSourceCapacity=10]=\"VideoCallAtSourceCapacity\",e[e.SignalingBadRequest=11]=\"SignalingBadRequest\",e[e.SignalingInternalServerError=12]=\"SignalingInternalServerError\",e[e.SignalingRequestFailed=13]=\"SignalingRequestFailed\",e[e.ICEGatheringTimeoutWorkaround=14]=\"ICEGatheringTimeoutWorkaround\",e[e.ConnectionHealthReconnect=15]=\"ConnectionHealthReconnect\",e[e.RealtimeApiFailed=16]=\"RealtimeApiFailed\",e[e.TaskFailed=17]=\"TaskFailed\",e[e.IncompatibleSDP=18]=\"IncompatibleSDP\",e[e.TURNCredentialsForbidden=19]=\"TURNCredentialsForbidden\",e[e.NoAttendeePresent=20]=\"NoAttendeePresent\",e[e.AudioAttendeeRemoved=21]=\"AudioAttendeeRemoved\",e[e.AudioVideoWasRemovedFromPrimaryMeeting=22]=\"AudioVideoWasRemovedFromPrimaryMeeting\",e[e.AudioDisconnectAudio=23]=\"AudioDisconnectAudio\"}(i=t.MeetingSessionStatusCode||(t.MeetingSessionStatusCode={})),t.default=i},7215:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(){this.username=null,this.password=null,this.ttl=null,this.uris=null}}},6057:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(){this._audioHostURL=null,this._signalingURL=null,this._turnControlURL=null,this._eventIngestionURL=null,this.urlRewriter=e=>e}get audioHostURL(){return this.urlRewriter(this._audioHostURL)}set audioHostURL(e){this._audioHostURL=e}get signalingURL(){return this.urlRewriter(this._signalingURL)}set signalingURL(e){this._signalingURL=e}get turnControlURL(){return this.urlRewriter(this._turnControlURL)}set turnControlURL(e){this._turnControlURL=e}get eventIngestionURL(){return this.urlRewriter(this._eventIngestionURL)}set eventIngestionURL(e){this._eventIngestionURL=e}}},5723:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});class i{constructor(){this.remoteVideoAvailable=!1,this.canStartLocalVideo=!1}equal(e){return this.remoteVideoAvailable===e.remoteVideoAvailable&&this.canStartLocalVideo===e.canStartLocalVideo}clone(){const e=new i;return e.remoteVideoAvailable=this.remoteVideoAvailable,e.canStartLocalVideo=this.canStartLocalVideo,e}}t.default=i},9358:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e,t,i){this.type=e,this.headers=t,this.payload=i}}},8947:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(2113),s=i(8434),o=i(7237),a=i(9358),c=i(9141),d=i(7797),l=i(334),u=i(7631),h=i(7387),p=i(106);t.default=class{constructor(e,t,i,n,r){this.configuration=e,this.logger=t,this.webSocket=i,this.reconnectController=n,this.sigV4=r,this.observerQueue=new Set,this.webSocket||(this.webSocket=new u.default(this.logger)),this.reconnectController||(this.reconnectController=new c.default(e.reconnectTimeoutMs,new s.default(e.reconnectFixedWaitMs,e.reconnectShortBackoffMs,e.reconnectLongBackoffMs))),this.sigV4||(this.sigV4=new l.default(this.configuration.chimeClient)),o.default.addLogger(this.logger),o.default.register(),this.preBootstrapMessages=[]}addObserver(e){this.logger.info(\"adding messaging observer\"),this.observerQueue.add(e)}removeObserver(e){this.logger.info(\"removing messaging observer\"),this.observerQueue.delete(e)}start(){return n(this,void 0,void 0,(function*(){this.isClosed()?yield this.startConnecting(!1):this.logger.info(\"messaging session already started\")}))}stop(){this.isClosed()?this.logger.info(\"no existing messaging session needs closing\"):(this.isClosing=!0,this.webSocket.close(),o.default.removeLogger(this.logger))}forEachObserver(e){for(const t of this.observerQueue)d.default.nextTick((()=>{this.observerQueue.has(t)&&e(t)}))}setUpEventListeners(){this.webSocket.addEventListener(\"open\",(()=>{this.openEventHandler()})),this.webSocket.addEventListener(\"message\",(e=>{this.receiveMessageHandler(e.data)})),this.webSocket.addEventListener(\"close\",(e=>{this.closeEventHandler(e)})),this.webSocket.addEventListener(\"error\",(()=>{this.logger.error(\"WebSocket error\")}))}startConnecting(e){return n(this,void 0,void 0,(function*(){return yield this.startConnectingInternal(e),yield new Promise(((e,t)=>{this.bootstrapResolved=e,this.bootstrapRejected=t}))}))}startConnectingInternal(e){var t;return n(this,void 0,void 0,(function*(){let i=this.configuration.endpointUrl;if(e||this.reconnectController.reset(),this.reconnectController.hasStartedConnectionAttempt()?this.reconnectController.startedConnectionAttempt(!1):this.reconnectController.startedConnectionAttempt(!0),e||void 0===i)try{if(this.configuration.chimeClient.getMessagingSessionEndpoint instanceof Function){const e=yield this.configuration.chimeClient.getMessagingSessionEndpoint();i=(null===(t=e.Endpoint)||void 0===t?void 0:t.Url)?e.Endpoint.Url:(yield this.configuration.chimeClient.getMessagingSessionEndpoint().promise()).Endpoint.Url}else i=(yield this.configuration.chimeClient.send(new r.GetMessagingSessionEndpointCommand({}))).Endpoint.Url;this.logger.debug(`Messaging endpoint resolved to: ${i}`)}catch(e){this.logger.error(`Messaging Session failed to resolve endpoint: ${e}`);const t=new CloseEvent(\"close\",{wasClean:!1,code:4999,reason:\"Failed to get messaging session endpoint URL\",bubbles:!1});return void this.closeEventHandler(t)}const n=yield this.prepareWebSocketUrl(i);this.logger.info(`opening connection to ${n}`),e||this.reconnectController.reset(),this.reconnectController.hasStartedConnectionAttempt()?this.reconnectController.startedConnectionAttempt(!1):this.reconnectController.startedConnectionAttempt(!0),this.webSocket.create(n,[],!0),this.forEachObserver((t=>{t.messagingSessionDidStartConnecting&&t.messagingSessionDidStartConnecting(e)})),this.setUpEventListeners()}))}prepareWebSocketUrl(e){return n(this,void 0,void 0,(function*(){const t=new Map;return t.set(\"userArn\",[this.configuration.userArn]),t.set(\"sessionId\",[this.configuration.messagingSessionId]),this.configuration.prefetchOn===p.default.Connect&&t.set(\"prefetch-on\",[p.default.Connect]),this.configuration.prefetchSortBy&&t.set(\"prefetch-sort-by\",[this.configuration.prefetchSortBy]),yield this.sigV4.signURL(\"GET\",\"wss\",\"chime\",e,\"/connect\",\"\",t)}))}isClosed(){return this.webSocket.readyState()===h.default.None||this.webSocket.readyState()===h.default.Closed}openEventHandler(){this.reconnectController.reset(),this.isSessionEstablished=!1}receiveMessageHandler(e){try{const t=JSON.parse(e),i=t.Headers[\"x-amz-chime-event-type\"],n=new a.default(i,t.Headers,t.Payload||null);if(this.isSessionEstablished||\"SESSION_ESTABLISHED\"!==i){if(!this.isSessionEstablished)return void this.preBootstrapMessages.push(n)}else{this.forEachObserver((e=>{e.messagingSessionDidStart&&e.messagingSessionDidStart()})),this.bootstrapResolved(),this.isSessionEstablished=!0;const e=this.preBootstrapMessages.length;for(let t=0;t{this.sendMessageToObserver(t,e)}))}}this.forEachObserver((e=>{this.sendMessageToObserver(e,n)}))}catch(e){this.logger.error(`Messaging parsing failed: ${e}`)}}sendMessageToObserver(e,t){e.messagingSessionDidReceiveMessage&&e.messagingSessionDidReceiveMessage(t)}retryConnection(){return this.reconnectController.retryWithBackoff((()=>n(this,void 0,void 0,(function*(){yield this.startConnecting(!0)}))),null)}closeEventHandler(e){this.logger.info(`WebSocket close: ${e.code} ${e.reason}`),4999!==e.code&&this.webSocket.destroy(),!this.isClosing&&this.canReconnect(e.code)&&this.retryConnection()||(this.isClosing=!1,this.isSessionEstablished?this.forEachObserver((t=>{t.messagingSessionDidStop&&t.messagingSessionDidStop(e)})):this.bootstrapRejected(e))}canReconnect(e){return 1001===e||1006===e||e>=1011&&e<=1014||e>4e3&&4002!==e&&4003!==e&&4401!==e}}},4323:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e,t,i,n){this.userArn=e,this.messagingSessionId=t,this.endpointUrl=i,this.chimeClient=n,this.reconnectTimeoutMs=1e4,this.reconnectFixedWaitMs=0,this.reconnectShortBackoffMs=1e3,this.reconnectLongBackoffMs=5e3,this.prefetchOn=void 0,this.prefetchSortBy=void 0,this.messagingSessionId||(this.messagingSessionId=this.generateSessionId())}generateSessionId(){const e=new Uint32Array(1);return window.crypto.getRandomValues(e)[0].toString()}}},106:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e.Connect=\"connect\"}(i||(i={})),t.default=i},3938:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e.Unread=\"unread\",e.LastMessageTimestamp=\"last-message-timestamp\"}(i||(i={})),t.default=i},214:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(8890);class r{constructor(e){this._id=e}id(){return this._id}base(){return this._id?this._id.split(r.MODALITY_SEPARATOR)[0]:\"\"}modality(){if(!this._id)return\"\";const e=this._id.split(r.MODALITY_SEPARATOR);return 2===e.length?e[1]:\"\"}hasModality(e){return\"\"!==e&&this.modality()===e}withModality(e){const t=new r(this.base()+r.MODALITY_SEPARATOR+e);return\"\"===e||\"\"===this.base()||new r(t._id).modality()!==e?new r(this.base()):t}}t.default=r,r.MODALITY_SEPARATOR=n.default.Modality[0],r.MODALITY_CONTENT=n.default.Modality.substr(1)},7500:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(7797),r=i(3922),s=i(9416),o=i(289),a=i(8660);t.default=class{constructor(e,t,i){this.signalingClient=e,this.intervalMs=t,this.logger=i,this.observerQueue=new Set,this.consecutivePongsUnaccountedFor=0,this.intervalScheduler=new r.default(this.intervalMs),this.pingId=0}addObserver(e){this.logger.info(\"adding a ping-pong observer\"),this.observerQueue.add(e)}removeObserver(e){this.logger.info(\"removing a ping-pong observer\"),this.observerQueue.delete(e)}forEachObserver(e){for(const t of this.observerQueue)n.default.nextTick((()=>{this.observerQueue.has(t)&&e(t)}))}start(){this.stop(),this.signalingClient.registerObserver(this),this.signalingClient.ready()&&this.startPingInterval()}stop(){this.stopPingInterval(),this.signalingClient.removeObserver(this)}startPingInterval(){this.intervalScheduler.start((()=>{this.ping()})),this.ping()}stopPingInterval(){this.intervalScheduler.stop(),this.pingId=0,this.consecutivePongsUnaccountedFor=0}ping(){this.consecutivePongsUnaccountedFor>0&&(this.logger.warn(`missed pong ${this.consecutivePongsUnaccountedFor} time(s)`),this.forEachObserver((e=>{a.Maybe.of(e.didMissPongs).map((t=>t.bind(e)(this.consecutivePongsUnaccountedFor)))}))),this.consecutivePongsUnaccountedFor+=1,this.pingId=this.pingId+1&4294967295;const e=o.SdkPingPongFrame.create();e.pingId=this.pingId,e.type=o.SdkPingPongType.PING,this.pingTimestampLocalMs=this.signalingClient.pingPong(e),this.logger.debug((()=>`sent ping ${this.pingId}`))}pong(e){const t=o.SdkPingPongFrame.create();t.pingId=e,t.type=o.SdkPingPongType.PONG,this.signalingClient.pingPong(t)}handleSignalingClientEvent(e){switch(e.type){case s.default.WebSocketOpen:this.startPingInterval();break;case s.default.WebSocketFailed:case s.default.WebSocketError:this.logger.warn(`stopped pinging (${s.default[e.type]})`),this.stopPingInterval();break;case s.default.WebSocketClosing:case s.default.WebSocketClosed:this.logger.info(`stopped pinging (${s.default[e.type]})`),this.stopPingInterval();break;case s.default.ReceivedSignalFrame:if(e.message.type!==o.SdkSignalFrame.Type.PING_PONG)break;if(e.message.pingPong.type===o.SdkPingPongType.PONG){const t=e.message.pingPong.pingId;if(t!==this.pingId){this.logger.warn(`unexpected ping id ${t} (expected ${this.pingId})`);break}let i;if(this.consecutivePongsUnaccountedFor=0,\"number\"!=typeof e.message.timestampMs)break;i=e.message.timestampMs,this.logger.debug((()=>`received pong ${t} with timestamp ${i}`));const n=e.timestampMs-this.pingTimestampLocalMs,r=Math.round(i-n/2),s=this.pingTimestampLocalMs-r;this.logger.info(`local clock skew estimate=${s}ms from ping-pong time=${n}ms`),this.forEachObserver((e=>{a.Maybe.of(e.didReceivePong).map((i=>i.bind(e)(t,s,n)))}))}else this.pong(e.message.pingPong.pingId)}}}},983:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(5308),r=i(9825),s=i(9576);t.default=class{constructor(e,t){this.mediaStreamBroker=e,this.state=new r.default,this._transcriptionController=t||new n.default(this)}realtimeSetLocalAttendeeId(e,t){this.state.localAttendeeId=e,this.state.localExternalUserId=t}realtimeSetAttendeeIdPresence(e,t,i,n,r){try{t&&(this.state.attendeeIdToExternalUserId[e]=i);for(const s of this.state.attendeeIdChangesCallbacks)s(e,t,i,n,r)}catch(e){this.onError(e)}}realtimeSubscribeToAttendeeIdPresence(e){try{this.state.attendeeIdChangesCallbacks.push(e)}catch(e){this.onError(e)}}realtimeUnsubscribeToAttendeeIdPresence(e){try{const t=this.state.attendeeIdChangesCallbacks.indexOf(e);-1!==t&&this.state.attendeeIdChangesCallbacks.splice(t,1)}catch(e){this.onError(e)}}realtimeSetCanUnmuteLocalAudio(e){try{if(this.state.canUnmute===e)return;this.state.canUnmute=e;for(const t of this.state.setCanUnmuteLocalAudioCallbacks)t(e)}catch(e){this.onError(e)}}realtimeSubscribeToSetCanUnmuteLocalAudio(e){try{this.state.setCanUnmuteLocalAudioCallbacks.push(e)}catch(e){this.onError(e)}}realtimeUnsubscribeToSetCanUnmuteLocalAudio(e){try{const t=this.state.setCanUnmuteLocalAudioCallbacks.indexOf(e);-1!==t&&this.state.setCanUnmuteLocalAudioCallbacks.splice(t,1)}catch(e){this.onError(e)}}realtimeCanUnmuteLocalAudio(){return this.state.canUnmute}realtimeMuteLocalAudio(){if(!this.state.muted)try{this.setAudioInputEnabled(!1),this.state.muted=!0,this.realtimeUpdateVolumeIndicator(this.state.localAttendeeId,null,null,null,this.state.localExternalUserId);for(const e of this.state.muteAndUnmuteLocalAudioCallbacks)e(!0)}catch(e){this.onError(e)}}realtimeUnmuteLocalAudio(){if(!this.state.muted)return!0;if(!this.state.canUnmute)return!1;try{this.setAudioInputEnabled(!0),this.state.muted=!1,this.realtimeUpdateVolumeIndicator(this.state.localAttendeeId,null,null,null,this.state.localExternalUserId);for(const e of this.state.muteAndUnmuteLocalAudioCallbacks)e(!1);return!0}catch(e){return this.onError(e),!1}}realtimeSubscribeToMuteAndUnmuteLocalAudio(e){try{this.state.muteAndUnmuteLocalAudioCallbacks.push(e)}catch(e){this.onError(e)}}realtimeUnsubscribeToMuteAndUnmuteLocalAudio(e){try{const t=this.state.muteAndUnmuteLocalAudioCallbacks.indexOf(e);-1!==t&&this.state.muteAndUnmuteLocalAudioCallbacks.splice(t,1)}catch(e){this.onError(e)}}realtimeIsLocalAudioMuted(){return this.state.muted}realtimeSubscribeToVolumeIndicator(e,t){try{this.state.volumeIndicatorCallbacks.hasOwnProperty(e)||(this.state.volumeIndicatorCallbacks[e]=[]),this.state.volumeIndicatorCallbacks[e].push(t),this.sendVolumeIndicatorChange(e,!0,!0,!0,this.state.attendeeIdToExternalUserId[e])}catch(e){this.onError(e)}}realtimeUnsubscribeFromVolumeIndicator(e,t){if(this.state.volumeIndicatorCallbacks[e])if(t){const i=this.state.volumeIndicatorCallbacks[e].indexOf(t);i>=0&&this.state.volumeIndicatorCallbacks[e].splice(i,1)}else delete this.state.volumeIndicatorCallbacks[e]}realtimeUpdateVolumeIndicator(e,t,i,n,r){try{i=this.applyLocalMuteOverride(e,i);const s=this.getVolumeIndicatorState(e);let o=!1,a=!1,c=!1;null!==i&&s.muted!==i&&(s.muted=i,a=!0,s.muted&&0!==s.volume&&(s.volume=0,o=!0)),s.muted||null===t||(s.volume!==t&&(s.volume=t,o=!0),null===s.muted&&(s.muted=!1,a=!0)),null!==n&&s.signalStrength!==n&&(s.signalStrength=n,c=!0),this.sendVolumeIndicatorChange(e,o,a,c,r)}catch(e){this.onError(e)}}realtimeSubscribeToLocalSignalStrengthChange(e){try{if(this.state.localSignalStrengthChangeCallbacks.push(e),null===this.state.localAttendeeId)return;this.sendLocalSignalStrengthChange(this.state.localAttendeeId,!0)}catch(e){this.onError(e)}}realtimeUnsubscribeToLocalSignalStrengthChange(e){try{const t=this.state.localSignalStrengthChangeCallbacks.indexOf(e);-1!==t&&this.state.localSignalStrengthChangeCallbacks.splice(t,1)}catch(e){this.onError(e)}}realtimeSubscribeToSendDataMessage(e){try{this.state.sendDataMessageCallbacks.push(e)}catch(e){this.onError(e)}}realtimeUnsubscribeFromSendDataMessage(e){try{const t=this.state.sendDataMessageCallbacks.indexOf(e);-1!==t&&this.state.sendDataMessageCallbacks.splice(t,1)}catch(e){this.onError(e)}}realtimeSendDataMessage(e,t,i){try{for(const n of this.state.sendDataMessageCallbacks)n(e,t,i)}catch(e){this.onError(e)}}realtimeSubscribeToReceiveDataMessage(e,t){try{this.state.receiveDataMessageCallbacks.has(e)?this.state.receiveDataMessageCallbacks.get(e).push(t):this.state.receiveDataMessageCallbacks.set(e,[t])}catch(e){this.onError(e)}}realtimeUnsubscribeFromReceiveDataMessage(e){try{this.state.receiveDataMessageCallbacks.delete(e)}catch(e){this.onError(e)}}realtimeReceiveDataMessage(e){try{if(this.state.receiveDataMessageCallbacks.has(e.topic))for(const t of this.state.receiveDataMessageCallbacks.get(e.topic))t(e)}catch(e){this.onError(e)}}realtimeSubscribeToFatalError(e){try{this.state.fatalErrorCallbacks.push(e)}catch(e){this.onError(e)}}realtimeUnsubscribeToFatalError(e){try{const t=this.state.fatalErrorCallbacks.indexOf(e);-1!==t&&this.state.fatalErrorCallbacks.splice(t,1)}catch(e){this.onError(e)}}get transcriptionController(){return this._transcriptionController}setAudioInputEnabled(e){e?this.mediaStreamBroker.unmuteLocalAudioInputStream():this.mediaStreamBroker.muteLocalAudioInputStream()}applyLocalMuteOverride(e,t){const i=this.state.localAttendeeId,n=this.state.muted;return e!==i?t:\"activeDevices\"in this.mediaStreamBroker&&this.mediaStreamBroker.activeDevices.audio?n:t}sendVolumeIndicatorChange(e,t,i,n,r){if(this.sendLocalSignalStrengthChange(e,n),!this.state.volumeIndicatorCallbacks.hasOwnProperty(e))return;const o=this.getVolumeIndicatorState(e),a=new s.default;if(t&&(a.volume=o.volume),i&&(a.muted=o.muted),n&&(a.signalStrength=o.signalStrength),!this.stateIsEmpty(a))for(const t of this.state.volumeIndicatorCallbacks[e])t(e,a.volume,a.muted,a.signalStrength,r)}sendLocalSignalStrengthChange(e,t){if(!t)return;if(e!==this.state.localAttendeeId)return;const i=this.getVolumeIndicatorState(e).signalStrength;if(null!==i)for(const e of this.state.localSignalStrengthChangeCallbacks)e(i)}getVolumeIndicatorState(e){return this.state.volumeIndicatorState.hasOwnProperty(e)||(this.state.volumeIndicatorState[e]=new s.default),this.state.volumeIndicatorState[e]}stateIsEmpty(e){return null===e.volume&&null===e.muted&&null===e.signalStrength}onError(e){try{for(const t of this.state.fatalErrorCallbacks)t(e)}catch(t){try{console.error(e),console.error(t)}catch(e){}}}}},5910:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(){this.attendeeIndex=null,this.attendeesInFrame=null}}},9825:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(){this.localAttendeeId=null,this.localExternalUserId=null,this.attendeeIdChangesCallbacks=[],this.canUnmute=!0,this.setCanUnmuteLocalAudioCallbacks=[],this.muted=!1,this.muteAndUnmuteLocalAudioCallbacks=[],this.volumeIndicatorState={},this.attendeeIdToExternalUserId={},this.volumeIndicatorCallbacks={},this.localSignalStrengthChangeCallbacks=[],this.fatalErrorCallbacks=[],this.sendDataMessageCallbacks=[],this.receiveDataMessageCallbacks=new Map}}},9576:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(){this.volume=null,this.muted=null,this.signalStrength=null}}},9141:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(4929);class r{constructor(e,t){this.reconnectTimeoutMs=e,this.backoffPolicy=t,this.shouldReconnect=!0,this.onlyRestartPeerConnection=!1,this.firstConnectionAttempted=!1,this.firstConnectionAttemptTimestampMs=0,this.lastActiveTimestampMs=1/0,this._isFirstConnection=!0,this.backoffTimer=null,this.backoffCancel=null,this.reset()}timeSpentReconnectingMs(){return this.firstConnectionAttempted?Date.now()-this.firstConnectionAttemptTimestampMs:0}hasPastReconnectDeadline(){return Date.now()-this.lastActiveTimestampMs>=this.reconnectTimeoutMs||this.timeSpentReconnectingMs()>=this.reconnectTimeoutMs}reset(){this.cancel(),this.shouldReconnect=!0,this.onlyRestartPeerConnection=!1,this.firstConnectionAttempted=!1,this.firstConnectionAttemptTimestampMs=0,this.lastActiveTimestampMs=1/0,this.backoffPolicy.reset()}startedConnectionAttempt(e){this._isFirstConnection=e,this.firstConnectionAttempted||(this.firstConnectionAttempted=!0,this.firstConnectionAttemptTimestampMs=Date.now())}hasStartedConnectionAttempt(){return this.firstConnectionAttempted}isFirstConnection(){return this._isFirstConnection}disableReconnect(){this.shouldReconnect=!1}enableRestartPeerConnection(){this.onlyRestartPeerConnection=!0}cancel(){this.disableReconnect(),this.backoffTimer&&(this.backoffTimer.stop(),this.backoffCancel&&(this.backoffCancel(),this.backoffCancel=null))}retryWithBackoff(e,t){const i=this.shouldReconnect&&!this.hasPastReconnectDeadline();return i&&(this.backoffCancel=t,this.backoffTimer=new n.default(this.backoffPolicy.nextBackoffAmountMs()),this.backoffTimer.start((()=>{this.backoffCancel=null,e()}))),i}shouldOnlyRestartPeerConnection(){return this.onlyRestartPeerConnection}clone(){return new r(this.reconnectTimeoutMs,this.backoffPolicy)}setLastActiveTimestampMs(e){this.lastActiveTimestampMs=e}}t.default=r},7797:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(4929);class r extends n.default{constructor(){super(0)}static nextTick(e){setTimeout(e,0)}}t.default=r},3922:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e){this.intervalMs=e}start(e){this.stop(),this.timer=setInterval(e,this.intervalMs)}stop(){void 0!==this.timer&&(clearInterval(this.timer),this.timer=void 0)}running(){return void 0!==this.timer}}},4929:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e){this.timeoutMs=e,this.timer=null}start(e){this.stop(),this.timer=setTimeout((()=>{clearTimeout(this.timer),e()}),this.timeoutMs)}stop(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)}}},326:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(4076),r=i(1944),s=i(2330);class o{constructor(e){this.sdp=e}clone(){return new o(this.sdp)}static isRTPCandidate(e){const t=/candidate[:](\\S+) (\\d+)/g.exec(e);return null!==t&&\"1\"===t[2]}static linesToSDP(e){return new o(e.join(o.CRLF))}static candidateTypeFromString(e){switch(e){case n.default.Host:return n.default.Host;case n.default.ServerReflexive:return n.default.ServerReflexive;case n.default.PeerReflexive:return n.default.PeerReflexive;case n.default.Relay:return n.default.Relay}return null}static candidateType(e){const t=/a[=]candidate[:].* typ ([a-z]+) /g.exec(e);return null===t?null:o.candidateTypeFromString(t[1])}static mediaType(e){const t=/m=(audio|video)/g.exec(e);if(null!==t)return t[1]}static mid(e){if(e.includes(\"a=mid:\"))return e.replace(/^(a=mid:)/,\"\")}static direction(e){const t=/a=(sendrecv|sendonly|recvonly|inactive)/g.exec(e);if(null!==t)return t[1]}static splitLines(e){return e.trim().split(\"\\n\").map((e=>e.trim()))}static splitSections(e){return e.split(\"\\nm=\").map(((e,t)=>(t>0?\"m=\"+e:e).trim()+o.CRLF))}static findActiveCameraSection(e){let t=0,i=!1;for(const n of e){if(/^m=video/.test(n)&&(n.indexOf(\"sendrecv\")>-1||-1===n.indexOf(\"sendonly\")&&-1===n.indexOf(\"recvonly\")&&-1===n.indexOf(\"inactive\"))){i=!0;break}t++}return!1===i&&(t=-1),t}static extractSSRCsFromFIDGroupLine(e){return/^a=ssrc-group:FID\\s(.+)/.exec(e)[1]}static matchPrefix(e,t){return o.splitLines(e).filter((e=>0===e.indexOf(t)))}lines(){return this.sdp.split(o.CRLF)}hasVideo(){return null!==/^m=video/gm.exec(this.sdp)}hasCandidates(){return null!==/a[=]candidate[:]/g.exec(this.sdp)}hasCandidatesForAllMLines(){return!(this.sdp.indexOf(\"c=IN IP4 0.0.0.0\")>-1)}withoutCandidateType(e){return o.linesToSDP(this.lines().filter((t=>o.candidateType(t)!==e)))}withoutServerReflexiveCandidates(){return this.withoutCandidateType(n.default.ServerReflexive)}withAudioMaxAverageBitrate(e){if(!e)return this.clone();e=Math.trunc(Math.min(Math.max(e,o.rfc7587LowestBitrate),o.rfc7587HighestBitrate));const t=this.lines(),i=o.findOpusFmtpAttributes(t),n=o.updateOpusFmtpAttributes(t,i,[`maxaveragebitrate=${e}`]);return o.linesToSDP(n)}withStereoAudio(){const e=this.lines(),t=o.findOpusFmtpAttributes(e),i=o.updateOpusFmtpAttributes(e,t,[\"stereo=1\",\"sprop-stereo=1\"]);return o.linesToSDP(i)}static findOpusFmtpAttributes(e){const t=/^a=rtpmap:\\s*(\\d+)\\s+opus\\/48000/;let i=!1;const n=[];for(const r of e)if(r.startsWith(\"m=audio\")&&(n.push(null),i=!0),r.startsWith(\"m=video\")&&(i=!1),i){const e=t.exec(r);null!==e&&(n[n.length-1]=`a=fmtp:${e[1]} `)}return n}static updateOpusFmtpAttributes(e,t,i){const n=[];let r=0,s=null;for(const o of e)if(o.startsWith(\"m=audio\")&&(s=t[r],r++),o.startsWith(\"m=video\")&&(s=null),s&&o.startsWith(s)){const e=o.slice(s.length).split(\";\"),t=[];for(const n of e)i.findIndex((e=>e.startsWith(n.split(\"=\")[0])))<0&&t.push(n);for(const e of i)t.push(e);n.push(s+t.join(\";\"))}else n.push(o);return n}withUnifiedPlanFormat(){let e=this.sdp;return e.includes(\"mozilla\")?this.clone():(e=e.replace(\"o=-\",\"o=mozilla-chrome\"),new o(e))}getUniqueRtpHeaderExtensionId(e){const t=[];for(const i of e)if(/^a=extmap:/.test(i.trim())){const e=+i.split(\"a=extmap:\")[1].split(\" \")[0];t.includes(e)||t.push(e)}t.sort(((e,t)=>e-t));let i=0;for(const e of t){if(e-i>1)return i+1;i=e}return 14===i?-1:i+1}withVideoLayersAllocationRtpHeaderExtension(e){const t=\"http://www.webrtc.org/experiments/rtp-hdrext/video-layers-allocation00\",i=e?e.getRtpHeaderExtensionId(t):-1,n=-1===i?this.getUniqueRtpHeaderExtensionId(o.splitLines(this.sdp)):i,r=o.splitSections(this.sdp),s=[];for(let e of r){if(/^m=video/.test(e)&&-1===o.getRtpHeaderExtensionIdInSection(e,t)){const i=o.splitLines(e),r=[];if(-1===n||this.hasRtpHeaderExtensionId(n)){s.push(e);continue}for(const e of i)if(r.push(e),/^a=sendrecv/.test(e.trim())){const e=\"a=extmap:\"+n+\" \"+t;r.push(e)}e=r.join(o.CRLF)+o.CRLF}else if(-1!==i&&/^m=video/.test(e)&&o.getRtpHeaderExtensionIdInSection(e,t)!==i){const n=o.splitLines(e),r=[];for(const e of n)if(/^a=extmap:/.test(e.trim())&&e.split(\"a=extmap:\")[1].split(\" \")[1]===t){if(!this.hasRtpHeaderExtensionId(i)){const e=\"a=extmap:\"+i+\" \"+t;r.push(e)}}else r.push(e);e=r.join(o.CRLF)+o.CRLF}s.push(e)}const a=s.join(\"\");return new o(a)}ssrcForVideoSendingSection(){const e=this.sdp,t=o.splitSections(e);if(t.length<2)return\"\";const i=o.findActiveCameraSection(t);if(-1===i)return\"\";const n=o.matchPrefix(t[i],\"a=ssrc-group:FID \");if(n.length<1)return\"\";const r=o.extractSSRCsFromFIDGroupLine(n[0]),[s]=r.split(\" \").map((e=>parseInt(e,10)));return s.toString()}videoSendSectionHasDifferentSSRC(e){const t=this.ssrcForVideoSendingSection(),i=e.ssrcForVideoSendingSection();return\"\"!==t&&\"\"!==i&&parseInt(t,10)!==parseInt(i,10)}removeH264SupportFromSendSection(){const e=this.sdp,t=o.splitSections(e),i=o.findActiveCameraSection(t);if(-1===i)return new o(this.sdp);const n=t[i],r=o.splitLines(n),s=[],a=new Map;r.forEach((e=>{if(/^a=rtpmap:/.test(e)){const t=/^a=rtpmap:([0-9]+)\\s/.exec(e);t&&e.toLowerCase().includes(\"h264\")&&s.push(parseInt(t[1],10))}if(/^a=fmtp:/.test(e)){const t=/^a=fmtp:([0-9]+) apt=([0-9]+)/.exec(e);if(t&&3===t.length){const e=parseInt(t[1],10),i=parseInt(t[2],10);a.has(i)?a.get(i).push(e):a.set(i,[e])}}}));const c=new Set;for(const e of s){c.add(e);const t=a.get(e);if(t)for(const e of t)c.add(e)}if(s.length>0){const e=r[0].split(\" \");r[0]=e.filter((e=>!c.has(parseInt(e)))).join(\" \")}const d=r.filter((e=>{if(!e.includes(\"rtpmap\")&&!e.includes(\"rtcp-fb\")&&!e.includes(\"fmtp\"))return!0;for(const t of c)if(e.includes(t.toString()))return!1;return!0}));t[i]=d.join(o.CRLF)+o.CRLF;const l=t.join(\"\");return new o(l)}mediaSections(){const e=o.splitSections(this.sdp);if(e.length<2)return[];const t=[];for(let i=1;i{if(/^a=rtpmap:/.test(e))for(const r of t){if(!e.includes(`${r.codecName}/${r.codecCapability.clockRate}`))continue;const t=/^a=rtpmap:([0-9]+)\\s/.exec(e);let s=!1;if(void 0!==r.codecCapability.sdpFmtpLine){for(const e of n)if(e.startsWith(`a=fmtp:${t[1]} ${r.codecCapability.sdpFmtpLine}`)){s=!0;break}}else s=!0;if(s){i.set(r.codecName,t[1]);break}}}));const r=new Set(i.values()),s=n[0].split(\" \").filter((e=>!r.has(e))),a=Array.from(i.values()).sort(((e,n)=>t.findIndex((t=>i.get(t.codecName)===e))-t.findIndex((e=>i.get(e.codecName)===n))));return s.splice(3,0,...a.values()),n[0]=s.join(\" \"),n.join(o.CRLF)+o.CRLF}highestPriorityVideoSendCodec(){const e=this.sdp,t=o.splitSections(e),i=o.findActiveCameraSection(t);if(-1===i)return;const n=o.splitLines(t[i]),r=n[0].split(\" \");if(r.length<4)return;const a=r[3];let c,d,l;for(const e of n){const t=/^a=rtpmap:([0-9]+)\\s/.exec(e);if(null===t||t.length<2||t[1]!==a)continue;const i=e.split(\" \")[1].split(\"/\");if(!(void 0===i||i.length<2)){c=i[0],d=i[1];for(const e of n)if(e.startsWith(`a=fmtp:${a}`)){const t=e.split(\" \");if(void 0===t||t.length<2)return;l=t[1]}break}}return void 0!==c?new s.default(c,{clockRate:parseInt(d),mimeType:`video/${c}`,sdpFmtpLine:l}):void 0}}t.default=o,o.CRLF=\"\\r\\n\",o.rfc7587LowestBitrate=6e3,o.rfc7587HighestBitrate=51e4},4076:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.SDPCandidateType=void 0,function(e){e.Host=\"host\",e.ServerReflexive=\"srflx\",e.PeerReflexive=\"prflx\",e.Relay=\"relay\"}(i=t.SDPCandidateType||(t.SDPCandidateType={})),t.default=i},1944:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{}},2330:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(289);class r{constructor(e,t){this.codecName=e,this.codecCapability=t}equals(e){return void 0!==e&&this.codecName===e.codecName&&this.codecCapability.mimeType===e.codecCapability.mimeType&&this.codecCapability.clockRate===e.codecCapability.clockRate&&this.codecCapability.sdpFmtpLine===e.codecCapability.sdpFmtpLine}static vp8(){return new r(\"VP8\",{clockRate:9e4,mimeType:\"video/VP8\"})}static h264ConstrainedBaselineProfile(){return new r(\"H264\",{clockRate:9e4,mimeType:\"video/H264\",sdpFmtpLine:\"level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\"})}static h264(){return this.h264ConstrainedBaselineProfile()}static fromSignaled(e){switch(e){case n.SdkVideoCodecCapability.VP8:return this.vp8();case n.SdkVideoCodecCapability.H264_CONSTRAINED_BASELINE_PROFILE:return this.h264ConstrainedBaselineProfile();default:return}}}t.default=r},3320:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(9591);class r{constructor(e){this.logger=e}compress(e,t){if(t.length>0){const e=Math.min(t.length,r.MAX_DICTIONARY_SIZE);t=t.slice(0,e)}const i={memLevel:r.Z_MEM_LEVEL,dictionary:t};return n.deflateRaw(e,i)}decompress(e,t){if(t.length>0){const e=Math.min(t.length,r.MAX_DICTIONARY_SIZE);t=t.slice(0,e)}const i={to:\"string\",dictionary:t,chunkSize:4096};let s=\"\";try{s=n.inflateRaw(e,i)}catch(e){this.logger.error(`failed to decompress the string with error: [${e}]`)}return s}}t.default=r,r.Z_MEM_LEVEL=9,r.MAX_DICTIONARY_SIZE=31744},9678:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(3860),r=i(6850),s=i(9553),o=i(3013);t.default=class{constructor(e){this.logger=e,this.currentState=s.SessionStateControllerState.NotConnected,this.deferredAction=null,this.deferredWork=null}perform(e,t){const i=this.currentState;if(i===s.SessionStateControllerState.NotConnected&&e===n.SessionStateControllerAction.Connect)this.transition(s.SessionStateControllerState.Connecting,e);else if(i===s.SessionStateControllerState.Connecting&&e===n.SessionStateControllerAction.Fail)this.transition(s.SessionStateControllerState.Disconnecting,e);else if(i===s.SessionStateControllerState.Connecting&&e===n.SessionStateControllerAction.FinishConnecting)this.transition(s.SessionStateControllerState.Connected,e);else if(i===s.SessionStateControllerState.Connected&&e===n.SessionStateControllerAction.Disconnect)this.transition(s.SessionStateControllerState.Disconnecting,e);else if(i===s.SessionStateControllerState.Connected&&e===n.SessionStateControllerAction.Reconnect)this.transition(s.SessionStateControllerState.Connecting,e);else if(i===s.SessionStateControllerState.Connected&&e===n.SessionStateControllerAction.Fail)this.transition(s.SessionStateControllerState.Disconnecting,e);else if(i===s.SessionStateControllerState.Connected&&e===n.SessionStateControllerAction.Update)this.transition(s.SessionStateControllerState.Updating,e);else if(i===s.SessionStateControllerState.Updating&&e===n.SessionStateControllerAction.Fail)this.transition(s.SessionStateControllerState.Disconnecting,e);else if(i===s.SessionStateControllerState.Updating&&e===n.SessionStateControllerAction.FinishUpdating)this.transition(s.SessionStateControllerState.Connected,e);else{if(i!==s.SessionStateControllerState.Disconnecting||e!==n.SessionStateControllerAction.FinishDisconnecting)return this.canDefer(e)?(this.logger.info(`deferring transition from ${s.SessionStateControllerState[this.currentState]} with ${n.SessionStateControllerAction[e]}`),this.deferAction(e,t),o.SessionStateControllerTransitionResult.DeferredTransition):(this.logger.warn(`no transition found from ${s.SessionStateControllerState[this.currentState]} with ${n.SessionStateControllerAction[e]}`),o.SessionStateControllerTransitionResult.NoTransitionAvailable);this.transition(s.SessionStateControllerState.NotConnected,e)}try{t()}catch(t){return this.logger.error(`error during state ${s.SessionStateControllerState[this.currentState]} with action ${n.SessionStateControllerAction[e]}: ${t}`),this.logger.info(`rolling back transition to ${s.SessionStateControllerState[i]}`),this.currentState=i,o.SessionStateControllerTransitionResult.TransitionFailed}return this.performDeferredAction(),o.SessionStateControllerTransitionResult.Transitioned}state(){return this.currentState}transition(e,t){this.logger.info(`transitioning from ${s.SessionStateControllerState[this.currentState]} to ${s.SessionStateControllerState[e]} with ${n.SessionStateControllerAction[t]}`),this.currentState=e}deferPriority(e){switch(e){case n.SessionStateControllerAction.Disconnect:return r.SessionStateControllerDeferPriority.VeryHigh;case n.SessionStateControllerAction.Fail:return r.SessionStateControllerDeferPriority.High;case n.SessionStateControllerAction.Reconnect:return r.SessionStateControllerDeferPriority.Medium;case n.SessionStateControllerAction.Update:return r.SessionStateControllerDeferPriority.Low;default:return r.SessionStateControllerDeferPriority.DoNotDefer}}deferAction(e,t){null!==this.deferredAction&&this.deferPriority(this.deferredAction)>this.deferPriority(e)||(this.deferredAction=e,this.deferredWork=t)}canDefer(e){return this.deferPriority(e)!==r.SessionStateControllerDeferPriority.DoNotDefer&&(this.currentState===s.SessionStateControllerState.Connecting||this.currentState===s.SessionStateControllerState.Updating)}performDeferredAction(){if(!this.deferredAction)return;const e=this.deferredAction,t=this.deferredWork;this.deferredAction=null,this.deferredWork=null,this.logger.info(`performing deferred action ${n.SessionStateControllerAction[e]}`),this.perform(e,t)!==o.SessionStateControllerTransitionResult.Transitioned&&this.logger.info(`unable to perform deferred action ${n.SessionStateControllerAction[e]} in state ${s.SessionStateControllerState[this.currentState]}`)}}},3860:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.SessionStateControllerAction=void 0,function(e){e[e.Connect=0]=\"Connect\",e[e.FinishConnecting=1]=\"FinishConnecting\",e[e.Update=2]=\"Update\",e[e.FinishUpdating=3]=\"FinishUpdating\",e[e.Reconnect=4]=\"Reconnect\",e[e.Disconnect=5]=\"Disconnect\",e[e.Fail=6]=\"Fail\",e[e.FinishDisconnecting=7]=\"FinishDisconnecting\"}(i=t.SessionStateControllerAction||(t.SessionStateControllerAction={})),t.default=i},6850:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.SessionStateControllerDeferPriority=void 0,function(e){e[e.DoNotDefer=0]=\"DoNotDefer\",e[e.Low=1]=\"Low\",e[e.Medium=2]=\"Medium\",e[e.High=3]=\"High\",e[e.VeryHigh=4]=\"VeryHigh\"}(i=t.SessionStateControllerDeferPriority||(t.SessionStateControllerDeferPriority={})),t.default=i},9553:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.SessionStateControllerState=void 0,function(e){e[e.NotConnected=0]=\"NotConnected\",e[e.Connecting=1]=\"Connecting\",e[e.Connected=2]=\"Connected\",e[e.Updating=3]=\"Updating\",e[e.Disconnecting=4]=\"Disconnecting\"}(i=t.SessionStateControllerState||(t.SessionStateControllerState={})),t.default=i},3013:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.SessionStateControllerTransitionResult=void 0,function(e){e[e.Transitioned=0]=\"Transitioned\",e[e.NoTransitionAvailable=1]=\"NoTransitionAvailable\",e[e.DeferredTransition=2]=\"DeferredTransition\",e[e.TransitionFailed=3]=\"TransitionFailed\"}(i=t.SessionStateControllerTransitionResult||(t.SessionStateControllerTransitionResult={})),t.default=i},1208:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(543),r=i(4929),s=i(289),o=i(8690),a=i(4046),c=i(7387),d=i(7103),l=i(2902),u=i(9416);class h{constructor(e,t){this.webSocket=e,this.logger=t,this.unloadHandler=null,this.closeEventHandler=e=>{this.deactivatePageUnloadHandler(),this.resetConnection(),this.sendEvent(new l.default(this,u.default.WebSocketClosed,null,e.code,e.reason)),this.serviceConnectionRequestQueue()},this.observerQueue=new Set,this.connectionRequestQueue=[],this.resetConnection(),this.logger.debug((()=>\"signaling client init\")),this.audioSessionId=this.generateNewAudioSessionId()}registerObserver(e){this.logger.debug((()=>\"registering signaling client observer\")),this.observerQueue.add(e)}removeObserver(e){this.logger.debug((()=>\"removing signaling client observer\")),this.observerQueue.delete(e)}openConnection(e){this.logger.info(\"adding connection request to queue: \"+e.url()),this.connectionRequestQueue.push(e),this.closeConnection()}pingPong(e){this.logger.debug((()=>\"sending ping\"));const t=s.SdkSignalFrame.create();return t.type=s.SdkSignalFrame.Type.PING_PONG,t.pingPong=e,this.sendMessage(t),t.timestampMs}join(e){this.logger.info(\"sending join\");const t=s.SdkJoinFrame.create();t.protocolVersion=2,t.flags=s.SdkJoinFlags.HAS_STREAM_UPDATE;const i=new n.default,r={platformName:i.name(),platformVersion:i.version(),clientSource:a.default.sdkName,chimeSdkVersion:a.default.sdkVersion,clientUtcOffset:o.getFormattedOffset((new Date).getTimezoneOffset())};if(e.applicationMetadata){const{appName:t,appVersion:i}=e.applicationMetadata;r.appName=t,r.appVersion=i}t.clientDetails=s.SdkClientDetails.create(r),t.audioSessionId=this.audioSessionId,t.wantsCompressedSdp=h.CLIENT_SUPPORTS_COMPRESSION,t.disablePeriodicKeyframeRequestOnContentSender=e.disablePeriodicKeyframeRequestOnContentSender,t.serverSideNetworkAdaption=d.convertServerSideNetworkAdaptionEnumToSignaled(e.serverSideNetworkAdaption),t.supportedServerSideNetworkAdaptions=e.supportedServerSideNetworkAdaptions.map(d.convertServerSideNetworkAdaptionEnumToSignaled);const c=s.SdkSignalFrame.create();c.type=s.SdkSignalFrame.Type.JOIN,c.join=t,this.sendMessage(c)}subscribe(e){const t=s.SdkSubscribeFrame.create();if(t.sendStreams=[],t.sdpOffer=e.sdpOffer,e.connectionTypeHasVideo&&(t.receiveStreamIds=e.receiveStreamIds),e.audioHost&&(t.audioCheckin=e.audioCheckin,t.audioHost=e.audioHost,t.audioMuted=e.audioMuted,!e.audioCheckin)){const i=s.SdkStreamDescriptor.create();i.mediaType=s.SdkStreamMediaType.AUDIO,i.trackLabel=\"AmazonChimeExpressAudio\",i.attendeeId=e.attendeeId,i.streamId=1,i.groupId=1,i.framerate=15,i.maxBitrateKbps=600,i.avgBitrateBps=4e5,t.sendStreams.push(i)}if(t.compressedSdpOffer=e.compressedSdpOffer,t.duplex=s.SdkStreamServiceType.RX,e.localVideoEnabled){t.duplex=s.SdkStreamServiceType.DUPLEX;for(let i=0;i0&&(t.videoSubscriptionConfiguration=e.videoSubscriptionConfiguration.map(this.convertSignalingClientVideoSubscriptionConfiguration));const i=s.SdkSignalFrame.create();i.type=s.SdkSignalFrame.Type.SUBSCRIBE,i.sub=t,this.sendMessage(i)}remoteVideoUpdate(e,t){const i=s.SdkRemoteVideoUpdateFrame.create();i.addedOrUpdatedVideoSubscriptions=e.map(this.convertSignalingClientVideoSubscriptionConfiguration),i.removedVideoSubscriptionMids=t;const n=s.SdkSignalFrame.create();n.type=s.SdkSignalFrame.Type.REMOTE_VIDEO_UPDATE,n.remoteVideoUpdate=i,this.sendMessage(n)}convertSignalingClientVideoSubscriptionConfiguration(e){const t=new s.SdkVideoSubscriptionConfiguration;return t.mid=e.mid,t.attendeeId=e.attendeeId,t.streamId=e.streamId,t.groupId=e.groupId,t.priority=e.priority,t.targetBitrateKbps=e.targetBitrateKbps,t}leave(){const e=s.SdkSignalFrame.create();e.type=s.SdkSignalFrame.Type.LEAVE,e.leave=s.SdkLeaveFrame.create(),this.sendMessage(e),this.logger.debug((()=>\"sent leave\"))}sendClientMetrics(e){const t=s.SdkSignalFrame.create();t.type=s.SdkSignalFrame.Type.CLIENT_METRIC,t.clientMetric=e,this.sendMessage(t)}sendDataMessage(e){const t=s.SdkSignalFrame.create();t.type=s.SdkSignalFrame.Type.DATA_MESSAGE,t.dataMessage=e,this.sendMessage(t)}closeConnection(){var e,t;if(this.webSocket.readyState()!==c.default.None&&this.webSocket.readyState()!==c.default.Closed){this.isClosing=!0,this.sendEvent(new l.default(this,u.default.WebSocketClosing,null));const i=new r.default(h.CLOSE_EVENT_TIMEOUT_MS),n=e=>{var t,r;null===(r=(t=this.webSocket).removeEventListener)||void 0===r||r.call(t,\"close\",n),i.stop(),this.closeEventHandler(e)};null===(t=(e=this.webSocket).removeEventListener)||void 0===t||t.call(e,\"close\",this.closeEventHandler),this.webSocket.addEventListener(\"close\",n),i.start((()=>{n(new CloseEvent(\"close\",{wasClean:!1,code:1006,reason:\"\",bubbles:!1}))})),this.webSocket.close(),this.deactivatePageUnloadHandler()}else this.logger.info(\"no existing signaling client connection needs closing\"),this.serviceConnectionRequestQueue()}ready(){return this.webSocket.readyState()===c.default.Open&&!this.isClosing&&this.wasOpened}mute(e){const t=s.SdkSignalFrame.create();t.type=s.SdkSignalFrame.Type.AUDIO_CONTROL;const i=s.SdkAudioControlFrame.create();i.muted=e,t.audioControl=i,this.sendMessage(t)}pause(e){const t=s.SdkSignalFrame.create();t.type=s.SdkSignalFrame.Type.PAUSE,t.pause=s.SdkPauseResumeFrame.create(),t.pause.streamIds=e,this.sendMessage(t)}resume(e){const t=s.SdkSignalFrame.create();t.type=s.SdkSignalFrame.Type.RESUME,t.pause=s.SdkPauseResumeFrame.create(),t.pause.streamIds=e,this.sendMessage(t)}resetConnection(){this.webSocket.destroy(),this.wasOpened=!1}sendMessage(e){e.timestampMs=Date.now(),this.logger.debug((()=>`sending: ${JSON.stringify(e)}`));const t=this.prependWithFrameTypeRTC(s.SdkSignalFrame.encode(e).finish());if(this.ready()){if(!this.webSocket.send(t))return void this.sendEvent(new l.default(this,u.default.WebSocketSendMessageFailure,null));this.sendEvent(new l.default(this,u.default.WebSocketSentMessage,null))}else this.sendEvent(new l.default(this,u.default.WebSocketSkippedMessage,null))}receiveMessage(e){let t;try{t=s.SdkSignalFrame.decode(e)}catch(t){return this.logger.info(`failed to decode: ${e}`),void this.sendEvent(new l.default(this,u.default.ProtocolDecodeFailure,null))}this.logger.debug((()=>`received: ${JSON.stringify(t)}`)),this.webSocket.readyState()===c.default.Open?this.sendEvent(new l.default(this,u.default.ReceivedSignalFrame,t)):this.logger.info(`skipping notification of message since WebSocket is not open: ${JSON.stringify(t)}`)}stripFrameTypeRTC(e){const t=e[0];return t!==h.FRAME_TYPE_RTC&&2!==t&&this.logger.warn(`expected FrameTypeRTC for message but got ${t}`),e.slice(1)}prependWithFrameTypeRTC(e){const t=new Uint8Array(e.length+1);return t[0]=h.FRAME_TYPE_RTC,t.set(e,1),t}serviceConnectionRequestQueue(){if(0===this.connectionRequestQueue.length)return void this.logger.info(\"no connection requests to service\");const e=this.connectionRequestQueue.shift();this.logger.info(`opening connection to ${e.url()}`),this.isClosing=!1,this.webSocket.create(e.url(),e.protocols()),this.setUpEventListeners(),this.sendEvent(new l.default(this,u.default.WebSocketConnecting,null))}sendEvent(e){switch(e.type){case u.default.WebSocketMessage:case u.default.ReceivedSignalFrame:case u.default.WebSocketSentMessage:this.logger.debug((()=>`notifying event: ${u.default[e.type]}`));break;case u.default.WebSocketSkippedMessage:this.logger.debug((()=>`notifying event: ${u.default[e.type]}, websocket state=${c.default[this.webSocket.readyState()]}`));break;default:this.logger.info(`notifying event: ${u.default[e.type]}`)}for(const t of this.observerQueue)t.handleSignalingClientEvent(e)}setUpEventListeners(){this.webSocket.addEventListener(\"open\",(()=>{this.activatePageUnloadHandler(),this.wasOpened=!0,this.sendEvent(new l.default(this,u.default.WebSocketOpen,null))})),this.webSocket.addEventListener(\"message\",(e=>{this.sendEvent(new l.default(this,u.default.WebSocketMessage,null)),this.receiveMessage(this.stripFrameTypeRTC(new Uint8Array(e.data)))})),this.webSocket.addEventListener(\"close\",this.closeEventHandler),this.webSocket.addEventListener(\"error\",(()=>{!this.isClosing||this.wasOpened?this.wasOpened?(this.logger.error(\"received error while connected\"),this.sendEvent(new l.default(this,u.default.WebSocketError,null))):(this.logger.error(\"failed to connect\"),this.sendEvent(new l.default(this,u.default.WebSocketFailed,null))):this.logger.info(\"ignoring error closing signaling while connecting\")}))}activatePageUnloadHandler(){this.unloadHandler=()=>{this.leave()};const e=i.g;e.window&&e.window.addEventListener&&window.addEventListener(\"unload\",this.unloadHandler)}deactivatePageUnloadHandler(){const e=i.g;e.window&&e.window.removeEventListener&&window.removeEventListener(\"unload\",this.unloadHandler),this.unloadHandler=null}generateNewAudioSessionId(){const e=new Uint32Array(1);return window.crypto.getRandomValues(e)[0]}promoteToPrimaryMeeting(e){const t=s.SdkMeetingSessionCredentials.create();t.attendeeId=e.attendeeId,t.externalUserId=e.externalUserId,t.joinToken=e.joinToken;const i=s.SdkPrimaryMeetingJoinFrame.create();i.credentials=t;const n=s.SdkSignalFrame.create();n.type=s.SdkSignalFrame.Type.PRIMARY_MEETING_JOIN,n.primaryMeetingJoin=i,this.sendMessage(n)}demoteFromPrimaryMeeting(){const e=s.SdkPrimaryMeetingLeaveFrame.create(),t=s.SdkSignalFrame.create();t.type=s.SdkSignalFrame.Type.PRIMARY_MEETING_LEAVE,t.primaryMeetingLeave=e,this.sendMessage(t)}}t.default=h,h.FRAME_TYPE_RTC=5,h.CLOSE_EVENT_TIMEOUT_MS=2e3,h.CLIENT_SUPPORTS_COMPRESSION=!0},7103:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.convertServerSideNetworkAdaptionEnumToSignaled=t.convertServerSideNetworkAdaptionEnumFromSignaled=t.serverSideNetworkAdaptionIsNoneOrDefault=t.ServerSideNetworkAdaption=void 0;const n=i(289);var r;!function(e){e[e.Default=0]=\"Default\",e[e.None=1]=\"None\",e[e.BandwidthProbing=2]=\"BandwidthProbing\",e[e.BandwidthProbingAndRemoteVideoQualityAdaption=3]=\"BandwidthProbingAndRemoteVideoQualityAdaption\"}(r=t.ServerSideNetworkAdaption||(t.ServerSideNetworkAdaption={})),t.default=r,t.serverSideNetworkAdaptionIsNoneOrDefault=function(e){return e===r.None||e===r.Default},t.convertServerSideNetworkAdaptionEnumFromSignaled=function(e){switch(e){case n.SdkServerSideNetworkAdaption.DEFAULT:return r.Default;case n.SdkServerSideNetworkAdaption.NONE:return r.None;case n.SdkServerSideNetworkAdaption.BANDWIDTH_PROBING:return r.BandwidthProbing;case n.SdkServerSideNetworkAdaption.BANDWIDTH_PROBING_AND_VIDEO_QUALITY_ADAPTION:return r.BandwidthProbingAndRemoteVideoQualityAdaption}},t.convertServerSideNetworkAdaptionEnumToSignaled=function(e){switch(e){case r.Default:return n.SdkServerSideNetworkAdaption.DEFAULT;case r.None:return n.SdkServerSideNetworkAdaption.NONE;case r.BandwidthProbing:return n.SdkServerSideNetworkAdaption.BANDWIDTH_PROBING;case r.BandwidthProbingAndRemoteVideoQualityAdaption:return n.SdkServerSideNetworkAdaption.BANDWIDTH_PROBING_AND_VIDEO_QUALITY_ADAPTION}}},3920:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e,t){this.signalingURL=e,this.joinToken=t}url(){return this.signalingURL+\"?X-Chime-Control-Protocol-Version=3&X-Amzn-Chime-Send-Close-On-Error=1\"}protocols(){return[\"_aws_wt_session\",this.joinToken]}}},2902:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(9416);t.default=class{constructor(e,t,i,n,r){this.client=e,this.type=t,this.message=i,this.closeCode=n,this.closeReason=r,this.timestampMs=Date.now()}isConnectionTerminated(){switch(this.type){case n.default.WebSocketFailed:case n.default.WebSocketError:case n.default.WebSocketClosing:case n.default.WebSocketClosed:return!0;default:return!1}}}},9416:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.SignalingClientEventType=void 0,function(e){e[e.WebSocketConnecting=0]=\"WebSocketConnecting\",e[e.WebSocketOpen=1]=\"WebSocketOpen\",e[e.WebSocketError=2]=\"WebSocketError\",e[e.WebSocketClosing=3]=\"WebSocketClosing\",e[e.WebSocketClosed=4]=\"WebSocketClosed\",e[e.WebSocketFailed=5]=\"WebSocketFailed\",e[e.WebSocketMessage=6]=\"WebSocketMessage\",e[e.WebSocketSendMessageFailure=7]=\"WebSocketSendMessageFailure\",e[e.WebSocketSentMessage=8]=\"WebSocketSentMessage\",e[e.ProtocolDecodeFailure=9]=\"ProtocolDecodeFailure\",e[e.ReceivedSignalFrame=10]=\"ReceivedSignalFrame\",e[e.WebSocketSkippedMessage=11]=\"WebSocketSkippedMessage\"}(i=t.SignalingClientEventType||(t.SignalingClientEventType={})),t.default=i},2168:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(7103);t.default=class{constructor(e){this.applicationMetadata=e,this.serverSideNetworkAdaption=n.default.Default,this.supportedServerSideNetworkAdaptions=[],this.disablePeriodicKeyframeRequestOnContentSender=!1}}},6729:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e,t,i,n,r,s,o,a,c,d){this.attendeeId=e,this.sdpOffer=t,this.audioHost=i,this.audioMuted=n,this.audioCheckin=r,this.receiveStreamIds=s,this.localVideoEnabled=o,this.videoStreamDescriptions=a,this.connectionTypeHasVideo=c,this.compressedSdpOffer=d,this.videoSubscriptionConfiguration=[]}}},9101:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{equals(e){return void 0!==e&&this.mid===e.mid&&this.attendeeId===e.attendeeId&&this.streamId===e.streamId&&this.groupId===e.groupId&&this.priority===e.priority&&this.targetBitrateKbps===e.targetBitrateKbps}}},289:(e,t,i)=>{\"use strict\";var n,r,s=i(9423),o=s.Reader,a=s.Writer,c=s.util,d=s.roots.default||(s.roots.default={});d.SdkSignalFrame=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.timestampMs=e.uint64();break;case 2:n.type=e.int32();break;case 3:n.error=d.SdkErrorFrame.decode(e,e.uint32());break;case 4:n.join=d.SdkJoinFrame.decode(e,e.uint32());break;case 5:n.joinack=d.SdkJoinAckFrame.decode(e,e.uint32());break;case 6:n.sub=d.SdkSubscribeFrame.decode(e,e.uint32());break;case 7:n.suback=d.SdkSubscribeAckFrame.decode(e,e.uint32());break;case 8:n.index=d.SdkIndexFrame.decode(e,e.uint32());break;case 10:n.pause=d.SdkPauseResumeFrame.decode(e,e.uint32());break;case 11:n.leave=d.SdkLeaveFrame.decode(e,e.uint32());break;case 12:n.leaveAck=d.SdkLeaveAckFrame.decode(e,e.uint32());break;case 14:n.bitrates=d.SdkBitrateFrame.decode(e,e.uint32());break;case 17:n.audioControl=d.SdkAudioControlFrame.decode(e,e.uint32());break;case 18:n.audioMetadata=d.SdkAudioMetadataFrame.decode(e,e.uint32());break;case 19:n.audioStreamIdInfo=d.SdkAudioStreamIdInfoFrame.decode(e,e.uint32());break;case 20:n.pingPong=d.SdkPingPongFrame.decode(e,e.uint32());break;case 21:n.audioStatus=d.SdkAudioStatusFrame.decode(e,e.uint32());break;case 22:n.clientMetric=d.SdkClientMetricFrame.decode(e,e.uint32());break;case 23:n.dataMessage=d.SdkDataMessageFrame.decode(e,e.uint32());break;case 25:n.remoteVideoUpdate=d.SdkRemoteVideoUpdateFrame.decode(e,e.uint32());break;case 26:n.primaryMeetingJoin=d.SdkPrimaryMeetingJoinFrame.decode(e,e.uint32());break;case 27:n.primaryMeetingJoinAck=d.SdkPrimaryMeetingJoinAckFrame.decode(e,e.uint32());break;case 28:n.primaryMeetingLeave=d.SdkPrimaryMeetingLeaveFrame.decode(e,e.uint32());break;default:e.skipType(7&r)}}if(!n.hasOwnProperty(\"timestampMs\"))throw c.ProtocolError(\"missing required 'timestampMs'\",{instance:n});if(!n.hasOwnProperty(\"type\"))throw c.ProtocolError(\"missing required 'type'\",{instance:n});return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(!(c.isInteger(e.timestampMs)||e.timestampMs&&c.isInteger(e.timestampMs.low)&&c.isInteger(e.timestampMs.high)))return\"timestampMs: integer|Long expected\";switch(e.type){default:return\"type: enum value expected\";case 1:case 2:case 3:case 4:case 5:case 7:case 8:case 9:case 10:case 13:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 24:case 25:case 26:case 27:}var t;return null!=e.error&&e.hasOwnProperty(\"error\")&&(t=d.SdkErrorFrame.verify(e.error))?\"error.\"+t:null!=e.join&&e.hasOwnProperty(\"join\")&&(t=d.SdkJoinFrame.verify(e.join))?\"join.\"+t:null!=e.joinack&&e.hasOwnProperty(\"joinack\")&&(t=d.SdkJoinAckFrame.verify(e.joinack))?\"joinack.\"+t:null!=e.sub&&e.hasOwnProperty(\"sub\")&&(t=d.SdkSubscribeFrame.verify(e.sub))?\"sub.\"+t:null!=e.suback&&e.hasOwnProperty(\"suback\")&&(t=d.SdkSubscribeAckFrame.verify(e.suback))?\"suback.\"+t:null!=e.index&&e.hasOwnProperty(\"index\")&&(t=d.SdkIndexFrame.verify(e.index))?\"index.\"+t:null!=e.pause&&e.hasOwnProperty(\"pause\")&&(t=d.SdkPauseResumeFrame.verify(e.pause))?\"pause.\"+t:null!=e.leave&&e.hasOwnProperty(\"leave\")&&(t=d.SdkLeaveFrame.verify(e.leave))?\"leave.\"+t:null!=e.leaveAck&&e.hasOwnProperty(\"leaveAck\")&&(t=d.SdkLeaveAckFrame.verify(e.leaveAck))?\"leaveAck.\"+t:null!=e.bitrates&&e.hasOwnProperty(\"bitrates\")&&(t=d.SdkBitrateFrame.verify(e.bitrates))?\"bitrates.\"+t:null!=e.audioControl&&e.hasOwnProperty(\"audioControl\")&&(t=d.SdkAudioControlFrame.verify(e.audioControl))?\"audioControl.\"+t:null!=e.audioMetadata&&e.hasOwnProperty(\"audioMetadata\")&&(t=d.SdkAudioMetadataFrame.verify(e.audioMetadata))?\"audioMetadata.\"+t:null!=e.audioStreamIdInfo&&e.hasOwnProperty(\"audioStreamIdInfo\")&&(t=d.SdkAudioStreamIdInfoFrame.verify(e.audioStreamIdInfo))?\"audioStreamIdInfo.\"+t:null!=e.pingPong&&e.hasOwnProperty(\"pingPong\")&&(t=d.SdkPingPongFrame.verify(e.pingPong))?\"pingPong.\"+t:null!=e.audioStatus&&e.hasOwnProperty(\"audioStatus\")&&(t=d.SdkAudioStatusFrame.verify(e.audioStatus))?\"audioStatus.\"+t:null!=e.clientMetric&&e.hasOwnProperty(\"clientMetric\")&&(t=d.SdkClientMetricFrame.verify(e.clientMetric))?\"clientMetric.\"+t:null!=e.dataMessage&&e.hasOwnProperty(\"dataMessage\")&&(t=d.SdkDataMessageFrame.verify(e.dataMessage))?\"dataMessage.\"+t:null!=e.remoteVideoUpdate&&e.hasOwnProperty(\"remoteVideoUpdate\")&&(t=d.SdkRemoteVideoUpdateFrame.verify(e.remoteVideoUpdate))?\"remoteVideoUpdate.\"+t:null!=e.primaryMeetingJoin&&e.hasOwnProperty(\"primaryMeetingJoin\")&&(t=d.SdkPrimaryMeetingJoinFrame.verify(e.primaryMeetingJoin))?\"primaryMeetingJoin.\"+t:null!=e.primaryMeetingJoinAck&&e.hasOwnProperty(\"primaryMeetingJoinAck\")&&(t=d.SdkPrimaryMeetingJoinAckFrame.verify(e.primaryMeetingJoinAck))?\"primaryMeetingJoinAck.\"+t:null!=e.primaryMeetingLeave&&e.hasOwnProperty(\"primaryMeetingLeave\")&&(t=d.SdkPrimaryMeetingLeaveFrame.verify(e.primaryMeetingLeave))?\"primaryMeetingLeave.\"+t:null},e.fromObject=function(e){if(e instanceof d.SdkSignalFrame)return e;var t=new d.SdkSignalFrame;switch(null!=e.timestampMs&&(c.Long?(t.timestampMs=c.Long.fromValue(e.timestampMs)).unsigned=!0:\"string\"==typeof e.timestampMs?t.timestampMs=parseInt(e.timestampMs,10):\"number\"==typeof e.timestampMs?t.timestampMs=e.timestampMs:\"object\"==typeof e.timestampMs&&(t.timestampMs=new c.LongBits(e.timestampMs.low>>>0,e.timestampMs.high>>>0).toNumber(!0))),e.type){case\"JOIN\":case 1:t.type=1;break;case\"JOIN_ACK\":case 2:t.type=2;break;case\"SUBSCRIBE\":case 3:t.type=3;break;case\"SUBSCRIBE_ACK\":case 4:t.type=4;break;case\"INDEX\":case 5:t.type=5;break;case\"PAUSE\":case 7:t.type=7;break;case\"RESUME\":case 8:t.type=8;break;case\"LEAVE\":case 9:t.type=9;break;case\"LEAVE_ACK\":case 10:t.type=10;break;case\"BITRATES\":case 13:t.type=13;break;case\"AUDIO_CONTROL\":case 16:t.type=16;break;case\"AUDIO_METADATA\":case 17:t.type=17;break;case\"AUDIO_STREAM_ID_INFO\":case 18:t.type=18;break;case\"PING_PONG\":case 19:t.type=19;break;case\"AUDIO_STATUS\":case 20:t.type=20;break;case\"CLIENT_METRIC\":case 21:t.type=21;break;case\"DATA_MESSAGE\":case 22:t.type=22;break;case\"REMOTE_VIDEO_UPDATE\":case 24:t.type=24;break;case\"PRIMARY_MEETING_JOIN\":case 25:t.type=25;break;case\"PRIMARY_MEETING_JOIN_ACK\":case 26:t.type=26;break;case\"PRIMARY_MEETING_LEAVE\":case 27:t.type=27}if(null!=e.error){if(\"object\"!=typeof e.error)throw TypeError(\".SdkSignalFrame.error: object expected\");t.error=d.SdkErrorFrame.fromObject(e.error)}if(null!=e.join){if(\"object\"!=typeof e.join)throw TypeError(\".SdkSignalFrame.join: object expected\");t.join=d.SdkJoinFrame.fromObject(e.join)}if(null!=e.joinack){if(\"object\"!=typeof e.joinack)throw TypeError(\".SdkSignalFrame.joinack: object expected\");t.joinack=d.SdkJoinAckFrame.fromObject(e.joinack)}if(null!=e.sub){if(\"object\"!=typeof e.sub)throw TypeError(\".SdkSignalFrame.sub: object expected\");t.sub=d.SdkSubscribeFrame.fromObject(e.sub)}if(null!=e.suback){if(\"object\"!=typeof e.suback)throw TypeError(\".SdkSignalFrame.suback: object expected\");t.suback=d.SdkSubscribeAckFrame.fromObject(e.suback)}if(null!=e.index){if(\"object\"!=typeof e.index)throw TypeError(\".SdkSignalFrame.index: object expected\");t.index=d.SdkIndexFrame.fromObject(e.index)}if(null!=e.pause){if(\"object\"!=typeof e.pause)throw TypeError(\".SdkSignalFrame.pause: object expected\");t.pause=d.SdkPauseResumeFrame.fromObject(e.pause)}if(null!=e.leave){if(\"object\"!=typeof e.leave)throw TypeError(\".SdkSignalFrame.leave: object expected\");t.leave=d.SdkLeaveFrame.fromObject(e.leave)}if(null!=e.leaveAck){if(\"object\"!=typeof e.leaveAck)throw TypeError(\".SdkSignalFrame.leaveAck: object expected\");t.leaveAck=d.SdkLeaveAckFrame.fromObject(e.leaveAck)}if(null!=e.bitrates){if(\"object\"!=typeof e.bitrates)throw TypeError(\".SdkSignalFrame.bitrates: object expected\");t.bitrates=d.SdkBitrateFrame.fromObject(e.bitrates)}if(null!=e.audioControl){if(\"object\"!=typeof e.audioControl)throw TypeError(\".SdkSignalFrame.audioControl: object expected\");t.audioControl=d.SdkAudioControlFrame.fromObject(e.audioControl)}if(null!=e.audioMetadata){if(\"object\"!=typeof e.audioMetadata)throw TypeError(\".SdkSignalFrame.audioMetadata: object expected\");t.audioMetadata=d.SdkAudioMetadataFrame.fromObject(e.audioMetadata)}if(null!=e.audioStreamIdInfo){if(\"object\"!=typeof e.audioStreamIdInfo)throw TypeError(\".SdkSignalFrame.audioStreamIdInfo: object expected\");t.audioStreamIdInfo=d.SdkAudioStreamIdInfoFrame.fromObject(e.audioStreamIdInfo)}if(null!=e.pingPong){if(\"object\"!=typeof e.pingPong)throw TypeError(\".SdkSignalFrame.pingPong: object expected\");t.pingPong=d.SdkPingPongFrame.fromObject(e.pingPong)}if(null!=e.audioStatus){if(\"object\"!=typeof e.audioStatus)throw TypeError(\".SdkSignalFrame.audioStatus: object expected\");t.audioStatus=d.SdkAudioStatusFrame.fromObject(e.audioStatus)}if(null!=e.clientMetric){if(\"object\"!=typeof e.clientMetric)throw TypeError(\".SdkSignalFrame.clientMetric: object expected\");t.clientMetric=d.SdkClientMetricFrame.fromObject(e.clientMetric)}if(null!=e.dataMessage){if(\"object\"!=typeof e.dataMessage)throw TypeError(\".SdkSignalFrame.dataMessage: object expected\");t.dataMessage=d.SdkDataMessageFrame.fromObject(e.dataMessage)}if(null!=e.remoteVideoUpdate){if(\"object\"!=typeof e.remoteVideoUpdate)throw TypeError(\".SdkSignalFrame.remoteVideoUpdate: object expected\");t.remoteVideoUpdate=d.SdkRemoteVideoUpdateFrame.fromObject(e.remoteVideoUpdate)}if(null!=e.primaryMeetingJoin){if(\"object\"!=typeof e.primaryMeetingJoin)throw TypeError(\".SdkSignalFrame.primaryMeetingJoin: object expected\");t.primaryMeetingJoin=d.SdkPrimaryMeetingJoinFrame.fromObject(e.primaryMeetingJoin)}if(null!=e.primaryMeetingJoinAck){if(\"object\"!=typeof e.primaryMeetingJoinAck)throw TypeError(\".SdkSignalFrame.primaryMeetingJoinAck: object expected\");t.primaryMeetingJoinAck=d.SdkPrimaryMeetingJoinAckFrame.fromObject(e.primaryMeetingJoinAck)}if(null!=e.primaryMeetingLeave){if(\"object\"!=typeof e.primaryMeetingLeave)throw TypeError(\".SdkSignalFrame.primaryMeetingLeave: object expected\");t.primaryMeetingLeave=d.SdkPrimaryMeetingLeaveFrame.fromObject(e.primaryMeetingLeave)}return t},e.toObject=function(e,t){t||(t={});var i={};if(t.defaults){if(c.Long){var n=new c.Long(0,0,!0);i.timestampMs=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else i.timestampMs=t.longs===String?\"0\":0;i.type=t.enums===String?\"JOIN\":1,i.error=null,i.join=null,i.joinack=null,i.sub=null,i.suback=null,i.index=null,i.pause=null,i.leave=null,i.leaveAck=null,i.bitrates=null,i.audioControl=null,i.audioMetadata=null,i.audioStreamIdInfo=null,i.pingPong=null,i.audioStatus=null,i.clientMetric=null,i.dataMessage=null,i.remoteVideoUpdate=null,i.primaryMeetingJoin=null,i.primaryMeetingJoinAck=null,i.primaryMeetingLeave=null}return null!=e.timestampMs&&e.hasOwnProperty(\"timestampMs\")&&(\"number\"==typeof e.timestampMs?i.timestampMs=t.longs===String?String(e.timestampMs):e.timestampMs:i.timestampMs=t.longs===String?c.Long.prototype.toString.call(e.timestampMs):t.longs===Number?new c.LongBits(e.timestampMs.low>>>0,e.timestampMs.high>>>0).toNumber(!0):e.timestampMs),null!=e.type&&e.hasOwnProperty(\"type\")&&(i.type=t.enums===String?d.SdkSignalFrame.Type[e.type]:e.type),null!=e.error&&e.hasOwnProperty(\"error\")&&(i.error=d.SdkErrorFrame.toObject(e.error,t)),null!=e.join&&e.hasOwnProperty(\"join\")&&(i.join=d.SdkJoinFrame.toObject(e.join,t)),null!=e.joinack&&e.hasOwnProperty(\"joinack\")&&(i.joinack=d.SdkJoinAckFrame.toObject(e.joinack,t)),null!=e.sub&&e.hasOwnProperty(\"sub\")&&(i.sub=d.SdkSubscribeFrame.toObject(e.sub,t)),null!=e.suback&&e.hasOwnProperty(\"suback\")&&(i.suback=d.SdkSubscribeAckFrame.toObject(e.suback,t)),null!=e.index&&e.hasOwnProperty(\"index\")&&(i.index=d.SdkIndexFrame.toObject(e.index,t)),null!=e.pause&&e.hasOwnProperty(\"pause\")&&(i.pause=d.SdkPauseResumeFrame.toObject(e.pause,t)),null!=e.leave&&e.hasOwnProperty(\"leave\")&&(i.leave=d.SdkLeaveFrame.toObject(e.leave,t)),null!=e.leaveAck&&e.hasOwnProperty(\"leaveAck\")&&(i.leaveAck=d.SdkLeaveAckFrame.toObject(e.leaveAck,t)),null!=e.bitrates&&e.hasOwnProperty(\"bitrates\")&&(i.bitrates=d.SdkBitrateFrame.toObject(e.bitrates,t)),null!=e.audioControl&&e.hasOwnProperty(\"audioControl\")&&(i.audioControl=d.SdkAudioControlFrame.toObject(e.audioControl,t)),null!=e.audioMetadata&&e.hasOwnProperty(\"audioMetadata\")&&(i.audioMetadata=d.SdkAudioMetadataFrame.toObject(e.audioMetadata,t)),null!=e.audioStreamIdInfo&&e.hasOwnProperty(\"audioStreamIdInfo\")&&(i.audioStreamIdInfo=d.SdkAudioStreamIdInfoFrame.toObject(e.audioStreamIdInfo,t)),null!=e.pingPong&&e.hasOwnProperty(\"pingPong\")&&(i.pingPong=d.SdkPingPongFrame.toObject(e.pingPong,t)),null!=e.audioStatus&&e.hasOwnProperty(\"audioStatus\")&&(i.audioStatus=d.SdkAudioStatusFrame.toObject(e.audioStatus,t)),null!=e.clientMetric&&e.hasOwnProperty(\"clientMetric\")&&(i.clientMetric=d.SdkClientMetricFrame.toObject(e.clientMetric,t)),null!=e.dataMessage&&e.hasOwnProperty(\"dataMessage\")&&(i.dataMessage=d.SdkDataMessageFrame.toObject(e.dataMessage,t)),null!=e.remoteVideoUpdate&&e.hasOwnProperty(\"remoteVideoUpdate\")&&(i.remoteVideoUpdate=d.SdkRemoteVideoUpdateFrame.toObject(e.remoteVideoUpdate,t)),null!=e.primaryMeetingJoin&&e.hasOwnProperty(\"primaryMeetingJoin\")&&(i.primaryMeetingJoin=d.SdkPrimaryMeetingJoinFrame.toObject(e.primaryMeetingJoin,t)),null!=e.primaryMeetingJoinAck&&e.hasOwnProperty(\"primaryMeetingJoinAck\")&&(i.primaryMeetingJoinAck=d.SdkPrimaryMeetingJoinAckFrame.toObject(e.primaryMeetingJoinAck,t)),null!=e.primaryMeetingLeave&&e.hasOwnProperty(\"primaryMeetingLeave\")&&(i.primaryMeetingLeave=d.SdkPrimaryMeetingLeaveFrame.toObject(e.primaryMeetingLeave,t)),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e.Type=(t={},(i=Object.create(t))[t[1]=\"JOIN\"]=1,i[t[2]=\"JOIN_ACK\"]=2,i[t[3]=\"SUBSCRIBE\"]=3,i[t[4]=\"SUBSCRIBE_ACK\"]=4,i[t[5]=\"INDEX\"]=5,i[t[7]=\"PAUSE\"]=7,i[t[8]=\"RESUME\"]=8,i[t[9]=\"LEAVE\"]=9,i[t[10]=\"LEAVE_ACK\"]=10,i[t[13]=\"BITRATES\"]=13,i[t[16]=\"AUDIO_CONTROL\"]=16,i[t[17]=\"AUDIO_METADATA\"]=17,i[t[18]=\"AUDIO_STREAM_ID_INFO\"]=18,i[t[19]=\"PING_PONG\"]=19,i[t[20]=\"AUDIO_STATUS\"]=20,i[t[21]=\"CLIENT_METRIC\"]=21,i[t[22]=\"DATA_MESSAGE\"]=22,i[t[24]=\"REMOTE_VIDEO_UPDATE\"]=24,i[t[25]=\"PRIMARY_MEETING_JOIN\"]=25,i[t[26]=\"PRIMARY_MEETING_JOIN_ACK\"]=26,i[t[27]=\"PRIMARY_MEETING_LEAVE\"]=27,i),e}(),d.SdkErrorFrame=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.status=e.uint32();break;case 2:n.description=e.string();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.status&&e.hasOwnProperty(\"status\")&&!c.isInteger(e.status)?\"status: integer expected\":null!=e.description&&e.hasOwnProperty(\"description\")&&!c.isString(e.description)?\"description: string expected\":null},e.fromObject=function(e){if(e instanceof d.SdkErrorFrame)return e;var t=new d.SdkErrorFrame;return null!=e.status&&(t.status=e.status>>>0),null!=e.description&&(t.description=String(e.description)),t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.status=0,i.description=\"\"),null!=e.status&&e.hasOwnProperty(\"status\")&&(i.status=e.status),null!=e.description&&e.hasOwnProperty(\"description\")&&(i.description=e.description),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkJoinFlags=(n={},(r=Object.create(n))[n[2]=\"HAS_STREAM_UPDATE\"]=2,r[n[16]=\"COMPLETE_VIDEO_SOURCES_LIST\"]=16,r[n[32]=\"EXCLUDE_SELF_CONTENT_IN_INDEX\"]=32,r),d.SdkClientDetails=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.appName=e.string();break;case 2:n.appVersion=e.string();break;case 3:n.deviceModel=e.string();break;case 4:n.deviceMake=e.string();break;case 5:n.platformName=e.string();break;case 6:n.platformVersion=e.string();break;case 7:n.clientSource=e.string();break;case 8:n.chimeSdkVersion=e.string();break;case 9:n.clientUtcOffset=e.string();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.appName&&e.hasOwnProperty(\"appName\")&&!c.isString(e.appName)?\"appName: string expected\":null!=e.appVersion&&e.hasOwnProperty(\"appVersion\")&&!c.isString(e.appVersion)?\"appVersion: string expected\":null!=e.deviceModel&&e.hasOwnProperty(\"deviceModel\")&&!c.isString(e.deviceModel)?\"deviceModel: string expected\":null!=e.deviceMake&&e.hasOwnProperty(\"deviceMake\")&&!c.isString(e.deviceMake)?\"deviceMake: string expected\":null!=e.platformName&&e.hasOwnProperty(\"platformName\")&&!c.isString(e.platformName)?\"platformName: string expected\":null!=e.platformVersion&&e.hasOwnProperty(\"platformVersion\")&&!c.isString(e.platformVersion)?\"platformVersion: string expected\":null!=e.clientSource&&e.hasOwnProperty(\"clientSource\")&&!c.isString(e.clientSource)?\"clientSource: string expected\":null!=e.chimeSdkVersion&&e.hasOwnProperty(\"chimeSdkVersion\")&&!c.isString(e.chimeSdkVersion)?\"chimeSdkVersion: string expected\":null!=e.clientUtcOffset&&e.hasOwnProperty(\"clientUtcOffset\")&&!c.isString(e.clientUtcOffset)?\"clientUtcOffset: string expected\":null},e.fromObject=function(e){if(e instanceof d.SdkClientDetails)return e;var t=new d.SdkClientDetails;return null!=e.appName&&(t.appName=String(e.appName)),null!=e.appVersion&&(t.appVersion=String(e.appVersion)),null!=e.deviceModel&&(t.deviceModel=String(e.deviceModel)),null!=e.deviceMake&&(t.deviceMake=String(e.deviceMake)),null!=e.platformName&&(t.platformName=String(e.platformName)),null!=e.platformVersion&&(t.platformVersion=String(e.platformVersion)),null!=e.clientSource&&(t.clientSource=String(e.clientSource)),null!=e.chimeSdkVersion&&(t.chimeSdkVersion=String(e.chimeSdkVersion)),null!=e.clientUtcOffset&&(t.clientUtcOffset=String(e.clientUtcOffset)),t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.appName=\"\",i.appVersion=\"\",i.deviceModel=\"\",i.deviceMake=\"\",i.platformName=\"\",i.platformVersion=\"\",i.clientSource=\"\",i.chimeSdkVersion=\"\",i.clientUtcOffset=\"\"),null!=e.appName&&e.hasOwnProperty(\"appName\")&&(i.appName=e.appName),null!=e.appVersion&&e.hasOwnProperty(\"appVersion\")&&(i.appVersion=e.appVersion),null!=e.deviceModel&&e.hasOwnProperty(\"deviceModel\")&&(i.deviceModel=e.deviceModel),null!=e.deviceMake&&e.hasOwnProperty(\"deviceMake\")&&(i.deviceMake=e.deviceMake),null!=e.platformName&&e.hasOwnProperty(\"platformName\")&&(i.platformName=e.platformName),null!=e.platformVersion&&e.hasOwnProperty(\"platformVersion\")&&(i.platformVersion=e.platformVersion),null!=e.clientSource&&e.hasOwnProperty(\"clientSource\")&&(i.clientSource=e.clientSource),null!=e.chimeSdkVersion&&e.hasOwnProperty(\"chimeSdkVersion\")&&(i.chimeSdkVersion=e.chimeSdkVersion),null!=e.clientUtcOffset&&e.hasOwnProperty(\"clientUtcOffset\")&&(i.clientUtcOffset=e.clientUtcOffset),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkServerSideNetworkAdaption=function(){var e={},t=Object.create(e);return t[e[1]=\"DEFAULT\"]=1,t[e[2]=\"NONE\"]=2,t[e[3]=\"BANDWIDTH_PROBING\"]=3,t[e[4]=\"BANDWIDTH_PROBING_AND_VIDEO_QUALITY_ADAPTION\"]=4,t}(),d.SdkJoinFrame=function(){function e(e){if(this.supportedServerSideNetworkAdaptions=[],e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.protocolVersion=e.uint32();break;case 2:n.maxNumOfVideos=e.uint32();break;case 3:n.flags=e.uint32();break;case 4:n.clientDetails=d.SdkClientDetails.decode(e,e.uint32());break;case 6:n.audioSessionId=e.uint64();break;case 7:n.wantsCompressedSdp=e.bool();break;case 10:n.serverSideNetworkAdaption=e.int32();break;case 11:if(n.supportedServerSideNetworkAdaptions&&n.supportedServerSideNetworkAdaptions.length||(n.supportedServerSideNetworkAdaptions=[]),2==(7&r))for(var s=e.uint32()+e.pos;e.pos>>0),null!=e.maxNumOfVideos&&(t.maxNumOfVideos=e.maxNumOfVideos>>>0),null!=e.flags&&(t.flags=e.flags>>>0),null!=e.clientDetails){if(\"object\"!=typeof e.clientDetails)throw TypeError(\".SdkJoinFrame.clientDetails: object expected\");t.clientDetails=d.SdkClientDetails.fromObject(e.clientDetails)}switch(null!=e.audioSessionId&&(c.Long?(t.audioSessionId=c.Long.fromValue(e.audioSessionId)).unsigned=!0:\"string\"==typeof e.audioSessionId?t.audioSessionId=parseInt(e.audioSessionId,10):\"number\"==typeof e.audioSessionId?t.audioSessionId=e.audioSessionId:\"object\"==typeof e.audioSessionId&&(t.audioSessionId=new c.LongBits(e.audioSessionId.low>>>0,e.audioSessionId.high>>>0).toNumber(!0))),null!=e.wantsCompressedSdp&&(t.wantsCompressedSdp=Boolean(e.wantsCompressedSdp)),e.serverSideNetworkAdaption){case\"DEFAULT\":case 1:t.serverSideNetworkAdaption=1;break;case\"NONE\":case 2:t.serverSideNetworkAdaption=2;break;case\"BANDWIDTH_PROBING\":case 3:t.serverSideNetworkAdaption=3;break;case\"BANDWIDTH_PROBING_AND_VIDEO_QUALITY_ADAPTION\":case 4:t.serverSideNetworkAdaption=4}if(e.supportedServerSideNetworkAdaptions){if(!Array.isArray(e.supportedServerSideNetworkAdaptions))throw TypeError(\".SdkJoinFrame.supportedServerSideNetworkAdaptions: array expected\");t.supportedServerSideNetworkAdaptions=[];for(var i=0;i>>0,e.audioSessionId.high>>>0).toNumber(!0):e.audioSessionId),null!=e.wantsCompressedSdp&&e.hasOwnProperty(\"wantsCompressedSdp\")&&(i.wantsCompressedSdp=e.wantsCompressedSdp),null!=e.serverSideNetworkAdaption&&e.hasOwnProperty(\"serverSideNetworkAdaption\")&&(i.serverSideNetworkAdaption=t.enums===String?d.SdkServerSideNetworkAdaption[e.serverSideNetworkAdaption]:e.serverSideNetworkAdaption),e.supportedServerSideNetworkAdaptions&&e.supportedServerSideNetworkAdaptions.length){i.supportedServerSideNetworkAdaptions=[];for(var r=0;r>>3){case 1:n.turnCredentials=d.SdkTurnCredentials.decode(e,e.uint32());break;case 2:n.videoSubscriptionLimit=e.uint32();break;case 3:n.wantsCompressedSdp=e.bool();break;case 4:n.defaultServerSideNetworkAdaption=e.int32();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.turnCredentials&&e.hasOwnProperty(\"turnCredentials\")){var t=d.SdkTurnCredentials.verify(e.turnCredentials);if(t)return\"turnCredentials.\"+t}if(null!=e.videoSubscriptionLimit&&e.hasOwnProperty(\"videoSubscriptionLimit\")&&!c.isInteger(e.videoSubscriptionLimit))return\"videoSubscriptionLimit: integer expected\";if(null!=e.wantsCompressedSdp&&e.hasOwnProperty(\"wantsCompressedSdp\")&&\"boolean\"!=typeof e.wantsCompressedSdp)return\"wantsCompressedSdp: boolean expected\";if(null!=e.defaultServerSideNetworkAdaption&&e.hasOwnProperty(\"defaultServerSideNetworkAdaption\"))switch(e.defaultServerSideNetworkAdaption){default:return\"defaultServerSideNetworkAdaption: enum value expected\";case 1:case 2:case 3:case 4:}return null},e.fromObject=function(e){if(e instanceof d.SdkJoinAckFrame)return e;var t=new d.SdkJoinAckFrame;if(null!=e.turnCredentials){if(\"object\"!=typeof e.turnCredentials)throw TypeError(\".SdkJoinAckFrame.turnCredentials: object expected\");t.turnCredentials=d.SdkTurnCredentials.fromObject(e.turnCredentials)}switch(null!=e.videoSubscriptionLimit&&(t.videoSubscriptionLimit=e.videoSubscriptionLimit>>>0),null!=e.wantsCompressedSdp&&(t.wantsCompressedSdp=Boolean(e.wantsCompressedSdp)),e.defaultServerSideNetworkAdaption){case\"DEFAULT\":case 1:t.defaultServerSideNetworkAdaption=1;break;case\"NONE\":case 2:t.defaultServerSideNetworkAdaption=2;break;case\"BANDWIDTH_PROBING\":case 3:t.defaultServerSideNetworkAdaption=3;break;case\"BANDWIDTH_PROBING_AND_VIDEO_QUALITY_ADAPTION\":case 4:t.defaultServerSideNetworkAdaption=4}return t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.turnCredentials=null,i.videoSubscriptionLimit=0,i.wantsCompressedSdp=!1,i.defaultServerSideNetworkAdaption=t.enums===String?\"DEFAULT\":1),null!=e.turnCredentials&&e.hasOwnProperty(\"turnCredentials\")&&(i.turnCredentials=d.SdkTurnCredentials.toObject(e.turnCredentials,t)),null!=e.videoSubscriptionLimit&&e.hasOwnProperty(\"videoSubscriptionLimit\")&&(i.videoSubscriptionLimit=e.videoSubscriptionLimit),null!=e.wantsCompressedSdp&&e.hasOwnProperty(\"wantsCompressedSdp\")&&(i.wantsCompressedSdp=e.wantsCompressedSdp),null!=e.defaultServerSideNetworkAdaption&&e.hasOwnProperty(\"defaultServerSideNetworkAdaption\")&&(i.defaultServerSideNetworkAdaption=t.enums===String?d.SdkServerSideNetworkAdaption[e.defaultServerSideNetworkAdaption]:e.defaultServerSideNetworkAdaption),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkLeaveFrame=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.duplex=e.int32();break;case 2:n.sendStreams&&n.sendStreams.length||(n.sendStreams=[]),n.sendStreams.push(d.SdkStreamDescriptor.decode(e,e.uint32()));break;case 3:if(n.receiveStreamIds&&n.receiveStreamIds.length||(n.receiveStreamIds=[]),2==(7&r))for(var s=e.uint32()+e.pos;e.pos>>0}if(null!=e.sdpOffer&&(t.sdpOffer=String(e.sdpOffer)),null!=e.audioHost&&(t.audioHost=String(e.audioHost)),null!=e.audioCheckin&&(t.audioCheckin=Boolean(e.audioCheckin)),null!=e.audioMuted&&(t.audioMuted=Boolean(e.audioMuted)),null!=e.compressedSdpOffer&&(\"string\"==typeof e.compressedSdpOffer?c.base64.decode(e.compressedSdpOffer,t.compressedSdpOffer=c.newBuffer(c.base64.length(e.compressedSdpOffer)),0):e.compressedSdpOffer.length&&(t.compressedSdpOffer=e.compressedSdpOffer)),e.videoSubscriptionConfiguration){if(!Array.isArray(e.videoSubscriptionConfiguration))throw TypeError(\".SdkSubscribeFrame.videoSubscriptionConfiguration: array expected\");for(t.videoSubscriptionConfiguration=[],i=0;i>>3){case 1:n.duplex=e.int32();break;case 2:n.allocations&&n.allocations.length||(n.allocations=[]),n.allocations.push(d.SdkStreamAllocation.decode(e,e.uint32()));break;case 3:n.sdpAnswer=e.string();break;case 4:n.tracks&&n.tracks.length||(n.tracks=[]),n.tracks.push(d.SdkTrackMapping.decode(e,e.uint32()));break;case 5:n.compressedSdpAnswer=e.bytes();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.duplex&&e.hasOwnProperty(\"duplex\"))switch(e.duplex){default:return\"duplex: enum value expected\";case 1:case 2:case 3:}if(null!=e.allocations&&e.hasOwnProperty(\"allocations\")){if(!Array.isArray(e.allocations))return\"allocations: array expected\";for(var t=0;t>>3){case 1:n.atCapacity=e.bool();break;case 2:n.sources&&n.sources.length||(n.sources=[]),n.sources.push(d.SdkStreamDescriptor.decode(e,e.uint32()));break;case 3:if(n.pausedAtSourceIds&&n.pausedAtSourceIds.length||(n.pausedAtSourceIds=[]),2==(7&r))for(var s=e.uint32()+e.pos;e.pos>>0}if(null!=e.numParticipants&&(t.numParticipants=e.numParticipants>>>0),e.supportedReceiveCodecIntersection){if(!Array.isArray(e.supportedReceiveCodecIntersection))throw TypeError(\".SdkIndexFrame.supportedReceiveCodecIntersection: array expected\");for(t.supportedReceiveCodecIntersection=[],i=0;i>>3){case 1:if(n.streamIds&&n.streamIds.length||(n.streamIds=[]),2==(7&r))for(var s=e.uint32()+e.pos;e.pos>>0}if(e.groupIds){if(!Array.isArray(e.groupIds))throw TypeError(\".SdkPauseResumeFrame.groupIds: array expected\");for(t.groupIds=[],i=0;i>>0}return t},e.toObject=function(e,t){t||(t={});var i={};if((t.arrays||t.defaults)&&(i.streamIds=[],i.groupIds=[]),e.streamIds&&e.streamIds.length){i.streamIds=[];for(var n=0;n>>3){case 1:n.bitrates&&n.bitrates.length||(n.bitrates=[]),n.bitrates.push(d.SdkBitrate.decode(e,e.uint32()));break;case 2:n.serverAvailableOutgoingBitrate=e.uint32();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.bitrates&&e.hasOwnProperty(\"bitrates\")){if(!Array.isArray(e.bitrates))return\"bitrates: array expected\";for(var t=0;t>>0),t},e.toObject=function(e,t){t||(t={});var i={};if((t.arrays||t.defaults)&&(i.bitrates=[]),t.defaults&&(i.serverAvailableOutgoingBitrate=0),e.bitrates&&e.bitrates.length){i.bitrates=[];for(var n=0;n>>3){case 1:n.streamId=e.uint32();break;case 2:n.framerate=e.uint32();break;case 3:n.maxBitrateKbps=e.uint32();break;case 4:n.trackLabel=e.string();break;case 6:n.groupId=e.uint32();break;case 7:n.avgBitrateBps=e.uint32();break;case 8:n.attendeeId=e.string();break;case 9:n.mediaType=e.int32();break;case 10:n.externalUserId=e.string();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.streamId&&e.hasOwnProperty(\"streamId\")&&!c.isInteger(e.streamId))return\"streamId: integer expected\";if(null!=e.framerate&&e.hasOwnProperty(\"framerate\")&&!c.isInteger(e.framerate))return\"framerate: integer expected\";if(null!=e.maxBitrateKbps&&e.hasOwnProperty(\"maxBitrateKbps\")&&!c.isInteger(e.maxBitrateKbps))return\"maxBitrateKbps: integer expected\";if(null!=e.trackLabel&&e.hasOwnProperty(\"trackLabel\")&&!c.isString(e.trackLabel))return\"trackLabel: string expected\";if(null!=e.groupId&&e.hasOwnProperty(\"groupId\")&&!c.isInteger(e.groupId))return\"groupId: integer expected\";if(null!=e.avgBitrateBps&&e.hasOwnProperty(\"avgBitrateBps\")&&!c.isInteger(e.avgBitrateBps))return\"avgBitrateBps: integer expected\";if(null!=e.attendeeId&&e.hasOwnProperty(\"attendeeId\")&&!c.isString(e.attendeeId))return\"attendeeId: string expected\";if(null!=e.mediaType&&e.hasOwnProperty(\"mediaType\"))switch(e.mediaType){default:return\"mediaType: enum value expected\";case 1:case 2:}return null!=e.externalUserId&&e.hasOwnProperty(\"externalUserId\")&&!c.isString(e.externalUserId)?\"externalUserId: string expected\":null},e.fromObject=function(e){if(e instanceof d.SdkStreamDescriptor)return e;var t=new d.SdkStreamDescriptor;switch(null!=e.streamId&&(t.streamId=e.streamId>>>0),null!=e.framerate&&(t.framerate=e.framerate>>>0),null!=e.maxBitrateKbps&&(t.maxBitrateKbps=e.maxBitrateKbps>>>0),null!=e.trackLabel&&(t.trackLabel=String(e.trackLabel)),null!=e.groupId&&(t.groupId=e.groupId>>>0),null!=e.avgBitrateBps&&(t.avgBitrateBps=e.avgBitrateBps>>>0),null!=e.attendeeId&&(t.attendeeId=String(e.attendeeId)),e.mediaType){case\"AUDIO\":case 1:t.mediaType=1;break;case\"VIDEO\":case 2:t.mediaType=2}return null!=e.externalUserId&&(t.externalUserId=String(e.externalUserId)),t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.streamId=0,i.framerate=0,i.maxBitrateKbps=0,i.trackLabel=\"\",i.groupId=0,i.avgBitrateBps=0,i.attendeeId=\"\",i.mediaType=t.enums===String?\"AUDIO\":1,i.externalUserId=\"\"),null!=e.streamId&&e.hasOwnProperty(\"streamId\")&&(i.streamId=e.streamId),null!=e.framerate&&e.hasOwnProperty(\"framerate\")&&(i.framerate=e.framerate),null!=e.maxBitrateKbps&&e.hasOwnProperty(\"maxBitrateKbps\")&&(i.maxBitrateKbps=e.maxBitrateKbps),null!=e.trackLabel&&e.hasOwnProperty(\"trackLabel\")&&(i.trackLabel=e.trackLabel),null!=e.groupId&&e.hasOwnProperty(\"groupId\")&&(i.groupId=e.groupId),null!=e.avgBitrateBps&&e.hasOwnProperty(\"avgBitrateBps\")&&(i.avgBitrateBps=e.avgBitrateBps),null!=e.attendeeId&&e.hasOwnProperty(\"attendeeId\")&&(i.attendeeId=e.attendeeId),null!=e.mediaType&&e.hasOwnProperty(\"mediaType\")&&(i.mediaType=t.enums===String?d.SdkStreamMediaType[e.mediaType]:e.mediaType),null!=e.externalUserId&&e.hasOwnProperty(\"externalUserId\")&&(i.externalUserId=e.externalUserId),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkStreamAllocation=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.trackLabel=e.string();break;case 2:n.streamId=e.uint32();break;case 3:n.groupId=e.uint32();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.trackLabel&&e.hasOwnProperty(\"trackLabel\")&&!c.isString(e.trackLabel)?\"trackLabel: string expected\":null!=e.streamId&&e.hasOwnProperty(\"streamId\")&&!c.isInteger(e.streamId)?\"streamId: integer expected\":null!=e.groupId&&e.hasOwnProperty(\"groupId\")&&!c.isInteger(e.groupId)?\"groupId: integer expected\":null},e.fromObject=function(e){if(e instanceof d.SdkStreamAllocation)return e;var t=new d.SdkStreamAllocation;return null!=e.trackLabel&&(t.trackLabel=String(e.trackLabel)),null!=e.streamId&&(t.streamId=e.streamId>>>0),null!=e.groupId&&(t.groupId=e.groupId>>>0),t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.trackLabel=\"\",i.streamId=0,i.groupId=0),null!=e.trackLabel&&e.hasOwnProperty(\"trackLabel\")&&(i.trackLabel=e.trackLabel),null!=e.streamId&&e.hasOwnProperty(\"streamId\")&&(i.streamId=e.streamId),null!=e.groupId&&e.hasOwnProperty(\"groupId\")&&(i.groupId=e.groupId),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkTrackMapping=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.streamId=e.uint32();break;case 2:n.ssrc=e.uint32();break;case 3:n.trackLabel=e.string();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.streamId&&e.hasOwnProperty(\"streamId\")&&!c.isInteger(e.streamId)?\"streamId: integer expected\":null!=e.ssrc&&e.hasOwnProperty(\"ssrc\")&&!c.isInteger(e.ssrc)?\"ssrc: integer expected\":null!=e.trackLabel&&e.hasOwnProperty(\"trackLabel\")&&!c.isString(e.trackLabel)?\"trackLabel: string expected\":null},e.fromObject=function(e){if(e instanceof d.SdkTrackMapping)return e;var t=new d.SdkTrackMapping;return null!=e.streamId&&(t.streamId=e.streamId>>>0),null!=e.ssrc&&(t.ssrc=e.ssrc>>>0),null!=e.trackLabel&&(t.trackLabel=String(e.trackLabel)),t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.streamId=0,i.ssrc=0,i.trackLabel=\"\"),null!=e.streamId&&e.hasOwnProperty(\"streamId\")&&(i.streamId=e.streamId),null!=e.ssrc&&e.hasOwnProperty(\"ssrc\")&&(i.ssrc=e.ssrc),null!=e.trackLabel&&e.hasOwnProperty(\"trackLabel\")&&(i.trackLabel=e.trackLabel),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkBitrate=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.sourceStreamId=e.uint32();break;case 2:n.avgBitrateBps=e.uint32();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.sourceStreamId&&e.hasOwnProperty(\"sourceStreamId\")&&!c.isInteger(e.sourceStreamId)?\"sourceStreamId: integer expected\":null!=e.avgBitrateBps&&e.hasOwnProperty(\"avgBitrateBps\")&&!c.isInteger(e.avgBitrateBps)?\"avgBitrateBps: integer expected\":null},e.fromObject=function(e){if(e instanceof d.SdkBitrate)return e;var t=new d.SdkBitrate;return null!=e.sourceStreamId&&(t.sourceStreamId=e.sourceStreamId>>>0),null!=e.avgBitrateBps&&(t.avgBitrateBps=e.avgBitrateBps>>>0),t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.sourceStreamId=0,i.avgBitrateBps=0),null!=e.sourceStreamId&&e.hasOwnProperty(\"sourceStreamId\")&&(i.sourceStreamId=e.sourceStreamId),null!=e.avgBitrateBps&&e.hasOwnProperty(\"avgBitrateBps\")&&(i.avgBitrateBps=e.avgBitrateBps),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkAudioControlFrame=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3==1?n.muted=e.bool():e.skipType(7&r)}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.muted&&e.hasOwnProperty(\"muted\")&&\"boolean\"!=typeof e.muted?\"muted: boolean expected\":null},e.fromObject=function(e){if(e instanceof d.SdkAudioControlFrame)return e;var t=new d.SdkAudioControlFrame;return null!=e.muted&&(t.muted=Boolean(e.muted)),t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.muted=!1),null!=e.muted&&e.hasOwnProperty(\"muted\")&&(i.muted=e.muted),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkAudioMetadataFrame=function(){function e(e){if(this.attendeeStates=[],e)for(var t=Object.keys(e),i=0;i>>3==1?(n.attendeeStates&&n.attendeeStates.length||(n.attendeeStates=[]),n.attendeeStates.push(d.SdkAudioAttendeeState.decode(e,e.uint32()))):e.skipType(7&r)}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.attendeeStates&&e.hasOwnProperty(\"attendeeStates\")){if(!Array.isArray(e.attendeeStates))return\"attendeeStates: array expected\";for(var t=0;t>>3){case 1:n.audioStreamId=e.uint32();break;case 2:n.volume=e.uint32();break;case 3:n.muted=e.bool();break;case 4:n.signalStrength=e.uint32();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.audioStreamId&&e.hasOwnProperty(\"audioStreamId\")&&!c.isInteger(e.audioStreamId)?\"audioStreamId: integer expected\":null!=e.volume&&e.hasOwnProperty(\"volume\")&&!c.isInteger(e.volume)?\"volume: integer expected\":null!=e.muted&&e.hasOwnProperty(\"muted\")&&\"boolean\"!=typeof e.muted?\"muted: boolean expected\":null!=e.signalStrength&&e.hasOwnProperty(\"signalStrength\")&&!c.isInteger(e.signalStrength)?\"signalStrength: integer expected\":null},e.fromObject=function(e){if(e instanceof d.SdkAudioAttendeeState)return e;var t=new d.SdkAudioAttendeeState;return null!=e.audioStreamId&&(t.audioStreamId=e.audioStreamId>>>0),null!=e.volume&&(t.volume=e.volume>>>0),null!=e.muted&&(t.muted=Boolean(e.muted)),null!=e.signalStrength&&(t.signalStrength=e.signalStrength>>>0),t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.audioStreamId=0,i.volume=0,i.muted=!1,i.signalStrength=0),null!=e.audioStreamId&&e.hasOwnProperty(\"audioStreamId\")&&(i.audioStreamId=e.audioStreamId),null!=e.volume&&e.hasOwnProperty(\"volume\")&&(i.volume=e.volume),null!=e.muted&&e.hasOwnProperty(\"muted\")&&(i.muted=e.muted),null!=e.signalStrength&&e.hasOwnProperty(\"signalStrength\")&&(i.signalStrength=e.signalStrength),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkAudioStreamIdInfoFrame=function(){function e(e){if(this.streams=[],e)for(var t=Object.keys(e),i=0;i>>3==1?(n.streams&&n.streams.length||(n.streams=[]),n.streams.push(d.SdkAudioStreamIdInfo.decode(e,e.uint32()))):e.skipType(7&r)}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.streams&&e.hasOwnProperty(\"streams\")){if(!Array.isArray(e.streams))return\"streams: array expected\";for(var t=0;t>>3){case 1:n.audioStreamId=e.uint32();break;case 2:n.attendeeId=e.string();break;case 3:n.muted=e.bool();break;case 4:n.externalUserId=e.string();break;case 5:n.dropped=e.bool();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.audioStreamId&&e.hasOwnProperty(\"audioStreamId\")&&!c.isInteger(e.audioStreamId)?\"audioStreamId: integer expected\":null!=e.attendeeId&&e.hasOwnProperty(\"attendeeId\")&&!c.isString(e.attendeeId)?\"attendeeId: string expected\":null!=e.muted&&e.hasOwnProperty(\"muted\")&&\"boolean\"!=typeof e.muted?\"muted: boolean expected\":null!=e.externalUserId&&e.hasOwnProperty(\"externalUserId\")&&!c.isString(e.externalUserId)?\"externalUserId: string expected\":null!=e.dropped&&e.hasOwnProperty(\"dropped\")&&\"boolean\"!=typeof e.dropped?\"dropped: boolean expected\":null},e.fromObject=function(e){if(e instanceof d.SdkAudioStreamIdInfo)return e;var t=new d.SdkAudioStreamIdInfo;return null!=e.audioStreamId&&(t.audioStreamId=e.audioStreamId>>>0),null!=e.attendeeId&&(t.attendeeId=String(e.attendeeId)),null!=e.muted&&(t.muted=Boolean(e.muted)),null!=e.externalUserId&&(t.externalUserId=String(e.externalUserId)),null!=e.dropped&&(t.dropped=Boolean(e.dropped)),t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.audioStreamId=0,i.attendeeId=\"\",i.muted=!1,i.externalUserId=\"\",i.dropped=!1),null!=e.audioStreamId&&e.hasOwnProperty(\"audioStreamId\")&&(i.audioStreamId=e.audioStreamId),null!=e.attendeeId&&e.hasOwnProperty(\"attendeeId\")&&(i.attendeeId=e.attendeeId),null!=e.muted&&e.hasOwnProperty(\"muted\")&&(i.muted=e.muted),null!=e.externalUserId&&e.hasOwnProperty(\"externalUserId\")&&(i.externalUserId=e.externalUserId),null!=e.dropped&&e.hasOwnProperty(\"dropped\")&&(i.dropped=e.dropped),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkPingPongType=function(){var e={},t=Object.create(e);return t[e[1]=\"PING\"]=1,t[e[2]=\"PONG\"]=2,t}(),d.SdkPingPongFrame=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.type=e.int32();break;case 2:n.pingId=e.uint32();break;default:e.skipType(7&r)}}if(!n.hasOwnProperty(\"type\"))throw c.ProtocolError(\"missing required 'type'\",{instance:n});if(!n.hasOwnProperty(\"pingId\"))throw c.ProtocolError(\"missing required 'pingId'\",{instance:n});return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";switch(e.type){default:return\"type: enum value expected\";case 1:case 2:}return c.isInteger(e.pingId)?null:\"pingId: integer expected\"},e.fromObject=function(e){if(e instanceof d.SdkPingPongFrame)return e;var t=new d.SdkPingPongFrame;switch(e.type){case\"PING\":case 1:t.type=1;break;case\"PONG\":case 2:t.type=2}return null!=e.pingId&&(t.pingId=e.pingId>>>0),t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.type=t.enums===String?\"PING\":1,i.pingId=0),null!=e.type&&e.hasOwnProperty(\"type\")&&(i.type=t.enums===String?d.SdkPingPongType[e.type]:e.type),null!=e.pingId&&e.hasOwnProperty(\"pingId\")&&(i.pingId=e.pingId),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkAudioStatusFrame=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3==1?n.audioStatus=e.uint32():e.skipType(7&r)}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.audioStatus&&e.hasOwnProperty(\"audioStatus\")&&!c.isInteger(e.audioStatus)?\"audioStatus: integer expected\":null},e.fromObject=function(e){if(e instanceof d.SdkAudioStatusFrame)return e;var t=new d.SdkAudioStatusFrame;return null!=e.audioStatus&&(t.audioStatus=e.audioStatus>>>0),t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.audioStatus=0),null!=e.audioStatus&&e.hasOwnProperty(\"audioStatus\")&&(i.audioStatus=e.audioStatus),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkMetric=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.type=e.int32();break;case 2:n.value=e.double();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.type&&e.hasOwnProperty(\"type\"))switch(e.type){default:return\"type: enum value expected\";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 64:case 66:case 69:case 72:case 86:case 87:case 88:case 89:}return null!=e.value&&e.hasOwnProperty(\"value\")&&\"number\"!=typeof e.value?\"value: number expected\":null},e.fromObject=function(e){if(e instanceof d.SdkMetric)return e;var t=new d.SdkMetric;switch(e.type){case\"VIDEO_ACTUAL_ENCODER_BITRATE\":case 1:t.type=1;break;case\"VIDEO_AVAILABLE_SEND_BANDWIDTH\":case 2:t.type=2;break;case\"VIDEO_RETRANSMIT_BITRATE\":case 3:t.type=3;break;case\"VIDEO_AVAILABLE_RECEIVE_BANDWIDTH\":case 4:t.type=4;break;case\"VIDEO_TARGET_ENCODER_BITRATE\":case 5:t.type=5;break;case\"VIDEO_BUCKET_DELAY_MS\":case 6:t.type=6;break;case\"STUN_RTT_MS\":case 7:t.type=7;break;case\"SOCKET_DISCARDED_PPS\":case 8:t.type=8;break;case\"RTC_MIC_JITTER_MS\":case 9:t.type=9;break;case\"RTC_MIC_PPS\":case 10:t.type=10;break;case\"RTC_MIC_FRACTION_PACKET_LOST_PERCENT\":case 11:t.type=11;break;case\"RTC_MIC_BITRATE\":case 12:t.type=12;break;case\"RTC_MIC_RTT_MS\":case 13:t.type=13;break;case\"RTC_SPK_PPS\":case 14:t.type=14;break;case\"RTC_SPK_FRACTION_PACKET_LOST_PERCENT\":case 15:t.type=15;break;case\"RTC_SPK_JITTER_MS\":case 16:t.type=16;break;case\"RTC_SPK_FRACTION_DECODER_LOSS_PERCENT\":case 17:t.type=17;break;case\"RTC_SPK_BITRATE\":case 18:t.type=18;break;case\"RTC_SPK_CURRENT_DELAY_MS\":case 19:t.type=19;break;case\"RTC_SPK_JITTER_BUFFER_MS\":case 20:t.type=20;break;case\"VIDEO_SENT_RTT_MS\":case 21:t.type=21;break;case\"VIDEO_ENCODE_USAGE_PERCENT\":case 22:t.type=22;break;case\"VIDEO_NACKS_RECEIVED\":case 23:t.type=23;break;case\"VIDEO_PLIS_RECEIVED\":case 24:t.type=24;break;case\"VIDEO_ENCODE_MS\":case 25:t.type=25;break;case\"VIDEO_INPUT_FPS\":case 26:t.type=26;break;case\"VIDEO_ENCODE_FPS\":case 27:t.type=27;break;case\"VIDEO_SENT_FPS\":case 28:t.type=28;break;case\"VIDEO_FIRS_RECEIVED\":case 29:t.type=29;break;case\"VIDEO_SENT_PPS\":case 30:t.type=30;break;case\"VIDEO_SENT_FRACTION_PACKET_LOST_PERCENT\":case 31:t.type=31;break;case\"VIDEO_SENT_BITRATE\":case 32:t.type=32;break;case\"VIDEO_DROPPED_FPS\":case 33:t.type=33;break;case\"VIDEO_TARGET_DELAY_MS\":case 34:t.type=34;break;case\"VIDEO_DECODE_MS\":case 35:t.type=35;break;case\"VIDEO_OUTPUT_FPS\":case 36:t.type=36;break;case\"VIDEO_RECEIVED_PPS\":case 37:t.type=37;break;case\"VIDEO_RECEIVED_FRACTION_PACKET_LOST_PERCENT\":case 38:t.type=38;break;case\"VIDEO_RENDER_DELAY_MS\":case 39:t.type=39;break;case\"VIDEO_RECEIVED_FPS\":case 40:t.type=40;break;case\"VIDEO_DECODE_FPS\":case 41:t.type=41;break;case\"VIDEO_NACKS_SENT\":case 42:t.type=42;break;case\"VIDEO_FIRS_SENT\":case 43:t.type=43;break;case\"VIDEO_RECEIVED_BITRATE\":case 44:t.type=44;break;case\"VIDEO_CURRENT_DELAY_MS\":case 45:t.type=45;break;case\"VIDEO_JITTER_BUFFER_MS\":case 46:t.type=46;break;case\"VIDEO_DISCARDED_PPS\":case 47:t.type=47;break;case\"VIDEO_PLIS_SENT\":case 48:t.type=48;break;case\"VIDEO_RECEIVED_JITTER_MS\":case 49:t.type=49;break;case\"VIDEO_ENCODE_HEIGHT\":case 64:t.type=64;break;case\"VIDEO_SENT_QP_SUM\":case 66:t.type=66;break;case\"VIDEO_DECODE_HEIGHT\":case 69:t.type=69;break;case\"VIDEO_RECEIVED_QP_SUM\":case 72:t.type=72;break;case\"VIDEO_ENCODE_WIDTH\":case 86:t.type=86;break;case\"VIDEO_DECODE_WIDTH\":case 87:t.type=87;break;case\"VIDEO_ENCODER_IS_HARDWARE\":case 88:t.type=88;break;case\"VIDEO_DECODER_IS_HARDWARE\":case 89:t.type=89}return null!=e.value&&(t.value=Number(e.value)),t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.type=t.enums===String?\"VIDEO_ACTUAL_ENCODER_BITRATE\":1,i.value=0),null!=e.type&&e.hasOwnProperty(\"type\")&&(i.type=t.enums===String?d.SdkMetric.Type[e.type]:e.type),null!=e.value&&e.hasOwnProperty(\"value\")&&(i.value=t.json&&!isFinite(e.value)?String(e.value):e.value),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e.Type=function(){var e={},t=Object.create(e);return t[e[1]=\"VIDEO_ACTUAL_ENCODER_BITRATE\"]=1,t[e[2]=\"VIDEO_AVAILABLE_SEND_BANDWIDTH\"]=2,t[e[3]=\"VIDEO_RETRANSMIT_BITRATE\"]=3,t[e[4]=\"VIDEO_AVAILABLE_RECEIVE_BANDWIDTH\"]=4,t[e[5]=\"VIDEO_TARGET_ENCODER_BITRATE\"]=5,t[e[6]=\"VIDEO_BUCKET_DELAY_MS\"]=6,t[e[7]=\"STUN_RTT_MS\"]=7,t[e[8]=\"SOCKET_DISCARDED_PPS\"]=8,t[e[9]=\"RTC_MIC_JITTER_MS\"]=9,t[e[10]=\"RTC_MIC_PPS\"]=10,t[e[11]=\"RTC_MIC_FRACTION_PACKET_LOST_PERCENT\"]=11,t[e[12]=\"RTC_MIC_BITRATE\"]=12,t[e[13]=\"RTC_MIC_RTT_MS\"]=13,t[e[14]=\"RTC_SPK_PPS\"]=14,t[e[15]=\"RTC_SPK_FRACTION_PACKET_LOST_PERCENT\"]=15,t[e[16]=\"RTC_SPK_JITTER_MS\"]=16,t[e[17]=\"RTC_SPK_FRACTION_DECODER_LOSS_PERCENT\"]=17,t[e[18]=\"RTC_SPK_BITRATE\"]=18,t[e[19]=\"RTC_SPK_CURRENT_DELAY_MS\"]=19,t[e[20]=\"RTC_SPK_JITTER_BUFFER_MS\"]=20,t[e[21]=\"VIDEO_SENT_RTT_MS\"]=21,t[e[22]=\"VIDEO_ENCODE_USAGE_PERCENT\"]=22,t[e[23]=\"VIDEO_NACKS_RECEIVED\"]=23,t[e[24]=\"VIDEO_PLIS_RECEIVED\"]=24,t[e[25]=\"VIDEO_ENCODE_MS\"]=25,t[e[26]=\"VIDEO_INPUT_FPS\"]=26,t[e[27]=\"VIDEO_ENCODE_FPS\"]=27,t[e[28]=\"VIDEO_SENT_FPS\"]=28,t[e[29]=\"VIDEO_FIRS_RECEIVED\"]=29,t[e[30]=\"VIDEO_SENT_PPS\"]=30,t[e[31]=\"VIDEO_SENT_FRACTION_PACKET_LOST_PERCENT\"]=31,t[e[32]=\"VIDEO_SENT_BITRATE\"]=32,t[e[33]=\"VIDEO_DROPPED_FPS\"]=33,t[e[34]=\"VIDEO_TARGET_DELAY_MS\"]=34,t[e[35]=\"VIDEO_DECODE_MS\"]=35,t[e[36]=\"VIDEO_OUTPUT_FPS\"]=36,t[e[37]=\"VIDEO_RECEIVED_PPS\"]=37,t[e[38]=\"VIDEO_RECEIVED_FRACTION_PACKET_LOST_PERCENT\"]=38,t[e[39]=\"VIDEO_RENDER_DELAY_MS\"]=39,t[e[40]=\"VIDEO_RECEIVED_FPS\"]=40,t[e[41]=\"VIDEO_DECODE_FPS\"]=41,t[e[42]=\"VIDEO_NACKS_SENT\"]=42,t[e[43]=\"VIDEO_FIRS_SENT\"]=43,t[e[44]=\"VIDEO_RECEIVED_BITRATE\"]=44,t[e[45]=\"VIDEO_CURRENT_DELAY_MS\"]=45,t[e[46]=\"VIDEO_JITTER_BUFFER_MS\"]=46,t[e[47]=\"VIDEO_DISCARDED_PPS\"]=47,t[e[48]=\"VIDEO_PLIS_SENT\"]=48,t[e[49]=\"VIDEO_RECEIVED_JITTER_MS\"]=49,t[e[64]=\"VIDEO_ENCODE_HEIGHT\"]=64,t[e[66]=\"VIDEO_SENT_QP_SUM\"]=66,t[e[69]=\"VIDEO_DECODE_HEIGHT\"]=69,t[e[72]=\"VIDEO_RECEIVED_QP_SUM\"]=72,t[e[86]=\"VIDEO_ENCODE_WIDTH\"]=86,t[e[87]=\"VIDEO_DECODE_WIDTH\"]=87,t[e[88]=\"VIDEO_ENCODER_IS_HARDWARE\"]=88,t[e[89]=\"VIDEO_DECODER_IS_HARDWARE\"]=89,t}(),e}(),d.SdkStreamMetricFrame=function(){function e(e){if(this.metrics=[],this.dimensions=[],e)for(var t=Object.keys(e),i=0;i>>3){case 3:n.streamId=e.uint32();break;case 4:n.groupId=e.uint32();break;case 5:n.metrics&&n.metrics.length||(n.metrics=[]),n.metrics.push(d.SdkMetric.decode(e,e.uint32()));break;case 6:n.dimensions&&n.dimensions.length||(n.dimensions=[]),n.dimensions.push(d.SdkStreamDimension.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.streamId&&e.hasOwnProperty(\"streamId\")&&!c.isInteger(e.streamId))return\"streamId: integer expected\";if(null!=e.groupId&&e.hasOwnProperty(\"groupId\")&&!c.isInteger(e.groupId))return\"groupId: integer expected\";if(null!=e.metrics&&e.hasOwnProperty(\"metrics\")){if(!Array.isArray(e.metrics))return\"metrics: array expected\";for(var t=0;t>>0),null!=e.groupId&&(t.groupId=e.groupId>>>0),e.metrics){if(!Array.isArray(e.metrics))throw TypeError(\".SdkStreamMetricFrame.metrics: array expected\");t.metrics=[];for(var i=0;i>>3){case 1:n.globalMetrics&&n.globalMetrics.length||(n.globalMetrics=[]),n.globalMetrics.push(d.SdkMetric.decode(e,e.uint32()));break;case 2:n.streamMetricFrames&&n.streamMetricFrames.length||(n.streamMetricFrames=[]),n.streamMetricFrames.push(d.SdkStreamMetricFrame.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.globalMetrics&&e.hasOwnProperty(\"globalMetrics\")){if(!Array.isArray(e.globalMetrics))return\"globalMetrics: array expected\";for(var t=0;t>>3){case 1:n.type=e.int32();break;case 2:n.value=d.SdkDimensionValue.decode(e,e.uint32());break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.type&&e.hasOwnProperty(\"type\"))switch(e.type){default:return\"type: enum value expected\";case 1:case 2:}if(null!=e.value&&e.hasOwnProperty(\"value\")){var t=d.SdkDimensionValue.verify(e.value);if(t)return\"value.\"+t}return null},e.fromObject=function(e){if(e instanceof d.SdkStreamDimension)return e;var t=new d.SdkStreamDimension;switch(e.type){case\"VIDEO_ENCODER_NAME\":case 1:t.type=1;break;case\"VIDEO_DECODER_NAME\":case 2:t.type=2}if(null!=e.value){if(\"object\"!=typeof e.value)throw TypeError(\".SdkStreamDimension.value: object expected\");t.value=d.SdkDimensionValue.fromObject(e.value)}return t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.type=t.enums===String?\"VIDEO_ENCODER_NAME\":1,i.value=null),null!=e.type&&e.hasOwnProperty(\"type\")&&(i.type=t.enums===String?d.SdkStreamDimension.Type[e.type]:e.type),null!=e.value&&e.hasOwnProperty(\"value\")&&(i.value=d.SdkDimensionValue.toObject(e.value,t)),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e.Type=function(){var e={},t=Object.create(e);return t[e[1]=\"VIDEO_ENCODER_NAME\"]=1,t[e[2]=\"VIDEO_DECODER_NAME\"]=2,t}(),e}(),d.SdkDimensionValue=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.stringValue=e.string();break;case 2:n.boolValue=e.bool();break;case 3:n.uintValue=e.uint64();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.stringValue&&e.hasOwnProperty(\"stringValue\")&&!c.isString(e.stringValue)?\"stringValue: string expected\":null!=e.boolValue&&e.hasOwnProperty(\"boolValue\")&&\"boolean\"!=typeof e.boolValue?\"boolValue: boolean expected\":null!=e.uintValue&&e.hasOwnProperty(\"uintValue\")&&!(c.isInteger(e.uintValue)||e.uintValue&&c.isInteger(e.uintValue.low)&&c.isInteger(e.uintValue.high))?\"uintValue: integer|Long expected\":null},e.fromObject=function(e){if(e instanceof d.SdkDimensionValue)return e;var t=new d.SdkDimensionValue;return null!=e.stringValue&&(t.stringValue=String(e.stringValue)),null!=e.boolValue&&(t.boolValue=Boolean(e.boolValue)),null!=e.uintValue&&(c.Long?(t.uintValue=c.Long.fromValue(e.uintValue)).unsigned=!0:\"string\"==typeof e.uintValue?t.uintValue=parseInt(e.uintValue,10):\"number\"==typeof e.uintValue?t.uintValue=e.uintValue:\"object\"==typeof e.uintValue&&(t.uintValue=new c.LongBits(e.uintValue.low>>>0,e.uintValue.high>>>0).toNumber(!0))),t},e.toObject=function(e,t){t||(t={});var i={};if(t.defaults)if(i.stringValue=\"\",i.boolValue=!1,c.Long){var n=new c.Long(0,0,!0);i.uintValue=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else i.uintValue=t.longs===String?\"0\":0;return null!=e.stringValue&&e.hasOwnProperty(\"stringValue\")&&(i.stringValue=e.stringValue),null!=e.boolValue&&e.hasOwnProperty(\"boolValue\")&&(i.boolValue=e.boolValue),null!=e.uintValue&&e.hasOwnProperty(\"uintValue\")&&(\"number\"==typeof e.uintValue?i.uintValue=t.longs===String?String(e.uintValue):e.uintValue:i.uintValue=t.longs===String?c.Long.prototype.toString.call(e.uintValue):t.longs===Number?new c.LongBits(e.uintValue.low>>>0,e.uintValue.high>>>0).toNumber(!0):e.uintValue),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkDataMessageFrame=function(){function e(e){if(this.messages=[],e)for(var t=Object.keys(e),i=0;i>>3==1?(n.messages&&n.messages.length||(n.messages=[]),n.messages.push(d.SdkDataMessagePayload.decode(e,e.uint32()))):e.skipType(7&r)}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.messages&&e.hasOwnProperty(\"messages\")){if(!Array.isArray(e.messages))return\"messages: array expected\";for(var t=0;t>>3){case 1:n.topic=e.string();break;case 2:n.data=e.bytes();break;case 3:n.lifetimeMs=e.uint32();break;case 4:n.senderAttendeeId=e.string();break;case 5:n.ingestTimeNs=e.int64();break;case 6:n.senderExternalUserId=e.string();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.topic&&e.hasOwnProperty(\"topic\")&&!c.isString(e.topic)?\"topic: string expected\":null!=e.data&&e.hasOwnProperty(\"data\")&&!(e.data&&\"number\"==typeof e.data.length||c.isString(e.data))?\"data: buffer expected\":null!=e.lifetimeMs&&e.hasOwnProperty(\"lifetimeMs\")&&!c.isInteger(e.lifetimeMs)?\"lifetimeMs: integer expected\":null!=e.senderAttendeeId&&e.hasOwnProperty(\"senderAttendeeId\")&&!c.isString(e.senderAttendeeId)?\"senderAttendeeId: string expected\":null!=e.ingestTimeNs&&e.hasOwnProperty(\"ingestTimeNs\")&&!(c.isInteger(e.ingestTimeNs)||e.ingestTimeNs&&c.isInteger(e.ingestTimeNs.low)&&c.isInteger(e.ingestTimeNs.high))?\"ingestTimeNs: integer|Long expected\":null!=e.senderExternalUserId&&e.hasOwnProperty(\"senderExternalUserId\")&&!c.isString(e.senderExternalUserId)?\"senderExternalUserId: string expected\":null},e.fromObject=function(e){if(e instanceof d.SdkDataMessagePayload)return e;var t=new d.SdkDataMessagePayload;return null!=e.topic&&(t.topic=String(e.topic)),null!=e.data&&(\"string\"==typeof e.data?c.base64.decode(e.data,t.data=c.newBuffer(c.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),null!=e.lifetimeMs&&(t.lifetimeMs=e.lifetimeMs>>>0),null!=e.senderAttendeeId&&(t.senderAttendeeId=String(e.senderAttendeeId)),null!=e.ingestTimeNs&&(c.Long?(t.ingestTimeNs=c.Long.fromValue(e.ingestTimeNs)).unsigned=!1:\"string\"==typeof e.ingestTimeNs?t.ingestTimeNs=parseInt(e.ingestTimeNs,10):\"number\"==typeof e.ingestTimeNs?t.ingestTimeNs=e.ingestTimeNs:\"object\"==typeof e.ingestTimeNs&&(t.ingestTimeNs=new c.LongBits(e.ingestTimeNs.low>>>0,e.ingestTimeNs.high>>>0).toNumber())),null!=e.senderExternalUserId&&(t.senderExternalUserId=String(e.senderExternalUserId)),t},e.toObject=function(e,t){t||(t={});var i={};if(t.defaults){if(i.topic=\"\",t.bytes===String?i.data=\"\":(i.data=[],t.bytes!==Array&&(i.data=c.newBuffer(i.data))),i.lifetimeMs=0,i.senderAttendeeId=\"\",c.Long){var n=new c.Long(0,0,!1);i.ingestTimeNs=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else i.ingestTimeNs=t.longs===String?\"0\":0;i.senderExternalUserId=\"\"}return null!=e.topic&&e.hasOwnProperty(\"topic\")&&(i.topic=e.topic),null!=e.data&&e.hasOwnProperty(\"data\")&&(i.data=t.bytes===String?c.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.lifetimeMs&&e.hasOwnProperty(\"lifetimeMs\")&&(i.lifetimeMs=e.lifetimeMs),null!=e.senderAttendeeId&&e.hasOwnProperty(\"senderAttendeeId\")&&(i.senderAttendeeId=e.senderAttendeeId),null!=e.ingestTimeNs&&e.hasOwnProperty(\"ingestTimeNs\")&&(\"number\"==typeof e.ingestTimeNs?i.ingestTimeNs=t.longs===String?String(e.ingestTimeNs):e.ingestTimeNs:i.ingestTimeNs=t.longs===String?c.Long.prototype.toString.call(e.ingestTimeNs):t.longs===Number?new c.LongBits(e.ingestTimeNs.low>>>0,e.ingestTimeNs.high>>>0).toNumber():e.ingestTimeNs),null!=e.senderExternalUserId&&e.hasOwnProperty(\"senderExternalUserId\")&&(i.senderExternalUserId=e.senderExternalUserId),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkTurnCredentials=function(){function e(e){if(this.uris=[],e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.username=e.string();break;case 2:n.password=e.string();break;case 3:n.ttl=e.uint32();break;case 4:n.uris&&n.uris.length||(n.uris=[]),n.uris.push(e.string());break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.username&&e.hasOwnProperty(\"username\")&&!c.isString(e.username))return\"username: string expected\";if(null!=e.password&&e.hasOwnProperty(\"password\")&&!c.isString(e.password))return\"password: string expected\";if(null!=e.ttl&&e.hasOwnProperty(\"ttl\")&&!c.isInteger(e.ttl))return\"ttl: integer expected\";if(null!=e.uris&&e.hasOwnProperty(\"uris\")){if(!Array.isArray(e.uris))return\"uris: array expected\";for(var t=0;t>>0),e.uris){if(!Array.isArray(e.uris))throw TypeError(\".SdkTurnCredentials.uris: array expected\");t.uris=[];for(var i=0;i>>3){case 1:n.content=e.string();break;case 2:n.endTime=e.int64();break;case 3:n.speakerAttendeeId=e.string();break;case 4:n.speakerExternalUserId=e.string();break;case 5:n.startTime=e.int64();break;case 6:n.type=e.int32();break;case 7:n.vocabularyFilterMatch=e.bool();break;case 8:n.confidence=e.double();break;case 9:n.stable=e.bool();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.content&&e.hasOwnProperty(\"content\")&&!c.isString(e.content))return\"content: string expected\";if(null!=e.endTime&&e.hasOwnProperty(\"endTime\")&&!(c.isInteger(e.endTime)||e.endTime&&c.isInteger(e.endTime.low)&&c.isInteger(e.endTime.high)))return\"endTime: integer|Long expected\";if(null!=e.speakerAttendeeId&&e.hasOwnProperty(\"speakerAttendeeId\")&&!c.isString(e.speakerAttendeeId))return\"speakerAttendeeId: string expected\";if(null!=e.speakerExternalUserId&&e.hasOwnProperty(\"speakerExternalUserId\")&&!c.isString(e.speakerExternalUserId))return\"speakerExternalUserId: string expected\";if(null!=e.startTime&&e.hasOwnProperty(\"startTime\")&&!(c.isInteger(e.startTime)||e.startTime&&c.isInteger(e.startTime.low)&&c.isInteger(e.startTime.high)))return\"startTime: integer|Long expected\";if(null!=e.type&&e.hasOwnProperty(\"type\"))switch(e.type){default:return\"type: enum value expected\";case 1:case 2:}return null!=e.vocabularyFilterMatch&&e.hasOwnProperty(\"vocabularyFilterMatch\")&&\"boolean\"!=typeof e.vocabularyFilterMatch?\"vocabularyFilterMatch: boolean expected\":null!=e.confidence&&e.hasOwnProperty(\"confidence\")&&\"number\"!=typeof e.confidence?\"confidence: number expected\":null!=e.stable&&e.hasOwnProperty(\"stable\")&&\"boolean\"!=typeof e.stable?\"stable: boolean expected\":null},e.fromObject=function(e){if(e instanceof d.SdkTranscriptItem)return e;var t=new d.SdkTranscriptItem;switch(null!=e.content&&(t.content=String(e.content)),null!=e.endTime&&(c.Long?(t.endTime=c.Long.fromValue(e.endTime)).unsigned=!1:\"string\"==typeof e.endTime?t.endTime=parseInt(e.endTime,10):\"number\"==typeof e.endTime?t.endTime=e.endTime:\"object\"==typeof e.endTime&&(t.endTime=new c.LongBits(e.endTime.low>>>0,e.endTime.high>>>0).toNumber())),null!=e.speakerAttendeeId&&(t.speakerAttendeeId=String(e.speakerAttendeeId)),null!=e.speakerExternalUserId&&(t.speakerExternalUserId=String(e.speakerExternalUserId)),null!=e.startTime&&(c.Long?(t.startTime=c.Long.fromValue(e.startTime)).unsigned=!1:\"string\"==typeof e.startTime?t.startTime=parseInt(e.startTime,10):\"number\"==typeof e.startTime?t.startTime=e.startTime:\"object\"==typeof e.startTime&&(t.startTime=new c.LongBits(e.startTime.low>>>0,e.startTime.high>>>0).toNumber())),e.type){case\"PRONUNCIATION\":case 1:t.type=1;break;case\"PUNCTUATION\":case 2:t.type=2}return null!=e.vocabularyFilterMatch&&(t.vocabularyFilterMatch=Boolean(e.vocabularyFilterMatch)),null!=e.confidence&&(t.confidence=Number(e.confidence)),null!=e.stable&&(t.stable=Boolean(e.stable)),t},e.toObject=function(e,t){t||(t={});var i={};if(t.defaults){if(i.content=\"\",c.Long){var n=new c.Long(0,0,!1);i.endTime=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else i.endTime=t.longs===String?\"0\":0;i.speakerAttendeeId=\"\",i.speakerExternalUserId=\"\",c.Long?(n=new c.Long(0,0,!1),i.startTime=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):i.startTime=t.longs===String?\"0\":0,i.type=t.enums===String?\"PRONUNCIATION\":1,i.vocabularyFilterMatch=!1,i.confidence=0,i.stable=!1}return null!=e.content&&e.hasOwnProperty(\"content\")&&(i.content=e.content),null!=e.endTime&&e.hasOwnProperty(\"endTime\")&&(\"number\"==typeof e.endTime?i.endTime=t.longs===String?String(e.endTime):e.endTime:i.endTime=t.longs===String?c.Long.prototype.toString.call(e.endTime):t.longs===Number?new c.LongBits(e.endTime.low>>>0,e.endTime.high>>>0).toNumber():e.endTime),null!=e.speakerAttendeeId&&e.hasOwnProperty(\"speakerAttendeeId\")&&(i.speakerAttendeeId=e.speakerAttendeeId),null!=e.speakerExternalUserId&&e.hasOwnProperty(\"speakerExternalUserId\")&&(i.speakerExternalUserId=e.speakerExternalUserId),null!=e.startTime&&e.hasOwnProperty(\"startTime\")&&(\"number\"==typeof e.startTime?i.startTime=t.longs===String?String(e.startTime):e.startTime:i.startTime=t.longs===String?c.Long.prototype.toString.call(e.startTime):t.longs===Number?new c.LongBits(e.startTime.low>>>0,e.startTime.high>>>0).toNumber():e.startTime),null!=e.type&&e.hasOwnProperty(\"type\")&&(i.type=t.enums===String?d.SdkTranscriptItem.Type[e.type]:e.type),null!=e.vocabularyFilterMatch&&e.hasOwnProperty(\"vocabularyFilterMatch\")&&(i.vocabularyFilterMatch=e.vocabularyFilterMatch),null!=e.confidence&&e.hasOwnProperty(\"confidence\")&&(i.confidence=t.json&&!isFinite(e.confidence)?String(e.confidence):e.confidence),null!=e.stable&&e.hasOwnProperty(\"stable\")&&(i.stable=e.stable),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e.Type=function(){var e={},t=Object.create(e);return t[e[1]=\"PRONUNCIATION\"]=1,t[e[2]=\"PUNCTUATION\"]=2,t}(),e}(),d.SdkTranscriptEntity=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.category=e.string();break;case 2:n.confidence=e.double();break;case 3:n.content=e.string();break;case 4:n.endTime=e.int64();break;case 5:n.startTime=e.int64();break;case 6:n.type=e.string();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.category&&e.hasOwnProperty(\"category\")&&!c.isString(e.category)?\"category: string expected\":null!=e.confidence&&e.hasOwnProperty(\"confidence\")&&\"number\"!=typeof e.confidence?\"confidence: number expected\":null!=e.content&&e.hasOwnProperty(\"content\")&&!c.isString(e.content)?\"content: string expected\":null!=e.endTime&&e.hasOwnProperty(\"endTime\")&&!(c.isInteger(e.endTime)||e.endTime&&c.isInteger(e.endTime.low)&&c.isInteger(e.endTime.high))?\"endTime: integer|Long expected\":null!=e.startTime&&e.hasOwnProperty(\"startTime\")&&!(c.isInteger(e.startTime)||e.startTime&&c.isInteger(e.startTime.low)&&c.isInteger(e.startTime.high))?\"startTime: integer|Long expected\":null!=e.type&&e.hasOwnProperty(\"type\")&&!c.isString(e.type)?\"type: string expected\":null},e.fromObject=function(e){if(e instanceof d.SdkTranscriptEntity)return e;var t=new d.SdkTranscriptEntity;return null!=e.category&&(t.category=String(e.category)),null!=e.confidence&&(t.confidence=Number(e.confidence)),null!=e.content&&(t.content=String(e.content)),null!=e.endTime&&(c.Long?(t.endTime=c.Long.fromValue(e.endTime)).unsigned=!1:\"string\"==typeof e.endTime?t.endTime=parseInt(e.endTime,10):\"number\"==typeof e.endTime?t.endTime=e.endTime:\"object\"==typeof e.endTime&&(t.endTime=new c.LongBits(e.endTime.low>>>0,e.endTime.high>>>0).toNumber())),null!=e.startTime&&(c.Long?(t.startTime=c.Long.fromValue(e.startTime)).unsigned=!1:\"string\"==typeof e.startTime?t.startTime=parseInt(e.startTime,10):\"number\"==typeof e.startTime?t.startTime=e.startTime:\"object\"==typeof e.startTime&&(t.startTime=new c.LongBits(e.startTime.low>>>0,e.startTime.high>>>0).toNumber())),null!=e.type&&(t.type=String(e.type)),t},e.toObject=function(e,t){t||(t={});var i={};if(t.defaults){if(i.category=\"\",i.confidence=0,i.content=\"\",c.Long){var n=new c.Long(0,0,!1);i.endTime=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else i.endTime=t.longs===String?\"0\":0;c.Long?(n=new c.Long(0,0,!1),i.startTime=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):i.startTime=t.longs===String?\"0\":0,i.type=\"\"}return null!=e.category&&e.hasOwnProperty(\"category\")&&(i.category=e.category),null!=e.confidence&&e.hasOwnProperty(\"confidence\")&&(i.confidence=t.json&&!isFinite(e.confidence)?String(e.confidence):e.confidence),null!=e.content&&e.hasOwnProperty(\"content\")&&(i.content=e.content),null!=e.endTime&&e.hasOwnProperty(\"endTime\")&&(\"number\"==typeof e.endTime?i.endTime=t.longs===String?String(e.endTime):e.endTime:i.endTime=t.longs===String?c.Long.prototype.toString.call(e.endTime):t.longs===Number?new c.LongBits(e.endTime.low>>>0,e.endTime.high>>>0).toNumber():e.endTime),null!=e.startTime&&e.hasOwnProperty(\"startTime\")&&(\"number\"==typeof e.startTime?i.startTime=t.longs===String?String(e.startTime):e.startTime:i.startTime=t.longs===String?c.Long.prototype.toString.call(e.startTime):t.longs===Number?new c.LongBits(e.startTime.low>>>0,e.startTime.high>>>0).toNumber():e.startTime),null!=e.type&&e.hasOwnProperty(\"type\")&&(i.type=e.type),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkTranscriptAlternative=function(){function e(e){if(this.items=[],this.entities=[],e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.items&&n.items.length||(n.items=[]),n.items.push(d.SdkTranscriptItem.decode(e,e.uint32()));break;case 2:n.transcript=e.string();break;case 3:n.entities&&n.entities.length||(n.entities=[]),n.entities.push(d.SdkTranscriptEntity.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.items&&e.hasOwnProperty(\"items\")){if(!Array.isArray(e.items))return\"items: array expected\";for(var t=0;t>>3){case 1:n.languageCode=e.string();break;case 2:n.score=e.double();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.languageCode&&e.hasOwnProperty(\"languageCode\")&&!c.isString(e.languageCode)?\"languageCode: string expected\":null!=e.score&&e.hasOwnProperty(\"score\")&&\"number\"!=typeof e.score?\"score: number expected\":null},e.fromObject=function(e){if(e instanceof d.SdkTranscriptLanguageWithScore)return e;var t=new d.SdkTranscriptLanguageWithScore;return null!=e.languageCode&&(t.languageCode=String(e.languageCode)),null!=e.score&&(t.score=Number(e.score)),t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.languageCode=\"\",i.score=0),null!=e.languageCode&&e.hasOwnProperty(\"languageCode\")&&(i.languageCode=e.languageCode),null!=e.score&&e.hasOwnProperty(\"score\")&&(i.score=t.json&&!isFinite(e.score)?String(e.score):e.score),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkTranscriptResult=function(){function e(e){if(this.alternatives=[],this.languageIdentification=[],e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.alternatives&&n.alternatives.length||(n.alternatives=[]),n.alternatives.push(d.SdkTranscriptAlternative.decode(e,e.uint32()));break;case 2:n.channelId=e.string();break;case 3:n.endTime=e.int64();break;case 4:n.isPartial=e.bool();break;case 5:n.resultId=e.string();break;case 6:n.startTime=e.int64();break;case 7:n.languageCode=e.string();break;case 8:n.languageIdentification&&n.languageIdentification.length||(n.languageIdentification=[]),n.languageIdentification.push(d.SdkTranscriptLanguageWithScore.decode(e,e.uint32()));break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.alternatives&&e.hasOwnProperty(\"alternatives\")){if(!Array.isArray(e.alternatives))return\"alternatives: array expected\";for(var t=0;t>>0,e.endTime.high>>>0).toNumber())),null!=e.isPartial&&(t.isPartial=Boolean(e.isPartial)),null!=e.resultId&&(t.resultId=String(e.resultId)),null!=e.startTime&&(c.Long?(t.startTime=c.Long.fromValue(e.startTime)).unsigned=!1:\"string\"==typeof e.startTime?t.startTime=parseInt(e.startTime,10):\"number\"==typeof e.startTime?t.startTime=e.startTime:\"object\"==typeof e.startTime&&(t.startTime=new c.LongBits(e.startTime.low>>>0,e.startTime.high>>>0).toNumber())),null!=e.languageCode&&(t.languageCode=String(e.languageCode)),e.languageIdentification){if(!Array.isArray(e.languageIdentification))throw TypeError(\".SdkTranscriptResult.languageIdentification: array expected\");for(t.languageIdentification=[],i=0;i>>0,e.endTime.high>>>0).toNumber():e.endTime),null!=e.isPartial&&e.hasOwnProperty(\"isPartial\")&&(i.isPartial=e.isPartial),null!=e.resultId&&e.hasOwnProperty(\"resultId\")&&(i.resultId=e.resultId),null!=e.startTime&&e.hasOwnProperty(\"startTime\")&&(\"number\"==typeof e.startTime?i.startTime=t.longs===String?String(e.startTime):e.startTime:i.startTime=t.longs===String?c.Long.prototype.toString.call(e.startTime):t.longs===Number?new c.LongBits(e.startTime.low>>>0,e.startTime.high>>>0).toNumber():e.startTime),null!=e.languageCode&&e.hasOwnProperty(\"languageCode\")&&(i.languageCode=e.languageCode),e.languageIdentification&&e.languageIdentification.length)for(i.languageIdentification=[],r=0;r>>3==1?(n.results&&n.results.length||(n.results=[]),n.results.push(d.SdkTranscriptResult.decode(e,e.uint32()))):e.skipType(7&r)}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.results&&e.hasOwnProperty(\"results\")){if(!Array.isArray(e.results))return\"results: array expected\";for(var t=0;t>>3){case 1:n.type=e.int32();break;case 2:n.eventTime=e.int64();break;case 3:n.transcriptionRegion=e.string();break;case 4:n.transcriptionConfiguration=e.string();break;case 5:n.message=e.string();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.type&&e.hasOwnProperty(\"type\"))switch(e.type){default:return\"type: enum value expected\";case 1:case 2:case 3:case 4:case 5:}return null!=e.eventTime&&e.hasOwnProperty(\"eventTime\")&&!(c.isInteger(e.eventTime)||e.eventTime&&c.isInteger(e.eventTime.low)&&c.isInteger(e.eventTime.high))?\"eventTime: integer|Long expected\":null!=e.transcriptionRegion&&e.hasOwnProperty(\"transcriptionRegion\")&&!c.isString(e.transcriptionRegion)?\"transcriptionRegion: string expected\":null!=e.transcriptionConfiguration&&e.hasOwnProperty(\"transcriptionConfiguration\")&&!c.isString(e.transcriptionConfiguration)?\"transcriptionConfiguration: string expected\":null!=e.message&&e.hasOwnProperty(\"message\")&&!c.isString(e.message)?\"message: string expected\":null},e.fromObject=function(e){if(e instanceof d.SdkTranscriptionStatus)return e;var t=new d.SdkTranscriptionStatus;switch(e.type){case\"STARTED\":case 1:t.type=1;break;case\"INTERRUPTED\":case 2:t.type=2;break;case\"RESUMED\":case 3:t.type=3;break;case\"STOPPED\":case 4:t.type=4;break;case\"FAILED\":case 5:t.type=5}return null!=e.eventTime&&(c.Long?(t.eventTime=c.Long.fromValue(e.eventTime)).unsigned=!1:\"string\"==typeof e.eventTime?t.eventTime=parseInt(e.eventTime,10):\"number\"==typeof e.eventTime?t.eventTime=e.eventTime:\"object\"==typeof e.eventTime&&(t.eventTime=new c.LongBits(e.eventTime.low>>>0,e.eventTime.high>>>0).toNumber())),null!=e.transcriptionRegion&&(t.transcriptionRegion=String(e.transcriptionRegion)),null!=e.transcriptionConfiguration&&(t.transcriptionConfiguration=String(e.transcriptionConfiguration)),null!=e.message&&(t.message=String(e.message)),t},e.toObject=function(e,t){t||(t={});var i={};if(t.defaults){if(i.type=t.enums===String?\"STARTED\":1,c.Long){var n=new c.Long(0,0,!1);i.eventTime=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else i.eventTime=t.longs===String?\"0\":0;i.transcriptionRegion=\"\",i.transcriptionConfiguration=\"\",i.message=\"\"}return null!=e.type&&e.hasOwnProperty(\"type\")&&(i.type=t.enums===String?d.SdkTranscriptionStatus.Type[e.type]:e.type),null!=e.eventTime&&e.hasOwnProperty(\"eventTime\")&&(\"number\"==typeof e.eventTime?i.eventTime=t.longs===String?String(e.eventTime):e.eventTime:i.eventTime=t.longs===String?c.Long.prototype.toString.call(e.eventTime):t.longs===Number?new c.LongBits(e.eventTime.low>>>0,e.eventTime.high>>>0).toNumber():e.eventTime),null!=e.transcriptionRegion&&e.hasOwnProperty(\"transcriptionRegion\")&&(i.transcriptionRegion=e.transcriptionRegion),null!=e.transcriptionConfiguration&&e.hasOwnProperty(\"transcriptionConfiguration\")&&(i.transcriptionConfiguration=e.transcriptionConfiguration),null!=e.message&&e.hasOwnProperty(\"message\")&&(i.message=e.message),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e.Type=function(){var e={},t=Object.create(e);return t[e[1]=\"STARTED\"]=1,t[e[2]=\"INTERRUPTED\"]=2,t[e[3]=\"RESUMED\"]=3,t[e[4]=\"STOPPED\"]=4,t[e[5]=\"FAILED\"]=5,t}(),e}(),d.SdkTranscriptEvent=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.status=d.SdkTranscriptionStatus.decode(e,e.uint32());break;case 2:n.transcript=d.SdkTranscript.decode(e,e.uint32());break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";var t={};if(null!=e.status&&e.hasOwnProperty(\"status\")&&(t.Event=1,i=d.SdkTranscriptionStatus.verify(e.status)))return\"status.\"+i;if(null!=e.transcript&&e.hasOwnProperty(\"transcript\")){if(1===t.Event)return\"Event: multiple values\";var i;if(t.Event=1,i=d.SdkTranscript.verify(e.transcript))return\"transcript.\"+i}return null},e.fromObject=function(e){if(e instanceof d.SdkTranscriptEvent)return e;var t=new d.SdkTranscriptEvent;if(null!=e.status){if(\"object\"!=typeof e.status)throw TypeError(\".SdkTranscriptEvent.status: object expected\");t.status=d.SdkTranscriptionStatus.fromObject(e.status)}if(null!=e.transcript){if(\"object\"!=typeof e.transcript)throw TypeError(\".SdkTranscriptEvent.transcript: object expected\");t.transcript=d.SdkTranscript.fromObject(e.transcript)}return t},e.toObject=function(e,t){t||(t={});var i={};return null!=e.status&&e.hasOwnProperty(\"status\")&&(i.status=d.SdkTranscriptionStatus.toObject(e.status,t),t.oneofs&&(i.Event=\"status\")),null!=e.transcript&&e.hasOwnProperty(\"transcript\")&&(i.transcript=d.SdkTranscript.toObject(e.transcript,t),t.oneofs&&(i.Event=\"transcript\")),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkTranscriptFrame=function(){function e(e){if(this.events=[],e)for(var t=Object.keys(e),i=0;i>>3==1?(n.events&&n.events.length||(n.events=[]),n.events.push(d.SdkTranscriptEvent.decode(e,e.uint32()))):e.skipType(7&r)}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.events&&e.hasOwnProperty(\"events\")){if(!Array.isArray(e.events))return\"events: array expected\";for(var t=0;t>>3){case 1:n.addedOrUpdatedVideoSubscriptions&&n.addedOrUpdatedVideoSubscriptions.length||(n.addedOrUpdatedVideoSubscriptions=[]),n.addedOrUpdatedVideoSubscriptions.push(d.SdkVideoSubscriptionConfiguration.decode(e,e.uint32()));break;case 2:n.removedVideoSubscriptionMids&&n.removedVideoSubscriptionMids.length||(n.removedVideoSubscriptionMids=[]),n.removedVideoSubscriptionMids.push(e.string());break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.addedOrUpdatedVideoSubscriptions&&e.hasOwnProperty(\"addedOrUpdatedVideoSubscriptions\")){if(!Array.isArray(e.addedOrUpdatedVideoSubscriptions))return\"addedOrUpdatedVideoSubscriptions: array expected\";for(var t=0;t>>3){case 1:n.mid=e.string();break;case 2:n.attendeeId=e.string();break;case 3:n.streamId=e.uint32();break;case 4:n.priority=e.uint32();break;case 5:n.targetBitrateKbps=e.uint32();break;case 6:n.groupId=e.uint32();break;default:e.skipType(7&r)}}if(!n.hasOwnProperty(\"mid\"))throw c.ProtocolError(\"missing required 'mid'\",{instance:n});return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":c.isString(e.mid)?null!=e.attendeeId&&e.hasOwnProperty(\"attendeeId\")&&!c.isString(e.attendeeId)?\"attendeeId: string expected\":null!=e.streamId&&e.hasOwnProperty(\"streamId\")&&!c.isInteger(e.streamId)?\"streamId: integer expected\":null!=e.priority&&e.hasOwnProperty(\"priority\")&&!c.isInteger(e.priority)?\"priority: integer expected\":null!=e.targetBitrateKbps&&e.hasOwnProperty(\"targetBitrateKbps\")&&!c.isInteger(e.targetBitrateKbps)?\"targetBitrateKbps: integer expected\":null!=e.groupId&&e.hasOwnProperty(\"groupId\")&&!c.isInteger(e.groupId)?\"groupId: integer expected\":null:\"mid: string expected\"},e.fromObject=function(e){if(e instanceof d.SdkVideoSubscriptionConfiguration)return e;var t=new d.SdkVideoSubscriptionConfiguration;return null!=e.mid&&(t.mid=String(e.mid)),null!=e.attendeeId&&(t.attendeeId=String(e.attendeeId)),null!=e.streamId&&(t.streamId=e.streamId>>>0),null!=e.priority&&(t.priority=e.priority>>>0),null!=e.targetBitrateKbps&&(t.targetBitrateKbps=e.targetBitrateKbps>>>0),null!=e.groupId&&(t.groupId=e.groupId>>>0),t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.mid=\"\",i.attendeeId=\"\",i.streamId=0,i.priority=0,i.targetBitrateKbps=0,i.groupId=0),null!=e.mid&&e.hasOwnProperty(\"mid\")&&(i.mid=e.mid),null!=e.attendeeId&&e.hasOwnProperty(\"attendeeId\")&&(i.attendeeId=e.attendeeId),null!=e.streamId&&e.hasOwnProperty(\"streamId\")&&(i.streamId=e.streamId),null!=e.priority&&e.hasOwnProperty(\"priority\")&&(i.priority=e.priority),null!=e.targetBitrateKbps&&e.hasOwnProperty(\"targetBitrateKbps\")&&(i.targetBitrateKbps=e.targetBitrateKbps),null!=e.groupId&&e.hasOwnProperty(\"groupId\")&&(i.groupId=e.groupId),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkPrimaryMeetingJoinFrame=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3==1?n.credentials=d.SdkMeetingSessionCredentials.decode(e,e.uint32()):e.skipType(7&r)}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){if(\"object\"!=typeof e||null===e)return\"object expected\";if(null!=e.credentials&&e.hasOwnProperty(\"credentials\")){var t=d.SdkMeetingSessionCredentials.verify(e.credentials);if(t)return\"credentials.\"+t}return null},e.fromObject=function(e){if(e instanceof d.SdkPrimaryMeetingJoinFrame)return e;var t=new d.SdkPrimaryMeetingJoinFrame;if(null!=e.credentials){if(\"object\"!=typeof e.credentials)throw TypeError(\".SdkPrimaryMeetingJoinFrame.credentials: object expected\");t.credentials=d.SdkMeetingSessionCredentials.fromObject(e.credentials)}return t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.credentials=null),null!=e.credentials&&e.hasOwnProperty(\"credentials\")&&(i.credentials=d.SdkMeetingSessionCredentials.toObject(e.credentials,t)),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkPrimaryMeetingJoinAckFrame=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i>>3){case 1:n.attendeeId=e.string();break;case 2:n.externalUserId=e.string();break;case 3:n.joinToken=e.string();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},e.verify=function(e){return\"object\"!=typeof e||null===e?\"object expected\":null!=e.attendeeId&&e.hasOwnProperty(\"attendeeId\")&&!c.isString(e.attendeeId)?\"attendeeId: string expected\":null!=e.externalUserId&&e.hasOwnProperty(\"externalUserId\")&&!c.isString(e.externalUserId)?\"externalUserId: string expected\":null!=e.joinToken&&e.hasOwnProperty(\"joinToken\")&&!c.isString(e.joinToken)?\"joinToken: string expected\":null},e.fromObject=function(e){if(e instanceof d.SdkMeetingSessionCredentials)return e;var t=new d.SdkMeetingSessionCredentials;return null!=e.attendeeId&&(t.attendeeId=String(e.attendeeId)),null!=e.externalUserId&&(t.externalUserId=String(e.externalUserId)),null!=e.joinToken&&(t.joinToken=String(e.joinToken)),t},e.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.attendeeId=\"\",i.externalUserId=\"\",i.joinToken=\"\"),null!=e.attendeeId&&e.hasOwnProperty(\"attendeeId\")&&(i.attendeeId=e.attendeeId),null!=e.externalUserId&&e.hasOwnProperty(\"externalUserId\")&&(i.externalUserId=e.externalUserId),null!=e.joinToken&&e.hasOwnProperty(\"joinToken\")&&(i.joinToken=e.joinToken),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),d.SdkVideoCodecCapability=function(){var e={},t=Object.create(e);return t[e[1]=\"VP8\"]=1,t[e[3]=\"H264_CONSTRAINED_BASELINE_PROFILE\"]=3,t}(),e.exports=d,c.Long=void 0,s.configure()},334:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(1938),s=i(3538),o=i(4046);t.default=class{constructor(e){this.chimeClient=e}makeTwoDigits(e){return e>9?e.toString():\"0\"+e.toString()}hmac(e,t){const i=new r.Sha256(t);return i.update(e),i.digest()}getDateTimeString(){const e=new Date;return e.getUTCFullYear()+this.makeTwoDigits(e.getUTCMonth()+1)+this.makeTwoDigits(e.getUTCDate())+\"T\"+this.makeTwoDigits(e.getUTCHours())+this.makeTwoDigits(e.getUTCMinutes())+this.makeTwoDigits(e.getUTCSeconds())+\"Z\"}getDateString(e){return e.substring(0,e.indexOf(\"T\"))}getSignatureKey(e,t,i,r){return n(this,void 0,void 0,(function*(){const n=yield this.hmac(t,\"AWS4\"+e),s=yield this.hmac(i,n),o=yield this.hmac(r,s);return yield this.hmac(\"aws4_request\",o)}))}signURL(e,t,i,r,a,c,d){return n(this,void 0,void 0,(function*(){const n=this.getDateTimeString(),l=this.getDateString(n);let u=\"\";u=this.chimeClient.config.region instanceof Function?yield this.chimeClient.config.region():this.chimeClient.config.region;const h=\"host:\"+r.toLowerCase()+\"\\n\",p=l+\"/\"+u+\"/\"+i+\"/aws4_request\";let m;m=this.chimeClient.config.credentials instanceof Function?yield this.chimeClient.config.credentials():this.chimeClient.config.credentials;let f=new Map;f.set(\"X-Amz-Algorithm\",[\"AWS4-HMAC-SHA256\"]),f.set(\"X-Amz-Credential\",[encodeURIComponent(m.accessKeyId+\"/\"+p)]),f.set(\"X-Amz-Date\",[n]),f.set(\"X-Amz-Expires\",[\"10\"]),f.set(\"X-Amz-SignedHeaders\",[\"host\"]),m.sessionToken&&f.set(\"X-Amz-Security-Token\",[encodeURIComponent(m.sessionToken)]),f.set(o.default.X_AMZN_VERSION,[encodeURIComponent(o.default.sdkVersion)]),f.set(o.default.X_AMZN_USER_AGENT,[encodeURIComponent(o.default.sdkUserAgentLowResolution)]),null==d||d.forEach(((e,t)=>{const i=encodeURIComponent(t);e.sort().forEach((e=>{f.has(i)||f.set(i,[]),f.get(i).push(encodeURIComponent(e))}))}));let g=\"\";f=new Map([...f.entries()].sort()),f.forEach(((e,t)=>{e.forEach((e=>{g.length&&(g+=\"&\"),g+=t+\"=\"+e}))}));const v=e+\"\\n\"+a+\"\\n\"+g+\"\\n\"+h+\"\\nhost\\n\"+s.toHex(yield this.hmac(c)),S=s.toHex(yield this.hmac(v)),b=\"AWS4-HMAC-SHA256\\n\"+n+\"\\n\"+l+\"/\"+u+\"/\"+i+\"/aws4_request\\n\"+S,y=yield this.getSignatureKey(m.secretAccessKey,l,u,i),w=s.toHex(yield this.hmac(b,y));return t+\"://\"+r+a+\"?\"+g+\"&X-Amz-Signature=\"+w}))}}},7606:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.SimulcastLayers=void 0,function(e){e[e.Low=0]=\"Low\",e[e.LowAndMedium=1]=\"LowAndMedium\",e[e.LowAndHigh=2]=\"LowAndHigh\",e[e.Medium=3]=\"Medium\",e[e.MediumAndHigh=4]=\"MediumAndHigh\",e[e.High=5]=\"High\"}(i=t.SimulcastLayers||(t.SimulcastLayers={})),t.default=i},9880:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.AudioLogEvent=void 0,function(e){e[e.DeviceChanged=0]=\"DeviceChanged\",e[e.MutedLocal=1]=\"MutedLocal\",e[e.UnmutedLocal=2]=\"UnmutedLocal\",e[e.Connected=3]=\"Connected\",e[e.ConnectFailed=4]=\"ConnectFailed\",e[e.RedmicStartLoss=5]=\"RedmicStartLoss\",e[e.RedmicEndLoss=6]=\"RedmicEndLoss\"}(i=t.AudioLogEvent||(t.AudioLogEvent={})),t.default=i},8597:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(4571),s=i(6196),o=i(9496),a=i(2811),c=i(7604),d=i(1296),l=i(3922),u=i(289),h=i(8660),p=i(9880),m=i(155);class f{constructor(e,t,i=f.INTERVAL_MS){this.audioVideoController=e,this.logger=t,this.interval=i,this.intervalScheduler=null,this.metricsAddTime=(e,t,i)=>{},this.metricsLogEvent=(e,t)=>{}}toAttribute(e){return this.toSuffix(e).substring(1)}toSuffix(e){return e.toLowerCase()===e?`_${e}`:e.toUpperCase()===e?`_${e.toLowerCase()}`:e.replace(/([A-Z][a-z]+)/g,(function(e){return`_${e}`})).replace(/([A-Z][A-Z]+)/g,(function(e){return`_${e}`})).toLowerCase()}logLatency(e,t,i){const n=this.toSuffix(e);this.logEventTime(\"meeting\"+n,t,i)}logStateTimeout(e,t){const i=this.toSuffix(e);this.logEvent(\"meeting_session_state_timeout\",Object.assign(Object.assign({},t),{state:`state${i}`}))}logAudioEvent(e,t){const i=\"audio\"+this.toSuffix(p.default[e]);this.logEvent(i,t)}logVideoEvent(e,t){const i=\"video\"+this.toSuffix(m.default[e]);this.logEvent(i,t)}logEventTime(e,t,i={}){const n=Object.assign(Object.assign({},i),{call_id:this.audioVideoController.configuration.meetingId,client_type:f.CLIENT_TYPE,metric_type:\"latency\"});this.logger.debug((()=>`[StatsCollector] ${e}: ${JSON.stringify(n)}`)),this.metricsAddTime(e,t,n)}logMeetingSessionStatus(e){const t=`${e.statusCode()}`;this.logEvent(t);const i={status:t,status_code:`${e.statusCode()}`};this.logEvent(\"meeting_session_status\",i),e.isTerminal()&&this.logEvent(\"meeting_session_stopped\",i),e.isAudioConnectionFailure()&&this.logEvent(\"meeting_session_audio_failed\",i),e.isFailure()&&this.logEvent(\"meeting_session_failed\",i)}logLifecycleEvent(e,t){const i={lifecycle_event:`lifecycle${this.toSuffix(c.default[e])}`,lifecycle_event_code:`${e}`,lifecycle_event_condition:`condition${this.toSuffix(d.default[t])}`,lifecycle_event_condition_code:`${t}`};this.logEvent(\"meeting_session_lifecycle\",i)}logEvent(e,t={}){const i=Object.assign(Object.assign({},t),{call_id:this.audioVideoController.configuration.meetingId,client_type:f.CLIENT_TYPE});this.logger.debug((()=>`[StatsCollector] ${e}: ${JSON.stringify(i)}`)),this.metricsLogEvent(e,i)}start(e,t){return!this.intervalScheduler&&(this.logger.info(\"Starting StatsCollector\"),this.signalingClient=e,this.videoStreamIndex=t,this.clientMetricReport=new r.default(this.logger,this.videoStreamIndex,this.audioVideoController.configuration.credentials.attendeeId),this.intervalScheduler=new l.default(this.interval),this.intervalScheduler.start((()=>n(this,void 0,void 0,(function*(){yield this.getStatsWrapper()})))),!0)}stop(){this.logger.info(\"Stopping StatsCollector\"),this.intervalScheduler&&this.intervalScheduler.stop(),this.intervalScheduler=null}updateMetricValues(e,t){const i=t?this.clientMetricReport.streamMetricReports[Number(e.ssrc)]:this.clientMetricReport.globalMetricReport;let n;n=t?this.clientMetricReport.getMetricMap(i.mediaType,i.direction):this.clientMetricReport.getMetricMap();for(const t in e)t in n&&(\"number\"==typeof e[t]?(i.previousMetrics[t]=i.currentMetrics[t],i.currentMetrics[t]=e[t]):\"string\"==typeof e[t]?i.currentStringMetrics[t]=e[t]:this.logger.error(`Unknown metric value type ${typeof e[t]} for metric ${t}`))}processRawMetricReports(e){this.clientMetricReport.currentSsrcs={};const t=Date.now();for(const t of e){const e=this.isStreamRawMetricReport(t.type);if(e){const e=this.clientMetricReport.streamMetricReports[Number(t.ssrc)];if(e)e.streamId=this.videoStreamIndex.streamIdForSSRC(Number(t.ssrc));else{const e=new a.default;e.mediaType=this.getMediaType(t),e.direction=this.getDirectionType(t),this.videoStreamIndex.allStreams().empty()||(e.streamId=this.videoStreamIndex.streamIdForSSRC(Number(t.ssrc)),void 0!==this.videoStreamIndex.groupIdForSSRC&&(e.groupId=this.videoStreamIndex.groupIdForSSRC(Number(t.ssrc)))),this.clientMetricReport.streamMetricReports[Number(t.ssrc)]=e}this.clientMetricReport.currentSsrcs[Number(t.ssrc)]=1}this.updateMetricValues(t,e)}this.clientMetricReport.removeDestroyedSsrcs(),this.clientMetricReport.previousTimestampMs=this.clientMetricReport.currentTimestampMs,this.clientMetricReport.currentTimestampMs=t,this.clientMetricReport.print()}addStreamMetricDimensionFrames(e,t){const i=this.clientMetricReport.getStreamDimensionMap();for(const n in t.currentStringMetrics)if(n in i){const r=u.SdkStreamDimension.create();r.type=i[n];const s=u.SdkDimensionValue.create();s.stringValue=t.currentStringMetrics[n],r.value=s,e.dimensions.push(r)}}addMetricFrame(e,t,i,n){const r=i.type,s=i.transform,o=i.source,a=t.streamMetricFrames.length,c=t.streamMetricFrames[a-1];if(r){const i=u.SdkMetric.create();i.type=r,i.value=s(o||e,n),n?c.metrics.push(i):t.globalMetrics.push(i)}}addGlobalMetricsToProtobuf(e){const t=this.clientMetricReport.getMetricMap();for(const i in this.clientMetricReport.globalMetricReport.currentMetrics)this.addMetricFrame(i,e,t[i])}addStreamMetricsToProtobuf(e){for(const t in this.clientMetricReport.streamMetricReports){const i=this.clientMetricReport.streamMetricReports[t],n=u.SdkStreamMetricFrame.create();n.streamId=i.streamId,n.metrics=[],this.addStreamMetricDimensionFrames(n,i),e.streamMetricFrames.push(n);const r=this.clientMetricReport.getMetricMap(i.mediaType,i.direction);for(const n in i.currentMetrics)this.addMetricFrame(n,e,r[n],Number(t));for(const n in i.currentStringMetrics)this.addMetricFrame(n,e,r[n],Number(t))}}makeClientMetricProtobuf(){const e=u.SdkClientMetricFrame.create();return e.globalMetrics=[],e.streamMetricFrames=[],this.addGlobalMetricsToProtobuf(e),this.addStreamMetricsToProtobuf(e),e}sendClientMetricProtobuf(e){this.signalingClient.sendClientMetrics(e)}isStreamRawMetricReport(e){return[\"inbound-rtp\",\"outbound-rtp\",\"remote-inbound-rtp\",\"remote-outbound-rtp\"].includes(e)}getMediaType(e){return\"audio\"===e.kind?o.default.AUDIO:o.default.VIDEO}getDirectionType(e){const{type:t}=e;return\"inbound-rtp\"===t||\"remote-outbound-rtp\"===t?s.default.DOWNSTREAM:s.default.UPSTREAM}isValidStandardRawMetric(e){return\"inbound-rtp\"===e.type||\"outbound-rtp\"===e.type||\"remote-inbound-rtp\"===e.type||\"remote-outbound-rtp\"===e.type||\"candidate-pair\"===e.type&&\"succeeded\"===e.state}isValidSsrc(e){let t=!0;return this.isStreamRawMetricReport(e.type)&&this.getDirectionType(e)===s.default.DOWNSTREAM&&this.getMediaType(e)===o.default.VIDEO&&(t=this.videoStreamIndex.streamIdForSSRC(Number(e.ssrc))>0),t}isValidRawMetricReport(e){return this.isValidStandardRawMetric(e)&&this.isValidSsrc(e)}filterRawMetricReports(e){const t=[];for(const i of e)this.isValidRawMetricReport(i)&&t.push(i);return t}handleRawMetricReports(e){const t=this.filterRawMetricReports(e);this.logger.debug((()=>`Filtered raw metrics : ${JSON.stringify(t)}`)),this.processRawMetricReports(t);const i=this.makeClientMetricProtobuf();this.sendClientMetricProtobuf(i),this.audioVideoController.forEachObserver((e=>{h.Maybe.of(e.metricsDidReceive).map((t=>t.bind(e)(this.clientMetricReport.clone())))}))}getStatsWrapper(){return n(this,void 0,void 0,(function*(){if(!this.audioVideoController.rtcPeerConnection)return;const e=[];try{const t=yield this.audioVideoController.rtcPeerConnection.getStats();this.clientMetricReport.rtcStatsReport=t,t.forEach((t=>{e.push(t)})),this.handleRawMetricReports(e)}catch(e){this.logger.error(e.message)}}))}overrideObservableMetric(e,t){this.clientMetricReport.overrideObservableMetric(e,t)}}t.default=f,f.INTERVAL_MS=1e3,f.CLIENT_TYPE=\"amazon-chime-sdk-js\"},155:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.VideoLogEvent=void 0,function(e){e[e.InputAttached=0]=\"InputAttached\",e[e.SendingFailed=1]=\"SendingFailed\",e[e.SendingSuccess=2]=\"SendingSuccess\"}(i=t.VideoLogEvent||(t.VideoLogEvent={})),t.default=i},8358:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(155),s=i(1789);class o extends s.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"AttachMediaInputTask\"}run(){return n(this,void 0,void 0,(function*(){const e=this.context.transceiverController;e.setPeer(this.context.peer),e.setupLocalTransceivers();const t=this.context.activeAudioInput;if(t){const i=t.getAudioTracks();this.context.logger.info(\"attaching audio track to peer connection\"),yield e.setAudioInput(i.length?i[0]:null)}else yield e.setAudioInput(null),this.context.logger.info(\"no audio track\");const i=this.context.activeVideoInput;if(i){const t=i.getVideoTracks(),n=t.length?t[0]:null;if(this.context.logger.info(\"attaching video track to peer connection\"),yield e.setVideoInput(n),this.context.enableSimulcast&&this.context.videoUplinkBandwidthPolicy){const t=this.context.videoUplinkBandwidthPolicy.chooseEncodingParameters();e.setEncodingParameters(t)}n&&this.context.statsCollector.logVideoEvent(r.default.InputAttached,this.context.videoDeviceInformation)}else yield e.setVideoInput(null),this.context.logger.info(\"no video track\");this.context.videoSubscriptions=e.updateVideoTransceivers(this.context.videoStreamIndex,this.context.videosToReceive)}))}}t.default=o},1789:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(1124),s=i(4456);t.default=class{constructor(e){this.logger=e,this.taskName=\"BaseTask\",this.parentTask=null,this.status=s.default.IDLE,this.run=this.baseRun.bind(this,this.run),this.cancel=this.baseCancel.bind(this,this.cancel)}once(...e){return new r.default(this.logger,this,e)}cancel(){}name(){return this.parentTask?`${this.parentTask.name()}/${this.taskName}`:this.taskName}setParent(e){this.parentTask=e}getStatus(){return this.status}logAndThrow(e){throw this.logger.info(e),new Error(e)}baseRun(e){return n(this,void 0,void 0,(function*(){try{const t=Date.now();switch(this.logger.info(`running task ${this.name()}`),this.status){case s.default.RUNNING:this.logAndThrow(`${this.name()} is already running`);case s.default.CANCELED:this.logAndThrow(`${this.name()} was canceled before running`);case s.default.FINISHED:this.logAndThrow(`${this.name()} was already finished`)}this.status=s.default.RUNNING,yield e.call(this),this.logger.info(`${this.name()} took ${Math.round(Date.now()-t)} ms`)}catch(e){throw e}finally{this.status!==s.default.CANCELED&&(this.status=s.default.FINISHED)}}))}baseCancel(e){this.status!==s.default.CANCELED&&this.status!==s.default.FINISHED?(this.logger.info(`canceling task ${this.name()}`),this.status=s.default.CANCELED,e.call(this)):this.logger.info(`Not canceling ${this.name()}: state is ${this.status}`)}}},3216:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(1789);class s extends r.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"CleanRestartedSessionTask\"}run(){return n(this,void 0,void 0,(function*(){this.context.resetConnectionSpecificState()}))}}t.default=s},7408:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(9416),s=i(1789);class o extends s.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"CleanStoppedSessionTask\",this.taskCanceler=null}cancel(){this.taskCanceler&&(this.taskCanceler.cancel(),this.taskCanceler=null)}run(){return n(this,void 0,void 0,(function*(){try{this.context.signalingClient.ready()&&(this.context.signalingClient.closeConnection(),yield this.receiveWebSocketClosedEvent())}catch(e){throw e}finally{for(const e of this.context.removableObservers)e.removeObserver();this.context.resetConnectionSpecificState(),this.context.statsCollector.stop(),this.context.statsCollector=null,this.context.connectionMonitor.stop(),this.context.connectionMonitor=null,this.context.videoUplinkBandwidthPolicy.setTransceiverController&&this.context.videoUplinkBandwidthPolicy.setTransceiverController(void 0),this.context.videoDownlinkBandwidthPolicy.bindToTileController&&this.context.videoDownlinkBandwidthPolicy.bindToTileController(void 0);const e=this.context.videoTileController.getLocalVideoTile();e&&e.bindVideoStream(\"\",!0,null,null,null,null),this.context.videoTileController.removeAllVideoTiles()}}))}receiveWebSocketClosedEvent(){return new Promise(((e,t)=>{const i=new class{constructor(e){this.signalingClient=e}cancel(){this.signalingClient.removeObserver(this),t(new Error(\"CleanStoppedSessionTask got canceled while waiting for the WebSocket closed event\"))}handleSignalingClientEvent(t){t.type===r.default.WebSocketClosed&&(this.signalingClient.removeObserver(this),e())}}(this.context.signalingClient);this.taskCanceler=i,this.context.signalingClient.registerObserver(i)}))}}t.default=o},5054:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(1789);class s extends r.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"CreatePeerConnectionTask\",this.removeTrackAddedEventListener=null,this.removeTrackRemovedEventListeners={},this.trackEvents=[\"ended\",\"mute\",\"unmute\",\"isolationchange\",\"overconstrained\"],this.removeVideoTrackEventListeners={},this.trackAddedHandler=e=>{const t=e.track;if(this.context.logger.info(`received track event: kind=${t.kind} id=${t.id} label=${t.label}`),e.transceiver&&\"inactive\"===e.transceiver.currentDirection)return;if(0===e.streams.length)return void this.context.logger.warn(\"Track event but no stream\");const i=e.streams[0];\"audio\"===t.kind?this.context.audioMixController.bindAudioStream(i):\"video\"!==t.kind||this.trackIsVideoInput(t)||this.addRemoteVideoTrack(t,i)}}removeObserver(){this.removeTrackAddedEventListener&&this.removeTrackAddedEventListener();for(const e in this.removeTrackRemovedEventListeners)this.removeTrackRemovedEventListeners[e]()}addPeerConnectionEventLogger(){const e=this.context.peer;e.addEventListener(\"connectionstatechange\",(()=>{this.context.logger.info(`peer connection state changed: ${e.connectionState}`)})),e.addEventListener(\"negotiationneeded\",(()=>{this.context.logger.info(\"peer connection negotiation is needed\")})),e.addEventListener(\"icegatheringstatechange\",(()=>{this.context.logger.info(`peer connection ice gathering state changed: ${e.iceGatheringState}`)})),e.addEventListener(\"icecandidate\",(e=>{this.context.logger.info(`peer connection ice candidate: ${e.candidate?e.candidate.candidate:\"(null)\"}`)})),e.addEventListener(\"iceconnectionstatechange\",(()=>{this.context.logger.info(`peer connection ice connection state changed: ${e.iceConnectionState}`)}))}run(){return n(this,void 0,void 0,(function*(){this.context.removableObservers.push(this);const e=this.context.turnCredentials&&this.context.turnCredentials.uris.length>0?{iceServers:[{urls:this.context.turnCredentials.uris,username:this.context.turnCredentials.username,credential:this.context.turnCredentials.password,credentialType:\"password\"}],iceTransportPolicy:\"relay\"}:{};e.bundlePolicy=this.context.browserBehavior.requiresBundlePolicy(),e.sdpSemantics=\"unified-plan\",this.context.peer?this.context.logger.info(\"reusing peer connection\"):(this.context.logger.info(\"creating new peer connection\"),this.context.peer=new RTCPeerConnection(e),this.addPeerConnectionEventLogger()),this.removeTrackAddedEventListener=()=>{this.context.peer&&this.context.peer.removeEventListener(\"track\",this.trackAddedHandler),this.removeTrackAddedEventListener=null},this.context.peer.addEventListener(\"track\",this.trackAddedHandler)}))}trackIsVideoInput(e){return!!this.context.transceiverController.useTransceivers()&&(this.logger.debug((()=>\"getting video track type\")),this.context.transceiverController.trackIsVideoInput(e))}addRemoteVideoTrack(e,t){var i;const n=t.id,r=this.context.videoStreamIndex.attendeeIdForTrack(n);let s,o;if(this.context.videoTileController.getVideoTileForAttendeeId?(o=this.context.videoTileController.getVideoTileForAttendeeId(r),s=!!(null===(i=null==o?void 0:o.state())||void 0===i?void 0:i.boundVideoStream)):s=this.context.videoTileController.haveVideoTileForAttendeeId(r),s)return void this.context.logger.info(`Not adding remote track. Already have tile for attendeeId: ${r}`);o||(o=this.context.videoTileController.addVideoTile(),this.logger.info(`Created video tile ${o.id()}`));let a,c,d=this.context.videoStreamIndex.streamIdForTrack(n);void 0===d&&(this.logger.warn(`stream not found for tile=${o.id()} track=${n}`),d=null);for(let i=0;i{this.context.logger.info(`received the ${n} event for tile=${o.id()} id=${e.id} streamId=${d}`),\"ended\"===n&&this.removeRemoteVideoTrack(e,o.state())};t.addEventListener(n,i),this.removeVideoTrackEventListeners[e.id]||(this.removeVideoTrackEventListeners[e.id]=[]),this.removeVideoTrackEventListeners[e.id].push((()=>{t.removeEventListener(n,i)}))}}if(e.getSettings){const t=e.getSettings();a=t.width,c=t.height}else{const t=e.getCapabilities();a=t.width,c=t.height}const l=this.context.videoStreamIndex.externalUserIdForTrack(n);o.bindVideoStream(r,!1,t,a,c,d,l),this.logger.info(`video track added, use tile=${o.id()} track=${n} streamId=${d}`);const u=\"removetrack\",h=t,p=()=>this.removeRemoteVideoTrack(e,o.state());this.removeTrackRemovedEventListeners[e.id]=()=>{h.removeEventListener(u,p),delete this.removeTrackRemovedEventListeners[e.id]},h.addEventListener(u,p)}removeRemoteVideoTrack(e,t){if(this.removeTrackRemovedEventListeners.hasOwnProperty(e.id)){this.removeTrackRemovedEventListeners[e.id]();for(const t of this.removeVideoTrackEventListeners[e.id])t();delete this.removeVideoTrackEventListeners[e.id]}this.logger.info(`video track ended, removing tile=${t.tileId} id=${e.id} stream=${t.streamId}`),t.streamId?this.context.videosPaused.remove(t.streamId):this.logger.warn(`no stream found for tile=${t.tileId}`),this.context.videoTileController.removeVideoTile(t.tileId)}}t.default=s,s.REMOVE_HANDLER_INTERVAL_MS=1e4},1129:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(5687),s=i(326),o=i(1789);class a extends o.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"CreateSDPTask\"}cancel(){if(this.cancelPromise){const e=new Error(`canceling ${this.name()}`);this.cancelPromise(e),delete this.cancelPromise}}sessionUsesAudio(){var e,t;return!!(null===(t=null===(e=this.context.meetingSessionConfiguration)||void 0===e?void 0:e.urls)||void 0===t?void 0:t.audioHostURL)}sessionUsesVideo(){let e;e=this.context.transceiverController.useTransceivers()?this.context.transceiverController.hasVideoInput():this.context.videoTileController.hasStartedLocalVideoTile();const t=!!this.context.videosToReceive&&!this.context.videosToReceive.empty(),i=e||t;return this.context.logger.info(`uses video: ${i} (enabled: true, sending: ${e}, receiving: ${t})`),i}run(){return n(this,void 0,void 0,(function*(){const e={offerToReceiveAudio:this.sessionUsesAudio(),offerToReceiveVideo:this.sessionUsesVideo()};this.logger.info(`peer connection offerOptions: ${JSON.stringify(e)}`),yield new Promise(((t,i)=>n(this,void 0,void 0,(function*(){this.cancelPromise=e=>{i(e)};try{if(this.context.sdpOfferInit=yield this.context.peer.createOffer(e),this.context.logger.info(\"peer connection created offer\"),this.context.previousSdpOffer&&new s.default(this.context.sdpOfferInit.sdp).videoSendSectionHasDifferentSSRC(this.context.previousSdpOffer)){const e=new Error(`canceling ${this.name()} due to the meeting status code: ${r.default.IncompatibleSDP}`);return this.context.previousSdpOffer=null,void i(e)}t()}catch(e){i(e)}finally{delete this.cancelPromise}}))))}))}}t.default=a},6240:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(5687),s=i(326),o=i(1789);class a extends o.default{constructor(e,t=a.CHROME_VPN_TIMEOUT_MS){super(e.logger),this.context=e,this.chromeVpnTimeoutMs=t,this.taskName=\"FinishGatheringICECandidatesTask\"}removeEventListener(){this.context.peer&&(this.context.peer.removeEventListener(\"icecandidate\",this.context.iceCandidateHandler),this.context.turnCredentials||this.context.peer.removeEventListener(\"icegatheringstatechange\",this.context.iceGatheringStateEventHandler))}cancel(){let e;this.context.browserBehavior.requiresIceCandidateGatheringTimeoutWorkaround()&&this.chromeVpnTimeoutMsthis.chromeVpnTimeoutMs&&(e=new Error(`canceling ${this.name()} due to the meeting status code: ${r.default.ICEGatheringTimeoutWorkaround}`)),this.cancelPromise&&(e=e||new Error(`canceling ${this.name()}`),this.cancelPromise(e),delete this.cancelPromise)}run(){return n(this,void 0,void 0,(function*(){if(this.context.peer||this.logAndThrow(\"session does not have peer connection; bypass ice gathering\"),this.context.browserBehavior.requiresCheckForSdpConnectionAttributes()){if(new s.default(this.context.peer.localDescription.sdp).hasCandidatesForAllMLines())return void this.context.logger.info(`ice gathering already complete; bypass gathering, current local description ${this.context.peer.localDescription.sdp}`)}else this.context.logger.info(`iOS device does not require checking for connection attributes in SDP, current local description ${this.context.peer.localDescription.sdp}`);if(!this.context.browserBehavior.hasFirefoxWebRTC()&&\"complete\"!==this.context.peer.iceGatheringState||!new s.default(this.context.peer.localDescription.sdp).hasCandidates())try{yield new Promise(((e,t)=>{this.cancelPromise=e=>{this.removeEventListener(),t(e)},this.context.turnCredentials||(this.context.iceGatheringStateEventHandler=()=>{if(\"complete\"===this.context.peer.iceGatheringState)return this.removeEventListener(),e(),void delete this.cancelPromise},this.context.peer.addEventListener(\"icegatheringstatechange\",this.context.iceGatheringStateEventHandler)),this.context.iceCandidateHandler=i=>{if(this.context.logger.info(`ice candidate: ${i.candidate?i.candidate.candidate:\"(null)\"} state: ${this.context.peer.iceGatheringState}`),i.candidate&&(s.default.isRTPCandidate(i.candidate.candidate)&&this.context.iceCandidates.push(i.candidate),this.context.turnCredentials&&this.context.iceCandidates.length>=1))return this.context.logger.info(\"gathered at least one relay candidate\"),this.removeEventListener(),e(),void delete this.cancelPromise;\"complete\"===this.context.peer.iceGatheringState&&(this.context.logger.info(\"done gathering ice candidates\"),this.removeEventListener(),new s.default(this.context.peer.localDescription.sdp).hasCandidates()&&0!==this.context.iceCandidates.length?(e(),delete this.cancelPromise):(t(new Error(\"no ice candidates were gathered\")),delete this.cancelPromise))},this.context.peer.addEventListener(\"icecandidate\",this.context.iceCandidateHandler),this.startTimestampMs=Date.now()}))}catch(e){throw e}finally{this.startTimestampMs&&(this.context.iceGatheringDurationMs=Math.round(Date.now()-this.startTimestampMs))}else this.context.logger.info(\"ice gathering state is complete and candidates are in SDP; bypass gathering\")}))}}t.default=a,a.CHROME_VPN_TIMEOUT_MS=5e3},1960:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(3789),s=i(5687),o=i(7215),a=i(7103),c=i(9416),d=i(2168),l=i(289),u=i(1789);class h extends u.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"JoinAndReceiveIndexTask\",this.taskCanceler=null}cancel(){this.taskCanceler&&(this.taskCanceler.cancel(),this.taskCanceler=null)}run(){return n(this,void 0,void 0,(function*(){const e=yield new Promise(((e,t)=>{const i=this.context;i.turnCredentials=null;const n=new class{constructor(e){this.signalingClient=e}cancel(){this.signalingClient.removeObserver(this),t(new Error(\"JoinAndReceiveIndexTask got canceled while waiting for SdkIndexFrame\"))}handleSignalingClientEvent(t){if(t.type===c.default.WebSocketClosed){let e=`The signaling connection was closed with code ${t.closeCode} and reason: ${t.closeReason}`;i.logger.warn(e);let n=s.default.SignalingBadRequest;return 4410===t.closeCode?(e=\"The meeting already ended.\",i.logger.warn(e),n=s.default.MeetingEnded):t.closeCode>=4500&&t.closeCode<4600&&(n=s.default.SignalingInternalServerError),void i.audioVideoController.handleMeetingSessionStatus(new r.default(n),new Error(e))}if(t.type!==c.default.ReceivedSignalFrame)return;if(t.message.type===l.SdkSignalFrame.Type.JOIN_ACK){const e=t.message.joinack;if(e&&e.videoSubscriptionLimit&&(i.videoSubscriptionLimit=e.videoSubscriptionLimit),i.serverSupportsCompression=null==e?void 0:e.wantsCompressedSdp,void 0!==(null==e?void 0:e.defaultServerSideNetworkAdaption)&&e.defaultServerSideNetworkAdaption!==a.default.Default&&void 0!==i.videoDownlinkBandwidthPolicy.setServerSideNetworkAdaption){const t=e.defaultServerSideNetworkAdaption;i.logger.info(`Overriding server side network adaption value to ${t}`),i.videoDownlinkBandwidthPolicy.setServerSideNetworkAdaption(a.convertServerSideNetworkAdaptionEnumFromSignaled(t))}return void(e&&e.turnCredentials?(i.turnCredentials=new o.default,i.turnCredentials.username=e.turnCredentials.username,i.turnCredentials.password=e.turnCredentials.password,i.turnCredentials.ttl=e.turnCredentials.ttl,i.turnCredentials.uris=e.turnCredentials.uris.map((e=>i.meetingSessionConfiguration.urls.urlRewriter(e))).filter((e=>!!e))):i.logger.error(\"missing TURN credentials in JoinAckFrame\"))}if(t.message.type!==l.SdkSignalFrame.Type.INDEX)return;this.signalingClient.removeObserver(this);const n=t.message.index;e(n)}}(this.context.signalingClient);this.context.signalingClient.registerObserver(n),this.taskCanceler=n,this.context.previousSdpAnswerAsString=\"\",this.context.previousSdpOffer=null,this.context.serverSupportsCompression=!1;const u=new d.default(this.context.meetingSessionConfiguration.applicationMetadata);void 0!==this.context.videoDownlinkBandwidthPolicy.getServerSideNetworkAdaption&&void 0!==this.context.videoDownlinkBandwidthPolicy.supportedServerSideNetworkAdaptions&&(u.serverSideNetworkAdaption=this.context.videoDownlinkBandwidthPolicy.getServerSideNetworkAdaption(),u.supportedServerSideNetworkAdaptions=this.context.videoDownlinkBandwidthPolicy.supportedServerSideNetworkAdaptions()),u.disablePeriodicKeyframeRequestOnContentSender=this.context.meetingSessionConfiguration.disablePeriodicKeyframeRequestOnContentSender,this.context.signalingClient.join(u)}));this.context.logger.info(`received first index ${JSON.stringify(e)}`),this.context.indexFrame=e}))}}t.default=h},6180:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(9416),s=i(289),o=i(1789);class a extends o.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"LeaveAndReceiveLeaveAckTask\",this.taskCanceler=null}cancel(){this.taskCanceler&&(this.taskCanceler.cancel(),this.taskCanceler=null)}run(){return n(this,void 0,void 0,(function*(){this.context.signalingClient.ready()&&(this.context.signalingClient.leave(),this.context.logger.info(\"sent leave\"),yield this.receiveLeaveAck())}))}receiveLeaveAck(){return new Promise(((e,t)=>{const i=new class{constructor(e,t){this.signalingClient=e,this.logger=t}cancel(){this.signalingClient.removeObserver(this),t(new Error(\"LeaveAndReceiveLeaveAckTask got canceled while waiting for IndexFrame\"))}handleSignalingClientEvent(t){if(t.isConnectionTerminated())return this.signalingClient.removeObserver(this),this.logger.info(\"LeaveAndReceiveLeaveAckTask connection terminated\"),void e();t.type===r.default.ReceivedSignalFrame&&t.message.type===s.SdkSignalFrame.Type.LEAVE_ACK&&(this.signalingClient.removeObserver(this),this.logger.info(\"got leave ack\"),e())}}(this.context.signalingClient,this.context.logger);this.taskCanceler=i,this.context.signalingClient.registerObserver(i)}))}}t.default=a},2748:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(9416),s=i(289),o=i(1789);class a extends o.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"ListenForVolumeIndicatorsTask\",this.realtimeMuteAndUnmuteHandler=e=>{this.context.signalingClient.mute(e)}}run(){return n(this,void 0,void 0,(function*(){this.context.removableObservers.push(this),this.context.signalingClient.registerObserver(this),this.context.realtimeController.realtimeSubscribeToMuteAndUnmuteLocalAudio(this.realtimeMuteAndUnmuteHandler)}))}removeObserver(){this.context.realtimeController.realtimeUnsubscribeToMuteAndUnmuteLocalAudio(this.realtimeMuteAndUnmuteHandler),this.context.signalingClient.removeObserver(this)}handleSignalingClientEvent(e){if(e.type===r.default.ReceivedSignalFrame)if(e.message.type===s.SdkSignalFrame.Type.AUDIO_STREAM_ID_INFO){const t=e.message.audioStreamIdInfo;this.context.volumeIndicatorAdapter.sendRealtimeUpdatesForAudioStreamIdInfo(t)}else if(e.message.type===s.SdkSignalFrame.Type.AUDIO_METADATA){const t=e.message.audioMetadata;this.context.volumeIndicatorAdapter.sendRealtimeUpdatesForAudioMetadata(t)}}}t.default=a},1981:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(6196),s=i(9496),o=i(9708),a=i(2977),c=i(1922),d=i(3789),l=i(5687),u=i(9416),h=i(289),p=i(9880),m=i(8660),f=i(1789);class g extends f.default{constructor(e,t,i){super(e.logger),this.context=e,this.initialConnectionHealthData=i,this.taskName=\"MonitorTask\",this.prevSignalStrength=1,this.currentAvailableStreamAvgBitrates=null,this.hasSignalingError=!1,this.presenceHandlerCalled=!1,this.isResubscribeCheckPaused=!1,this.pendingMetricsReport=void 0,this.isMeetingConnected=!1,this.checkAndSendWeakSignalEvent=e=>{const t=e<1,i=this.prevSignalStrength<1,n=t?i?null:p.default.RedmicStartLoss:i?p.default.RedmicEndLoss:null;n&&this.context.statsCollector.logAudioEvent(n),this.prevSignalStrength=e},this.realtimeFatalErrorCallback=e=>{this.logger.error(`realtime error: ${e}: ${e.stack}`),this.context.audioVideoController.handleMeetingSessionStatus(new d.default(l.default.RealtimeApiFailed),e)},this.realtimeAttendeeIdPresenceHandler=(e,t)=>{var i;const n=this.context.meetingSessionConfiguration.credentials.attendeeId;this.logger.info(`attendeePresenceReceived: ${n}`),n===e&&t&&!this.presenceHandlerCalled&&(this.presenceHandlerCalled=!0,this.context.attendeePresenceDurationMs=Date.now()-this.context.startAudioVideoTimestamp,null===(i=this.context.eventController)||void 0===i||i.publishEvent(\"attendeePresenceReceived\",{attendeePresenceDurationMs:this.context.attendeePresenceDurationMs}))},this.generateBaseAudioVideoEventAttributes=()=>{const{signalingOpenDurationMs:e,startTimeMs:t,iceGatheringDurationMs:i,attendeePresenceDurationMs:n,meetingStartDurationMs:r}=this.context;return{meetingDurationMs:null===t?0:Math.round(Date.now()-t),signalingOpenDurationMs:e,iceGatheringDurationMs:i,attendeePresenceDurationMs:n,meetingStartDurationMs:r}},this.generateAudioVideoEventAttributesForReceivingAudioDropped=()=>{const e=this.generateBaseAudioVideoEventAttributes();return Object.assign(Object.assign({},e),{maxVideoTileCount:this.context.maxVideoTileCount,poorConnectionCount:this.context.poorConnectionCount})},this.reconnectionHealthPolicy=new o.default(e.logger,Object.assign({},t),this.initialConnectionHealthData.clone()),this.unusableAudioWarningHealthPolicy=new c.default(Object.assign({},t),this.initialConnectionHealthData.clone()),this.sendingAudioFailureHealthPolicy=new a.default(e.logger,Object.assign({},t),this.initialConnectionHealthData.clone())}removeObserver(){this.context.audioVideoController.removeObserver(this),this.context.realtimeController.realtimeUnsubscribeToFatalError(this.realtimeFatalErrorCallback),this.context.realtimeController.realtimeUnsubscribeToLocalSignalStrengthChange(this.checkAndSendWeakSignalEvent),this.context.realtimeController.realtimeUnsubscribeToAttendeeIdPresence(this.realtimeAttendeeIdPresenceHandler),this.context.signalingClient.removeObserver(this)}run(){return n(this,void 0,void 0,(function*(){this.context.removableObservers.push(this),this.context.audioVideoController.addObserver(this),this.context.realtimeController.realtimeSubscribeToFatalError(this.realtimeFatalErrorCallback),this.context.realtimeController.realtimeSubscribeToLocalSignalStrengthChange(this.checkAndSendWeakSignalEvent),this.context.realtimeController.realtimeSubscribeToAttendeeIdPresence(this.realtimeAttendeeIdPresenceHandler),this.context.connectionMonitor.start(),this.context.statsCollector.start(this.context.signalingClient,this.context.videoStreamIndex),this.context.signalingClient.registerObserver(this)}))}pauseResubscribeCheck(){this.isResubscribeCheckPaused=!0}resumeResubscribeCheck(){this.isResubscribeCheckPaused&&(this.isResubscribeCheckPaused=!1,this.pendingMetricsReport&&(this.context.logger.info(\"Resuming resubscribe check with pending metrics report\"),this.checkResubscribe(this.pendingMetricsReport)&&this.context.audioVideoController.update({needsRenegotiation:!1})))}videoTileDidUpdate(e){this.context.maxVideoTileCount=Math.max(this.context.maxVideoTileCount,this.context.videoTileController.getAllVideoTiles().length)}checkResubscribe(e){if(this.isResubscribeCheckPaused)return this.context.logger.info(\"Resubscribe check is paused, setting incoming client metric report as pending\"),void(this.pendingMetricsReport=e);this.pendingMetricsReport=void 0;const t=e.getObservableMetrics(),i=t.availableOutgoingBitrate,n=t.nackCountReceivedPerSecond;let r=!1;this.context.videoDownlinkBandwidthPolicy.updateMetrics(e);const s=this.context.videoDownlinkBandwidthPolicy.wantsResubscribe();if(r=r||s,s){const e=this.context.videoDownlinkBandwidthPolicy.chooseSubscriptions();this.context.videosToReceive=e.truncate(this.context.videoSubscriptionLimit),e.size()>this.context.videosToReceive.size()&&this.logger.warn(`Video receive limit exceeded. Limiting the videos to ${this.context.videosToReceive.size()}. Please consider using AllHighestVideoBandwidthPolicy or VideoPriorityBasedPolicy along with chooseRemoteVideoSources api to select the video sources to be displayed.`),this.logger.info(`trigger resubscribe for down=${s}; videosToReceive=[${this.context.videosToReceive.array()}]`)}if(this.context.videoTileController.hasStartedLocalVideoTile()){this.context.videoUplinkBandwidthPolicy.updateConnectionMetric({uplinkKbps:i/1e3,nackCountPerSecond:n});const e=this.context.videoUplinkBandwidthPolicy.wantsResubscribe();r=r||e,e&&(this.logger.info(`trigger resubscribe for up=${e}; videosToReceive=[${this.context.videosToReceive.array()}]`),this.context.videoUplinkBandwidthPolicy.chooseEncodingParameters(),this.context.videoUplinkBandwidthPolicy.chooseMediaTrackConstraints())}return r}metricsDidReceive(e){if(this.checkResubscribe(e)&&this.context.audioVideoController.update({needsRenegotiation:!1}),!this.currentAvailableStreamAvgBitrates)return;const t=e.streamMetricReports,i=new Map;for(const e in t)t[e].mediaType===s.default.VIDEO&&t[e].direction===r.default.DOWNSTREAM&&i.set(t[e].streamId,t[e])}connectionHealthDidChange(e){0===e.consecutiveMissedPongs&&this.context.reconnectController&&this.context.reconnectController.setLastActiveTimestampMs(Date.now()),this.applyHealthPolicy(this.reconnectionHealthPolicy,e,(()=>{this.context.audioVideoController.handleMeetingSessionStatus(new d.default(l.default.ConnectionHealthReconnect),null)})),this.applyHealthPolicy(this.unusableAudioWarningHealthPolicy,e,(()=>{var e;this.context.poorConnectionCount+=1;const t=this.generateAudioVideoEventAttributesForReceivingAudioDropped();null===(e=this.context.eventController)||void 0===e||e.publishEvent(\"receivingAudioDropped\",t),this.context.videoTileController.haveVideoTilesWithStreams()?this.context.audioVideoController.forEachObserver((e=>{m.Maybe.of(e.connectionDidSuggestStopVideo).map((t=>t.bind(e)()))})):this.context.audioVideoController.forEachObserver((e=>{m.Maybe.of(e.connectionDidBecomePoor).map((t=>t.bind(e)()))}))}),(()=>{this.context.audioVideoController.forEachObserver((e=>{m.Maybe.of(e.connectionDidBecomeGood).map((t=>t.bind(e)()))}))})),this.isMeetingConnected&&this.applyHealthPolicy(this.sendingAudioFailureHealthPolicy,e,(()=>{var e;const t=this.generateBaseAudioVideoEventAttributes();null===(e=this.context.eventController)||void 0===e||e.publishEvent(\"sendingAudioFailed\",t)}),(()=>{var e;const t=this.generateBaseAudioVideoEventAttributes();null===(e=this.context.eventController)||void 0===e||e.publishEvent(\"sendingAudioRecovered\",t)}))}audioVideoDidStart(){this.isMeetingConnected=!0}audioVideoDidStartConnecting(e){this.isMeetingConnected=!1}audioVideoDidStop(e){this.isMeetingConnected=!1}applyHealthPolicy(e,t,i,n){e.update(t);const r=e.healthIfChanged();null!==r&&(this.logger.info(`${e.name} value is now ${r}`),r<=e.minimumHealth()?m.Maybe.of(i).map((e=>e.bind(this)())):m.Maybe.of(n).map((e=>e.bind(this)())))}handleBitrateFrame(e){this.currentAvailableStreamAvgBitrates=e,e.serverAvailableOutgoingBitrate>0&&(this.logger.info(`Received server side estimation of available incoming bitrate ${e.serverAvailableOutgoingBitrate}kbps`),this.context.statsCollector.overrideObservableMetric(\"availableIncomingBitrate\",1e3*e.serverAvailableOutgoingBitrate))}handleSignalingClientEvent(e){var t;if(e.type===u.default.WebSocketClosed&&(4410===e.closeCode||e.closeCode>=4500&&e.closeCode<4600)||e.type===u.default.WebSocketError||e.type===u.default.WebSocketFailed){if(!this.hasSignalingError){const e=this.generateAudioVideoEventAttributesForReceivingAudioDropped();null===(t=this.context.eventController)||void 0===t||t.publishEvent(\"signalingDropped\",e),this.hasSignalingError=!0}}else e.type===u.default.WebSocketOpen&&(this.hasSignalingError=!1);if(e.type===u.default.ReceivedSignalFrame){if(e.message.bitrates){const t=e.message.bitrates;this.context.videoStreamIndex.integrateBitratesFrame(t),this.context.videoDownlinkBandwidthPolicy.updateIndex(this.context.videoStreamIndex),this.handleBitrateFrame(e.message.bitrates)}const t=d.default.fromSignalFrame(e.message);e.message.type!==h.SdkSignalFrame.Type.PRIMARY_MEETING_JOIN_ACK&&t.statusCode()!==l.default.OK&&this.context.audioVideoController.handleMeetingSessionStatus(t,null)}}}t.default=g},8831:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{cancel(){}name(){return\"NoOpTask\"}run(){return Promise.resolve()}setParent(e){}}},1124:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(813),r=i(7797);t.default=class{constructor(e,t,i){this.logger=e,this.task=t,this.dependencies=i,this.canceled=!1}name(){return`${this.task.name()} (once)`}cancel(){if(!this.canceled){if(this.dependencies)for(const e of this.dependencies)e.cancel();this.logger.info(`Canceling ${this.name()}`),r.default.nextTick((()=>this.task.cancel())),this.canceled=!0,this.cancelPromise&&r.default.nextTick((()=>this.cancelPromise(new Error(`canceling ${this.name()}`))))}}logDependencies(){if(this.logger.getLogLevel()>n.default.INFO)return;if(!this.dependencies)return;const e=this.dependencies.filter((e=>e)).map((e=>e.name())).join(\", \");this.logger.info(`${this.task.name()} waiting for dependencies: ${e}`)}run(){if(this.promise)return this.promise;const e=this.dependencies?Promise.all(this.dependencies.map((e=>null==e?void 0:e.run()))):Promise.resolve();return this.logDependencies(),this.ongoing=e.then((()=>this.task.run())),this.promise=new Promise(((e,t)=>{this.cancelPromise=t,this.ongoing.then(e).catch(t)}))}setParent(e){this.task.setParent(e)}}},4543:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(3920),s=i(9416),o=i(1789);class a extends o.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"OpenSignalingConnectionTask\",this.taskCanceler=null}cancel(){this.taskCanceler&&(this.taskCanceler.cancel(),this.taskCanceler=null)}run(){return n(this,void 0,void 0,(function*(){const e=this.context.meetingSessionConfiguration;this.context.signalingClient.openConnection(new r.default(e.urls.signalingURL,e.credentials.joinToken));const t=Date.now();try{yield new Promise(((e,t)=>{const i=new class{constructor(e){this.signalingClient=e}cancel(){this.signalingClient.removeObserver(this),t(new Error(\"OpenSignalingConnectionTask got canceled while waiting to open signaling connection\"))}handleSignalingClientEvent(i){switch(i.type){case s.default.WebSocketOpen:this.signalingClient.removeObserver(this),e();break;case s.default.WebSocketFailed:this.signalingClient.removeObserver(this),t(new Error(\"WebSocket connection failed\"))}}}(this.context.signalingClient);this.context.signalingClient.registerObserver(i),this.taskCanceler=i}))}catch(e){throw e}finally{this.context.signalingOpenDurationMs=Math.round(Date.now()-t),this.logger.info(`Opening signaling connection took ${this.context.signalingOpenDurationMs} ms`)}}))}}t.default=a},8556:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(1789);class s extends r.default{constructor(e,t,i){super(e),this.taskName=t,this.tasksToRunParallel=i;for(const e of i)e.setParent(this)}cancel(){for(const e of this.tasksToRunParallel)this.logger.info(`canceling parallel group task ${this.name()} subtask ${e.name()}`),e.cancel()}run(){return n(this,void 0,void 0,(function*(){const e=[];for(const t of this.tasksToRunParallel)this.logger.info(`parallel group task ${this.name()} running subtask ${t.name()}`),e.push(t.run());const t=[];for(let i=0;i0){const e=t.join(\", \");this.logAndThrow(`parallel group task ${this.name()} failed for tasks: ${e}`)}this.logger.info(`parallel group task ${this.name()} completed`)}))}}t.default=s},9945:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(3204),s=i(9416),o=i(289),a=i(1789);class c extends a.default{constructor(e,t,i){super(e.logger),this.context=e,this.credentials=t,this.completionCallback=i,this.taskName=\"PromoteToPrimaryMeetingTask\",this.taskCanceler=null}cancel(){this.taskCanceler&&(this.taskCanceler.cancel(),this.taskCanceler=null)}run(){return n(this,void 0,void 0,(function*(){this.context.signalingClient.ready()?(this.context.signalingClient.promoteToPrimaryMeeting(this.credentials),this.context.logger.info(\"Sent request to join primary meeting\"),yield this.receivePrimaryMeetingJoinAck()):this.completionCallback(new r.MeetingSessionStatus(r.MeetingSessionStatusCode.SignalingRequestFailed))}))}receivePrimaryMeetingJoinAck(){return new Promise(((e,t)=>{const i=new class{constructor(e,t,i){this.signalingClient=e,this.completionCallback=t,this.logger=i}cancel(){this.signalingClient.removeObserver(this),this.completionCallback(new r.MeetingSessionStatus(r.MeetingSessionStatusCode.SignalingRequestFailed)),e()}handleSignalingClientEvent(t){t.isConnectionTerminated()&&(this.signalingClient.removeObserver(this),this.logger.info(\"PromoteToPrimaryMeetingTask connection terminated\"),this.completionCallback(new r.MeetingSessionStatus(r.MeetingSessionStatusCode.SignalingRequestFailed)),e()),t.type===s.default.ReceivedSignalFrame&&t.message.type===o.SdkSignalFrame.Type.PRIMARY_MEETING_JOIN_ACK&&(this.signalingClient.removeObserver(this),this.logger.info(\"Got a primary meeting join ACK\"),this.completionCallback(r.MeetingSessionStatus.fromSignalFrame(t.message)),e())}}(this.context.signalingClient,this.completionCallback,this.context.logger);this.taskCanceler=i,this.context.signalingClient.registerObserver(i)}))}}t.default=c},1209:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(1789);class s extends r.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"ReceiveAudioInputTask\"}run(){var e,t;return n(this,void 0,void 0,(function*(){if(!(null===(t=null===(e=this.context.meetingSessionConfiguration)||void 0===e?void 0:e.urls)||void 0===t?void 0:t.audioHostURL))return void this.context.logger.info(\"No audio connection: not acquiring audio input\");if(this.context.activeAudioInput)return void this.context.logger.info(\"an active audio input exists\");let i;try{i=yield this.context.mediaStreamBroker.acquireAudioInputStream()}catch(e){this.context.logger.warn(\"could not acquire audio input from current device\")}i?this.context.activeAudioInput=i:this.context.logger.warn(\"an audio input is not available\")}))}}t.default=s},6274:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(9416),s=i(289),o=i(1789);class a extends o.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"ReceiveRemoteVideoPauseResume\",this.serverPausedVideoTileIds=new Set}removeObserver(){this.context.signalingClient.removeObserver(this)}run(){return n(this,void 0,void 0,(function*(){this.context.signalingClient.registerObserver(this),this.context.removableObservers.push(this)}))}handleSignalingClientEvent(e){if(e.type!==r.default.ReceivedSignalFrame||e.message.type!==s.SdkSignalFrame.Type.PAUSE&&e.message.type!==s.SdkSignalFrame.Type.RESUME)return;const t=e.message.pause,i=e.message.type;if(this.context.logger.info(`received new ${i===s.SdkSignalFrame.Type.PAUSE?\"pause\":\"resume\"} frame: ${JSON.stringify(t)}`),!t||void 0===this.context.videoTileController.getVideoTileForAttendeeId||void 0===this.context.videoDownlinkBandwidthPolicy.forEachObserver||void 0===this.context.videoStreamIndex.attendeeIdForGroupId)return;const n=t.groupIds.map((e=>{const t=this.context.videoStreamIndex.attendeeIdForGroupId(e);return this.context.videoTileController.getVideoTileForAttendeeId(t)}));for(const e of n)void 0!==e&&(i===s.SdkSignalFrame.Type.PAUSE?e.state().paused||(this.serverPausedVideoTileIds.add(e.id()),this.context.videoDownlinkBandwidthPolicy.forEachObserver((t=>{t.tileWillBePausedByDownlinkPolicy(e.id())})),e.pause()):e.state().paused&&this.serverPausedVideoTileIds.has(e.id())&&(this.serverPausedVideoTileIds.delete(e.id()),this.context.videoDownlinkBandwidthPolicy.forEachObserver((t=>{t.tileWillBeUnpausedByDownlinkPolicy(e.id())})),e.unpause()))}}t.default=a},5547:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(5687),s=i(7215),o=i(214),a=i(4046),c=i(1789);class d extends c.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"ReceiveTURNCredentialsTask\",this.url=e.meetingSessionConfiguration.urls.turnControlURL,this.meetingId=e.meetingSessionConfiguration.meetingId,this.joinToken=e.meetingSessionConfiguration.credentials.joinToken}cancel(){if(this.cancelPromise){const e=new Error(`canceling ${this.name()}`);this.cancelPromise(e),delete this.cancelPromise}}run(){return n(this,void 0,void 0,(function*(){if(this.context.turnCredentials)return void this.context.logger.info(\"TURN credentials available, skipping credentials fetch\");if(this.context.logger.error(\"missing TURN credentials - falling back to fetch\"),!this.url)return void this.context.logger.info(\"TURN control url not supplied, skipping credentials fetch\");const e={method:\"POST\",mode:\"cors\",cache:\"no-cache\",credentials:\"omit\",headers:{\"Content-Type\":\"application/json\",\"X-Chime-Auth-Token\":\"_aws_wt_session=\"+new o.default(this.joinToken).base()},redirect:\"follow\",referrer:\"no-referrer\",body:JSON.stringify({meetingId:this.meetingId})};this.context.logger.info(`requesting TURN credentials from ${this.url}`);const t=yield new Promise(((t,i)=>n(this,void 0,void 0,(function*(){this.cancelPromise=e=>{i(e)};try{const n=yield fetch(a.default.urlWithVersion(this.url),e);if(this.context.logger.info(\"received TURN credentials\"),n.status&&403===n.status)return void i(new Error(`canceling ${this.name()} due to the meeting status code: ${r.default.TURNCredentialsForbidden}`));if(n.status&&404===n.status)return void i(new Error(`canceling ${this.name()} due to the meeting status code: ${r.default.MeetingEnded}`));t(yield n.json())}catch(e){i(e)}finally{delete this.cancelPromise}}))));this.context.turnCredentials=new s.default,this.context.turnCredentials.password=t.password,this.context.turnCredentials.ttl=t.ttl,this.context.turnCredentials.uris=t.uris.map((e=>this.context.meetingSessionConfiguration.urls.urlRewriter(e))).filter((e=>!!e)),this.context.turnCredentials.username=t.username}))}}t.default=d},120:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(214),s=i(289),o=i(1789);class a extends o.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"ReceiveVideoInputTask\"}run(){return n(this,void 0,void 0,(function*(){const e=this.context.videoDuplexMode===s.SdkStreamServiceType.RX||this.context.videoDuplexMode===s.SdkStreamServiceType.DUPLEX;if(this.context.videoTileController.hasStartedLocalVideoTile()?this.context.videoDuplexMode=e?s.SdkStreamServiceType.DUPLEX:s.SdkStreamServiceType.TX:this.context.videoDuplexMode=e?s.SdkStreamServiceType.RX:0,this.context.videoCaptureAndEncodeParameter=this.context.videoUplinkBandwidthPolicy.chooseCaptureAndEncodeParameters(),!this.context.videoTileController.hasStartedLocalVideoTile())return this.context.logger.info(\"has not started local video tile\"),void(this.context.activeVideoInput&&(this.context.activeVideoInput=void 0,this.context.videoStreamIndex.integrateUplinkPolicyDecision([])));const t=this.context.videoTileController.getLocalVideoTile();let i;try{i=yield this.context.mediaStreamBroker.acquireVideoInputStream()}catch(e){this.context.logger.warn(\"could not acquire video input from current device\"),this.context.videoTileController.stopLocalVideoTile()}if(this.context.enableSimulcast){const e=this.context.videoUplinkBandwidthPolicy.chooseEncodingParameters();this.context.videoStreamIndex.integrateUplinkPolicyDecision(Array.from(e.values()))}if(this.context.activeVideoInput=i,i){const e=i.getVideoTracks();if(!e||0===e.length)return;const n=this.context.meetingSessionConfiguration.credentials.attendeeId,s=new r.default(n).hasModality(r.default.MODALITY_CONTENT),o=e[0].getSettings();if(s){const t={width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}};this.context.logger.info(`Video track (content = ${s}) with constraint: ${JSON.stringify(t)}, trackSettings: ${JSON.stringify(o)}`);try{yield e[0].applyConstraints(t)}catch(e){this.context.logger.info(\"Could not apply constraint for video track (content = ${isContentAttendee})\")}}if(this.context.enableSimulcast&&!s){const t=this.context.videoUplinkBandwidthPolicy.chooseMediaTrackConstraints();this.context.logger.info(`simulcast: choose constraint ${JSON.stringify(t)}`);try{yield e[0].applyConstraints(t)}catch(e){this.context.logger.info(\"simulcast: pass video without more constraint\")}}const a=this.context.audioVideoController.configuration.credentials.externalUserId;t.bindVideoStream(n,!0,i,o.width,o.height,null,a);for(let t=0;t{const i=new s.default(e.attendeeId);return!(i.base()===t&&i.hasModality(s.default.MODALITY_CONTENT))}));const{videoStreamIndex:i,videoDownlinkBandwidthPolicy:n,videoUplinkBandwidthPolicy:r}=this.context,o=i.allVideoSendingSourcesExcludingSelf(t);i.integrateIndexFrame(e),n.updateIndex(i),r.updateIndex(i),this.resubscribe(n,r),this.updateVideoAvailability(e),this.handleIndexVideosPausedAtSource(),e.supportedReceiveCodecIntersection.length>0&&this.handleSupportedVideoReceiveCodecIntersection(e);const a=i.allVideoSendingSourcesExcludingSelf(t);this.areVideoSourcesEqual(o,a)||this.context.audioVideoController.forEachObserver((e=>{d.Maybe.of(e.remoteVideoSourcesDidChange).map((t=>t.bind(e)(a)))}))}areVideoSourcesEqual(e,t){if(e.length!==t.length)return!1;const i=(e,t)=>e.attendee.attendeeId.localeCompare(t.attendee.attendeeId),n=[...e].sort(i),r=[...t].sort(i);for(let e=0;ethis.context.videosToReceive.size()&&this.logger.warn(`Video receive limit exceeded. Limiting the videos to ${this.context.videosToReceive.size()}. Please consider using AllHighestVideoBandwidthPolicy or VideoPriorityBasedPolicy along with chooseRemoteVideoSources api to select the video sources to be displayed.`),this.context.videoCaptureAndEncodeParameter=t.chooseCaptureAndEncodeParameters(),this.logger.info(`trigger resubscribe for up=${n} down=${i}; videosToReceive=[${this.context.videosToReceive.array()}] captureParams=${JSON.stringify(this.context.videoCaptureAndEncodeParameter)}`),this.context.audioVideoController.update({needsRenegotiation:!1})}updateVideoAvailability(e){if(!this.context.videosToReceive)return void this.logger.error(\"videosToReceive must be set in the meeting context.\");const t=new r.default;t.remoteVideoAvailable=!this.context.videosToReceive.empty(),t.canStartLocalVideo=!e.atCapacity,this.context.lastKnownVideoAvailability&&this.context.lastKnownVideoAvailability.equal(t)||(this.context.lastKnownVideoAvailability=t.clone(),this.context.audioVideoController.forEachObserver((e=>{d.Maybe.of(e.videoAvailabilityDidChange).map((i=>i.bind(e)(t.clone())))})))}handleSupportedVideoReceiveCodecIntersection(e){if(void 0===this.context.videoSendCodecPreferences)return;const t=[];let i=!1;for(const n of this.context.videoSendCodecPreferences){let r=!1;for(const i of e.supportedReceiveCodecIntersection)if(n.equals(o.default.fromSignaled(i))){r=!0,t.push(n);break}void 0!==this.context.currentVideoSendCodec&&!r&&n.equals(this.context.currentVideoSendCodec)&&(i=!0)}t.length>0?this.context.meetingSupportedVideoSendCodecPreferences=t:(this.logger.warn(\"Interesection of meeting receive codec support and send codec preferences has no overlap, falling back to just values provided in `setVideoCodecSendPreferences`\"),this.context.meetingSupportedVideoSendCodecPreferences=void 0),i&&this.context.audioVideoController.update({needsRenegotiation:!0})}handleIndexVideosPausedAtSource(){const e=this.context.videoStreamIndex.streamsPausedAtSource();for(const t of this.context.videoTileController.getAllVideoTiles()){const i=t.state();e.contain(i.streamId)?t.markPoorConnection()&&this.logger.info(`marks the tile ${i.tileId} as having a poor connection`):t.unmarkPoorConnection()&&this.logger.info(`unmarks the tile ${i.tileId} as having a poor connection`)}}}t.default=u},4191:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(1789);class r extends n.default{constructor(e,t,i=\"RunnableTask\"){super(e),this.fn=t,this.taskName=i}run(){return this.fn().then((()=>{}))}}t.default=r},9485:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(1018),s=i(9416),o=i(289),a=i(1789);class c extends a.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"SendAndReceiveDataMessagesTask\",this.sendDataMessageHandler=(e,t,i)=>{if(this.context.signalingClient.ready()){let n;n=t instanceof Uint8Array?t:\"string\"==typeof t?(new TextEncoder).encode(t):(new TextEncoder).encode(JSON.stringify(t)),this.validateDataMessage(e,n,i);const r=o.SdkDataMessagePayload.create();r.topic=e,r.lifetimeMs=i,r.data=n;const s=o.SdkDataMessageFrame.create();s.messages=[r],this.context.signalingClient.sendDataMessage(s)}else this.context.logger.error(\"Signaling client is not ready\")}}run(){return n(this,void 0,void 0,(function*(){this.context.removableObservers.push(this),this.context.signalingClient.registerObserver(this),this.context.realtimeController.realtimeSubscribeToSendDataMessage(this.sendDataMessageHandler)}))}removeObserver(){this.context.realtimeController.realtimeUnsubscribeFromSendDataMessage(this.sendDataMessageHandler),this.context.signalingClient.removeObserver(this)}handleSignalingClientEvent(e){if(e.type===s.default.ReceivedSignalFrame&&e.message.type===o.SdkSignalFrame.Type.DATA_MESSAGE)for(const t of e.message.dataMessage.messages){const e=new r.default(t.ingestTimeNs/1e6,t.topic,t.data,t.senderAttendeeId,t.senderExternalUserId,0===t.ingestTimeNs);this.context.realtimeController.realtimeReceiveDataMessage(e)}}validateDataMessage(e,t,i){if(!c.TOPIC_REGEX.test(e))throw new Error(\"Invalid topic\");if(t.length>c.DATA_SIZE)throw new Error(\"Data size has to be less than 2048 bytes\");if(i&&i<0)throw new Error(\"The life time of the message has to be non negative\")}}t.default=c,c.TOPIC_REGEX=new RegExp(/^[a-zA-Z0-9_-]{1,36}$/),c.DATA_SIZE=2048},7079:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(1789),s=i(4456);class o extends r.default{constructor(e,t,i){super(e),this.taskName=t,this.tasksToRunSerially=i,this.currentTask=null;for(const e of i)e.setParent(this)}cancel(){this.currentTask&&(this.logger.info(`canceling serial group task ${this.name()} subtask ${this.currentTask.name()}`),this.currentTask.cancel())}run(){return n(this,void 0,void 0,(function*(){for(const e of this.tasksToRunSerially){this.getStatus()===s.default.CANCELED&&this.logAndThrow(`serial group task ${this.name()} was canceled`);try{this.logger.info(`serial group task ${this.name()} running subtask ${e.name()}`),this.currentTask=e,yield e.run(),this.logger.info(`serial group task ${this.name()} completed subtask ${e.name()}`)}catch(e){this.logAndThrow(`serial group task ${this.name()} was canceled due to subtask ${this.currentTask.name()} error: ${e.message}`)}finally{this.currentTask=null}}this.logger.info(`serial group task ${this.name()} completed`)}))}}t.default=o},4833:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(543),s=i(326),o=i(1789);class a extends o.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"SetLocalDescriptionTask\"}cancel(){if(this.cancelPromise){const e=new Error(`canceling ${this.name()}`);this.cancelPromise(e),delete this.cancelPromise}}run(){return n(this,void 0,void 0,(function*(){const e=this.context.peer;let t=this.context.sdpOfferInit.sdp;this.context.browserBehavior.supportsVideoLayersAllocationRtpHeaderExtension()&&(t=new s.default(t).withVideoLayersAllocationRtpHeaderExtension(this.context.previousSdpOffer).sdp),(new r.default).requiresDisablingH264Encoding()&&(t=new s.default(t).removeH264SupportFromSendSection().sdp),void 0!==this.context.videoSendCodecPreferences&&this.context.videoSendCodecPreferences.length>0&&(t=new s.default(t).withVideoSendCodecPreferences(void 0!==this.context.meetingSupportedVideoSendCodecPreferences?this.context.meetingSupportedVideoSendCodecPreferences:this.context.videoSendCodecPreferences).sdp),this.context.audioProfile&&(t=new s.default(t).withAudioMaxAverageBitrate(this.context.audioProfile.audioBitrateBps).sdp,this.context.audioProfile.isStereo()&&(t=new s.default(t).withStereoAudio().sdp)),this.logger.debug((()=>`local description is >>>${t}<<<`));const i={type:\"offer\",sdp:t,toJSON:null};yield new Promise(((t,r)=>n(this,void 0,void 0,(function*(){this.cancelPromise=e=>{r(e)};try{yield e.setLocalDescription(i),t()}catch(e){r(e)}finally{delete this.cancelPromise}})))),this.context.logger.info(\"set local description\")}))}}t.default=a},5275:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(326),s=i(1789);class o extends s.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"SetRemoteDescriptionTask\"}cancel(){this.cancelICEPromise&&this.cancelICEPromise()}run(){return n(this,void 0,void 0,(function*(){this.context.peer||this.logAndThrow(\"session does not have peer connection; bypass set remote description\");let e=this.context.sdpAnswer;e=new r.default(e).withoutServerReflexiveCandidates().sdp,this.context.audioProfile&&(e=new r.default(e).withAudioMaxAverageBitrate(this.context.audioProfile.audioBitrateBps).sdp,this.context.audioProfile.isStereo()&&(e=new r.default(e).withStereoAudio().sdp)),void 0!==this.context.videoSendCodecPreferences&&this.context.videoSendCodecPreferences.length>0&&(e=new r.default(e).withVideoSendCodecPreferences(void 0!==this.context.meetingSupportedVideoSendCodecPreferences?this.context.meetingSupportedVideoSendCodecPreferences:this.context.videoSendCodecPreferences).sdp,this.context.currentVideoSendCodec=new r.default(e).highestPriorityVideoSendCodec()),this.logger.info(`processed remote description is >>>${e}<<<`);const t={type:\"answer\",sdp:e,toJSON:null};try{yield this.createICEConnectionCompletedPromise(t)}catch(e){throw e}}))}createICEConnectionCompletedPromise(e){return new Promise(((t,i)=>n(this,void 0,void 0,(function*(){const n=()=>{\"connected\"!==this.context.peer.iceConnectionState&&\"completed\"!==this.context.peer.iceConnectionState||(this.context.peer.removeEventListener(\"iceconnectionstatechange\",n),t())};this.cancelICEPromise=()=>{this.context.peer&&this.context.peer.removeEventListener(\"iceconnectionstatechange\",n),i(new Error(`${this.name()} got canceled while waiting for the ICE connection state`))},this.context.peer.addEventListener(\"iceconnectionstatechange\",n);try{yield this.context.peer.setRemoteDescription(e),this.logger.info(\"set remote description, waiting for ICE connection\"),n()}catch(e){i(e)}}))))}}t.default=o},5924:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(3789),s=i(5687),o=i(326),a=i(3320),c=i(7103),d=i(9416),l=i(6729),u=i(289),h=i(1819),p=i(1789);class m extends p.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"SubscribeAndReceiveSubscribeAckTask\",this.taskCanceler=null,this.textCompressor=new a.default(e.logger)}cancel(){this.taskCanceler&&(this.taskCanceler.cancel(),this.taskCanceler=null)}run(){return n(this,void 0,void 0,(function*(){let e=\"\";if(this.context.peer&&this.context.peer.localDescription&&(e=new o.default(this.context.peer.localDescription.sdp).withUnifiedPlanFormat().sdp),!this.context.enableSimulcast){let e=0,t=0;this.context.videoCaptureAndEncodeParameter&&(e=this.context.videoCaptureAndEncodeParameter.captureFrameRate(),t=this.context.videoCaptureAndEncodeParameter.encodeBitrates()[0]);const i={rid:\"hi\",maxBitrate:1e3*t,maxFramerate:e,active:!0};this.context.videoStreamIndex.integrateUplinkPolicyDecision([i])}this.context.videoStreamIndex.subscribeFrameSent();const t=this.fixUpSubscriptionOrder(e,this.context.videoSubscriptions),i=this.context.videoDuplexMode===u.SdkStreamServiceType.TX||this.context.videoDuplexMode===u.SdkStreamServiceType.DUPLEX;let n;const r=e;if(this.context.serverSupportsCompression){const t=this.context.previousSdpOffer?this.context.previousSdpOffer.sdp:\"\";n=this.textCompressor.compress(r,t),this.context.logger.info(`Compressed the SDP message from ${r.length} to ${n.length} bytes.`),e=\"\"}this.context.previousSdpOffer=new o.default(r);const s=new l.default(this.context.meetingSessionConfiguration.credentials.attendeeId,e,this.context.meetingSessionConfiguration.urls.audioHostURL,this.context.realtimeController.realtimeIsLocalAudioMuted(),!1,t,i,this.context.videoStreamIndex.localStreamDescriptions(),!0,n);void 0===this.context.videoDownlinkBandwidthPolicy.getServerSideNetworkAdaption||c.serverSideNetworkAdaptionIsNoneOrDefault(this.context.videoDownlinkBandwidthPolicy.getServerSideNetworkAdaption())||void 0===this.context.videoDownlinkBandwidthPolicy.getVideoPreferences||(s.videoSubscriptionConfiguration=h.convertVideoPreferencesToSignalingClientVideoSubscriptionConfiguration(this.context,t.map((e=>0===e?0:this.context.videoStreamIndex.groupIdForStreamId(e))),this.context.videoDownlinkBandwidthPolicy.getVideoPreferences())),this.context.logger.info(`sending subscribe: ${JSON.stringify(s)}`),this.context.signalingClient.subscribe(s);const a=yield this.receiveSubscribeAck();this.context.logger.info(`got subscribe ack: ${JSON.stringify(a)}`);let d=\"\";a.compressedSdpAnswer&&a.compressedSdpAnswer.length?(d=this.textCompressor.decompress(a.compressedSdpAnswer,this.context.previousSdpAnswerAsString),0===d.length&&(this.context.sdpAnswer=\"\",this.context.previousSdpAnswerAsString=\"\",this.logAndThrow(\"Error occurred while trying to decompress the SDP answer.\")),this.context.logger.info(`Decompressed the SDP message from ${a.compressedSdpAnswer.length} to ${d.length} bytes.`),this.context.sdpAnswer=d):this.context.sdpAnswer=a.sdpAnswer,this.context.previousSdpAnswerAsString=this.context.sdpAnswer,this.context.videoStreamIndex.integrateSubscribeAckFrame(a)}))}fixUpSubscriptionOrder(e,t){if(void 0===this.context.transceiverController.getMidForStreamId)return t;const i=new Map;for(const e of t){const t=this.context.transceiverController.getMidForStreamId(e);void 0!==t?i.set(t,e):0!==e&&this.logger.warn(`Could not find MID for stream ID: ${e}`)}const n=new o.default(e).mediaSections(),r=[];for(const e of n)if(\"video\"===e.mediaType)if(\"recvonly\"===e.direction){const t=i.get(e.mid);if(void 0===t){this.logger.warn(`Could not find stream ID for MID: ${e.mid}`);continue}r.push(t)}else r.push(0);return this.logger.info(`Fixed up ${JSON.stringify(t)} to ${JSON.stringify(r)} (may be same))}`),r}receiveSubscribeAck(){return new Promise(((e,t)=>{const i=this.context,n=new class{constructor(e){this.signalingClient=e}cancel(){this.signalingClient.removeObserver(this),t(new Error(\"SubscribeAndReceiveSubscribeAckTask got canceled while waiting for SdkSubscribeAckFrame\"))}handleSignalingClientEvent(t){if(t.isConnectionTerminated()){const e=`SubscribeAndReceiveSubscribeAckTask connection was terminated with code ${t.closeCode} and reason: ${t.closeReason}`;i.logger.warn(e);let n=s.default.TaskFailed;return t.closeCode>=4500&&t.closeCode<4600&&(n=s.default.SignalingInternalServerError),void i.audioVideoController.handleMeetingSessionStatus(new r.default(n),new Error(e))}if(t.type!==d.default.ReceivedSignalFrame||t.message.type!==u.SdkSignalFrame.Type.SUBSCRIBE_ACK)return;this.signalingClient.removeObserver(this);const n=t.message.suback;e(n)}}(this.context.signalingClient);this.context.signalingClient.registerObserver(n),this.taskCanceler=n}))}}t.default=m},4456:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e.IDLE=\"IDLE\",e.RUNNING=\"RUNNING\",e.CANCELED=\"CANCELED\",e.FINISHED=\"FINISHED\"}(i||(i={})),t.default=i},250:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(4929),s=i(1789);class o extends s.default{constructor(e,t,i){super(e),this.taskToRunBeforeTimeout=t,this.timeoutMs=i,this.taskName=`Timeout${this.timeoutMs}ms`,t.setParent(this)}cancel(){this.logger.info(`canceling timeout task ${this.name()} subtask ${this.taskToRunBeforeTimeout}`),this.taskToRunBeforeTimeout.cancel()}run(){return n(this,void 0,void 0,(function*(){const e=new r.default(this.timeoutMs);e.start((()=>{this.logger.info(`timeout reached for task ${this.name()}`),this.taskToRunBeforeTimeout.cancel()}));try{yield this.taskToRunBeforeTimeout.run()}finally{e.stop()}this.logger.info(`timeout task ${this.name()} completed`)}))}}t.default=o},6171:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(5687),s=i(1789);class o extends s.default{constructor(e){super(e.logger),this.context=e,this.taskName=\"WaitForAttendeePresenceTask\"}cancel(){if(this.cancelPromise){const e=new Error(`canceling ${this.name()} due to the meeting status code: ${r.default.NoAttendeePresent}`);this.cancelPromise(e),delete this.cancelPromise}}run(){return n(this,void 0,void 0,(function*(){const e=this.context.meetingSessionConfiguration.credentials.attendeeId;return new Promise(((t,i)=>{const n=(i,r,s,o,a)=>{e===i&&r&&(this.context.realtimeController.realtimeUnsubscribeToAttendeeIdPresence(n),t(),delete this.cancelPromise)};this.cancelPromise=e=>{this.context.realtimeController.realtimeUnsubscribeToAttendeeIdPresence(n),i(e)},this.context.realtimeController.realtimeSubscribeToAttendeeIdPresence(n)}))}))}}t.default=o},365:function(e,t){\"use strict\";var i=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e,t){this.logger=e,this.browserBehavior=t,this._localCameraTransceiver=null,this._localAudioTransceiver=null,this.videoSubscriptions=[],this.defaultMediaStream=null,this.peer=null,this.streamIdToTransceiver=new Map,this.groupIdToTransceiver=new Map}setEncodingParameters(e){return i(this,void 0,void 0,(function*(){if(!this._localCameraTransceiver||\"sendrecv\"!==this._localCameraTransceiver.direction)return;const t=this._localCameraTransceiver.sender;if(!e||0===e.size)return;const i=Array.from(e.values()),n=t.getParameters();if(n.encodings&&0!==n.encodings.length)for(const e of n.encodings)for(const t of i){if((e.rid||t.rid)&&e.rid!==t.rid)continue;let i;for(i in t)\"rid\"!==i&&\"codecPayloadType\"!==i&&t.hasOwnProperty(i)&&(e[i]=t[i])}else n.encodings=i;yield t.setParameters(n)}))}localAudioTransceiver(){return this._localAudioTransceiver}localVideoTransceiver(){return this._localCameraTransceiver}setVideoSendingBitrateKbps(e){return i(this,void 0,void 0,(function*(){if(!this._localCameraTransceiver||\"sendrecv\"!==this._localCameraTransceiver.direction)return;const t=this._localCameraTransceiver.sender;if(!t||e<=0)return;const i=t.getParameters();i.encodings||(i.encodings=[{}]);for(const t of i.encodings)t.maxBitrate=1e3*e;yield t.setParameters(i)}))}setPeer(e){this.peer=e}reset(){this._localCameraTransceiver=null,this._localAudioTransceiver=null,this.videoSubscriptions=[],this.defaultMediaStream=null,this.peer=null}useTransceivers(){return!!this.peer&&void 0!==this.peer.getTransceivers}hasVideoInput(){return!(!this._localCameraTransceiver||\"sendrecv\"!==this._localCameraTransceiver.direction)}trackIsVideoInput(e){return!!this._localCameraTransceiver&&(e===this._localCameraTransceiver.sender.track||e===this._localCameraTransceiver.receiver.track)}setupLocalTransceivers(){this.useTransceivers()&&(this.defaultMediaStream||\"undefined\"==typeof MediaStream||(this.defaultMediaStream=new MediaStream),this._localAudioTransceiver||(this._localAudioTransceiver=this.peer.addTransceiver(\"audio\",{direction:\"inactive\",streams:[this.defaultMediaStream]})),this._localCameraTransceiver||(this._localCameraTransceiver=this.peer.addTransceiver(\"video\",{direction:\"inactive\",streams:[this.defaultMediaStream]})))}replaceAudioTrack(e){return i(this,void 0,void 0,(function*(){return this._localAudioTransceiver&&\"sendrecv\"===this._localAudioTransceiver.direction?(yield this._localAudioTransceiver.sender.replaceTrack(e),!0):(this.logger.info(\"audio transceiver direction is not set up or not activated\"),!1)}))}setAudioInput(e){return i(this,void 0,void 0,(function*(){yield this.setTransceiverInput(this._localAudioTransceiver,e)}))}setVideoInput(e){return i(this,void 0,void 0,(function*(){yield this.setTransceiverInput(this._localCameraTransceiver,e)}))}updateVideoTransceivers(e,t){if(!this.useTransceivers())return t.array();const i=this.peer.getTransceivers();return this.videoSubscriptions=[0],t=t.clone(),this.updateTransceivers(i,e,t),this.logger.debug((()=>this.debugDumpTransceivers())),this.videoSubscriptions}updateTransceivers(e,t,i){const n=i.array();0===e.length||e[0].stop?0!==e.length&&this.updateTransceiverWithStop(e,t,n):(this.logger.info(\"Updating transceivers without `stop` function\"),this.updateTransceiverWithoutStop(e,t,n));for(const e of n){const i=this.peer.addTransceiver(\"video\",{direction:\"recvonly\",streams:[new MediaStream]});this.streamIdToTransceiver.set(e,i),this.groupIdToTransceiver.set(t.groupIdForStreamId(e),i),this.videoSubscriptions.push(e),this.logger.info(`adding transceiver mid: ${i.mid} subscription: ${e} direction: recvonly`)}}updateTransceiverWithStop(e,t,i){let n=1;this.videoSubscriptions=[0];for(const r of e){if(r===this._localCameraTransceiver||!this.transceiverIsVideo(r)||!r.mid)continue;let e=!1;const s=t.streamIdForTrack(\"v_\"+r.mid);if(\"inactive\"!==r.direction&&void 0!==s)for(const[o,a]of i.entries())if(t.StreamIdsInSameGroup(s,a)){r.direction=\"recvonly\",this.videoSubscriptions[n]=a,e=!0,this.streamIdToTransceiver.delete(s),this.streamIdToTransceiver.set(a,r),i.splice(o,1);break}if(!e){this.videoSubscriptions[n]=0,this.logger.info(`Stopping MID: ${r.mid}, direction: ${r.direction}, current direction: ${r.currentDirection}`),r.stop();for(const[e,i]of this.streamIdToTransceiver.entries())r.mid===i.mid&&(this.streamIdToTransceiver.delete(e),this.groupIdToTransceiver.delete(t.groupIdForStreamId(e)))}n+=1}}updateTransceiverWithoutStop(e,t,i){let n=1;for(const r of e)if(r!==this._localCameraTransceiver&&this.transceiverIsVideo(r)){if(this.videoSubscriptions[n]=0,\"inactive\"!==r.direction){const e=t.streamIdForTrack(\"v_\"+r.mid);if(void 0!==e)for(const[s,o]of i.entries())if(t.StreamIdsInSameGroup(e,o)){r.direction=\"recvonly\",this.videoSubscriptions[n]=o,this.streamIdToTransceiver.delete(e),this.streamIdToTransceiver.set(o,r),i.splice(s,1);break}}n+=1}n=1;for(const r of e)if(r!==this._localCameraTransceiver&&this.transceiverIsVideo(r)){if(\"inactive\"===r.direction&&i.length>0){r.direction=\"recvonly\";const e=i.shift();this.videoSubscriptions[n]=e,this.streamIdToTransceiver.set(e,r),this.groupIdToTransceiver.set(t.groupIdForStreamId(e),r)}else if(0===this.videoSubscriptions[n]){r.direction=\"inactive\";for(const[e,i]of this.streamIdToTransceiver.entries())r===i&&(this.streamIdToTransceiver.delete(e),this.groupIdToTransceiver.delete(t.groupIdForStreamId(e)))}n+=1}}getMidForStreamId(e){var t;return null===(t=this.streamIdToTransceiver.get(e))||void 0===t?void 0:t.mid}setStreamIdForMid(e,t){for(const[i,n]of this.streamIdToTransceiver.entries())if(n.mid===e)return this.streamIdToTransceiver.delete(i),void this.streamIdToTransceiver.set(t,n)}getMidForGroupId(e){var t;return null===(t=this.groupIdToTransceiver.get(e))||void 0===t?void 0:t.mid}transceiverIsVideo(e){return e.receiver&&e.receiver.track&&\"video\"===e.receiver.track.kind||e.sender&&e.sender.track&&\"video\"===e.sender.track.kind}debugDumpTransceivers(){let e=\"\",t=0;for(const i of this.peer.getTransceivers())this.transceiverIsVideo(i)&&(e+=`transceiver index=${t} mid=${i.mid} subscription=${this.videoSubscriptions[t]} direction=${i.direction}\\n`,t+=1);return e}setTransceiverInput(e,t){return i(this,void 0,void 0,(function*(){e&&(e.direction=t?\"sendrecv\":\"inactive\",yield e.sender.replaceTrack(t))}))}}},7377:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(5785);class s extends r.default{constructor(e,t){super(e,t);let i=2;this.videoQualityControlParameterMap=new Map;for(let e=0;e{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(365);class r extends n.default{constructor(e,t){super(e,t)}setupLocalTransceivers(){this.useTransceivers()&&(this.defaultMediaStream||\"undefined\"==typeof MediaStream||(this.defaultMediaStream=new MediaStream),this._localCameraTransceiver||(this._localCameraTransceiver=this.peer.addTransceiver(\"video\",{direction:\"inactive\",streams:[this.defaultMediaStream]})))}}t.default=r},5308:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.TRANSCRIPTION_DATA_MESSAGE_TOPIC=void 0;const n=i(1877);t.TRANSCRIPTION_DATA_MESSAGE_TOPIC=\"aws:chime:transcription\",t.default=class{constructor(e){this.realtimeController=e,this.transcriptEventCallbacks=new Set}subscribeToTranscriptEvent(e){0===this.transcriptEventCallbacks.size&&this.realtimeController.realtimeSubscribeToReceiveDataMessage(t.TRANSCRIPTION_DATA_MESSAGE_TOPIC,(e=>{for(const t of n.TranscriptEventConverter.from(e))for(const e of this.transcriptEventCallbacks)e(t)})),this.transcriptEventCallbacks.add(e)}unsubscribeFromTranscriptEvent(e){this.transcriptEventCallbacks.delete(e),0===this.transcriptEventCallbacks.size&&this.realtimeController.realtimeUnsubscribeFromReceiveDataMessage(t.TRANSCRIPTION_DATA_MESSAGE_TOPIC)}}},4739:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{}},2471:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{}},7210:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{}},1877:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.TranscriptEventConverter=void 0;const n=i(289),r=i(4739),s=i(1288),o=i(1326),a=i(6864),c={[n.SdkTranscriptionStatus.Type.STARTED]:o.default.STARTED,[n.SdkTranscriptionStatus.Type.INTERRUPTED]:o.default.INTERRUPTED,[n.SdkTranscriptionStatus.Type.RESUMED]:o.default.RESUMED,[n.SdkTranscriptionStatus.Type.STOPPED]:o.default.STOPPED,[n.SdkTranscriptionStatus.Type.FAILED]:o.default.FAILED};t.TranscriptEventConverter=class{static from(e){let t;try{t=n.SdkTranscriptFrame.decode(e.data)}catch(e){throw new Error(\"Cannot decode transcript data message: \"+e)}const i=[];for(const e of t.events)if(e.status){const t=c[e.status.type];if(!t)continue;const n=new s.default;n.type=t,n.eventTimeMs=e.status.eventTime,n.transcriptionRegion=e.status.transcriptionRegion,n.transcriptionConfiguration=e.status.transcriptionConfiguration,e.status.message&&(n.message=e.status.message),i.push(n)}else if(e.transcript){const t=new r.default;t.results=[];for(const i of e.transcript.results){const e={channelId:i.channelId,isPartial:i.isPartial,resultId:i.resultId,startTimeMs:i.startTime,endTimeMs:i.endTime,alternatives:[]};if(i.languageCode&&(e.languageCode=i.languageCode),i.languageIdentification&&i.languageIdentification.length>0){e.languageIdentification=[];for(const t of i.languageIdentification){const i={languageCode:t.languageCode,score:t.score};e.languageIdentification.push(i)}}for(const t of i.alternatives){const i={items:[],transcript:t.transcript};for(const e of t.items){const t={content:e.content,attendee:{attendeeId:e.speakerAttendeeId,externalUserId:e.speakerExternalUserId},startTimeMs:e.startTime,endTimeMs:e.endTime,type:null};switch(e.vocabularyFilterMatch&&(t.vocabularyFilterMatch=e.vocabularyFilterMatch),e.hasOwnProperty(\"stable\")&&(t.stable=e.stable),e.hasOwnProperty(\"confidence\")&&(t.confidence=e.confidence),e.type){case n.SdkTranscriptItem.Type.PRONUNCIATION:t.type=a.default.PRONUNCIATION;break;case n.SdkTranscriptItem.Type.PUNCTUATION:t.type=a.default.PUNCTUATION}i.items.push(t)}for(const e of t.entities){i.entities||(i.entities=[]);const t={category:e.category,confidence:e.confidence,content:e.content,startTimeMs:e.startTime,endTimeMs:e.endTime};e.type&&(t.type=e.type),i.entities.push(t)}e.alternatives.push(i)}t.results.push(e)}i.push(t)}return i}}},1741:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{}},6864:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e.PRONUNCIATION=\"pronunciation\",e.PUNCTUATION=\"punctuation\"}(i||(i={})),t.default=i},9063:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{}},5323:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{}},1288:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{}},1326:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e.STARTED=\"started\",e.INTERRUPTED=\"interrupted\",e.RESUMED=\"resumed\",e.STOPPED=\"stopped\",e.FAILED=\"failed\"}(i||(i={})),t.default=i},8627:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(2238),r=i(4046);class s{constructor(e){var t,i,r,o,a,c,d;try{this.parserResult=navigator&&navigator.userAgent?new n.UAParser(navigator.userAgent).getResult():void 0}catch(t){e.error(t.message)}this.browserMajorVersion=(null===(r=null===(i=null===(t=this.parserResult)||void 0===t?void 0:t.browser)||void 0===i?void 0:i.version)||void 0===r?void 0:r.split(\".\")[0])||s.UNAVAILABLE,this.browserName=(null===(o=this.parserResult)||void 0===o?void 0:o.browser.name)||s.UNAVAILABLE,this.browserVersion=(null===(a=this.parserResult)||void 0===a?void 0:a.browser.version)||s.UNAVAILABLE,this.deviceName=[(null===(c=this.parserResult)||void 0===c?void 0:c.device.vendor)||\"\",(null===(d=this.parserResult)||void 0===d?void 0:d.device.model)||\"\"].join(\" \").trim()||s.UNAVAILABLE}getParserResult(){var e,t;return{browserMajorVersion:this.browserMajorVersion,browserName:this.browserName,browserVersion:this.browserVersion,deviceName:this.deviceName,osName:(null===(e=this.parserResult)||void 0===e?void 0:e.os.name)||s.UNAVAILABLE,osVersion:(null===(t=this.parserResult)||void 0===t?void 0:t.os.version)||s.UNAVAILABLE,sdkVersion:r.default.sdkVersion,sdkName:r.default.sdkName}}}t.default=s,s.UNAVAILABLE=\"Unavailable\"},1515:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(){this.queue=Promise.resolve()}add(e){return new Promise(((t,i)=>{this.queue=this.queue.then(e).then(t).catch(i)}))}}},8660:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.None=t.Some=t.Maybe=void 0;class i{static of(e){return null==e?r.of():n.of(e)}}t.Maybe=i;class n{constructor(e){this.value=e,this.isSome=!0,this.isNone=!1}map(e){return i.of(e(this.value))}flatMap(e){return e(this.value)}get(){return this.value}getOrElse(e){return this.value}defaulting(e){return i.of(this.getOrElse(e))}static of(e){if(null==e)throw new Error(\"value is ${value}\");return new n(e)}}t.Some=n;class r{constructor(){this.isSome=!1,this.isNone=!0}get(){throw new Error(\"value is null\")}getOrElse(e){return e}map(e){return new r}flatMap(e){return new r}defaulting(e){return i.of(this.getOrElse(e))}static of(){return new r}}t.None=r},8690:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.getFormattedOffset=t.getDefaultAssetSpec=t.toLowerCasePropertyNames=t.isIFramed=t.wait=void 0;const n=i(4046);t.wait=function(e){return new Promise((t=>setTimeout(t,e)))},t.isIFramed=function(){var e;try{return\"IFRAME\"===(null===(e=window.frameElement)||void 0===e?void 0:e.nodeName)||parent!==top}catch(e){return!0}},t.toLowerCasePropertyNames=function e(t){return null===t?null:\"object\"!=typeof t?t:Array.isArray(t)?t.map(e):Object.keys(t).reduce(((i,n)=>{const r=t[n],s=\"object\"==typeof r?e(r):r;return i[n.toLowerCase()]=s,i}),{})},t.getDefaultAssetSpec=function(){const e=n.default.sdkVersionSemVer;return{assetGroup:`sdk-${e.major}.${e.minor}`}},t.getFormattedOffset=function(e){const t=Math.abs(e);return`${e<=0?\"+\":\"-\"}${Math.floor(t/60).toString().padStart(2,\"0\")}:${Math.floor(t%60).toString().padStart(2,\"0\")}`}},4046:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(543),r=i(2336);class s{static get sdkName(){return\"amazon-chime-sdk-js\"}static get sdkVersion(){return r.default.semverString}static get sdkVersionSemVer(){var e,t,i,n;const s=r.default.semverString.match(/^(?[0-9]+)\\.(?[0-9]+)((?:\\.(?[0-9]+))(?:-(?[a-zA-Z]+(\\.[0-9])*))?)?/);return{major:null===(e=null==s?void 0:s.groups)||void 0===e?void 0:e.major,minor:null===(t=null==s?void 0:s.groups)||void 0===t?void 0:t.minor,patch:null===(i=null==s?void 0:s.groups)||void 0===i?void 0:i.patch,preRelease:null===(n=null==s?void 0:s.groups)||void 0===n?void 0:n.preRelease}}static get buildSHA(){return r.default.hash.substr(1)}static get sdkUserAgentLowResolution(){const e=new n.default;return`${e.name()}-${e.majorVersion()}`}static urlWithVersion(e){const t=new URL(e);return t.searchParams.append(s.X_AMZN_VERSION,s.sdkVersion),t.searchParams.append(s.X_AMZN_USER_AGENT,s.sdkUserAgentLowResolution),t.toString()}}t.default=s,s.X_AMZN_VERSION=\"X-Amzn-Version\",s.X_AMZN_USER_AGENT=\"X-Amzn-User-Agent\"},2336:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default={hash:\"64a3f79\",raw:\"v3.15.0\",semverString:\"3.15.0\"}},1133:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});class i{constructor(e,t,i,n,r,s=1){this.cameraWidth=e,this.cameraHeight=t,this.cameraFrameRate=i,this.maxEncodeBitrateKbps=n,this.isSimulcast=r,this.scaleResolutionDownBy=s}equal(e){let t=e.captureWidth()===this.cameraWidth&&e.captureHeight()===this.cameraHeight&&e.captureFrameRate()===this.cameraFrameRate&&e.encodeBitrates().length===this.encodeBitrates().length&&e.encodeScaleResolutionDownBy().length===this.encodeScaleResolutionDownBy().length&&e.encodeWidths().length===this.encodeWidths().length&&e.encodeHeights().length===this.encodeHeights().length;if(t)for(let i=0;i{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(1508);t.default=class{constructor(e){this.selfAttendeeId=e,this.reset()}reset(){this.optimalReceiveSet=new n.default,this.subscribedReceiveSet=new n.default,this.videoSources=void 0}updateIndex(e){this.videoIndex=e,this.optimalReceiveSet=this.calculateOptimalReceiveSet(e)}updateMetrics(e){}wantsResubscribe(){return!this.subscribedReceiveSet.equal(this.optimalReceiveSet)}chooseSubscriptions(){return this.subscribedReceiveSet=this.optimalReceiveSet.clone(),this.subscribedReceiveSet.clone()}chooseRemoteVideoSources(e){this.videoSources=e,this.optimalReceiveSet=this.calculateOptimalReceiveSet(this.videoIndex).clone()}calculateOptimalReceiveSet(e){const t=new n.default;if(!this.videoIndex||this.videoIndex.allStreams().empty())return t;const i=e.highestQualityStreamFromEachGroupExcludingSelf(this.selfAttendeeId);if(void 0===this.videoSources)return i;const r=this.videoIndex.remoteStreamDescriptions(),s=new Map;for(const e of r)i.contain(e.streamId)&&s.set(e.attendeeId,e.streamId);for(const e of this.videoSources){const i=e.attendee.attendeeId;s.has(i)&&t.add(s.get(i))}return t}}},5319:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(1508);t.default=class{reset(){}updateIndex(e){}updateMetrics(e){}wantsResubscribe(){return!1}chooseSubscriptions(){return new n.default}}},2721:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.TargetDisplaySize=void 0,function(e){e[e.Low=0]=\"Low\",e[e.Medium=1]=\"Medium\",e[e.High=2]=\"High\",e[e.Maximum=3]=\"Maximum\"}(i=t.TargetDisplaySize||(t.TargetDisplaySize={})),t.default=i},2880:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(8890),r=i(1754),s=i(1819),o=i(4992);class a extends o.default{constructor(e){super(e),this.logger=e,super.shouldPauseTiles=!1,this.videoPreferences=void 0}reset(){super.reset(),super.shouldPauseTiles=!1,this.videoPreferences=void 0}updateIndex(e){super.updateIndex(e);const t=s.VideoPreferences.prepare();let i=!1;const o=e.remoteStreamDescriptions();for(const e of o)t.some((t=>t.attendeeId===e.attendeeId))||(e.attendeeId.endsWith(n.default.Modality)?(t.add(new r.default(e.attendeeId,1)),i=!0):t.add(new r.default(e.attendeeId,2)));i?(this.videoPreferences=t.build(),this.videoPreferencesUpdated=!0):this.videoPreferences=void 0}chooseRemoteVideoSources(e){this.logger.error(\"chooseRemoteVideoSources should not be called by VideoAdaptiveProbePolicy\")}}t.default=a},1754:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(2721);class r{constructor(e,t,i){this.attendeeId=e,this.priority=t,this.targetSize=void 0!==i?i:n.default.High}partialCompare(e){return this.priority-e.priority}equals(e){return this.attendeeId===e.attendeeId&&this.targetSize===e.targetSize&&this.priority===e.priority}clone(){return new r(this.attendeeId,this.priority,this.targetSize)}targetSizeToBitrateKbps(e){switch(e){case n.default.Maximum:return r.MAXIMUM_BITRATE_KBPS;case n.default.High:return r.HIGH_BITRATE_KBPS;case n.default.Medium:return r.MID_BITRATE_KBPS;case n.default.Low:return r.LOW_BITRATE_KBPS}}}t.default=r,r.LOW_BITRATE_KBPS=300,r.MID_BITRATE_KBPS=600,r.HIGH_BITRATE_KBPS=1400,r.MAXIMUM_BITRATE_KBPS=1e4},1819:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.VideoPreferences=t.MutableVideoPreferences=t.convertVideoPreferencesToSignalingClientVideoSubscriptionConfiguration=void 0;const n=i(9101);t.convertVideoPreferencesToSignalingClientVideoSubscriptionConfiguration=function(e,t,i){if(void 0===e.transceiverController.getMidForGroupId||void 0===e.videoStreamIndex.attendeeIdForGroupId||void 0===i)return[];const r=new Array,s=new Map,o=new Map;for(const i of t){const t=e.transceiverController.getMidForGroupId(i);if(void 0===t)continue;const n=e.videoStreamIndex.attendeeIdForGroupId(i);s.set(n,t),o.set(n,i)}for(const e of i){const t=new n.default,i=s.get(e.attendeeId);void 0!==i&&(t.mid=i,t.attendeeId=e.attendeeId,t.groupId=o.get(e.attendeeId),t.priority=Number.MAX_SAFE_INTEGER-e.priority,t.targetBitrateKbps=e.targetSizeToBitrateKbps(e.targetSize),r.push(t))}return r};class r{constructor(e=[]){this.items=e}static default(){return new r([])}[Symbol.iterator](){let e=0;const t=this.items;return{next:()=>e!t.equals(e)))}clear(){this.items=[]}isEmpty(){return 0===this.items.length}equals(e){if(e===this)return!0;if(e.items.length!==this.items.length)return!1;for(const t of this.items)if(!e.items.some((e=>e.equals(t))))return!1;return!0}has(e){return this.items.some((t=>t.equals(e)))}some(e){return this.items.some(e)}clone(){return new r([...this.items])}sort(){this.items.sort(((e,t)=>e.partialCompare(t)))}modify(){return new s(this)}}class s{constructor(e=new r){this.items=e,this.copied=!1}cow(){this.copied||(this.items=this.items.clone(),this.copied=!0)}add(e){this.items.has(e)||(this.cow(),this.items.add(e))}replaceFirst(e,t){this.items.has(e)&&!this.items.some(t)||(this.cow(),this.items.replaceFirst(e,t))}remove(e){this.items.has(e)&&(this.cow(),this.items.remove(e))}some(e){return this.items.some(e)}clear(){this.items.isEmpty()||(this.cow(),this.items.clear())}build(){return this.copied&&this.items.sort(),this.copied=!1,this.items}}class o{constructor(e){this.builder=e}add(e){this.builder.add(e)}replaceFirst(e,t){this.builder.replaceFirst(e,t)}remove(e){this.builder.remove(e)}some(e){return this.builder.some(e)}clear(){this.builder.clear()}build(){return new a(this.builder.build())}}t.MutableVideoPreferences=o;class a{constructor(e){this.items=e}static prepare(){return new o(new s)}static default(){return new a(r.default())}[Symbol.iterator](){return this.items[Symbol.iterator]()}highestPriority(){var e;return null===(e=this.items.first())||void 0===e?void 0:e.priority}sorted(){return this.items[Symbol.iterator]()}equals(e){return e===this||this.items.equals(e.items)}modify(){return new o(this.items.modify())}some(e){return this.items.some(e)}isEmpty(){return this.items.isEmpty()}clone(){const e=a.prepare();for(const t of this.items)e.add(t.clone());return e.build()}}t.VideoPreferences=a,t.default=a},4992:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(7602),r=i(6196),s=i(9496),o=i(8890),a=i(813),c=i(7103),d=i(60),l=i(1508),u=i(5185),h=i(2721),p=i(1754),m=i(1819),f=i(1034);class g{constructor(){this.bandwidthEstimateKbps=0,this.usedBandwidthKbps=0,this.packetsLost=0,this.nackCount=0,this.rttMs=0}}class v{constructor(e,t=f.default.Default){this.logger=e,this.videoPriorityBasedPolicyConfig=t,this.shouldPauseTiles=!0,this.observerQueue=new Set,this.pausedBwAttendeeIds=new Set,this.wantsResubscribeObserver=void 0,this.reset()}reset(){this.allHighestPolicy=new u.default(\"\"),this.optimalReceiveSet=new l.default,this.optimalReceiveStreams=[],this.optimalNonPausedReceiveStreams=[],this.subscribedReceiveSet=new l.default,this.subscribedReceiveStreams=[],this.videoPreferences=void 0,this.defaultVideoPreferences=void 0,this.shouldPauseTiles=!0,this.pausedStreamIds=new l.default,this.pausedBwAttendeeIds=new Set,this.videoPreferencesUpdated=!1,this.logCount=0,this.startupPeriod=!0,this.usingPrevTargetRate=!1,this.rateProbeState=\"Not Probing\",this.firstEstimateTimestamp=0,this.lastUpgradeRateKbps=0,this.timeBeforeAllowSubscribeMs=v.MIN_TIME_BETWEEN_SUBSCRIBE_MS,this.lastProbeTimestamp=Date.now(),this.timeBeforeAllowProbeMs=v.MIN_TIME_BETWEEN_PROBE_MS,this.downlinkStats=new g,this.prevDownlinkStats=new g,this.probeFailed=!1,this.serverSideNetworkAdaption=this.videoPriorityBasedPolicyConfig.serverSideNetworkAdaption,this.pendingActionAfterUpdatedPreferences=!1}bindToTileController(e){this.tileController=e,this.logger.info(\"tileController bound\")}setWantsResubscribeObserver(e){this.wantsResubscribeObserver=e}chooseRemoteVideoSources(e){var t;if(!(null===(t=this.videoPreferences)||void 0===t?void 0:t.equals(e)))if(this.videoPreferences=null==e?void 0:e.clone(),c.serverSideNetworkAdaptionIsNoneOrDefault(this.serverSideNetworkAdaption)||(this.pendingActionAfterUpdatedPreferences=!0,void 0!==this.wantsResubscribeObserver&&(this.wantsResubscribeObserver(),this.pendingActionAfterUpdatedPreferences=!1),this.serverSideNetworkAdaption!==c.default.BandwidthProbingAndRemoteVideoQualityAdaption))this.videoPreferencesUpdated=!0,this.logger.info(`bwe: setVideoPreferences bwe: new preferences: ${JSON.stringify(e)}`);else{const e=new Array;for(const t of this.videoPreferences){const i=new d.default;i.attendee=new n.default,i.attendee.attendeeId=t.attendeeId,e.push(i)}this.allHighestPolicy.chooseRemoteVideoSources(e)}}updateIndex(e){this.videoIndex=e,this.serverSideNetworkAdaption===c.default.BandwidthProbingAndRemoteVideoQualityAdaption&&this.allHighestPolicy.updateIndex(e),this.videoPreferences||this.updateDefaultVideoPreferences()}updateDefaultVideoPreferences(){const e=new Set;for(const t of this.videoIndex.remoteStreamDescriptions())e.add(t.attendeeId);const t=m.VideoPreferences.prepare(),i=e.size;let n=h.default.High;i>8?n=h.default.Low:i>4&&(n=h.default.Medium);for(const i of e)t.add(new p.default(i,1,n));this.defaultVideoPreferences=t.build()}updateMetrics(e){if(!this.videoIndex||this.videoIndex.allStreams().empty())return;this.prevDownlinkStats=this.downlinkStats,this.downlinkStats=new g;const t=e.getObservableMetrics();this.downlinkStats.bandwidthEstimateKbps=t.availableIncomingBitrate/1e3;for(const t in e.streamMetricReports){const i=Number.parseInt(t,10),n=e.streamMetricReports[i];n.direction===r.default.DOWNSTREAM&&n.mediaType===s.default.VIDEO&&(n.currentMetrics.hasOwnProperty(\"nackCount\")&&(this.downlinkStats.nackCount+=e.countPerSecond(\"nackCount\",i)),n.currentMetrics.hasOwnProperty(\"packetsLost\")&&(this.downlinkStats.packetsLost+=e.countPerSecond(\"packetsLost\",i)),n.currentMetrics.hasOwnProperty(\"bytesReceived\")&&(this.downlinkStats.usedBandwidthKbps+=e.bitsPerSecond(\"bytesReceived\",i)/1e3))}}wantsResubscribe(){let e=!1;return c.serverSideNetworkAdaptionIsNoneOrDefault(this.serverSideNetworkAdaption)||(e||(e=this.pendingActionAfterUpdatedPreferences),this.serverSideNetworkAdaption!==c.default.BandwidthProbingAndRemoteVideoQualityAdaption)?(this.calculateOptimalReceiveSet(),e||(e=!this.subscribedReceiveSet.equal(this.optimalReceiveSet)),e):e||this.allHighestPolicy.wantsResubscribe()}chooseSubscriptions(){return c.serverSideNetworkAdaptionIsNoneOrDefault(this.serverSideNetworkAdaption)||(this.pendingActionAfterUpdatedPreferences=!1,this.serverSideNetworkAdaption!==c.default.BandwidthProbingAndRemoteVideoQualityAdaption)?(this.subscribedReceiveSet.equal(this.optimalReceiveSet)||(this.lastSubscribeTimestamp=Date.now()),this.subscribedReceiveSet=this.optimalReceiveSet.clone(),this.subscribedReceiveStreams=this.optimalReceiveStreams.slice(),this.subscribedReceiveSet.clone()):this.allHighestPolicy.chooseSubscriptions()}addObserver(e){this.observerQueue.add(e)}removeObserver(e){this.observerQueue.delete(e)}forEachObserver(e){for(const t of this.observerQueue)e(t)}setVideoPriorityBasedPolicyConfigs(e){this.videoPriorityBasedPolicyConfig=e}calculateOptimalReceiveStreams(){var e;const t=[],i=this.videoIndex.remoteStreamDescriptions();if(0===i.length||(null===(e=this.videoPreferences)||void 0===e?void 0:e.isEmpty()))return void(this.optimalReceiveStreams=[]);const n=this.rateProbeState;this.cleanBwPausedTiles(i),this.handleAppPausedStreams(t,i);const r=this.availStreamsSameAsLast(i),s=!this.startupPeriod&&r;if(s&&Date.now()-this.lastSubscribeTimestampe.maxBitrateKbps===t.maxBitrateKbps?e.streamId-t.streamId:e.maxBitrateKbps-t.maxBitrateKbps));for(const e of i)(0===e.avgBitrateKbps||e.avgBitrateKbps>e.maxBitrateKbps)&&(e.attendeeId.endsWith(o.default.Modality)&&e.maxBitrateKbps<100?e.maxBitrateKbps=e.avgBitrateKbps:e.avgBitrateKbps=e.maxBitrateKbps);const d={targetDownlinkBitrate:0,chosenTotalBitrate:0,deltaToNextUpgrade:0};d.targetDownlinkBitrate=this.determineTargetRate();const l=this.subscribedReceiveSet.size(),u=this.downlinkStats.bandwidthEstimateKbps,h=!this.videoPriorityBasedPolicyConfig.allowSubscribe(l,u);if(this.probeFailed&&(this.probeFailed=!1,this.timeBeforeAllowSubscribeMs=v.MIN_TIME_BETWEEN_SUBSCRIBE_MS,s&&h))return;const p=this.priorityPolicy(d,i,t);let m=0;if(c.serverSideNetworkAdaptionIsNoneOrDefault(this.serverSideNetworkAdaption)&&!this.startupPeriod&&r?\"Probing\"===this.rateProbeState?m=this.handleProbe(t,d.targetDownlinkBitrate):0!==d.deltaToNextUpgrade&&(m=this.maybeOverrideOrProbe(t,d,p)):(this.setProbeState(\"Not Probing\"),this.lastUpgradeRateKbps=0),this.prevRemoteInfos=i,this.videoPreferencesUpdated=!1,1===m)return this.logger.info(`bwe: keepSameSubscriptions stats:${JSON.stringify(this.downlinkStats)}`),void(this.prevTargetRateKbps=d.targetDownlinkBitrate);if(2===m){const e=this.calculateSubscribeRate(this.preProbeNonPausedReceiveStreams);return this.optimalReceiveStreams=this.preProbeReceiveStreams.slice(),this.processBwPausedStreams(i,this.preProbeNonPausedReceiveStreams),void this.logger.info(\"bwe: Use Pre-Probe subscription subscribedRate:\"+e)}this.optimalNonPausedReceiveStreams=t.slice();const f=this.pausedBwAttendeeIds.size;this.processBwPausedStreams(i,t),this.logger.getLogLevel()<=a.LogLevel.INFO&&(this.logCount%15==0||this.rateProbeState!==n||this.optimalReceiveStreams.length!==t.length||f!==this.pausedBwAttendeeIds.size)&&(this.logger.info(this.policyStateLogStr(i,d.targetDownlinkBitrate)),this.logCount=0),this.logCount++,this.prevTargetRateKbps=d.targetDownlinkBitrate,this.optimalReceiveStreams=t.slice()}calculateOptimalReceiveSet(){const e=new l.default;this.calculateOptimalReceiveStreams();for(const t of this.optimalReceiveStreams)e.add(t.streamId);if(!this.optimalReceiveSet.equal(e)){const t=this.calculateSubscribeRate(this.optimalReceiveStreams);this.logger.info(`bwe: new streamSelection: ${JSON.stringify(e)} subscribedRate:${t}`)}this.optimalReceiveSet=e}determineTargetRate(){let e=0;const t=Date.now();return 0!==this.downlinkStats.bandwidthEstimateKbps?(0===this.firstEstimateTimestamp&&(this.firstEstimateTimestamp=t),this.startupPeriod&&(this.downlinkStats.bandwidthEstimateKbps>v.DEFAULT_BANDWIDTH_KBPS||this.downlinkStats.packetsLost>0||t-this.firstEstimateTimestamp>v.STARTUP_PERIOD_MS&&this.downlinkStats.bandwidthEstimateKbps<=this.prevDownlinkStats.bandwidthEstimateKbps)&&(this.startupPeriod=!1,this.prevTargetRateKbps=this.downlinkStats.bandwidthEstimateKbps),this.startupPeriod?e=v.DEFAULT_BANDWIDTH_KBPS:\"Probing\"===this.rateProbeState&&this.downlinkStats.usedBandwidthKbps>this.downlinkStats.bandwidthEstimateKbps&&this.downlinkStats.packetsLost\"bwe: ValidateRate: Using Previous rate \"+this.prevTargetRateKbps)),this.usingPrevTargetRate=!0,e=this.prevTargetRateKbps):this.usingPrevTargetRate=!1,e}setProbeState(e){if(this.rateProbeState===e)return!1;const t=Date.now();switch(e){case\"Not Probing\":this.probePendingStartTimestamp=0;break;case\"Probe Pending\":if(!(0===this.lastProbeTimestamp||t-this.lastProbeTimestamp>v.MIN_TIME_BETWEEN_PROBE_MS))return!1;this.probePendingStartTimestamp=t;break;case\"Probing\":if(!(t-this.probePendingStartTimestamp>this.timeBeforeAllowProbeMs))return!1;this.lastProbeTimestamp=t,this.preProbeReceiveStreams=this.subscribedReceiveStreams.slice(),this.preProbeNonPausedReceiveStreams=this.optimalNonPausedReceiveStreams,this.timeBeforeAllowProbeMs=Math.min(2*this.timeBeforeAllowProbeMs,v.MAX_HOLD_BEFORE_PROBE_MS)}return this.logger.info(\"bwe: setProbeState to \"+e+\" from \"+this.rateProbeState),this.rateProbeState=e,!0}upgradeToStream(e,t){for(let i=0;iv.MAX_ALLOWED_PROBE_TIME_MS)return this.logger.info(\"bwe: Canceling probe due to timeout\"),this.setProbeState(\"Not Probing\"),0;if(this.downlinkStats.packetsLost>0&&(this.logger.info(`bwe: Probe encountering packets lost:${this.downlinkStats.packetsLost}`),this.downlinkStats.packetsLost>v.SPURIOUS_PACKET_LOST_THRESHOLD))return this.setProbeState(\"Not Probing\"),this.logger.info(`bwe: Canceling probe due to packets lost:${this.downlinkStats.packetsLost}`),this.probeFailed=!0,this.timeBeforeAllowSubscribeMs=3*Math.max(v.MIN_TIME_BETWEEN_SUBSCRIBE_MS,this.timeBeforeAllowSubscribeMs),2;const i=this.calculateSubscribeRate(this.optimalReceiveStreams);return this.chosenStreamsSameAsLast(e)||t>i?(this.logger.info(\"bwe: Probe successful\"),this.setProbeState(\"Not Probing\"),this.timeBeforeAllowProbeMs=v.MIN_TIME_BETWEEN_PROBE_MS,0):1}maybeOverrideOrProbe(e,t,i){const n=this.chosenStreamsSameAsLast(e);let r=0;const s=t.targetDownlinkBitrate>v.LOW_BITRATE_THRESHOLD_KBPS?v.TARGET_RATE_CHANGE_TRIGGER_PERCENT:2*v.TARGET_RATE_CHANGE_TRIGGER_PERCENT,o=t.targetDownlinkBitrate*s/100;if(this.targetRateBaselineForDeltaCheckKbps=void 0!==this.targetRateBaselineForDeltaCheckKbps?this.targetRateBaselineForDeltaCheckKbps:this.prevTargetRateKbps,!n&&Math.abs(t.targetDownlinkBitrate-this.targetRateBaselineForDeltaCheckKbps)this.prevDownlinkStats.packetsLost)return this.setProbeState(\"Not Probing\"),this.lastUpgradeRateKbps=0,r;if(n||1===r)switch(this.rateProbeState){case\"Not Probing\":this.setProbeState(\"Probe Pending\");break;case\"Probe Pending\":this.setProbeState(\"Probing\")&&(this.upgradeToStream(e,i),r=0)}else this.setProbeState(\"Not Probing\");return r}calculateSubscribeRate(e){let t=0;for(const i of e)this.pausedStreamIds.contain(i.streamId)||this.pausedBwAttendeeIds.has(i.attendeeId)||(t+=i.maxBitrateKbps);return t}handleAppPausedStreams(e,t){if(!this.tileController)return void this.logger.warn(\"tileController not found!\");this.pausedStreamIds=new l.default;const i=this.tileController.getAllRemoteVideoTiles();for(const n of i){const i=n.state();if(i.paused&&!this.pausedBwAttendeeIds.has(i.boundAttendeeId)){let n=t.length;for(;n--;)t[n].attendeeId===i.boundAttendeeId&&(this.logger.info(\"bwe: removed paused attendee \"+i.boundAttendeeId+\" streamId: \"+t[n].streamId),this.pausedStreamIds.add(t[n].streamId),this.subscribedReceiveSet.contain(t[n].streamId)&&e.push(t[n]),t.splice(n,1))}}}processBwPausedStreams(e,t){if(!this.tileController)return void this.logger.warn(\"tileController not found!\");const i=this.getCurrentVideoPreferences();if(i&&this.shouldPauseTiles){const n=this.tileController.getAllVideoTiles();for(const r of i){const i=this.getVideoTileForAttendeeId(r.attendeeId,n),s=(null==i?void 0:i.state().paused)||!1;if(t.some((e=>e.attendeeId===r.attendeeId)))s&&this.pausedBwAttendeeIds.has(r.attendeeId)&&(this.logger.info(`bwe: unpausing attendee ${r.attendeeId} due to bandwidth`),this.forEachObserver((e=>{e.tileWillBeUnpausedByDownlinkPolicy(i.id())})),this.tileController.unpauseVideoTile(i.id()),this.pausedBwAttendeeIds.delete(r.attendeeId));else{const n=e.some((e=>e.attendeeId===r.attendeeId));if(i&&n){const e=this.optimalReceiveStreams.find((e=>e.attendeeId===r.attendeeId));void 0!==e&&(s||(this.logger.info(`bwe: pausing streamId ${e.streamId} attendee ${r.attendeeId} due to bandwidth`),this.forEachObserver((e=>{e.tileWillBePausedByDownlinkPolicy(i.id())})),this.tileController.pauseVideoTile(i.id())),t.push(e)),this.pausedBwAttendeeIds.add(r.attendeeId)}else if(n){const e=this.tileController.addVideoTile();e.bindVideoStream(r.attendeeId,!1,null,0,0,0,null),this.forEachObserver((t=>{t.tileWillBePausedByDownlinkPolicy(e.id())})),e.pause(),this.logger.info(`bwe: Created video tile ${e.id()} for bw paused attendee ${r.attendeeId}`),this.pausedBwAttendeeIds.add(r.attendeeId)}}}}}cleanBwPausedTiles(e){if(!this.tileController)return void this.logger.warn(\"tileController not found!\");const t=this.tileController.getAllRemoteVideoTiles(),i=this.getCurrentVideoPreferences();for(const n of t){const t=n.state();t.boundVideoStream||(e.some((e=>e.attendeeId===t.boundAttendeeId))?void 0===i||i.some((e=>e.attendeeId===t.boundAttendeeId))||this.tileController.removeVideoTile(t.tileId):(this.tileController.removeVideoTile(t.tileId),this.logger.info(`bwe: Removed video tile ${t.tileId} for bw paused attendee ${t.boundAttendeeId}`)))}}priorityPolicy(e,t,i){let n;const r=this.getCurrentVideoPreferences(),s=r.highestPriority();let a,c=s;for(;-1!==c;){a=-1;for(const s of r)if(s.priority===c)for(const r of t)r.attendeeId===s.attendeeId&&(i.some((e=>e.groupId===r.groupId))||(e.chosenTotalBitrate+r.avgBitrateKbps<=e.targetDownlinkBitrate?(i.push(r),e.chosenTotalBitrate+=r.avgBitrateKbps):0===e.deltaToNextUpgrade&&(e.deltaToNextUpgrade=r.avgBitrateKbps,n=r)));else if(s.priority>c){a=s.priority;break}for(const s of r)if(s.priority===c){for(const r of t)if(r.attendeeId===s.attendeeId){const a=i.findIndex((e=>e.groupId===r.groupId&&e.maxBitrateKbpsc)break;if(c===s&&0!==e.deltaToNextUpgrade)break;c=a}return n}getVideoTileForAttendeeId(e,t){for(const i of t)if(i.state().boundAttendeeId===e)return i;return null}canUpgrade(e,t,i,n){let r=!1;return n?(t===h.default.High||t===h.default.Medium&&e<=i)&&(r=!0):e<=i&&(r=!0),r?(this.logger.info(`bwe: canUpgrade: bitrateKbp: ${e} targetBitrateKbp: ${i}`),!0):(this.logger.info(`bwe: cannot Upgrade: bitrateKbp: ${e} targetBitrateKbp: ${i}`),!1)}hasSimulcastStreams(e,t,i){let n=0;for(const r of e)r.attendeeId===t&&r.groupId===i&&n++;return this.logger.info(`bwe: attendeeId: ${t} groupId: ${i} hasSimulcastStreams: streamCount: ${n}`),n>1}availStreamsSameAsLast(e){if(void 0===this.prevRemoteInfos||e.length!==this.prevRemoteInfos.length||!0===this.videoPreferencesUpdated)return!1;for(const t of e)if(void 0===this.prevRemoteInfos.find((e=>e.groupId===t.groupId&&e.streamId===t.streamId&&e.maxBitrateKbps===t.maxBitrateKbps)))return!1;return!0}chosenStreamsSameAsLast(e){if(this.optimalNonPausedReceiveStreams.length!==e.length)return!1;for(const t of this.optimalNonPausedReceiveStreams)if(!e.some((e=>e.streamId===t.streamId)))return!1;return!0}policyStateLogStr(e,t){const i={targetBitrate:t,subscribedRate:this.calculateSubscribeRate(this.optimalReceiveStreams),probeState:this.rateProbeState,startupPeriod:this.startupPeriod};let n=\"remoteInfos: [\";for(const t of e)n+=`{grpId:${t.groupId} strId:${t.streamId} maxBr:${t.maxBitrateKbps} avgBr:${t.avgBitrateKbps}}, `;n+=\"]\";let r=`bwe: optimalReceiveSet ${JSON.stringify(i)}\\nbwe: prev ${JSON.stringify(this.prevDownlinkStats)}\\nbwe: now ${JSON.stringify(this.downlinkStats)}\\nbwe: ${n}\\n`;return(this.pausedStreamIds.size()>0||this.pausedBwAttendeeIds.size>0)&&(r+=`bwe: paused: app stream ids ${JSON.stringify(this.pausedStreamIds)} bw attendees { ${Array.from(this.pausedBwAttendeeIds).join(\" \")} }\\n`),this.videoPreferences?r+=`bwe: preferences: ${JSON.stringify(this.videoPreferences)}`:r+=`bwe: default preferences: ${JSON.stringify(this.defaultVideoPreferences)}`,r}getCurrentVideoPreferences(){return this.videoPreferences||this.defaultVideoPreferences}getServerSideNetworkAdaption(){return this.serverSideNetworkAdaption}setServerSideNetworkAdaption(e){this.serverSideNetworkAdaption=e,this.setProbeState(\"Not Probing\")}supportedServerSideNetworkAdaptions(){return[c.default.None,c.default.BandwidthProbing,c.default.BandwidthProbingAndRemoteVideoQualityAdaption]}getVideoPreferences(){let e=this.getCurrentVideoPreferences();return e||(e=m.VideoPreferences.prepare().build()),e}}t.default=v,v.DEFAULT_BANDWIDTH_KBPS=2800,v.STARTUP_PERIOD_MS=6e3,v.LARGE_RATE_CHANGE_TRIGGER_PERCENT=20,v.TARGET_RATE_CHANGE_TRIGGER_PERCENT=15,v.LOW_BITRATE_THRESHOLD_KBPS=300,v.MIN_TIME_BETWEEN_PROBE_MS=5e3,v.MIN_TIME_BETWEEN_SUBSCRIBE_MS=2e3,v.MAX_HOLD_BEFORE_PROBE_MS=3e4,v.MAX_ALLOWED_PROBE_TIME_MS=6e4,v.SPURIOUS_PACKET_LOST_THRESHOLD=2,v.USED_BANDWIDTH_OVERRIDE_BUFFER_KBPS=100},1034:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(7103);class r{constructor(e=0,t=0){this.networkIssueResponseDelayFactor=e,this.networkIssueRecoveryDelayFactor=t,this.currentNetworkEvent=0,this.bandwidthDecreaseTimestamp=0,this.referenceBitrate=0,this.serverSideNetworkAdaption=n.default.Default,e<0?e=0:e>1&&(e=1),this.networkIssueResponseDelayFactor=e,t<0?t=0:t>1&&(t=1),this.networkIssueRecoveryDelayFactor=t}allowSubscribe(e,t){let i=0;const n=this.currentNetworkEvent;if(t>this.referenceBitrate)return this.currentNetworkEvent=2,this.referenceBitrate=t,!0;if(ti)return this.referenceBitrate=t,!0;return!1}return this.currentNetworkEvent=0,!1}getSubscribeDelay(e,t){let i=r.MINIMUM_DELAY_MS;const n=r.MAXIMUM_DELAY_MS-r.MINIMUM_DELAY_MS,s=this.networkIssueResponseDelayFactor;return 1===e&&(i+=n*s*(1+t/10),i=Math.min(r.MAXIMUM_DELAY_MS,i)),i}}t.default=r,r.MINIMUM_DELAY_MS=2e3,r.MAXIMUM_DELAY_MS=8e3,r.Default=new r(0,0),r.UnstableNetworkPreset=new r(0,1),r.StableNetworkPreset=new r(1,0)},3663:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{create(){const e={clientWidth:400,clientHeight:300,width:400,height:300,videoWidth:400,videoHeight:300,style:{transform:\"\"},hasAttribute:()=>!1,removeAttribute:()=>{},setAttribute:()=>{},srcObject:!1,paused:!0,pause:()=>{e.paused=!0},play:()=>(e.paused=!1,Promise.resolve())};return e}}},9807:function(e,t){\"use strict\";var i=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e){this.canvas=e,this.destroyed=!1}destroy(){this.canvas=null,this.destroyed=!0}asCanvasImageSource(){return i(this,void 0,void 0,(function*(){return this.destroyed?Promise.reject(\"canvas buffer is destroyed\"):Promise.resolve(this.canvas)}))}asCanvasElement(){return this.canvas}}},8919:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(9807);t.default=class{constructor(e,t){this.logger=e,this.stages=t,this.fr=15,this.outputMediaStream=new MediaStream,this.videoInput=document.createElement(\"video\"),this.canvasOutput=document.createElement(\"canvas\"),this.outputCtx=this.canvasOutput.getContext(\"2d\"),this.canvasInput=document.createElement(\"canvas\"),this.inputCtx=this.canvasInput.getContext(\"2d\"),this.inputVideoStream=null,this.sourceBuffers=[],this.destBuffers=[],this.observers=new Set,this.hasStarted=!1,this.process=e=>n(this,void 0,void 0,(function*(){if(!this.inputVideoStream)return;const e=performance.now();this.videoInput.videoWidth&&(this.canvasInput.width!==this.videoInput.videoWidth&&(this.canvasInput.width=this.videoInput.videoWidth,this.canvasInput.height=this.videoInput.videoHeight,this.sourceBuffers[0].height=this.canvasInput.height,this.sourceBuffers[0].width=this.canvasInput.width,this.sourceBuffers[0].framerate=this.framerate),this.inputCtx.drawImage(this.videoInput,0,0));let t,i=[];i.push(this.sourceBuffers[0]);try{for(const e of this.processors)i=yield e.process(i)}catch(e){return void this.forEachObserver((e=>{e.processingDidFailToStart&&e.processingDidFailToStart()}))}this.destBuffers=i;try{t=yield this.destBuffers[0].asCanvasImageSource()}catch(e){return void(this.inputVideoStream&&(this.logger.info(\"buffers are destroyed and pipeline could not start\"),this.forEachObserver((e=>{e.processingDidFailToStart&&e.processingDidFailToStart()}))))}const n=t.width,r=t.height;0!==n&&0!==r&&(this.canvasOutput.width!==n&&this.canvasOutput.height!==r&&(this.canvasOutput.width=n,this.canvasOutput.height=r),this.outputCtx.drawImage(t,0,0,n,r,0,0,n,r),this.hasStarted||(this.hasStarted=!0,this.forEachObserver((e=>{e.processingDidStart&&e.processingDidStart()}))));const s=performance.now()-e,o=2e3/this.framerate-s,a=Math.max(0,1e3/this.framerate-s);o<=0&&this.forEachObserver((e=>{e.processingLatencyTooHigh&&e.processingLatencyTooHigh(s)})),this.lastTimeOut=setTimeout(this.process,a)}))}destroy(){if(this.stop(),this.stages)for(const e of this.stages)e.destroy()}get framerate(){return this.fr}set framerate(e){this.fr=e<0?15:e}stop(){if(this.videoInput.removeEventListener(\"loadedmetadata\",this.process),this.videoInput.srcObject=null,this.destroyInputMediaStreamAndBuffers(),this.outputMediaStream)for(const e of this.outputMediaStream.getVideoTracks())e.stop();this.lastTimeOut&&(clearTimeout(this.lastTimeOut),this.lastTimeOut=void 0),this.hasStarted&&(this.hasStarted=!1,this.forEachObserver((e=>{e.processingDidStop&&e.processingDidStop()})))}addObserver(e){this.observers.add(e)}removeObserver(e){this.observers.delete(e)}getInputMediaStream(){return n(this,void 0,void 0,(function*(){return this.inputVideoStream}))}getActiveOutputMediaStream(){return this.isOutputMediaStreamActive()||(this.outputMediaStream=this.canvasOutput.captureStream(this.framerate),this.cloneInputAudioTracksToOutput()),this.outputMediaStream}setInputMediaStream(e){return n(this,void 0,void 0,(function*(){if(!e)return void this.stop();if(0===e.getVideoTracks().length)return void this.logger.error(\"No video tracks in input media stream, ignoring\");this.inputVideoStream=e;const t=this.inputVideoStream.getVideoTracks()[0].getSettings();this.logger.info(`processing pipeline input stream settings ${JSON.stringify(t)}`),this.canvasOutput.width=t.width,this.canvasOutput.height=t.height,this.videoInput.addEventListener(\"loadedmetadata\",this.process),this.videoInput.srcObject=this.inputVideoStream,this.videoInput.setAttribute(\"playsinline\",\"true\");const i=new r.default(this.canvasInput);this.sourceBuffers.push(i),this.videoInput.load();try{yield this.videoInput.play()}catch(e){this.logger.warn(\"Video element play() overrided by another load().\")}this.cloneInputAudioTracksToOutput()}))}cloneInputAudioTracksToOutput(){if(this.isOutputMediaStreamActive()&&null!==this.inputVideoStream){for(const e of this.outputMediaStream.getAudioTracks())this.logger.info(`Removing audio track ${e.id} from output stream`),this.outputMediaStream.removeTrack(e);for(const e of this.inputVideoStream.getAudioTracks())this.logger.info(`Adding audio track ${e.id} to output stream`),this.outputMediaStream.addTrack(e)}else this.logger.info(\"Not cloning input audio tracks to output, do not have media streams ready\")}isOutputMediaStreamActive(){return this.outputMediaStream&&this.outputMediaStream.active}set processors(e){this.stages=e}get processors(){return this.stages}forEachObserver(e){for(const t of this.observers)setTimeout((()=>{e(t)}),0)}destroyInputMediaStreamAndBuffers(){if(this.inputVideoStream)for(const e of this.inputVideoStream.getTracks())e.stop();this.inputVideoStream=null;for(const e of this.sourceBuffers)e.destroy();this.sourceBuffers=[]}}},7673:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(543),s=i(8919);class o{constructor(e,t,i,n=new r.default){this.logger=e,this.device=t,this.processors=i,this.browserBehavior=n,this.observers=new Set,this.pipe=new s.default(this.logger,this.processors),this.pipe.addObserver(this)}get outputMediaStream(){return this.pipe.outputMediaStream}passEventControllerToProcessors(e){if(this.pipe.processors)for(const t of this.pipe.processors)\"function\"==typeof t.setEventController&&t.setEventController(e)}chooseNewInnerDevice(e){const t=new o(this.logger,e,this.processors,this.browserBehavior);return t.pipe=this.pipe,t}getInnerDevice(){return this.device}intrinsicDevice(){return n(this,void 0,void 0,(function*(){return this.device}))}transformStream(e){return n(this,void 0,void 0,(function*(){return yield this.pipe.setInputMediaStream(e),this.inputMediaStream=e,this.pipe.getActiveOutputMediaStream()}))}onOutputStreamDisconnect(){this.logger.info(\"DefaultVideoTransformDevice: detach stopping input media stream\");const e=this.device&&this.device.id;if(this.pipe.stop(),!e&&this.inputMediaStream)for(const e of this.inputMediaStream.getVideoTracks())e.stop()}stop(){return n(this,void 0,void 0,(function*(){if(this.inputMediaStream)for(const e of this.inputMediaStream.getVideoTracks())e.stop();this.pipe.destroy(),this.inputMediaStream=null}))}addObserver(e){this.observers.add(e)}removeObserver(e){this.observers.delete(e)}processingDidStart(){this.logger.info(\"video transform device processing started\"),this.forEachObserver((e=>{e.processingDidStart&&e.processingDidStart()}))}processingLatencyTooHigh(e){this.forEachObserver((t=>{t.processingLatencyTooHigh&&t.processingLatencyTooHigh(e)}))}processingDidFailToStart(){this.logger.info(\"video transform device processing failed to start\"),this.forEachObserver((e=>{e.processingDidFailToStart&&e.processingDidFailToStart()}))}processingDidStop(){this.logger.info(\"video transform device processing stopped\"),this.forEachObserver((e=>{e.processingDidStop&&e.processingDidStop()}))}forEachObserver(e){for(const t of this.observers)setTimeout((()=>{e(t)}),0)}}t.default=o},2801:function(e,t){\"use strict\";var i=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{process(e){return i(this,void 0,void 0,(function*(){return e}))}destroy(){return i(this,void 0,void 0,(function*(){}))}}},2826:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.DeferredPromise=void 0,t.DeferredPromise=class{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}getPromise(){return this.promise}resolvePromise(e){this.resolve(e)}resolveAndReplacePromise(e){this.resolve(e),this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}rejectPromise(e){this.reject(e)}rejectAndReplacePromise(e){this.reject(e),this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}},8190:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0}),t.VideoFxCanvasOpsManager=void 0;const r=i(2913);t.VideoFxCanvasOpsManager=class{constructor(e,t){this.streamParameters=e,this.outputCanvas=t,this.configureCanvasPipeline()}getInferenceInputData(e){return this.inferenceCtx.save(),this.inferenceCtx.scale(this.horizontalResizeScalar,this.verticalResizeScalar),this.inferenceCtx.drawImage(e,0,0),this.inferenceCtx.restore(),this.inferenceCtx.getImageData(0,0,r.SEGMENTATION_MODEL.WIDTH_IN_PIXELS,r.SEGMENTATION_MODEL.HEIGHT_IN_PIXELS)}configureForStreamParameters(e){return n(this,void 0,void 0,(function*(){if(this.streamParameters=e,this.outputCanvas.width=this.streamParameters.width,this.outputCanvas.height=this.streamParameters.height,this.backgroundReplacementCanvas){const e=document.createElement(\"canvas\");e.width=this.streamParameters.width,e.height=this.streamParameters.height,e.getContext(\"2d\").drawImage(this.backgroundReplacementCanvas,0,0,this.streamParameters.width,this.streamParameters.height),this.backgroundReplacementCanvas=e}this.configureCanvasPipeline()}))}configureCanvasPipeline(){this.inferenceCanvas=document.createElement(\"canvas\"),this.inferenceCtx=this.inferenceCanvas.getContext(\"2d\",{willReadFrequently:!0}),this.inferenceCanvas.width=r.SEGMENTATION_MODEL.WIDTH_IN_PIXELS,this.inferenceCanvas.height=r.SEGMENTATION_MODEL.HEIGHT_IN_PIXELS,this.horizontalResizeScalar=r.SEGMENTATION_MODEL.WIDTH_IN_PIXELS/this.streamParameters.width,this.verticalResizeScalar=r.SEGMENTATION_MODEL.HEIGHT_IN_PIXELS/this.streamParameters.height}getBackgroundReplacementCanvas(){return this.backgroundReplacementCanvas}loadReplacementBackground(e){return n(this,void 0,void 0,(function*(){const t=e.backgroundReplacement.backgroundImageURL,i=e.backgroundReplacement.defaultColor;if(t)try{const e=yield this.loadImage(t);this.backgroundReplacementImage=e,this.resizeAndSetReplacementImage(this.backgroundReplacementImage)}catch(e){throw this.logger.error(e),new Error(\"Failed to set the replacement image.\")}else this.resizeAndSetReplacementColor(i)}))}resizeAndSetReplacementImage(e){const t=document.createElement(\"canvas\"),i=t.getContext(\"2d\");t.width=this.streamParameters.width,t.height=this.streamParameters.height,i.drawImage(e,0,0,this.streamParameters.width,this.streamParameters.height),this.backgroundReplacementCanvas=t}resizeAndSetReplacementColor(e){const t=document.createElement(\"canvas\"),i=t.getContext(\"2d\");t.width=this.streamParameters.width,t.height=this.streamParameters.height,i.fillStyle=e,i.fillRect(0,0,this.streamParameters.width,this.streamParameters.height),this.backgroundReplacementCanvas=t}loadImage(e){return n(this,void 0,void 0,(function*(){const t=yield fetch(e).catch((e=>{throw this.logger.error(e.toString()),new Error(\"Failed to fetch image.\")})),i=yield t.blob(),n=new Image;return n.src=URL.createObjectURL(i),new Promise(((e,t)=>{n.onload=()=>{e(n)},n.onerror=e=>{t(e)}}))}))}}},2913:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.FXLIB_PATH=t.WORKER_PATH=t.CDN_BASE_PATH=t.RESOURCE_CONSTRAINTS=t.SEGMENTATION_MODEL=t.DEFAULT_STREAM_PARAMETERS=t.WORKER_MSG=void 0,t.WORKER_MSG={BUILD_ENGINE_REQUEST:\"BuildEngineRequest\",BUILD_ENGINE_RESPONSE:\"BuildEngineResponse\",PERFORM_SEGMENTATION_REQUEST:\"PerformSegmentationRequest\",PERFORM_SEGMENTATION_RESPONSE:\"PerformSegmentationResponse\",PERFORM_SEGMENTATION_SAB_REQUEST:\"PerformSegmentationSABRequest\",PERFORM_SEGMENTATION_SAB_RESPONSE:\"PerformSegmentationSABResponse\",DESTROY_ASSETS_REQUEST:\"DestroyAssetsRequest\",DESTROY_ASSETS_RESPONSE:\"DestroyAssetsResponse\",CLOSE_WORKER_REQUEST:\"CloseWorkerRequest\"},t.DEFAULT_STREAM_PARAMETERS={FRAMES_PER_SECOND:15,WIDTH_IN_PIXEL:960,HEIGHT_IN_PIXEL:540,CHANNEL_COUNT:4},t.SEGMENTATION_MODEL={LOAD_SUCCESS:2,WIDTH_IN_PIXELS:176,HEIGHT_IN_PIXELS:160},t.RESOURCE_CONSTRAINTS={DEFAULT_PROCESSING_BUDGET_PER_FRAME:50,SEGMENTATION_DEFAULT_FRAMES_PER_SEGMENTATION:1,SEGMENTATION_SAMPLING_PERIOD_FRAME_COUNT:500,BLUR_DEFAULT_CYCLE_PERCENTAGE:10,BLUR_SAMPLING_PERIOD_FRAME_COUNT:1e3,MIN_PROCESSING_BUDGET:0,MAX_PROCESSING_BUDGET:100},t.CDN_BASE_PATH=\"https://static.sdkassets.chime.aws\";const i=\"/ml_media_fx/otherassets\";t.WORKER_PATH=`${i}/worker.js`,t.FXLIB_PATH=`${i}/fxlib.js`},7746:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(623),s=i(5021),o=i(9424),a=i(543),c=i(7434),d=i(8690),l=i(4046),u=i(9807),h=i(2826),p=i(8190),m=i(2913),f=i(9935);class g{constructor(e,t=m.RESOURCE_CONSTRAINTS.DEFAULT_PROCESSING_BUDGET_PER_FRAME,i){this.logger=e,this.outputCanvas=document.createElement(\"canvas\"),this.canvasVideoFrameBuffer=new u.default(this.outputCanvas);try{this.validateProcessingBudgetPerFrame(t)}catch(e){throw this.logger.error(e),new Error(`Cannot instantiate VideoFxProcessor due to invalid processingBudgetPerFrame of ${t}`)}i&&(this.eventController=i),this.effectConfig={backgroundBlur:{isEnabled:!1,strength:\"low\"},backgroundReplacement:{isEnabled:!1,backgroundImageURL:null,defaultColor:\"black\"}},this.segmentationRequestPromise=new h.DeferredPromise,this.segmentationRateManager=new f.VideoFxSegmentationRateManager(this.logger,t),this.streamParameters={framerate:m.DEFAULT_STREAM_PARAMETERS.FRAMES_PER_SECOND,width:m.DEFAULT_STREAM_PARAMETERS.WIDTH_IN_PIXEL,height:m.DEFAULT_STREAM_PARAMETERS.HEIGHT_IN_PIXEL,channels:m.DEFAULT_STREAM_PARAMETERS.CHANNEL_COUNT},g.isSharedArrayBufferSupported&&(this.sharedImageBuffer=new SharedArrayBuffer(m.SEGMENTATION_MODEL.WIDTH_IN_PIXELS*m.SEGMENTATION_MODEL.HEIGHT_IN_PIXELS*this.streamParameters.channels),this.sharedImageData=new Uint8ClampedArray(this.sharedImageBuffer)),this.logger.info(`VideoFx supports Shared Array Buffer: ${g.isSharedArrayBufferSupported}`),this.canvasOpsManager=new p.VideoFxCanvasOpsManager(this.streamParameters,this.outputCanvas),this.outputCanvas.width=this.streamParameters.width,this.outputCanvas.height=this.streamParameters.height,this.segmentationMask=new ImageData(this.streamParameters.width,this.streamParameters.height),this.logger.info(`VideoFxProcessor instantiated with a processingBudgetPerFrame of ${t}`)}process(e){return n(this,void 0,void 0,(function*(){return e}))}fxProcess(e){return n(this,void 0,void 0,(function*(){const t=e[0].asCanvasElement();this.didStreamParametersChange(t)&&(yield this.adjustProcessorForNewStreamParameters(t));try{yield this.manageSegmentationMask(t)}catch(e){throw this.logger.error(e),new Error(\"Video stream could not be processed\")}return yield this.renderer.render(t,this.segmentationMask),e[0]=this.canvasVideoFrameBuffer,e}))}noOpProcess(e){return n(this,void 0,void 0,(function*(){return e}))}didStreamParametersChange(e){return e.width!==this.streamParameters.width||e.height!==this.streamParameters.height}adjustProcessorForNewStreamParameters(e){return n(this,void 0,void 0,(function*(){this.streamParameters.width=e.width,this.streamParameters.height=e.height,yield this.canvasOpsManager.configureForStreamParameters(this.streamParameters),yield this.renderer.configure(this.streamParameters.width,this.streamParameters.height,this.effectConfig)}))}destroy(){return n(this,void 0,void 0,(function*(){this.canvasVideoFrameBuffer.destroy(),this.fxLibScript&&this.fxLibScript.parentNode&&this.fxLibScript.parentNode.removeChild(this.fxLibScript),this.engineWorker&&(this.destroyedAssetsPromise=new h.DeferredPromise,this.engineWorker.postMessage({msg:m.WORKER_MSG.DESTROY_ASSETS_REQUEST}),yield this.destroyedAssetsPromise.getPromise(),this.engineWorker.postMessage({msg:m.WORKER_MSG.CLOSE_WORKER_REQUEST})),this.logger.info(\"VideoFxProcessor destroyed.\")}))}manageSegmentationMask(e){return n(this,void 0,void 0,(function*(){try{if(this.segmentationRateManager.submitFrame(),this.segmentationRateManager.shouldApplySegmentation()){this.segmentationRateManager.startSegmentation();const t=this.canvasOpsManager.getInferenceInputData(e);this.segmentationMask=yield this.generateSegmentationMask(t),this.segmentationRateManager.completeSegmentation()}}catch(e){throw this.logger.error(e.toString()),new Error(\"Can not properly manage the returned segmentation mask\")}}))}generateSegmentationMask(e){return n(this,void 0,void 0,(function*(){g.isSharedArrayBufferSupported?(this.sharedImageData.set(e.data),this.engineWorker.postMessage({msg:m.WORKER_MSG.PERFORM_SEGMENTATION_SAB_REQUEST,payload:this.sharedImageBuffer})):this.engineWorker.postMessage({msg:m.WORKER_MSG.PERFORM_SEGMENTATION_REQUEST,payload:e},[e.data.buffer]);try{return yield this.segmentationRequestPromise.getPromise()}catch(e){throw this.logger.error(e.toString()),new Error(\"Segmentation mask could not be generated\")}}))}cloneConfigFrom(e){return{backgroundBlur:{isEnabled:e.backgroundBlur.isEnabled,strength:e.backgroundBlur.strength},backgroundReplacement:{isEnabled:e.backgroundReplacement.isEnabled,backgroundImageURL:e.backgroundReplacement.backgroundImageURL,defaultColor:e.backgroundReplacement.defaultColor}}}setEffectConfig(e){return n(this,void 0,void 0,(function*(){if(this.sameVideoFxConfig(e,this.effectConfig))return;const t=this.cloneConfigFrom(e);try{yield this.validateEffectConfig(t)}catch(e){throw this.logger.error(e.toString()),new Error(\"Provided effect config is invalid, not updating VideoFxProcessor\")}t.backgroundReplacement.isEnabled&&(yield this.canvasOpsManager.loadReplacementBackground(t),yield this.renderer.setBackgroundReplacementCanvas(this.canvasOpsManager.getBackgroundReplacementCanvas())),yield this.renderer.configure(this.streamParameters.width,this.streamParameters.height,t),this.effectConfig=t,this.effectConfig.backgroundBlur.isEnabled||this.effectConfig.backgroundReplacement.isEnabled?this.process=this.fxProcess:this.process=this.noOpProcess,this.logger.info(`VideoFxProcessor effect configuration updated to: ${JSON.stringify(this.effectConfig)}`),this.eventController&&this.publishVideoFxConfigEvent()}))}validateEffectConfig(e){return n(this,void 0,void 0,(function*(){if(e.backgroundBlur.isEnabled&&e.backgroundReplacement.isEnabled)throw new Error(\"Invalid VideoFx configuration: Background Blur and Background Replacement can not both be enabled\");e.backgroundReplacement.isEnabled&&(yield this.validateReplacementConfig(e))}))}validateReplacementConfig(e){return n(this,void 0,void 0,(function*(){if(e.backgroundReplacement.backgroundImageURL&&e.backgroundReplacement.defaultColor)throw new Error(\"Invalid VideoFx configuration: Background Replacement can not have both an image URL and default color\");if(!e.backgroundReplacement.backgroundImageURL&&!e.backgroundReplacement.defaultColor)throw new Error(\"Invalid VideoFx configuration: Background Replacement image URL and default can not both be null/undefined\");try{e.backgroundReplacement.backgroundImageURL&&(yield this.canvasOpsManager.loadImage(e.backgroundReplacement.backgroundImageURL))}catch(e){throw this.logger.error(e.toString()),new Error(\"Invalid VideoFx configuration: backgroundImageURL failed to load\")}const t=e.backgroundReplacement.defaultColor;if(t&&\"black\"!==t&&\"#000000\"!==t&&\"#000\"!==t){if(t.includes(\"#\")&&!new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/).test(t))throw new Error(`Invalid hexadecimal color code for default replacement background: ${t}`);const e=document.createElement(\"canvas\").getContext(\"2d\"),i=e.fillStyle;if(e.fillStyle=t,e.fillStyle===i)throw new Error(`Invalid color for default replacement background: ${t}`)}}))}validateProcessingBudgetPerFrame(e){if(em.RESOURCE_CONSTRAINTS.MAX_PROCESSING_BUDGET)throw new Error(`Invalid resource constraint: cycle percentage must be within range of ${m.RESOURCE_CONSTRAINTS.MIN_PROCESSING_BUDGET} and ${m.RESOURCE_CONSTRAINTS.MAX_PROCESSING_BUDGET}`)}loadAssets(){return n(this,void 0,void 0,(function*(){this.logger.info(\"Loading required assets for the VideoFxProcessor\");try{const e=this.getVideoFxAssetParams();yield this.loadEngineWorker(e),yield this.buildEngine(e),yield this.loadFxLib(e),this.renderer=constructRenderer(m.SEGMENTATION_MODEL.WIDTH_IN_PIXELS,m.SEGMENTATION_MODEL.HEIGHT_IN_PIXELS,this.effectConfig,this.outputCanvas)}catch(e){throw this.logger.error(e.toString()),new Error(\"Failed to load necessary assets for the VideoFxProcessor\")}this.logger.info(\"Finished loading of essential VideoFxProcessor assets.\")}))}getVideoFxAssetParams(){const e=d.getDefaultAssetSpec();return{assetGroup:e.assetGroup,revisionID:e.revisionID,sdk:encodeURIComponent(l.default.sdkVersion),ua:encodeURIComponent(l.default.sdkUserAgentLowResolution)}}getPathFromVideoFxAssetParams(e,t){const i=new URL(e);for(const[e,n]of Object.entries(t))if(void 0!==n){const t=encodeURIComponent(e),r=encodeURIComponent(n);i.searchParams.set(t,r)}return i.toString()}loadEngineWorker(e){return n(this,void 0,void 0,(function*(){try{const t=this.getPathFromVideoFxAssetParams(m.CDN_BASE_PATH+m.WORKER_PATH,e);this.engineWorker=yield s.loadWorker(t,\"VideoFxEngineWorker\",{},null),this.logger.info(\"Successfully loaded the VideoFxProcessor's engine worker\"),this.engineWorker.addEventListener(\"message\",(e=>this.engineWorkerReceiver(e)))}catch(e){throw this.logger.error(e.toString()),new Error(\"Failed to load the VideoFxProcessor's engine worker\")}}))}buildEngine(e){return n(this,void 0,void 0,(function*(){this.buildEnginePromise=new h.DeferredPromise,this.engineWorker.postMessage({msg:m.WORKER_MSG.BUILD_ENGINE_REQUEST,payload:{cdnBasePath:m.CDN_BASE_PATH,sdkVersioningParams:e}});try{yield this.buildEnginePromise.getPromise()}catch(e){throw this.logger.error(e.toString()),new Error(\"Failed to instantiate the VideoFxEngine\")}}))}loadFxLib(e){return n(this,void 0,void 0,(function*(){const t=this.getPathFromVideoFxAssetParams(m.CDN_BASE_PATH+m.FXLIB_PATH,e),i={method:\"GET\",mode:\"cors\",credentials:\"omit\",redirect:\"follow\",referrerPolicy:\"no-referrer\"};try{const e=yield r.fetchWithBehavior(t,i,{});if(!e.ok)throw new Error(\"Fetch failed.\");const n=window.URL.createObjectURL(yield e.blob());yield new Promise(((e,t)=>{this.fxLibScript=document.createElement(\"script\"),this.fxLibScript.setAttribute(\"src\",n),this.fxLibScript.setAttribute(\"type\",\"module\"),this.fxLibScript.setAttribute(\"async\",\"false\"),this.fxLibScript.addEventListener(\"load\",e),this.fxLibScript.addEventListener(\"error\",t),document.body.appendChild(this.fxLibScript)}))}catch(e){throw this.logger.error(e.toString()),new Error(\"Failed to load the fxlib\")}}))}getEffectConfig(){return this.cloneConfigFrom(this.effectConfig)}engineWorkerReceiver(e){const t=e.data;switch(t.msg){case m.WORKER_MSG.BUILD_ENGINE_RESPONSE:this.settleEngineBuildPromise(t.payload);break;case m.WORKER_MSG.PERFORM_SEGMENTATION_RESPONSE:this.settleSegmentationPromise(t.payload.output);break;case m.WORKER_MSG.PERFORM_SEGMENTATION_SAB_RESPONSE:this.settleSegmentationPromiseSAB();break;case m.WORKER_MSG.DESTROY_ASSETS_RESPONSE:this.destroyedAssetsPromise.resolvePromise();break;default:this.logger.info(`VideoFx worker received unknown event msg: ${JSON.stringify(t)}`)}}settleEngineBuildPromise(e){e!==m.SEGMENTATION_MODEL.LOAD_SUCCESS?this.buildEnginePromise.rejectPromise(new Error(\"Failed to build VideoFxProcessor's engine\")):(this.logger.info(\"Successfully built the VideoFxEngine\"),this.buildEnginePromise.resolvePromise())}settleSegmentationPromise(e){e?this.segmentationRequestPromise.resolveAndReplacePromise(e):this.segmentationRequestPromise.rejectAndReplacePromise(new Error(\"Failed to perform a segmentation on the input image\"))}settleSegmentationPromiseSAB(){try{const e=new ImageData(new Uint8ClampedArray(this.sharedImageData),m.SEGMENTATION_MODEL.WIDTH_IN_PIXELS,m.SEGMENTATION_MODEL.HEIGHT_IN_PIXELS);this.segmentationRequestPromise.resolveAndReplacePromise(e)}catch(e){this.segmentationRequestPromise.rejectAndReplacePromise(new Error(\"Failed to perform a segmentation with a shared array buffer on the input image\"))}}setToNoOpProcess(){this.process=this.noOpProcess}static isSupported(e=new c.default,t=!0){return n(this,void 0,void 0,(function*(){let i=!0;const r=(t,n)=>{t&&(e.info(n),i=!1)};return r(\"undefined\"==typeof globalThis,\"Browser does not have globalThis.\"),r(!o.supportsWorker(globalThis,e),\"Browser does not support web workers.\"),r(!o.supportsWASM(globalThis,e),\"Browser does not support wasm.\"),r(!document.createElement(\"canvas\").getContext(\"webgl2\"),\"Browser does not support webgl.\"),r(!(new a.default).isVideoFxSupportedBrowser(),\"Browser is unsupported for VideoFxProcessor\"),Promise.resolve(!!i&&(yield(()=>n(this,void 0,void 0,(function*(){if(t)try{const t=new g(e);yield t.loadAssets(),yield t.destroy()}catch(t){return e.info(\"Browser environment is unable to access the required external assets.\"),Promise.resolve(!1)}return Promise.resolve(!0)})))()))}))}static create(e,t,i=m.RESOURCE_CONSTRAINTS.DEFAULT_PROCESSING_BUDGET_PER_FRAME){return n(this,void 0,void 0,(function*(){const n=new g(e,i);try{return yield n.loadAssets(),yield n.setEffectConfig(t),n}catch(t){throw e.error(t.toString()),n.setToNoOpProcess(),new Error(\"VideoFxProcessor built with support for only NoOp processing\")}}))}setEventController(e){this.eventController?this.eventController=e:(this.eventController=e,this.publishVideoFxConfigEvent())}publishVideoFxConfigEvent(){const e={backgroundBlurEnabled:this.effectConfig.backgroundBlur.isEnabled.toString(),backgroundBlurStrength:this.effectConfig.backgroundBlur.strength,backgroundReplacementEnabled:this.effectConfig.backgroundReplacement.isEnabled.toString(),backgroundFilterVersion:2};this.eventController.publishEvent(\"backgroundFilterConfigSelected\",e)}sameVideoFxConfig(e,t){return e.backgroundBlur.isEnabled===t.backgroundBlur.isEnabled&&e.backgroundBlur.strength===t.backgroundBlur.strength&&e.backgroundReplacement.backgroundImageURL===t.backgroundReplacement.backgroundImageURL&&e.backgroundReplacement.defaultColor===t.backgroundReplacement.defaultColor&&e.backgroundReplacement.isEnabled===t.backgroundReplacement.isEnabled}}t.default=g,g.isSharedArrayBufferSupported=\"undefined\"!=typeof SharedArrayBuffer},9935:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.VideoFxSegmentationRateManager=void 0;const n=i(2913);t.VideoFxSegmentationRateManager=class{constructor(e,t){this.logger=e,this.targetSegmentationCyclePercentage=t/100,this.frameCountOverSamplingPeriod=0,this.totalSegmentationDurationOverSamplingPeriod=0,this.samplingPeriodStartTime=performance.now(),this.framesPerSegmentation=n.RESOURCE_CONSTRAINTS.SEGMENTATION_DEFAULT_FRAMES_PER_SEGMENTATION}submitFrame(){this.frameCountOverSamplingPeriod++}shouldApplySegmentation(){return this.frameCountOverSamplingPeriod%this.framesPerSegmentation==0}startSegmentation(){this.frameSegmentationStartTime=performance.now()}completeSegmentation(){this.totalSegmentationDurationOverSamplingPeriod+=performance.now()-this.frameSegmentationStartTime,this.frameCountOverSamplingPeriod>=n.RESOURCE_CONSTRAINTS.SEGMENTATION_SAMPLING_PERIOD_FRAME_COUNT&&this.adjustFramesPerSegmentation(this.totalSegmentationDurationOverSamplingPeriod/(performance.now()-this.samplingPeriodStartTime))}adjustFramesPerSegmentation(e){e>this.targetSegmentationCyclePercentage?(this.framesPerSegmentation++,this.logger.info(`Segmentation cycle percentage above the configured maximal value. Decreasing segmentation rate to 1 segmentation per ${this.framesPerSegmentation} frames`)):this.framesPerSegmentation>1&&e{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{}},1508:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});class i{constructor(e){this.ids=new Set(e)}add(e){this.ids.add(e)}array(){return Array.from(this.ids.values()).sort(((e,t)=>e-t))}contain(e){return this.ids.has(e)}forEach(e){this.ids.forEach(e)}empty(){return 0===this.ids.size}size(){return this.ids.size}equal(e){if(!e)return 0===this.ids.size;const t=this.array(),i=e.array();if(t.length!==i.length)return!1;for(let e=0;e{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(289),r=i(1508),s=i(6876);t.default=class{constructor(e){this.logger=e,this.currentIndex=null,this.indexForSubscribe=null,this.currentSubscribeAck=null,this.subscribeTrackToStreamMap=null,this.subscribeStreamToAttendeeMap=null,this.subscribeStreamToExternalUserIdMap=null,this.subscribeSsrcToStreamMap=null,this.subscribeSsrcToGroupMap=null,this.streamToAttendeeMap=null,this.groupIdToAttendeeMap=null,this.streamToExternalUserIdMap=null,this.videoStreamDescription=new s.default,this.videoStreamDescription.trackLabel=\"AmazonChimeExpressVideo\",this.videoStreamDescription.streamId=2,this.videoStreamDescription.groupId=2}localStreamDescriptions(){return[this.videoStreamDescription.clone()]}convertBpsToKbps(e){return e>0&&e<1e3?1:Math.trunc(e/1e3)}remoteStreamDescriptions(){if(!this.currentIndex||!this.currentIndex.sources)return[];const e=[];return this.currentIndex.sources.forEach((t=>{const i=new s.default;i.attendeeId=t.attendeeId,i.groupId=t.groupId,i.streamId=t.streamId,i.maxBitrateKbps=t.maxBitrateKbps,i.avgBitrateKbps=this.convertBpsToKbps(t.avgBitrateBps),e.push(i)})),e}integrateUplinkPolicyDecision(e){if(e&&e.length){const t=e[0];this.videoStreamDescription.maxBitrateKbps=t.maxBitrate/1e3,this.videoStreamDescription.maxFrameRate=t.maxFramerate}}integrateIndexFrame(e){if(this.currentIndex=e,!e)return;const t=new Map;let i=!1;for(const n of e.sources){if(!t.has(n.attendeeId)){t.set(n.attendeeId,n.groupId);continue}const e=t.get(n.attendeeId);et.get(e.attendeeId)===e.groupId))),this.streamToAttendeeMap=null,this.groupIdToAttendeeMap=null,this.streamToExternalUserIdMap=null}subscribeFrameSent(){this.indexForSubscribe=this.currentIndex}integrateSubscribeAckFrame(e){this.currentSubscribeAck=e,this.subscribeTrackToStreamMap=this.buildTrackToStreamMap(this.currentSubscribeAck),this.subscribeSsrcToStreamMap=this.buildSSRCToStreamMap(this.currentSubscribeAck),this.subscribeSsrcToGroupMap=this.buildSSRCToGroupMap(this.currentSubscribeAck),this.subscribeStreamToAttendeeMap=this.buildStreamToAttendeeMap(this.indexForSubscribe),this.subscribeStreamToExternalUserIdMap=this.buildStreamExternalUserIdMap(this.indexForSubscribe)}integrateBitratesFrame(e){if(this.currentIndex)for(const t of e.bitrates){const e=this.currentIndex.sources.find((e=>e.streamId===t.sourceStreamId));void 0!==e&&(e.avgBitrateBps=t.avgBitrateBps)}}allStreams(){const e=new r.default;if(this.currentIndex)for(const t of this.currentIndex.sources)e.add(t.streamId);return e}allVideoSendingSourcesExcludingSelf(e){const t=[],i=new Set;if(this.currentIndex&&this.currentIndex.sources&&this.currentIndex.sources.length)for(const r of this.currentIndex.sources){const{attendeeId:s,externalUserId:o,mediaType:a}=r;s!==e&&a===n.SdkStreamMediaType.VIDEO&&(i.has(s)||(t.push({attendee:{attendeeId:s,externalUserId:o}}),i.add(s)))}return t}streamSelectionUnderBandwidthConstraint(e,t,i,s){const o=new Set;if(this.currentIndex)for(const r of this.currentIndex.sources)r.attendeeId!==e&&r.mediaType===n.SdkStreamMediaType.VIDEO&&(t.has(r.attendeeId)||i.has(r.attendeeId)||o.add(r.attendeeId));const a=this.buildAttendeeToSortedStreamDescriptorMapExcludingSelf(e),c=new Map;let d=0;a.forEach(((e,t)=>{c.set(t,e[0]),d+=e[0].maxBitrateKbps})),d=this.trySelectHighBitrateForAttendees(a,t,d,s,c),this.trySelectHighBitrateForAttendees(a,o,d,s,c);const l=new r.default;for(const e of c.values())l.add(e.streamId);return l}highestQualityStreamFromEachGroupExcludingSelf(e){const t=new r.default;if(this.currentIndex){const i=new Map;for(const t of this.currentIndex.sources)t.attendeeId!==e&&t.mediaType===n.SdkStreamMediaType.VIDEO&&(!i.has(t.groupId)||t.maxBitrateKbps>i.get(t.groupId).maxBitrateKbps)&&i.set(t.groupId,t);for(const e of i.values())t.add(e.streamId)}return t}numberOfVideoPublishingParticipantsExcludingSelf(e){return this.highestQualityStreamFromEachGroupExcludingSelf(e).array().length}numberOfParticipants(){return this.currentIndex.numParticipants?this.currentIndex.numParticipants:-1}attendeeIdForTrack(e){const t=this.streamIdForTrack(e);if(void 0===t||!this.subscribeStreamToAttendeeMap)return this.logger.warn(`no attendee found for track ${e}`),\"\";return this.subscribeStreamToAttendeeMap.get(t)||(this.logger.info(`track ${e} (stream ${t}) does not correspond to a known attendee`),\"\")}externalUserIdForTrack(e){const t=this.streamIdForTrack(e);if(void 0===t||!this.subscribeStreamToExternalUserIdMap)return this.logger.warn(`no external user id found for track ${e}`),\"\";return this.subscribeStreamToExternalUserIdMap.get(t)||(this.logger.info(`track ${e} (stream ${t}) does not correspond to a known externalUserId`),\"\")}attendeeIdForStreamId(e){if(!this.streamToAttendeeMap){if(!this.currentIndex)return\"\";this.streamToAttendeeMap=this.buildStreamToAttendeeMap(this.currentIndex)}return this.streamToAttendeeMap.get(e)||(this.logger.info(`stream ID ${e} does not correspond to a known attendee`),\"\")}attendeeIdForGroupId(e){if(!this.groupIdToAttendeeMap){if(!this.currentIndex)return\"\";this.groupIdToAttendeeMap=this.buildGroupIdToAttendeeMap(this.currentIndex)}return this.groupIdToAttendeeMap.get(e)||(this.logger.info(`group ID ${e} does not correspond to a known attendee`),\"\")}groupIdForStreamId(e){if(this.currentIndex&&this.currentIndex.sources){for(const t of this.currentIndex.sources)if(t.streamId===e)return t.groupId;if(this.indexForSubscribe)for(const t of this.indexForSubscribe.sources)if(t.streamId===e)return t.groupId}}StreamIdsInSameGroup(e,t){return this.groupIdForStreamId(e)===this.groupIdForStreamId(t)}streamIdForTrack(e){if(this.subscribeTrackToStreamMap)return this.subscribeTrackToStreamMap.get(e)}streamIdForSSRC(e){if(this.subscribeSsrcToStreamMap)return this.subscribeSsrcToStreamMap.get(e)}overrideStreamIdMappings(e,t){if(this.subscribeTrackToStreamMap)for(const[i,n]of this.subscribeTrackToStreamMap.entries())if(e===n){this.subscribeTrackToStreamMap.set(i,t);break}if(this.subscribeSsrcToStreamMap)for(const[i,n]of this.subscribeSsrcToStreamMap.entries())if(e===n){this.subscribeSsrcToStreamMap.set(i,t);break}}groupIdForSSRC(e){if(this.subscribeSsrcToGroupMap)return this.subscribeSsrcToGroupMap.get(e)}streamsPausedAtSource(){const e=new r.default;if(this.currentIndex)for(const t of this.currentIndex.pausedAtSourceIds)e.add(t);return e}buildTrackToStreamMap(e){const t=new Map;this.logger.debug((()=>`trackMap ${JSON.stringify(e.tracks)}`));for(const i of e.tracks)i.trackLabel.length>0&&i.streamId>0&&t.set(i.trackLabel,i.streamId);return t}buildSSRCToStreamMap(e){const t=new Map;this.logger.debug((()=>`ssrcMap ${JSON.stringify(e.tracks)}`));for(const i of e.tracks)i.trackLabel.length>0&&i.streamId>0&&t.set(i.ssrc,i.streamId);return t}buildSSRCToGroupMap(e){const t=new Map;for(const i of e.tracks)i.trackLabel.length>0&&i.streamId>0&&t.set(i.ssrc,this.groupIdForStreamId(i.streamId));return t}buildStreamToAttendeeMap(e){const t=new Map;if(e)for(const i of e.sources)t.set(i.streamId,i.attendeeId);return t}buildGroupIdToAttendeeMap(e){const t=new Map;for(const i of e.sources)t.set(i.groupId,i.attendeeId);return t}buildStreamExternalUserIdMap(e){const t=new Map;if(e)for(const i of e.sources)i.externalUserId&&t.set(i.streamId,i.externalUserId);return t}trySelectHighBitrateForAttendees(e,t,i,n,r){for(const s of t){if(i>=n)break;if(e.has(s)){const t=e.get(s);for(const e of t.reverse())if(i-r.get(s).maxBitrateKbps+e.maxBitrateKbps{e.sort(((e,t)=>e.maxBitrateKbps>t.maxBitrateKbps?1:e.maxBitrateKbps{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(289),r=i(1318),s=i(6876);class o extends r.default{constructor(e){super(e),this.streamIdToBitrateKbpsMap=new Map,this._localStreamInfos=[],this._lastBitRateMsgTime=Date.now()}localStreamDescriptions(){const e=[];return this._localStreamInfos.forEach((t=>{e.push(t.clone())})),e}integrateUplinkPolicyDecision(e){let t=!0,i=0;for(let n=0;n0&&(this._localStreamInfos[i].timeEnabled=Date.now()),this._localStreamInfos[i].maxBitrateKbps=r,this._localStreamInfos[i].maxFrameRate=o,this._localStreamInfos[i].disabledByUplinkPolicy=0===r,!0===this._localStreamInfos[i].disabledByUplinkPolicy&&(this._localStreamInfos[i].disabledByWebRTC=!1),i++;else{t=!1;const e=new s.default;e.maxBitrateKbps=r,e.maxFrameRate=o,e.disabledByUplinkPolicy=0===r,0!==r&&(e.timeEnabled=Date.now()),this._localStreamInfos.push(e),i++}}t&&this._localStreamInfos.splice(i)}integrateBitratesFrame(e){super.integrateBitratesFrame(e);const t=new Set,i=new Set(this.streamIdToBitrateKbpsMap.keys());for(const i of e.bitrates)t.add(i.sourceStreamId),this.streamIdToBitrateKbpsMap.set(i.sourceStreamId,this.convertBpsToKbps(i.avgBitrateBps));for(const e of i)t.has(e)||(this.streamIdToBitrateKbpsMap.get(e)===o.UNSEEN_STREAM_BITRATE?this.streamIdToBitrateKbpsMap.set(e,o.RECENTLY_INACTIVE_STREAM_BITRATE):this.streamIdToBitrateKbpsMap.set(e,o.NOT_SENDING_STREAM_BITRATE));for(let e=0;eo.BitratesMsgFrequencyMs&&(this._localStreamInfos[e].disabledByWebRTC=!0):this._lastBitRateMsgTime-this._localStreamInfos[e].timeEnabled>o.BitratesMsgFrequencyMs&&(this._localStreamInfos[e].disabledByWebRTC=!0))}this._lastBitRateMsgTime=Date.now(),this.logLocalStreamDescriptions()}logLocalStreamDescriptions(){let e=\"\";for(const t of this._localStreamInfos)e+=`streamId=${t.streamId} maxBitrate=${t.maxBitrateKbps} disabledByWebRTC=${t.disabledByWebRTC} disabledByUplink=${t.disabledByUplinkPolicy}\\n`;this.logger.debug((()=>e))}integrateIndexFrame(e){super.integrateIndexFrame(e);const t=new Set,i=new Set(this.streamIdToBitrateKbpsMap.keys());for(const e of this.currentIndex.sources)e.mediaType===n.SdkStreamMediaType.VIDEO&&(t.add(e.streamId),this.streamIdToBitrateKbpsMap.has(e.streamId)||this.streamIdToBitrateKbpsMap.set(e.streamId,o.UNSEEN_STREAM_BITRATE));for(const e of i)t.has(e)||this.streamIdToBitrateKbpsMap.delete(e)}integrateSubscribeAckFrame(e){if(super.integrateSubscribeAckFrame(e),!e.allocations||void 0===e.allocations)return;let t=0;for(const i of e.allocations){if(this._localStreamInfos.length{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(289);class r{constructor(e,t,i,n,r){this.attendeeId=\"\",this.groupId=0,this.streamId=0,this.ssrc=0,this.trackLabel=\"\",this.maxBitrateKbps=0,this.avgBitrateKbps=0,this.maxFrameRate=0,this.timeEnabled=0,this.disabledByWebRTC=!1,this.disabledByUplinkPolicy=!1,this.attendeeId=e,this.groupId=t,this.streamId=i,this.maxBitrateKbps=n,this.avgBitrateKbps=r}clone(){const e=new r;return e.attendeeId=this.attendeeId,e.groupId=this.groupId,e.streamId=this.streamId,e.ssrc=this.ssrc,e.trackLabel=this.trackLabel,e.maxBitrateKbps=this.maxBitrateKbps,e.avgBitrateKbps=this.avgBitrateKbps,e.maxFrameRate=this.maxFrameRate,e.timeEnabled=this.timeEnabled,e.disabledByWebRTC=this.disabledByWebRTC,e.disabledByUplinkPolicy=this.disabledByUplinkPolicy,e}toStreamDescriptor(){const e=n.SdkStreamDescriptor.create();return e.mediaType=n.SdkStreamMediaType.VIDEO,e.trackLabel=this.trackLabel,e.attendeeId=this.attendeeId,e.streamId=this.streamId,e.groupId=this.groupId,e.framerate=this.maxFrameRate,e.maxBitrateKbps=this.disabledByUplinkPolicy||this.disabledByWebRTC?0:this.maxBitrateKbps,e.avgBitrateBps=this.avgBitrateKbps,e}}t.default=r},3327:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(543),r=i(214),s=i(7804);class o{constructor(e,t,i,n){this.tileController=i,this.devicePixelRatioMonitor=n,this.tileState=new s.default,this.tileState.tileId=e,this.tileState.localTile=t,this.devicePixelRatioMonitor.registerObserver(this)}static connectVideoStreamToVideoElement(e,t,i){const r=i&&\"environment\"!==e.getVideoTracks()[0].getSettings().facingMode?\"rotateY(180deg)\":\"\";if(o.setVideoElementFlag(t,\"disablePictureInPicture\",i),o.setVideoElementFlag(t,\"disableRemotePlayback\",i),t.style.transform!==r&&(t.style.transform=r),t.hasAttribute(\"controls\")&&t.removeAttribute(\"controls\"),t.hasAttribute(\"autoplay\")||t.setAttribute(\"autoplay\",\"true\"),t.hasAttribute(\"playsinline\")||t.setAttribute(\"playsinline\",\"true\"),t.hasAttribute(\"muted\")||(t.setAttribute(\"muted\",\"true\"),t.muted=!0),t.srcObject!==e&&(t.srcObject=e,(new n.default).requiresVideoPlayWorkaround()&&t.paused)){const e=t.play();void 0!==e&&e.catch((e=>{console.warn(\"Error playing video in Safari\",e)})).then((()=>{console.debug(\"Video played successfully in Safari\")}))}}static disconnectVideoStreamFromVideoElement(e,t,i=!1){if(e)if(t)i||(e.srcObject=null,e.style.transform=\"\");else{if(!e.srcObject)return;e.pause(),e.style.transform=\"\",o.setVideoElementFlag(e,\"disablePictureInPicture\",!1),o.setVideoElementFlag(e,\"disableRemotePlayback\",!1),e.srcObject=null}}destroy(){this.devicePixelRatioMonitor.removeObserver(this),this.tileState.boundVideoElement&&this.tileState.boundVideoElement.srcObject===this.tileState.boundVideoStream&&o.disconnectVideoStreamFromVideoElement(this.tileState.boundVideoElement,!1),this.tileState=new s.default}devicePixelRatioChanged(e){this.tileState.devicePixelRatio=e,this.sendTileStateUpdate()}id(){return this.tileState.tileId}state(){return this.tileState.clone()}stateRef(){return this.tileState}bindVideoStream(e,t,i,n,s,o,a){let c=!1;this.tileState.boundAttendeeId!==e&&(this.tileState.boundAttendeeId=e,new r.default(e).hasModality(r.default.MODALITY_CONTENT)&&(this.tileState.isContent=!0),c=!0),this.tileState.boundExternalUserId!==a&&(this.tileState.boundExternalUserId=a,c=!0),this.tileState.localTile!==t&&(this.tileState.localTile=t,c=!0),this.tileState.boundVideoStream!==i&&(this.tileState.boundVideoStream=i,c=!0),this.tileState.videoStreamContentWidth!==n&&(this.tileState.videoStreamContentWidth=n,c=!0),this.tileState.videoStreamContentHeight!==s&&(this.tileState.videoStreamContentHeight=s,c=!0),this.tileState.streamId!==o&&(this.tileState.streamId=o,c=!0),c&&this.sendTileStateUpdate()}bindVideoElement(e){let t=!1;this.tileState.boundVideoElement!==e&&(this.tileState.boundVideoElement=e,t=!0),null!==this.tileState.boundVideoElement?(this.tileState.videoElementCSSWidthPixels!==e.clientWidth&&(this.tileState.videoElementCSSWidthPixels=e.clientWidth,t=!0),this.tileState.videoElementCSSHeightPixels!==e.clientHeight&&(this.tileState.videoElementCSSHeightPixels=e.clientHeight,t=!0)):(this.tileState.videoElementCSSWidthPixels=null,this.tileState.videoElementCSSHeightPixels=null),t&&this.sendTileStateUpdate()}pause(){this.tileState.paused||(this.tileState.paused=!0,this.sendTileStateUpdate())}unpause(){this.tileState.paused&&(this.tileState.paused=!1,this.sendTileStateUpdate())}markPoorConnection(){return!this.tileState.poorConnection&&(this.tileState.poorConnection=!0,this.sendTileStateUpdate(),!0)}unmarkPoorConnection(){return!!this.tileState.poorConnection&&(this.tileState.poorConnection=!1,this.sendTileStateUpdate(),!0)}capture(){if(!this.tileState.active)return null;const e=document.createElement(\"canvas\"),t=this.tileState.boundVideoElement;e.width=t.videoWidth||t.width,e.height=t.videoHeight||t.height;const i=e.getContext(\"2d\");return i.drawImage(t,0,0,e.width,e.height),i.getImageData(0,0,e.width,e.height)}setStreamId(e){this.tileState.streamId=e,this.tileController.sendTileStateUpdate(this.state())}sendTileStateUpdate(){this.updateActiveState(),this.updateVideoStreamOnVideoElement(),this.updateVideoElementPhysicalPixels(),this.tileController.sendTileStateUpdate(this.state())}updateActiveState(){this.tileState.active=!(this.tileState.paused||this.tileState.poorConnection||!this.tileState.boundAttendeeId||!this.tileState.boundVideoElement||!this.tileState.boundVideoStream)}updateVideoElementPhysicalPixels(){\"number\"==typeof this.tileState.videoElementCSSWidthPixels&&\"number\"==typeof this.tileState.videoElementCSSHeightPixels?(this.tileState.videoElementPhysicalWidthPixels=this.tileState.devicePixelRatio*this.tileState.videoElementCSSWidthPixels,this.tileState.videoElementPhysicalHeightPixels=this.tileState.devicePixelRatio*this.tileState.videoElementCSSHeightPixels):(this.tileState.videoElementPhysicalWidthPixels=null,this.tileState.videoElementPhysicalHeightPixels=null)}updateVideoStreamOnVideoElement(){this.tileState.active?o.connectVideoStreamToVideoElement(this.tileState.boundVideoStream,this.tileState.boundVideoElement,this.tileState.localTile):o.disconnectVideoStreamFromVideoElement(this.tileState.boundVideoElement,this.tileState.paused,this.tileController.keepLastFrameWhenPaused)}static setVideoElementFlag(e,t,i){t in e&&(e[t]=i)}}t.default=o},7804:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});class i{constructor(){this.tileId=null,this.localTile=!1,this.localTileStarted=!1,this.isContent=!1,this.active=!1,this.paused=!1,this.poorConnection=!1,this.boundAttendeeId=null,this.boundExternalUserId=null,this.boundVideoStream=null,this.boundVideoElement=null,this.nameplate=null,this.videoStreamContentWidth=null,this.videoStreamContentHeight=null,this.videoElementCSSWidthPixels=null,this.videoElementCSSHeightPixels=null,this.devicePixelRatio=0,this.videoElementPhysicalWidthPixels=null,this.videoElementPhysicalHeightPixels=null,this.streamId=null}clone(){const e=new i;return e.tileId=this.tileId,e.localTile=this.localTile,e.isContent=this.isContent,e.active=this.active,e.paused=this.paused,e.poorConnection=this.poorConnection,e.boundAttendeeId=this.boundAttendeeId,e.boundExternalUserId=this.boundExternalUserId,e.boundVideoStream=this.boundVideoStream,e.boundVideoElement=this.boundVideoElement,e.nameplate=this.nameplate,e.videoStreamContentWidth=this.videoStreamContentWidth,e.videoStreamContentHeight=this.videoStreamContentHeight,e.videoElementCSSWidthPixels=this.videoElementCSSWidthPixels,e.videoElementCSSHeightPixels=this.videoElementCSSHeightPixels,e.devicePixelRatio=this.devicePixelRatio,e.videoElementPhysicalWidthPixels=this.videoElementPhysicalWidthPixels,e.videoElementPhysicalHeightPixels=this.videoElementPhysicalHeightPixels,e.streamId=this.streamId,e}}t.default=i},2958:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(8236),s=i(9190),o=i(8660),a=i(3327);t.default=class{constructor(e,t,i){this.tileFactory=e,this.audioVideoController=t,this.logger=i,this.tileMap=new Map,this.nextTileId=1,this.currentLocalTile=null,this.currentPausedTilesByIds=new Set,this.keepLastFrameWhenPaused=!1,this.keepLastFrameWhenPaused=t.configuration.keepLastFrameWhenPaused}createDevicePixelRatioMonitorIfNeeded(){this.devicePixelRatioMonitor||(this.devicePixelRatioMonitor=new r.default(new s.default,this.logger))}discardDevicePixelRatioMonitorIfNotNeeded(){return n(this,void 0,void 0,(function*(){if(this.tileMap.size||!this.devicePixelRatioMonitor)return;const e=this.devicePixelRatioMonitor;return this.devicePixelRatioMonitor=void 0,e.destroy()}))}bindVideoElement(e,t){const i=this.getVideoTile(e);null!==i?i.bindVideoElement(t):this.logger.warn(`Ignoring video element binding for unknown tile id ${e}`)}unbindVideoElement(e,t=!0){const i=this.getVideoTile(e);if(null===i)return void this.logger.warn(`Ignoring video element unbinding for unknown tile id ${e}`);this.logger.info(\"Unbinding the video element\");const n=i.stateRef().boundVideoElement;i.bindVideoElement(null),t&&(this.logger.info(\"Cleaning up the video element\"),a.default.disconnectVideoStreamFromVideoElement(n,!1))}startLocalVideoTile(){const e=this.findOrCreateLocalVideoTile();return this.currentLocalTile.stateRef().localTileStarted=!0,this.audioVideoController.update({needsRenegotiation:!0}),e.id()}stopLocalVideoTile(){this.currentLocalTile&&(this.currentLocalTile.stateRef().localTileStarted=!1,this.currentLocalTile.bindVideoStream(this.audioVideoController.configuration.credentials.attendeeId,!0,null,null,null,null,this.audioVideoController.configuration.credentials.externalUserId),this.audioVideoController.update({needsRenegotiation:!0}))}hasStartedLocalVideoTile(){return!(!this.currentLocalTile||!this.currentLocalTile.stateRef().localTileStarted)}removeLocalVideoTile(){this.currentLocalTile&&this.removeVideoTile(this.currentLocalTile.id())}getLocalVideoTile(){return this.currentLocalTile}pauseVideoTile(e){const t=this.getVideoTile(e);t&&(this.currentPausedTilesByIds.has(e)||(this.audioVideoController.pauseReceivingStream(t.stateRef().streamId),this.currentPausedTilesByIds.add(e)),t.pause())}unpauseVideoTile(e){const t=this.getVideoTile(e);t&&(this.currentPausedTilesByIds.has(e)&&(this.audioVideoController.resumeReceivingStream(t.stateRef().streamId),this.currentPausedTilesByIds.delete(e)),t.unpause())}getVideoTile(e){return this.tileMap.has(e)?this.tileMap.get(e):null}getVideoTileArea(e){const t=e.state();let i=0,n=0;return t.boundVideoElement&&(i=t.boundVideoElement.clientHeight*t.devicePixelRatio,n=t.boundVideoElement.clientWidth*t.devicePixelRatio),i*n}getAllRemoteVideoTiles(){const e=new Array;return this.tileMap.forEach(((t,i)=>{this.currentLocalTile&&i===this.currentLocalTile.id()||e.push(t)})),e}getAllVideoTiles(){return Array.from(this.tileMap.values())}addVideoTile(e=!1){const t=this.nextTileId;this.nextTileId+=1,this.createDevicePixelRatioMonitorIfNeeded();const i=this.tileFactory.makeTile(t,e,this,this.devicePixelRatioMonitor);return this.tileMap.set(t,i),i}removeVideoTile(e){if(!this.tileMap.has(e))return;const t=this.tileMap.get(e);this.currentLocalTile===t&&(this.currentLocalTile=null),t.destroy(),this.tileMap.delete(e),this.audioVideoController.forEachObserver((t=>{o.Maybe.of(t.videoTileWasRemoved).map((i=>i.bind(t)(e)))})),this.discardDevicePixelRatioMonitorIfNotNeeded()}removeVideoTilesByAttendeeId(e){const t=[];for(const i of this.getAllVideoTiles()){const n=i.state();n.boundAttendeeId===e&&(this.removeVideoTile(n.tileId),t.push(n.tileId))}return t}removeAllVideoTiles(){const e=Array.from(this.tileMap.keys());for(const t of e)this.removeVideoTile(t)}sendTileStateUpdate(e){this.audioVideoController.forEachObserver((t=>{o.Maybe.of(t.videoTileDidUpdate).map((i=>i.bind(t)(e)))}))}haveVideoTilesWithStreams(){for(const e of this.getAllVideoTiles())if(e.state().boundVideoStream)return!0;return!1}haveVideoTileForAttendeeId(e){return!!this.getVideoTileForAttendeeId(e)}getVideoTileForAttendeeId(e){for(const t of this.getAllVideoTiles())if(t.state().boundAttendeeId===e)return t}captureVideoTile(e){const t=this.getVideoTile(e);return t?t.capture():null}findOrCreateLocalVideoTile(){return this.currentLocalTile||(this.currentLocalTile=this.addVideoTile(!0),this.currentLocalTile.bindVideoStream(this.audioVideoController.configuration.credentials.attendeeId,!0,null,null,null,null,this.audioVideoController.configuration.credentials.externalUserId)),this.currentLocalTile}}},4922:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(3327);t.default=class{makeTile(e,t,i,r){return new n.default(e,t,i,r)}}},9394:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{}},4450:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(7606),r=i(5785),s=i(8660),o=i(1133),a=i(9394);class c{constructor(e,t){this.selfAttendeeId=e,this.logger=t,this.numSenders=0,this.shouldDisableSimulcast=!1,this.newQualityMap=new Map,this.currentQualityMap=new Map,this.newActiveStreams=1,this.currentActiveStreams=1,this.lastUplinkBandwidthKbps=c.defaultUplinkBandwidthKbps,this.startTimeMs=0,this.lastUpdatedMs=Date.now(),this.videoIndex=null,this.currLocalDescriptions=[],this.nextLocalDescriptions=[],this.observerQueue=new Set,this.optimalParameters=new o.default(0,0,0,0,!0),this.parametersInEffect=new o.default(0,0,0,0,!0),this.lastUplinkBandwidthKbps=c.defaultUplinkBandwidthKbps,this.currentQualityMap=this.fillEncodingParamWithBitrates([300,0,1200]),this.newQualityMap=this.fillEncodingParamWithBitrates([300,0,1200])}updateConnectionMetric({uplinkKbps:e=0}){if(isNaN(e))return;0===this.startTimeMs&&(this.startTimeMs=Date.now()),Date.now()-this.startTimeMs`simulcast: uplink policy update metrics ${this.lastUplinkBandwidthKbps}`));let t=c.holdDownDurationMs;3===this.currentActiveStreams?t=2*c.holdDownDurationMs:(2===this.currentActiveStreams&&e<=c.kMidDisabledRate||1===this.currentActiveStreams&&e<=c.kHiDisabledRate)&&(t=c.holdDownDurationMs/2),Date.now()=i||this.lastUplinkBandwidthKbps<=n){this.shouldDisableSimulcast?(this.newActiveStreams=0,t[0].maxBitrateKbps=0,t[1].maxBitrateKbps=1200,t[2].maxBitrateKbps=0):this.numSenders<=4&&this.lastUplinkBandwidthKbps>=c.kHiDisabledRate?(this.newActiveStreams=1,t[0].maxBitrateKbps=300,t[1].maxBitrateKbps=0,t[2].maxBitrateKbps=1200):this.lastUplinkBandwidthKbps>=c.kMidDisabledRate?(this.newActiveStreams=2,t[0].maxBitrateKbps=this.lastUplinkBandwidthKbps>=350?200:150,t[1].maxBitrateKbps=this.numSenders<=6?600:350,t[2].maxBitrateKbps=0):(this.newActiveStreams=3,t[0].maxBitrateKbps=300,t[1].maxBitrateKbps=0,t[2].maxBitrateKbps=0);const e=t.map(((e,t,i)=>e.maxBitrateKbps));this.newQualityMap=this.fillEncodingParamWithBitrates(e),this.encodingParametersEqual()||this.logger.info(`simulcast: policy:calculateEncodingParameters bw:${this.lastUplinkBandwidthKbps} numSources:${this.numSenders} shouldDisableSimulcast:${this.shouldDisableSimulcast} newQualityMap: ${this.getQualityMapString(this.newQualityMap)}`)}return this.newQualityMap}chooseMediaTrackConstraints(){return{width:{ideal:1280},height:{ideal:768},frameRate:{ideal:15}}}chooseEncodingParameters(){return this.currentQualityMap=this.newQualityMap,this.currentActiveStreams=this.newActiveStreams,this.activeStreamsToPublish!==this.newActiveStreams&&(this.activeStreamsToPublish=this.newActiveStreams,this.publishEncodingSimulcastLayer()),this.currentQualityMap}updateIndex(e){const t=e.numberOfVideoPublishingParticipantsExcludingSelf(this.selfAttendeeId)+1,i=t!==this.numSenders,n=e.numberOfParticipants(),r=n>=0&&n<=2,s=this.shouldDisableSimulcast!==r;this.numSenders=t,this.shouldDisableSimulcast=r,this.optimalParameters=new o.default(this.captureWidth(),this.captureHeight(),this.captureFrameRate(),this.maxBandwidthKbps(),!1),this.videoIndex=e,this.newQualityMap=this.calculateEncodingParameters(i||s)}wantsResubscribe(){let e=!this.encodingParametersEqual();this.nextLocalDescriptions=this.videoIndex.localStreamDescriptions();for(let t=0;te.streamId===i));-1!==n&&this.nextLocalDescriptions[t].disabledByWebRTC!==this.currLocalDescriptions[n].disabledByWebRTC&&(e=!0)}}return e&&(this.lastUpdatedMs=Date.now()),this.currLocalDescriptions=this.nextLocalDescriptions,e}compareEncodingParameter(e,t){return JSON.stringify(e)===JSON.stringify(t)}encodingParametersEqual(){let e=!1;for(const t of r.default.NAME_ARR_ASCENDING)if(e=e||!this.compareEncodingParameter(this.newQualityMap.get(t),this.currentQualityMap.get(t)),e)break;return!e}chooseCaptureAndEncodeParameters(){return this.parametersInEffect=this.optimalParameters.clone(),this.parametersInEffect.clone()}captureWidth(){return 1280}captureHeight(){return 768}captureFrameRate(){return 15}maxBandwidthKbps(){return 1400}setIdealMaxBandwidthKbps(e){}setHasBandwidthPriority(e){}fillEncodingParamWithBitrates(e){const t=new Map,i=r.default.NAME_ARR_ASCENDING,n=e;let s=this.shouldDisableSimulcast?1:4;for(let e=0;e0,scaleResolutionDownBy:Math.max(s,1),maxBitrate:1e3*n[e]}),s/=2}return t}getQualityMapString(e){let t=\"\";const i=this.videoIndex.localStreamDescriptions();return 3===i.length&&e.forEach((e=>{let n=!1;n=\"low\"===e.rid?i[0].disabledByWebRTC:\"mid\"===e.rid?i[1].disabledByWebRTC:i[2].disabledByWebRTC,t+=`{ rid: ${e.rid} active:${e.active} disabledByWebRTC: ${n} maxBitrate:${e.maxBitrate}}`})),t}getEncodingSimulcastLayer(e){switch(e){case 0:return n.default.High;case 1:return n.default.LowAndHigh;case 2:return n.default.LowAndMedium;case 3:return n.default.Low}}publishEncodingSimulcastLayer(){const e=this.getEncodingSimulcastLayer(this.activeStreamsToPublish);this.forEachObserver((t=>{s.Maybe.of(t.encodingSimulcastLayersDidChange).map((i=>i.bind(t)(e)))}))}addObserver(e){this.logger.info(\"adding simulcast uplink observer\"),this.observerQueue.add(e)}removeObserver(e){this.logger.info(\"removing simulcast uplink observer\"),this.observerQueue.delete(e)}forEachObserver(e){for(const t of this.observerQueue)e(t)}}t.default=c,c.defaultUplinkBandwidthKbps=1200,c.startupDurationMs=6e3,c.holdDownDurationMs=4e3,c.defaultMaxFrameRate=15,c.kHiDisabledRate=700,c.kMidDisabledRate=240},3879:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(7377);t.default=class{constructor(e,t){this.logger=e,this.encodingParams=t,this.videoIndex=null,this.currLocalDescriptions=[],this.nextLocalDescriptions=[]}updateConnectionMetric(e){}chooseMediaTrackConstraints(){}chooseEncodingParameters(){var e,t,i,r,s,o,a,c,d,l,u,h;const p=new Map,m=n.default.NAME_ARR_ASCENDING;return p.set(m[0],{rid:m[0],active:!0,scaleResolutionDownBy:(null===(t=null===(e=this.encodingParams)||void 0===e?void 0:e.low)||void 0===t?void 0:t.scaleResolutionDownBy)||2,maxBitrate:1e3*((null===(r=null===(i=this.encodingParams)||void 0===i?void 0:i.low)||void 0===r?void 0:r.maxBitrateKbps)||300),maxFramerate:(null===(o=null===(s=this.encodingParams)||void 0===s?void 0:s.low)||void 0===o?void 0:o.maxFramerate)||5}),p.set(m[1],{rid:m[1],active:!0,scaleResolutionDownBy:(null===(c=null===(a=this.encodingParams)||void 0===a?void 0:a.high)||void 0===c?void 0:c.scaleResolutionDownBy)||1,maxBitrate:1e3*((null===(l=null===(d=this.encodingParams)||void 0===d?void 0:d.high)||void 0===l?void 0:l.maxBitrateKbps)||1200),maxFramerate:null===(h=null===(u=this.encodingParams)||void 0===u?void 0:u.high)||void 0===h?void 0:h.maxFramerate}),this.getQualityMapString(p),p}updateIndex(e){this.videoIndex=e}wantsResubscribe(){var e,t;let i=!1;this.nextLocalDescriptions=null===(e=this.videoIndex)||void 0===e?void 0:e.localStreamDescriptions();for(let e=0;e<(null===(t=this.nextLocalDescriptions)||void 0===t?void 0:t.length);e++){const t=this.nextLocalDescriptions[e].streamId;if(0!==t&&t){const n=this.currLocalDescriptions.findIndex((e=>e.streamId===t));-1!==n&&this.nextLocalDescriptions[e].disabledByWebRTC!==this.currLocalDescriptions[n].disabledByWebRTC&&(i=!0)}}return this.currLocalDescriptions=this.nextLocalDescriptions,i}chooseCaptureAndEncodeParameters(){}maxBandwidthKbps(){return 1200}setIdealMaxBandwidthKbps(e){}setHasBandwidthPriority(e){}getQualityMapString(e){var t;let i=\"\";const n=null===(t=this.videoIndex)||void 0===t?void 0:t.localStreamDescriptions();(null==n?void 0:n.length)>0&&(e.forEach((e=>{let t=!1;t=\"low\"===e.rid?n[0].disabledByWebRTC:n[1].disabledByWebRTC,i+=`{ rid: ${e.rid} active:${e.active} disabledByWebRTC: ${t} maxBitrate:${e.maxBitrate} scaleResolutionDownBy:${e.scaleResolutionDownBy} maxFrameRate:${e.maxFramerate}`})),this.logger.info(`simulcast: content policy:chooseEncodingParameters newQualityMap: ${i}`))}addObserver(e){}removeObserver(e){}forEachObserver(e){}}},4442:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(1133);class s{constructor(e,t=!0,i=void 0,n=void 0){this.selfAttendeeId=e,this.scaleResolution=t,this.logger=i,this.browserBehavior=n,this.numberOfPublishedVideoSources=void 0,this.idealMaxBandwidthKbps=1500,this.hasBandwidthPriority=!1,this.encodingParamMap=new Map,this.reset()}reset(){this.numberOfPublishedVideoSources=void 0,this.optimalParameters=new r.default(0,0,0,0,!1),this.parametersInEffect=new r.default(0,0,0,0,!1),this.encodingParamMap.set(s.encodingMapKey,{maxBitrate:0})}updateConnectionMetric(e){}chooseMediaTrackConstraints(){return{}}chooseEncodingParameters(){return new Map}updateIndex(e){var t;let i=!0,n=1;this.transceiverController&&(i=this.transceiverController.hasVideoInput());const s=e.numberOfVideoPublishingParticipantsExcludingSelf(this.selfAttendeeId)+(i?1:0);if(this.numberOfPublishedVideoSources!==s){if(this.numberOfPublishedVideoSources=s,this.transceiverController){const e=this.getStreamCaptureSetting();e&&(n=this.calculateEncodingParameters(e).scaleResolutionDownBy)}this.optimalParameters=new r.default(this.captureWidth(),this.captureHeight(),this.captureFrameRate(),this.maxBandwidthKbps(),!1,n)}else null===(t=this.logger)||void 0===t||t.debug(\"Skipping update index; Number of participants has not changed\")}wantsResubscribe(){return!this.parametersInEffect.equal(this.optimalParameters)}chooseCaptureAndEncodeParameters(){return this.parametersInEffect=this.optimalParameters.clone(),this.parametersInEffect.clone()}captureWidth(){let e=640;return this.getNumberOfPublishedVideoSources()>4&&(e=320),e}captureHeight(){let e=384;return this.getNumberOfPublishedVideoSources()>4&&(e=192),e}captureFrameRate(){return 15}maxBandwidthKbps(){if(this.hasBandwidthPriority)return Math.trunc(this.idealMaxBandwidthKbps);let e=0;return e=this.getNumberOfPublishedVideoSources()<=2?this.idealMaxBandwidthKbps:this.getNumberOfPublishedVideoSources()<=4?2*this.idealMaxBandwidthKbps/3:(544/11+14880/(11*this.getNumberOfPublishedVideoSources()))/600*this.idealMaxBandwidthKbps,Math.trunc(e)}setIdealMaxBandwidthKbps(e){this.idealMaxBandwidthKbps=e}setHasBandwidthPriority(e){this.hasBandwidthPriority=e}setTransceiverController(e){this.transceiverController=e}updateTransceiverController(){return n(this,void 0,void 0,(function*(){const e=this.getStreamCaptureSetting();if(!e)return;const t=this.calculateEncodingParameters(e);this.shouldUpdateEndcodingParameters(t)&&(this.encodingParamMap.set(s.encodingMapKey,t),this.transceiverController.setEncodingParameters(this.encodingParamMap))}))}shouldUpdateEndcodingParameters(e){var t,i;const n=null===(i=null===(t=this.transceiverController.localVideoTransceiver().sender.getParameters())||void 0===t?void 0:t.encodings)||void 0===i?void 0:i[0];return e.maxBitrate!==(null==n?void 0:n.maxBitrate)||e.scaleResolutionDownBy!==(null==n?void 0:n.scaleResolutionDownBy)}calculateEncodingParameters(e){var t,i;const n=1e3*this.maxBandwidthKbps();let r=1;if(void 0!==e.height&&void 0!==e.width&&this.scaleResolution&&!this.hasBandwidthPriority&&this.getNumberOfPublishedVideoSources()>2){let n=s.targetHeightArray[Math.min(this.getNumberOfPublishedVideoSources(),s.targetHeightArray.length-1)];480===n&&(null===(t=this.browserBehavior)||void 0===t?void 0:t.disable480pResolutionScaleDown())&&(n=360),r=Math.max(Math.min(e.height,e.width)/n,1),null===(i=this.logger)||void 0===i||i.info(`Resolution scale factor is ${r} for capture resolution ${e.width}x${e.height}. New dimension is ${e.width/r}x${e.height/r}`)}return{scaleResolutionDownBy:r,maxBitrate:n}}getStreamCaptureSetting(){var e,t,i,n;return null===(n=null===(i=null===(t=null===(e=this.transceiverController)||void 0===e?void 0:e.localVideoTransceiver())||void 0===t?void 0:t.sender)||void 0===i?void 0:i.track)||void 0===n?void 0:n.getSettings()}getNumberOfPublishedVideoSources(){var e;return null!==(e=this.numberOfPublishedVideoSources)&&void 0!==e?e:0}}t.default=s,s.encodingMapKey=\"video\",s.targetHeightArray=[0,0,0,540,540,480,480,480,480,360,360,360,360,270,270,270,270,180,180,180,180,180,180,180,180,180]},657:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(1133);t.default=class{constructor(){}updateConnectionMetric(e){}chooseMediaTrackConstraints(){return{}}chooseEncodingParameters(){return new Map}updateIndex(e){}wantsResubscribe(){return!1}chooseCaptureAndEncodeParameters(){return new n.default(0,0,0,0,!1)}maxBandwidthKbps(){return 0}setIdealMaxBandwidthKbps(e){}setHasBandwidthPriority(e){}}},3928:(e,t)=>{\"use strict\";function i(e){return e.map((e=>\"object\"==typeof e?JSON.stringify(e):`${e}`)).join(\" \")}Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(e){this.base=e}debug(...e){this.base.debug(i(e))}info(...e){this.base.info(i(e))}warn(...e){this.base.warn(i(e))}error(...e){this.base.error(i(e))}}},2497:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0}),t.VoiceFocusDeviceTransformer=void 0;const r=i(6035),s=i(8690),o=i(4046),a=i(3928),c=i(8878),d=i(851);class l{constructor(e,{preload:t=!0,logger:i,fetchBehavior:n=l.defaultFetchBehavior()},r){this.spec=e,this.supported=!0,this.logger=i,this.vfLogger=i?new a.default(i):void 0,this.preload=t,this.fetchBehavior=n,this.spec=l.augmentSpec(this.spec),r&&(this.configuration=Promise.resolve(r))}static isSupported(e,t){var i,n;const o={fetchBehavior:l.defaultFetchBehavior(),logger:(null==t?void 0:t.logger)?new a.default(t.logger):void 0};if(s.isIFramed()){if(!1===(null==t?void 0:t.allowIFrame))return null===(i=null==t?void 0:t.logger)||void 0===i||i.error(\"Amazon Voice Focus support check inside iframe: not supported.\"),Promise.resolve(!1);null===(n=null==t?void 0:t.logger)||void 0===n||n.warn(\"Amazon Voice Focus support check inside iframe: not recommended.\")}return r.VoiceFocus.isSupported(l.augmentSpec(e),o)}static create(e={},t={},i,r,s){var o,a,c;return n(this,void 0,void 0,(function*(){r&&r.Meeting.Meeting&&(r=r.Meeting);const n=\"AVAILABLE\"===(null===(c=null===(a=null===(o=null==r?void 0:r.Meeting)||void 0===o?void 0:o.MeetingFeatures)||void 0===a?void 0:a.Audio)||void 0===c?void 0:c.EchoReduction),s=i&&!0===i.supported&&\"ns_es\"===i.model.name&&!n,d=\"ns_es\"===e.name&&!n;if(s||d)throw new Error(\"Echo Reduction requested but not enabled.\");const u=new l(e,t,i);return yield u.init(),u}))}static configure(e={},t={}){return n(this,void 0,void 0,(function*(){return new l(e,t,void 0).configure(!0)}))}getConfiguration(){return this.configuration}isSupported(){return this.supported}createTransformDevice(e,t){return n(this,void 0,void 0,(function*(){if(this.supported)try{const i=!0,[n,r]=yield this.allocateVoiceFocus(i),s=Object.assign(Object.assign({},t),{es:\"ns_es\"===this.spec.name});return new c.default(e,n,r,s)}catch(e){return}}))}static destroyVoiceFocus(e){var t;return n(this,void 0,void 0,(function*(){null===(t=null==e?void 0:e.vf)||void 0===t||t.destroy()}))}static augmentSpec(e){return e&&(e.assetGroup||e.revisionID)?e:Object.assign(Object.assign({},e),{assetGroup:l.currentSDKAssetGroup()})}configure(e=!1){return n(this,void 0,void 0,(function*(){const t={fetchBehavior:this.fetchBehavior,preResolve:e,logger:this.vfLogger};return r.VoiceFocus.configure(this.spec,t)}))}init(){var e;return n(this,void 0,void 0,(function*(){this.configuration||(this.configuration=this.configure());const t=yield this.configuration;if(t.supported){this.pendingVoiceFocus=this.createVoiceFocus(t,this.preload);try{yield this.pendingVoiceFocus}catch(t){null===(e=this.logger)||void 0===e||e.error(`Unable to initialize Amazon Voice Focus: ${t}`),this.supported=!1}}else this.supported=!1}))}createVoiceFocus(e,t){return n(this,void 0,void 0,(function*(){const i=new d.default;return this.vf=yield r.VoiceFocus.init(e,{delegate:i,preload:t,logger:this.vfLogger}),[this.vf,i]}))}allocateVoiceFocus(e){return n(this,void 0,void 0,(function*(){if(!this.supported)throw new Error(\"Not supported.\");if(this.pendingVoiceFocus){const e=this.pendingVoiceFocus;return this.pendingVoiceFocus=void 0,e}return this.createVoiceFocus(yield this.configuration,e)}))}static majorVersion(){return o.default.sdkVersion.match(/^[1-9][0-9]*\\.(?:0|[1-9][0-9]*)/)[0]}static majorMinorVersion(){return o.default.sdkVersion.match(/^[1-9][0-9]*\\.(?:0|(?:[1-9][0-9]*))\\.(?:0|[1-9][0-9]*)/)[0]}static currentSDKAssetGroup(){const e=this.majorVersion();return e?`sdk-${e}`:\"stable-v1\"}static defaultFetchBehavior(){const e=l.majorMinorVersion()||\"unknown\",t=o.default.sdkUserAgentLowResolution;return{escapedQueryString:`sdk=${encodeURIComponent(e)}&ua=${encodeURIComponent(t)}`}}}t.VoiceFocusDeviceTransformer=l,t.default=l},8878:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(543);class s{constructor(e,t,i,n,s=!1,o=void 0,a=new r.default,c=new Map,d=void 0,l=void 0){this.device=e,this.voiceFocus=t,this.delegate=i,this.nodeOptions=n,this.failed=s,this.node=o,this.browserBehavior=a,this.farEndStreamToAudioSourceNode=c,this.mixDestNode=d,this.mixSourceNode=l}getInnerDevice(){return this.device}mute(e){return n(this,void 0,void 0,(function*(){this.node&&(e?yield this.node.disable():yield this.node.enable())}))}stop(){return n(this,void 0,void 0,(function*(){this.node&&(this.node.disconnect(),yield this.node.stop())}))}chooseNewInnerDevice(e){return n(this,void 0,void 0,(function*(){return this.device!==e||(\"default\"===(t=e)||t&&\"object\"==typeof t&&(\"deviceId\"in t&&\"default\"===t.deviceId||\"id\"in t&&\"default\"===t.id))?new s(e,this.voiceFocus,this.delegate,this.nodeOptions,this.failed,this.node,this.browserBehavior,this.farEndStreamToAudioSourceNode,this.mixDestNode,this.mixSourceNode):this;var t}))}intrinsicDevice(){return n(this,void 0,void 0,(function*(){if(this.failed)return this.device;const e=this.nodeOptions.es,t={echoCancellation:!e,googEchoCancellation:!e,googEchoCancellation2:!e,noiseSuppression:!1,googNoiseSuppression:!1,googHighpassFilter:!1,googNoiseSuppression2:!1};let i;return i=!this.nodeOptions||void 0===this.nodeOptions.agc||this.nodeOptions.agc.useBuiltInAGC,t.autoGainControl=i,t.googAutoGainControl=i,t.googAutoGainControl2=i,this.device?\"string\"==typeof this.device?(this.browserBehavior.requiresNoExactMediaStreamConstraints()?t.deviceId=this.device:t.deviceId={exact:this.device},t):this.device.id?this.device:Object.assign(Object.assign({},this.device),t):t}))}createAudioNode(e){var t,i;return n(this,void 0,void 0,(function*(){if((null===(t=this.node)||void 0===t?void 0:t.context)===e)return{start:this.node,end:this.node};const n=Object.assign({enabled:!0,agc:{useVoiceFocusAGC:!1}},this.nodeOptions);try{if(null===(i=this.node)||void 0===i||i.disconnect(),this.node=yield this.voiceFocus.createNode(e,n),this.nodeOptions.es){this.mixDestNode=new MediaStreamAudioDestinationNode(e,{channelCount:1,channelCountMode:\"explicit\"});for(const e of this.farEndStreamToAudioSourceNode.keys())this.assignFarEndStreamToAudioSourceNode(e);this.createMixSourceNode()}return{start:this.node,end:this.node}}catch(e){throw this.failed=!0,this.delegate.onFallback(this,e),e}}))}observeMeetingAudio(e){return n(this,void 0,void 0,(function*(){if(!this.nodeOptions.es)return;e.addAudioMixObserver(this);const t=yield e.getCurrentMeetingAudioStream();t&&this.addFarEndStream(t)}))}unObserveMeetingAudio(e){return n(this,void 0,void 0,(function*(){if(!this.nodeOptions.es)return;e.removeAudioMixObserver(this);const t=yield e.getCurrentMeetingAudioStream();t&&this.removeFarendStream(t)}))}addObserver(e){this.delegate.addObserver(e)}removeObserver(e){this.delegate.removeObserver(e)}addFarEndStream(e){return n(this,void 0,void 0,(function*(){this.nodeOptions.es&&e&&!this.farEndStreamToAudioSourceNode.has(e)&&(this.node?this.assignFarEndStreamToAudioSourceNode(e):this.farEndStreamToAudioSourceNode.set(e,null))}))}removeFarendStream(e){var t;return n(this,void 0,void 0,(function*(){null===(t=this.farEndStreamToAudioSourceNode.get(e))||void 0===t||t.disconnect(),this.farEndStreamToAudioSourceNode.delete(e)}))}meetingAudioStreamBecameActive(e){return n(this,void 0,void 0,(function*(){this.addFarEndStream(e)}))}meetingAudioStreamBecameInactive(e){return n(this,void 0,void 0,(function*(){this.removeFarendStream(e)}))}assignFarEndStreamToAudioSourceNode(e){const t=this.node.context.createMediaStreamSource(e);t.channelCount=1,t.channelCountMode=\"explicit\",this.farEndStreamToAudioSourceNode.set(e,t),t.connect(this.mixDestNode,0)}createMixSourceNode(){this.mixSourceNode=this.node.context.createMediaStreamSource(this.mixDestNode.stream),this.mixSourceNode.channelCount=1,this.mixSourceNode.channelCountMode=\"explicit\",this.mixSourceNode.connect(this.node,0,1)}}t.default=s},851:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default=class{constructor(){this.observers=new Set}addObserver(e){this.observers.add(e)}removeObserver(e){this.observers.delete(e)}onFallback(e,t){var i;for(const n of this.observers)null===(i=n.voiceFocusFellBackToInnerStream)||void 0===i||i.call(n,e,t)}onCPUWarning(){var e;for(const t of this.observers)null===(e=t.voiceFocusInsufficientResources)||void 0===e||e.call(t)}}},9751:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});class i{constructor(e,t,i,n,r){this.logger=e,this.realtimeController=t,this.minVolumeDecibels=i,this.maxVolumeDecibels=n,this.selfAttendeeId=r,this.streamIdToAttendeeId={},this.streamIdToExternalUserId={},this.warnedAboutMissingStreamIdMapping={},this.attendeeIdToStreamId={},this.sessionReconnected=!1}onReconnect(){this.sessionReconnected=!0}sendRealtimeUpdatesForAudioStreamIdInfo(e){let t=0;for(const i of e.streams){const n=!!i.attendeeId,r=!!i.externalUserId,s=i.hasOwnProperty(\"muted\"),o=!!i.dropped;if(n){this.attendeeIdToStreamId[i.attendeeId]&&this.attendeeIdToStreamId[i.attendeeId]i.audioStreamId&&this.streamIdToAttendeeId[t]===n){s=!0;break}}s||this.realtimeController.realtimeSetAttendeeIdPresence(n,!1,r,o,{attendeeIndex:t++,attendeesInFrame:e.streams.length})}}}this.sessionReconnected&&(this.cleanUpState(e),this.sessionReconnected=!1)}cleanUpState(e){const t=Object.values(this.streamIdToAttendeeId),i=e.streams.map((e=>e.attendeeId)),n=t.filter((e=>!i.includes(e)));for(const[e,t]of n.entries()){const i=this.attendeeIdToStreamId[t],n=this.streamIdToExternalUserId[i];delete this.streamIdToAttendeeId[i],delete this.streamIdToExternalUserId[i],delete this.warnedAboutMissingStreamIdMapping[i],delete this.attendeeIdToStreamId[t],t!==this.selfAttendeeId?this.realtimeController.realtimeSetAttendeeIdPresence(t,!1,n,!1,{attendeeIndex:e,attendeesInFrame:t.length}):this.logger.warn(\"the volume indicator adapter cleans up the current attendee (presence = false) after reconnection\")}}sendRealtimeUpdatesForAudioMetadata(e){let t=null,i=null;for(const n of e.attendeeStates){const e=this.attendeeIdForStreamId(n.audioStreamId);n.hasOwnProperty(\"volume\")&&(null===t&&(t={}),null!==e&&(t[e]=this.normalizedVolume(n))),n.hasOwnProperty(\"signalStrength\")&&(null===i&&(i={}),null!==e&&(i[e]=this.normalizedSignalStrength(n)))}this.applyRealtimeUpdatesForAudioMetadata(t,i)}normalizedVolume(e){const t=1-(-e.volume-this.maxVolumeDecibels)/(this.minVolumeDecibels-this.maxVolumeDecibels);return Math.min(Math.max(t,0),1)}normalizedSignalStrength(e){const t=e.signalStrength/i.MAX_SIGNAL_STRENGTH_LEVELS;return Math.min(Math.max(t,0),1)}applyRealtimeUpdatesForAudioMetadata(e,t){for(const n in this.streamIdToAttendeeId){const r=this.streamIdToAttendeeId[n],s=this.streamIdToExternalUserId[n];let o=null,a=null;null!==e&&(o=e.hasOwnProperty(r)?e[r]:i.IMPLICIT_VOLUME),null!==t&&(a=t.hasOwnProperty(r)?t[r]:i.IMPLICIT_SIGNAL_STRENGTH),null===o&&null===a||this.realtimeController.realtimeUpdateVolumeIndicator(r,o,null,a,s)}}attendeeIdForStreamId(e){if(0===e)return null;return this.streamIdToAttendeeId[e]||(this.warnedAboutMissingStreamIdMapping[e]||(this.warnedAboutMissingStreamIdMapping[e]=!0,this.logger.warn(`volume indicator stream id ${e} seen before being defined`)),null)}}t.default=i,i.MAX_SIGNAL_STRENGTH_LEVELS=2,i.IMPLICIT_VOLUME=0,i.IMPLICIT_SIGNAL_STRENGTH=1},7631:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(4046),r=i(7387);t.default=class{constructor(e){this.logger=e}create(e,t,i){this.connection=new WebSocket(i?e:n.default.urlWithVersion(e),t),this.connection.binaryType=\"arraybuffer\"}send(e){if(!this.connection)return this.logger.error(\"WebSocket not yet created or already destroyed.\"),!1;try{return e instanceof Uint8Array?this.connection.send(e.buffer):this.connection.send(e),!0}catch(e){return this.logger.debug((()=>`send error: ${e.message}, websocket state=${r.default[this.readyState()]}`)),!1}}close(e,t){var i;null===(i=this.connection)||void 0===i||i.close(e,t)}destroy(){this.connection=void 0}addEventListener(e,t){this.connection?this.connection.addEventListener(e,t):this.logger.warn(\"Cannot add event listener with no WebSocket connection.\")}removeEventListener(e,t){var i;null===(i=this.connection)||void 0===i||i.removeEventListener(e,t)}readyState(){if(!this.connection)return r.default.None;switch(this.connection.readyState){case WebSocket.CONNECTING:return r.default.Connecting;case WebSocket.OPEN:return r.default.Open;case WebSocket.CLOSING:return r.default.Closing;case WebSocket.CLOSED:return r.default.Closed}}}},7387:(e,t)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.WebSocketReadyState=void 0,function(e){e[e.None=0]=\"None\",e[e.Connecting=1]=\"Connecting\",e[e.Open=2]=\"Open\",e[e.Closing=3]=\"Closing\",e[e.Closed=4]=\"Closed\"}(i=t.WebSocketReadyState||(t.WebSocketReadyState={})),t.default=i},5995:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0}),t.decideModel=t.measureAndDecideExecutionApproach=void 0;const r=i(5021),s=i(9424),o={wasm:{noSupport:.07,inline:{c100:1,c50:.36,c20:.16,c10:.07},worker:{c100:.5,c50:.18,c20:.08,c10:.06}},simd:{noSupport:.1,inline:{c100:1,c50:.43,c20:.3,c10:.2},worker:{c100:.5,c50:.21,c20:.15,c10:.1}}};class a{constructor(e,t){this.fetchConfig=e,this.logger=t;const i=`${e.paths.workers}estimator-v1.js`;this.fetchBehavior={headers:e.headers,escapedQueryString:e.escapedQueryString},this.worker=r.loadWorker(i,\"VoiceFocusEstimator\",this.fetchBehavior,t)}roundtrip(e,t,i){return new Promise(((n,r)=>{this.worker.then((r=>{let s;s=e=>{const{message:o,key:a}=e.data;o===t&&a===i&&(r.removeEventListener(\"message\",s),n(e.data))},r.addEventListener(\"message\",s),r.postMessage(e)})).catch((e=>{var t;null===(t=this.logger)||void 0===t||t.error(\"Failed to load worker.\",e),r(e)}))}))}supportsSIMD(e){const t=\"simd\",i=e||`${this.fetchConfig.paths.wasm}simd-v1.wasm`,n={message:\"supports-simd\",fetchBehavior:this.fetchBehavior,path:i,key:t};return this.roundtrip(n,\"simd-support\",t).then((e=>e.supports))}measure(e,t){const i=`${this.fetchConfig.paths.wasm}bench-v1.wasm`,n=`${this.fetchConfig.paths.wasm}bench-v1_simd.wasm`,r=e?n:i,s=`bench:${e}`,o={message:\"measure\",fetchBehavior:this.fetchBehavior,budget:t,path:r,key:s};return this.roundtrip(o,\"measurement\",s).then((e=>{if(e.measurement)return e.measurement;throw new Error(\"Failed to measure.\")}))}stop(){this.worker.then((e=>{var t;null===(t=this.logger)||void 0===t||t.debug(\"Stopping estimator worker.\"),e.terminate()})).catch((e=>{}))}}const c=(e,t,i,r)=>n(void 0,void 0,void 0,(function*(){const n={supportsSIMD:e,supportsSAB:s.supportsSharedArrayBuffer(globalThis,window,i),duration:-1};if(e)return null==i||i.info(\"Supports SIMD: true (force)\"),n;const o=!r,c=r||new a(t,i);try{const t=!s.isOldChrome(window,i)&&(yield c.supportsSIMD());return null==i||i.info(`Supports SIMD: ${t} (force: ${e})`),n.supportsSIMD=t,n}finally{o&&c.stop()}}));t.measureAndDecideExecutionApproach=(e,t,i,r=o)=>n(void 0,void 0,void 0,(function*(){let d=e.executionPreference;const{usagePreference:l,variantPreference:u,namePreference:h,simdPreference:p,estimatorBudget:m,executionQuantaPreference:f}=e;\"interactivity\"===l&&\"inline\"!==d&&(null==i||i.debug(`Overriding execution preference ${d} to reflect interactivity preference.`),d=\"inline\");const g=\"force\"===p,v=\"auto\"!==u,S=\"auto\"!==d;let b;try{b=v&&S?yield c(g,t,i):yield((e,t,i,r)=>n(void 0,void 0,void 0,(function*(){const n=new a(t,r);try{const s=yield c(e,t,r,n);if(s.supportsSIMD)try{return s.duration=yield n.measure(!0,i),null==r||r.info(\"SIMD timing:\",s.duration),s}catch(e){null==r||r.warn(\"Failed SIMD estimation; falling back to non-SIMD.\"),s.supportsSIMD=!1}return s.duration=yield n.measure(!1,i),null==r||r.info(\"No-SIMD timing:\",s.duration),s}catch(e){throw null==r||r.error(\"Could not feature check.\",e),e}finally{n.stop()}})))(g,t,m,i)}catch(e){throw null==i||i.error(\"Could not load estimator.\",e),new Error(\"Could not load Voice Focus estimator.\")}return(({supportsSIMD:e,supportsSAB:t,duration:i,executionPreference:n=\"auto\",simdPreference:r,variantPreference:a=\"auto\",namePreference:c=\"default\",usagePreference:d,executionQuantaPreference:l=3},u=o,h)=>{const p=\"force\"===r||\"disable\"!==r&&e,m=-1!==i,f=m?(p?2.5:2.63)/i:0,g=p?u.simd:u.wasm,v=m?((e,t)=>1===e?.6:\"quality\"===t?.65*e:.5*e)(l,d)*f:0,S=m?.7*f:0,b=c,y=e=>({supported:!1,reason:e});if(m){if(f({supported:!0,useSIMD:p,processor:e,executionApproach:t,variant:i,executionQuanta:\"inline\"===t?l:void 0,name:b}),C=(e,t,i)=>\"auto\"!==t?!m||e>i[t]?t:\"failed\":e>i.c100?\"c100\":e>i.c50?\"c50\":e>i.c20?\"c20\":e>i.c10?\"c10\":\"failed\",k=e=>{switch(e||\"auto\"){case\"auto\":{let e=k(\"inline\"),t=k(\"worker\");return null==h||h.debug(`Reducing auto preference: ${JSON.stringify(e)} vs ${JSON.stringify(t)}`),!1===e.supported||!1===t.supported?t:e.variant===t.variant||\"c50\"===e.variant?e:t}case\"worker\":return s.supportsSharedArrayBuffer(globalThis,window,h)?k(\"worker-sab\"):k(\"worker-postMessage\");case\"inline\":{const e=C(v,a,g.inline);return\"failed\"===e?y(`Performance score ${v} not sufficient for inline use with variant preference ${a}.`):w(\"voicefocus-inline-processor\",\"inline\",e)}case\"worker-sab\":{if(!t){const e=\"Requested worker-sab but no SharedArrayBuffer support.\";return null==h||h.warn(e),{supported:!1,reason:e}}const e=C(S,a,g.worker);return\"failed\"===e?y(`Performance score ${S} not sufficient for worker use with variant preference ${a}.`):w(\"voicefocus-worker-sab-processor\",\"worker-sab\",e)}case\"worker-postMessage\":{const e=C(S,a,g.worker);if(\"failed\"===e)return y(`Performance score ${S} not sufficient for worker use.`);if(\"ns_es\"===b){const e=\"Requested echo suppression but postMessage executor does not support it.\";return null==h||h.warn(e),{supported:!1,reason:e}}return w(\"voicefocus-worker-postMessage-processor\",\"worker-postMessage\",e)}}};return k(n)})(Object.assign(Object.assign({},b),{simdPreference:p,executionPreference:d,variantPreference:u,namePreference:h,usagePreference:l,executionQuantaPreference:f}),r,i)})),t.decideModel=({category:e,name:t,variant:i,simd:n,url:r})=>`${e}-${t}-${i}-v1${n?\"_simd\":\"\"}`},623:(e,t)=>{\"use strict\";function i(e,t,i){if(!i)return fetch(e,t);const s=r(e,i),o=n(t,i);return fetch(s,o)}function n(e,t){return(null==t?void 0:t.headers)?e?Object.assign(Object.assign({},e),{headers:Object.assign(Object.assign({},e.headers||{}),t.headers)}):{headers:t.headers}:e}function r(e,t){if(!(null==t?void 0:t.escapedQueryString))return e;const i=-1!==e.lastIndexOf(\"?\");return`${e}${i?\"&\":\"?\"}${t.escapedQueryString}`}Object.defineProperty(t,\"__esModule\",{value:!0}),t.isValidRevisionID=t.isValidAssetGroup=t.resolveURL=t.addQueryParams=t.withQueryString=t.withRequestHeaders=t.fetchWithBehavior=void 0,t.fetchWithBehavior=i,t.withRequestHeaders=n,t.withQueryString=r,t.addQueryParams=function(e,t){const i=Object.keys(t);if(!i.length)return e;const n=new URLSearchParams(null==e?void 0:e.escapedQueryString);for(const e of i)n.append(e,t[e]);return Object.assign(Object.assign({},e),{escapedQueryString:n.toString()})};const s={method:\"HEAD\",mode:\"cors\",credentials:\"omit\",redirect:\"follow\",referrerPolicy:\"origin\"};t.resolveURL=function(e,t){return i(e,s,t).then((t=>t.redirected?t.url:e))},t.isValidAssetGroup=function(e){return!!e&&/^[-.a-zA-Z0-9]+$/.test(e)},t.isValidRevisionID=function(e){return!!e&&/^[123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ]{22}$/.test(e)}},5021:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.loadWorker=void 0;const n=i(623),r={method:\"GET\",mode:\"cors\",credentials:\"omit\",redirect:\"follow\",referrerPolicy:\"no-referrer\"};t.loadWorker=(e,t,i,s)=>{null==s||s.debug(`Loading ${t} worker from ${e}.`);let o=!1;try{o=self.origin===new URL(e).origin}catch(e){null==s||s.error(\"Could not compare origins.\",e)}if(o){const r=n.withQueryString(e,i);return Promise.resolve(new Worker(r,{name:t}))}return n.fetchWithBehavior(e,r,i).then((e=>{if(e.ok)return e.blob().then((e=>new Worker(window.URL.createObjectURL(e))));throw new Error(\"Fetch failed.\")}))}},9424:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0}),t.isOldChrome=t.supportsWASMStreaming=t.supportsSharedArrayBuffer=t.supportsWASM=t.supportsAudioWorklet=t.supportsWorker=t.supportsVoiceFocusWorker=t.supportsWASMPostMessage=t.isSafari=void 0;const r=i(5021);t.isSafari=(e=globalThis)=>{const t=e.navigator.userAgent,i=t.match(/Safari\\//),n=t.match(/Chrom(?:e|ium)\\//);return!(!i||n)},t.supportsWASMPostMessage=(e=globalThis)=>!t.isSafari(e)&&(!((e=globalThis)=>!!e.navigator.userAgent.match(/Chrom(?:e|ium)\\/([0-9]+)/))(e)||(s(e)||0)<95),t.supportsVoiceFocusWorker=(e=globalThis,i,s)=>n(void 0,void 0,void 0,(function*(){if(!t.supportsWorker(e,s))return!1;const n=`${i.paths.workers}worker-v1.js`;try{const e=yield r.loadWorker(n,\"VoiceFocusTestWorker\",i,s);try{e.terminate()}catch(e){null==s||s.debug(\"Failed to terminate worker.\",e)}return!0}catch(e){return null==s||s.info(\"Failed to fetch and instantiate test worker\",e),!1}})),t.supportsWorker=(e=globalThis,t)=>{try{return!!e.Worker}catch(e){return null==t||t.info(\"Does not support Worker\",e),!1}},t.supportsAudioWorklet=(e=globalThis,t)=>{try{return!!e.AudioWorklet&&!!e.AudioWorkletNode}catch(e){return null==t||t.info(\"Does not support Audio Worklet\",e),!1}},t.supportsWASM=(e=globalThis,t)=>{try{return!(!e.WebAssembly||!e.WebAssembly.compile&&!e.WebAssembly.compileStreaming)}catch(e){return null==t||t.info(\"Does not support WASM\",e),!1}},t.supportsSharedArrayBuffer=(e=globalThis,t=globalThis,i)=>{try{return!(!e.SharedArrayBuffer||!t.chrome&&!e.crossOriginIsolated)}catch(e){return null==i||i.info(\"Does not support SharedArrayBuffer.\"),!1}},t.supportsWASMStreaming=(e=globalThis,t)=>{var i;try{return!!(null===(i=e.WebAssembly)||void 0===i?void 0:i.compileStreaming)}catch(e){return null==t||t.info(\"Does not support WASM streaming compilation\",e),!1}};const s=(e=globalThis)=>{try{if(!e.chrome)return}catch(e){}const t=e.navigator.userAgent.match(/Chrom(?:e|ium)\\/([0-9]+)/);if(t)return parseInt(t[1],10)};t.isOldChrome=(e=globalThis,t)=>{const i=s(e);return!!i&&i<90&&(null==t||t.debug(`Chrome ${i} has incomplete SIMD support.`),!0)}},103:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.VoiceFocusAudioWorkletNode=void 0;class i extends(\"undefined\"!=typeof globalThis&&globalThis.AudioWorkletNode||class{}){}t.VoiceFocusAudioWorkletNode=i},6035:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0}),t.getAudioInput=t.createAudioContext=t.VoiceFocus=void 0;const r=i(5995),s=i(623),o=i(5021),a=i(9424),c=i(2633),d=i(1678),l=i(271),u={useVoiceFocusAGC:!1,useBuiltInAGC:!0},h=\"stable-v1\",p=\"https://static.sdkassets.chime.aws\",m={processors:`${p}/processors/`,workers:`${p}/workers/`,wasm:`${p}/wasm/`,models:`${p}/wasm/`},f={latencyHint:0},g={channelCount:1,echoCancellation:!0,googEchoCancellation:!0,noiseSuppression:!1,googNoiseSuppression:!1,googHighpassFilter:!1,googTypingNoiseDetection:!1},v=Object.assign(Object.assign({},g),{autoGainControl:!0,googAutoGainControl:!0,googAutoGainControl2:!0}),S=Object.assign(Object.assign({},g),{autoGainControl:!1,googAutoGainControl:!1,googAutoGainControl2:!1}),b={\"voicefocus-worker-sab-processor\":{file:\"worklet-worker-sab-processor-v1.js\",node:d.default},\"voicefocus-worker-postMessage-processor\":{file:\"worklet-worker-postMessage-processor-v1.js\",node:l.default},\"voicefocus-inline-processor\":{file:\"worklet-inline-processor-v1.js\",node:c.default}},y=(e,t)=>{if(void 0!==e&&!s.isValidAssetGroup(e))throw new Error(`Invalid asset group ${e}`);if(void 0!==t&&!s.isValidRevisionID(t))throw new Error(`Invalid revision ID ${t}`)},w=(e,t)=>`${t.models}${r.decideModel(e)}.wasm`;class C{constructor(e,t,i,n,r){this.processorURL=t,this.nodeConstructor=i,this.nodeOptions=n,this.executionQuanta=r,this.internal={worker:e,nodeOptions:n,isDestroyed:!1}}static isSupported(e,t){const{fetchBehavior:i,logger:n}=t||{};if(\"undefined\"==typeof globalThis)return null==n||n.debug(\"Browser does not have globalThis.\"),Promise.resolve(!1);if(!a.supportsAudioWorklet(globalThis,n))return null==n||n.debug(\"Browser does not support Audio Worklet.\"),Promise.resolve(!1);if(!a.supportsWASM(globalThis,n))return null==n||n.debug(\"Browser does not support WASM.\"),Promise.resolve(!1);a.supportsWASMStreaming(globalThis,n)||null==n||n.debug(\"Browser does not support streaming WASM compilation.\");const{assetGroup:r=h,revisionID:o,paths:c=m}=e||{};y(r,o);const d=o?{revisionID:o}:{assetGroup:r},l=s.addQueryParams(i,d),u=Object.assign(Object.assign({},l),{paths:c});return a.supportsVoiceFocusWorker(globalThis,u,n)}static mungeExecutionPreference(e,t){const i=void 0===e||\"auto\"===e;if(a.isSafari(globalThis)){if(i||\"inline\"===e)return\"inline\";if(!i)throw new Error(`Unsupported execution preference ${e}`)}if(\"worker-sab\"===e&&!a.supportsSharedArrayBuffer(globalThis,globalThis,t))throw new Error(`Unsupported execution preference ${e}`);return e||\"auto\"}static configure(e,t){return n(this,void 0,void 0,(function*(){const{fetchBehavior:i,preResolve:n,logger:o}=t||{},{category:a=\"voicefocus\",name:c=\"default\",variant:d=\"auto\",assetGroup:l=h,revisionID:u,simd:p=\"detect\",executionPreference:f=\"auto\",executionQuantaPreference:g,usagePreference:v=\"interactivity\",estimatorBudget:S=100,paths:b=m,thresholds:C}=e||{};if(null==o||o.debug(\"Configuring Voice Focus with spec\",e),void 0!==a&&\"voicefocus\"!==a)throw new Error(`Unrecognized category ${a}`);if(void 0!==c&&\"default\"!==c&&\"ns_es\"!==c)throw new Error(`Unrecognized feature name ${c}`);if(void 0!==d&&![\"auto\",\"c100\",\"c50\",\"c20\",\"c10\"].includes(d))throw new Error(`Unrecognized feature variant ${d}`);if(void 0!==g&&![1,2,3].includes(g))throw new Error(`Unrecognized execution quanta preference ${g}`);if(y(l,u),void 0!==p&&![\"detect\",\"force\",\"disable\"].includes(p))throw new Error(`Unrecognized SIMD option ${p}`);if(void 0!==f&&![\"auto\",\"inline\",\"worker\",\"worker-sab\",\"worker-postMessage\"].includes(f))throw new Error(`Unrecognized execution preference ${f}`);if(void 0!==v&&![\"quality\",\"interactivity\"].includes(v))throw new Error(`Unrecognized usage preference ${v}`);const k={executionPreference:this.mungeExecutionPreference(f,o),usagePreference:v,executionQuantaPreference:g,variantPreference:d,namePreference:c,simdPreference:p,estimatorBudget:S},E=u?{revisionID:u}:{assetGroup:l},I=s.addQueryParams(i,E),T=Object.assign({paths:b},I),A=yield r.measureAndDecideExecutionApproach(k,T,o,C);if(!1===A.supported)return{supported:!1,reason:A.reason};null==o||o.info(\"Decided execution approach\",A);const{useSIMD:M,processor:x,variant:_,executionQuanta:P}=A,O={category:a||\"voicefocus\",name:c||\"default\",variant:_,simd:M};if(n){const e=w(O,b);O.url=yield s.resolveURL(e,I)}return{fetchConfig:T,model:O,processor:x,executionQuanta:P,supported:!0}}))}static init(e,{delegate:t,preload:i=!0,logger:r}){return n(this,void 0,void 0,(function*(){if(!1===e.supported)throw new Error(\"Voice Focus not supported. Reason: \"+e.reason);const{model:n,processor:s,fetchConfig:c,executionQuanta:d}=e,{simd:l,name:u}=n,{paths:h}=c;if(\"voicefocus-inline-processor\"!==s&&\"voicefocus-worker-postMessage-processor\"!==s&&\"voicefocus-worker-sab-processor\"!==s)throw new Error(`Unknown processor ${s}`);const p=n.url||w(n,h);null==r||r.debug(`Using model URL ${p}.`);const m=`${h.wasm}audio_buffer-v1${l?\"_simd\":\"\"}.wasm`,f=`${h.wasm}resampler-v1${l?\"_simd\":\"\"}.wasm`,g=`${h.workers}worker-v1.js`,{file:v,node:S}=b[s],y=`${h.processors}${v}`,k=yield o.loadWorker(g,\"VoiceFocusWorker\",c,r);if(i){null==r||r.debug(\"Preloading\",p);let e=a.supportsWASMPostMessage(globalThis)?\"get-module\":\"get-module-buffer\";k.postMessage({message:e,preload:!0,key:\"model\",fetchBehavior:c,path:p})}const E=new C(k,y,S,{processor:s,worker:k,audioBufferURL:m,resamplerURL:f,fetchBehavior:c,modelURL:p,delegate:t,logger:r,numberOfInputs:\"ns_es\"===u?2:1},d);return Promise.resolve(E)}))}createNode(e,t){var i;if(this.internal.isDestroyed)throw new Error(\"Unable to create node because VoiceFocus worker has been destroyed.\");const{voiceFocusSampleRate:n=(16e3===e.sampleRate?16e3:48e3),enabled:r=!0,agc:o=u}=t||{},a=null==t?void 0:t.es,c={voiceFocusSampleRate:n,enabled:r,sendBufferCount:10,prefill:6,agc:o,executionQuanta:this.executionQuanta,supportFarendStream:a},d=s.withQueryString(this.processorURL,null===(i=this.nodeOptions)||void 0===i?void 0:i.fetchBehavior);return e.audioWorklet.addModule(d).then((()=>new this.nodeConstructor(e,Object.assign(Object.assign({},this.nodeOptions),{processorOptions:c}))))}applyToStream(e,t,i){return n(this,void 0,void 0,(function*(){if(this.internal.isDestroyed)throw new Error(\"Unable to apply stream because VoiceFocus worker has been destroyed\");const n=t.createMediaStreamSource(e),r=yield this.applyToSourceNode(n,t,i),s=t.createMediaStreamDestination();return r.connect(s),{node:r,source:n,destination:s,stream:s.stream}}))}applyToSourceNode(e,t,i){return n(this,void 0,void 0,(function*(){const n=yield this.createNode(t,i);return e.connect(n),n}))}destroy(){this.internal.worker&&this.internal.worker.terminate(),this.internal.isDestroyed=!0}}t.VoiceFocus=C,t.createAudioContext=(e=f)=>new(window.AudioContext||window.webkitAudioContext)(e),t.getAudioInput=(e,t,i)=>n(void 0,void 0,void 0,(function*(){var n,r;const{constraints:s,spec:o,delegate:a,preload:c=!0,options:d}=t,{logger:l}=i,h=yield C.configure(o,i);if(!h.supported)return null===(n=i.logger)||void 0===n||n.warn(\"Voice Focus not supported; returning standard stream.\"),window.navigator.mediaDevices.getUserMedia(s);const p=yield C.init(h,{delegate:a,preload:c,logger:l}),m=(null===(r=t.options)||void 0===r?void 0:r.agc)||u,f=yield window.navigator.mediaDevices.getUserMedia(((e,t)=>{let i;if(i=t.useBuiltInAGC?v:S,!e)return{audio:i};if(!e.audio)return e;if(e.video)throw new Error(\"Not adding Voice Focus to multi-device getUserMedia call.\");return Object.assign(Object.assign({},e),{audio:!0===e.audio?i:Object.assign(Object.assign({},e.audio),i)})})(s,m));return p.applyToStream(f,e,d).then((e=>e.stream))}))},2633:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(9424),s=i(103);class o extends s.VoiceFocusAudioWorkletNode{constructor(e,t){super(e,t.processor,t),this.cpuWarningCount=0,this.channelCountMode=\"explicit\",this.channelCount=1;const{modelURL:i,worker:n,fetchBehavior:s,logger:o,delegate:a}=t;this.logger=o,this.port.onmessage=this.onProcessorMessage.bind(this),this.delegate=a,o&&o.debug(\"VoiceFocusInlineNode:\",i),this.worker=n,this.worker.onmessage=this.onWorkerMessage.bind(this);const c=r.supportsWASMPostMessage(globalThis)?\"get-module\":\"get-module-buffer\";this.worker.postMessage({message:c,key:\"model\",fetchBehavior:s,path:i})}onModuleBufferLoaded(e,t){this.port.postMessage({message:\"module-buffer\",buffer:e,key:t})}onModuleLoaded(e,t){this.port.postMessage({message:\"module\",module:e,key:t})}enable(){return n(this,void 0,void 0,(function*(){this.port.postMessage({message:\"enable\"})}))}disable(){return n(this,void 0,void 0,(function*(){this.port.postMessage({message:\"disable\"})}))}stop(){var e;return n(this,void 0,void 0,(function*(){this.port.postMessage({message:\"stop\"});try{null===(e=this.worker)||void 0===e||e.terminate()}catch(e){console.error(\"failed to terminate worker:\",e)}this.disconnect()}))}onProcessorMessage(e){var t,i,n;const r=e.data;if(\"cpu\"===r.message){this.cpuWarningCount++;const e=Date.now(),n=this.cpuWarningLastTriggered||e,s=Math.abs(e-n);(!this.cpuWarningLastTriggered||s>5e3)&&(null===(t=this.logger)||void 0===t||t.warn(`CPU warning (count: ${this.cpuWarningCount}):`,r.message),this.cpuWarningCount=0,this.cpuWarningLastTriggered=e),null===(i=this.delegate)||void 0===i||i.onCPUWarning()}else null===(n=this.logger)||void 0===n||n.debug(\"Ignoring processor message.\")}onWorkerMessage(e){const t=e.data;switch(t.message){case\"module-buffer\":if(!t.buffer||!t.key)return;this.onModuleBufferLoaded(t.buffer,t.key);break;case\"module\":if(!t.module||!t.key)return;this.onModuleLoaded(t.module,t.key);break;case\"stopped\":this.worker&&this.worker.terminate();break;default:return}}}t.default=o},271:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(9424),s=i(103);class o extends s.VoiceFocusAudioWorkletNode{constructor(e,t){super(e,t.processor,t),this.channelCountMode=\"explicit\",this.channelCount=1;const{modelURL:i,audioBufferURL:n,worker:s,fetchBehavior:o,delegate:a}=t;this.delegate=a,this.worker=s,this.worker.onmessage=this.onWorkerMessage.bind(this),this.port.onmessage=this.onProcessorMessage.bind(this);const{enabled:c,agc:d,supportFarendStream:l}=t.processorOptions;this.worker.postMessage({message:\"init\",approach:\"postMessage\",frames:16e3===e.sampleRate?160:480,enabled:c,agc:d,fetchBehavior:o,model:i,supportFarendStream:l});const u=r.supportsWASMPostMessage(globalThis)?\"get-module\":\"get-module-buffer\";this.worker.postMessage({message:u,key:\"buffer\",fetchBehavior:o,path:n})}enable(){return n(this,void 0,void 0,(function*(){this.worker.postMessage({message:\"enable\"})}))}disable(){return n(this,void 0,void 0,(function*(){this.worker.postMessage({message:\"disable\"})}))}stop(){return n(this,void 0,void 0,(function*(){try{this.worker.postMessage({message:\"stop\"})}catch(e){}this.disconnect()}))}onWorkerMessage(e){var t;const i=e.data;switch(i.message){case\"ready\":this.port.postMessage({message:\"ready\",shared:i.shared},i.shared?Object.values(i.shared):[]);break;case\"data\":if(!i.buffer)return;this.port.postMessage({message:\"data\",buffer:i.buffer},[i.buffer]);break;case\"stopped\":this.worker.terminate();break;case\"module-buffer\":case\"module\":case\"processing\":this.port.postMessage(i);break;case\"cpu\":null===(t=this.delegate)||void 0===t||t.onCPUWarning();break;default:return}}onProcessorMessage(e){var t;const i=e.data;switch(i.message){case\"data\":if(!i.buffer)return;this.worker.postMessage({message:\"data\",buffer:i.buffer},[i.buffer]);break;case\"cpu\":null===(t=this.delegate)||void 0===t||t.onCPUWarning();break;case\"prepare-for-frames\":this.worker.postMessage(i);break;default:return}}}t.default=o},1678:function(e,t,i){\"use strict\";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,\"__esModule\",{value:!0});const r=i(9424),s=i(103);class o extends s.VoiceFocusAudioWorkletNode{constructor(e,t){super(e,t.processor,t),this.channelCountMode=\"explicit\",this.channelCount=1;const{modelURL:i,resamplerURL:n,worker:s,fetchBehavior:o,delegate:a}=t;this.delegate=a,this.worker=s,this.worker.onmessage=this.onWorkerMessage.bind(this),this.port.onmessage=this.onProcessorMessage.bind(this);const{enabled:c,supportFarendStream:d}=t.processorOptions;this.worker.postMessage({message:\"init\",approach:\"sab\",frames:16e3===e.sampleRate?160:480,enabled:c,model:i,supportFarendStream:d});const l=r.supportsWASMPostMessage(globalThis)?\"get-module\":\"get-module-buffer\";this.worker.postMessage({message:l,key:\"resampler\",fetchBehavior:o,path:n})}enable(){return n(this,void 0,void 0,(function*(){this.state?(Atomics.store(this.state,1,1),Atomics.notify(this.state,0,1)):this.worker.postMessage({message:\"enable\"})}))}disable(){return n(this,void 0,void 0,(function*(){this.state?(Atomics.store(this.state,1,0),Atomics.notify(this.state,0,1)):this.worker.postMessage({message:\"disable\"})}))}stop(){return n(this,void 0,void 0,(function*(){if(this.state)Atomics.store(this.state,1,2),Atomics.notify(this.state,0,1);else try{this.worker.postMessage({message:\"stop\"})}catch(e){}this.disconnect()}))}onWorkerMessage(e){var t;const i=e.data;switch(i.message){case\"ready\":if(!i.shared)throw new Error(\"No shared state.\");this.state=new Int32Array(i.shared.state),this.port.postMessage(i);break;case\"stopped\":this.worker.terminate();break;case\"module-buffer\":case\"module\":case\"processing\":this.port.postMessage(i);break;case\"cpu\":null===(t=this.delegate)||void 0===t||t.onCPUWarning();break;default:return}}onProcessorMessage(e){var t;const i=e.data;switch(i.message){case\"cpu\":null===(t=this.delegate)||void 0===t||t.onCPUWarning();break;case\"prepare-for-frames\":this.worker.postMessage(i)}}}t.default=o},9423:(e,t,i)=>{\"use strict\";e.exports=i(4838)},4838:(e,t,i)=>{\"use strict\";var n=t;function r(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build=\"minimal\",n.Writer=i(6935),n.BufferWriter=i(8651),n.Reader=i(3669),n.BufferReader=i(2282),n.util=i(5598),n.rpc=i(2881),n.roots=i(574),n.configure=r,r()},3669:(e,t,i)=>{\"use strict\";e.exports=c;var n,r=i(5598),s=r.LongBits,o=r.utf8;function a(e,t){return RangeError(\"index out of range: \"+e.pos+\" + \"+(t||1)+\" > \"+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var d,l=\"undefined\"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error(\"illegal buffer\")}:function(e){if(Array.isArray(e))return new c(e);throw Error(\"illegal buffer\")},u=function(){return r.Buffer?function(e){return(c.create=function(e){return r.Buffer.isBuffer(e)?new n(e):l(e)})(e)}:l};function h(){var e=new s(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(\"invalid varint encoding\")}function p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function m(){if(this.pos+8>this.len)throw a(this,8);return new s(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.create=u(),c.prototype._slice=r.Array.prototype.subarray||r.Array.prototype.slice,c.prototype.uint32=(d=4294967295,function(){if(d=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return d;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return d}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|p(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,i=this.pos+e;if(i>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,i):t===i?new this.buf.constructor(0):this._slice.call(this.buf,t,i)},c.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},c.prototype.skip=function(e){if(\"number\"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(\"invalid wire type \"+e+\" at offset \"+this.pos)}return this},c._configure=function(e){n=e,c.create=u(),n._configure();var t=r.Long?\"toLong\":\"toNumber\";r.merge(c.prototype,{int64:function(){return h.call(this)[t](!1)},uint64:function(){return h.call(this)[t](!0)},sint64:function(){return h.call(this).zzDecode()[t](!1)},fixed64:function(){return m.call(this)[t](!0)},sfixed64:function(){return m.call(this)[t](!1)}})}},2282:(e,t,i)=>{\"use strict\";e.exports=s;var n=i(3669);(s.prototype=Object.create(n.prototype)).constructor=s;var r=i(5598);function s(e){n.call(this,e)}s._configure=function(){r.Buffer&&(s.prototype._slice=r.Buffer.prototype.slice)},s.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString(\"utf-8\",this.pos,this.pos=Math.min(this.pos+e,this.len))},s._configure()},574:e=>{\"use strict\";e.exports={}},2881:(e,t,i)=>{\"use strict\";t.Service=i(7505)},7505:(e,t,i)=>{\"use strict\";e.exports=r;var n=i(5598);function r(e,t,i){if(\"function\"!=typeof e)throw TypeError(\"rpcImpl must be a function\");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(i)}(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r,r.prototype.rpcCall=function e(t,i,r,s,o){if(!s)throw TypeError(\"request must be specified\");var a=this;if(!o)return n.asPromise(e,a,t,i,r,s);if(a.rpcImpl)try{return a.rpcImpl(t,i[a.requestDelimited?\"encodeDelimited\":\"encode\"](s).finish(),(function(e,i){if(e)return a.emit(\"error\",e,t),o(e);if(null!==i){if(!(i instanceof r))try{i=r[a.responseDelimited?\"decodeDelimited\":\"decode\"](i)}catch(e){return a.emit(\"error\",e,t),o(e)}return a.emit(\"data\",i,t),o(null,i)}a.end(!0)}))}catch(e){return a.emit(\"error\",e,t),void setTimeout((function(){o(e)}),0)}else setTimeout((function(){o(Error(\"already ended\"))}),0)},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(\"end\").off()),this}},7222:(e,t,i)=>{\"use strict\";e.exports=r;var n=i(5598);function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=r.zero=new r(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var o=r.zeroHash=\"\\0\\0\\0\\0\\0\\0\\0\\0\";r.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var i=e>>>0,n=(e-i)/4294967296>>>0;return t&&(n=~n>>>0,i=~i>>>0,++i>4294967295&&(i=0,++n>4294967295&&(n=0))),new r(i,n)},r.from=function(e){if(\"number\"==typeof e)return r.fromNumber(e);if(n.isString(e)){if(!n.Long)return r.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new r(e.low>>>0,e.high>>>0):s},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,i=~this.hi>>>0;return t||(i=i+1>>>0),-(t+4294967296*i)}return this.lo+4294967296*this.hi},r.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;r.fromHash=function(e){return e===o?s:new r((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:i<128?9:10}},5598:function(e,t,i){\"use strict\";var n=t;function r(e,t,i){for(var n=Object.keys(t),r=0;r0)},n.Buffer=function(){try{var e=n.inquire(\"buffer\").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return\"number\"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):\"undefined\"==typeof Uint8Array?e:new Uint8Array(e)},n.Array=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire(\"long\"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var i=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(i.lo,i.hi,t):i.toNumber(Boolean(t))},n.merge=r,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=s,n.ProtocolError=s(\"ProtocolError\"),n.oneOfGetter=function(e){for(var t={},i=0;i-1;--i)if(1===t[e[i]]&&void 0!==this[e[i]]&&null!==this[e[i]])return e[i]}},n.oneOfSetter=function(e){return function(t){for(var i=0;i{\"use strict\";e.exports=u;var n,r=i(5598),s=r.LongBits,o=r.base64,a=r.utf8;function c(e,t,i){this.fn=e,this.len=t,this.next=void 0,this.val=i}function d(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new c(d,0,0),this.tail=this.head,this.states=null}var h=function(){return r.Buffer?function(){return(u.create=function(){return new n})()}:function(){return new u}};function p(e,t,i){t[i]=255&e}function m(e,t){this.len=e,this.next=void 0,this.val=t}function f(e,t,i){for(;e.hi;)t[i++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[i++]=127&e.lo|128,e.lo=e.lo>>>7;t[i++]=e.lo}function g(e,t,i){t[i]=255&e,t[i+1]=e>>>8&255,t[i+2]=e>>>16&255,t[i+3]=e>>>24}u.create=h(),u.alloc=function(e){return new r.Array(e)},r.Array!==Array&&(u.alloc=r.pool(u.alloc,r.Array.prototype.subarray)),u.prototype._push=function(e,t,i){return this.tail=this.tail.next=new c(e,t,i),this.len+=t,this},m.prototype=Object.create(c.prototype),m.prototype.fn=function(e,t,i){for(;e>127;)t[i++]=127&e|128,e>>>=7;t[i]=e},u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new m((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return e<0?this._push(f,10,s.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},u.prototype.uint64=function(e){var t=s.from(e);return this._push(f,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(f,t.length(),t)},u.prototype.bool=function(e){return this._push(p,1,e?1:0)},u.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=s.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(r.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(r.float.writeDoubleLE,8,e)};var v=r.Array.prototype.set?function(e,t,i){t.set(e,i)}:function(e,t,i){for(var n=0;n>>0;if(!t)return this._push(p,1,0);if(r.isString(e)){var i=u.alloc(t=o.length(e));o.decode(e,i,0),e=i}return this.uint32(t)._push(v,t,e)},u.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(p,1,0)},u.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new c(d,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(d,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=e.next,this.tail=t,this.len+=i),this},u.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),i=0;e;)e.fn(e.val,t,i),i+=e.len,e=e.next;return t},u._configure=function(e){n=e,u.create=h(),n._configure()}},8651:(e,t,i)=>{\"use strict\";e.exports=s;var n=i(6935);(s.prototype=Object.create(n.prototype)).constructor=s;var r=i(5598);function s(){n.call(this)}function o(e,t,i){e.length<40?r.utf8.write(e,t,i):t.utf8Write?t.utf8Write(e,i):t.write(e,i)}s._configure=function(){s.alloc=r._Buffer_allocUnsafe,s.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&\"set\"===r.Buffer.prototype.set.name?function(e,t,i){t.set(e,i)}:function(e,t,i){if(e.copy)e.copy(t,i,0,e.length);else for(var n=0;n>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},s._configure()},9742:(e,t)=>{\"use strict\";t.byteLength=function(e){var t=a(e),i=t[0],n=t[1];return 3*(i+n)/4-n},t.toByteArray=function(e){var t,i,s=a(e),o=s[0],c=s[1],d=new r(function(e,t,i){return 3*(t+i)/4-i}(0,o,c)),l=0,u=c>0?o-4:o;for(i=0;i>16&255,d[l++]=t>>8&255,d[l++]=255&t;return 2===c&&(t=n[e.charCodeAt(i)]<<2|n[e.charCodeAt(i+1)]>>4,d[l++]=255&t),1===c&&(t=n[e.charCodeAt(i)]<<10|n[e.charCodeAt(i+1)]<<4|n[e.charCodeAt(i+2)]>>2,d[l++]=t>>8&255,d[l++]=255&t),d},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,s=[],o=16383,a=0,d=n-r;ad?d:a+o));return 1===r?(t=e[n-1],s.push(i[t>>2]+i[t<<4&63]+\"==\")):2===r&&(t=(e[n-2]<<8)+e[n-1],s.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+\"=\")),s.join(\"\")};for(var i=[],n=[],r=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,s=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",o=0;o<64;++o)i[o]=s[o],n[s.charCodeAt(o)]=o;function a(e){var t=e.length;if(t%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var i=e.indexOf(\"=\");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function c(e,t,n){for(var r,s,o=[],a=t;a>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return o.join(\"\")}n[\"-\".charCodeAt(0)]=62,n[\"_\".charCodeAt(0)]=63},1206:function(e){e.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,\"a\",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p=\"\",i(i.s=90)}({17:function(e,t,i){\"use strict\";t.__esModule=!0,t.default=void 0;var n=i(18),r=function(){function e(){}return e.getFirstMatch=function(e,t){var i=t.match(e);return i&&i.length>0&&i[1]||\"\"},e.getSecondMatch=function(e,t){var i=t.match(e);return i&&i.length>1&&i[2]||\"\"},e.matchAndReturnConst=function(e,t,i){if(e.test(t))return i},e.getWindowsVersionName=function(e){switch(e){case\"NT\":return\"NT\";case\"XP\":case\"NT 5.1\":return\"XP\";case\"NT 5.0\":return\"2000\";case\"NT 5.2\":return\"2003\";case\"NT 6.0\":return\"Vista\";case\"NT 6.1\":return\"7\";case\"NT 6.2\":return\"8\";case\"NT 6.3\":return\"8.1\";case\"NT 10.0\":return\"10\";default:return}},e.getMacOSVersionName=function(e){var t=e.split(\".\").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return\"Leopard\";case 6:return\"Snow Leopard\";case 7:return\"Lion\";case 8:return\"Mountain Lion\";case 9:return\"Mavericks\";case 10:return\"Yosemite\";case 11:return\"El Capitan\";case 12:return\"Sierra\";case 13:return\"High Sierra\";case 14:return\"Mojave\";case 15:return\"Catalina\";default:return}},e.getAndroidVersionName=function(e){var t=e.split(\".\").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?\"Cupcake\":1===t[0]&&t[1]>=6?\"Donut\":2===t[0]&&t[1]<2?\"Eclair\":2===t[0]&&2===t[1]?\"Froyo\":2===t[0]&&t[1]>2?\"Gingerbread\":3===t[0]?\"Honeycomb\":4===t[0]&&t[1]<1?\"Ice Cream Sandwich\":4===t[0]&&t[1]<4?\"Jelly Bean\":4===t[0]&&t[1]>=4?\"KitKat\":5===t[0]?\"Lollipop\":6===t[0]?\"Marshmallow\":7===t[0]?\"Nougat\":8===t[0]?\"Oreo\":9===t[0]?\"Pie\":void 0},e.getVersionPrecision=function(e){return e.split(\".\").length},e.compareVersions=function(t,i,n){void 0===n&&(n=!1);var r=e.getVersionPrecision(t),s=e.getVersionPrecision(i),o=Math.max(r,s),a=0,c=e.map([t,i],(function(t){var i=o-e.getVersionPrecision(t),n=t+new Array(i+1).join(\".0\");return e.map(n.split(\".\"),(function(e){return new Array(20-e.length).join(\"0\")+e})).reverse()}));for(n&&(a=o-Math.min(r,s)),o-=1;o>=a;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===a)return 0;o-=1}else if(c[0][o]1?r-1:0),o=1;o0){var o=Object.keys(i),c=a.default.find(o,(function(e){return t.isOS(e)}));if(c){var d=this.satisfies(i[c]);if(void 0!==d)return d}var l=a.default.find(o,(function(e){return t.isPlatform(e)}));if(l){var u=this.satisfies(i[l]);if(void 0!==u)return u}}if(s>0){var h=Object.keys(r),p=a.default.find(h,(function(e){return t.isBrowser(e,!0)}));if(void 0!==p)return this.compareVersion(r[p])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var i=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),r=a.default.getBrowserTypeByAlias(n);return t&&r&&(n=r.toLowerCase()),n===i},t.compareVersion=function(e){var t=[0],i=e,n=!1,r=this.getBrowserVersion();if(\"string\"==typeof r)return\">\"===e[0]||\"<\"===e[0]?(i=e.substr(1),\"=\"===e[1]?(n=!0,i=e.substr(2)):t=[],\">\"===e[0]?t.push(1):t.push(-1)):\"=\"===e[0]?i=e.substr(1):\"~\"===e[0]&&(n=!0,i=e.substr(1)),t.indexOf(a.default.compareVersions(r,i,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=d,e.exports=t.default},92:function(e,t,i){\"use strict\";t.__esModule=!0,t.default=void 0;var n,r=(n=i(17))&&n.__esModule?n:{default:n},s=/version\\/(\\d+(\\.?_?\\d+)+)/i,o=[{test:[/googlebot/i],describe:function(e){var t={name:\"Googlebot\"},i=r.default.getFirstMatch(/googlebot\\/(\\d+(\\.\\d+))/i,e)||r.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/opera/i],describe:function(e){var t={name:\"Opera\"},i=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:opera)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/opr\\/|opios/i],describe:function(e){var t={name:\"Opera\"},i=r.default.getFirstMatch(/(?:opr|opios)[\\s/](\\S+)/i,e)||r.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:\"Samsung Internet for Android\"},i=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:SamsungBrowser)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/Whale/i],describe:function(e){var t={name:\"NAVER Whale Browser\"},i=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:whale)[\\s/](\\d+(?:\\.\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:\"MZ Browser\"},i=r.default.getFirstMatch(/(?:MZBrowser)[\\s/](\\d+(?:\\.\\d+)+)/i,e)||r.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/focus/i],describe:function(e){var t={name:\"Focus\"},i=r.default.getFirstMatch(/(?:focus)[\\s/](\\d+(?:\\.\\d+)+)/i,e)||r.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/swing/i],describe:function(e){var t={name:\"Swing\"},i=r.default.getFirstMatch(/(?:swing)[\\s/](\\d+(?:\\.\\d+)+)/i,e)||r.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/coast/i],describe:function(e){var t={name:\"Opera Coast\"},i=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:coast)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/opt\\/\\d+(?:.?_?\\d+)+/i],describe:function(e){var t={name:\"Opera Touch\"},i=r.default.getFirstMatch(/(?:opt)[\\s/](\\d+(\\.?_?\\d+)+)/i,e)||r.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/yabrowser/i],describe:function(e){var t={name:\"Yandex Browser\"},i=r.default.getFirstMatch(/(?:yabrowser)[\\s/](\\d+(\\.?_?\\d+)+)/i,e)||r.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:\"UC Browser\"},i=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:ucbrowser)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:\"Maxthon\"},i=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:Maxthon|mxios)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/epiphany/i],describe:function(e){var t={name:\"Epiphany\"},i=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:epiphany)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/puffin/i],describe:function(e){var t={name:\"Puffin\"},i=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:puffin)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/sleipnir/i],describe:function(e){var t={name:\"Sleipnir\"},i=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:sleipnir)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/k-meleon/i],describe:function(e){var t={name:\"K-Meleon\"},i=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/(?:k-meleon)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/micromessenger/i],describe:function(e){var t={name:\"WeChat\"},i=r.default.getFirstMatch(/(?:micromessenger)[\\s/](\\d+(\\.?_?\\d+)+)/i,e)||r.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?\"QQ Browser Lite\":\"QQ Browser\"},i=r.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\\d+(\\.?_?\\d+)+)/i,e)||r.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/msie|trident/i],describe:function(e){var t={name:\"Internet Explorer\"},i=r.default.getFirstMatch(/(?:msie |rv:)(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/\\sedg\\//i],describe:function(e){var t={name:\"Microsoft Edge\"},i=r.default.getFirstMatch(/\\sedg\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:\"Microsoft Edge\"},i=r.default.getSecondMatch(/edg([ea]|ios)\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/vivaldi/i],describe:function(e){var t={name:\"Vivaldi\"},i=r.default.getFirstMatch(/vivaldi\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/seamonkey/i],describe:function(e){var t={name:\"SeaMonkey\"},i=r.default.getFirstMatch(/seamonkey\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/sailfish/i],describe:function(e){var t={name:\"Sailfish\"},i=r.default.getFirstMatch(/sailfish\\s?browser\\/(\\d+(\\.\\d+)?)/i,e);return i&&(t.version=i),t}},{test:[/silk/i],describe:function(e){var t={name:\"Amazon Silk\"},i=r.default.getFirstMatch(/silk\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/phantom/i],describe:function(e){var t={name:\"PhantomJS\"},i=r.default.getFirstMatch(/phantomjs\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/slimerjs/i],describe:function(e){var t={name:\"SlimerJS\"},i=r.default.getFirstMatch(/slimerjs\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/blackberry|\\bbb\\d+/i,/rim\\stablet/i],describe:function(e){var t={name:\"BlackBerry\"},i=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/blackberry[\\d]+\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:\"WebOS Browser\"},i=r.default.getFirstMatch(s,e)||r.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/bada/i],describe:function(e){var t={name:\"Bada\"},i=r.default.getFirstMatch(/dolfin\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/tizen/i],describe:function(e){var t={name:\"Tizen\"},i=r.default.getFirstMatch(/(?:tizen\\s?)?browser\\/(\\d+(\\.?_?\\d+)+)/i,e)||r.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/qupzilla/i],describe:function(e){var t={name:\"QupZilla\"},i=r.default.getFirstMatch(/(?:qupzilla)[\\s/](\\d+(\\.?_?\\d+)+)/i,e)||r.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:\"Firefox\"},i=r.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/electron/i],describe:function(e){var t={name:\"Electron\"},i=r.default.getFirstMatch(/(?:electron)\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:\"Miui\"},i=r.default.getFirstMatch(/(?:MiuiBrowser)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/chromium/i],describe:function(e){var t={name:\"Chromium\"},i=r.default.getFirstMatch(/(?:chromium)[\\s/](\\d+(\\.?_?\\d+)+)/i,e)||r.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:\"Chrome\"},i=r.default.getFirstMatch(/(?:chrome|crios|crmo)\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/GSA/i],describe:function(e){var t={name:\"Google Search\"},i=r.default.getFirstMatch(/(?:GSA)\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:function(e){var t=!e.test(/like android/i),i=e.test(/android/i);return t&&i},describe:function(e){var t={name:\"Android Browser\"},i=r.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/playstation 4/i],describe:function(e){var t={name:\"PlayStation 4\"},i=r.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:\"Safari\"},i=r.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search(\"\\\\(\")?/^(.*)\\/(.*)[ \\t]\\((.*)/:/^(.*)\\/(.*) /;return{name:r.default.getFirstMatch(t,e),version:r.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,i){\"use strict\";t.__esModule=!0,t.default=void 0;var n,r=(n=i(17))&&n.__esModule?n:{default:n},s=i(18),o=[{test:[/Roku\\/DVP/],describe:function(e){var t=r.default.getFirstMatch(/Roku\\/DVP-(\\d+\\.\\d+)/i,e);return{name:s.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=r.default.getFirstMatch(/windows phone (?:os)?\\s?(\\d+(\\.\\d+)*)/i,e);return{name:s.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=r.default.getFirstMatch(/Windows ((NT|XP)( \\d\\d?.\\d)?)/i,e),i=r.default.getWindowsVersionName(t);return{name:s.OS_MAP.Windows,version:t,versionName:i}}},{test:[/Macintosh(.*?) FxiOS(.*?)\\//],describe:function(e){var t={name:s.OS_MAP.iOS},i=r.default.getSecondMatch(/(Version\\/)(\\d[\\d.]+)/,e);return i&&(t.version=i),t}},{test:[/macintosh/i],describe:function(e){var t=r.default.getFirstMatch(/mac os x (\\d+(\\.?_?\\d+)+)/i,e).replace(/[_\\s]/g,\".\"),i=r.default.getMacOSVersionName(t),n={name:s.OS_MAP.MacOS,version:t};return i&&(n.versionName=i),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=r.default.getFirstMatch(/os (\\d+([_\\s]\\d+)*) like mac os x/i,e).replace(/[_\\s]/g,\".\");return{name:s.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),i=e.test(/android/i);return t&&i},describe:function(e){var t=r.default.getFirstMatch(/android[\\s/-](\\d+(\\.\\d+)*)/i,e),i=r.default.getAndroidVersionName(t),n={name:s.OS_MAP.Android,version:t};return i&&(n.versionName=i),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=r.default.getFirstMatch(/(?:web|hpw)[o0]s\\/(\\d+(\\.\\d+)*)/i,e),i={name:s.OS_MAP.WebOS};return t&&t.length&&(i.version=t),i}},{test:[/blackberry|\\bbb\\d+/i,/rim\\stablet/i],describe:function(e){var t=r.default.getFirstMatch(/rim\\stablet\\sos\\s(\\d+(\\.\\d+)*)/i,e)||r.default.getFirstMatch(/blackberry\\d+\\/(\\d+([_\\s]\\d+)*)/i,e)||r.default.getFirstMatch(/\\bbb(\\d+)/i,e);return{name:s.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=r.default.getFirstMatch(/bada\\/(\\d+(\\.\\d+)*)/i,e);return{name:s.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=r.default.getFirstMatch(/tizen[/\\s](\\d+(\\.\\d+)*)/i,e);return{name:s.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:s.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:s.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=r.default.getFirstMatch(/PlayStation 4[/\\s](\\d+(\\.\\d+)*)/i,e);return{name:s.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,i){\"use strict\";t.__esModule=!0,t.default=void 0;var n,r=(n=i(17))&&n.__esModule?n:{default:n},s=i(18),o=[{test:[/googlebot/i],describe:function(){return{type:\"bot\",vendor:\"Google\"}}},{test:[/huawei/i],describe:function(e){var t=r.default.getFirstMatch(/(can-l01)/i,e)&&\"Nova\",i={type:s.PLATFORMS_MAP.mobile,vendor:\"Huawei\"};return t&&(i.model=t),i}},{test:[/nexus\\s*(?:7|8|9|10).*/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:\"Nexus\"}}},{test:[/ipad/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:\"Apple\",model:\"iPad\"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\\//],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:\"Apple\",model:\"iPad\"}}},{test:[/kftt build/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:\"Amazon\",model:\"Kindle Fire HD 7\"}}},{test:[/silk/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:\"Amazon\"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),i=e.test(/like (ipod|iphone)/i);return t&&!i},describe:function(e){var t=r.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:s.PLATFORMS_MAP.mobile,vendor:\"Apple\",model:t}}},{test:[/nexus\\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:\"Nexus\"}}},{test:[/[^-]mobi/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return\"blackberry\"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:\"BlackBerry\"}}},{test:function(e){return\"bada\"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return\"windows phone\"===e.getBrowserName()},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:\"Microsoft\"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(\".\")[0]);return\"android\"===e.getOSName(!0)&&t>=3},describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){return\"android\"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return\"macos\"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop,vendor:\"Apple\"}}},{test:function(e){return\"windows\"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return\"linux\"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return\"playstation 4\"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:function(e){return\"roku\"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,i){\"use strict\";t.__esModule=!0,t.default=void 0;var n,r=(n=i(17))&&n.__esModule?n:{default:n},s=i(18),o=[{test:function(e){return\"microsoft edge\"===e.getBrowserName(!0)},describe:function(e){if(/\\sedg\\//i.test(e))return{name:s.ENGINE_MAP.Blink};var t=r.default.getFirstMatch(/edge\\/(\\d+(\\.?_?\\d+)+)/i,e);return{name:s.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:s.ENGINE_MAP.Trident},i=r.default.getFirstMatch(/trident\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:s.ENGINE_MAP.Presto},i=r.default.getFirstMatch(/presto\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:function(e){var t=e.test(/gecko/i),i=e.test(/like gecko/i);return t&&!i},describe:function(e){var t={name:s.ENGINE_MAP.Gecko},i=r.default.getFirstMatch(/gecko\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/(apple)?webkit\\/537\\.36/i],describe:function(){return{name:s.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:s.ENGINE_MAP.WebKit},i=r.default.getFirstMatch(/webkit\\/(\\d+(\\.?_?\\d+)+)/i,e);return i&&(t.version=i),t}}];t.default=o,e.exports=t.default}})},8764:(e,t,i)=>{\"use strict\";const n=i(9742),r=i(645),s=\"function\"==typeof Symbol&&\"function\"==typeof Symbol.for?Symbol.for(\"nodejs.util.inspect.custom\"):null;t.lW=c,t.h2=50;const o=2147483647;function a(e){if(e>o)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,i){if(\"number\"==typeof e){if(\"string\"==typeof t)throw new TypeError('The \"string\" argument must be of type string. Received type number');return u(e)}return d(e,t,i)}function d(e,t,i){if(\"string\"==typeof e)return function(e,t){if(\"string\"==typeof t&&\"\"!==t||(t=\"utf8\"),!c.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);const i=0|f(e,t);let n=a(i);const r=n.write(e,t);return r!==i&&(n=n.slice(0,r)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(J(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return p(e,t,i);if(\"undefined\"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return p(e,t,i);if(\"number\"==typeof e)throw new TypeError('The \"value\" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,i);const r=function(e){if(c.isBuffer(e)){const t=0|m(e.length),i=a(t);return 0===i.length||e.copy(i,0,0,t),i}return void 0!==e.length?\"number\"!=typeof e.length||Q(e.length)?a(0):h(e):\"Buffer\"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(r)return r;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive](\"string\"),t,i);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e)}function l(e){if(\"number\"!=typeof e)throw new TypeError('\"size\" argument must be of type number');if(e<0)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"')}function u(e){return l(e),a(e<0?0:0|m(e))}function h(e){const t=e.length<0?0:0|m(e.length),i=a(t);for(let n=0;n=o)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+o.toString(16)+\" bytes\");return 0|e}function f(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const i=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;let r=!1;for(;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return i;case\"utf8\":case\"utf-8\":return q(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*i;case\"hex\":return i>>>1;case\"base64\":return K(e).length;default:if(r)return n?-1:q(e).length;t=(\"\"+t).toLowerCase(),r=!0}}function g(e,t,i){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return\"\";if((i>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return _(this,t,i);case\"utf8\":case\"utf-8\":return T(this,t,i);case\"ascii\":return M(this,t,i);case\"latin1\":case\"binary\":return x(this,t,i);case\"base64\":return I(this,t,i);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return P(this,t,i);default:if(n)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),n=!0}}function v(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}function S(e,t,i,n,r){if(0===e.length)return-1;if(\"string\"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),Q(i=+i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if(\"string\"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:b(e,t,i,n,r);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):b(e,[t],i,n,r);throw new TypeError(\"val must be string, number or Buffer\")}function b(e,t,i,n,r){let s,o=1,a=e.length,c=t.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,i/=2}function d(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){let n=-1;for(s=i;sa&&(i=a-c),s=i;s>=0;s--){let i=!0;for(let n=0;nr&&(n=r):n=r;const s=t.length;let o;for(n>s/2&&(n=s/2),o=0;o>8,r=i%256,s.push(r),s.push(n);return s}(t,e.length-i),e,i,n)}function I(e,t,i){return 0===t&&i===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,i))}function T(e,t,i){i=Math.min(e.length,i);const n=[];let r=t;for(;r239?4:t>223?3:t>191?2:1;if(r+o<=i){let i,n,a,c;switch(o){case 1:t<128&&(s=t);break;case 2:i=e[r+1],128==(192&i)&&(c=(31&t)<<6|63&i,c>127&&(s=c));break;case 3:i=e[r+1],n=e[r+2],128==(192&i)&&128==(192&n)&&(c=(15&t)<<12|(63&i)<<6|63&n,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:i=e[r+1],n=e[r+2],a=e[r+3],128==(192&i)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&i)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(s=c))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),r+=o}return function(e){const t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let i=\"\",n=0;for(;nn.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,r)):Uint8Array.prototype.set.call(n,t,r);else{if(!c.isBuffer(t))throw new TypeError('\"list\" argument must be an Array of Buffers');t.copy(n,r)}r+=t.length}return n},c.byteLength=f,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(let t=0;ti&&(e+=\" ... \"),\"\"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(e,t,i,n,r){if(J(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw new RangeError(\"out of range index\");if(n>=r&&t>=i)return 0;if(n>=r)return-1;if(t>=i)return 1;if(this===e)return 0;let s=(r>>>=0)-(n>>>=0),o=(i>>>=0)-(t>>>=0);const a=Math.min(s,o),d=this.slice(n,r),l=e.slice(t,i);for(let e=0;e>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n=\"utf8\")):(n=i,i=void 0)}const r=this.length-t;if((void 0===i||i>r)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");let s=!1;for(;;)switch(n){case\"hex\":return y(this,e,t,i);case\"utf8\":case\"utf-8\":return w(this,e,t,i);case\"ascii\":case\"latin1\":case\"binary\":return C(this,e,t,i);case\"base64\":return k(this,e,t,i);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return E(this,e,t,i);default:if(s)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function M(e,t,i){let n=\"\";i=Math.min(e.length,i);for(let r=t;rn)&&(i=n);let r=\"\";for(let n=t;ni)throw new RangeError(\"Trying to access beyond buffer length\")}function R(e,t,i,n,r,s){if(!c.isBuffer(e))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError(\"Index out of range\")}function D(e,t,i,n,r){z(t,n,r,e,i,7);let s=Number(t&BigInt(4294967295));e[i++]=s,s>>=8,e[i++]=s,s>>=8,e[i++]=s,s>>=8,e[i++]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[i++]=o,o>>=8,e[i++]=o,o>>=8,e[i++]=o,o>>=8,e[i++]=o,i}function N(e,t,i,n,r){z(t,n,r,e,i,7);let s=Number(t&BigInt(4294967295));e[i+7]=s,s>>=8,e[i+6]=s,s>>=8,e[i+5]=s,s>>=8,e[i+4]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[i+3]=o,o>>=8,e[i+2]=o,o>>=8,e[i+1]=o,o>>=8,e[i]=o,i+8}function F(e,t,i,n,r,s){if(i+n>e.length)throw new RangeError(\"Index out of range\");if(i<0)throw new RangeError(\"Index out of range\")}function B(e,t,i,n,s){return t=+t,i>>>=0,s||F(e,0,i,4),r.write(e,t,i,n,23,4),i+4}function L(e,t,i,n,s){return t=+t,i>>>=0,s||F(e,0,i,8),r.write(e,t,i,n,52,8),i+8}c.prototype.slice=function(e,t){const i=this.length;(e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t>>=0,t>>>=0,i||O(e,t,this.length);let n=this[e],r=1,s=0;for(;++s>>=0,t>>>=0,i||O(e,t,this.length);let n=this[e+--t],r=1;for(;t>0&&(r*=256);)n+=this[e+--t]*r;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=X((function(e){$(e>>>=0,\"offset\");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||W(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,r=this[++e]+256*this[++e]+65536*this[++e]+i*2**24;return BigInt(n)+(BigInt(r)<>>=0,\"offset\");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||W(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],r=this[++e]*2**24+65536*this[++e]+256*this[++e]+i;return(BigInt(n)<>>=0,t>>>=0,i||O(e,t,this.length);let n=this[e],r=1,s=0;for(;++s=r&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||O(e,t,this.length);let n=t,r=1,s=this[e+--n];for(;n>0&&(r*=256);)s+=this[e+--n]*r;return r*=128,s>=r&&(s-=Math.pow(2,8*t)),s},c.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);const i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},c.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);const i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=X((function(e){$(e>>>=0,\"offset\");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||W(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(i<<24);return(BigInt(n)<>>=0,\"offset\");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||W(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||O(e,4,this.length),r.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),r.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),r.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),r.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,i,n){e=+e,t>>>=0,i>>>=0,n||R(this,e,t,i,Math.pow(2,8*i)-1,0);let r=1,s=0;for(this[t]=255&e;++s>>=0,i>>>=0,n||R(this,e,t,i,Math.pow(2,8*i)-1,0);let r=i-1,s=1;for(this[t+r]=255&e;--r>=0&&(s*=256);)this[t+r]=e/s&255;return t+i},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=X((function(e,t=0){return D(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),c.prototype.writeBigUInt64BE=X((function(e,t=0){return N(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),c.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*i-1);R(this,e,t,i,n-1,-n)}let r=0,s=1,o=0;for(this[t]=255&e;++r>0)-o&255;return t+i},c.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*i-1);R(this,e,t,i,n-1,-n)}let r=i-1,s=1,o=0;for(this[t+r]=255&e;--r>=0&&(s*=256);)e<0&&0===o&&0!==this[t+r+1]&&(o=1),this[t+r]=(e/s>>0)-o&255;return t+i},c.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=X((function(e,t=0){return D(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),c.prototype.writeBigInt64BE=X((function(e,t=0){return N(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),c.prototype.writeFloatLE=function(e,t,i){return B(this,e,t,!0,i)},c.prototype.writeFloatBE=function(e,t,i){return B(this,e,t,!1,i)},c.prototype.writeDoubleLE=function(e,t,i){return L(this,e,t,!0,i)},c.prototype.writeDoubleBE=function(e,t,i){return L(this,e,t,!1,i)},c.prototype.copy=function(e,t,i,n){if(!c.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError(\"Index out of range\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),e.length-t>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),\"number\"==typeof e)for(r=t;r=n+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}function z(e,t,i,n,r,s){if(e>i||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${t}${n} and <= ${i}${n}`,new U.ERR_OUT_OF_RANGE(\"value\",r,e)}!function(e,t,i){$(t,\"offset\"),void 0!==e[t]&&void 0!==e[t+i]||W(t,e.length-(i+1))}(n,r,s)}function $(e,t){if(\"number\"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,\"number\",e)}function W(e,t,i){if(Math.floor(e)!==e)throw $(e,i),new U.ERR_OUT_OF_RANGE(i||\"offset\",\"an integer\",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(i||\"offset\",`>= ${i?1:0} and <= ${t}`,e)}V(\"ERR_BUFFER_OUT_OF_BOUNDS\",(function(e){return e?`${e} is outside of buffer bounds`:\"Attempt to access memory outside buffer bounds\"}),RangeError),V(\"ERR_INVALID_ARG_TYPE\",(function(e,t){return`The \"${e}\" argument must be of type number. Received type ${typeof t}`}),TypeError),V(\"ERR_OUT_OF_RANGE\",(function(e,t,i){let n=`The value of \"${e}\" is out of range.`,r=i;return Number.isInteger(i)&&Math.abs(i)>2**32?r=j(String(i)):\"bigint\"==typeof i&&(r=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(r=j(r)),r+=\"n\"),n+=` It must be ${t}. Received ${r}`,n}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function q(e,t){let i;t=t||1/0;const n=e.length;let r=null;const s=[];for(let o=0;o55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&s.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&s.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;s.push(i)}else if(i<2048){if((t-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function K(e){return n.toByteArray(function(e){if((e=(e=e.split(\"=\")[0]).trim().replace(H,\"\")).length<2)return\"\";for(;e.length%4!=0;)e+=\"=\";return e}(e))}function G(e,t,i,n){let r;for(r=0;r=t.length||r>=e.length);++r)t[r+i]=e[r];return r}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const Z=function(){const e=\"0123456789abcdef\",t=new Array(256);for(let i=0;i<16;++i){const n=16*i;for(let r=0;r<16;++r)t[n+r]=e[i]+e[r]}return t}();function X(e){return\"undefined\"==typeof BigInt?Y:e}function Y(){throw new Error(\"BigInt not supported\")}},3631:(e,t,i)=>{\"use strict\";i.r(t),i.d(t,{BotInfo:()=>a,BrowserInfo:()=>r,NodeInfo:()=>s,ReactNativeInfo:()=>c,SearchBotDeviceInfo:()=>o,browserName:()=>f,detect:()=>p,detectOS:()=>v,getNodeVersion:()=>S,parseUserAgent:()=>g});var n=function(e,t,i){if(i||2===arguments.length)for(var n,r=0,s=t.length;r{t.read=function(e,t,i,n,r){var s,o,a=8*r-n-1,c=(1<>1,l=-7,u=i?r-1:0,h=i?-1:1,p=e[t+u];for(u+=h,s=p&(1<<-l)-1,p>>=-l,l+=a;l>0;s=256*s+e[t+u],u+=h,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+e[t+u],u+=h,l-=8);if(0===s)s=1-d;else{if(s===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),s-=d}return(p?-1:1)*o*Math.pow(2,s-n)},t.write=function(e,t,i,n,r,s){var o,a,c,d=8*s-r-1,l=(1<>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:s-1,m=n?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+u>=1?h/c:h*Math.pow(2,1-u))*c>=2&&(o++,c/=2),o+u>=l?(a=0,o=l):o+u>=1?(a=(t*c-1)*Math.pow(2,r),o+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,r),o=0));r>=8;e[i+p]=255&a,p+=m,a/=256,r-=8);for(o=o<0;e[i+p]=255&o,p+=m,o/=256,d-=8);e[i+p-m]|=128*f}},9483:(e,t,i)=>{e.exports=function e(t,i,n){function r(o,a){if(!i[o]){if(!t[o]){if(s)return s(o,!0);var c=new Error(\"Cannot find module '\"+o+\"'\");throw c.code=\"MODULE_NOT_FOUND\",c}var d=i[o]={exports:{}};t[o][0].call(d.exports,(function(e){return r(t[o][1][e]||e)}),d,d.exports,e,t,i,n)}return i[o].exports}for(var s=void 0,o=0;o=43)}})).catch((function(){return!1}))}(e).then((function(e){return h=e}))}function b(e){var t=p[e.name],i={};i.promise=new o((function(e,t){i.resolve=e,i.reject=t})),t.deferredOperations.push(i),t.dbReady?t.dbReady=t.dbReady.then((function(){return i.promise})):t.dbReady=i.promise}function y(e){var t=p[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function w(e,t){var i=p[e.name].deferredOperations.pop();if(i)return i.reject(t),i.promise}function C(e,t){return new o((function(i,n){if(p[e.name]=p[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return i(e.db);b(e),e.db.close()}var s=[e.name];t&&s.push(e.version);var o=r.open.apply(r,s);t&&(o.onupgradeneeded=function(t){var i=o.result;try{i.createObjectStore(e.storeName),t.oldVersion<=1&&i.createObjectStore(u)}catch(i){if(\"ConstraintError\"!==i.name)throw i;console.warn('The database \"'+e.name+'\" has been upgraded from version '+t.oldVersion+\" to version \"+t.newVersion+', but the storage \"'+e.storeName+'\" already exists.')}}),o.onerror=function(e){e.preventDefault(),n(o.error)},o.onsuccess=function(){var t=o.result;t.onversionchange=function(e){e.target.close()},i(t),y(e)}}))}function k(e){return C(e,!1)}function E(e){return C(e,!0)}function I(e,t){if(!e.db)return!0;var i=!e.db.objectStoreNames.contains(e.storeName),n=e.versione.db.version;if(n&&(e.version!==t&&console.warn('The database \"'+e.name+\"\\\" can't be downgraded from version \"+e.db.version+\" to version \"+e.version+\".\"),e.version=e.db.version),r||i){if(i){var s=e.db.version+1;s>e.version&&(e.version=s)}return!0}return!1}function T(e){return s([v(atob(e.data))],{type:e.type})}function A(e){return e&&e.__local_forage_encoded_blob}function M(e){var t=this,i=t._initReady().then((function(){var e=p[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return c(i,e,e),i}function x(e,t,i,n){void 0===n&&(n=1);try{var r=e.db.transaction(e.storeName,t);i(null,r)}catch(r){if(n>0&&(!e.db||\"InvalidStateError\"===r.name||\"NotFoundError\"===r.name))return o.resolve().then((function(){if(!e.db||\"NotFoundError\"===r.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),E(e)})).then((function(){return function(e){b(e);for(var t=p[e.name],i=t.forages,n=0;n>4,l[c++]=(15&n)<<4|r>>2,l[c++]=(3&r)<<6|63&s;return d}function K(e){var t,i=new Uint8Array(e),n=\"\";for(t=0;t>2],n+=P[(3&i[t])<<4|i[t+1]>>4],n+=P[(15&i[t+1])<<2|i[t+2]>>6],n+=P[63&i[t+2]];return i.length%3==2?n=n.substring(0,n.length-1)+\"=\":i.length%3==1&&(n=n.substring(0,n.length-2)+\"==\"),n}var G={serialize:function(e,t){var i=\"\";if(e&&(i=H.call(e)),e&&(\"[object ArrayBuffer]\"===i||e.buffer&&\"[object ArrayBuffer]\"===H.call(e.buffer))){var n,r=R;e instanceof ArrayBuffer?(n=e,r+=D):(n=e.buffer,\"[object Int8Array]\"===i?r+=F:\"[object Uint8Array]\"===i?r+=B:\"[object Uint8ClampedArray]\"===i?r+=L:\"[object Int16Array]\"===i?r+=U:\"[object Uint16Array]\"===i?r+=j:\"[object Int32Array]\"===i?r+=V:\"[object Uint32Array]\"===i?r+=z:\"[object Float32Array]\"===i?r+=$:\"[object Float64Array]\"===i?r+=W:t(new Error(\"Failed to get type for BinaryArray\"))),t(r+K(n))}else if(\"[object Blob]\"===i){var s=new FileReader;s.onload=function(){var i=\"~~local_forage_type~\"+e.type+\"~\"+K(this.result);t(R+N+i)},s.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(i){console.error(\"Couldn't convert value into a JSON string: \",e),t(null,i)}},deserialize:function(e){if(e.substring(0,9)!==R)return JSON.parse(e);var t,i=e.substring(13),n=e.substring(9,13);if(n===N&&O.test(i)){var r=i.match(O);t=r[1],i=i.substring(r[0].length)}var o=q(i);switch(n){case D:return o;case N:return s([o],{type:t});case F:return new Int8Array(o);case B:return new Uint8Array(o);case L:return new Uint8ClampedArray(o);case U:return new Int16Array(o);case j:return new Uint16Array(o);case V:return new Int32Array(o);case z:return new Uint32Array(o);case $:return new Float32Array(o);case W:return new Float64Array(o);default:throw new Error(\"Unkown type: \"+n)}},stringToBuffer:q,bufferToString:K};function J(e,t,i,n){e.executeSql(\"CREATE TABLE IF NOT EXISTS \"+t.storeName+\" (id INTEGER PRIMARY KEY, key unique, value)\",[],i,n)}function Q(e,t,i,n,r,s){e.executeSql(i,n,r,(function(e,o){o.code===o.SYNTAX_ERR?e.executeSql(\"SELECT name FROM sqlite_master WHERE type='table' AND name = ?\",[t.storeName],(function(e,a){a.rows.length?s(e,o):J(e,t,(function(){e.executeSql(i,n,r,s)}),s)}),s):s(e,o)}),s)}function Z(e,t,i,n){var r=this;e=d(e);var s=new o((function(s,o){r.ready().then((function(){void 0===t&&(t=null);var a=t,c=r._dbInfo;c.serializer.serialize(t,(function(t,d){d?o(d):c.db.transaction((function(i){Q(i,c,\"INSERT OR REPLACE INTO \"+c.storeName+\" (key, value) VALUES (?, ?)\",[e,t],(function(){s(a)}),(function(e,t){o(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(n>0)return void s(Z.apply(r,[e,a,i,n-1]));o(t)}}))}))})).catch(o)}));return a(s,i),s}var X={_driver:\"webSQLStorage\",_initStorage:function(e){var t=this,i={db:null};if(e)for(var n in e)i[n]=\"string\"!=typeof e[n]?e[n].toString():e[n];var r=new o((function(e,n){try{i.db=openDatabase(i.name,String(i.version),i.description,i.size)}catch(e){return n(e)}i.db.transaction((function(r){J(r,i,(function(){t._dbInfo=i,e()}),(function(e,t){n(t)}))}),n)}));return i.serializer=G,r},_support:\"function\"==typeof openDatabase,iterate:function(e,t){var i=this,n=new o((function(t,n){i.ready().then((function(){var r=i._dbInfo;r.db.transaction((function(i){Q(i,r,\"SELECT * FROM \"+r.storeName,[],(function(i,n){for(var s=n.rows,o=s.length,a=0;a '__WebKitDatabaseInfoTable__'\",[],(function(i,n){for(var r=[],s=0;s0}var te={_driver:\"localStorageWrapper\",_initStorage:function(e){var t={};if(e)for(var i in e)t[i]=e[i];return t.keyPrefix=Y(e,this._defaultConfig),ee()?(this._dbInfo=t,t.serializer=G,o.resolve()):o.reject()},_support:function(){try{return\"undefined\"!=typeof localStorage&&\"setItem\"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var i=this,n=i.ready().then((function(){for(var t=i._dbInfo,n=t.keyPrefix,r=n.length,s=localStorage.length,o=1,a=0;a=0;i--){var n=localStorage.key(i);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return a(i,e),i},length:function(e){var t=this.keys().then((function(e){return e.length}));return a(t,e),t},key:function(e,t){var i=this,n=i.ready().then((function(){var t,n=i._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t}));return a(n,t),n},keys:function(e){var t=this,i=t.ready().then((function(){for(var e=t._dbInfo,i=localStorage.length,n=[],r=0;r=0;t--){var i=localStorage.key(t);0===i.indexOf(e)&&localStorage.removeItem(i)}})):o.reject(\"Invalid arguments\"),a(n,t),n}},ie=function(e,t){for(var i=e.length,n=0;n{\"use strict\";const{Deflate:n,deflate:r,deflateRaw:s,gzip:o}=i(4555),{Inflate:a,inflate:c,inflateRaw:d,ungzip:l}=i(8843),u=i(1619);e.exports.Deflate=n,e.exports.deflate=r,e.exports.deflateRaw=s,e.exports.gzip=o,e.exports.Inflate=a,e.exports.inflate=c,e.exports.inflateRaw=d,e.exports.ungzip=l,e.exports.constants=u},4555:(e,t,i)=>{\"use strict\";const n=i(405),r=i(6247),s=i(9373),o=i(8898),a=i(2292),c=Object.prototype.toString,{Z_NO_FLUSH:d,Z_SYNC_FLUSH:l,Z_FULL_FLUSH:u,Z_FINISH:h,Z_OK:p,Z_STREAM_END:m,Z_DEFAULT_COMPRESSION:f,Z_DEFAULT_STRATEGY:g,Z_DEFLATED:v}=i(1619);function S(e){this.options=r.assign({level:f,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:g},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;let i=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==p)throw new Error(o[i]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e=\"string\"==typeof t.dictionary?s.string2buf(t.dictionary):\"[object ArrayBuffer]\"===c.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,i=n.deflateSetDictionary(this.strm,e),i!==p)throw new Error(o[i]);this._dict_set=!0}}function b(e,t){const i=new S(t);if(i.push(e,!0),i.err)throw i.msg||o[i.err];return i.result}S.prototype.push=function(e,t){const i=this.strm,r=this.options.chunkSize;let o,a;if(this.ended)return!1;for(a=t===~~t?t:!0===t?h:d,\"string\"==typeof e?i.input=s.string2buf(e):\"[object ArrayBuffer]\"===c.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),(a===l||a===u)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(o=n.deflate(i,a),o===m)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),o=n.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===p;if(0!==i.avail_out){if(a>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},S.prototype.onData=function(e){this.chunks.push(e)},S.prototype.onEnd=function(e){e===p&&(this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Deflate=S,e.exports.deflate=b,e.exports.deflateRaw=function(e,t){return(t=t||{}).raw=!0,b(e,t)},e.exports.gzip=function(e,t){return(t=t||{}).gzip=!0,b(e,t)},e.exports.constants=i(1619)},8843:(e,t,i)=>{\"use strict\";const n=i(7948),r=i(6247),s=i(9373),o=i(8898),a=i(2292),c=i(2401),d=Object.prototype.toString,{Z_NO_FLUSH:l,Z_FINISH:u,Z_OK:h,Z_STREAM_END:p,Z_NEED_DICT:m,Z_STREAM_ERROR:f,Z_DATA_ERROR:g,Z_MEM_ERROR:v}=i(1619);function S(e){this.options=r.assign({chunkSize:65536,windowBits:15,to:\"\"},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;let i=n.inflateInit2(this.strm,t.windowBits);if(i!==h)throw new Error(o[i]);if(this.header=new c,n.inflateGetHeader(this.strm,this.header),t.dictionary&&(\"string\"==typeof t.dictionary?t.dictionary=s.string2buf(t.dictionary):\"[object ArrayBuffer]\"===d.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=n.inflateSetDictionary(this.strm,t.dictionary),i!==h)))throw new Error(o[i])}function b(e,t){const i=new S(t);if(i.push(e),i.err)throw i.msg||o[i.err];return i.result}S.prototype.push=function(e,t){const i=this.strm,r=this.options.chunkSize,o=this.options.dictionary;let a,c,S;if(this.ended)return!1;for(c=t===~~t?t:!0===t?u:l,\"[object ArrayBuffer]\"===d.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),a=n.inflate(i,c),a===m&&o&&(a=n.inflateSetDictionary(i,o),a===h?a=n.inflate(i,c):a===g&&(a=m));i.avail_in>0&&a===p&&i.state.wrap>0&&0!==e[i.next_in];)n.inflateReset(i),a=n.inflate(i,c);switch(a){case f:case g:case m:case v:return this.onEnd(a),this.ended=!0,!1}if(S=i.avail_out,i.next_out&&(0===i.avail_out||a===p))if(\"string\"===this.options.to){let e=s.utf8border(i.output,i.next_out),t=i.next_out-e,n=s.buf2string(i.output,e);i.next_out=t,i.avail_out=r-t,t&&i.output.set(i.output.subarray(e,e+t),0),this.onData(n)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(a!==h||0!==S){if(a===p)return a=n.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===i.avail_in)break}}return!0},S.prototype.onData=function(e){this.chunks.push(e)},S.prototype.onEnd=function(e){e===h&&(\"string\"===this.options.to?this.result=this.chunks.join(\"\"):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Inflate=S,e.exports.inflate=b,e.exports.inflateRaw=function(e,t){return(t=t||{}).raw=!0,b(e,t)},e.exports.ungzip=b,e.exports.constants=i(1619)},6247:e=>{\"use strict\";const t=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);e.exports.assign=function(e){const i=Array.prototype.slice.call(arguments,1);for(;i.length;){const n=i.shift();if(n){if(\"object\"!=typeof n)throw new TypeError(n+\"must be non-object\");for(const i in n)t(n,i)&&(e[i]=n[i])}}return e},e.exports.flattenChunks=e=>{let t=0;for(let i=0,n=e.length;i{\"use strict\";let t=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){t=!1}const i=new Uint8Array(256);for(let e=0;e<256;e++)i[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;i[254]=i[254]=1,e.exports.string2buf=e=>{if(\"function\"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,i,n,r,s,o=e.length,a=0;for(r=0;r>>6,t[s++]=128|63&i):i<65536?(t[s++]=224|i>>>12,t[s++]=128|i>>>6&63,t[s++]=128|63&i):(t[s++]=240|i>>>18,t[s++]=128|i>>>12&63,t[s++]=128|i>>>6&63,t[s++]=128|63&i);return t},e.exports.buf2string=(e,n)=>{const r=n||e.length;if(\"function\"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,n));let s,o;const a=new Array(2*r);for(o=0,s=0;s4)a[o++]=65533,s+=n-1;else{for(t&=2===n?31:3===n?15:7;n>1&&s1?a[o++]=65533:t<65536?a[o++]=t:(t-=65536,a[o++]=55296|t>>10&1023,a[o++]=56320|1023&t)}}return((e,i)=>{if(i<65534&&e.subarray&&t)return String.fromCharCode.apply(null,e.length===i?e:e.subarray(0,i));let n=\"\";for(let t=0;t{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+i[e[n]]>t?n:t}},6069:e=>{\"use strict\";e.exports=(e,t,i,n)=>{let r=65535&e|0,s=e>>>16&65535|0,o=0;for(;0!==i;){o=i>2e3?2e3:i,i-=o;do{r=r+t[n++]|0,s=s+r|0}while(--o);r%=65521,s%=65521}return r|s<<16|0}},1619:e=>{\"use strict\";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},2869:e=>{\"use strict\";const t=new Uint32Array((()=>{let e,t=[];for(var i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t})());e.exports=(e,i,n,r)=>{const s=t,o=r+n;e^=-1;for(let t=r;t>>8^s[255&(e^i[t])];return-1^e}},405:(e,t,i)=>{\"use strict\";const{_tr_init:n,_tr_stored_block:r,_tr_flush_block:s,_tr_tally:o,_tr_align:a}=i(342),c=i(6069),d=i(2869),l=i(8898),{Z_NO_FLUSH:u,Z_PARTIAL_FLUSH:h,Z_FULL_FLUSH:p,Z_FINISH:m,Z_BLOCK:f,Z_OK:g,Z_STREAM_END:v,Z_STREAM_ERROR:S,Z_DATA_ERROR:b,Z_BUF_ERROR:y,Z_DEFAULT_COMPRESSION:w,Z_FILTERED:C,Z_HUFFMAN_ONLY:k,Z_RLE:E,Z_FIXED:I,Z_DEFAULT_STRATEGY:T,Z_UNKNOWN:A,Z_DEFLATED:M}=i(1619),x=258,_=262,P=42,O=113,R=666,D=(e,t)=>(e.msg=l[t],t),N=e=>2*e-(e>4?9:0),F=e=>{let t=e.length;for(;--t>=0;)e[t]=0},B=e=>{let t,i,n,r=e.w_size;t=e.hash_size,n=t;do{i=e.head[--n],e.head[n]=i>=r?i-r:0}while(--t);t=r,n=t;do{i=e.prev[--n],e.prev[n]=i>=r?i-r:0}while(--t)};let L=(e,t,i)=>(t<{const t=e.state;let i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+i),e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))},V=(e,t)=>{s(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,U(e.strm)},j=(e,t)=>{e.pending_buf[e.pending++]=t},z=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},$=(e,t,i,n)=>{let r=e.avail_in;return r>n&&(r=n),0===r?0:(e.avail_in-=r,t.set(e.input.subarray(e.next_in,e.next_in+r),i),1===e.state.wrap?e.adler=c(e.adler,t,r,i):2===e.state.wrap&&(e.adler=d(e.adler,t,r,i)),e.next_in+=r,e.total_in+=r,r)},W=(e,t)=>{let i,n,r=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match;const c=e.strstart>e.w_size-_?e.strstart-(e.w_size-_):0,d=e.window,l=e.w_mask,u=e.prev,h=e.strstart+x;let p=d[s+o-1],m=d[s+o];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do{if(i=t,d[i+o]===m&&d[i+o-1]===p&&d[i]===d[s]&&d[++i]===d[s+1]){s+=2,i++;do{}while(d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&so){if(e.match_start=t,o=n,n>=a)break;p=d[s+o-1],m=d[s+o]}}}while((t=u[t&l])>c&&0!=--r);return o<=e.lookahead?o:e.lookahead},H=e=>{const t=e.w_size;let i,n,r;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-_)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),B(e),n+=t),0===e.strm.avail_in)break;if(i=$(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=i,e.lookahead+e.insert>=3)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=L(e,e.ins_h,e.window[r+1]);e.insert&&(e.ins_h=L(e,e.ins_h,e.window[r+3-1]),e.prev[r&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=r,r++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<_&&0!==e.strm.avail_in)},q=(e,t)=>{let i,n,s,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,c=e.strm.avail_in;do{if(i=65535,s=e.bi_valid+42>>3,e.strm.avail_outn+e.strm.avail_in&&(i=n+e.strm.avail_in),i>s&&(i=s),i>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,U(e.strm),n&&(n>i&&(n=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,i-=n),i&&($(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(0===a);return c-=e.strm.avail_in,c&&(c>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=c&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-c,e.strm.next_in),e.strstart),e.strstart+=c,e.insert+=c>e.w_size-e.insert?e.w_size-e.insert:c),e.block_start=e.strstart),e.high_waters&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,s+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),s>e.strm.avail_in&&(s=e.strm.avail_in),s&&($(e.strm,e.window,e.strstart,s),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.high_water>3,s=e.pending_buf_size-s>65535?65535:e.pending_buf_size-s,o=s>e.w_size?e.w_size:s,n=e.strstart-e.block_start,(n>=o||(n||t===m)&&t!==u&&0===e.strm.avail_in&&n<=s)&&(i=n>s?s:n,a=t===m&&0===e.strm.avail_in&&i===n?1:0,r(e,e.block_start,i,a),e.block_start+=i,U(e.strm)),a?3:1)},K=(e,t)=>{let i,n;for(;;){if(e.lookahead<_){if(H(e),e.lookahead<_&&t===u)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-_&&(e.match_length=W(e,i)),e.match_length>=3)if(n=o(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=L(e,e.ins_h,e.window[e.strstart+1]);else n=o(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(V(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===m?(V(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(V(e,!1),0===e.strm.avail_out)?1:2},G=(e,t)=>{let i,n,r;for(;;){if(e.lookahead<_){if(H(e),e.lookahead<_&&t===u)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-3,n=o(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=r&&(e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(V(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=o(e,0,e.window[e.strstart-1]),n&&V(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=o(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===m?(V(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(V(e,!1),0===e.strm.avail_out)?1:2};function J(e,t,i,n,r){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=n,this.func=r}const Q=[new J(0,0,0,0,q),new J(4,4,8,4,K),new J(4,5,16,8,K),new J(4,6,32,32,K),new J(4,4,16,16,G),new J(8,16,32,32,G),new J(8,16,128,128,G),new J(8,32,128,256,G),new J(32,128,258,1024,G),new J(32,258,258,4096,G)];function Z(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=M,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),F(this.dyn_ltree),F(this.dyn_dtree),F(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),F(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),F(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const X=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==P&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==O&&t.status!==R?1:0},Y=e=>{if(X(e))return D(e,S);e.total_in=e.total_out=0,e.data_type=A;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?P:O,e.adler=2===t.wrap?0:1,t.last_flush=-2,n(t),g},ee=e=>{const t=Y(e);var i;return t===g&&((i=e.state).window_size=2*i.w_size,F(i.head),i.max_lazy_match=Q[i.level].max_lazy,i.good_match=Q[i.level].good_length,i.nice_match=Q[i.level].nice_length,i.max_chain_length=Q[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=2,i.match_available=0,i.ins_h=0),t},te=(e,t,i,n,r,s)=>{if(!e)return S;let o=1;if(t===w&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),r<1||r>9||i!==M||n<8||n>15||t<0||t>9||s<0||s>I||8===n&&1!==o)return D(e,S);8===n&&(n=9);const a=new Z;return e.state=a,a.strm=e,a.status=P,a.wrap=o,a.gzhead=null,a.w_bits=n,a.w_size=1<te(e,t,M,15,8,T),e.exports.deflateInit2=te,e.exports.deflateReset=ee,e.exports.deflateResetKeep=Y,e.exports.deflateSetHeader=(e,t)=>X(e)||2!==e.state.wrap?S:(e.state.gzhead=t,g),e.exports.deflate=(e,t)=>{if(X(e)||t>f||t<0)return e?D(e,S):S;const i=e.state;if(!e.output||0!==e.avail_in&&!e.input||i.status===R&&t!==m)return D(e,0===e.avail_out?y:S);const n=i.last_flush;if(i.last_flush=t,0!==i.pending){if(U(e),0===e.avail_out)return i.last_flush=-1,g}else if(0===e.avail_in&&N(t)<=N(n)&&t!==m)return D(e,y);if(i.status===R&&0!==e.avail_in)return D(e,y);if(i.status===P&&0===i.wrap&&(i.status=O),i.status===P){let t=M+(i.w_bits-8<<4)<<8,n=-1;if(n=i.strategy>=k||i.level<2?0:i.level<6?1:6===i.level?2:3,t|=n<<6,0!==i.strstart&&(t|=32),t+=31-t%31,z(i,t),0!==i.strstart&&(z(i,e.adler>>>16),z(i,65535&e.adler)),e.adler=1,i.status=O,U(e),0!==i.pending)return i.last_flush=-1,g}if(57===i.status)if(e.adler=0,j(i,31),j(i,139),j(i,8),i.gzhead)j(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),j(i,255&i.gzhead.time),j(i,i.gzhead.time>>8&255),j(i,i.gzhead.time>>16&255),j(i,i.gzhead.time>>24&255),j(i,9===i.level?2:i.strategy>=k||i.level<2?4:0),j(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(j(i,255&i.gzhead.extra.length),j(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=d(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69;else if(j(i,0),j(i,0),j(i,0),j(i,0),j(i,0),j(i,9===i.level?2:i.strategy>=k||i.level<2?4:0),j(i,3),i.status=O,U(e),0!==i.pending)return i.last_flush=-1,g;if(69===i.status){if(i.gzhead.extra){let t=i.pending,n=(65535&i.gzhead.extra.length)-i.gzindex;for(;i.pending+n>i.pending_buf_size;){let r=i.pending_buf_size-i.pending;if(i.pending_buf.set(i.gzhead.extra.subarray(i.gzindex,i.gzindex+r),i.pending),i.pending=i.pending_buf_size,i.gzhead.hcrc&&i.pending>t&&(e.adler=d(e.adler,i.pending_buf,i.pending-t,t)),i.gzindex+=r,U(e),0!==i.pending)return i.last_flush=-1,g;t=0,n-=r}let r=new Uint8Array(i.gzhead.extra);i.pending_buf.set(r.subarray(i.gzindex,i.gzindex+n),i.pending),i.pending+=n,i.gzhead.hcrc&&i.pending>t&&(e.adler=d(e.adler,i.pending_buf,i.pending-t,t)),i.gzindex=0}i.status=73}if(73===i.status){if(i.gzhead.name){let t,n=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),U(e),0!==i.pending)return i.last_flush=-1,g;n=0}t=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex=0}i.status=91}if(91===i.status){if(i.gzhead.comment){let t,n=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),U(e),0!==i.pending)return i.last_flush=-1,g;n=0}t=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n))}i.status=103}if(103===i.status){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size&&(U(e),0!==i.pending))return i.last_flush=-1,g;j(i,255&e.adler),j(i,e.adler>>8&255),e.adler=0}if(i.status=O,U(e),0!==i.pending)return i.last_flush=-1,g}if(0!==e.avail_in||0!==i.lookahead||t!==u&&i.status!==R){let n=0===i.level?q(i,t):i.strategy===k?((e,t)=>{let i;for(;;){if(0===e.lookahead&&(H(e),0===e.lookahead)){if(t===u)return 1;break}if(e.match_length=0,i=o(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(V(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===m?(V(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(V(e,!1),0===e.strm.avail_out)?1:2})(i,t):i.strategy===E?((e,t)=>{let i,n,r,s;const a=e.window;for(;;){if(e.lookahead<=x){if(H(e),e.lookahead<=x&&t===u)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(r=e.strstart-1,n=a[r],n===a[++r]&&n===a[++r]&&n===a[++r])){s=e.strstart+x;do{}while(n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&re.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=o(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=o(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(V(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===m?(V(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(V(e,!1),0===e.strm.avail_out)?1:2})(i,t):Q[i.level].func(i,t);if(3!==n&&4!==n||(i.status=R),1===n||3===n)return 0===e.avail_out&&(i.last_flush=-1),g;if(2===n&&(t===h?a(i):t!==f&&(r(i,0,0,!1),t===p&&(F(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),U(e),0===e.avail_out))return i.last_flush=-1,g}return t!==m?g:i.wrap<=0?v:(2===i.wrap?(j(i,255&e.adler),j(i,e.adler>>8&255),j(i,e.adler>>16&255),j(i,e.adler>>24&255),j(i,255&e.total_in),j(i,e.total_in>>8&255),j(i,e.total_in>>16&255),j(i,e.total_in>>24&255)):(z(i,e.adler>>>16),z(i,65535&e.adler)),U(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?g:v)},e.exports.deflateEnd=e=>{if(X(e))return S;const t=e.state.status;return e.state=null,t===O?D(e,b):g},e.exports.deflateSetDictionary=(e,t)=>{let i=t.length;if(X(e))return S;const n=e.state,r=n.wrap;if(2===r||1===r&&n.status!==P||n.lookahead)return S;if(1===r&&(e.adler=c(e.adler,t,i,0)),n.wrap=0,i>=n.w_size){0===r&&(F(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(i-n.w_size,i),0),t=e,i=n.w_size}const s=e.avail_in,o=e.next_in,a=e.input;for(e.avail_in=i,e.next_in=0,e.input=t,H(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=L(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=2,H(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=o,e.input=a,e.avail_in=s,n.wrap=r,g},e.exports.deflateInfo=\"pako deflate (from Nodeca project)\"},2401:e=>{\"use strict\";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=\"\",this.comment=\"\",this.hcrc=0,this.done=!1}},4264:e=>{\"use strict\";const t=16209;e.exports=function(e,i){let n,r,s,o,a,c,d,l,u,h,p,m,f,g,v,S,b,y,w,C,k,E,I,T;const A=e.state;n=e.next_in,I=e.input,r=n+(e.avail_in-5),s=e.next_out,T=e.output,o=s-(i-e.avail_out),a=s+(e.avail_out-257),c=A.dmax,d=A.wsize,l=A.whave,u=A.wnext,h=A.window,p=A.hold,m=A.bits,f=A.lencode,g=A.distcode,v=(1<>>24,p>>>=y,m-=y,y=b>>>16&255,0===y)T[s++]=65535&b;else{if(!(16&y)){if(0==(64&y)){b=f[(65535&b)+(p&(1<>>=y,m-=y),m<15&&(p+=I[n++]<>>24,p>>>=y,m-=y,y=b>>>16&255,!(16&y)){if(0==(64&y)){b=g[(65535&b)+(p&(1<c){e.msg=\"invalid distance too far back\",A.mode=t;break e}if(p>>>=y,m-=y,y=s-o,C>y){if(y=C-y,y>l&&A.sane){e.msg=\"invalid distance too far back\",A.mode=t;break e}if(k=0,E=h,0===u){if(k+=d-y,y2;)T[s++]=E[k++],T[s++]=E[k++],T[s++]=E[k++],w-=3;w&&(T[s++]=E[k++],w>1&&(T[s++]=E[k++]))}else{k=s-C;do{T[s++]=T[k++],T[s++]=T[k++],T[s++]=T[k++],w-=3}while(w>2);w&&(T[s++]=T[k++],w>1&&(T[s++]=T[k++]))}break}}break}}while(n>3,n-=w,m-=w<<3,p&=(1<{\"use strict\";const n=i(6069),r=i(2869),s=i(4264),o=i(9241),{Z_FINISH:a,Z_BLOCK:c,Z_TREES:d,Z_OK:l,Z_STREAM_END:u,Z_NEED_DICT:h,Z_STREAM_ERROR:p,Z_DATA_ERROR:m,Z_MEM_ERROR:f,Z_BUF_ERROR:g,Z_DEFLATED:v}=i(1619),S=16180,b=16190,y=16191,w=16192,C=16194,k=16199,E=16200,I=16206,T=16209,A=16210,M=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function x(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const _=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode16211?1:0},P=e=>{if(_(e))return p;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg=\"\",t.wrap&&(e.adler=1&t.wrap),t.mode=S,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,l},O=e=>{if(_(e))return p;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,P(e)},R=(e,t)=>{let i;if(_(e))return p;const n=e.state;return t<0?(i=0,t=-t):(i=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?p:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,O(e))},D=(e,t)=>{if(!e)return p;const i=new x;e.state=i,i.strm=e,i.window=null,i.mode=S;const n=R(e,t);return n!==l&&(e.state=null),n};let N,F,B=!0;const L=e=>{if(B){N=new Int32Array(512),F=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(o(1,e.lens,0,288,N,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;o(2,e.lens,0,32,F,0,e.work,{bits:5}),B=!1}e.lencode=N,e.lenbits=9,e.distcode=F,e.distbits=5},U=(e,t,i,n)=>{let r;const s=e.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(t.subarray(i-s.wsize,i),0),s.wnext=0,s.whave=s.wsize):(r=s.wsize-s.wnext,r>n&&(r=n),s.window.set(t.subarray(i-n,i-n+r),s.wnext),(n-=r)?(s.window.set(t.subarray(i-n,i),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whaveD(e,15),e.exports.inflateInit2=D,e.exports.inflate=(e,t)=>{let i,x,P,O,R,D,N,F,B,V,j,z,$,W,H,q,K,G,J,Q,Z,X,Y=0;const ee=new Uint8Array(4);let te,ie;const ne=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(_(e)||!e.output||!e.input&&0!==e.avail_in)return p;i=e.state,i.mode===y&&(i.mode=w),R=e.next_out,P=e.output,N=e.avail_out,O=e.next_in,x=e.input,D=e.avail_in,F=i.hold,B=i.bits,V=D,j=N,X=l;e:for(;;)switch(i.mode){case S:if(0===i.wrap){i.mode=w;break}for(;B<16;){if(0===D)break e;D--,F+=x[O++]<>>8&255,i.check=r(i.check,ee,2,0),F=0,B=0,i.mode=16181;break}if(i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&F)<<8)+(F>>8))%31){e.msg=\"incorrect header check\",i.mode=T;break}if((15&F)!==v){e.msg=\"unknown compression method\",i.mode=T;break}if(F>>>=4,B-=4,Z=8+(15&F),0===i.wbits&&(i.wbits=Z),Z>15||Z>i.wbits){e.msg=\"invalid window size\",i.mode=T;break}i.dmax=1<>8&1),512&i.flags&&4&i.wrap&&(ee[0]=255&F,ee[1]=F>>>8&255,i.check=r(i.check,ee,2,0)),F=0,B=0,i.mode=16182;case 16182:for(;B<32;){if(0===D)break e;D--,F+=x[O++]<>>8&255,ee[2]=F>>>16&255,ee[3]=F>>>24&255,i.check=r(i.check,ee,4,0)),F=0,B=0,i.mode=16183;case 16183:for(;B<16;){if(0===D)break e;D--,F+=x[O++]<>8),512&i.flags&&4&i.wrap&&(ee[0]=255&F,ee[1]=F>>>8&255,i.check=r(i.check,ee,2,0)),F=0,B=0,i.mode=16184;case 16184:if(1024&i.flags){for(;B<16;){if(0===D)break e;D--,F+=x[O++]<>>8&255,i.check=r(i.check,ee,2,0)),F=0,B=0}else i.head&&(i.head.extra=null);i.mode=16185;case 16185:if(1024&i.flags&&(z=i.length,z>D&&(z=D),z&&(i.head&&(Z=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(x.subarray(O,O+z),Z)),512&i.flags&&4&i.wrap&&(i.check=r(i.check,x,z,O)),D-=z,O+=z,i.length-=z),i.length))break e;i.length=0,i.mode=16186;case 16186:if(2048&i.flags){if(0===D)break e;z=0;do{Z=x[O+z++],i.head&&Z&&i.length<65536&&(i.head.name+=String.fromCharCode(Z))}while(Z&&z>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=y;break;case 16189:for(;B<32;){if(0===D)break e;D--,F+=x[O++]<>>=7&B,B-=7&B,i.mode=I;break}for(;B<3;){if(0===D)break e;D--,F+=x[O++]<>>=1,B-=1,3&F){case 0:i.mode=16193;break;case 1:if(L(i),i.mode=k,t===d){F>>>=2,B-=2;break e}break;case 2:i.mode=16196;break;case 3:e.msg=\"invalid block type\",i.mode=T}F>>>=2,B-=2;break;case 16193:for(F>>>=7&B,B-=7&B;B<32;){if(0===D)break e;D--,F+=x[O++]<>>16^65535)){e.msg=\"invalid stored block lengths\",i.mode=T;break}if(i.length=65535&F,F=0,B=0,i.mode=C,t===d)break e;case C:i.mode=16195;case 16195:if(z=i.length,z){if(z>D&&(z=D),z>N&&(z=N),0===z)break e;P.set(x.subarray(O,O+z),R),D-=z,O+=z,N-=z,R+=z,i.length-=z;break}i.mode=y;break;case 16196:for(;B<14;){if(0===D)break e;D--,F+=x[O++]<>>=5,B-=5,i.ndist=1+(31&F),F>>>=5,B-=5,i.ncode=4+(15&F),F>>>=4,B-=4,i.nlen>286||i.ndist>30){e.msg=\"too many length or distance symbols\",i.mode=T;break}i.have=0,i.mode=16197;case 16197:for(;i.have>>=3,B-=3}for(;i.have<19;)i.lens[ne[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,te={bits:i.lenbits},X=o(0,i.lens,0,19,i.lencode,0,i.work,te),i.lenbits=te.bits,X){e.msg=\"invalid code lengths set\",i.mode=T;break}i.have=0,i.mode=16198;case 16198:for(;i.have>>24,q=Y>>>16&255,K=65535&Y,!(H<=B);){if(0===D)break e;D--,F+=x[O++]<>>=H,B-=H,i.lens[i.have++]=K;else{if(16===K){for(ie=H+2;B>>=H,B-=H,0===i.have){e.msg=\"invalid bit length repeat\",i.mode=T;break}Z=i.lens[i.have-1],z=3+(3&F),F>>>=2,B-=2}else if(17===K){for(ie=H+3;B>>=H,B-=H,Z=0,z=3+(7&F),F>>>=3,B-=3}else{for(ie=H+7;B>>=H,B-=H,Z=0,z=11+(127&F),F>>>=7,B-=7}if(i.have+z>i.nlen+i.ndist){e.msg=\"invalid bit length repeat\",i.mode=T;break}for(;z--;)i.lens[i.have++]=Z}}if(i.mode===T)break;if(0===i.lens[256]){e.msg=\"invalid code -- missing end-of-block\",i.mode=T;break}if(i.lenbits=9,te={bits:i.lenbits},X=o(1,i.lens,0,i.nlen,i.lencode,0,i.work,te),i.lenbits=te.bits,X){e.msg=\"invalid literal/lengths set\",i.mode=T;break}if(i.distbits=6,i.distcode=i.distdyn,te={bits:i.distbits},X=o(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,te),i.distbits=te.bits,X){e.msg=\"invalid distances set\",i.mode=T;break}if(i.mode=k,t===d)break e;case k:i.mode=E;case E:if(D>=6&&N>=258){e.next_out=R,e.avail_out=N,e.next_in=O,e.avail_in=D,i.hold=F,i.bits=B,s(e,j),R=e.next_out,P=e.output,N=e.avail_out,O=e.next_in,x=e.input,D=e.avail_in,F=i.hold,B=i.bits,i.mode===y&&(i.back=-1);break}for(i.back=0;Y=i.lencode[F&(1<>>24,q=Y>>>16&255,K=65535&Y,!(H<=B);){if(0===D)break e;D--,F+=x[O++]<>G)],H=Y>>>24,q=Y>>>16&255,K=65535&Y,!(G+H<=B);){if(0===D)break e;D--,F+=x[O++]<>>=G,B-=G,i.back+=G}if(F>>>=H,B-=H,i.back+=H,i.length=K,0===q){i.mode=16205;break}if(32&q){i.back=-1,i.mode=y;break}if(64&q){e.msg=\"invalid literal/length code\",i.mode=T;break}i.extra=15&q,i.mode=16201;case 16201:if(i.extra){for(ie=i.extra;B>>=i.extra,B-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=16202;case 16202:for(;Y=i.distcode[F&(1<>>24,q=Y>>>16&255,K=65535&Y,!(H<=B);){if(0===D)break e;D--,F+=x[O++]<>G)],H=Y>>>24,q=Y>>>16&255,K=65535&Y,!(G+H<=B);){if(0===D)break e;D--,F+=x[O++]<>>=G,B-=G,i.back+=G}if(F>>>=H,B-=H,i.back+=H,64&q){e.msg=\"invalid distance code\",i.mode=T;break}i.offset=K,i.extra=15&q,i.mode=16203;case 16203:if(i.extra){for(ie=i.extra;B>>=i.extra,B-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg=\"invalid distance too far back\",i.mode=T;break}i.mode=16204;case 16204:if(0===N)break e;if(z=j-N,i.offset>z){if(z=i.offset-z,z>i.whave&&i.sane){e.msg=\"invalid distance too far back\",i.mode=T;break}z>i.wnext?(z-=i.wnext,$=i.wsize-z):$=i.wnext-z,z>i.length&&(z=i.length),W=i.window}else W=P,$=R-i.offset,z=i.length;z>N&&(z=N),N-=z,i.length-=z;do{P[R++]=W[$++]}while(--z);0===i.length&&(i.mode=E);break;case 16205:if(0===N)break e;P[R++]=i.length,N--,i.mode=E;break;case I:if(i.wrap){for(;B<32;){if(0===D)break e;D--,F|=x[O++]<{if(_(e))return p;let t=e.state;return t.window&&(t.window=null),e.state=null,l},e.exports.inflateGetHeader=(e,t)=>{if(_(e))return p;const i=e.state;return 0==(2&i.wrap)?p:(i.head=t,t.done=!1,l)},e.exports.inflateSetDictionary=(e,t)=>{const i=t.length;let r,s,o;return _(e)?p:(r=e.state,0!==r.wrap&&r.mode!==b?p:r.mode===b&&(s=1,s=n(s,t,i,0),s!==r.check)?m:(o=U(e,t,i,i),o?(r.mode=A,f):(r.havedict=1,l)))},e.exports.inflateInfo=\"pako inflate (from Nodeca project)\"},9241:e=>{\"use strict\";const t=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),i=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),n=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),r=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);e.exports=(e,s,o,a,c,d,l,u)=>{const h=u.bits;let p,m,f,g,v,S,b=0,y=0,w=0,C=0,k=0,E=0,I=0,T=0,A=0,M=0,x=null;const _=new Uint16Array(16),P=new Uint16Array(16);let O,R,D,N=null;for(b=0;b<=15;b++)_[b]=0;for(y=0;y=1&&0===_[C];C--);if(k>C&&(k=C),0===C)return c[d++]=20971520,c[d++]=20971520,u.bits=1,0;for(w=1;w0&&(0===e||1!==C))return-1;for(P[1]=0,b=1;b<15;b++)P[b+1]=P[b]+_[b];for(y=0;y852||2===e&&A>592)return 1;for(;;){O=b-I,l[y]+1=S?(R=N[l[y]-S],D=x[l[y]-S]):(R=96,D=0),p=1<>I)+m]=O<<24|R<<16|D|0}while(0!==m);for(p=1<>=1;if(0!==p?(M&=p-1,M+=p):M=0,y++,0==--_[b]){if(b===C)break;b=s[o+l[y]]}if(b>k&&(M&g)!==f){for(0===I&&(I=k),v+=w,E=b-I,T=1<852||2===e&&A>592)return 1;f=M&g,c[f]=k<<24|E<<16|v-d|0}}return 0!==M&&(c[v+M]=b-I<<24|64<<16|0),u.bits=k,0}},8898:e=>{\"use strict\";e.exports={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"}},342:e=>{\"use strict\";function t(e){let t=e.length;for(;--t>=0;)e[t]=0}const i=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),s=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);t(o);const a=new Array(60);t(a);const c=new Array(512);t(c);const d=new Array(256);t(d);const l=new Array(29);t(l);const u=new Array(30);function h(e,t,i,n,r){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=n,this.max_length=r,this.has_stree=e&&e.length}let p,m,f;function g(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}t(u);const v=e=>e<256?c[e]:c[256+(e>>>7)],S=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},b=(e,t,i)=>{e.bi_valid>16-i?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<{b(e,i[2*t],i[2*t+1])},w=(e,t)=>{let i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1},C=(e,t,i)=>{const n=new Array(16);let r,s,o=0;for(r=1;r<=15;r++)o=o+i[r-1]<<1,n[r]=o;for(s=0;s<=t;s++){let t=e[2*s+1];0!==t&&(e[2*s]=w(n[t]++,t))}},k=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},E=e=>{e.bi_valid>8?S(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},I=(e,t,i,n)=>{const r=2*t,s=2*i;return e[r]{const n=e.heap[i];let r=i<<1;for(;r<=e.heap_len&&(r{let s,o,a,c,h=0;if(0!==e.sym_next)do{s=255&e.pending_buf[e.sym_buf+h++],s+=(255&e.pending_buf[e.sym_buf+h++])<<8,o=e.pending_buf[e.sym_buf+h++],0===s?y(e,o,t):(a=d[o],y(e,a+256+1,t),c=i[a],0!==c&&(o-=l[a],b(e,o,c)),s--,a=v(s),y(e,a,r),c=n[a],0!==c&&(s-=u[a],b(e,s,c)))}while(h{const i=t.dyn_tree,n=t.stat_desc.static_tree,r=t.stat_desc.has_stree,s=t.stat_desc.elems;let o,a,c,d=-1;for(e.heap_len=0,e.heap_max=573,o=0;o>1;o>=1;o--)T(e,i,o);c=s;do{o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],T(e,i,1),a=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=a,i[2*c]=i[2*o]+i[2*a],e.depth[c]=(e.depth[o]>=e.depth[a]?e.depth[o]:e.depth[a])+1,i[2*o+1]=i[2*a+1]=c,e.heap[1]=c++,T(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const i=t.dyn_tree,n=t.max_code,r=t.stat_desc.static_tree,s=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,c=t.stat_desc.max_length;let d,l,u,h,p,m,f=0;for(h=0;h<=15;h++)e.bl_count[h]=0;for(i[2*e.heap[e.heap_max]+1]=0,d=e.heap_max+1;d<573;d++)l=e.heap[d],h=i[2*i[2*l+1]+1]+1,h>c&&(h=c,f++),i[2*l+1]=h,l>n||(e.bl_count[h]++,p=0,l>=a&&(p=o[l-a]),m=i[2*l],e.opt_len+=m*(h+p),s&&(e.static_len+=m*(r[2*l+1]+p)));if(0!==f){do{for(h=c-1;0===e.bl_count[h];)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[c]--,f-=2}while(f>0);for(h=c;0!==h;h--)for(l=e.bl_count[h];0!==l;)u=e.heap[--d],u>n||(i[2*u+1]!==h&&(e.opt_len+=(h-i[2*u+1])*i[2*u],i[2*u+1]=h),l--)}})(e,t),C(i,d,e.bl_count)},x=(e,t,i)=>{let n,r,s=-1,o=t[1],a=0,c=7,d=4;for(0===o&&(c=138,d=3),t[2*(i+1)+1]=65535,n=0;n<=i;n++)r=o,o=t[2*(n+1)+1],++a{let n,r,s=-1,o=t[1],a=0,c=7,d=4;for(0===o&&(c=138,d=3),n=0;n<=i;n++)if(r=o,o=t[2*(n+1)+1],!(++a{b(e,0+(n?1:0),3),E(e),S(e,i),S(e,~i),i&&e.pending_buf.set(e.window.subarray(t,t+i),e.pending),e.pending+=i};e.exports._tr_init=e=>{P||((()=>{let e,t,s,g,v;const S=new Array(16);for(s=0,g=0;g<28;g++)for(l[g]=s,e=0;e<1<>=7;g<30;g++)for(u[g]=v<<7,e=0;e<1<{let r,c,d=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),M(e,e.l_desc),M(e,e.d_desc),d=(e=>{let t;for(x(e,e.dyn_ltree,e.l_desc.max_code),x(e,e.dyn_dtree,e.d_desc.max_code),M(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*s[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),r=e.opt_len+3+7>>>3,c=e.static_len+3+7>>>3,c<=r&&(r=c)):r=c=i+5,i+4<=r&&-1!==t?O(e,t,i,n):4===e.strategy||c===r?(b(e,2+(n?1:0),3),A(e,o,a)):(b(e,4+(n?1:0),3),((e,t,i,n)=>{let r;for(b(e,t-257,5),b(e,i-1,5),b(e,n-4,4),r=0;r(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=i,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(d[i]+256+1)]++,e.dyn_dtree[2*v(t)]++),e.sym_next===e.sym_end),e.exports._tr_align=e=>{b(e,2,3),y(e,256,o),(e=>{16===e.bi_valid?(S(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}},2292:e=>{\"use strict\";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0}},655:(e,t,i)=>{\"use strict\";i.r(t),i.d(t,{__assign:()=>s,__asyncDelegator:()=>y,__asyncGenerator:()=>b,__asyncValues:()=>w,__await:()=>S,__awaiter:()=>l,__classPrivateFieldGet:()=>I,__classPrivateFieldSet:()=>T,__createBinding:()=>h,__decorate:()=>a,__exportStar:()=>p,__extends:()=>r,__generator:()=>u,__importDefault:()=>E,__importStar:()=>k,__makeTemplateObject:()=>C,__metadata:()=>d,__param:()=>c,__read:()=>f,__rest:()=>o,__spread:()=>g,__spreadArrays:()=>v,__values:()=>m});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},n(e,t)};function r(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var s=function(){return s=Object.assign||function(e){for(var t,i=1,n=arguments.length;i=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o}function c(e,t){return function(i,n){t(i,n,e)}}function d(e,t){if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))}function u(e,t){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},\"function\"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError(\"Generator is already executing.\");for(;o;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")}function f(e,t){var i=\"function\"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,s=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}function g(){for(var e=[],t=0;t1||a(e,t)}))})}function a(e,t){try{(i=r[e](t)).value instanceof S?Promise.resolve(i.value.v).then(c,d):l(s[0][2],i)}catch(e){l(s[0][3],e)}var i}function c(e){a(\"next\",e)}function d(e){a(\"throw\",e)}function l(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function y(e){var t,i;return t={},n(\"next\"),n(\"throw\",(function(e){throw e})),n(\"return\"),t[Symbol.iterator]=function(){return this},t;function n(n,r){t[n]=e[n]?function(t){return(i=!i)?{value:S(e[n](t)),done:\"return\"===n}:r?r(t):t}:r}}function w(e){if(!Symbol.asyncIterator)throw new TypeError(\"Symbol.asyncIterator is not defined.\");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e=m(e),t={},n(\"next\"),n(\"throw\"),n(\"return\"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise((function(n,r){!function(e,t,i,n){Promise.resolve(n).then((function(t){e({value:t,done:i})}),t)}(n,r,(t=e[i](t)).done,t.value)}))}}}function C(e,t){return Object.defineProperty?Object.defineProperty(e,\"raw\",{value:t}):e.raw=t,e}function k(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function I(e,t){if(!t.has(e))throw new TypeError(\"attempted to get private field on non-instance\");return t.get(e)}function T(e,t,i){if(!t.has(e))throw new TypeError(\"attempted to set private field on non-instance\");return t.set(e,i),i}},2238:function(e,t,i){var n;!function(r,s){\"use strict\";var o=\"function\",a=\"undefined\",c=\"object\",d=\"string\",l=\"major\",u=\"model\",h=\"name\",p=\"type\",m=\"vendor\",f=\"version\",g=\"architecture\",v=\"console\",S=\"mobile\",b=\"tablet\",y=\"smarttv\",w=\"wearable\",C=\"embedded\",k=\"Amazon\",E=\"Apple\",I=\"ASUS\",T=\"BlackBerry\",A=\"Browser\",M=\"Chrome\",x=\"Firefox\",_=\"Google\",P=\"Huawei\",O=\"LG\",R=\"Microsoft\",D=\"Motorola\",N=\"Opera\",F=\"Samsung\",B=\"Sharp\",L=\"Sony\",U=\"Xiaomi\",V=\"Zebra\",j=\"Facebook\",z=\"Chromium OS\",$=\"Mac OS\",W=function(e){for(var t={},i=0;i0?2===a.length?typeof a[1]==o?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3===a.length?typeof a[1]!==o||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):s:this[a[0]]=l?a[1].call(this,l,a[2]):s:4===a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):s):this[a]=l||s;u+=2}},J=function(e,t){for(var i in t)if(typeof t[i]===c&&t[i].length>0){for(var n=0;n2&&(e[u]=\"iPad\",e[p]=b),e},this.getEngine=function(){var e={};return e[h]=s,e[f]=s,G.call(e,n,y.engine),e},this.getOS=function(){var e={};return e[h]=s,e[f]=s,G.call(e,n,y.os),w&&!e[h]&&v&&\"Unknown\"!=v.platform&&(e[h]=v.platform.replace(/chrome os/i,z).replace(/macos/i,$)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===d&&e.length>350?K(e,350):e,this},this.setUA(n),this};X.VERSION=\"1.0.35\",X.BROWSER=W([h,f,l]),X.CPU=W([g]),X.DEVICE=W([u,m,p,v,S,y,b,w,C]),X.ENGINE=X.OS=W([h,f]),typeof t!==a?(e.exports&&(t=e.exports=X),t.UAParser=X):i.amdO?(n=function(){return X}.call(t,i,t,e))===s||(e.exports=n):typeof r!==a&&(r.UAParser=X);var Y=typeof r!==a&&(r.jQuery||r.Zepto);if(Y&&!Y.ua){var ee=new X;Y.ua=ee.getResult(),Y.ua.get=function(){return ee.getUA()},Y.ua.set=function(e){ee.setUA(e);var t=ee.getResult();for(var i in t)Y.ua[i]=t[i]}}}(\"object\"==typeof window?window:this)},8156:e=>{\"use strict\";e.exports=__WEBPACK_EXTERNAL_MODULE__8156__}},__webpack_module_cache__={};function __nested_webpack_require_1096430__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var i=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(i.exports,i,i.exports,__nested_webpack_require_1096430__),i.exports}__nested_webpack_require_1096430__.amdO={},__nested_webpack_require_1096430__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __nested_webpack_require_1096430__.d(t,{a:t}),t},__nested_webpack_require_1096430__.d=(e,t)=>{for(var i in t)__nested_webpack_require_1096430__.o(t,i)&&!__nested_webpack_require_1096430__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__nested_webpack_require_1096430__.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(e){if(\"object\"==typeof window)return window}}(),__nested_webpack_require_1096430__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__nested_webpack_require_1096430__.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})};var __nested_webpack_exports__={};return(()=>{\"use strict\";__nested_webpack_require_1096430__.r(__nested_webpack_exports__),__nested_webpack_require_1096430__.d(__nested_webpack_exports__,{CrossFadeOverlapSize:()=>r,DefaultClientSettng:()=>m,DefaultServerSetting:()=>d,DiffMethod:()=>o,DownSamplingMode:()=>h,F0Detector:()=>s,INDEXEDDB_DB_APP_NAME:()=>g,INDEXEDDB_DB_NAME:()=>v,INDEXEDDB_KEY_CLIENT:()=>S,INDEXEDDB_KEY_MODEL_DATA:()=>y,INDEXEDDB_KEY_SERVER:()=>b,InputSampleRate:()=>i,ModelAssetName:()=>rt,ModelFileKind:()=>st,ModelLoadException:()=>w,ModelSamplingRate:()=>n,Protocol:()=>l,RVCModelType:()=>a,SampleRate:()=>p,SendingSampleRate:()=>u,ServerSettingKey:()=>c,VOICE_CHANGER_CLIENT_EXCEPTION:()=>f,VoiceChangerClient:()=>Ye,VoiceChangerType:()=>t,createDummyMediaStream:()=>Ke,fileSelector:()=>Ge,fileSelectorAsDataURL:()=>Je,useClient:()=>ct,useIndexedDB:()=>nt,useServerSetting:()=>ot,validateUrl:()=>Qe});var e={};__nested_webpack_require_1096430__.r(e),__nested_webpack_require_1096430__.d(e,{Decoder:()=>De,Encoder:()=>Oe,PacketType:()=>Pe,protocol:()=>_e});const t={MMVCv15:\"MMVCv15\",MMVCv13:\"MMVCv13\",\"so-vits-svc-40\":\"so-vits-svc-40\",\"DDSP-SVC\":\"DDSP-SVC\",RVC:\"RVC\",\"Diffusion-SVC\":\"Diffusion-SVC\"},i={48e3:48e3,44100:44100,24e3:24e3},n={48e3:48e3,4e4:4e4,32e3:32e3},r={1024:1024,2048:2048,4096:4096},s={dio:\"dio\",harvest:\"harvest\",crepe:\"crepe\",crepe_full:\"crepe_full\",crepe_tiny:\"crepe_tiny\"},o={pndm:\"pndm\",\"dpm-solver\":\"dpm-solver\"},a={pyTorchRVC:\"pyTorchRVC\",pyTorchRVCNono:\"pyTorchRVCNono\",pyTorchRVCv2:\"pyTorchRVCv2\",pyTorchRVCv2Nono:\"pyTorchRVCv2Nono\",pyTorchWebUI:\"pyTorchWebUI\",pyTorchWebUINono:\"pyTorchWebUINono\",onnxRVC:\"onnxRVC\",onnxRVCNono:\"onnxRVCNono\"},c={srcId:\"srcId\",dstId:\"dstId\",gpu:\"gpu\",crossFadeOffsetRate:\"crossFadeOffsetRate\",crossFadeEndRate:\"crossFadeEndRate\",crossFadeOverlapSize:\"crossFadeOverlapSize\",framework:\"framework\",onnxExecutionProvider:\"onnxExecutionProvider\",f0Factor:\"f0Factor\",f0Detector:\"f0Detector\",recordIO:\"recordIO\",enableServerAudio:\"enableServerAudio\",serverAudioStated:\"serverAudioStated\",serverAudioSampleRate:\"serverAudioSampleRate\",serverInputAudioSampleRate:\"serverInputAudioSampleRate\",serverOutputAudioSampleRate:\"serverOutputAudioSampleRate\",serverMonitorAudioSampleRate:\"serverMonitorAudioSampleRate\",serverInputAudioBufferSize:\"serverInputAudioBufferSize\",serverOutputAudioBufferSize:\"serverOutputAudioBufferSize\",serverInputDeviceId:\"serverInputDeviceId\",serverOutputDeviceId:\"serverOutputDeviceId\",serverMonitorDeviceId:\"serverMonitorDeviceId\",serverReadChunkSize:\"serverReadChunkSize\",serverInputAudioGain:\"serverInputAudioGain\",serverOutputAudioGain:\"serverOutputAudioGain\",tran:\"tran\",noiseScale:\"noiseScale\",predictF0:\"predictF0\",silentThreshold:\"silentThreshold\",extraConvertSize:\"extraConvertSize\",clusterInferRatio:\"clusterInferRatio\",indexRatio:\"indexRatio\",protect:\"protect\",rvcQuality:\"rvcQuality\",modelSamplingRate:\"modelSamplingRate\",silenceFront:\"silenceFront\",modelSlotIndex:\"modelSlotIndex\",useEnhancer:\"useEnhancer\",useDiff:\"useDiff\",diffMethod:\"diffMethod\",useDiffSilence:\"useDiffSilence\",diffAcc:\"diffAcc\",diffSpkId:\"diffSpkId\",kStep:\"kStep\",threshold:\"threshold\",speedUp:\"speedUp\",inputSampleRate:\"inputSampleRate\",enableDirectML:\"enableDirectML\"},d={inputSampleRate:48e3,crossFadeOffsetRate:0,crossFadeEndRate:1,crossFadeOverlapSize:r[1024],recordIO:0,enableServerAudio:0,serverAudioStated:0,serverAudioSampleRate:48e3,serverInputAudioSampleRate:48e3,serverOutputAudioSampleRate:48e3,serverMonitorAudioSampleRate:48e3,serverInputAudioBufferSize:24576,serverOutputAudioBufferSize:24576,serverInputDeviceId:-1,serverOutputDeviceId:-1,serverMonitorDeviceId:-1,serverReadChunkSize:256,serverInputAudioGain:1,serverOutputAudioGain:1,srcId:0,dstId:1,gpu:0,f0Factor:1,f0Detector:s.dio,tran:0,noiseScale:0,predictF0:0,silentThreshold:0,extraConvertSize:0,clusterInferRatio:0,indexRatio:0,protect:.5,rvcQuality:0,modelSamplingRate:48e3,silenceFront:1,modelSlotIndex:0,sampleModels:[],gpus:[],useEnhancer:0,useDiff:1,diffMethod:\"dpm-solver\",useDiffSilence:0,diffAcc:20,diffSpkId:1,kStep:120,threshold:-45,speedUp:10,enableDirectML:0,status:\"ok\",modelSlots:[],serverAudioInputDevices:[],serverAudioOutputDevices:[],maxInputLength:262144},l={sio:\"sio\",rest:\"rest\"},u={48e3:48e3,44100:44100,24e3:24e3},h={decimate:\"decimate\",average:\"average\"},p={48e3:48e3},m={workletSetting:{numTrancateTreshold:100,volTrancateThreshold:5e-4,volTrancateLength:32},workletNodeSetting:{serverUrl:\"\",protocol:\"sio\",sendingSampleRate:48e3,inputChunkNum:48,downSamplingMode:\"average\"},voiceChangerClientSetting:{audioInput:null,sampleRate:48e3,echoCancel:!1,noiseSuppression:!1,noiseSuppression2:!1,inputGain:1,outputGain:1}},f={ERR_SIO_CONNECT_FAILED:\"ERR_SIO_CONNECT_FAILED\",ERR_SIO_INVALID_RESPONSE:\"ERR_SIO_INVALID_RESPONSE\",ERR_REST_INVALID_RESPONSE:\"ERR_REST_INVALID_RESPONSE\",ERR_MIC_STREAM_NOT_INITIALIZED:\"ERR_MIC_STREAM_NOT_INITIALIZED\"},g=\"INDEXEDDB_KEY_VOICE_CHANGER\",v=\"INDEXEDDB_KEY_VOICE_CHANGER_DB\",S=\"INDEXEDDB_KEY_VOICE_CHANGER_LIB_CLIENT\",b=\"INDEXEDDB_KEY_VOICE_CHANGER_LIB_SERVER\",y=\"INDEXEDDB_KEY_VOICE_CHANGER_LIB_MODEL_DATA\";class w extends Error{constructor(e){super(`Model Load Exception:${e}`),this.causeFileType=\"\",this.causeFileType=e,this.name=this.constructor.name,Error.captureStackTrace(this)}}const C=Object.create(null);C.open=\"0\",C.close=\"1\",C.ping=\"2\",C.pong=\"3\",C.message=\"4\",C.upgrade=\"5\",C.noop=\"6\";const k=Object.create(null);Object.keys(C).forEach((e=>{k[C[e]]=e}));const E={type:\"error\",data:\"parser error\"},I=\"function\"==typeof Blob||\"undefined\"!=typeof Blob&&\"[object BlobConstructor]\"===Object.prototype.toString.call(Blob),T=\"function\"==typeof ArrayBuffer,A=e=>\"function\"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,M=({type:e,data:t},i,n)=>I&&t instanceof Blob?i?n(t):x(t,n):T&&(t instanceof ArrayBuffer||A(t))?i?n(t):x(new Blob([t]),n):n(C[e]+(t||\"\")),x=(e,t)=>{const i=new FileReader;return i.onload=function(){const e=i.result.split(\",\")[1];t(\"b\"+(e||\"\"))},i.readAsDataURL(e)};function _(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let P;function O(e,t){return I&&e.data instanceof Blob?e.data.arrayBuffer().then(_).then(t):T&&(e.data instanceof ArrayBuffer||A(e.data))?t(_(e.data)):void M(e,!1,(e=>{P||(P=new TextEncoder),t(P.encode(e))}))}const R=\"undefined\"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)R[\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".charCodeAt(e)]=e;const D=\"function\"==typeof ArrayBuffer,N=(e,t)=>{if(\"string\"!=typeof e)return{type:\"message\",data:B(e,t)};const i=e.charAt(0);return\"b\"===i?{type:\"message\",data:F(e.substring(1),t)}:k[i]?e.length>1?{type:k[i],data:e.substring(1)}:{type:k[i]}:E},F=(e,t)=>{if(D){const i=(e=>{let t,i,n,r,s,o=.75*e.length,a=e.length,c=0;\"=\"===e[e.length-1]&&(o--,\"=\"===e[e.length-2]&&o--);const d=new ArrayBuffer(o),l=new Uint8Array(d);for(t=0;t>4,l[c++]=(15&n)<<4|r>>2,l[c++]=(3&r)<<6|63&s;return d})(e);return B(i,t)}return{base64:!0,data:e}},B=(e,t)=>\"blob\"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,L=String.fromCharCode(30);let U;function V(e){if(e)return function(e){for(var t in V.prototype)e[t]=V.prototype[t];return e}(e)}V.prototype.on=V.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[\"$\"+e]=this._callbacks[\"$\"+e]||[]).push(t),this},V.prototype.once=function(e,t){function i(){this.off(e,i),t.apply(this,arguments)}return i.fn=t,this.on(e,i),this},V.prototype.off=V.prototype.removeListener=V.prototype.removeAllListeners=V.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i,n=this._callbacks[\"$\"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks[\"$\"+e],this;for(var r=0;r(e.hasOwnProperty(i)&&(t[i]=e[i]),t)),{})}const $=j.setTimeout,W=j.clearTimeout;function H(e,t){t.useNativeTimers?(e.setTimeoutFn=$.bind(j),e.clearTimeoutFn=W.bind(j)):(e.setTimeoutFn=j.setTimeout.bind(j),e.clearTimeoutFn=j.clearTimeout.bind(j))}class q extends Error{constructor(e,t,i){super(e),this.description=t,this.context=i,this.type=\"TransportError\"}}class K extends V{constructor(e){super(),this.writable=!1,H(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,i){return super.emitReserved(\"error\",new q(e,t,i)),this}open(){return this.readyState=\"opening\",this.doOpen(),this}close(){return\"opening\"!==this.readyState&&\"open\"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){\"open\"===this.readyState&&this.write(e)}onOpen(){this.readyState=\"open\",this.writable=!0,super.emitReserved(\"open\")}onData(e){const t=N(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved(\"packet\",e)}onClose(e){this.readyState=\"closed\",super.emitReserved(\"close\",e)}pause(e){}createUri(e,t={}){return e+\"://\"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(\":\")?e:\"[\"+e+\"]\"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?\":\"+this.opts.port:\"\"}_query(e){const t=function(e){let t=\"\";for(let i in e)e.hasOwnProperty(i)&&(t.length&&(t+=\"&\"),t+=encodeURIComponent(i)+\"=\"+encodeURIComponent(e[i]));return t}(e);return t.length?\"?\"+t:\"\"}}const G=\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\".split(\"\"),J=64,Q={};let Z,X=0,Y=0;function ee(e){let t=\"\";do{t=G[e%J]+t,e=Math.floor(e/J)}while(e>0);return t}function te(){const e=ee(+new Date);return e!==Z?(X=0,Z=e):e+\".\"+ee(X++)}for(;Y{var e;3===i.readyState&&(null===(e=this.opts.cookieJar)||void 0===e||e.parseCookies(i)),4===i.readyState&&(200===i.status||1223===i.status?this.onLoad():this.setTimeoutFn((()=>{this.onError(\"number\"==typeof i.status?i.status:0)}),0))},i.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}\"undefined\"!=typeof document&&(this.index=ae.requestsCount++,ae.requests[this.index]=this)}onError(e){this.emitReserved(\"error\",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=se,e)try{this.xhr.abort()}catch(e){}\"undefined\"!=typeof document&&delete ae.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved(\"data\",e),this.emitReserved(\"success\"),this.cleanup())}abort(){this.cleanup()}}function ce(){for(let e in ae.requests)ae.requests.hasOwnProperty(e)&&ae.requests[e].abort()}ae.requestsCount=0,ae.requests={},\"undefined\"!=typeof document&&(\"function\"==typeof attachEvent?attachEvent(\"onunload\",ce):\"function\"==typeof addEventListener&&addEventListener(\"onpagehide\"in j?\"pagehide\":\"unload\",ce,!1));const de=\"function\"==typeof Promise&&\"function\"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),le=j.WebSocket||j.MozWebSocket;__nested_webpack_require_1096430__(8764).lW;const ue=\"undefined\"!=typeof navigator&&\"string\"==typeof navigator.product&&\"reactnative\"===navigator.product.toLowerCase();function he(e,t){return\"message\"===e.type&&\"string\"!=typeof e.data&&t[0]>=48&&t[0]<=54}const pe={websocket:class extends K{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return\"websocket\"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,i=ue?{}:z(this.opts,\"agent\",\"perMessageDeflate\",\"pfx\",\"key\",\"passphrase\",\"cert\",\"ca\",\"ciphers\",\"rejectUnauthorized\",\"localAddress\",\"protocolVersion\",\"origin\",\"maxPayload\",\"family\",\"checkServerIdentity\");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=ue?new le(e,t,i):t?new le(e,t):new le(e)}catch(e){return this.emitReserved(\"error\",e)}this.ws.binaryType=this.socket.binaryType||\"arraybuffer\",this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:\"websocket connection closed\",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError(\"websocket error\",e)}write(e){this.writable=!1;for(let t=0;t{try{this.ws.send(e)}catch(e){}n&&de((()=>{this.writable=!0,this.emitReserved(\"drain\")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?\"wss\":\"ws\",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=te()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!le}},webtransport:class extends K{get name(){return\"webtransport\"}doOpen(){\"function\"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri(\"https\"),this.opts.transportOptions[this.name]),this.transport.closed.then((()=>{this.onClose()})).catch((e=>{this.onError(\"webtransport error\",e)})),this.transport.ready.then((()=>{this.transport.createBidirectionalStream().then((e=>{const t=e.readable.getReader();let i;this.writer=e.writable.getWriter();const n=()=>{t.read().then((({done:e,value:t})=>{e||(i||1!==t.byteLength||54!==t[0]?(this.onPacket(function(e,t,i){U||(U=new TextDecoder);const n=t||e[0]<48||e[0]>54;return N(n?e:U.decode(e),\"arraybuffer\")}(t,i)),i=!1):i=!0,n())})).catch((e=>{}))};n();const r=this.query.sid?`0{\"sid\":\"${this.query.sid}\"}`:\"0\";this.writer.write((new TextEncoder).encode(r)).then((()=>this.onOpen()))}))})))}write(e){this.writable=!1;for(let t=0;t{he(i,e)&&this.writer.write(Uint8Array.of(54)),this.writer.write(e).then((()=>{n&&de((()=>{this.writable=!0,this.emitReserved(\"drain\")}),this.setTimeoutFn)}))}))}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}},polling:class extends K{constructor(e){if(super(e),this.polling=!1,\"undefined\"!=typeof location){const t=\"https:\"===location.protocol;let i=location.port;i||(i=t?\"443\":\"80\"),this.xd=\"undefined\"!=typeof location&&e.hostname!==location.hostname||i!==e.port}const t=e&&e.forceBase64;this.supportsBinary=oe&&!t,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return\"polling\"}doOpen(){this.poll()}pause(e){this.readyState=\"pausing\";const t=()=>{this.readyState=\"paused\",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once(\"pollComplete\",(function(){--e||t()}))),this.writable||(e++,this.once(\"drain\",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved(\"poll\")}onData(e){((e,t)=>{const i=e.split(L),n=[];for(let e=0;e{if(\"opening\"===this.readyState&&\"open\"===e.type&&this.onOpen(),\"close\"===e.type)return this.onClose({description:\"transport closed by the server\"}),!1;this.onPacket(e)})),\"closed\"!==this.readyState&&(this.polling=!1,this.emitReserved(\"pollComplete\"),\"open\"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:\"close\"}])};\"open\"===this.readyState?e():this.once(\"open\",e)}write(e){this.writable=!1,((e,t)=>{const i=e.length,n=new Array(i);let r=0;e.forEach(((e,s)=>{M(e,!1,(e=>{n[s]=e,++r===i&&t(n.join(L))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved(\"drain\")}))}))}uri(){const e=this.opts.secure?\"https\":\"http\",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=te()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new ae(this.uri(),e)}doWrite(e,t){const i=this.request({method:\"POST\",data:e});i.on(\"success\",t),i.on(\"error\",((e,t)=>{this.onError(\"xhr post error\",e,t)}))}doPoll(){const e=this.request();e.on(\"data\",this.onData.bind(this)),e.on(\"error\",((e,t)=>{this.onError(\"xhr poll error\",e,t)})),this.pollXhr=e}}},me=/^(?:(?![^:@\\/?#]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@\\/?#]*)(?::([^:@\\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/,fe=[\"source\",\"protocol\",\"authority\",\"userInfo\",\"user\",\"password\",\"host\",\"port\",\"relative\",\"path\",\"directory\",\"file\",\"query\",\"anchor\"];function ge(e){const t=e,i=e.indexOf(\"[\"),n=e.indexOf(\"]\");-1!=i&&-1!=n&&(e=e.substring(0,i)+e.substring(i,n).replace(/:/g,\";\")+e.substring(n,e.length));let r=me.exec(e||\"\"),s={},o=14;for(;o--;)s[fe[o]]=r[o]||\"\";return-1!=i&&-1!=n&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,\":\"),s.authority=s.authority.replace(\"[\",\"\").replace(\"]\",\"\").replace(/;/g,\":\"),s.ipv6uri=!0),s.pathNames=function(e,t){const i=t.replace(/\\/{2,9}/g,\"/\").split(\"/\");return\"/\"!=t.slice(0,1)&&0!==t.length||i.splice(0,1),\"/\"==t.slice(-1)&&i.splice(i.length-1,1),i}(0,s.path),s.queryKey=function(e,t){const i={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,n){t&&(i[t]=n)})),i}(0,s.query),s}class ve extends V{constructor(e,t={}){super(),this.writeBuffer=[],e&&\"object\"==typeof e&&(t=e,e=null),e?(e=ge(e),t.hostname=e.host,t.secure=\"https\"===e.protocol||\"wss\"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=ge(t.host).host),H(this,t),this.secure=null!=t.secure?t.secure:\"undefined\"!=typeof location&&\"https:\"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?\"443\":\"80\"),this.hostname=t.hostname||(\"undefined\"!=typeof location?location.hostname:\"localhost\"),this.port=t.port||(\"undefined\"!=typeof location&&location.port?location.port:this.secure?\"443\":\"80\"),this.transports=t.transports||[\"polling\",\"websocket\",\"webtransport\"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:\"/engine.io\",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:\"t\",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\\/$/,\"\")+(this.opts.addTrailingSlash?\"/\":\"\"),\"string\"==typeof this.opts.query&&(this.opts.query=function(e){let t={},i=e.split(\"&\");for(let e=0,n=i.length;e{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener(\"beforeunload\",this.beforeunloadEventListener,!1)),\"localhost\"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose(\"transport close\",{description:\"network connection lost\"})},addEventListener(\"offline\",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const i=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new pe[e](i)}open(){let e;if(this.opts.rememberUpgrade&&ve.priorWebsocketSuccess&&-1!==this.transports.indexOf(\"websocket\"))e=\"websocket\";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved(\"error\",\"No transports available\")}),0);e=this.transports[0]}this.readyState=\"opening\";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on(\"drain\",this.onDrain.bind(this)).on(\"packet\",this.onPacket.bind(this)).on(\"error\",this.onError.bind(this)).on(\"close\",(e=>this.onClose(\"transport close\",e)))}probe(e){let t=this.createTransport(e),i=!1;ve.priorWebsocketSuccess=!1;const n=()=>{i||(t.send([{type:\"ping\",data:\"probe\"}]),t.once(\"packet\",(e=>{if(!i)if(\"pong\"===e.type&&\"probe\"===e.data){if(this.upgrading=!0,this.emitReserved(\"upgrading\",t),!t)return;ve.priorWebsocketSuccess=\"websocket\"===t.name,this.transport.pause((()=>{i||\"closed\"!==this.readyState&&(d(),this.setTransport(t),t.send([{type:\"upgrade\"}]),this.emitReserved(\"upgrade\",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error(\"probe error\");e.transport=t.name,this.emitReserved(\"upgradeError\",e)}})))};function r(){i||(i=!0,d(),t.close(),t=null)}const s=e=>{const i=new Error(\"probe error: \"+e);i.transport=t.name,r(),this.emitReserved(\"upgradeError\",i)};function o(){s(\"transport closed\")}function a(){s(\"socket closed\")}function c(e){t&&e.name!==t.name&&r()}const d=()=>{t.removeListener(\"open\",n),t.removeListener(\"error\",s),t.removeListener(\"close\",o),this.off(\"close\",a),this.off(\"upgrading\",c)};t.once(\"open\",n),t.once(\"error\",s),t.once(\"close\",o),this.once(\"close\",a),this.once(\"upgrading\",c),-1!==this.upgrades.indexOf(\"webtransport\")&&\"webtransport\"!==e?this.setTimeoutFn((()=>{i||t.open()}),200):t.open()}onOpen(){if(this.readyState=\"open\",ve.priorWebsocketSuccess=\"websocket\"===this.transport.name,this.emitReserved(\"open\"),this.flush(),\"open\"===this.readyState&&this.opts.upgrade){let e=0;const t=this.upgrades.length;for(;e{this.onClose(\"ping timeout\")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved(\"drain\"):this.flush()}flush(){if(\"closed\"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved(\"flush\")}}getWritablePackets(){if(!(this.maxPayload&&\"polling\"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let i=0;i=57344?i+=3:(n++,i+=4);return i}(t):Math.ceil(1.33*(t.byteLength||t.size))),i>0&&e>this.maxPayload)return this.writeBuffer.slice(0,i);e+=2}var t;return this.writeBuffer}write(e,t,i){return this.sendPacket(\"message\",e,t,i),this}send(e,t,i){return this.sendPacket(\"message\",e,t,i),this}sendPacket(e,t,i,n){if(\"function\"==typeof t&&(n=t,t=void 0),\"function\"==typeof i&&(n=i,i=null),\"closing\"===this.readyState||\"closed\"===this.readyState)return;(i=i||{}).compress=!1!==i.compress;const r={type:e,data:t,options:i};this.emitReserved(\"packetCreate\",r),this.writeBuffer.push(r),n&&this.once(\"flush\",n),this.flush()}close(){const e=()=>{this.onClose(\"forced close\"),this.transport.close()},t=()=>{this.off(\"upgrade\",t),this.off(\"upgradeError\",t),e()},i=()=>{this.once(\"upgrade\",t),this.once(\"upgradeError\",t)};return\"opening\"!==this.readyState&&\"open\"!==this.readyState||(this.readyState=\"closing\",this.writeBuffer.length?this.once(\"drain\",(()=>{this.upgrading?i():e()})):this.upgrading?i():e()),this}onError(e){ve.priorWebsocketSuccess=!1,this.emitReserved(\"error\",e),this.onClose(\"transport error\",e)}onClose(e,t){\"opening\"!==this.readyState&&\"open\"!==this.readyState&&\"closing\"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners(\"close\"),this.transport.close(),this.transport.removeAllListeners(),\"function\"==typeof removeEventListener&&(removeEventListener(\"beforeunload\",this.beforeunloadEventListener,!1),removeEventListener(\"offline\",this.offlineEventListener,!1)),this.readyState=\"closed\",this.id=null,this.emitReserved(\"close\",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let i=0;const n=e.length;for(;i\"function\"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,ye=Object.prototype.toString,we=\"function\"==typeof Blob||\"undefined\"!=typeof Blob&&\"[object BlobConstructor]\"===ye.call(Blob),Ce=\"function\"==typeof File||\"undefined\"!=typeof File&&\"[object FileConstructor]\"===ye.call(File);function ke(e){return Se&&(e instanceof ArrayBuffer||be(e))||we&&e instanceof Blob||Ce&&e instanceof File}function Ee(e,t){if(!e||\"object\"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,i=e.length;t=0&&e.num{delete this.acks[e];for(let t=0;t{this.io.clearTimeoutFn(r),t.apply(this,[null,...e])}}emitWithAck(e,...t){const i=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((n,r)=>{t.push(((e,t)=>i?e?r(e):n(t):n(e))),this.emit(e,...t)}))}_addToQueue(e){let t;\"function\"==typeof e[e.length-1]&&(t=e.pop());const i={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...n)=>{if(i===this._queue[0])return null!==e?i.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...n)),i.pending=!1,this._drainQueue()})),this._queue.push(i),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){\"function\"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Pe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved(\"connect_error\",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved(\"disconnect\",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Pe.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved(\"connect_error\",new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));break;case Pe.EVENT:case Pe.BINARY_EVENT:this.onevent(e);break;case Pe.ACK:case Pe.BINARY_ACK:this.onack(e);break;case Pe.DISCONNECT:this.ondisconnect();break;case Pe.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved(\"connect_error\",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const i of t)i.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&\"string\"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let i=!1;return function(...n){i||(i=!0,t.packet({type:Pe.ACK,id:e,data:n}))}}onack(e){const t=this.acks[e.id];\"function\"==typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved(\"connect\"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose(\"io server disconnect\")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Pe.DISCONNECT}),this.destroy(),this.connected&&this.onclose(\"io client disconnect\"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let i=0;i0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ue.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),i=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-i:e+i}return 0|Math.min(e,this.max)},Ue.prototype.reset=function(){this.attempts=0},Ue.prototype.setMin=function(e){this.ms=e},Ue.prototype.setMax=function(e){this.max=e},Ue.prototype.setJitter=function(e){this.jitter=e};class Ve extends V{constructor(t,i){var n;super(),this.nsps={},this.subs=[],t&&\"object\"==typeof t&&(i=t,t=void 0),(i=i||{}).path=i.path||\"/socket.io\",this.opts=i,H(this,i),this.reconnection(!1!==i.reconnection),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=i.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new Ue({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==i.timeout?2e4:i.timeout),this._readyState=\"closed\",this.uri=t;const r=i.parser||e;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==i.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf(\"open\"))return this;this.engine=new ve(this.uri,this.opts);const t=this.engine,i=this;this._readyState=\"opening\",this.skipReconnect=!1;const n=Fe(t,\"open\",(function(){i.onopen(),e&&e()})),r=t=>{this.cleanup(),this._readyState=\"closed\",this.emitReserved(\"error\",t),e?e(t):this.maybeReconnectOnOpen()},s=Fe(t,\"error\",r);if(!1!==this._timeout){const e=this._timeout,i=this.setTimeoutFn((()=>{n(),r(new Error(\"timeout\")),t.close()}),e);this.opts.autoUnref&&i.unref(),this.subs.push((()=>{this.clearTimeoutFn(i)}))}return this.subs.push(n),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState=\"open\",this.emitReserved(\"open\");const e=this.engine;this.subs.push(Fe(e,\"ping\",this.onping.bind(this)),Fe(e,\"data\",this.ondata.bind(this)),Fe(e,\"error\",this.onerror.bind(this)),Fe(e,\"close\",this.onclose.bind(this)),Fe(this.decoder,\"decoded\",this.ondecoded.bind(this)))}onping(){this.emitReserved(\"ping\")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose(\"parse error\",e)}}ondecoded(e){de((()=>{this.emitReserved(\"packet\",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved(\"error\",e)}socket(e,t){let i=this.nsps[e];return i?this._autoConnect&&!i.active&&i.connect():(i=new Le(this,e,t),this.nsps[e]=i),i}_destroy(e){const t=Object.keys(this.nsps);for(const e of t)if(this.nsps[e].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let i=0;ie())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose(\"forced close\"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState=\"closed\",this.emitReserved(\"close\",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved(\"reconnect_failed\"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const i=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved(\"reconnect_attempt\",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved(\"reconnect_error\",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&i.unref(),this.subs.push((()=>{this.clearTimeoutFn(i)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved(\"reconnect\",e)}}const je={};function ze(e,t){\"object\"==typeof e&&(t=e,e=void 0);const i=function(e,t=\"\",i){let n=e;i=i||\"undefined\"!=typeof location&&location,null==e&&(e=i.protocol+\"//\"+i.host),\"string\"==typeof e&&(\"/\"===e.charAt(0)&&(e=\"/\"===e.charAt(1)?i.protocol+e:i.host+e),/^(https?|wss?):\\/\\//.test(e)||(e=void 0!==i?i.protocol+\"//\"+e:\"https://\"+e),n=ge(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port=\"80\":/^(http|ws)s$/.test(n.protocol)&&(n.port=\"443\")),n.path=n.path||\"/\";const r=-1!==n.host.indexOf(\":\")?\"[\"+n.host+\"]\":n.host;return n.id=n.protocol+\"://\"+r+\":\"+n.port+t,n.href=n.protocol+\"://\"+r+(i&&i.port===n.port?\"\":\":\"+n.port),n}(e,(t=t||{}).path||\"/socket.io\"),n=i.source,r=i.id,s=i.path,o=je[r]&&s in je[r].nsps;let a;return t.forceNew||t[\"force new connection\"]||!1===t.multiplex||o?a=new Ve(n,t):(je[r]||(je[r]=new Ve(n,t)),a=je[r]),i.query&&!t.query&&(t.query=i.queryKey),a.socket(i.path,t)}Object.assign(ze,{Manager:Ve,Socket:Le,io:ze,connect:ze});var $e=__nested_webpack_require_1096430__(8764).lW;class We extends AudioWorkletNode{constructor(e,t){super(e,\"voice-changer-worklet-processor\"),this.setting=m.workletNodeSetting,this.requestChunks=[],this.socket=null,this.bufferStart=0,this.isOutputRecording=!1,this.recordingOutputChunk=[],this.outputNode=null,this.startPromiseResolve=null,this.stopPromiseResolve=null,this.setOutputNode=e=>{this.outputNode=e},this.updateSetting=e=>{console.log(\"[WorkletNode] Updating WorkletNode Setting,\",this.setting,e);let t=!1;this.setting.serverUrl==e.serverUrl&&this.setting.protocol==e.protocol||(t=!0),this.setting=e,t&&this.createSocketIO()},this.getSettings=()=>this.setting,this.getSocketId=()=>this.socket?.id,this.createSocketIO=()=>{this.socket&&this.socket.close(),\"sio\"===this.setting.protocol&&(this.socket=ze(this.setting.serverUrl+\"/test\"),this.socket.on(\"connect_error\",(e=>{this.listener.notifyException(f.ERR_SIO_CONNECT_FAILED,`[SIO] rconnection failed ${e}`)})),this.socket.on(\"connect\",(()=>{console.log(`[SIO] connect to ${this.setting.serverUrl}`),console.log(`[SIO] ${this.socket?.id}`)})),this.socket.on(\"close\",(function(e){console.log(`[SIO] close ${e.id}`)})),this.socket.on(\"message\",(e=>{console.log(\"message:\",e)})),this.socket.on(\"response\",(e=>{const t=Date.now()-e[0],i=e[1],n=e[2];0!=e[0]?i.byteLength<256?this.listener.notifyException(f.ERR_SIO_INVALID_RESPONSE,`[SIO] recevied data is too short ${i.byteLength}`):(null!=this.outputNode?this.outputNode.postReceivedVoice(e[1]):this.postReceivedVoice(e[1]),this.listener.notifyResponseTime(t,n)):this.listener.notifyResponseTime(Math.round(1e3*n[0]),n.slice(1,4))})))},this.postReceivedVoice=e=>{const t=new Int16Array(e),i=new Float32Array(t.length);t.forEach(((e,t)=>{const n=e>=32768?-(65536-e)/32768:e/32767;i[t]=n}));let n=null;if(48e3==this.setting.sendingSampleRate)n=i;else{n=new Float32Array(2*i.length);for(let e=0;e{const t=Date.now();if(\"sio\"===this.setting.protocol){if(!this.socket)return void console.warn(\"sio is not initialized\");this.socket.emit(\"request_message\",[t,e.buffer])}else{const i=await He(this.setting.serverUrl+\"/test\",t,e.buffer);i.byteLength<256?this.listener.notifyException(f.ERR_REST_INVALID_RESPONSE,`[REST] recevied data is too short ${i.byteLength}`):(null!=this.outputNode?this.outputNode.postReceivedVoice(i):this.postReceivedVoice(i),this.listener.notifyResponseTime(Date.now()-t))}},this.configure=e=>{const t={requestType:\"config\",voice:new Float32Array(1),numTrancateTreshold:e.numTrancateTreshold,volTrancateThreshold:e.volTrancateThreshold,volTrancateLength:e.volTrancateLength};this.port.postMessage(t)},this.start=async()=>{const e=new Promise((e=>{this.startPromiseResolve=e})),t={requestType:\"start\",voice:new Float32Array(1),numTrancateTreshold:0,volTrancateThreshold:0,volTrancateLength:0};this.port.postMessage(t),await e},this.stop=async()=>{const e=new Promise((e=>{this.stopPromiseResolve=e})),t={requestType:\"stop\",voice:new Float32Array(1),numTrancateTreshold:0,volTrancateThreshold:0,volTrancateLength:0};this.port.postMessage(t),await e},this.trancateBuffer=()=>{const e={requestType:\"trancateBuffer\",voice:new Float32Array(1),numTrancateTreshold:0,volTrancateThreshold:0,volTrancateLength:0};this.port.postMessage(e)},this.startOutputRecording=()=>{this.recordingOutputChunk=[],this.isOutputRecording=!0},this.stopOutputRecording=()=>{this.isOutputRecording=!1;const e=this.recordingOutputChunk.reduce(((e,t)=>e+t.length),0),t=new Float32Array(e);let i=0;for(let e=0;et)throw\"downsampling rate show be smaller than original sample rate\";const n=t/i,r=Math.round(e.length/n),s=new Float32Array(r);let o=0,a=0;for(;oe+t.byteLength),0),o=new Uint8Array(s);this.requestChunks.reduce(((e,t)=>(o.set(new Uint8Array(t),e),e+t.byteLength)),0),this.sendBuffer(o),this.requestChunks=[],this.listener.notifySendBufferingTime(Date.now()-this.bufferStart),this.bufferStart=Date.now()}else console.warn(`[worklet_node][voice-changer-worklet-processor] unknown response ${e.data.responseType}`,e.data)}}const He=async(e,t,i)=>{const n={timestamp:t,buffer:$e.from(i).toString(\"base64\")},r=JSON.stringify(n),s=await fetch(`${e}`,{method:\"POST\",headers:{Accept:\"application/json\",\"Content-Type\":\"application/json\"},body:r});try{const e=(await s.json()).changedVoiceBase64,t=$e.from(e,\"base64\"),i=new ArrayBuffer(t.length),n=new Uint8Array(i);for(let e=0;e{const t=e.createMediaStreamDestination(),i=e.createGain();i.gain.value=0,i.connect(t);const n=e.createOscillator();return n.frequency.value=440,n.connect(i),n.start(),t.stream},Ge=async e=>{const t=document.createElement(\"input\");t.type=\"file\";const i=new Promise(((i,n)=>{t.onchange=t=>{if(t.target instanceof HTMLInputElement==0)return console.log(\"invalid target!\",t.target),n(\"invalid target\"),null;const r=t.target;return r.files&&0!=r.files.length?\"\"!=e&&r.files[0].type.match(e)?(n(`not target file type ${r.files[0].type}`),null):(i(r.files[0]),null):(n(\"no file selected\"),null)},t.click()}));return await i},Je=async e=>{const t=await Ge(e);return t?await new Promise((e=>{const i=new FileReader;i.onload=()=>{console.log(\"load data\",i.result),e(i.result)},i.readAsDataURL(t)})):t},Qe=e=>e?.endsWith(\"/\")?e.substring(0,e.length-1):e;class Ze{constructor(){this.serverUrl=\"\",this.setServerUrl=e=>{this.serverUrl=e,console.log(`[ServerConfigurator] Server URL: ${this.serverUrl}`)},this.getSettings=async()=>{const e=this.serverUrl+\"/info\";return await new Promise((t=>{const i=new Request(e,{method:\"GET\"});fetch(i).then((async e=>{const i=await e.json();t(i)}))}))},this.getPerformance=async()=>{const e=this.serverUrl+\"/performance\";return await new Promise((t=>{const i=new Request(e,{method:\"GET\"});fetch(i).then((async e=>{const i=await e.json();t(i)}))}))},this.updateSettings=async(e,t)=>{const i=this.serverUrl+\"/update_settings\";return await new Promise((async n=>{const r=new FormData;r.append(\"key\",e),r.append(\"val\",t);const s=new Request(i,{method:\"POST\",body:r});n(await(await fetch(s)).json())}))},this.uploadFile2=async(e,t,i)=>{const n=this.serverUrl+\"/upload_file\";i(0,!1);const r=1048576;let s=0;const o=t.size,a=e+t.name,c=Math.ceil(o/r);for(;;){const e=[];for(let i=0;i<10&&!(s*r>=o);i++){const i=t.slice(s*r,(s+1)*r),o=new Promise((e=>{const t=new FormData;t.append(\"file\",new Blob([i])),t.append(\"filename\",`${a}_${s}`);const r=new Request(n,{method:\"POST\",body:t});fetch(r).then((async t=>{e()}))}));s+=1,e.push(o)}if(await Promise.all(e),s*r>=o)break;i(Math.floor(s/(c+1)*100),!1)}return c},this.uploadFile=async(e,t,i)=>{const n=this.serverUrl+\"/upload_file\";i(0,!1);const r=1048576,s=[];let o=0;for(let t=0;t{const r=new FormData;r.append(\"file\",new Blob([i.chunk])),r.append(\"filename\",`${t}_${i.hash}`);const s=new Request(n,{method:\"POST\",body:r});fetch(s).then((async t=>{e()}))}));e.push(r)}if(await Promise.all(e),0==s.length)break;i(Math.floor((a-s.length)/(a+1)*100),!1)}return a},this.concatUploadedFile=async(e,t)=>{const i=this.serverUrl+\"/concat_uploaded_file\";await new Promise((n=>{const r=new FormData;r.append(\"filename\",e),r.append(\"filenameChunkNum\",\"\"+t);const s=new Request(i,{method:\"POST\",body:r});fetch(s).then((async e=>{console.log(await e.text()),n()}))}))},this.loadModel=async(e,t,i=\"{}\")=>{null!=t&&null!=t||(console.warn(\"isHalf is invalid value\",t),t=!1);const n=this.serverUrl+\"/load_model\",r=new Promise((async r=>{const s=new FormData;s.append(\"slot\",\"\"+e),s.append(\"isHalf\",\"\"+t),s.append(\"params\",i);const o=new Request(n,{method:\"POST\",body:s});r(await(await fetch(o)).json())}));return await r},this.uploadAssets=async e=>{const t=this.serverUrl+\"/upload_model_assets\",i=new Promise((async i=>{const n=new FormData;n.append(\"params\",e);const r=new Request(t,{method:\"POST\",body:n});i(await(await fetch(r)).json())}));return await i},this.getModelType=async()=>{const e=this.serverUrl+\"/model_type\",t=new Promise((async t=>{const i=new Request(e,{method:\"GET\"});t(await(await fetch(i)).json())}));return await t},this.export2onnx=async()=>{const e=this.serverUrl+\"/onnx\",t=new Promise((async t=>{const i=new Request(e,{method:\"GET\"});t(await(await fetch(i)).json())}));return await t},this.mergeModel=async e=>{const t=this.serverUrl+\"/merge_model\",i=new Promise((async i=>{const n=new FormData;n.append(\"request\",JSON.stringify(e));const r=new Request(t,{method:\"POST\",body:n}),s=await(await fetch(r)).json();console.log(\"RESPONSE\",s),i(s)}));return await i},this.updateModelDefault=async()=>{const e=this.serverUrl+\"/update_model_default\",t=new Promise((async t=>{const i=new Request(e,{method:\"POST\"}),n=await(await fetch(i)).json();console.log(\"RESPONSE\",n),t(n)}));return await t},this.updateModelInfo=async(e,t,i)=>{const n=this.serverUrl+\"/update_model_info\",r={slot:e,key:t,val:i},s=new Promise((async e=>{const t=new FormData;t.append(\"newData\",JSON.stringify(r));const i=new Request(n,{method:\"POST\",body:t}),s=await(await fetch(i)).json();console.log(\"RESPONSE\",s),e(s)}));return await s}}}class Xe{constructor(){this._resolvers=[],this._promises=[]}_add(){this._promises.push(new Promise((e=>{this._resolvers.push(e)})))}enqueue(e){0==this._resolvers.length&&this._add(),this._resolvers.shift()(e)}dequeue(){return 0==this._promises.length&&this._add(),this._promises.shift()}isEmpty(){return 0==this._promises.length}isBlocked(){return 0!=this._resolvers.length}get length(){return this._promises.length-this._resolvers.length}}class Ye{constructor(e,t,i){this.vfEnable=!1,this.vf=null,this.currentDevice=null,this.currentMediaStream=null,this.currentMediaStreamAudioSourceNode=null,this.inputGainNode=null,this.outputGainNode=null,this._isVoiceChanging=!1,this.setting=m.voiceChangerClientSetting,this.sslCertified=[],this.sem=new Xe,this.lock=async()=>await this.sem.dequeue(),this.unlock=e=>{this.sem.enqueue(e+1)},this.isInitialized=async()=>(this.promiseForInitialize&&await this.promiseForInitialize,!0),this.setup=async()=>{const e=await this.lock();if(console.log(`Input Setup=> echo: ${this.setting.echoCancel}, noise1: ${this.setting.noiseSuppression}, noise2: ${this.setting.noiseSuppression2}`),!this.vcInNode)throw console.warn(\"vc node is not initialized.\"),\"vc node is not initialized.\";if(this.currentMediaStream&&(this.currentMediaStream.getTracks().forEach((e=>{e.stop()})),this.currentMediaStream=null),!this.setting.audioInput)return console.log(`Input Setup=> client mic is disabled. ${this.setting.audioInput}`),this.vcInNode.stop(),void await this.unlock(e);if(\"string\"==typeof this.setting.audioInput)try{\"none\"==this.setting.audioInput?this.currentMediaStream=Ke(this.ctx):this.currentMediaStream=await navigator.mediaDevices.getUserMedia({audio:{deviceId:this.setting.audioInput,channelCount:1,sampleRate:this.setting.sampleRate,sampleSize:16,autoGainControl:!1,echoCancellation:this.setting.echoCancel,noiseSuppression:this.setting.noiseSuppression}})}catch(t){throw console.warn(t),this.vcInNode.stop(),await this.unlock(e),t}else this.currentMediaStream=this.setting.audioInput;if(this.currentMediaStreamAudioSourceNode=this.ctx.createMediaStreamSource(this.currentMediaStream),this.inputGainNode=this.ctx.createGain(),this.inputGainNode.gain.value=this.setting.inputGain,this.currentMediaStreamAudioSourceNode.connect(this.inputGainNode),this.currentDevice&&this.setting.noiseSuppression2){this.currentDevice.chooseNewInnerDevice(this.currentMediaStream);const e=await this.currentDevice.createAudioNode(this.ctx);this.inputGainNode.connect(e.start),e.end.connect(this.vcInNode)}else this.inputGainNode.connect(this.vcInNode);this.vcInNode.setOutputNode(this.vcOutNode),console.log(\"Input Setup=> success\"),await this.unlock(e)},this.start=async()=>{await this.vcInNode.start(),this._isVoiceChanging=!0},this.stop=async()=>{await this.vcInNode.stop(),this._isVoiceChanging=!1},this.setServerUrl=(e,t=!1)=>{const i=Qe(e);i!=`${location.protocol}//${location.host}`&&0!=i.length&&\"https:\"==location.protocol&&0==this.sslCertified.includes(i)&&t&&(window.confirm(\"MMVC Server is different from this page's origin. Open tab to open ssl connection. OK? (You can close the opened tab after ssl connection succeed.)\")?(window.open(i,\"_blank\"),this.sslCertified.push(i)):alert(\"Your voice conversion may fail...\")),this.vcInNode.updateSetting({...this.vcInNode.getSettings(),serverUrl:i}),this.configurator.setServerUrl(i)},this.updateClientSetting=async e=>{let t=!1;this.setting.audioInput==e.audioInput&&this.setting.echoCancel==e.echoCancel&&this.setting.noiseSuppression==e.noiseSuppression&&this.setting.noiseSuppression2==e.noiseSuppression2&&this.setting.sampleRate==e.sampleRate||(t=!0),this.setting.inputGain!=e.inputGain&&this.setInputGain(e.inputGain),this.setting.outputGain!=e.outputGain&&this.setOutputGain(e.outputGain),this.setting=e,t&&await this.setup()},this.setInputGain=e=>{this.setting.inputGain=e,this.inputGainNode&&(this.inputGainNode.gain.value=e)},this.setOutputGain=e=>{this.outputGainNode&&(this.outputGainNode.gain.value=e)},this.getModelType=()=>this.configurator.getModelType(),this.getOnnx=async()=>this.configurator.export2onnx(),this.mergeModel=async e=>this.configurator.mergeModel(e),this.updateModelDefault=async()=>this.configurator.updateModelDefault(),this.updateModelInfo=async(e,t,i)=>this.configurator.updateModelInfo(e,t,i),this.updateServerSettings=(e,t)=>this.configurator.updateSettings(e,t),this.uploadFile=(e,t,i)=>this.configurator.uploadFile(e,t,i),this.uploadFile2=(e,t,i)=>this.configurator.uploadFile2(e,t,i),this.concatUploadedFile=(e,t)=>this.configurator.concatUploadedFile(e,t),this.loadModel=(e,t,i)=>this.configurator.loadModel(e,t,i),this.uploadAssets=e=>this.configurator.uploadAssets(e),this.configureWorklet=e=>{this.vcInNode.configure(e),this.vcOutNode.configure(e)},this.startOutputRecording=()=>{this.vcOutNode.startOutputRecording()},this.stopOutputRecording=()=>this.vcOutNode.stopOutputRecording(),this.trancateBuffer=()=>{this.vcOutNode.trancateBuffer()},this.updateWorkletNodeSetting=e=>{this.vcInNode.updateSetting(e),this.vcOutNode.updateSetting(e)},this.getClientSettings=()=>this.vcInNode.getSettings(),this.getServerSettings=()=>this.configurator.getSettings(),this.getPerformance=()=>this.configurator.getPerformance(),this.getSocketId=()=>this.vcInNode.getSocketId(),this.sem.enqueue(0),this.configurator=new Ze,this.ctx=e,this.vfEnable=t,this.promiseForInitialize=new Promise((async e=>{const t=URL.createObjectURL(new Blob(['(()=>{\"use strict\";class e extends AudioWorkletProcessor{constructor(){super(),this.BLOCK_SIZE=128,this.initialized=!1,this.volume=0,this.numTrancateTreshold=150,this.isRecording=!1,this.playBuffer=[],this.calcVol=(e,t)=>{const s=e.reduce(((e,t)=>e+t*t),0),r=Math.sqrt(s/e.length);return Math.max(r,.95*t)},this.trancateBuffer=()=>{for(console.log(\"[worklet] Buffer truncated\");this.playBuffer.length>2;)this.playBuffer.shift()},this.pushData=e=>{const t={responseType:\"inputData\",inputData:e};this.port.postMessage(t)},this.initialized=!0,this.port.onmessage=this.handleMessage.bind(this)}handleMessage(e){const t=e.data;if(\"config\"===t.requestType)return this.numTrancateTreshold=t.numTrancateTreshold,void console.log(\"[worklet] worklet configured\",t);if(\"start\"===t.requestType){if(this.isRecording)return void console.warn(\"[worklet] recoring is already started\");this.isRecording=!0;const e={responseType:\"start_ok\"};return void this.port.postMessage(e)}if(\"stop\"===t.requestType){if(!this.isRecording)return void console.warn(\"[worklet] recoring is not started\");this.isRecording=!1;const e={responseType:\"stop_ok\"};return void this.port.postMessage(e)}if(\"trancateBuffer\"===t.requestType)return void this.trancateBuffer();this.playBuffer.length>this.numTrancateTreshold&&this.trancateBuffer();const s=t.voice,r=s.length/this.BLOCK_SIZE;for(let e=0;e0&&e[0].length>0&&this.pushData(e[0][0]),0===this.playBuffer.length)return!0;let r=this.playBuffer.shift();if(r){this.volume=this.calcVol(r,this.volume);const e={responseType:\"volume\",volume:this.volume};this.port.postMessage(e),t[0][0].set(r),2==t[0].length&&t[0][1].set(r)}return!0}}registerProcessor(\"voice-changer-worklet-processor\",e)})();'],{type:\"text/javascript\"}));try{this.vcInNode=new We(this.ctx,i)}catch(e){await this.ctx.audioWorklet.addModule(t),this.vcInNode=new We(this.ctx,i)}const n=new AudioContext({sampleRate:48e3});console.log(\"audio out:\",n);try{this.vcOutNode=new We(n,i)}catch(e){await n.audioWorklet.addModule(t),this.vcOutNode=new We(n,i)}if(this.currentMediaStreamAudioDestinationNode=n.createMediaStreamDestination(),this.outputGainNode=n.createGain(),this.outputGainNode.gain.value=this.setting.outputGain,this.vcOutNode.connect(this.outputGainNode),this.outputGainNode.connect(this.currentMediaStreamAudioDestinationNode),this.vfEnable){this.vf=await qe.VoiceFocusDeviceTransformer.create({variant:\"c20\"});const e=Ke(this.ctx);this.currentDevice=await this.vf.createTransformDevice(e)||null}e()}))}get stream(){return this.currentMediaStreamAudioDestinationNode.stream}get isVoiceChanging(){return this._isVoiceChanging}}var et=__nested_webpack_require_1096430__(8156),tt=__nested_webpack_require_1096430__(9483),it=__nested_webpack_require_1096430__.n(tt);const nt=e=>{const t=e.clientType||\"default\";it().config({driver:it().INDEXEDDB,name:g,version:1,storeName:`${v}`,description:\"appStorage\"});const i=(0,et.useMemo)((()=>async(e,i)=>{const n=`${t}_${e}`;await it().setItem(n,i)}),[e.clientType]);return{dummy:\"\",setItem:i,getItem:(0,et.useMemo)((()=>async e=>{const i=`${t}_${e}`;return await it().getItem(i)}),[e.clientType]),removeItem:(0,et.useMemo)((()=>async e=>{const i=`${t}_${e}`;return console.log(\"remove key:\",i),await it().removeItem(i)}),[e.clientType]),removeDB:(0,et.useMemo)((()=>async()=>{const e=await it().keys();for(const t of e)console.log(\"remove key:\",t),await it().removeItem(t)}),[e.clientType])}},rt={iconFile:\"iconFile\"},st={mmvcv13Config:\"mmvcv13Config\",mmvcv13Model:\"mmvcv13Model\",mmvcv15Config:\"mmvcv15Config\",mmvcv15Model:\"mmvcv15Model\",mmvcv15Correspondence:\"mmvcv15Correspondence\",soVitsSvc40Config:\"soVitsSvc40Config\",soVitsSvc40Model:\"soVitsSvc40Model\",soVitsSvc40Cluster:\"soVitsSvc40Cluster\",rvcModel:\"rvcModel\",rvcIndex:\"rvcIndex\",ddspSvcModel:\"ddspSvcModel\",ddspSvcModelConfig:\"ddspSvcModelConfig\",ddspSvcDiffusion:\"ddspSvcDiffusion\",ddspSvcDiffusionConfig:\"ddspSvcDiffusionConfig\",diffusionSVCModel:\"diffusionSVCModel\"},ot=e=>{const[t,i]=(0,et.useState)(d),n=(0,et.useMemo)((()=>async n=>{if(e.voiceChangerClient)for(let r=0;rasync(t,i,n=\"\")=>{if(!e.voiceChangerClient)return;const r=await e.voiceChangerClient.uploadFile2(n,t,i),s=await e.voiceChangerClient.concatUploadedFile(n+t.name,r);console.log(\"uploaded\",r,s)}),[e.voiceChangerClient]),u=(0,et.useMemo)((()=>async t=>{if(!e.voiceChangerClient)return;if(s(0),a(!0),0==t.isSampleMode){const e=1/t.files.length;for(let i=0;i{s(t*e+n)}),t.files[i].dir)}}const i={...t,files:t.files.map((e=>({name:e.file.name,kind:e.kind,dir:e.dir})))},n=e.voiceChangerClient.loadModel(0,!1,JSON.stringify(i));await n,s(0),a(!1),p()}),[e.voiceChangerClient]),h=(0,et.useMemo)((()=>async(t,i,n)=>{if(!e.voiceChangerClient)return;await l(n,((e,t)=>{console.log(e,t)}));const r={slot:t,name:i,file:n.name};await e.voiceChangerClient.uploadAssets(JSON.stringify(r)),p()}),[e.voiceChangerClient]),p=(0,et.useMemo)((()=>async()=>{if(!e.voiceChangerClient)return;const t=await e.voiceChangerClient.getServerSettings();i(t)}),[e.voiceChangerClient]);return{serverSetting:t,updateServerSettings:n,reloadServerInfo:p,uploadModel:u,uploadProgress:r,isUploading:o,getOnnx:async()=>e.voiceChangerClient.getOnnx(),mergeModel:async t=>{const n=await e.voiceChangerClient.mergeModel(t);return i(n),n},updateModelDefault:async()=>{const t=await e.voiceChangerClient.updateModelDefault();return i(t),t},updateModelInfo:async(t,n,r)=>{const s=await e.voiceChangerClient.updateModelInfo(t,n,r);return i(s),s},uploadAssets:h}},at={responseTime:0,preprocessTime:0,mainprocessTime:0,postprocessTime:0},ct=e=>{const[t,i]=(0,et.useState)(!1),[n,r]=(0,et.useState)(m),s=(0,et.useRef)(null),[o,a]=(0,et.useState)(s.current),c=(0,et.useRef)(),d=(0,et.useMemo)((()=>new Promise((e=>{c.current=e}))),[]),l=(e=>{const[t,i]=(0,et.useState)(e.voiceChangerClientSetting);(0,et.useEffect)((()=>{(async()=>{if(e.voiceChangerClient)for(let n in e.voiceChangerClientSetting)if(t[n]!=e.voiceChangerClientSetting[n]){i(e.voiceChangerClientSetting),await e.voiceChangerClient.updateClientSetting(e.voiceChangerClientSetting);break}})()}),[e.voiceChangerClient,e.voiceChangerClientSetting]);return{setServerUrl:(0,et.useMemo)((()=>t=>{e.voiceChangerClient&&e.voiceChangerClient.setServerUrl(t,!0)}),[e.voiceChangerClient]),start:(0,et.useMemo)((()=>async()=>{e.voiceChangerClient&&await e.voiceChangerClient.start()}),[e.voiceChangerClient]),stop:(0,et.useMemo)((()=>async()=>{e.voiceChangerClient&&await e.voiceChangerClient.stop()}),[e.voiceChangerClient]),reloadClientSetting:(0,et.useMemo)((()=>async()=>{e.voiceChangerClient&&await e.voiceChangerClient.getClientSettings()}),[e.voiceChangerClient])}})({voiceChangerClient:o,voiceChangerClientSetting:n.voiceChangerClientSetting}),u=(e=>{const[t,i]=(0,et.useState)(e.workletNodeSetting);return(0,et.useEffect)((()=>{if(e.voiceChangerClient)for(let n in e.workletNodeSetting)if(t[n]!=e.workletNodeSetting[n]){i(e.workletNodeSetting),e.voiceChangerClient.updateWorkletNodeSetting(e.workletNodeSetting);break}}),[e.voiceChangerClient,e.workletNodeSetting]),{startOutputRecording:(0,et.useMemo)((()=>()=>{e.voiceChangerClient&&e.voiceChangerClient.startOutputRecording()}),[e.voiceChangerClient]),stopOutputRecording:(0,et.useMemo)((()=>async()=>e.voiceChangerClient?e.voiceChangerClient.stopOutputRecording():new Float32Array),[e.voiceChangerClient]),trancateBuffer:(0,et.useMemo)((()=>async()=>{e.voiceChangerClient&&e.voiceChangerClient.trancateBuffer()}),[e.voiceChangerClient])}})({voiceChangerClient:o,workletNodeSetting:n.workletNodeSetting});(e=>{const[t,i]=(0,et.useState)(e.workletSetting);(0,et.useEffect)((()=>{e.voiceChangerClient&&e.voiceChangerClient.configureWorklet(t)}),[e.voiceChangerClient,e.workletSetting])})({voiceChangerClient:o,workletSetting:n.workletSetting});const h=ot({voiceChangerClient:o}),p=nt({clientType:null}),[f,g]=(0,et.useState)(0),[v,S]=(0,et.useState)(at),[b,y]=(0,et.useState)(0),[w,C]=(0,et.useState)(0),k=(0,et.useMemo)((()=>s.current?async()=>{if(s.current){const e=await s.current.getPerformance(),t=e[0],i=e[1],n=e[2],r=e[3];S({responseTime:t,preprocessTime:i,mainprocessTime:n,postprocessTime:r})}else S({responseTime:0,preprocessTime:0,mainprocessTime:0,postprocessTime:0})}:null),[s.current]),E=(0,et.useRef)(0),{setItem:I,getItem:T}=nt({clientType:null}),A=e=>{const t={...e};t.voiceChangerClientSetting={...t.voiceChangerClientSetting},\"string\"!=typeof t.voiceChangerClientSetting.audioInput&&(t.voiceChangerClientSetting.audioInput=\"none\"),I(\"clientSetting\",t),r(e)};(0,et.useEffect)((()=>{o&&(async()=>{const e=await T(\"clientSetting\");e&&(r(e),h.reloadServerInfo())})()}),[o]),(0,et.useEffect)((()=>{(async()=>{if(!e.audioContext)return;const t=new Ye(e.audioContext,!0,{notifySendBufferingTime:e=>{g(e)},notifyResponseTime:(e,t)=>{const i=e,n=t?Math.ceil(1e3*t[0]):0,r=t?Math.ceil(1e3*t[1]):0,s=t?Math.ceil(1e3*t[2]):0;S({responseTime:i,preprocessTime:n,mainprocessTime:r,postprocessTime:s})},notifyException:e=>{e.length>0&&(console.log(`error:${e}`),E.current+=1,C(E.current))},notifyVolume:e=>{y(e)}});await t.isInitialized(),s.current=t,a(s.current),console.log(\"[useClient] client initialized\"),c.current(),i(!0)})()}),[e.audioContext]);const M=(0,et.useMemo)((()=>async()=>{await d,await l.reloadClientSetting(),await h.reloadServerInfo()}),[l.reloadClientSetting,h.reloadServerInfo]);return{initialized:t,setting:n,setVoiceChangerClientSetting:e=>{n.voiceChangerClientSetting=e,console.log(\"setting.voiceChangerClientSetting\",n.voiceChangerClientSetting),A({...n})},setServerUrl:l.setServerUrl,start:l.start,stop:l.stop,reloadClientSetting:l.reloadClientSetting,setWorkletNodeSetting:e=>{n.workletNodeSetting=e,console.log(\"setting.workletNodeSetting\",n.workletNodeSetting),A({...n})},startOutputRecording:u.startOutputRecording,stopOutputRecording:u.stopOutputRecording,trancateBuffer:u.trancateBuffer,setWorkletSetting:e=>{n.workletSetting=e,console.log(\"setting.workletSetting\",n.workletSetting),A({...n})},serverSetting:h,indexedDBState:p,bufferingTime:f,volume:b,performance:v,updatePerformance:k,getInfo:M,clearSetting:async()=>{},setAudioOutputElementId:e=>{if(!s.current)return void console.warn(\"[voiceChangerClient] is not ready for set audio output.\");const t=document.getElementById(e);t.paused&&(t.srcObject=s.current.stream,t.play())},ioErrorCount:w,resetIoErrorCount:()=>{E.current=0,C(E.current)}}}})(),__nested_webpack_exports__})()));\n\n//# sourceURL=webpack://demo/./node_modules/@dannadori/voice-changer-client-js/dist/index.js?"); /***/ }), /***/ "./src/000_index.tsx": /*!***************************!*\ !*** ./src/000_index.tsx ***! \***************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("var __filename = \"/index.js\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-dom/client */ \"./node_modules/react-dom/client.js\");\n/* harmony import */ var _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @fortawesome/fontawesome-svg-core */ \"./node_modules/@fortawesome/fontawesome-svg-core/index.mjs\");\n/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @fortawesome/free-solid-svg-icons */ \"./node_modules/@fortawesome/free-solid-svg-icons/index.mjs\");\n/* harmony import */ var _fortawesome_free_regular_svg_icons__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @fortawesome/free-regular-svg-icons */ \"./node_modules/@fortawesome/free-regular-svg-icons/index.mjs\");\n/* harmony import */ var _fortawesome_free_brands_svg_icons__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @fortawesome/free-brands-svg-icons */ \"./node_modules/@fortawesome/free-brands-svg-icons/index.mjs\");\n/* harmony import */ var _css_App_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./css/App.css */ \"./src/css/App.css\");\n/* harmony import */ var _001_provider_900_ErrorBoundary__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./001_provider/900_ErrorBoundary */ \"./src/001_provider/900_ErrorBoundary.tsx\");\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./001_provider/001_AppRootProvider */ \"./src/001_provider/001_AppRootProvider.tsx\");\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @dannadori/voice-changer-client-js */ \"./node_modules/@dannadori/voice-changer-client-js/dist/index.js\");\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _components_demo_010_Demo__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./components/demo/010_Demo */ \"./src/components/demo/010_Demo.tsx\");\n/* harmony import */ var _hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./hooks/useMessageBuilder */ \"./src/hooks/useMessageBuilder.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n_fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_5__.library.add(_fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_13__.fas, _fortawesome_free_regular_svg_icons__WEBPACK_IMPORTED_MODULE_14__.far, _fortawesome_free_brands_svg_icons__WEBPACK_IMPORTED_MODULE_15__.fab);\nvar container = document.getElementById(\"app\");\nvar root = (0,react_dom_client__WEBPACK_IMPORTED_MODULE_4__.createRoot)(container);\nvar App = function App() {\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_9__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var front = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n if (appGuiSettingState.appGuiSetting.type == \"demo\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(_components_demo_010_Demo__WEBPACK_IMPORTED_MODULE_11__.Demo, null);\n } else {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(react__WEBPACK_IMPORTED_MODULE_3__.Fragment, null, \"unknown gui type. \", appGuiSettingState.appGuiSetting.type);\n }\n }, [appGuiSettingState.appGuiSetting.type]);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(react__WEBPACK_IMPORTED_MODULE_3__.Fragment, null, front);\n};\nvar AppStateWrapper = function AppStateWrapper() {\n var _useAppRoot2 = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_9__.useAppRoot)(),\n appGuiSettingState = _useAppRoot2.appGuiSettingState,\n getGUISetting = _useAppRoot2.getGUISetting;\n var messageBuilderState = (0,_hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_12__.useMessageBuilder)();\n // エラーメッセージ登録\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n messageBuilderState.setMessage(__filename, \"Problem\", {\n \"ja\": \"ちょっと問題が起きたみたいです。\",\n \"en\": \"Looks like there's a bit of a problem.\"\n });\n messageBuilderState.setMessage(__filename, \"Problem-sub1\", {\n \"ja\": \"このアプリで管理している情報をクリアすると回復する場合があります。\",\n \"en\": \"\"\n });\n messageBuilderState.setMessage(__filename, \"Problem-sub2\", {\n \"ja\": \"下記のボタンを押して情報をクリアします。\",\n \"en\": \"If you clear the information being managed by this app, it may be recoverable.\"\n });\n messageBuilderState.setMessage(__filename, \"Problem-action1\", {\n \"ja\": \"アプリを初期化\",\n \"en\": \"Initialize\"\n });\n messageBuilderState.setMessage(__filename, \"Problem-action2\", {\n \"ja\": \"初期化せずリロード\",\n \"en\": \"Reload without initialize\"\n });\n }, []);\n\n // エラーバウンダリー設定\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState, 2),\n error = _useState2[0],\n setError = _useState2[1];\n var _useIndexedDB = (0,_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_10__.useIndexedDB)({\n clientType: null\n }),\n removeDB = _useIndexedDB.removeDB;\n var errorComponent = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n var errorName = (error === null || error === void 0 ? void 0 : error.error.name) || \"no error name\";\n var errorMessage = (error === null || error === void 0 ? void 0 : error.error.message) || \"no error message\";\n var errorInfos = ((error === null || error === void 0 ? void 0 : error.errorInfo.componentStack) || \"no error stack\").split(\"\\n\");\n var onClearCacheClicked = /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return removeDB();\n case 2:\n location.reload();\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onClearCacheClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n var onReloadClicked = function onReloadClicked() {\n location.reload();\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"div\", {\n className: \"error-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"div\", {\n className: \"top-error-message\"\n }, messageBuilderState.getMessage(__filename, \"Problem\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"div\", {\n className: \"top-error-description\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"p\", null, \" \", messageBuilderState.getMessage(__filename, \"Problem-sub1\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"p\", null, \" \", messageBuilderState.getMessage(__filename, \"Problem-sub2\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"p\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"button\", {\n onClick: onClearCacheClicked\n }, messageBuilderState.getMessage(__filename, \"Problem-action1\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"p\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"button\", {\n onClick: onReloadClicked\n }, messageBuilderState.getMessage(__filename, \"Problem-action2\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"div\", {\n className: \"error-detail\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"div\", {\n className: \"error-name\"\n }, errorName), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"div\", {\n className: \"error-message\"\n }, errorMessage), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"div\", {\n className: \"error-info-container\"\n }, errorInfos.map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"div\", {\n className: \"error-info-line\",\n key: x\n }, x);\n }))));\n }, [error]);\n var updateError = function updateError(error, errorInfo) {\n console.log(\"error compo\", error, errorInfo);\n setError({\n error: error,\n errorInfo: errorInfo\n });\n };\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n var loadDefaultModelType = /*#__PURE__*/function () {\n var _ref2 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee2() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n getGUISetting();\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function loadDefaultModelType() {\n return _ref2.apply(this, arguments);\n };\n }();\n loadDefaultModelType();\n }, []);\n if (!appGuiSettingState.guiSettingLoaded) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(react__WEBPACK_IMPORTED_MODULE_3__.Fragment, null, \"loading...\");\n } else {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(_001_provider_900_ErrorBoundary__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n fallback: errorComponent,\n onError: updateError\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_8__.AppStateProvider, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(App, null)));\n }\n};\nroot.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_9__.AppRootProvider, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(AppStateWrapper, null)));\n\n//# sourceURL=webpack://demo/./src/000_index.tsx?"); /***/ }), /***/ "./src/001_globalHooks/001_useAppGuiSetting.ts": /*!*****************************************************!*\ !*** ./src/001_globalHooks/001_useAppGuiSetting.ts ***! \*****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useAppGuiSetting: () => (/* binding */ useAppGuiSetting)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\nvar InitialAppGuiDemoSetting = {\n type: \"demo\",\n front: {\n \"modelSlotControl\": []\n }\n};\nvar useAppGuiSetting = function useAppGuiSetting() {\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState, 2),\n guiSettingLoaded = _useState2[0],\n setGuiSettingLoaded = _useState2[1];\n var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(InitialAppGuiDemoSetting),\n _useState4 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState3, 2),\n appGuiSetting = _useState4[0],\n setAppGuiSetting = _useState4[1];\n var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(\"\"),\n _useState6 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState5, 2),\n version = _useState6[0],\n setVersion = _useState6[1];\n var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(\"\"),\n _useState8 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState7, 2),\n edition = _useState8[0],\n setEdition = _useState8[1];\n var getAppGuiSetting = /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(url) {\n var res, appSetting;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return fetch(\"\".concat(url), {\n method: \"GET\"\n });\n case 2:\n res = _context.sent;\n _context.next = 5;\n return res.json();\n case 5:\n appSetting = _context.sent;\n setAppGuiSetting(appSetting);\n setGuiSettingLoaded(true);\n case 8:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function getAppGuiSetting(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n var clearAppGuiSetting = function clearAppGuiSetting() {\n setAppGuiSetting(InitialAppGuiDemoSetting);\n setGuiSettingLoaded(false);\n };\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n var getVersionInfo = /*#__PURE__*/function () {\n var _ref2 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee2() {\n var res, version;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return fetch(\"/assets/gui_settings/version.txt\", {\n method: \"GET\"\n });\n case 2:\n res = _context2.sent;\n _context2.next = 5;\n return res.text();\n case 5:\n version = _context2.sent;\n setVersion(version);\n case 7:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function getVersionInfo() {\n return _ref2.apply(this, arguments);\n };\n }();\n getVersionInfo();\n }, []);\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n var getVersionInfo = /*#__PURE__*/function () {\n var _ref3 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee3() {\n var res, edition;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return fetch(\"/assets/gui_settings/edition.txt\", {\n method: \"GET\"\n });\n case 2:\n res = _context3.sent;\n _context3.next = 5;\n return res.text();\n case 5:\n edition = _context3.sent;\n setEdition(edition);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return function getVersionInfo() {\n return _ref3.apply(this, arguments);\n };\n }();\n getVersionInfo();\n }, []);\n return {\n appGuiSetting: appGuiSetting,\n guiSettingLoaded: guiSettingLoaded,\n version: version,\n edition: edition,\n getAppGuiSetting: getAppGuiSetting,\n clearAppGuiSetting: clearAppGuiSetting\n };\n};\n\n//# sourceURL=webpack://demo/./src/001_globalHooks/001_useAppGuiSetting.ts?"); /***/ }), /***/ "./src/001_globalHooks/001_useAudioConfig.ts": /*!***************************************************!*\ !*** ./src/001_globalHooks/001_useAudioConfig.ts ***! \***************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useAudioConfig: () => (/* binding */ useAudioConfig)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n\n\nvar useAudioConfig = function useAudioConfig() {\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_useState, 2),\n audioContext = _useState2[0],\n setAudioContext = _useState2[1];\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n var createAudioContext = function createAudioContext() {\n var url = new URL(window.location.href);\n var params = url.searchParams;\n var sampleRate = params.get('sample_rate') || null;\n var ctx;\n if (sampleRate) {\n if (sampleRate == \"default\") {\n console.log(\"Sample rate: default\");\n ctx = new AudioContext();\n } else {\n console.log(\"Sample rate: \".concat(sampleRate));\n ctx = new AudioContext({\n sampleRate: Number(sampleRate)\n });\n }\n } else {\n console.log(\"Sample rate: default(48000)\");\n ctx = new AudioContext({\n sampleRate: 48000\n });\n }\n console.log(ctx);\n setAudioContext(ctx);\n document.removeEventListener('touchstart', createAudioContext);\n document.removeEventListener('mousedown', createAudioContext);\n };\n document.addEventListener('touchstart', createAudioContext, false);\n document.addEventListener('mousedown', createAudioContext, false);\n }, []);\n var ret = {\n audioContext: audioContext\n };\n return ret;\n};\n\n//# sourceURL=webpack://demo/./src/001_globalHooks/001_useAudioConfig.ts?"); /***/ }), /***/ "./src/001_globalHooks/001_useVCClient.ts": /*!************************************************!*\ !*** ./src/001_globalHooks/001_useVCClient.ts ***! \************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useVCClient: () => (/* binding */ useVCClient)\n/* harmony export */ });\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dannadori/voice-changer-client-js */ \"./node_modules/@dannadori/voice-changer-client-js/dist/index.js\");\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_0__);\n\nvar useVCClient = function useVCClient(props) {\n var clientState = (0,_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_0__.useClient)({\n audioContext: props.audioContext\n });\n var ret = {\n clientState: clientState\n };\n return ret;\n};\n\n//# sourceURL=webpack://demo/./src/001_globalHooks/001_useVCClient.ts?"); /***/ }), /***/ "./src/001_provider/001_AppRootProvider.tsx": /*!**************************************************!*\ !*** ./src/001_provider/001_AppRootProvider.tsx ***! \**************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AppRootProvider: () => (/* binding */ AppRootProvider),\n/* harmony export */ useAppRoot: () => (/* binding */ useAppRoot)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _001_globalHooks_001_useAppGuiSetting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../001_globalHooks/001_useAppGuiSetting */ \"./src/001_globalHooks/001_useAppGuiSetting.ts\");\n/* harmony import */ var _001_globalHooks_001_useAudioConfig__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../001_globalHooks/001_useAudioConfig */ \"./src/001_globalHooks/001_useAudioConfig.ts\");\n\n\n\n\n\nvar AppRootContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext(null);\nvar useAppRoot = function useAppRoot() {\n var state = (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(AppRootContext);\n if (!state) {\n throw new Error(\"useAppState must be used within AppStateProvider\");\n }\n return state;\n};\nvar AppRootProvider = function AppRootProvider(_ref) {\n var children = _ref.children;\n var audioContextState = (0,_001_globalHooks_001_useAudioConfig__WEBPACK_IMPORTED_MODULE_4__.useAudioConfig)();\n var appGuiSettingState = (0,_001_globalHooks_001_useAppGuiSetting__WEBPACK_IMPORTED_MODULE_3__.useAppGuiSetting)();\n var getGUISetting = /*#__PURE__*/function () {\n var _ref2 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return appGuiSettingState.getAppGuiSetting(\"/assets/gui_settings/GUI.json\");\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function getGUISetting() {\n return _ref2.apply(this, arguments);\n };\n }();\n var providerValue = {\n audioContextState: audioContextState,\n appGuiSettingState: appGuiSettingState,\n getGUISetting: getGUISetting\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(AppRootContext.Provider, {\n value: providerValue\n }, children);\n};\n\n//# sourceURL=webpack://demo/./src/001_provider/001_AppRootProvider.tsx?"); /***/ }), /***/ "./src/001_provider/001_AppStateProvider.tsx": /*!***************************************************!*\ !*** ./src/001_provider/001_AppStateProvider.tsx ***! \***************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("var __filename = \"/index.js\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AppStateProvider: () => (/* binding */ AppStateProvider),\n/* harmony export */ useAppState: () => (/* binding */ useAppState)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _001_globalHooks_001_useVCClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../001_globalHooks/001_useVCClient */ \"./src/001_globalHooks/001_useVCClient.ts\");\n/* harmony import */ var _001_AppRootProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./001_AppRootProvider */ \"./src/001_provider/001_AppRootProvider.tsx\");\n/* harmony import */ var _hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../hooks/useMessageBuilder */ \"./src/hooks/useMessageBuilder.ts\");\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\n\n\nvar AppStateContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createContext(null);\nvar useAppState = function useAppState() {\n var state = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(AppStateContext);\n if (!state) {\n throw new Error(\"useAppState must be used within AppStateProvider\");\n }\n return state;\n};\nvar AppStateProvider = function AppStateProvider(_ref) {\n var children = _ref.children;\n var appRoot = (0,_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_3__.useAppRoot)();\n var clientState = (0,_001_globalHooks_001_useVCClient__WEBPACK_IMPORTED_MODULE_2__.useVCClient)({\n audioContext: appRoot.audioContextState.audioContext\n });\n var messageBuilderState = (0,_hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_4__.useMessageBuilder)();\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n messageBuilderState.setMessage(__filename, \"ioError\", {\n \"ja\": \"エラーが頻発しています。対象としているフレームワークのモデルがロードされているか確認してください。\",\n \"en\": \"Frequent errors occur. Please check if the model of the framework being targeted is loaded.\"\n });\n }, []);\n var initializedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(false);\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n if (clientState.clientState.initialized) {\n initializedRef.current = true;\n clientState.clientState.getInfo();\n // clientState.clientState.setVoiceChangerClientSetting({\n // ...clientState.clientState.setting.voiceChangerClientSetting\n // })\n }\n }, [clientState.clientState.initialized]);\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n if (clientState.clientState.ioErrorCount > 100) {\n alert(messageBuilderState.getMessage(__filename, \"ioError\"));\n clientState.clientState.resetIoErrorCount();\n }\n }, [clientState.clientState.ioErrorCount]);\n var providerValue = _objectSpread(_objectSpread({\n audioContext: appRoot.audioContextState.audioContext\n }, clientState.clientState), {}, {\n initializedRef: initializedRef\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(AppStateContext.Provider, {\n value: providerValue\n }, children);\n};\n\n//# sourceURL=webpack://demo/./src/001_provider/001_AppStateProvider.tsx?"); /***/ }), /***/ "./src/001_provider/900_ErrorBoundary.tsx": /*!************************************************!*\ !*** ./src/001_provider/900_ErrorBoundary.tsx ***! \************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/esm/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/esm/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/esm/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_6__);\n\n\n\n\n\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0,_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nvar ErrorBoundary = /*#__PURE__*/function (_React$Component) {\n (0,_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(ErrorBoundary, _React$Component);\n var _super = _createSuper(ErrorBoundary);\n function ErrorBoundary(props) {\n var _this;\n (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, ErrorBoundary);\n _this = _super.call(this, props);\n _this.state = {\n hasError: false\n };\n _this.eventHandler = _this.updateError.bind((0,_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_this));\n return _this;\n }\n (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(ErrorBoundary, [{\n key: \"componentDidCatch\",\n value: function componentDidCatch(error, errorInfo) {\n // For logging\n console.warn(\"React Error Boundary Catch\", error, errorInfo);\n var onError = this.props.onError;\n if (onError) {\n onError(error, errorInfo);\n }\n }\n\n // 非同期例外対応\n }, {\n key: \"updateError\",\n value: function updateError() {\n this.setState({\n hasError: true\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n window.addEventListener('unhandledrejection', this.eventHandler);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('unhandledrejection', this.eventHandler);\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.state.hasError) {\n return this.props.fallback;\n }\n return this.props.children;\n }\n }], [{\n key: \"getDerivedStateFromError\",\n value: function getDerivedStateFromError(_error) {\n // console.warn(\"React Error Boundary Catch\", error)\n return {\n hasError: true\n };\n }\n }]);\n return ErrorBoundary;\n}((react__WEBPACK_IMPORTED_MODULE_6___default().Component));\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ErrorBoundary);\n\n//# sourceURL=webpack://demo/./src/001_provider/900_ErrorBoundary.tsx?"); /***/ }), /***/ "./src/components/demo/001_GuiStateProvider.tsx": /*!******************************************************!*\ !*** ./src/components/demo/001_GuiStateProvider.tsx ***! \******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GuiStateProvider: () => (/* binding */ GuiStateProvider),\n/* harmony export */ OpenAdvancedSettingCheckbox: () => (/* binding */ OpenAdvancedSettingCheckbox),\n/* harmony export */ OpenAdvancedSettingDialogCheckbox: () => (/* binding */ OpenAdvancedSettingDialogCheckbox),\n/* harmony export */ OpenConverterSettingCheckbox: () => (/* binding */ OpenConverterSettingCheckbox),\n/* harmony export */ OpenDeviceSettingCheckbox: () => (/* binding */ OpenDeviceSettingCheckbox),\n/* harmony export */ OpenGetClientInformationDialogCheckbox: () => (/* binding */ OpenGetClientInformationDialogCheckbox),\n/* harmony export */ OpenGetServerInformationDialogCheckbox: () => (/* binding */ OpenGetServerInformationDialogCheckbox),\n/* harmony export */ OpenLabCheckbox: () => (/* binding */ OpenLabCheckbox),\n/* harmony export */ OpenLicenseDialogCheckbox: () => (/* binding */ OpenLicenseDialogCheckbox),\n/* harmony export */ OpenMergeLabDialogCheckbox: () => (/* binding */ OpenMergeLabDialogCheckbox),\n/* harmony export */ OpenModelSettingCheckbox: () => (/* binding */ OpenModelSettingCheckbox),\n/* harmony export */ OpenModelSlotManagerDialogCheckbox: () => (/* binding */ OpenModelSlotManagerDialogCheckbox),\n/* harmony export */ OpenQualityControlCheckbox: () => (/* binding */ OpenQualityControlCheckbox),\n/* harmony export */ OpenServerControlCheckbox: () => (/* binding */ OpenServerControlCheckbox),\n/* harmony export */ OpenShowLicenseDialogCheckbox: () => (/* binding */ OpenShowLicenseDialogCheckbox),\n/* harmony export */ OpenSpeakerSettingCheckbox: () => (/* binding */ OpenSpeakerSettingCheckbox),\n/* harmony export */ OpenStartingNoticeDialogCheckbox: () => (/* binding */ OpenStartingNoticeDialogCheckbox),\n/* harmony export */ OpenTextInputDialogCheckbox: () => (/* binding */ OpenTextInputDialogCheckbox),\n/* harmony export */ OpenWaitingDialogCheckbox: () => (/* binding */ OpenWaitingDialogCheckbox),\n/* harmony export */ useGuiState: () => (/* binding */ useGuiState)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../001_provider/001_AppRootProvider */ \"./src/001_provider/001_AppRootProvider.tsx\");\n/* harmony import */ var _hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../hooks/useStateControlCheckbox */ \"./src/hooks/useStateControlCheckbox.tsx\");\n\n\n\n\n\n\nvar OpenServerControlCheckbox = \"open-server-control-checkbox\";\nvar OpenModelSettingCheckbox = \"open-model-setting-checkbox\";\nvar OpenDeviceSettingCheckbox = \"open-device-setting-checkbox\";\nvar OpenQualityControlCheckbox = \"open-quality-control-checkbox\";\nvar OpenSpeakerSettingCheckbox = \"open-speaker-setting-checkbox\";\nvar OpenConverterSettingCheckbox = \"open-converter-setting-checkbox\";\nvar OpenAdvancedSettingCheckbox = \"open-advanced-setting-checkbox\";\nvar OpenLabCheckbox = \"open-lab-checkbox\";\nvar OpenLicenseDialogCheckbox = \"open-license-dialog-checkbox\";\nvar OpenWaitingDialogCheckbox = \"open-waiting-dialog-checkbox\";\nvar OpenStartingNoticeDialogCheckbox = \"open-starting-notice-dialog-checkbox\";\nvar OpenModelSlotManagerDialogCheckbox = \"open-model-slot-manager-dialog-checkbox\";\nvar OpenMergeLabDialogCheckbox = \"open-merge-lab-dialog-checkbox\";\nvar OpenAdvancedSettingDialogCheckbox = \"open-advanced-setting-dialog-checkbox\";\nvar OpenGetServerInformationDialogCheckbox = \"open-get-server-information-dialog-checkbox\";\nvar OpenGetClientInformationDialogCheckbox = \"open-get-client-information-dialog-checkbox\";\nvar OpenTextInputDialogCheckbox = \"open-text-input-dialog-checkbox\";\nvar OpenShowLicenseDialogCheckbox = \"open-show-license-dialog-checkbox\";\nvar GuiStateContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createContext(null);\nvar useGuiState = function useGuiState() {\n var state = (0,react__WEBPACK_IMPORTED_MODULE_3__.useContext)(GuiStateContext);\n if (!state) {\n throw new Error(\"useGuiState must be used within GuiStateProvider\");\n }\n return state;\n};\nvar GuiStateProvider = function GuiStateProvider(_ref) {\n var children = _ref.children;\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_4__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState, 2),\n isConverting = _useState2[0],\n setIsConverting = _useState2[1];\n var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),\n _useState4 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState3, 2),\n isAnalyzing = _useState4[0],\n setIsAnalyzing = _useState4[1];\n var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(0),\n _useState6 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState5, 2),\n modelSlotNum = _useState6[0],\n setModelSlotNum = _useState6[1];\n var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),\n _useState8 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState7, 2),\n showPyTorchModelUpload = _useState8[0],\n setShowPyTorchModelUpload = _useState8[1];\n var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]),\n _useState10 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState9, 2),\n inputAudioDeviceInfo = _useState10[0],\n setInputAudioDeviceInfo = _useState10[1];\n var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]),\n _useState12 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState11, 2),\n outputAudioDeviceInfo = _useState12[0],\n setOutputAudioDeviceInfo = _useState12[1];\n var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(\"none\"),\n _useState14 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState13, 2),\n audioInputForGUI = _useState14[0],\n setAudioInputForGUI = _useState14[1];\n var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(\"none\"),\n _useState16 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState15, 2),\n audioOutputForGUI = _useState16[0],\n setAudioOutputForGUI = _useState16[1];\n var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),\n _useState18 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState17, 2),\n fileInputEchoback = _useState18[0],\n setFileInputEchoback = _useState18[1]; //最初のmuteが有効になるように。undefined <-- ??? falseしておけばよさそう。undefinedだとwarningがでる。\n var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(\"default\"),\n _useState20 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState19, 2),\n audioOutputForAnalyzer = _useState20[0],\n setAudioOutputForAnalyzer = _useState20[1];\n var _useState21 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(null),\n _useState22 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState21, 2),\n textInputResolve = _useState22[0],\n setTextInputResolve = _useState22[1];\n var reloadDeviceInfo = /*#__PURE__*/function () {\n var _ref2 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee() {\n var ms, mediaDeviceInfos, audioInputs, audioOutputs;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return navigator.mediaDevices.getUserMedia({\n video: false,\n audio: true\n });\n case 3:\n ms = _context.sent;\n ms.getTracks().forEach(function (x) {\n x.stop();\n });\n _context.next = 10;\n break;\n case 7:\n _context.prev = 7;\n _context.t0 = _context[\"catch\"](0);\n console.warn(\"Enumerate device error::\", _context.t0);\n case 10:\n _context.next = 12;\n return navigator.mediaDevices.enumerateDevices();\n case 12:\n mediaDeviceInfos = _context.sent;\n audioInputs = mediaDeviceInfos.filter(function (x) {\n return x.kind == \"audioinput\";\n });\n audioInputs.push({\n deviceId: \"none\",\n groupId: \"none\",\n kind: \"audioinput\",\n label: \"none\",\n toJSON: function toJSON() {}\n });\n audioInputs.push({\n deviceId: \"file\",\n groupId: \"file\",\n kind: \"audioinput\",\n label: \"file\",\n toJSON: function toJSON() {}\n });\n audioOutputs = mediaDeviceInfos.filter(function (x) {\n return x.kind == \"audiooutput\";\n });\n audioOutputs.push({\n deviceId: \"none\",\n groupId: \"none\",\n kind: \"audiooutput\",\n label: \"none\",\n toJSON: function toJSON() {}\n });\n // audioOutputs.push({\n // deviceId: \"record\",\n // groupId: \"record\",\n // kind: \"audiooutput\",\n // label: \"record\",\n // toJSON: () => { }\n // })\n return _context.abrupt(\"return\", [audioInputs, audioOutputs]);\n case 19:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[0, 7]]);\n }));\n return function reloadDeviceInfo() {\n return _ref2.apply(this, arguments);\n };\n }();\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n var audioInitialize = /*#__PURE__*/function () {\n var _ref3 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee2() {\n var audioInfo;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return reloadDeviceInfo();\n case 2:\n audioInfo = _context2.sent;\n setInputAudioDeviceInfo(audioInfo[0]);\n setOutputAudioDeviceInfo(audioInfo[1]);\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function audioInitialize() {\n return _ref3.apply(this, arguments);\n };\n }();\n audioInitialize();\n }, []);\n\n // (1) Controller Switch\n var openServerControlCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenServerControlCheckbox);\n var openModelSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenModelSettingCheckbox);\n var openDeviceSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenDeviceSettingCheckbox);\n var openQualityControlCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenQualityControlCheckbox);\n var openSpeakerSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenSpeakerSettingCheckbox);\n var openConverterSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenConverterSettingCheckbox);\n var openAdvancedSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenAdvancedSettingCheckbox);\n var openLabCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenLabCheckbox);\n var showWaitingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenWaitingDialogCheckbox);\n var showStartingNoticeCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenStartingNoticeDialogCheckbox);\n var showModelSlotManagerCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenModelSlotManagerDialogCheckbox);\n var showMergeLabCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenMergeLabDialogCheckbox);\n var showAdvancedSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenAdvancedSettingDialogCheckbox);\n var showGetServerInformationCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenGetServerInformationDialogCheckbox);\n var showGetClientInformationCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenGetClientInformationDialogCheckbox);\n var showTextInputCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenTextInputDialogCheckbox);\n var showLicenseCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenShowLicenseDialogCheckbox);\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n openServerControlCheckbox.updateState(true);\n openModelSettingCheckbox.updateState(false);\n openDeviceSettingCheckbox.updateState(true);\n openSpeakerSettingCheckbox.updateState(true);\n openConverterSettingCheckbox.updateState(true);\n openQualityControlCheckbox.updateState(false);\n openLabCheckbox.updateState(false);\n openAdvancedSettingCheckbox.updateState(false);\n showWaitingCheckbox.updateState(false);\n showStartingNoticeCheckbox.updateState(false);\n showModelSlotManagerCheckbox.updateState(false);\n showMergeLabCheckbox.updateState(false);\n showAdvancedSettingCheckbox.updateState(false);\n showGetServerInformationCheckbox.updateState(false);\n showGetClientInformationCheckbox.updateState(false);\n showTextInputCheckbox.updateState(false);\n showLicenseCheckbox.updateState(false);\n }, []);\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n var show = function show() {\n var _document$getElementB, _document$getElementB2;\n // const lang = window.navigator.language\n // const edition = appGuiSettingState.edition\n // console.log(\"appGuiSettingState.edition\", appGuiSettingState.edition, lang)\n // if ((edition == \"onnxdirectML-cuda\" || edition == \"\") && lang == \"ja\") {\n // return\n // }\n\n (_document$getElementB = document.getElementById(\"dialog\")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add(\"dialog-container-show\");\n showStartingNoticeCheckbox.updateState(true);\n (_document$getElementB2 = document.getElementById(\"dialog2\")) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.add(\"dialog-container-show\");\n };\n setTimeout(show);\n }, [appGuiSettingState.edition]);\n var providerValue = {\n stateControls: {\n openServerControlCheckbox: openServerControlCheckbox,\n openModelSettingCheckbox: openModelSettingCheckbox,\n openDeviceSettingCheckbox: openDeviceSettingCheckbox,\n openQualityControlCheckbox: openQualityControlCheckbox,\n openSpeakerSettingCheckbox: openSpeakerSettingCheckbox,\n openConverterSettingCheckbox: openConverterSettingCheckbox,\n openAdvancedSettingCheckbox: openAdvancedSettingCheckbox,\n openLabCheckbox: openLabCheckbox,\n showWaitingCheckbox: showWaitingCheckbox,\n showStartingNoticeCheckbox: showStartingNoticeCheckbox,\n showModelSlotManagerCheckbox: showModelSlotManagerCheckbox,\n showMergeLabCheckbox: showMergeLabCheckbox,\n showAdvancedSettingCheckbox: showAdvancedSettingCheckbox,\n showGetServerInformationCheckbox: showGetServerInformationCheckbox,\n showGetClientInformationCheckbox: showGetClientInformationCheckbox,\n showTextInputCheckbox: showTextInputCheckbox,\n showLicenseCheckbox: showLicenseCheckbox\n },\n isConverting: isConverting,\n setIsConverting: setIsConverting,\n isAnalyzing: isAnalyzing,\n setIsAnalyzing: setIsAnalyzing,\n showPyTorchModelUpload: showPyTorchModelUpload,\n setShowPyTorchModelUpload: setShowPyTorchModelUpload,\n reloadDeviceInfo: reloadDeviceInfo,\n inputAudioDeviceInfo: inputAudioDeviceInfo,\n outputAudioDeviceInfo: outputAudioDeviceInfo,\n audioInputForGUI: audioInputForGUI,\n audioOutputForGUI: audioOutputForGUI,\n fileInputEchoback: fileInputEchoback,\n audioOutputForAnalyzer: audioOutputForAnalyzer,\n setInputAudioDeviceInfo: setInputAudioDeviceInfo,\n setOutputAudioDeviceInfo: setOutputAudioDeviceInfo,\n setAudioInputForGUI: setAudioInputForGUI,\n setAudioOutputForGUI: setAudioOutputForGUI,\n setFileInputEchoback: setFileInputEchoback,\n setAudioOutputForAnalyzer: setAudioOutputForAnalyzer,\n modelSlotNum: modelSlotNum,\n setModelSlotNum: setModelSlotNum,\n textInputResolve: textInputResolve,\n setTextInputResolve: setTextInputResolve\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(GuiStateContext.Provider, {\n value: providerValue\n }, children);\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/001_GuiStateProvider.tsx?"); /***/ }), /***/ "./src/components/demo/002_ComponentGenerator.tsx": /*!********************************************************!*\ !*** ./src/components/demo/002_ComponentGenerator.tsx ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ addToCatalog: () => (/* binding */ addToCatalog),\n/* harmony export */ catalog: () => (/* binding */ catalog),\n/* harmony export */ generateComponent: () => (/* binding */ generateComponent)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _components2_100_ModelSlotArea__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components2/100_ModelSlotArea */ \"./src/components/demo/components2/100_ModelSlotArea.tsx\");\n/* harmony import */ var _components2_101_CharacterArea__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components2/101_CharacterArea */ \"./src/components/demo/components2/101_CharacterArea.tsx\");\n/* harmony import */ var _components2_102_ConfigArea__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components2/102_ConfigArea */ \"./src/components/demo/components2/102_ConfigArea.tsx\");\n/* harmony import */ var _components2_001_HeaderArea__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components2/001_HeaderArea */ \"./src/components/demo/components2/001_HeaderArea.tsx\");\n\n\n\n\n\nvar catalog = {};\nvar addToCatalog = function addToCatalog(key, generator) {\n catalog[key] = generator;\n};\nvar generateComponent = function generateComponent(key, props) {\n if (!catalog[key]) {\n console.error(\"not found component generator.\", key);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n }\n return catalog[key](props);\n};\nvar initialize = function initialize() {\n addToCatalog(\"headerArea\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components2_001_HeaderArea__WEBPACK_IMPORTED_MODULE_4__.HeaderArea, props);\n });\n addToCatalog(\"modelSlotArea\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components2_100_ModelSlotArea__WEBPACK_IMPORTED_MODULE_1__.ModelSlotArea, props);\n });\n addToCatalog(\"characterArea\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components2_101_CharacterArea__WEBPACK_IMPORTED_MODULE_2__.CharacterArea, props);\n });\n addToCatalog(\"configArea\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components2_102_ConfigArea__WEBPACK_IMPORTED_MODULE_3__.ConfigArea, props);\n });\n};\ninitialize();\n\n//# sourceURL=webpack://demo/./src/components/demo/002_ComponentGenerator.tsx?"); /***/ }), /***/ "./src/components/demo/010_Demo.tsx": /*!******************************************!*\ !*** ./src/components/demo/010_Demo.tsx ***! \******************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Demo: () => (/* binding */ Demo)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _900_Dialogs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./900_Dialogs */ \"./src/components/demo/900_Dialogs.tsx\");\n/* harmony import */ var _b00_ModelSlotControl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./b00_ModelSlotControl */ \"./src/components/demo/b00_ModelSlotControl.tsx\");\n/* harmony import */ var _910_Dialogs2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./910_Dialogs2 */ \"./src/components/demo/910_Dialogs2.tsx\");\n\n\n\n\n\nvar Demo = function Demo() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__.GuiStateProvider, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"main-body\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_910_Dialogs2__WEBPACK_IMPORTED_MODULE_4__.Dialogs2, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_900_Dialogs__WEBPACK_IMPORTED_MODULE_2__.Dialogs, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_b00_ModelSlotControl__WEBPACK_IMPORTED_MODULE_3__.ModelSlotControl, null)));\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/010_Demo.tsx?"); /***/ }), /***/ "./src/components/demo/900_Dialogs.tsx": /*!*********************************************!*\ !*** ./src/components/demo/900_Dialogs.tsx ***! \*********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Dialogs: () => (/* binding */ Dialogs)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _902_WaitingDialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./902_WaitingDialog */ \"./src/components/demo/902_WaitingDialog.tsx\");\n/* harmony import */ var _903_StartingNoticeDialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./903_StartingNoticeDialog */ \"./src/components/demo/903_StartingNoticeDialog.tsx\");\n/* harmony import */ var _904_ModelSlotManagerDialog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./904_ModelSlotManagerDialog */ \"./src/components/demo/904_ModelSlotManagerDialog.tsx\");\n/* harmony import */ var _905_MergeLabDialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./905_MergeLabDialog */ \"./src/components/demo/905_MergeLabDialog.tsx\");\n/* harmony import */ var _906_AdvancedSettingDialog__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./906_AdvancedSettingDialog */ \"./src/components/demo/906_AdvancedSettingDialog.tsx\");\n/* harmony import */ var _907_GetServerInfomationDialog__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./907_GetServerInfomationDialog */ \"./src/components/demo/907_GetServerInfomationDialog.tsx\");\n/* harmony import */ var _908_GetClientInfomationDialog__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./908_GetClientInfomationDialog */ \"./src/components/demo/908_GetClientInfomationDialog.tsx\");\n\n\n\n\n\n\n\n\n\nvar Dialogs = function Dialogs() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__.useGuiState)();\n var dialogs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, guiState.stateControls.showWaitingCheckbox.trigger, guiState.stateControls.showStartingNoticeCheckbox.trigger, guiState.stateControls.showModelSlotManagerCheckbox.trigger, guiState.stateControls.showMergeLabCheckbox.trigger, guiState.stateControls.showAdvancedSettingCheckbox.trigger, guiState.stateControls.showGetServerInformationCheckbox.trigger, guiState.stateControls.showGetClientInformationCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-container\",\n id: \"dialog\"\n }, guiState.stateControls.showWaitingCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_902_WaitingDialog__WEBPACK_IMPORTED_MODULE_2__.WaitingDialog, null), guiState.stateControls.showStartingNoticeCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_903_StartingNoticeDialog__WEBPACK_IMPORTED_MODULE_3__.StartingNoticeDialog, null), guiState.stateControls.showModelSlotManagerCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_904_ModelSlotManagerDialog__WEBPACK_IMPORTED_MODULE_4__.ModelSlotManagerDialog, null), guiState.stateControls.showMergeLabCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_905_MergeLabDialog__WEBPACK_IMPORTED_MODULE_5__.MergeLabDialog, null), guiState.stateControls.showAdvancedSettingCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_906_AdvancedSettingDialog__WEBPACK_IMPORTED_MODULE_6__.AdvancedSettingDialog, null), guiState.stateControls.showGetServerInformationCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_907_GetServerInfomationDialog__WEBPACK_IMPORTED_MODULE_7__.GetServerInfomationDialog, null), guiState.stateControls.showGetClientInformationCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_908_GetClientInfomationDialog__WEBPACK_IMPORTED_MODULE_8__.GetClientInfomationDialog, null)));\n return dialogs;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/900_Dialogs.tsx?"); /***/ }), /***/ "./src/components/demo/902_WaitingDialog.tsx": /*!***************************************************!*\ !*** ./src/components/demo/902_WaitingDialog.tsx ***! \***************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("var __filename = \"/index.js\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ WaitingDialog: () => (/* binding */ WaitingDialog)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../hooks/useMessageBuilder */ \"./src/hooks/useMessageBuilder.ts\");\n\n\nvar WaitingDialog = function WaitingDialog() {\n // const guiState = useGuiState()\n var messageBuilderState = (0,_hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_1__.useMessageBuilder)();\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n messageBuilderState.setMessage(__filename, \"wait\", {\n \"ja\": \"しばらくお待ちください\",\n \"en\": \"please wait...\"\n });\n messageBuilderState.setMessage(__filename, \"wait_sub1\", {\n \"ja\": \"ONNXファイルを生成しています。\",\n \"en\": \"generating ONNX file.\"\n });\n messageBuilderState.setMessage(__filename, \"wait_sub2\", {\n \"ja\": \"しばらくお待ちください(1分程度)。\",\n \"en\": \"please wait... (about 1 min).\"\n });\n }, []);\n var dialog = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n // const closeButtonRow = (\n //
\n //
\n //
\n //
\n //
{ guiState.stateControls.showWaitingCheckbox.updateState(false) }} >close
\n //
\n //
\n //
\n // )\n var content = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-row left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, messageBuilderState.getMessage(__filename, \"wait_sub1\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, messageBuilderState.getMessage(__filename, \"wait_sub2\")));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-frame\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-title\"\n }, messageBuilderState.getMessage(__filename, \"wait\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-content\"\n }, content));\n }, []);\n return dialog;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/902_WaitingDialog.tsx?"); /***/ }), /***/ "./src/components/demo/903_StartingNoticeDialog.tsx": /*!**********************************************************!*\ !*** ./src/components/demo/903_StartingNoticeDialog.tsx ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("var __filename = \"/index.js\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ StartingNoticeDialog: () => (/* binding */ StartingNoticeDialog)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _const__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../const */ \"./src/const.ts\");\n/* harmony import */ var _001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../001_provider/001_AppRootProvider */ \"./src/001_provider/001_AppRootProvider.tsx\");\n/* harmony import */ var _hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks/useMessageBuilder */ \"./src/hooks/useMessageBuilder.ts\");\n\n\n\n\n\nvar StartingNoticeDialog = function StartingNoticeDialog() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__.useGuiState)();\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_3__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var messageBuilderState = (0,_hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_4__.useMessageBuilder)();\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n messageBuilderState.setMessage(__filename, \"support\", {\n ja: \"支援\",\n en: \"Donation\"\n });\n messageBuilderState.setMessage(__filename, \"support_message_1\", {\n ja: \"このソフトウェアを気に入ったら開発者にコーヒーをご馳走してあげよう。黄色いアイコンから。\",\n en: \"This software is supported by donations. Thank you for your support!\"\n });\n messageBuilderState.setMessage(__filename, \"support_message_2\", {\n ja: \"コーヒーをご馳走する。\",\n en: \"I will support a developer by buying coffee.\"\n });\n messageBuilderState.setMessage(__filename, \"directml_1\", {\n ja: \"directML版は実験的バージョンです。以下の既知の問題があります。\",\n en: \"DirectML version is an experimental version. There are the known issues as follows.\"\n });\n messageBuilderState.setMessage(__filename, \"directml_2\", {\n ja: \"(1) 一部の設定変更を行うとgpuを使用していても変換処理が遅くなることが発生します。もしこの現象が発生したらGPUの値を-1にしてから再度0に戻してください。\",\n en: \"(1) When some settings are changed, conversion process becomes slow even when using GPU. If this occurs, reset the GPU value to -1 and then back to 0.\"\n });\n messageBuilderState.setMessage(__filename, \"click_to_start\", {\n ja: \"スタートボタンを押してください。\",\n en: \"Click to start\"\n });\n messageBuilderState.setMessage(__filename, \"start\", {\n ja: \"スタート\",\n en: \"start\"\n });\n }, []);\n var coffeeLink = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return (0,_const__WEBPACK_IMPORTED_MODULE_2__.isDesktopApp)() ?\n /*#__PURE__*/\n // @ts-ignore\n react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"link\",\n onClick: function onClick() {\n // @ts-ignore\n window.electronAPI.openBrowser(\"https://www.buymeacoffee.com/wokad\");\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n className: \"donate-img\",\n src: \"./assets/buymeacoffee.png\"\n }), \" \", messageBuilderState.getMessage(__filename, \"support_message_2\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n className: \"link\",\n href: \"https://www.buymeacoffee.com/wokad\",\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n className: \"donate-img\",\n src: \"./assets/buymeacoffee.png\"\n }), \" \", messageBuilderState.getMessage(__filename, \"support_message_2\"));\n }, []);\n var licenseNoticeLink = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return (0,_const__WEBPACK_IMPORTED_MODULE_2__.isDesktopApp)() ?\n /*#__PURE__*/\n // @ts-ignore\n react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"link\",\n onClick: function onClick() {\n // @ts-ignore\n window.electronAPI.openBrowser(\"https://github.com/w-okada/voice-changer/blob/master/LICENSE-NOTICE\");\n }\n }, \"License Notice\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n className: \"link\",\n href: \"https://github.com/w-okada/voice-changer/blob/master/LICENSE-NOTICE\",\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, \"License Notice\");\n }, []);\n var dialog = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var closeButtonRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-row split-3-4-3 left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-button-container body-button-container-space-around\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: function onClick() {\n guiState.stateControls.showStartingNoticeCheckbox.updateState(false);\n }\n }, messageBuilderState.getMessage(__filename, \"start\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }));\n var donationMessage = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-content-part\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, messageBuilderState.getMessage(__filename, \"support_message_1\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, coffeeLink));\n var directMLMessage = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-content-part\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, messageBuilderState.getMessage(__filename, \"directml_1\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"left-padding-1\"\n }, messageBuilderState.getMessage(__filename, \"directml_2\")));\n var licenseInfo = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-content-part\"\n }, licenseNoticeLink);\n var clickToStartMessage = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-content-part\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, messageBuilderState.getMessage(__filename, \"click_to_start\")));\n var edition = appGuiSettingState.edition;\n var content = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-row\"\n }, donationMessage, edition.indexOf(\"onnxdirectML-cuda\") >= 0 ? directMLMessage : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null), licenseInfo, clickToStartMessage);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-frame\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-title\"\n }, \"Message\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-content\"\n }, content, closeButtonRow));\n }, [appGuiSettingState.edition]);\n return dialog;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/903_StartingNoticeDialog.tsx?"); /***/ }), /***/ "./src/components/demo/904-1_MainScreen.tsx": /*!**************************************************!*\ !*** ./src/components/demo/904-1_MainScreen.tsx ***! \**************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("var __filename = \"/index.js\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MainScreen: () => (/* binding */ MainScreen)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @dannadori/voice-changer-client-js */ \"./node_modules/@dannadori/voice-changer-client-js/dist/index.js\");\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../hooks/useMessageBuilder */ \"./src/hooks/useMessageBuilder.ts\");\n/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/utils */ \"./src/utils/utils.ts\");\n\n\n\n\n\n\n\n\nvar MainScreen = function MainScreen(props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__.useAppState)(),\n serverSetting = _useAppState.serverSetting;\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__.useGuiState)();\n var messageBuilderState = (0,_hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_6__.useMessageBuilder)();\n (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n messageBuilderState.setMessage(__filename, \"change_icon\", {\n ja: \"アイコン変更\",\n en: \"chage icon\"\n });\n messageBuilderState.setMessage(__filename, \"rename\", {\n ja: \"リネーム\",\n en: \"rename\"\n });\n messageBuilderState.setMessage(__filename, \"download\", {\n ja: \"ダウンロード\",\n en: \"download\"\n });\n messageBuilderState.setMessage(__filename, \"terms_of_use\", {\n ja: \"利用規約\",\n en: \"terms of use\"\n });\n messageBuilderState.setMessage(__filename, \"sample\", {\n ja: \"サンプル\",\n en: \"DL sample\"\n });\n messageBuilderState.setMessage(__filename, \"upload\", {\n ja: \"アップロード\",\n en: \"upload\"\n });\n messageBuilderState.setMessage(__filename, \"edit\", {\n ja: \"編集\",\n en: \"edit\"\n });\n messageBuilderState.setMessage(__filename, \"close\", {\n ja: \"閉じる\",\n en: \"close\"\n });\n }, []);\n var screen = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n if (props.screen != \"Main\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n }\n if (!serverSetting.serverSetting.modelSlots) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n }\n var iconAction = /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(index) {\n var file;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(!serverSetting.serverSetting.modelSlots[index].name || serverSetting.serverSetting.modelSlots[index].name.length == 0)) {\n _context.next = 2;\n break;\n }\n return _context.abrupt(\"return\");\n case 2:\n _context.next = 4;\n return (0,_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_5__.fileSelector)(\"\");\n case 4:\n file = _context.sent;\n if (!((0,_utils_utils__WEBPACK_IMPORTED_MODULE_7__.checkExtention)(file.name, [\"png\", \"jpg\", \"jpeg\", \"gif\"]) == false)) {\n _context.next = 8;\n break;\n }\n alert(\"\\u30B5\\u30E0\\u30CD\\u30A4\\u30EB\\u306E\\u62E1\\u5F35\\u5B50\\u306F\\\".png\\\", \\\".jpg\\\", \\\".jpeg\\\", \\\".gif\\\"\\u3067\\u3042\\u308B\\u5FC5\\u8981\\u304C\\u3042\\u308A\\u307E\\u3059\\u3002\");\n return _context.abrupt(\"return\");\n case 8:\n _context.next = 10;\n return serverSetting.uploadAssets(index, \"iconFile\", file);\n case 10:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function iconAction(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n var nameValueAction = /*#__PURE__*/function () {\n var _ref2 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee2(index) {\n var p, text;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n if (!(!serverSetting.serverSetting.modelSlots[index].name || serverSetting.serverSetting.modelSlots[index].name.length == 0)) {\n _context2.next = 2;\n break;\n }\n return _context2.abrupt(\"return\");\n case 2:\n // Open Text Input Dialog\n p = new Promise(function (resolve) {\n guiState.setTextInputResolve({\n resolve: resolve\n });\n });\n guiState.stateControls.showTextInputCheckbox.updateState(true);\n _context2.next = 6;\n return p;\n case 6:\n text = _context2.sent;\n if (!(text.length > 0)) {\n _context2.next = 11;\n break;\n }\n console.log(\"input text:\", text);\n _context2.next = 11;\n return serverSetting.updateModelInfo(index, \"name\", text);\n case 11:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function nameValueAction(_x2) {\n return _ref2.apply(this, arguments);\n };\n }();\n var fileValueAction = function fileValueAction(url) {\n if (url.length == 0) {\n return;\n }\n var link = document.createElement(\"a\");\n link.href = \"./\" + url;\n link.download = url.replace(/^.*[\\\\\\/]/, \"\");\n link.click();\n link.remove();\n };\n var closeButtonRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-row split-3-4-3 left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-text\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button-container body-button-container-space-around\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: function onClick() {\n props.close();\n }\n }, messageBuilderState.getMessage(__filename, \"close\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-text\"\n }));\n var slotRow = serverSetting.serverSetting.modelSlots.map(function (x, index) {\n // モデルのアイコン\n var generateIconArea = function generateIconArea(slotIndex, iconUrl, tooltip) {\n var realIconUrl = iconUrl.length > 0 ? iconUrl : \"/assets/icons/noimage.png\";\n var iconDivClass = tooltip ? \"tooltip\" : \"\";\n var iconClass = tooltip ? \"model-slot-icon-pointable\" : \"model-slot-icon\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: iconDivClass\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"img\", {\n src: realIconUrl,\n className: iconClass,\n onClick: function onClick() {\n iconAction(slotIndex);\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-thin tooltip-text-lower\"\n }, messageBuilderState.getMessage(__filename, \"change_icon\")));\n };\n\n // モデルの名前\n var generateNameRow = function generateNameRow(slotIndex, name, termsOfUseUrl) {\n var nameValueClass = name.length > 0 ? \"model-slot-detail-row-value-pointable tooltip\" : \"model-slot-detail-row-value\";\n var displayName = name.length > 0 ? name : \"blank\";\n var termOfUseUrlLink = termsOfUseUrl.length > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"a\", {\n href: termsOfUseUrl,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n className: \"body-item-text-small\"\n }, \"[\", messageBuilderState.getMessage(__filename, \"terms_of_use\"), \"]\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"model-slot-detail-row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"model-slot-detail-row-label\"\n }, \"[\", slotIndex, \"]\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: nameValueClass,\n onClick: function onClick() {\n nameValueAction(slotIndex);\n }\n }, displayName, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-thin\"\n }, messageBuilderState.getMessage(__filename, \"rename\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"\"\n }, termOfUseUrlLink));\n };\n\n // モデルを構成するファイル\n var generateFileRow = function generateFileRow(title, filePath) {\n var fileValueClass = filePath.length > 0 ? \"model-slot-detail-row-value-download tooltip\" : \"model-slot-detail-row-value\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n key: \"\".concat(title),\n className: \"model-slot-detail-row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"model-slot-detail-row-label\"\n }, title, \":\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: fileValueClass,\n onClick: function onClick() {\n fileValueAction(filePath);\n }\n }, (0,_utils_utils__WEBPACK_IMPORTED_MODULE_7__.trimfileName)(filePath, 20), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-thin\"\n }, messageBuilderState.getMessage(__filename, \"download\"))));\n };\n\n // その他情報欄\n var generateInfoRow = function generateInfoRow(info) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"model-slot-detail-row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"model-slot-detail-row-label\"\n }, \"info: \"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"model-slot-detail-row-value\"\n }, info), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"\"\n }));\n };\n var iconArea = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n var nameRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n var fileRows = [];\n var infoRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n if (x.voiceChangerType == \"RVC\") {\n var slotInfo = x;\n iconArea = generateIconArea(index, slotInfo.iconFile, true);\n nameRow = generateNameRow(index, slotInfo.name, slotInfo.termsOfUseUrl);\n fileRows.push(generateFileRow(\"model\", slotInfo.modelFile));\n fileRows.push(generateFileRow(\"index\", slotInfo.indexFile));\n infoRow = generateInfoRow(\"\".concat(slotInfo.f0 ? \"f0\" : \"nof0\", \", \").concat(slotInfo.samplingRate, \", \").concat(slotInfo.embChannels, \", \").concat(slotInfo.modelType, \", \").concat(slotInfo.defaultTune, \", \").concat(slotInfo.defaultIndexRatio, \", \").concat(slotInfo.defaultProtect));\n } else if (x.voiceChangerType == \"MMVCv13\") {\n var _slotInfo = x;\n iconArea = generateIconArea(index, _slotInfo.iconFile, true);\n nameRow = generateNameRow(index, _slotInfo.name, _slotInfo.termsOfUseUrl);\n fileRows.push(generateFileRow(\"config\", _slotInfo.configFile));\n fileRows.push(generateFileRow(\"model\", _slotInfo.modelFile));\n infoRow = generateInfoRow(\"\");\n } else if (x.voiceChangerType == \"MMVCv15\") {\n var _slotInfo2 = x;\n iconArea = generateIconArea(index, _slotInfo2.iconFile, true);\n nameRow = generateNameRow(index, _slotInfo2.name, _slotInfo2.termsOfUseUrl);\n fileRows.push(generateFileRow(\"config\", _slotInfo2.configFile));\n fileRows.push(generateFileRow(\"model\", _slotInfo2.modelFile));\n infoRow = generateInfoRow(\"f0factor:\".concat(_slotInfo2.f0Factor));\n } else if (x.voiceChangerType == \"so-vits-svc-40\") {\n var _slotInfo3 = x;\n iconArea = generateIconArea(index, _slotInfo3.iconFile, true);\n nameRow = generateNameRow(index, _slotInfo3.name, _slotInfo3.termsOfUseUrl);\n fileRows.push(generateFileRow(\"config\", _slotInfo3.configFile));\n fileRows.push(generateFileRow(\"model\", _slotInfo3.modelFile));\n fileRows.push(generateFileRow(\"cluster\", _slotInfo3.clusterFile));\n infoRow = generateInfoRow(\"tune:\".concat(_slotInfo3.defaultTune, \",cluster:\").concat(_slotInfo3.defaultClusterInferRatio, \",noise:\").concat(_slotInfo3.noiseScale));\n } else if (x.voiceChangerType == \"DDSP-SVC\") {\n var _slotInfo4 = x;\n iconArea = generateIconArea(index, _slotInfo4.iconFile, true);\n nameRow = generateNameRow(index, _slotInfo4.name, _slotInfo4.termsOfUseUrl);\n fileRows.push(generateFileRow(\"config\", _slotInfo4.configFile));\n fileRows.push(generateFileRow(\"model\", _slotInfo4.modelFile));\n fileRows.push(generateFileRow(\"diff conf\", _slotInfo4.diffConfigFile));\n fileRows.push(generateFileRow(\"diff model\", _slotInfo4.diffModelFile));\n infoRow = generateInfoRow(\"tune:\".concat(_slotInfo4.defaultTune, \",acc:\").concat(_slotInfo4.acc, \",ks:\").concat(_slotInfo4.kstep, \", diff:\").concat(_slotInfo4.diffusion, \",enh:\").concat(_slotInfo4.enhancer));\n } else if (x.voiceChangerType == \"Diffusion-SVC\") {\n var _slotInfo5 = x;\n iconArea = generateIconArea(index, _slotInfo5.iconFile, true);\n nameRow = generateNameRow(index, _slotInfo5.name, _slotInfo5.termsOfUseUrl);\n fileRows.push(generateFileRow(\"model\", _slotInfo5.modelFile));\n infoRow = generateInfoRow(\"tune:\".concat(_slotInfo5.defaultTune, \",ks(max):\").concat(_slotInfo5.kStepMax, \",ks:\").concat(_slotInfo5.defaultKstep, \", sp:\").concat(_slotInfo5.defaultSpeedup, \", l:\").concat(_slotInfo5.nLayers, \",\").concat(_slotInfo5.nnLayers, \",\"));\n } else {\n iconArea = generateIconArea(index, \"/assets/icons/blank.png\", false);\n nameRow = generateNameRow(index, \"\", \"\");\n }\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n key: index,\n className: \"model-slot\"\n }, iconArea, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"model-slot-detail\"\n }, nameRow, fileRows, infoRow), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"model-slot-buttons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"model-slot-button\",\n onClick: function onClick() {\n props.openFileUploader(index);\n }\n }, messageBuilderState.getMessage(__filename, \"upload\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"model-slot-button\",\n onClick: function onClick() {\n props.openSampleDownloader(index);\n }\n }, messageBuilderState.getMessage(__filename, \"sample\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"model-slot-button\",\n onClick: function onClick() {\n props.openEditor(index);\n }\n }, messageBuilderState.getMessage(__filename, \"edit\"))));\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"dialog-frame\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"dialog-title\"\n }, \"Model Slot Configuration\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"dialog-fixed-size-content\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"model-slot-container\"\n }, slotRow), closeButtonRow));\n }, [props.screen, serverSetting.serverSetting]);\n return screen;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/904-1_MainScreen.tsx?"); /***/ }), /***/ "./src/components/demo/904-2_SampleDownloader.tsx": /*!********************************************************!*\ !*** ./src/components/demo/904-2_SampleDownloader.tsx ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("var __filename = \"/index.js\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SampleDownloaderScreen: () => (/* binding */ SampleDownloaderScreen)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../hooks/useMessageBuilder */ \"./src/hooks/useMessageBuilder.ts\");\n\n\n\n\n\n\nvar SampleDownloaderScreen = function SampleDownloaderScreen(props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__.useAppState)(),\n serverSetting = _useAppState.serverSetting;\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(\"All\"),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState, 2),\n lang = _useState2[0],\n setLang = _useState2[1];\n var messageBuilderState = (0,_hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_5__.useMessageBuilder)();\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n messageBuilderState.setMessage(__filename, \"header_message\", {\n \"ja\": \"サンプルをダウンロードしてください. 対象:\",\n \"en\": \"Download Sample for\"\n });\n messageBuilderState.setMessage(__filename, \"lang\", {\n \"ja\": \"言語\",\n \"en\": \"Lang\"\n });\n messageBuilderState.setMessage(__filename, \"back\", {\n \"ja\": \"戻る\",\n \"en\": \"back\"\n });\n messageBuilderState.setMessage(__filename, \"terms_of_use\", {\n \"ja\": \"利用規約\",\n \"en\": \"terms of use\"\n });\n messageBuilderState.setMessage(__filename, \"download\", {\n \"ja\": \"ダウンロード\",\n \"en\": \"download\"\n });\n }, []);\n\n /////////////////////////////////////////\n // Sample Downloader\n /////////////////////////////////////////\n var screen = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n if (props.screen != \"SampleDownloader\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null);\n }\n if (!serverSetting.serverSetting.modelSlots) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null);\n }\n var langs = serverSetting.serverSetting.sampleModels.reduce(function (prev, cur) {\n if (prev.includes(cur.lang) == false) {\n prev.push(cur.lang);\n }\n return prev;\n }, [\"All\"]);\n var langOptions = langs.map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n });\n var onDownloadSampleClicked = /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(id) {\n var uploadParams;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n uploadParams = {\n voiceChangerType: \"RVC\",\n slot: props.targetIndex,\n isSampleMode: true,\n sampleId: id,\n files: [],\n params: {\n rvcIndexDownload: true\n }\n };\n _context.prev = 1;\n _context.next = 4;\n return serverSetting.uploadModel(uploadParams);\n case 4:\n _context.next = 9;\n break;\n case 6:\n _context.prev = 6;\n _context.t0 = _context[\"catch\"](1);\n alert(_context.t0);\n case 9:\n props.backToSlotManager();\n // setMode(\"localFile\")\n case 10:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[1, 6]]);\n }));\n return function onDownloadSampleClicked(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n var options = serverSetting.serverSetting.sampleModels.filter(function (x) {\n return lang == \"All\" ? true : x.lang == lang;\n }).map(function (x, index) {\n var termOfUseUrlLink = x.termsOfUseUrl && x.termsOfUseUrl.length > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"a\", {\n href: x.termsOfUseUrl,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n className: \"body-item-text-small\"\n }, \"[\", messageBuilderState.getMessage(__filename, \"terms_of_use\"), \"]\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n key: index,\n className: \"model-slot\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"img\", {\n src: x.icon,\n className: \"model-slot-icon\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-detail\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-detail-row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-detail-row-label\"\n }, \"name:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-detail-row-value\"\n }, x.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"\"\n }, termOfUseUrlLink)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-detail-row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-detail-row-label\"\n }, \"info: \"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-detail-row-value\"\n }, x.modelType, \",\", x.f0 ? \"f0\" : \"nof0\", \",\", x.sampleRate), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-buttons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-button\",\n onClick: function onClick() {\n onDownloadSampleClicked(x.id);\n }\n }, messageBuilderState.getMessage(__filename, \"download\"))));\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"dialog-frame\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"dialog-title\"\n }, \"Sample Downloader\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"dialog-fixed-size-content\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-header\"\n }, messageBuilderState.getMessage(__filename, \"header_message\"), \" Slot[\", props.targetIndex, \"]\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n onClick: function onClick() {\n props.backToSlotManager();\n },\n className: \"model-slot-header-button\"\n }, \"<<\", messageBuilderState.getMessage(__filename, \"back\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", null, messageBuilderState.getMessage(__filename, \"lang\"), \":\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"select\", {\n value: lang,\n onChange: function onChange(e) {\n setLang(e.target.value);\n }\n }, langOptions)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-container\"\n }, options)));\n }, [props.screen, props.targetIndex, lang, serverSetting.serverSetting]);\n return screen;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/904-2_SampleDownloader.tsx?"); /***/ }), /***/ "./src/components/demo/904-3_FileUploader.tsx": /*!****************************************************!*\ !*** ./src/components/demo/904-3_FileUploader.tsx ***! \****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("var __filename = \"/index.js\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FileUploaderScreen: () => (/* binding */ FileUploaderScreen)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @dannadori/voice-changer-client-js */ \"./node_modules/@dannadori/voice-changer-client-js/dist/index.js\");\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../hooks/useMessageBuilder */ \"./src/hooks/useMessageBuilder.ts\");\n/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/utils */ \"./src/utils/utils.ts\");\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\n\n\n\nvar FileUploaderScreen = function FileUploaderScreen(props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)(),\n serverSetting = _useAppState.serverSetting;\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(\"RVC\"),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useState, 2),\n voiceChangerType = _useState2[0],\n setVoiceChangerType = _useState2[1];\n var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),\n _useState4 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useState3, 2),\n uploadSetting = _useState4[0],\n setUploadSetting = _useState4[1];\n var messageBuilderState = (0,_hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_7__.useMessageBuilder)();\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n messageBuilderState.setMessage(__filename, \"header_message\", {\n \"ja\": \"ファイルをアップロードしてください. 対象:\",\n \"en\": \"Upload Files for \"\n });\n messageBuilderState.setMessage(__filename, \"back\", {\n \"ja\": \"戻る\",\n \"en\": \"back\"\n });\n messageBuilderState.setMessage(__filename, \"select\", {\n \"ja\": \"ファイル選択\",\n \"en\": \"select file\"\n });\n messageBuilderState.setMessage(__filename, \"upload\", {\n \"ja\": \"アップロード\",\n \"en\": \"upload\"\n });\n messageBuilderState.setMessage(__filename, \"uploading\", {\n \"ja\": \"アップロード中\",\n \"en\": \"uploading\"\n });\n messageBuilderState.setMessage(__filename, \"alert-model-ext\", {\n \"ja\": \"ファイルの拡張子は次のモノである必要があります。\",\n \"en\": \"extension of file should be the following.\"\n });\n messageBuilderState.setMessage(__filename, \"alert-model-file\", {\n \"ja\": \"ファイルが選択されていません\",\n \"en\": \"file is not selected.\"\n });\n }, []);\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n setUploadSetting({\n voiceChangerType: voiceChangerType,\n slot: props.targetIndex,\n isSampleMode: false,\n sampleId: null,\n files: [],\n params: {}\n });\n }, [props.targetIndex, voiceChangerType]);\n var screen = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (props.screen != \"FileUploader\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n var vcTypeOptions = Object.values(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6__.VoiceChangerType).map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n });\n var checkModelSetting = function checkModelSetting(setting) {\n if (setting.voiceChangerType == \"RVC\") {\n var enough = !!setting.files.find(function (x) {\n return x.kind == \"rvcModel\";\n });\n return enough;\n } else if (setting.voiceChangerType == \"MMVCv13\") {\n var _enough = !!setting.files.find(function (x) {\n return x.kind == \"mmvcv13Model\";\n }) && !!setting.files.find(function (x) {\n return x.kind == \"mmvcv13Config\";\n });\n return _enough;\n } else if (setting.voiceChangerType == \"MMVCv15\") {\n var _enough2 = !!setting.files.find(function (x) {\n return x.kind == \"mmvcv15Model\";\n }) && !!setting.files.find(function (x) {\n return x.kind == \"mmvcv15Config\";\n });\n return _enough2;\n } else if (setting.voiceChangerType == \"so-vits-svc-40\") {\n var _enough3 = !!setting.files.find(function (x) {\n return x.kind == \"soVitsSvc40Config\";\n }) && !!setting.files.find(function (x) {\n return x.kind == \"soVitsSvc40Model\";\n });\n return _enough3;\n } else if (setting.voiceChangerType == \"DDSP-SVC\") {\n var _enough4 = !!setting.files.find(function (x) {\n return x.kind == \"ddspSvcModel\";\n }) && !!setting.files.find(function (x) {\n return x.kind == \"ddspSvcModelConfig\";\n }) && !!setting.files.find(function (x) {\n return x.kind == \"ddspSvcDiffusion\";\n }) && !!setting.files.find(function (x) {\n return x.kind == \"ddspSvcDiffusionConfig\";\n });\n return _enough4;\n } else if (setting.voiceChangerType == \"Diffusion-SVC\") {\n var _enough5 = !!setting.files.find(function (x) {\n return x.kind == \"diffusionSVCModel\";\n });\n return _enough5;\n }\n return false;\n };\n var generateFileRow = function generateFileRow(setting, title, kind, ext) {\n var dir = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : \"\";\n var selectedFile = setting.files.find(function (x) {\n return x.kind == kind;\n });\n var selectedFilename = (selectedFile === null || selectedFile === void 0 ? void 0 : selectedFile.file.name) || \"\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n key: \"\".concat(title),\n className: \"file-uploader-file-select-row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"file-uploader-file-select-row-label\"\n }, title, \":\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"file-uploader-file-select-row-value\"\n }, (0,_utils_utils__WEBPACK_IMPORTED_MODULE_8__.trimfileName)(selectedFilename, 30)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"file-uploader-file-select-row-button\",\n onClick: /*#__PURE__*/(0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee() {\n var file, alertMessage;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return (0,_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6__.fileSelector)(\"\");\n case 2:\n file = _context.sent;\n if (!((0,_utils_utils__WEBPACK_IMPORTED_MODULE_8__.checkExtention)(file.name, ext) == false)) {\n _context.next = 7;\n break;\n }\n alertMessage = \"\".concat(messageBuilderState.getMessage(__filename, \"alert-model-ext\"), \" \").concat(ext);\n alert(alertMessage);\n return _context.abrupt(\"return\");\n case 7:\n if (selectedFile) {\n selectedFile.file = file;\n } else {\n setting.files.push({\n kind: kind,\n file: file,\n dir: dir\n });\n }\n setUploadSetting(_objectSpread({}, setting));\n case 9:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }))\n }, messageBuilderState.getMessage(__filename, \"select\")));\n };\n var generateFileRowsByVCType = function generateFileRowsByVCType(vcType) {\n var rows = [];\n if (vcType == \"RVC\") {\n rows.push(generateFileRow(uploadSetting, \"Model\", \"rvcModel\", [\"pth\", \"onnx\"]));\n rows.push(generateFileRow(uploadSetting, \"Index\", \"rvcIndex\", [\"index\", \"bin\"]));\n } else if (vcType == \"MMVCv13\") {\n rows.push(generateFileRow(uploadSetting, \"Config\", \"mmvcv13Config\", [\"json\"]));\n rows.push(generateFileRow(uploadSetting, \"Model\", \"mmvcv13Model\", [\"pth\", \"onnx\"]));\n } else if (vcType == \"MMVCv15\") {\n rows.push(generateFileRow(uploadSetting, \"Config\", \"mmvcv15Config\", [\"json\"]));\n rows.push(generateFileRow(uploadSetting, \"Corres\", \"mmvcv15Correspondence\", [\"txt\"]));\n rows.push(generateFileRow(uploadSetting, \"Model\", \"mmvcv15Model\", [\"pth\", \"onnx\"]));\n } else if (vcType == \"so-vits-svc-40\") {\n rows.push(generateFileRow(uploadSetting, \"Config\", \"soVitsSvc40Config\", [\"json\"]));\n rows.push(generateFileRow(uploadSetting, \"Model\", \"soVitsSvc40Model\", [\"pth\"]));\n rows.push(generateFileRow(uploadSetting, \"Cluster\", \"soVitsSvc40Cluster\", [\"pth\", \"pt\"]));\n } else if (vcType == \"DDSP-SVC\") {\n rows.push(generateFileRow(uploadSetting, \"Config\", \"ddspSvcModelConfig\", [\"yaml\"], \"model/\"));\n rows.push(generateFileRow(uploadSetting, \"Model\", \"ddspSvcModel\", [\"pth\", \"pt\"], \"model/\"));\n rows.push(generateFileRow(uploadSetting, \"Config(diff)\", \"ddspSvcDiffusionConfig\", [\"yaml\"], \"diff/\"));\n rows.push(generateFileRow(uploadSetting, \"Model(diff)\", \"ddspSvcDiffusion\", [\"pth\", \"pt\"], \"diff/\"));\n } else if (vcType == \"Diffusion-SVC\") {\n rows.push(generateFileRow(uploadSetting, \"Model\", \"diffusionSVCModel\", [\"ptc\"]));\n }\n return rows;\n };\n var fileRows = generateFileRowsByVCType(voiceChangerType);\n\n // appState.serverSetting.uploadProgress == 0 ? `loading model...(wait about 20sec)` : `processing.... ${appState.serverSetting.uploadProgress.toFixed(1)}%` : \"\"\n\n var buttonLabel = serverSetting.uploadProgress == 0 ? messageBuilderState.getMessage(__filename, \"upload\") : messageBuilderState.getMessage(__filename, \"uploading\") + \"(\".concat(serverSetting.uploadProgress.toFixed(1), \"%)\");\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"dialog-frame\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"dialog-title\"\n }, \"File Uploader\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"dialog-fixed-size-content\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"file-uploader-header\"\n }, messageBuilderState.getMessage(__filename, \"header_message\"), \" Slot[\", props.targetIndex, \"]\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n onClick: function onClick() {\n props.backToSlotManager();\n },\n className: \"file-uploader-header-button\"\n }, \"<<\", messageBuilderState.getMessage(__filename, \"back\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"file-uploader-voice-changer-select\"\n }, \"VoiceChangerType:\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n value: voiceChangerType,\n onChange: function onChange(e) {\n setVoiceChangerType(e.target.value);\n }\n }, vcTypeOptions)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"file-uploader-file-select-container\"\n }, fileRows), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"file-uploader-file-select-upload-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"file-uploader-file-select-upload-button\",\n onClick: function onClick() {\n if (!uploadSetting) {\n return;\n }\n if (serverSetting.uploadProgress != 0) {\n return;\n }\n if (checkModelSetting(uploadSetting)) {\n serverSetting.uploadModel(uploadSetting).then(function () {\n props.backToSlotManager();\n });\n } else {\n var errorMessage = messageBuilderState.getMessage(__filename, \"alert-model-file\");\n alert(errorMessage);\n }\n }\n }, buttonLabel))));\n }, [props.screen, props.targetIndex, voiceChangerType, uploadSetting, serverSetting.uploadModel, serverSetting.uploadProgress]);\n return screen;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/904-3_FileUploader.tsx?"); /***/ }), /***/ "./src/components/demo/904-4_Editor.tsx": /*!**********************************************!*\ !*** ./src/components/demo/904-4_Editor.tsx ***! \**********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("var __filename = \"/index.js\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EditorScreen: () => (/* binding */ EditorScreen)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../hooks/useMessageBuilder */ \"./src/hooks/useMessageBuilder.ts\");\n\n\n\n\n\n\n\nvar EditorScreen = function EditorScreen(props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)(),\n serverSetting = _useAppState.serverSetting;\n var messageBuilderState = (0,_hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_6__.useMessageBuilder)();\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(0),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useState, 2),\n targetId = _useState2[0],\n setTargetId = _useState2[1];\n var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),\n _useState4 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useState3, 2),\n targetName = _useState4[0],\n setTargetName = _useState4[1];\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n messageBuilderState.setMessage(__filename, \"header_message\", {\n \"ja\": \"詳細設定: \",\n \"en\": \"Edit \"\n });\n messageBuilderState.setMessage(__filename, \"edit_speaker\", {\n \"ja\": \"話者登録\",\n \"en\": \"Speaker ID\"\n });\n messageBuilderState.setMessage(__filename, \"back\", {\n \"ja\": \"戻る\",\n \"en\": \"back\"\n });\n }, []);\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n var targetSlot = serverSetting.serverSetting.modelSlots[props.targetIndex];\n if (!targetSlot) {\n return;\n }\n var currentName = !!targetSlot.speakers[targetId] ? targetSlot.speakers[targetId] : \"\";\n setTargetName(currentName);\n }, [targetId]);\n var screen = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (props.screen != \"Editor\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n var targetSlot = serverSetting.serverSetting.modelSlots[props.targetIndex];\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"dialog-frame\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"dialog-title\"\n }, \"Model Slot Editor\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"dialog-fixed-size-content\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"file-uploader-header\"\n }, messageBuilderState.getMessage(__filename, \"header_message\"), \" Slot[\", props.targetIndex, \"]\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n onClick: function onClick() {\n props.backToSlotManager();\n },\n className: \"file-uploader-header-button\"\n }, \"<<\", messageBuilderState.getMessage(__filename, \"back\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"edit-model-slot-row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"edit-model-slot-title\"\n }, messageBuilderState.getMessage(__filename, \"edit_speaker\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"edit-model-slot-speakers\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"edit-model-slot-speakers-id-label\"\n }, \"ID:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"edit-model-slot-speakers-id-select\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n name: \"\",\n id: \"\",\n value: targetId,\n onChange: function onChange(e) {\n setTargetId(Number(e.target.value));\n }\n }, (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Array(127).keys()).map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"edit-model-slot-speakers-name-label\"\n }, \"Name:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"edit-model-slot-speakers-name-input\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"input\", {\n id: \"edit-model-slot-speakers-name-input\",\n value: targetName,\n onChange: function onChange(e) {\n setTargetName(e.target.value);\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"edit-model-slot-speakers-buttons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"edit-model-slot-speakers-button\",\n onClick: /*#__PURE__*/(0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee() {\n var inputElem;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n inputElem = document.getElementById(\"edit-model-slot-speakers-name-input\");\n targetSlot.speakers[targetId] = inputElem.value;\n _context.next = 4;\n return serverSetting.updateModelInfo(props.targetIndex, \"speakers\", JSON.stringify(targetSlot.speakers));\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }))\n }, \"set\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"edit-model-slot-speakers-button\",\n onClick: /*#__PURE__*/(0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee2() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n delete targetSlot.speakers[targetId];\n _context2.next = 3;\n return serverSetting.updateModelInfo(props.targetIndex, \"speakers\", JSON.stringify(targetSlot.speakers));\n case 3:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }))\n }, \"del\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"edit-model-slot-row\"\n })));\n }, [props.screen, props.targetIndex, targetId, targetName]);\n return screen;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/904-4_Editor.tsx?"); /***/ }), /***/ "./src/components/demo/904_ModelSlotManagerDialog.tsx": /*!************************************************************!*\ !*** ./src/components/demo/904_ModelSlotManagerDialog.tsx ***! \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ModelSlotManagerDialog: () => (/* binding */ ModelSlotManagerDialog),\n/* harmony export */ ModelSlotManagerDialogScreen: () => (/* binding */ ModelSlotManagerDialogScreen),\n/* harmony export */ ModelSlotSettingMode: () => (/* binding */ ModelSlotSettingMode)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _904_1_MainScreen__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./904-1_MainScreen */ \"./src/components/demo/904-1_MainScreen.tsx\");\n/* harmony import */ var _904_2_SampleDownloader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./904-2_SampleDownloader */ \"./src/components/demo/904-2_SampleDownloader.tsx\");\n/* harmony import */ var _904_3_FileUploader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./904-3_FileUploader */ \"./src/components/demo/904-3_FileUploader.tsx\");\n/* harmony import */ var _904_4_Editor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./904-4_Editor */ \"./src/components/demo/904-4_Editor.tsx\");\n\n\n\n\n\n\n\nvar ModelSlotSettingMode = {\n localFile: \"localFile\",\n fromNet: \"fromNet\"\n};\nvar ModelSlotManagerDialogScreen = {\n Main: \"Main\",\n SampleDownloader: \"SampleDownloader\",\n FileUploader: \"FileUploader\",\n Editor: \"Editor\"\n};\nvar ModelSlotManagerDialog = function ModelSlotManagerDialog() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_2__.useGuiState)();\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(\"Main\"),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_useState, 2),\n screen = _useState2[0],\n setScreen = _useState2[1];\n var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0),\n _useState4 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_useState3, 2),\n targetIndex = _useState4[0],\n setTargetIndex = _useState4[1];\n var dialog = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var close = function close() {\n guiState.stateControls.showModelSlotManagerCheckbox.updateState(false);\n };\n var openSampleDownloader = function openSampleDownloader(index) {\n setTargetIndex(index);\n setScreen(\"SampleDownloader\");\n };\n var openFileUploader = function openFileUploader(index) {\n setTargetIndex(index);\n setScreen(\"FileUploader\");\n };\n var openEditor = function openEditor(index) {\n setTargetIndex(index);\n setScreen(\"Editor\");\n };\n var backToSlotManager = function backToSlotManager() {\n setScreen(\"Main\");\n };\n var mainScreen = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_904_1_MainScreen__WEBPACK_IMPORTED_MODULE_3__.MainScreen, {\n screen: screen,\n close: close,\n openSampleDownloader: openSampleDownloader,\n openFileUploader: openFileUploader,\n openEditor: openEditor\n });\n var sampleDownloaderScreen = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_904_2_SampleDownloader__WEBPACK_IMPORTED_MODULE_4__.SampleDownloaderScreen, {\n screen: screen,\n targetIndex: targetIndex,\n close: close,\n backToSlotManager: backToSlotManager\n });\n var fileUploaderScreen = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_904_3_FileUploader__WEBPACK_IMPORTED_MODULE_5__.FileUploaderScreen, {\n screen: screen,\n targetIndex: targetIndex,\n close: close,\n backToSlotManager: backToSlotManager\n });\n var editorScreen = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_904_4_Editor__WEBPACK_IMPORTED_MODULE_6__.EditorScreen, {\n screen: screen,\n targetIndex: targetIndex,\n close: close,\n backToSlotManager: backToSlotManager\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"dialog-frame\"\n }, mainScreen, sampleDownloaderScreen, fileUploaderScreen, editorScreen);\n }, [screen, targetIndex]);\n return dialog;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/904_ModelSlotManagerDialog.tsx?"); /***/ }), /***/ "./src/components/demo/905_MergeLabDialog.tsx": /*!****************************************************!*\ !*** ./src/components/demo/905_MergeLabDialog.tsx ***! \****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MergeLabDialog: () => (/* binding */ MergeLabDialog)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @dannadori/voice-changer-client-js */ \"./node_modules/@dannadori/voice-changer-client-js/dist/index.js\");\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_4__);\n\n\n\n\n\nvar MergeLabDialog = function MergeLabDialog() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_2__.useGuiState)();\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__.useAppState)(),\n serverSetting = _useAppState.serverSetting;\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(\"\"),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_useState, 2),\n currentFilter = _useState2[0],\n setCurrentFilter = _useState2[1];\n var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]),\n _useState4 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_useState3, 2),\n mergeElements = _useState4[0],\n setMergeElements = _useState4[1];\n\n // スロットが変更されたときの初期化処理\n var newSlotChangeKey = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n if (!serverSetting.serverSetting.modelSlots) {\n return \"\";\n }\n return serverSetting.serverSetting.modelSlots.reduce(function (prev, cur) {\n return prev + \"_\" + cur.modelFile;\n }, \"\");\n }, [serverSetting.serverSetting.modelSlots]);\n var filterItems = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return serverSetting.serverSetting.modelSlots.reduce(function (prev, cur) {\n if (cur.voiceChangerType != \"RVC\") {\n return prev;\n }\n var curRVC = cur;\n var key = \"\".concat(curRVC.modelType, \",\").concat(cur.samplingRate, \",\").concat(curRVC.embChannels);\n var val = {\n type: curRVC.modelType,\n samplingRate: cur.samplingRate,\n embChannels: curRVC.embChannels\n };\n var existKeys = Object.keys(prev);\n if (!cur.modelFile || cur.modelFile.length == 0) {\n return prev;\n }\n if (curRVC.modelType == \"onnxRVC\" || curRVC.modelType == \"onnxRVCNono\") {\n return prev;\n }\n if (!existKeys.includes(key)) {\n prev[key] = val;\n }\n return prev;\n }, {});\n }, [newSlotChangeKey]);\n var models = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return serverSetting.serverSetting.modelSlots.filter(function (x) {\n if (x.voiceChangerType != \"RVC\") {\n return;\n }\n var xRVC = x;\n var filterVals = filterItems[currentFilter];\n if (!filterVals) {\n return false;\n }\n if (xRVC.modelType == filterVals.type && xRVC.samplingRate == filterVals.samplingRate && xRVC.embChannels == filterVals.embChannels) {\n return true;\n } else {\n return false;\n }\n });\n }, [filterItems, currentFilter]);\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n if (Object.keys(filterItems).length > 0) {\n setCurrentFilter(Object.keys(filterItems)[0]);\n }\n }, [filterItems]);\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n var newMergeElements = models.map(function (x) {\n return {\n filename: x.modelFile,\n strength: 0\n };\n });\n setMergeElements(newMergeElements);\n }, [models]);\n var dialog = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var closeButtonRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-4-3 left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-text\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button-container body-button-container-space-around\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: function onClick() {\n guiState.stateControls.showMergeLabCheckbox.updateState(false);\n }\n }, \"close\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-text\"\n }));\n var filterOptions = Object.keys(filterItems).map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n }).filter(function (x) {\n return x != null;\n });\n var onMergeElementsChanged = function onMergeElementsChanged(filename, strength) {\n var newMergeElements = mergeElements.map(function (x) {\n if (x.filename == filename) {\n return {\n filename: x.filename,\n strength: strength\n };\n } else {\n return x;\n }\n });\n setMergeElements(newMergeElements);\n };\n var onMergeClicked = function onMergeClicked() {\n serverSetting.mergeModel({\n voiceChangerType: _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_4__.VoiceChangerType.RVC,\n command: \"mix\",\n files: mergeElements\n });\n };\n var modelList = mergeElements.map(function (x, index) {\n var _models$find;\n var name = ((_models$find = models.find(function (model) {\n return model.modelFile == x.filename;\n })) === null || _models$find === void 0 ? void 0 : _models$find.name) || \"\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n key: index,\n className: \"merge-lab-model-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"range\",\n className: \"body-item-input-slider\",\n min: \"0\",\n max: \"100\",\n step: \"1\",\n value: x.strength,\n onChange: function onChange(e) {\n onMergeElementsChanged(x.filename, Number(e.target.value));\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-val\"\n }, x.strength)));\n });\n var content = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"merge-lab-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"merge-lab-type-filter\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, \"Type:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n value: currentFilter,\n onChange: function onChange(e) {\n setCurrentFilter(e.target.value);\n }\n }, filterOptions))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"merge-lab-manipulator\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"merge-lab-model-list\"\n }, modelList), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"merge-lab-merge-buttons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"merge-lab-merge-buttons-notice\"\n }, \"The merged model is stored in the final slot. If you assign this slot, it will be overwritten.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"merge-lab-merge-button\",\n onClick: onMergeClicked\n }, \"merge\"))));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"dialog-frame\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"dialog-title\"\n }, \"MergeLab\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"dialog-content\"\n }, content, closeButtonRow));\n }, [newSlotChangeKey, currentFilter, mergeElements, models]);\n return dialog;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/905_MergeLabDialog.tsx?"); /***/ }), /***/ "./src/components/demo/906_AdvancedSettingDialog.tsx": /*!***********************************************************!*\ !*** ./src/components/demo/906_AdvancedSettingDialog.tsx ***! \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AdvancedSettingDialog: () => (/* binding */ AdvancedSettingDialog)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @dannadori/voice-changer-client-js */ \"./node_modules/@dannadori/voice-changer-client-js/dist/index.js\");\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6__);\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\n\n\nvar AdvancedSettingDialog = function AdvancedSettingDialog() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_4__.useGuiState)();\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)(),\n setting = _useAppState.setting,\n serverSetting = _useAppState.serverSetting,\n setWorkletNodeSetting = _useAppState.setWorkletNodeSetting,\n setWorkletSetting = _useAppState.setWorkletSetting;\n var dialog = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n var closeButtonRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-row split-3-4-3 left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-text\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-button-container body-button-container-space-around\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: function onClick() {\n guiState.stateControls.showAdvancedSettingCheckbox.updateState(false);\n }\n }, \"close\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-text\"\n }));\n var onProtocolChanged = /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n setWorkletNodeSetting(_objectSpread(_objectSpread({}, setting.workletNodeSetting), {}, {\n protocol: val\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onProtocolChanged(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n var protocolRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row-title\"\n }, \"protocol\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"select\", {\n value: setting.workletNodeSetting.protocol,\n onChange: function onChange(e) {\n onProtocolChanged(e.target.value);\n }\n }, Object.values(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6__.Protocol).map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n }))));\n var crossfaceRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row-title\"\n }, \"Crossfade\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row-field-crossfade-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", null, \"overlap:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"select\", {\n className: \"body-select\",\n value: serverSetting.serverSetting.crossFadeOverlapSize,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n crossFadeOverlapSize: Number(e.target.value)\n }));\n }\n }, Object.values(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6__.CrossFadeOverlapSize).map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", null, \"start:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"input\", {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.1,\n value: serverSetting.serverSetting.crossFadeOffsetRate,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n crossFadeOffsetRate: Number(e.target.value)\n }));\n }\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", null, \"end:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"input\", {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.1,\n value: serverSetting.serverSetting.crossFadeEndRate,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n crossFadeEndRate: Number(e.target.value)\n }));\n }\n }))))));\n var trancateRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row-title\"\n }, \"Trancate\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"input\", {\n type: \"number\",\n min: 5,\n max: 300,\n step: 1,\n value: setting.workletSetting.numTrancateTreshold,\n onChange: function onChange(e) {\n setWorkletSetting(_objectSpread(_objectSpread({}, setting.workletSetting), {}, {\n numTrancateTreshold: Number(e.target.value)\n }));\n }\n })));\n var onSilenceFrontChanged = function onSilenceFrontChanged(val) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n silenceFront: val\n }));\n };\n var silenceFrontRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row-title\"\n }, \"SilenceFront\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"select\", {\n value: serverSetting.serverSetting.silenceFront,\n onChange: function onChange(e) {\n onSilenceFrontChanged(Number(e.target.value));\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"option\", {\n value: \"0\"\n }, \"off\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"option\", {\n value: \"1\"\n }, \"on\"))));\n var protectRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row-title\"\n }, \"Protect\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"input\", {\n type: \"range\",\n className: \"body-item-input-slider\",\n min: \"0\",\n max: \"0.5\",\n step: \"0.1\",\n value: serverSetting.serverSetting.protect || 0,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n protect: Number(e.target.value)\n }));\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n className: \"body-item-input-slider-val\"\n }, serverSetting.serverSetting.protect))));\n var onRVCQualityChanged = function onRVCQualityChanged(val) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n rvcQuality: val\n }));\n };\n var rvcQualityRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row-title\"\n }, \"RVC Quality\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container-row-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"select\", {\n value: serverSetting.serverSetting.rvcQuality,\n onChange: function onChange(e) {\n onRVCQualityChanged(Number(e.target.value));\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"option\", {\n value: \"0\"\n }, \"low\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"option\", {\n value: \"1\"\n }, \"high\"))));\n var content = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"advanced-setting-container\"\n }, protocolRow, crossfaceRow, trancateRow, silenceFrontRow, protectRow, rvcQualityRow);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"dialog-frame\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"dialog-title\"\n }, \"Advanced Setting\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"dialog-content\"\n }, content, closeButtonRow));\n }, [serverSetting.serverSetting, serverSetting.updateServerSettings, setting.workletNodeSetting, setWorkletNodeSetting, setting.workletSetting, setWorkletSetting]);\n return dialog;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/906_AdvancedSettingDialog.tsx?"); /***/ }), /***/ "./src/components/demo/907_GetServerInfomationDialog.tsx": /*!***************************************************************!*\ !*** ./src/components/demo/907_GetServerInfomationDialog.tsx ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GetServerInfomationDialog: () => (/* binding */ GetServerInfomationDialog)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n\n\n\nvar GetServerInfomationDialog = function GetServerInfomationDialog() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__.useGuiState)();\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)(),\n serverSetting = _useAppState.serverSetting;\n var dialog = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var closeButtonRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-row split-3-4-3 left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-button-container body-button-container-space-around\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: function onClick() {\n guiState.stateControls.showGetServerInformationCheckbox.updateState(false);\n }\n }, \"close\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }));\n var content = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"get-server-information-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"textarea\", {\n className: \"get-server-information-text-area\",\n id: \"get-server-information-text-area\",\n value: JSON.stringify(serverSetting.serverSetting, null, 4),\n onChange: function onChange() {}\n }));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-frame\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-title\"\n }, \"Server Information\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-content\"\n }, content, closeButtonRow));\n }, [serverSetting.serverSetting]);\n return dialog;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/907_GetServerInfomationDialog.tsx?"); /***/ }), /***/ "./src/components/demo/908_GetClientInfomationDialog.tsx": /*!***************************************************************!*\ !*** ./src/components/demo/908_GetClientInfomationDialog.tsx ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GetClientInfomationDialog: () => (/* binding */ GetClientInfomationDialog)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../001_provider/001_AppRootProvider */ \"./src/001_provider/001_AppRootProvider.tsx\");\n\n\n\n\nvar GetClientInfomationDialog = function GetClientInfomationDialog() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__.useGuiState)();\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_3__.useAppRoot)(),\n audioContextState = _useAppRoot.audioContextState;\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)(),\n setting = _useAppState.setting;\n var dialog = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var _audioContextState$au, _audioContextState$au2, _audioContextState$au3, _audioContextState$au4, _audioContextState$au5, _audioContextState$au6;\n var closeButtonRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-row split-3-4-3 left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-button-container body-button-container-space-around\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: function onClick() {\n guiState.stateControls.showGetClientInformationCheckbox.updateState(false);\n }\n }, \"close\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }));\n var settingJson = JSON.stringify(setting, null, 4);\n var rootAudioContextJson = JSON.stringify({\n sampleRate: (_audioContextState$au = audioContextState.audioContext) === null || _audioContextState$au === void 0 ? void 0 : _audioContextState$au.sampleRate,\n baseLatency: (_audioContextState$au2 = audioContextState.audioContext) === null || _audioContextState$au2 === void 0 ? void 0 : _audioContextState$au2.baseLatency,\n currentTime: (_audioContextState$au3 = audioContextState.audioContext) === null || _audioContextState$au3 === void 0 ? void 0 : _audioContextState$au3.currentTime,\n outputLatency: (_audioContextState$au4 = audioContextState.audioContext) === null || _audioContextState$au4 === void 0 ? void 0 : _audioContextState$au4.outputLatency,\n // @ts-ignore\n sinkId: (_audioContextState$au5 = audioContextState.audioContext) === null || _audioContextState$au5 === void 0 ? void 0 : _audioContextState$au5.sinkId,\n state: (_audioContextState$au6 = audioContextState.audioContext) === null || _audioContextState$au6 === void 0 ? void 0 : _audioContextState$au6.state\n }, null, 4);\n var concatJson = settingJson + \"\\n\" + rootAudioContextJson;\n console.log(\"AUDIO_CONTEXT\", audioContextState.audioContext);\n var content = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"get-server-information-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"textarea\", {\n className: \"get-server-information-text-area\",\n id: \"get-server-information-text-area\",\n value: concatJson,\n onChange: function onChange() {}\n }));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-frame\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-title\"\n }, \"Client Information\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-content\"\n }, content, closeButtonRow));\n }, [setting, audioContextState]);\n return dialog;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/908_GetClientInfomationDialog.tsx?"); /***/ }), /***/ "./src/components/demo/910_Dialogs2.tsx": /*!**********************************************!*\ !*** ./src/components/demo/910_Dialogs2.tsx ***! \**********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Dialogs2: () => (/* binding */ Dialogs2)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _911_TextInputDialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./911_TextInputDialog */ \"./src/components/demo/911_TextInputDialog.tsx\");\n/* harmony import */ var _912_ShowLicenseDialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./912_ShowLicenseDialog */ \"./src/components/demo/912_ShowLicenseDialog.tsx\");\n\n\n\n\nvar Dialogs2 = function Dialogs2() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__.useGuiState)();\n var dialogs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, guiState.stateControls.showTextInputCheckbox.trigger, guiState.stateControls.showLicenseCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-container2\",\n id: \"dialog2\"\n }, guiState.stateControls.showTextInputCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_911_TextInputDialog__WEBPACK_IMPORTED_MODULE_2__.TextInputDialog, null), guiState.stateControls.showLicenseCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_912_ShowLicenseDialog__WEBPACK_IMPORTED_MODULE_3__.ShowLicenseDialog, null)));\n return dialogs;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/910_Dialogs2.tsx?"); /***/ }), /***/ "./src/components/demo/911_TextInputDialog.tsx": /*!*****************************************************!*\ !*** ./src/components/demo/911_TextInputDialog.tsx ***! \*****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TextInputDialog: () => (/* binding */ TextInputDialog)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n\n\nvar TextInputDialog = function TextInputDialog() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__.useGuiState)();\n var dialog = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var buttonsRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-row split-3-4-3 left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-button-container body-button-container-space-around\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: function onClick() {\n var inputText = document.getElementById(\"input-text\");\n var text = inputText.value;\n inputText.value = \"\";\n if (guiState.textInputResolve) {\n guiState.textInputResolve.resolve(text);\n guiState.setTextInputResolve(null);\n }\n guiState.stateControls.showTextInputCheckbox.updateState(false);\n }\n }, \"ok\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: function onClick() {\n var inputText = document.getElementById(\"input-text\");\n inputText.value = \"\";\n if (guiState.textInputResolve) {\n guiState.textInputResolve.resolve(\"\");\n guiState.setTextInputResolve(null);\n }\n guiState.stateControls.showTextInputCheckbox.updateState(false);\n }\n }, \"cancel\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }));\n var textInput = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"input-text-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, \"Input Text: \"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n id: \"input-text\",\n type: \"text\"\n }));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-frame\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-title\"\n }, \"Input Dialog\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-content\"\n }, textInput, buttonsRow));\n }, [guiState.textInputResolve]);\n return dialog;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/911_TextInputDialog.tsx?"); /***/ }), /***/ "./src/components/demo/912_ShowLicenseDialog.tsx": /*!*******************************************************!*\ !*** ./src/components/demo/912_ShowLicenseDialog.tsx ***! \*******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("var __filename = \"/index.js\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ShowLicenseDialog: () => (/* binding */ ShowLicenseDialog)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _const__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../const */ \"./src/const.ts\");\n/* harmony import */ var _hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../hooks/useMessageBuilder */ \"./src/hooks/useMessageBuilder.ts\");\n////// Currently not used /////////\n\n\n\n\n\nvar ShowLicenseDialog = function ShowLicenseDialog() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__.useGuiState)();\n var messageBuilderState = (0,_hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_3__.useMessageBuilder)();\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n messageBuilderState.setMessage(__filename, \"nsf_hifigan1\", {\n ja: \"Diffusion SVC, DDSP SVCはvocodeerはDiffSinger Community Vocodersを使用しています。次のリンクからライセンスをご確認ください。\",\n en: \"Diffusion SVC and DDSP SVC uses DiffSinger Community Vocoders. Please check the license from the following link.\"\n });\n messageBuilderState.setMessage(__filename, \"nsf_hifigan2\", {\n ja: \"別のモデルを使用する場合はpretrain\\\\nsf_hifiganに設置してください。\",\n en: \"Please place it on pretrain\\\\nsf_hifigan if you are using a different model.\"\n });\n }, []);\n var hifiGanLink = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return (0,_const__WEBPACK_IMPORTED_MODULE_2__.isDesktopApp)() ?\n /*#__PURE__*/\n // @ts-ignore\n react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"link\",\n onClick: function onClick() {\n // @ts-ignore\n window.electronAPI.openBrowser(\"https://openvpi.github.io/vocoders/\");\n }\n }, \"license\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n className: \"link\",\n href: \"https://openvpi.github.io/vocoders/\",\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, \"license\");\n }, []);\n var dialog = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var hifiganMessage = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-content-part\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, messageBuilderState.getMessage(__filename, \"nsf_hifigan1\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, messageBuilderState.getMessage(__filename, \"nsf_hifigan2\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, hifiGanLink));\n var buttonsRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-row split-3-4-3 left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-button-container body-button-container-space-around\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: function onClick() {\n guiState.stateControls.showLicenseCheckbox.updateState(false);\n }\n }, \"close\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-frame\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-title\"\n }, \"Input Dialog\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-content\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-row\"\n }, hifiganMessage), buttonsRow));\n }, [guiState.textInputResolve]);\n return dialog;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/912_ShowLicenseDialog.tsx?"); /***/ }), /***/ "./src/components/demo/b00_ModelSlotControl.tsx": /*!******************************************************!*\ !*** ./src/components/demo/b00_ModelSlotControl.tsx ***! \******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ModelSlotControl: () => (/* binding */ ModelSlotControl)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../001_provider/001_AppRootProvider */ \"./src/001_provider/001_AppRootProvider.tsx\");\n/* harmony import */ var _002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./002_ComponentGenerator */ \"./src/components/demo/002_ComponentGenerator.tsx\");\n\n\n\nvar ModelSlotControl = function ModelSlotControl() {\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_1__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var componentSettings = appGuiSettingState.appGuiSetting.front.modelSlotControl;\n var deviceSetting = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n if (!componentSettings || componentSettings.length == 0) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n }\n var components = componentSettings.map(function (x, index) {\n var c = (0,_002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_2__.generateComponent)(x.name, x.options);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n key: \"\".concat(x.name, \"_\").concat(index)\n }, c);\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"partition\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"partition-content\"\n }, components)));\n }, []);\n return deviceSetting;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/b00_ModelSlotControl.tsx?"); /***/ }), /***/ "./src/components/demo/components2/001_HeaderArea.tsx": /*!************************************************************!*\ !*** ./src/components/demo/components2/001_HeaderArea.tsx ***! \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("var __filename = \"/index.js\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ HeaderArea: () => (/* binding */ HeaderArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _const__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../const */ \"./src/const.ts\");\n/* harmony import */ var _001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../001_provider/001_AppRootProvider */ \"./src/001_provider/001_AppRootProvider.tsx\");\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @dannadori/voice-changer-client-js */ \"./node_modules/@dannadori/voice-changer-client-js/dist/index.js\");\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../hooks/useMessageBuilder */ \"./src/hooks/useMessageBuilder.ts\");\n\n\n\n\n\n\n\n\nvar HeaderArea = function HeaderArea(props) {\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_4__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var messageBuilderState = (0,_hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_7__.useMessageBuilder)();\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)(),\n clearSetting = _useAppState.clearSetting;\n var _useIndexedDB = (0,_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6__.useIndexedDB)({\n clientType: null\n }),\n removeItem = _useIndexedDB.removeItem;\n (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n messageBuilderState.setMessage(__filename, \"github\", {\n \"ja\": \"github\",\n \"en\": \"github\"\n });\n messageBuilderState.setMessage(__filename, \"manual\", {\n \"ja\": \"マニュアル\",\n \"en\": \"manual\"\n });\n messageBuilderState.setMessage(__filename, \"screenCapture\", {\n \"ja\": \"録画ツール\",\n \"en\": \"Record Screen\"\n });\n messageBuilderState.setMessage(__filename, \"support\", {\n \"ja\": \"支援\",\n \"en\": \"Donation\"\n });\n }, []);\n var githubLink = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n return (0,_const__WEBPACK_IMPORTED_MODULE_3__.isDesktopApp)() ?\n /*#__PURE__*/\n // @ts-ignore\n react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"link tooltip\",\n onClick: function onClick() {\n window.electronAPI.openBrowser(\"https://github.com/w-okada/voice-changer\");\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"img\", {\n src: \"./assets/icons/github.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"tooltip-text\"\n }, messageBuilderState.getMessage(__filename, \"github\"))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"a\", {\n className: \"link tooltip\",\n href: \"https://github.com/w-okada/voice-changer\",\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"img\", {\n src: \"./assets/icons/github.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"tooltip-text\"\n }, messageBuilderState.getMessage(__filename, \"github\")));\n }, []);\n var manualLink = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n return (0,_const__WEBPACK_IMPORTED_MODULE_3__.isDesktopApp)() ?\n /*#__PURE__*/\n // @ts-ignore\n react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"link tooltip\",\n onClick: function onClick() {\n window.electronAPI.openBrowser(\"https://github.com/w-okada/voice-changer/blob/master/tutorials/tutorial_rvc_ja_latest.md\");\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"img\", {\n src: \"./assets/icons/help-circle.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-100px\"\n }, messageBuilderState.getMessage(__filename, \"manual\"))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"a\", {\n className: \"link tooltip\",\n href: \"https://github.com/w-okada/voice-changer/blob/master/tutorials/tutorial_rvc_ja_latest.md\",\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"img\", {\n src: \"./assets/icons/help-circle.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-100px\"\n }, messageBuilderState.getMessage(__filename, \"manual\")));\n }, []);\n var toolLink = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n return (0,_const__WEBPACK_IMPORTED_MODULE_3__.isDesktopApp)() ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"link tooltip\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"img\", {\n src: \"./assets/icons/tool.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-100px\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"p\", {\n onClick: function onClick() {\n // @ts-ignore\n window.electronAPI.openBrowser(\"https://w-okada.github.io/screen-recorder-ts/\");\n }\n }, messageBuilderState.getMessage(__filename, \"screenCapture\")))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"link tooltip\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"img\", {\n src: \"./assets/icons/tool.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-100px\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"p\", {\n onClick: function onClick() {\n window.open(\"https://w-okada.github.io/screen-recorder-ts/\", '_blank', \"noreferrer\");\n }\n }, messageBuilderState.getMessage(__filename, \"screenCapture\"))));\n }, []);\n var coffeeLink = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n return (0,_const__WEBPACK_IMPORTED_MODULE_3__.isDesktopApp)() ?\n /*#__PURE__*/\n // @ts-ignore\n react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"link tooltip\",\n onClick: function onClick() {\n window.electronAPI.openBrowser(\"https://www.buymeacoffee.com/wokad\");\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"img\", {\n className: \"donate-img\",\n src: \"./assets/buymeacoffee.png\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-100px\"\n }, messageBuilderState.getMessage(__filename, \"support\"))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"a\", {\n className: \"link tooltip\",\n href: \"https://www.buymeacoffee.com/wokad\",\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"img\", {\n className: \"donate-img\",\n src: \"./assets/buymeacoffee.png\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-100px\"\n }, messageBuilderState.getMessage(__filename, \"support\")));\n }, []);\n var headerArea = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n var onClearSettingClicked = /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return clearSetting();\n case 2:\n _context.next = 4;\n return removeItem(_const__WEBPACK_IMPORTED_MODULE_3__.INDEXEDDB_KEY_AUDIO_OUTPUT);\n case 4:\n location.reload();\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onClearSettingClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"headerArea\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"title1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"title\"\n }, props.mainTitle), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"title-version\"\n }, props.subTitle), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"title-version-number\"\n }, appGuiSettingState.version), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"title-version-number\"\n }, appGuiSettingState.edition)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"icons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"belongings\"\n }, githubLink, manualLink, toolLink, coffeeLink), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"belongings\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"belongings-button\",\n onClick: onClearSettingClicked\n }, \"clear setting\"))));\n }, [props.subTitle, props.mainTitle, appGuiSettingState.version, appGuiSettingState.edition]);\n return headerArea;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/001_HeaderArea.tsx?"); /***/ }), /***/ "./src/components/demo/components2/100_ModelSlotArea.tsx": /*!***************************************************************!*\ !*** ./src/components/demo/components2/100_ModelSlotArea.tsx ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("var __filename = \"/index.js\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ModelSlotArea: () => (/* binding */ ModelSlotArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../hooks/useMessageBuilder */ \"./src/hooks/useMessageBuilder.ts\");\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\n\n\nvar ModelSlotArea = function ModelSlotArea(_props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__.useAppState)(),\n serverSetting = _useAppState.serverSetting,\n getInfo = _useAppState.getInfo;\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_5__.useGuiState)();\n var messageBuilderState = (0,_hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_6__.useMessageBuilder)();\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n messageBuilderState.setMessage(__filename, \"edit\", {\n \"ja\": \"編集\",\n \"en\": \"edit\"\n });\n }, []);\n var modelTiles = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n if (!serverSetting.serverSetting.modelSlots) {\n return [];\n }\n return serverSetting.serverSetting.modelSlots.map(function (x, index) {\n if (!x.modelFile || x.modelFile.length == 0) {\n return null;\n }\n var tileContainerClass = index == serverSetting.serverSetting.modelSlotIndex ? \"model-slot-tile-container-selected\" : \"model-slot-tile-container\";\n var name = x.name.length > 8 ? x.name.substring(0, 7) + \"...\" : x.name;\n var iconElem = x.iconFile.length > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"img\", {\n className: \"model-slot-tile-icon\",\n src: x.iconFile,\n alt: x.name\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-tile-vctype\"\n }, x.voiceChangerType)) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-tile-icon-no-entry\"\n }, \"no image\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-tile-vctype\"\n }, x.voiceChangerType));\n var clickAction = /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee() {\n var dummyModelSlotIndex;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n dummyModelSlotIndex = Math.floor(Date.now() / 1000) * 1000 + index;\n _context.next = 3;\n return serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n modelSlotIndex: dummyModelSlotIndex\n }));\n case 3:\n setTimeout(function () {\n // quick hack\n getInfo();\n }, 1000 * 2);\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function clickAction() {\n return _ref.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n key: index,\n className: tileContainerClass,\n onClick: clickAction\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-tile-icon-div\"\n }, iconElem), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-tile-dscription\"\n }, name));\n }).filter(function (x) {\n return x != null;\n });\n }, [serverSetting.serverSetting.modelSlots, serverSetting.serverSetting.modelSlotIndex]);\n var modelSlotArea = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n var onModelSlotEditClicked = function onModelSlotEditClicked() {\n guiState.stateControls.showModelSlotManagerCheckbox.updateState(true);\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-area\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-panel\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-tiles-container\"\n }, modelTiles), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-buttons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"model-slot-button\",\n onClick: onModelSlotEditClicked\n }, messageBuilderState.getMessage(__filename, \"edit\")))));\n }, [modelTiles]);\n return modelSlotArea;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/100_ModelSlotArea.tsx?"); /***/ }), /***/ "./src/components/demo/components2/101-1_TuningArea.tsx": /*!**************************************************************!*\ !*** ./src/components/demo/components2/101-1_TuningArea.tsx ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TuningArea: () => (/* binding */ TuningArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\nvar TuningArea = function TuningArea(_props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__.useAppState)(),\n serverSetting = _useAppState.serverSetting;\n var selected = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n if (serverSetting.serverSetting.modelSlotIndex == undefined) {\n return;\n }\n return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];\n }, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);\n var tuningArea = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n if (!selected) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null);\n }\n if (selected.voiceChangerType == \"MMVCv13\" || selected.voiceChangerType == \"MMVCv15\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null);\n }\n var currentTuning = serverSetting.serverSetting.tran;\n var tranValueUpdatedAction = /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n tran: val\n }));\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function tranValueUpdatedAction(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }, \"TUNE:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"input\", {\n type: \"range\",\n min: \"-50\",\n max: \"50\",\n step: \"1\",\n value: currentTuning,\n onChange: function onChange(e) {\n tranValueUpdatedAction(Number(e.target.value));\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n className: \"character-area-slider-control-val\"\n }, currentTuning))));\n }, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected]);\n return tuningArea;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/101-1_TuningArea.tsx?"); /***/ }), /***/ "./src/components/demo/components2/101-2_IndexArea.tsx": /*!*************************************************************!*\ !*** ./src/components/demo/components2/101-2_IndexArea.tsx ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IndexArea: () => (/* binding */ IndexArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\nvar IndexArea = function IndexArea(_props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__.useAppState)(),\n serverSetting = _useAppState.serverSetting;\n var selected = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n if (serverSetting.serverSetting.modelSlotIndex == undefined) {\n return;\n }\n return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];\n }, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);\n var indexArea = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n if (!selected) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null);\n }\n if (selected.voiceChangerType != \"RVC\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null);\n }\n var currentIndexRatio = serverSetting.serverSetting.indexRatio;\n var indexRatioValueUpdatedAction = /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n indexRatio: val\n }));\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function indexRatioValueUpdatedAction(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }, \"INDEX:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"input\", {\n type: \"range\",\n min: \"0\",\n max: \"1\",\n step: \"0.1\",\n value: currentIndexRatio,\n onChange: function onChange(e) {\n indexRatioValueUpdatedAction(Number(e.target.value));\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n className: \"character-area-slider-control-val\"\n }, currentIndexRatio))));\n }, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected]);\n return indexArea;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/101-2_IndexArea.tsx?"); /***/ }), /***/ "./src/components/demo/components2/101-3_SpeakerArea.tsx": /*!***************************************************************!*\ !*** ./src/components/demo/components2/101-3_SpeakerArea.tsx ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SpeakerArea: () => (/* binding */ SpeakerArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\nvar SpeakerArea = function SpeakerArea(_props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__.useAppState)(),\n serverSetting = _useAppState.serverSetting;\n var selected = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n if (serverSetting.serverSetting.modelSlotIndex == undefined) {\n return;\n }\n return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];\n }, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);\n var srcArea = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n if (!selected) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null);\n }\n if (selected.voiceChangerType != \"MMVCv13\" && selected.voiceChangerType != \"MMVCv15\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null);\n }\n var options = Object.keys(selected.speakers).map(function (key) {\n var val = selected.speakers[Number(key)];\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"option\", {\n key: key,\n value: key\n }, val, \"[\", key, \"]\");\n });\n var srcSpeakerValueUpdatedAction = /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n srcId: val\n }));\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function srcSpeakerValueUpdatedAction(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }, \"Voice:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }, \"src\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"select\", {\n value: serverSetting.serverSetting.srcId,\n onChange: function onChange(e) {\n srcSpeakerValueUpdatedAction(Number(e.target.value));\n }\n }, options)))));\n }, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected]);\n var dstArea = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n if (!selected) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null);\n }\n var options = Object.keys(selected.speakers).map(function (key) {\n var val = selected.speakers[Number(key)];\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"option\", {\n key: key,\n value: key\n }, val, \"[\", key, \"]\");\n });\n var srcSpeakerValueUpdatedAction = /*#__PURE__*/function () {\n var _ref2 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee2(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n dstId: val\n }));\n case 2:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function srcSpeakerValueUpdatedAction(_x2) {\n return _ref2.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }, selected.voiceChangerType == \"DDSP-SVC\" || selected.voiceChangerType == \"so-vits-svc-40\" || selected.voiceChangerType == \"RVC\" ? \"Voice:\" : \"\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }, selected.voiceChangerType == \"MMVCv13\" || selected.voiceChangerType == \"MMVCv15\" ? \"dst\" : \"\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"select\", {\n value: serverSetting.serverSetting.dstId,\n onChange: function onChange(e) {\n srcSpeakerValueUpdatedAction(Number(e.target.value));\n }\n }, options)))));\n }, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected]);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null, srcArea, dstArea);\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/101-3_SpeakerArea.tsx?"); /***/ }), /***/ "./src/components/demo/components2/101-4_F0FactorArea.tsx": /*!****************************************************************!*\ !*** ./src/components/demo/components2/101-4_F0FactorArea.tsx ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ F0FactorArea: () => (/* binding */ F0FactorArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\nvar F0FactorArea = function F0FactorArea(_props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)(),\n serverSetting = _useAppState.serverSetting;\n var selected = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n if (serverSetting.serverSetting.modelSlotIndex == undefined) {\n return;\n }\n return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];\n }, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);\n var f0FactorArea = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n if (!selected) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n }\n if (selected.voiceChangerType != \"MMVCv15\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n }\n var selectedMMVCv15 = selected;\n var recommendF0 = (selectedMMVCv15.f0[serverSetting.serverSetting.dstId] / selectedMMVCv15.f0[serverSetting.serverSetting.srcId]).toFixed(2);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }, \"F0Factor:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"range\",\n min: \"0.01\",\n max: \"5.00\",\n step: \"0.01\",\n value: serverSetting.serverSetting.f0Factor,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n f0Factor: Number(e.target.value)\n }));\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-val\"\n }, serverSetting.serverSetting.f0Factor)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-text\"\n }, \"recommend:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-text\"\n }, recommendF0)))));\n }, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected]);\n return f0FactorArea;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/101-4_F0FactorArea.tsx?"); /***/ }), /***/ "./src/components/demo/components2/101-5_so-vits-svc40SettingArea.tsx": /*!****************************************************************************!*\ !*** ./src/components/demo/components2/101-5_so-vits-svc40SettingArea.tsx ***! \****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoVitsSVC40SettingArea: () => (/* binding */ SoVitsSVC40SettingArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\nvar SoVitsSVC40SettingArea = function SoVitsSVC40SettingArea(_props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)(),\n serverSetting = _useAppState.serverSetting;\n var selected = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n if (serverSetting.serverSetting.modelSlotIndex == undefined) {\n return;\n }\n return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];\n }, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);\n var settingArea = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n if (!selected) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n }\n if (selected.voiceChangerType != \"so-vits-svc-40\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n }\n var cluster = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }, \"Cluster:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"range\",\n min: \"0\",\n max: \"1.0\",\n step: \"0.1\",\n value: serverSetting.serverSetting.clusterInferRatio,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n clusterInferRatio: Number(e.target.value)\n }));\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-val\"\n }, serverSetting.serverSetting.clusterInferRatio))));\n var noise = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }, \"Noise:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"range\",\n min: \"0\",\n max: \"1.0\",\n step: \"0.1\",\n value: serverSetting.serverSetting.noiseScale,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n noiseScale: Number(e.target.value)\n }));\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-val\"\n }, serverSetting.serverSetting.noiseScale))));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, cluster, noise);\n }, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected]);\n return settingArea;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/101-5_so-vits-svc40SettingArea.tsx?"); /***/ }), /***/ "./src/components/demo/components2/101-6_ddsp-svc30SettingArea.tsx": /*!*************************************************************************!*\ !*** ./src/components/demo/components2/101-6_ddsp-svc30SettingArea.tsx ***! \*************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DDSPSVC30SettingArea: () => (/* binding */ DDSPSVC30SettingArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\nvar DDSPSVC30SettingArea = function DDSPSVC30SettingArea(_props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)(),\n serverSetting = _useAppState.serverSetting;\n var selected = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n if (serverSetting.serverSetting.modelSlotIndex == undefined) {\n return;\n }\n return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];\n }, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);\n var settingArea = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n if (!selected) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n }\n if (selected.voiceChangerType != \"DDSP-SVC\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n }\n var acc = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }, \"ACC:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"range\",\n min: \"1\",\n max: \"20\",\n step: \"1\",\n value: serverSetting.serverSetting.diffAcc,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n diffAcc: Number(e.target.value)\n }));\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-val\"\n }, serverSetting.serverSetting.diffAcc))));\n var kstep = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }, \"Kstep:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"range\",\n min: \"21\",\n max: \"300\",\n step: \"1\",\n value: serverSetting.serverSetting.kStep,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n kStep: Number(e.target.value)\n }));\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"character-area-slider-control-val\"\n }, serverSetting.serverSetting.kStep))));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, acc, kstep);\n }, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected]);\n return settingArea;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/101-6_ddsp-svc30SettingArea.tsx?"); /***/ }), /***/ "./src/components/demo/components2/101-7_diffusion-svcSettingArea.tsx": /*!****************************************************************************!*\ !*** ./src/components/demo/components2/101-7_diffusion-svcSettingArea.tsx ***! \****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DiffusionSVCSettingArea: () => (/* binding */ DiffusionSVCSettingArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\nvar DiffusionSVCSettingArea = function DiffusionSVCSettingArea(_props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__.useAppState)(),\n serverSetting = _useAppState.serverSetting;\n var selected = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n if (serverSetting.serverSetting.modelSlotIndex == undefined) {\n return;\n }\n return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];\n }, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);\n var settingArea = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n if (!selected) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n }\n if (selected.voiceChangerType != \"Diffusion-SVC\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n }\n var skipValues = getDivisors(serverSetting.serverSetting.kStep);\n skipValues.pop();\n var kStepRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }, \"k-step:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"input\", {\n type: \"range\",\n min: \"2\",\n max: selected.kStepMax,\n step: \"1\",\n value: serverSetting.serverSetting.kStep,\n onChange: function onChange(e) {\n var newKStep = Number(e.target.value);\n var newSkipValues = getDivisors(Number(e.target.value));\n newSkipValues.pop();\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n speedUp: Math.max.apply(Math, (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(newSkipValues)),\n kStep: newKStep\n }));\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"character-area-slider-control-val\"\n }, serverSetting.serverSetting.kStep))));\n var speedUpRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }, \"skip\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"select\", {\n name: \"\",\n id: \"\",\n value: serverSetting.serverSetting.speedUp,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n speedUp: Number(e.target.value)\n }));\n }\n }, skipValues.map(function (v) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"option\", {\n value: v,\n key: v\n }, v);\n }))))));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, kStepRow, speedUpRow);\n }, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected]);\n return settingArea;\n};\nvar getDivisors = function getDivisors(num) {\n var divisors = [];\n var end = Math.sqrt(num);\n for (var i = 1; i <= end; i++) {\n if (num % i === 0) {\n divisors.push(i);\n if (i !== num / i) {\n divisors.push(num / i);\n }\n }\n }\n return divisors.sort(function (a, b) {\n return a - b;\n });\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/101-7_diffusion-svcSettingArea.tsx?"); /***/ }), /***/ "./src/components/demo/components2/101_CharacterArea.tsx": /*!***************************************************************!*\ !*** ./src/components/demo/components2/101_CharacterArea.tsx ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("var __filename = \"/index.js\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CharacterArea: () => (/* binding */ CharacterArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../hooks/useMessageBuilder */ \"./src/hooks/useMessageBuilder.ts\");\n/* harmony import */ var _101_1_TuningArea__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./101-1_TuningArea */ \"./src/components/demo/components2/101-1_TuningArea.tsx\");\n/* harmony import */ var _101_2_IndexArea__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./101-2_IndexArea */ \"./src/components/demo/components2/101-2_IndexArea.tsx\");\n/* harmony import */ var _101_3_SpeakerArea__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./101-3_SpeakerArea */ \"./src/components/demo/components2/101-3_SpeakerArea.tsx\");\n/* harmony import */ var _101_4_F0FactorArea__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./101-4_F0FactorArea */ \"./src/components/demo/components2/101-4_F0FactorArea.tsx\");\n/* harmony import */ var _101_5_so_vits_svc40SettingArea__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./101-5_so-vits-svc40SettingArea */ \"./src/components/demo/components2/101-5_so-vits-svc40SettingArea.tsx\");\n/* harmony import */ var _101_6_ddsp_svc30SettingArea__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./101-6_ddsp-svc30SettingArea */ \"./src/components/demo/components2/101-6_ddsp-svc30SettingArea.tsx\");\n/* harmony import */ var _101_7_diffusion_svcSettingArea__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./101-7_diffusion-svcSettingArea */ \"./src/components/demo/components2/101-7_diffusion-svcSettingArea.tsx\");\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\n\n\n\n\n\n\n\n\n\nvar CharacterArea = function CharacterArea(_props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)(),\n serverSetting = _useAppState.serverSetting,\n initializedRef = _useAppState.initializedRef,\n volume = _useAppState.volume,\n bufferingTime = _useAppState.bufferingTime,\n performance = _useAppState.performance,\n setting = _useAppState.setting,\n setVoiceChangerClientSetting = _useAppState.setVoiceChangerClientSetting,\n start = _useAppState.start,\n stop = _useAppState.stop;\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_6__.useGuiState)();\n var messageBuilderState = (0,_hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_7__.useMessageBuilder)();\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n messageBuilderState.setMessage(__filename, \"terms_of_use\", {\n ja: \"利用規約\",\n en: \"terms of use\"\n });\n messageBuilderState.setMessage(__filename, \"export_to_onnx\", {\n ja: \"onnx出力\",\n en: \"export to onnx\"\n });\n messageBuilderState.setMessage(__filename, \"save_default\", {\n ja: \"設定保存\",\n en: \"save setting\"\n });\n messageBuilderState.setMessage(__filename, \"alert_onnx\", {\n ja: \"ボイチェン中はonnx出力できません\",\n en: \"cannot export onnx when voice conversion is enabled\"\n });\n }, []);\n var selected = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (serverSetting.serverSetting.modelSlotIndex == undefined) {\n return;\n }\n return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];\n }, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n var vol = document.getElementById(\"status-vol\");\n var buf = document.getElementById(\"status-buf\");\n var res = document.getElementById(\"status-res\");\n if (!vol || !buf || !res) {\n return;\n }\n vol.innerText = volume.toFixed(4);\n buf.innerText = bufferingTime.toString();\n res.innerText = performance.responseTime.toString();\n }, [volume, bufferingTime, performance]);\n var portrait = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (!selected) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n var icon = selected.iconFile.length > 0 ? selected.iconFile : \"./assets/icons/human.png\";\n var selectedTermOfUseUrlLink = selected.termsOfUseUrl ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"a\", {\n href: selected.termsOfUseUrl,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n className: \"portrait-area-terms-of-use-link\"\n }, \"[\", messageBuilderState.getMessage(__filename, \"terms_of_use\"), \"]\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"portrait-area\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"portrait-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"img\", {\n className: \"portrait\",\n src: icon,\n alt: selected.name\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"portrait-area-status\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"p\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"portrait-area-status-vctype\"\n }, selected.voiceChangerType)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"p\", null, \"vol: \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n id: \"status-vol\"\n }, \"0\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"p\", null, \"buf: \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n id: \"status-buf\"\n }, \"0\"), \" ms\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"p\", null, \"res: \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n id: \"status-res\"\n }, \"0\"), \" ms\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"portrait-area-terms-of-use\"\n }, selectedTermOfUseUrlLink)));\n }, [selected]);\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useState, 2),\n startWithAudioContextCreate = _useState2[0],\n setStartWithAudioContextCreate = _useState2[1];\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n if (!startWithAudioContextCreate) {\n return;\n }\n guiState.setIsConverting(true);\n start();\n }, [startWithAudioContextCreate]);\n var startControl = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n var onStartClicked = /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(serverSetting.serverSetting.enableServerAudio == 0)) {\n _context.next = 17;\n break;\n }\n if (initializedRef.current) {\n _context.next = 12;\n break;\n }\n case 2:\n if (false) {}\n _context.next = 5;\n return new Promise(function (resolve) {\n setTimeout(resolve, 500);\n });\n case 5:\n if (!initializedRef.current) {\n _context.next = 7;\n break;\n }\n return _context.abrupt(\"break\", 9);\n case 7:\n _context.next = 2;\n break;\n case 9:\n setStartWithAudioContextCreate(true);\n _context.next = 15;\n break;\n case 12:\n guiState.setIsConverting(true);\n _context.next = 15;\n return start();\n case 15:\n _context.next = 19;\n break;\n case 17:\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverAudioStated: 1\n }));\n guiState.setIsConverting(true);\n case 19:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onStartClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n var onStopClicked = /*#__PURE__*/function () {\n var _ref2 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee2() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n if (!(serverSetting.serverSetting.enableServerAudio == 0)) {\n _context2.next = 6;\n break;\n }\n guiState.setIsConverting(false);\n _context2.next = 4;\n return stop();\n case 4:\n _context2.next = 8;\n break;\n case 6:\n guiState.setIsConverting(false);\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverAudioStated: 0\n }));\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function onStopClicked() {\n return _ref2.apply(this, arguments);\n };\n }();\n var startClassName = guiState.isConverting ? \"character-area-control-button-active\" : \"character-area-control-button-stanby\";\n var stopClassName = guiState.isConverting ? \"character-area-control-button-stanby\" : \"character-area-control-button-active\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-buttons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: onStartClicked,\n className: startClassName\n }, \"start\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: onStopClicked,\n className: stopClassName\n }, \"stop\")));\n }, [guiState.isConverting, start, stop, serverSetting.serverSetting, serverSetting.updateServerSettings]);\n var gainControl = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n var currentInputGain = serverSetting.serverSetting.enableServerAudio == 0 ? setting.voiceChangerClientSetting.inputGain : serverSetting.serverSetting.serverInputAudioGain;\n var inputValueUpdatedAction = serverSetting.serverSetting.enableServerAudio == 0 ? /*#__PURE__*/function () {\n var _ref3 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee3(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return setVoiceChangerClientSetting(_objectSpread(_objectSpread({}, setting.voiceChangerClientSetting), {}, {\n inputGain: val\n }));\n case 2:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return function (_x) {\n return _ref3.apply(this, arguments);\n };\n }() : /*#__PURE__*/function () {\n var _ref4 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee4(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverInputAudioGain: val\n }));\n case 2:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return function (_x2) {\n return _ref4.apply(this, arguments);\n };\n }();\n var currentOutputGain = serverSetting.serverSetting.enableServerAudio == 0 ? setting.voiceChangerClientSetting.outputGain : serverSetting.serverSetting.serverOutputAudioGain;\n var outputValueUpdatedAction = serverSetting.serverSetting.enableServerAudio == 0 ? /*#__PURE__*/function () {\n var _ref5 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee5(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.next = 2;\n return setVoiceChangerClientSetting(_objectSpread(_objectSpread({}, setting.voiceChangerClientSetting), {}, {\n outputGain: val\n }));\n case 2:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5);\n }));\n return function (_x3) {\n return _ref5.apply(this, arguments);\n };\n }() : /*#__PURE__*/function () {\n var _ref6 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee6(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n _context6.next = 2;\n return serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverOutputAudioGain: val\n }));\n case 2:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6);\n }));\n return function (_x4) {\n return _ref6.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }, \"GAIN:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }, \"in\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"input\", {\n type: \"range\",\n min: \"0.1\",\n max: \"10.0\",\n step: \"0.1\",\n value: currentInputGain,\n onChange: function onChange(e) {\n inputValueUpdatedAction(Number(e.target.value));\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-val\"\n }, currentInputGain)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }, \"out\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"input\", {\n type: \"range\",\n min: \"0.1\",\n max: \"10.0\",\n step: \"0.1\",\n value: currentOutputGain,\n onChange: function onChange(e) {\n outputValueUpdatedAction(Number(e.target.value));\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-val\"\n }, currentOutputGain))));\n }, [serverSetting.serverSetting, setting, setVoiceChangerClientSetting, serverSetting.updateServerSettings]);\n var modelSlotControl = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (!selected) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n var onUpdateDefaultClicked = /*#__PURE__*/function () {\n var _ref7 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee7() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n _context7.next = 2;\n return serverSetting.updateModelDefault();\n case 2:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7);\n }));\n return function onUpdateDefaultClicked() {\n return _ref7.apply(this, arguments);\n };\n }();\n var onnxExportButtonAction = /*#__PURE__*/function () {\n var _ref8 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee8() {\n var _document$getElementB;\n var res, a;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n if (!guiState.isConverting) {\n _context8.next = 3;\n break;\n }\n alert(messageBuilderState.getMessage(__filename, \"alert_onnx\"));\n return _context8.abrupt(\"return\");\n case 3:\n (_document$getElementB = document.getElementById(\"dialog\")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add(\"dialog-container-show\");\n guiState.stateControls.showWaitingCheckbox.updateState(true);\n _context8.next = 7;\n return serverSetting.getOnnx();\n case 7:\n res = _context8.sent;\n a = document.createElement(\"a\");\n a.href = res.path;\n a.download = res.filename;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n guiState.stateControls.showWaitingCheckbox.updateState(false);\n case 15:\n case \"end\":\n return _context8.stop();\n }\n }, _callee8);\n }));\n return function onnxExportButtonAction() {\n return _ref8.apply(this, arguments);\n };\n }();\n var exportOnnx = selected.voiceChangerType == \"RVC\" && selected.modelFile.endsWith(\"pth\") ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-button\",\n onClick: onnxExportButtonAction\n }, messageBuilderState.getMessage(__filename, \"export_to_onnx\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-buttons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-button\",\n onClick: onUpdateDefaultClicked\n }, messageBuilderState.getMessage(__filename, \"save_default\")), exportOnnx)));\n }, [selected, serverSetting.getOnnx, serverSetting.updateModelDefault]);\n var characterArea = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area\"\n }, portrait, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-area\"\n }, startControl, gainControl, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_1_TuningArea__WEBPACK_IMPORTED_MODULE_8__.TuningArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_2_IndexArea__WEBPACK_IMPORTED_MODULE_9__.IndexArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_3_SpeakerArea__WEBPACK_IMPORTED_MODULE_10__.SpeakerArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_4_F0FactorArea__WEBPACK_IMPORTED_MODULE_11__.F0FactorArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_5_so_vits_svc40SettingArea__WEBPACK_IMPORTED_MODULE_12__.SoVitsSVC40SettingArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_6_ddsp_svc30SettingArea__WEBPACK_IMPORTED_MODULE_13__.DDSPSVC30SettingArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_7_diffusion_svcSettingArea__WEBPACK_IMPORTED_MODULE_14__.DiffusionSVCSettingArea, null), modelSlotControl));\n }, [portrait, startControl, gainControl, modelSlotControl]);\n return characterArea;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/101_CharacterArea.tsx?"); /***/ }), /***/ "./src/components/demo/components2/102-1_QualityArea.tsx": /*!***************************************************************!*\ !*** ./src/components/demo/components2/102-1_QualityArea.tsx ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ QualityArea: () => (/* binding */ QualityArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\nvar QualityArea = function QualityArea(props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)(),\n setVoiceChangerClientSetting = _useAppState.setVoiceChangerClientSetting,\n serverSetting = _useAppState.serverSetting,\n setting = _useAppState.setting;\n var qualityArea = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n if (!serverSetting.updateServerSettings || !setVoiceChangerClientSetting || !serverSetting.serverSetting || !setting) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n }\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"config-sub-area\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"config-sub-area-control-title\"\n }, \"NOISE:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"config-sub-area-noise-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"config-sub-area-noise-checkbox-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"checkbox\",\n disabled: serverSetting.serverSetting.enableServerAudio != 0,\n checked: setting.voiceChangerClientSetting.echoCancel,\n onChange: function onChange(e) {\n try {\n setVoiceChangerClientSetting(_objectSpread(_objectSpread({}, setting.voiceChangerClientSetting), {}, {\n echoCancel: e.target.checked\n }));\n } catch (e) {\n console.error(e);\n }\n }\n }), \" \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", null, \"Echo\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"config-sub-area-noise-checkbox-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"checkbox\",\n disabled: serverSetting.serverSetting.enableServerAudio != 0,\n checked: setting.voiceChangerClientSetting.noiseSuppression,\n onChange: function onChange(e) {\n try {\n setVoiceChangerClientSetting(_objectSpread(_objectSpread({}, setting.voiceChangerClientSetting), {}, {\n noiseSuppression: e.target.checked\n }));\n } catch (e) {\n console.error(e);\n }\n }\n }), \" \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", null, \"Sup1\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"config-sub-area-noise-checkbox-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"checkbox\",\n disabled: serverSetting.serverSetting.enableServerAudio != 0,\n checked: setting.voiceChangerClientSetting.noiseSuppression2,\n onChange: function onChange(e) {\n try {\n setVoiceChangerClientSetting(_objectSpread(_objectSpread({}, setting.voiceChangerClientSetting), {}, {\n noiseSuppression2: e.target.checked\n }));\n } catch (e) {\n console.error(e);\n }\n }\n }), \" \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", null, \"Sup2\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"config-sub-area-control-title\"\n }, \"F0 Det.:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: serverSetting.serverSetting.f0Detector,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n f0Detector: e.target.value\n }));\n }\n }, Object.values(props.detectors).map(function (x) {\n //@ts-ignore\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"config-sub-area-control-title\"\n }, \"S.Thresh.:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"config-sub-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"config-sub-area-slider-control-kind\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"config-sub-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"range\",\n className: \"config-sub-area-slider-control-slider\",\n min: \"0.00000\",\n max: \"0.001\",\n step: \"0.00001\",\n value: serverSetting.serverSetting.silentThreshold || 0,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n silentThreshold: Number(e.target.value)\n }));\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"config-sub-area-slider-control-val\"\n }, serverSetting.serverSetting.silentThreshold)))));\n }, [serverSetting.serverSetting, setting, serverSetting.updateServerSettings, setVoiceChangerClientSetting]);\n return qualityArea;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/102-1_QualityArea.tsx?"); /***/ }), /***/ "./src/components/demo/components2/102-2_ConvertArea.tsx": /*!***************************************************************!*\ !*** ./src/components/demo/components2/102-2_ConvertArea.tsx ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ConvertArea: () => (/* binding */ ConvertArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../001_provider/001_AppRootProvider */ \"./src/001_provider/001_AppRootProvider.tsx\");\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\n\nvar ConvertArea = function ConvertArea(props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)(),\n setting = _useAppState.setting,\n serverSetting = _useAppState.serverSetting,\n setWorkletNodeSetting = _useAppState.setWorkletNodeSetting,\n trancateBuffer = _useAppState.trancateBuffer;\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_6__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var edition = appGuiSettingState.edition;\n var convertArea = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n var nums;\n if (!props.inputChunkNums) {\n nums = [8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024, 2048];\n } else {\n nums = props.inputChunkNums;\n }\n if (serverSetting.serverSetting.maxInputLength) {\n nums = nums.filter(function (x) {\n return x < serverSetting.serverSetting.maxInputLength / 128;\n });\n }\n var gpusEntry = (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(serverSetting.serverSetting.gpus);\n gpusEntry.push({\n id: -1,\n name: \"cpu\",\n memory: 0\n });\n var onClassName = serverSetting.serverSetting.gpu == 0 ? \"config-sub-area-button-active\" : \"config-sub-area-button\";\n var offClassName = serverSetting.serverSetting.gpu == 0 ? \"config-sub-area-button\" : \"config-sub-area-button-active\";\n var gpuSelect = edition.indexOf(\"onnxdirectML-cuda\") >= 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title\"\n }, \"GPU(dml):\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-buttons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: /*#__PURE__*/(0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n gpu: 0\n }));\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n })),\n className: onClassName\n }, \"on\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: /*#__PURE__*/(0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee2() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n gpu: -1\n }));\n case 2:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n })),\n className: offClassName\n }, \"off\")))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title\"\n }, \"GPU:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"body-select\",\n value: serverSetting.serverSetting.gpu,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n gpu: Number(e.target.value)\n }));\n }\n }, gpusEntry.map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n key: x.id,\n value: x.id\n }, x.name, x.name == \"cpu\" ? \"\" : \"(\".concat((x.memory / 1024 / 1024 / 1024).toFixed(0), \"GB)\"), \" \");\n }))));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title\"\n }, \"CHUNK:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"body-select\",\n value: setting.workletNodeSetting.inputChunkNum,\n onChange: function onChange(e) {\n setWorkletNodeSetting(_objectSpread(_objectSpread({}, setting.workletNodeSetting), {}, {\n inputChunkNum: Number(e.target.value)\n }));\n trancateBuffer();\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverReadChunkSize: Number(e.target.value)\n }));\n }\n }, nums.map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n key: x,\n value: x\n }, x, \" (\", (x * 128 * 1000 / 48000).toFixed(1), \" ms, \", x * 128, \")\");\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title\"\n }, \"EXTRA:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"body-select\",\n value: serverSetting.serverSetting.extraConvertSize,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n extraConvertSize: Number(e.target.value)\n }));\n trancateBuffer();\n }\n }, [1024 * 4, 1024 * 8, 1024 * 16, 1024 * 32, 1024 * 64, 1024 * 128].map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n })))), gpuSelect);\n }, [serverSetting.serverSetting, setting, serverSetting.updateServerSettings, setWorkletNodeSetting, edition]);\n return convertArea;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/102-2_ConvertArea.tsx?"); /***/ }), /***/ "./src/components/demo/components2/102-3_DeviceArea.tsx": /*!**************************************************************!*\ !*** ./src/components/demo/components2/102-3_DeviceArea.tsx ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DeviceArea: () => (/* binding */ DeviceArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @dannadori/voice-changer-client-js */ \"./node_modules/@dannadori/voice-changer-client-js/dist/index.js\");\n/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _const__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../const */ \"./src/const.ts\");\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\n\n\n\nvar DeviceArea = function DeviceArea(_props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)(),\n setting = _useAppState.setting,\n serverSetting = _useAppState.serverSetting,\n audioContext = _useAppState.audioContext,\n setAudioOutputElementId = _useAppState.setAudioOutputElementId,\n initializedRef = _useAppState.initializedRef,\n setVoiceChangerClientSetting = _useAppState.setVoiceChangerClientSetting,\n startOutputRecording = _useAppState.startOutputRecording,\n stopOutputRecording = _useAppState.stopOutputRecording;\n var _useGuiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_7__.useGuiState)(),\n isConverting = _useGuiState.isConverting,\n audioInputForGUI = _useGuiState.audioInputForGUI,\n inputAudioDeviceInfo = _useGuiState.inputAudioDeviceInfo,\n setAudioInputForGUI = _useGuiState.setAudioInputForGUI,\n fileInputEchoback = _useGuiState.fileInputEchoback,\n setFileInputEchoback = _useGuiState.setFileInputEchoback,\n setAudioOutputForGUI = _useGuiState.setAudioOutputForGUI,\n audioOutputForGUI = _useGuiState.audioOutputForGUI,\n outputAudioDeviceInfo = _useGuiState.outputAudioDeviceInfo;\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(\"ALL\"),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useState, 2),\n inputHostApi = _useState2[0],\n setInputHostApi = _useState2[1];\n var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(\"ALL\"),\n _useState4 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useState3, 2),\n outputHostApi = _useState4[0],\n setOutputHostApi = _useState4[1];\n var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(\"ALL\"),\n _useState6 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useState5, 2),\n monitorHostApi = _useState6[0],\n setMonitorHostApi = _useState6[1];\n var audioSrcNode = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)();\n var _useIndexedDB = (0,_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6__.useIndexedDB)({\n clientType: null\n }),\n getItem = _useIndexedDB.getItem,\n setItem = _useIndexedDB.setItem;\n var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false),\n _useState8 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useState7, 2),\n outputRecordingStarted = _useState8[0],\n setOutputRecordingStarted = _useState8[1];\n\n // (1) Audio Mode\n var deviceModeRow = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n var enableServerAudio = serverSetting.serverSetting.enableServerAudio;\n var clientChecked = enableServerAudio == 1 ? false : true;\n var serverChecked = enableServerAudio == 1 ? true : false;\n var onDeviceModeChanged = function onDeviceModeChanged(val) {\n if (isConverting) {\n alert(\"cannot change mode when voice conversion is enabled\");\n return;\n }\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n enableServerAudio: val\n }));\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title\"\n }, \"AUDIO:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-noise-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-noise-checkbox-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"input\", {\n type: \"radio\",\n id: \"client-device\",\n name: \"device-mode\",\n checked: clientChecked,\n onChange: function onChange() {\n onDeviceModeChanged(0);\n }\n }), \" \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"label\", {\n htmlFor: \"client-device\"\n }, \"client\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-noise-checkbox-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"input\", {\n className: \"left-padding-1\",\n type: \"radio\",\n id: \"server-device\",\n name: \"device-mode\",\n checked: serverChecked,\n onChange: function onChange() {\n onDeviceModeChanged(1);\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"label\", {\n htmlFor: \"server-device\"\n }, \"server\")))));\n }, [serverSetting.serverSetting, serverSetting.updateServerSettings, isConverting]);\n\n // (2) Audio Input\n // キャッシュの設定は反映(たぶん、設定操作の時も起動していしまう。が問題は起こらないはず)\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n if (typeof setting.voiceChangerClientSetting.audioInput == \"string\") {\n if (inputAudioDeviceInfo.find(function (x) {\n // console.log(\"COMPARE:\", x.deviceId, appState.clientSetting.setting.audioInput)\n return x.deviceId == setting.voiceChangerClientSetting.audioInput;\n })) {\n setAudioInputForGUI(setting.voiceChangerClientSetting.audioInput);\n }\n }\n }, [inputAudioDeviceInfo, setting.voiceChangerClientSetting.audioInput]);\n\n // (2-1) クライアント\n var clientAudioInputRow = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (serverSetting.serverSetting.enableServerAudio == 1) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title left-padding-1\"\n }, \"input\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"body-select\",\n value: audioInputForGUI,\n onChange: /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee(e) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n setAudioInputForGUI(e.target.value);\n if (!(e.target.value != \"file\")) {\n _context.next = 14;\n break;\n }\n _context.prev = 2;\n _context.next = 5;\n return setVoiceChangerClientSetting(_objectSpread(_objectSpread({}, setting.voiceChangerClientSetting), {}, {\n audioInput: e.target.value\n }));\n case 5:\n _context.next = 14;\n break;\n case 7:\n _context.prev = 7;\n _context.t0 = _context[\"catch\"](2);\n alert(_context.t0);\n console.error(_context.t0);\n setAudioInputForGUI(\"none\");\n _context.next = 14;\n return setVoiceChangerClientSetting(_objectSpread(_objectSpread({}, setting.voiceChangerClientSetting), {}, {\n audioInput: null\n }));\n case 14:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[2, 7]]);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }()\n }, inputAudioDeviceInfo.map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n key: x.deviceId,\n value: x.deviceId\n }, x.label);\n }))));\n }, [setVoiceChangerClientSetting, setting, inputAudioDeviceInfo, audioInputForGUI, serverSetting.serverSetting.enableServerAudio]);\n\n // (2-2) サーバ\n var serverAudioInputRow = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (serverSetting.serverSetting.enableServerAudio == 0) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n var devices = serverSetting.serverSetting.serverAudioInputDevices;\n var hostAPIs = new Set(devices.map(function (x) {\n return x.hostAPI;\n }));\n var hostAPIOptions = Array.from(hostAPIs).map(function (x, index) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n value: x,\n key: index\n }, x);\n });\n var filteredDevice = devices.map(function (x, index) {\n if (inputHostApi != \"ALL\" && x.hostAPI != inputHostApi) {\n return null;\n }\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n value: x.index,\n key: index\n }, \"[\", x.hostAPI, \"]\", x.name);\n }).filter(function (x) {\n return x != null;\n });\n var currentValue = devices.find(function (x) {\n return (x.hostAPI == inputHostApi || inputHostApi == \"ALL\") && x.index == serverSetting.serverSetting.serverInputDeviceId;\n }) ? serverSetting.serverSetting.serverInputDeviceId : -1;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title left-padding-1\"\n }, \"input\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field-auido-io\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"config-sub-area-control-field-auido-io-filter\",\n name: \"kinds\",\n id: \"kinds\",\n value: inputHostApi,\n onChange: function onChange(e) {\n setInputHostApi(e.target.value);\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n value: \"ALL\",\n key: \"ALL\"\n }, \"ALL\"), hostAPIOptions), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"config-sub-area-control-field-auido-io-select\",\n value: currentValue,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverInputDeviceId: Number(e.target.value)\n }));\n }\n }, filteredDevice, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n value: \"-1\",\n key: \"none\"\n }, \"none\")))));\n }, [inputHostApi, serverSetting.serverSetting, serverSetting.updateServerSettings, serverSetting.serverSetting.enableServerAudio]);\n\n // (2-3) File\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n [_const__WEBPACK_IMPORTED_MODULE_8__.AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK].forEach(function (x) {\n var audio = document.getElementById(x);\n if (audio) {\n audio.volume = fileInputEchoback ? 1 : 0;\n }\n });\n }, [fileInputEchoback]);\n var audioInputMediaRow = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (audioInputForGUI != \"file\" || serverSetting.serverSetting.enableServerAudio == 1) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n var onFileLoadClicked = /*#__PURE__*/function () {\n var _ref2 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee2() {\n var url, audio, dst, audio_echo, audio_org;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return (0,_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_6__.fileSelectorAsDataURL)(\"\");\n case 2:\n url = _context2.sent;\n // input stream for client.\n audio = document.getElementById(_const__WEBPACK_IMPORTED_MODULE_8__.AUDIO_ELEMENT_FOR_TEST_CONVERTED);\n audio.pause();\n audio.srcObject = null;\n audio.src = url;\n _context2.next = 9;\n return audio.play();\n case 9:\n if (!audioSrcNode.current) {\n audioSrcNode.current = audioContext.createMediaElementSource(audio);\n }\n if (audioSrcNode.current.mediaElement != audio) {\n audioSrcNode.current = audioContext.createMediaElementSource(audio);\n }\n dst = audioContext.createMediaStreamDestination();\n audioSrcNode.current.connect(dst);\n try {\n setVoiceChangerClientSetting(_objectSpread(_objectSpread({}, setting.voiceChangerClientSetting), {}, {\n audioInput: dst.stream\n }));\n } catch (e) {\n console.error(e);\n }\n audio_echo = document.getElementById(_const__WEBPACK_IMPORTED_MODULE_8__.AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK);\n audio_echo.srcObject = dst.stream;\n audio_echo.play();\n audio_echo.volume = 0;\n setFileInputEchoback(false);\n\n // original stream to play.\n audio_org = document.getElementById(_const__WEBPACK_IMPORTED_MODULE_8__.AUDIO_ELEMENT_FOR_TEST_ORIGINAL);\n audio_org.src = url;\n audio_org.pause();\n case 22:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function onFileLoadClicked() {\n return _ref2.apply(this, arguments);\n };\n }();\n var echobackClass = fileInputEchoback ? \"config-sub-area-control-field-wav-file-echoback-button-active\" : \"config-sub-area-control-field-wav-file-echoback-button\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field-wav-file left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field-wav-file-audio-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"audio\", {\n id: _const__WEBPACK_IMPORTED_MODULE_8__.AUDIO_ELEMENT_FOR_TEST_ORIGINAL,\n controls: true,\n hidden: true\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"audio\", {\n className: \"config-sub-area-control-field-wav-file-audio\",\n id: _const__WEBPACK_IMPORTED_MODULE_8__.AUDIO_ELEMENT_FOR_TEST_CONVERTED,\n controls: true,\n controlsList: \"nodownload noplaybackrate\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"audio\", {\n id: _const__WEBPACK_IMPORTED_MODULE_8__.AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK,\n controls: true,\n hidden: true\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"img\", {\n className: \"config-sub-area-control-field-wav-file-folder\",\n src: \"./assets/icons/folder.svg\",\n onClick: onFileLoadClicked\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: echobackClass,\n onClick: function onClick() {\n setFileInputEchoback(!fileInputEchoback);\n }\n }, \"echo\", fileInputEchoback))));\n }, [audioInputForGUI, fileInputEchoback, setting, serverSetting.serverSetting]);\n\n // (3) Audio Output\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n var loadCache = /*#__PURE__*/function () {\n var _ref3 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee3() {\n var key;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return getItem(_const__WEBPACK_IMPORTED_MODULE_8__.INDEXEDDB_KEY_AUDIO_OUTPUT);\n case 2:\n key = _context3.sent;\n if (key) {\n setAudioOutputForGUI(key);\n }\n case 4:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return function loadCache() {\n return _ref3.apply(this, arguments);\n };\n }();\n loadCache();\n }, []);\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n var setAudioOutput = /*#__PURE__*/function () {\n var _ref4 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee4() {\n var mediaDeviceInfos;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return navigator.mediaDevices.enumerateDevices();\n case 2:\n mediaDeviceInfos = _context4.sent;\n [_const__WEBPACK_IMPORTED_MODULE_8__.AUDIO_ELEMENT_FOR_PLAY_RESULT, _const__WEBPACK_IMPORTED_MODULE_8__.AUDIO_ELEMENT_FOR_TEST_ORIGINAL, _const__WEBPACK_IMPORTED_MODULE_8__.AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK].forEach(function (x) {\n var audio = document.getElementById(x);\n if (audio) {\n if (serverSetting.serverSetting.enableServerAudio == 1) {\n // Server Audio を使う場合はElementから音は出さない。\n audio.volume = 0;\n } else if (audioOutputForGUI == \"none\") {\n // @ts-ignore\n audio.setSinkId(\"\");\n if (x == _const__WEBPACK_IMPORTED_MODULE_8__.AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK) {\n audio.volume = 0;\n } else {\n audio.volume = 0;\n }\n } else {\n var audioOutputs = mediaDeviceInfos.filter(function (x) {\n return x.kind == \"audiooutput\";\n });\n var found = audioOutputs.some(function (x) {\n return x.deviceId == audioOutputForGUI;\n });\n if (found) {\n // @ts-ignore // 例外キャッチできないので事前にIDチェックが必要らしい。!?\n audio.setSinkId(audioOutputForGUI);\n } else {\n console.warn(\"No audio output device. use default\");\n }\n if (x == _const__WEBPACK_IMPORTED_MODULE_8__.AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK) {\n audio.volume = fileInputEchoback ? 1 : 0;\n } else {\n audio.volume = 1;\n }\n }\n }\n });\n case 4:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return function setAudioOutput() {\n return _ref4.apply(this, arguments);\n };\n }();\n setAudioOutput();\n }, [audioOutputForGUI, fileInputEchoback, serverSetting.serverSetting.enableServerAudio]);\n\n // (3-1) クライアント\n var clientAudioOutputRow = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (serverSetting.serverSetting.enableServerAudio == 1) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title left-padding-1\"\n }, \"output\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"body-select\",\n value: audioOutputForGUI,\n onChange: function onChange(e) {\n setAudioOutputForGUI(e.target.value);\n setItem(_const__WEBPACK_IMPORTED_MODULE_8__.INDEXEDDB_KEY_AUDIO_OUTPUT, e.target.value);\n }\n }, outputAudioDeviceInfo.map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n key: x.deviceId,\n value: x.deviceId\n }, x.label);\n }))));\n }, [serverSetting.serverSetting.enableServerAudio, outputAudioDeviceInfo, audioOutputForGUI]);\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n console.log(\"initializedRef.current\", initializedRef.current);\n setAudioOutputElementId(_const__WEBPACK_IMPORTED_MODULE_8__.AUDIO_ELEMENT_FOR_PLAY_RESULT);\n }, [initializedRef.current]);\n\n // (3-2) サーバ\n var serverAudioOutputRow = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (serverSetting.serverSetting.enableServerAudio == 0) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n var devices = serverSetting.serverSetting.serverAudioOutputDevices;\n var hostAPIs = new Set(devices.map(function (x) {\n return x.hostAPI;\n }));\n var hostAPIOptions = Array.from(hostAPIs).map(function (x, index) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n value: x,\n key: index\n }, x);\n });\n var filteredDevice = devices.map(function (x, index) {\n if (outputHostApi != \"ALL\" && x.hostAPI != outputHostApi) {\n return null;\n }\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n value: x.index,\n key: index\n }, \"[\", x.hostAPI, \"]\", x.name);\n }).filter(function (x) {\n return x != null;\n });\n var currentValue = devices.find(function (x) {\n return (x.hostAPI == outputHostApi || outputHostApi == \"ALL\") && x.index == serverSetting.serverSetting.serverOutputDeviceId;\n }) ? serverSetting.serverSetting.serverOutputDeviceId : -1;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title left-padding-1\"\n }, \"output\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field-auido-io\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"config-sub-area-control-field-auido-io-filter\",\n name: \"kinds\",\n id: \"kinds\",\n value: outputHostApi,\n onChange: function onChange(e) {\n setOutputHostApi(e.target.value);\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n value: \"ALL\",\n key: \"ALL\"\n }, \"ALL\"), hostAPIOptions), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"config-sub-area-control-field-auido-io-select\",\n value: currentValue,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverOutputDeviceId: Number(e.target.value)\n }));\n }\n }, filteredDevice, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n value: \"-1\",\n key: \"none\"\n }, \"none\")))));\n }, [outputHostApi, serverSetting.serverSetting, serverSetting.updateServerSettings, serverSetting.serverSetting.enableServerAudio]);\n\n // (4) レコーダー\n var outputRecorderRow = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (serverSetting.serverSetting.enableServerAudio == 1) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n var onOutputRecordStartClicked = /*#__PURE__*/function () {\n var _ref5 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee5() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n setOutputRecordingStarted(true);\n _context5.next = 3;\n return startOutputRecording();\n case 3:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5);\n }));\n return function onOutputRecordStartClicked() {\n return _ref5.apply(this, arguments);\n };\n }();\n var onOutputRecordStopClicked = /*#__PURE__*/function () {\n var _ref6 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee6() {\n var record;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n setOutputRecordingStarted(false);\n _context6.next = 3;\n return stopOutputRecording();\n case 3:\n record = _context6.sent;\n downloadRecord(record);\n case 5:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6);\n }));\n return function onOutputRecordStopClicked() {\n return _ref6.apply(this, arguments);\n };\n }();\n var startClassName = outputRecordingStarted ? \"config-sub-area-button-active\" : \"config-sub-area-button\";\n var stopClassName = outputRecordingStarted ? \"config-sub-area-button\" : \"config-sub-area-button-active\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title\"\n }, \"REC.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-buttons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: onOutputRecordStartClicked,\n className: startClassName\n }, \"start\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: onOutputRecordStopClicked,\n className: stopClassName\n }, \"stop\"))));\n }, [outputRecordingStarted, startOutputRecording, stopOutputRecording, serverSetting.serverSetting.enableServerAudio]);\n\n // (5) サンプリングレート\n var sampleRateRow = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (serverSetting.serverSetting.enableServerAudio == 0) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title left-padding-1\"\n }, \"S.R.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field-auido-io\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"config-sub-area-control-field-sample-rate-select\",\n value: serverSetting.serverSetting.serverAudioSampleRate,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverAudioSampleRate: Number(e.target.value)\n }));\n }\n }, [16000, 32000, 44100, 48000, 96000, 192000].map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n })))));\n }, [serverSetting.serverSetting, serverSetting.updateServerSettings, serverSetting.serverSetting.enableServerAudio]);\n\n // (6) Monitor\n var serverMonitorRow = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (serverSetting.serverSetting.enableServerAudio == 0) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n var devices = serverSetting.serverSetting.serverAudioOutputDevices;\n var hostAPIs = new Set(devices.map(function (x) {\n return x.hostAPI;\n }));\n var hostAPIOptions = Array.from(hostAPIs).map(function (x, index) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n value: x,\n key: index\n }, x);\n });\n var filteredDevice = devices.map(function (x, index) {\n if (monitorHostApi != \"ALL\" && x.hostAPI != monitorHostApi) {\n return null;\n }\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n value: x.index,\n key: index\n }, \"[\", x.hostAPI, \"]\", x.name);\n }).filter(function (x) {\n return x != null;\n });\n filteredDevice.unshift( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n value: -1,\n key: -1\n }, \"none\"));\n var currentValue = devices.find(function (x) {\n return (x.hostAPI == monitorHostApi || monitorHostApi == \"ALL\") && x.index == serverSetting.serverSetting.serverMonitorDeviceId;\n }) ? serverSetting.serverSetting.serverMonitorDeviceId : -1;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title left-padding-1\"\n }, \"monitor\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field-auido-io\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"config-sub-area-control-field-auido-io-filter\",\n name: \"kinds\",\n id: \"kinds\",\n value: monitorHostApi,\n onChange: function onChange(e) {\n setMonitorHostApi(e.target.value);\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n value: \"ALL\",\n key: \"ALL\"\n }, \"ALL\"), hostAPIOptions), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"config-sub-area-control-field-auido-io-select\",\n value: currentValue,\n onChange: function onChange(e) {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverMonitorDeviceId: Number(e.target.value)\n }));\n }\n }, filteredDevice))));\n }, [monitorHostApi, serverSetting.serverSetting, serverSetting.updateServerSettings, serverSetting.serverSetting.enableServerAudio]);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area\"\n }, deviceModeRow, sampleRateRow, clientAudioInputRow, serverAudioInputRow, audioInputMediaRow, clientAudioOutputRow, serverAudioOutputRow, serverMonitorRow, outputRecorderRow, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"audio\", {\n hidden: true,\n id: _const__WEBPACK_IMPORTED_MODULE_8__.AUDIO_ELEMENT_FOR_PLAY_RESULT\n }));\n};\nvar downloadRecord = function downloadRecord(data) {\n var writeString = function writeString(view, offset, string) {\n for (var i = 0; i < string.length; i++) {\n view.setUint8(offset + i, string.charCodeAt(i));\n }\n };\n var floatTo16BitPCM = function floatTo16BitPCM(output, offset, input) {\n for (var i = 0; i < input.length; i++, offset += 2) {\n var s = Math.max(-1, Math.min(1, input[i]));\n output.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7fff, true);\n }\n };\n var buffer = new ArrayBuffer(44 + data.length * 2);\n var view = new DataView(buffer);\n\n // https://www.youfit.co.jp/archives/1418\n writeString(view, 0, \"RIFF\"); // RIFFヘッダ\n view.setUint32(4, 32 + data.length * 2, true); // これ以降のファイルサイズ\n writeString(view, 8, \"WAVE\"); // WAVEヘッダ\n writeString(view, 12, \"fmt \"); // fmtチャンク\n view.setUint32(16, 16, true); // fmtチャンクのバイト数\n view.setUint16(20, 1, true); // フォーマットID\n view.setUint16(22, 1, true); // チャンネル数\n view.setUint32(24, 48000, true); // サンプリングレート\n view.setUint32(28, 48000 * 2, true); // データ速度\n view.setUint16(32, 2, true); // ブロックサイズ\n view.setUint16(34, 16, true); // サンプルあたりのビット数\n writeString(view, 36, \"data\"); // dataチャンク\n view.setUint32(40, data.length * 2, true); // 波形データのバイト数\n floatTo16BitPCM(view, 44, data); // 波形データ\n var audioBlob = new Blob([view], {\n type: \"audio/wav\"\n });\n var url = URL.createObjectURL(audioBlob);\n var a = document.createElement(\"a\");\n a.href = url;\n a.download = \"output.wav\";\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n URL.revokeObjectURL(url);\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/102-3_DeviceArea.tsx?"); /***/ }), /***/ "./src/components/demo/components2/102-4_RecorderArea.tsx": /*!****************************************************************!*\ !*** ./src/components/demo/components2/102-4_RecorderArea.tsx ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RecorderArea: () => (/* binding */ RecorderArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _const__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../const */ \"./src/const.ts\");\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\n\n\nvar RecorderArea = function RecorderArea(_props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)(),\n serverSetting = _useAppState.serverSetting;\n var _useGuiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_6__.useGuiState)(),\n audioOutputForAnalyzer = _useGuiState.audioOutputForAnalyzer,\n setAudioOutputForAnalyzer = _useGuiState.setAudioOutputForAnalyzer,\n outputAudioDeviceInfo = _useGuiState.outputAudioDeviceInfo;\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useState, 2),\n serverIORecording = _useState2[0],\n setServerIORecording = _useState2[1];\n var serverIORecorderRow = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n var onServerIORecordStartClicked = /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n setServerIORecording(true);\n _context.next = 3;\n return serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n recordIO: 1\n }));\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onServerIORecordStartClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n var onServerIORecordStopClicked = /*#__PURE__*/function () {\n var _ref2 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee2() {\n var wavInput, wavOutput;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n setServerIORecording(false);\n _context2.next = 3;\n return serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n recordIO: 0\n }));\n case 3:\n // set wav (input)\n wavInput = document.getElementById(_const__WEBPACK_IMPORTED_MODULE_7__.AUDIO_ELEMENT_FOR_SAMPLING_INPUT);\n wavInput.src = \"/tmp/in.wav?\" + new Date().getTime();\n wavInput.controls = true;\n // @ts-ignore\n wavInput.setSinkId(audioOutputForAnalyzer);\n\n // set wav (output)\n wavOutput = document.getElementById(_const__WEBPACK_IMPORTED_MODULE_7__.AUDIO_ELEMENT_FOR_SAMPLING_OUTPUT);\n wavOutput.src = \"/tmp/out.wav?\" + new Date().getTime();\n wavOutput.controls = true;\n // @ts-ignore\n wavOutput.setSinkId(audioOutputForAnalyzer);\n case 11:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function onServerIORecordStopClicked() {\n return _ref2.apply(this, arguments);\n };\n }();\n var startClassName = serverIORecording ? \"config-sub-area-button-active\" : \"config-sub-area-button\";\n var stopClassName = serverIORecording ? \"config-sub-area-button\" : \"config-sub-area-button-active\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title-long\"\n }, \"ServerIO Analyzer\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title\"\n }, \"SIO rec.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-buttons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: onServerIORecordStartClicked,\n className: startClassName\n }, \"start\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: onServerIORecordStopClicked,\n className: stopClassName\n }, \"stop\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title\"\n }, \"output\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field-auido-io\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"body-select\",\n value: audioOutputForAnalyzer,\n onChange: function onChange(e) {\n setAudioOutputForAnalyzer(e.target.value);\n var wavInput = document.getElementById(_const__WEBPACK_IMPORTED_MODULE_7__.AUDIO_ELEMENT_FOR_SAMPLING_INPUT);\n var wavOutput = document.getElementById(_const__WEBPACK_IMPORTED_MODULE_7__.AUDIO_ELEMENT_FOR_SAMPLING_OUTPUT);\n //@ts-ignore\n wavInput.setSinkId(e.target.value);\n //@ts-ignore\n wavOutput.setSinkId(e.target.value);\n }\n }, outputAudioDeviceInfo.map(function (x) {\n if (x.deviceId == \"none\") {\n return null;\n }\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n key: x.deviceId,\n value: x.deviceId\n }, x.label);\n }).filter(function (x) {\n return x != null;\n }))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title\"\n }, \"in\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field-wav-file\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field-wav-file-audio-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"audio\", {\n className: \"config-sub-area-control-field-wav-file-audio\",\n id: _const__WEBPACK_IMPORTED_MODULE_7__.AUDIO_ELEMENT_FOR_SAMPLING_INPUT,\n controls: true\n }))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-title\"\n }, \"out\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field-wav-file\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area-control-field-wav-file-audio-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"audio\", {\n className: \"config-sub-area-control-field-wav-file-audio\",\n id: _const__WEBPACK_IMPORTED_MODULE_7__.AUDIO_ELEMENT_FOR_SAMPLING_OUTPUT,\n controls: true\n }))))));\n }, [serverIORecording, audioOutputForAnalyzer, outputAudioDeviceInfo, serverSetting.updateServerSettings]);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"config-sub-area\"\n }, serverIORecorderRow);\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/102-4_RecorderArea.tsx?"); /***/ }), /***/ "./src/components/demo/components2/102-5_MoreActionArea.tsx": /*!******************************************************************!*\ !*** ./src/components/demo/components2/102-5_MoreActionArea.tsx ***! \******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MoreActionArea: () => (/* binding */ MoreActionArea)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n\n\nvar MoreActionArea = function MoreActionArea(_props) {\n var _useGuiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__.useGuiState)(),\n stateControls = _useGuiState.stateControls;\n var serverIORecorderRow = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var onOpenMergeLabClicked = function onOpenMergeLabClicked() {\n stateControls.showMergeLabCheckbox.updateState(true);\n };\n var onOpenAdvancedSettingClicked = function onOpenAdvancedSettingClicked() {\n stateControls.showAdvancedSettingCheckbox.updateState(true);\n };\n var onOpenGetServerInformationClicked = function onOpenGetServerInformationClicked() {\n stateControls.showGetServerInformationCheckbox.updateState(true);\n };\n var onOpenGetClientInformationClicked = function onOpenGetClientInformationClicked() {\n stateControls.showGetClientInformationCheckbox.updateState(true);\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"config-sub-area-control left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"config-sub-area-control-title\"\n }, \"more...\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"config-sub-area-control-field config-sub-area-control-field-long\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"config-sub-area-buttons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n onClick: onOpenMergeLabClicked,\n className: \"config-sub-area-button\"\n }, \"Merge Lab\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n onClick: onOpenAdvancedSettingClicked,\n className: \"config-sub-area-button\"\n }, \"Advanced Setting\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n onClick: onOpenGetServerInformationClicked,\n className: \"config-sub-area-button\"\n }, \"Server Info\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n onClick: onOpenGetClientInformationClicked,\n className: \"config-sub-area-button\"\n }, \"Client Info\")))));\n }, [stateControls]);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"config-sub-area\"\n }, serverIORecorderRow);\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/102-5_MoreActionArea.tsx?"); /***/ }), /***/ "./src/components/demo/components2/102_ConfigArea.tsx": /*!************************************************************!*\ !*** ./src/components/demo/components2/102_ConfigArea.tsx ***! \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ConfigArea: () => (/* binding */ ConfigArea)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _102_1_QualityArea__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./102-1_QualityArea */ \"./src/components/demo/components2/102-1_QualityArea.tsx\");\n/* harmony import */ var _102_2_ConvertArea__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./102-2_ConvertArea */ \"./src/components/demo/components2/102-2_ConvertArea.tsx\");\n/* harmony import */ var _102_3_DeviceArea__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./102-3_DeviceArea */ \"./src/components/demo/components2/102-3_DeviceArea.tsx\");\n/* harmony import */ var _102_4_RecorderArea__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./102-4_RecorderArea */ \"./src/components/demo/components2/102-4_RecorderArea.tsx\");\n/* harmony import */ var _102_5_MoreActionArea__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./102-5_MoreActionArea */ \"./src/components/demo/components2/102-5_MoreActionArea.tsx\");\n\n\n\n\n\n\nvar ConfigArea = function ConfigArea(props) {\n var configArea = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"config-area\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_102_1_QualityArea__WEBPACK_IMPORTED_MODULE_1__.QualityArea, {\n detectors: props.detectors\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_102_2_ConvertArea__WEBPACK_IMPORTED_MODULE_2__.ConvertArea, {\n inputChunkNums: props.inputChunkNums\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"config-area\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_102_3_DeviceArea__WEBPACK_IMPORTED_MODULE_3__.DeviceArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_102_4_RecorderArea__WEBPACK_IMPORTED_MODULE_4__.RecorderArea, null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"config-area\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_102_5_MoreActionArea__WEBPACK_IMPORTED_MODULE_5__.MoreActionArea, null)));\n }, []);\n return configArea;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/102_ConfigArea.tsx?"); /***/ }), /***/ "./src/const.ts": /*!**********************!*\ !*** ./src/const.ts ***! \**********************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AUDIO_ELEMENT_FOR_PLAY_RESULT: () => (/* binding */ AUDIO_ELEMENT_FOR_PLAY_RESULT),\n/* harmony export */ AUDIO_ELEMENT_FOR_SAMPLING_INPUT: () => (/* binding */ AUDIO_ELEMENT_FOR_SAMPLING_INPUT),\n/* harmony export */ AUDIO_ELEMENT_FOR_SAMPLING_OUTPUT: () => (/* binding */ AUDIO_ELEMENT_FOR_SAMPLING_OUTPUT),\n/* harmony export */ AUDIO_ELEMENT_FOR_TEST_CONVERTED: () => (/* binding */ AUDIO_ELEMENT_FOR_TEST_CONVERTED),\n/* harmony export */ AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK: () => (/* binding */ AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK),\n/* harmony export */ AUDIO_ELEMENT_FOR_TEST_ORIGINAL: () => (/* binding */ AUDIO_ELEMENT_FOR_TEST_ORIGINAL),\n/* harmony export */ INDEXEDDB_KEY_AUDIO_OUTPUT: () => (/* binding */ INDEXEDDB_KEY_AUDIO_OUTPUT),\n/* harmony export */ INDEXEDDB_KEY_DEFAULT_MODEL_TYPE: () => (/* binding */ INDEXEDDB_KEY_DEFAULT_MODEL_TYPE),\n/* harmony export */ isDesktopApp: () => (/* binding */ isDesktopApp)\n/* harmony export */ });\nvar AUDIO_ELEMENT_FOR_PLAY_RESULT = \"audio-result\";\nvar AUDIO_ELEMENT_FOR_TEST_ORIGINAL = \"audio-test-original\";\nvar AUDIO_ELEMENT_FOR_TEST_CONVERTED = \"audio-test-converted\";\nvar AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK = \"audio-test-converted-echoback\";\nvar AUDIO_ELEMENT_FOR_SAMPLING_INPUT = \"body-wav-container-wav-input\";\nvar AUDIO_ELEMENT_FOR_SAMPLING_OUTPUT = \"body-wav-container-wav-output\";\nvar INDEXEDDB_KEY_AUDIO_OUTPUT = \"INDEXEDDB_KEY_AUDIO_OUTPUT\";\nvar INDEXEDDB_KEY_DEFAULT_MODEL_TYPE = \"INDEXEDDB_KEY_DEFALT_MODEL_TYPE\";\nvar isDesktopApp = function isDesktopApp() {\n if (navigator.userAgent.indexOf('Electron') >= 0) {\n return true;\n } else {\n return false;\n }\n};\n\n//# sourceURL=webpack://demo/./src/const.ts?"); /***/ }), /***/ "./src/hooks/useMessageBuilder.ts": /*!****************************************!*\ !*** ./src/hooks/useMessageBuilder.ts ***! \****************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useMessageBuilder: () => (/* binding */ useMessageBuilder)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nvar useMessageBuilder = function useMessageBuilder() {\n var messagesRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]);\n var setMessage = function setMessage(file, id, message) {\n if (messagesRef.current.find(function (x) {\n return x.file == file && x.id == id;\n })) {\n console.warn(\"duplicate message is registerd\", file, id, message);\n } else {\n messagesRef.current.push({\n file: file,\n id: id,\n message: message\n });\n }\n };\n var getMessage = function getMessage(file, id) {\n var _messagesRef$current$;\n var lang = window.navigator.language;\n if (lang != \"ja\") {\n lang = \"en\";\n }\n return ((_messagesRef$current$ = messagesRef.current.find(function (x) {\n return x.file == file && x.id == id;\n })) === null || _messagesRef$current$ === void 0 ? void 0 : _messagesRef$current$.message[lang]) || \"unknwon message\";\n };\n return {\n setMessage: setMessage,\n getMessage: getMessage\n };\n};\n\n//# sourceURL=webpack://demo/./src/hooks/useMessageBuilder.ts?"); /***/ }), /***/ "./src/hooks/useStateControlCheckbox.tsx": /*!***********************************************!*\ !*** ./src/hooks/useStateControlCheckbox.tsx ***! \***********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useStateControlCheckbox: () => (/* binding */ useStateControlCheckbox)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\n\nvar useStateControlCheckbox = function useStateControlCheckbox(className, changeCallback) {\n var currentValForTriggerCallbackRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);\n // (4) トリガチェックボックス\n var callback = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n // console.log(\"generate callback function\", className);\n return function (newVal) {\n if (!changeCallback) {\n return;\n }\n // 値が同じときはスルー (== 初期値(undefined)か、値が違ったのみ発火)\n if (currentValForTriggerCallbackRef.current === newVal) {\n return;\n }\n // 初期値(undefined)か、値が違ったのみ発火\n currentValForTriggerCallbackRef.current = newVal;\n changeCallback(currentValForTriggerCallbackRef.current);\n };\n }, []);\n var trigger = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n if (changeCallback) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n type: \"checkbox\",\n className: \"\".concat(className, \" state-control-checkbox rotate-button\"),\n id: \"\".concat(className),\n onChange: function onChange(e) {\n callback(e.target.checked);\n }\n });\n } else {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n type: \"checkbox\",\n className: \"\".concat(className, \" state-control-checkbox rotate-button\"),\n id: \"\".concat(className)\n });\n }\n }, []);\n var checked = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return function () {\n var checkboxes = document.querySelectorAll(\".\".concat(className));\n if (checkboxes.length == 0) {\n return false;\n }\n var box = checkboxes[0];\n return box.checked;\n };\n }, []);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n var checkboxes = document.querySelectorAll(\".\".concat(className));\n // (1) On/Off同期\n checkboxes.forEach(function (x) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n x.onchange = function (ev) {\n updateState(ev.target.checked);\n };\n });\n // (2) 全エレメントoff\n var removers = document.querySelectorAll(\".\".concat(className, \"-remover\"));\n removers.forEach(function (x) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n x.onclick = function (ev) {\n if (ev.target.className.indexOf(\"\".concat(className, \"-remover\")) > 0) {\n updateState(false);\n }\n };\n });\n }, []);\n\n // (3) ステート変更\n var updateState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return function (newVal) {\n var currentCheckboxes = document.querySelectorAll(\".\".concat(className));\n currentCheckboxes.forEach(function (y) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n y.checked = newVal;\n });\n if (changeCallback) {\n callback(newVal);\n }\n };\n }, []);\n return {\n trigger: trigger,\n updateState: updateState,\n checked: checked,\n className: className\n };\n};\n\n//# sourceURL=webpack://demo/./src/hooks/useStateControlCheckbox.tsx?"); /***/ }), /***/ "./src/utils/utils.ts": /*!****************************!*\ !*** ./src/utils/utils.ts ***! \****************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ checkExtention: () => (/* binding */ checkExtention),\n/* harmony export */ trimfileName: () => (/* binding */ trimfileName)\n/* harmony export */ });\nvar trimfileName = function trimfileName(name, length) {\n var trimmedName = name.replace(/^.*[\\\\\\/]/, '');\n if (trimmedName.length > length) {\n return trimmedName.substring(0, length) + \"...\";\n } else {\n return trimmedName;\n }\n};\nvar checkExtention = function checkExtention(filename, acceptExtentions) {\n var ext = filename.split('.').pop();\n if (!ext) {\n return false;\n }\n return acceptExtentions.includes(ext);\n};\n\n//# sourceURL=webpack://demo/./src/utils/utils.ts?"); /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js!./src/css/101_RotatedButton.css": /*!***************************************************************************************************************************************************!*\ !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js!./src/css/101_RotatedButton.css ***! \***************************************************************************************************************************************************/ /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `/* 前提条件 */\r\n\r\n.rotate-button-container {\r\n height: var(--header-height);\r\n width: var(--header-height);\r\n position: relative;\r\n}\r\n.rotate-button {\r\n display: none;\r\n}\r\n.rotate-button ~ .rotate-lable {\r\n padding: 2px;\r\n position: absolute;\r\n transition: all 0.3s;\r\n cursor: pointer;\r\n height: var(--header-height);\r\n width: var(--header-height);\r\n}\r\n.rotate-button ~ .rotate-lable > * {\r\n width: 100%;\r\n height: 100%;\r\n float: left;\r\n transition: all 0.3s;\r\n}\r\n.rotate-button ~ .rotate-lable > * .spin-on {\r\n width: 100%;\r\n height: 100%;\r\n display: none;\r\n }\r\n.rotate-button ~ .rotate-lable > * .spin-off {\r\n width: 100%;\r\n height: 100%;\r\n display: blcok;\r\n }\r\n.rotate-button ~ .rotate-lable > .colored {\r\n color: rgba(200, 200, 200, 0.8);\r\n background: rgba(0, 0, 0, 1);\r\n transition: all 0.3s;\r\n}\r\n.rotate-button ~ .rotate-lable > .colored .spin-on {\r\n display: none;\r\n }\r\n.rotate-button ~ .rotate-lable > .colored .spin-off {\r\n display: block;\r\n }\r\n.rotate-button:checked ~ .rotate-lable > .colored {\r\n color: rgba(50, 240, 50, 0.8);\r\n background: rgba(60, 60, 60, 1);\r\n transition: all 0.3s;\r\n}\r\n.rotate-button:checked ~ .rotate-lable > .colored .spin-on {\r\n display: block;\r\n }\r\n.rotate-button:checked ~ .rotate-lable > .colored .spin-off {\r\n display: none;\r\n }\r\n\r\n.rotate-button:checked ~ .rotate-lable > .spinner {\r\n width: 100%;\r\n height: 100%;\r\n transform: rotate(180deg);\r\n transition: all 0.3s;\r\n box-sizing: border-box;\r\n}\r\n\r\n.rotate-button:checked ~ .rotate-lable > .spinner .spin-on {\r\n display: block;\r\n }\r\n\r\n.rotate-button:checked ~ .rotate-lable > .spinner .spin-off {\r\n display: none;\r\n }\r\n`, \"\"]);\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://demo/./src/css/101_RotatedButton.css?./node_modules/css-loader/dist/cjs.js??ruleSet%5B1%5D.rules%5B2%5D.use%5B1%5D!./node_modules/postcss-loader/dist/cjs.js"); /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js!./src/css/App.css": /*!*************************************************************************************************************************************!*\ !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js!./src/css/App.css ***! \*************************************************************************************************************************************/ /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_101_RotatedButton_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! -!../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../node_modules/postcss-loader/dist/cjs.js!./101_RotatedButton.css */ \"./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js!./src/css/101_RotatedButton.css\");\n/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_Error_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! -!../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../node_modules/postcss-loader/dist/cjs.js!./Error.css */ \"./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js!./src/css/Error.css\");\n// Imports\n\n\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n___CSS_LOADER_EXPORT___.push([module.id, \"@import url(https://fonts.googleapis.com/css2?family=Chicle&family=Poppins:ital,wght@0,200;0,400;0,600;1,200;1,400;1,600&display=swap);\"]);\n___CSS_LOADER_EXPORT___.push([module.id, \"@import url(https://fonts.googleapis.com/css2?family=Yusei+Magic&display=swap);\"]);\n___CSS_LOADER_EXPORT___.i(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_101_RotatedButton_css__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n___CSS_LOADER_EXPORT___.i(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_Error_css__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root {\r\n --text-color: #333;\r\n --company-color1: rgba(64, 119, 187, 1);\r\n --company-color2: rgba(29, 47, 78, 1);\r\n --company-color3: rgba(255, 255, 255, 1);\r\n --company-color1-alpha: rgba(64, 119, 187, 0.3);\r\n --company-color2-alpha: rgba(29, 47, 78, 0.3);\r\n --company-color3-alpha: rgba(255, 255, 255, 0.3);\r\n --global-shadow-color: rgba(0, 0, 0, 0.4);\r\n\r\n --sidebar-transition-time: 0.2s;\r\n --sidebar-transition-time-quick: 0.1s;\r\n --sidebar-transition-animation: ease-in-out;\r\n\r\n --header-height: 1.5rem;\r\n --right-sidebar-width: 320px;\r\n\r\n --dialog-border-color: rgba(100, 100, 100, 1);\r\n --dialog-shadow-color: rgba(0, 0, 0, 0.3);\r\n --dialog-background-color: rgba(255, 255, 255, 1);\r\n --dialog-primary-color: rgba(19, 70, 209, 1);\r\n --dialog-active-color: rgba(40, 70, 209, 1);\r\n --dialog-input-border-color: rgba(200, 200, 200, 1);\r\n --dialog-submit-button-color: rgba(180, 190, 230, 1);\r\n --dialog-cancel-button-color: rgba(235, 80, 80, 1);\r\n\r\n --body-video-seeker-height: 3rem;\r\n}\r\n\r\n* {\r\n margin: 0;\r\n padding: 0;\r\n box-sizing: border-box;\r\n font-family: \"Poppins\", sans-serif;\r\n}\r\nhtml {\r\n font-size: 16px;\r\n}\r\nbody {\r\n height: 100%;\r\n width: 100%;\r\n overflow-y: scroll;\r\n overflow-x: hidden;\r\n color: var(--text-color);\r\n /* background: linear-gradient(45deg, var(--company-color1) 0, 5%, var(--company-color2) 5% 10%, var(--company-color3) 10% 80%, var(--company-color1) 80% 85%, var(--company-color2) 85% 100%); */\r\n background: linear-gradient(45deg, var(--company-color1) 0, 1%, var(--company-color2) 1% 5%, var(--company-color3) 5% 90%, var(--company-color1) 90% 95%, var(--company-color2) 95% 100%);\r\n}\r\n#app {\r\n height: 100%;\r\n width: 100%;\r\n}\r\n.first-gesture {\r\n background: rgba(200, 0, 0, 0.2);\r\n width: 100%;\r\n height: 100%;\r\n position: absolute;\r\n}\r\n\r\n/* Main + Section Partition*/\r\n.main-body {\r\n height: 100%;\r\n width: 100%;\r\n padding: 2rem;\r\n font-family: \"Yusei Magic\", sans-serif;\r\n display: flex;\r\n flex-direction: column;\r\n font-size: 1rem;\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n}\r\n/* Title */\r\n.main-body .top-title .title {\r\n font-size: 3rem;\r\n }\r\n.main-body .top-title .top-title-version {\r\n margin-left: 2rem;\r\n font-size: 1.2rem;\r\n background: linear-gradient(transparent 60%, yellow 30%);\r\n }\r\n.main-body .top-title .top-title-version-number {\r\n margin-left: 0.3rem;\r\n font-size: 0.8rem;\r\n }\r\n.main-body .top-title .belongings {\r\n margin-left: 1rem;\r\n margin-right: 1rem;\r\n }\r\n.main-body .top-title .belongings .link {\r\n margin-left: 1rem;\r\n font-weight: 700;\r\n text-decoration: underline;\r\n }\r\n/* Partition */\r\n.main-body .partition {\r\n width: 100%;\r\n }\r\n.main-body .partition .partition-header {\r\n font-weight: 700;\r\n color: rgb(71, 69, 69);\r\n display: flex;\r\n }\r\n.main-body .partition .partition-header .caret {\r\n width: 2rem;\r\n }\r\n.main-body .partition .partition-header .title {\r\n font-size: 1.1rem;\r\n }\r\n.main-body .partition .partition-header .belongings {\r\n font-weight: 400;\r\n font-size: 0.8rem;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: flex-end;\r\n margin-left: 10px;\r\n }\r\n.main-body .partition .partition-header .belongings .belongings-checkbox {\r\n margin-bottom: 3px;\r\n }\r\n.main-body .partition .partition-content {\r\n position: static;\r\n overflow-y: hidden;\r\n }\r\n.main-body .partition .row-split {\r\n }\r\n.state-control-checkbox:checked + .partition .partition-content {\r\n max-height: 700px;\r\n background: rgba(255, 255, 255, 0.3);\r\n transition: all var(--sidebar-transition-time) var(--sidebar-transition-animation);\r\n}\r\n.state-control-checkbox + .partition .partition-content {\r\n max-height: 0px;\r\n background: rgba(233, 233, 255, 0.3);\r\n transition: all var(--sidebar-transition-time) var(--sidebar-transition-animation);\r\n}\r\n/* ROW */\r\n\r\n.split-8-2 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n\r\n.split-8-2 > div:nth-child(1) {\r\n left: 0px;\r\n width: 80%;\r\n }\r\n\r\n.split-8-2 > div:nth-child(2) {\r\n left: 80%;\r\n width: 20%;\r\n }\r\n.split-6-4 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n.split-6-4 > div:nth-child(1) {\r\n left: 0px;\r\n width: 60%;\r\n }\r\n.split-6-4 > div:nth-child(2) {\r\n left: 60%;\r\n width: 40%;\r\n }\r\n.split-5-5 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n.split-5-5 > div:nth-child(1) {\r\n left: 0px;\r\n width: 50%;\r\n }\r\n.split-5-5 > div:nth-child(2) {\r\n left: 50%;\r\n width: 50%;\r\n }\r\n.split-4-6 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n.split-4-6 > div:nth-child(1) {\r\n left: 0px;\r\n width: 40%;\r\n }\r\n.split-4-6 > div:nth-child(2) {\r\n left: 40%;\r\n width: 60%;\r\n }\r\n.split-3-7 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n.split-3-7 > div:nth-child(1) {\r\n left: 0px;\r\n width: 30%;\r\n }\r\n.split-3-7 > div:nth-child(2) {\r\n left: 30%;\r\n width: 70%;\r\n }\r\n\r\n.split-2-8 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n\r\n.split-2-8 > div:nth-child(1) {\r\n left: 0px;\r\n width: 20%;\r\n }\r\n\r\n.split-2-8 > div:nth-child(2) {\r\n left: 20%;\r\n width: 80%;\r\n }\r\n\r\n.split-1-8-1 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n\r\n.split-1-8-1 > div:nth-child(1) {\r\n left: 0px;\r\n width: 10%;\r\n }\r\n\r\n.split-1-8-1 > div:nth-child(2) {\r\n left: 10%;\r\n width: 80%;\r\n }\r\n\r\n.split-1-8-1 > div:nth-child(3) {\r\n left: 90%;\r\n width: 10%;\r\n }\r\n.split-2-2-6 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n.split-2-2-6 > div:nth-child(1) {\r\n left: 0px;\r\n width: 20%;\r\n }\r\n.split-2-2-6 > div:nth-child(2) {\r\n left: 20%;\r\n width: 20%;\r\n }\r\n.split-2-2-6 > div:nth-child(3) {\r\n left: 40%;\r\n width: 60%;\r\n }\r\n.split-3-3-4 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n.split-3-3-4 > div:nth-child(1) {\r\n left: 0px;\r\n width: 30%;\r\n }\r\n.split-3-3-4 > div:nth-child(2) {\r\n left: 30%;\r\n width: 30%;\r\n }\r\n.split-3-3-4 > div:nth-child(3) {\r\n left: 60%;\r\n width: 40%;\r\n }\r\n\r\n.split-3-4-3 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n\r\n.split-3-4-3 > div:nth-child(1) {\r\n left: 0px;\r\n width: 30%;\r\n }\r\n\r\n.split-3-4-3 > div:nth-child(2) {\r\n left: 30%;\r\n width: 40%;\r\n }\r\n\r\n.split-3-4-3 > div:nth-child(3) {\r\n left: 70%;\r\n width: 30%;\r\n }\r\n.split-2-5-3 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n.split-2-5-3 > div:nth-child(1) {\r\n left: 0px;\r\n width: 20%;\r\n }\r\n.split-2-5-3 > div:nth-child(2) {\r\n left: 20%;\r\n width: 50%;\r\n }\r\n.split-2-5-3 > div:nth-child(3) {\r\n left: 70%;\r\n width: 30%;\r\n }\r\n.split-4-4-2 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n.split-4-4-2 > div:nth-child(1) {\r\n left: 0px;\r\n width: 40%;\r\n }\r\n.split-4-4-2 > div:nth-child(2) {\r\n left: 40%;\r\n width: 40%;\r\n }\r\n.split-4-4-2 > div:nth-child(3) {\r\n left: 80%;\r\n width: 20%;\r\n }\r\n.split-1-4-4-1 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n.split-1-4-4-1 > div:nth-child(1) {\r\n left: 0px;\r\n width: 10%;\r\n }\r\n.split-1-4-4-1 > div:nth-child(2) {\r\n left: 10%;\r\n width: 40%;\r\n }\r\n.split-1-4-4-1 > div:nth-child(3) {\r\n left: 50%;\r\n width: 40%;\r\n }\r\n.split-1-4-4-1 > div:nth-child(4) {\r\n left: 90%;\r\n width: 10%;\r\n }\r\n\r\n.split-3-2-2-3 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n\r\n.split-3-2-2-3 > div:nth-child(1) {\r\n left: 0px;\r\n width: 30%;\r\n }\r\n\r\n.split-3-2-2-3 > div:nth-child(2) {\r\n left: 30%;\r\n width: 20%;\r\n }\r\n\r\n.split-3-2-2-3 > div:nth-child(3) {\r\n left: 50%;\r\n width: 20%;\r\n }\r\n\r\n.split-3-2-2-3 > div:nth-child(4) {\r\n left: 70%;\r\n width: 30%;\r\n }\r\n.split-3-2-3-2 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n.split-3-2-3-2 > div:nth-child(1) {\r\n left: 0px;\r\n width: 30%;\r\n }\r\n.split-3-2-3-2 > div:nth-child(2) {\r\n left: 30%;\r\n width: 20%;\r\n }\r\n.split-3-2-3-2 > div:nth-child(3) {\r\n left: 50%;\r\n width: 30%;\r\n }\r\n.split-3-2-3-2 > div:nth-child(4) {\r\n left: 80%;\r\n width: 20%;\r\n }\r\n.split-3-1-2-4 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n.split-3-1-2-4 > div:nth-child(1) {\r\n left: 0px;\r\n width: 30%;\r\n }\r\n.split-3-1-2-4 > div:nth-child(2) {\r\n left: 30%;\r\n width: 10%;\r\n }\r\n.split-3-1-2-4 > div:nth-child(3) {\r\n left: 40%;\r\n width: 20%;\r\n }\r\n.split-3-1-2-4 > div:nth-child(4) {\r\n left: 60%;\r\n width: 40%;\r\n }\r\n.split-3-2-1-4 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n.split-3-2-1-4 > div:nth-child(1) {\r\n left: 0px;\r\n width: 30%;\r\n }\r\n.split-3-2-1-4 > div:nth-child(2) {\r\n left: 30%;\r\n width: 20%;\r\n }\r\n.split-3-2-1-4 > div:nth-child(3) {\r\n left: 50%;\r\n width: 10%;\r\n }\r\n.split-3-2-1-4 > div:nth-child(4) {\r\n left: 60%;\r\n width: 40%;\r\n }\r\n.split-3-2-2-2-1 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n.split-3-2-2-2-1 > div:nth-child(1) {\r\n left: 0px;\r\n width: 30%;\r\n }\r\n.split-3-2-2-2-1 > div:nth-child(2) {\r\n left: 30%;\r\n width: 20%;\r\n }\r\n.split-3-2-2-2-1 > div:nth-child(3) {\r\n left: 50%;\r\n width: 20%;\r\n }\r\n.split-3-2-2-2-1 > div:nth-child(4) {\r\n left: 70%;\r\n width: 20%;\r\n }\r\n.split-3-2-2-2-1 > div:nth-child(5) {\r\n left: 90%;\r\n width: 10%;\r\n }\r\n.split-3-1-1-1-4 {\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n margin: 1px 0px 1px 0px;\r\n}\r\n.split-3-1-1-1-4 > div:nth-child(1) {\r\n left: 0px;\r\n width: 30%;\r\n }\r\n.split-3-1-1-1-4 > div:nth-child(2) {\r\n left: 30%;\r\n width: 10%;\r\n }\r\n.split-3-1-1-1-4 > div:nth-child(3) {\r\n left: 40%;\r\n width: 10%;\r\n }\r\n.split-3-1-1-1-4 > div:nth-child(4) {\r\n left: 50%;\r\n width: 10%;\r\n }\r\n.split-3-1-1-1-4 > div:nth-child(5) {\r\n left: 60%;\r\n width: 40%;\r\n }\r\n.w20 {\r\n width: 20%;\r\n}\r\n.bold {\r\n font-weight: 700;\r\n}\r\n.w40 {\r\n width: 40%;\r\n}\r\n\r\n.underline {\r\n border-bottom: 3px solid #333;\r\n}\r\n.left-padding-05 {\r\n padding-left: 0.5rem;\r\n}\r\n.left-padding-1 {\r\n padding-left: 1rem;\r\n}\r\n.left-padding-2 {\r\n padding-left: 2rem;\r\n}\r\n.left-margin-1 {\r\n margin-left: 1rem;\r\n}\r\n.left-margin-2 {\r\n margin-left: 2rem;\r\n}\r\n.highlight {\r\n background-color: rgba(200, 200, 255, 0.3);\r\n}\r\n.guided {\r\n /* background-color: rgba(9, 133, 67, 0.3); */\r\n background-color: rgba(159, 165, 162, 0.1);\r\n /* border-bottom: 1px solid rgba(9, 133, 67, 0.3); */\r\n}\r\n\r\n.divider {\r\n height: 0.8rem;\r\n /* background-color: rgba(16, 210, 113, 0.1); */\r\n background-color: rgba(31, 42, 36, 0.1);\r\n}\r\n\r\n.body-section-title {\r\n font-size: 1.5rem;\r\n color: rgb(51, 49, 49);\r\n}\r\n.body-sub-section-title {\r\n font-size: 1.1rem;\r\n font-weight: 700;\r\n color: rgb(3, 53, 12);\r\n}\r\n\r\n.body-item-title {\r\n color: rgb(51, 99, 49);\r\n display: flex;\r\n}\r\n.body-item-text {\r\n color: rgb(30, 30, 30);\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n}\r\n.body-item-text .body-item-text-item {\r\n padding-left: 1rem;\r\n }\r\n.body-item-text-small {\r\n color: rgb(30, 30, 30);\r\n font-size: 0.7rem;\r\n}\r\n.body-item-text-em {\r\n color: rgb(250, 30, 30);\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n font-weight: 700;\r\n}\r\n\r\n.body-input-container {\r\n display: flex;\r\n}\r\n.body-item-input {\r\n width: 60%;\r\n}\r\n.body-item-input-slider {\r\n width: 60%;\r\n}\r\n.body-item-input-slider-label {\r\n margin-right: 1rem;\r\n}\r\n.body-item-input-slider-val {\r\n margin-left: 1rem;\r\n}\r\n.body-item-input-slider-2nd {\r\n width: 60%;\r\n accent-color: #33f;\r\n}\r\n\r\n.body-button-container {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n}\r\n\r\n.body-button-container > div {\r\n margin-left: 5px;\r\n margin-right: 5px;\r\n padding-left: 20px;\r\n padding-right: 20px;\r\n }\r\n\r\n.body-button-container .body-button {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n border: solid 1px #999;\r\n border-radius: 2px;\r\n cursor: pointer;\r\n vertical-align: middle;\r\n text-align: center;\r\n }\r\n\r\n.body-button-container .body-button:hover {\r\n border: solid 1px #000;\r\n }\r\n\r\n.body-button-container .body-button-disabled {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n border: solid 1px #999;\r\n border-radius: 2px;\r\n vertical-align: middle;\r\n background: #ddd;\r\n }\r\n\r\n.body-button-container .body-button-active {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n border: solid 1px #333;\r\n border-radius: 2px;\r\n background: #ada;\r\n }\r\n\r\n.body-button-container .body-button-stanby {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n border: solid 1px #999;\r\n border-radius: 2px;\r\n background: #aba;\r\n cursor: pointer;\r\n }\r\n\r\n.body-button-container .body-button-stanby:hover {\r\n border: solid 1px #000;\r\n }\r\n\r\n.body-button-container-space-around {\r\n justify-content: space-around;\r\n}\r\n\r\n.body-select {\r\n color: rgb(30, 30, 30);\r\n max-width: 100%;\r\n}\r\n\r\n.body-select-50 {\r\n color: rgb(30, 30, 30);\r\n max-width: 50%;\r\n height: 1.5rem;\r\n}\r\n.select-option-red {\r\n color: #f66;\r\n font-weight: 700;\r\n}\r\n\r\n.body-image-container,\r\n.body-wav-container {\r\n display: flex;\r\n width: 100%;\r\n}\r\n\r\n.body-image-container .body-image-container-title,\r\n .body-image-container .body-wav-container-title,\r\n .body-wav-container .body-image-container-title,\r\n .body-wav-container .body-wav-container-title {\r\n width: 20%;\r\n }\r\n\r\n.body-image-container .body-image-container-img,\r\n .body-image-container .body-wav-container-wav,\r\n .body-wav-container .body-image-container-img,\r\n .body-wav-container .body-wav-container-wav {\r\n width: 80%;\r\n }\r\n\r\n.donate-img {\r\n border-radius: 35px;\r\n height: 1.5rem;\r\n}\r\n\r\n/* Dialog */\r\n.dialog-container,\r\n.dialog-container2 {\r\n justify-content: center;\r\n align-items: center;\r\n position: absolute;\r\n top: 0px;\r\n left: 0px;\r\n width: 100vw;\r\n height: 100vh;\r\n z-index: -1;\r\n display: none;\r\n}\r\n.dialog-container .dialog-frame, .dialog-container2 .dialog-frame {\r\n color: var(--company-color2);\r\n width: 40rem;\r\n max-height: 80vh;\r\n border: 2px solid var(--dialog-border-color);\r\n border-radius: 20px;\r\n flex-direction: column;\r\n align-items: center;\r\n box-shadow: 5px 5px 5px var(--dialog-shadow-color);\r\n background: var(--dialog-background-color);\r\n overflow: hidden;\r\n display: flex;\r\n }\r\n.dialog-container .dialog-frame .dialog-title, .dialog-container2 .dialog-frame .dialog-title {\r\n margin-top: 20px;\r\n background: var(--company-color2);\r\n color: #fff;\r\n width: 100%;\r\n text-align: center;\r\n }\r\n.dialog-container .dialog-frame .dialog-content, .dialog-container2 .dialog-frame .dialog-content {\r\n width: 90%;\r\n }\r\n.dialog-container .dialog-frame .dialog-content .dialog-application-title, .dialog-container2 .dialog-frame .dialog-content .dialog-application-title {\r\n font-family: \"Chicle\", cursive;\r\n font-size: 3rem;\r\n text-align: center;\r\n }\r\n.dialog-container .dialog-frame .dialog-content .dialog-content-part, .dialog-container2 .dialog-frame .dialog-content .dialog-content-part {\r\n margin-top: 1rem;\r\n margin-bottom: 1rem;\r\n }\r\n.dialog-container .dialog-frame .dialog-content .input-text-container, .dialog-container2 .dialog-frame .dialog-content .input-text-container {\r\n display: flex;\r\n flex-direction: row;\r\n margin: 20px;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content, .dialog-container2 .dialog-frame .dialog-fixed-size-content {\r\n width: 90%;\r\n max-height: 70vh;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-header,\r\n .dialog-container .dialog-frame .dialog-fixed-size-content .file-uploader-header,\r\n .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-header,\r\n .dialog-container2 .dialog-frame .dialog-fixed-size-content .file-uploader-header {\r\n font-weight: 700;\r\n margin: 5px 5px 5px 5px;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-header .model-slot-header-button,\r\n .dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-header .file-uploader-header-button,\r\n .dialog-container .dialog-frame .dialog-fixed-size-content .file-uploader-header .model-slot-header-button,\r\n .dialog-container .dialog-frame .dialog-fixed-size-content .file-uploader-header .file-uploader-header-button,\r\n .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-header .model-slot-header-button,\r\n .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-header .file-uploader-header-button,\r\n .dialog-container2 .dialog-frame .dialog-fixed-size-content .file-uploader-header .model-slot-header-button,\r\n .dialog-container2 .dialog-frame .dialog-fixed-size-content .file-uploader-header .file-uploader-header-button {\r\n font-weight: 400;\r\n font-size: 0.8rem;\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n border: solid 1px #999;\r\n border-radius: 2px;\r\n cursor: pointer;\r\n vertical-align: middle;\r\n text-align: center;\r\n padding: 1px 5px 1px 5px;\r\n margin-left: 1rem;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-header .model-slot-header-button:hover, .dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-header .file-uploader-header-button:hover, .dialog-container .dialog-frame .dialog-fixed-size-content .file-uploader-header .model-slot-header-button:hover, .dialog-container .dialog-frame .dialog-fixed-size-content .file-uploader-header .file-uploader-header-button:hover, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-header .model-slot-header-button:hover, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-header .file-uploader-header-button:hover, .dialog-container2 .dialog-frame .dialog-fixed-size-content .file-uploader-header .model-slot-header-button:hover, .dialog-container2 .dialog-frame .dialog-fixed-size-content .file-uploader-header .file-uploader-header-button:hover {\r\n border: solid 1px #000;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container {\r\n max-height: 60vh;\r\n width: 100%;\r\n overflow-y: scroll;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot {\r\n height: 5rem;\r\n display: flex;\r\n flex-direction: row;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-icon, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-icon {\r\n width: 5rem;\r\n height: 5rem;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-icon-pointable, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-icon-pointable {\r\n width: 5rem;\r\n height: 5rem;\r\n cursor: pointer;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail {\r\n display: flex;\r\n flex-direction: column;\r\n font-size: 0.8rem;\r\n border-bottom: solid 1px #aaa;\r\n width: 80%;\r\n overflow-y: scroll;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail::-webkit-scrollbar, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail::-webkit-scrollbar {\r\n width: 10px;\r\n height: 10px;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail::-webkit-scrollbar-track, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail::-webkit-scrollbar-track {\r\n background-color: #eee;\r\n border-radius: 3px;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail::-webkit-scrollbar-thumb, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail::-webkit-scrollbar-thumb {\r\n background: #f7cfec80;\r\n border-radius: 3px;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail .model-slot-detail-row, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail .model-slot-detail-row {\r\n display: flex;\r\n flex-direction: row;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail .model-slot-detail-row .model-slot-detail-row-label, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail .model-slot-detail-row .model-slot-detail-row-label {\r\n width: 20%;\r\n white-space: nowrap;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail .model-slot-detail-row .model-slot-detail-row-value, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail .model-slot-detail-row .model-slot-detail-row-value {\r\n width: 55%;\r\n white-space: nowrap;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail .model-slot-detail-row .model-slot-detail-row-value-download, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail .model-slot-detail-row .model-slot-detail-row-value-download {\r\n width: 55%;\r\n white-space: nowrap;\r\n cursor: pointer;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail .model-slot-detail-row .model-slot-detail-row-value-pointable, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail .model-slot-detail-row .model-slot-detail-row-value-pointable {\r\n width: 55%;\r\n white-space: nowrap;\r\n cursor: pointer;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail .model-slot-detail-row .model-slot-detail-row-value-edit, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail .model-slot-detail-row .model-slot-detail-row-value-edit {\r\n width: 55%;\r\n font-weight: 700;\r\n color: #f00;\r\n white-space: nowrap;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail .model-slot-detail-row .model-slot-detail-row-button, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-detail .model-slot-detail-row .model-slot-detail-row-button {\r\n width: 15%;\r\n height: 90%;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-buttons, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-buttons {\r\n display: flex;\r\n flex-direction: column;\r\n border-bottom: solid 1px #a00;\r\n width: 20%;\r\n font-size: 0.8rem;\r\n padding: 4px;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-button, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-button {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n border: solid 1px #999;\r\n border-radius: 2px;\r\n cursor: pointer;\r\n vertical-align: middle;\r\n text-align: center;\r\n padding: 1px;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-button:hover, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-button:hover {\r\n border: solid 1px #000;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-button-disabled, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-button-disabled {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n border: solid 1px #999;\r\n border-radius: 2px;\r\n vertical-align: middle;\r\n background: #ddd;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-button-active, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-button-active {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n border: solid 1px #333;\r\n border-radius: 2px;\r\n background: #ada;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-button-stanby, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-button-stanby {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n border: solid 1px #999;\r\n border-radius: 2px;\r\n background: #aba;\r\n cursor: pointer;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-button-stanby:hover, .dialog-container2 .dialog-frame .dialog-fixed-size-content .model-slot-container .model-slot .model-slot-button-stanby:hover {\r\n border: solid 1px #000;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .file-uploader-voice-changer-select,\r\n .dialog-container .dialog-frame .dialog-fixed-size-content .edit-model-slot-title,\r\n .dialog-container2 .dialog-frame .dialog-fixed-size-content .file-uploader-voice-changer-select,\r\n .dialog-container2 .dialog-frame .dialog-fixed-size-content .edit-model-slot-title {\r\n font-size: 1rem;\r\n padding-left: 0.5rem;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-container, .dialog-container2 .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-container {\r\n font-size: 0.9rem;\r\n padding-left: 1rem;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-container .file-uploader-file-select-row, .dialog-container2 .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-container .file-uploader-file-select-row {\r\n display: flex;\r\n flex-direction: row;\r\n margin: 0.2rem;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-container .file-uploader-file-select-row .file-uploader-file-select-row-label, .dialog-container2 .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-container .file-uploader-file-select-row .file-uploader-file-select-row-label {\r\n width: 5rem;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-container .file-uploader-file-select-row .file-uploader-file-select-row-value, .dialog-container2 .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-container .file-uploader-file-select-row .file-uploader-file-select-row-value {\r\n width: 20rem;\r\n color: #f00;\r\n white-space: nowrap;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-container .file-uploader-file-select-row .file-uploader-file-select-row-button, .dialog-container2 .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-container .file-uploader-file-select-row .file-uploader-file-select-row-button {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n border: solid 1px #999;\r\n border-radius: 2px;\r\n cursor: pointer;\r\n vertical-align: middle;\r\n text-align: center;\r\n padding: 1px;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-container .file-uploader-file-select-row .file-uploader-file-select-row-button:hover, .dialog-container2 .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-container .file-uploader-file-select-row .file-uploader-file-select-row-button:hover {\r\n border: solid 1px #000;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-upload-button-container, .dialog-container2 .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-upload-button-container {\r\n display: flex;\r\n flex-direction: row;\r\n margin-top: 1rem;\r\n margin-bottom: 0.5rem;\r\n justify-content: center;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-upload-button-container .file-uploader-file-select-upload-button, .dialog-container2 .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-upload-button-container .file-uploader-file-select-upload-button {\r\n /* width: 12rem; */\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n border: solid 1px #999;\r\n border-radius: 2px;\r\n cursor: pointer;\r\n vertical-align: middle;\r\n text-align: center;\r\n padding: 1px 10px 1px 10px;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-upload-button-container .file-uploader-file-select-upload-button:hover, .dialog-container2 .dialog-frame .dialog-fixed-size-content .file-uploader-file-select-upload-button-container .file-uploader-file-select-upload-button:hover {\r\n border: solid 1px #000;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .edit-model-slot-row, .dialog-container2 .dialog-frame .dialog-fixed-size-content .edit-model-slot-row {\r\n display: flex;\r\n flex-direction: row;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .edit-model-slot-row .edit-model-slot-title, .dialog-container2 .dialog-frame .dialog-fixed-size-content .edit-model-slot-row .edit-model-slot-title {\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .edit-model-slot-row .edit-model-slot-speakers, .dialog-container2 .dialog-frame .dialog-fixed-size-content .edit-model-slot-row .edit-model-slot-speakers {\r\n display: flex;\r\n flex-direction: row;\r\n margin: 0px 0px 0px 1rem;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .edit-model-slot-row .edit-model-slot-speakers .edit-model-slot-speakers-id-label,\r\n .dialog-container .dialog-frame .dialog-fixed-size-content .edit-model-slot-row .edit-model-slot-speakers .edit-model-slot-speakers-name-label,\r\n .dialog-container2 .dialog-frame .dialog-fixed-size-content .edit-model-slot-row .edit-model-slot-speakers .edit-model-slot-speakers-id-label,\r\n .dialog-container2 .dialog-frame .dialog-fixed-size-content .edit-model-slot-row .edit-model-slot-speakers .edit-model-slot-speakers-name-label {\r\n margin: 0px 0px 0px 0.5rem;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .edit-model-slot-row .edit-model-slot-speakers .edit-model-slot-speakers-buttons, .dialog-container2 .dialog-frame .dialog-fixed-size-content .edit-model-slot-row .edit-model-slot-speakers .edit-model-slot-speakers-buttons {\r\n margin: 0px 0px 0px 0.5rem;\r\n display: flex;\r\n flex-direction: row;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .edit-model-slot-row .edit-model-slot-speakers .edit-model-slot-speakers-buttons .edit-model-slot-speakers-button, .dialog-container2 .dialog-frame .dialog-fixed-size-content .edit-model-slot-row .edit-model-slot-speakers .edit-model-slot-speakers-buttons .edit-model-slot-speakers-button {\r\n margin: 0px 0.5rem 0px 0.5rem;\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n border: solid 1px #999;\r\n border-radius: 2px;\r\n cursor: pointer;\r\n vertical-align: middle;\r\n text-align: center;\r\n padding: 0px 10px 0px 10px;\r\n }\r\n.dialog-container .dialog-frame .dialog-fixed-size-content .edit-model-slot-row .edit-model-slot-speakers .edit-model-slot-speakers-buttons .edit-model-slot-speakers-button:hover, .dialog-container2 .dialog-frame .dialog-fixed-size-content .edit-model-slot-row .edit-model-slot-speakers .edit-model-slot-speakers-buttons .edit-model-slot-speakers-button:hover {\r\n border: solid 1px #000;\r\n }\r\n.dialog-container-show {\r\n display: flex;\r\n}\r\n\r\n.state-control-checkbox:checked ~ .dialog-container {\r\n background: rgba(200, 200, 200, 0.4);\r\n animation-name: dialog-show;\r\n animation-duration: 0.4s;\r\n animation-iteration-count: 1;\r\n animation-fill-mode: forwards;\r\n animation-direction: normal;\r\n}\r\n.state-control-checkbox ~ .dialog-container {\r\n background: rgba(100, 100, 100, 0.4);\r\n animation-name: dialog-hide;\r\n animation-duration: 0.4s;\r\n animation-iteration-count: 1;\r\n animation-fill-mode: forwards;\r\n animation-direction: normal;\r\n}\r\n.state-control-checkbox:checked + .dialog-frame {\r\n display: flex;\r\n}\r\n.state-control-checkbox + .dialog-frame {\r\n display: none;\r\n}\r\n\r\n@keyframes dialog-hide {\r\n from {\r\n opacity: 1;\r\n z-index: 200;\r\n }\r\n 90% {\r\n opacity: 0;\r\n z-index: -1;\r\n }\r\n to {\r\n opacity: 0;\r\n z-index: -1;\r\n }\r\n}\r\n\r\n@keyframes dialog-show {\r\n from {\r\n opacity: 0;\r\n z-index: -1;\r\n }\r\n 10% {\r\n z-index: 200;\r\n }\r\n to {\r\n opacity: 1;\r\n z-index: 200;\r\n }\r\n}\r\n\r\n.state-control-checkbox:checked ~ .dialog-container2 {\r\n background: rgba(200, 200, 200, 0.4);\r\n animation-name: dialog-show2;\r\n animation-duration: 0.4s;\r\n animation-iteration-count: 1;\r\n animation-fill-mode: forwards;\r\n animation-direction: normal;\r\n}\r\n.state-control-checkbox ~ .dialog-container2 {\r\n background: rgba(100, 100, 100, 0.4);\r\n animation-name: dialog-hide2;\r\n animation-duration: 0.4s;\r\n animation-iteration-count: 1;\r\n animation-fill-mode: forwards;\r\n animation-direction: normal;\r\n}\r\n/* .state-control-checkbox:checked + .dialog-frame {\r\n display: flex;\r\n}\r\n.state-control-checkbox + .dialog-frame {\r\n display: none;\r\n} */\r\n\r\n@keyframes dialog-hide2 {\r\n from {\r\n opacity: 1;\r\n z-index: 400;\r\n }\r\n 90% {\r\n opacity: 0;\r\n z-index: -1;\r\n }\r\n to {\r\n opacity: 0;\r\n z-index: -1;\r\n }\r\n}\r\n\r\n@keyframes dialog-show2 {\r\n from {\r\n opacity: 0;\r\n z-index: -1;\r\n }\r\n 10% {\r\n z-index: 400;\r\n }\r\n to {\r\n opacity: 1;\r\n z-index: 400;\r\n }\r\n}\r\n\r\n.tooltip-text {\r\n display: none;\r\n position: absolute;\r\n padding: 4px;\r\n font-size: 0.7rem;\r\n line-height: 2rem;\r\n color: #ddd;\r\n border-radius: 5px;\r\n background: #444;\r\n /* width: 100px; */\r\n}\r\n.tooltip-text-100px {\r\n width: 100px;\r\n}\r\n.tooltip-text-thin {\r\n line-height: 1rem;\r\n}\r\n.tooltip-text-right {\r\n line-height: 1rem;\r\n}\r\n.tooltip-text:before {\r\n content: \"\";\r\n position: absolute;\r\n top: -1.4rem;\r\n border: 12px solid transparent;\r\n border-top: 16px solid #444;\r\n margin-left: 0rem;\r\n transform: rotateZ(180deg);\r\n}\r\n.tooltip:hover .tooltip-text {\r\n display: inline-block;\r\n top: 30px;\r\n left: 0px;\r\n}\r\n.tooltip:hover .tooltip-text-lower {\r\n display: inline-block;\r\n top: 60px;\r\n left: 0px;\r\n}\r\n\r\n.tooltip {\r\n position: relative;\r\n cursor: pointer;\r\n display: inline-block;\r\n}\r\n\r\n/* ################## */\r\n.merge-field-container {\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n.merge-field-container .merge-field {\r\n display: flex;\r\n flex-direction: row;\r\n }\r\n.merge-field-container .merge-field .merge-field-elem {\r\n padding-left: 5px;\r\n }\r\n.merge-field-container .merge-field .red {\r\n color: #f00;\r\n }\r\n.merge-field-container .merge-field .purple {\r\n color: #33f;\r\n }\r\n.merge-field-container .merge-field .grey-bold {\r\n color: #555;\r\n font-weight: 800;\r\n }\r\n.model-slot-area {\r\n display: inline-block;\r\n background: var(--company-color2);\r\n border-radius: 10px;\r\n padding: 20px;\r\n}\r\n.model-slot-area .model-slot-panel {\r\n display: flex;\r\n flex-direction: row;\r\n gap: 5px;\r\n }\r\n.model-slot-area .model-slot-panel .model-slot-tiles-container {\r\n display: flex;\r\n flex-direction: row;\r\n gap: 2px;\r\n flex-wrap: wrap;\r\n /* width: calc(30rem + 40px + 10px); */\r\n }\r\n.model-slot-area .model-slot-panel .model-slot-buttons {\r\n display: flex;\r\n flex-direction: column-reverse;\r\n }\r\n.model-slot-area .model-slot-panel .model-slot-buttons .model-slot-button {\r\n border: solid 2px #999;\r\n color: white;\r\n font-size: 0.8rem;\r\n border-radius: 2px;\r\n background: #333;\r\n cursor: pointer;\r\n padding: 5px;\r\n }\r\n.model-slot-area .model-slot-panel .model-slot-buttons .model-slot-button:hover {\r\n border: solid 2px #faa;\r\n }\r\n.model-slot-tile-container,\r\n.model-slot-tile-container-selected {\r\n width: 6rem;\r\n height: 6rem;\r\n border-radius: 2px;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n}\r\n.model-slot-tile-container-selected {\r\n background: #43030c;\r\n}\r\n.model-slot-tile-container:hover {\r\n background: #43030c;\r\n}\r\n\r\n.model-slot-tile-icon-div {\r\n width: 5rem;\r\n height: 5rem;\r\n padding-top: 4px;\r\n position: relative;\r\n}\r\n.model-slot-tile-icon {\r\n width: 5rem;\r\n height: 5rem;\r\n -o-object-fit: contain;\r\n object-fit: contain;\r\n border-radius: 10px;\r\n position: absolute;\r\n}\r\n.model-slot-tile-vctype {\r\n position: absolute;\r\n font-size: 0.6rem;\r\n font-weight: 800;\r\n top: 5px;\r\n left: 2px;\r\n background: RGBA(10, 200, 100, 0.6);\r\n border-radius: 5px;\r\n padding: 0px 2px 0px 2px;\r\n}\r\n.model-slot-tile-icon-no-entry {\r\n color: gray;\r\n position: absolute;\r\n top: 2rem;\r\n}\r\n.model-slot-tile-dscription {\r\n font-size: 0.7rem;\r\n font-weight: 700;\r\n color: navajowhite;\r\n padding-top: 4px;\r\n}\r\n\r\n.character-area {\r\n display: flex;\r\n gap: 5px;\r\n padding: 20px;\r\n}\r\n\r\n.character-area .portrait-area {\r\n width: 20rem;\r\n height: 20rem;\r\n }\r\n\r\n.character-area .portrait-area .portrait-container {\r\n position: relative;\r\n width: 20rem;\r\n height: 20rem;\r\n }\r\n\r\n.character-area .portrait-area .portrait-container .portrait {\r\n width: 20rem;\r\n height: 20rem;\r\n -o-object-fit: contain;\r\n object-fit: contain;\r\n border-radius: 10px;\r\n position: absolute;\r\n }\r\n\r\n.character-area .portrait-area .portrait-container .portrait-area-status {\r\n width: 5rem;\r\n background: rgba(100, 100, 100, 0.5);\r\n color: white;\r\n position: absolute;\r\n padding: 0px 0px 0px 3px;\r\n font-size: 0.7rem;\r\n left: 5px;\r\n top: 5px;\r\n border-radius: 2px;\r\n }\r\n\r\n.character-area .portrait-area .portrait-container .portrait-area-status .portrait-area-status-vctype {\r\n font-weight: 800;\r\n color: #866;\r\n }\r\n\r\n.character-area .portrait-area .portrait-container .portrait-area-terms-of-use {\r\n width: 5rem;\r\n background: rgba(100, 100, 100, 0.5);\r\n color: white;\r\n position: absolute;\r\n paddig: 2px;\r\n font-size: 0.7rem;\r\n right: 5px;\r\n bottom: 5px;\r\n }\r\n\r\n.character-area .portrait-area .portrait-container .portrait-area-terms-of-use .portrait-area-terms-of-use-link {\r\n color: white;\r\n }\r\n\r\n.character-area .character-area-control-area {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 10px;\r\n }\r\n\r\n.character-area .character-area-control-area .character-area-control {\r\n display: flex;\r\n gap: 3px;\r\n }\r\n\r\n.character-area .character-area-control-area .character-area-control .character-area-control-buttons {\r\n display: flex;\r\n flex-direction: row;\r\n gap: 10px;\r\n }\r\n\r\n.character-area .character-area-control-area .character-area-control .character-area-control-buttons .character-area-control-button-active {\r\n width: 5rem;\r\n border: solid 1px #333;\r\n border-radius: 2px;\r\n background: #ada;\r\n font-weight: 700;\r\n text-align: center;\r\n }\r\n\r\n.character-area .character-area-control-area .character-area-control .character-area-control-buttons .character-area-control-button-stanby {\r\n width: 5rem;\r\n border: solid 1px #999;\r\n border-radius: 2px;\r\n background: #aba;\r\n cursor: pointer;\r\n font-weight: 700;\r\n text-align: center;\r\n }\r\n\r\n.character-area .character-area-control-area .character-area-control .character-area-control-buttons .character-area-control-button-stanby:hover {\r\n border: solid 1px #000;\r\n }\r\n\r\n.character-area .character-area-control-area .character-area-control .character-area-control-title {\r\n width: 4rem;\r\n font-weight: 700;\r\n }\r\n\r\n.character-area .character-area-control-area .character-area-control .character-area-control-field {\r\n /* width: 20rem; */\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n\r\n.character-area .character-area-control-area .character-area-control .character-area-control-field .character-area-slider-control {\r\n display: flex;\r\n flex-direction: row;\r\n }\r\n\r\n.character-area .character-area-control-area .character-area-control .character-area-control-field .character-area-slider-control .character-area-slider-control-kind {\r\n width: 2rem;\r\n }\r\n\r\n.character-area .character-area-control-area .character-area-control .character-area-control-field .character-area-slider-control .character-area-slider-control-slider {\r\n width: 10rem;\r\n }\r\n\r\n.character-area .character-area-control-area .character-area-control .character-area-control-field .character-area-slider-control .character-area-slider-control-val {\r\n width: 3rem;\r\n }\r\n\r\n.character-area .character-area-control-area .character-area-control .character-area-control-field .character-area-slider-control .character-area-slider-control-text {\r\n padding: 0px 1px 0px 1px;\r\n }\r\n\r\n.character-area .character-area-control-area .character-area-control .character-area-control-field .character-area-buttons {\r\n display: flex;\r\n flex-direction: row;\r\n gap: 5px;\r\n }\r\n\r\n.character-area .character-area-control-area .character-area-control .character-area-control-field .character-area-buttons .character-area-button {\r\n border: solid 2px #999;\r\n color: white;\r\n font-size: 0.8rem;\r\n border-radius: 2px;\r\n background: #666;\r\n cursor: pointer;\r\n padding: 5px;\r\n }\r\n\r\n.character-area .character-area-control-area .character-area-control .character-area-control-field .character-area-buttons .character-area-button:hover {\r\n border: solid 2px #faa;\r\n }\r\n\r\n/* audio::-webkit-media-controls-play-button,\r\naudio::-webkit-media-controls-panel {\r\n background-color: #ff0;\r\n height: 1rem;\r\n}\r\naudio::-webkit-media-controls-enclosure {\r\n max-height: 1rem;\r\n}\r\naudio::-webkit-media-controls {\r\n justify-content: start;\r\n}\r\naudio::-webkit-media-controls-overlay-enclosure{\r\n height: 1rem;\r\n} */\r\n\r\n.config-area {\r\n display: flex;\r\n gap: 5px;\r\n padding: 20px;\r\n}\r\n\r\n.config-area .config-sub-area {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 3px;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control {\r\n display: flex;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-title {\r\n width: 5rem;\r\n font-weight: 700;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-title-long {\r\n width: 20rem;\r\n font-weight: 700;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field {\r\n width: 15rem;\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-noise-container {\r\n display: flex;\r\n gap: 10px;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-noise-container .config-sub-area-noise-checkbox-container {\r\n display: flex;\r\n gap: 5px;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-slider-control {\r\n display: flex;\r\n flex-direction: row;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-slider-control .config-sub-area-slider-control-kind {\r\n width: 1rem;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-slider-control .config-sub-area-slider-control-slider {\r\n width: 10rem;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-slider-control .config-sub-area-slider-control-val {\r\n width: 3rem;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-buttons {\r\n display: flex;\r\n flex-direction: row;\r\n gap: 5px;\r\n align-items: center;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-buttons .config-sub-area-button {\r\n border: solid 2px #999;\r\n color: white;\r\n background: #666;\r\n\r\n cursor: pointer;\r\n\r\n font-size: 0.8rem;\r\n border-radius: 5px;\r\n height: 1.2rem;\r\n padding-left: 2px;\r\n padding-right: 2px;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-buttons .config-sub-area-button:hover {\r\n border: solid 2px #faa;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-buttons .config-sub-area-button-active {\r\n border: solid 2px #999;\r\n color: white;\r\n background: #844;\r\n\r\n cursor: pointer;\r\n\r\n font-size: 0.8rem;\r\n border-radius: 5px;\r\n height: 1.2rem;\r\n padding-left: 2px;\r\n padding-right: 2px;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-control-field-auido-io {\r\n display: flex;\r\n flex-direction: row;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-control-field-auido-io .config-sub-area-control-field-auido-io-filter {\r\n max-width: 30%;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-control-field-auido-io .config-sub-area-control-field-auido-io-select {\r\n max-width: 70%;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-control-field-wav-file {\r\n display: flex;\r\n flex-direction: row;\r\n gap: 5px;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-control-field-wav-file .config-sub-area-control-field-wav-file-audio-container {\r\n height: 1rem;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-control-field-wav-file .config-sub-area-control-field-wav-file-audio-container .config-sub-area-control-field-wav-file-audio {\r\n height: 1rem;\r\n width: 15rem;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-control-field-wav-file .config-sub-area-control-field-wav-file-folder {\r\n height: 1rem;\r\n width: 1rem;\r\n cursor: pointer;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-control-field-wav-file .config-sub-area-control-field-wav-file-echoback-button {\r\n border: solid 1px #333;\r\n background: #fff;\r\n font-size: 0.8rem;\r\n border-radius: 5px;\r\n height: 1.2rem;\r\n padding-left: 2px;\r\n padding-right: 2px;\r\n cursor: pointer;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field .config-sub-area-control-field-wav-file .config-sub-area-control-field-wav-file-echoback-button-active {\r\n font-size: 0.8rem;\r\n border: solid 1px #333;\r\n border-radius: 5px;\r\n background: #ada;\r\n height: 1.2rem;\r\n padding-left: 2px;\r\n padding-right: 2px;\r\n cursor: pointer;\r\n }\r\n\r\n.config-area .config-sub-area .config-sub-area-control .config-sub-area-control-field-long {\r\n width: 30rem;\r\n }\r\n\r\n.headerArea {\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n.headerArea .title1 {\r\n display: flex;\r\n flex-direction: row;\r\n gap: 5px;\r\n align-items: flex-end;\r\n }\r\n\r\n.headerArea .title1 .title {\r\n font-size: 1.8rem;\r\n font-weight: 700;\r\n color: #333;\r\n text-shadow: 0 0 2px #333;\r\n }\r\n\r\n.headerArea .title1 .title-version {\r\n font-size: 0.9rem;\r\n }\r\n\r\n.headerArea .title1 .title-version-number {\r\n font-size: 0.7rem;\r\n }\r\n\r\n.headerArea .icons {\r\n display: flex;\r\n flex-direction: row;\r\n gap: 20px;\r\n }\r\n\r\n.headerArea .icons .belongings {\r\n display: flex;\r\n flex-direction: row;\r\n gap: 3px;\r\n }\r\n\r\n.headerArea .icons .belongings .belongings-button {\r\n border: solid 2px #999;\r\n color: white;\r\n font-size: 0.8rem;\r\n border-radius: 5px;\r\n background: #666;\r\n cursor: pointer;\r\n padding: 5px;\r\n height: 1.7rem;\r\n top: -2px;\r\n }\r\n\r\n.headerArea .icons .belongings .belongings-button:hover {\r\n border: solid 2px #cc6;\r\n }\r\n\r\n.advanced-setting-container {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 5px;\r\n margin: 10px;\r\n}\r\n\r\n.advanced-setting-container .advanced-setting-container-row {\r\n display: flex;\r\n flex-direction: row;\r\n gap: 5px;\r\n }\r\n\r\n.advanced-setting-container .advanced-setting-container-row .advanced-setting-container-row-title {\r\n width: 7rem;\r\n font-weight: 700;\r\n font-size: 0.9rem;\r\n }\r\n\r\n.advanced-setting-container .advanced-setting-container-row .advanced-setting-container-row-field {\r\n width: 15rem;\r\n font-size: 0.9rem;\r\n }\r\n\r\n.advanced-setting-container .advanced-setting-container-row .advanced-setting-container-row-field .advanced-setting-container-row-field-crossfade-container {\r\n display: flex;\r\n flex-direction: row;\r\n gap: 5px;\r\n width: 10rem;\r\n }\r\n\r\n.advanced-setting-container .advanced-setting-container-row .advanced-setting-container-row-field .advanced-setting-container-row-field-crossfade-container > div {\r\n display: flex;\r\n flex-direction: row;\r\n gap: 3px;\r\n }\r\n\r\n.advanced-setting-container .advanced-setting-container-row .advanced-setting-container-row-field .advanced-setting-container-row-field-crossfade-container > div > div:nth-child(1) {\r\n color: #333;\r\n }\r\n\r\n.advanced-setting-container .advanced-setting-container-row .advanced-setting-container-row-field .advanced-setting-container-row-field-crossfade-container > div > div:nth-child(2) {\r\n }\r\n.get-server-information-container {\r\n margin: 10px;\r\n}\r\n.get-server-information-container .get-server-information-text-area {\r\n width: 100%;\r\n height: 20rem;\r\n }\r\n.merge-lab-container {\r\n display: flex;\r\n flex-direction: column;\r\n margin: 10px;\r\n gap: 10px;\r\n}\r\n.merge-lab-container .merge-lab-type-filter {\r\n display: flex;\r\n flex-direction: row;\r\n }\r\n.merge-lab-container .merge-lab-type-filter > div:nth-child(1) {\r\n width: 50%;\r\n }\r\n.merge-lab-container .merge-lab-type-filter > div:nth-child(2) {\r\n width: 50%;\r\n }\r\n.merge-lab-container .merge-lab-manipulator {\r\n display: flex;\r\n flex-direction: row;\r\n }\r\n.merge-lab-container .merge-lab-manipulator .merge-lab-model-list {\r\n width: 70%;\r\n }\r\n.merge-lab-container .merge-lab-manipulator .merge-lab-model-list .merge-lab-model-item {\r\n display: flex;\r\n flex-direction: row;\r\n }\r\n.merge-lab-container .merge-lab-manipulator .merge-lab-model-list .merge-lab-model-item > div:nth-child(1) {\r\n width: 50%;\r\n }\r\n.merge-lab-container .merge-lab-manipulator .merge-lab-model-list .merge-lab-model-item > div:nth-child(2) {\r\n width: 50%;\r\n }\r\n.merge-lab-container .merge-lab-manipulator .merge-lab-merge-buttons {\r\n display: flex;\r\n flex-direction: column-reverse;\r\n width: 30%;\r\n }\r\n.merge-lab-container .merge-lab-manipulator .merge-lab-merge-buttons .merge-lab-merge-button {\r\n border: solid 2px #ddd;\r\n color: black;\r\n font-size: 0.8rem;\r\n border-radius: 5px;\r\n background: #eee;\r\n cursor: pointer;\r\n padding: 5px;\r\n height: 1.7rem;\r\n text-align: center;\r\n }\r\n.merge-lab-container .merge-lab-manipulator .merge-lab-merge-buttons .merge-lab-merge-button:hover {\r\n border: solid 2px #aaa;\r\n }\r\n.merge-lab-container .merge-lab-manipulator .merge-lab-merge-buttons .merge-lab-merge-buttons-notice {\r\n font-size: 0.7rem;\r\n font-weight: 700;\r\n color: #333;\r\n text-align: center;\r\n }\r\n`, \"\"]);\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://demo/./src/css/App.css?./node_modules/css-loader/dist/cjs.js??ruleSet%5B1%5D.rules%5B2%5D.use%5B1%5D!./node_modules/postcss-loader/dist/cjs.js"); /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js!./src/css/Error.css": /*!***************************************************************************************************************************************!*\ !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js!./src/css/Error.css ***! \***************************************************************************************************************************************/ /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.error-container {\r\n margin: 2rem;\r\n}\r\n .error-container .top-error-message {\r\n color: #44a;\r\n font-size: 2rem;\r\n font-weight: 100;\r\n }\r\n .error-container .top-error-description {\r\n color: #444;\r\n font-size: 1rem;\r\n font-weight: 100;\r\n }\r\n .error-container .error-detail {\r\n margin-top: 2rem;\r\n padding: 1rem;\r\n border: 1px solid;\r\n }\r\n .error-container .error-detail .error-name {\r\n font-weight: 700;\r\n }\r\n .error-container .error-detail .error-message {\r\n margin-top: 0.5rem;\r\n }\r\n .error-container .error-detail .error-info-container {\r\n margin-top: 0.5rem;\r\n font-size: 0.8rem;\r\n }\r\n .error-container .error-detail .error-info-container .error-info-line {\r\n }\r\n`, \"\"]);\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://demo/./src/css/Error.css?./node_modules/css-loader/dist/cjs.js??ruleSet%5B1%5D.rules%5B2%5D.use%5B1%5D!./node_modules/postcss-loader/dist/cjs.js"); /***/ }), /***/ "./node_modules/css-loader/dist/runtime/api.js": /*!*****************************************************!*\ !*** ./node_modules/css-loader/dist/runtime/api.js ***! \*****************************************************/ /***/ ((module) => { "use strict"; eval("\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};\n\n//# sourceURL=webpack://demo/./node_modules/css-loader/dist/runtime/api.js?"); /***/ }), /***/ "./node_modules/css-loader/dist/runtime/noSourceMaps.js": /*!**************************************************************!*\ !*** ./node_modules/css-loader/dist/runtime/noSourceMaps.js ***! \**************************************************************/ /***/ ((module) => { "use strict"; eval("\n\nmodule.exports = function (i) {\n return i[1];\n};\n\n//# sourceURL=webpack://demo/./node_modules/css-loader/dist/runtime/noSourceMaps.js?"); /***/ }), /***/ "./node_modules/react-dom/cjs/react-dom.development.js": /*!*************************************************************!*\ !*** ./node_modules/react-dom/cjs/react-dom.development.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; eval("/**\n * @license React\n * react-dom.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (true) {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar Scheduler = __webpack_require__(/*! scheduler */ \"./node_modules/scheduler/index.js\");\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nvar suppressWarning = false;\nfunction setSuppressWarning(newSuppressWarning) {\n {\n suppressWarning = newSuppressWarning;\n }\n} // In DEV, calls to console.warn and console.error get replaced\n// by calls to these methods by a Babel plugin.\n//\n// In PROD (or in packages without access to React internals),\n// they are left as they are instead.\n\nfunction warn(format) {\n {\n if (!suppressWarning) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }\n}\nfunction error(format) {\n {\n if (!suppressWarning) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\nvar FunctionComponent = 0;\nvar ClassComponent = 1;\nvar IndeterminateComponent = 2; // Before we know whether it is function or class\n\nvar HostRoot = 3; // Root of a host tree. Could be nested inside another node.\n\nvar HostPortal = 4; // A subtree. Could be an entry point to a different renderer.\n\nvar HostComponent = 5;\nvar HostText = 6;\nvar Fragment = 7;\nvar Mode = 8;\nvar ContextConsumer = 9;\nvar ContextProvider = 10;\nvar ForwardRef = 11;\nvar Profiler = 12;\nvar SuspenseComponent = 13;\nvar MemoComponent = 14;\nvar SimpleMemoComponent = 15;\nvar LazyComponent = 16;\nvar IncompleteClassComponent = 17;\nvar DehydratedFragment = 18;\nvar SuspenseListComponent = 19;\nvar ScopeComponent = 21;\nvar OffscreenComponent = 22;\nvar LegacyHiddenComponent = 23;\nvar CacheComponent = 24;\nvar TracingMarkerComponent = 25;\n\n// -----------------------------------------------------------------------------\n\nvar enableClientRenderFallbackOnTextMismatch = true; // TODO: Need to review this code one more time before landing\n// the react-reconciler package.\n\nvar enableNewReconciler = false; // Support legacy Primer support on internal FB www\n\nvar enableLazyContextPropagation = false; // FB-only usage. The new API has different semantics.\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n\nvar enableSuspenseAvoidThisFallback = false; // Enables unstable_avoidThisFallback feature in Fizz\n// React DOM Chopping Block\n//\n// Similar to main Chopping Block but only flags related to React DOM. These are\n// grouped because we will likely batch all of them into a single major release.\n// -----------------------------------------------------------------------------\n// Disable support for comment nodes as React DOM containers. Already disabled\n// in open source, but www codebase still relies on it. Need to remove.\n\nvar disableCommentsAsDOMContainers = true; // Disable javascript: URL strings in href for XSS protection.\n// and client rendering, mostly to allow JSX attributes to apply to the custom\n// element's object properties instead of only HTML attributes.\n// https://github.com/facebook/react/issues/11347\n\nvar enableCustomElementPropertySupport = false; // Disables children for