UNPKG

@salutejs/client

Version:

Модуль взаимодействия с виртуальным ассистентом

1 lines 216 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).assistant={})}(this,(function(exports){"use strict";var __assign=function(){return __assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},__assign.apply(this,arguments)};function __rest(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function __awaiter(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function __generator(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function __spreadArray(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var createNanoEvents=function(){var e={},t=function(t,n){return(e[t]=e[t]||[]).push(n),function(){e[t]=e[t].filter((function(e){return e!==n}))}};return{events:e,emit:function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];for(var o=0,i=e[t]||[];o<i.length;o++){i[o].apply(void 0,n)}},on:t,once:function(e,n){var r=t(e,(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n.apply(void 0,e),r()}));return r},clear:function(){e={}}}},commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var proto={exports:{}},indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;return hasRequiredAspromise=1,aspromise=function(e,t){var n=new Array(arguments.length-1),r=0,o=2,i=!0;for(;o<arguments.length;)n[r++]=arguments[o++];return new Promise((function(o,a){n[r]=function(e){if(i)if(i=!1,e)a(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];o.apply(null,t)}};try{e.apply(t||null,n)}catch(e){i&&(i=!1,a(e))}}))},aspromise}var base64={},hasRequiredBase64,eventemitter,hasRequiredEventemitter,float,hasRequiredFloat,inquire_1,hasRequiredInquire;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(e){var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var n=new Array(64),r=new Array(123),o=0;o<64;)r[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;t.encode=function(e,t,r){for(var o,i=null,a=[],s=0,u=0;t<r;){var c=e[t++];switch(u){case 0:a[s++]=n[c>>2],o=(3&c)<<4,u=1;break;case 1:a[s++]=n[o|c>>4],o=(15&c)<<2,u=2;break;case 2:a[s++]=n[o|c>>6],a[s++]=n[63&c],u=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return u&&(a[s++]=n[o],a[s++]=61,1===u&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var i="invalid encoding";t.decode=function(e,t,n){for(var o,a=n,s=0,u=0;u<e.length;){var c=e.charCodeAt(u++);if(61===c&&s>1)break;if(void 0===(c=r[c]))throw Error(i);switch(s){case 0:o=c,s=1;break;case 1:t[n++]=o<<2|(48&c)>>4,o=c,s=2;break;case 2:t[n++]=(15&o)<<4|(60&c)>>2,o=c,s=3;break;case 3:t[n++]=(3&o)<<6|c,s=0}}if(1===s)throw Error(i);return n-a},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(base64)),base64}function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;function e(){this._listeners={}}return hasRequiredEventemitter=1,eventemitter=e,e.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},e.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},e.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this},eventemitter}function requireFloat(){if(hasRequiredFloat)return float;function e(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3]}function i(e,r,o){t[0]=e,r[o]=n[3],r[o+1]=n[2],r[o+2]=n[1],r[o+3]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?o:i,e.writeFloatBE=r?i:o,e.readFloatLE=r?a:s,e.readFloatBE=r?s:a}():function(){function i(e,t,n,r){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,n,r)}}function a(e,t,n){var r=e(t,n),o=2*(r>>31)+1,i=r>>>23&255,a=8388607&r;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=i.bind(null,t),e.writeFloatBE=i.bind(null,n),e.readFloatLE=a.bind(null,r),e.readFloatBE=a.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function i(e,r,o){t[0]=e,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?o:i,e.writeDoubleBE=r?i:o,e.readDoubleLE=r?a:s,e.readDoubleBE=r?s:a}():function(){function i(e,t,n,r,o,i){var a=r<0?1:0;if(a&&(r=-r),0===r)e(0,o,i+t),e(1/r>0?0:2147483648,o,i+n);else if(isNaN(r))e(0,o,i+t),e(2146959360,o,i+n);else if(r>17976931348623157e292)e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+n);else{var s;if(r<22250738585072014e-324)e((s=r/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+n);else{var u=Math.floor(Math.log(r)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(s=r*Math.pow(2,-u))>>>0,o,i+t),e((a<<31|u+1023<<20|1048576*s&1048575)>>>0,o,i+n)}}}function a(e,t,n,r,o){var i=e(r,o+t),a=e(r,o+n),s=2*(a>>31)+1,u=a>>>20&2047,c=4294967296*(1048575&a)+i;return 2047===u?c?NaN:s*(1/0):0===u?5e-324*s*c:s*Math.pow(2,u-1075)*(c+4503599627370496)}e.writeDoubleLE=i.bind(null,t,0,4),e.writeDoubleBE=i.bind(null,n,4,0),e.readDoubleLE=a.bind(null,r,0,4),e.readDoubleBE=a.bind(null,o,4,0)}(),e}function t(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function n(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function r(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}return hasRequiredFloat=1,float=e(e)}function requireInquire(){if(hasRequiredInquire)return inquire_1;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}return hasRequiredInquire=1,inquire_1=inquire,inquire_1}var utf8={},hasRequiredUtf8,pool_1,hasRequiredPool,longbits,hasRequiredLongbits,hasRequiredMinimal$1,writer,hasRequiredWriter,writer_buffer,hasRequiredWriter_buffer,reader,hasRequiredReader,reader_buffer,hasRequiredReader_buffer;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(e){var t=e;t.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},t.read=function(e,t,n){if(n-t<1)return"";for(var r,o=null,i=[],a=0;t<n;)(r=e[t++])<128?i[a++]=r:r>191&&r<224?i[a++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(r>>10),i[a++]=56320+(1023&r)):i[a++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},t.write=function(e,t,n){for(var r,o,i=n,a=0;a<e.length;++a)(r=e.charCodeAt(a))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=e.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&o),++a,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-i}}(utf8)),utf8}function requirePool(){if(hasRequiredPool)return pool_1;return hasRequiredPool=1,pool_1=function(e,t,n){var r=n||8192,o=r>>>1,i=null,a=r;return function(n){if(n<1||n>o)return e(n);a+n>r&&(i=e(r),a=0);var s=t.call(i,a,a+=n);return 7&a&&(a=1+(7|a)),s}}}function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var e=requireMinimal$1();function t(e,t){this.lo=e>>>0,this.hi=t>>>0}var n=t.zero=new t(0,0);n.toNumber=function(){return 0},n.zzEncode=n.zzDecode=function(){return this},n.length=function(){return 1};var r=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(e){if(0===e)return n;var r=e<0;r&&(e=-e);var o=e>>>0,i=(e-o)/4294967296>>>0;return r&&(i=~i>>>0,o=~o>>>0,++o>4294967295&&(o=0,++i>4294967295&&(i=0))),new t(o,i)},t.from=function(r){if("number"==typeof r)return t.fromNumber(r);if(e.isString(r)){if(!e.Long)return t.fromNumber(parseInt(r,10));r=e.Long.fromString(r)}return r.low||r.high?new t(r.low>>>0,r.high>>>0):n},t.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},t.prototype.toLong=function(t){return e.Long?new e.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var o=String.prototype.charCodeAt;return t.fromHash=function(e){return e===r?n:new t((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},t.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)},t.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},t.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},t.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10},longbits}function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(e){var t=e;function n(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;++o)void 0!==e[r[o]]&&n||(e[r[o]]=t[r[o]]);return e}function r(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&n(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}t.asPromise=requireAspromise(),t.base64=requireBase64(),t.EventEmitter=requireEventemitter(),t.float=requireFloat(),t.inquire=requireInquire(),t.utf8=requireUtf8(),t.pool=requirePool(),t.LongBits=requireLongbits(),t.isNode=Boolean(void 0!==commonjsGlobal&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),t.global=t.isNode&&commonjsGlobal||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||commonjsGlobal,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isObject=function(e){return e&&"object"==typeof e},t.isset=t.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},t.Buffer=function(){try{var e=t.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return"number"==typeof e?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},t.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(Boolean(n))},t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},t.newError=r,t.ProtocolError=r("ProtocolError"),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;e?(t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):t._Buffer_from=t._Buffer_allocUnsafe=null}}(minimal$1)),minimal$1}function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=u;var e,t=requireMinimal$1(),n=t.LongBits,r=t.base64,o=t.utf8;function i(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function a(){}function s(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 i(a,0,0),this.tail=this.head,this.states=null}var c=function(){return t.Buffer?function(){return(u.create=function(){return new e})()}:function(){return new u}};function l(e,t,n){t[n]=255&e}function d(e,t){this.len=e,this.next=void 0,this.val=t}function p(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function f(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}u.create=c(),u.alloc=function(e){return new t.Array(e)},t.Array!==Array&&(u.alloc=t.pool(u.alloc,t.Array.prototype.subarray)),u.prototype._push=function(e,t,n){return this.tail=this.tail.next=new i(e,t,n),this.len+=t,this},d.prototype=Object.create(i.prototype),d.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new d((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(p,10,n.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=n.from(e);return this._push(p,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=n.from(e).zzEncode();return this._push(p,t.length(),t)},u.prototype.bool=function(e){return this._push(l,1,e?1:0)},u.prototype.fixed32=function(e){return this._push(f,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=n.from(e);return this._push(f,4,t.lo)._push(f,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(t.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(t.float.writeDoubleLE,8,e)};var g=t.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};return u.prototype.bytes=function(e){var n=e.length>>>0;if(!n)return this._push(l,1,0);if(t.isString(e)){var o=u.alloc(n=r.length(e));r.decode(e,o,0),e=o}return this.uint32(n)._push(g,n,e)},u.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(l,1,0)},u.prototype.fork=function(){return this.states=new s(this),this.head=this.tail=new i(a,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 i(a,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},u.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},u._configure=function(t){e=t,u.create=c(),e._configure()},writer}function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=n;var e=requireWriter();(n.prototype=Object.create(e.prototype)).constructor=n;var t=requireMinimal$1();function n(){e.call(this)}function r(e,n,r){e.length<40?t.utf8.write(e,n,r):n.utf8Write?n.utf8Write(e,r):n.write(e,r)}return n._configure=function(){n.alloc=t._Buffer_allocUnsafe,n.writeBytesBuffer=t.Buffer&&t.Buffer.prototype instanceof Uint8Array&&"set"===t.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},n.prototype.bytes=function(e){t.isString(e)&&(e=t._Buffer_from(e,"base64"));var r=e.length>>>0;return this.uint32(r),r&&this._push(n.writeBytesBuffer,r,e),this},n.prototype.string=function(e){var n=t.Buffer.byteLength(e);return this.uint32(n),n&&this._push(r,n,e),this},n._configure(),writer_buffer}function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=i;var e,t=requireMinimal$1(),n=t.LongBits,r=t.utf8;function o(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function i(e){this.buf=e,this.pos=0,this.len=e.length}var a,s="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new i(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new i(e);throw Error("illegal buffer")},u=function(){return t.Buffer?function(n){return(i.create=function(n){return t.Buffer.isBuffer(n)?new e(n):s(n)})(n)}:s};function c(){var e=new n(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw o(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 o(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 l(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw o(this,8);return new n(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}return i.create=u(),i.prototype._slice=t.Array.prototype.subarray||t.Array.prototype.slice,i.prototype.uint32=(a=4294967295,function(){if(a=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return a;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return a}),i.prototype.int32=function(){return 0|this.uint32()},i.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},i.prototype.bool=function(){return 0!==this.uint32()},i.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return l(this.buf,this.pos+=4)},i.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return 0|l(this.buf,this.pos+=4)},i.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=t.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},i.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=t.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},i.prototype.bytes=function(){var e=this.uint32(),n=this.pos,r=this.pos+e;if(r>this.len)throw o(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(n,r);if(n===r){var i=t.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,n,r)},i.prototype.string=function(){var e=this.bytes();return r.read(e,0,e.length)},i.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw o(this)}while(128&this.buf[this.pos++]);return this},i.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},i._configure=function(n){e=n,i.create=u(),e._configure();var r=t.Long?"toLong":"toNumber";t.merge(i.prototype,{int64:function(){return c.call(this)[r](!1)},uint64:function(){return c.call(this)[r](!0)},sint64:function(){return c.call(this).zzDecode()[r](!1)},fixed64:function(){return d.call(this)[r](!0)},sfixed64:function(){return d.call(this)[r](!1)}})},reader}function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=n;var e=requireReader();(n.prototype=Object.create(e.prototype)).constructor=n;var t=requireMinimal$1();function n(t){e.call(this,t)}return n._configure=function(){t.Buffer&&(n.prototype._slice=t.Buffer.prototype.slice)},n.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))},n._configure(),reader_buffer}var rpc={},service,hasRequiredService,hasRequiredRpc,roots,hasRequiredRoots,hasRequiredIndexMinimal,minimal,hasRequiredMinimal;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=t;var e=requireMinimal$1();function t(t,n,r){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(n),this.responseDelimited=Boolean(r)}return(t.prototype=Object.create(e.EventEmitter.prototype)).constructor=t,t.prototype.rpcCall=function t(n,r,o,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return e.asPromise(t,s,n,r,o,i);if(s.rpcImpl)try{return s.rpcImpl(n,r[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,t){if(e)return s.emit("error",e,n),a(e);if(null!==t){if(!(t instanceof o))try{t=o[s.responseDelimited?"decodeDelimited":"decode"](t)}catch(e){return s.emit("error",e,n),a(e)}return s.emit("data",t,n),a(null,t)}s.end(!0)}))}catch(e){return s.emit("error",e,n),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},t.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(e){e.Service=requireService()}(rpc)),rpc}function requireRoots(){return hasRequiredRoots?roots:(hasRequiredRoots=1,roots={})}function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(e){var t=e;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}t.build="minimal",t.Writer=requireWriter(),t.BufferWriter=requireWriter_buffer(),t.Reader=requireReader(),t.BufferReader=requireReader_buffer(),t.util=requireMinimal$1(),t.rpc=requireRpc(),t.roots=requireRoots(),t.configure=n,n()}(indexMinimal)),indexMinimal}function requireMinimal(){return hasRequiredMinimal?minimal:(hasRequiredMinimal=1,minimal=requireIndexMinimal())}!function(e){var t,n,r,o,i,a,s;"function"==typeof commonjsRequire&&e&&e.exports&&(e.exports=(r=requireMinimal(),o=r.Reader,i=r.Writer,a=r.util,(s=r.roots.default||(r.roots.default={})).Message=function(){function e(e){if(this.devContext=[],this.meta={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var t;return e.prototype.userId="",e.prototype.messageId=a.Long?a.Long.fromBits(0,0,!1):0,e.prototype.last=0,e.prototype.token="",e.prototype.userChannel="",e.prototype.vpsToken="",e.prototype.devContext=a.emptyArray,e.prototype.messageName="",e.prototype.version=0,e.prototype.voice=null,e.prototype.text=null,e.prototype.systemMessage=null,e.prototype.legacyDevice=null,e.prototype.settings=null,e.prototype.status=null,e.prototype.device=null,e.prototype.bytes=null,e.prototype.initialSettings=null,e.prototype.cancel=null,e.prototype.getHistoryRequest=null,e.prototype.mute=null,e.prototype.timestamp=a.Long?a.Long.fromBits(0,0,!1):0,e.prototype.meta=a.emptyObject,Object.defineProperty(e.prototype,"content",{get:a.oneOfGetter(t=["voice","text","systemMessage","legacyDevice","settings","status","device","bytes","initialSettings","cancel","getHistoryRequest","mute"]),set:a.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=i.create()),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),null!=e.messageId&&Object.hasOwnProperty.call(e,"messageId")&&t.uint32(16).int64(e.messageId),null!=e.last&&Object.hasOwnProperty.call(e,"last")&&t.uint32(24).int32(e.last),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&t.uint32(34).string(e.token),null!=e.voice&&Object.hasOwnProperty.call(e,"voice")&&s.Voice.encode(e.voice,t.uint32(42).fork()).ldelim(),null!=e.text&&Object.hasOwnProperty.call(e,"text")&&s.Text.encode(e.text,t.uint32(50).fork()).ldelim(),null!=e.systemMessage&&Object.hasOwnProperty.call(e,"systemMessage")&&s.SystemMessage.encode(e.systemMessage,t.uint32(58).fork()).ldelim(),null!=e.legacyDevice&&Object.hasOwnProperty.call(e,"legacyDevice")&&s.LegacyDevice.encode(e.legacyDevice,t.uint32(66).fork()).ldelim(),null!=e.settings&&Object.hasOwnProperty.call(e,"settings")&&s.Settings.encode(e.settings,t.uint32(74).fork()).ldelim(),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&s.Status.encode(e.status,t.uint32(82).fork()).ldelim(),null!=e.userChannel&&Object.hasOwnProperty.call(e,"userChannel")&&t.uint32(90).string(e.userChannel),null!=e.vpsToken&&Object.hasOwnProperty.call(e,"vpsToken")&&t.uint32(98).string(e.vpsToken),null!=e.devContext&&e.devContext.length)for(var n=0;n<e.devContext.length;++n)s.DevContext.encode(e.devContext[n],t.uint32(106).fork()).ldelim();if(null!=e.messageName&&Object.hasOwnProperty.call(e,"messageName")&&t.uint32(114).string(e.messageName),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(120).int32(e.version),null!=e.device&&Object.hasOwnProperty.call(e,"device")&&s.Device.encode(e.device,t.uint32(130).fork()).ldelim(),null!=e.bytes&&Object.hasOwnProperty.call(e,"bytes")&&s.Bytes.encode(e.bytes,t.uint32(138).fork()).ldelim(),null!=e.initialSettings&&Object.hasOwnProperty.call(e,"initialSettings")&&s.InitialSettings.encode(e.initialSettings,t.uint32(146).fork()).ldelim(),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(152).int64(e.timestamp),null!=e.meta&&Object.hasOwnProperty.call(e,"meta")){var r=Object.keys(e.meta);for(n=0;n<r.length;++n)t.uint32(162).fork().uint32(10).string(r[n]).uint32(18).string(e.meta[r[n]]).ldelim()}return null!=e.cancel&&Object.hasOwnProperty.call(e,"cancel")&&s.Cancel.encode(e.cancel,t.uint32(170).fork()).ldelim(),null!=e.getHistoryRequest&&Object.hasOwnProperty.call(e,"getHistoryRequest")&&s.GetHistoryRequest.encode(e.getHistoryRequest,t.uint32(178).fork()).ldelim(),null!=e.mute&&Object.hasOwnProperty.call(e,"mute")&&s.Mute.encode(e.mute,t.uint32(186).fork()).ldelim(),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n,r,i=void 0===t?e.len:e.pos+t,u=new s.Message;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:u.userId=e.string();break;case 2:u.messageId=e.int64();break;case 3:u.last=e.int32();break;case 4:u.token=e.string();break;case 11:u.userChannel=e.string();break;case 12:u.vpsToken=e.string();break;case 13:u.devContext&&u.devContext.length||(u.devContext=[]),u.devContext.push(s.DevContext.decode(e,e.uint32()));break;case 14:u.messageName=e.string();break;case 15:u.version=e.int32();break;case 5:u.voice=s.Voice.decode(e,e.uint32());break;case 6:u.text=s.Text.decode(e,e.uint32());break;case 7:u.systemMessage=s.SystemMessage.decode(e,e.uint32());break;case 8:u.legacyDevice=s.LegacyDevice.decode(e,e.uint32());break;case 9:u.settings=s.Settings.decode(e,e.uint32());break;case 10:u.status=s.Status.decode(e,e.uint32());break;case 16:u.device=s.Device.decode(e,e.uint32());break;case 17:u.bytes=s.Bytes.decode(e,e.uint32());break;case 18:u.initialSettings=s.InitialSettings.decode(e,e.uint32());break;case 21:u.cancel=s.Cancel.decode(e,e.uint32());break;case 22:u.getHistoryRequest=s.GetHistoryRequest.decode(e,e.uint32());break;case 23:u.mute=s.Mute.decode(e,e.uint32());break;case 19:u.timestamp=e.int64();break;case 20:u.meta===a.emptyObject&&(u.meta={});var l=e.uint32()+e.pos;for(n="",r="";e.pos<l;){var d=e.uint32();switch(d>>>3){case 1:n=e.string();break;case 2:r=e.string();break;default:e.skipType(7&d)}}u.meta[n]=r;break;default:e.skipType(7&c)}}return u},e}(),s.InitialSettings=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.userId="",e.prototype.userChannel="",e.prototype.device=null,e.prototype.settings=null,e.prototype.locale="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),null!=e.userChannel&&Object.hasOwnProperty.call(e,"userChannel")&&t.uint32(18).string(e.userChannel),null!=e.device&&Object.hasOwnProperty.call(e,"device")&&s.Device.encode(e.device,t.uint32(26).fork()).ldelim(),null!=e.settings&&Object.hasOwnProperty.call(e,"settings")&&s.Settings.encode(e.settings,t.uint32(34).fork()).ldelim(),null!=e.locale&&Object.hasOwnProperty.call(e,"locale")&&t.uint32(42).string(e.locale),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.InitialSettings;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.userId=e.string();break;case 2:r.userChannel=e.string();break;case 3:r.device=s.Device.decode(e,e.uint32());break;case 4:r.settings=s.Settings.decode(e,e.uint32());break;case 5:r.locale=e.string();break;default:e.skipType(7&i)}}return r},e}(),s.Device=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.platformType="",e.prototype.platformVersion="",e.prototype.surface="",e.prototype.surfaceVersion="",e.prototype.features="",e.prototype.capabilities="",e.prototype.deviceId="",e.prototype.deviceManufacturer="",e.prototype.deviceModel="",e.prototype.additionalInfo="",e.prototype.tenant="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.platformType&&Object.hasOwnProperty.call(e,"platformType")&&t.uint32(10).string(e.platformType),null!=e.platformVersion&&Object.hasOwnProperty.call(e,"platformVersion")&&t.uint32(18).string(e.platformVersion),null!=e.surface&&Object.hasOwnProperty.call(e,"surface")&&t.uint32(26).string(e.surface),null!=e.surfaceVersion&&Object.hasOwnProperty.call(e,"surfaceVersion")&&t.uint32(34).string(e.surfaceVersion),null!=e.features&&Object.hasOwnProperty.call(e,"features")&&t.uint32(42).string(e.features),null!=e.capabilities&&Object.hasOwnProperty.call(e,"capabilities")&&t.uint32(50).string(e.capabilities),null!=e.deviceId&&Object.hasOwnProperty.call(e,"deviceId")&&t.uint32(58).string(e.deviceId),null!=e.deviceManufacturer&&Object.hasOwnProperty.call(e,"deviceManufacturer")&&t.uint32(66).string(e.deviceManufacturer),null!=e.deviceModel&&Object.hasOwnProperty.call(e,"deviceModel")&&t.uint32(74).string(e.deviceModel),null!=e.additionalInfo&&Object.hasOwnProperty.call(e,"additionalInfo")&&t.uint32(82).string(e.additionalInfo),null!=e.tenant&&Object.hasOwnProperty.call(e,"tenant")&&t.uint32(90).string(e.tenant),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.Device;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.platformType=e.string();break;case 2:r.platformVersion=e.string();break;case 3:r.surface=e.string();break;case 4:r.surfaceVersion=e.string();break;case 5:r.features=e.string();break;case 6:r.capabilities=e.string();break;case 7:r.deviceId=e.string();break;case 8:r.deviceManufacturer=e.string();break;case 9:r.deviceModel=e.string();break;case 10:r.additionalInfo=e.string();break;case 11:r.tenant=e.string();break;default:e.skipType(7&i)}}return r},e}(),s.Settings=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.dubbing=0,e.prototype.echo=0,e.prototype.ttsEngine="",e.prototype.asrEngine="",e.prototype.asrAutoStop=0,e.prototype.devMode=0,e.prototype.authConnector="",e.prototype.surface="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.dubbing&&Object.hasOwnProperty.call(e,"dubbing")&&t.uint32(8).int32(e.dubbing),null!=e.echo&&Object.hasOwnProperty.call(e,"echo")&&t.uint32(16).int32(e.echo),null!=e.ttsEngine&&Object.hasOwnProperty.call(e,"ttsEngine")&&t.uint32(26).string(e.ttsEngine),null!=e.asrEngine&&Object.hasOwnProperty.call(e,"asrEngine")&&t.uint32(34).string(e.asrEngine),null!=e.asrAutoStop&&Object.hasOwnProperty.call(e,"asrAutoStop")&&t.uint32(40).int32(e.asrAutoStop),null!=e.devMode&&Object.hasOwnProperty.call(e,"devMode")&&t.uint32(48).int32(e.devMode),null!=e.authConnector&&Object.hasOwnProperty.call(e,"authConnector")&&t.uint32(58).string(e.authConnector),null!=e.surface&&Object.hasOwnProperty.call(e,"surface")&&t.uint32(66).string(e.surface),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.Settings;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.dubbing=e.int32();break;case 2:r.echo=e.int32();break;case 3:r.ttsEngine=e.string();break;case 4:r.asrEngine=e.string();break;case 5:r.asrAutoStop=e.int32();break;case 6:r.devMode=e.int32();break;case 7:r.authConnector=e.string();break;case 8:r.surface=e.string();break;default:e.skipType(7&i)}}return r},e}(),s.LegacyDevice=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.clientType="",e.prototype.channel="",e.prototype.channelVersion="",e.prototype.platformName="",e.prototype.platformVersion="",e.prototype.sdkVersion="",e.prototype.protocolVersion="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.clientType&&Object.hasOwnProperty.call(e,"clientType")&&t.uint32(10).string(e.clientType),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(18).string(e.channel),null!=e.channelVersion&&Object.hasOwnProperty.call(e,"channelVersion")&&t.uint32(26).string(e.channelVersion),null!=e.platformName&&Object.hasOwnProperty.call(e,"platformName")&&t.uint32(34).string(e.platformName),null!=e.platformVersion&&Object.hasOwnProperty.call(e,"platformVersion")&&t.uint32(42).string(e.platformVersion),null!=e.sdkVersion&&Object.hasOwnProperty.call(e,"sdkVersion")&&t.uint32(50).string(e.sdkVersion),null!=e.protocolVersion&&Object.hasOwnProperty.call(e,"protocolVersion")&&t.uint32(58).string(e.protocolVersion),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.LegacyDevice;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.clientType=e.string();break;case 2:r.channel=e.string();break;case 3:r.channelVersion=e.string();break;case 4:r.platformName=e.string();break;case 5:r.platformVersion=e.string();break;case 6:r.sdkVersion=e.string();break;case 7:r.protocolVersion=e.string();break;default:e.skipType(7&i)}}return r},e}(),s.Voice=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=a.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).bytes(e.data),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.Voice;e.pos<n;){var i=e.uint32();i>>>3==1?r.data=e.bytes():e.skipType(7&i)}return r},e}(),s.Text=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.type="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(18).string(e.type),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.Text;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.data=e.string();break;case 2:r.type=e.string();break;default:e.skipType(7&i)}}return r},e}(),s.SystemMessage=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.SystemMessage;e.pos<n;){var i=e.uint32();i>>>3==1?r.data=e.string():e.skipType(7&i)}return r},e}(),s.Status=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.code=0,e.prototype.description="",e.prototype.technicalDescription="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(8).int32(e.code),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(18).string(e.description),null!=e.technicalDescription&&Object.hasOwnProperty.call(e,"technicalDescription")&&t.uint32(26).string(e.technicalDescription),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.Status;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.code=e.int32();break;case 2:r.description=e.string();break;case 3:r.technicalDescription=e.string();break;default:e.skipType(7&i)}}return r},e}(),s.Bytes=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=a.newBuffer([]),e.prototype.desc="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).bytes(e.data),null!=e.desc&&Object.hasOwnProperty.call(e,"desc")&&t.uint32(18).string(e.desc),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.Bytes;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.data=e.bytes();break;case 2:r.desc=e.string();break;default:e.skipType(7&i)}}return r},e}(),s.DevContext=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.timestampMs=a.Long?a.Long.fromBits(0,0,!1):0,e.prototype.data="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.timestampMs&&Object.hasOwnProperty.call(e,"timestampMs")&&t.uint32(16).int64(e.timestampMs),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).string(e.data),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.DevContext;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.name=e.string();break;case 2:r.timestampMs=e.int64();break;case 3:r.data=e.string();break;default:e.skipType(7&i)}}return r},e}(),s.Cancel=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.Cancel;e.pos<n;){var i=e.uint32();e.skipType(7&i)}return r},e}(),s.Mute=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.Mute;e.pos<n;){var i=e.uint32();e.skipType(7&i)}return r},e}(),s.GetHistoryRequest=function(){function e(e){if(this.messageTypes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.messageTypes=a.emptyArray,e.prototype.app=null,e.prototype.offset=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=i.create()),null!=e.messageTypes&&e.messageTypes.length)for(var n=0;n<e.messageTypes.length;++n)t.uint32(10).string(e.messageTypes[n]);return null!=e.app&&Object.hasOwnProperty.call(e,"app")&&s.App.encode(e.app,t.uint32(18).fork()).ldelim(),null!=e.offset&&Object.hasOwnProperty.call(e,"offset")&&s.Offset.encode(e.offset,t.uint32(26).fork()).ldelim(),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.GetHistoryRequest;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.messageTypes&&r.messageTypes.length||(r.messageTypes=[]),r.messageTypes.push(e.string());break;case 2:r.app=s.App.decode(e,e.uint32());break;case 3:r.offset=s.Offset.decode(e,e.uint32());break;default:e.skipType(7&i)}}return r},e}(),s.App=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.type=null,e.prototype.projectId=null,e.prototype.systemName=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&s.google.protobuf.StringValue.encode(e.type,t.uint32(10).fork()).ldelim(),null!=e.projectId&&Object.hasOwnProperty.call(e,"projectId")&&s.google.protobuf.StringValue.encode(e.projectId,t.uint32(18).fork()).ldelim(),null!=e.systemName&&Object.hasOwnProperty.call(e,"systemName")&&s.google.protobuf.StringValue.encode(e.systemName,t.uint32(26).fork()).ldelim(),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.App;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.type=s.google.protobuf.StringValue.decode(e,e.uint32());break;case 2:r.projectId=s.google.protobuf.StringValue.decode(e,e.uint32());break;case 3:r.systemName=s.google.protobuf.StringValue.decode(e,e.uint32());break;default:e.skipType(7&i)}}return r},e}(),s.Offset=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.limit=null,e.prototype.contentId=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.limit&&Object.hasOwnProperty.call(e,"limit")&&s.google.protobuf.StringValue.encode(e.limit,t.uint32(10).fork()).ldelim(),null!=e.contentId&&Object.hasOwnProperty.call(e,"contentId")&&s.google.protobuf.StringValue.encode(e.contentId,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.Offset;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.limit=s.google.protobuf.StringValue.decode(e,e.uint32());break;case 2:r.contentId=s.google.protobuf.StringValue.decode(e,e.uint32());break;default:e.skipType(7&i)}}return r},e}(),s.ChatHistoryRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.uuid=null,e.prototype.device=null,e.prototype.getHistoryRequest=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.uuid&&Object.hasOwnProperty.call(e,"uuid")&&s.Uuid.encode(e.uuid,t.uint32(10).fork()).ldelim(),null!=e.device&&Object.hasOwnProperty.call(e,"device")&&s.Device.encode(e.device,t.uint32(18).fork()).ldelim(),null!=e.getHistoryRequest&&Object.hasOwnProperty.call(e,"getHistoryRequest")&&s.GetHistoryRequest.encode(e.getHistoryRequest,t.uint32(34).fork()).ldelim(),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.ChatHistoryRequest;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.uuid=s.Uuid.decode(e,e.uint32());break;case 2:r.device=s.Device.decode(e,e.uint32());break;case 4:r.getHistoryRequest=s.GetHistoryRequest.decode(e,e.uint32());break;default:e.skipType(7&i)}}return r},e}(),s.Uuid=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.userId="",e.prototype.userChannel="",e.prototype.sub="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),null!=e.userChannel&&Object.hasOwnProperty.call(e,"userChannel")&&t.uint32(18).string(e.userChannel),null!=e.sub&&Object.hasOwnProperty.call(e,"sub")&&t.uint32(26).string(e.sub),t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.Uuid;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.userId=e.string();break;case 2:r.userChannel=e.string();break;case 3:r.sub=e.string();break;default:e.skipType(7&i)}}return r},e}(),s.GetHistoryResponse=function(){function e(e){if(this.historyMessages=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.historyMessages=a.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=i.create()),null!=e.historyMessages&&e.historyMessages.length)for(var n=0;n<e.historyMessages.length;++n)s.HistoryMessages.encode(e.historyMessages[n],t.uint32(10).fork()).ldelim();return t},e.decode=function(e,t){e instanceof o||(e=o.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.GetHistoryResponse;e.pos<n;){var i=e.uint32();i>>>3==1?(r.historyMessages&&r.historyMessages.length||(r.historyMessages=[]),r.historyMessages.push(s.HistoryMessages.decode(e,e.uint32()))):e.skipType(7&i)}return r},e}(),s.HistoryMessages=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.content="",e.prototype.contentId="",e.prototype.timeCreated="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(10).string(e.content),null!=e.contentId&