/* * 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__={8260:(e,t)=>{\"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:()=>Nt,AllowNotifications:()=>Ki,AssociateChannelFlowCommand:()=>ns,BadRequestException:()=>Qi,BatchChannelMembershipsFilterSensitiveLog:()=>yn,BatchCreateChannelMembershipCommand:()=>rs,BatchCreateChannelMembershipResponseFilterSensitiveLog:()=>wn,ChannelAssociatedWithFlowSummaryFilterSensitiveLog:()=>kn,ChannelBanFilterSensitiveLog:()=>En,ChannelBanSummaryFilterSensitiveLog:()=>In,ChannelFilterSensitiveLog:()=>Cn,ChannelFlowCallbackCommand:()=>ss,ChannelFlowCallbackRequestFilterSensitiveLog:()=>Pn,ChannelFlowFilterSensitiveLog:()=>Mn,ChannelFlowSummaryFilterSensitiveLog:()=>On,ChannelMembershipFilterSensitiveLog:()=>Rn,ChannelMembershipForAppInstanceUserSummaryFilterSensitiveLog:()=>Nn,ChannelMembershipPreferencesFilterSensitiveLog:()=>Bn,ChannelMembershipSummaryFilterSensitiveLog:()=>Ln,ChannelMembershipType:()=>Gi,ChannelMessageCallbackFilterSensitiveLog:()=>_n,ChannelMessageFilterSensitiveLog:()=>Un,ChannelMessagePersistenceType:()=>hn,ChannelMessageStatus:()=>pn,ChannelMessageSummaryFilterSensitiveLog:()=>Vn,ChannelMessageType:()=>mn,ChannelMode:()=>an,ChannelModeratedByAppInstanceUserSummaryFilterSensitiveLog:()=>jn,ChannelModeratorFilterSensitiveLog:()=>zn,ChannelModeratorSummaryFilterSensitiveLog:()=>$n,ChannelPrivacy:()=>cn,ChannelSummaryFilterSensitiveLog:()=>Dn,ChimeSDKMessaging:()=>to,ChimeSDKMessagingClient:()=>$i,ChimeSDKMessagingServiceException:()=>qi,ConflictException:()=>Zi,CreateChannelBanCommand:()=>os,CreateChannelBanResponseFilterSensitiveLog:()=>qn,CreateChannelCommand:()=>as,CreateChannelFlowCommand:()=>cs,CreateChannelFlowRequestFilterSensitiveLog:()=>Kn,CreateChannelMembershipCommand:()=>ds,CreateChannelMembershipResponseFilterSensitiveLog:()=>Gn,CreateChannelModeratorCommand:()=>ls,CreateChannelModeratorResponseFilterSensitiveLog:()=>Jn,CreateChannelRequestFilterSensitiveLog:()=>Hn,DeleteChannelBanCommand:()=>us,DeleteChannelCommand:()=>hs,DeleteChannelFlowCommand:()=>ps,DeleteChannelMembershipCommand:()=>ms,DeleteChannelMessageCommand:()=>fs,DeleteChannelModeratorCommand:()=>gs,DeleteMessagingStreamingConfigurationsCommand:()=>vs,DescribeChannelBanCommand:()=>Ss,DescribeChannelBanResponseFilterSensitiveLog:()=>Zn,DescribeChannelCommand:()=>bs,DescribeChannelFlowCommand:()=>ys,DescribeChannelFlowResponseFilterSensitiveLog:()=>Xn,DescribeChannelMembershipCommand:()=>ws,DescribeChannelMembershipForAppInstanceUserCommand:()=>Cs,DescribeChannelMembershipForAppInstanceUserResponseFilterSensitiveLog:()=>er,DescribeChannelMembershipResponseFilterSensitiveLog:()=>Yn,DescribeChannelModeratedByAppInstanceUserCommand:()=>ks,DescribeChannelModeratedByAppInstanceUserResponseFilterSensitiveLog:()=>tr,DescribeChannelModeratorCommand:()=>Es,DescribeChannelModeratorResponseFilterSensitiveLog:()=>ir,DescribeChannelResponseFilterSensitiveLog:()=>Qn,DisassociateChannelFlowCommand:()=>Is,ErrorCode:()=>Ji,ExpirationCriterion:()=>on,FallbackAction:()=>ln,ForbiddenException:()=>Xi,GetChannelMembershipPreferencesCommand:()=>Ts,GetChannelMembershipPreferencesResponseFilterSensitiveLog:()=>nr,GetChannelMessageCommand:()=>Ms,GetChannelMessageResponseFilterSensitiveLog:()=>rr,GetChannelMessageStatusCommand:()=>xs,GetMessagingSessionEndpointCommand:()=>As,GetMessagingStreamingConfigurationsCommand:()=>_s,IdentityFilterSensitiveLog:()=>bn,InvocationType:()=>dn,ListChannelBansCommand:()=>Ps,ListChannelBansRequestFilterSensitiveLog:()=>sr,ListChannelBansResponseFilterSensitiveLog:()=>or,ListChannelFlowsCommand:()=>Os,ListChannelFlowsRequestFilterSensitiveLog:()=>ar,ListChannelFlowsResponseFilterSensitiveLog:()=>cr,ListChannelMembershipsCommand:()=>Rs,ListChannelMembershipsForAppInstanceUserCommand:()=>Ds,ListChannelMembershipsForAppInstanceUserRequestFilterSensitiveLog:()=>ur,ListChannelMembershipsForAppInstanceUserResponseFilterSensitiveLog:()=>hr,ListChannelMembershipsRequestFilterSensitiveLog:()=>dr,ListChannelMembershipsResponseFilterSensitiveLog:()=>lr,ListChannelMessagesCommand:()=>Ns,ListChannelMessagesRequestFilterSensitiveLog:()=>pr,ListChannelMessagesResponseFilterSensitiveLog:()=>mr,ListChannelModeratorsCommand:()=>Fs,ListChannelModeratorsRequestFilterSensitiveLog:()=>fr,ListChannelModeratorsResponseFilterSensitiveLog:()=>gr,ListChannelsAssociatedWithChannelFlowCommand:()=>Bs,ListChannelsAssociatedWithChannelFlowRequestFilterSensitiveLog:()=>br,ListChannelsAssociatedWithChannelFlowResponseFilterSensitiveLog:()=>yr,ListChannelsCommand:()=>Ls,ListChannelsModeratedByAppInstanceUserCommand:()=>Us,ListChannelsModeratedByAppInstanceUserRequestFilterSensitiveLog:()=>wr,ListChannelsModeratedByAppInstanceUserResponseFilterSensitiveLog:()=>Cr,ListChannelsRequestFilterSensitiveLog:()=>vr,ListChannelsResponseFilterSensitiveLog:()=>Sr,ListSubChannelsCommand:()=>Vs,ListSubChannelsRequestFilterSensitiveLog:()=>kr,ListSubChannelsResponseFilterSensitiveLog:()=>Er,ListTagsForResourceCommand:()=>js,ListTagsForResourceResponseFilterSensitiveLog:()=>Ir,MessageAttributeValueFilterSensitiveLog:()=>xn,MessagingDataType:()=>fn,NotFoundException:()=>Yi,ProcessorFilterSensitiveLog:()=>Tn,PushNotificationConfigurationFilterSensitiveLog:()=>An,PushNotificationPreferencesFilterSensitiveLog:()=>Fn,PushNotificationType:()=>un,PutChannelExpirationSettingsCommand:()=>zs,PutChannelMembershipPreferencesCommand:()=>$s,PutChannelMembershipPreferencesRequestFilterSensitiveLog:()=>Tr,PutChannelMembershipPreferencesResponseFilterSensitiveLog:()=>Mr,PutMessagingStreamingConfigurationsCommand:()=>Ws,RedactChannelMessageCommand:()=>Hs,ResourceLimitExceededException:()=>sn,SearchChannelsCommand:()=>qs,SearchChannelsRequestFilterSensitiveLog:()=>xr,SearchChannelsResponseFilterSensitiveLog:()=>Ar,SearchFieldKey:()=>vn,SearchFieldOperator:()=>Sn,SendChannelMessageCommand:()=>Ks,SendChannelMessageRequestFilterSensitiveLog:()=>_r,ServiceFailureException:()=>en,ServiceUnavailableException:()=>tn,SortOrder:()=>gn,TagFilterSensitiveLog:()=>Wn,TagResourceCommand:()=>Gs,TagResourceRequestFilterSensitiveLog:()=>Pr,ThrottledClientException:()=>nn,UnauthorizedClientException:()=>rn,UntagResourceCommand:()=>Js,UntagResourceRequestFilterSensitiveLog:()=>Or,UpdateChannelCommand:()=>Qs,UpdateChannelFlowCommand:()=>Zs,UpdateChannelFlowRequestFilterSensitiveLog:()=>Dr,UpdateChannelMessageCommand:()=>Xs,UpdateChannelMessageRequestFilterSensitiveLog:()=>Nr,UpdateChannelReadMarkerCommand:()=>Ys,UpdateChannelRequestFilterSensitiveLog:()=>Rr,__Client:()=>Dt,paginateListChannelBans:()=>no,paginateListChannelFlows:()=>so,paginateListChannelMemberships:()=>lo,paginateListChannelMembershipsForAppInstanceUser:()=>ao,paginateListChannelMessages:()=>ho,paginateListChannelModerators:()=>mo,paginateListChannels:()=>yo,paginateListChannelsAssociatedWithChannelFlow:()=>go,paginateListChannelsModeratedByAppInstanceUser:()=>So,paginateListSubChannels:()=>Co,paginateSearchChannels:()=>Eo});var n={};i.r(n),i.d(n,{getUserAgentPrefix:()=>$e,isVirtualHostableS3Bucket:()=>Ze,parseArn:()=>Xe,partition:()=>Ve,setPartitionInfo:()=>je,useDefaultPartitionInfo:()=>ze});var r,s={};i.r(s),i.d(s,{aws:()=>n,booleanEquals:()=>Ye,getAttr:()=>et,isSet:()=>tt,isValidHostLabel:()=>Qe,not:()=>it,parseURL:()=>ct,stringEquals:()=>dt,substring:()=>lt,uriEncode:()=>ut}),function(e){e.ENV=\"env\",e.CONFIG=\"shared config entry\"}(r||(r={}));const o=e=>\"string\"==typeof e&&(e.startsWith(\"fips-\")||e.endsWith(\"-fips\")),a=e=>o(e)?[\"fips-aws-global\",\"aws-fips\"].includes(e)?\"us-east-1\":e.replace(/fips-(dkr-|prod-)?|-fips/,\"\"):e;var c,d;(d=c||(c={}))[d.HEADER=0]=\"HEADER\",d[d.TRAILER=1]=\"TRAILER\";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:\"/\"}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.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=\"content-length\",p={step:\"build\",tags:[\"SET_CONTENT_LENGTH\",\"CONTENT_LENGTH\"],name:\"contentLengthMiddleware\",override:!0},m={name:\"deserializerMiddleware\",step:\"deserialize\",tags:[\"DESERIALIZER\"],override:!0},f={name:\"serializerMiddleware\",step:\"serialize\",tags:[\"SERIALIZER\"],override:!0};function g(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),m),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),f)}}}const v=/^[a-z0-9][a-z0-9\\.\\-]{1,61}[a-z0-9]$/,S=/(\\d+\\.){3}\\d+/,b=/\\.\\./,y=(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},w=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 y(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,(!v.test(i)||S.test(i)||b.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},C={step:\"serialize\",tags:[\"ENDPOINT_PARAMETERS\",\"ENDPOINT_V2\",\"ENDPOINT\"],name:\"endpointV2Middleware\",override:!0,relation:\"before\",toMiddleware:f.name},k=(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 w(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}),C)}}),E=e=>{if(\"function\"==typeof e)return e;const t=Promise.resolve(e);return()=>t},I=e=>{if(\"string\"==typeof e)return I(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}},T={name:\"hostHeaderMiddleware\",step:\"build\",priority:\"low\",tags:[\"HOST\"],override:!0},M={name:\"loggerMiddleware\",tags:[\"LOGGER\"],step:\"initialize\",override:!0},x=\"X-Amzn-Trace-Id\",A={step:\"build\",tags:[\"RECURSION_DETECTION\"],name:\"recursionDetectionMiddleware\",override:!0,priority:\"low\"};var _,P;(P=_||(_={})).STANDARD=\"standard\",P.ADAPTIVE=\"adaptive\";const O=_.STANDARD,R=[\"BandwidthLimitExceeded\",\"EC2ThrottledException\",\"LimitExceededException\",\"PriorRequestNotComplete\",\"ProvisionedThroughputExceededException\",\"RequestLimitExceeded\",\"RequestThrottled\",\"RequestThrottledException\",\"SlowDown\",\"ThrottledException\",\"Throttling\",\"ThrottlingException\",\"TooManyRequestsException\",\"TransactionInProgressException\"],D=[\"AbortError\",\"TimeoutError\",\"RequestTimeout\",\"RequestTimeoutException\"],N=[500,502,503,504],F=[\"ECONNRESET\",\"ECONNREFUSED\",\"EPIPE\",\"ETIMEDOUT\"],B=e=>429===e.$metadata?.httpStatusCode||R.includes(e.name)||1==e.$retryable?.throttling,L=e=>D.includes(e.name)||F.includes(e?.code||\"\")||N.includes(e.$metadata?.httpStatusCode||0);class U{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(),B(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))}}class V{constructor(e){this.maxAttempts=e,this.mode=_.STANDARD,this.retryToken=((e,t,i,n)=>{const r=e,s=n?.retryCost??5,o=n?.timeoutRetryCost??10,a=n?.retryBackoffStrategy??(()=>{let e=100;return{computeNextBackoffDelay:t=>Math.floor(Math.min(2e4,Math.random()*2**t*e)),setDelayBase:t=>{e=t}}})();let c,d=e,l=Math.min(2e4,t),u=i??0;const h=e=>\"TRANSIENT\"===e?o:s,p=e=>h(e)<=d;return{getRetryCount:()=>u,getRetryDelay:()=>l,getLastRetryCost:()=>c,hasRetryTokens:p,getRetryTokenCount:e=>{const t=e.errorType;if(!p(t))throw new Error(\"No retry token available\");const i=h(t),n=\"THROTTLING\"===t?500:100;a.setDelayBase(n);const r=a.computeNextBackoffDelay(u);if(e.retryAfterHint){const t=e.retryAfterHint.getTime()-Date.now();l=Math.max(t||0,r)}else l=r;return u++,c=i,d-=i,i},releaseRetryTokens:e=>{d+=e??1,d=Math.min(d,r)}}})(500,100),this.maxAttemptsProvider=\"function\"==typeof e?e:async()=>e}async acquireInitialRetryToken(e){return this.retryToken}async refreshRetryTokenForRetry(e,t){const i=await this.getMaxAttempts();if(this.shouldRetry(e,t,i))return e.getRetryTokenCount(t),e;throw new Error(\"No retry token available\")}recordSuccess(e){this.retryToken.releaseRetryTokens(e.getLastRetryCost())}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&&void 0!==arguments[1]?arguments[1]:0,i=(q[e[t+0]]+q[e[t+1]]+q[e[t+2]]+q[e[t+3]]+\"-\"+q[e[t+4]]+q[e[t+5]]+\"-\"+q[e[t+6]]+q[e[t+7]]+\"-\"+q[e[t+8]]+q[e[t+9]]+\"-\"+q[e[t+10]]+q[e[t+11]]+q[e[t+12]]+q[e[t+13]]+q[e[t+14]]+q[e[t+15]]).toLowerCase();if(!function(e){return\"string\"==typeof e&&H.test(e)}(i))throw TypeError(\"Stringified UUID is invalid\");return i},J=function(e,t,i){var n=(e=e||{}).random||(e.rng||W)();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 G(n)},Q=e=>{const t={errorType:Z(e)},i=Y(e.$response);return i&&(t.retryAfterHint=i),t},Z=e=>B(e)?\"THROTTLING\":L(e)?\"TRANSIENT\":(e=>{if(void 0!==e.$metadata?.httpStatusCode){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!L(e)}return!1})(e)?\"SERVER_ERROR\":\"CLIENT_ERROR\",X={name:\"retryMiddleware\",tags:[\"RETRY\"],step:\"finalizeRequest\",priority:\"high\",override:!0},Y=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)};Error;const ee=(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)};var te=i(3538);const ie=e=>(new TextEncoder).encode(e),ne=e=>\"string\"==typeof e?ie(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),re=\"X-Amz-Date\",se=\"X-Amz-Signature\",oe=\"X-Amz-Security-Token\",ae=\"authorization\",ce=re.toLowerCase(),de=[ae,ce,\"date\"],le=se.toLowerCase(),ue=\"x-amz-content-sha256\",he=oe.toLowerCase(),pe={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},me=/^proxy-/,fe=/^sec-/,ge=\"AWS4-HMAC-SHA256\",ve=\"AWS4-HMAC-SHA256-PAYLOAD\",Se=\"aws4_request\",be={},ye=[],we=(e,t,i)=>`${e}/${t}/${i}/${Se}`,Ce=(e,t,i)=>{const n=new e(t);return n.update(ne(i)),n.digest()},ke=({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 pe||t?.has(s)||me.test(s)||fe.test(s))&&(!i||i&&!i.has(s))||(n[s]=e[r].trim().replace(/\\s+/g,\" \"))}return n},Ee=e=>encodeURIComponent(e).replace(/[!'()*]/g,Ie),Ie=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`,Te=async({headers:e,body:t},i)=>{for(const t of Object.keys(e))if(t.toLowerCase()===ue)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(ne(t)),(0,te.toHex)(await e.digest())}var n;return\"UNSIGNED-PAYLOAD\"},Me=({headers:e,query:t,...i})=>({...i,headers:{...e},query:t?xe(t):void 0}),xe=e=>Object.keys(e).reduce(((t,i)=>{const n=e[i];return{...t,[i]:Array.isArray(n)?[...n]:n}}),{}),Ae=e=>{e=\"function\"==typeof e.clone?e.clone():Me(e);for(const t of Object.keys(e.headers))de.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e};class _e{constructor({applyChecksum:e,credentials:t,region:i,service:n,sha256:r,uriEscapePath:s=!0}){this.service=n,this.sha256=r,this.uriEscapePath=s,this.applyChecksum=\"boolean\"!=typeof e||e,this.regionProvider=E(i),this.credentialProvider=E(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}=Pe(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=we(h,l,c??this.service),m=((e,t={})=>{const{headers:i,query:n={}}=\"function\"==typeof e.clone?e.clone():Me(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}})(Ae(e),{unhoistableHeaders:s});d.sessionToken&&(m.query[oe]=d.sessionToken),m.query[\"X-Amz-Algorithm\"]=ge,m.query[\"X-Amz-Credential\"]=`${d.accessKeyId}/${p}`,m.query[re]=u,m.query[\"X-Amz-Expires\"]=n.toString(10);const f=ke(m,r,o);return m.query[\"X-Amz-SignedHeaders\"]=Oe(f),m.query[se]=await this.getSignature(u,p,this.getSigningKey(d,l,h,c),this.createCanonicalRequest(m,f,await Te(e,this.sha256))),m}async sign(e,t){return\"string\"==typeof e?this.signString(e,t):e.headers&&e.payload?this.signEvent(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}=Pe(i),d=we(a,o,s??this.service),l=await Te({headers:{},body:t},this.sha256),u=new this.sha256;u.update(e);const h=(0,te.toHex)(await u.digest()),p=[ve,c,d,n,h,l].join(\"\\n\");return this.signString(p,{signingDate:i,signingRegion:o,signingService:s})}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}=Pe(t),a=new this.sha256(await this.getSigningKey(r,s,o,n));return a.update(ne(e)),(0,te.toHex)(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=Ae(e),{longDate:d,shortDate:l}=Pe(t),u=we(l,a,s??this.service);c.headers[ce]=d,o.sessionToken&&(c.headers[he]=o.sessionToken);const h=await Te(c,this.sha256);!((e,t)=>{e=e.toLowerCase();for(const i of Object.keys(t))if(e===i.toLowerCase())return!0;return!1})(ue,c.headers)&&this.applyChecksum&&(c.headers[ue]=h);const p=ke(c,n,i),m=await this.getSignature(d,u,this.getSigningKey(o,a,l,s),this.createCanonicalRequest(c,p,h));return c.headers[ae]=`${ge} Credential=${o.accessKeyId}/${u}, SignedHeaders=${Oe(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()===le)continue;t.push(n);const r=e[n];\"string\"==typeof r?i[n]=`${Ee(n)}=${Ee(r)}`:Array.isArray(r)&&(i[n]=r.slice(0).sort().reduce(((e,t)=>e.concat([`${Ee(n)}=${Ee(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(ne(i));const r=await n.digest();return`${ge}\\n${e}\\n${t}\\n${(0,te.toHex)(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(ne(r)),(0,te.toHex)(await s.digest())}getSigningKey(e,t,i,n){return(async(e,t,i,n,r)=>{const s=await Ce(e,t.secretAccessKey,t.accessKeyId),o=`${i}:${n}:${r}:${(0,te.toHex)(s)}:${t.sessionToken}`;if(o in be)return be[o];for(ye.push(o);ye.length>50;)delete be[ye.shift()];let a=`AWS4${t.secretAccessKey}`;for(const t of[i,n,r,Se])a=await Ce(e,a,t);return be[o]=a})(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 Pe=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)}},Oe=e=>Object.keys(e).sort().join(\";\"),Re=e=>new Date(Date.now()+e),De=(e,t)=>{const i=Date.parse(e);return((e,t)=>Math.abs(Re(t).getTime()-e)>=3e5)(i,t)?i-Date.now():t},Ne=e=>u.isInstance(e)?e.headers?.date??e.headers?.Date:void 0,Fe={name:\"awsAuthMiddleware\",tags:[\"SIGNATURE\",\"AWSAUTH\"],relation:\"after\",toMiddleware:\"retryMiddleware\",override:!0},Be=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\":{}}],\"version\":\"1.1\"}');let Le=Be,Ue=\"\";const Ve=e=>{const{partitions:t}=Le;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}},je=(e,t=\"\")=>{Le=e,Ue=t},ze=()=>{je(Be,\"\")},$e=()=>Ue,We=\"endpoints\";function He(e){return\"object\"!=typeof e||null==e?e:\"ref\"in e?`$${He(e.ref)}`:\"fn\"in e?`${e.fn}(${(e.argv||[]).map(He).join(\", \")})`:JSON.stringify(e,null,2)}class qe extends Error{constructor(e){super(e),this.name=\"EndpointError\"}}const Ke=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}$\"),Ge=e=>Ke.test(e)||e.startsWith(\"[\")&&e.endsWith(\"]\"),Je=new RegExp(\"^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$\"),Qe=(e,t=!1)=>{if(!t)return Je.test(e);const i=e.split(\".\");for(const e of i)if(!Qe(e))return!1;return!0},Ze=(e,t=!1)=>{if(t){for(const t of e.split(\".\"))if(!Ze(t))return!1;return!0}return!(!Qe(e)||e.length<3||e.length>63||e!==e.toLowerCase()||Ge(e))},Xe=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}},Ye=(e,t)=>e===t,et=(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 qe(`Path: '${e}' does not end with ']'`);const r=n.slice(t+1,-1);if(Number.isNaN(parseInt(r)))throw new qe(`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 qe(`Index '${n}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(i)?i[parseInt(n)]:i[n]}),e),tt=e=>null!=e,it=e=>!e;var nt,rt,st,ot;!function(e){e.HEADER=\"header\",e.QUERY=\"query\"}(nt||(nt={})),function(e){e.AAAA=\"AAAA\",e.A=\"A\"}(rt||(rt={})),function(e){e.HTTP=\"http\",e.HTTPS=\"https\"}(st||(st={})),function(e){e.HTTP_0_9=\"http/0.9\",e.HTTP_1_0=\"http/1.0\",e.TDS_8_0=\"tds/8.0\"}(ot||(ot={}));const at={[st.HTTP]:80,[st.HTTPS]:443},ct=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:s,protocol:o,search:a}=t;if(a)return null;const c=o.slice(0,-1);if(!Object.values(st).includes(c))return null;const d=Ge(r);return{scheme:c,authority:`${n}${i.includes(`${n}:${at[c]}`)||\"string\"==typeof e&&e.includes(`${n}:${at[c]}`)?`:${at[c]}`:\"\"}`,path:s,normalizedPath:s.endsWith(\"/\")?s:`${s}/`,isIp:d}},dt=(e,t)=>e===t,lt=(e,t,i,n)=>t>=i||e.lengthencodeURIComponent(e).replace(/[!*'()]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),ht=(e,t)=>{const i=[],n={...t.endpointParams,...t.referenceRecord};let r=0;for(;r{if(\"string\"==typeof e)return ht(e,i);if(e.fn)return mt(e,i);if(e.ref)return(({ref:e},t)=>({...t.endpointParams,...t.referenceRecord}[e]))(e,i);throw new qe(`'${t}': ${String(e)} is not a string, function or reference.`)},mt=({fn:e,argv:t},i)=>{const n=t.map((e=>[\"boolean\",\"number\"].includes(typeof e)?e:pt(e,\"arg\",i)));return e.split(\".\").reduce(((e,t)=>e[t]),s)(...n)},ft=({assign:e,...t},i)=>{if(e&&e in i.referenceRecord)throw new qe(`'${e}' is already defined in Reference Record.`);const n=mt(t,i);return i.logger?.debug?.(We,`evaluateCondition: ${He(t)} = ${He(n)}`),{result:\"\"===n||!!n,...null!=e&&{toAssign:{name:e,value:n}}}},gt=(e=[],t)=>{const i={};for(const n of e){const{result:e,toAssign:r}=ft(n,{...t,referenceRecord:{...t.referenceRecord,...i}});if(!e)return{result:e};r&&(i[r.name]=r.value,t.logger?.debug?.(We,`assign: ${r.name} := ${He(r.value)}`))}return{result:!0,referenceRecord:i}},vt=(e,t)=>Object.entries(e).reduce(((e,[i,n])=>({...e,[i]:n.map((e=>{const n=pt(e,\"Header value entry\",t);if(\"string\"!=typeof n)throw new qe(`Header '${i}' value '${n}' is not a string`);return n}))})),{}),St=(e,t)=>{if(Array.isArray(e))return e.map((e=>St(e,t)));switch(typeof e){case\"string\":return ht(e,t);case\"object\":if(null===e)throw new qe(`Unexpected endpoint property: ${e}`);return bt(e,t);case\"boolean\":return e;default:throw new qe(\"Unexpected endpoint property type: \"+typeof e)}},bt=(e,t)=>Object.entries(e).reduce(((e,[i,n])=>({...e,[i]:St(n,t)})),{}),yt=(e,t)=>{const i=pt(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 qe(\"Endpoint URL must be a string, got \"+typeof i)},wt=(e,t)=>{const{conditions:i,endpoint:n}=e,{result:r,referenceRecord:s}=gt(i,t);if(!r)return;const o={...t,referenceRecord:{...t.referenceRecord,...s}},{url:a,properties:c,headers:d}=n;return t.logger?.debug?.(We,`Resolving endpoint from template: ${He(n)}`),{...null!=d&&{headers:vt(d,o)},...null!=c&&{properties:bt(c,o)},url:yt(a,o)}},Ct=(e,t)=>{const{conditions:i,error:n}=e,{result:r,referenceRecord:s}=gt(i,t);if(r)throw new qe(pt(n,\"Error\",{...t,referenceRecord:{...t.referenceRecord,...s}}))},kt=(e,t)=>{const{conditions:i,rules:n}=e,{result:r,referenceRecord:s}=gt(i,t);if(r)return Et(n,{...t,referenceRecord:{...t.referenceRecord,...s}})},Et=(e,t)=>{for(const i of e)if(\"endpoint\"===i.type){const e=wt(i,t);if(e)return e}else if(\"error\"===i.type)Ct(i,t);else{if(\"tree\"!==i.type)throw new qe(`Unknown endpoint rule: ${i}`);{const e=kt(i,t);if(e)return e}}throw new qe(\"Rules evaluation failed\")},It=\"user-agent\",Tt=\"x-amz-user-agent\",Mt=/[^\\!\\#\\$\\%\\&\\'\\*\\+\\-\\.\\^\\_\\`\\|\\~\\d\\w]/g,xt=([e,t])=>{const i=e.indexOf(\"/\"),n=e.substring(0,i);let r=e.substring(i+1);return\"api\"===n&&(r=r.toLowerCase()),[n,r,t].filter((e=>e&&e.length>0)).map((e=>e?.replace(Mt,\"_\"))).join(\"/\")},At={name:\"getUserAgentMiddleware\",step:\"build\",priority:\"low\",tags:[\"SET_USER_AGENT\",\"USER_AGENT\"],override:!0};class _t{trace(){}debug(){}info(){}warn(){}error(){}}const Pt=()=>{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)=>Ot[t.step]-Ot[e.step]||Rt[t.priority||\"normal\"]-Rt[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(Pt()),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(Pt());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},Ot={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Rt={high:3,normal:2,low:1};class Dt{constructor(e){this.middlewareStack=Pt(),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()}}class Nt{constructor(){this.middlewareStack=Pt()}}const Ft=\"***SensitiveInformation***\",Bt=e=>{if(null!=e){if(\"number\"==typeof e){if(0!==e&&1!==e||Ht.warn(Wt(`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||Ht.warn(Wt(`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}`)}},Lt=e=>{if(null!=e){if(\"string\"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&Ht.warn(Wt(`Expected number but observed string: ${e}`)),t}if(\"number\"==typeof e)return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},Ut=(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}),Vt=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}`)},jt=e=>{if(null!=e){if(\"string\"==typeof e)return e;if([\"boolean\",\"number\",\"bigint\"].includes(typeof e))return Ht.warn(Wt(`Expected string, got ${typeof e}: ${e}`)),String(e);throw new TypeError(`Expected string, got ${typeof e}: ${e}`)}},zt=/(-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)|(-?Infinity)|(NaN)/g,$t=e=>{const t=e.match(zt);if(null===t||t[0].length!==e.length)throw new TypeError(\"Expected real number, got implicit NaN\");return parseFloat(e)},Wt=e=>String(new TypeError(e).stack||e).split(\"\\n\").slice(0,5).filter((e=>!e.includes(\"stackTraceWarning\"))).join(\"\\n\"),Ht={warn:console.warn},qt=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=>Lt(\"string\"==typeof e?$t(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 Kt extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,Kt.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}}const Gt=(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},Jt=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{}}},Qt=function(){const e=Object.getPrototypeOf(this).constructor,t=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(t,e.prototype),t};function Zt(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,Yt(n,r,s);s=t}for(const e of Object.keys(s))Array.isArray(s[e])?ei(n,null,s,e):n[e]=s[e];return n}Qt.prototype=Object.create(String.prototype,{constructor:{value:Qt,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(Qt,String);const Xt=(e,t)=>{const i={};for(const n in t)ei(i,e,t,n);return i},Yt=(e,t,i)=>Zt(e,Object.entries(i).reduce(((e,[i,n])=>(Array.isArray(n)?e[i]=n:e[i]=\"function\"==typeof n?[t,n()]:[t,n],e)),{})),ei=(e,t,i,n)=>{if(null!==t){let r=i[n];\"function\"==typeof r&&(r=[,r]);const[s=ti,o=ii,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)}},ti=e=>null!=e,ii=e=>e;function ni(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return\"%\"+e.charCodeAt(0).toString(16).toUpperCase()}))}const ri=(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=>ni(e))).join(\"/\"):ni(t))}return e},si=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]=si(e[i]));return t}return e};var oi=i(7643);function ai(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 ci{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;if(e.query){const t=function(e){const t=[];for(let i of Object.keys(e).sort()){const n=e[i];if(i=Ee(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,statusCode:e.status,body:e.body})}:e.blob().then((t=>({response:new u({headers:i,statusCode:e.status,body:t})})))})),ai(i)];return t&&d.push(new Promise(((e,i)=>{t.onabort=()=>{const e=new Error(\"Request aborted\");e.name=\"AbortError\",i(e)}}))),Promise.race(d)}}const di={},li=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);di[i]=e,li[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;di[i]=n,li[n]=i}for(let e=0;e<10;e++){di[e.toString(10)]=e+52;const t=e.toString(10),i=e+52;di[t]=i,li[i]=t}di[\"+\"]=62,li[62]=\"+\",di[\"/\"]=63,li[63]=\"/\";const ui=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 hi(e){let t=\"\";for(let i=0;i>i]}t+=\"==\".slice(0,4-s)}return t}const pi=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=ui(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),mi=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}`)};var fi=i(1206),gi=i.n(fi);const vi=({serviceId:e,clientVersion:t})=>async()=>{const i=\"undefined\"!=typeof window&&window?.navigator?.userAgent?gi().parse(window.navigator.userAgent):void 0,n=[[\"aws-sdk-js\",t],[`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},Si=e=>new TextDecoder(\"utf-8\").decode(e),bi=\"required\",yi=\"fn\",wi=\"argv\",Ci=\"ref\",ki=\"isSet\",Ei=\"tree\",Ii=\"error\",Ti=\"endpoint\",Mi=\"PartitionResult\",xi={[bi]:!1,type:\"String\"},Ai={[bi]:!0,default:!1,type:\"Boolean\"},_i={[Ci]:\"Endpoint\"},Pi={[yi]:\"booleanEquals\",[wi]:[{[Ci]:\"UseFIPS\"},!0]},Oi={[yi]:\"booleanEquals\",[wi]:[{[Ci]:\"UseDualStack\"},!0]},Ri={},Di={[yi]:\"booleanEquals\",[wi]:[!0,{[yi]:\"getAttr\",[wi]:[{[Ci]:Mi},\"supportsFIPS\"]}]},Ni={[yi]:\"booleanEquals\",[wi]:[!0,{[yi]:\"getAttr\",[wi]:[{[Ci]:Mi},\"supportsDualStack\"]}]},Fi=[Pi],Bi=[Oi],Li=[{[Ci]:\"Region\"}],Ui={version:\"1.0\",parameters:{Region:xi,UseDualStack:Ai,UseFIPS:Ai,Endpoint:xi},rules:[{conditions:[{[yi]:ki,[wi]:[_i]}],type:Ei,rules:[{conditions:Fi,error:\"Invalid Configuration: FIPS and custom endpoint are not supported\",type:Ii},{type:Ei,rules:[{conditions:Bi,error:\"Invalid Configuration: Dualstack and custom endpoint are not supported\",type:Ii},{endpoint:{url:_i,properties:Ri,headers:Ri},type:Ti}]}]},{type:Ei,rules:[{conditions:[{[yi]:ki,[wi]:Li}],type:Ei,rules:[{conditions:[{[yi]:\"aws.partition\",[wi]:Li,assign:Mi}],type:Ei,rules:[{conditions:[Pi,Oi],type:Ei,rules:[{conditions:[Di,Ni],type:Ei,rules:[{type:Ei,rules:[{endpoint:{url:\"https://messaging-chime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\",properties:Ri,headers:Ri},type:Ti}]}]},{error:\"FIPS and DualStack are enabled, but this partition does not support one or both\",type:Ii}]},{conditions:Fi,type:Ei,rules:[{conditions:[Di],type:Ei,rules:[{type:Ei,rules:[{endpoint:{url:\"https://messaging-chime-fips.{Region}.{PartitionResult#dnsSuffix}\",properties:Ri,headers:Ri},type:Ti}]}]},{error:\"FIPS is enabled but this partition does not support FIPS\",type:Ii}]},{conditions:Bi,type:Ei,rules:[{conditions:[Ni],type:Ei,rules:[{type:Ei,rules:[{endpoint:{url:\"https://messaging-chime.{Region}.{PartitionResult#dualStackDnsSuffix}\",properties:Ri,headers:Ri},type:Ti}]}]},{error:\"DualStack is enabled but this partition does not support DualStack\",type:Ii}]},{type:Ei,rules:[{endpoint:{url:\"https://messaging-chime.{Region}.{PartitionResult#dnsSuffix}\",properties:Ri,headers:Ri},type:Ti}]}]}]},{error:\"Invalid Configuration: Missing Region\",type:Ii}]}]},Vi=(e,t={})=>((e,t)=>{const{endpointParams:i,logger:n}=t,{parameters:r,rules:s}=e;t.logger?.debug?.(`${We} Initial EndpointParams: ${He(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 qe(`Missing required parameter: '${e}'`);const c=Et(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?.(`${We} Resolved endpoint: ${He(c)}`),c})(Ui,{endpointParams:e,logger:t.logger}),ji=[\"in-region\",\"cross-region\",\"mobile\",\"standard\",\"legacy\"],zi=e=>{const t=(({defaultsMode:e}={})=>ee((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?gi().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 ${ji.join(\", \")}, got ${t}`)}})))(e),i=()=>t().then(Jt),n=(e=>({apiVersion:\"2021-05-15\",base64Decoder:e?.base64Decoder??ui,base64Encoder:e?.base64Encoder??hi,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Vi,logger:e?.logger??new _t,serviceId:e?.serviceId??\"Chime SDK Messaging\",urlParser:e?.urlParser??I,utf8Decoder:e?.utf8Decoder??ie,utf8Encoder:e?.utf8Encoder??Si}))(e);return{...n,...e,runtime:\"browser\",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??mi,credentialDefaultProvider:e?.credentialDefaultProvider??(e=>()=>Promise.reject(new Error(\"Credential is missing\"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??vi({serviceId:n.serviceId,clientVersion:\"3.338.0\"}),maxAttempts:e?.maxAttempts??3,region:e?.region??(\"Region is missing\",()=>Promise.reject(\"Region is missing\")),requestHandler:e?.requestHandler??new ci(i),retryMode:e?.retryMode??(async()=>(await i()).retryMode||O),sha256:e?.sha256??oi.Sha256,streamCollector:e?.streamCollector??pi,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(!1)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(!1))}};class $i extends Dt{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 a(t);const e=await t();return a(e)},useFipsEndpoint:async()=>{const e=\"string\"==typeof t?t:await t();return!!o(e)||(\"function\"!=typeof i?Promise.resolve(!!i):i())}}})((t=zi(e),{...t,useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:\"chime\"})),n=(e=>{const{retryStrategy:t}=e,i=E(e.maxAttempts??3);return{...e,maxAttempts:i,retryStrategy:async()=>t||(await E(e.retryMode)()===_.ADAPTIVE?new j(i):new V(i))}})((e=>{const t=e.tls??!0,{endpoint:i}=e,n=null!=i?async()=>(e=>\"object\"==typeof e?\"url\"in e?I(e.url):e:I(e))(await E(i)()):void 0,r=!!i;return{...e,endpoint:n,tls:t,isCustomEndpoint:r,useDualstackEndpoint:E(e.useDualstackEndpoint??!1),useFipsEndpoint:E(e.useFipsEndpoint??!1)}})(i)),r=(e=>{const t=e.credentials?\"function\"==typeof(s=e.credentials)?ee(s,(e=>void 0!==e.expiration&&e.expiration.getTime()-Date.now()<3e5),(e=>void 0!==e.expiration)):E(s):e.credentialDefaultProvider(e),{signingEscapePath:i=!0,systemClockOffset:n=e.systemClockOffset||0,sha256:r}=e;var s;let o;return o=e.signer?E(e.signer):e.regionInfoProvider?()=>E(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||_e)(c)})):async n=>{const s=(n=Object.assign({},{name:\"sigv4\",signingName:e.signingName||e.defaultSigningName,signingRegion:await E(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||_e)(a)},{...e,systemClockOffset:n,signingEscapePath:i,credentials:t,signer:o}})(n),s=(c=r,{...c,customUserAgent:\"string\"==typeof c.customUserAgent?[[c.customUserAgent]]:c.customUserAgent});var c,d;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\"]=J());;)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=Q(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),X)}}))(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(h))try{const t=i(e);n.headers={...n.headers,[h]:String(t)}}catch(e){}}return e({...t,request:n})}),p)}}))(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),T)}}))(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}}),M)}})),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(x))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[x]=s),t({...i,request:n})})(e),A)}}))(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:Re(e.systemClockOffset),signingRegion:s||i.signing_region,signingService:i.signing_service})}).catch((t=>{const i=t.ServerTime??Ne(t.$response);throw i&&(e.systemClockOffset=De(i,e.systemClockOffset)),t})),c=Ne(a.response);return c&&(e.systemClockOffset=De(c,e.systemClockOffset)),a})(e),Fe)}}))(this.config)),this.middlewareStack.use((d=this.config,{applyToStack:e=>{var t;e.add((t=d,(e,i)=>async n=>{const{request:r}=n;if(!l.isInstance(r))return e(n);const{headers:s}=r,o=i?.userAgent?.map(xt)||[],a=(await t.defaultUserAgentProvider()).map(xt),c=t?.customUserAgent?.map(xt)||[],d=$e(),u=(d?[d]:[]).concat([...a,...o,...c]).join(\" \"),h=[...a.filter((e=>e.startsWith(\"aws-sdk-\"))),...c].join(\" \");return\"browser\"!==t.runtime?(h&&(s[Tt]=s[Tt]?`${s[It]} ${h}`:h),s[It]=u):s[Tt]=u,e({...n,request:r})}),At)}}))}destroy(){super.destroy()}}var Wi;!function(e){e[e.HEADER=0]=\"HEADER\",e[e.TRAILER=1]=\"TRAILER\"}(Wi||(Wi={}));class Hi{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:\"/\"}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 Hi({...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 qi extends Kt{constructor(e){super(e),Object.setPrototypeOf(this,qi.prototype)}}const Ki={ALL:\"ALL\",FILTERED:\"FILTERED\",NONE:\"NONE\"},Gi={DEFAULT:\"DEFAULT\",HIDDEN:\"HIDDEN\"},Ji={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 Qi extends qi{constructor(e){super({name:\"BadRequestException\",$fault:\"client\",...e}),this.name=\"BadRequestException\",this.$fault=\"client\",Object.setPrototypeOf(this,Qi.prototype),this.Code=e.Code,this.Message=e.Message}}class Zi extends qi{constructor(e){super({name:\"ConflictException\",$fault:\"client\",...e}),this.name=\"ConflictException\",this.$fault=\"client\",Object.setPrototypeOf(this,Zi.prototype),this.Code=e.Code,this.Message=e.Message}}class Xi extends qi{constructor(e){super({name:\"ForbiddenException\",$fault:\"client\",...e}),this.name=\"ForbiddenException\",this.$fault=\"client\",Object.setPrototypeOf(this,Xi.prototype),this.Code=e.Code,this.Message=e.Message}}class Yi extends qi{constructor(e){super({name:\"NotFoundException\",$fault:\"client\",...e}),this.name=\"NotFoundException\",this.$fault=\"client\",Object.setPrototypeOf(this,Yi.prototype),this.Code=e.Code,this.Message=e.Message}}class en extends qi{constructor(e){super({name:\"ServiceFailureException\",$fault:\"server\",...e}),this.name=\"ServiceFailureException\",this.$fault=\"server\",Object.setPrototypeOf(this,en.prototype),this.Code=e.Code,this.Message=e.Message}}class tn extends qi{constructor(e){super({name:\"ServiceUnavailableException\",$fault:\"server\",...e}),this.name=\"ServiceUnavailableException\",this.$fault=\"server\",Object.setPrototypeOf(this,tn.prototype),this.Code=e.Code,this.Message=e.Message}}class nn extends qi{constructor(e){super({name:\"ThrottledClientException\",$fault:\"client\",...e}),this.name=\"ThrottledClientException\",this.$fault=\"client\",Object.setPrototypeOf(this,nn.prototype),this.Code=e.Code,this.Message=e.Message}}class rn extends qi{constructor(e){super({name:\"UnauthorizedClientException\",$fault:\"client\",...e}),this.name=\"UnauthorizedClientException\",this.$fault=\"client\",Object.setPrototypeOf(this,rn.prototype),this.Code=e.Code,this.Message=e.Message}}class sn extends qi{constructor(e){super({name:\"ResourceLimitExceededException\",$fault:\"client\",...e}),this.name=\"ResourceLimitExceededException\",this.$fault=\"client\",Object.setPrototypeOf(this,sn.prototype),this.Code=e.Code,this.Message=e.Message}}const on={CREATED_TIMESTAMP:\"CREATED_TIMESTAMP\",LAST_MESSAGE_TIMESTAMP:\"LAST_MESSAGE_TIMESTAMP\"},an={RESTRICTED:\"RESTRICTED\",UNRESTRICTED:\"UNRESTRICTED\"},cn={PRIVATE:\"PRIVATE\",PUBLIC:\"PUBLIC\"},dn={ASYNC:\"ASYNC\"},ln={ABORT:\"ABORT\",CONTINUE:\"CONTINUE\"},un={DEFAULT:\"DEFAULT\",VOIP:\"VOIP\"},hn={NON_PERSISTENT:\"NON_PERSISTENT\",PERSISTENT:\"PERSISTENT\"},pn={DENIED:\"DENIED\",FAILED:\"FAILED\",PENDING:\"PENDING\",SENT:\"SENT\"},mn={CONTROL:\"CONTROL\",STANDARD:\"STANDARD\"},fn={Channel:\"Channel\",ChannelMessage:\"ChannelMessage\"},gn={ASCENDING:\"ASCENDING\",DESCENDING:\"DESCENDING\"},vn={MEMBERS:\"MEMBERS\"},Sn={EQUALS:\"EQUALS\",INCLUDES:\"INCLUDES\"},bn=e=>({...e,...e.Name&&{Name:Ft}}),yn=e=>({...e,...e.InvitedBy&&{InvitedBy:bn(e.InvitedBy)},...e.Members&&{Members:e.Members.map((e=>bn(e)))}}),wn=e=>({...e,...e.BatchChannelMemberships&&{BatchChannelMemberships:yn(e.BatchChannelMemberships)}}),Cn=e=>({...e,...e.Name&&{Name:Ft},...e.Metadata&&{Metadata:Ft},...e.CreatedBy&&{CreatedBy:bn(e.CreatedBy)}}),kn=e=>({...e,...e.Name&&{Name:Ft},...e.Metadata&&{Metadata:Ft}}),En=e=>({...e,...e.Member&&{Member:bn(e.Member)},...e.CreatedBy&&{CreatedBy:bn(e.CreatedBy)}}),In=e=>({...e,...e.Member&&{Member:bn(e.Member)}}),Tn=e=>({...e,...e.Name&&{Name:Ft}}),Mn=e=>({...e,...e.Processors&&{Processors:e.Processors.map((e=>Tn(e)))},...e.Name&&{Name:Ft}}),xn=e=>({...e,...e.StringValues&&{StringValues:Ft}}),An=e=>({...e,...e.Title&&{Title:Ft},...e.Body&&{Body:Ft}}),_n=e=>({...e,...e.Content&&{Content:Ft},...e.Metadata&&{Metadata:Ft},...e.PushNotification&&{PushNotification:An(e.PushNotification)},...e.MessageAttributes&&{MessageAttributes:Object.entries(e.MessageAttributes).reduce(((e,[t,i])=>(e[t]=xn(i),e)),{})},...e.ContentType&&{ContentType:Ft}}),Pn=e=>({...e,...e.ChannelMessage&&{ChannelMessage:_n(e.ChannelMessage)}}),On=e=>({...e,...e.Name&&{Name:Ft},...e.Processors&&{Processors:e.Processors.map((e=>Tn(e)))}}),Rn=e=>({...e,...e.InvitedBy&&{InvitedBy:bn(e.InvitedBy)},...e.Member&&{Member:bn(e.Member)}}),Dn=e=>({...e,...e.Name&&{Name:Ft},...e.Metadata&&{Metadata:Ft}}),Nn=e=>({...e,...e.ChannelSummary&&{ChannelSummary:Dn(e.ChannelSummary)}}),Fn=e=>({...e,...e.FilterRule&&{FilterRule:Ft}}),Bn=e=>({...e,...e.PushNotifications&&{PushNotifications:Fn(e.PushNotifications)}}),Ln=e=>({...e,...e.Member&&{Member:bn(e.Member)}}),Un=e=>({...e,...e.Content&&{Content:Ft},...e.Metadata&&{Metadata:Ft},...e.Sender&&{Sender:bn(e.Sender)},...e.MessageAttributes&&{MessageAttributes:Object.entries(e.MessageAttributes).reduce(((e,[t,i])=>(e[t]=xn(i),e)),{})},...e.ContentType&&{ContentType:Ft}}),Vn=e=>({...e,...e.Content&&{Content:Ft},...e.Metadata&&{Metadata:Ft},...e.Sender&&{Sender:bn(e.Sender)},...e.MessageAttributes&&{MessageAttributes:Object.entries(e.MessageAttributes).reduce(((e,[t,i])=>(e[t]=xn(i),e)),{})},...e.ContentType&&{ContentType:Ft}}),jn=e=>({...e,...e.ChannelSummary&&{ChannelSummary:Dn(e.ChannelSummary)}}),zn=e=>({...e,...e.Moderator&&{Moderator:bn(e.Moderator)},...e.CreatedBy&&{CreatedBy:bn(e.CreatedBy)}}),$n=e=>({...e,...e.Moderator&&{Moderator:bn(e.Moderator)}}),Wn=e=>({...e,...e.Key&&{Key:Ft},...e.Value&&{Value:Ft}}),Hn=e=>({...e,...e.Name&&{Name:Ft},...e.Metadata&&{Metadata:Ft},...e.ClientRequestToken&&{ClientRequestToken:Ft},...e.Tags&&{Tags:e.Tags.map((e=>Wn(e)))},...e.ChannelId&&{ChannelId:Ft}}),qn=e=>({...e,...e.Member&&{Member:bn(e.Member)}}),Kn=e=>({...e,...e.Processors&&{Processors:e.Processors.map((e=>Tn(e)))},...e.Name&&{Name:Ft},...e.Tags&&{Tags:e.Tags.map((e=>Wn(e)))},...e.ClientRequestToken&&{ClientRequestToken:Ft}}),Gn=e=>({...e,...e.Member&&{Member:bn(e.Member)}}),Jn=e=>({...e,...e.ChannelModerator&&{ChannelModerator:bn(e.ChannelModerator)}}),Qn=e=>({...e,...e.Channel&&{Channel:Cn(e.Channel)}}),Zn=e=>({...e,...e.ChannelBan&&{ChannelBan:En(e.ChannelBan)}}),Xn=e=>({...e,...e.ChannelFlow&&{ChannelFlow:Mn(e.ChannelFlow)}}),Yn=e=>({...e,...e.ChannelMembership&&{ChannelMembership:Rn(e.ChannelMembership)}}),er=e=>({...e,...e.ChannelMembership&&{ChannelMembership:Nn(e.ChannelMembership)}}),tr=e=>({...e,...e.Channel&&{Channel:jn(e.Channel)}}),ir=e=>({...e,...e.ChannelModerator&&{ChannelModerator:zn(e.ChannelModerator)}}),nr=e=>({...e,...e.Member&&{Member:bn(e.Member)},...e.Preferences&&{Preferences:Bn(e.Preferences)}}),rr=e=>({...e,...e.ChannelMessage&&{ChannelMessage:Un(e.ChannelMessage)}}),sr=e=>({...e,...e.NextToken&&{NextToken:Ft}}),or=e=>({...e,...e.NextToken&&{NextToken:Ft},...e.ChannelBans&&{ChannelBans:e.ChannelBans.map((e=>In(e)))}}),ar=e=>({...e,...e.NextToken&&{NextToken:Ft}}),cr=e=>({...e,...e.ChannelFlows&&{ChannelFlows:e.ChannelFlows.map((e=>On(e)))},...e.NextToken&&{NextToken:Ft}}),dr=e=>({...e,...e.NextToken&&{NextToken:Ft}}),lr=e=>({...e,...e.ChannelMemberships&&{ChannelMemberships:e.ChannelMemberships.map((e=>Ln(e)))},...e.NextToken&&{NextToken:Ft}}),ur=e=>({...e,...e.NextToken&&{NextToken:Ft}}),hr=e=>({...e,...e.ChannelMemberships&&{ChannelMemberships:e.ChannelMemberships.map((e=>Nn(e)))},...e.NextToken&&{NextToken:Ft}}),pr=e=>({...e,...e.NextToken&&{NextToken:Ft}}),mr=e=>({...e,...e.NextToken&&{NextToken:Ft},...e.ChannelMessages&&{ChannelMessages:e.ChannelMessages.map((e=>Vn(e)))}}),fr=e=>({...e,...e.NextToken&&{NextToken:Ft}}),gr=e=>({...e,...e.NextToken&&{NextToken:Ft},...e.ChannelModerators&&{ChannelModerators:e.ChannelModerators.map((e=>$n(e)))}}),vr=e=>({...e,...e.NextToken&&{NextToken:Ft}}),Sr=e=>({...e,...e.Channels&&{Channels:e.Channels.map((e=>Dn(e)))},...e.NextToken&&{NextToken:Ft}}),br=e=>({...e,...e.NextToken&&{NextToken:Ft}}),yr=e=>({...e,...e.Channels&&{Channels:e.Channels.map((e=>kn(e)))},...e.NextToken&&{NextToken:Ft}}),wr=e=>({...e,...e.NextToken&&{NextToken:Ft}}),Cr=e=>({...e,...e.Channels&&{Channels:e.Channels.map((e=>jn(e)))},...e.NextToken&&{NextToken:Ft}}),kr=e=>({...e,...e.NextToken&&{NextToken:Ft}}),Er=e=>({...e,...e.NextToken&&{NextToken:Ft}}),Ir=e=>({...e,...e.Tags&&{Tags:e.Tags.map((e=>Wn(e)))}}),Tr=e=>({...e,...e.Preferences&&{Preferences:Bn(e.Preferences)}}),Mr=e=>({...e,...e.Member&&{Member:bn(e.Member)},...e.Preferences&&{Preferences:Bn(e.Preferences)}}),xr=e=>({...e,...e.NextToken&&{NextToken:Ft}}),Ar=e=>({...e,...e.Channels&&{Channels:e.Channels.map((e=>Dn(e)))},...e.NextToken&&{NextToken:Ft}}),_r=e=>({...e,...e.Content&&{Content:Ft},...e.Metadata&&{Metadata:Ft},...e.ClientRequestToken&&{ClientRequestToken:Ft},...e.PushNotification&&{PushNotification:An(e.PushNotification)},...e.MessageAttributes&&{MessageAttributes:Object.entries(e.MessageAttributes).reduce(((e,[t,i])=>(e[t]=xn(i),e)),{})},...e.ContentType&&{ContentType:Ft}}),Pr=e=>({...e,...e.Tags&&{Tags:e.Tags.map((e=>Wn(e)))}}),Or=e=>({...e,...e.TagKeys&&{TagKeys:Ft}}),Rr=e=>({...e,...e.Name&&{Name:Ft},...e.Metadata&&{Metadata:Ft}}),Dr=e=>({...e,...e.Processors&&{Processors:e.Processors.map((e=>Tn(e)))},...e.Name&&{Name:Ft}}),Nr=e=>({...e,...e.Content&&{Content:Ft},...e.Metadata&&{Metadata:Ft},...e.ContentType&&{ContentType:Ft}}),Fr=(Br=qi,({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 Gt(o,t)})({output:e,parsedBody:t,exceptionCtor:Br,errorCode:i})});var Br;const Lr=async(e,t)=>{const i=Zt({}),n=e.body,r=Xt(n,{Code:jt,Message:jt});Object.assign(i,r);const s=new Qi({$metadata:Zr(e),...i});return Gt(s,e.body)},Ur=async(e,t)=>{const i=Zt({}),n=e.body,r=Xt(n,{Code:jt,Message:jt});Object.assign(i,r);const s=new Zi({$metadata:Zr(e),...i});return Gt(s,e.body)},Vr=async(e,t)=>{const i=Zt({}),n=e.body,r=Xt(n,{Code:jt,Message:jt});Object.assign(i,r);const s=new Xi({$metadata:Zr(e),...i});return Gt(s,e.body)},jr=async(e,t)=>{const i=Zt({}),n=e.body,r=Xt(n,{Code:jt,Message:jt});Object.assign(i,r);const s=new Yi({$metadata:Zr(e),...i});return Gt(s,e.body)},zr=async(e,t)=>{const i=Zt({}),n=e.body,r=Xt(n,{Code:jt,Message:jt});Object.assign(i,r);const s=new sn({$metadata:Zr(e),...i});return Gt(s,e.body)},$r=async(e,t)=>{const i=Zt({}),n=e.body,r=Xt(n,{Code:jt,Message:jt});Object.assign(i,r);const s=new en({$metadata:Zr(e),...i});return Gt(s,e.body)},Wr=async(e,t)=>{const i=Zt({}),n=e.body,r=Xt(n,{Code:jt,Message:jt});Object.assign(i,r);const s=new tn({$metadata:Zr(e),...i});return Gt(s,e.body)},Hr=async(e,t)=>{const i=Zt({}),n=e.body,r=Xt(n,{Code:jt,Message:jt});Object.assign(i,r);const s=new nn({$metadata:Zr(e),...i});return Gt(s,e.body)},qr=async(e,t)=>{const i=Zt({}),n=e.body,r=Xt(n,{Code:jt,Message:jt});Object.assign(i,r);const s=new rn({$metadata:Zr(e),...i});return Gt(s,e.body)},Kr=(e,t)=>Xt(e,{AppInstanceUserMembershipSummary:e=>((e,t)=>Xt(e,{ReadMarkerTimestamp:e=>Ut(qt(Lt(e))),SubChannelId:jt,Type:jt}))(e),ChannelSummary:e=>Jr(e,t)}),Gr=(e,t)=>Xt(e,{ChannelSummary:e=>Jr(e,t)}),Jr=(e,t)=>Xt(e,{ChannelArn:jt,LastMessageTimestamp:e=>Ut(qt(Lt(e))),Metadata:jt,Mode:jt,Name:jt,Privacy:jt}),Qr=(e,t)=>{const i=(e||[]).filter((e=>null!=e)).map((e=>Jr(e,t)));return i},Zr=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\"]}),Xr=(e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array),Yr=e=>!(null==e||\"\"===e||Object.getOwnPropertyNames(e).includes(\"length\")&&0==e.length||Object.getOwnPropertyNames(e).includes(\"size\")&&0==e.size),es=(e,t)=>((e,t)=>Xr(e,t).then((e=>t.utf8Encoder(e))))(e,t).then((e=>e.length?JSON.parse(e):{})),ts=async(e,t)=>{const i=await es(e,t);return i.message=i.message??i.Message,i},is=(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 ns extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,ns.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=Zt({},Yr,{\"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=ri(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=JSON.stringify(Xt(e,{ChannelFlowArn:[]})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await jr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)});return await Xr(e.body,t),i})(e,t)}}class rs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,rs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"BatchCreateChannelMembershipCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:wn},{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=Zt({},Yr,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/memberships`;a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Zt({operation:[,\"batch-create\"]});let d;return d=JSON.stringify(Xt(e,{MemberArns:e=>si(e),SubChannelId:[],Type:[]})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await jr(i,t);case\"ResourceLimitExceededException\":case\"com.amazonaws.chimesdkmessaging#ResourceLimitExceededException\":throw await zr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{BatchChannelMemberships:si,Errors:si});return Object.assign(i,r),i})(e,t)}}class ss extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,ss.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ChannelFlowCallbackCommand\",inputFilterSensitiveLog:Pn,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=ri(o,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const a=Zt({operation:[,\"channel-flow-callback\"]});let c;return c=JSON.stringify(Xt(e,{CallbackId:[!0,e=>e??J()],ChannelMessage:e=>si(e),DeleteResource:[]})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{CallbackId:jt,ChannelArn:jt});return Object.assign(i,r),i})(e,t)}}class os extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,os.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"CreateChannelBanCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:qn},{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=Zt({},Yr,{\"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=ri(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=JSON.stringify(Xt(e,{MemberArn:[]})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ResourceLimitExceededException\":case\"com.amazonaws.chimesdkmessaging#ResourceLimitExceededException\":throw await zr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt,Member:si});return Object.assign(i,r),i})(e,t)}}class as extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,as.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"CreateChannelCommand\",inputFilterSensitiveLog:Hn,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=Zt({},Yr,{\"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(Xt(e,{AppInstanceArn:[],ChannelId:[],ClientRequestToken:[!0,e=>e??J()],ElasticChannelConfiguration:e=>si(e),ExpirationSettings:e=>si(e),MemberArns:e=>si(e),Metadata:[],Mode:[],ModeratorArns:e=>si(e),Name:[],Privacy:[],Tags:e=>si(e)})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ResourceLimitExceededException\":case\"com.amazonaws.chimesdkmessaging#ResourceLimitExceededException\":throw await zr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt});return Object.assign(i,r),i})(e,t)}}class cs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,cs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"CreateChannelFlowCommand\",inputFilterSensitiveLog:Kn,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(Xt(e,{AppInstanceArn:[],ClientRequestToken:[!0,e=>e??J()],Name:[],Processors:e=>si(e),Tags:e=>si(e)})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ResourceLimitExceededException\":case\"com.amazonaws.chimesdkmessaging#ResourceLimitExceededException\":throw await zr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelFlowArn:jt});return Object.assign(i,r),i})(e,t)}}class ds extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,ds.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"CreateChannelMembershipCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:Gn},{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=Zt({},Yr,{\"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=ri(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=JSON.stringify(Xt(e,{MemberArn:[],SubChannelId:[],Type:[]})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await jr(i,t);case\"ResourceLimitExceededException\":case\"com.amazonaws.chimesdkmessaging#ResourceLimitExceededException\":throw await zr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt,Member:si,SubChannelId:jt});return Object.assign(i,r),i})(e,t)}}class ls extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,ls.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"CreateChannelModeratorCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:Jn},{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=Zt({},Yr,{\"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=ri(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=JSON.stringify(Xt(e,{ChannelModeratorArn:[]})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ResourceLimitExceededException\":case\"com.amazonaws.chimesdkmessaging#ResourceLimitExceededException\":throw await zr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt,ChannelModerator:si});return Object.assign(i,r),i})(e,t)}}class us extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,us.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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/bans/{MemberArn}`;return a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=ri(a,e,\"MemberArn\",(()=>e.MemberArn),\"{MemberArn}\",!1),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)});return await Xr(e.body,t),i})(e,t)}}class hs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,hs.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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}`;return a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)});return await Xr(e.body,t),i})(e,t)}}class ps extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,ps.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=ri(o,e,\"ChannelFlowArn\",(()=>e.ChannelFlowArn),\"{ChannelFlowArn}\",!1),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)});return await Xr(e.body,t),i})(e,t)}}class ms extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,ms.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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/memberships/{MemberArn}`;a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=ri(a,e,\"MemberArn\",(()=>e.MemberArn),\"{MemberArn}\",!1);const c=Zt({\"sub-channel-id\":[,e.SubChannelId]});return new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)});return await Xr(e.body,t),i})(e,t)}}class fs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,fs.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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/messages/{MessageId}`;a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=ri(a,e,\"MessageId\",(()=>e.MessageId),\"{MessageId}\",!1);const c=Zt({\"sub-channel-id\":[,e.SubChannelId]});return new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)});return await Xr(e.body,t),i})(e,t)}}class gs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,gs.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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/moderators/{ChannelModeratorArn}`;return a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=ri(a,e,\"ChannelModeratorArn\",(()=>e.ChannelModeratorArn),\"{ChannelModeratorArn}\",!1),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)});return await Xr(e.body,t),i})(e,t)}}class vs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,vs.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=ri(o,e,\"AppInstanceArn\",(()=>e.AppInstanceArn),\"{AppInstanceArn}\",!1),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)});return await Xr(e.body,t),i})(e,t)}}class Ss extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Ss.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DescribeChannelBanCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:Zn},{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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/bans/{MemberArn}`;return a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=ri(a,e,\"MemberArn\",(()=>e.MemberArn),\"{MemberArn}\",!1),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await jr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelBan:e=>((e,t)=>Xt(e,{ChannelArn:jt,CreatedBy:si,CreatedTimestamp:e=>Ut(qt(Lt(e))),Member:si}))(e)});return Object.assign(i,r),i})(e,t)}}class bs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,bs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DescribeChannelCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:Qn},{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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}`;return a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{Channel:e=>((e,t)=>Xt(e,{ChannelArn:jt,ChannelFlowArn:jt,CreatedBy:si,CreatedTimestamp:e=>Ut(qt(Lt(e))),ElasticChannelConfiguration:si,ExpirationSettings:si,LastMessageTimestamp:e=>Ut(qt(Lt(e))),LastUpdatedTimestamp:e=>Ut(qt(Lt(e))),Metadata:jt,Mode:jt,Name:jt,Privacy:jt}))(e)});return Object.assign(i,r),i})(e,t)}}class ys extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,ys.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DescribeChannelFlowCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:Xn},{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=ri(o,e,\"ChannelFlowArn\",(()=>e.ChannelFlowArn),\"{ChannelFlowArn}\",!1),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelFlow:e=>((e,t)=>Xt(e,{ChannelFlowArn:jt,CreatedTimestamp:e=>Ut(qt(Lt(e))),LastUpdatedTimestamp:e=>Ut(qt(Lt(e))),Name:jt,Processors:si}))(e)});return Object.assign(i,r),i})(e,t)}}class ws extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,ws.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DescribeChannelMembershipCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:Yn},{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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/memberships/{MemberArn}`;a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=ri(a,e,\"MemberArn\",(()=>e.MemberArn),\"{MemberArn}\",!1);const c=Zt({\"sub-channel-id\":[,e.SubChannelId]});return new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await jr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelMembership:e=>((e,t)=>Xt(e,{ChannelArn:jt,CreatedTimestamp:e=>Ut(qt(Lt(e))),InvitedBy:si,LastUpdatedTimestamp:e=>Ut(qt(Lt(e))),Member:si,SubChannelId:jt,Type:jt}))(e)});return Object.assign(i,r),i})(e,t)}}class Cs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Cs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DescribeChannelMembershipForAppInstanceUserCommand\",inputFilterSensitiveLog:e=>e,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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}`;a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Zt({scope:[,\"app-instance-user-membership\"],\"app-instance-user-arn\":[,Ut(e.AppInstanceUserArn,\"AppInstanceUserArn\")]});return new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelMembership:e=>Kr(e,t)});return Object.assign(i,r),i})(e,t)}}class ks extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,ks.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DescribeChannelModeratedByAppInstanceUserCommand\",inputFilterSensitiveLog:e=>e,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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}`;a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Zt({scope:[,\"app-instance-user-moderated-channel\"],\"app-instance-user-arn\":[,Ut(e.AppInstanceUserArn,\"AppInstanceUserArn\")]});return new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{Channel:e=>Gr(e,t)});return Object.assign(i,r),i})(e,t)}}class Es extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Es.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"DescribeChannelModeratorCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:ir},{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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/moderators/{ChannelModeratorArn}`;return a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=ri(a,e,\"ChannelModeratorArn\",(()=>e.ChannelModeratorArn),\"{ChannelModeratorArn}\",!1),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await jr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelModerator:e=>((e,t)=>Xt(e,{ChannelArn:jt,CreatedBy:si,CreatedTimestamp:e=>Ut(qt(Lt(e))),Moderator:si}))(e)});return Object.assign(i,r),i})(e,t)}}class Is extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Is.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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/channel-flow/{ChannelFlowArn}`;return a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=ri(a,e,\"ChannelFlowArn\",(()=>e.ChannelFlowArn),\"{ChannelFlowArn}\",!1),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await jr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)});return await Xr(e.body,t),i})(e,t)}}class Ts extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Ts.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"GetChannelMembershipPreferencesCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:nr},{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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/memberships/{MemberArn}/preferences`;return a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=ri(a,e,\"MemberArn\",(()=>e.MemberArn),\"{MemberArn}\",!1),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt,Member:si,Preferences:si});return Object.assign(i,r),i})(e,t)}}class Ms extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Ms.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"GetChannelMessageCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:rr},{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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/messages/{MessageId}`;a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=ri(a,e,\"MessageId\",(()=>e.MessageId),\"{MessageId}\",!1);const c=Zt({\"sub-channel-id\":[,e.SubChannelId]});return new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await jr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelMessage:e=>((e,t)=>Xt(e,{ChannelArn:jt,Content:jt,ContentType:jt,CreatedTimestamp:e=>Ut(qt(Lt(e))),LastEditedTimestamp:e=>Ut(qt(Lt(e))),LastUpdatedTimestamp:e=>Ut(qt(Lt(e))),MessageAttributes:si,MessageId:jt,Metadata:jt,Persistence:jt,Redacted:Bt,Sender:si,Status:si,SubChannelId:jt,Type:jt}))(e)});return Object.assign(i,r),i})(e,t)}}class xs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,xs.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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/messages/{MessageId}`;a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=ri(a,e,\"MessageId\",(()=>e.MessageId),\"{MessageId}\",!1);const c=Zt({scope:[,\"message-status\"],\"sub-channel-id\":[,e.SubChannelId]});return new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{Status:si});return Object.assign(i,r),i})(e,t)}}class As extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,As.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 Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{Endpoint:si});return Object.assign(i,r),i})(e,t)}}class _s extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,_s.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=ri(o,e,\"AppInstanceArn\",(()=>e.AppInstanceArn),\"{AppInstanceArn}\",!1),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await jr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{StreamingConfigurations:si});return Object.assign(i,r),i})(e,t)}}class Ps extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Ps.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelBansCommand\",inputFilterSensitiveLog:sr,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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/bans`;a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Zt({\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});return new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt,ChannelBans:si,NextToken:jt});return Object.assign(i,r),i})(e,t)}}class Os extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Os.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelFlowsCommand\",inputFilterSensitiveLog:ar,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=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channel-flows`,a=Zt({\"app-instance-arn\":[,Ut(e.AppInstanceArn,\"AppInstanceArn\")],\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});return new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelFlows:si,NextToken:jt});return Object.assign(i,r),i})(e,t)}}class Rs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Rs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelMembershipsCommand\",inputFilterSensitiveLog:dr,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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/memberships`;a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Zt({type:[,e.Type],\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken],\"sub-channel-id\":[,e.SubChannelId]});return new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt,ChannelMemberships:si,NextToken:jt});return Object.assign(i,r),i})(e,t)}}class Ds extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Ds.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelMembershipsForAppInstanceUserCommand\",inputFilterSensitiveLog:ur,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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer}),a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels`,c=Zt({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 Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelMemberships:e=>((e,t)=>{const i=(e||[]).filter((e=>null!=e)).map((e=>Kr(e,t)));return i})(e,t),NextToken:jt});return Object.assign(i,r),i})(e,t)}}class Ns extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Ns.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelMessagesCommand\",inputFilterSensitiveLog:pr,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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/messages`;a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Zt({\"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 Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt,ChannelMessages:e=>((e,t)=>{const i=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>Xt(e,{Content:jt,ContentType:jt,CreatedTimestamp:e=>Ut(qt(Lt(e))),LastEditedTimestamp:e=>Ut(qt(Lt(e))),LastUpdatedTimestamp:e=>Ut(qt(Lt(e))),MessageAttributes:si,MessageId:jt,Metadata:jt,Redacted:Bt,Sender:si,Status:si,Type:jt}))(e)));return i})(e),NextToken:jt,SubChannelId:jt});return Object.assign(i,r),i})(e,t)}}class Fs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Fs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelModeratorsCommand\",inputFilterSensitiveLog:fr,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(),o=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/moderators`;a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Zt({\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});return new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt,ChannelModerators:si,NextToken:jt});return Object.assign(i,r),i})(e,t)}}class Bs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Bs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelsAssociatedWithChannelFlowCommand\",inputFilterSensitiveLog:br,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=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels`,a=Zt({scope:[,\"channel-flow-associations\"],\"channel-flow-arn\":[,Ut(e.ChannelFlowArn,\"ChannelFlowArn\")],\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});return new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{Channels:si,NextToken:jt});return Object.assign(i,r),i})(e,t)}}class Ls extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Ls.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelsCommand\",inputFilterSensitiveLog:vr,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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer}),a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels`,c=Zt({\"app-instance-arn\":[,Ut(e.AppInstanceArn,\"AppInstanceArn\")],privacy:[,e.Privacy],\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});return new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{Channels:e=>Qr(e,t),NextToken:jt});return Object.assign(i,r),i})(e,t)}}class Us extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Us.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListChannelsModeratedByAppInstanceUserCommand\",inputFilterSensitiveLog:wr,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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer}),a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels`,c=Zt({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 Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{Channels:e=>((e,t)=>{const i=(e||[]).filter((e=>null!=e)).map((e=>Gr(e,t)));return i})(e,t),NextToken:jt});return Object.assign(i,r),i})(e,t)}}class Vs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Vs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListSubChannelsCommand\",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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/subchannels`;a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1);const c=Zt({\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});return new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt,NextToken:jt,SubChannels:si});return Object.assign(i,r),i})(e,t)}}class js extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,js.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"ListTagsForResourceCommand\",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:Ir},{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=Zt({arn:[,Ut(e.ResourceARN,\"ResourceARN\")]});return new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{Tags:si});return Object.assign(i,r),i})(e,t)}}class zs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,zs.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=Zt({},Yr,{\"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=ri(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=JSON.stringify(Xt(e,{ExpirationSettings:e=>si(e)})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt,ExpirationSettings:si});return Object.assign(i,r),i})(e,t)}}class $s extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,$s.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"PutChannelMembershipPreferencesCommand\",inputFilterSensitiveLog:Tr,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=Zt({},Yr,{\"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=ri(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),c=ri(c,e,\"MemberArn\",(()=>e.MemberArn),\"{MemberArn}\",!1),a=JSON.stringify(Xt(e,{Preferences:e=>si(e)})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt,Member:si,Preferences:si});return Object.assign(i,r),i})(e,t)}}class Ws extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Ws.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=ri(a,e,\"AppInstanceArn\",(()=>e.AppInstanceArn),\"{AppInstanceArn}\",!1),o=JSON.stringify(Xt(e,{StreamingConfigurations:e=>si(e)})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"NotFoundException\":case\"com.amazonaws.chimesdkmessaging#NotFoundException\":throw await jr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{StreamingConfigurations:si});return Object.assign(i,r),i})(e,t)}}class Hs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Hs.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=Zt({},Yr,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/messages/{MessageId}`;a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=ri(a,e,\"MessageId\",(()=>e.MessageId),\"{MessageId}\",!1);const c=Zt({operation:[,\"redact\"]});let d;return d=JSON.stringify(Xt(e,{SubChannelId:[]})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt,MessageId:jt,SubChannelId:jt});return Object.assign(i,r),i})(e,t)}}class qs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,qs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"SearchChannelsCommand\",inputFilterSensitiveLog:xr,outputFilterSensitiveLog:Ar},{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=Zt({},Yr,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer}),a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels`,c=Zt({operation:[,\"search\"],\"max-results\":[()=>void 0!==e.MaxResults,()=>e.MaxResults.toString()],\"next-token\":[,e.NextToken]});let d;return d=JSON.stringify(Xt(e,{Fields:e=>si(e)})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{Channels:e=>Qr(e,t),NextToken:jt});return Object.assign(i,r),i})(e,t)}}class Ks extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Ks.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"SendChannelMessageCommand\",inputFilterSensitiveLog:_r,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=Zt({},Yr,{\"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=ri(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=JSON.stringify(Xt(e,{ClientRequestToken:[!0,e=>e??J()],Content:[],ContentType:[],MessageAttributes:e=>si(e),Metadata:[],Persistence:[],PushNotification:e=>si(e),SubChannelId:[],Type:[]})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt,MessageId:jt,Status:si,SubChannelId:jt});return Object.assign(i,r),i})(e,t)}}class Gs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Gs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"TagResourceCommand\",inputFilterSensitiveLog:Pr,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=Zt({operation:[,\"tag-resource\"]});let c;return c=JSON.stringify(Xt(e,{ResourceARN:[],Tags:e=>si(e)})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ResourceLimitExceededException\":case\"com.amazonaws.chimesdkmessaging#ResourceLimitExceededException\":throw await zr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)});return await Xr(e.body,t),i})(e,t)}}class Js extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Js.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"UntagResourceCommand\",inputFilterSensitiveLog:Or,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=Zt({operation:[,\"untag-resource\"]});let c;return c=JSON.stringify(Xt(e,{ResourceARN:[],TagKeys:e=>si(e)})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)});return await Xr(e.body,t),i})(e,t)}}class Qs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Qs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"UpdateChannelCommand\",inputFilterSensitiveLog:Rr,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=Zt({},Yr,{\"content-type\":\"application/json\",\"x-amz-chime-bearer\":e.ChimeBearer});let a,c=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}`;return c=ri(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),a=JSON.stringify(Xt(e,{Metadata:[],Mode:[],Name:[]})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt});return Object.assign(i,r),i})(e,t)}}class Zs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Zs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"UpdateChannelFlowCommand\",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();let o,a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channel-flows/{ChannelFlowArn}`;return a=ri(a,e,\"ChannelFlowArn\",(()=>e.ChannelFlowArn),\"{ChannelFlowArn}\",!1),o=JSON.stringify(Xt(e,{Name:[],Processors:e=>si(e)})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelFlowArn:jt});return Object.assign(i,r),i})(e,t)}}class Xs extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Xs.getEndpointParameterInstructions()));const n=e.concat(this.middlewareStack),{logger:r}=t,s={logger:r,clientName:\"ChimeSDKMessagingClient\",commandName:\"UpdateChannelMessageCommand\",inputFilterSensitiveLog:Nr,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=Zt({},Yr,{\"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=ri(c,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),c=ri(c,e,\"MessageId\",(()=>e.MessageId),\"{MessageId}\",!1),a=JSON.stringify(Xt(e,{Content:[],ContentType:[],Metadata:[],SubChannelId:[]})),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt,MessageId:jt,Status:si,SubChannelId:jt});return Object.assign(i,r),i})(e,t)}}class Ys extends Nt{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(g(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Ys.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=Zt({},Yr,{\"x-amz-chime-bearer\":e.ChimeBearer});let a=`${s?.endsWith(\"/\")?s.slice(0,-1):s||\"\"}/channels/{ChannelArn}/readMarker`;return a=ri(a,e,\"ChannelArn\",(()=>e.ChannelArn),\"{ChannelArn}\",!1),new Hi({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 ts(e.body,t)},n=is(e,i.body);switch(n){case\"BadRequestException\":case\"com.amazonaws.chimesdkmessaging#BadRequestException\":throw await Lr(i,t);case\"ConflictException\":case\"com.amazonaws.chimesdkmessaging#ConflictException\":throw await Ur(i,t);case\"ForbiddenException\":case\"com.amazonaws.chimesdkmessaging#ForbiddenException\":throw await Vr(i,t);case\"ServiceFailureException\":case\"com.amazonaws.chimesdkmessaging#ServiceFailureException\":throw await $r(i,t);case\"ServiceUnavailableException\":case\"com.amazonaws.chimesdkmessaging#ServiceUnavailableException\":throw await Wr(i,t);case\"ThrottledClientException\":case\"com.amazonaws.chimesdkmessaging#ThrottledClientException\":throw await Hr(i,t);case\"UnauthorizedClientException\":case\"com.amazonaws.chimesdkmessaging#UnauthorizedClientException\":throw await qr(i,t);default:const r=i.body;return Fr({output:e,parsedBody:r,errorCode:n})}})(e,t);const i=Zt({$metadata:Zr(e)}),n=Ut(Vt(await es(e.body,t)),\"body\"),r=Xt(n,{ChannelArn:jt});return Object.assign(i,r),i})(e,t)}}const eo={AssociateChannelFlowCommand:ns,BatchCreateChannelMembershipCommand:rs,ChannelFlowCallbackCommand:ss,CreateChannelCommand:as,CreateChannelBanCommand:os,CreateChannelFlowCommand:cs,CreateChannelMembershipCommand:ds,CreateChannelModeratorCommand:ls,DeleteChannelCommand:hs,DeleteChannelBanCommand:us,DeleteChannelFlowCommand:ps,DeleteChannelMembershipCommand:ms,DeleteChannelMessageCommand:fs,DeleteChannelModeratorCommand:gs,DeleteMessagingStreamingConfigurationsCommand:vs,DescribeChannelCommand:bs,DescribeChannelBanCommand:Ss,DescribeChannelFlowCommand:ys,DescribeChannelMembershipCommand:ws,DescribeChannelMembershipForAppInstanceUserCommand:Cs,DescribeChannelModeratedByAppInstanceUserCommand:ks,DescribeChannelModeratorCommand:Es,DisassociateChannelFlowCommand:Is,GetChannelMembershipPreferencesCommand:Ts,GetChannelMessageCommand:Ms,GetChannelMessageStatusCommand:xs,GetMessagingSessionEndpointCommand:As,GetMessagingStreamingConfigurationsCommand:_s,ListChannelBansCommand:Ps,ListChannelFlowsCommand:Os,ListChannelMembershipsCommand:Rs,ListChannelMembershipsForAppInstanceUserCommand:Ds,ListChannelMessagesCommand:Ns,ListChannelModeratorsCommand:Fs,ListChannelsCommand:Ls,ListChannelsAssociatedWithChannelFlowCommand:Bs,ListChannelsModeratedByAppInstanceUserCommand:Us,ListSubChannelsCommand:Vs,ListTagsForResourceCommand:js,PutChannelExpirationSettingsCommand:zs,PutChannelMembershipPreferencesCommand:$s,PutMessagingStreamingConfigurationsCommand:Ws,RedactChannelMessageCommand:Hs,SearchChannelsCommand:qs,SendChannelMessageCommand:Ks,TagResourceCommand:Gs,UntagResourceCommand:Js,UpdateChannelCommand:Qs,UpdateChannelFlowCommand:Zs,UpdateChannelMessageCommand:Xs,UpdateChannelReadMarkerCommand:Ys};class to extends $i{}((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}})(eo,to);const io=async(e,t,...i)=>await e.send(new Ps(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 $i))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await io(e.client,t,...i),yield n;const o=r;r=n.NextToken,s=!(!r||e.stopOnSameToken&&r===o)}}const ro=async(e,t,...i)=>await e.send(new Os(t),...i);async function*so(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 $i))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await ro(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 Ds(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 $i))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 co=async(e,t,...i)=>await e.send(new Rs(t),...i);async function*lo(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 $i))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 uo=async(e,t,...i)=>await e.send(new Ns(t),...i);async function*ho(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 $i))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await uo(e.client,t,...i),yield n;const o=r;r=n.NextToken,s=!(!r||e.stopOnSameToken&&r===o)}}const po=async(e,t,...i)=>await e.send(new Fs(t),...i);async function*mo(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 $i))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await po(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 Bs(t),...i);async function*go(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 $i))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 vo=async(e,t,...i)=>await e.send(new Us(t),...i);async function*So(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 $i))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)}}const bo=async(e,t,...i)=>await e.send(new Ls(t),...i);async function*yo(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 $i))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await bo(e.client,t,...i),yield n;const o=r;r=n.NextToken,s=!(!r||e.stopOnSameToken&&r===o)}}const wo=async(e,t,...i)=>await e.send(new Vs(t),...i);async function*Co(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 $i))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await wo(e.client,t,...i),yield n;const o=r;r=n.NextToken,s=!(!r||e.stopOnSameToken&&r===o)}}const ko=async(e,t,...i)=>await e.send(new qs(t),...i);async function*Eo(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 $i))throw new Error(\"Invalid client, expected ChimeSDKMessaging | ChimeSDKMessagingClient\");n=await ko(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.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.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(9416),k=i(9101),E=i(289),I=i(8597),T=i(8358),M=i(3216),x=i(7408),A=i(5482),_=i(1129),P=i(6240),O=i(1960),R=i(6180),D=i(2748),N=i(1981),F=i(4543),B=i(8556),L=i(9945),U=i(1209),V=i(5547),j=i(120),z=i(9560),$=i(9485),W=i(7079),H=i(4833),q=i(5275),K=i(5924),G=i(250),J=i(6171),Q=i(365),Z=i(7377),X=i(5785),Y=i(9354),ee=i(8660),te=i(1133),ie=i(5185),ne=i(2880),re=i(1508),se=i(1318),oe=i(4242),ae=i(2958),ce=i(4922),de=i(4450),le=i(4442),ue=i(9751),he=i(1876);class pe{constructor(e,t,i,n,r,a){this._audioProfile=new o.default,this.connectionHealthData=new c.default,this.observerQueue=new Set,this.meetingSessionContext=new he.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 ae.default(new ce.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 he.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===C.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 N.default(t,this.configuration.connectionHealthPolicyConfiguration,this.connectionHealthData);const i=this.monitorTask.once(),n=new U.default(t).once();this.receiveIndexTask=new z.default(t),this.monitorTask.pauseResubscribeCheck(),this.receiveIndexTask.pauseIngestion();const r=new W.default(this.logger,\"Signaling\",[this.createOrReuseSignalingTask(),new D.default(t),new $.default(t),new O.default(t),new V.default(t),this.receiveIndexTask]).once(),s=new A.default(t).once(r),o=new T.default(t).once(s,n),a=new _.default(t).once(o),c=new H.default(t).once(a),d=new P.default(t).once(c),l=new K.default(t).once(d);return new W.default(this.logger,this.wrapTaskName(\"AudioVideoStart\"),[i,((e,t)=>new G.default(this.logger,t,e))(this.configuration.connectionTimeoutMs,new W.default(this.logger,\"Peer\",[l,e?new G.default(this.logger,new B.default(this.logger,\"FinalizeConnection\",[new J.default(t),new q.default(t)]),this.meetingSessionContext.meetingSessionConfiguration.attendeePresenceTimeoutMs):new q.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 Z.default(this.logger,this.meetingSessionContext.browserBehavior):this.meetingSessionContext.transceiverController=new X.default(this.logger,this.meetingSessionContext.browserBehavior)):(this.logger.info(\"Using default transceiver controller\"),this.meetingSessionContext.transceiverController=new Q.default(this.logger,this.meetingSessionContext.browserBehavior)):(this.logger.info(\"Using video only transceiver controller\"),this.meetingSessionContext.transceiverController=new Y.default(this.logger,this.meetingSessionContext.browserBehavior)),this.meetingSessionContext.volumeIndicatorAdapter=new ue.default(this.logger,this._realtimeController,pe.MIN_VOLUME_DECIBELS,pe.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 de.default(this.configuration.credentials.attendeeId,this.meetingSessionContext.logger),this.meetingSessionContext.videoUplinkBandwidthPolicy=e),e.addObserver(this),this.meetingSessionContext.videoDownlinkBandwidthPolicy||(this.meetingSessionContext.videoDownlinkBandwidthPolicy=new ne.default(this.meetingSessionContext.logger)),this.meetingSessionContext.videoStreamIndex=new oe.default(this.logger)}else this.meetingSessionContext.enableSimulcast=!1,this.meetingSessionContext.videoStreamIndex=new se.default(this.logger),this.meetingSessionContext.videoUplinkBandwidthPolicy||(this.meetingSessionContext.videoUplinkBandwidthPolicy=new le.default(this.configuration.credentials.attendeeId,!this.meetingSessionContext.browserBehavior.disableResolutionScaleDown(),this.meetingSessionContext.logger,this.meetingSessionContext.browserBehavior)),this.meetingSessionContext.videoDownlinkBandwidthPolicy||(this.meetingSessionContext.videoDownlinkBandwidthPolicy=new ie.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.lastKnownVideoAvailability=new h.default,this.meetingSessionContext.videoCaptureAndEncodeParameter=new te.default(0,0,0,0,!1),this.meetingSessionContext.videosToReceive=new re.default,this.meetingSessionContext.videosPaused=new re.default,this.meetingSessionContext.statsCollector=new I.default(this,this.logger),this.meetingSessionContext.connectionMonitor=new d.default(this,this._realtimeController,this.connectionHealthData,new m.default(this.meetingSessionContext.signalingClient,pe.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=>{ee.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 G.default(this.logger,new F.default(this.meetingSessionContext),this.configuration.connectionTimeoutMs).once()),this.signalingTask}actionFinishConnecting(){this.signalingTask=void 0,this.meetingSessionContext.videoDuplexMode=E.SdkStreamServiceType.RX,this.meetingSessionContext.enableSimulcast||(this.useUpdateTransceiverControllerForUplink?this.meetingSessionContext.videoUplinkBandwidthPolicy.updateTransceiverController():this.enforceBandwidthLimitationForSender(this.meetingSessionContext.videoCaptureAndEncodeParameter.encodeBitrates()[0])),this.forEachObserver((e=>{ee.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 W.default(this.logger,this.wrapTaskName(\"AudioVideoStop\"),[new G.default(this.logger,new R.default(this.meetingSessionContext),this.configuration.connectionTimeoutMs)]).run()}catch(e){this.logger.info(\"fail to stop\")}try{const e=[new G.default(this.logger,new x.default(this.meetingSessionContext),this.configuration.connectionTimeoutMs)];this.cleanUpMediaStreamsAfterStop(),yield new W.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.updateRemoteVideosFromLastVideosToReceive()),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}updateRemoteVideosFromLastVideosToReceive(){var e,t;const i=this.meetingSessionContext;if((null===(e=i.videosToReceive)||void 0===e?void 0:e.empty())||(null===(t=i.lastVideosToReceive)||void 0===t?void 0:t.empty()))return!1;if(!(i.transceiverController&&i.transceiverController.getMidForStreamId&&i.transceiverController.setStreamIdForMid&&i.videosToReceive.forEach&&i.signalingClient.remoteVideoUpdate&&i.videoStreamIndex.overrideStreamIdMappings))return!1;let n=[];const r=new Map;let s=[];if(null===i.lastVideosToReceive)n=i.videosToReceive.array();else{const e=i.videoStreamIndex;i.videosToReceive.forEach((t=>{if(i.lastVideosToReceive.contain(t))return;let s=!1;i.lastVideosToReceive.forEach((i=>{s||e.StreamIdsInSameGroup(i,t)&&(r.set(i,t),s=!0)})),s||n.push(t)})),s=i.lastVideosToReceive.array().filter((e=>{const t=i.videosToReceive.contain(e),n=r.has(e);return!t&&!n}))}this.logger.info(`Request to update remote videos with added: ${n}, updated: ${[...r.entries()]}, removed: ${s}`);const o=[];for(const[e,t]of r.entries()){const n=new k.default;if(n.streamId=t,n.attendeeId=i.videoStreamIndex.attendeeIdForStreamId(t),n.mid=i.transceiverController.getMidForStreamId(e),void 0===n.mid)return this.logger.info(`No MID found for stream ID ${e}, cannot update stream without renegotiation`),!1;if(o.push(n),i.transceiverController.setStreamIdForMid(n.mid,t),i.videoStreamIndex.overrideStreamIdMappings(e,t),i.videoTileController.haveVideoTileForAttendeeId(n.attendeeId)){const e=i.videoTileController.getVideoTileForAttendeeId(n.attendeeId);if(!e.setStreamId)return!1;e.setStreamId(t)}}return 0!==o.length&&i.signalingClient.remoteVideoUpdate(o,[]),0===n.length&&0===s.length&&(i.videoStreamIndex.subscribeFrameSent(),!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 W.default(this.logger,this.wrapTaskName(\"AudioVideoUpdate\"),[new j.default(this.meetingSessionContext),new G.default(this.logger,new W.default(this.logger,\"UpdateSession\",[new T.default(this.meetingSessionContext),new _.default(this.meetingSessionContext),new H.default(this.meetingSessionContext),new P.default(this.meetingSessionContext),new K.default(this.meetingSessionContext),new q.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=>{ee.Maybe.of(t.audioVideoDidStop).map((i=>i.bind(t)(e)))})),this.promotedToPrimaryMeeting&&t&&this.forEachObserver((e=>{this.promotedToPrimaryMeeting=!1,ee.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=>{ee.Maybe.of(e.audioVideoDidStartConnecting).map((t=>t.bind(e)(!0)))}))),this.meetingSessionContext.volumeIndicatorAdapter.onReconnect(),this.connectionHealthData.reset();try{yield new W.default(this.logger,this.wrapTaskName(\"AudioVideoReconnect\"),[new G.default(this.logger,new W.default(this.logger,\"Media\",[new M.default(this.meetingSessionContext),new W.default(this.logger,\"Signaling\",[new F.default(this.meetingSessionContext),new O.default(this.meetingSessionContext),new V.default(this.meetingSessionContext)]),new A.default(this.meetingSessionContext)]),this.configuration.connectionTimeoutMs),new j.default(this.meetingSessionContext),new G.default(this.logger,new W.default(this.logger,\"UpdateSession\",[new T.default(this.meetingSessionContext),new _.default(this.meetingSessionContext),new H.default(this.meetingSessionContext),new P.default(this.meetingSessionContext),new K.default(this.meetingSessionContext),new q.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=>{ee.Maybe.of(e.videoSendDidBecomeUnavailable).map((t=>t.bind(e)()))})),!1;if(e.statusCode()===u.default.AudioVideoWasRemovedFromPrimaryMeeting)return this.forEachObserver((t=>{ee.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=>{ee.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 W.default(this.logger,this.wrapTaskName(\"PromoteToPrimaryMeeting\"),[new G.default(this.logger,new L.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=>{ee.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=pe,pe.MIN_VOLUME_DECIBELS=-42,pe.MAX_VOLUME_DECIBELS=-14,pe.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 parseInt(this.version().split(\".\")[0])}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.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){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].streamId,r=n?this.videoStreamIndex.attendeeIdForStreamId(n):this.selfAttendeeId;e[r]=e[r]?e[r]:{},e[r][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}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]}}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.SDPMediaSection=t.SDPCandidateType=t.SDP=t.RunnableTask=t.ReconnectionHealthPolicy=t.ReceiveVideoStreamIndexTask=t.ReceiveVideoInputTask=t.ReceiveTURNCredentialsTask=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.VideoPriorityBasedPolicyConfig=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=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=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 M=i(6818);t.CheckVideoConnectivityFeedback=M.default;const x=i(1737);t.CheckVideoInputFeedback=x.default;const A=i(3216);t.CleanRestartedSessionTask=A.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(5482);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 Me=i(8128);t.DeviceSelection=Me.default;const xe=i(7700);t.EventBufferConfiguration=xe.default;const Ae=i(5680);t.EventIngestionConfiguration=Ae.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 Mt=i(3938);t.PrefetchSortBy=Mt.default;const xt=i(1515);t.PromiseQueue=xt.default;const At=i(9945);t.PromoteToPrimaryMeetingTask=At.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(5547);t.ReceiveTURNCredentialsTask=Dt.default;const Nt=i(120);t.ReceiveVideoInputTask=Nt.default;const Ft=i(9560);t.ReceiveVideoStreamIndexTask=Ft.default;const Bt=i(9708);t.ReconnectionHealthPolicy=Bt.default;const Lt=i(4191);t.RunnableTask=Lt.default;const Ut=i(326);t.SDP=Ut.default;const Vt=i(4076);t.SDPCandidateType=Vt.default;const jt=i(1944);t.SDPMediaSection=jt.default;const zt=i(9485);t.SendAndReceiveDataMessagesTask=zt.default;const $t=i(2977);t.SendingAudioFailureConnectionHealthPolicy=$t.default;const Wt=i(7079);t.SerialGroupTask=Wt.default;const Ht=i(7103);t.ServerSideNetworkAdaption=Ht.default;const qt=i(3860);t.SessionStateControllerAction=qt.default;const Kt=i(6850);t.SessionStateControllerDeferPriority=Kt.default;const Gt=i(9553);t.SessionStateControllerState=Gt.default;const Jt=i(3013);t.SessionStateControllerTransitionResult=Jt.default;const Qt=i(4833);t.SetLocalDescriptionTask=Qt.default;const Zt=i(5275);t.SetRemoteDescriptionTask=Zt.default;const Xt=i(8581);t.SignalingAndMetricsConnectionMonitor=Xt.default;const Yt=i(3920);t.SignalingClientConnectionRequest=Yt.default;const ei=i(2902);t.SignalingClientEvent=ei.default;const ti=i(9416);t.SignalingClientEventType=ti.default;const ii=i(2168);t.SignalingClientJoin=ii.default;const ni=i(6729);t.SignalingClientSubscribe=ni.default;const ri=i(9101);t.SignalingClientVideoSubscriptionConfiguration=ri.default;const si=i(7377);t.SimulcastContentShareTransceiverController=si.default;const oi=i(7606);t.SimulcastLayers=oi.default;const ai=i(5785);t.SimulcastTransceiverController=ai.default;const ci=i(4242);t.SimulcastVideoStreamIndex=ci.default;const di=i(7786);t.SingleNodeAudioTransformDevice=di.default;const li=i(2811);t.StreamMetricReport=li.default;const ui=i(5924);t.SubscribeAndReceiveSubscribeAckTask=ui.default;const hi=i(2721);t.TargetDisplaySize=hi.default;const pi=i(4456);t.TaskStatus=pi.default;const mi=i(4929);t.TimeoutScheduler=mi.default;const fi=i(250);t.TimeoutTask=fi.default;const gi=i(4739);t.Transcript=gi.default;const vi=i(2471);t.TranscriptAlternative=vi.default;const Si=i(7210);t.TranscriptEntity=Si.default;const bi=i(1741);t.TranscriptItem=bi.default;const yi=i(6864);t.TranscriptItemType=yi.default;const wi=i(9063);t.TranscriptLanguageWithScore=wi.default;const Ci=i(5323);t.TranscriptResult=Ci.default;const ki=i(1288);t.TranscriptionStatus=ki.default;const Ei=i(1326);t.TranscriptionStatusType=Ei.default;const Ii=i(6950);t.TypeError=Ii.default;const Ti=i(1922);t.UnusableAudioWarningConnectionHealthPolicy=Ti.default;const Mi=i(4046);t.Versioning=Mi.default;const xi=i(2880);t.VideoAdaptiveProbePolicy=xi.default;const Ai=i(2330);t.VideoCodecCapability=Ai.default;const _i=i(7746);t.VideoFxProcessor=_i.default;const Pi=i(155);t.VideoLogEvent=Pi.default;const Oi=i(9354);t.VideoOnlyTransceiverController=Oi.default;const Ri=i(1754);t.VideoPreference=Ri.default;const Di=i(1819);t.VideoPreferences=Di.default;const Ni=i(4992);t.VideoPriorityBasedPolicy=Ni.default;const Fi=i(1034);t.VideoPriorityBasedPolicyConfig=Fi.default;const Bi=i(4500);t.VideoQualitySettings=Bi.default;const Li=i(60);t.VideoSource=Li.default;const Ui=i(6876);t.VideoStreamDescription=Ui.default;const Vi=i(7804);t.VideoTileState=Vi.default;const ji=i(2497);t.VoiceFocusDeviceTransformer=ji.default;const zi=i(8878);t.VoiceFocusTransformDevice=zi.default;const $i=i(6171);t.WaitForAttendeePresenceTask=$i.default;const Wi=i(7387);t.WebSocketReadyState=Wi.default;const Hi=i(3320);t.ZLIBTextCompressor=Hi.default;const qi=i(1819);Object.defineProperty(t,\"MutableVideoPreferences\",{enumerable:!0,get:function(){return qi.MutableVideoPreferences}});const Ki=i(8660);Object.defineProperty(t,\"Some\",{enumerable:!0,get:function(){return Ki.Some}}),Object.defineProperty(t,\"None\",{enumerable:!0,get:function(){return Ki.None}}),Object.defineProperty(t,\"Maybe\",{enumerable:!0,get:function(){return Ki.Maybe}});const Gi=i(1746);Object.defineProperty(t,\"isAudioTransformDevice\",{enumerable:!0,get:function(){return Gi.isAudioTransformDevice}});const Ji=i(146);Object.defineProperty(t,\"isDestroyable\",{enumerable:!0,get:function(){return Ji.isDestroyable}});const Qi=i(7170);Object.defineProperty(t,\"isVideoTransformDevice\",{enumerable:!0,get:function(){return Qi.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(6674),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.convertVideoSubscriptionConfiguration));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.convertVideoSubscriptionConfiguration),i.removedVideoSubscriptionMids=t;const n=s.SdkSignalFrame.create();n.type=s.SdkSignalFrame.Type.REMOTE_VIDEO_UPDATE,n.remoteVideoUpdate=i,this.sendMessage(n)}convertVideoSubscriptionConfiguration(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.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\"}(r=t.ServerSideNetworkAdaption||(t.ServerSideNetworkAdaption={})),t.default=r,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}},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}}},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{}},289:(e,t,i)=>{\"use strict\";var n,r,s=i(2100),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}(),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}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:}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}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==1?(n.bitrates&&n.bitrates.length||(n.bitrates=[]),n.bitrates.push(d.SdkBitrate.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.bitrates&&e.hasOwnProperty(\"bitrates\")){if(!Array.isArray(e.bitrates))return\"bitrates: array expected\";for(var t=0;t>>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))),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)}}))}}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},5482: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(2770),a=i(9708),c=i(2977),d=i(1922),l=i(3789),u=i(5687),h=i(9416),p=i(289),m=i(9880),f=i(8660),g=i(1789);class v extends g.default{constructor(e,t,i){super(e.logger),this.context=e,this.initialConnectionHealthData=i,this.taskName=\"MonitorTask\",this.prevSignalStrength=1,this.currentVideoDownlinkBandwidthEstimationKbps=1e4,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:m.default.RedmicStartLoss:i?m.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 l.default(u.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 a.default(e.logger,Object.assign({},t),this.initialConnectionHealthData.clone()),this.unusableAudioWarningHealthPolicy=new d.default(Object.assign({},t),this.initialConnectionHealthData.clone()),this.sendingAudioFailureHealthPolicy=new c.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();if(!t)return!1;const 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){const t=e;if(!t)return;if(this.checkResubscribe(e)&&this.context.audioVideoController.update({needsRenegotiation:!1}),!this.currentAvailableStreamAvgBitrates)return;const i=t.streamMetricReports;if(!i)return;const n=e.getObservableMetrics();this.currentVideoDownlinkBandwidthEstimationKbps=n.availableIncomingBitrate;const a=new Map,c=new Map;for(const e in i)i[e].mediaType===s.default.VIDEO&&i[e].direction===r.default.DOWNSTREAM&&a.set(i[e].streamId,i[e]);let d=!1;for(const e of this.currentAvailableStreamAvgBitrates.bitrates)if(a.has(e.sourceStreamId)){const t=a.get(e.sourceStreamId),i=this.context.videoStreamIndex.attendeeIdForStreamId(e.sourceStreamId);if(!i)continue;const n=new o.default,r=t.previousMetrics.bytesReceived,s=t.currentMetrics.bytesReceived;if(!r||!s)continue;const l=8*(s-r)/1e3;n.expectedAverageBitrateKbps=e.avgBitrateBps/1e3,n.receivedAverageBitrateKbps=l,n.attendeeId=i,l{this.context.audioVideoController.handleMeetingSessionStatus(new l.default(u.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=>{f.Maybe.of(e.connectionDidSuggestStopVideo).map((t=>t.bind(e)()))})):this.context.audioVideoController.forEachObserver((e=>{f.Maybe.of(e.connectionDidBecomePoor).map((t=>t.bind(e)()))}))}),(()=>{this.context.audioVideoController.forEachObserver((e=>{f.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()?f.Maybe.of(i).map((e=>e.bind(this)())):f.Maybe.of(n).map((e=>e.bind(this)())))}handleBitrateFrame(e){let t=0;this.currentAvailableStreamAvgBitrates=e,this.logger.debug((()=>`simulcast: bitrates from server ${JSON.stringify(e)}`));for(const i of e.bitrates)this.context.videosToReceive.contain(i.sourceStreamId)&&(t+=i.avgBitrateBps);t/=1e3,this.currentVideoDownlinkBandwidthEstimationKbps*v.DEFAULT_DOWNLINK_CALLRATE_OVERSHOOT_FACTOR=4500&&e.closeCode<4600)||e.type===h.default.WebSocketError||e.type===h.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===h.default.WebSocketOpen&&(this.hasSignalingError=!1);if(e.type===h.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=l.default.fromSignalFrame(e.message);e.message.type!==p.SdkSignalFrame.Type.PRIMARY_MEETING_JOIN_ACK&&t.statusCode()!==u.default.OK&&this.context.audioVideoController.handleMeetingSessionStatus(t,null)}}}t.default=v,v.DEFAULT_DOWNLINK_CALLRATE_OVERSHOOT_FACTOR=2,v.DEFAULT_DOWNLINK_CALLRATE_UNDERSHOOT_FACTOR=.2},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},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(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(9101),h=i(289),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===h.SdkStreamServiceType.TX||this.context.videoDuplexMode===h.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&&this.context.videoDownlinkBandwidthPolicy.getServerSideNetworkAdaption()!==c.default.None&&void 0!==this.context.videoDownlinkBandwidthPolicy.getVideoPreferences&&(s.videoSubscriptionConfiguration=this.convertVideoPreferencesToVideoSubscriptionConfiguration(t,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}convertVideoPreferencesToVideoSubscriptionConfiguration(e,t){if(void 0===this.context.transceiverController.getMidForStreamId||void 0===t)return[];const i=new Array,n=new Map,r=new Map;for(const t of e){const e=this.context.transceiverController.getMidForStreamId(t);if(void 0===e){0!==t&&this.context.logger.warn(`Could not find MID for stream ID: ${t}`);continue}const i=this.context.videoStreamIndex.attendeeIdForStreamId(t);n.set(i,e),r.set(i,this.context.videoStreamIndex.groupIdForStreamId(t))}for(const e of t){const t=new u.default,s=n.get(e.attendeeId);void 0!==s?(t.mid=s,t.attendeeId=e.attendeeId,t.groupId=r.get(e.attendeeId),t.priority=Number.MAX_SAFE_INTEGER-e.priority,t.targetBitrateKbps=e.targetSizeToBitrateKbps(e.targetSize),i.push(t)):this.context.logger.warn(`Could not find MID for attendee ID: ${e.attendeeId}`)}return i}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!==h.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}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 t=this.peer.addTransceiver(\"video\",{direction:\"recvonly\",streams:[new MediaStream]});this.streamIdToTransceiver.set(e,t),this.videoSubscriptions.push(e),this.logger.info(`adding transceiver mid: ${t.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,t]of this.streamIdToTransceiver.entries())r.mid===t.mid&&this.streamIdToTransceiver.delete(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 t of e)if(t!==this._localCameraTransceiver&&this.transceiverIsVideo(t)){if(\"inactive\"===t.direction&&i.length>0){t.direction=\"recvonly\";const e=i.shift();this.videoSubscriptions[n]=e,this.streamIdToTransceiver.set(e,t)}else if(0===this.videoSubscriptions[n]){t.direction=\"inactive\";for(const[e,i]of this.streamIdToTransceiver.entries())t===i&&this.streamIdToTransceiver.delete(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)}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:\"ae511bf\",raw:\"v3.14.0\",semverString:\"3.14.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\"}(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.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=1200},1819:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.VideoPreferences=t.MutableVideoPreferences=void 0;class i{constructor(e=[]){this.items=e}static default(){return new i([])}[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 i([...this.items])}sort(){this.items.sort(((e,t)=>e.partialCompare(t)))}modify(){return new n(this)}}class n{constructor(e=new i){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 r{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 s(this.builder.build())}}t.MutableVideoPreferences=r;class s{constructor(e){this.items=e}static prepare(){return new r(new n)}static default(){return new s(i.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 r(this.items.modify())}some(e){return this.items.some(e)}isEmpty(){return this.items.isEmpty()}clone(){const e=s.prepare();for(const t of this.items)e.add(t.clone());return e.build()}}t.VideoPreferences=s,t.default=s},4992:(e,t,i)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const n=i(6196),r=i(9496),s=i(8890),o=i(813),a=i(7103),c=i(1508),d=i(2721),l=i(1754),u=i(1819),h=i(1034);class p{constructor(){this.bandwidthEstimateKbps=0,this.usedBandwidthKbps=0,this.packetsLost=0,this.nackCount=0,this.rttMs=0}}class m{constructor(e,t=h.default.Default){this.logger=e,this.videoPriorityBasedPolicyConfig=t,this.shouldPauseTiles=!0,this.observerQueue=new Set,this.pausedBwAttendeeIds=new Set,this.reset()}reset(){this.optimalReceiveSet=new c.default,this.optimalReceiveStreams=[],this.optimalNonPausedReceiveStreams=[],this.subscribedReceiveSet=new c.default,this.subscribedReceiveStreams=[],this.videoPreferences=void 0,this.defaultVideoPreferences=void 0,this.shouldPauseTiles=!0,this.pausedStreamIds=new c.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=m.MIN_TIME_BETWEEN_SUBSCRIBE_MS,this.lastProbeTimestamp=Date.now(),this.timeBeforeAllowProbeMs=m.MIN_TIME_BETWEEN_PROBE_MS,this.downlinkStats=new p,this.prevDownlinkStats=new p,this.probeFailed=!1,this.serverSideNetworkAdaption=this.videoPriorityBasedPolicyConfig.serverSideNetworkAdaption}bindToTileController(e){this.tileController=e,this.logger.info(\"tileController bound\")}chooseRemoteVideoSources(e){var t;(null===(t=this.videoPreferences)||void 0===t?void 0:t.equals(e))||(this.videoPreferences=null==e?void 0:e.clone(),this.videoPreferencesUpdated=!0,this.logger.info(`bwe: setVideoPreferences bwe: new preferences: ${JSON.stringify(e)}`))}updateIndex(e){this.videoIndex=e,this.videoPreferences||this.updateDefaultVideoPreferences()}updateDefaultVideoPreferences(){const e=new Set;for(const t of this.videoIndex.remoteStreamDescriptions())e.add(t.attendeeId);const t=u.VideoPreferences.prepare(),i=e.size;let n=d.default.High;i>8?n=d.default.Low:i>4&&(n=d.default.Medium);for(const i of e)t.add(new l.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 p;const t=e.getObservableMetrics();this.downlinkStats.bandwidthEstimateKbps=t.availableIncomingBitrate/1e3;for(const t in e.streamMetricReports){const i=Number.parseInt(t,10),s=e.streamMetricReports[i];s.direction===n.default.DOWNSTREAM&&s.mediaType===r.default.VIDEO&&(s.currentMetrics.hasOwnProperty(\"nackCount\")&&(this.downlinkStats.nackCount+=e.countPerSecond(\"nackCount\",i)),s.currentMetrics.hasOwnProperty(\"packetsLost\")&&(this.downlinkStats.packetsLost+=e.countPerSecond(\"packetsLost\",i)),s.currentMetrics.hasOwnProperty(\"bytesReceived\")&&(this.downlinkStats.usedBandwidthKbps+=e.bitsPerSecond(\"bytesReceived\",i)/1e3))}}wantsResubscribe(){return this.calculateOptimalReceiveSet(),!this.subscribedReceiveSet.equal(this.optimalReceiveSet)}chooseSubscriptions(){return this.subscribedReceiveSet.equal(this.optimalReceiveSet)||(this.lastSubscribeTimestamp=Date.now()),this.subscribedReceiveSet=this.optimalReceiveSet.clone(),this.subscribedReceiveStreams=this.optimalReceiveStreams.slice(),this.subscribedReceiveSet.clone()}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),c=!this.startupPeriod&&r;if(c&&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(s.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=m.MIN_TIME_BETWEEN_SUBSCRIBE_MS,c&&h))return;const p=this.priorityPolicy(d,i,t);let f=0;if(this.serverSideNetworkAdaption!==a.default.None&&this.serverSideNetworkAdaption!==a.default.Default||this.startupPeriod||!r?(this.setProbeState(\"Not Probing\"),this.lastUpgradeRateKbps=0):\"Probing\"===this.rateProbeState?f=this.handleProbe(t,d.targetDownlinkBitrate):0!==d.deltaToNextUpgrade&&(f=this.maybeOverrideOrProbe(t,d,p)),this.prevRemoteInfos=i,this.videoPreferencesUpdated=!1,1===f)return this.logger.info(`bwe: keepSameSubscriptions stats:${JSON.stringify(this.downlinkStats)}`),void(this.prevTargetRateKbps=d.targetDownlinkBitrate);if(2===f){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 g=this.pausedBwAttendeeIds.size;this.processBwPausedStreams(i,t),this.logger.getLogLevel()<=o.LogLevel.INFO&&(this.logCount%15==0||this.rateProbeState!==n||this.optimalReceiveStreams.length!==t.length||g!==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 c.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>m.DEFAULT_BANDWIDTH_KBPS||this.downlinkStats.packetsLost>0||t-this.firstEstimateTimestamp>m.STARTUP_PERIOD_MS&&this.downlinkStats.bandwidthEstimateKbps<=this.prevDownlinkStats.bandwidthEstimateKbps)&&(this.startupPeriod=!1,this.prevTargetRateKbps=this.downlinkStats.bandwidthEstimateKbps),this.startupPeriod?e=m.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>m.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,m.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;im.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>m.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(m.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=m.MIN_TIME_BETWEEN_PROBE_MS,0):1}maybeOverrideOrProbe(e,t,i){const n=this.chosenStreamsSameAsLast(e);let r=0;const s=t.targetDownlinkBitrate>m.LOW_BITRATE_THRESHOLD_KBPS?m.TARGET_RATE_CHANGE_TRIGGER_PERCENT:2*m.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 c.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(),o=r.highestPriority();let a,c=o;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 o of r)if(o.priority===c){for(const r of t)if(r.attendeeId===o.attendeeId){const a=i.findIndex((e=>e.groupId===r.groupId&&e.maxBitrateKbpsc)break;if(c===o&&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===d.default.High||t===d.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[a.default.None,a.default.BandwidthProbing]}getVideoPreferences(){let e=this.getCurrentVideoPreferences();return e||(e=u.VideoPreferences.prepare().build()),e}}t.default=m,m.DEFAULT_BANDWIDTH_KBPS=2800,m.STARTUP_PERIOD_MS=6e3,m.LARGE_RATE_CHANGE_TRIGGER_PERCENT=20,m.TARGET_RATE_CHANGE_TRIGGER_PERCENT=15,m.LOW_BITRATE_THRESHOLD_KBPS=300,m.MIN_TIME_BETWEEN_PROBE_MS=5e3,m.MIN_TIME_BETWEEN_SUBSCRIBE_MS=2e3,m.MAX_HOLD_BEFORE_PROBE_MS=3e4,m.MAX_ALLOWED_PROBE_TIME_MS=6e4,m.SPURIOUS_PACKET_LOST_THRESHOLD=2,m.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.streamToAttendeeMap=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){this.currentIndex=e;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.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.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 ${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}}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}buildStreamToAttendeeMap(e){const t=new Map;if(e)for(const i of e.sources)t.set(i.streamId,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=0,this.idealMaxBandwidthKbps=1400,this.hasBandwidthPriority=!1,this.encodingParamMap=new Map,this.reset()}reset(){this.numberOfPublishedVideoSources=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),M=yield r.measureAndDecideExecutionApproach(k,T,o,C);if(!1===M.supported)return{supported:!1,reason:M.reason};null==o||o.info(\"Decided execution approach\",M);const{useSIMD:x,processor:A,variant:_,executionQuanta:P}=M,O={category:a||\"voicefocus\",name:c||\"default\",variant:_,simd:x};if(n){const e=w(O,b);O.url=yield s.resolveURL(e,I)}return{fetchConfig:T,model:O,processor:A,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},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 x(this,t,i);case\"latin1\":case\"binary\":return A(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<=M)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 M=4096;function x(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 M(e){return e&&e.__local_forage_encoded_blob}function x(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 A(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(6351),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:M,Z_DEFLATED:x}=i(1619),A=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+A;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=x,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=M;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!==x||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,x,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=x+(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<=A){if(H(e),e.lookahead<=A&&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+A;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 M=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=M.dmax,d=M.wsize,l=M.whave,u=M.wnext,h=M.window,p=M.hold,m=M.bits,f=M.lencode,g=M.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\",M.mode=t;break e}if(p>>>=y,m-=y,y=s-o,C>y){if(y=C-y,y>l&&M.sane){e.msg=\"invalid distance too far back\",M.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,M=16210,x=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function A(){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 A;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,A,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,A=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+=A[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+=A[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+=A[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+=A[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(A.subarray(O,O+z),Z)),512&i.flags&&4&i.wrap&&(i.check=r(i.check,A,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=A[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+=A[O++]<>>=7&B,B-=7&B,i.mode=I;break}for(;B<3;){if(0===D)break e;D--,F+=A[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+=A[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(A.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+=A[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+=A[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,A=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+=A[O++]<>G)],H=Y>>>24,q=Y>>>16&255,K=65535&Y,!(G+H<=B);){if(0===D)break e;D--,F+=A[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+=A[O++]<>G)],H=Y>>>24,q=Y>>>16&255,K=65535&Y,!(G+H<=B);){if(0===D)break e;D--,F+=A[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|=A[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=M,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,M=0,x=0,A=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&&M>592)return 1;for(;;){O=b-I,l[y]+1=S?(R=N[l[y]-S],D=A[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?(x&=p-1,x+=p):x=0,y++,0==--_[b]){if(b===C)break;b=s[o+l[y]]}if(b>k&&(x&g)!==f){for(0===I&&(I=k),v+=w,E=b-I,T=1<852||2===e&&M>592)return 1;f=x&g,c[f]=k<<24|E<<16|v-d|0}}return 0!==x&&(c[v+x]=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)},A=(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)),x(e,e.l_desc),x(e,e.d_desc),d=(e=>{let t;for(A(e,e.dyn_ltree,e.l_desc.max_code),A(e,e.dyn_dtree,e.d_desc.max_code),x(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),M(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}},2100:(e,t,i)=>{\"use strict\";e.exports=i(9482)},9482:(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(1173),n.BufferWriter=i(3155),n.Reader=i(1408),n.BufferReader=i(593),n.util=i(9693),n.rpc=i(5994),n.roots=i(5054),n.configure=r,r()},1408:(e,t,i)=>{\"use strict\";e.exports=c;var n,r=i(9693),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)}})}},593:(e,t,i)=>{\"use strict\";e.exports=s;var n=i(1408);(s.prototype=Object.create(n.prototype)).constructor=s;var r=i(9693);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()},5054:e=>{\"use strict\";e.exports={}},5994:(e,t,i)=>{\"use strict\";t.Service=i(7948)},7948:(e,t,i)=>{\"use strict\";e.exports=r;var n=i(9693);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}},1945:(e,t,i)=>{\"use strict\";e.exports=r;var n=i(9693);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}},9693: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(9693),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()}},3155:(e,t,i)=>{\"use strict\";e.exports=s;var n=i(1173);(s.prototype=Object.create(n.prototype)).constructor=s;var r=i(9693);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()},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\",M=\"Browser\",x=\"Chrome\",A=\"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_1076797__(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_1076797__),i.exports}__nested_webpack_require_1076797__.amdO={},__nested_webpack_require_1076797__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __nested_webpack_require_1076797__.d(t,{a:t}),t},__nested_webpack_require_1076797__.d=(e,t)=>{for(var i in t)__nested_webpack_require_1076797__.o(t,i)&&!__nested_webpack_require_1076797__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__nested_webpack_require_1076797__.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_1076797__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__nested_webpack_require_1076797__.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_1076797__.r(__nested_webpack_exports__),__nested_webpack_require_1076797__.d(__nested_webpack_exports__,{ClientType:()=>t,CrossFadeOverlapSize:()=>r,DefaultServerSetting:()=>u,DefaultServerSetting_DDSP_SVC:()=>v,DefaultServerSetting_MMVCv13:()=>p,DefaultServerSetting_MMVCv15:()=>h,DefaultServerSetting_RVC:()=>S,DefaultServerSetting_so_vits_svc_40:()=>m,DefaultServerSetting_so_vits_svc_40_c:()=>f,DefaultServerSetting_so_vits_svc_40v2:()=>g,DefaultVoiceChangerClientSetting:()=>A,DefaultWorkletNodeSetting:()=>k,DefaultWorkletNodeSetting_DDSP_SVC:()=>T,DefaultWorkletNodeSetting_RVC:()=>M,DefaultWorkletNodeSetting_so_vits_svc_40:()=>E,DefaultWorkletNodeSetting_so_vits_svc_40v2:()=>I,DefaultWorkletSetting:()=>b,DiffMethod:()=>c,DownSamplingMode:()=>C,F0Detector:()=>a,Framework:()=>o,INDEXEDDB_DB_APP_NAME:()=>P,INDEXEDDB_DB_NAME:()=>O,INDEXEDDB_KEY_CLIENT:()=>R,INDEXEDDB_KEY_MODEL_DATA:()=>F,INDEXEDDB_KEY_SERVER:()=>D,INDEXEDDB_KEY_WORKLET:()=>B,INDEXEDDB_KEY_WORKLETNODE:()=>N,InputSampleRate:()=>i,MAX_MODEL_SLOT_NUM:()=>L,ModelSamplingRate:()=>n,ModelType:()=>d,OnnxExecutionProvider:()=>s,Protocol:()=>y,SampleRate:()=>x,SendingSampleRate:()=>w,ServerSettingKey:()=>l,VOICE_CHANGER_CLIENT_EXCEPTION:()=>_,VoiceChangerClient:()=>dt,createDummyMediaStream:()=>nt,fileSelector:()=>rt,fileSelectorAsDataURL:()=>st,getLicenceInfo:()=>vt,useClient:()=>gt,useIndexedDB:()=>pt,validateUrl:()=>ot});var e={};__nested_webpack_require_1076797__.r(e),__nested_webpack_require_1076797__.d(e,{Decoder:()=>We,Encoder:()=>$e,PacketType:()=>ze,protocol:()=>je});const t={MMVCv15:\"MMVCv15\",MMVCv13:\"MMVCv13\",\"so-vits-svc-40\":\"so-vits-svc-40\",\"so-vits-svc-40_c\":\"so-vits-svc-40_c\",\"so-vits-svc-40v2\":\"so-vits-svc-40v2\",\"DDSP-SVC\":\"DDSP-SVC\",RVC:\"RVC\"},i={48e3:48e3,44100:44100,24e3:24e3},n={48e3:48e3,4e4:4e4,32e3:32e3},r={1024:1024,2048:2048,4096:4096},s={CPUExecutionProvider:\"CPUExecutionProvider\",CUDAExecutionProvider:\"CUDAExecutionProvider\",DmlExecutionProvider:\"DmlExecutionProvider\",OpenVINOExecutionProvider:\"OpenVINOExecutionProvider\"},o={PyTorch:\"PyTorch\",ONNX:\"ONNX\"},a={dio:\"dio\",harvest:\"harvest\",crepe:\"crepe\"},c={pndm:\"pndm\",\"dpm-solver\":\"dpm-solver\"},d={pyTorchRVC:\"pyTorchRVC\",pyTorchRVCNono:\"pyTorchRVCNono\",pyTorchRVCv2:\"pyTorchRVCv2\",pyTorchRVCv2Nono:\"pyTorchRVCv2Nono\",pyTorchWebUI:\"pyTorchWebUI\",pyTorchWebUINono:\"pyTorchWebUINono\",onnxRVC:\"onnxRVC\",onnxRVCNono:\"onnxRVCNono\"},l={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\",serverInputAudioSampleRate:\"serverInputAudioSampleRate\",serverOutputAudioSampleRate:\"serverOutputAudioSampleRate\",serverInputAudioBufferSize:\"serverInputAudioBufferSize\",serverOutputAudioBufferSize:\"serverOutputAudioBufferSize\",serverInputDeviceId:\"serverInputDeviceId\",serverOutputDeviceId:\"serverOutputDeviceId\",serverReadChunkSize:\"serverReadChunkSize\",tran:\"tran\",noiseScale:\"noiseScale\",predictF0:\"predictF0\",silentThreshold:\"silentThreshold\",extraConvertSize:\"extraConvertSize\",clusterInferRatio:\"clusterInferRatio\",indexRatio:\"indexRatio\",rvcQuality:\"rvcQuality\",modelSamplingRate:\"modelSamplingRate\",silenceFront:\"silenceFront\",modelSlotIndex:\"modelSlotIndex\",useEnhancer:\"useEnhancer\",useDiff:\"useDiff\",diffMethod:\"diffMethod\",useDiffSilence:\"useDiffSilence\",diffAcc:\"diffAcc\",diffSpkId:\"diffSpkId\",kStep:\"kStep\",threshold:\"threshold\",inputSampleRate:\"inputSampleRate\",enableDirectML:\"enableDirectML\"},u={inputSampleRate:48e3,crossFadeOffsetRate:0,crossFadeEndRate:1,crossFadeOverlapSize:r[1024],recordIO:0,enableServerAudio:0,serverAudioStated:0,serverInputAudioSampleRate:48e3,serverOutputAudioSampleRate:48e3,serverInputAudioBufferSize:24576,serverOutputAudioBufferSize:24576,serverInputDeviceId:-1,serverOutputDeviceId:-1,serverReadChunkSize:256,srcId:0,dstId:1,gpu:0,framework:o.PyTorch,f0Factor:1,onnxExecutionProvider:s.CPUExecutionProvider,f0Detector:a.dio,tran:0,noiseScale:0,predictF0:0,silentThreshold:0,extraConvertSize:0,clusterInferRatio:0,indexRatio:0,rvcQuality:0,modelSamplingRate:48e3,silenceFront:1,modelSlotIndex:0,sampleModels:[],useEnhancer:0,useDiff:1,diffMethod:\"dpm-solver\",useDiffSilence:0,diffAcc:20,diffSpkId:1,kStep:120,threshold:-45,enableDirectML:0,status:\"ok\",configFile:\"\",pyTorchModelFile:\"\",onnxModelFile:\"\",onnxExecutionProviders:[],modelSlots:[],serverAudioInputDevices:[],serverAudioOutputDevices:[]},h={...u,dstId:101},p={...u,srcId:107,dstId:100},m={...u,tran:10,noiseScale:.3,extraConvertSize:32768,clusterInferRatio:.1},f={...u,tran:10,noiseScale:.3,extraConvertSize:32768,clusterInferRatio:.1},g={...u,tran:10,noiseScale:.3,extraConvertSize:32768,clusterInferRatio:.1},v={...u,dstId:1,tran:10,extraConvertSize:32768},S={...u,tran:10,extraConvertSize:32768,f0Detector:a.harvest},b={numTrancateTreshold:100,volTrancateThreshold:5e-4,volTrancateLength:32},y={sio:\"sio\",rest:\"rest\"},w={48e3:48e3,44100:44100,24e3:24e3},C={decimate:\"decimate\",average:\"average\"},k={serverUrl:\"\",protocol:\"sio\",sendingSampleRate:48e3,inputChunkNum:48,downSamplingMode:\"average\"},E={...k,inputChunkNum:128},I={...k,inputChunkNum:128},T={...k,inputChunkNum:256},M={...k,inputChunkNum:256},x={48e3:48e3},A={audioInput:null,sampleRate:48e3,speakers:[{id:0,name:\"user\"},{id:101,name:\"ずんだもん\"},{id:102,name:\"そら\"},{id:103,name:\"めたん\"},{id:104,name:\"つむぎ\"}],correspondences:[],echoCancel:!1,noiseSuppression:!1,noiseSuppression2:!1,inputGain:1,outputGain:1},_={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\"},P=\"INDEXEDDB_KEY_VOICE_CHANGER\",O=\"INDEXEDDB_KEY_VOICE_CHANGER_DB\",R=\"INDEXEDDB_KEY_VOICE_CHANGER_LIB_CLIENT\",D=\"INDEXEDDB_KEY_VOICE_CHANGER_LIB_SERVER\",N=\"INDEXEDDB_KEY_VOICE_CHANGER_LIB_WORKLETNODE\",F=\"INDEXEDDB_KEY_VOICE_CHANGER_LIB_MODEL_DATA\",B=\"INDEXEDDB_KEY_VOICE_CHANGER_LIB_WORKLET\",L=4,U=Object.create(null);U.open=\"0\",U.close=\"1\",U.ping=\"2\",U.pong=\"3\",U.message=\"4\",U.upgrade=\"5\",U.noop=\"6\";const V=Object.create(null);Object.keys(U).forEach((e=>{V[U[e]]=e}));const j={type:\"error\",data:\"parser error\"},z=\"function\"==typeof Blob||\"undefined\"!=typeof Blob&&\"[object BlobConstructor]\"===Object.prototype.toString.call(Blob),$=\"function\"==typeof ArrayBuffer,W=(e,t)=>{const i=new FileReader;return i.onload=function(){const e=i.result.split(\",\")[1];t(\"b\"+(e||\"\"))},i.readAsDataURL(e)},H=({type:e,data:t},i,n)=>{return z&&t instanceof Blob?i?n(t):W(t,n):$&&(t instanceof ArrayBuffer||(r=t,\"function\"==typeof ArrayBuffer.isView?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer))?i?n(t):W(new Blob([t]),n):n(U[e]+(t||\"\"));var r},q=\"undefined\"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)q[\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".charCodeAt(e)]=e;const K=\"function\"==typeof ArrayBuffer,G=(e,t)=>{if(K){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 J(i,t)}return{base64:!0,data:e}},J=(e,t)=>\"blob\"===t&&e instanceof ArrayBuffer?new Blob([e]):e,Q=(e,t)=>{if(\"string\"!=typeof e)return{type:\"message\",data:J(e,t)};const i=e.charAt(0);return\"b\"===i?{type:\"message\",data:G(e.substring(1),t)}:V[i]?e.length>1?{type:V[i],data:e.substring(1)}:{type:V[i]}:j},Z=String.fromCharCode(30);function X(e){if(e)return function(e){for(var t in X.prototype)e[t]=X.prototype[t];return e}(e)}X.prototype.on=X.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[\"$\"+e]=this._callbacks[\"$\"+e]||[]).push(t),this},X.prototype.once=function(e,t){function i(){this.off(e,i),t.apply(this,arguments)}return i.fn=t,this.on(e,i),this},X.prototype.off=X.prototype.removeListener=X.prototype.removeAllListeners=X.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 te=Y.setTimeout,ie=Y.clearTimeout;function ne(e,t){t.useNativeTimers?(e.setTimeoutFn=te.bind(Y),e.clearTimeoutFn=ie.bind(Y)):(e.setTimeoutFn=Y.setTimeout.bind(Y),e.clearTimeoutFn=Y.clearTimeout.bind(Y))}class re extends Error{constructor(e,t,i){super(e),this.description=t,this.context=i,this.type=\"TransportError\"}}class se extends X{constructor(e){super(),this.writable=!1,ne(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,i){return super.emitReserved(\"error\",new re(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=Q(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved(\"packet\",e)}onClose(e){this.readyState=\"closed\",super.emitReserved(\"close\",e)}pause(e){}}const oe=\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\".split(\"\"),ae=64,ce={};let de,le=0,ue=0;function he(e){let t=\"\";do{t=oe[e%ae]+t,e=Math.floor(e/ae)}while(e>0);return t}function pe(){const e=he(+new Date);return e!==de?(le=0,de=e):e+\".\"+he(le++)}for(;ue{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError(\"number\"==typeof t.status?t.status:0)}),0))},t.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}\"undefined\"!=typeof document&&(this.index=ye.requestsCount++,ye.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 ye.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 we(){for(let e in ye.requests)ye.requests.hasOwnProperty(e)&&ye.requests[e].abort()}ye.requestsCount=0,ye.requests={},\"undefined\"!=typeof document&&(\"function\"==typeof attachEvent?attachEvent(\"onunload\",we):\"function\"==typeof addEventListener&&addEventListener(\"onpagehide\"in Y?\"pagehide\":\"unload\",we,!1));const Ce=\"function\"==typeof Promise&&\"function\"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),ke=Y.WebSocket||Y.MozWebSocket;__nested_webpack_require_1076797__(8764).lW;const Ee=\"undefined\"!=typeof navigator&&\"string\"==typeof navigator.product&&\"reactnative\"===navigator.product.toLowerCase(),Ie={websocket:class extends se{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=Ee?{}:ee(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=Ee?new ke(e,t,i):t?new ke(e,t):new ke(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&&Ce((()=>{this.writable=!0,this.emitReserved(\"drain\")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?\"wss\":\"ws\";let i=\"\";this.opts.port&&(\"wss\"===t&&443!==Number(this.opts.port)||\"ws\"===t&&80!==Number(this.opts.port))&&(i=\":\"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=pe()),this.supportsBinary||(e.b64=1);const n=me(e);return t+\"://\"+(-1!==this.opts.hostname.indexOf(\":\")?\"[\"+this.opts.hostname+\"]\":this.opts.hostname)+i+this.opts.path+(n.length?\"?\"+n:\"\")}check(){return!!ke}},polling:class extends se{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,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=be&&!t}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(Z),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)=>{H(e,!1,(e=>{n[s]=e,++r===i&&t(n.join(Z))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved(\"drain\")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?\"https\":\"http\";let i=\"\";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=pe()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&(\"https\"===t&&443!==Number(this.opts.port)||\"http\"===t&&80!==Number(this.opts.port))&&(i=\":\"+this.opts.port);const n=me(e);return t+\"://\"+(-1!==this.opts.hostname.indexOf(\":\")?\"[\"+this.opts.hostname+\"]\":this.opts.hostname)+i+this.opts.path+(n.length?\"?\"+n:\"\")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new ye(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}}},Te=/^(?:(?![^:@\\/?#]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@\\/?#]*)(?::([^:@\\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/,Me=[\"source\",\"protocol\",\"authority\",\"userInfo\",\"user\",\"password\",\"host\",\"port\",\"relative\",\"path\",\"directory\",\"file\",\"query\",\"anchor\"];function xe(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=Te.exec(e||\"\"),s={},o=14;for(;o--;)s[Me[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 Ae extends X{constructor(e,t={}){super(),this.writeBuffer=[],e&&\"object\"==typeof e&&(t=e,e=null),e?(e=xe(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=xe(t.host).host),ne(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\"],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:!0},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.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new Ie[e](i)}open(){let e;if(this.opts.rememberUpgrade&&Ae.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;Ae.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;Ae.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),t.open()}onOpen(){if(this.readyState=\"open\",Ae.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){Ae.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,Oe=Object.prototype.toString,Re=\"function\"==typeof Blob||\"undefined\"!=typeof Blob&&\"[object BlobConstructor]\"===Oe.call(Blob),De=\"function\"==typeof File||\"undefined\"!=typeof File&&\"[object FileConstructor]\"===Oe.call(File);function Ne(e){return _e&&(e instanceof ArrayBuffer||Pe(e))||Re&&e instanceof Blob||De&&e instanceof File}function Fe(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:ze.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 ze.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 ze.EVENT:case ze.BINARY_EVENT:this.onevent(e);break;case ze.ACK:case ze.BINARY_ACK:this.onack(e);break;case ze.DISCONNECT:this.ondisconnect();break;case ze.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:ze.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:ze.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}Je.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)},Je.prototype.reset=function(){this.attempts=0},Je.prototype.setMin=function(e){this.ms=e},Je.prototype.setMax=function(e){this.max=e},Je.prototype.setJitter=function(e){this.jitter=e};class Qe extends X{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,ne(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 Je({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 Ae(this.uri,this.opts);const t=this.engine,i=this;this._readyState=\"opening\",this.skipReconnect=!1;const n=qe(t,\"open\",(function(){i.onopen(),e&&e()})),r=qe(t,\"error\",(t=>{i.cleanup(),i._readyState=\"closed\",this.emitReserved(\"error\",t),e?e(t):i.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;0===e&&n();const i=this.setTimeoutFn((()=>{n(),t.close(),t.emit(\"error\",new Error(\"timeout\"))}),e);this.opts.autoUnref&&i.unref(),this.subs.push((function(){clearTimeout(i)}))}return this.subs.push(n),this.subs.push(r),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState=\"open\",this.emitReserved(\"open\");const e=this.engine;this.subs.push(qe(e,\"ping\",this.onping.bind(this)),qe(e,\"data\",this.ondata.bind(this)),qe(e,\"error\",this.onerror.bind(this)),qe(e,\"close\",this.onclose.bind(this)),qe(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){Ce((()=>{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 Ge(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((function(){clearTimeout(i)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved(\"reconnect\",e)}}const Ze={};function Xe(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=xe(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=Ze[r]&&s in Ze[r].nsps;let a;return t.forceNew||t[\"force new connection\"]||!1===t.multiplex||o?a=new Qe(n,t):(Ze[r]||(Ze[r]=new Qe(n,t)),a=Ze[r]),i.query&&!t.query&&(t.query=i.queryKey),a.socket(i.path,t)}Object.assign(Xe,{Manager:Qe,Socket:Ge,io:Xe,connect:Xe});var Ye=__nested_webpack_require_1076797__(8764).lW;class et extends AudioWorkletNode{constructor(e,t){super(e,\"voice-changer-worklet-processor\"),this.setting=k,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=Xe(this.setting.serverUrl+\"/test\"),this.socket.on(\"connect_error\",(e=>{this.listener.notifyException(_.ERR_SIO_CONNECT_FAILED,`[SIO] rconnection failed ${e}`)})),this.socket.on(\"connect\",(()=>{console.log(`[SIO] sonnect to ${this.setting.serverUrl}`),console.log(`[SIO] ${this.socket?.id}`)})),this.socket.on(\"response\",(e=>{const t=Date.now()-e[0],i=e[1],n=e[2];i.byteLength<256?this.listener.notifyException(_.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.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 tt(this.setting.serverUrl+\"/test\",t,e.buffer);i.byteLength<256?this.listener.notifyException(_.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 tt=async(e,t,i)=>{const n={timestamp:t,buffer:Ye.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=Ye.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},rt=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},st=async e=>{const t=await rt(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},ot=e=>e?.endsWith(\"/\")?e.substring(0,e.length-1):e;class at{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.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.switchModelType=async e=>{const t=this.serverUrl+\"/model_type\",i=new Promise((async i=>{const n=new FormData;n.append(\"modelType\",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}}}class ct{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 dt{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=A,this.sslCertified=[],this.sem=new ct,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=nt(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(e){throw console.warn(e),e}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=ot(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=e=>{console.log(\"[VoiceChangerClient] Updating Client Setting,\",this.setting,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&&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.switchModelType=e=>this.configurator.switchModelType(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.updateServerSettings=(e,t)=>this.configurator.updateSettings(e,t),this.uploadFile=(e,t,i)=>this.configurator.uploadFile(e,t,i),this.concatUploadedFile=(e,t)=>this.configurator.concatUploadedFile(e,t),this.loadModel=(e,t,i)=>this.configurator.loadModel(e,t,i),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 at,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 et(this.ctx,i)}catch(e){await this.ctx.audioWorklet.addModule(t),this.vcInNode=new et(this.ctx,i)}const n=new AudioContext({sampleRate:48e3});console.log(\"audio out:\",n);try{this.vcOutNode=new et(n,i)}catch(e){await n.audioWorklet.addModule(t),this.vcOutNode=new et(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 it.VoiceFocusDeviceTransformer.create({variant:\"c20\"});const e=nt(this.ctx);this.currentDevice=await this.vf.createTransformDevice(e)||null}e()}))}get stream(){return this.currentMediaStreamAudioDestinationNode.stream}get isVoiceChanging(){return this._isVoiceChanging}}var lt=__nested_webpack_require_1076797__(8156),ut=__nested_webpack_require_1076797__(9483),ht=__nested_webpack_require_1076797__.n(ut);const pt=e=>{const t=e.clientType||\"default\";ht().config({driver:ht().INDEXEDDB,name:P,version:1,storeName:`${O}`,description:\"appStorage\"});const i=(0,lt.useMemo)((()=>async(e,i)=>{const n=`${t}_${e}`;await ht().setItem(n,i)}),[e.clientType]);return{dummy:\"\",setItem:i,getItem:(0,lt.useMemo)((()=>async e=>{const i=`${t}_${e}`;return await ht().getItem(i)}),[e.clientType]),removeItem:(0,lt.useMemo)((()=>async e=>{const i=`${t}_${e}`;return console.log(\"remove key:\",i),await ht().removeItem(i)}),[e.clientType]),removeDB:(0,lt.useMemo)((()=>async()=>{const e=await ht().keys();for(const t of e)console.log(\"remove key:\",t),await ht().removeItem(t)}),[e.clientType])}},mt={isHalf:!0,uploaded:!1,defaultTune:0,defaultIndexRatio:1,framework:o.PyTorch,params:\"{}\",mmvcv13Config:null,mmvcv13Model:null,mmvcv15Config:null,mmvcv15Model:null,soVitsSvc40Config:null,soVitsSvc40Model:null,soVitsSvc40Cluster:null,soVitsSvc40v2Config:null,soVitsSvc40v2Model:null,soVitsSvc40v2Cluster:null,rvcModel:null,rvcFeature:null,rvcIndex:null,isSampleMode:!1,sampleId:null,ddspSvcModel:null,ddspSvcModelConfig:null,ddspSvcDiffusion:null,ddspSvcDiffusionConfig:null},ft={responseTime:0,preprocessTime:0,mainprocessTime:0,postprocessTime:0},gt=e=>{const[t,i]=(0,lt.useState)(!1),n=(0,lt.useRef)(null),[r,s]=(0,lt.useState)(n.current),o=(0,lt.useRef)(),a=(0,lt.useMemo)((()=>new Promise((e=>{o.current=e}))),[]),c=(e=>{const[t,i]=(0,lt.useState)(A),{setItem:n,getItem:r,removeItem:s}=pt({clientType:e.clientType});(0,lt.useEffect)((()=>{(async()=>{const e=await r(R);e&&(console.log(\"[ClientSetting] Load Setting from db\",e),\"null\"==e.audioInput&&(e.audioInput=null),e&&i({...e}))})()}),[]),(0,lt.useEffect)((()=>{e.voiceChangerClient&&e.voiceChangerClient.updateClientSetting(t)}),[e.voiceChangerClient]);const o=async e=>{const t={...e};\"string\"!=typeof t.audioInput&&(t.audioInput=null),n(R,t),i(e)},a=(0,lt.useMemo)((()=>i=>{if(e.voiceChangerClient)for(let n in i)if(t[n]!=i[n]){o(i),e.voiceChangerClient.updateClientSetting(i);break}}),[e.voiceChangerClient,t]),c=(0,lt.useMemo)((()=>t=>{e.voiceChangerClient&&e.voiceChangerClient.setServerUrl(t,!0)}),[e.voiceChangerClient]),d=(0,lt.useMemo)((()=>async()=>{e.voiceChangerClient&&await e.voiceChangerClient.start()}),[e.voiceChangerClient]),l=(0,lt.useMemo)((()=>async()=>{e.voiceChangerClient&&await e.voiceChangerClient.stop()}),[e.voiceChangerClient]),u=(0,lt.useMemo)((()=>async()=>{e.voiceChangerClient&&await e.voiceChangerClient.getClientSettings()}),[e.voiceChangerClient]);return{clientSetting:t,clearSetting:async()=>{await s(R)},setServerUrl:c,updateClientSetting:a,start:d,stop:l,reloadClientSetting:u}})({clientType:e.clientType,voiceChangerClient:r,audioContext:e.audioContext}),d=(e=>{const t=(0,lt.useMemo)((()=>\"MMVCv13\"==e.clientType||\"MMVCv15\"==e.clientType?k:\"so-vits-svc-40\"==e.clientType||\"so-vits-svc-40_c\"==e.clientType?E:\"so-vits-svc-40v2\"==e.clientType?I:\"DDSP-SVC\"==e.clientType?T:\"RVC\"==e.clientType?M:k),[]),[i,n]=(0,lt.useState)(t),{setItem:r,getItem:s,removeItem:o}=pt({clientType:e.clientType});(0,lt.useEffect)((()=>{(async()=>{const e=await s(N);e&&n({...e,sendingSampleRate:48e3})})()}),[]),(0,lt.useEffect)((()=>{e.voiceChangerClient&&(e.voiceChangerClient.setServerUrl(i.serverUrl),e.voiceChangerClient.updateWorkletNodeSetting(i))}),[e.voiceChangerClient]);const a=(0,lt.useMemo)((()=>t=>{if(e.voiceChangerClient)for(let s in t)if(i[s]!=t[s]){n(t),r(N,t),e.voiceChangerClient.updateWorkletNodeSetting(t);break}}),[e.voiceChangerClient,i]),c=(0,lt.useMemo)((()=>()=>{e.voiceChangerClient&&e.voiceChangerClient.startOutputRecording()}),[e.voiceChangerClient]),d=(0,lt.useMemo)((()=>async()=>e.voiceChangerClient?e.voiceChangerClient.stopOutputRecording():new Float32Array),[e.voiceChangerClient]),l=(0,lt.useMemo)((()=>async()=>{e.voiceChangerClient&&e.voiceChangerClient.trancateBuffer()}),[e.voiceChangerClient]);return{workletNodeSetting:i,clearSetting:async()=>{await o(N)},updateWorkletNodeSetting:a,startOutputRecording:c,stopOutputRecording:d,trancateBuffer:l}})({clientType:e.clientType,voiceChangerClient:r}),u=(e=>{const[t,i]=(0,lt.useState)(b),{setItem:n,getItem:r,removeItem:s}=pt({clientType:e.clientType});(0,lt.useEffect)((()=>{(async()=>{const e=await r(B);if(e)i({...e});else{const e=new URLSearchParams(location.search).get(\"colab\");i(\"true\"==e?{numTrancateTreshold:300,volTrancateThreshold:5e-4,volTrancateLength:32}:{numTrancateTreshold:100,volTrancateThreshold:5e-4,volTrancateLength:32})}})()}),[]),(0,lt.useEffect)((()=>{e.voiceChangerClient&&e.voiceChangerClient.configureWorklet(t)}),[e.voiceChangerClient,t]);const o=(0,lt.useMemo)((()=>t=>{e.voiceChangerClient&&(i(t),n(B,t))}),[e.voiceChangerClient]);return{setting:t,clearSetting:async()=>{await s(B)},setSetting:o}})({clientType:e.clientType,voiceChangerClient:r}),y=(e=>{const t=()=>\"MMVCv13\"==e.clientType?p:\"MMVCv15\"==e.clientType?h:\"so-vits-svc-40\"==e.clientType?m:\"so-vits-svc-40_c\"==e.clientType?(console.log(\"default so_vits_svc_40_c\"),f):\"so-vits-svc-40v2\"==e.clientType?g:\"DDSP-SVC\"==e.clientType?v:\"RVC\"==e.clientType?S:h,[i,n]=(0,lt.useState)(t()),[r,s]=(0,lt.useState)([]),{setItem:o,getItem:a,removeItem:c}=pt({clientType:e.clientType});(0,lt.useEffect)((()=>{e.voiceChangerClient&&e.clientType&&(async()=>{await e.voiceChangerClient.switchModelType(e.clientType);const i=t(),r=await a(D);let o;o=r?{...i,...r,serverAudioStated:0,inputSampleRate:48e3}:{...i},n(o);for(let t=0;tasync t=>{if(e.voiceChangerClient)for(let r=0;r0?t.onnxExecutionProvider=t.onnxExecutionProviders[0]:t.onnxExecutionProvider=\"CPUExecutionProvider\",n(t);const i={...t};i.recordIO=0,o(D,i)}}}),[e.voiceChangerClient,i]),u=(0,lt.useMemo)((()=>async(e,t)=>{t.uploaded=!1,r[e]=t,s([...r])}),[r]),[b,y]=(0,lt.useState)(0),[w,C]=(0,lt.useState)(!1),k=(0,lt.useMemo)((()=>async(t,i,n=\"\")=>{if(!e.voiceChangerClient)return;const r=await e.voiceChangerClient.uploadFile(t.data,n+t.filename,i),s=await e.voiceChangerClient.concatUploadedFile(n+t.filename,r);console.log(\"uploaded\",r,s)}),[e.voiceChangerClient]),E=(0,lt.useMemo)((()=>async t=>{const i=r[t];if(0==i.isSampleMode){if(\"MMVCv13\"==e.clientType){if(!i.mmvcv13Config)return void alert(\"Configファイルを指定する必要があります。\");if(!i.mmvcv13Model)return void alert(\"モデルファイルを指定する必要があります。\")}else if(\"MMVCv15\"==e.clientType){if(!i.mmvcv15Config)return void alert(\"Configファイルを指定する必要があります。\");if(!i.mmvcv15Model)return void alert(\"モデルファイルを指定する必要があります。\")}else if(\"so-vits-svc-40\"==e.clientType){if(!i.soVitsSvc40Config)return void alert(\"Configファイルを指定する必要があります。\");if(!i.soVitsSvc40Model)return void alert(\"モデルファイルを指定する必要があります。\")}else if(\"so-vits-svc-40v2\"==e.clientType){if(!i.soVitsSvc40v2Config)return void alert(\"Configファイルを指定する必要があります。\");if(!i.soVitsSvc40v2Model)return void alert(\"モデルファイルを指定する必要があります。\")}else if(\"RVC\"==e.clientType){if(!i.rvcModel)return void alert(\"モデルファイルを指定する必要があります。\")}else if(\"DDSP-SVC\"==e.clientType){if(!i.ddspSvcModel)return void alert(\"DDSPモデルを指定する必要があります。\");if(!i.ddspSvcModelConfig)return void alert(\"DDSP Configファイルを指定する必要があります。\");if(!i.ddspSvcDiffusion)return void alert(\"Diffusionモデルを指定する必要があります。\");if(!i.ddspSvcDiffusionConfig)return void alert(\"Diffusion Configファイルを指定する必要があります。\")}}else if(!i.sampleId)return void alert(\"Sample IDを指定する必要があります。\");if(!e.voiceChangerClient)return;y(0),C(!0);const n=[i.mmvcv13Config,i.mmvcv13Model,i.mmvcv15Config,i.mmvcv15Model,i.soVitsSvc40Config,i.soVitsSvc40Model,i.soVitsSvc40Cluster,i.soVitsSvc40v2Config,i.soVitsSvc40v2Model,i.soVitsSvc40v2Cluster,i.rvcModel,i.rvcIndex,i.rvcFeature].filter((e=>null!=e));for(let e=0;e{y(e*t+i)}))}const o=[i.ddspSvcModel,i.ddspSvcModelConfig,i.ddspSvcDiffusion,i.ddspSvcDiffusionConfig].filter((e=>null!=e));for(let e=0;e{y(e*t+i)}),n)}const a=JSON.stringify({defaultTune:i.defaultTune||0,defaultIndexRatio:i.defaultIndexRatio||1,sampleId:i.isSampleMode&&i.sampleId||\"\",files:i.isSampleMode?{}:{mmvcv13Config:i.mmvcv13Config?.filename||\"\",mmvcv13Model:i.mmvcv13Model?.filename||\"\",mmvcv15Config:i.mmvcv15Config?.filename||\"\",mmvcv15Model:i.mmvcv15Model?.filename||\"\",soVitsSvc40Config:i.soVitsSvc40Config?.filename||\"\",soVitsSvc40Model:i.soVitsSvc40Model?.filename||\"\",soVitsSvc40Cluster:i.soVitsSvc40Cluster?.filename||\"\",soVitsSvc40v2Config:i.soVitsSvc40v2Config?.filename||\"\",soVitsSvc40v2Model:i.soVitsSvc40v2Model?.filename||\"\",soVitsSvc40v2Cluster:i.soVitsSvc40v2Cluster?.filename||\"\",rvcModel:i.rvcModel?.filename||\"\",rvcIndex:i.rvcIndex?.filename||\"\",rvcFeature:i.rvcFeature?.filename||\"\",ddspSvcModel:i.ddspSvcModel?.filename?\"ddsp_mod/\"+i.ddspSvcModel?.filename:\"\",ddspSvcModelConfig:i.ddspSvcModelConfig?.filename?\"ddsp_mod/\"+i.ddspSvcModelConfig?.filename:\"\",ddspSvcDiffusion:i.ddspSvcDiffusion?.filename?\"ddsp_diff/\"+i.ddspSvcDiffusion?.filename:\"\",ddspSvcDiffusionConfig:i.ddspSvcDiffusionConfig?.filename?\"ddsp_diff/\"+i.ddspSvcDiffusionConfig.filename:\"\"}});null==i.isHalf&&(i.isHalf=!1),console.log(\"PARAMS:\",a);const c=e.voiceChangerClient.loadModel(t,i.isHalf,a);I(t,i),await c,i.uploaded=!0,r[t]=i,s([...r]),y(0),C(!1),T()}),[r,e.voiceChangerClient,e.clientType]),I=(e,t)=>{try{const i={isHalf:t.isHalf,uploaded:!1,defaultTune:t.defaultTune,defaultIndexRatio:t.defaultIndexRatio,framework:t.framework,params:t.params,mmvcv13Config:t.mmvcv13Config?{data:t.mmvcv13Config.data,filename:t.mmvcv13Config.filename}:null,mmvcv13Model:t.mmvcv13Model?{data:t.mmvcv13Model.data,filename:t.mmvcv13Model.filename}:null,mmvcv15Config:t.mmvcv15Config?{data:t.mmvcv15Config.data,filename:t.mmvcv15Config.filename}:null,mmvcv15Model:t.mmvcv15Model?{data:t.mmvcv15Model.data,filename:t.mmvcv15Model.filename}:null,soVitsSvc40Config:t.soVitsSvc40Config?{data:t.soVitsSvc40Config.data,filename:t.soVitsSvc40Config.filename}:null,soVitsSvc40Model:t.soVitsSvc40Model?{data:t.soVitsSvc40Model.data,filename:t.soVitsSvc40Model.filename}:null,soVitsSvc40Cluster:t.soVitsSvc40Cluster?{data:t.soVitsSvc40Cluster.data,filename:t.soVitsSvc40Cluster.filename}:null,soVitsSvc40v2Config:t.soVitsSvc40v2Config?{data:t.soVitsSvc40v2Config.data,filename:t.soVitsSvc40v2Config.filename}:null,soVitsSvc40v2Model:t.soVitsSvc40v2Model?{data:t.soVitsSvc40v2Model.data,filename:t.soVitsSvc40v2Model.filename}:null,soVitsSvc40v2Cluster:t.soVitsSvc40v2Cluster?{data:t.soVitsSvc40v2Cluster.data,filename:t.soVitsSvc40v2Cluster.filename}:null,rvcModel:t.rvcModel?{data:t.rvcModel.data,filename:t.rvcModel.filename}:null,rvcIndex:t.rvcIndex?{data:t.rvcIndex.data,filename:t.rvcIndex.filename}:null,rvcFeature:t.rvcFeature?{data:t.rvcFeature.data,filename:t.rvcFeature.filename}:null,ddspSvcModel:t.ddspSvcModel?{data:t.ddspSvcModel.data,filename:t.ddspSvcModel.filename}:null,ddspSvcModelConfig:t.ddspSvcModelConfig?{data:t.ddspSvcModelConfig.data,filename:t.ddspSvcModelConfig.filename}:null,ddspSvcDiffusion:t.ddspSvcDiffusion?{data:t.ddspSvcDiffusion.data,filename:t.ddspSvcDiffusion.filename}:null,ddspSvcDiffusionConfig:t.ddspSvcDiffusionConfig?{data:t.ddspSvcDiffusionConfig.data,filename:t.ddspSvcDiffusionConfig.filename}:null,isSampleMode:t.isSampleMode,sampleId:t.sampleId};o(`${F}_${e}`,i)}catch(e){console.log(\"Excpetion:::::::::\",e)}},T=(0,lt.useMemo)((()=>async()=>{if(!e.voiceChangerClient)return;const t=await e.voiceChangerClient.getServerSettings();n(t);const i={...t};i.recordIO=0,o(D,i)}),[e.voiceChangerClient]);return{serverSetting:i,updateServerSettings:d,clearSetting:async()=>{await c(D),await c(F);for(let e=0;ee.voiceChangerClient.getOnnx(),mergeModel:async t=>{const i=await e.voiceChangerClient.mergeModel(t);return n(i),i},updateModelDefault:async()=>{const t=await e.voiceChangerClient.updateModelDefault();return n(t),t}}})({clientType:e.clientType,voiceChangerClient:r}),w=pt({clientType:e.clientType}),[C,x]=(0,lt.useState)(0),[_,P]=(0,lt.useState)(ft),[O,U]=(0,lt.useState)(0),V=(0,lt.useMemo)((()=>n.current?async()=>{if(n.current){const e=await n.current.getPerformance(),t=e[0],i=e[1],r=e[2],s=e[3];P({responseTime:t,preprocessTime:i,mainprocessTime:r,postprocessTime:s})}else P({responseTime:0,preprocessTime:0,mainprocessTime:0,postprocessTime:0})}:null),[n.current]),j=(0,lt.useRef)(0);(0,lt.useEffect)((()=>{(async()=>{if(!e.audioContext)return;const t=new dt(e.audioContext,!0,{notifySendBufferingTime:e=>{x(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;P({responseTime:i,preprocessTime:n,mainprocessTime:r,postprocessTime:s})},notifyException:e=>{e.length>0&&(console.log(`error:${e}`),j.current+=1,j.current>100&&(alert(\"エラーが頻発しています。対象としているフレームワークのモデルがロードされているか確認してください。\"),j.current=0))},notifyVolume:e=>{U(e)}});await t.isInitialized(),n.current=t,s(n.current),console.log(\"[useClient] client initialized\"),o.current(),i(!0)})()}),[e.audioContext]);const z=(0,lt.useMemo)((()=>async()=>{await a,await c.reloadClientSetting(),await y.reloadServerInfo()}),[c.reloadClientSetting,y.reloadServerInfo]);return{initialized:t,clientSetting:c,workletNodeSetting:d,workletSetting:u,serverSetting:y,indexedDBState:w,bufferingTime:C,volume:O,performance:_,updatePerformance:V,getInfo:z,clearSetting:async()=>{await c.clearSetting(),await d.clearSetting(),await u.clearSetting(),await y.clearSetting()},setAudioOutputElementId:e=>{if(!n.current)return void console.warn(\"[voiceChangerClient] is not ready for set audio output.\");const t=document.getElementById(e);t.srcObject=n.current.stream,t.play()}}},vt=()=>[{name:\"VC Helper\",url:\"https://github.com/w-okada/voice-changer\",license:\"MIT\",licenseUrl:\"https://raw.githubusercontent.com/w-okada/voice-changer/master/LICENSE\",description:\"\"},{name:\"MMVC\",url:\"https://github.com/isletennos/MMVC_Trainer\",license:\"MIT\",licenseUrl:\"https://raw.githubusercontent.com/isletennos/MMVC_Trainer/main/LICENSE\",description:\"\"},{name:\"so-vits-svc\",url:\"https://github.com/svc-develop-team/so-vits-svc\",license:\"MIT\",licenseUrl:\"https://github.com/svc-develop-team/so-vits-svc/blob/4.0/LICENSE\",description:\"\"},{name:\"ContentVec\",url:\"https://github.com/auspicious3000/contentvec\",license:\"MIT\",licenseUrl:\"https://raw.githubusercontent.com/auspicious3000/contentvec/main/LICENSE\",description:\"\"}]})(),__nested_webpack_exports__})()));\n\n//# sourceURL=webpack://demo/./node_modules/@dannadori/voice-changer-client-js/dist/index.js?"); /***/ }), /***/ "./node_modules/@fortawesome/react-fontawesome/index.es.js": /*!*****************************************************************!*\ !*** ./node_modules/@fortawesome/react-fontawesome/index.es.js ***! \*****************************************************************/ /***/ ((__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 */ FontAwesomeIcon: () => (/* binding */ FontAwesomeIcon)\n/* harmony export */ });\n/* harmony import */ var _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @fortawesome/fontawesome-svg-core */ \"./node_modules/@fortawesome/fontawesome-svg-core/index.mjs\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);\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\n\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\n// Get CSS class list from a props object\nfunction classList(props) {\n var _classes;\n\n var beat = props.beat,\n fade = props.fade,\n beatFade = props.beatFade,\n bounce = props.bounce,\n shake = props.shake,\n flash = props.flash,\n spin = props.spin,\n spinPulse = props.spinPulse,\n spinReverse = props.spinReverse,\n pulse = props.pulse,\n fixedWidth = props.fixedWidth,\n inverse = props.inverse,\n border = props.border,\n listItem = props.listItem,\n flip = props.flip,\n size = props.size,\n rotation = props.rotation,\n pull = props.pull; // map of CSS class names to properties\n\n var classes = (_classes = {\n 'fa-beat': beat,\n 'fa-fade': fade,\n 'fa-beat-fade': beatFade,\n 'fa-bounce': bounce,\n 'fa-shake': shake,\n 'fa-flash': flash,\n 'fa-spin': spin,\n 'fa-spin-reverse': spinReverse,\n 'fa-spin-pulse': spinPulse,\n 'fa-pulse': pulse,\n 'fa-fw': fixedWidth,\n 'fa-inverse': inverse,\n 'fa-border': border,\n 'fa-li': listItem,\n 'fa-flip': flip === true,\n 'fa-flip-horizontal': flip === 'horizontal' || flip === 'both',\n 'fa-flip-vertical': flip === 'vertical' || flip === 'both'\n }, _defineProperty(_classes, \"fa-\".concat(size), typeof size !== 'undefined' && size !== null), _defineProperty(_classes, \"fa-rotate-\".concat(rotation), typeof rotation !== 'undefined' && rotation !== null && rotation !== 0), _defineProperty(_classes, \"fa-pull-\".concat(pull), typeof pull !== 'undefined' && pull !== null), _defineProperty(_classes, 'fa-swap-opacity', props.swapOpacity), _classes); // map over all the keys in the classes object\n // return an array of the keys where the value for the key is not null\n\n return Object.keys(classes).map(function (key) {\n return classes[key] ? key : null;\n }).filter(function (key) {\n return key;\n });\n}\n\n// Camelize taken from humps\n// humps is copyright © 2012+ Dom Christie\n// Released under the MIT license.\n// Performant way to determine if object coerces to a number\nfunction _isNumerical(obj) {\n obj = obj - 0; // eslint-disable-next-line no-self-compare\n\n return obj === obj;\n}\n\nfunction camelize(string) {\n if (_isNumerical(string)) {\n return string;\n } // eslint-disable-next-line no-useless-escape\n\n\n string = string.replace(/[\\-_\\s]+(.)?/g, function (match, chr) {\n return chr ? chr.toUpperCase() : '';\n }); // Ensure 1st char is always lowercase\n\n return string.substr(0, 1).toLowerCase() + string.substr(1);\n}\n\nvar _excluded = [\"style\"];\n\nfunction capitalize(val) {\n return val.charAt(0).toUpperCase() + val.slice(1);\n}\n\nfunction styleToObject(style) {\n return style.split(';').map(function (s) {\n return s.trim();\n }).filter(function (s) {\n return s;\n }).reduce(function (acc, pair) {\n var i = pair.indexOf(':');\n var prop = camelize(pair.slice(0, i));\n var value = pair.slice(i + 1).trim();\n prop.startsWith('webkit') ? acc[capitalize(prop)] = value : acc[prop] = value;\n return acc;\n }, {});\n}\n\nfunction convert(createElement, element) {\n var extraProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n if (typeof element === 'string') {\n return element;\n }\n\n var children = (element.children || []).map(function (child) {\n return convert(createElement, child);\n });\n /* eslint-disable dot-notation */\n\n var mixins = Object.keys(element.attributes || {}).reduce(function (acc, key) {\n var val = element.attributes[key];\n\n switch (key) {\n case 'class':\n acc.attrs['className'] = val;\n delete element.attributes['class'];\n break;\n\n case 'style':\n acc.attrs['style'] = styleToObject(val);\n break;\n\n default:\n if (key.indexOf('aria-') === 0 || key.indexOf('data-') === 0) {\n acc.attrs[key.toLowerCase()] = val;\n } else {\n acc.attrs[camelize(key)] = val;\n }\n\n }\n\n return acc;\n }, {\n attrs: {}\n });\n\n var _extraProps$style = extraProps.style,\n existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style,\n remaining = _objectWithoutProperties(extraProps, _excluded);\n\n mixins.attrs['style'] = _objectSpread2(_objectSpread2({}, mixins.attrs['style']), existingStyle);\n /* eslint-enable */\n\n return createElement.apply(void 0, [element.tag, _objectSpread2(_objectSpread2({}, mixins.attrs), remaining)].concat(_toConsumableArray(children)));\n}\n\nvar PRODUCTION = false;\n\ntry {\n PRODUCTION = \"development\" === 'production';\n} catch (e) {}\n\nfunction log () {\n if (!PRODUCTION && console && typeof console.error === 'function') {\n var _console;\n\n (_console = console).error.apply(_console, arguments);\n }\n}\n\nfunction normalizeIconArgs(icon) {\n // this has everything that it needs to be rendered which means it was probably imported\n // directly from an icon svg package\n if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName && icon.icon) {\n return icon;\n }\n\n if (_fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.parse.icon) {\n return _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.parse.icon(icon);\n } // if the icon is null, there's nothing to do\n\n\n if (icon === null) {\n return null;\n } // if the icon is an object and has a prefix and an icon name, return it\n\n\n if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName) {\n return icon;\n } // if it's an array with length of two\n\n\n if (Array.isArray(icon) && icon.length === 2) {\n // use the first item as prefix, second as icon name\n return {\n prefix: icon[0],\n iconName: icon[1]\n };\n } // if it's a string, use it as the icon name\n\n\n if (typeof icon === 'string') {\n return {\n prefix: 'fas',\n iconName: icon\n };\n }\n}\n\n// creates an object with a key of key\n// and a value of value\n// if certain conditions are met\nfunction objectWithKey(key, value) {\n // if the value is a non-empty array\n // or it's not an array but it is truthy\n // then create the object with the key and the value\n // if not, return an empty array\n return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty({}, key, value) : {};\n}\n\nvar FontAwesomeIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().forwardRef(function (props, ref) {\n var iconArgs = props.icon,\n maskArgs = props.mask,\n symbol = props.symbol,\n className = props.className,\n title = props.title,\n titleId = props.titleId,\n maskId = props.maskId;\n var iconLookup = normalizeIconArgs(iconArgs);\n var classes = objectWithKey('classes', [].concat(_toConsumableArray(classList(props)), _toConsumableArray(className.split(' '))));\n var transform = objectWithKey('transform', typeof props.transform === 'string' ? _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.parse.transform(props.transform) : props.transform);\n var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));\n var renderedIcon = (0,_fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.icon)(iconLookup, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, classes), transform), mask), {}, {\n symbol: symbol,\n title: title,\n titleId: titleId,\n maskId: maskId\n }));\n\n if (!renderedIcon) {\n log('Could not find icon', iconLookup);\n return null;\n }\n\n var abstract = renderedIcon.abstract;\n var extraProps = {\n ref: ref\n };\n Object.keys(props).forEach(function (key) {\n // eslint-disable-next-line no-prototype-builtins\n if (!FontAwesomeIcon.defaultProps.hasOwnProperty(key)) {\n extraProps[key] = props[key];\n }\n });\n return convertCurry(abstract[0], extraProps);\n});\nFontAwesomeIcon.displayName = 'FontAwesomeIcon';\nFontAwesomeIcon.propTypes = {\n beat: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),\n border: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),\n beatFade: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),\n bounce: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),\n className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),\n fade: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),\n flash: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),\n mask: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().object), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)]),\n maskId: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),\n fixedWidth: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),\n inverse: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),\n flip: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf([true, false, 'horizontal', 'vertical', 'both']),\n icon: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().object), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)]),\n listItem: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),\n pull: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(['right', 'left']),\n pulse: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),\n rotation: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf([0, 90, 180, 270]),\n shake: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),\n size: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(['2xs', 'xs', 'sm', 'lg', 'xl', '2xl', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),\n spin: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),\n spinPulse: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),\n spinReverse: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),\n symbol: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)]),\n title: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),\n titleId: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),\n transform: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object)]),\n swapOpacity: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool)\n};\nFontAwesomeIcon.defaultProps = {\n border: false,\n className: '',\n mask: null,\n maskId: null,\n fixedWidth: false,\n inverse: false,\n flip: false,\n icon: null,\n listItem: false,\n pull: null,\n pulse: false,\n rotation: null,\n size: null,\n spin: false,\n spinPulse: false,\n spinReverse: false,\n beat: false,\n fade: false,\n beatFade: false,\n bounce: false,\n shake: false,\n symbol: false,\n title: '',\n titleId: null,\n transform: null,\n swapOpacity: false\n};\nvar convertCurry = convert.bind(null, (react__WEBPACK_IMPORTED_MODULE_1___default().createElement));\n\n\n\n\n//# sourceURL=webpack://demo/./node_modules/@fortawesome/react-fontawesome/index.es.js?"); /***/ }), /***/ "./src/000_index.tsx": /*!***************************!*\ !*** ./src/000_index.tsx ***! \***************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__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 _css_App_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./css/App.css */ \"./src/css/App.css\");\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_7__ = __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_14__ = __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_15__ = __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_16__ = __webpack_require__(/*! @fortawesome/free-brands-svg-icons */ \"./node_modules/@fortawesome/free-brands-svg-icons/index.mjs\");\n/* harmony import */ var _001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./001_provider/001_AppRootProvider */ \"./src/001_provider/001_AppRootProvider.tsx\");\n/* harmony import */ var _001_provider_900_ErrorBoundary__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./001_provider/900_ErrorBoundary */ \"./src/001_provider/900_ErrorBoundary.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 _const__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./const */ \"./src/const.ts\");\n/* harmony import */ var _components_demo_010_Demo__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./components/demo/010_Demo */ \"./src/components/demo/010_Demo.tsx\");\n/* harmony import */ var _001_ClientSelector__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./001_ClientSelector */ \"./src/001_ClientSelector.tsx\");\n\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_7__.library.add(_fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_14__.fas, _fortawesome_free_regular_svg_icons__WEBPACK_IMPORTED_MODULE_15__.far, _fortawesome_free_brands_svg_icons__WEBPACK_IMPORTED_MODULE_16__.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_8__.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_12__.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_8__.useAppRoot)(),\n appGuiSettingState = _useAppRoot2.appGuiSettingState,\n clientType = _useAppRoot2.clientType,\n setClientType = _useAppRoot2.setClientType;\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: clientType\n }),\n removeItem = _useIndexedDB.removeItem;\n var _useIndexedDB2 = (0,_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_10__.useIndexedDB)({\n clientType: null\n }),\n getItem = _useIndexedDB2.getItem,\n removeDB = _useIndexedDB2.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\n // const indexedDBKeys = [\n // INDEXEDDB_KEY_CLIENT,\n // INDEXEDDB_KEY_SERVER,\n // INDEXEDDB_KEY_WORKLETNODE,\n // INDEXEDDB_KEY_WORKLET,\n // INDEXEDDB_KEY_AUDIO_OUTPUT\n // ]\n // for (const k of indexedDBKeys) {\n // await removeItem(k)\n // }\n\n // for (let i = 0; i < MAX_MODEL_SLOT_NUM; i++) {\n // const modleKey = `${INDEXEDDB_KEY_MODEL_DATA}_${i}`\n // await removeItem(modleKey)\n // }\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 }, \"\\u3061\\u3087\\u3063\\u3068\\u554F\\u984C\\u304C\\u8D77\\u304D\\u305F\\u307F\\u305F\\u3044\\u3067\\u3059\\u3002\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"div\", {\n className: \"top-error-description\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"p\", null, \"\\u3053\\u306E\\u30A2\\u30D7\\u30EA\\u3067\\u7BA1\\u7406\\u3057\\u3066\\u3044\\u308B\\u60C5\\u5831\\u3092\\u30AF\\u30EA\\u30A2\\u3059\\u308B\\u3068\\u56DE\\u5FA9\\u3059\\u308B\\u5834\\u5408\\u304C\\u3042\\u308A\\u307E\\u3059\\u3002\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"p\", null, \"\\u4E0B\\u8A18\\u306E\\u30DC\\u30BF\\u30F3\\u3092\\u62BC\\u3057\\u3066\\u60C5\\u5831\\u3092\\u30AF\\u30EA\\u30A2\\u3057\\u307E\\u3059\\u3002\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"p\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"button\", {\n onClick: onClearCacheClicked\n }, \"\\u30A2\\u30D7\\u30EA\\u3092\\u521D\\u671F\\u5316\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"p\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"button\", {\n onClick: onReloadClicked\n }, \"\\u521D\\u671F\\u5316\\u305B\\u305A\\u30EA\\u30ED\\u30FC\\u30C9\"))), /*#__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 var defaultModelType;\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 getItem(_const__WEBPACK_IMPORTED_MODULE_11__.INDEXEDDB_KEY_DEFAULT_MODEL_TYPE);\n case 2:\n defaultModelType = _context2.sent;\n if (defaultModelType && defaultModelType != \"null\") {\n setClientType(defaultModelType);\n }\n case 4:\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 (!clientType) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(_001_ClientSelector__WEBPACK_IMPORTED_MODULE_13__.ClientSelector, null);\n } else if (!appGuiSettingState.guiSettingLoaded) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(react__WEBPACK_IMPORTED_MODULE_3__.Fragment, null);\n } else {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(_001_provider_900_ErrorBoundary__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n fallback: errorComponent,\n onError: updateError\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_6__.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_8__.AppRootProvider, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(AppStateWrapper, null)));\n\n//# sourceURL=webpack://demo/./src/000_index.tsx?"); /***/ }), /***/ "./src/001-1_Title.tsx": /*!*****************************!*\ !*** ./src/001-1_Title.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 */ Title: () => (/* binding */ Title)\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 _const__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./const */ \"./src/const.ts\");\n\n\nvar Title = function Title(props) {\n var githubLink = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return (0,_const__WEBPACK_IMPORTED_MODULE_1__.isDesktopApp)() ?\n /*#__PURE__*/\n // @ts-ignore\n react__WEBPACK_IMPORTED_MODULE_0___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_0___default().createElement(\"img\", {\n src: \"./assets/icons/github.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text\"\n }, \"github\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___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_0___default().createElement(\"img\", {\n src: \"./assets/icons/github.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text\"\n }, \"github\"));\n }, []);\n var manualLink = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return (0,_const__WEBPACK_IMPORTED_MODULE_1__.isDesktopApp)() ?\n /*#__PURE__*/\n // @ts-ignore\n react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"link tooltip\",\n onClick: function onClick() {\n window.electronAPI.openBrowser(\"https://zenn.dev/wok/books/0004_vc-client-v_1_5_1_x\");\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n src: \"./assets/icons/help-circle.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text\"\n }, \"manual\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n className: \"link tooltip\",\n href: \"https://zenn.dev/wok/books/0004_vc-client-v_1_5_1_x\",\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n src: \"./assets/icons/help-circle.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text\"\n }, \"manual\"));\n }, []);\n var toolLink = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return (0,_const__WEBPACK_IMPORTED_MODULE_1__.isDesktopApp)() ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"link tooltip\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n src: \"./assets/icons/tool.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-100px\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"p\", {\n onClick: function onClick() {\n // @ts-ignore\n window.electronAPI.openBrowser(\"https://w-okada.github.io/screen-recorder-ts/\");\n }\n }, \"screen capture\"))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"link tooltip\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n src: \"./assets/icons/tool.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-100px\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"p\", {\n onClick: function onClick() {\n window.open(\"https://w-okada.github.io/screen-recorder-ts/\", '_blank', \"noreferrer\");\n }\n }, \"screen capture\")));\n }, []);\n var coffeeLink = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return (0,_const__WEBPACK_IMPORTED_MODULE_1__.isDesktopApp)() ?\n /*#__PURE__*/\n // @ts-ignore\n react__WEBPACK_IMPORTED_MODULE_0___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_0___default().createElement(\"img\", {\n className: \"donate-img\",\n src: \"./assets/buymeacoffee.png\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-100px\"\n }, \"donate(\\u5BC4\\u4ED8)\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___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_0___default().createElement(\"img\", {\n className: \"donate-img\",\n src: \"./assets/buymeacoffee.png\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-100px\"\n }, \"donate(\\u5BC4\\u4ED8)\"));\n }, []);\n var titleRow = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n if (props.lineNum == 2) {\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: \"top-title\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"title\"\n }, props.mainTitle)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"top-title\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"top-title-version\"\n }, props.subTitle), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"belongings\"\n }, githubLink, manualLink, toolLink, coffeeLink)));\n } else {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"top-title\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"title\"\n }, props.mainTitle), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"top-title-version\"\n }, props.subTitle), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"belongings\"\n }, githubLink, manualLink, toolLink, coffeeLink), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"belongings\"\n }));\n }\n }, [props.subTitle, props.mainTitle, props.lineNum]);\n return titleRow;\n};\n\n//# sourceURL=webpack://demo/./src/001-1_Title.tsx?"); /***/ }), /***/ "./src/001_ClientSelector.tsx": /*!************************************!*\ !*** ./src/001_ClientSelector.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 */ ClientSelector: () => (/* binding */ ClientSelector)\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/* 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_1_Title__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./001-1_Title */ \"./src/001-1_Title.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/* harmony import */ var _const__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./const */ \"./src/const.ts\");\n\n\n\n\n\nvar ClientSelector = function ClientSelector() {\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_3__.useAppRoot)(),\n setClientType = _useAppRoot.setClientType;\n var _useIndexedDB = (0,_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_0__.useIndexedDB)({\n clientType: null\n }),\n setItem = _useIndexedDB.setItem;\n var onClientTypeClicked = function onClientTypeClicked(clientType) {\n setClientType(clientType);\n setItem(_const__WEBPACK_IMPORTED_MODULE_4__.INDEXEDDB_KEY_DEFAULT_MODEL_TYPE, clientType);\n };\n var selectableClientTypes = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var ua = window.navigator.userAgent.toLowerCase();\n if (ua.indexOf(\"mac os x\") !== -1) {\n return [\"MMVCv13\", \"MMVCv15\", \"so-vits-svc-40\", \"RVC\"];\n } else {\n return [\"MMVCv13\", \"MMVCv15\", \"so-vits-svc-40\", \"so-vits-svc-40v2\", \"RVC\", \"DDSP-SVC\"];\n }\n }, []);\n var selectableClientTypesRowItems = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return selectableClientTypes.flatMap(function (_, i, a) {\n return i % 2 ? [] : [a.slice(i, i + 2)];\n });\n }, []);\n var selectableClientTypesRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return selectableClientTypesRowItems.map(function (x, index) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n key: index,\n className: \"body-row split-1-8-1 left-padding-1 \"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, x.map(function (y) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n key: y,\n className: \"body-button w40 bold\",\n onClick: function onClick() {\n onClientTypeClicked(y);\n }\n }, y);\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null));\n });\n }, []);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"main-body\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_001_1_Title__WEBPACK_IMPORTED_MODULE_2__.Title, {\n lineNum: 1,\n mainTitle: \"Realtime Voice Changer Client\",\n subTitle: \"launcher\"\n }), selectableClientTypesRow);\n};\n\n//# sourceURL=webpack://demo/./src/001_ClientSelector.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 */ userAppGuiSetting: () => (/* binding */ userAppGuiSetting)\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 _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\n\n// export type AppGuiDemoSetting2 = {\n// type: \"demo\",\n// id: ClientType,\n// front: GuiSectionSetting[],\n// dialogs: {\n// \"license\": { title: string, auther: string, contact: string, url: string, license: string }[]\n// }\n// }\n\n// export type GuiSectionSetting = {\n// \"title\": string,\n// \"components\": GuiComponentSetting[]\n// }\nvar InitialAppGuiDemoSetting = {\n type: \"demo\",\n id: _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_4__.ClientType.MMVCv13,\n front: {\n \"title\": [],\n \"serverControl\": [],\n \"modelSetting\": [],\n \"deviceSetting\": [],\n \"qualityControl\": [],\n \"speakerSetting\": [],\n \"converterSetting\": [],\n \"advancedSetting\": [],\n \"lab\": []\n },\n dialogs: {\n \"license\": [{\n title: \"\",\n auther: \"\",\n contact: \"\",\n url: \"\",\n license: \"MIT\"\n }]\n }\n};\nvar userAppGuiSetting = function userAppGuiSetting() {\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 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 return {\n appGuiSetting: appGuiSetting,\n guiSettingLoaded: guiSettingLoaded,\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 ctx = new AudioContext();\n document.removeEventListener('touchstart', createAudioContext);\n document.removeEventListener('mousedown', createAudioContext);\n setAudioContext(ctx);\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 clientType: props.clientType\n });\n\n // const setClientType = (clientType: ClientType) => {\n // console.log(\"SET CLIENT TYPE\", clientType)\n // clientState.setClientType(clientType)\n // }\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_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_globalHooks_001_useAppGuiSetting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../001_globalHooks/001_useAppGuiSetting */ \"./src/001_globalHooks/001_useAppGuiSetting.ts\");\n/* harmony import */ var _001_globalHooks_001_useAudioConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../001_globalHooks/001_useAudioConfig */ \"./src/001_globalHooks/001_useAudioConfig.ts\");\n\n\n\n\nvar AppRootContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createContext(null);\nvar useAppRoot = function useAppRoot() {\n var state = (0,react__WEBPACK_IMPORTED_MODULE_1__.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_3__.useAudioConfig)();\n var appGuiSettingState = (0,_001_globalHooks_001_useAppGuiSetting__WEBPACK_IMPORTED_MODULE_2__.userAppGuiSetting)();\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 clientType = _useState2[0],\n setClientType = _useState2[1];\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n if (!clientType) {\n return;\n }\n appGuiSettingState.getAppGuiSetting(\"/assets/gui_settings/\".concat(clientType, \".json\"));\n }, [clientType]);\n var providerValue = {\n audioContextState: audioContextState,\n appGuiSettingState: appGuiSettingState,\n clientType: clientType,\n setClientType: setClientType\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___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("__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\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 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 clientType: appRoot.clientType\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.clientSetting.updateClientSetting(_objectSpread(_objectSpread({}, clientState.clientState.clientSetting.clientSetting), {}, {\n speakers: [{\n \"id\": 107,\n \"name\": \"user\"\n }, {\n \"id\": 100,\n \"name\": \"ずんだもん\"\n }, {\n \"id\": 101,\n \"name\": \"そら\"\n }, {\n \"id\": 102,\n \"name\": \"めたん\"\n }, {\n \"id\": 103,\n \"name\": \"つむぎ\"\n }]\n }));\n }\n }, [clientState.clientState.initialized]);\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/101_HeaderButton.tsx": /*!*********************************************!*\ !*** ./src/components/101_HeaderButton.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 */ AnimationTypes: () => (/* binding */ AnimationTypes),\n/* harmony export */ HeaderButton: () => (/* binding */ HeaderButton)\n/* harmony export */ });\n/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @fortawesome/react-fontawesome */ \"./node_modules/@fortawesome/react-fontawesome/index.es.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 AnimationTypes = {\n colored: \"colored\",\n spinner: \"spinner\"\n};\nvar HeaderButton = function HeaderButton(props) {\n var headerButton = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var tooltipClass = props.tooltipClass || \"tooltip-bottom\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"rotate-button-container \".concat(tooltipClass),\n \"data-tooltip\": props.tooltip\n }, props.stateControlCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"label\", {\n htmlFor: props.stateControlCheckbox.className,\n className: \"rotate-lable\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: props.animation\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_0__.FontAwesomeIcon, {\n icon: props.onIcon,\n className: \"spin-on\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_0__.FontAwesomeIcon, {\n icon: props.offIcon,\n className: \"spin-off\"\n }))));\n }, []);\n return headerButton;\n};\n\n//# sourceURL=webpack://demo/./src/components/101_HeaderButton.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 */ OpenConverterSettingCheckbox: () => (/* binding */ OpenConverterSettingCheckbox),\n/* harmony export */ OpenDeviceSettingCheckbox: () => (/* binding */ OpenDeviceSettingCheckbox),\n/* harmony export */ OpenLabCheckbox: () => (/* binding */ OpenLabCheckbox),\n/* harmony export */ OpenLicenseDialogCheckbox: () => (/* binding */ OpenLicenseDialogCheckbox),\n/* harmony export */ OpenModelSettingCheckbox: () => (/* binding */ OpenModelSettingCheckbox),\n/* harmony export */ OpenQualityControlCheckbox: () => (/* binding */ OpenQualityControlCheckbox),\n/* harmony export */ OpenServerControlCheckbox: () => (/* binding */ OpenServerControlCheckbox),\n/* harmony export */ OpenSpeakerSettingCheckbox: () => (/* binding */ OpenSpeakerSettingCheckbox),\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 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 clientType = _useAppRoot.clientType;\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 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 showLicenseCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenLicenseDialogCheckbox);\n var showWaitingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenWaitingDialogCheckbox);\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 showLicenseCheckbox.updateState(false);\n showWaitingCheckbox.updateState(false);\n }, []);\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n setModelSlotNum(0);\n }, [clientType]);\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 showLicenseCheckbox: showLicenseCheckbox,\n showWaitingCheckbox: showWaitingCheckbox\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 };\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 _components_102_ClearSettingRow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/102_ClearSettingRow */ \"./src/components/demo/components/102_ClearSettingRow.tsx\");\n/* harmony import */ var _components_101_Title__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/101_Title */ \"./src/components/demo/components/101_Title.tsx\");\n/* harmony import */ var _components_201_StartButtonRow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/201_StartButtonRow */ \"./src/components/demo/components/201_StartButtonRow.tsx\");\n/* harmony import */ var _components_202_PerformanceRow__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/202_PerformanceRow */ \"./src/components/demo/components/202_PerformanceRow.tsx\");\n/* harmony import */ var _components_203_ServerInfoRow__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/203_ServerInfoRow */ \"./src/components/demo/components/203_ServerInfoRow.tsx\");\n/* harmony import */ var _components_302_FrameworkRow__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/302_FrameworkRow */ \"./src/components/demo/components/302_FrameworkRow.tsx\");\n/* harmony import */ var _components_401_AudioInputRow__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./components/401_AudioInputRow */ \"./src/components/demo/components/401_AudioInputRow.tsx\");\n/* harmony import */ var _components_402_AudioOutputRow__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./components/402_AudioOutputRow */ \"./src/components/demo/components/402_AudioOutputRow.tsx\");\n/* harmony import */ var _components_502_GainControlRow__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./components/502_GainControlRow */ \"./src/components/demo/components/502_GainControlRow.tsx\");\n/* harmony import */ var _components_501_NoiseControlRow__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./components/501_NoiseControlRow */ \"./src/components/demo/components/501_NoiseControlRow.tsx\");\n/* harmony import */ var _components_503_F0DetectorRow__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./components/503_F0DetectorRow */ \"./src/components/demo/components/503_F0DetectorRow.tsx\");\n/* harmony import */ var _components_990_DividerRow__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./components/990_DividerRow */ \"./src/components/demo/components/990_DividerRow.tsx\");\n/* harmony import */ var _components_510_AnalyzerRow__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./components/510_AnalyzerRow */ \"./src/components/demo/components/510_AnalyzerRow.tsx\");\n/* harmony import */ var _components_601_SrcIdRow__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./components/601_SrcIdRow */ \"./src/components/demo/components/601_SrcIdRow.tsx\");\n/* harmony import */ var _components_602_DstIdRow__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./components/602_DstIdRow */ \"./src/components/demo/components/602_DstIdRow.tsx\");\n/* harmony import */ var _components_603_EditSpeakerIdMappingRow__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./components/603_EditSpeakerIdMappingRow */ \"./src/components/demo/components/603_EditSpeakerIdMappingRow.tsx\");\n/* harmony import */ var _components_604_F0FactorRow__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./components/604_F0FactorRow */ \"./src/components/demo/components/604_F0FactorRow.tsx\");\n/* harmony import */ var _components_605_TuneRow__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./components/605_TuneRow */ \"./src/components/demo/components/605_TuneRow.tsx\");\n/* harmony import */ var _components_606_ClusterInferRatioRow__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./components/606_ClusterInferRatioRow */ \"./src/components/demo/components/606_ClusterInferRatioRow.tsx\");\n/* harmony import */ var _components_607_NoiseScaleRow__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./components/607_NoiseScaleRow */ \"./src/components/demo/components/607_NoiseScaleRow.tsx\");\n/* harmony import */ var _components_608_SilentThresholdRow__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./components/608_SilentThresholdRow */ \"./src/components/demo/components/608_SilentThresholdRow.tsx\");\n/* harmony import */ var _components_701_InputChunkNumRow__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./components/701_InputChunkNumRow */ \"./src/components/demo/components/701_InputChunkNumRow.tsx\");\n/* harmony import */ var _components_702_ExtraDataLengthRow__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./components/702_ExtraDataLengthRow */ \"./src/components/demo/components/702_ExtraDataLengthRow.tsx\");\n/* harmony import */ var _components_703_GPURow__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./components/703_GPURow */ \"./src/components/demo/components/703_GPURow.tsx\");\n/* harmony import */ var _components_801_ServerURLRow__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./components/801_ServerURLRow */ \"./src/components/demo/components/801_ServerURLRow.tsx\");\n/* harmony import */ var _components_802_ProtocolRow__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./components/802_ProtocolRow */ \"./src/components/demo/components/802_ProtocolRow.tsx\");\n/* harmony import */ var _components_803_SampleRateRow__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./components/803_SampleRateRow */ \"./src/components/demo/components/803_SampleRateRow.tsx\");\n/* harmony import */ var _components_804_SendingSampleRateRow__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./components/804_SendingSampleRateRow */ \"./src/components/demo/components/804_SendingSampleRateRow.tsx\");\n/* harmony import */ var _components_805_CrossFadeOverlapSizeRow__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./components/805_CrossFadeOverlapSizeRow */ \"./src/components/demo/components/805_CrossFadeOverlapSizeRow.tsx\");\n/* harmony import */ var _components_806_CrossFadeOffsetRateRow__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./components/806_CrossFadeOffsetRateRow */ \"./src/components/demo/components/806_CrossFadeOffsetRateRow.tsx\");\n/* harmony import */ var _components_807_CrossFadeEndRateRow__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./components/807_CrossFadeEndRateRow */ \"./src/components/demo/components/807_CrossFadeEndRateRow.tsx\");\n/* harmony import */ var _components_808_DownSamplingModeRow__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./components/808_DownSamplingModeRow */ \"./src/components/demo/components/808_DownSamplingModeRow.tsx\");\n/* harmony import */ var _components_809_TrancateNumTresholdRow__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./components/809_TrancateNumTresholdRow */ \"./src/components/demo/components/809_TrancateNumTresholdRow.tsx\");\n/* harmony import */ var _components_609_IndexRatioRow__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./components/609_IndexRatioRow */ \"./src/components/demo/components/609_IndexRatioRow.tsx\");\n/* harmony import */ var _components_810_RVCQualityRow__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./components/810_RVCQualityRow */ \"./src/components/demo/components/810_RVCQualityRow.tsx\");\n/* harmony import */ var _components_303_ModelSamplingRateRow__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./components/303_ModelSamplingRateRow */ \"./src/components/demo/components/303_ModelSamplingRateRow.tsx\");\n/* harmony import */ var _components_602v2_DstIdRow2__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./components/602v2_DstIdRow2 */ \"./src/components/demo/components/602v2_DstIdRow2.tsx\");\n/* harmony import */ var _components_812_SilenceFrontRow__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./components/812_SilenceFrontRow */ \"./src/components/demo/components/812_SilenceFrontRow.tsx\");\n/* harmony import */ var _components_205_ONNXExportRow__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./components/205_ONNXExportRow */ \"./src/components/demo/components/205_ONNXExportRow.tsx\");\n/* harmony import */ var _components_206_ONNXExecutorRow__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./components/206_ONNXExecutorRow */ \"./src/components/demo/components/206_ONNXExecutorRow.tsx\");\n/* harmony import */ var _components_a01_MergeLab_Row__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./components/a01_MergeLab.Row */ \"./src/components/demo/components/a01_MergeLab.Row.tsx\");\n/* harmony import */ var _components_204_ModelSwitchRow__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./components/204_ModelSwitchRow */ \"./src/components/demo/components/204_ModelSwitchRow.tsx\");\n/* harmony import */ var _components_813_EnableDirectMLRow__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./components/813_EnableDirectMLRow */ \"./src/components/demo/components/813_EnableDirectMLRow.tsx\");\n/* harmony import */ var _components_410_AudioDeviceModeRow__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./components/410_AudioDeviceModeRow */ \"./src/components/demo/components/410_AudioDeviceModeRow.tsx\");\n/* harmony import */ var _components_411_IOBufferRow__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./components/411_IOBufferRow */ \"./src/components/demo/components/411_IOBufferRow.tsx\");\n/* harmony import */ var _components_301_e_CommonFileSelectRow__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./components/301-e_CommonFileSelectRow */ \"./src/components/demo/components/301-e_CommonFileSelectRow.tsx\");\n/* harmony import */ var _components_301_f_ModelUploadButtonRow__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./components/301-f_ModelUploadButtonRow */ \"./src/components/demo/components/301-f_ModelUploadButtonRow.tsx\");\n/* harmony import */ var _components_301_ModelUploaderRowv2__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./components/301_ModelUploaderRowv2 */ \"./src/components/demo/components/301_ModelUploaderRowv2.tsx\");\n/* harmony import */ var _components_301_g_CorrespondenceSelectRow2__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./components/301-g_CorrespondenceSelectRow2 */ \"./src/components/demo/components/301-g_CorrespondenceSelectRow2.tsx\");\n/* harmony import */ var _components_301_h_ModelSlotRowv2__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./components/301-h_ModelSlotRowv2 */ \"./src/components/demo/components/301-h_ModelSlotRowv2.tsx\");\n/* harmony import */ var _components_301_i_DefaultTuneRowv2__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./components/301-i_DefaultTuneRowv2 */ \"./src/components/demo/components/301-i_DefaultTuneRowv2.tsx\");\n/* harmony import */ var _components_611_DiffEnablerRow__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./components/611_DiffEnablerRow */ \"./src/components/demo/components/611_DiffEnablerRow.tsx\");\n/* harmony import */ var _components_612_DiffSettingRow__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./components/612_DiffSettingRow */ \"./src/components/demo/components/612_DiffSettingRow.tsx\");\n/* harmony import */ var _components_613_DiffMethodRow__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./components/613_DiffMethodRow */ \"./src/components/demo/components/613_DiffMethodRow.tsx\");\n/* harmony import */ var _components_207_ServerOpertationRow__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./components/207_ServerOpertationRow */ \"./src/components/demo/components/207_ServerOpertationRow.tsx\");\n/* harmony import */ var _components_301_j_SampleModelSelectRow__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./components/301-j_SampleModelSelectRow */ \"./src/components/demo/components/301-j_SampleModelSelectRow.tsx\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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(\"divider\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_990_DividerRow__WEBPACK_IMPORTED_MODULE_12__.DividerRow, props);\n });\n addToCatalog(\"title\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_101_Title__WEBPACK_IMPORTED_MODULE_2__.Title, props);\n });\n addToCatalog(\"clearSetting\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_102_ClearSettingRow__WEBPACK_IMPORTED_MODULE_1__.ClearSettingRow, props);\n });\n addToCatalog(\"startButton\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_201_StartButtonRow__WEBPACK_IMPORTED_MODULE_3__.StartButtonRow, props);\n });\n addToCatalog(\"performance\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_202_PerformanceRow__WEBPACK_IMPORTED_MODULE_4__.PerformanceRow, props);\n });\n addToCatalog(\"serverInfo\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_203_ServerInfoRow__WEBPACK_IMPORTED_MODULE_5__.ServerInfoRow, props);\n });\n addToCatalog(\"modelSwitch\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_204_ModelSwitchRow__WEBPACK_IMPORTED_MODULE_42__.ModelSwitchRow, props);\n });\n addToCatalog(\"onnxExport\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_205_ONNXExportRow__WEBPACK_IMPORTED_MODULE_39__.ONNXExportRow, props);\n });\n addToCatalog(\"onnxExecutor\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_206_ONNXExecutorRow__WEBPACK_IMPORTED_MODULE_40__.ONNXExecutorRow, props);\n });\n addToCatalog(\"serverOperation\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_207_ServerOpertationRow__WEBPACK_IMPORTED_MODULE_55__.ServerOpertationRow, props);\n });\n addToCatalog(\"modelUploaderv2\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_301_ModelUploaderRowv2__WEBPACK_IMPORTED_MODULE_48__.ModelUploaderRowv2, props);\n });\n addToCatalog(\"framework\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_302_FrameworkRow__WEBPACK_IMPORTED_MODULE_6__.FrameworkRow, props);\n });\n addToCatalog(\"modelSamplingRate\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_303_ModelSamplingRateRow__WEBPACK_IMPORTED_MODULE_36__.ModelSamplingRateRow, props);\n });\n addToCatalog(\"commonFileSelect\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_301_e_CommonFileSelectRow__WEBPACK_IMPORTED_MODULE_46__.CommonFileSelectRow, props);\n });\n addToCatalog(\"modelUploadButtonRow2\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_301_f_ModelUploadButtonRow__WEBPACK_IMPORTED_MODULE_47__.ModelUploadButtonRow2, props);\n });\n addToCatalog(\"correspondenceSelectRow2\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_301_g_CorrespondenceSelectRow2__WEBPACK_IMPORTED_MODULE_49__.CorrespondenceSelectRow2, props);\n });\n addToCatalog(\"modelSlotRow2\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_301_h_ModelSlotRowv2__WEBPACK_IMPORTED_MODULE_50__.ModelSlotRow2, props);\n });\n addToCatalog(\"defaultTuneRow2\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_301_i_DefaultTuneRowv2__WEBPACK_IMPORTED_MODULE_51__.DefaultTuneRow2, props);\n });\n addToCatalog(\"sampleModelSelect\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_301_j_SampleModelSelectRow__WEBPACK_IMPORTED_MODULE_56__.SampleModelSelectRow, props);\n });\n addToCatalog(\"audioInput\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_401_AudioInputRow__WEBPACK_IMPORTED_MODULE_7__.AudioInputRow, props);\n });\n addToCatalog(\"audioOutput\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_402_AudioOutputRow__WEBPACK_IMPORTED_MODULE_8__.AudioOutputRow, props);\n });\n addToCatalog(\"audioDeviceMode\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_410_AudioDeviceModeRow__WEBPACK_IMPORTED_MODULE_44__.AudioDeviceModeRow, props);\n });\n addToCatalog(\"noiseControl\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_501_NoiseControlRow__WEBPACK_IMPORTED_MODULE_10__.NoiseControlRow, props);\n });\n addToCatalog(\"gainControl\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_502_GainControlRow__WEBPACK_IMPORTED_MODULE_9__.GainControlRow, props);\n });\n addToCatalog(\"f0Detector\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_503_F0DetectorRow__WEBPACK_IMPORTED_MODULE_11__.F0DetectorRow, props);\n });\n addToCatalog(\"analyzer\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_510_AnalyzerRow__WEBPACK_IMPORTED_MODULE_13__.AnalyzerRow, props);\n });\n addToCatalog(\"srcId\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_601_SrcIdRow__WEBPACK_IMPORTED_MODULE_14__.SrcIdRow, props);\n });\n addToCatalog(\"dstId\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_602_DstIdRow__WEBPACK_IMPORTED_MODULE_15__.DstIdRow, props);\n });\n addToCatalog(\"dstId2\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_602v2_DstIdRow2__WEBPACK_IMPORTED_MODULE_37__.DstIdRow2, props);\n });\n addToCatalog(\"editSpeakerIdMapping\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_603_EditSpeakerIdMappingRow__WEBPACK_IMPORTED_MODULE_16__.EditSpeakerIdMappingRow, props);\n });\n addToCatalog(\"f0Factor\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_604_F0FactorRow__WEBPACK_IMPORTED_MODULE_17__.F0FactorRow, props);\n });\n addToCatalog(\"tune\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_605_TuneRow__WEBPACK_IMPORTED_MODULE_18__.TuneRow, props);\n });\n addToCatalog(\"clusterInferRatio\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_606_ClusterInferRatioRow__WEBPACK_IMPORTED_MODULE_19__.ClusterInferRatioRow, props);\n });\n addToCatalog(\"noiseScale\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_607_NoiseScaleRow__WEBPACK_IMPORTED_MODULE_20__.NoiseScaleRow, props);\n });\n addToCatalog(\"silentThreshold\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_608_SilentThresholdRow__WEBPACK_IMPORTED_MODULE_21__.SilentThresholdRow, props);\n });\n addToCatalog(\"indexRatio\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_609_IndexRatioRow__WEBPACK_IMPORTED_MODULE_34__.IndexRatioRow, props);\n });\n addToCatalog(\"diffEnabler\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_611_DiffEnablerRow__WEBPACK_IMPORTED_MODULE_52__.DiffEnablerRow, props);\n });\n addToCatalog(\"diffSetting\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_612_DiffSettingRow__WEBPACK_IMPORTED_MODULE_53__.DiffSettingRow, props);\n });\n addToCatalog(\"diffMethod\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_613_DiffMethodRow__WEBPACK_IMPORTED_MODULE_54__.DiffMethodRow, props);\n });\n addToCatalog(\"inputChunkNum\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_701_InputChunkNumRow__WEBPACK_IMPORTED_MODULE_22__.InputChunkNumRow, props);\n });\n addToCatalog(\"extraDataLength\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_702_ExtraDataLengthRow__WEBPACK_IMPORTED_MODULE_23__.ExtraDataLengthRow, props);\n });\n addToCatalog(\"gpu\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_703_GPURow__WEBPACK_IMPORTED_MODULE_24__.GPURow, props);\n });\n addToCatalog(\"ioBuffer\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_411_IOBufferRow__WEBPACK_IMPORTED_MODULE_45__.IOBufferRow, props);\n });\n addToCatalog(\"serverURL\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_801_ServerURLRow__WEBPACK_IMPORTED_MODULE_25__.ServerURLRow, props);\n });\n addToCatalog(\"protocol\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_802_ProtocolRow__WEBPACK_IMPORTED_MODULE_26__.ProtocolRow, props);\n });\n addToCatalog(\"sampleRate\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_803_SampleRateRow__WEBPACK_IMPORTED_MODULE_27__.SampleRateRow, props);\n });\n addToCatalog(\"sendingSampleRate\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_804_SendingSampleRateRow__WEBPACK_IMPORTED_MODULE_28__.SendingSampleRateRow, props);\n });\n addToCatalog(\"crossFadeOverlapSize\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_805_CrossFadeOverlapSizeRow__WEBPACK_IMPORTED_MODULE_29__.CrossFadeOverlapSizeRow, props);\n });\n addToCatalog(\"crossFadeOffsetRate\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_806_CrossFadeOffsetRateRow__WEBPACK_IMPORTED_MODULE_30__.CrossFadeOffsetRateRow, props);\n });\n addToCatalog(\"crossFadeEndRate\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_807_CrossFadeEndRateRow__WEBPACK_IMPORTED_MODULE_31__.CrossFadeEndRateRow, props);\n });\n addToCatalog(\"downSamplingMode\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_808_DownSamplingModeRow__WEBPACK_IMPORTED_MODULE_32__.DownSamplingModeRow, props);\n });\n addToCatalog(\"trancateNumThreshold\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_809_TrancateNumTresholdRow__WEBPACK_IMPORTED_MODULE_33__.TrancateNumTresholdRow, props);\n });\n addToCatalog(\"rvcQuality\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_810_RVCQualityRow__WEBPACK_IMPORTED_MODULE_35__.RVCQualityRow, props);\n });\n addToCatalog(\"silenceFront\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_812_SilenceFrontRow__WEBPACK_IMPORTED_MODULE_38__.SilenceFrontRow, props);\n });\n addToCatalog(\"enableDirectML\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_813_EnableDirectMLRow__WEBPACK_IMPORTED_MODULE_43__.EnableDirectMLRow, props);\n });\n addToCatalog(\"mergeLab\", function (props) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_a01_MergeLab_Row__WEBPACK_IMPORTED_MODULE_41__.MergeLabRow, 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 _100_TitleArea__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./100_TitleArea */ \"./src/components/demo/100_TitleArea.tsx\");\n/* harmony import */ var _200_ServerControl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./200_ServerControl */ \"./src/components/demo/200_ServerControl.tsx\");\n/* harmony import */ var _300_ModelSetting__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./300_ModelSetting */ \"./src/components/demo/300_ModelSetting.tsx\");\n/* harmony import */ var _400_DeviceSetting__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./400_DeviceSetting */ \"./src/components/demo/400_DeviceSetting.tsx\");\n/* harmony import */ var _500_QualityControl__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./500_QualityControl */ \"./src/components/demo/500_QualityControl.tsx\");\n/* harmony import */ var _600_SpeakerSetting__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./600_SpeakerSetting */ \"./src/components/demo/600_SpeakerSetting.tsx\");\n/* harmony import */ var _700_ConverterSetting__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./700_ConverterSetting */ \"./src/components/demo/700_ConverterSetting.tsx\");\n/* harmony import */ var _800_AdvancedSetting__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./800_AdvancedSetting */ \"./src/components/demo/800_AdvancedSetting.tsx\");\n/* harmony import */ var _a00_Lab__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./a00_Lab */ \"./src/components/demo/a00_Lab.tsx\");\n\n\n\n\n\n\n\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(_900_Dialogs__WEBPACK_IMPORTED_MODULE_2__.Dialogs, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_100_TitleArea__WEBPACK_IMPORTED_MODULE_3__.TitleArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_200_ServerControl__WEBPACK_IMPORTED_MODULE_4__.ServerControl, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_300_ModelSetting__WEBPACK_IMPORTED_MODULE_5__.ModelSetting, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_600_SpeakerSetting__WEBPACK_IMPORTED_MODULE_8__.SpeakerSetting, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_700_ConverterSetting__WEBPACK_IMPORTED_MODULE_9__.ConverterSetting, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_400_DeviceSetting__WEBPACK_IMPORTED_MODULE_6__.DeviceSetting, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_a00_Lab__WEBPACK_IMPORTED_MODULE_11__.Lab, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_500_QualityControl__WEBPACK_IMPORTED_MODULE_7__.QualityControl, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_800_AdvancedSetting__WEBPACK_IMPORTED_MODULE_10__.AdvancedSetting, null)));\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/010_Demo.tsx?"); /***/ }), /***/ "./src/components/demo/100_TitleArea.tsx": /*!***********************************************!*\ !*** ./src/components/demo/100_TitleArea.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 */ TitleArea: () => (/* binding */ TitleArea)\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 _002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./002_ComponentGenerator */ \"./src/components/demo/002_ComponentGenerator.tsx\");\n/* harmony import */ var _001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../001_provider/001_AppRootProvider */ \"./src/001_provider/001_AppRootProvider.tsx\");\n\n\n\nvar TitleArea = function TitleArea() {\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_2__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var componentSettings = appGuiSettingState.appGuiSetting.front.title;\n var titleArea = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var components = componentSettings.map(function (x, index) {\n var c = (0,_002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_1__.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, components);\n }, []);\n return titleArea;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/100_TitleArea.tsx?"); /***/ }), /***/ "./src/components/demo/200_ServerControl.tsx": /*!***************************************************!*\ !*** ./src/components/demo/200_ServerControl.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 */ ServerControl: () => (/* binding */ ServerControl)\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 _101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../101_HeaderButton */ \"./src/components/101_HeaderButton.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./002_ComponentGenerator */ \"./src/components/demo/002_ComponentGenerator.tsx\");\n\n\n\n\n\nvar ServerControl = function ServerControl() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__.useGuiState)();\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_1__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var componentSettings = appGuiSettingState.appGuiSetting.front.serverControl;\n var accodionButton = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var accodionButtonProps = {\n stateControlCheckbox: guiState.stateControls.openServerControlCheckbox,\n tooltip: \"Open/Close\",\n onIcon: [\"fas\", \"caret-up\"],\n offIcon: [\"fas\", \"caret-up\"],\n animation: _101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__.AnimationTypes.spinner,\n tooltipClass: \"tooltip-right\"\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__.HeaderButton, accodionButtonProps);\n }, []);\n var serverControl = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var components = componentSettings.map(function (x, index) {\n var c = (0,_002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__.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, guiState.stateControls.openServerControlCheckbox.trigger, /*#__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-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"caret\"\n }, accodionButton), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"title\",\n onClick: function onClick() {\n guiState.stateControls.openServerControlCheckbox.updateState(!guiState.stateControls.openServerControlCheckbox.checked());\n }\n }, \"Server Control\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"partition-content\"\n }, components)));\n }, []);\n return serverControl;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/200_ServerControl.tsx?"); /***/ }), /***/ "./src/components/demo/300_ModelSetting.tsx": /*!**************************************************!*\ !*** ./src/components/demo/300_ModelSetting.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 */ ModelSetting: () => (/* binding */ ModelSetting)\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 _101_HeaderButton__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../101_HeaderButton */ \"./src/components/101_HeaderButton.tsx\");\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_AppRootProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../001_provider/001_AppRootProvider */ \"./src/001_provider/001_AppRootProvider.tsx\");\n/* harmony import */ var _002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./002_ComponentGenerator */ \"./src/components/demo/002_ComponentGenerator.tsx\");\n\n\n\n\n\nvar ModelSetting = function ModelSetting() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_2__.useGuiState)();\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_3__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var componentSettings = appGuiSettingState.appGuiSetting.front.modelSetting;\n var accodionButton = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var accodionButtonProps = {\n stateControlCheckbox: guiState.stateControls.openModelSettingCheckbox,\n tooltip: \"Open/Close\",\n onIcon: [\"fas\", \"caret-up\"],\n offIcon: [\"fas\", \"caret-up\"],\n animation: _101_HeaderButton__WEBPACK_IMPORTED_MODULE_1__.AnimationTypes.spinner,\n tooltipClass: \"tooltip-right\"\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_101_HeaderButton__WEBPACK_IMPORTED_MODULE_1__.HeaderButton, accodionButtonProps);\n }, []);\n var modelSetting = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var components = componentSettings.map(function (x, index) {\n var c = (0,_002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__.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, guiState.stateControls.openModelSettingCheckbox.trigger, /*#__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-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"caret\"\n }, accodionButton), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"title\",\n onClick: function onClick() {\n guiState.stateControls.openModelSettingCheckbox.updateState(!guiState.stateControls.openModelSettingCheckbox.checked());\n }\n }, \"Model Setting\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"partition-content\"\n }, components)));\n }, []);\n return modelSetting;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/300_ModelSetting.tsx?"); /***/ }), /***/ "./src/components/demo/400_DeviceSetting.tsx": /*!***************************************************!*\ !*** ./src/components/demo/400_DeviceSetting.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 */ DeviceSetting: () => (/* binding */ DeviceSetting)\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 _101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../101_HeaderButton */ \"./src/components/101_HeaderButton.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./002_ComponentGenerator */ \"./src/components/demo/002_ComponentGenerator.tsx\");\n\n\n\n\n\nvar DeviceSetting = function DeviceSetting() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__.useGuiState)();\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_1__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var componentSettings = appGuiSettingState.appGuiSetting.front.deviceSetting;\n var accodionButton = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var accodionButtonProps = {\n stateControlCheckbox: guiState.stateControls.openDeviceSettingCheckbox,\n tooltip: \"Open/Close\",\n onIcon: [\"fas\", \"caret-up\"],\n offIcon: [\"fas\", \"caret-up\"],\n animation: _101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__.AnimationTypes.spinner,\n tooltipClass: \"tooltip-right\"\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__.HeaderButton, accodionButtonProps);\n }, []);\n var deviceSetting = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var components = componentSettings.map(function (x, index) {\n var c = (0,_002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__.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, guiState.stateControls.openDeviceSettingCheckbox.trigger, /*#__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-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"caret\"\n }, accodionButton), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"title\",\n onClick: function onClick() {\n guiState.stateControls.openDeviceSettingCheckbox.updateState(!guiState.stateControls.openDeviceSettingCheckbox.checked());\n }\n }, \"Device Setting\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null)), /*#__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/400_DeviceSetting.tsx?"); /***/ }), /***/ "./src/components/demo/500_QualityControl.tsx": /*!****************************************************!*\ !*** ./src/components/demo/500_QualityControl.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 */ QualityControl: () => (/* binding */ QualityControl)\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 _101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../101_HeaderButton */ \"./src/components/101_HeaderButton.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./002_ComponentGenerator */ \"./src/components/demo/002_ComponentGenerator.tsx\");\n\n\n\n\n\nvar QualityControl = function QualityControl() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__.useGuiState)();\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_1__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var componentSettings = appGuiSettingState.appGuiSetting.front.qualityControl;\n var accodionButton = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var accodionButtonProps = {\n stateControlCheckbox: guiState.stateControls.openQualityControlCheckbox,\n tooltip: \"Open/Close\",\n onIcon: [\"fas\", \"caret-up\"],\n offIcon: [\"fas\", \"caret-up\"],\n animation: _101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__.AnimationTypes.spinner,\n tooltipClass: \"tooltip-right\"\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__.HeaderButton, accodionButtonProps);\n }, []);\n var deviceSetting = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var components = componentSettings.map(function (x, index) {\n var c = (0,_002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__.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, guiState.stateControls.openQualityControlCheckbox.trigger, /*#__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-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"caret\"\n }, accodionButton), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"title\",\n onClick: function onClick() {\n guiState.stateControls.openQualityControlCheckbox.updateState(!guiState.stateControls.openQualityControlCheckbox.checked());\n }\n }, \"Quality Control\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null)), /*#__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/500_QualityControl.tsx?"); /***/ }), /***/ "./src/components/demo/600_SpeakerSetting.tsx": /*!****************************************************!*\ !*** ./src/components/demo/600_SpeakerSetting.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 */ SpeakerSetting: () => (/* binding */ SpeakerSetting)\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 _101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../101_HeaderButton */ \"./src/components/101_HeaderButton.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./002_ComponentGenerator */ \"./src/components/demo/002_ComponentGenerator.tsx\");\n\n\n\n\n\nvar SpeakerSetting = function SpeakerSetting() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__.useGuiState)();\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_1__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var componentSettings = appGuiSettingState.appGuiSetting.front.speakerSetting;\n var accodionButton = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var accodionButtonProps = {\n stateControlCheckbox: guiState.stateControls.openSpeakerSettingCheckbox,\n tooltip: \"Open/Close\",\n onIcon: [\"fas\", \"caret-up\"],\n offIcon: [\"fas\", \"caret-up\"],\n animation: _101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__.AnimationTypes.spinner,\n tooltipClass: \"tooltip-right\"\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__.HeaderButton, accodionButtonProps);\n }, []);\n var deviceSetting = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var components = componentSettings.map(function (x, index) {\n var c = (0,_002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__.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, guiState.stateControls.openSpeakerSettingCheckbox.trigger, /*#__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-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"caret\"\n }, accodionButton), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"title\",\n onClick: function onClick() {\n guiState.stateControls.openSpeakerSettingCheckbox.updateState(!guiState.stateControls.openSpeakerSettingCheckbox.checked());\n }\n }, \"Speaker Setting\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null)), /*#__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/600_SpeakerSetting.tsx?"); /***/ }), /***/ "./src/components/demo/700_ConverterSetting.tsx": /*!******************************************************!*\ !*** ./src/components/demo/700_ConverterSetting.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 */ ConverterSetting: () => (/* binding */ ConverterSetting)\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 _101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../101_HeaderButton */ \"./src/components/101_HeaderButton.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./002_ComponentGenerator */ \"./src/components/demo/002_ComponentGenerator.tsx\");\n\n\n\n\n\nvar ConverterSetting = function ConverterSetting() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__.useGuiState)();\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_1__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var componentSettings = appGuiSettingState.appGuiSetting.front.converterSetting;\n var accodionButton = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var accodionButtonProps = {\n stateControlCheckbox: guiState.stateControls.openConverterSettingCheckbox,\n tooltip: \"Open/Close\",\n onIcon: [\"fas\", \"caret-up\"],\n offIcon: [\"fas\", \"caret-up\"],\n animation: _101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__.AnimationTypes.spinner,\n tooltipClass: \"tooltip-right\"\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__.HeaderButton, accodionButtonProps);\n }, []);\n var deviceSetting = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var components = componentSettings.map(function (x, index) {\n var c = (0,_002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__.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, guiState.stateControls.openConverterSettingCheckbox.trigger, /*#__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-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"caret\"\n }, accodionButton), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"title\",\n onClick: function onClick() {\n guiState.stateControls.openConverterSettingCheckbox.updateState(!guiState.stateControls.openConverterSettingCheckbox.checked());\n }\n }, \"Converter Setting\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null)), /*#__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/700_ConverterSetting.tsx?"); /***/ }), /***/ "./src/components/demo/800_AdvancedSetting.tsx": /*!*****************************************************!*\ !*** ./src/components/demo/800_AdvancedSetting.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 */ AdvancedSetting: () => (/* binding */ AdvancedSetting)\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 _101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../101_HeaderButton */ \"./src/components/101_HeaderButton.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./002_ComponentGenerator */ \"./src/components/demo/002_ComponentGenerator.tsx\");\n\n\n\n\n\nvar AdvancedSetting = function AdvancedSetting() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__.useGuiState)();\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_1__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var componentSettings = appGuiSettingState.appGuiSetting.front.advancedSetting;\n var accodionButton = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var accodionButtonProps = {\n stateControlCheckbox: guiState.stateControls.openAdvancedSettingCheckbox,\n tooltip: \"Open/Close\",\n onIcon: [\"fas\", \"caret-up\"],\n offIcon: [\"fas\", \"caret-up\"],\n animation: _101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__.AnimationTypes.spinner,\n tooltipClass: \"tooltip-right\"\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__.HeaderButton, accodionButtonProps);\n }, []);\n var deviceSetting = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var components = componentSettings.map(function (x, index) {\n var c = (0,_002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__.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, guiState.stateControls.openAdvancedSettingCheckbox.trigger, /*#__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-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"caret\"\n }, accodionButton), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"title\",\n onClick: function onClick() {\n guiState.stateControls.openAdvancedSettingCheckbox.updateState(!guiState.stateControls.openAdvancedSettingCheckbox.checked());\n }\n }, \"Advanced Setting\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null)), /*#__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/800_AdvancedSetting.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 _901_LicenseDialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./901_LicenseDialog */ \"./src/components/demo/901_LicenseDialog.tsx\");\n/* harmony import */ var _902_WaitingDialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./902_WaitingDialog */ \"./src/components/demo/902_WaitingDialog.tsx\");\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.showLicenseCheckbox.trigger, guiState.stateControls.showWaitingCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-container\",\n id: \"dialog\"\n }, guiState.stateControls.showLicenseCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_901_LicenseDialog__WEBPACK_IMPORTED_MODULE_2__.LicenseDialog, null), guiState.stateControls.showWaitingCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_902_WaitingDialog__WEBPACK_IMPORTED_MODULE_3__.WaitingDialog, null)));\n return dialogs;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/900_Dialogs.tsx?"); /***/ }), /***/ "./src/components/demo/901_LicenseDialog.tsx": /*!***************************************************!*\ !*** ./src/components/demo/901_LicenseDialog.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 */ LicenseDialog: () => (/* binding */ LicenseDialog)\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 _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n\n\n\nvar LicenseDialog = function LicenseDialog() {\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_1__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_2__.useGuiState)();\n var licenses = appGuiSettingState.appGuiSetting.dialogs.license;\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.showLicenseCheckbox.updateState(false);\n }\n }, \"close\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }));\n var records = licenses.map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n key: x.url,\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(\"a\", {\n href: x.url,\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, x.title)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n href: x.url,\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, x.auther, \"(\", x.contact, \")\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, x.license));\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 }, \"License\"), /*#__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: \"dialog-application-title\"\n }, \"Voice Changer Demo\"), records, closeButtonRow));\n }, [licenses]);\n return dialog;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/901_LicenseDialog.tsx?"); /***/ }), /***/ "./src/components/demo/902_WaitingDialog.tsx": /*!***************************************************!*\ !*** ./src/components/demo/902_WaitingDialog.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 */ 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 _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n\n\nvar WaitingDialog = function WaitingDialog() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__.useGuiState)();\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.showWaitingCheckbox.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: \"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-item-text\"\n }, \"please wait... (about 1 min)\"), /*#__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 }, \"export onnx file\"), /*#__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/a00_Lab.tsx": /*!*****************************************!*\ !*** ./src/components/demo/a00_Lab.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 */ Lab: () => (/* binding */ Lab)\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 _101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../101_HeaderButton */ \"./src/components/101_HeaderButton.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./002_ComponentGenerator */ \"./src/components/demo/002_ComponentGenerator.tsx\");\n\n\n\n\n\nvar Lab = function Lab() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__.useGuiState)();\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_1__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var componentSettings = appGuiSettingState.appGuiSetting.front.lab;\n var accodionButton = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var accodionButtonProps = {\n stateControlCheckbox: guiState.stateControls.openLabCheckbox,\n tooltip: \"Open/Close\",\n onIcon: [\"fas\", \"caret-up\"],\n offIcon: [\"fas\", \"caret-up\"],\n animation: _101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__.AnimationTypes.spinner,\n tooltipClass: \"tooltip-right\"\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_101_HeaderButton__WEBPACK_IMPORTED_MODULE_2__.HeaderButton, accodionButtonProps);\n }, []);\n var deviceSetting = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n var components = componentSettings.map(function (x, index) {\n var c = (0,_002_ComponentGenerator__WEBPACK_IMPORTED_MODULE_4__.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, guiState.stateControls.openLabCheckbox.trigger, /*#__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-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"caret\"\n }, accodionButton), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"title\",\n onClick: function onClick() {\n guiState.stateControls.openLabCheckbox.updateState(!guiState.stateControls.openLabCheckbox.checked());\n }\n }, \"Labs (Experimental)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null)), /*#__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/a00_Lab.tsx?"); /***/ }), /***/ "./src/components/demo/components/101_Title.tsx": /*!******************************************************!*\ !*** ./src/components/demo/components/101_Title.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 */ Title: () => (/* binding */ Title)\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 _const__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../const */ \"./src/const.ts\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n\n\n\nvar Title = function Title(props) {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_2__.useGuiState)();\n var githubLink = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return (0,_const__WEBPACK_IMPORTED_MODULE_1__.isDesktopApp)() ?\n /*#__PURE__*/\n // @ts-ignore\n react__WEBPACK_IMPORTED_MODULE_0___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_0___default().createElement(\"img\", {\n src: \"./assets/icons/github.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text\"\n }, \"github\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___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_0___default().createElement(\"img\", {\n src: \"./assets/icons/github.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text\"\n }, \"github\"));\n }, []);\n var manualLink = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return (0,_const__WEBPACK_IMPORTED_MODULE_1__.isDesktopApp)() ?\n /*#__PURE__*/\n // @ts-ignore\n react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"link tooltip\",\n onClick: function onClick() {\n window.electronAPI.openBrowser(\"https://zenn.dev/wok/books/0004_vc-client-v_1_5_1_x\");\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n src: \"./assets/icons/help-circle.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text\"\n }, \"manual\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n className: \"link tooltip\",\n href: \"https://zenn.dev/wok/books/0004_vc-client-v_1_5_1_x\",\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n src: \"./assets/icons/help-circle.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text\"\n }, \"manual\"));\n }, []);\n var toolLink = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return (0,_const__WEBPACK_IMPORTED_MODULE_1__.isDesktopApp)() ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"link tooltip\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n src: \"./assets/icons/tool.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-100px\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"p\", {\n onClick: function onClick() {\n // @ts-ignore\n window.electronAPI.openBrowser(\"https://w-okada.github.io/screen-recorder-ts/\");\n }\n }, \"screen capture\"))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"link tooltip\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n src: \"./assets/icons/tool.svg\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-100px\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"p\", {\n onClick: function onClick() {\n window.open(\"https://w-okada.github.io/screen-recorder-ts/\", '_blank', \"noreferrer\");\n }\n }, \"screen capture\")));\n }, []);\n var coffeeLink = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return (0,_const__WEBPACK_IMPORTED_MODULE_1__.isDesktopApp)() ?\n /*#__PURE__*/\n // @ts-ignore\n react__WEBPACK_IMPORTED_MODULE_0___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_0___default().createElement(\"img\", {\n className: \"donate-img\",\n src: \"./assets/buymeacoffee.png\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-100px\"\n }, \"donate(\\u5BC4\\u4ED8)\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___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_0___default().createElement(\"img\", {\n className: \"donate-img\",\n src: \"./assets/buymeacoffee.png\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"tooltip-text tooltip-text-100px\"\n }, \"donate(\\u5BC4\\u4ED8)\"));\n }, []);\n var licenseButton = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"link\",\n onClick: function onClick() {\n var _document$getElementB;\n (_document$getElementB = document.getElementById(\"dialog\")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add(\"dialog-container-show\");\n guiState.stateControls.showLicenseCheckbox.updateState(true);\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, \"License\"));\n }, []);\n var titleRow = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n if (props.lineNum == 2) {\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: \"top-title\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"title\"\n }, props.mainTitle)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"top-title\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"top-title-version\"\n }, props.subTitle), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"belongings\"\n }, githubLink, manualLink, toolLink, coffeeLink, licenseButton)));\n } else {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"top-title\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"title\"\n }, props.mainTitle), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"top-title-version\"\n }, props.subTitle), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"belongings\"\n }, githubLink, manualLink, toolLink, coffeeLink, licenseButton), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n className: \"belongings\"\n }));\n }\n }, [props.subTitle, props.mainTitle, props.lineNum]);\n return titleRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/101_Title.tsx?"); /***/ }), /***/ "./src/components/demo/components/102_ClearSettingRow.tsx": /*!****************************************************************!*\ !*** ./src/components/demo/components/102_ClearSettingRow.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 */ ClearSettingRow: () => (/* binding */ ClearSettingRow)\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_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/* harmony import */ var _const__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../const */ \"./src/const.ts\");\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/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n\n\n\n\n\n\n\n\nvar ClearSettingRow = function ClearSettingRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__.useAppState)();\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_6__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState,\n setClientType = _useAppRoot.setClientType;\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_7__.useGuiState)();\n var clientType = appGuiSettingState.appGuiSetting.id;\n var _useIndexedDB = (0,_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_4__.useIndexedDB)({\n clientType: clientType\n }),\n removeItem = _useIndexedDB.removeItem;\n var _useIndexedDB2 = (0,_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_4__.useIndexedDB)({\n clientType: null\n }),\n setItem = _useIndexedDB2.setItem;\n var clearSettingRow = (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 appState.clearSetting();\n case 2:\n _context.next = 4;\n return removeItem(_const__WEBPACK_IMPORTED_MODULE_5__.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 var onReloadClicked = /*#__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() {\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 location.reload();\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function onReloadClicked() {\n return _ref2.apply(this, arguments);\n };\n }();\n var onReselectVCClicked = /*#__PURE__*/function () {\n var _ref3 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee3() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n guiState.setIsConverting(false);\n if (!guiState.isConverting) {\n _context3.next = 5;\n break;\n }\n _context3.next = 4;\n return appState.clientSetting.stop();\n case 4:\n guiState.setIsConverting(false);\n case 5:\n setItem(_const__WEBPACK_IMPORTED_MODULE_5__.INDEXEDDB_KEY_DEFAULT_MODEL_TYPE, \"null\");\n setClientType(null);\n appGuiSettingState.clearAppGuiSetting();\n case 8:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return function onReselectVCClicked() {\n return _ref3.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-row split-2-2-6 left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: onClearSettingClicked\n }, \"clear setting\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: onReloadClicked\n }, \"reload\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: onReselectVCClicked\n }, \"re-select vc\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-text\"\n }));\n }, [appState.clientSetting, guiState.isConverting]);\n return clearSettingRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/102_ClearSettingRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/201_StartButtonRow.tsx": /*!***************************************************************!*\ !*** ./src/components/demo/components/201_StartButtonRow.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 */ StartButtonRow: () => (/* binding */ StartButtonRow)\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\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 StartButtonRow = function StartButtonRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)();\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_6__.useGuiState)();\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 appState.clientSetting.start();\n }, [startWithAudioContextCreate]);\n var startButtonRow = (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 (!(appState.serverSetting.serverSetting.enableServerAudio == 0)) {\n _context.next = 17;\n break;\n }\n if (appState.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 (!appState.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 appState.clientSetting.start();\n case 15:\n _context.next = 19;\n break;\n case 17:\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.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 (!(appState.serverSetting.serverSetting.enableServerAudio == 0)) {\n _context2.next = 6;\n break;\n }\n guiState.setIsConverting(false);\n _context2.next = 4;\n return appState.clientSetting.stop();\n case 4:\n _context2.next = 9;\n break;\n case 6:\n guiState.setIsConverting(false);\n console.log(\"Stop clicked\", appState.serverSetting.serverSetting);\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n serverAudioStated: 0\n }));\n case 9:\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 ? \"body-button-active\" : \"body-button-stanby\";\n var stopClassName = guiState.isConverting ? \"body-button-stanby\" : \"body-button-active\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-row split-3-2-2-3 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Start\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-button-container\"\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\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-input-container\"\n }));\n }, [guiState.isConverting, appState.clientSetting.start, appState.clientSetting.stop, appState.serverSetting.serverSetting,, appState.serverSetting.updateServerSettings]);\n return startButtonRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/201_StartButtonRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/202_PerformanceRow.tsx": /*!***************************************************************!*\ !*** ./src/components/demo/components/202_PerformanceRow.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 */ PerformanceRow: () => (/* binding */ PerformanceRow)\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\n\n\n\n\nvar PerformanceRow = function PerformanceRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__.useAppState)();\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 showPerformanceDetail = _useState2[0],\n setShowPerformanceDetail = _useState2[1];\n var performanceRow = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n if (appState.serverSetting.serverSetting.enableServerAudio) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"monitor:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, \"server device mode. refer console.\"));\n }\n var performanceDetailLabel = showPerformanceDetail ? \"[pre, main, post] <<\" : \"more >>\";\n var performanceData = showPerformanceDetail ? \"[\".concat(appState.performance.preprocessTime, \", \").concat(appState.performance.mainprocessTime, \",\").concat(appState.performance.postprocessTime, \"]\") : \"\";\n return /*#__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: \"body-row split-3-1-1-1-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"monitor:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, \"vol\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n className: \"body-item-text-small\"\n }, \"(rms)\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, \"buf\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n className: \"body-item-text-small\"\n }, \"(ms)\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, \"res\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n className: \"body-item-text-small\"\n }, \"(ms)\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"span\", {\n onClick: function onClick() {\n setShowPerformanceDetail(!showPerformanceDetail);\n }\n }, performanceDetailLabel))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-row split-3-1-1-1-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, appState.volume.toFixed(4)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, appState.bufferingTime), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, appState.performance.responseTime), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, performanceData)));\n }, [appState.volume, appState.bufferingTime, appState.performance, showPerformanceDetail, appState.serverSetting.serverSetting.enableServerAudio]);\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n if (!appState.updatePerformance) {\n return;\n }\n if (appState.serverSetting.serverSetting.enableServerAudio != 1) {\n return;\n }\n var execNext = true;\n var updatePerformance = /*#__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 appState.updatePerformance();\n case 2:\n if (execNext) {\n setTimeout(updatePerformance, 1000 * 2);\n }\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function updatePerformance() {\n return _ref.apply(this, arguments);\n };\n }();\n // updatePerformance()\n return function () {\n execNext = false;\n };\n }, [appState.updatePerformance, appState.serverSetting.serverSetting.enableServerAudio]);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null, performanceRow);\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/202_PerformanceRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/203_ServerInfoRow.tsx": /*!**************************************************************!*\ !*** ./src/components/demo/components/203_ServerInfoRow.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 */ ServerInfoRow: () => (/* binding */ ServerInfoRow)\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_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n\n\n\n\nvar ServerInfoRow = function ServerInfoRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__.useAppState)();\n var serverInfoRow = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n var onReloadClicked = /*#__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 var info;\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 appState.getInfo();\n case 2:\n info = _context.sent;\n console.log(\"info\", info);\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onReloadClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Model Info:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"body-item-text-item\"\n }, appState.serverSetting.serverSetting.configFile || \"\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"body-item-text-item\"\n }, appState.serverSetting.serverSetting.pyTorchModelFile || \"\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n className: \"body-item-text-item\"\n }, appState.serverSetting.serverSetting.onnxModelFile || \"\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: onReloadClicked\n }, \"reload\"))));\n }, [appState.getInfo, appState.serverSetting.serverSetting]);\n return serverInfoRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/203_ServerInfoRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/204_ModelSwitchRow.tsx": /*!***************************************************************!*\ !*** ./src/components/demo/components/204_ModelSwitchRow.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 */ ModelSwitchRow: () => (/* binding */ ModelSwitchRow)\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 ModelSwitchRow = function ModelSwitchRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__.useAppState)();\n var modelSwitchRow = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n var _appState$serverSetti;\n var slot = appState.serverSetting.serverSetting.modelSlotIndex;\n var onSwitchModelClicked = /*#__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(slot) {\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 // Quick hack for same slot is selected. 下3桁が実際のSlotID\n dummyModelSlotIndex = Math.floor(Date.now() / 1000) * 1000 + slot;\n _context.next = 3;\n return appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n modelSlotIndex: dummyModelSlotIndex\n }));\n case 3:\n setTimeout(function () {\n // quick hack\n appState.getInfo();\n }, 1000 * 2);\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onSwitchModelClicked(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n var onUpdateDefaultClicked = /*#__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() {\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 appState.serverSetting.updateModelDefault();\n case 2:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function onUpdateDefaultClicked() {\n return _ref2.apply(this, arguments);\n };\n }();\n var options = appState.serverSetting.serverSetting.modelSlots.map(function (x, index) {\n var filename = \"\";\n if (x.modelFile && x.modelFile.length > 0) {\n filename = x.modelFile.replace(/^.*[\\\\\\/]/, '');\n } else {\n return null;\n }\n var f0str = x.f0 == true ? \"f0\" : \"nof0\";\n var srstr = Math.floor(x.samplingRate / 1000) + \"K\";\n var embedstr = x.embChannels;\n var typestr = function () {\n if (x.modelType == \"pyTorchRVC\" || x.modelType == \"pyTorchRVCNono\") {\n return \"org\";\n } else if (x.modelType == \"pyTorchRVCv2\" || x.modelType == \"pyTorchRVCv2Nono\") {\n return \"orv_v2\";\n } else if (x.modelType == \"pyTorchWebUI\" || x.modelType == \"pyTorchWebUINono\") {\n return \"webui\";\n } else {\n return \"unknown\";\n }\n }();\n var metadata = x.deprecated ? \"[\".concat(index, \"] [deprecated version]\") : \"[\".concat(index, \"] [\").concat(f0str, \",\").concat(srstr, \",\").concat(embedstr, \",\").concat(typestr, \"]\");\n var tuning = \"t:\".concat(x.defaultTune);\n var useIndex = x.indexFile != null && x.featureFile != null ? \"i:true\" : \"i:false\";\n var defaultIndexRatio = \"ir:\".concat(x.defaultIndexRatio);\n var subMetadata = \"(\".concat(tuning, \",\").concat(useIndex, \",\").concat(defaultIndexRatio, \")\");\n var displayName = \"\".concat(metadata, \" \").concat(x.name || filename, \" \").concat(subMetadata);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"option\", {\n key: index,\n value: index\n }, displayName);\n }).filter(function (x) {\n return x != null;\n });\n var selectedTermOfUseUrl = ((_appState$serverSetti = appState.serverSetting.serverSetting.modelSlots[slot]) === null || _appState$serverSetti === void 0 ? void 0 : _appState$serverSetti.termsOfUseUrl) || null;\n var selectedTermOfUseUrlLink = selectedTermOfUseUrl ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"a\", {\n href: selectedTermOfUseUrl,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n className: \"body-item-text-small\"\n }, \"[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((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-row split-3-4-3 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Switch Model\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"select\", {\n className: \"body-select\",\n value: slot,\n onChange: function onChange(e) {\n onSwitchModelClicked(Number(e.target.value));\n }\n }, options), selectedTermOfUseUrlLink), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: onUpdateDefaultClicked\n }, \"update default\"))));\n }, [appState.getInfo, appState.serverSetting.serverSetting]);\n return modelSwitchRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/204_ModelSwitchRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/205_ONNXExportRow.tsx": /*!**************************************************************!*\ !*** ./src/components/demo/components/205_ONNXExportRow.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 */ ONNXExportRow: () => (/* binding */ ONNXExportRow)\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_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n\n\n\n\n\nvar ONNXExportRow = function ONNXExportRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__.useAppState)();\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_4__.useGuiState)();\n var onnxExporthRow = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n var onnxExportButtonAction = /*#__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 var _document$getElementB;\n var res, a;\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 (!guiState.isConverting) {\n _context.next = 3;\n break;\n }\n alert(\"cannot export onnx when voice conversion is enabled\");\n return _context.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 _context.next = 7;\n return appState.serverSetting.getOnnx();\n case 7:\n res = _context.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 _context.stop();\n }\n }, _callee);\n }));\n return function onnxExportButtonAction() {\n return _ref.apply(this, arguments);\n };\n }();\n var onDownloadClicked = function onDownloadClicked() {\n var slot = appState.serverSetting.serverSetting.modelSlotIndex;\n var model = appState.serverSetting.serverSetting.modelSlots[slot];\n var a = document.createElement(\"a\");\n a.href = model.modelFile;\n a.download = a.href.replace(/^.*[\\\\\\/]/, '');\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n guiState.stateControls.showWaitingCheckbox.updateState(false);\n };\n var exportOnnx = appState.serverSetting.serverSetting.framework == \"PyTorch\" ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button left-margin-1\",\n onClick: onnxExportButtonAction\n }, \"export onnx\") : /*#__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((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Export ONNX\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, exportOnnx, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button left-margin-1\",\n onClick: function onClick() {\n onDownloadClicked();\n }\n }, \"download\"))));\n }, [appState.getInfo, appState.serverSetting.serverSetting]);\n return onnxExporthRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/205_ONNXExportRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/206_ONNXExecutorRow.tsx": /*!****************************************************************!*\ !*** ./src/components/demo/components/206_ONNXExecutorRow.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 */ ONNXExecutorRow: () => (/* binding */ ONNXExecutorRow)\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 _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__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\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 ONNXExecutorRow = function ONNXExecutorRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)();\n var onnxExecutorRow = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (appState.serverSetting.serverSetting.framework != \"ONNX\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n var onOnnxExecutionProviderChanged = /*#__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 appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n onnxExecutionProvider: val\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onOnnxExecutionProviderChanged(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-item-title left-padding-2\"\n }, \"OnnxExecutionProvider\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.serverSetting.serverSetting.onnxExecutionProvider,\n onChange: function onChange(e) {\n onOnnxExecutionProviderChanged(e.target.value);\n }\n }, Object.values(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__.OnnxExecutionProvider).map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n }))));\n }, [appState.getInfo, appState.serverSetting.serverSetting]);\n return onnxExecutorRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/206_ONNXExecutorRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/207_ServerOpertationRow.tsx": /*!********************************************************************!*\ !*** ./src/components/demo/components/207_ServerOpertationRow.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 */ ServerOpertationRow: () => (/* binding */ ServerOpertationRow)\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_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n\n\n\n\n\nvar ServerOpertationRow = function ServerOpertationRow(props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__.useAppState)();\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_4__.useGuiState)();\n var serverOpertationRow = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n var onnxExportButtonAction = /*#__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 var _document$getElementB;\n var res, a;\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 (!guiState.isConverting) {\n _context.next = 3;\n break;\n }\n alert(\"cannot export onnx when voice conversion is enabled\");\n return _context.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 _context.next = 7;\n return appState.serverSetting.getOnnx();\n case 7:\n res = _context.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 _context.stop();\n }\n }, _callee);\n }));\n return function onnxExportButtonAction() {\n return _ref.apply(this, arguments);\n };\n }();\n var onDownloadClicked = function onDownloadClicked() {\n var slot = appState.serverSetting.serverSetting.modelSlotIndex;\n var model = appState.serverSetting.serverSetting.modelSlots[slot];\n var a = document.createElement(\"a\");\n a.href = model.modelFile;\n a.download = a.href.replace(/^.*[\\\\\\/]/, '');\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n };\n var onReloadClicked = /*#__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() {\n var info;\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 _context2.next = 2;\n return appState.getInfo();\n case 2:\n info = _context2.sent;\n console.log(\"info\", info);\n case 4:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function onReloadClicked() {\n return _ref2.apply(this, arguments);\n };\n }();\n var exportOnnx = appState.serverSetting.serverSetting.framework == \"PyTorch\" && props.showExportOnnx == true ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button left-margin-1\",\n onClick: onnxExportButtonAction\n }, \"export onnx\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n var download = props.showDownload ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button left-margin-1\",\n onClick: function onClick() {\n onDownloadClicked();\n }\n }, \"download\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n var reload = props.showReload ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: onReloadClicked\n }, \"reload\")) : /*#__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((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Operation\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, exportOnnx, download, reload)));\n }, [appState.getInfo, appState.serverSetting.serverSetting]);\n return serverOpertationRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/207_ServerOpertationRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/301-e_CommonFileSelectRow.tsx": /*!**********************************************************************!*\ !*** ./src/components/demo/components/301-e_CommonFileSelectRow.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 */ CommonFileSelectRow: () => (/* binding */ CommonFileSelectRow),\n/* harmony export */ Filekinds: () => (/* binding */ Filekinds)\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 _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/* 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\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 Filekinds = {\n \"mmvcv13Config\": \"mmvcv13Config\",\n \"mmvcv13Model\": \"mmvcv13Model\",\n \"mmvcv15Config\": \"mmvcv15Config\",\n \"mmvcv15Model\": \"mmvcv15Model\",\n \"soVitsSvc40Config\": \"soVitsSvc40Config\",\n \"soVitsSvc40Model\": \"soVitsSvc40Model\",\n \"soVitsSvc40Cluster\": \"soVitsSvc40Cluster\",\n \"soVitsSvc40v2Config\": \"soVitsSvc40v2Config\",\n \"soVitsSvc40v2Model\": \"soVitsSvc40v2Model\",\n \"soVitsSvc40v2Cluster\": \"soVitsSvc40v2Cluster\",\n \"rvcModel\": \"rvcModel\",\n \"rvcFeature\": \"rvcFeature\",\n \"rvcIndex\": \"rvcIndex\",\n \"ddspSvcModel\": \"ddspSvcModel\",\n \"ddspSvcModelConfig\": \"ddspSvcModelConfig\",\n \"ddspSvcDiffusion\": \"ddspSvcDiffusion\",\n \"ddspSvcDiffusionConfig\": \"ddspSvcDiffusionConfig\"\n};\nvar CommonFileSelectRow = function CommonFileSelectRow(props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)();\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_6__.useGuiState)();\n var commonFileSelectRow = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n var _targetModel$file;\n var slot = guiState.modelSlotNum;\n if (!appState.serverSetting.fileUploadSettings[slot]) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null);\n }\n if (appState.serverSetting.fileUploadSettings[slot].isSampleMode == true) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null);\n }\n var getTargetModelData = function getTargetModelData() {\n var targetSlot = appState.serverSetting.fileUploadSettings[slot];\n if (!targetSlot) {\n return null;\n }\n return targetSlot[props.fileKind];\n };\n var targetModel = getTargetModelData();\n var filenameText = (targetModel === null || targetModel === void 0 ? void 0 : targetModel.filename) || (targetModel === null || targetModel === void 0 ? void 0 : (_targetModel$file = targetModel.file) === null || _targetModel$file === void 0 ? void 0 : _targetModel$file.name) || \"\";\n var checkExtention = function checkExtention(filename) {\n var ext = filename.split('.').pop();\n if (!ext) {\n return false;\n }\n return props.acceptExtentions.includes(ext);\n };\n var onFileLoadClicked = /*#__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 file;\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 (0,_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_4__.fileSelector)(\"\");\n case 2:\n file = _context.sent;\n if (!(checkExtention(file.name) == false)) {\n _context.next = 6;\n break;\n }\n alert(\"\\u30E2\\u30C7\\u30EB\\u30D5\\u30A1\\u30A4\\u30EB\\u306E\\u62E1\\u5F35\\u5B50\\u306F\".concat(props.acceptExtentions, \"\\u3067\\u3042\\u308B\\u5FC5\\u8981\\u304C\\u3042\\u308A\\u307E\\u3059\\u3002\"));\n return _context.abrupt(\"return\");\n case 6:\n appState.serverSetting.fileUploadSettings[slot][props.fileKind] = {\n file: file\n };\n appState.serverSetting.fileUploadSettings[slot].sampleId = null;\n appState.serverSetting.setFileUploadSetting(slot, _objectSpread({}, appState.serverSetting.fileUploadSettings[slot]));\n case 9:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onFileLoadClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n var onFileClearClicked = function onFileClearClicked() {\n appState.serverSetting.fileUploadSettings[slot][props.fileKind] = null;\n appState.serverSetting.fileUploadSettings[slot].sampleId = null;\n appState.serverSetting.setFileUploadSetting(slot, _objectSpread({}, appState.serverSetting.fileUploadSettings[slot]));\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-title left-padding-2\"\n }, props.title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", null, filenameText)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: onFileLoadClicked\n }, \"select\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-button left-margin-1\",\n onClick: onFileClearClicked\n }, \"clear\")));\n }, [appState.serverSetting.fileUploadSettings, appState.serverSetting.setFileUploadSetting, appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings, guiState.modelSlotNum]);\n return commonFileSelectRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/301-e_CommonFileSelectRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/301-f_ModelUploadButtonRow.tsx": /*!***********************************************************************!*\ !*** ./src/components/demo/components/301-f_ModelUploadButtonRow.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 */ ModelUploadButtonRow2: () => (/* binding */ ModelUploadButtonRow2)\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_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n\n\n\n\n\nvar ModelUploadButtonRow2 = function ModelUploadButtonRow2(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__.useAppState)();\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_4__.useGuiState)();\n var modelUploadButtonRow = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n var slot = guiState.modelSlotNum;\n if (!appState.serverSetting.fileUploadSettings[slot]) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n }\n var onModelUploadClicked = /*#__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 appState.serverSetting.loadModel(slot);\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onModelUploadClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n var buttonText = appState.serverSetting.fileUploadSettings[slot].isSampleMode ? \"select\" : \"upload\";\n var uploadButtonClassName = appState.serverSetting.isUploading ? \"body-button-disabled\" : \"body-button\";\n var uploadButtonAction = appState.serverSetting.isUploading ? function () {} : onModelUploadClicked;\n var uploadButtonLabel = appState.serverSetting.isUploading ? \"wait...\" : buttonText;\n var uploadingStatus = appState.serverSetting.isUploading ? appState.serverSetting.uploadProgress == 0 ? \"loading model...(wait about 20sec)\" : \"processing.... \".concat(appState.serverSetting.uploadProgress.toFixed(1), \"%\") : \"\";\n var uploadedText = appState.serverSetting.fileUploadSettings[slot] == undefined ? \"\" : appState.serverSetting.fileUploadSettings[slot].uploaded ? \"\" : \"not uploaded\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-title left-padding-2\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, uploadingStatus), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: uploadButtonClassName,\n onClick: uploadButtonAction\n }, uploadButtonLabel), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-text-em\"\n }, uploadedText)));\n }, [appState.serverSetting.isUploading, appState.serverSetting.uploadProgress, appState.serverSetting.loadModel, guiState.modelSlotNum, appState.serverSetting.fileUploadSettings]);\n return modelUploadButtonRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/301-f_ModelUploadButtonRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/301-g_CorrespondenceSelectRow2.tsx": /*!***************************************************************************!*\ !*** ./src/components/demo/components/301-g_CorrespondenceSelectRow2.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 */ CorrespondenceSelectRow2: () => (/* binding */ CorrespondenceSelectRow2)\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 _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/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__ = __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\n\nvar CorrespondenceSelectRow2 = function CorrespondenceSelectRow2(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)();\n var CorrespondenceSelectRow = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n var correspondenceFileText = appState.clientSetting.clientSetting.correspondences ? JSON.stringify(appState.clientSetting.clientSetting.correspondences.map(function (x) {\n return x.dirname;\n })) : \"\";\n var onCorrespondenceFileLoadClicked = /*#__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 file, correspondenceText, cors;\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 (0,_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_4__.fileSelector)(\"\");\n case 2:\n file = _context.sent;\n _context.next = 5;\n return file.text();\n case 5:\n correspondenceText = _context.sent;\n cors = correspondenceText.split(\"\\n\").map(function (line) {\n var items = line.split(\"|\");\n if (items.length != 3) {\n console.warn(\"Invalid Correspondence Line:\", line);\n return null;\n } else {\n var cor = {\n sid: Number(items[0]),\n correspondence: Number(items[1]),\n dirname: items[2]\n };\n return cor;\n }\n }).filter(function (x) {\n return x != null;\n });\n console.log(\"recogninzed corresponding lines:\", cors);\n appState.clientSetting.updateClientSetting(_objectSpread(_objectSpread({}, appState.clientSetting.clientSetting), {}, {\n correspondences: cors\n }));\n case 9:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onCorrespondenceFileLoadClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n var onCorrespondenceFileClearClicked = function onCorrespondenceFileClearClicked() {\n appState.clientSetting.updateClientSetting(_objectSpread(_objectSpread({}, appState.clientSetting.clientSetting), {}, {\n correspondences: []\n }));\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-title left-padding-2\"\n }, \"Correspondence\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", null, correspondenceFileText)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: onCorrespondenceFileLoadClicked\n }, \"select\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-button left-margin-1\",\n onClick: onCorrespondenceFileClearClicked\n }, \"clear\")));\n }, [appState.clientSetting.clientSetting, appState.clientSetting.updateClientSetting]);\n return CorrespondenceSelectRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/301-g_CorrespondenceSelectRow2.tsx?"); /***/ }), /***/ "./src/components/demo/components/301-h_ModelSlotRowv2.tsx": /*!*****************************************************************!*\ !*** ./src/components/demo/components/301-h_ModelSlotRowv2.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 */ ModelSlotRow2: () => (/* binding */ ModelSlotRow2)\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 _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_1__ = __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_1___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__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\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 ModelSlotRow2 = function ModelSlotRow2(_prop) {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__.useGuiState)();\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__.useAppState)();\n var modelSlotRow = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n var slot = guiState.modelSlotNum;\n if (!appState.serverSetting.fileUploadSettings[slot]) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n }\n var onModelSlotChanged = function onModelSlotChanged(val) {\n guiState.setModelSlotNum(val);\n };\n var onModeChanged = function onModeChanged(val) {\n appState.serverSetting.fileUploadSettings[slot].isSampleMode = val;\n appState.serverSetting.setFileUploadSetting(slot, _objectSpread({}, appState.serverSetting.fileUploadSettings[slot]));\n };\n var isSampleMode = appState.serverSetting.fileUploadSettings[slot].isSampleMode;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-title left-padding-2\"\n }, \"Model Slot\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"select\", {\n value: slot,\n onChange: function onChange(e) {\n onModelSlotChanged(Number(e.target.value));\n }\n }, Array(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_1__.MAX_MODEL_SLOT_NUM).fill(0).map(function (_x, index) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"option\", {\n key: index,\n value: index\n }, index);\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"input\", {\n className: \"left-padding-1\",\n type: \"radio\",\n id: \"from-file\",\n name: \"sample-mode\",\n checked: isSampleMode == false,\n onChange: function onChange() {\n onModeChanged(false);\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"label\", {\n className: \"left-padding-05\",\n htmlFor: \"from-file\"\n }, \"file\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"input\", {\n className: \"left-padding-1\",\n type: \"radio\",\n id: \"from-net\",\n name: \"sample-mode\",\n checked: isSampleMode == true,\n onChange: function onChange() {\n onModeChanged(true);\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"label\", {\n className: \"left-padding-05\",\n htmlFor: \"from-net\"\n }, \"from net\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", null));\n }, [guiState.modelSlotNum, appState.serverSetting.fileUploadSettings]);\n return modelSlotRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/301-h_ModelSlotRowv2.tsx?"); /***/ }), /***/ "./src/components/demo/components/301-i_DefaultTuneRowv2.tsx": /*!*******************************************************************!*\ !*** ./src/components/demo/components/301-i_DefaultTuneRowv2.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 */ DefaultTuneRow2: () => (/* binding */ DefaultTuneRow2)\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/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.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\n\nvar DefaultTuneRow2 = function DefaultTuneRow2(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__.useGuiState)();\n var defaultTuneRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var slot = guiState.modelSlotNum;\n var fileUploadSetting = appState.serverSetting.fileUploadSettings[slot];\n if (!fileUploadSetting) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n }\n var currentValue = fileUploadSetting.defaultTune;\n var onDefaultTuneChanged = function onDefaultTuneChanged(val) {\n appState.serverSetting.setFileUploadSetting(slot, _objectSpread(_objectSpread({}, appState.serverSetting.fileUploadSettings[slot]), {}, {\n defaultTune: val\n }));\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-2-1-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-2 \"\n }, \"Default Tune\"), /*#__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: \"-50\",\n max: \"50\",\n step: \"1\",\n value: currentValue,\n onChange: function onChange(e) {\n onDefaultTuneChanged(Number(e.target.value));\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-val\"\n }, currentValue)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button-container\"\n }));\n }, [appState.serverSetting.fileUploadSettings, guiState.modelSlotNum]);\n return defaultTuneRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/301-i_DefaultTuneRowv2.tsx?"); /***/ }), /***/ "./src/components/demo/components/301-j_SampleModelSelectRow.tsx": /*!***********************************************************************!*\ !*** ./src/components/demo/components/301-j_SampleModelSelectRow.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 */ SampleModelSelectRow: () => (/* binding */ SampleModelSelectRow)\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_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.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/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.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_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 SampleModelSelectRow = function SampleModelSelectRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__.useAppState)();\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_4__.useGuiState)();\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_2__.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 sampleModelSelectRow = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n var slot = guiState.modelSlotNum;\n var fileUploadSetting = appState.serverSetting.fileUploadSettings[slot];\n if (!fileUploadSetting) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n }\n if (fileUploadSetting.isSampleMode == false) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n }\n var langs = appState.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_2___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n });\n var options = appState.serverSetting.serverSetting.sampleModels.filter(function (x) {\n return lang == \"All\" ? true : x.lang == lang;\n }).map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"option\", {\n key: x.id,\n value: x.id\n }, x.name);\n });\n var selectedSample = appState.serverSetting.serverSetting.sampleModels.find(function (x) {\n return x.id == fileUploadSetting.sampleId;\n });\n var creditText = selectedSample ? \"credit:\".concat(selectedSample.credit) : \"\";\n var termOfUseLink = selectedSample ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"a\", {\n href: selectedSample.termsOfUseUrl,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n className: \"body-item-text-small\"\n }, \"[terms of use]\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n var onModelSelected = function onModelSelected(val) {\n appState.serverSetting.setFileUploadSetting(slot, _objectSpread(_objectSpread({}, appState.serverSetting.fileUploadSettings[slot]), {}, {\n sampleId: val\n }));\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-title left-padding-2 \"\n }, \"Select Model\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"select\", {\n value: lang,\n onChange: function onChange(e) {\n setLang(e.target.value);\n }\n }, langOptions), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"select\", {\n value: fileUploadSetting.sampleId || \"\",\n onChange: function onChange(e) {\n onModelSelected(e.target.value);\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"option\", {\n disabled: true,\n value: \"\"\n }, \" -- select model -- \"), options)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, creditText, termOfUseLink));\n }, [appState.serverSetting.fileUploadSettings, guiState.modelSlotNum, lang]);\n return sampleModelSelectRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/301-j_SampleModelSelectRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/301_ModelUploaderRowv2.tsx": /*!*******************************************************************!*\ !*** ./src/components/demo/components/301_ModelUploaderRowv2.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 */ ModelUploaderRowv2: () => (/* binding */ ModelUploaderRowv2)\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 ModelUploaderRowv2 = function ModelUploaderRowv2(_props) {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__.useGuiState)();\n var modelUploaderRow = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Model Uploader\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-text\"\n }));\n }, [guiState.showPyTorchModelUpload]);\n return modelUploaderRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/301_ModelUploaderRowv2.tsx?"); /***/ }), /***/ "./src/components/demo/components/302_FrameworkRow.tsx": /*!*************************************************************!*\ !*** ./src/components/demo/components/302_FrameworkRow.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 */ FrameworkRow: () => (/* binding */ FrameworkRow)\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 _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/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__ = __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\n\nvar FrameworkRow = function FrameworkRow(props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)();\n var frameworkRow = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n if (!props.showFramework) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null);\n }\n var onFrameworkChanged = /*#__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 appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n framework: val\n }));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onFrameworkChanged(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Framework\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.serverSetting.serverSetting.framework,\n onChange: function onChange(e) {\n onFrameworkChanged(e.target.value);\n }\n }, Object.values(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_4__.Framework).map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n }))));\n }, [appState.serverSetting.serverSetting.framework, appState.serverSetting.updateServerSettings]);\n var onnxExecutorRow = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n if (appState.serverSetting.serverSetting.framework != \"ONNX\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null);\n }\n var onOnnxExecutionProviderChanged = /*#__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 appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n onnxExecutionProvider: val\n }));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function onOnnxExecutionProviderChanged(_x2) {\n return _ref2.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-title left-padding-2\"\n }, \"OnnxExecutionProvider\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.serverSetting.serverSetting.onnxExecutionProvider,\n onChange: function onChange(e) {\n onOnnxExecutionProviderChanged(e.target.value);\n }\n }, Object.values(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_4__.OnnxExecutionProvider).map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n }))));\n }, [appState.serverSetting.serverSetting.framework, appState.serverSetting.updateServerSettings]);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null, frameworkRow, onnxExecutorRow);\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/302_FrameworkRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/303_ModelSamplingRateRow.tsx": /*!*********************************************************************!*\ !*** ./src/components/demo/components/303_ModelSamplingRateRow.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 */ ModelSamplingRateRow: () => (/* binding */ ModelSamplingRateRow)\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 _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_2__ = __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_2___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__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\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 ModelSamplingRateRow = function ModelSamplingRateRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__.useAppState)();\n var modelSamplingRateRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n if (appState.serverSetting.serverSetting.framework != \"ONNX\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n }\n var onModelSamplingRateChanged = function onModelSamplingRateChanged(val) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n modelSamplingRate: val\n }));\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-2\"\n }, \"Model Sampling Rate\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.serverSetting.serverSetting.modelSamplingRate,\n onChange: function onChange(e) {\n onModelSamplingRateChanged(e.target.value);\n }\n }, Object.values(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_2__.ModelSamplingRate).map(function (x) {\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: \"body-item-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null)));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return modelSamplingRateRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/303_ModelSamplingRateRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/401-1_AudioInputMediaRow.tsx": /*!*********************************************************************!*\ !*** ./src/components/demo/components/401-1_AudioInputMediaRow.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 */ AudioInputMediaRow: () => (/* binding */ AudioInputMediaRow)\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 _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/* 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\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 AudioInputMediaRow = function AudioInputMediaRow() {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)();\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_6__.useGuiState)();\n var audioSrcNode = (0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)();\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n [_const__WEBPACK_IMPORTED_MODULE_7__.AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK].forEach(function (x) {\n var audio = document.getElementById(x);\n if (audio) {\n audio.volume = guiState.fileInputEchoback ? 1 : 0;\n }\n });\n }, [guiState.fileInputEchoback]);\n var audioInputMediaRow = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n if (guiState.audioInputForGUI != \"file\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement((react__WEBPACK_IMPORTED_MODULE_3___default().Fragment), null);\n }\n var onFileLoadClicked = /*#__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 url, audio, dst, audio_echo, audio_org;\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 (0,_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_4__.fileSelectorAsDataURL)(\"\");\n case 2:\n url = _context.sent;\n // input stream for client.\n audio = document.getElementById(_const__WEBPACK_IMPORTED_MODULE_7__.AUDIO_ELEMENT_FOR_TEST_CONVERTED);\n audio.pause();\n audio.srcObject = null;\n audio.src = url;\n _context.next = 9;\n return audio.play();\n case 9:\n if (!audioSrcNode.current) {\n audioSrcNode.current = appState.audioContext.createMediaElementSource(audio);\n }\n if (audioSrcNode.current.mediaElement != audio) {\n audioSrcNode.current = appState.audioContext.createMediaElementSource(audio);\n }\n dst = appState.audioContext.createMediaStreamDestination();\n audioSrcNode.current.connect(dst);\n appState.clientSetting.updateClientSetting(_objectSpread(_objectSpread({}, appState.clientSetting.clientSetting), {}, {\n audioInput: dst.stream\n }));\n audio_echo = document.getElementById(_const__WEBPACK_IMPORTED_MODULE_7__.AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK);\n audio_echo.srcObject = dst.stream;\n audio_echo.play();\n audio_echo.volume = 0;\n guiState.setFileInputEchoback(false);\n\n // original stream to play.\n audio_org = document.getElementById(_const__WEBPACK_IMPORTED_MODULE_7__.AUDIO_ELEMENT_FOR_TEST_ORIGINAL);\n audio_org.src = url;\n audio_org.pause();\n\n // audio_org.onplay = () => {\n // console.log(audioOutputRef.current)\n // // @ts-ignore\n // audio_org.setSinkId(audioOutputRef.current)\n // }\n case 22:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onFileLoadClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-title\"\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 style: {\n display: \"none\"\n }\n }, \"org:\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"audio\", {\n id: _const__WEBPACK_IMPORTED_MODULE_7__.AUDIO_ELEMENT_FOR_TEST_ORIGINAL,\n controls: true\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"audio\", {\n id: _const__WEBPACK_IMPORTED_MODULE_7__.AUDIO_ELEMENT_FOR_TEST_CONVERTED,\n controls: true\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"audio\", {\n id: _const__WEBPACK_IMPORTED_MODULE_7__.AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK,\n controls: true,\n hidden: true\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: onFileLoadClicked\n }, \"load\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"input\", {\n type: \"checkbox\",\n checked: guiState.fileInputEchoback,\n onChange: function onChange(e) {\n guiState.setFileInputEchoback(e.target.checked);\n }\n }), \" echoback\"));\n }, [guiState.audioInputForGUI, guiState.fileInputEchoback]);\n return audioInputMediaRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/401-1_AudioInputMediaRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/401_AudioInputRow.tsx": /*!**************************************************************!*\ !*** ./src/components/demo/components/401_AudioInputRow.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 */ AudioInputRow: () => (/* binding */ AudioInputRow)\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_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.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/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _401_1_AudioInputMediaRow__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./401-1_AudioInputMediaRow */ \"./src/components/demo/components/401-1_AudioInputMediaRow.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_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 AudioInputRow = function AudioInputRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__.useAppState)();\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_4__.useGuiState)();\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(\"\"),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState, 2),\n hostApi = _useState2[0],\n setHostApi = _useState2[1];\n\n // キャッシュの設定は反映(たぶん、設定操作の時も起動していしまう。が問題は起こらないはず)\n (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {\n if (typeof appState.clientSetting.clientSetting.audioInput == \"string\") {\n if (guiState.inputAudioDeviceInfo.find(function (x) {\n // console.log(\"COMPARE:\", x.deviceId, appState.clientSetting.setting.audioInput)\n return x.deviceId == appState.clientSetting.clientSetting.audioInput;\n })) {\n guiState.setAudioInputForGUI(appState.clientSetting.clientSetting.audioInput);\n }\n }\n }, [guiState.inputAudioDeviceInfo, appState.clientSetting.clientSetting.audioInput]);\n var audioInputRow = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n if (appState.serverSetting.serverSetting.enableServerAudio == 1) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n }\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"AudioInput\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"select\", {\n className: \"body-select\",\n value: guiState.audioInputForGUI,\n onChange: function onChange(e) {\n guiState.setAudioInputForGUI(e.target.value);\n if (guiState.audioInputForGUI != \"file\") {\n appState.clientSetting.updateClientSetting(_objectSpread(_objectSpread({}, appState.clientSetting.clientSetting), {}, {\n audioInput: e.target.value\n }));\n }\n }\n }, guiState.inputAudioDeviceInfo.map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"option\", {\n key: x.deviceId,\n value: x.deviceId\n }, x.label);\n }))));\n }, [guiState.inputAudioDeviceInfo, guiState.audioInputForGUI, appState.clientSetting.clientSetting, appState.clientSetting.updateClientSetting, appState.serverSetting.serverSetting.enableServerAudio]);\n var serverAudioInputRow = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n if (appState.serverSetting.serverSetting.enableServerAudio == 0) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null);\n }\n var devices = appState.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_2___default().createElement(\"option\", {\n value: x,\n key: index\n }, x);\n });\n var filteredDevice = devices.map(function (x, index) {\n var className = x.hostAPI == hostApi || hostApi == \"\" ? \"select-option-red\" : \"\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"option\", {\n className: className,\n value: x.index,\n key: index\n }, \"[\", x.hostAPI, \"]\", x.name);\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"AudioInput\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"select\", {\n name: \"kinds\",\n id: \"kinds\",\n value: hostApi,\n onChange: function onChange(e) {\n setHostApi(e.target.value);\n }\n }, hostAPIOptions), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.serverSetting.serverSetting.serverInputDeviceId,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n serverInputDeviceId: Number(e.target.value)\n }));\n }\n }, filteredDevice))));\n }, [hostApi, appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, audioInputRow, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_401_1_AudioInputMediaRow__WEBPACK_IMPORTED_MODULE_5__.AudioInputMediaRow, null), serverAudioInputRow);\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/401_AudioInputRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/402-1_AudioOutputRecordRow.tsx": /*!***********************************************************************!*\ !*** ./src/components/demo/components/402-1_AudioOutputRecordRow.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 */ AudioOutputRecordRow: () => (/* binding */ AudioOutputRecordRow)\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 _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n\n\n\n\n\n\nvar AudioOutputRecordRow = function AudioOutputRecordRow() {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__.useAppState)();\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_5__.useGuiState)();\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 outputRecordingStarted = _useState2[0],\n setOutputRecordingStarted = _useState2[1];\n var audioOutputRecordRow = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\n var onOutputRecordStartClicked = /*#__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 setOutputRecordingStarted(true);\n _context.next = 3;\n return appState.workletNodeSetting.startOutputRecording();\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onOutputRecordStartClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n var onOutputRecordStopClicked = /*#__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 record;\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 setOutputRecordingStarted(false);\n _context2.next = 3;\n return appState.workletNodeSetting.stopOutputRecording();\n case 3:\n record = _context2.sent;\n downloadRecord(record);\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function onOutputRecordStopClicked() {\n return _ref2.apply(this, arguments);\n };\n }();\n var startClassName = outputRecordingStarted ? \"body-button-active\" : \"body-button-stanby\";\n var stopClassName = outputRecordingStarted ? \"body-button-stanby\" : \"body-button-active\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-title left-padding-2\"\n }, \"output record\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n onClick: onOutputRecordStartClicked,\n className: startClassName\n }, \"start\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n onClick: onOutputRecordStopClicked,\n className: stopClassName\n }, \"stop\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-input-container\"\n }));\n }, [guiState.audioOutputForGUI, outputRecordingStarted, appState.workletNodeSetting.startOutputRecording, appState.workletNodeSetting.stopOutputRecording]);\n return audioOutputRecordRow;\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/components/402-1_AudioOutputRecordRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/402_AudioOutputRow.tsx": /*!***************************************************************!*\ !*** ./src/components/demo/components/402_AudioOutputRow.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 */ AudioOutputRow: () => (/* binding */ AudioOutputRow)\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 _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 _402_1_AudioOutputRecordRow__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./402-1_AudioOutputRecordRow */ \"./src/components/demo/components/402-1_AudioOutputRecordRow.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../001_provider/001_AppRootProvider */ \"./src/001_provider/001_AppRootProvider.tsx\");\n/* harmony import */ var _const__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../const */ \"./src/const.ts\");\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_10__ = __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\n\n\n\n\n\n\nvar AudioOutputRow = function AudioOutputRow(_props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_10__.useAppState)(),\n setAudioOutputElementId = _useAppState.setAudioOutputElementId,\n initializedRef = _useAppState.initializedRef;\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_10__.useAppState)();\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_7__.useGuiState)();\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_8__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var clientType = appGuiSettingState.appGuiSetting.id;\n var _useIndexedDB = (0,_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_5__.useIndexedDB)({\n clientType: clientType\n }),\n getItem = _useIndexedDB.getItem,\n setItem = _useIndexedDB.setItem;\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(\"\"),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useState, 2),\n hostApi = _useState2[0],\n setHostApi = _useState2[1];\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n var loadCache = /*#__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 var key;\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 getItem(_const__WEBPACK_IMPORTED_MODULE_9__.INDEXEDDB_KEY_AUDIO_OUTPUT);\n case 2:\n key = _context.sent;\n if (key) {\n guiState.setAudioOutputForGUI(key);\n }\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function loadCache() {\n return _ref.apply(this, arguments);\n };\n }();\n loadCache();\n }, []);\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n var setAudioOutput = /*#__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 mediaDeviceInfos;\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 navigator.mediaDevices.enumerateDevices();\n case 2:\n mediaDeviceInfos = _context2.sent;\n [_const__WEBPACK_IMPORTED_MODULE_9__.AUDIO_ELEMENT_FOR_PLAY_RESULT, _const__WEBPACK_IMPORTED_MODULE_9__.AUDIO_ELEMENT_FOR_TEST_ORIGINAL, _const__WEBPACK_IMPORTED_MODULE_9__.AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK].forEach(function (x) {\n var audio = document.getElementById(x);\n if (audio) {\n if (appState.serverSetting.serverSetting.enableServerAudio == 1) {\n // Server Audio を使う場合はElementから音は出さない。\n audio.volume = 0;\n } else if (guiState.audioOutputForGUI == \"none\") {\n // @ts-ignore\n audio.setSinkId(\"\");\n if (x == _const__WEBPACK_IMPORTED_MODULE_9__.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 == guiState.audioOutputForGUI;\n });\n if (found) {\n // @ts-ignore // 例外キャッチできないので事前にIDチェックが必要らしい。!?\n audio.setSinkId(guiState.audioOutputForGUI);\n } else {\n console.warn(\"No audio output device. use default\");\n }\n if (x == _const__WEBPACK_IMPORTED_MODULE_9__.AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK) {\n audio.volume = guiState.fileInputEchoback ? 1 : 0;\n } else {\n audio.volume = 1;\n }\n }\n }\n });\n case 4:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function setAudioOutput() {\n return _ref2.apply(this, arguments);\n };\n }();\n setAudioOutput();\n }, [guiState.audioOutputForGUI, guiState.fileInputEchoback, appState.serverSetting.serverSetting.enableServerAudio]);\n var audioOutputRow = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (appState.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: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"AudioOutput\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"body-select\",\n value: guiState.audioOutputForGUI,\n onChange: function onChange(e) {\n guiState.setAudioOutputForGUI(e.target.value);\n setItem(_const__WEBPACK_IMPORTED_MODULE_9__.INDEXEDDB_KEY_AUDIO_OUTPUT, e.target.value);\n }\n }, guiState.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 }, [appState.serverSetting.serverSetting.enableServerAudio, guiState.outputAudioDeviceInfo, guiState.audioOutputForGUI]);\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n setAudioOutputElementId(_const__WEBPACK_IMPORTED_MODULE_9__.AUDIO_ELEMENT_FOR_PLAY_RESULT);\n }, [initializedRef.current]);\n var serverAudioOutputRow = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (appState.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 = appState.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\n // const filteredDevice = devices.filter(x => { return x.hostAPI == hostApi || hostApi == \"\" }).map((x, index) => { return })\n var filteredDevice = devices.map(function (x, index) {\n var className = x.hostAPI == hostApi || hostApi == \"\" ? \"select-option-red\" : \"\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"option\", {\n className: className,\n value: x.index,\n key: index\n }, \"[\", x.hostAPI, \"]\", x.name);\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"AudioOutput\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n name: \"kinds\",\n id: \"kinds\",\n value: hostApi,\n onChange: function onChange(e) {\n setHostApi(e.target.value);\n }\n }, hostAPIOptions), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.serverSetting.serverSetting.serverOutputDeviceId,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n serverOutputDeviceId: Number(e.target.value)\n }));\n }\n }, filteredDevice))));\n }, [hostApi, appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null, audioOutputRow, appState.serverSetting.serverSetting.enableServerAudio == 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_402_1_AudioOutputRecordRow__WEBPACK_IMPORTED_MODULE_6__.AudioOutputRecordRow, null) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null), serverAudioOutputRow, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"audio\", {\n hidden: true,\n id: _const__WEBPACK_IMPORTED_MODULE_9__.AUDIO_ELEMENT_FOR_PLAY_RESULT\n }));\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/402_AudioOutputRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/410_AudioDeviceModeRow.tsx": /*!*******************************************************************!*\ !*** ./src/components/demo/components/410_AudioDeviceModeRow.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 */ AudioDeviceModeRow: () => (/* binding */ AudioDeviceModeRow)\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/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.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\n\nvar AudioDeviceModeRow = function AudioDeviceModeRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__.useGuiState)();\n var serverAudioInputRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var enableServerAudio = appState.serverSetting.serverSetting.enableServerAudio;\n var serverChecked = enableServerAudio == 1 ? true : false;\n var clientChecked = enableServerAudio == 1 ? false : true;\n var onDeviceModeChanged = function onDeviceModeChanged(val) {\n if (guiState.isConverting) {\n alert(\"cannot change mode when voice conversion is enabled\");\n return;\n }\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n enableServerAudio: val\n }));\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Device Mode\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___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_1___default().createElement(\"label\", {\n htmlFor: \"client-device\"\n }, \"client device\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___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_1___default().createElement(\"label\", {\n htmlFor: \"server-device\"\n }, \"server device(exp.)\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings, guiState.isConverting]);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, serverAudioInputRow);\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/410_AudioDeviceModeRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/411_IOBufferRow.tsx": /*!************************************************************!*\ !*** ./src/components/demo/components/411_IOBufferRow.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 */ IOBufferRow: () => (/* binding */ IOBufferRow)\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 IOBufferRow = function IOBufferRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var ioBufferRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n if (appState.serverSetting.serverSetting.enableServerAudio == 0) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n }\n var readBuf = appState.serverSetting.serverSetting.serverInputAudioBufferSize;\n var writeBuf = appState.serverSetting.serverSetting.serverOutputAudioBufferSize;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"I/O Buffer\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"left-padding-1\"\n }, \"In:\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: readBuf,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n serverInputAudioBufferSize: Number(e.target.value)\n }));\n appState.workletNodeSetting.trancateBuffer();\n }\n }, [1024 * 4, 1024 * 8, 1024 * 12, 1024 * 16, 1024 * 24, 1024 * 32].map(function (x) {\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: \"left-padding-1\"\n }, \"Out:\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: writeBuf,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n serverOutputAudioBufferSize: Number(e.target.value)\n }));\n appState.workletNodeSetting.trancateBuffer();\n }\n }, [1024 * 4, 1024 * 8, 1024 * 12, 1024 * 16, 1024 * 24, 1024 * 32].map(function (x) {\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: \"body-item-text\"\n }));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return ioBufferRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/411_IOBufferRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/501_NoiseControlRow.tsx": /*!****************************************************************!*\ !*** ./src/components/demo/components/501_NoiseControlRow.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 */ NoiseControlRow: () => (/* binding */ NoiseControlRow)\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 NoiseControlRow = function NoiseControlRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var noiseControlRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-2-2-2-1 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1 \"\n }, \"Noise Suppression\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"checkbox\",\n checked: appState.clientSetting.clientSetting.echoCancel,\n onChange: function onChange(e) {\n appState.clientSetting.updateClientSetting(_objectSpread(_objectSpread({}, appState.clientSetting.clientSetting), {}, {\n echoCancel: e.target.checked\n }));\n }\n }), \" echo cancel\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"checkbox\",\n checked: appState.clientSetting.clientSetting.noiseSuppression,\n onChange: function onChange(e) {\n appState.clientSetting.updateClientSetting(_objectSpread(_objectSpread({}, appState.clientSetting.clientSetting), {}, {\n noiseSuppression: e.target.checked\n }));\n }\n }), \" suppression1\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"checkbox\",\n checked: appState.clientSetting.clientSetting.noiseSuppression2,\n onChange: function onChange(e) {\n appState.clientSetting.updateClientSetting(_objectSpread(_objectSpread({}, appState.clientSetting.clientSetting), {}, {\n noiseSuppression2: e.target.checked\n }));\n }\n }), \" suppression2\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button-container\"\n }));\n }, [appState.clientSetting.clientSetting.echoCancel, appState.clientSetting.clientSetting.noiseSuppression, appState.clientSetting.clientSetting.noiseSuppression2, appState.clientSetting.updateClientSetting]);\n return noiseControlRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/501_NoiseControlRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/502_GainControlRow.tsx": /*!***************************************************************!*\ !*** ./src/components/demo/components/502_GainControlRow.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 */ GainControlRow: () => (/* binding */ GainControlRow)\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 GainControlRow = function GainControlRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var gainControlRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-2-2-3 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1 \"\n }, \"Gain Control\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-label\"\n }, \"in\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"range\",\n className: \"body-item-input-slider\",\n min: \"0.1\",\n max: \"10.0\",\n step: \"0.1\",\n value: appState.clientSetting.clientSetting.inputGain,\n onChange: function onChange(e) {\n appState.clientSetting.updateClientSetting(_objectSpread(_objectSpread({}, appState.clientSetting.clientSetting), {}, {\n inputGain: Number(e.target.value)\n }));\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-val\"\n }, appState.clientSetting.clientSetting.inputGain)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-label\"\n }, \"out\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"range\",\n className: \"body-item-input-slider\",\n min: \"0.1\",\n max: \"10.0\",\n step: \"0.1\",\n value: appState.clientSetting.clientSetting.outputGain,\n onChange: function onChange(e) {\n appState.clientSetting.updateClientSetting(_objectSpread(_objectSpread({}, appState.clientSetting.clientSetting), {}, {\n outputGain: Number(e.target.value)\n }));\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-val\"\n }, appState.clientSetting.clientSetting.outputGain)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button-container\"\n }));\n }, [appState.clientSetting.clientSetting.inputGain, appState.clientSetting.clientSetting.outputGain, appState.clientSetting.updateClientSetting]);\n return gainControlRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/502_GainControlRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/503_F0DetectorRow.tsx": /*!**************************************************************!*\ !*** ./src/components/demo/components/503_F0DetectorRow.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 */ F0DetectorRow: () => (/* binding */ F0DetectorRow)\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 F0DetectorRow = function F0DetectorRow(props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var f0DetectorRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var desc = {\n \"harvest\": \"harvest(High Quality)\",\n \"dio\": \"dio/pm(Light Weight)\"\n };\n var detectors = props.detectors || [\"dio\", \"harvest\"];\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1 \"\n }, \"F0 Detector\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.serverSetting.serverSetting.f0Detector,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n f0Detector: e.target.value\n }));\n }\n }, Object.values(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 }))));\n }, [appState.serverSetting.serverSetting.f0Detector, appState.serverSetting.updateServerSettings]);\n return f0DetectorRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/503_F0DetectorRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/510-1_SamplingRow.tsx": /*!**************************************************************!*\ !*** ./src/components/demo/components/510-1_SamplingRow.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 */ SamplingRow: () => (/* binding */ SamplingRow)\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 _const__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../const */ \"./src/const.ts\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.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\nvar SamplingRow = function SamplingRow() {\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 recording = _useState2[0],\n setRecording = _useState2[1];\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)();\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_7__.useGuiState)();\n var samplingRow = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n var onRecordStartClicked = /*#__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 setRecording(true);\n _context.next = 3;\n return appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n recordIO: 1\n }));\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onRecordStartClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n var onRecordStopClicked = /*#__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 setRecording(false);\n _context2.next = 3;\n return appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n recordIO: 0\n }));\n case 3:\n // set wav (input)\n wavInput = document.getElementById(_const__WEBPACK_IMPORTED_MODULE_6__.AUDIO_ELEMENT_FOR_SAMPLING_INPUT);\n wavInput.src = \"/tmp/in.wav?\" + new Date().getTime();\n wavInput.controls = true;\n // @ts-ignore\n wavInput.setSinkId(guiState.audioOutputForAnalyzer);\n\n // set wav (output)\n wavOutput = document.getElementById(_const__WEBPACK_IMPORTED_MODULE_6__.AUDIO_ELEMENT_FOR_SAMPLING_OUTPUT);\n wavOutput.src = \"/tmp/out.wav?\" + new Date().getTime();\n wavOutput.controls = true;\n // @ts-ignore\n wavOutput.setSinkId(guiState.audioOutputForAnalyzer);\n case 11:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function onRecordStopClicked() {\n return _ref2.apply(this, arguments);\n };\n }();\n var startClassName = recording ? \"body-button-active\" : \"body-button-stanby\";\n var stopClassName = recording ? \"body-button-stanby\" : \"body-button-active\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-item-title left-padding-2 \"\n }, \"Sampling\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: onRecordStartClicked,\n className: startClassName\n }, \"Start\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: onRecordStopClicked,\n className: stopClassName\n }, \"Stop\")));\n }, [recording, appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings, guiState.audioOutputForAnalyzer]);\n return samplingRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/510-1_SamplingRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/510-2_SamplingPlayRow.tsx": /*!******************************************************************!*\ !*** ./src/components/demo/components/510-2_SamplingPlayRow.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 */ SamplingPlayRow: () => (/* binding */ SamplingPlayRow)\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 _const__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../const */ \"./src/const.ts\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n\n\n\nvar SamplingPlayRow = function SamplingPlayRow() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_2__.useGuiState)();\n var samplingPlayRow = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-row split-3-2-2-3 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-title left-padding-2 \"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, \"Play\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"select\", {\n className: \"body-select-50 left-margin-2\",\n value: guiState.audioOutputForAnalyzer,\n onChange: function onChange(e) {\n guiState.setAudioOutputForAnalyzer(e.target.value);\n var wavInput = document.getElementById(_const__WEBPACK_IMPORTED_MODULE_1__.AUDIO_ELEMENT_FOR_SAMPLING_INPUT);\n var wavOutput = document.getElementById(_const__WEBPACK_IMPORTED_MODULE_1__.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 }, guiState.outputAudioDeviceInfo.map(function (x) {\n if (x.deviceId == \"none\") {\n return null;\n }\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___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_0___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-wav-container-title\"\n }, \"Input\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-wav-container-wav\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"audio\", {\n src: \"\",\n id: _const__WEBPACK_IMPORTED_MODULE_1__.AUDIO_ELEMENT_FOR_SAMPLING_INPUT\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-wav-container-title\"\n }, \"Output\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-wav-container-wav\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"audio\", {\n src: \"\",\n id: _const__WEBPACK_IMPORTED_MODULE_1__.AUDIO_ELEMENT_FOR_SAMPLING_OUTPUT\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null));\n }, [guiState.audioOutputForAnalyzer, guiState.outputAudioDeviceInfo]);\n return samplingPlayRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/510-2_SamplingPlayRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/510_AnalyzerRow.tsx": /*!************************************************************!*\ !*** ./src/components/demo/components/510_AnalyzerRow.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 */ AnalyzerRow: () => (/* binding */ AnalyzerRow)\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 _510_1_SamplingRow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./510-1_SamplingRow */ \"./src/components/demo/components/510-1_SamplingRow.tsx\");\n/* harmony import */ var _510_2_SamplingPlayRow__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./510-2_SamplingPlayRow */ \"./src/components/demo/components/510-2_SamplingPlayRow.tsx\");\n\n\n\nvar AnalyzerRow = function AnalyzerRow(_props) {\n var analyzerRow = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1 \"\n }, \"Analyzer\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"body-button-container\"\n }));\n }, []);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, analyzerRow, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_510_1_SamplingRow__WEBPACK_IMPORTED_MODULE_1__.SamplingRow, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_510_2_SamplingPlayRow__WEBPACK_IMPORTED_MODULE_2__.SamplingPlayRow, null));\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/510_AnalyzerRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/601_SrcIdRow.tsx": /*!*********************************************************!*\ !*** ./src/components/demo/components/601_SrcIdRow.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 */ SrcIdRow: () => (/* binding */ SrcIdRow)\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 SrcIdRow = function SrcIdRow(props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var srcIdRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n if (props.showF0) {\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: \"body-row split-3-2-1-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Source Speaker Id\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.serverSetting.serverSetting.srcId,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n srcId: Number(e.target.value)\n }));\n }\n }, appState.clientSetting.clientSetting.speakers.map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n key: x.id,\n value: x.id\n }, x.name, \"(\", x.id, \")\");\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-item-text\"\n }));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings, appState.clientSetting.clientSetting.speakers]);\n var srcIdRowWithF0 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var _appState$clientSetti, _appState$clientSetti2;\n if (!props.showF0) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n }\n var selectedCorrespondence = (_appState$clientSetti = appState.clientSetting.clientSetting.correspondences) === null || _appState$clientSetti === void 0 ? void 0 : _appState$clientSetti.find(function (x) {\n return x.sid == appState.serverSetting.serverSetting.srcId;\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-2-1-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Source Speaker Id\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.serverSetting.serverSetting.srcId,\n onChange: function onChange(e) {\n // const recF0 = calcDefaultF0Factor(Number(e.target.value), appState.serverSetting.serverSetting.dstId)\n // appState.serverSetting.updateServerSettings({ ...appState.serverSetting.serverSetting, srcId: Number(e.target.value), f0Factor: recF0 })\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n srcId: Number(e.target.value)\n }));\n }\n }, (_appState$clientSetti2 = appState.clientSetting.clientSetting.correspondences) === null || _appState$clientSetti2 === void 0 ? void 0 : _appState$clientSetti2.map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n key: x.sid,\n value: x.sid\n }, x.dirname, \"(\", x.sid, \")\");\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\", null, \"F0: \", (selectedCorrespondence === null || selectedCorrespondence === void 0 ? void 0 : selectedCorrespondence.correspondence.toFixed(1)) || \"\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-text\"\n }));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings, appState.clientSetting.clientSetting.correspondences]);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, srcIdRow, srcIdRowWithF0);\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/601_SrcIdRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/602_DstIdRow.tsx": /*!*********************************************************!*\ !*** ./src/components/demo/components/602_DstIdRow.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 */ DstIdDisplayType: () => (/* binding */ DstIdDisplayType),\n/* harmony export */ DstIdRow: () => (/* binding */ DstIdRow)\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 DstIdDisplayType = {\n \"MMVCv13\": \"MMVCv13\",\n \"MMVCv15\": \"MMVCv15\",\n \"sovitsvc40\": \"sovitsvc40\",\n \"sovitsvc40v2\": \"sovitsvc40v2\",\n \"rvc\": \"rvc\",\n \"ddspsvc\": \"ddspsvc\"\n};\nvar DstIdRow = function DstIdRow(props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var dstIdRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var _appState$clientSetti;\n if (props.dstIdDisplayType != \"MMVCv13\") {\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: \"body-row split-3-2-1-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Destination Speaker Id\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.serverSetting.serverSetting.dstId,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n dstId: Number(e.target.value)\n }));\n }\n }, (_appState$clientSetti = appState.clientSetting.clientSetting.speakers) === null || _appState$clientSetti === void 0 ? void 0 : _appState$clientSetti.map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n key: x.id,\n value: x.id\n }, x.name, \"(\", x.id, \")\");\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-item-text\"\n }));\n }, [appState.serverSetting.serverSetting, appState.clientSetting.clientSetting.speakers, appState.serverSetting.updateServerSettings]);\n var dstIdRowWithF0 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var _appState$clientSetti2, _appState$clientSetti3;\n if (props.dstIdDisplayType != \"MMVCv15\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n }\n var selected = (_appState$clientSetti2 = appState.clientSetting.clientSetting.correspondences) === null || _appState$clientSetti2 === void 0 ? void 0 : _appState$clientSetti2.find(function (x) {\n return x.sid == appState.serverSetting.serverSetting.dstId;\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-2-1-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Destination Speaker Id\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.serverSetting.serverSetting.dstId,\n onChange: function onChange(e) {\n // const recF0 = calcDefaultF0Factor(appState.serverSetting.serverSetting.srcId, Number(e.target.value))\n // appState.serverSetting.updateServerSettings({ ...appState.serverSetting.serverSetting, dstId: Number(e.target.value), f0Factor: recF0 })\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n dstId: Number(e.target.value)\n }));\n }\n }, (_appState$clientSetti3 = appState.clientSetting.clientSetting.correspondences) === null || _appState$clientSetti3 === void 0 ? void 0 : _appState$clientSetti3.map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n key: x.sid,\n value: x.sid\n }, x.dirname, \"(\", x.sid, \")\");\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\", null, \"F0: \", (selected === null || selected === void 0 ? void 0 : selected.correspondence.toFixed(1)) || \"\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-text\"\n }));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings, appState.clientSetting.clientSetting.correspondences]);\n var dstIdRowFromServer = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n if (props.dstIdDisplayType != \"sovitsvc40\" && props.dstIdDisplayType != \"sovitsvc40v2\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n }\n var settings = appState.serverSetting.serverSetting;\n var speakers = settings.speakers;\n if (!speakers) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n }\n var currentValue = Object.values(speakers).includes(appState.serverSetting.serverSetting.dstId) ? appState.serverSetting.serverSetting.dstId : -1;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-2-1-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Destination Speaker Id\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: currentValue,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n dstId: Number(e.target.value)\n }));\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n key: \"unknown\",\n value: 0\n }, \"default(0)\"), Object.keys(speakers).map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n key: x,\n value: speakers[x]\n }, x, \"(\", speakers[x], \")\");\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-item-text\"\n }));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings, appState.clientSetting.clientSetting.correspondences]);\n var dstIdRowStatic = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n if (props.dstIdDisplayType != \"rvc\" && props.dstIdDisplayType != \"ddspsvc\") {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n }\n\n // const settings = appState.serverSetting.serverSetting as ServerInfoSoVitsSVC\n // const speakers = settings.speakers\n // if (!speakers) {\n // return <>\n // }\n\n var currentValue = Object.values(props.staticIds).includes(appState.serverSetting.serverSetting.dstId) ? appState.serverSetting.serverSetting.dstId : -1;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-2-1-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Destination Speaker Id\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: currentValue,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n dstId: Number(e.target.value)\n }));\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n key: \"unknown\",\n value: 0\n }, \"default(0)\"), Object.values(props.staticIds).map(function (x) {\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: \"body-item-text\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-text\"\n }));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, dstIdRow, dstIdRowWithF0, dstIdRowFromServer, dstIdRowStatic);\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/602_DstIdRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/602v2_DstIdRow2.tsx": /*!************************************************************!*\ !*** ./src/components/demo/components/602v2_DstIdRow2.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 */ DstIdRow2: () => (/* binding */ DstIdRow2)\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 DstIdRow2 = function DstIdRow2(props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var dstIdRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-2-1-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Destination Speaker Id\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.serverSetting.serverSetting.dstId,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n dstId: Number(e.target.value)\n }));\n }\n }, props.selectableIds.map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n key: x,\n value: x\n }, x, \"(\", x, \")\");\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-item-text\"\n }));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, dstIdRow);\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/602v2_DstIdRow2.tsx?"); /***/ }), /***/ "./src/components/demo/components/603_EditSpeakerIdMappingRow.tsx": /*!************************************************************************!*\ !*** ./src/components/demo/components/603_EditSpeakerIdMappingRow.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 */ EditSpeakerIdMappingRow: () => (/* binding */ EditSpeakerIdMappingRow)\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 _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __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_3__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n\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\nvar EditSpeakerIdMappingRow = function EditSpeakerIdMappingRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_6__.useAppState)();\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(0),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(_useState, 2),\n editSpeakerTargetId = _useState2[0],\n setEditSpeakerTargetId = _useState2[1];\n var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(\"\"),\n _useState4 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(_useState3, 2),\n editSpeakerTargetName = _useState4[0],\n setEditSpeakerTargetName = _useState4[1];\n var editSpeakerIdMappingRow = (0,react__WEBPACK_IMPORTED_MODULE_5__.useMemo)(function () {\n var onSetSpeakerMappingClicked = /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee() {\n var targetId, targetName, targetSpeaker, newSpeakers;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n targetId = editSpeakerTargetId;\n targetName = editSpeakerTargetName;\n targetSpeaker = appState.clientSetting.clientSetting.speakers.find(function (x) {\n return x.id == targetId;\n });\n if (targetSpeaker) {\n if (targetName.length == 0) {\n // Delete\n newSpeakers = appState.clientSetting.clientSetting.speakers.filter(function (x) {\n return x.id != targetId;\n });\n appState.clientSetting.updateClientSetting(_objectSpread(_objectSpread({}, appState.clientSetting.clientSetting), {}, {\n speakers: newSpeakers\n }));\n } else {\n // Update\n targetSpeaker.name = targetName;\n appState.clientSetting.updateClientSetting(_objectSpread(_objectSpread({}, appState.clientSetting.clientSetting), {}, {\n speakers: (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(appState.clientSetting.clientSetting.speakers)\n }));\n }\n } else {\n if (targetName.length == 0) {// Noop\n } else {\n // add\n appState.clientSetting.clientSetting.speakers.push({\n id: targetId,\n name: targetName\n });\n appState.clientSetting.updateClientSetting(_objectSpread(_objectSpread({}, appState.clientSetting.clientSetting), {}, {\n speakers: (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(appState.clientSetting.clientSetting.speakers)\n }));\n }\n }\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onSetSpeakerMappingClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default().createElement(\"div\", {\n className: \"body-row split-3-1-2-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Edit Speaker Mapping\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default().createElement(\"input\", {\n type: \"number\",\n min: 1,\n max: 256,\n step: 1,\n value: editSpeakerTargetId,\n onChange: function onChange(e) {\n var _appState$clientSetti;\n var id = Number(e.target.value);\n setEditSpeakerTargetId(id);\n setEditSpeakerTargetName(((_appState$clientSetti = appState.clientSetting.clientSetting.speakers.find(function (x) {\n return x.id == id;\n })) === null || _appState$clientSetti === void 0 ? void 0 : _appState$clientSetti.name) || \"\");\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default().createElement(\"input\", {\n type: \"text\",\n value: editSpeakerTargetName,\n onChange: function onChange(e) {\n setEditSpeakerTargetName(e.target.value);\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: onSetSpeakerMappingClicked\n }, \"set\")));\n }, [appState.clientSetting.clientSetting.speakers, editSpeakerTargetId, editSpeakerTargetName]);\n return editSpeakerIdMappingRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/603_EditSpeakerIdMappingRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/604_F0FactorRow.tsx": /*!************************************************************!*\ !*** ./src/components/demo/components/604_F0FactorRow.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 */ F0FactorRow: () => (/* binding */ F0FactorRow)\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 F0FactorRow = function F0FactorRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var f0FactorRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var _appState$clientSetti, _appState$clientSetti2, _appState$serverSetti;\n var src = (_appState$clientSetti = appState.clientSetting.clientSetting.correspondences) === null || _appState$clientSetti === void 0 ? void 0 : _appState$clientSetti.find(function (x) {\n return x.sid == appState.serverSetting.serverSetting.srcId;\n });\n var dst = (_appState$clientSetti2 = appState.clientSetting.clientSetting.correspondences) === null || _appState$clientSetti2 === void 0 ? void 0 : _appState$clientSetti2.find(function (x) {\n return x.sid == appState.serverSetting.serverSetting.dstId;\n });\n var recommendedF0Factor = dst && src ? dst.correspondence / src.correspondence : 0;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-2-1-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"F0 Factor\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"range\",\n className: \"body-item-input-slider\",\n min: \"0.1\",\n max: \"5.0\",\n step: \"0.01\",\n value: appState.serverSetting.serverSetting.f0Factor || 0,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n f0Factor: Number(e.target.value)\n }));\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-val\"\n }, ((_appState$serverSetti = appState.serverSetting.serverSetting.f0Factor) === null || _appState$serverSetti === void 0 ? void 0 : _appState$serverSetti.toFixed(2)) || 0)), /*#__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-item-text\"\n }, \"recommend: \", recommendedF0Factor.toFixed(1)));\n }, [appState.serverSetting.serverSetting.f0Factor, appState.serverSetting.serverSetting.srcId, appState.serverSetting.serverSetting.dstId, appState.clientSetting.clientSetting.correspondences, appState.serverSetting.updateServerSettings]);\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n var _appState$clientSetti3, _appState$clientSetti4;\n var src = (_appState$clientSetti3 = appState.clientSetting.clientSetting.correspondences) === null || _appState$clientSetti3 === void 0 ? void 0 : _appState$clientSetti3.find(function (x) {\n return x.sid == appState.serverSetting.serverSetting.srcId;\n });\n var dst = (_appState$clientSetti4 = appState.clientSetting.clientSetting.correspondences) === null || _appState$clientSetti4 === void 0 ? void 0 : _appState$clientSetti4.find(function (x) {\n return x.sid == appState.serverSetting.serverSetting.dstId;\n });\n var recommendedF0Factor = dst && src ? dst.correspondence / src.correspondence : 0;\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n f0Factor: recommendedF0Factor\n }));\n }, [appState.serverSetting.serverSetting.srcId, appState.serverSetting.serverSetting.dstId]);\n return f0FactorRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/604_F0FactorRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/605_TuneRow.tsx": /*!********************************************************!*\ !*** ./src/components/demo/components/605_TuneRow.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 */ TuneRow: () => (/* binding */ TuneRow)\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/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.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\n\nvar TuneRow = function TuneRow(props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_3__.useGuiState)();\n var tuneRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var predictF0 = props.showPredictF0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"checkbox\",\n checked: appState.serverSetting.serverSetting.predictF0 == 1,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n predictF0: e.target.checked ? 1 : 0\n }));\n }\n }), \" predict f0\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-2-1-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1 \"\n }, \"Tuning\"), /*#__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: \"-50\",\n max: \"50\",\n step: \"1\",\n value: appState.serverSetting.serverSetting.tran || 0,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n tran: Number(e.target.value)\n }));\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-val\"\n }, appState.serverSetting.serverSetting.tran)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, predictF0), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button-container\"\n }));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings, guiState.modelSlotNum]);\n return tuneRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/605_TuneRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/606_ClusterInferRatioRow.tsx": /*!*********************************************************************!*\ !*** ./src/components/demo/components/606_ClusterInferRatioRow.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 */ ClusterInferRatioRow: () => (/* binding */ ClusterInferRatioRow)\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 ClusterInferRatioRow = function ClusterInferRatioRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var clusterRatioRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1 \"\n }, \"Cluster infer ratio\"), /*#__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: \"1\",\n step: \"0.1\",\n value: appState.serverSetting.serverSetting.clusterInferRatio || 0,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n clusterInferRatio: Number(e.target.value)\n }));\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-val\"\n }, appState.serverSetting.serverSetting.clusterInferRatio)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button-container\"\n }));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return clusterRatioRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/606_ClusterInferRatioRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/607_NoiseScaleRow.tsx": /*!**************************************************************!*\ !*** ./src/components/demo/components/607_NoiseScaleRow.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 */ NoiseScaleRow: () => (/* binding */ NoiseScaleRow)\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 NoiseScaleRow = function NoiseScaleRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var noiseScaleRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1 \"\n }, \"Noise Scale\"), /*#__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: \"1\",\n step: \"0.1\",\n value: appState.serverSetting.serverSetting.noiseScale || 0,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n noiseScale: Number(e.target.value)\n }));\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-val\"\n }, appState.serverSetting.serverSetting.noiseScale)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button-container\"\n }));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return noiseScaleRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/607_NoiseScaleRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/608_SilentThresholdRow.tsx": /*!*******************************************************************!*\ !*** ./src/components/demo/components/608_SilentThresholdRow.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 */ SilentThresholdRow: () => (/* binding */ SilentThresholdRow)\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 SilentThresholdRow = function SilentThresholdRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var silentThresholdRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1 \"\n }, \"Silent Threshold\"), /*#__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.00000\",\n max: \"0.001\",\n step: \"0.00001\",\n value: appState.serverSetting.serverSetting.silentThreshold || 0,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n silentThreshold: Number(e.target.value)\n }));\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-val\"\n }, appState.serverSetting.serverSetting.silentThreshold)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button-container\"\n }));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return silentThresholdRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/608_SilentThresholdRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/609_IndexRatioRow.tsx": /*!**************************************************************!*\ !*** ./src/components/demo/components/609_IndexRatioRow.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 */ IndexRatioRow: () => (/* binding */ IndexRatioRow)\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 IndexRatioRow = function IndexRatioRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var clusterRatioRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1 \"\n }, \"index ratio\"), /*#__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: \"1\",\n step: \"0.1\",\n value: appState.serverSetting.serverSetting.indexRatio || 0,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n indexRatio: Number(e.target.value)\n }));\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-val\"\n }, appState.serverSetting.serverSetting.indexRatio)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button-container\"\n }));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return clusterRatioRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/609_IndexRatioRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/611_DiffEnablerRow.tsx": /*!***************************************************************!*\ !*** ./src/components/demo/components/611_DiffEnablerRow.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 */ DiffEnablerRow: () => (/* binding */ DiffEnablerRow)\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 DiffEnablerRow = function DiffEnablerRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var diffEnablerRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-2-2-2-1 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1 \"\n }, \"DDSP Setting\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"checkbox\",\n checked: appState.serverSetting.serverSetting.useEnhancer == 1,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n useEnhancer: e.target.checked ? 1 : 0\n }));\n }\n }), \" Enhancer\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"checkbox\",\n checked: appState.serverSetting.serverSetting.useDiff == 1,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n useDiff: e.target.checked ? 1 : 0\n }));\n }\n }), \" Diff\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"checkbox\",\n checked: appState.serverSetting.serverSetting.useDiffSilence == 1,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n useDiffSilence: e.target.checked ? 1 : 0\n }));\n }\n }), \" Silence\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return diffEnablerRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/611_DiffEnablerRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/612_DiffSettingRow.tsx": /*!***************************************************************!*\ !*** ./src/components/demo/components/612_DiffSettingRow.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 */ DiffSettingRow: () => (/* binding */ DiffSettingRow)\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 DiffSettingRow = function DiffSettingRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var diffSettingRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-2-2-3 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1 \"\n }, \"Diff Setting\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-label\"\n }, \"Acc\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"range\",\n className: \"body-item-input-slider\",\n min: \"1\",\n max: \"20\",\n step: \"1\",\n value: appState.serverSetting.serverSetting.diffAcc,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n diffAcc: Number(e.target.value)\n }));\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-val\"\n }, appState.serverSetting.serverSetting.diffAcc)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-label\"\n }, \"kstep\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"range\",\n className: \"body-item-input-slider\",\n min: \"21\",\n max: \"300\",\n step: \"1\",\n value: appState.serverSetting.serverSetting.kStep,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n kStep: Number(e.target.value)\n }));\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n className: \"body-item-input-slider-val\"\n }, appState.serverSetting.serverSetting.kStep)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button-container\"\n }));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return diffSettingRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/612_DiffSettingRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/613_DiffMethodRow.tsx": /*!**************************************************************!*\ !*** ./src/components/demo/components/613_DiffMethodRow.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 */ DiffMethodRow: () => (/* binding */ DiffMethodRow)\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/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__);\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 DiffMethodRow = function DiffMethodRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var diffMethodRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var onDiffMethodChanged = function onDiffMethodChanged(val) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n diffMethod: val\n }));\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Diff Method\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.serverSetting.serverSetting.diffMethod,\n onChange: function onChange(e) {\n onDiffMethodChanged(e.target.value);\n }\n }, Object.values(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__.DiffMethod).map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n }))));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return diffMethodRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/613_DiffMethodRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/701_InputChunkNumRow.tsx": /*!*****************************************************************!*\ !*** ./src/components/demo/components/701_InputChunkNumRow.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 */ InputChunkNumRow: () => (/* binding */ InputChunkNumRow)\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 InputChunkNumRow = function InputChunkNumRow(props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var inputChunkNumRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var nums;\n if (!props.nums) {\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.nums;\n }\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-2-2-3 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Input Chunk Num(128sample/chunk)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.workletNodeSetting.workletNodeSetting.inputChunkNum,\n onChange: function onChange(e) {\n appState.workletNodeSetting.updateWorkletNodeSetting(_objectSpread(_objectSpread({}, appState.workletNodeSetting.workletNodeSetting), {}, {\n inputChunkNum: Number(e.target.value)\n }));\n appState.workletNodeSetting.trancateBuffer();\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n serverReadChunkSize: Number(e.target.value)\n }));\n }\n }, nums.map(function (x) {\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: \"body-item-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, \"buff: \", (appState.workletNodeSetting.workletNodeSetting.inputChunkNum * 128 * 1000 / 48000).toFixed(1), \"ms\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, \"sample: \", appState.workletNodeSetting.workletNodeSetting.inputChunkNum * 128)));\n }, [appState.workletNodeSetting.workletNodeSetting, appState.workletNodeSetting.updateWorkletNodeSetting, appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return inputChunkNumRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/701_InputChunkNumRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/702_ExtraDataLengthRow.tsx": /*!*******************************************************************!*\ !*** ./src/components/demo/components/702_ExtraDataLengthRow.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 */ ExtraDataLengthRow: () => (/* binding */ ExtraDataLengthRow)\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 ExtraDataLengthRow = function ExtraDataLengthRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var extraDataLengthRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-2-1-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Extra Data Length\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.serverSetting.serverSetting.extraConvertSize,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n extraConvertSize: Number(e.target.value)\n }));\n appState.workletNodeSetting.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_1___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\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-item-text\"\n }));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return extraDataLengthRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/702_ExtraDataLengthRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/703_GPURow.tsx": /*!*******************************************************!*\ !*** ./src/components/demo/components/703_GPURow.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 */ GPURow: () => (/* binding */ GPURow)\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 GPURow = function GPURow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var gpuRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"GPU\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"number\",\n min: -2,\n max: 5,\n step: 1,\n value: appState.serverSetting.serverSetting.gpu || 0,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n gpu: Number(e.target.value)\n }));\n }\n })));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return gpuRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/703_GPURow.tsx?"); /***/ }), /***/ "./src/components/demo/components/801_ServerURLRow.tsx": /*!*************************************************************!*\ !*** ./src/components/demo/components/801_ServerURLRow.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 */ ServerURLRow: () => (/* binding */ ServerURLRow)\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_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n\n\n\n\nvar ServerURLRow = function ServerURLRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__.useAppState)();\n var serverUrlRow = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {\n var onSetServerClicked = /*#__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 var input;\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 input = document.getElementById(\"mmvc-server-url\");\n appState.clientSetting.setServerUrl(input.value);\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onSetServerClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"MMVC Server\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"input\", {\n type: \"text\",\n defaultValue: appState.workletNodeSetting.workletNodeSetting.serverUrl,\n id: \"mmvc-server-url\",\n className: \"body-item-input\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: onSetServerClicked\n }, \"set\")));\n }, [appState.workletNodeSetting.workletNodeSetting, appState.clientSetting.setServerUrl]);\n return serverUrlRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/801_ServerURLRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/802_ProtocolRow.tsx": /*!************************************************************!*\ !*** ./src/components/demo/components/802_ProtocolRow.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 */ ProtocolRow: () => (/* binding */ ProtocolRow)\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 _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\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 ProtocolRow = function ProtocolRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_4__.useAppState)();\n var protocolRow = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(function () {\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 appState.workletNodeSetting.updateWorkletNodeSetting(_objectSpread(_objectSpread({}, appState.workletNodeSetting.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 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Protocol\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.workletNodeSetting.workletNodeSetting.protocol,\n onChange: function onChange(e) {\n onProtocolChanged(e.target.value);\n }\n }, Object.values(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_5__.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 }, [appState.workletNodeSetting.workletNodeSetting, appState.workletNodeSetting.updateWorkletNodeSetting]);\n return protocolRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/802_ProtocolRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/803_SampleRateRow.tsx": /*!**************************************************************!*\ !*** ./src/components/demo/components/803_SampleRateRow.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 */ SampleRateRow: () => (/* binding */ SampleRateRow)\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/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__);\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 SampleRateRow = function SampleRateRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var sampleRateRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Sample Rate\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.clientSetting.clientSetting.sampleRate,\n onChange: function onChange(e) {\n appState.clientSetting.updateClientSetting(_objectSpread(_objectSpread({}, appState.clientSetting.clientSetting), {}, {\n sampleRate: Number(e.target.value)\n }));\n }\n }, Object.values(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__.SampleRate).map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n }))));\n }, [appState.clientSetting.clientSetting, appState.clientSetting.updateClientSetting]);\n return sampleRateRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/803_SampleRateRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/804_SendingSampleRateRow.tsx": /*!*********************************************************************!*\ !*** ./src/components/demo/components/804_SendingSampleRateRow.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 */ SendingSampleRateRow: () => (/* binding */ SendingSampleRateRow)\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/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__);\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 SendingSampleRateRow = function SendingSampleRateRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var sendingSampleRateRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Sending Sample Rate\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.workletNodeSetting.workletNodeSetting.sendingSampleRate,\n onChange: function onChange(e) {\n appState.workletNodeSetting.updateWorkletNodeSetting(_objectSpread(_objectSpread({}, appState.workletNodeSetting.workletNodeSetting), {}, {\n sendingSampleRate: Number(e.target.value)\n }));\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n inputSampleRate: Number(e.target.value)\n }));\n }\n }, Object.values(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__.InputSampleRate).map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n }))));\n }, [appState.workletNodeSetting.workletNodeSetting, appState.workletNodeSetting.updateWorkletNodeSetting, appState.serverSetting.updateServerSettings]);\n return sendingSampleRateRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/804_SendingSampleRateRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/805_CrossFadeOverlapSizeRow.tsx": /*!************************************************************************!*\ !*** ./src/components/demo/components/805_CrossFadeOverlapSizeRow.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 */ CrossFadeOverlapSizeRow: () => (/* binding */ CrossFadeOverlapSizeRow)\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/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__);\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 CrossFadeOverlapSizeRow = function CrossFadeOverlapSizeRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var crossFadeOverlapSizeRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Cross Fade Overlap Size\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.serverSetting.serverSetting.crossFadeOverlapSize,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n crossFadeOverlapSize: Number(e.target.value)\n }));\n }\n }, Object.values(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__.CrossFadeOverlapSize).map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n }))));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return crossFadeOverlapSizeRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/805_CrossFadeOverlapSizeRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/806_CrossFadeOffsetRateRow.tsx": /*!***********************************************************************!*\ !*** ./src/components/demo/components/806_CrossFadeOffsetRateRow.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 */ CrossFadeOffsetRateRow: () => (/* binding */ CrossFadeOffsetRateRow)\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 CrossFadeOffsetRateRow = function CrossFadeOffsetRateRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var crossFadeOffsetRateRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Cross Fade Offset Rate\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.1,\n value: appState.serverSetting.serverSetting.crossFadeOffsetRate,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n crossFadeOffsetRate: Number(e.target.value)\n }));\n }\n })));\n }, [appState.serverSetting.serverSetting.crossFadeOffsetRate, appState.serverSetting.updateServerSettings]);\n return crossFadeOffsetRateRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/806_CrossFadeOffsetRateRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/807_CrossFadeEndRateRow.tsx": /*!********************************************************************!*\ !*** ./src/components/demo/components/807_CrossFadeEndRateRow.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 */ CrossFadeEndRateRow: () => (/* binding */ CrossFadeEndRateRow)\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 CrossFadeEndRateRow = function CrossFadeEndRateRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var crossFadeEndRateRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Cross Fade End Rate\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.1,\n value: appState.serverSetting.serverSetting.crossFadeEndRate,\n onChange: function onChange(e) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n crossFadeEndRate: Number(e.target.value)\n }));\n }\n })));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return crossFadeEndRateRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/807_CrossFadeEndRateRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/808_DownSamplingModeRow.tsx": /*!********************************************************************!*\ !*** ./src/components/demo/components/808_DownSamplingModeRow.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 */ DownSamplingModeRow: () => (/* binding */ DownSamplingModeRow)\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/* harmony import */ var _dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__);\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 DownSamplingModeRow = function DownSamplingModeRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var downSamplingModeRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1 \"\n }, \"DownSamplingMode\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-select-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n className: \"body-select\",\n value: appState.workletNodeSetting.workletNodeSetting.downSamplingMode,\n onChange: function onChange(e) {\n appState.workletNodeSetting.updateWorkletNodeSetting(_objectSpread(_objectSpread({}, appState.workletNodeSetting.workletNodeSetting), {}, {\n downSamplingMode: e.target.value\n }));\n }\n }, Object.values(_dannadori_voice_changer_client_js__WEBPACK_IMPORTED_MODULE_3__.DownSamplingMode).map(function (x) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n key: x,\n value: x\n }, x);\n }))));\n }, [appState.workletNodeSetting.workletNodeSetting, appState.workletNodeSetting.updateWorkletNodeSetting]);\n return downSamplingModeRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/808_DownSamplingModeRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/809_TrancateNumTresholdRow.tsx": /*!***********************************************************************!*\ !*** ./src/components/demo/components/809_TrancateNumTresholdRow.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 */ TrancateNumTresholdRow: () => (/* binding */ TrancateNumTresholdRow)\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 TrancateNumTresholdRow = function TrancateNumTresholdRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var trancateNumTresholdRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Trancate Num\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"input\", {\n type: \"number\",\n min: 5,\n max: 300,\n step: 1,\n value: appState.workletSetting.setting.numTrancateTreshold,\n onChange: function onChange(e) {\n appState.workletSetting.setSetting(_objectSpread(_objectSpread({}, appState.workletSetting.setting), {}, {\n numTrancateTreshold: Number(e.target.value)\n }));\n }\n })));\n }, [appState.workletSetting.setting, appState.workletSetting.setSetting]);\n return trancateNumTresholdRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/809_TrancateNumTresholdRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/810_RVCQualityRow.tsx": /*!**************************************************************!*\ !*** ./src/components/demo/components/810_RVCQualityRow.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 */ RVCQualityRow: () => (/* binding */ RVCQualityRow)\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 RVCQualityRow = function RVCQualityRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var trancateNumTresholdRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var onRVCQualityChanged = function onRVCQualityChanged(val) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n rvcQuality: val\n }));\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"RCV Quality\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n value: appState.serverSetting.serverSetting.rvcQuality,\n onChange: function onChange(e) {\n onRVCQualityChanged(Number(e.target.value));\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n value: \"0\"\n }, \"low\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n value: \"1\"\n }, \"high\"))));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return trancateNumTresholdRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/810_RVCQualityRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/812_SilenceFrontRow.tsx": /*!****************************************************************!*\ !*** ./src/components/demo/components/812_SilenceFrontRow.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 */ SilenceFrontRow: () => (/* binding */ SilenceFrontRow)\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 SilenceFrontRow = function SilenceFrontRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var trancateNumTresholdRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var onSilenceFrontChanged = function onSilenceFrontChanged(val) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n silenceFront: val\n }));\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Silence Front\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n value: appState.serverSetting.serverSetting.silenceFront,\n onChange: function onChange(e) {\n onSilenceFrontChanged(Number(e.target.value));\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n value: \"0\"\n }, \"off\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n value: \"1\"\n }, \"on\"))));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return trancateNumTresholdRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/812_SilenceFrontRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/813_EnableDirectMLRow.tsx": /*!******************************************************************!*\ !*** ./src/components/demo/components/813_EnableDirectMLRow.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 */ EnableDirectMLRow: () => (/* binding */ EnableDirectMLRow)\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 EnableDirectMLRow = function EnableDirectMLRow(_props) {\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_2__.useAppState)();\n var enableDirctMLRow = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var onEnableDirectMLChanged = function onEnableDirectMLChanged(val) {\n appState.serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, appState.serverSetting.serverSetting), {}, {\n enableDirectML: val\n }));\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-7 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"DirectML(experimental)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-input-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"select\", {\n value: appState.serverSetting.serverSetting.enableDirectML,\n onChange: function onChange(e) {\n onEnableDirectMLChanged(Number(e.target.value));\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n value: \"0\"\n }, \"off\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"option\", {\n value: \"1\"\n }, \"on\"))));\n }, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings]);\n return enableDirctMLRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/813_EnableDirectMLRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/990_DividerRow.tsx": /*!***********************************************************!*\ !*** ./src/components/demo/components/990_DividerRow.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 */ DividerRow: () => (/* binding */ DividerRow)\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 DividerRow = function DividerRow(_props) {\n var dividerRow = (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: \"body-row divider\"\n }));\n }, []);\n return dividerRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/990_DividerRow.tsx?"); /***/ }), /***/ "./src/components/demo/components/a01_MergeLab.Row.tsx": /*!*************************************************************!*\ !*** ./src/components/demo/components/a01_MergeLab.Row.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 */ MergeLabRow: () => (/* binding */ MergeLabRow)\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_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\n\n\n\n\n\nvar MergeLabRow = function MergeLabRow(_props) {\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)([]),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useState, 2),\n mergeElements = _useState2[0],\n setMergeElements = _useState2[1];\n var appState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)();\n var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(0),\n _useState4 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useState3, 2),\n defaultTune = _useState4[0],\n setDefaultTune = _useState4[1];\n\n // スロットが変更されたときの初期化処理\n var newSlotChangeKey = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n return appState.serverSetting.serverSetting.modelSlots.reduce(function (prev, cur) {\n return prev + \"_\" + cur.modelFile;\n }, \"\");\n }, [appState.serverSetting.serverSetting.modelSlots]);\n\n // マージ用データセットの初期化\n var clearMergeModelSetting = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n return function () {\n // PyTorchモデルだけフィルタリング\n var models = appState.serverSetting.serverSetting.modelSlots.filter(function (x) {\n return x.modelFile && x.modelFile.endsWith(\"onnx\") == false;\n });\n if (models.length == 0) {\n setMergeElements([]);\n return;\n }\n var newMergeElements = models.map(function (x) {\n var elem = {\n filename: x.modelFile,\n strength: 0\n };\n return elem;\n });\n setMergeElements(newMergeElements);\n };\n }, [appState.serverSetting.serverSetting.modelSlots]);\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n clearMergeModelSetting();\n }, [newSlotChangeKey]);\n var mergeLabRow = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n var onMergeClicked = /*#__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 appState.serverSetting.mergeModel({\n command: \"mix\",\n defaultTune: defaultTune,\n defaultIndexRatio: 1,\n files: mergeElements\n });\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onMergeClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n var onMergeElementsChanged = function onMergeElementsChanged(filename, strength) {\n console.log(\"targetelement\");\n var srcElements = mergeElements.filter(function (x) {\n return x.strength > 0;\n });\n var targetElement = mergeElements.find(function (x) {\n return x.filename == filename;\n });\n if (!targetElement) {\n console.warn(\"target model is not found\");\n return;\n }\n // 一つ目の対象モデル\n if (srcElements.length == 0) {\n targetElement.strength = strength;\n setMergeElements((0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(mergeElements));\n return;\n }\n\n //二つ目以降\n\n var srcSample = appState.serverSetting.serverSetting.modelSlots.find(function (x) {\n return x.modelFile == srcElements[0].filename;\n });\n var tgtSample = appState.serverSetting.serverSetting.modelSlots.find(function (x) {\n return x.modelFile == filename;\n });\n if (!srcSample || !tgtSample) {\n console.warn(\"target model is not found\", srcSample, tgtSample);\n return;\n }\n if (srcSample.samplingRate != tgtSample.samplingRate || srcSample.embChannels != tgtSample.embChannels || srcSample.modelType != tgtSample.modelType) {\n alert(\"current selected model is not same as the other selected.\");\n console.log(\"current selected model is not same as the other selected.\", srcSample.samplingRate, tgtSample.samplingRate, srcSample.embChannels, tgtSample.embChannels, srcSample.modelType, tgtSample.modelType);\n return;\n }\n targetElement.strength = strength;\n setMergeElements((0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(mergeElements));\n return;\n };\n var modelOptions = mergeElements.map(function (x, index) {\n var filename = \"\";\n if (x.filename.length > 0) {\n filename = x.filename.replace(/^.*[\\\\\\/]/, '');\n } else {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n key: index\n });\n }\n var modelInfo = appState.serverSetting.serverSetting.modelSlots.find(function (y) {\n return y.modelFile == x.filename;\n });\n if (!modelInfo) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n key: index\n });\n }\n var f0str = modelInfo.f0 == true ? \"f0\" : \"nof0\";\n var srstr = Math.floor(modelInfo.samplingRate / 1000) + \"K\";\n var embedstr = modelInfo.embChannels;\n var typestr = function () {\n if (modelInfo.modelType == \"pyTorchRVC\" || modelInfo.modelType == \"pyTorchRVCNono\") {\n return \"org\";\n } else if (modelInfo.modelType == \"pyTorchRVCv2\" || modelInfo.modelType == \"pyTorchRVCv2Nono\") {\n return \"orv_v2\";\n } else if (modelInfo.modelType == \"pyTorchWebUI\" || modelInfo.modelType == \"pyTorchWebUINono\") {\n return \"webui\";\n } else {\n return \"unknown\";\n }\n }();\n var metadata = \"[\".concat(f0str, \",\").concat(srstr, \",\").concat(embedstr, \",\").concat(typestr, \"]\");\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n key: index,\n className: \"merge-field split-8-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"merge-field-elem\"\n }, metadata, \" \", filename), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"merge-field-elem\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___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_4___default().createElement(\"span\", {\n className: \"body-item-input-slider-val\"\n }, x.strength)));\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-row split-3-3-4 left-padding-1 guided\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-item-title left-padding-1\"\n }, \"Model Merger\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"merge-field-container\"\n }, modelOptions, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"merge-field split-8-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"merge-field-elem grey-bold\"\n }, \"Default Tune\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"merge-field-elem\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"input\", {\n type: \"range\",\n className: \"body-item-input-slider-2nd\",\n min: \"-50\",\n max: \"50\",\n step: \"1\",\n value: defaultTune,\n onChange: function onChange(e) {\n setDefaultTune(Number(e.target.value));\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"body-item-input-slider-val\"\n }, defaultTune)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-button-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: onMergeClicked\n }, \"merge\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: clearMergeModelSetting\n }, \"clear\")));\n }, [mergeElements, appState.serverSetting.serverSetting, defaultTune]);\n return mergeLabRow;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components/a01_MergeLab.Row.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/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?"); /***/ }), /***/ "./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, \"/* 前提条件 */\\n\\n.rotate-button-container {\\n height: var(--header-height);\\n width: var(--header-height);\\n position: relative;\\n}\\n.rotate-button {\\n display: none;\\n}\\n.rotate-button ~ .rotate-lable {\\n padding: 2px;\\n position: absolute;\\n transition: all 0.3s;\\n cursor: pointer;\\n height: var(--header-height);\\n width: var(--header-height);\\n}\\n.rotate-button ~ .rotate-lable > * {\\n width: 100%;\\n height: 100%;\\n float: left;\\n transition: all 0.3s;\\n}\\n.rotate-button ~ .rotate-lable > * .spin-on {\\n width: 100%;\\n height: 100%;\\n display: none;\\n }\\n.rotate-button ~ .rotate-lable > * .spin-off {\\n width: 100%;\\n height: 100%;\\n display: blcok;\\n }\\n.rotate-button ~ .rotate-lable > .colored {\\n color: rgba(200, 200, 200, 0.8);\\n background: rgba(0, 0, 0, 1);\\n transition: all 0.3s;\\n}\\n.rotate-button ~ .rotate-lable > .colored .spin-on {\\n display: none;\\n }\\n.rotate-button ~ .rotate-lable > .colored .spin-off {\\n display: block;\\n }\\n.rotate-button:checked ~ .rotate-lable > .colored {\\n color: rgba(50, 240, 50, 0.8);\\n background: rgba(60, 60, 60, 1);\\n transition: all 0.3s;\\n}\\n.rotate-button:checked ~ .rotate-lable > .colored .spin-on {\\n display: block;\\n }\\n.rotate-button:checked ~ .rotate-lable > .colored .spin-off {\\n display: none;\\n }\\n\\n.rotate-button:checked ~ .rotate-lable > .spinner {\\n width: 100%;\\n height: 100%;\\n transform: rotate(180deg);\\n transition: all 0.3s;\\n box-sizing: border-box;\\n}\\n\\n.rotate-button:checked ~ .rotate-lable > .spinner .spin-on {\\n display: block;\\n }\\n\\n.rotate-button:checked ~ .rotate-lable > .spinner .spin-off {\\n display: none;\\n }\\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 {\\n --text-color: #333;\\n --company-color1: rgba(64, 119, 187, 1);\\n --company-color2: rgba(29, 47, 78, 1);\\n --company-color3: rgba(255, 255, 255, 1);\\n --company-color1-alpha: rgba(64, 119, 187, 0.3);\\n --company-color2-alpha: rgba(29, 47, 78, 0.3);\\n --company-color3-alpha: rgba(255, 255, 255, 0.3);\\n --global-shadow-color: rgba(0, 0, 0, 0.4);\\n\\n --sidebar-transition-time: 0.2s;\\n --sidebar-transition-time-quick: 0.1s;\\n --sidebar-transition-animation: ease-in-out;\\n\\n --header-height: 1.5rem;\\n --right-sidebar-width: 320px;\\n\\n --dialog-border-color: rgba(100, 100, 100, 1);\\n --dialog-shadow-color: rgba(0, 0, 0, 0.3);\\n --dialog-background-color: rgba(255, 255, 255, 1);\\n --dialog-primary-color: rgba(19, 70, 209, 1);\\n --dialog-active-color: rgba(40, 70, 209, 1);\\n --dialog-input-border-color: rgba(200, 200, 200, 1);\\n --dialog-submit-button-color: rgba(180, 190, 230, 1);\\n --dialog-cancel-button-color: rgba(235, 80, 80, 1);\\n\\n --body-video-seeker-height: 3rem;\\n}\\n\\n* {\\n margin: 0;\\n padding: 0;\\n box-sizing: border-box;\\n font-family: \\\"Poppins\\\", sans-serif;\\n}\\nhtml {\\n font-size: 16px;\\n}\\nbody {\\n height: 100%;\\n width: 100%;\\n overflow-y: scroll;\\n overflow-x: hidden;\\n color: var(--text-color);\\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%); */\\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%);\\n}\\n#app {\\n height: 100%;\\n width: 100%;\\n}\\n.first-gesture {\\n background: rgba(200, 0, 0, 0.2);\\n width: 100%;\\n height: 100%;\\n position: absolute;\\n}\\n\\n/* Main + Section Partition*/\\n.main-body {\\n height: 100%;\\n width: 100%;\\n padding: 2rem;\\n font-family: \\\"Yusei Magic\\\", sans-serif;\\n display: flex;\\n flex-direction: column;\\n font-size: 1rem;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n user-select: none;\\n}\\n/* Title */\\n.main-body .top-title .title {\\n font-size: 3rem;\\n }\\n.main-body .top-title .top-title-version {\\n margin-left: 2rem;\\n font-size: 1.2rem;\\n background: linear-gradient(transparent 60%, yellow 30%);\\n }\\n.main-body .top-title .belongings {\\n margin-left: 1rem;\\n margin-right: 1rem;\\n }\\n.main-body .top-title .belongings .link {\\n margin-left: 1rem;\\n font-weight: 700;\\n text-decoration: underline;\\n }\\n/* Partition */\\n.main-body .partition {\\n width: 100%;\\n }\\n.main-body .partition .partition-header {\\n font-weight: 700;\\n color: rgb(71, 69, 69);\\n display: flex;\\n }\\n.main-body .partition .partition-header .caret {\\n width: 2rem;\\n }\\n.main-body .partition .partition-header .title {\\n font-size: 1.1rem;\\n }\\n.main-body .partition .partition-header .belongings {\\n font-weight: 400;\\n font-size: 0.8rem;\\n display: flex;\\n flex-direction: row;\\n align-items: flex-end;\\n margin-left: 10px;\\n }\\n.main-body .partition .partition-header .belongings .belongings-checkbox {\\n margin-bottom: 3px;\\n }\\n.main-body .partition .partition-content {\\n position: static;\\n overflow-y: hidden;\\n }\\n.main-body .partition .row-split {\\n }\\n.state-control-checkbox:checked + .partition .partition-content {\\n max-height: 700px;\\n background: rgba(255, 255, 255, 0.3);\\n transition: all var(--sidebar-transition-time) var(--sidebar-transition-animation);\\n}\\n.state-control-checkbox + .partition .partition-content {\\n max-height: 0px;\\n background: rgba(233, 233, 255, 0.3);\\n transition: all var(--sidebar-transition-time) var(--sidebar-transition-animation);\\n}\\n/* ROW */\\n\\n.split-8-2 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n\\n.split-8-2 > div:nth-child(1) {\\n left: 0px;\\n width: 80%;\\n }\\n\\n.split-8-2 > div:nth-child(2) {\\n left: 80%;\\n width: 20%;\\n }\\n.split-6-4 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n.split-6-4 > div:nth-child(1) {\\n left: 0px;\\n width: 60%;\\n }\\n.split-6-4 > div:nth-child(2) {\\n left: 60%;\\n width: 40%;\\n }\\n.split-5-5 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n.split-5-5 > div:nth-child(1) {\\n left: 0px;\\n width: 50%;\\n }\\n.split-5-5 > div:nth-child(2) {\\n left: 50%;\\n width: 50%;\\n }\\n.split-4-6 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n.split-4-6 > div:nth-child(1) {\\n left: 0px;\\n width: 40%;\\n }\\n.split-4-6 > div:nth-child(2) {\\n left: 40%;\\n width: 60%;\\n }\\n.split-3-7 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n.split-3-7 > div:nth-child(1) {\\n left: 0px;\\n width: 30%;\\n }\\n.split-3-7 > div:nth-child(2) {\\n left: 30%;\\n width: 70%;\\n }\\n\\n.split-2-8 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n\\n.split-2-8 > div:nth-child(1) {\\n left: 0px;\\n width: 20%;\\n }\\n\\n.split-2-8 > div:nth-child(2) {\\n left: 20%;\\n width: 80%;\\n }\\n\\n.split-1-8-1 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n\\n.split-1-8-1 > div:nth-child(1) {\\n left: 0px;\\n width: 10%;\\n }\\n\\n.split-1-8-1 > div:nth-child(2) {\\n left: 10%;\\n width: 80%;\\n }\\n\\n.split-1-8-1 > div:nth-child(3) {\\n left: 90%;\\n width: 10%;\\n }\\n.split-2-2-6 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n.split-2-2-6 > div:nth-child(1) {\\n left: 0px;\\n width: 20%;\\n }\\n.split-2-2-6 > div:nth-child(2) {\\n left: 20%;\\n width: 20%;\\n }\\n.split-2-2-6 > div:nth-child(3) {\\n left: 40%;\\n width: 60%;\\n }\\n.split-3-3-4 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n.split-3-3-4 > div:nth-child(1) {\\n left: 0px;\\n width: 30%;\\n }\\n.split-3-3-4 > div:nth-child(2) {\\n left: 30%;\\n width: 30%;\\n }\\n.split-3-3-4 > div:nth-child(3) {\\n left: 60%;\\n width: 40%;\\n }\\n\\n.split-3-4-3 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n\\n.split-3-4-3 > div:nth-child(1) {\\n left: 0px;\\n width: 30%;\\n }\\n\\n.split-3-4-3 > div:nth-child(2) {\\n left: 30%;\\n width: 40%;\\n }\\n\\n.split-3-4-3 > div:nth-child(3) {\\n left: 70%;\\n width: 30%;\\n }\\n.split-2-5-3 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n.split-2-5-3 > div:nth-child(1) {\\n left: 0px;\\n width: 20%;\\n }\\n.split-2-5-3 > div:nth-child(2) {\\n left: 20%;\\n width: 50%;\\n }\\n.split-2-5-3 > div:nth-child(3) {\\n left: 70%;\\n width: 30%;\\n }\\n.split-4-4-2 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n.split-4-4-2 > div:nth-child(1) {\\n left: 0px;\\n width: 40%;\\n }\\n.split-4-4-2 > div:nth-child(2) {\\n left: 40%;\\n width: 40%;\\n }\\n.split-4-4-2 > div:nth-child(3) {\\n left: 80%;\\n width: 20%;\\n }\\n.split-1-4-4-1 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n.split-1-4-4-1 > div:nth-child(1) {\\n left: 0px;\\n width: 10%;\\n }\\n.split-1-4-4-1 > div:nth-child(2) {\\n left: 10%;\\n width: 40%;\\n }\\n.split-1-4-4-1 > div:nth-child(3) {\\n left: 50%;\\n width: 40%;\\n }\\n.split-1-4-4-1 > div:nth-child(4) {\\n left: 90%;\\n width: 10%;\\n }\\n\\n.split-3-2-2-3 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n\\n.split-3-2-2-3 > div:nth-child(1) {\\n left: 0px;\\n width: 30%;\\n }\\n\\n.split-3-2-2-3 > div:nth-child(2) {\\n left: 30%;\\n width: 20%;\\n }\\n\\n.split-3-2-2-3 > div:nth-child(3) {\\n left: 50%;\\n width: 20%;\\n }\\n\\n.split-3-2-2-3 > div:nth-child(4) {\\n left: 70%;\\n width: 30%;\\n }\\n.split-3-2-3-2 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n.split-3-2-3-2 > div:nth-child(1) {\\n left: 0px;\\n width: 30%;\\n }\\n.split-3-2-3-2 > div:nth-child(2) {\\n left: 30%;\\n width: 20%;\\n }\\n.split-3-2-3-2 > div:nth-child(3) {\\n left: 50%;\\n width: 30%;\\n }\\n.split-3-2-3-2 > div:nth-child(4) {\\n left: 80%;\\n width: 20%;\\n }\\n.split-3-1-2-4 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n.split-3-1-2-4 > div:nth-child(1) {\\n left: 0px;\\n width: 30%;\\n }\\n.split-3-1-2-4 > div:nth-child(2) {\\n left: 30%;\\n width: 10%;\\n }\\n.split-3-1-2-4 > div:nth-child(3) {\\n left: 40%;\\n width: 20%;\\n }\\n.split-3-1-2-4 > div:nth-child(4) {\\n left: 60%;\\n width: 40%;\\n }\\n.split-3-2-1-4 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n.split-3-2-1-4 > div:nth-child(1) {\\n left: 0px;\\n width: 30%;\\n }\\n.split-3-2-1-4 > div:nth-child(2) {\\n left: 30%;\\n width: 20%;\\n }\\n.split-3-2-1-4 > div:nth-child(3) {\\n left: 50%;\\n width: 10%;\\n }\\n.split-3-2-1-4 > div:nth-child(4) {\\n left: 60%;\\n width: 40%;\\n }\\n.split-3-2-2-2-1 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n.split-3-2-2-2-1 > div:nth-child(1) {\\n left: 0px;\\n width: 30%;\\n }\\n.split-3-2-2-2-1 > div:nth-child(2) {\\n left: 30%;\\n width: 20%;\\n }\\n.split-3-2-2-2-1 > div:nth-child(3) {\\n left: 50%;\\n width: 20%;\\n }\\n.split-3-2-2-2-1 > div:nth-child(4) {\\n left: 70%;\\n width: 20%;\\n }\\n.split-3-2-2-2-1 > div:nth-child(5) {\\n left: 90%;\\n width: 10%;\\n }\\n.split-3-1-1-1-4 {\\n display: flex;\\n width: 100%;\\n justify-content: center;\\n margin: 1px 0px 1px 0px;\\n}\\n.split-3-1-1-1-4 > div:nth-child(1) {\\n left: 0px;\\n width: 30%;\\n }\\n.split-3-1-1-1-4 > div:nth-child(2) {\\n left: 30%;\\n width: 10%;\\n }\\n.split-3-1-1-1-4 > div:nth-child(3) {\\n left: 40%;\\n width: 10%;\\n }\\n.split-3-1-1-1-4 > div:nth-child(4) {\\n left: 50%;\\n width: 10%;\\n }\\n.split-3-1-1-1-4 > div:nth-child(5) {\\n left: 60%;\\n width: 40%;\\n }\\n.w20 {\\n width: 20%;\\n}\\n.bold {\\n font-weight: 700;\\n}\\n.w40 {\\n width: 40%;\\n}\\n\\n.underline {\\n border-bottom: 3px solid #333;\\n}\\n.left-padding-05 {\\n padding-left: 0.5rem;\\n}\\n.left-padding-1 {\\n padding-left: 1rem;\\n}\\n.left-padding-2 {\\n padding-left: 2rem;\\n}\\n.left-margin-1 {\\n margin-left: 1rem;\\n}\\n.left-margin-2 {\\n margin-left: 2rem;\\n}\\n.highlight {\\n background-color: rgba(200, 200, 255, 0.3);\\n}\\n.guided {\\n /* background-color: rgba(9, 133, 67, 0.3); */\\n background-color: rgba(159, 165, 162, 0.1);\\n /* border-bottom: 1px solid rgba(9, 133, 67, 0.3); */\\n}\\n\\n.divider {\\n height: 0.8rem;\\n /* background-color: rgba(16, 210, 113, 0.1); */\\n background-color: rgba(31, 42, 36, 0.1);\\n}\\n\\n.body-section-title {\\n font-size: 1.5rem;\\n color: rgb(51, 49, 49);\\n}\\n.body-sub-section-title {\\n font-size: 1.1rem;\\n font-weight: 700;\\n color: rgb(3, 53, 12);\\n}\\n\\n.body-item-title {\\n color: rgb(51, 99, 49);\\n display: flex;\\n}\\n.body-item-text {\\n color: rgb(30, 30, 30);\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n}\\n.body-item-text .body-item-text-item {\\n padding-left: 1rem;\\n }\\n.body-item-text-small {\\n color: rgb(30, 30, 30);\\n font-size: 0.7rem;\\n}\\n.body-item-text-em {\\n color: rgb(250, 30, 30);\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n font-weight: 700;\\n}\\n\\n.body-input-container {\\n display: flex;\\n}\\n.body-item-input {\\n width: 60%;\\n}\\n.body-item-input-slider {\\n width: 60%;\\n}\\n.body-item-input-slider-label {\\n margin-right: 1rem;\\n}\\n.body-item-input-slider-val {\\n margin-left: 1rem;\\n}\\n.body-item-input-slider-2nd {\\n width: 60%;\\n accent-color: #33f;\\n}\\n\\n.body-button-container {\\n display: flex;\\n flex-direction: row;\\n align-items: center;\\n}\\n\\n.body-button-container > div {\\n margin-left: 5px;\\n margin-right: 5px;\\n padding-left: 20px;\\n padding-right: 20px;\\n }\\n\\n.body-button-container .body-button {\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n user-select: none;\\n border: solid 1px #999;\\n border-radius: 2px;\\n cursor: pointer;\\n vertical-align: middle;\\n text-align: center;\\n }\\n\\n.body-button-container .body-button:hover {\\n border: solid 1px #000;\\n }\\n\\n.body-button-container .body-button-disabled {\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n user-select: none;\\n border: solid 1px #999;\\n border-radius: 2px;\\n vertical-align: middle;\\n background: #ddd;\\n }\\n\\n.body-button-container .body-button-active {\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n user-select: none;\\n border: solid 1px #333;\\n border-radius: 2px;\\n background: #ada;\\n }\\n\\n.body-button-container .body-button-stanby {\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n user-select: none;\\n border: solid 1px #999;\\n border-radius: 2px;\\n background: #aba;\\n cursor: pointer;\\n }\\n\\n.body-button-container .body-button-stanby:hover {\\n border: solid 1px #000;\\n }\\n\\n.body-button-container-space-around {\\n justify-content: space-around;\\n}\\n\\n.body-select {\\n color: rgb(30, 30, 30);\\n max-width: 100%;\\n}\\n\\n.body-select-50 {\\n color: rgb(30, 30, 30);\\n max-width: 50%;\\n height: 1.5rem;\\n}\\n.select-option-red {\\n color: #f66;\\n font-weight: 700;\\n}\\n\\n.body-image-container,\\n.body-wav-container {\\n display: flex;\\n width: 100%;\\n}\\n\\n.body-image-container .body-image-container-title,\\n .body-image-container .body-wav-container-title,\\n .body-wav-container .body-image-container-title,\\n .body-wav-container .body-wav-container-title {\\n width: 20%;\\n }\\n\\n.body-image-container .body-image-container-img,\\n .body-image-container .body-wav-container-wav,\\n .body-wav-container .body-image-container-img,\\n .body-wav-container .body-wav-container-wav {\\n width: 80%;\\n }\\n\\n.donate-img {\\n border-radius: 35px;\\n height: 1.5rem;\\n}\\n\\n/* Dialog */\\n.dialog-container {\\n justify-content: center;\\n align-items: center;\\n position: absolute;\\n top: 0px;\\n left: 0px;\\n width: 100vw;\\n height: 100vh;\\n z-index: -1;\\n display: none;\\n}\\n.dialog-container .dialog-frame {\\n color: var(--company-color2);\\n width: 40rem;\\n border: 2px solid var(--dialog-border-color);\\n border-radius: 20px;\\n flex-direction: column;\\n align-items: center;\\n box-shadow: 5px 5px 5px var(--dialog-shadow-color);\\n background: var(--dialog-background-color);\\n overflow: hidden;\\n display: flex;\\n }\\n.dialog-container .dialog-frame .dialog-title {\\n margin-top: 20px;\\n background: var(--company-color2);\\n color: #fff;\\n width: 100%;\\n text-align: center;\\n }\\n.dialog-container .dialog-frame .dialog-content {\\n width: 90%;\\n }\\n.dialog-container .dialog-frame .dialog-content .dialog-application-title {\\n font-family: \\\"Chicle\\\", cursive;\\n font-size: 3rem;\\n text-align: center;\\n }\\n.dialog-container-show {\\n display: flex;\\n}\\n\\n.state-control-checkbox:checked ~ .dialog-container {\\n background: rgba(200, 200, 200, 0.4);\\n animation-name: dialog-show;\\n animation-duration: 0.4s;\\n animation-iteration-count: 1;\\n animation-fill-mode: forwards;\\n animation-direction: normal;\\n}\\n.state-control-checkbox ~ .dialog-container {\\n background: rgba(100, 100, 100, 0.4);\\n animation-name: dialog-hide;\\n animation-duration: 0.4s;\\n animation-iteration-count: 1;\\n animation-fill-mode: forwards;\\n animation-direction: normal;\\n}\\n.state-control-checkbox:checked + .dialog-frame {\\n display: flex;\\n}\\n.state-control-checkbox + .dialog-frame {\\n display: none;\\n}\\n\\n@keyframes dialog-hide {\\n from {\\n opacity: 1;\\n z-index: 200;\\n }\\n 90% {\\n opacity: 0;\\n z-index: -1;\\n }\\n to {\\n opacity: 0;\\n z-index: -1;\\n }\\n}\\n\\n@keyframes dialog-show {\\n from {\\n opacity: 0;\\n z-index: -1;\\n }\\n 10% {\\n z-index: 200;\\n }\\n to {\\n opacity: 1;\\n z-index: 200;\\n }\\n}\\n\\n.tooltip-text {\\n display: none;\\n position: absolute;\\n padding: 4px;\\n font-size: 0.7rem;\\n line-height: 2rem;\\n color: #ddd;\\n border-radius: 5px;\\n background: #444;\\n /* width: 100px; */\\n}\\n.tooltip-text-100px {\\n width: 100px;\\n}\\n\\n.tooltip-text:before {\\n content: \\\"\\\";\\n position: absolute;\\n top: -1.4rem;\\n border: 12px solid transparent;\\n border-top: 16px solid #444;\\n margin-left: 0rem;\\n transform: rotateZ(180deg);\\n}\\n.tooltip:hover .tooltip-text {\\n display: inline-block;\\n top: 30px;\\n left: 0px;\\n}\\n\\n.tooltip {\\n position: relative;\\n cursor: pointer;\\n display: inline-block;\\n}\\n\\n/* ################## */\\n.merge-field-container {\\n display: flex;\\n flex-direction: column;\\n}\\n.merge-field-container .merge-field {\\n display: flex;\\n flex-direction: row;\\n }\\n.merge-field-container .merge-field .merge-field-elem {\\n padding-left: 5px;\\n }\\n.merge-field-container .merge-field .red {\\n color: #f00;\\n }\\n.merge-field-container .merge-field .purple {\\n color: #33f;\\n }\\n.merge-field-container .merge-field .grey-bold {\\n color: #555;\\n font-weight: 800;\\n }\\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 {\\n margin: 2rem;\\n}\\n .error-container .top-error-message {\\n color: #44a;\\n font-size: 2rem;\\n font-weight: 100;\\n }\\n .error-container .top-error-description {\\n color: #444;\\n font-size: 1rem;\\n font-weight: 100;\\n }\\n .error-container .error-detail {\\n margin-top: 2rem;\\n padding: 1rem;\\n border: 1px solid;\\n }\\n .error-container .error-detail .error-name {\\n font-weight: 700;\\n }\\n .error-container .error-detail .error-message {\\n margin-top: 0.5rem;\\n }\\n .error-container .error-detail .error-info-container {\\n margin-top: 0.5rem;\\n font-size: 0.8rem;\\n }\\n .error-container .error-detail .error-info-container .error-info-line {\\n }\\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/object-assign/index.js": /*!*********************************************!*\ !*** ./node_modules/object-assign/index.js ***! \*********************************************/ /***/ ((module) => { "use strict"; eval("/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n\n\n//# sourceURL=webpack://demo/./node_modules/object-assign/index.js?"); /***/ }), /***/ "./node_modules/prop-types/checkPropTypes.js": /*!***************************************************!*\ !*** ./node_modules/prop-types/checkPropTypes.js ***! \***************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\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\nvar printWarning = function() {};\n\nif (true) {\n var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ \"./node_modules/prop-types/lib/ReactPropTypesSecret.js\");\n var loggedTypeFailures = {};\n var has = __webpack_require__(/*! ./lib/has */ \"./node_modules/prop-types/lib/has.js\");\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) { /**/ }\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (true) {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +\n 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n 'shape all require an argument).'\n );\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (true) {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n//# sourceURL=webpack://demo/./node_modules/prop-types/checkPropTypes.js?"); /***/ }), /***/ "./node_modules/prop-types/factoryWithTypeCheckers.js": /*!************************************************************!*\ !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***! \************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\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\nvar ReactIs = __webpack_require__(/*! react-is */ \"./node_modules/react-is/index.js\");\nvar assign = __webpack_require__(/*! object-assign */ \"./node_modules/object-assign/index.js\");\n\nvar ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ \"./node_modules/prop-types/lib/ReactPropTypesSecret.js\");\nvar has = __webpack_require__(/*! ./lib/has */ \"./node_modules/prop-types/lib/has.js\");\nvar checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ \"./node_modules/prop-types/checkPropTypes.js\");\n\nvar printWarning = function() {};\n\nif (true) {\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\nfunction emptyFunctionThatReturnsNull() {\n return null;\n}\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bigint: createPrimitiveTypeChecker('bigint'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n elementType: createElementTypeTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message, data) {\n this.message = message;\n this.data = data && typeof data === 'object' ? data: {};\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (true) {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n } else if ( true && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n printWarning(\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),\n {expectedType: expectedType}\n );\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunctionThatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!ReactIs.isValidElementType(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n if (true) {\n if (arguments.length > 1) {\n printWarning(\n 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +\n 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'\n );\n } else {\n printWarning('Invalid argument supplied to oneOf, expected an array.');\n }\n }\n return emptyFunctionThatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {\n var type = getPreciseType(value);\n if (type === 'symbol') {\n return String(value);\n }\n return value;\n });\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (has(propValue, key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0;\n return emptyFunctionThatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n printWarning(\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'\n );\n return emptyFunctionThatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var expectedTypes = [];\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);\n if (checkerResult == null) {\n return null;\n }\n if (checkerResult.data && has(checkerResult.data, 'expectedType')) {\n expectedTypes.push(checkerResult.data.expectedType);\n }\n }\n var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function invalidValidatorError(componentName, location, propFullName, key, type) {\n return new PropTypeError(\n (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'\n );\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (has(shapeTypes, key) && typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // falsy value can't be a Symbol\n if (!propValue) {\n return false;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n//# sourceURL=webpack://demo/./node_modules/prop-types/factoryWithTypeCheckers.js?"); /***/ }), /***/ "./node_modules/prop-types/index.js": /*!******************************************!*\ !*** ./node_modules/prop-types/index.js ***! \******************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\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\nif (true) {\n var ReactIs = __webpack_require__(/*! react-is */ \"./node_modules/react-is/index.js\");\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ \"./node_modules/prop-types/factoryWithTypeCheckers.js\")(ReactIs.isElement, throwOnDirectAccess);\n} else {}\n\n\n//# sourceURL=webpack://demo/./node_modules/prop-types/index.js?"); /***/ }), /***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js": /*!*************************************************************!*\ !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***! \*************************************************************/ /***/ ((module) => { "use strict"; eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\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\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n//# sourceURL=webpack://demo/./node_modules/prop-types/lib/ReactPropTypesSecret.js?"); /***/ }), /***/ "./node_modules/prop-types/lib/has.js": /*!********************************************!*\ !*** ./node_modules/prop-types/lib/has.js ***! \********************************************/ /***/ ((module) => { eval("module.exports = Function.call.bind(Object.prototype.hasOwnProperty);\n\n\n//# sourceURL=webpack://demo/./node_modules/prop-types/lib/has.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