buttplug 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/module/buttplug-rs-ffi/buttplug_rs_ffi_bg.wasm +0 -0
- package/dist/module/buttplug-rs-ffi/buttplug_rs_ffi_bg.wasm.d.ts +3 -3
- package/dist/module/buttplug-rs-ffi/buttplug_rs_ffi_bg_node.js +135 -122
- package/dist/module/buttplug-rs-ffi/buttplug_rs_ffi_bg_web.js +135 -122
- package/dist/web/0.buttplug.js +358 -345
- package/dist/web/1.buttplug.min.js +1 -1
- package/dist/web/1.buttplug.min.js.map +1 -1
- package/dist/web/b0219b34bc18e1ad0240.module.wasm +0 -0
- package/dist/web/buttplug.js +146 -146
- package/dist/web/buttplug.min.js +1 -1
- package/dist/web/buttplug.min.js.map +1 -1
- package/dist/web/e5566a8b6a3fda978549.module.wasm +0 -0
- package/package.json +9 -9
- package/dist/web/166a428ed7ca7a309853.module.wasm +0 -0
- package/dist/web/c729307841d2d311543e.module.wasm +0 -0
package/dist/web/buttplug.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["buttplug-commonjs"]=t():e.Buttplug=t()}(window,(function(){return function(e){function t(t){for(var n,s,o=t[0],c=t[1],u=t[3]||[],l=0,p=[];l<o.length;l++)s=o[l],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&p.push(r[s][0]),r[s]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(d&&d(t),u.forEach((function(e){if(void 0===r[e]){r[e]=null;var t=document.createElement("link");a.nc&&t.setAttribute("nonce",a.nc),t.rel="prefetch",t.as="script",t.href=i(e),document.head.appendChild(t)}}));p.length;)p.shift()()}var n={},r={0:0};function i(e){return a.p+""+e+".buttplug.min.js"}var s={};var o={30:function(){return{"./buttplug_rs_ffi_bg.js":{__wbindgen_object_drop_ref:function(e){return n[28].exports.Fb(e)},__wbindgen_string_new:function(e,t){return n[28].exports.Hb(e,t)},__wbindgen_cb_drop:function(e){return n[28].exports.sb(e)},__wbg_log_35a94a6f9ba22278:function(e,t){return n[28].exports.y(e,t)},__wbindgen_object_clone_ref:function(e){return n[28].exports.Eb(e)},__wbg_new_59cb74e423758ede:function(){return n[28].exports.I()},__wbg_stack_558ba5917b466edd:function(e,t){return n[28].exports.ib(e,t)},__wbg_error_4bb6c2a97407129a:function(e,t){return n[28].exports.o(e,t)},__wbg_log_b7dcb3facc73166d:function(e,t){return n[28].exports.A(e,t)},__wbg_log_96295d68ab8338df:function(e,t,r,i,s,o,a,c){return n[28].exports.z(e,t,r,i,s,o,a,c)},__wbg_mark_55c5ecfe509deb6a:function(e,t){return n[28].exports.B(e,t)},__wbg_measure_608563106d70d48a:function(e,t,r,i){return n[28].exports.C(e,t,r,i)},__wbg_Window_f826a1dec163bacb:function(e){return n[28].exports.a(e)},__wbindgen_is_undefined:function(e){return n[28].exports.Cb(e)},__wbg_WorkerGlobalScope_967d186155183d38:function(e){return n[28].exports.b(e)},__wbg_instanceof_Window_fac4f1f8e3c61c1f:function(e){return n[28].exports.w(e)},__wbg_navigator_f92994fb618b3c03:function(e){return n[28].exports.G(e)},__wbg_clearTimeout_60252f615c569bcf:function(e,t){return n[28].exports.j(e,t)},__wbg_setTimeout_56c7fbf887ce45de:function(e,t,r){return n[28].exports.Z(e,t,r)},__wbg_data_7cd3f124c3b5a69f:function(e){return n[28].exports.n(e)},__wbg_value_03e8225239dbd7d8:function(e){return n[28].exports.ob(e)},__wbg_setoncharacteristicvaluechanged_0cee0979d99dc9d1:function(e,t){return n[28].exports.db(e,t)},__wbg_readValue_69b87e4f58cc86cd:function(e){return n[28].exports.U(e)},__wbg_startNotifications_9fa99b41b7caa34e:function(e){return n[28].exports.jb(e)},__wbg_writeValue_4aac2f49d8ed528b:function(e,t,r){return n[28].exports.rb(e,t,r)},__wbg_connect_a404ec0ee0473b28:function(e){return n[28].exports.l(e)},__wbg_getPrimaryService_02f630a4fa89270e:function(e,t,r){return n[28].exports.r(e,t,r)},__wbg_target_8eac1b471e53114d:function(e){return n[28].exports.lb(e)},__wbg_requestDevice_572ca20db5044981:function(e,t){return n[28].exports.V(e,t)},__wbg_id_6a48553deb512e33:function(e,t){return n[28].exports.v(e,t)},__wbg_name_de841b61e86e41a0:function(e,t){return n[28].exports.F(e,t)},__wbg_gatt_948cc2b96fe1151a:function(e){return n[28].exports.p(e)},__wbg_setongattserverdisconnected_dfb9d4668d265698:function(e,t){return n[28].exports.fb(e,t)},__wbg_clearTimeout_314f616ced084484:function(e,t){return n[28].exports.i(e,t)},__wbg_setTimeout_7c4b174605b75e39:function(e,t,r){return n[28].exports.ab(e,t,r)},__wbg_bluetooth_6b5bab60cc8bb7c6:function(e){return n[28].exports.c(e)},__wbg_setonopen_faba655bda608b5f:function(e,t){return n[28].exports.hb(e,t)},__wbg_setonerror_28e7c95e09d93ac7:function(e,t){return n[28].exports.eb(e,t)},__wbg_setonmessage_f64e20ef3929f315:function(e,t){return n[28].exports.gb(e,t)},__wbg_new_ef8bd7aae8c6ec3d:function(e,t){return n[28].exports.L(e,t)},__wbg_close_5571385f58cb11b4:function(e){return n[28].exports.k(e)},__wbg_send_d5d38801ffbb328e:function(e,t,r){return n[28].exports.Y(e,t,r)},__wbg_getCharacteristic_9f5a50aa9515729d:function(e,t,r){return n[28].exports.q(e,t,r)},__wbg_getRandomValues_98117e9a7e993920:function(e,t){return n[28].exports.s(e,t)},__wbg_randomFillSync_64cc7d048f228ca8:function(e,t,r){return n[28].exports.T(e,t,r)},__wbg_process_2f24d6544ea7b200:function(e){return n[28].exports.R(e)},__wbindgen_is_object:function(e){return n[28].exports.Ab(e)},__wbg_versions_6164651e75405d4a:function(e){return n[28].exports.pb(e)},__wbg_node_4b517d861cbcb3bc:function(e){return n[28].exports.Q(e)},__wbg_crypto_98fc271021c7d2ad:function(e){return n[28].exports.m(e)},__wbg_msCrypto_a2cdb043d2bfe57f:function(e){return n[28].exports.E(e)},__wbg_modulerequire_3440a4bcf44437db:function(e,t){return n[28].exports.D(e,t)},__wbg_new_ec75d0d5815be736:function(){return n[28].exports.K()},__wbg_newnoargs_1a11e7e8c906996c:function(e,t){return n[28].exports.M(e,t)},__wbg_call_e91f71ddf1f45cff:function(e,t){return n[28].exports.h(e,t)},__wbg_new_4b48f9f8159fea77:function(){return n[28].exports.H()},__wbg_push_0daae9343162dbe7:function(e,t){return n[28].exports.S(e,t)},__wbg_buffer_04a22f1b4377e8b6:function(e){return n[28].exports.d(e)},__wbg_byteLength_f539f83608347df8:function(e){return n[28].exports.f(e)},__wbg_call_e3c72355d091d5d4:function(e,t,r){return n[28].exports.g(e,t,r)},__wbg_resolve_7161ec6fd5b1cd29:function(e){return n[28].exports.W(e)},__wbg_then_6d5072fec3fdb237:function(e,t){return n[28].exports.nb(e,t)},__wbg_then_4f3c7f6f3d36634a:function(e,t,r){return n[28].exports.mb(e,t,r)},__wbg_self_b4546ea7b590539e:function(){return n[28].exports.X()},__wbg_window_c279fea81f426a68:function(){return n[28].exports.qb()},__wbg_globalThis_038a6ea0ff17789f:function(){return n[28].exports.t()},__wbg_global_4f93ce884bcee597:function(){return n[28].exports.u()},__wbg_buffer_79a3294266d4e783:function(e){return n[28].exports.e(e)},__wbg_newwithbyteoffsetandlength_22a36e6023ad3cd0:function(e,t,r){return n[28].exports.O(e,t,r)},__wbg_new_945397fb09fec0b8:function(e){return n[28].exports.J(e)},__wbg_set_223873223acf6d07:function(e,t,r){return n[28].exports.bb(e,t,r)},__wbg_length_68e13e7bbd918464:function(e){return n[28].exports.x(e)},__wbg_newwithlength_b7722b5594f1dc21:function(e){return n[28].exports.P(e)},__wbg_newwithbyteoffset_5abaa6f77edbdcec:function(e,t){return n[28].exports.N(e,t)},__wbg_subarray_466613921b2fc6db:function(e,t,r){return n[28].exports.kb(e,t,r)},__wbg_set_d29a397c9cc5d746:function(e,t,r){return n[28].exports.cb(e,t,r)},__wbindgen_is_string:function(e){return n[28].exports.Bb(e)},__wbindgen_string_get:function(e,t){return n[28].exports.Gb(e,t)},__wbindgen_debug_string:function(e,t){return n[28].exports.zb(e,t)},__wbindgen_throw:function(e,t){return n[28].exports.Ib(e,t)},__wbindgen_memory:function(){return n[28].exports.Db()},__wbindgen_closure_wrapper195:function(e,t,r){return n[28].exports.tb(e,t,r)},__wbindgen_closure_wrapper197:function(e,t,r){return n[28].exports.ub(e,t,r)},__wbindgen_closure_wrapper199:function(e,t,r){return n[28].exports.vb(e,t,r)},__wbindgen_closure_wrapper201:function(e,t,r){return n[28].exports.wb(e,t,r)},__wbindgen_closure_wrapper2720:function(e,t,r){return n[28].exports.xb(e,t,r)},__wbindgen_closure_wrapper4521:function(e,t,r){return n[28].exports.yb(e,t,r)}}}}};function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var c=new Promise((function(t,i){n=r[e]=[t,i]}));t.push(n[2]=c);var u,l=document.createElement("script");l.charset="utf-8",l.timeout=120,a.nc&&l.setAttribute("nonce",a.nc),l.src=i(e);var d=new Error;u=function(t){l.onerror=l.onload=null,clearTimeout(p);var n=r[e];if(0!==n){if(n){var i=t&&("load"===t.type?"missing":t.type),s=t&&t.target&&t.target.src;d.message="Loading chunk "+e+" failed.\n("+i+": "+s+")",d.name="ChunkLoadError",d.type=i,d.request=s,n[1](d)}r[e]=void 0}};var p=setTimeout((function(){u({type:"timeout",target:l})}),12e4);l.onerror=l.onload=u,document.head.appendChild(l)}return({1:[30]}[e]||[]).forEach((function(e){var n=s[e];if(n)t.push(n);else{var r,i=o[e](),c=fetch(a.p+""+{30:"166a428ed7ca7a309853"}[e]+".module.wasm");if(i instanceof Promise&&"function"==typeof WebAssembly.compileStreaming)r=Promise.all([WebAssembly.compileStreaming(c),i]).then((function(e){return WebAssembly.instantiate(e[0],e[1])}));else if("function"==typeof WebAssembly.instantiateStreaming)r=WebAssembly.instantiateStreaming(c,i);else{r=c.then((function(e){return e.arrayBuffer()})).then((function(e){return WebAssembly.instantiate(e,i)}))}t.push(s[e]=r.then((function(t){return a.w[e]=(t.instance||t).exports})))}})),Promise.all(t)},a.m=e,a.c=n,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a.oe=function(e){throw console.error(e),e},a.w={};var c=window.webpackJsonp=window.webpackJsonp||[],u=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var d=u,p=a(a.s=26);return t([[],{},0,[1]]),p}([function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(1),i=n.n(r);const s=i.a.Reader,o=i.a.Writer,a=i.a.util,c=i.a.roots.default||(i.a.roots.default={}),u=c.Buttplug=(()=>{const e={};return e.Endpoint=function(){const e={},t=Object.create(e);return t[e[0]="Command"]=0,t[e[1]="Firmware"]=1,t[e[2]="Rx"]=2,t[e[3]="RxAccel"]=3,t[e[4]="RxBLEBattery"]=4,t[e[5]="RxPressure"]=5,t[e[6]="RxTouch"]=6,t[e[7]="Tx"]=7,t[e[8]="TxMode"]=8,t[e[9]="TxShock"]=9,t[e[10]="TxVibrate"]=10,t[e[11]="TxVendorControl"]=11,t[e[12]="Whitelist"]=12,t[e[13]="Generic0"]=13,t[e[14]="Generic1"]=14,t[e[15]="Generic2"]=15,t[e[16]="Generic3"]=16,t[e[17]="Generic4"]=17,t[e[18]="Generic5"]=18,t[e[19]="Generic6"]=19,t[e[20]="Generic7"]=20,t[e[21]="Generic8"]=21,t[e[22]="Generic9"]=22,t[e[23]="Generic10"]=23,t[e[24]="Generic11"]=24,t[e[25]="Generic12"]=25,t[e[26]="Generic13"]=26,t[e[27]="Generic14"]=27,t[e[28]="Generic15"]=28,t[e[29]="Generic16"]=29,t[e[30]="Generic17"]=30,t[e[31]="Generic18"]=31,t[e[32]="Generic19"]=32,t[e[33]="Generic20"]=33,t[e[34]="Generic21"]=34,t[e[35]="Generic22"]=35,t[e[36]="Generic23"]=36,t[e[37]="Generic24"]=37,t[e[38]="Generic25"]=38,t[e[39]="Generic26"]=39,t[e[40]="Generic27"]=40,t[e[41]="Generic28"]=41,t[e[42]="Generic29"]=42,t[e[43]="Generic30"]=43,t[e[44]="Generic31"]=44,t[e[45]="RxBLEModel"]=45,t}(),e.ClientMessage=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id=0,e.prototype.message=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(8).uint32(e.id),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&c.Buttplug.ClientMessage.FFIMessage.encode(e.message,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.uint32();break;case 2:r.message=c.Buttplug.ClientMessage.FFIMessage.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!a.isInteger(e.id))return"id: integer expected";if(null!=e.message&&e.hasOwnProperty("message")){let t=c.Buttplug.ClientMessage.FFIMessage.verify(e.message);if(t)return"message."+t}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.ClientMessage)return e;let t=new c.Buttplug.ClientMessage;if(null!=e.id&&(t.id=e.id>>>0),null!=e.message){if("object"!=typeof e.message)throw TypeError(".Buttplug.ClientMessage.message: object expected");t.message=c.Buttplug.ClientMessage.FFIMessage.fromObject(e.message)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id=0,n.message=null),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.message&&e.hasOwnProperty("message")&&(n.message=c.Buttplug.ClientMessage.FFIMessage.toObject(e.message,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e.DeviceCommunicationManagerTypes=function(){const e={},t=Object.create(e);return t[e[0]="All"]=0,t[e[1]="Btleplug"]=1,t[e[2]="XInput"]=2,t[e[4]="SerialPort"]=4,t[e[8]="LovenseHIDDongle"]=8,t[e[16]="LovenseSerialDongle"]=16,t}(),e.ConnectLocal=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.serverName="",e.prototype.maxPingTime=0,e.prototype.allowRawMessages=!1,e.prototype.deviceConfigurationJson="",e.prototype.userDeviceConfigurationJson="",e.prototype.commManagerTypes=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.serverName&&Object.hasOwnProperty.call(e,"serverName")&&t.uint32(10).string(e.serverName),null!=e.maxPingTime&&Object.hasOwnProperty.call(e,"maxPingTime")&&t.uint32(16).uint32(e.maxPingTime),null!=e.allowRawMessages&&Object.hasOwnProperty.call(e,"allowRawMessages")&&t.uint32(24).bool(e.allowRawMessages),null!=e.deviceConfigurationJson&&Object.hasOwnProperty.call(e,"deviceConfigurationJson")&&t.uint32(34).string(e.deviceConfigurationJson),null!=e.userDeviceConfigurationJson&&Object.hasOwnProperty.call(e,"userDeviceConfigurationJson")&&t.uint32(42).string(e.userDeviceConfigurationJson),null!=e.commManagerTypes&&Object.hasOwnProperty.call(e,"commManagerTypes")&&t.uint32(48).uint32(e.commManagerTypes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.ConnectLocal;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.serverName=e.string();break;case 2:r.maxPingTime=e.uint32();break;case 3:r.allowRawMessages=e.bool();break;case 4:r.deviceConfigurationJson=e.string();break;case 5:r.userDeviceConfigurationJson=e.string();break;case 6:r.commManagerTypes=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.serverName&&e.hasOwnProperty("serverName")&&!a.isString(e.serverName)?"serverName: string expected":null!=e.maxPingTime&&e.hasOwnProperty("maxPingTime")&&!a.isInteger(e.maxPingTime)?"maxPingTime: integer expected":null!=e.allowRawMessages&&e.hasOwnProperty("allowRawMessages")&&"boolean"!=typeof e.allowRawMessages?"allowRawMessages: boolean expected":null!=e.deviceConfigurationJson&&e.hasOwnProperty("deviceConfigurationJson")&&!a.isString(e.deviceConfigurationJson)?"deviceConfigurationJson: string expected":null!=e.userDeviceConfigurationJson&&e.hasOwnProperty("userDeviceConfigurationJson")&&!a.isString(e.userDeviceConfigurationJson)?"userDeviceConfigurationJson: string expected":null!=e.commManagerTypes&&e.hasOwnProperty("commManagerTypes")&&!a.isInteger(e.commManagerTypes)?"commManagerTypes: integer expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.ClientMessage.ConnectLocal)return e;let t=new c.Buttplug.ClientMessage.ConnectLocal;return null!=e.serverName&&(t.serverName=String(e.serverName)),null!=e.maxPingTime&&(t.maxPingTime=e.maxPingTime>>>0),null!=e.allowRawMessages&&(t.allowRawMessages=Boolean(e.allowRawMessages)),null!=e.deviceConfigurationJson&&(t.deviceConfigurationJson=String(e.deviceConfigurationJson)),null!=e.userDeviceConfigurationJson&&(t.userDeviceConfigurationJson=String(e.userDeviceConfigurationJson)),null!=e.commManagerTypes&&(t.commManagerTypes=e.commManagerTypes>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.serverName="",n.maxPingTime=0,n.allowRawMessages=!1,n.deviceConfigurationJson="",n.userDeviceConfigurationJson="",n.commManagerTypes=0),null!=e.serverName&&e.hasOwnProperty("serverName")&&(n.serverName=e.serverName),null!=e.maxPingTime&&e.hasOwnProperty("maxPingTime")&&(n.maxPingTime=e.maxPingTime),null!=e.allowRawMessages&&e.hasOwnProperty("allowRawMessages")&&(n.allowRawMessages=e.allowRawMessages),null!=e.deviceConfigurationJson&&e.hasOwnProperty("deviceConfigurationJson")&&(n.deviceConfigurationJson=e.deviceConfigurationJson),null!=e.userDeviceConfigurationJson&&e.hasOwnProperty("userDeviceConfigurationJson")&&(n.userDeviceConfigurationJson=e.userDeviceConfigurationJson),null!=e.commManagerTypes&&e.hasOwnProperty("commManagerTypes")&&(n.commManagerTypes=e.commManagerTypes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.ConnectWebsocket=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.address="",e.prototype.bypassCertVerification=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.address&&Object.hasOwnProperty.call(e,"address")&&t.uint32(10).string(e.address),null!=e.bypassCertVerification&&Object.hasOwnProperty.call(e,"bypassCertVerification")&&t.uint32(16).bool(e.bypassCertVerification),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.ConnectWebsocket;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.address=e.string();break;case 2:r.bypassCertVerification=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.address&&e.hasOwnProperty("address")&&!a.isString(e.address)?"address: string expected":null!=e.bypassCertVerification&&e.hasOwnProperty("bypassCertVerification")&&"boolean"!=typeof e.bypassCertVerification?"bypassCertVerification: boolean expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.ClientMessage.ConnectWebsocket)return e;let t=new c.Buttplug.ClientMessage.ConnectWebsocket;return null!=e.address&&(t.address=String(e.address)),null!=e.bypassCertVerification&&(t.bypassCertVerification=Boolean(e.bypassCertVerification)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.address="",n.bypassCertVerification=!1),null!=e.address&&e.hasOwnProperty("address")&&(n.address=e.address),null!=e.bypassCertVerification&&e.hasOwnProperty("bypassCertVerification")&&(n.bypassCertVerification=e.bypassCertVerification),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.StartScanning=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.StartScanning;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ClientMessage.StartScanning?e:new c.Buttplug.ClientMessage.StartScanning},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.StopScanning=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.StopScanning;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ClientMessage.StopScanning?e:new c.Buttplug.ClientMessage.StopScanning},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.StopAllDevices=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.StopAllDevices;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ClientMessage.StopAllDevices?e:new c.Buttplug.ClientMessage.StopAllDevices},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.Disconnect=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.Disconnect;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ClientMessage.Disconnect?e:new c.Buttplug.ClientMessage.Disconnect},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.Ping=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.Ping;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ClientMessage.Ping?e:new c.Buttplug.ClientMessage.Ping},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.FFIMessage=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.connectLocal=null,e.prototype.connectWebsocket=null,e.prototype.startScanning=null,e.prototype.stopScanning=null,e.prototype.stopAllDevices=null,e.prototype.disconnect=null,e.prototype.ping=null,Object.defineProperty(e.prototype,"msg",{get:a.oneOfGetter(t=["connectLocal","connectWebsocket","startScanning","stopScanning","stopAllDevices","disconnect","ping"]),set:a.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.connectLocal&&Object.hasOwnProperty.call(e,"connectLocal")&&c.Buttplug.ClientMessage.ConnectLocal.encode(e.connectLocal,t.uint32(10).fork()).ldelim(),null!=e.connectWebsocket&&Object.hasOwnProperty.call(e,"connectWebsocket")&&c.Buttplug.ClientMessage.ConnectWebsocket.encode(e.connectWebsocket,t.uint32(18).fork()).ldelim(),null!=e.startScanning&&Object.hasOwnProperty.call(e,"startScanning")&&c.Buttplug.ClientMessage.StartScanning.encode(e.startScanning,t.uint32(26).fork()).ldelim(),null!=e.stopScanning&&Object.hasOwnProperty.call(e,"stopScanning")&&c.Buttplug.ClientMessage.StopScanning.encode(e.stopScanning,t.uint32(34).fork()).ldelim(),null!=e.stopAllDevices&&Object.hasOwnProperty.call(e,"stopAllDevices")&&c.Buttplug.ClientMessage.StopAllDevices.encode(e.stopAllDevices,t.uint32(42).fork()).ldelim(),null!=e.disconnect&&Object.hasOwnProperty.call(e,"disconnect")&&c.Buttplug.ClientMessage.Disconnect.encode(e.disconnect,t.uint32(50).fork()).ldelim(),null!=e.ping&&Object.hasOwnProperty.call(e,"ping")&&c.Buttplug.ClientMessage.Ping.encode(e.ping,t.uint32(58).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.FFIMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.connectLocal=c.Buttplug.ClientMessage.ConnectLocal.decode(e,e.uint32());break;case 2:r.connectWebsocket=c.Buttplug.ClientMessage.ConnectWebsocket.decode(e,e.uint32());break;case 3:r.startScanning=c.Buttplug.ClientMessage.StartScanning.decode(e,e.uint32());break;case 4:r.stopScanning=c.Buttplug.ClientMessage.StopScanning.decode(e,e.uint32());break;case 5:r.stopAllDevices=c.Buttplug.ClientMessage.StopAllDevices.decode(e,e.uint32());break;case 6:r.disconnect=c.Buttplug.ClientMessage.Disconnect.decode(e,e.uint32());break;case 7:r.ping=c.Buttplug.ClientMessage.Ping.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";let t={};if(null!=e.connectLocal&&e.hasOwnProperty("connectLocal")){t.msg=1;{let t=c.Buttplug.ClientMessage.ConnectLocal.verify(e.connectLocal);if(t)return"connectLocal."+t}}if(null!=e.connectWebsocket&&e.hasOwnProperty("connectWebsocket")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ClientMessage.ConnectWebsocket.verify(e.connectWebsocket);if(t)return"connectWebsocket."+t}}if(null!=e.startScanning&&e.hasOwnProperty("startScanning")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ClientMessage.StartScanning.verify(e.startScanning);if(t)return"startScanning."+t}}if(null!=e.stopScanning&&e.hasOwnProperty("stopScanning")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ClientMessage.StopScanning.verify(e.stopScanning);if(t)return"stopScanning."+t}}if(null!=e.stopAllDevices&&e.hasOwnProperty("stopAllDevices")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ClientMessage.StopAllDevices.verify(e.stopAllDevices);if(t)return"stopAllDevices."+t}}if(null!=e.disconnect&&e.hasOwnProperty("disconnect")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ClientMessage.Disconnect.verify(e.disconnect);if(t)return"disconnect."+t}}if(null!=e.ping&&e.hasOwnProperty("ping")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ClientMessage.Ping.verify(e.ping);if(t)return"ping."+t}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.ClientMessage.FFIMessage)return e;let t=new c.Buttplug.ClientMessage.FFIMessage;if(null!=e.connectLocal){if("object"!=typeof e.connectLocal)throw TypeError(".Buttplug.ClientMessage.FFIMessage.connectLocal: object expected");t.connectLocal=c.Buttplug.ClientMessage.ConnectLocal.fromObject(e.connectLocal)}if(null!=e.connectWebsocket){if("object"!=typeof e.connectWebsocket)throw TypeError(".Buttplug.ClientMessage.FFIMessage.connectWebsocket: object expected");t.connectWebsocket=c.Buttplug.ClientMessage.ConnectWebsocket.fromObject(e.connectWebsocket)}if(null!=e.startScanning){if("object"!=typeof e.startScanning)throw TypeError(".Buttplug.ClientMessage.FFIMessage.startScanning: object expected");t.startScanning=c.Buttplug.ClientMessage.StartScanning.fromObject(e.startScanning)}if(null!=e.stopScanning){if("object"!=typeof e.stopScanning)throw TypeError(".Buttplug.ClientMessage.FFIMessage.stopScanning: object expected");t.stopScanning=c.Buttplug.ClientMessage.StopScanning.fromObject(e.stopScanning)}if(null!=e.stopAllDevices){if("object"!=typeof e.stopAllDevices)throw TypeError(".Buttplug.ClientMessage.FFIMessage.stopAllDevices: object expected");t.stopAllDevices=c.Buttplug.ClientMessage.StopAllDevices.fromObject(e.stopAllDevices)}if(null!=e.disconnect){if("object"!=typeof e.disconnect)throw TypeError(".Buttplug.ClientMessage.FFIMessage.disconnect: object expected");t.disconnect=c.Buttplug.ClientMessage.Disconnect.fromObject(e.disconnect)}if(null!=e.ping){if("object"!=typeof e.ping)throw TypeError(".Buttplug.ClientMessage.FFIMessage.ping: object expected");t.ping=c.Buttplug.ClientMessage.Ping.fromObject(e.ping)}return t},e.toObject=function(e,t){t||(t={});let n={};return null!=e.connectLocal&&e.hasOwnProperty("connectLocal")&&(n.connectLocal=c.Buttplug.ClientMessage.ConnectLocal.toObject(e.connectLocal,t),t.oneofs&&(n.msg="connectLocal")),null!=e.connectWebsocket&&e.hasOwnProperty("connectWebsocket")&&(n.connectWebsocket=c.Buttplug.ClientMessage.ConnectWebsocket.toObject(e.connectWebsocket,t),t.oneofs&&(n.msg="connectWebsocket")),null!=e.startScanning&&e.hasOwnProperty("startScanning")&&(n.startScanning=c.Buttplug.ClientMessage.StartScanning.toObject(e.startScanning,t),t.oneofs&&(n.msg="startScanning")),null!=e.stopScanning&&e.hasOwnProperty("stopScanning")&&(n.stopScanning=c.Buttplug.ClientMessage.StopScanning.toObject(e.stopScanning,t),t.oneofs&&(n.msg="stopScanning")),null!=e.stopAllDevices&&e.hasOwnProperty("stopAllDevices")&&(n.stopAllDevices=c.Buttplug.ClientMessage.StopAllDevices.toObject(e.stopAllDevices,t),t.oneofs&&(n.msg="stopAllDevices")),null!=e.disconnect&&e.hasOwnProperty("disconnect")&&(n.disconnect=c.Buttplug.ClientMessage.Disconnect.toObject(e.disconnect,t),t.oneofs&&(n.msg="disconnect")),null!=e.ping&&e.hasOwnProperty("ping")&&(n.ping=c.Buttplug.ClientMessage.Ping.toObject(e.ping,t),t.oneofs&&(n.msg="ping")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e}(),e.DeviceMessage=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id=0,e.prototype.index=0,e.prototype.message=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(8).uint32(e.id),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(16).uint32(e.index),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&c.Buttplug.DeviceMessage.FFIMessage.encode(e.message,t.uint32(26).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.uint32();break;case 2:r.index=e.uint32();break;case 3:r.message=c.Buttplug.DeviceMessage.FFIMessage.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!a.isInteger(e.id))return"id: integer expected";if(null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index))return"index: integer expected";if(null!=e.message&&e.hasOwnProperty("message")){let t=c.Buttplug.DeviceMessage.FFIMessage.verify(e.message);if(t)return"message."+t}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage)return e;let t=new c.Buttplug.DeviceMessage;if(null!=e.id&&(t.id=e.id>>>0),null!=e.index&&(t.index=e.index>>>0),null!=e.message){if("object"!=typeof e.message)throw TypeError(".Buttplug.DeviceMessage.message: object expected");t.message=c.Buttplug.DeviceMessage.FFIMessage.fromObject(e.message)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id=0,n.index=0,n.message=null),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),null!=e.message&&e.hasOwnProperty("message")&&(n.message=c.Buttplug.DeviceMessage.FFIMessage.toObject(e.message,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e.VibrateComponent=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.prototype.speed=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),null!=e.speed&&Object.hasOwnProperty.call(e,"speed")&&t.uint32(17).double(e.speed),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.VibrateComponent;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;case 2:r.speed=e.double();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index)?"index: integer expected":null!=e.speed&&e.hasOwnProperty("speed")&&"number"!=typeof e.speed?"speed: number expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.VibrateComponent)return e;let t=new c.Buttplug.DeviceMessage.VibrateComponent;return null!=e.index&&(t.index=e.index>>>0),null!=e.speed&&(t.speed=Number(e.speed)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0,n.speed=0),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),null!=e.speed&&e.hasOwnProperty("speed")&&(n.speed=t.json&&!isFinite(e.speed)?String(e.speed):e.speed),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.VibrateCmd=function(){function e(e){if(this.speeds=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.speeds=a.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.speeds&&e.speeds.length)for(let n=0;n<e.speeds.length;++n)c.Buttplug.DeviceMessage.VibrateComponent.encode(e.speeds[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.VibrateCmd;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.speeds&&r.speeds.length||(r.speeds=[]),r.speeds.push(c.Buttplug.DeviceMessage.VibrateComponent.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.speeds&&e.hasOwnProperty("speeds")){if(!Array.isArray(e.speeds))return"speeds: array expected";for(let t=0;t<e.speeds.length;++t){let n=c.Buttplug.DeviceMessage.VibrateComponent.verify(e.speeds[t]);if(n)return"speeds."+n}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.VibrateCmd)return e;let t=new c.Buttplug.DeviceMessage.VibrateCmd;if(e.speeds){if(!Array.isArray(e.speeds))throw TypeError(".Buttplug.DeviceMessage.VibrateCmd.speeds: array expected");t.speeds=[];for(let n=0;n<e.speeds.length;++n){if("object"!=typeof e.speeds[n])throw TypeError(".Buttplug.DeviceMessage.VibrateCmd.speeds: object expected");t.speeds[n]=c.Buttplug.DeviceMessage.VibrateComponent.fromObject(e.speeds[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.speeds=[]),e.speeds&&e.speeds.length){n.speeds=[];for(let r=0;r<e.speeds.length;++r)n.speeds[r]=c.Buttplug.DeviceMessage.VibrateComponent.toObject(e.speeds[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RotateComponent=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.prototype.speed=0,e.prototype.clockwise=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),null!=e.speed&&Object.hasOwnProperty.call(e,"speed")&&t.uint32(17).double(e.speed),null!=e.clockwise&&Object.hasOwnProperty.call(e,"clockwise")&&t.uint32(24).bool(e.clockwise),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.RotateComponent;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;case 2:r.speed=e.double();break;case 3:r.clockwise=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index)?"index: integer expected":null!=e.speed&&e.hasOwnProperty("speed")&&"number"!=typeof e.speed?"speed: number expected":null!=e.clockwise&&e.hasOwnProperty("clockwise")&&"boolean"!=typeof e.clockwise?"clockwise: boolean expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.RotateComponent)return e;let t=new c.Buttplug.DeviceMessage.RotateComponent;return null!=e.index&&(t.index=e.index>>>0),null!=e.speed&&(t.speed=Number(e.speed)),null!=e.clockwise&&(t.clockwise=Boolean(e.clockwise)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0,n.speed=0,n.clockwise=!1),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),null!=e.speed&&e.hasOwnProperty("speed")&&(n.speed=t.json&&!isFinite(e.speed)?String(e.speed):e.speed),null!=e.clockwise&&e.hasOwnProperty("clockwise")&&(n.clockwise=e.clockwise),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RotateCmd=function(){function e(e){if(this.rotations=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.rotations=a.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.rotations&&e.rotations.length)for(let n=0;n<e.rotations.length;++n)c.Buttplug.DeviceMessage.RotateComponent.encode(e.rotations[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.RotateCmd;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.rotations&&r.rotations.length||(r.rotations=[]),r.rotations.push(c.Buttplug.DeviceMessage.RotateComponent.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.rotations&&e.hasOwnProperty("rotations")){if(!Array.isArray(e.rotations))return"rotations: array expected";for(let t=0;t<e.rotations.length;++t){let n=c.Buttplug.DeviceMessage.RotateComponent.verify(e.rotations[t]);if(n)return"rotations."+n}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.RotateCmd)return e;let t=new c.Buttplug.DeviceMessage.RotateCmd;if(e.rotations){if(!Array.isArray(e.rotations))throw TypeError(".Buttplug.DeviceMessage.RotateCmd.rotations: array expected");t.rotations=[];for(let n=0;n<e.rotations.length;++n){if("object"!=typeof e.rotations[n])throw TypeError(".Buttplug.DeviceMessage.RotateCmd.rotations: object expected");t.rotations[n]=c.Buttplug.DeviceMessage.RotateComponent.fromObject(e.rotations[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.rotations=[]),e.rotations&&e.rotations.length){n.rotations=[];for(let r=0;r<e.rotations.length;++r)n.rotations[r]=c.Buttplug.DeviceMessage.RotateComponent.toObject(e.rotations[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.LinearComponent=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.prototype.duration=0,e.prototype.position=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),null!=e.duration&&Object.hasOwnProperty.call(e,"duration")&&t.uint32(16).uint32(e.duration),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&t.uint32(25).double(e.position),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.LinearComponent;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;case 2:r.duration=e.uint32();break;case 3:r.position=e.double();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index)?"index: integer expected":null!=e.duration&&e.hasOwnProperty("duration")&&!a.isInteger(e.duration)?"duration: integer expected":null!=e.position&&e.hasOwnProperty("position")&&"number"!=typeof e.position?"position: number expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.LinearComponent)return e;let t=new c.Buttplug.DeviceMessage.LinearComponent;return null!=e.index&&(t.index=e.index>>>0),null!=e.duration&&(t.duration=e.duration>>>0),null!=e.position&&(t.position=Number(e.position)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0,n.duration=0,n.position=0),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),null!=e.duration&&e.hasOwnProperty("duration")&&(n.duration=e.duration),null!=e.position&&e.hasOwnProperty("position")&&(n.position=t.json&&!isFinite(e.position)?String(e.position):e.position),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.LinearCmd=function(){function e(e){if(this.movements=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.movements=a.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.movements&&e.movements.length)for(let n=0;n<e.movements.length;++n)c.Buttplug.DeviceMessage.LinearComponent.encode(e.movements[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.LinearCmd;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.movements&&r.movements.length||(r.movements=[]),r.movements.push(c.Buttplug.DeviceMessage.LinearComponent.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.movements&&e.hasOwnProperty("movements")){if(!Array.isArray(e.movements))return"movements: array expected";for(let t=0;t<e.movements.length;++t){let n=c.Buttplug.DeviceMessage.LinearComponent.verify(e.movements[t]);if(n)return"movements."+n}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.LinearCmd)return e;let t=new c.Buttplug.DeviceMessage.LinearCmd;if(e.movements){if(!Array.isArray(e.movements))throw TypeError(".Buttplug.DeviceMessage.LinearCmd.movements: array expected");t.movements=[];for(let n=0;n<e.movements.length;++n){if("object"!=typeof e.movements[n])throw TypeError(".Buttplug.DeviceMessage.LinearCmd.movements: object expected");t.movements[n]=c.Buttplug.DeviceMessage.LinearComponent.fromObject(e.movements[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.movements=[]),e.movements&&e.movements.length){n.movements=[];for(let r=0;r<e.movements.length;++r)n.movements[r]=c.Buttplug.DeviceMessage.LinearComponent.toObject(e.movements[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.StopDeviceCmd=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.StopDeviceCmd;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.DeviceMessage.StopDeviceCmd?e:new c.Buttplug.DeviceMessage.StopDeviceCmd},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RawReadCmd=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.endpoint=0,e.prototype.data=a.newBuffer([]),e.prototype.expectedLength=0,e.prototype.timeout=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.endpoint&&Object.hasOwnProperty.call(e,"endpoint")&&t.uint32(8).int32(e.endpoint),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(18).bytes(e.data),null!=e.expectedLength&&Object.hasOwnProperty.call(e,"expectedLength")&&t.uint32(24).uint32(e.expectedLength),null!=e.timeout&&Object.hasOwnProperty.call(e,"timeout")&&t.uint32(32).uint32(e.timeout),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.RawReadCmd;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.endpoint=e.int32();break;case 2:r.data=e.bytes();break;case 3:r.expectedLength=e.uint32();break;case 4:r.timeout=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.endpoint&&e.hasOwnProperty("endpoint"))switch(e.endpoint){default:return"endpoint: enum value expected";case 0: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:}return null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||a.isString(e.data))?"data: buffer expected":null!=e.expectedLength&&e.hasOwnProperty("expectedLength")&&!a.isInteger(e.expectedLength)?"expectedLength: integer expected":null!=e.timeout&&e.hasOwnProperty("timeout")&&!a.isInteger(e.timeout)?"timeout: integer expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.RawReadCmd)return e;let t=new c.Buttplug.DeviceMessage.RawReadCmd;switch(e.endpoint){case"Command":case 0:t.endpoint=0;break;case"Firmware":case 1:t.endpoint=1;break;case"Rx":case 2:t.endpoint=2;break;case"RxAccel":case 3:t.endpoint=3;break;case"RxBLEBattery":case 4:t.endpoint=4;break;case"RxPressure":case 5:t.endpoint=5;break;case"RxTouch":case 6:t.endpoint=6;break;case"Tx":case 7:t.endpoint=7;break;case"TxMode":case 8:t.endpoint=8;break;case"TxShock":case 9:t.endpoint=9;break;case"TxVibrate":case 10:t.endpoint=10;break;case"TxVendorControl":case 11:t.endpoint=11;break;case"Whitelist":case 12:t.endpoint=12;break;case"Generic0":case 13:t.endpoint=13;break;case"Generic1":case 14:t.endpoint=14;break;case"Generic2":case 15:t.endpoint=15;break;case"Generic3":case 16:t.endpoint=16;break;case"Generic4":case 17:t.endpoint=17;break;case"Generic5":case 18:t.endpoint=18;break;case"Generic6":case 19:t.endpoint=19;break;case"Generic7":case 20:t.endpoint=20;break;case"Generic8":case 21:t.endpoint=21;break;case"Generic9":case 22:t.endpoint=22;break;case"Generic10":case 23:t.endpoint=23;break;case"Generic11":case 24:t.endpoint=24;break;case"Generic12":case 25:t.endpoint=25;break;case"Generic13":case 26:t.endpoint=26;break;case"Generic14":case 27:t.endpoint=27;break;case"Generic15":case 28:t.endpoint=28;break;case"Generic16":case 29:t.endpoint=29;break;case"Generic17":case 30:t.endpoint=30;break;case"Generic18":case 31:t.endpoint=31;break;case"Generic19":case 32:t.endpoint=32;break;case"Generic20":case 33:t.endpoint=33;break;case"Generic21":case 34:t.endpoint=34;break;case"Generic22":case 35:t.endpoint=35;break;case"Generic23":case 36:t.endpoint=36;break;case"Generic24":case 37:t.endpoint=37;break;case"Generic25":case 38:t.endpoint=38;break;case"Generic26":case 39:t.endpoint=39;break;case"Generic27":case 40:t.endpoint=40;break;case"Generic28":case 41:t.endpoint=41;break;case"Generic29":case 42:t.endpoint=42;break;case"Generic30":case 43:t.endpoint=43;break;case"Generic31":case 44:t.endpoint=44;break;case"RxBLEModel":case 45:t.endpoint=45}return null!=e.data&&("string"==typeof e.data?a.base64.decode(e.data,t.data=a.newBuffer(a.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),null!=e.expectedLength&&(t.expectedLength=e.expectedLength>>>0),null!=e.timeout&&(t.timeout=e.timeout>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.endpoint=t.enums===String?"Command":0,t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=a.newBuffer(n.data))),n.expectedLength=0,n.timeout=0),null!=e.endpoint&&e.hasOwnProperty("endpoint")&&(n.endpoint=t.enums===String?c.Buttplug.Endpoint[e.endpoint]:e.endpoint),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?a.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.expectedLength&&e.hasOwnProperty("expectedLength")&&(n.expectedLength=e.expectedLength),null!=e.timeout&&e.hasOwnProperty("timeout")&&(n.timeout=e.timeout),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RawWriteCmd=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.endpoint=0,e.prototype.data=a.newBuffer([]),e.prototype.writeWithResponse=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.endpoint&&Object.hasOwnProperty.call(e,"endpoint")&&t.uint32(8).int32(e.endpoint),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(18).bytes(e.data),null!=e.writeWithResponse&&Object.hasOwnProperty.call(e,"writeWithResponse")&&t.uint32(24).bool(e.writeWithResponse),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.RawWriteCmd;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.endpoint=e.int32();break;case 2:r.data=e.bytes();break;case 3:r.writeWithResponse=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.endpoint&&e.hasOwnProperty("endpoint"))switch(e.endpoint){default:return"endpoint: enum value expected";case 0: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:}return null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||a.isString(e.data))?"data: buffer expected":null!=e.writeWithResponse&&e.hasOwnProperty("writeWithResponse")&&"boolean"!=typeof e.writeWithResponse?"writeWithResponse: boolean expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.RawWriteCmd)return e;let t=new c.Buttplug.DeviceMessage.RawWriteCmd;switch(e.endpoint){case"Command":case 0:t.endpoint=0;break;case"Firmware":case 1:t.endpoint=1;break;case"Rx":case 2:t.endpoint=2;break;case"RxAccel":case 3:t.endpoint=3;break;case"RxBLEBattery":case 4:t.endpoint=4;break;case"RxPressure":case 5:t.endpoint=5;break;case"RxTouch":case 6:t.endpoint=6;break;case"Tx":case 7:t.endpoint=7;break;case"TxMode":case 8:t.endpoint=8;break;case"TxShock":case 9:t.endpoint=9;break;case"TxVibrate":case 10:t.endpoint=10;break;case"TxVendorControl":case 11:t.endpoint=11;break;case"Whitelist":case 12:t.endpoint=12;break;case"Generic0":case 13:t.endpoint=13;break;case"Generic1":case 14:t.endpoint=14;break;case"Generic2":case 15:t.endpoint=15;break;case"Generic3":case 16:t.endpoint=16;break;case"Generic4":case 17:t.endpoint=17;break;case"Generic5":case 18:t.endpoint=18;break;case"Generic6":case 19:t.endpoint=19;break;case"Generic7":case 20:t.endpoint=20;break;case"Generic8":case 21:t.endpoint=21;break;case"Generic9":case 22:t.endpoint=22;break;case"Generic10":case 23:t.endpoint=23;break;case"Generic11":case 24:t.endpoint=24;break;case"Generic12":case 25:t.endpoint=25;break;case"Generic13":case 26:t.endpoint=26;break;case"Generic14":case 27:t.endpoint=27;break;case"Generic15":case 28:t.endpoint=28;break;case"Generic16":case 29:t.endpoint=29;break;case"Generic17":case 30:t.endpoint=30;break;case"Generic18":case 31:t.endpoint=31;break;case"Generic19":case 32:t.endpoint=32;break;case"Generic20":case 33:t.endpoint=33;break;case"Generic21":case 34:t.endpoint=34;break;case"Generic22":case 35:t.endpoint=35;break;case"Generic23":case 36:t.endpoint=36;break;case"Generic24":case 37:t.endpoint=37;break;case"Generic25":case 38:t.endpoint=38;break;case"Generic26":case 39:t.endpoint=39;break;case"Generic27":case 40:t.endpoint=40;break;case"Generic28":case 41:t.endpoint=41;break;case"Generic29":case 42:t.endpoint=42;break;case"Generic30":case 43:t.endpoint=43;break;case"Generic31":case 44:t.endpoint=44;break;case"RxBLEModel":case 45:t.endpoint=45}return null!=e.data&&("string"==typeof e.data?a.base64.decode(e.data,t.data=a.newBuffer(a.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),null!=e.writeWithResponse&&(t.writeWithResponse=Boolean(e.writeWithResponse)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.endpoint=t.enums===String?"Command":0,t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=a.newBuffer(n.data))),n.writeWithResponse=!1),null!=e.endpoint&&e.hasOwnProperty("endpoint")&&(n.endpoint=t.enums===String?c.Buttplug.Endpoint[e.endpoint]:e.endpoint),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?a.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.writeWithResponse&&e.hasOwnProperty("writeWithResponse")&&(n.writeWithResponse=e.writeWithResponse),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RawSubscribeCmd=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.endpoint=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.endpoint&&Object.hasOwnProperty.call(e,"endpoint")&&t.uint32(8).int32(e.endpoint),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.RawSubscribeCmd;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.endpoint=e.int32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.endpoint&&e.hasOwnProperty("endpoint"))switch(e.endpoint){default:return"endpoint: enum value expected";case 0: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:}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.RawSubscribeCmd)return e;let t=new c.Buttplug.DeviceMessage.RawSubscribeCmd;switch(e.endpoint){case"Command":case 0:t.endpoint=0;break;case"Firmware":case 1:t.endpoint=1;break;case"Rx":case 2:t.endpoint=2;break;case"RxAccel":case 3:t.endpoint=3;break;case"RxBLEBattery":case 4:t.endpoint=4;break;case"RxPressure":case 5:t.endpoint=5;break;case"RxTouch":case 6:t.endpoint=6;break;case"Tx":case 7:t.endpoint=7;break;case"TxMode":case 8:t.endpoint=8;break;case"TxShock":case 9:t.endpoint=9;break;case"TxVibrate":case 10:t.endpoint=10;break;case"TxVendorControl":case 11:t.endpoint=11;break;case"Whitelist":case 12:t.endpoint=12;break;case"Generic0":case 13:t.endpoint=13;break;case"Generic1":case 14:t.endpoint=14;break;case"Generic2":case 15:t.endpoint=15;break;case"Generic3":case 16:t.endpoint=16;break;case"Generic4":case 17:t.endpoint=17;break;case"Generic5":case 18:t.endpoint=18;break;case"Generic6":case 19:t.endpoint=19;break;case"Generic7":case 20:t.endpoint=20;break;case"Generic8":case 21:t.endpoint=21;break;case"Generic9":case 22:t.endpoint=22;break;case"Generic10":case 23:t.endpoint=23;break;case"Generic11":case 24:t.endpoint=24;break;case"Generic12":case 25:t.endpoint=25;break;case"Generic13":case 26:t.endpoint=26;break;case"Generic14":case 27:t.endpoint=27;break;case"Generic15":case 28:t.endpoint=28;break;case"Generic16":case 29:t.endpoint=29;break;case"Generic17":case 30:t.endpoint=30;break;case"Generic18":case 31:t.endpoint=31;break;case"Generic19":case 32:t.endpoint=32;break;case"Generic20":case 33:t.endpoint=33;break;case"Generic21":case 34:t.endpoint=34;break;case"Generic22":case 35:t.endpoint=35;break;case"Generic23":case 36:t.endpoint=36;break;case"Generic24":case 37:t.endpoint=37;break;case"Generic25":case 38:t.endpoint=38;break;case"Generic26":case 39:t.endpoint=39;break;case"Generic27":case 40:t.endpoint=40;break;case"Generic28":case 41:t.endpoint=41;break;case"Generic29":case 42:t.endpoint=42;break;case"Generic30":case 43:t.endpoint=43;break;case"Generic31":case 44:t.endpoint=44;break;case"RxBLEModel":case 45:t.endpoint=45}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.endpoint=t.enums===String?"Command":0),null!=e.endpoint&&e.hasOwnProperty("endpoint")&&(n.endpoint=t.enums===String?c.Buttplug.Endpoint[e.endpoint]:e.endpoint),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RawUnsubscribeCmd=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.endpoint=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.endpoint&&Object.hasOwnProperty.call(e,"endpoint")&&t.uint32(8).int32(e.endpoint),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.RawUnsubscribeCmd;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.endpoint=e.int32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.endpoint&&e.hasOwnProperty("endpoint"))switch(e.endpoint){default:return"endpoint: enum value expected";case 0: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:}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.RawUnsubscribeCmd)return e;let t=new c.Buttplug.DeviceMessage.RawUnsubscribeCmd;switch(e.endpoint){case"Command":case 0:t.endpoint=0;break;case"Firmware":case 1:t.endpoint=1;break;case"Rx":case 2:t.endpoint=2;break;case"RxAccel":case 3:t.endpoint=3;break;case"RxBLEBattery":case 4:t.endpoint=4;break;case"RxPressure":case 5:t.endpoint=5;break;case"RxTouch":case 6:t.endpoint=6;break;case"Tx":case 7:t.endpoint=7;break;case"TxMode":case 8:t.endpoint=8;break;case"TxShock":case 9:t.endpoint=9;break;case"TxVibrate":case 10:t.endpoint=10;break;case"TxVendorControl":case 11:t.endpoint=11;break;case"Whitelist":case 12:t.endpoint=12;break;case"Generic0":case 13:t.endpoint=13;break;case"Generic1":case 14:t.endpoint=14;break;case"Generic2":case 15:t.endpoint=15;break;case"Generic3":case 16:t.endpoint=16;break;case"Generic4":case 17:t.endpoint=17;break;case"Generic5":case 18:t.endpoint=18;break;case"Generic6":case 19:t.endpoint=19;break;case"Generic7":case 20:t.endpoint=20;break;case"Generic8":case 21:t.endpoint=21;break;case"Generic9":case 22:t.endpoint=22;break;case"Generic10":case 23:t.endpoint=23;break;case"Generic11":case 24:t.endpoint=24;break;case"Generic12":case 25:t.endpoint=25;break;case"Generic13":case 26:t.endpoint=26;break;case"Generic14":case 27:t.endpoint=27;break;case"Generic15":case 28:t.endpoint=28;break;case"Generic16":case 29:t.endpoint=29;break;case"Generic17":case 30:t.endpoint=30;break;case"Generic18":case 31:t.endpoint=31;break;case"Generic19":case 32:t.endpoint=32;break;case"Generic20":case 33:t.endpoint=33;break;case"Generic21":case 34:t.endpoint=34;break;case"Generic22":case 35:t.endpoint=35;break;case"Generic23":case 36:t.endpoint=36;break;case"Generic24":case 37:t.endpoint=37;break;case"Generic25":case 38:t.endpoint=38;break;case"Generic26":case 39:t.endpoint=39;break;case"Generic27":case 40:t.endpoint=40;break;case"Generic28":case 41:t.endpoint=41;break;case"Generic29":case 42:t.endpoint=42;break;case"Generic30":case 43:t.endpoint=43;break;case"Generic31":case 44:t.endpoint=44;break;case"RxBLEModel":case 45:t.endpoint=45}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.endpoint=t.enums===String?"Command":0),null!=e.endpoint&&e.hasOwnProperty("endpoint")&&(n.endpoint=t.enums===String?c.Buttplug.Endpoint[e.endpoint]:e.endpoint),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.BatteryLevelCmd=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.BatteryLevelCmd;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.DeviceMessage.BatteryLevelCmd?e:new c.Buttplug.DeviceMessage.BatteryLevelCmd},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RSSILevelCmd=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.RSSILevelCmd;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.DeviceMessage.RSSILevelCmd?e:new c.Buttplug.DeviceMessage.RSSILevelCmd},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.FFIMessage=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.vibrateCmd=null,e.prototype.rotateCmd=null,e.prototype.linearCmd=null,e.prototype.stopDeviceCmd=null,e.prototype.rawReadCmd=null,e.prototype.rawWriteCmd=null,e.prototype.rawSubscribeCmd=null,e.prototype.rawUnsubscribeCmd=null,e.prototype.batteryLevelCmd=null,e.prototype.rssiLevelCmd=null,Object.defineProperty(e.prototype,"msg",{get:a.oneOfGetter(t=["vibrateCmd","rotateCmd","linearCmd","stopDeviceCmd","rawReadCmd","rawWriteCmd","rawSubscribeCmd","rawUnsubscribeCmd","batteryLevelCmd","rssiLevelCmd"]),set:a.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.vibrateCmd&&Object.hasOwnProperty.call(e,"vibrateCmd")&&c.Buttplug.DeviceMessage.VibrateCmd.encode(e.vibrateCmd,t.uint32(10).fork()).ldelim(),null!=e.rotateCmd&&Object.hasOwnProperty.call(e,"rotateCmd")&&c.Buttplug.DeviceMessage.RotateCmd.encode(e.rotateCmd,t.uint32(18).fork()).ldelim(),null!=e.linearCmd&&Object.hasOwnProperty.call(e,"linearCmd")&&c.Buttplug.DeviceMessage.LinearCmd.encode(e.linearCmd,t.uint32(26).fork()).ldelim(),null!=e.stopDeviceCmd&&Object.hasOwnProperty.call(e,"stopDeviceCmd")&&c.Buttplug.DeviceMessage.StopDeviceCmd.encode(e.stopDeviceCmd,t.uint32(34).fork()).ldelim(),null!=e.rawReadCmd&&Object.hasOwnProperty.call(e,"rawReadCmd")&&c.Buttplug.DeviceMessage.RawReadCmd.encode(e.rawReadCmd,t.uint32(42).fork()).ldelim(),null!=e.rawWriteCmd&&Object.hasOwnProperty.call(e,"rawWriteCmd")&&c.Buttplug.DeviceMessage.RawWriteCmd.encode(e.rawWriteCmd,t.uint32(50).fork()).ldelim(),null!=e.rawSubscribeCmd&&Object.hasOwnProperty.call(e,"rawSubscribeCmd")&&c.Buttplug.DeviceMessage.RawSubscribeCmd.encode(e.rawSubscribeCmd,t.uint32(58).fork()).ldelim(),null!=e.rawUnsubscribeCmd&&Object.hasOwnProperty.call(e,"rawUnsubscribeCmd")&&c.Buttplug.DeviceMessage.RawUnsubscribeCmd.encode(e.rawUnsubscribeCmd,t.uint32(66).fork()).ldelim(),null!=e.batteryLevelCmd&&Object.hasOwnProperty.call(e,"batteryLevelCmd")&&c.Buttplug.DeviceMessage.BatteryLevelCmd.encode(e.batteryLevelCmd,t.uint32(74).fork()).ldelim(),null!=e.rssiLevelCmd&&Object.hasOwnProperty.call(e,"rssiLevelCmd")&&c.Buttplug.DeviceMessage.RSSILevelCmd.encode(e.rssiLevelCmd,t.uint32(82).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.FFIMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.vibrateCmd=c.Buttplug.DeviceMessage.VibrateCmd.decode(e,e.uint32());break;case 2:r.rotateCmd=c.Buttplug.DeviceMessage.RotateCmd.decode(e,e.uint32());break;case 3:r.linearCmd=c.Buttplug.DeviceMessage.LinearCmd.decode(e,e.uint32());break;case 4:r.stopDeviceCmd=c.Buttplug.DeviceMessage.StopDeviceCmd.decode(e,e.uint32());break;case 5:r.rawReadCmd=c.Buttplug.DeviceMessage.RawReadCmd.decode(e,e.uint32());break;case 6:r.rawWriteCmd=c.Buttplug.DeviceMessage.RawWriteCmd.decode(e,e.uint32());break;case 7:r.rawSubscribeCmd=c.Buttplug.DeviceMessage.RawSubscribeCmd.decode(e,e.uint32());break;case 8:r.rawUnsubscribeCmd=c.Buttplug.DeviceMessage.RawUnsubscribeCmd.decode(e,e.uint32());break;case 9:r.batteryLevelCmd=c.Buttplug.DeviceMessage.BatteryLevelCmd.decode(e,e.uint32());break;case 10:r.rssiLevelCmd=c.Buttplug.DeviceMessage.RSSILevelCmd.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";let t={};if(null!=e.vibrateCmd&&e.hasOwnProperty("vibrateCmd")){t.msg=1;{let t=c.Buttplug.DeviceMessage.VibrateCmd.verify(e.vibrateCmd);if(t)return"vibrateCmd."+t}}if(null!=e.rotateCmd&&e.hasOwnProperty("rotateCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.RotateCmd.verify(e.rotateCmd);if(t)return"rotateCmd."+t}}if(null!=e.linearCmd&&e.hasOwnProperty("linearCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.LinearCmd.verify(e.linearCmd);if(t)return"linearCmd."+t}}if(null!=e.stopDeviceCmd&&e.hasOwnProperty("stopDeviceCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.StopDeviceCmd.verify(e.stopDeviceCmd);if(t)return"stopDeviceCmd."+t}}if(null!=e.rawReadCmd&&e.hasOwnProperty("rawReadCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.RawReadCmd.verify(e.rawReadCmd);if(t)return"rawReadCmd."+t}}if(null!=e.rawWriteCmd&&e.hasOwnProperty("rawWriteCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.RawWriteCmd.verify(e.rawWriteCmd);if(t)return"rawWriteCmd."+t}}if(null!=e.rawSubscribeCmd&&e.hasOwnProperty("rawSubscribeCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.RawSubscribeCmd.verify(e.rawSubscribeCmd);if(t)return"rawSubscribeCmd."+t}}if(null!=e.rawUnsubscribeCmd&&e.hasOwnProperty("rawUnsubscribeCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.RawUnsubscribeCmd.verify(e.rawUnsubscribeCmd);if(t)return"rawUnsubscribeCmd."+t}}if(null!=e.batteryLevelCmd&&e.hasOwnProperty("batteryLevelCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.BatteryLevelCmd.verify(e.batteryLevelCmd);if(t)return"batteryLevelCmd."+t}}if(null!=e.rssiLevelCmd&&e.hasOwnProperty("rssiLevelCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.RSSILevelCmd.verify(e.rssiLevelCmd);if(t)return"rssiLevelCmd."+t}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.FFIMessage)return e;let t=new c.Buttplug.DeviceMessage.FFIMessage;if(null!=e.vibrateCmd){if("object"!=typeof e.vibrateCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.vibrateCmd: object expected");t.vibrateCmd=c.Buttplug.DeviceMessage.VibrateCmd.fromObject(e.vibrateCmd)}if(null!=e.rotateCmd){if("object"!=typeof e.rotateCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.rotateCmd: object expected");t.rotateCmd=c.Buttplug.DeviceMessage.RotateCmd.fromObject(e.rotateCmd)}if(null!=e.linearCmd){if("object"!=typeof e.linearCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.linearCmd: object expected");t.linearCmd=c.Buttplug.DeviceMessage.LinearCmd.fromObject(e.linearCmd)}if(null!=e.stopDeviceCmd){if("object"!=typeof e.stopDeviceCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.stopDeviceCmd: object expected");t.stopDeviceCmd=c.Buttplug.DeviceMessage.StopDeviceCmd.fromObject(e.stopDeviceCmd)}if(null!=e.rawReadCmd){if("object"!=typeof e.rawReadCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.rawReadCmd: object expected");t.rawReadCmd=c.Buttplug.DeviceMessage.RawReadCmd.fromObject(e.rawReadCmd)}if(null!=e.rawWriteCmd){if("object"!=typeof e.rawWriteCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.rawWriteCmd: object expected");t.rawWriteCmd=c.Buttplug.DeviceMessage.RawWriteCmd.fromObject(e.rawWriteCmd)}if(null!=e.rawSubscribeCmd){if("object"!=typeof e.rawSubscribeCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.rawSubscribeCmd: object expected");t.rawSubscribeCmd=c.Buttplug.DeviceMessage.RawSubscribeCmd.fromObject(e.rawSubscribeCmd)}if(null!=e.rawUnsubscribeCmd){if("object"!=typeof e.rawUnsubscribeCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.rawUnsubscribeCmd: object expected");t.rawUnsubscribeCmd=c.Buttplug.DeviceMessage.RawUnsubscribeCmd.fromObject(e.rawUnsubscribeCmd)}if(null!=e.batteryLevelCmd){if("object"!=typeof e.batteryLevelCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.batteryLevelCmd: object expected");t.batteryLevelCmd=c.Buttplug.DeviceMessage.BatteryLevelCmd.fromObject(e.batteryLevelCmd)}if(null!=e.rssiLevelCmd){if("object"!=typeof e.rssiLevelCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.rssiLevelCmd: object expected");t.rssiLevelCmd=c.Buttplug.DeviceMessage.RSSILevelCmd.fromObject(e.rssiLevelCmd)}return t},e.toObject=function(e,t){t||(t={});let n={};return null!=e.vibrateCmd&&e.hasOwnProperty("vibrateCmd")&&(n.vibrateCmd=c.Buttplug.DeviceMessage.VibrateCmd.toObject(e.vibrateCmd,t),t.oneofs&&(n.msg="vibrateCmd")),null!=e.rotateCmd&&e.hasOwnProperty("rotateCmd")&&(n.rotateCmd=c.Buttplug.DeviceMessage.RotateCmd.toObject(e.rotateCmd,t),t.oneofs&&(n.msg="rotateCmd")),null!=e.linearCmd&&e.hasOwnProperty("linearCmd")&&(n.linearCmd=c.Buttplug.DeviceMessage.LinearCmd.toObject(e.linearCmd,t),t.oneofs&&(n.msg="linearCmd")),null!=e.stopDeviceCmd&&e.hasOwnProperty("stopDeviceCmd")&&(n.stopDeviceCmd=c.Buttplug.DeviceMessage.StopDeviceCmd.toObject(e.stopDeviceCmd,t),t.oneofs&&(n.msg="stopDeviceCmd")),null!=e.rawReadCmd&&e.hasOwnProperty("rawReadCmd")&&(n.rawReadCmd=c.Buttplug.DeviceMessage.RawReadCmd.toObject(e.rawReadCmd,t),t.oneofs&&(n.msg="rawReadCmd")),null!=e.rawWriteCmd&&e.hasOwnProperty("rawWriteCmd")&&(n.rawWriteCmd=c.Buttplug.DeviceMessage.RawWriteCmd.toObject(e.rawWriteCmd,t),t.oneofs&&(n.msg="rawWriteCmd")),null!=e.rawSubscribeCmd&&e.hasOwnProperty("rawSubscribeCmd")&&(n.rawSubscribeCmd=c.Buttplug.DeviceMessage.RawSubscribeCmd.toObject(e.rawSubscribeCmd,t),t.oneofs&&(n.msg="rawSubscribeCmd")),null!=e.rawUnsubscribeCmd&&e.hasOwnProperty("rawUnsubscribeCmd")&&(n.rawUnsubscribeCmd=c.Buttplug.DeviceMessage.RawUnsubscribeCmd.toObject(e.rawUnsubscribeCmd,t),t.oneofs&&(n.msg="rawUnsubscribeCmd")),null!=e.batteryLevelCmd&&e.hasOwnProperty("batteryLevelCmd")&&(n.batteryLevelCmd=c.Buttplug.DeviceMessage.BatteryLevelCmd.toObject(e.batteryLevelCmd,t),t.oneofs&&(n.msg="batteryLevelCmd")),null!=e.rssiLevelCmd&&e.hasOwnProperty("rssiLevelCmd")&&(n.rssiLevelCmd=c.Buttplug.DeviceMessage.RSSILevelCmd.toObject(e.rssiLevelCmd,t),t.oneofs&&(n.msg="rssiLevelCmd")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e}(),e.ServerMessage=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.ok=null,e.prototype.error=null,e.prototype.scanningFinished=null,e.prototype.deviceAdded=null,e.prototype.deviceRemoved=null,e.prototype.disconnect=null,Object.defineProperty(e.prototype,"msg",{get:a.oneOfGetter(t=["ok","error","scanningFinished","deviceAdded","deviceRemoved","disconnect"]),set:a.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.ok&&Object.hasOwnProperty.call(e,"ok")&&c.Buttplug.ServerMessage.Ok.encode(e.ok,t.uint32(10).fork()).ldelim(),null!=e.error&&Object.hasOwnProperty.call(e,"error")&&c.Buttplug.ServerMessage.Error.encode(e.error,t.uint32(18).fork()).ldelim(),null!=e.scanningFinished&&Object.hasOwnProperty.call(e,"scanningFinished")&&c.Buttplug.ServerMessage.ScanningFinished.encode(e.scanningFinished,t.uint32(26).fork()).ldelim(),null!=e.deviceAdded&&Object.hasOwnProperty.call(e,"deviceAdded")&&c.Buttplug.ServerMessage.DeviceAdded.encode(e.deviceAdded,t.uint32(34).fork()).ldelim(),null!=e.deviceRemoved&&Object.hasOwnProperty.call(e,"deviceRemoved")&&c.Buttplug.ServerMessage.DeviceRemoved.encode(e.deviceRemoved,t.uint32(42).fork()).ldelim(),null!=e.disconnect&&Object.hasOwnProperty.call(e,"disconnect")&&c.Buttplug.ServerMessage.Disconnect.encode(e.disconnect,t.uint32(50).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.ok=c.Buttplug.ServerMessage.Ok.decode(e,e.uint32());break;case 2:r.error=c.Buttplug.ServerMessage.Error.decode(e,e.uint32());break;case 3:r.scanningFinished=c.Buttplug.ServerMessage.ScanningFinished.decode(e,e.uint32());break;case 4:r.deviceAdded=c.Buttplug.ServerMessage.DeviceAdded.decode(e,e.uint32());break;case 5:r.deviceRemoved=c.Buttplug.ServerMessage.DeviceRemoved.decode(e,e.uint32());break;case 6:r.disconnect=c.Buttplug.ServerMessage.Disconnect.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";let t={};if(null!=e.ok&&e.hasOwnProperty("ok")){t.msg=1;{let t=c.Buttplug.ServerMessage.Ok.verify(e.ok);if(t)return"ok."+t}}if(null!=e.error&&e.hasOwnProperty("error")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ServerMessage.Error.verify(e.error);if(t)return"error."+t}}if(null!=e.scanningFinished&&e.hasOwnProperty("scanningFinished")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ServerMessage.ScanningFinished.verify(e.scanningFinished);if(t)return"scanningFinished."+t}}if(null!=e.deviceAdded&&e.hasOwnProperty("deviceAdded")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ServerMessage.DeviceAdded.verify(e.deviceAdded);if(t)return"deviceAdded."+t}}if(null!=e.deviceRemoved&&e.hasOwnProperty("deviceRemoved")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ServerMessage.DeviceRemoved.verify(e.deviceRemoved);if(t)return"deviceRemoved."+t}}if(null!=e.disconnect&&e.hasOwnProperty("disconnect")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ServerMessage.Disconnect.verify(e.disconnect);if(t)return"disconnect."+t}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.ServerMessage)return e;let t=new c.Buttplug.ServerMessage;if(null!=e.ok){if("object"!=typeof e.ok)throw TypeError(".Buttplug.ServerMessage.ok: object expected");t.ok=c.Buttplug.ServerMessage.Ok.fromObject(e.ok)}if(null!=e.error){if("object"!=typeof e.error)throw TypeError(".Buttplug.ServerMessage.error: object expected");t.error=c.Buttplug.ServerMessage.Error.fromObject(e.error)}if(null!=e.scanningFinished){if("object"!=typeof e.scanningFinished)throw TypeError(".Buttplug.ServerMessage.scanningFinished: object expected");t.scanningFinished=c.Buttplug.ServerMessage.ScanningFinished.fromObject(e.scanningFinished)}if(null!=e.deviceAdded){if("object"!=typeof e.deviceAdded)throw TypeError(".Buttplug.ServerMessage.deviceAdded: object expected");t.deviceAdded=c.Buttplug.ServerMessage.DeviceAdded.fromObject(e.deviceAdded)}if(null!=e.deviceRemoved){if("object"!=typeof e.deviceRemoved)throw TypeError(".Buttplug.ServerMessage.deviceRemoved: object expected");t.deviceRemoved=c.Buttplug.ServerMessage.DeviceRemoved.fromObject(e.deviceRemoved)}if(null!=e.disconnect){if("object"!=typeof e.disconnect)throw TypeError(".Buttplug.ServerMessage.disconnect: object expected");t.disconnect=c.Buttplug.ServerMessage.Disconnect.fromObject(e.disconnect)}return t},e.toObject=function(e,t){t||(t={});let n={};return null!=e.ok&&e.hasOwnProperty("ok")&&(n.ok=c.Buttplug.ServerMessage.Ok.toObject(e.ok,t),t.oneofs&&(n.msg="ok")),null!=e.error&&e.hasOwnProperty("error")&&(n.error=c.Buttplug.ServerMessage.Error.toObject(e.error,t),t.oneofs&&(n.msg="error")),null!=e.scanningFinished&&e.hasOwnProperty("scanningFinished")&&(n.scanningFinished=c.Buttplug.ServerMessage.ScanningFinished.toObject(e.scanningFinished,t),t.oneofs&&(n.msg="scanningFinished")),null!=e.deviceAdded&&e.hasOwnProperty("deviceAdded")&&(n.deviceAdded=c.Buttplug.ServerMessage.DeviceAdded.toObject(e.deviceAdded,t),t.oneofs&&(n.msg="deviceAdded")),null!=e.deviceRemoved&&e.hasOwnProperty("deviceRemoved")&&(n.deviceRemoved=c.Buttplug.ServerMessage.DeviceRemoved.toObject(e.deviceRemoved,t),t.oneofs&&(n.msg="deviceRemoved")),null!=e.disconnect&&e.hasOwnProperty("disconnect")&&(n.disconnect=c.Buttplug.ServerMessage.Disconnect.toObject(e.disconnect,t),t.oneofs&&(n.msg="disconnect")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e.ButtplugErrorType=function(){const e={},t=Object.create(e);return t[e[0]="ButtplugConnectorError"]=0,t[e[1]="ButtplugHandshakeError"]=1,t[e[2]="ButtplugDeviceError"]=2,t[e[3]="ButtplugPingError"]=3,t[e[4]="ButtplugMessageError"]=4,t[e[5]="ButtplugUnknownError"]=5,t}(),e.MessageAttributeType=function(){const e={},t=Object.create(e);return t[e[0]="VibrateCmd"]=0,t[e[1]="RotateCmd"]=1,t[e[2]="LinearCmd"]=2,t[e[3]="StopDeviceCmd"]=3,t[e[4]="RawReadCmd"]=4,t[e[5]="RawWriteCmd"]=5,t[e[6]="RawSubscribeCmd"]=6,t[e[7]="RawUnsubscribeCmd"]=7,t[e[8]="BatteryLevelCmd"]=8,t[e[9]="RSSILevelCmd"]=9,t}(),e.MessageAttributes=function(){function e(e){if(this.stepCount=[],this.endpoints=[],this.maxDuration=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.messageType=0,e.prototype.featureCount=0,e.prototype.stepCount=a.emptyArray,e.prototype.endpoints=a.emptyArray,e.prototype.maxDuration=a.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.messageType&&Object.hasOwnProperty.call(e,"messageType")&&t.uint32(8).int32(e.messageType),null!=e.featureCount&&Object.hasOwnProperty.call(e,"featureCount")&&t.uint32(16).uint32(e.featureCount),null!=e.stepCount&&e.stepCount.length){t.uint32(26).fork();for(let n=0;n<e.stepCount.length;++n)t.uint32(e.stepCount[n]);t.ldelim()}if(null!=e.endpoints&&e.endpoints.length){t.uint32(34).fork();for(let n=0;n<e.endpoints.length;++n)t.int32(e.endpoints[n]);t.ldelim()}if(null!=e.maxDuration&&e.maxDuration.length){t.uint32(42).fork();for(let n=0;n<e.maxDuration.length;++n)t.uint32(e.maxDuration[n]);t.ldelim()}return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage.MessageAttributes;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.messageType=e.int32();break;case 2:r.featureCount=e.uint32();break;case 3:if(r.stepCount&&r.stepCount.length||(r.stepCount=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.stepCount.push(e.uint32())}else r.stepCount.push(e.uint32());break;case 4:if(r.endpoints&&r.endpoints.length||(r.endpoints=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.endpoints.push(e.int32())}else r.endpoints.push(e.int32());break;case 5:if(r.maxDuration&&r.maxDuration.length||(r.maxDuration=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.maxDuration.push(e.uint32())}else r.maxDuration.push(e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.messageType&&e.hasOwnProperty("messageType"))switch(e.messageType){default:return"messageType: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:}if(null!=e.featureCount&&e.hasOwnProperty("featureCount")&&!a.isInteger(e.featureCount))return"featureCount: integer expected";if(null!=e.stepCount&&e.hasOwnProperty("stepCount")){if(!Array.isArray(e.stepCount))return"stepCount: array expected";for(let t=0;t<e.stepCount.length;++t)if(!a.isInteger(e.stepCount[t]))return"stepCount: integer[] expected"}if(null!=e.endpoints&&e.hasOwnProperty("endpoints")){if(!Array.isArray(e.endpoints))return"endpoints: array expected";for(let t=0;t<e.endpoints.length;++t)switch(e.endpoints[t]){default:return"endpoints: enum value[] expected";case 0: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:}}if(null!=e.maxDuration&&e.hasOwnProperty("maxDuration")){if(!Array.isArray(e.maxDuration))return"maxDuration: array expected";for(let t=0;t<e.maxDuration.length;++t)if(!a.isInteger(e.maxDuration[t]))return"maxDuration: integer[] expected"}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.ServerMessage.MessageAttributes)return e;let t=new c.Buttplug.ServerMessage.MessageAttributes;switch(e.messageType){case"VibrateCmd":case 0:t.messageType=0;break;case"RotateCmd":case 1:t.messageType=1;break;case"LinearCmd":case 2:t.messageType=2;break;case"StopDeviceCmd":case 3:t.messageType=3;break;case"RawReadCmd":case 4:t.messageType=4;break;case"RawWriteCmd":case 5:t.messageType=5;break;case"RawSubscribeCmd":case 6:t.messageType=6;break;case"RawUnsubscribeCmd":case 7:t.messageType=7;break;case"BatteryLevelCmd":case 8:t.messageType=8;break;case"RSSILevelCmd":case 9:t.messageType=9}if(null!=e.featureCount&&(t.featureCount=e.featureCount>>>0),e.stepCount){if(!Array.isArray(e.stepCount))throw TypeError(".Buttplug.ServerMessage.MessageAttributes.stepCount: array expected");t.stepCount=[];for(let n=0;n<e.stepCount.length;++n)t.stepCount[n]=e.stepCount[n]>>>0}if(e.endpoints){if(!Array.isArray(e.endpoints))throw TypeError(".Buttplug.ServerMessage.MessageAttributes.endpoints: array expected");t.endpoints=[];for(let n=0;n<e.endpoints.length;++n)switch(e.endpoints[n]){default:case"Command":case 0:t.endpoints[n]=0;break;case"Firmware":case 1:t.endpoints[n]=1;break;case"Rx":case 2:t.endpoints[n]=2;break;case"RxAccel":case 3:t.endpoints[n]=3;break;case"RxBLEBattery":case 4:t.endpoints[n]=4;break;case"RxPressure":case 5:t.endpoints[n]=5;break;case"RxTouch":case 6:t.endpoints[n]=6;break;case"Tx":case 7:t.endpoints[n]=7;break;case"TxMode":case 8:t.endpoints[n]=8;break;case"TxShock":case 9:t.endpoints[n]=9;break;case"TxVibrate":case 10:t.endpoints[n]=10;break;case"TxVendorControl":case 11:t.endpoints[n]=11;break;case"Whitelist":case 12:t.endpoints[n]=12;break;case"Generic0":case 13:t.endpoints[n]=13;break;case"Generic1":case 14:t.endpoints[n]=14;break;case"Generic2":case 15:t.endpoints[n]=15;break;case"Generic3":case 16:t.endpoints[n]=16;break;case"Generic4":case 17:t.endpoints[n]=17;break;case"Generic5":case 18:t.endpoints[n]=18;break;case"Generic6":case 19:t.endpoints[n]=19;break;case"Generic7":case 20:t.endpoints[n]=20;break;case"Generic8":case 21:t.endpoints[n]=21;break;case"Generic9":case 22:t.endpoints[n]=22;break;case"Generic10":case 23:t.endpoints[n]=23;break;case"Generic11":case 24:t.endpoints[n]=24;break;case"Generic12":case 25:t.endpoints[n]=25;break;case"Generic13":case 26:t.endpoints[n]=26;break;case"Generic14":case 27:t.endpoints[n]=27;break;case"Generic15":case 28:t.endpoints[n]=28;break;case"Generic16":case 29:t.endpoints[n]=29;break;case"Generic17":case 30:t.endpoints[n]=30;break;case"Generic18":case 31:t.endpoints[n]=31;break;case"Generic19":case 32:t.endpoints[n]=32;break;case"Generic20":case 33:t.endpoints[n]=33;break;case"Generic21":case 34:t.endpoints[n]=34;break;case"Generic22":case 35:t.endpoints[n]=35;break;case"Generic23":case 36:t.endpoints[n]=36;break;case"Generic24":case 37:t.endpoints[n]=37;break;case"Generic25":case 38:t.endpoints[n]=38;break;case"Generic26":case 39:t.endpoints[n]=39;break;case"Generic27":case 40:t.endpoints[n]=40;break;case"Generic28":case 41:t.endpoints[n]=41;break;case"Generic29":case 42:t.endpoints[n]=42;break;case"Generic30":case 43:t.endpoints[n]=43;break;case"Generic31":case 44:t.endpoints[n]=44;break;case"RxBLEModel":case 45:t.endpoints[n]=45}}if(e.maxDuration){if(!Array.isArray(e.maxDuration))throw TypeError(".Buttplug.ServerMessage.MessageAttributes.maxDuration: array expected");t.maxDuration=[];for(let n=0;n<e.maxDuration.length;++n)t.maxDuration[n]=e.maxDuration[n]>>>0}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.stepCount=[],n.endpoints=[],n.maxDuration=[]),t.defaults&&(n.messageType=t.enums===String?"VibrateCmd":0,n.featureCount=0),null!=e.messageType&&e.hasOwnProperty("messageType")&&(n.messageType=t.enums===String?c.Buttplug.ServerMessage.MessageAttributeType[e.messageType]:e.messageType),null!=e.featureCount&&e.hasOwnProperty("featureCount")&&(n.featureCount=e.featureCount),e.stepCount&&e.stepCount.length){n.stepCount=[];for(let t=0;t<e.stepCount.length;++t)n.stepCount[t]=e.stepCount[t]}if(e.endpoints&&e.endpoints.length){n.endpoints=[];for(let r=0;r<e.endpoints.length;++r)n.endpoints[r]=t.enums===String?c.Buttplug.Endpoint[e.endpoints[r]]:e.endpoints[r]}if(e.maxDuration&&e.maxDuration.length){n.maxDuration=[];for(let t=0;t<e.maxDuration.length;++t)n.maxDuration[t]=e.maxDuration[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.Ok=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage.Ok;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ServerMessage.Ok?e:new c.Buttplug.ServerMessage.Ok},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.Error=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.errorType=0,e.prototype.message="",e.prototype.backtrace="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.errorType&&Object.hasOwnProperty.call(e,"errorType")&&t.uint32(8).int32(e.errorType),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&t.uint32(18).string(e.message),null!=e.backtrace&&Object.hasOwnProperty.call(e,"backtrace")&&t.uint32(26).string(e.backtrace),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage.Error;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.errorType=e.int32();break;case 2:r.message=e.string();break;case 3:r.backtrace=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.errorType&&e.hasOwnProperty("errorType"))switch(e.errorType){default:return"errorType: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:}return null!=e.message&&e.hasOwnProperty("message")&&!a.isString(e.message)?"message: string expected":null!=e.backtrace&&e.hasOwnProperty("backtrace")&&!a.isString(e.backtrace)?"backtrace: string expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.ServerMessage.Error)return e;let t=new c.Buttplug.ServerMessage.Error;switch(e.errorType){case"ButtplugConnectorError":case 0:t.errorType=0;break;case"ButtplugHandshakeError":case 1:t.errorType=1;break;case"ButtplugDeviceError":case 2:t.errorType=2;break;case"ButtplugPingError":case 3:t.errorType=3;break;case"ButtplugMessageError":case 4:t.errorType=4;break;case"ButtplugUnknownError":case 5:t.errorType=5}return null!=e.message&&(t.message=String(e.message)),null!=e.backtrace&&(t.backtrace=String(e.backtrace)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.errorType=t.enums===String?"ButtplugConnectorError":0,n.message="",n.backtrace=""),null!=e.errorType&&e.hasOwnProperty("errorType")&&(n.errorType=t.enums===String?c.Buttplug.ServerMessage.ButtplugErrorType[e.errorType]:e.errorType),null!=e.message&&e.hasOwnProperty("message")&&(n.message=e.message),null!=e.backtrace&&e.hasOwnProperty("backtrace")&&(n.backtrace=e.backtrace),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.ScanningFinished=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage.ScanningFinished;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ServerMessage.ScanningFinished?e:new c.Buttplug.ServerMessage.ScanningFinished},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.DeviceAdded=function(){function e(e){if(this.messageAttributes=[],e)for(let 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.index=0,e.prototype.messageAttributes=a.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(16).uint32(e.index),null!=e.messageAttributes&&e.messageAttributes.length)for(let n=0;n<e.messageAttributes.length;++n)c.Buttplug.ServerMessage.MessageAttributes.encode(e.messageAttributes[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage.DeviceAdded;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.name=e.string();break;case 2:r.index=e.uint32();break;case 3:r.messageAttributes&&r.messageAttributes.length||(r.messageAttributes=[]),r.messageAttributes.push(c.Buttplug.ServerMessage.MessageAttributes.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index))return"index: integer expected";if(null!=e.messageAttributes&&e.hasOwnProperty("messageAttributes")){if(!Array.isArray(e.messageAttributes))return"messageAttributes: array expected";for(let t=0;t<e.messageAttributes.length;++t){let n=c.Buttplug.ServerMessage.MessageAttributes.verify(e.messageAttributes[t]);if(n)return"messageAttributes."+n}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.ServerMessage.DeviceAdded)return e;let t=new c.Buttplug.ServerMessage.DeviceAdded;if(null!=e.name&&(t.name=String(e.name)),null!=e.index&&(t.index=e.index>>>0),e.messageAttributes){if(!Array.isArray(e.messageAttributes))throw TypeError(".Buttplug.ServerMessage.DeviceAdded.messageAttributes: array expected");t.messageAttributes=[];for(let n=0;n<e.messageAttributes.length;++n){if("object"!=typeof e.messageAttributes[n])throw TypeError(".Buttplug.ServerMessage.DeviceAdded.messageAttributes: object expected");t.messageAttributes[n]=c.Buttplug.ServerMessage.MessageAttributes.fromObject(e.messageAttributes[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.messageAttributes=[]),t.defaults&&(n.name="",n.index=0),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),e.messageAttributes&&e.messageAttributes.length){n.messageAttributes=[];for(let r=0;r<e.messageAttributes.length;++r)n.messageAttributes[r]=c.Buttplug.ServerMessage.MessageAttributes.toObject(e.messageAttributes[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.DeviceRemoved=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage.DeviceRemoved;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index)?"index: integer expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.ServerMessage.DeviceRemoved)return e;let t=new c.Buttplug.ServerMessage.DeviceRemoved;return null!=e.index&&(t.index=e.index>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.Disconnect=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage.Disconnect;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ServerMessage.Disconnect?e:new c.Buttplug.ServerMessage.Disconnect},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e}(),e.DeviceEvent=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.disconnect=null,e.prototype.batteryLevelReading=null,e.prototype.rssiLevelReading=null,e.prototype.rawReading=null,Object.defineProperty(e.prototype,"msg",{get:a.oneOfGetter(t=["disconnect","batteryLevelReading","rssiLevelReading","rawReading"]),set:a.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.disconnect&&Object.hasOwnProperty.call(e,"disconnect")&&c.Buttplug.DeviceEvent.Disconnect.encode(e.disconnect,t.uint32(10).fork()).ldelim(),null!=e.batteryLevelReading&&Object.hasOwnProperty.call(e,"batteryLevelReading")&&c.Buttplug.DeviceEvent.BatteryLevelReading.encode(e.batteryLevelReading,t.uint32(18).fork()).ldelim(),null!=e.rssiLevelReading&&Object.hasOwnProperty.call(e,"rssiLevelReading")&&c.Buttplug.DeviceEvent.RSSILevelReading.encode(e.rssiLevelReading,t.uint32(26).fork()).ldelim(),null!=e.rawReading&&Object.hasOwnProperty.call(e,"rawReading")&&c.Buttplug.DeviceEvent.RawReading.encode(e.rawReading,t.uint32(34).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceEvent;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.disconnect=c.Buttplug.DeviceEvent.Disconnect.decode(e,e.uint32());break;case 2:r.batteryLevelReading=c.Buttplug.DeviceEvent.BatteryLevelReading.decode(e,e.uint32());break;case 3:r.rssiLevelReading=c.Buttplug.DeviceEvent.RSSILevelReading.decode(e,e.uint32());break;case 4:r.rawReading=c.Buttplug.DeviceEvent.RawReading.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";let t={};if(null!=e.disconnect&&e.hasOwnProperty("disconnect")){t.msg=1;{let t=c.Buttplug.DeviceEvent.Disconnect.verify(e.disconnect);if(t)return"disconnect."+t}}if(null!=e.batteryLevelReading&&e.hasOwnProperty("batteryLevelReading")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceEvent.BatteryLevelReading.verify(e.batteryLevelReading);if(t)return"batteryLevelReading."+t}}if(null!=e.rssiLevelReading&&e.hasOwnProperty("rssiLevelReading")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceEvent.RSSILevelReading.verify(e.rssiLevelReading);if(t)return"rssiLevelReading."+t}}if(null!=e.rawReading&&e.hasOwnProperty("rawReading")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceEvent.RawReading.verify(e.rawReading);if(t)return"rawReading."+t}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceEvent)return e;let t=new c.Buttplug.DeviceEvent;if(null!=e.disconnect){if("object"!=typeof e.disconnect)throw TypeError(".Buttplug.DeviceEvent.disconnect: object expected");t.disconnect=c.Buttplug.DeviceEvent.Disconnect.fromObject(e.disconnect)}if(null!=e.batteryLevelReading){if("object"!=typeof e.batteryLevelReading)throw TypeError(".Buttplug.DeviceEvent.batteryLevelReading: object expected");t.batteryLevelReading=c.Buttplug.DeviceEvent.BatteryLevelReading.fromObject(e.batteryLevelReading)}if(null!=e.rssiLevelReading){if("object"!=typeof e.rssiLevelReading)throw TypeError(".Buttplug.DeviceEvent.rssiLevelReading: object expected");t.rssiLevelReading=c.Buttplug.DeviceEvent.RSSILevelReading.fromObject(e.rssiLevelReading)}if(null!=e.rawReading){if("object"!=typeof e.rawReading)throw TypeError(".Buttplug.DeviceEvent.rawReading: object expected");t.rawReading=c.Buttplug.DeviceEvent.RawReading.fromObject(e.rawReading)}return t},e.toObject=function(e,t){t||(t={});let n={};return null!=e.disconnect&&e.hasOwnProperty("disconnect")&&(n.disconnect=c.Buttplug.DeviceEvent.Disconnect.toObject(e.disconnect,t),t.oneofs&&(n.msg="disconnect")),null!=e.batteryLevelReading&&e.hasOwnProperty("batteryLevelReading")&&(n.batteryLevelReading=c.Buttplug.DeviceEvent.BatteryLevelReading.toObject(e.batteryLevelReading,t),t.oneofs&&(n.msg="batteryLevelReading")),null!=e.rssiLevelReading&&e.hasOwnProperty("rssiLevelReading")&&(n.rssiLevelReading=c.Buttplug.DeviceEvent.RSSILevelReading.toObject(e.rssiLevelReading,t),t.oneofs&&(n.msg="rssiLevelReading")),null!=e.rawReading&&e.hasOwnProperty("rawReading")&&(n.rawReading=c.Buttplug.DeviceEvent.RawReading.toObject(e.rawReading,t),t.oneofs&&(n.msg="rawReading")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e.Disconnect=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceEvent.Disconnect;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index)?"index: integer expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceEvent.Disconnect)return e;let t=new c.Buttplug.DeviceEvent.Disconnect;return null!=e.index&&(t.index=e.index>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RawReading=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.prototype.endpoint=0,e.prototype.data=a.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),null!=e.endpoint&&Object.hasOwnProperty.call(e,"endpoint")&&t.uint32(16).int32(e.endpoint),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).bytes(e.data),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceEvent.RawReading;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;case 2:r.endpoint=e.int32();break;case 3:r.data=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index))return"index: integer expected";if(null!=e.endpoint&&e.hasOwnProperty("endpoint"))switch(e.endpoint){default:return"endpoint: enum value expected";case 0: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:}return null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||a.isString(e.data))?"data: buffer expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceEvent.RawReading)return e;let t=new c.Buttplug.DeviceEvent.RawReading;switch(null!=e.index&&(t.index=e.index>>>0),e.endpoint){case"Command":case 0:t.endpoint=0;break;case"Firmware":case 1:t.endpoint=1;break;case"Rx":case 2:t.endpoint=2;break;case"RxAccel":case 3:t.endpoint=3;break;case"RxBLEBattery":case 4:t.endpoint=4;break;case"RxPressure":case 5:t.endpoint=5;break;case"RxTouch":case 6:t.endpoint=6;break;case"Tx":case 7:t.endpoint=7;break;case"TxMode":case 8:t.endpoint=8;break;case"TxShock":case 9:t.endpoint=9;break;case"TxVibrate":case 10:t.endpoint=10;break;case"TxVendorControl":case 11:t.endpoint=11;break;case"Whitelist":case 12:t.endpoint=12;break;case"Generic0":case 13:t.endpoint=13;break;case"Generic1":case 14:t.endpoint=14;break;case"Generic2":case 15:t.endpoint=15;break;case"Generic3":case 16:t.endpoint=16;break;case"Generic4":case 17:t.endpoint=17;break;case"Generic5":case 18:t.endpoint=18;break;case"Generic6":case 19:t.endpoint=19;break;case"Generic7":case 20:t.endpoint=20;break;case"Generic8":case 21:t.endpoint=21;break;case"Generic9":case 22:t.endpoint=22;break;case"Generic10":case 23:t.endpoint=23;break;case"Generic11":case 24:t.endpoint=24;break;case"Generic12":case 25:t.endpoint=25;break;case"Generic13":case 26:t.endpoint=26;break;case"Generic14":case 27:t.endpoint=27;break;case"Generic15":case 28:t.endpoint=28;break;case"Generic16":case 29:t.endpoint=29;break;case"Generic17":case 30:t.endpoint=30;break;case"Generic18":case 31:t.endpoint=31;break;case"Generic19":case 32:t.endpoint=32;break;case"Generic20":case 33:t.endpoint=33;break;case"Generic21":case 34:t.endpoint=34;break;case"Generic22":case 35:t.endpoint=35;break;case"Generic23":case 36:t.endpoint=36;break;case"Generic24":case 37:t.endpoint=37;break;case"Generic25":case 38:t.endpoint=38;break;case"Generic26":case 39:t.endpoint=39;break;case"Generic27":case 40:t.endpoint=40;break;case"Generic28":case 41:t.endpoint=41;break;case"Generic29":case 42:t.endpoint=42;break;case"Generic30":case 43:t.endpoint=43;break;case"Generic31":case 44:t.endpoint=44;break;case"RxBLEModel":case 45:t.endpoint=45}return null!=e.data&&("string"==typeof e.data?a.base64.decode(e.data,t.data=a.newBuffer(a.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0,n.endpoint=t.enums===String?"Command":0,t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=a.newBuffer(n.data)))),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),null!=e.endpoint&&e.hasOwnProperty("endpoint")&&(n.endpoint=t.enums===String?c.Buttplug.Endpoint[e.endpoint]:e.endpoint),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?a.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.BatteryLevelReading=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.prototype.reading=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),null!=e.reading&&Object.hasOwnProperty.call(e,"reading")&&t.uint32(17).double(e.reading),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceEvent.BatteryLevelReading;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;case 2:r.reading=e.double();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index)?"index: integer expected":null!=e.reading&&e.hasOwnProperty("reading")&&"number"!=typeof e.reading?"reading: number expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceEvent.BatteryLevelReading)return e;let t=new c.Buttplug.DeviceEvent.BatteryLevelReading;return null!=e.index&&(t.index=e.index>>>0),null!=e.reading&&(t.reading=Number(e.reading)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0,n.reading=0),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),null!=e.reading&&e.hasOwnProperty("reading")&&(n.reading=t.json&&!isFinite(e.reading)?String(e.reading):e.reading),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RSSILevelReading=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.prototype.reading=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),null!=e.reading&&Object.hasOwnProperty.call(e,"reading")&&t.uint32(16).int32(e.reading),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceEvent.RSSILevelReading;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;case 2:r.reading=e.int32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index)?"index: integer expected":null!=e.reading&&e.hasOwnProperty("reading")&&!a.isInteger(e.reading)?"reading: integer expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceEvent.RSSILevelReading)return e;let t=new c.Buttplug.DeviceEvent.RSSILevelReading;return null!=e.index&&(t.index=e.index>>>0),null!=e.reading&&(t.reading=0|e.reading),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0,n.reading=0),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),null!=e.reading&&e.hasOwnProperty("reading")&&(n.reading=e.reading),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e}(),e.ButtplugFFIServerMessage=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id=0,e.prototype.message=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(8).uint32(e.id),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&c.Buttplug.ButtplugFFIServerMessage.FFIMessage.encode(e.message,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ButtplugFFIServerMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.uint32();break;case 2:r.message=c.Buttplug.ButtplugFFIServerMessage.FFIMessage.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!a.isInteger(e.id))return"id: integer expected";if(null!=e.message&&e.hasOwnProperty("message")){let t=c.Buttplug.ButtplugFFIServerMessage.FFIMessage.verify(e.message);if(t)return"message."+t}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.ButtplugFFIServerMessage)return e;let t=new c.Buttplug.ButtplugFFIServerMessage;if(null!=e.id&&(t.id=e.id>>>0),null!=e.message){if("object"!=typeof e.message)throw TypeError(".Buttplug.ButtplugFFIServerMessage.message: object expected");t.message=c.Buttplug.ButtplugFFIServerMessage.FFIMessage.fromObject(e.message)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id=0,n.message=null),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.message&&e.hasOwnProperty("message")&&(n.message=c.Buttplug.ButtplugFFIServerMessage.FFIMessage.toObject(e.message,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e.FFIMessage=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.serverMessage=null,e.prototype.deviceEvent=null,Object.defineProperty(e.prototype,"msg",{get:a.oneOfGetter(t=["serverMessage","deviceEvent"]),set:a.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.serverMessage&&Object.hasOwnProperty.call(e,"serverMessage")&&c.Buttplug.ServerMessage.encode(e.serverMessage,t.uint32(10).fork()).ldelim(),null!=e.deviceEvent&&Object.hasOwnProperty.call(e,"deviceEvent")&&c.Buttplug.DeviceEvent.encode(e.deviceEvent,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ButtplugFFIServerMessage.FFIMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.serverMessage=c.Buttplug.ServerMessage.decode(e,e.uint32());break;case 2:r.deviceEvent=c.Buttplug.DeviceEvent.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";let t={};if(null!=e.serverMessage&&e.hasOwnProperty("serverMessage")){t.msg=1;{let t=c.Buttplug.ServerMessage.verify(e.serverMessage);if(t)return"serverMessage."+t}}if(null!=e.deviceEvent&&e.hasOwnProperty("deviceEvent")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceEvent.verify(e.deviceEvent);if(t)return"deviceEvent."+t}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.ButtplugFFIServerMessage.FFIMessage)return e;let t=new c.Buttplug.ButtplugFFIServerMessage.FFIMessage;if(null!=e.serverMessage){if("object"!=typeof e.serverMessage)throw TypeError(".Buttplug.ButtplugFFIServerMessage.FFIMessage.serverMessage: object expected");t.serverMessage=c.Buttplug.ServerMessage.fromObject(e.serverMessage)}if(null!=e.deviceEvent){if("object"!=typeof e.deviceEvent)throw TypeError(".Buttplug.ButtplugFFIServerMessage.FFIMessage.deviceEvent: object expected");t.deviceEvent=c.Buttplug.DeviceEvent.fromObject(e.deviceEvent)}return t},e.toObject=function(e,t){t||(t={});let n={};return null!=e.serverMessage&&e.hasOwnProperty("serverMessage")&&(n.serverMessage=c.Buttplug.ServerMessage.toObject(e.serverMessage,t),t.oneofs&&(n.msg="serverMessage")),null!=e.deviceEvent&&e.hasOwnProperty("deviceEvent")&&(n.deviceEvent=c.Buttplug.DeviceEvent.toObject(e.deviceEvent,t),t.oneofs&&(n.msg="deviceEvent")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e}(),e})()},function(e,t,n){"use strict";e.exports=n(8)},function(e,t,n){"use strict";(function(e){n.d(t,"c",(function(){return g})),n.d(t,"d",(function(){return b})),n.d(t,"e",(function(){return m})),n.d(t,"h",(function(){return v})),n.d(t,"r",(function(){return y})),n.d(t,"u",(function(){return w})),n.d(t,"s",(function(){return O})),n.d(t,"v",(function(){return k})),n.d(t,"p",(function(){return x})),n.d(t,"k",(function(){return _})),n.d(t,"t",(function(){return M})),n.d(t,"b",(function(){return B})),n.d(t,"q",(function(){return j})),n.d(t,"l",(function(){return S})),n.d(t,"o",(function(){return D})),n.d(t,"m",(function(){return R})),n.d(t,"n",(function(){return P})),n.d(t,"f",(function(){return A})),n.d(t,"g",(function(){return E})),n.d(t,"i",(function(){return L})),n.d(t,"j",(function(){return T})),n.d(t,"a",(function(){return G}));var r=n(0);function i(e){throw new Error("Must run buttplugInit() async before calling any Buttplug methods!")}function s(e,t,n,r){throw new Error("Must run buttplugInit() async before calling any Buttplug methods!")}let o=function(e,t,n){throw new Error("Must run buttplugInit() async before calling any Buttplug methods!")},a=i,c=s,u=i,l=i,d=function(e,t){throw new Error("Must run buttplugInit() async before calling any Buttplug methods!")},p=s,f=!1;async function g(){if(f)return void console.log("buttplugInit function has already run successfully. This only needs to be run once, but doesn't affect anything (other than printing this message) if called again.");let e=await n.e(1).then(n.bind(null,27)).catch(e=>(console.log(e),Promise.reject(e)));o=e.buttplug_create_protobuf_client,a=e.buttplug_free_client,c=e.buttplug_client_protobuf_message,u=e.buttplug_activate_env_logger,l=e.buttplug_free_device,d=e.buttplug_create_device,p=e.buttplug_device_protobuf_message,f=!0}function h(t,n,i,s){let o=t.PrepareOutgoingMessage(i),a=e.from(r.a.ClientMessage.encode(i).finish());return c(n,a,s,0),o}function b(e,t,n,i){return h(e,t,r.a.ClientMessage.create({message:r.a.ClientMessage.FFIMessage.create({connectLocal:r.a.ClientMessage.ConnectLocal.create({serverName:n.ServerName,allowRawMessages:n.AllowRawMessages,deviceConfigurationJson:n.DeviceConfigJSON,userDeviceConfigurationJson:n.UserDeviceConfigJSON,commManagerTypes:n.DeviceCommunicationManagerTypes,maxPingTime:n.MaxPingTime})}),id:1}),i)}function m(e,t,n,i){return h(e,t,r.a.ClientMessage.create({message:r.a.ClientMessage.FFIMessage.create({connectWebsocket:r.a.ClientMessage.ConnectWebsocket.create({address:n.Address})}),id:1}),i)}function v(e,t,n){return h(e,t,r.a.ClientMessage.create({message:r.a.ClientMessage.FFIMessage.create({disconnect:r.a.ClientMessage.Disconnect.create({})})}),n)}function y(e,t,n){return h(e,t,r.a.ClientMessage.create({message:r.a.ClientMessage.FFIMessage.create({startScanning:r.a.ClientMessage.StartScanning.create({})}),id:1}),n)}function w(e,t,n){return h(e,t,r.a.ClientMessage.create({message:r.a.ClientMessage.FFIMessage.create({stopScanning:r.a.ClientMessage.StopScanning.create({})}),id:1}),n)}function O(e,t,n){return h(e,t,r.a.ClientMessage.create({message:r.a.ClientMessage.FFIMessage.create({stopAllDevices:r.a.ClientMessage.StopAllDevices.create({})}),id:1}),n)}function C(t,n,i,s){let o=t.PrepareOutgoingMessage(i),a=e.from(r.a.DeviceMessage.encode(i).finish());return p(n,a,s,0),o}function k(e,t,n,i){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({vibrateCmd:r.a.DeviceMessage.VibrateCmd.create({speeds:n})}),id:1}),i)}function x(e,t,n,i){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({rotateCmd:r.a.DeviceMessage.RotateCmd.create({rotations:n})}),id:1}),i)}function _(e,t,n,i){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({linearCmd:r.a.DeviceMessage.LinearCmd.create({movements:n})}),id:1}),i)}function M(e,t,n){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({stopDeviceCmd:r.a.DeviceMessage.StopDeviceCmd.create({})}),id:1}),n)}function B(e,t,n){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({batteryLevelCmd:r.a.DeviceMessage.BatteryLevelCmd.create({})}),id:1}),n)}function j(e,t,n){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({rssiLevelCmd:r.a.DeviceMessage.RSSILevelCmd.create({})}),id:1}),n)}function S(e,t,n,i,s,o){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({rawReadCmd:r.a.DeviceMessage.RawReadCmd.create({endpoint:n,expectedLength:i,timeout:s})}),id:1}),o)}function D(e,t,n,i,s,o){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({rawWriteCmd:r.a.DeviceMessage.RawWriteCmd.create({endpoint:n,data:i,writeWithResponse:s})}),id:1}),o)}function R(e,t,n,i){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({rawSubscribeCmd:r.a.DeviceMessage.RawSubscribeCmd.create({endpoint:n})}),id:1}),i)}function P(e,t,n,i){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({rawUnsubscribeCmd:r.a.DeviceMessage.RawUnsubscribeCmd.create({endpoint:n})}),id:1}),i)}function A(e,t){return o(t,e,0)}function E(e,t){return d(e,t)}function L(e){a(e)}function T(e){l(e)}function G(e){u(e)}}).call(this,n(22).Buffer)},function(e,t,n){"use strict";(function(e){var r=t;function i(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)void 0!==e[r[i]]&&n||(e[r[i]]=t[r[i]]);return e}function s(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&i(this,n)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}r.asPromise=n(9),r.base64=n(10),r.EventEmitter=n(11),r.float=n(12),r.inquire=n(13),r.utf8=n(14),r.pool=n(15),r.LongBits=n(16),r.isNode=Boolean(void 0!==e&&e&&e.process&&e.process.versions&&e.process.versions.node),r.global=r.isNode&&e||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.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)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=i,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=s,r.ProtocolError=s("ProtocolError"),r.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]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}}).call(this,n(5))},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,s=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}m(e,t,s,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,n)}(e,i,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,s,o,a;if(u(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=l(e))>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,a=c,console&&console.warn&&console.warn(a)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=p.bind(r);return i.listener=n,r.wrapFn=i,i}function g(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):b(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function b(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function m(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(s){r.once&&e.removeEventListener(t,i),n(s)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)s(c,this,t);else{var u=c.length,l=b(c,u);for(n=0;n<u;++n)s(l[n],this,t)}return!0},a.prototype.addListener=function(e,t){return d(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return d(this,e,t,!0)},a.prototype.once=function(e,t){return u(t),this.on(e,f(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,f(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,i,s,o;if(u(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return g(this,e,!0)},a.prototype.rawListeners=function(e){return g(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},a.prototype.listenerCount=h,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";e.exports=d;var r,i=n(3),s=i.LongBits,o=i.base64,a=i.utf8;function c(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function u(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};function f(e,t,n){t[n]=255&e}function g(e,t){this.len=e,this.next=void 0,this.val=t}function h(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 b(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}d.create=p(),d.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(e,t,n){return this.tail=this.tail.next=new c(e,t,n),this.len+=t,this},g.prototype=Object.create(c.prototype),g.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new g((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(h,10,s.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=s.from(e);return this._push(h,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(h,t.length(),t)},d.prototype.bool=function(e){return this._push(f,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(b,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=s.from(e);return this._push(b,4,t.lo)._push(b,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var m=i.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]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(i.isString(e)){var n=d.alloc(t=o.length(e));o.decode(e,n,0),e=n}return this.uint32(t)._push(m,t,e)},d.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(f,1,0)},d.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.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(u,0,0),this.len=0),this},d.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},d.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},d._configure=function(e){r=e,d.create=p(),r._configure()}},function(e,t,n){"use strict";e.exports=c;var r,i=n(3),s=i.LongBits,o=i.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 u,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")},d=function(){return i.Buffer?function(e){return(c.create=function(e){return i.Buffer.isBuffer(e)?new r(e):l(e)})(e)}:l};function p(){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 f(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function g(){if(this.pos+8>this.len)throw a(this,8);return new s(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}c.create=d(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),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 f(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|f(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=i.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=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},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){r=e,c.create=d(),r._configure();var t=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return g.call(this)[t](!0)},sfixed64:function(){return g.call(this)[t](!1)}})}},function(e,t,n){"use strict";var r=t;function i(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(6),r.BufferWriter=n(17),r.Reader=n(7),r.BufferReader=n(18),r.util=n(3),r.rpc=n(19),r.roots=n(21),r.configure=i,i()},function(e,t,n){"use strict";e.exports=function(e,t){var n=new Array(arguments.length-1),r=0,i=2,s=!0;for(;i<arguments.length;)n[r++]=arguments[i++];return new Promise((function(i,o){n[r]=function(e){if(s)if(s=!1,e)o(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){s&&(s=!1,o(e))}}))}},function(e,t,n){"use strict";var r=t;r.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 i=new Array(64),s=new Array(123),o=0;o<64;)s[i[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;r.encode=function(e,t,n){for(var r,s=null,o=[],a=0,c=0;t<n;){var u=e[t++];switch(c){case 0:o[a++]=i[u>>2],r=(3&u)<<4,c=1;break;case 1:o[a++]=i[r|u>>4],r=(15&u)<<2,c=2;break;case 2:o[a++]=i[r|u>>6],o[a++]=i[63&u],c=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0)}return c&&(o[a++]=i[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))};r.decode=function(e,t,n){for(var r,i=n,o=0,a=0;a<e.length;){var c=e.charCodeAt(a++);if(61===c&&o>1)break;if(void 0===(c=s[c]))throw Error("invalid encoding");switch(o){case 0:r=c,o=1;break;case 1:t[n++]=r<<2|(48&c)>>4,r=c,o=2;break;case 2:t[n++]=(15&r)<<4|(60&c)>>2,r=c,o=3;break;case 3:t[n++]=(3&r)<<6|c,o=0}}if(1===o)throw Error("invalid encoding");return n-i},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},function(e,t,n){"use strict";function r(){this._listeners={}}e.exports=r,r.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},r.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},r.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}},function(e,t,n){"use strict";function r(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function s(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}function o(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 a(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?i:s,e.writeFloatBE=r?s:i,e.readFloatLE=r?o:a,e.readFloatBE=r?a:o}():function(){function t(e,t,n,r){var i=t<0?1:0;if(i&&(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((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(t)/Math.LN2);e((i<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,n,r)}}function n(e,t,n){var r=e(t,n),i=2*(r>>31)+1,s=r>>>23&255,o=8388607&r;return 255===s?o?NaN:i*(1/0):0===s?1401298464324817e-60*i*o:i*Math.pow(2,s-150)*(o+8388608)}e.writeFloatLE=t.bind(null,i),e.writeFloatBE=t.bind(null,s),e.readFloatLE=n.bind(null,o),e.readFloatBE=n.bind(null,a)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function s(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}function o(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 a(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?i:s,e.writeDoubleBE=r?s:i,e.readDoubleLE=r?o:a,e.readDoubleBE=r?a:o}():function(){function t(e,t,n,r,i,s){var o=r<0?1:0;if(o&&(r=-r),0===r)e(0,i,s+t),e(1/r>0?0:2147483648,i,s+n);else if(isNaN(r))e(0,i,s+t),e(2146959360,i,s+n);else if(r>17976931348623157e292)e(0,i,s+t),e((o<<31|2146435072)>>>0,i,s+n);else{var a;if(r<22250738585072014e-324)e((a=r/5e-324)>>>0,i,s+t),e((o<<31|a/4294967296)>>>0,i,s+n);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=r*Math.pow(2,-c))>>>0,i,s+t),e((o<<31|c+1023<<20|1048576*a&1048575)>>>0,i,s+n)}}}function n(e,t,n,r,i){var s=e(r,i+t),o=e(r,i+n),a=2*(o>>31)+1,c=o>>>20&2047,u=4294967296*(1048575&o)+s;return 2047===c?u?NaN:a*(1/0):0===c?5e-324*a*u:a*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,i,0,4),e.writeDoubleBE=t.bind(null,s,4,0),e.readDoubleLE=n.bind(null,o,0,4),e.readDoubleBE=n.bind(null,a,4,0)}(),e}function i(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 s(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 o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function a(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=r(r)},function(module,exports,__webpack_require__){"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},function(e,t,n){"use strict";var r=t;r.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},r.read=function(e,t,n){if(n-t<1)return"";for(var r,i=null,s=[],o=0;t<n;)(r=e[t++])<128?s[o++]=r:r>191&&r<224?s[o++]=(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,s[o++]=55296+(r>>10),s[o++]=56320+(1023&r)):s[o++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i?(o&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))},r.write=function(e,t,n){for(var r,i,s=n,o=0;o<e.length;++o)(r=e.charCodeAt(o))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=e.charCodeAt(o+1)))?(r=65536+((1023&r)<<10)+(1023&i),++o,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-s}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r=n||8192,i=r>>>1,s=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(s=e(r),o=0);var a=t.call(s,o,o+=n);return 7&o&&(o=1+(7|o)),a}}},function(e,t,n){"use strict";e.exports=i;var r=n(3);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=i.zero=new i(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var o=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new i(n,r)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(r.isString(e)){if(!r.Long)return i.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):s},i.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},i.prototype.toLong=function(e){return r.Long?new r.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;i.fromHash=function(e){return e===o?s:new i((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)},i.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)},i.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},i.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},i.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}},function(e,t,n){"use strict";e.exports=s;var r=n(6);(s.prototype=Object.create(r.prototype)).constructor=s;var i=n(3);function s(){r.call(this)}function o(e,t,n){e.length<40?i.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}s._configure=function(){s.alloc=i._Buffer_allocUnsafe,s.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.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++]}},s.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},s._configure()},function(e,t,n){"use strict";e.exports=s;var r=n(7);(s.prototype=Object.create(r.prototype)).constructor=s;var i=n(3);function s(e){r.call(this,e)}s._configure=function(){i.Buffer&&(s.prototype._slice=i.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()},function(e,t,n){"use strict";t.Service=n(20)},function(e,t,n){"use strict";e.exports=i;var r=n(3);function i(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(i.prototype=Object.create(r.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,n,i,s,o){if(!s)throw TypeError("request must be specified");var a=this;if(!o)return r.asPromise(e,a,t,n,i,s);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(e,n){if(e)return a.emit("error",e,t),o(e);if(null!==n){if(!(n instanceof i))try{n=i[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),o(e)}return a.emit("data",n,t),o(null,n)}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)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},function(e,t,n){"use strict";e.exports={}},function(e,t,n){"use strict";(function(e){
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["buttplug-commonjs"]=t():e.Buttplug=t()}(window,(function(){return function(e){function t(t){for(var n,s,o=t[0],c=t[1],u=t[3]||[],l=0,p=[];l<o.length;l++)s=o[l],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&p.push(r[s][0]),r[s]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(d&&d(t),u.forEach((function(e){if(void 0===r[e]){r[e]=null;var t=document.createElement("link");a.nc&&t.setAttribute("nonce",a.nc),t.rel="prefetch",t.as="script",t.href=i(e),document.head.appendChild(t)}}));p.length;)p.shift()()}var n={},r={0:0};function i(e){return a.p+""+e+".buttplug.min.js"}var s={};var o={30:function(){return{"./buttplug_rs_ffi_bg.js":{__wbindgen_object_drop_ref:function(e){return n[28].exports.Fb(e)},__wbindgen_cb_drop:function(e){return n[28].exports.sb(e)},__wbg_log_aedd6896ca471fe6:function(e,t){return n[28].exports.A(e,t)},__wbindgen_string_new:function(e,t){return n[28].exports.Hb(e,t)},__wbindgen_object_clone_ref:function(e){return n[28].exports.Eb(e)},__wbindgen_is_string:function(e){return n[28].exports.Bb(e)},__wbg_log_02e20a3c32305fb7:function(e,t){return n[28].exports.y(e,t)},__wbg_log_5c7513aa8c164502:function(e,t,r,i,s,o,a,c){return n[28].exports.z(e,t,r,i,s,o,a,c)},__wbg_mark_abc7631bdced64f0:function(e,t){return n[28].exports.B(e,t)},__wbg_measure_c528ff64085b7146:function(e,t,r,i){return n[28].exports.C(e,t,r,i)},__wbg_new_693216e109162396:function(){return n[28].exports.I()},__wbg_stack_0ddaca5d1abfb52f:function(e,t){return n[28].exports.ib(e,t)},__wbg_error_09919627ac0992f5:function(e,t){return n[28].exports.o(e,t)},__wbg_Window_f826a1dec163bacb:function(e){return n[28].exports.a(e)},__wbindgen_is_undefined:function(e){return n[28].exports.Cb(e)},__wbg_WorkerGlobalScope_967d186155183d38:function(e){return n[28].exports.b(e)},__wbg_instanceof_Window_c4b70662a0d2c5ec:function(e){return n[28].exports.w(e)},__wbg_navigator_480e592af6ad365b:function(e){return n[28].exports.G(e)},__wbg_clearTimeout_2c1ba0016d8bca41:function(e,t){return n[28].exports.i(e,t)},__wbg_setTimeout_df66d951b1726b78:function(e,t,r){return n[28].exports.ab(e,t,r)},__wbg_data_9e55e7d79ab13ef1:function(e){return n[28].exports.n(e)},__wbg_value_84cefeb2408dfe15:function(e){return n[28].exports.ob(e)},__wbg_setoncharacteristicvaluechanged_75ec7773e310719c:function(e,t){return n[28].exports.db(e,t)},__wbg_readValue_eeee467eee29d9ab:function(e){return n[28].exports.U(e)},__wbg_startNotifications_89d52c5da12f4a73:function(e){return n[28].exports.jb(e)},__wbg_writeValue_5045e53d65cf4416:function(e,t,r){return n[28].exports.rb(e,t,r)},__wbg_target_cc69dde6c2d9ec90:function(e){return n[28].exports.lb(e)},__wbindgen_string_get:function(e,t){return n[28].exports.Gb(e,t)},__wbg_requestDevice_94797563349e93d8:function(e,t){return n[28].exports.V(e,t)},__wbg_id_a762586fc34a710d:function(e,t){return n[28].exports.v(e,t)},__wbg_name_48ead2aa58c91524:function(e,t){return n[28].exports.F(e,t)},__wbg_gatt_bca8d85b97b18ec3:function(e){return n[28].exports.p(e)},__wbg_setongattserverdisconnected_5e832e08b6b5f423:function(e,t){return n[28].exports.fb(e,t)},__wbg_clearTimeout_c1f246d6874c0679:function(e,t){return n[28].exports.j(e,t)},__wbg_setTimeout_5314850184d61a44:function(e,t,r){return n[28].exports.Z(e,t,r)},__wbg_bluetooth_cc8e053613d8eeca:function(e){return n[28].exports.c(e)},__wbg_setonopen_33b75427f7db7ce1:function(e,t){return n[28].exports.hb(e,t)},__wbg_setonerror_cb55f0521ac0da3a:function(e,t){return n[28].exports.eb(e,t)},__wbg_setonmessage_ca5f75e4a84134ef:function(e,t){return n[28].exports.gb(e,t)},__wbg_new_982fe22cd93d67f7:function(e,t){return n[28].exports.K(e,t)},__wbg_close_f2a10c1de90df5f0:function(e){return n[28].exports.k(e)},__wbg_send_503c2e7652e95bf5:function(e,t,r){return n[28].exports.Y(e,t,r)},__wbg_connect_e3ccb7d88e903a95:function(e){return n[28].exports.l(e)},__wbg_getPrimaryService_e624e0982bcd83b1:function(e,t,r){return n[28].exports.r(e,t,r)},__wbg_getCharacteristic_7d2869d1ad7151d2:function(e,t,r){return n[28].exports.q(e,t,r)},__wbg_getRandomValues_98117e9a7e993920:function(e,t){return n[28].exports.s(e,t)},__wbg_randomFillSync_64cc7d048f228ca8:function(e,t,r){return n[28].exports.T(e,t,r)},__wbg_process_2f24d6544ea7b200:function(e){return n[28].exports.R(e)},__wbindgen_is_object:function(e){return n[28].exports.Ab(e)},__wbg_versions_6164651e75405d4a:function(e){return n[28].exports.pb(e)},__wbg_node_4b517d861cbcb3bc:function(e){return n[28].exports.Q(e)},__wbg_modulerequire_3440a4bcf44437db:function(e,t){return n[28].exports.D(e,t)},__wbg_crypto_98fc271021c7d2ad:function(e){return n[28].exports.m(e)},__wbg_msCrypto_a2cdb043d2bfe57f:function(e){return n[28].exports.E(e)},__wbg_new_949bbc1147195c4e:function(){return n[28].exports.J()},__wbg_newnoargs_be86524d73f67598:function(e,t){return n[28].exports.M(e,t)},__wbg_call_888d259a5fefc347:function(e,t){return n[28].exports.h(e,t)},__wbg_new_0b83d3df67ecb33e:function(){return n[28].exports.H()},__wbg_push_284486ca27c6aa8b:function(e,t){return n[28].exports.S(e,t)},__wbg_buffer_45280fecb82c83df:function(e){return n[28].exports.e(e)},__wbg_byteLength_c9e4f1b2bae8fc4d:function(e){return n[28].exports.f(e)},__wbg_call_346669c262382ad7:function(e,t,r){return n[28].exports.g(e,t,r)},__wbg_resolve_d23068002f584f22:function(e){return n[28].exports.W(e)},__wbg_then_2fcac196782070cc:function(e,t){return n[28].exports.mb(e,t)},__wbg_then_8c2d62e8ae5978f7:function(e,t,r){return n[28].exports.nb(e,t,r)},__wbg_self_c6fbdfc2918d5e58:function(){return n[28].exports.X()},__wbg_window_baec038b5ab35c54:function(){return n[28].exports.qb()},__wbg_globalThis_3f735a5746d41fbd:function(){return n[28].exports.t()},__wbg_global_1bc0b39582740e95:function(){return n[28].exports.u()},__wbg_buffer_397eaa4d72ee94dd:function(e){return n[28].exports.d(e)},__wbg_newwithbyteoffsetandlength_4b9b8c4e3f5adbff:function(e,t,r){return n[28].exports.O(e,t,r)},__wbg_new_a7ce447f15ff496f:function(e){return n[28].exports.L(e)},__wbg_set_969ad0a60e51d320:function(e,t,r){return n[28].exports.cb(e,t,r)},__wbg_length_1eb8fc608a0d4cdb:function(e){return n[28].exports.x(e)},__wbg_newwithlength_929232475839a482:function(e){return n[28].exports.P(e)},__wbg_newwithbyteoffset_b638bad8cc090f32:function(e,t){return n[28].exports.N(e,t)},__wbg_subarray_8b658422a224f479:function(e,t,r){return n[28].exports.kb(e,t,r)},__wbg_set_82a4e8a85e31ac42:function(e,t,r){return n[28].exports.bb(e,t,r)},__wbindgen_debug_string:function(e,t){return n[28].exports.zb(e,t)},__wbindgen_throw:function(e,t){return n[28].exports.Ib(e,t)},__wbindgen_memory:function(){return n[28].exports.Db()},__wbindgen_closure_wrapper256:function(e,t,r){return n[28].exports.tb(e,t,r)},__wbindgen_closure_wrapper258:function(e,t,r){return n[28].exports.ub(e,t,r)},__wbindgen_closure_wrapper260:function(e,t,r){return n[28].exports.vb(e,t,r)},__wbindgen_closure_wrapper262:function(e,t,r){return n[28].exports.wb(e,t,r)},__wbindgen_closure_wrapper2880:function(e,t,r){return n[28].exports.xb(e,t,r)},__wbindgen_closure_wrapper4637:function(e,t,r){return n[28].exports.yb(e,t,r)}}}}};function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var c=new Promise((function(t,i){n=r[e]=[t,i]}));t.push(n[2]=c);var u,l=document.createElement("script");l.charset="utf-8",l.timeout=120,a.nc&&l.setAttribute("nonce",a.nc),l.src=i(e);var d=new Error;u=function(t){l.onerror=l.onload=null,clearTimeout(p);var n=r[e];if(0!==n){if(n){var i=t&&("load"===t.type?"missing":t.type),s=t&&t.target&&t.target.src;d.message="Loading chunk "+e+" failed.\n("+i+": "+s+")",d.name="ChunkLoadError",d.type=i,d.request=s,n[1](d)}r[e]=void 0}};var p=setTimeout((function(){u({type:"timeout",target:l})}),12e4);l.onerror=l.onload=u,document.head.appendChild(l)}return({1:[30]}[e]||[]).forEach((function(e){var n=s[e];if(n)t.push(n);else{var r,i=o[e](),c=fetch(a.p+""+{30:"b0219b34bc18e1ad0240"}[e]+".module.wasm");if(i instanceof Promise&&"function"==typeof WebAssembly.compileStreaming)r=Promise.all([WebAssembly.compileStreaming(c),i]).then((function(e){return WebAssembly.instantiate(e[0],e[1])}));else if("function"==typeof WebAssembly.instantiateStreaming)r=WebAssembly.instantiateStreaming(c,i);else{r=c.then((function(e){return e.arrayBuffer()})).then((function(e){return WebAssembly.instantiate(e,i)}))}t.push(s[e]=r.then((function(t){return a.w[e]=(t.instance||t).exports})))}})),Promise.all(t)},a.m=e,a.c=n,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a.oe=function(e){throw console.error(e),e},a.w={};var c=window.webpackJsonp=window.webpackJsonp||[],u=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var d=u,p=a(a.s=26);return t([[],{},0,[1]]),p}([function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(1),i=n.n(r);const s=i.a.Reader,o=i.a.Writer,a=i.a.util,c=i.a.roots.default||(i.a.roots.default={}),u=c.Buttplug=(()=>{const e={};return e.Endpoint=function(){const e={},t=Object.create(e);return t[e[0]="Command"]=0,t[e[1]="Firmware"]=1,t[e[2]="Rx"]=2,t[e[3]="RxAccel"]=3,t[e[4]="RxBLEBattery"]=4,t[e[5]="RxPressure"]=5,t[e[6]="RxTouch"]=6,t[e[7]="Tx"]=7,t[e[8]="TxMode"]=8,t[e[9]="TxShock"]=9,t[e[10]="TxVibrate"]=10,t[e[11]="TxVendorControl"]=11,t[e[12]="Whitelist"]=12,t[e[13]="Generic0"]=13,t[e[14]="Generic1"]=14,t[e[15]="Generic2"]=15,t[e[16]="Generic3"]=16,t[e[17]="Generic4"]=17,t[e[18]="Generic5"]=18,t[e[19]="Generic6"]=19,t[e[20]="Generic7"]=20,t[e[21]="Generic8"]=21,t[e[22]="Generic9"]=22,t[e[23]="Generic10"]=23,t[e[24]="Generic11"]=24,t[e[25]="Generic12"]=25,t[e[26]="Generic13"]=26,t[e[27]="Generic14"]=27,t[e[28]="Generic15"]=28,t[e[29]="Generic16"]=29,t[e[30]="Generic17"]=30,t[e[31]="Generic18"]=31,t[e[32]="Generic19"]=32,t[e[33]="Generic20"]=33,t[e[34]="Generic21"]=34,t[e[35]="Generic22"]=35,t[e[36]="Generic23"]=36,t[e[37]="Generic24"]=37,t[e[38]="Generic25"]=38,t[e[39]="Generic26"]=39,t[e[40]="Generic27"]=40,t[e[41]="Generic28"]=41,t[e[42]="Generic29"]=42,t[e[43]="Generic30"]=43,t[e[44]="Generic31"]=44,t[e[45]="RxBLEModel"]=45,t}(),e.ClientMessage=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id=0,e.prototype.message=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(8).uint32(e.id),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&c.Buttplug.ClientMessage.FFIMessage.encode(e.message,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.uint32();break;case 2:r.message=c.Buttplug.ClientMessage.FFIMessage.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!a.isInteger(e.id))return"id: integer expected";if(null!=e.message&&e.hasOwnProperty("message")){let t=c.Buttplug.ClientMessage.FFIMessage.verify(e.message);if(t)return"message."+t}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.ClientMessage)return e;let t=new c.Buttplug.ClientMessage;if(null!=e.id&&(t.id=e.id>>>0),null!=e.message){if("object"!=typeof e.message)throw TypeError(".Buttplug.ClientMessage.message: object expected");t.message=c.Buttplug.ClientMessage.FFIMessage.fromObject(e.message)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id=0,n.message=null),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.message&&e.hasOwnProperty("message")&&(n.message=c.Buttplug.ClientMessage.FFIMessage.toObject(e.message,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e.DeviceCommunicationManagerTypes=function(){const e={},t=Object.create(e);return t[e[0]="All"]=0,t[e[1]="Btleplug"]=1,t[e[2]="XInput"]=2,t[e[4]="SerialPort"]=4,t[e[8]="LovenseHIDDongle"]=8,t[e[16]="LovenseSerialDongle"]=16,t}(),e.ConnectLocal=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.serverName="",e.prototype.maxPingTime=0,e.prototype.allowRawMessages=!1,e.prototype.deviceConfigurationJson="",e.prototype.userDeviceConfigurationJson="",e.prototype.commManagerTypes=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.serverName&&Object.hasOwnProperty.call(e,"serverName")&&t.uint32(10).string(e.serverName),null!=e.maxPingTime&&Object.hasOwnProperty.call(e,"maxPingTime")&&t.uint32(16).uint32(e.maxPingTime),null!=e.allowRawMessages&&Object.hasOwnProperty.call(e,"allowRawMessages")&&t.uint32(24).bool(e.allowRawMessages),null!=e.deviceConfigurationJson&&Object.hasOwnProperty.call(e,"deviceConfigurationJson")&&t.uint32(34).string(e.deviceConfigurationJson),null!=e.userDeviceConfigurationJson&&Object.hasOwnProperty.call(e,"userDeviceConfigurationJson")&&t.uint32(42).string(e.userDeviceConfigurationJson),null!=e.commManagerTypes&&Object.hasOwnProperty.call(e,"commManagerTypes")&&t.uint32(48).uint32(e.commManagerTypes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.ConnectLocal;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.serverName=e.string();break;case 2:r.maxPingTime=e.uint32();break;case 3:r.allowRawMessages=e.bool();break;case 4:r.deviceConfigurationJson=e.string();break;case 5:r.userDeviceConfigurationJson=e.string();break;case 6:r.commManagerTypes=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.serverName&&e.hasOwnProperty("serverName")&&!a.isString(e.serverName)?"serverName: string expected":null!=e.maxPingTime&&e.hasOwnProperty("maxPingTime")&&!a.isInteger(e.maxPingTime)?"maxPingTime: integer expected":null!=e.allowRawMessages&&e.hasOwnProperty("allowRawMessages")&&"boolean"!=typeof e.allowRawMessages?"allowRawMessages: boolean expected":null!=e.deviceConfigurationJson&&e.hasOwnProperty("deviceConfigurationJson")&&!a.isString(e.deviceConfigurationJson)?"deviceConfigurationJson: string expected":null!=e.userDeviceConfigurationJson&&e.hasOwnProperty("userDeviceConfigurationJson")&&!a.isString(e.userDeviceConfigurationJson)?"userDeviceConfigurationJson: string expected":null!=e.commManagerTypes&&e.hasOwnProperty("commManagerTypes")&&!a.isInteger(e.commManagerTypes)?"commManagerTypes: integer expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.ClientMessage.ConnectLocal)return e;let t=new c.Buttplug.ClientMessage.ConnectLocal;return null!=e.serverName&&(t.serverName=String(e.serverName)),null!=e.maxPingTime&&(t.maxPingTime=e.maxPingTime>>>0),null!=e.allowRawMessages&&(t.allowRawMessages=Boolean(e.allowRawMessages)),null!=e.deviceConfigurationJson&&(t.deviceConfigurationJson=String(e.deviceConfigurationJson)),null!=e.userDeviceConfigurationJson&&(t.userDeviceConfigurationJson=String(e.userDeviceConfigurationJson)),null!=e.commManagerTypes&&(t.commManagerTypes=e.commManagerTypes>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.serverName="",n.maxPingTime=0,n.allowRawMessages=!1,n.deviceConfigurationJson="",n.userDeviceConfigurationJson="",n.commManagerTypes=0),null!=e.serverName&&e.hasOwnProperty("serverName")&&(n.serverName=e.serverName),null!=e.maxPingTime&&e.hasOwnProperty("maxPingTime")&&(n.maxPingTime=e.maxPingTime),null!=e.allowRawMessages&&e.hasOwnProperty("allowRawMessages")&&(n.allowRawMessages=e.allowRawMessages),null!=e.deviceConfigurationJson&&e.hasOwnProperty("deviceConfigurationJson")&&(n.deviceConfigurationJson=e.deviceConfigurationJson),null!=e.userDeviceConfigurationJson&&e.hasOwnProperty("userDeviceConfigurationJson")&&(n.userDeviceConfigurationJson=e.userDeviceConfigurationJson),null!=e.commManagerTypes&&e.hasOwnProperty("commManagerTypes")&&(n.commManagerTypes=e.commManagerTypes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.ConnectWebsocket=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.address="",e.prototype.bypassCertVerification=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.address&&Object.hasOwnProperty.call(e,"address")&&t.uint32(10).string(e.address),null!=e.bypassCertVerification&&Object.hasOwnProperty.call(e,"bypassCertVerification")&&t.uint32(16).bool(e.bypassCertVerification),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.ConnectWebsocket;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.address=e.string();break;case 2:r.bypassCertVerification=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.address&&e.hasOwnProperty("address")&&!a.isString(e.address)?"address: string expected":null!=e.bypassCertVerification&&e.hasOwnProperty("bypassCertVerification")&&"boolean"!=typeof e.bypassCertVerification?"bypassCertVerification: boolean expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.ClientMessage.ConnectWebsocket)return e;let t=new c.Buttplug.ClientMessage.ConnectWebsocket;return null!=e.address&&(t.address=String(e.address)),null!=e.bypassCertVerification&&(t.bypassCertVerification=Boolean(e.bypassCertVerification)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.address="",n.bypassCertVerification=!1),null!=e.address&&e.hasOwnProperty("address")&&(n.address=e.address),null!=e.bypassCertVerification&&e.hasOwnProperty("bypassCertVerification")&&(n.bypassCertVerification=e.bypassCertVerification),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.StartScanning=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.StartScanning;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ClientMessage.StartScanning?e:new c.Buttplug.ClientMessage.StartScanning},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.StopScanning=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.StopScanning;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ClientMessage.StopScanning?e:new c.Buttplug.ClientMessage.StopScanning},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.StopAllDevices=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.StopAllDevices;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ClientMessage.StopAllDevices?e:new c.Buttplug.ClientMessage.StopAllDevices},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.Disconnect=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.Disconnect;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ClientMessage.Disconnect?e:new c.Buttplug.ClientMessage.Disconnect},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.Ping=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.Ping;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ClientMessage.Ping?e:new c.Buttplug.ClientMessage.Ping},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.FFIMessage=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.connectLocal=null,e.prototype.connectWebsocket=null,e.prototype.startScanning=null,e.prototype.stopScanning=null,e.prototype.stopAllDevices=null,e.prototype.disconnect=null,e.prototype.ping=null,Object.defineProperty(e.prototype,"msg",{get:a.oneOfGetter(t=["connectLocal","connectWebsocket","startScanning","stopScanning","stopAllDevices","disconnect","ping"]),set:a.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.connectLocal&&Object.hasOwnProperty.call(e,"connectLocal")&&c.Buttplug.ClientMessage.ConnectLocal.encode(e.connectLocal,t.uint32(10).fork()).ldelim(),null!=e.connectWebsocket&&Object.hasOwnProperty.call(e,"connectWebsocket")&&c.Buttplug.ClientMessage.ConnectWebsocket.encode(e.connectWebsocket,t.uint32(18).fork()).ldelim(),null!=e.startScanning&&Object.hasOwnProperty.call(e,"startScanning")&&c.Buttplug.ClientMessage.StartScanning.encode(e.startScanning,t.uint32(26).fork()).ldelim(),null!=e.stopScanning&&Object.hasOwnProperty.call(e,"stopScanning")&&c.Buttplug.ClientMessage.StopScanning.encode(e.stopScanning,t.uint32(34).fork()).ldelim(),null!=e.stopAllDevices&&Object.hasOwnProperty.call(e,"stopAllDevices")&&c.Buttplug.ClientMessage.StopAllDevices.encode(e.stopAllDevices,t.uint32(42).fork()).ldelim(),null!=e.disconnect&&Object.hasOwnProperty.call(e,"disconnect")&&c.Buttplug.ClientMessage.Disconnect.encode(e.disconnect,t.uint32(50).fork()).ldelim(),null!=e.ping&&Object.hasOwnProperty.call(e,"ping")&&c.Buttplug.ClientMessage.Ping.encode(e.ping,t.uint32(58).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ClientMessage.FFIMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.connectLocal=c.Buttplug.ClientMessage.ConnectLocal.decode(e,e.uint32());break;case 2:r.connectWebsocket=c.Buttplug.ClientMessage.ConnectWebsocket.decode(e,e.uint32());break;case 3:r.startScanning=c.Buttplug.ClientMessage.StartScanning.decode(e,e.uint32());break;case 4:r.stopScanning=c.Buttplug.ClientMessage.StopScanning.decode(e,e.uint32());break;case 5:r.stopAllDevices=c.Buttplug.ClientMessage.StopAllDevices.decode(e,e.uint32());break;case 6:r.disconnect=c.Buttplug.ClientMessage.Disconnect.decode(e,e.uint32());break;case 7:r.ping=c.Buttplug.ClientMessage.Ping.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";let t={};if(null!=e.connectLocal&&e.hasOwnProperty("connectLocal")){t.msg=1;{let t=c.Buttplug.ClientMessage.ConnectLocal.verify(e.connectLocal);if(t)return"connectLocal."+t}}if(null!=e.connectWebsocket&&e.hasOwnProperty("connectWebsocket")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ClientMessage.ConnectWebsocket.verify(e.connectWebsocket);if(t)return"connectWebsocket."+t}}if(null!=e.startScanning&&e.hasOwnProperty("startScanning")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ClientMessage.StartScanning.verify(e.startScanning);if(t)return"startScanning."+t}}if(null!=e.stopScanning&&e.hasOwnProperty("stopScanning")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ClientMessage.StopScanning.verify(e.stopScanning);if(t)return"stopScanning."+t}}if(null!=e.stopAllDevices&&e.hasOwnProperty("stopAllDevices")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ClientMessage.StopAllDevices.verify(e.stopAllDevices);if(t)return"stopAllDevices."+t}}if(null!=e.disconnect&&e.hasOwnProperty("disconnect")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ClientMessage.Disconnect.verify(e.disconnect);if(t)return"disconnect."+t}}if(null!=e.ping&&e.hasOwnProperty("ping")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ClientMessage.Ping.verify(e.ping);if(t)return"ping."+t}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.ClientMessage.FFIMessage)return e;let t=new c.Buttplug.ClientMessage.FFIMessage;if(null!=e.connectLocal){if("object"!=typeof e.connectLocal)throw TypeError(".Buttplug.ClientMessage.FFIMessage.connectLocal: object expected");t.connectLocal=c.Buttplug.ClientMessage.ConnectLocal.fromObject(e.connectLocal)}if(null!=e.connectWebsocket){if("object"!=typeof e.connectWebsocket)throw TypeError(".Buttplug.ClientMessage.FFIMessage.connectWebsocket: object expected");t.connectWebsocket=c.Buttplug.ClientMessage.ConnectWebsocket.fromObject(e.connectWebsocket)}if(null!=e.startScanning){if("object"!=typeof e.startScanning)throw TypeError(".Buttplug.ClientMessage.FFIMessage.startScanning: object expected");t.startScanning=c.Buttplug.ClientMessage.StartScanning.fromObject(e.startScanning)}if(null!=e.stopScanning){if("object"!=typeof e.stopScanning)throw TypeError(".Buttplug.ClientMessage.FFIMessage.stopScanning: object expected");t.stopScanning=c.Buttplug.ClientMessage.StopScanning.fromObject(e.stopScanning)}if(null!=e.stopAllDevices){if("object"!=typeof e.stopAllDevices)throw TypeError(".Buttplug.ClientMessage.FFIMessage.stopAllDevices: object expected");t.stopAllDevices=c.Buttplug.ClientMessage.StopAllDevices.fromObject(e.stopAllDevices)}if(null!=e.disconnect){if("object"!=typeof e.disconnect)throw TypeError(".Buttplug.ClientMessage.FFIMessage.disconnect: object expected");t.disconnect=c.Buttplug.ClientMessage.Disconnect.fromObject(e.disconnect)}if(null!=e.ping){if("object"!=typeof e.ping)throw TypeError(".Buttplug.ClientMessage.FFIMessage.ping: object expected");t.ping=c.Buttplug.ClientMessage.Ping.fromObject(e.ping)}return t},e.toObject=function(e,t){t||(t={});let n={};return null!=e.connectLocal&&e.hasOwnProperty("connectLocal")&&(n.connectLocal=c.Buttplug.ClientMessage.ConnectLocal.toObject(e.connectLocal,t),t.oneofs&&(n.msg="connectLocal")),null!=e.connectWebsocket&&e.hasOwnProperty("connectWebsocket")&&(n.connectWebsocket=c.Buttplug.ClientMessage.ConnectWebsocket.toObject(e.connectWebsocket,t),t.oneofs&&(n.msg="connectWebsocket")),null!=e.startScanning&&e.hasOwnProperty("startScanning")&&(n.startScanning=c.Buttplug.ClientMessage.StartScanning.toObject(e.startScanning,t),t.oneofs&&(n.msg="startScanning")),null!=e.stopScanning&&e.hasOwnProperty("stopScanning")&&(n.stopScanning=c.Buttplug.ClientMessage.StopScanning.toObject(e.stopScanning,t),t.oneofs&&(n.msg="stopScanning")),null!=e.stopAllDevices&&e.hasOwnProperty("stopAllDevices")&&(n.stopAllDevices=c.Buttplug.ClientMessage.StopAllDevices.toObject(e.stopAllDevices,t),t.oneofs&&(n.msg="stopAllDevices")),null!=e.disconnect&&e.hasOwnProperty("disconnect")&&(n.disconnect=c.Buttplug.ClientMessage.Disconnect.toObject(e.disconnect,t),t.oneofs&&(n.msg="disconnect")),null!=e.ping&&e.hasOwnProperty("ping")&&(n.ping=c.Buttplug.ClientMessage.Ping.toObject(e.ping,t),t.oneofs&&(n.msg="ping")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e}(),e.DeviceMessage=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id=0,e.prototype.index=0,e.prototype.message=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(8).uint32(e.id),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(16).uint32(e.index),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&c.Buttplug.DeviceMessage.FFIMessage.encode(e.message,t.uint32(26).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.uint32();break;case 2:r.index=e.uint32();break;case 3:r.message=c.Buttplug.DeviceMessage.FFIMessage.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!a.isInteger(e.id))return"id: integer expected";if(null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index))return"index: integer expected";if(null!=e.message&&e.hasOwnProperty("message")){let t=c.Buttplug.DeviceMessage.FFIMessage.verify(e.message);if(t)return"message."+t}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage)return e;let t=new c.Buttplug.DeviceMessage;if(null!=e.id&&(t.id=e.id>>>0),null!=e.index&&(t.index=e.index>>>0),null!=e.message){if("object"!=typeof e.message)throw TypeError(".Buttplug.DeviceMessage.message: object expected");t.message=c.Buttplug.DeviceMessage.FFIMessage.fromObject(e.message)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id=0,n.index=0,n.message=null),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),null!=e.message&&e.hasOwnProperty("message")&&(n.message=c.Buttplug.DeviceMessage.FFIMessage.toObject(e.message,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e.VibrateComponent=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.prototype.speed=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),null!=e.speed&&Object.hasOwnProperty.call(e,"speed")&&t.uint32(17).double(e.speed),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.VibrateComponent;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;case 2:r.speed=e.double();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index)?"index: integer expected":null!=e.speed&&e.hasOwnProperty("speed")&&"number"!=typeof e.speed?"speed: number expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.VibrateComponent)return e;let t=new c.Buttplug.DeviceMessage.VibrateComponent;return null!=e.index&&(t.index=e.index>>>0),null!=e.speed&&(t.speed=Number(e.speed)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0,n.speed=0),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),null!=e.speed&&e.hasOwnProperty("speed")&&(n.speed=t.json&&!isFinite(e.speed)?String(e.speed):e.speed),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.VibrateCmd=function(){function e(e){if(this.speeds=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.speeds=a.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.speeds&&e.speeds.length)for(let n=0;n<e.speeds.length;++n)c.Buttplug.DeviceMessage.VibrateComponent.encode(e.speeds[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.VibrateCmd;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.speeds&&r.speeds.length||(r.speeds=[]),r.speeds.push(c.Buttplug.DeviceMessage.VibrateComponent.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.speeds&&e.hasOwnProperty("speeds")){if(!Array.isArray(e.speeds))return"speeds: array expected";for(let t=0;t<e.speeds.length;++t){let n=c.Buttplug.DeviceMessage.VibrateComponent.verify(e.speeds[t]);if(n)return"speeds."+n}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.VibrateCmd)return e;let t=new c.Buttplug.DeviceMessage.VibrateCmd;if(e.speeds){if(!Array.isArray(e.speeds))throw TypeError(".Buttplug.DeviceMessage.VibrateCmd.speeds: array expected");t.speeds=[];for(let n=0;n<e.speeds.length;++n){if("object"!=typeof e.speeds[n])throw TypeError(".Buttplug.DeviceMessage.VibrateCmd.speeds: object expected");t.speeds[n]=c.Buttplug.DeviceMessage.VibrateComponent.fromObject(e.speeds[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.speeds=[]),e.speeds&&e.speeds.length){n.speeds=[];for(let r=0;r<e.speeds.length;++r)n.speeds[r]=c.Buttplug.DeviceMessage.VibrateComponent.toObject(e.speeds[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RotateComponent=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.prototype.speed=0,e.prototype.clockwise=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),null!=e.speed&&Object.hasOwnProperty.call(e,"speed")&&t.uint32(17).double(e.speed),null!=e.clockwise&&Object.hasOwnProperty.call(e,"clockwise")&&t.uint32(24).bool(e.clockwise),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.RotateComponent;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;case 2:r.speed=e.double();break;case 3:r.clockwise=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index)?"index: integer expected":null!=e.speed&&e.hasOwnProperty("speed")&&"number"!=typeof e.speed?"speed: number expected":null!=e.clockwise&&e.hasOwnProperty("clockwise")&&"boolean"!=typeof e.clockwise?"clockwise: boolean expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.RotateComponent)return e;let t=new c.Buttplug.DeviceMessage.RotateComponent;return null!=e.index&&(t.index=e.index>>>0),null!=e.speed&&(t.speed=Number(e.speed)),null!=e.clockwise&&(t.clockwise=Boolean(e.clockwise)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0,n.speed=0,n.clockwise=!1),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),null!=e.speed&&e.hasOwnProperty("speed")&&(n.speed=t.json&&!isFinite(e.speed)?String(e.speed):e.speed),null!=e.clockwise&&e.hasOwnProperty("clockwise")&&(n.clockwise=e.clockwise),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RotateCmd=function(){function e(e){if(this.rotations=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.rotations=a.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.rotations&&e.rotations.length)for(let n=0;n<e.rotations.length;++n)c.Buttplug.DeviceMessage.RotateComponent.encode(e.rotations[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.RotateCmd;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.rotations&&r.rotations.length||(r.rotations=[]),r.rotations.push(c.Buttplug.DeviceMessage.RotateComponent.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.rotations&&e.hasOwnProperty("rotations")){if(!Array.isArray(e.rotations))return"rotations: array expected";for(let t=0;t<e.rotations.length;++t){let n=c.Buttplug.DeviceMessage.RotateComponent.verify(e.rotations[t]);if(n)return"rotations."+n}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.RotateCmd)return e;let t=new c.Buttplug.DeviceMessage.RotateCmd;if(e.rotations){if(!Array.isArray(e.rotations))throw TypeError(".Buttplug.DeviceMessage.RotateCmd.rotations: array expected");t.rotations=[];for(let n=0;n<e.rotations.length;++n){if("object"!=typeof e.rotations[n])throw TypeError(".Buttplug.DeviceMessage.RotateCmd.rotations: object expected");t.rotations[n]=c.Buttplug.DeviceMessage.RotateComponent.fromObject(e.rotations[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.rotations=[]),e.rotations&&e.rotations.length){n.rotations=[];for(let r=0;r<e.rotations.length;++r)n.rotations[r]=c.Buttplug.DeviceMessage.RotateComponent.toObject(e.rotations[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.LinearComponent=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.prototype.duration=0,e.prototype.position=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),null!=e.duration&&Object.hasOwnProperty.call(e,"duration")&&t.uint32(16).uint32(e.duration),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&t.uint32(25).double(e.position),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.LinearComponent;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;case 2:r.duration=e.uint32();break;case 3:r.position=e.double();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index)?"index: integer expected":null!=e.duration&&e.hasOwnProperty("duration")&&!a.isInteger(e.duration)?"duration: integer expected":null!=e.position&&e.hasOwnProperty("position")&&"number"!=typeof e.position?"position: number expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.LinearComponent)return e;let t=new c.Buttplug.DeviceMessage.LinearComponent;return null!=e.index&&(t.index=e.index>>>0),null!=e.duration&&(t.duration=e.duration>>>0),null!=e.position&&(t.position=Number(e.position)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0,n.duration=0,n.position=0),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),null!=e.duration&&e.hasOwnProperty("duration")&&(n.duration=e.duration),null!=e.position&&e.hasOwnProperty("position")&&(n.position=t.json&&!isFinite(e.position)?String(e.position):e.position),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.LinearCmd=function(){function e(e){if(this.movements=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.movements=a.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.movements&&e.movements.length)for(let n=0;n<e.movements.length;++n)c.Buttplug.DeviceMessage.LinearComponent.encode(e.movements[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.LinearCmd;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.movements&&r.movements.length||(r.movements=[]),r.movements.push(c.Buttplug.DeviceMessage.LinearComponent.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.movements&&e.hasOwnProperty("movements")){if(!Array.isArray(e.movements))return"movements: array expected";for(let t=0;t<e.movements.length;++t){let n=c.Buttplug.DeviceMessage.LinearComponent.verify(e.movements[t]);if(n)return"movements."+n}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.LinearCmd)return e;let t=new c.Buttplug.DeviceMessage.LinearCmd;if(e.movements){if(!Array.isArray(e.movements))throw TypeError(".Buttplug.DeviceMessage.LinearCmd.movements: array expected");t.movements=[];for(let n=0;n<e.movements.length;++n){if("object"!=typeof e.movements[n])throw TypeError(".Buttplug.DeviceMessage.LinearCmd.movements: object expected");t.movements[n]=c.Buttplug.DeviceMessage.LinearComponent.fromObject(e.movements[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.movements=[]),e.movements&&e.movements.length){n.movements=[];for(let r=0;r<e.movements.length;++r)n.movements[r]=c.Buttplug.DeviceMessage.LinearComponent.toObject(e.movements[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.StopDeviceCmd=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.StopDeviceCmd;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.DeviceMessage.StopDeviceCmd?e:new c.Buttplug.DeviceMessage.StopDeviceCmd},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RawReadCmd=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.endpoint=0,e.prototype.data=a.newBuffer([]),e.prototype.expectedLength=0,e.prototype.timeout=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.endpoint&&Object.hasOwnProperty.call(e,"endpoint")&&t.uint32(8).int32(e.endpoint),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(18).bytes(e.data),null!=e.expectedLength&&Object.hasOwnProperty.call(e,"expectedLength")&&t.uint32(24).uint32(e.expectedLength),null!=e.timeout&&Object.hasOwnProperty.call(e,"timeout")&&t.uint32(32).uint32(e.timeout),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.RawReadCmd;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.endpoint=e.int32();break;case 2:r.data=e.bytes();break;case 3:r.expectedLength=e.uint32();break;case 4:r.timeout=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.endpoint&&e.hasOwnProperty("endpoint"))switch(e.endpoint){default:return"endpoint: enum value expected";case 0: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:}return null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||a.isString(e.data))?"data: buffer expected":null!=e.expectedLength&&e.hasOwnProperty("expectedLength")&&!a.isInteger(e.expectedLength)?"expectedLength: integer expected":null!=e.timeout&&e.hasOwnProperty("timeout")&&!a.isInteger(e.timeout)?"timeout: integer expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.RawReadCmd)return e;let t=new c.Buttplug.DeviceMessage.RawReadCmd;switch(e.endpoint){case"Command":case 0:t.endpoint=0;break;case"Firmware":case 1:t.endpoint=1;break;case"Rx":case 2:t.endpoint=2;break;case"RxAccel":case 3:t.endpoint=3;break;case"RxBLEBattery":case 4:t.endpoint=4;break;case"RxPressure":case 5:t.endpoint=5;break;case"RxTouch":case 6:t.endpoint=6;break;case"Tx":case 7:t.endpoint=7;break;case"TxMode":case 8:t.endpoint=8;break;case"TxShock":case 9:t.endpoint=9;break;case"TxVibrate":case 10:t.endpoint=10;break;case"TxVendorControl":case 11:t.endpoint=11;break;case"Whitelist":case 12:t.endpoint=12;break;case"Generic0":case 13:t.endpoint=13;break;case"Generic1":case 14:t.endpoint=14;break;case"Generic2":case 15:t.endpoint=15;break;case"Generic3":case 16:t.endpoint=16;break;case"Generic4":case 17:t.endpoint=17;break;case"Generic5":case 18:t.endpoint=18;break;case"Generic6":case 19:t.endpoint=19;break;case"Generic7":case 20:t.endpoint=20;break;case"Generic8":case 21:t.endpoint=21;break;case"Generic9":case 22:t.endpoint=22;break;case"Generic10":case 23:t.endpoint=23;break;case"Generic11":case 24:t.endpoint=24;break;case"Generic12":case 25:t.endpoint=25;break;case"Generic13":case 26:t.endpoint=26;break;case"Generic14":case 27:t.endpoint=27;break;case"Generic15":case 28:t.endpoint=28;break;case"Generic16":case 29:t.endpoint=29;break;case"Generic17":case 30:t.endpoint=30;break;case"Generic18":case 31:t.endpoint=31;break;case"Generic19":case 32:t.endpoint=32;break;case"Generic20":case 33:t.endpoint=33;break;case"Generic21":case 34:t.endpoint=34;break;case"Generic22":case 35:t.endpoint=35;break;case"Generic23":case 36:t.endpoint=36;break;case"Generic24":case 37:t.endpoint=37;break;case"Generic25":case 38:t.endpoint=38;break;case"Generic26":case 39:t.endpoint=39;break;case"Generic27":case 40:t.endpoint=40;break;case"Generic28":case 41:t.endpoint=41;break;case"Generic29":case 42:t.endpoint=42;break;case"Generic30":case 43:t.endpoint=43;break;case"Generic31":case 44:t.endpoint=44;break;case"RxBLEModel":case 45:t.endpoint=45}return null!=e.data&&("string"==typeof e.data?a.base64.decode(e.data,t.data=a.newBuffer(a.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),null!=e.expectedLength&&(t.expectedLength=e.expectedLength>>>0),null!=e.timeout&&(t.timeout=e.timeout>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.endpoint=t.enums===String?"Command":0,t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=a.newBuffer(n.data))),n.expectedLength=0,n.timeout=0),null!=e.endpoint&&e.hasOwnProperty("endpoint")&&(n.endpoint=t.enums===String?c.Buttplug.Endpoint[e.endpoint]:e.endpoint),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?a.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.expectedLength&&e.hasOwnProperty("expectedLength")&&(n.expectedLength=e.expectedLength),null!=e.timeout&&e.hasOwnProperty("timeout")&&(n.timeout=e.timeout),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RawWriteCmd=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.endpoint=0,e.prototype.data=a.newBuffer([]),e.prototype.writeWithResponse=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.endpoint&&Object.hasOwnProperty.call(e,"endpoint")&&t.uint32(8).int32(e.endpoint),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(18).bytes(e.data),null!=e.writeWithResponse&&Object.hasOwnProperty.call(e,"writeWithResponse")&&t.uint32(24).bool(e.writeWithResponse),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.RawWriteCmd;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.endpoint=e.int32();break;case 2:r.data=e.bytes();break;case 3:r.writeWithResponse=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.endpoint&&e.hasOwnProperty("endpoint"))switch(e.endpoint){default:return"endpoint: enum value expected";case 0: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:}return null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||a.isString(e.data))?"data: buffer expected":null!=e.writeWithResponse&&e.hasOwnProperty("writeWithResponse")&&"boolean"!=typeof e.writeWithResponse?"writeWithResponse: boolean expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.RawWriteCmd)return e;let t=new c.Buttplug.DeviceMessage.RawWriteCmd;switch(e.endpoint){case"Command":case 0:t.endpoint=0;break;case"Firmware":case 1:t.endpoint=1;break;case"Rx":case 2:t.endpoint=2;break;case"RxAccel":case 3:t.endpoint=3;break;case"RxBLEBattery":case 4:t.endpoint=4;break;case"RxPressure":case 5:t.endpoint=5;break;case"RxTouch":case 6:t.endpoint=6;break;case"Tx":case 7:t.endpoint=7;break;case"TxMode":case 8:t.endpoint=8;break;case"TxShock":case 9:t.endpoint=9;break;case"TxVibrate":case 10:t.endpoint=10;break;case"TxVendorControl":case 11:t.endpoint=11;break;case"Whitelist":case 12:t.endpoint=12;break;case"Generic0":case 13:t.endpoint=13;break;case"Generic1":case 14:t.endpoint=14;break;case"Generic2":case 15:t.endpoint=15;break;case"Generic3":case 16:t.endpoint=16;break;case"Generic4":case 17:t.endpoint=17;break;case"Generic5":case 18:t.endpoint=18;break;case"Generic6":case 19:t.endpoint=19;break;case"Generic7":case 20:t.endpoint=20;break;case"Generic8":case 21:t.endpoint=21;break;case"Generic9":case 22:t.endpoint=22;break;case"Generic10":case 23:t.endpoint=23;break;case"Generic11":case 24:t.endpoint=24;break;case"Generic12":case 25:t.endpoint=25;break;case"Generic13":case 26:t.endpoint=26;break;case"Generic14":case 27:t.endpoint=27;break;case"Generic15":case 28:t.endpoint=28;break;case"Generic16":case 29:t.endpoint=29;break;case"Generic17":case 30:t.endpoint=30;break;case"Generic18":case 31:t.endpoint=31;break;case"Generic19":case 32:t.endpoint=32;break;case"Generic20":case 33:t.endpoint=33;break;case"Generic21":case 34:t.endpoint=34;break;case"Generic22":case 35:t.endpoint=35;break;case"Generic23":case 36:t.endpoint=36;break;case"Generic24":case 37:t.endpoint=37;break;case"Generic25":case 38:t.endpoint=38;break;case"Generic26":case 39:t.endpoint=39;break;case"Generic27":case 40:t.endpoint=40;break;case"Generic28":case 41:t.endpoint=41;break;case"Generic29":case 42:t.endpoint=42;break;case"Generic30":case 43:t.endpoint=43;break;case"Generic31":case 44:t.endpoint=44;break;case"RxBLEModel":case 45:t.endpoint=45}return null!=e.data&&("string"==typeof e.data?a.base64.decode(e.data,t.data=a.newBuffer(a.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),null!=e.writeWithResponse&&(t.writeWithResponse=Boolean(e.writeWithResponse)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.endpoint=t.enums===String?"Command":0,t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=a.newBuffer(n.data))),n.writeWithResponse=!1),null!=e.endpoint&&e.hasOwnProperty("endpoint")&&(n.endpoint=t.enums===String?c.Buttplug.Endpoint[e.endpoint]:e.endpoint),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?a.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.writeWithResponse&&e.hasOwnProperty("writeWithResponse")&&(n.writeWithResponse=e.writeWithResponse),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RawSubscribeCmd=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.endpoint=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.endpoint&&Object.hasOwnProperty.call(e,"endpoint")&&t.uint32(8).int32(e.endpoint),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.RawSubscribeCmd;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.endpoint=e.int32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.endpoint&&e.hasOwnProperty("endpoint"))switch(e.endpoint){default:return"endpoint: enum value expected";case 0: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:}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.RawSubscribeCmd)return e;let t=new c.Buttplug.DeviceMessage.RawSubscribeCmd;switch(e.endpoint){case"Command":case 0:t.endpoint=0;break;case"Firmware":case 1:t.endpoint=1;break;case"Rx":case 2:t.endpoint=2;break;case"RxAccel":case 3:t.endpoint=3;break;case"RxBLEBattery":case 4:t.endpoint=4;break;case"RxPressure":case 5:t.endpoint=5;break;case"RxTouch":case 6:t.endpoint=6;break;case"Tx":case 7:t.endpoint=7;break;case"TxMode":case 8:t.endpoint=8;break;case"TxShock":case 9:t.endpoint=9;break;case"TxVibrate":case 10:t.endpoint=10;break;case"TxVendorControl":case 11:t.endpoint=11;break;case"Whitelist":case 12:t.endpoint=12;break;case"Generic0":case 13:t.endpoint=13;break;case"Generic1":case 14:t.endpoint=14;break;case"Generic2":case 15:t.endpoint=15;break;case"Generic3":case 16:t.endpoint=16;break;case"Generic4":case 17:t.endpoint=17;break;case"Generic5":case 18:t.endpoint=18;break;case"Generic6":case 19:t.endpoint=19;break;case"Generic7":case 20:t.endpoint=20;break;case"Generic8":case 21:t.endpoint=21;break;case"Generic9":case 22:t.endpoint=22;break;case"Generic10":case 23:t.endpoint=23;break;case"Generic11":case 24:t.endpoint=24;break;case"Generic12":case 25:t.endpoint=25;break;case"Generic13":case 26:t.endpoint=26;break;case"Generic14":case 27:t.endpoint=27;break;case"Generic15":case 28:t.endpoint=28;break;case"Generic16":case 29:t.endpoint=29;break;case"Generic17":case 30:t.endpoint=30;break;case"Generic18":case 31:t.endpoint=31;break;case"Generic19":case 32:t.endpoint=32;break;case"Generic20":case 33:t.endpoint=33;break;case"Generic21":case 34:t.endpoint=34;break;case"Generic22":case 35:t.endpoint=35;break;case"Generic23":case 36:t.endpoint=36;break;case"Generic24":case 37:t.endpoint=37;break;case"Generic25":case 38:t.endpoint=38;break;case"Generic26":case 39:t.endpoint=39;break;case"Generic27":case 40:t.endpoint=40;break;case"Generic28":case 41:t.endpoint=41;break;case"Generic29":case 42:t.endpoint=42;break;case"Generic30":case 43:t.endpoint=43;break;case"Generic31":case 44:t.endpoint=44;break;case"RxBLEModel":case 45:t.endpoint=45}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.endpoint=t.enums===String?"Command":0),null!=e.endpoint&&e.hasOwnProperty("endpoint")&&(n.endpoint=t.enums===String?c.Buttplug.Endpoint[e.endpoint]:e.endpoint),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RawUnsubscribeCmd=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.endpoint=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.endpoint&&Object.hasOwnProperty.call(e,"endpoint")&&t.uint32(8).int32(e.endpoint),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.RawUnsubscribeCmd;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.endpoint=e.int32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.endpoint&&e.hasOwnProperty("endpoint"))switch(e.endpoint){default:return"endpoint: enum value expected";case 0: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:}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.RawUnsubscribeCmd)return e;let t=new c.Buttplug.DeviceMessage.RawUnsubscribeCmd;switch(e.endpoint){case"Command":case 0:t.endpoint=0;break;case"Firmware":case 1:t.endpoint=1;break;case"Rx":case 2:t.endpoint=2;break;case"RxAccel":case 3:t.endpoint=3;break;case"RxBLEBattery":case 4:t.endpoint=4;break;case"RxPressure":case 5:t.endpoint=5;break;case"RxTouch":case 6:t.endpoint=6;break;case"Tx":case 7:t.endpoint=7;break;case"TxMode":case 8:t.endpoint=8;break;case"TxShock":case 9:t.endpoint=9;break;case"TxVibrate":case 10:t.endpoint=10;break;case"TxVendorControl":case 11:t.endpoint=11;break;case"Whitelist":case 12:t.endpoint=12;break;case"Generic0":case 13:t.endpoint=13;break;case"Generic1":case 14:t.endpoint=14;break;case"Generic2":case 15:t.endpoint=15;break;case"Generic3":case 16:t.endpoint=16;break;case"Generic4":case 17:t.endpoint=17;break;case"Generic5":case 18:t.endpoint=18;break;case"Generic6":case 19:t.endpoint=19;break;case"Generic7":case 20:t.endpoint=20;break;case"Generic8":case 21:t.endpoint=21;break;case"Generic9":case 22:t.endpoint=22;break;case"Generic10":case 23:t.endpoint=23;break;case"Generic11":case 24:t.endpoint=24;break;case"Generic12":case 25:t.endpoint=25;break;case"Generic13":case 26:t.endpoint=26;break;case"Generic14":case 27:t.endpoint=27;break;case"Generic15":case 28:t.endpoint=28;break;case"Generic16":case 29:t.endpoint=29;break;case"Generic17":case 30:t.endpoint=30;break;case"Generic18":case 31:t.endpoint=31;break;case"Generic19":case 32:t.endpoint=32;break;case"Generic20":case 33:t.endpoint=33;break;case"Generic21":case 34:t.endpoint=34;break;case"Generic22":case 35:t.endpoint=35;break;case"Generic23":case 36:t.endpoint=36;break;case"Generic24":case 37:t.endpoint=37;break;case"Generic25":case 38:t.endpoint=38;break;case"Generic26":case 39:t.endpoint=39;break;case"Generic27":case 40:t.endpoint=40;break;case"Generic28":case 41:t.endpoint=41;break;case"Generic29":case 42:t.endpoint=42;break;case"Generic30":case 43:t.endpoint=43;break;case"Generic31":case 44:t.endpoint=44;break;case"RxBLEModel":case 45:t.endpoint=45}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.endpoint=t.enums===String?"Command":0),null!=e.endpoint&&e.hasOwnProperty("endpoint")&&(n.endpoint=t.enums===String?c.Buttplug.Endpoint[e.endpoint]:e.endpoint),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.BatteryLevelCmd=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.BatteryLevelCmd;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.DeviceMessage.BatteryLevelCmd?e:new c.Buttplug.DeviceMessage.BatteryLevelCmd},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RSSILevelCmd=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.RSSILevelCmd;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.DeviceMessage.RSSILevelCmd?e:new c.Buttplug.DeviceMessage.RSSILevelCmd},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.FFIMessage=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.vibrateCmd=null,e.prototype.rotateCmd=null,e.prototype.linearCmd=null,e.prototype.stopDeviceCmd=null,e.prototype.rawReadCmd=null,e.prototype.rawWriteCmd=null,e.prototype.rawSubscribeCmd=null,e.prototype.rawUnsubscribeCmd=null,e.prototype.batteryLevelCmd=null,e.prototype.rssiLevelCmd=null,Object.defineProperty(e.prototype,"msg",{get:a.oneOfGetter(t=["vibrateCmd","rotateCmd","linearCmd","stopDeviceCmd","rawReadCmd","rawWriteCmd","rawSubscribeCmd","rawUnsubscribeCmd","batteryLevelCmd","rssiLevelCmd"]),set:a.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.vibrateCmd&&Object.hasOwnProperty.call(e,"vibrateCmd")&&c.Buttplug.DeviceMessage.VibrateCmd.encode(e.vibrateCmd,t.uint32(10).fork()).ldelim(),null!=e.rotateCmd&&Object.hasOwnProperty.call(e,"rotateCmd")&&c.Buttplug.DeviceMessage.RotateCmd.encode(e.rotateCmd,t.uint32(18).fork()).ldelim(),null!=e.linearCmd&&Object.hasOwnProperty.call(e,"linearCmd")&&c.Buttplug.DeviceMessage.LinearCmd.encode(e.linearCmd,t.uint32(26).fork()).ldelim(),null!=e.stopDeviceCmd&&Object.hasOwnProperty.call(e,"stopDeviceCmd")&&c.Buttplug.DeviceMessage.StopDeviceCmd.encode(e.stopDeviceCmd,t.uint32(34).fork()).ldelim(),null!=e.rawReadCmd&&Object.hasOwnProperty.call(e,"rawReadCmd")&&c.Buttplug.DeviceMessage.RawReadCmd.encode(e.rawReadCmd,t.uint32(42).fork()).ldelim(),null!=e.rawWriteCmd&&Object.hasOwnProperty.call(e,"rawWriteCmd")&&c.Buttplug.DeviceMessage.RawWriteCmd.encode(e.rawWriteCmd,t.uint32(50).fork()).ldelim(),null!=e.rawSubscribeCmd&&Object.hasOwnProperty.call(e,"rawSubscribeCmd")&&c.Buttplug.DeviceMessage.RawSubscribeCmd.encode(e.rawSubscribeCmd,t.uint32(58).fork()).ldelim(),null!=e.rawUnsubscribeCmd&&Object.hasOwnProperty.call(e,"rawUnsubscribeCmd")&&c.Buttplug.DeviceMessage.RawUnsubscribeCmd.encode(e.rawUnsubscribeCmd,t.uint32(66).fork()).ldelim(),null!=e.batteryLevelCmd&&Object.hasOwnProperty.call(e,"batteryLevelCmd")&&c.Buttplug.DeviceMessage.BatteryLevelCmd.encode(e.batteryLevelCmd,t.uint32(74).fork()).ldelim(),null!=e.rssiLevelCmd&&Object.hasOwnProperty.call(e,"rssiLevelCmd")&&c.Buttplug.DeviceMessage.RSSILevelCmd.encode(e.rssiLevelCmd,t.uint32(82).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceMessage.FFIMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.vibrateCmd=c.Buttplug.DeviceMessage.VibrateCmd.decode(e,e.uint32());break;case 2:r.rotateCmd=c.Buttplug.DeviceMessage.RotateCmd.decode(e,e.uint32());break;case 3:r.linearCmd=c.Buttplug.DeviceMessage.LinearCmd.decode(e,e.uint32());break;case 4:r.stopDeviceCmd=c.Buttplug.DeviceMessage.StopDeviceCmd.decode(e,e.uint32());break;case 5:r.rawReadCmd=c.Buttplug.DeviceMessage.RawReadCmd.decode(e,e.uint32());break;case 6:r.rawWriteCmd=c.Buttplug.DeviceMessage.RawWriteCmd.decode(e,e.uint32());break;case 7:r.rawSubscribeCmd=c.Buttplug.DeviceMessage.RawSubscribeCmd.decode(e,e.uint32());break;case 8:r.rawUnsubscribeCmd=c.Buttplug.DeviceMessage.RawUnsubscribeCmd.decode(e,e.uint32());break;case 9:r.batteryLevelCmd=c.Buttplug.DeviceMessage.BatteryLevelCmd.decode(e,e.uint32());break;case 10:r.rssiLevelCmd=c.Buttplug.DeviceMessage.RSSILevelCmd.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";let t={};if(null!=e.vibrateCmd&&e.hasOwnProperty("vibrateCmd")){t.msg=1;{let t=c.Buttplug.DeviceMessage.VibrateCmd.verify(e.vibrateCmd);if(t)return"vibrateCmd."+t}}if(null!=e.rotateCmd&&e.hasOwnProperty("rotateCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.RotateCmd.verify(e.rotateCmd);if(t)return"rotateCmd."+t}}if(null!=e.linearCmd&&e.hasOwnProperty("linearCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.LinearCmd.verify(e.linearCmd);if(t)return"linearCmd."+t}}if(null!=e.stopDeviceCmd&&e.hasOwnProperty("stopDeviceCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.StopDeviceCmd.verify(e.stopDeviceCmd);if(t)return"stopDeviceCmd."+t}}if(null!=e.rawReadCmd&&e.hasOwnProperty("rawReadCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.RawReadCmd.verify(e.rawReadCmd);if(t)return"rawReadCmd."+t}}if(null!=e.rawWriteCmd&&e.hasOwnProperty("rawWriteCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.RawWriteCmd.verify(e.rawWriteCmd);if(t)return"rawWriteCmd."+t}}if(null!=e.rawSubscribeCmd&&e.hasOwnProperty("rawSubscribeCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.RawSubscribeCmd.verify(e.rawSubscribeCmd);if(t)return"rawSubscribeCmd."+t}}if(null!=e.rawUnsubscribeCmd&&e.hasOwnProperty("rawUnsubscribeCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.RawUnsubscribeCmd.verify(e.rawUnsubscribeCmd);if(t)return"rawUnsubscribeCmd."+t}}if(null!=e.batteryLevelCmd&&e.hasOwnProperty("batteryLevelCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.BatteryLevelCmd.verify(e.batteryLevelCmd);if(t)return"batteryLevelCmd."+t}}if(null!=e.rssiLevelCmd&&e.hasOwnProperty("rssiLevelCmd")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceMessage.RSSILevelCmd.verify(e.rssiLevelCmd);if(t)return"rssiLevelCmd."+t}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceMessage.FFIMessage)return e;let t=new c.Buttplug.DeviceMessage.FFIMessage;if(null!=e.vibrateCmd){if("object"!=typeof e.vibrateCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.vibrateCmd: object expected");t.vibrateCmd=c.Buttplug.DeviceMessage.VibrateCmd.fromObject(e.vibrateCmd)}if(null!=e.rotateCmd){if("object"!=typeof e.rotateCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.rotateCmd: object expected");t.rotateCmd=c.Buttplug.DeviceMessage.RotateCmd.fromObject(e.rotateCmd)}if(null!=e.linearCmd){if("object"!=typeof e.linearCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.linearCmd: object expected");t.linearCmd=c.Buttplug.DeviceMessage.LinearCmd.fromObject(e.linearCmd)}if(null!=e.stopDeviceCmd){if("object"!=typeof e.stopDeviceCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.stopDeviceCmd: object expected");t.stopDeviceCmd=c.Buttplug.DeviceMessage.StopDeviceCmd.fromObject(e.stopDeviceCmd)}if(null!=e.rawReadCmd){if("object"!=typeof e.rawReadCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.rawReadCmd: object expected");t.rawReadCmd=c.Buttplug.DeviceMessage.RawReadCmd.fromObject(e.rawReadCmd)}if(null!=e.rawWriteCmd){if("object"!=typeof e.rawWriteCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.rawWriteCmd: object expected");t.rawWriteCmd=c.Buttplug.DeviceMessage.RawWriteCmd.fromObject(e.rawWriteCmd)}if(null!=e.rawSubscribeCmd){if("object"!=typeof e.rawSubscribeCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.rawSubscribeCmd: object expected");t.rawSubscribeCmd=c.Buttplug.DeviceMessage.RawSubscribeCmd.fromObject(e.rawSubscribeCmd)}if(null!=e.rawUnsubscribeCmd){if("object"!=typeof e.rawUnsubscribeCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.rawUnsubscribeCmd: object expected");t.rawUnsubscribeCmd=c.Buttplug.DeviceMessage.RawUnsubscribeCmd.fromObject(e.rawUnsubscribeCmd)}if(null!=e.batteryLevelCmd){if("object"!=typeof e.batteryLevelCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.batteryLevelCmd: object expected");t.batteryLevelCmd=c.Buttplug.DeviceMessage.BatteryLevelCmd.fromObject(e.batteryLevelCmd)}if(null!=e.rssiLevelCmd){if("object"!=typeof e.rssiLevelCmd)throw TypeError(".Buttplug.DeviceMessage.FFIMessage.rssiLevelCmd: object expected");t.rssiLevelCmd=c.Buttplug.DeviceMessage.RSSILevelCmd.fromObject(e.rssiLevelCmd)}return t},e.toObject=function(e,t){t||(t={});let n={};return null!=e.vibrateCmd&&e.hasOwnProperty("vibrateCmd")&&(n.vibrateCmd=c.Buttplug.DeviceMessage.VibrateCmd.toObject(e.vibrateCmd,t),t.oneofs&&(n.msg="vibrateCmd")),null!=e.rotateCmd&&e.hasOwnProperty("rotateCmd")&&(n.rotateCmd=c.Buttplug.DeviceMessage.RotateCmd.toObject(e.rotateCmd,t),t.oneofs&&(n.msg="rotateCmd")),null!=e.linearCmd&&e.hasOwnProperty("linearCmd")&&(n.linearCmd=c.Buttplug.DeviceMessage.LinearCmd.toObject(e.linearCmd,t),t.oneofs&&(n.msg="linearCmd")),null!=e.stopDeviceCmd&&e.hasOwnProperty("stopDeviceCmd")&&(n.stopDeviceCmd=c.Buttplug.DeviceMessage.StopDeviceCmd.toObject(e.stopDeviceCmd,t),t.oneofs&&(n.msg="stopDeviceCmd")),null!=e.rawReadCmd&&e.hasOwnProperty("rawReadCmd")&&(n.rawReadCmd=c.Buttplug.DeviceMessage.RawReadCmd.toObject(e.rawReadCmd,t),t.oneofs&&(n.msg="rawReadCmd")),null!=e.rawWriteCmd&&e.hasOwnProperty("rawWriteCmd")&&(n.rawWriteCmd=c.Buttplug.DeviceMessage.RawWriteCmd.toObject(e.rawWriteCmd,t),t.oneofs&&(n.msg="rawWriteCmd")),null!=e.rawSubscribeCmd&&e.hasOwnProperty("rawSubscribeCmd")&&(n.rawSubscribeCmd=c.Buttplug.DeviceMessage.RawSubscribeCmd.toObject(e.rawSubscribeCmd,t),t.oneofs&&(n.msg="rawSubscribeCmd")),null!=e.rawUnsubscribeCmd&&e.hasOwnProperty("rawUnsubscribeCmd")&&(n.rawUnsubscribeCmd=c.Buttplug.DeviceMessage.RawUnsubscribeCmd.toObject(e.rawUnsubscribeCmd,t),t.oneofs&&(n.msg="rawUnsubscribeCmd")),null!=e.batteryLevelCmd&&e.hasOwnProperty("batteryLevelCmd")&&(n.batteryLevelCmd=c.Buttplug.DeviceMessage.BatteryLevelCmd.toObject(e.batteryLevelCmd,t),t.oneofs&&(n.msg="batteryLevelCmd")),null!=e.rssiLevelCmd&&e.hasOwnProperty("rssiLevelCmd")&&(n.rssiLevelCmd=c.Buttplug.DeviceMessage.RSSILevelCmd.toObject(e.rssiLevelCmd,t),t.oneofs&&(n.msg="rssiLevelCmd")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e}(),e.ServerMessage=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.ok=null,e.prototype.error=null,e.prototype.scanningFinished=null,e.prototype.deviceAdded=null,e.prototype.deviceRemoved=null,e.prototype.disconnect=null,Object.defineProperty(e.prototype,"msg",{get:a.oneOfGetter(t=["ok","error","scanningFinished","deviceAdded","deviceRemoved","disconnect"]),set:a.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.ok&&Object.hasOwnProperty.call(e,"ok")&&c.Buttplug.ServerMessage.Ok.encode(e.ok,t.uint32(10).fork()).ldelim(),null!=e.error&&Object.hasOwnProperty.call(e,"error")&&c.Buttplug.ServerMessage.Error.encode(e.error,t.uint32(18).fork()).ldelim(),null!=e.scanningFinished&&Object.hasOwnProperty.call(e,"scanningFinished")&&c.Buttplug.ServerMessage.ScanningFinished.encode(e.scanningFinished,t.uint32(26).fork()).ldelim(),null!=e.deviceAdded&&Object.hasOwnProperty.call(e,"deviceAdded")&&c.Buttplug.ServerMessage.DeviceAdded.encode(e.deviceAdded,t.uint32(34).fork()).ldelim(),null!=e.deviceRemoved&&Object.hasOwnProperty.call(e,"deviceRemoved")&&c.Buttplug.ServerMessage.DeviceRemoved.encode(e.deviceRemoved,t.uint32(42).fork()).ldelim(),null!=e.disconnect&&Object.hasOwnProperty.call(e,"disconnect")&&c.Buttplug.ServerMessage.Disconnect.encode(e.disconnect,t.uint32(50).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.ok=c.Buttplug.ServerMessage.Ok.decode(e,e.uint32());break;case 2:r.error=c.Buttplug.ServerMessage.Error.decode(e,e.uint32());break;case 3:r.scanningFinished=c.Buttplug.ServerMessage.ScanningFinished.decode(e,e.uint32());break;case 4:r.deviceAdded=c.Buttplug.ServerMessage.DeviceAdded.decode(e,e.uint32());break;case 5:r.deviceRemoved=c.Buttplug.ServerMessage.DeviceRemoved.decode(e,e.uint32());break;case 6:r.disconnect=c.Buttplug.ServerMessage.Disconnect.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";let t={};if(null!=e.ok&&e.hasOwnProperty("ok")){t.msg=1;{let t=c.Buttplug.ServerMessage.Ok.verify(e.ok);if(t)return"ok."+t}}if(null!=e.error&&e.hasOwnProperty("error")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ServerMessage.Error.verify(e.error);if(t)return"error."+t}}if(null!=e.scanningFinished&&e.hasOwnProperty("scanningFinished")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ServerMessage.ScanningFinished.verify(e.scanningFinished);if(t)return"scanningFinished."+t}}if(null!=e.deviceAdded&&e.hasOwnProperty("deviceAdded")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ServerMessage.DeviceAdded.verify(e.deviceAdded);if(t)return"deviceAdded."+t}}if(null!=e.deviceRemoved&&e.hasOwnProperty("deviceRemoved")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ServerMessage.DeviceRemoved.verify(e.deviceRemoved);if(t)return"deviceRemoved."+t}}if(null!=e.disconnect&&e.hasOwnProperty("disconnect")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.ServerMessage.Disconnect.verify(e.disconnect);if(t)return"disconnect."+t}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.ServerMessage)return e;let t=new c.Buttplug.ServerMessage;if(null!=e.ok){if("object"!=typeof e.ok)throw TypeError(".Buttplug.ServerMessage.ok: object expected");t.ok=c.Buttplug.ServerMessage.Ok.fromObject(e.ok)}if(null!=e.error){if("object"!=typeof e.error)throw TypeError(".Buttplug.ServerMessage.error: object expected");t.error=c.Buttplug.ServerMessage.Error.fromObject(e.error)}if(null!=e.scanningFinished){if("object"!=typeof e.scanningFinished)throw TypeError(".Buttplug.ServerMessage.scanningFinished: object expected");t.scanningFinished=c.Buttplug.ServerMessage.ScanningFinished.fromObject(e.scanningFinished)}if(null!=e.deviceAdded){if("object"!=typeof e.deviceAdded)throw TypeError(".Buttplug.ServerMessage.deviceAdded: object expected");t.deviceAdded=c.Buttplug.ServerMessage.DeviceAdded.fromObject(e.deviceAdded)}if(null!=e.deviceRemoved){if("object"!=typeof e.deviceRemoved)throw TypeError(".Buttplug.ServerMessage.deviceRemoved: object expected");t.deviceRemoved=c.Buttplug.ServerMessage.DeviceRemoved.fromObject(e.deviceRemoved)}if(null!=e.disconnect){if("object"!=typeof e.disconnect)throw TypeError(".Buttplug.ServerMessage.disconnect: object expected");t.disconnect=c.Buttplug.ServerMessage.Disconnect.fromObject(e.disconnect)}return t},e.toObject=function(e,t){t||(t={});let n={};return null!=e.ok&&e.hasOwnProperty("ok")&&(n.ok=c.Buttplug.ServerMessage.Ok.toObject(e.ok,t),t.oneofs&&(n.msg="ok")),null!=e.error&&e.hasOwnProperty("error")&&(n.error=c.Buttplug.ServerMessage.Error.toObject(e.error,t),t.oneofs&&(n.msg="error")),null!=e.scanningFinished&&e.hasOwnProperty("scanningFinished")&&(n.scanningFinished=c.Buttplug.ServerMessage.ScanningFinished.toObject(e.scanningFinished,t),t.oneofs&&(n.msg="scanningFinished")),null!=e.deviceAdded&&e.hasOwnProperty("deviceAdded")&&(n.deviceAdded=c.Buttplug.ServerMessage.DeviceAdded.toObject(e.deviceAdded,t),t.oneofs&&(n.msg="deviceAdded")),null!=e.deviceRemoved&&e.hasOwnProperty("deviceRemoved")&&(n.deviceRemoved=c.Buttplug.ServerMessage.DeviceRemoved.toObject(e.deviceRemoved,t),t.oneofs&&(n.msg="deviceRemoved")),null!=e.disconnect&&e.hasOwnProperty("disconnect")&&(n.disconnect=c.Buttplug.ServerMessage.Disconnect.toObject(e.disconnect,t),t.oneofs&&(n.msg="disconnect")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e.ButtplugErrorType=function(){const e={},t=Object.create(e);return t[e[0]="ButtplugConnectorError"]=0,t[e[1]="ButtplugHandshakeError"]=1,t[e[2]="ButtplugDeviceError"]=2,t[e[3]="ButtplugPingError"]=3,t[e[4]="ButtplugMessageError"]=4,t[e[5]="ButtplugUnknownError"]=5,t}(),e.MessageAttributeType=function(){const e={},t=Object.create(e);return t[e[0]="VibrateCmd"]=0,t[e[1]="RotateCmd"]=1,t[e[2]="LinearCmd"]=2,t[e[3]="StopDeviceCmd"]=3,t[e[4]="RawReadCmd"]=4,t[e[5]="RawWriteCmd"]=5,t[e[6]="RawSubscribeCmd"]=6,t[e[7]="RawUnsubscribeCmd"]=7,t[e[8]="BatteryLevelCmd"]=8,t[e[9]="RSSILevelCmd"]=9,t}(),e.MessageAttributes=function(){function e(e){if(this.stepCount=[],this.endpoints=[],this.maxDuration=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.messageType=0,e.prototype.featureCount=0,e.prototype.stepCount=a.emptyArray,e.prototype.endpoints=a.emptyArray,e.prototype.maxDuration=a.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.messageType&&Object.hasOwnProperty.call(e,"messageType")&&t.uint32(8).int32(e.messageType),null!=e.featureCount&&Object.hasOwnProperty.call(e,"featureCount")&&t.uint32(16).uint32(e.featureCount),null!=e.stepCount&&e.stepCount.length){t.uint32(26).fork();for(let n=0;n<e.stepCount.length;++n)t.uint32(e.stepCount[n]);t.ldelim()}if(null!=e.endpoints&&e.endpoints.length){t.uint32(34).fork();for(let n=0;n<e.endpoints.length;++n)t.int32(e.endpoints[n]);t.ldelim()}if(null!=e.maxDuration&&e.maxDuration.length){t.uint32(42).fork();for(let n=0;n<e.maxDuration.length;++n)t.uint32(e.maxDuration[n]);t.ldelim()}return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage.MessageAttributes;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.messageType=e.int32();break;case 2:r.featureCount=e.uint32();break;case 3:if(r.stepCount&&r.stepCount.length||(r.stepCount=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.stepCount.push(e.uint32())}else r.stepCount.push(e.uint32());break;case 4:if(r.endpoints&&r.endpoints.length||(r.endpoints=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.endpoints.push(e.int32())}else r.endpoints.push(e.int32());break;case 5:if(r.maxDuration&&r.maxDuration.length||(r.maxDuration=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.maxDuration.push(e.uint32())}else r.maxDuration.push(e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.messageType&&e.hasOwnProperty("messageType"))switch(e.messageType){default:return"messageType: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:}if(null!=e.featureCount&&e.hasOwnProperty("featureCount")&&!a.isInteger(e.featureCount))return"featureCount: integer expected";if(null!=e.stepCount&&e.hasOwnProperty("stepCount")){if(!Array.isArray(e.stepCount))return"stepCount: array expected";for(let t=0;t<e.stepCount.length;++t)if(!a.isInteger(e.stepCount[t]))return"stepCount: integer[] expected"}if(null!=e.endpoints&&e.hasOwnProperty("endpoints")){if(!Array.isArray(e.endpoints))return"endpoints: array expected";for(let t=0;t<e.endpoints.length;++t)switch(e.endpoints[t]){default:return"endpoints: enum value[] expected";case 0: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:}}if(null!=e.maxDuration&&e.hasOwnProperty("maxDuration")){if(!Array.isArray(e.maxDuration))return"maxDuration: array expected";for(let t=0;t<e.maxDuration.length;++t)if(!a.isInteger(e.maxDuration[t]))return"maxDuration: integer[] expected"}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.ServerMessage.MessageAttributes)return e;let t=new c.Buttplug.ServerMessage.MessageAttributes;switch(e.messageType){case"VibrateCmd":case 0:t.messageType=0;break;case"RotateCmd":case 1:t.messageType=1;break;case"LinearCmd":case 2:t.messageType=2;break;case"StopDeviceCmd":case 3:t.messageType=3;break;case"RawReadCmd":case 4:t.messageType=4;break;case"RawWriteCmd":case 5:t.messageType=5;break;case"RawSubscribeCmd":case 6:t.messageType=6;break;case"RawUnsubscribeCmd":case 7:t.messageType=7;break;case"BatteryLevelCmd":case 8:t.messageType=8;break;case"RSSILevelCmd":case 9:t.messageType=9}if(null!=e.featureCount&&(t.featureCount=e.featureCount>>>0),e.stepCount){if(!Array.isArray(e.stepCount))throw TypeError(".Buttplug.ServerMessage.MessageAttributes.stepCount: array expected");t.stepCount=[];for(let n=0;n<e.stepCount.length;++n)t.stepCount[n]=e.stepCount[n]>>>0}if(e.endpoints){if(!Array.isArray(e.endpoints))throw TypeError(".Buttplug.ServerMessage.MessageAttributes.endpoints: array expected");t.endpoints=[];for(let n=0;n<e.endpoints.length;++n)switch(e.endpoints[n]){default:case"Command":case 0:t.endpoints[n]=0;break;case"Firmware":case 1:t.endpoints[n]=1;break;case"Rx":case 2:t.endpoints[n]=2;break;case"RxAccel":case 3:t.endpoints[n]=3;break;case"RxBLEBattery":case 4:t.endpoints[n]=4;break;case"RxPressure":case 5:t.endpoints[n]=5;break;case"RxTouch":case 6:t.endpoints[n]=6;break;case"Tx":case 7:t.endpoints[n]=7;break;case"TxMode":case 8:t.endpoints[n]=8;break;case"TxShock":case 9:t.endpoints[n]=9;break;case"TxVibrate":case 10:t.endpoints[n]=10;break;case"TxVendorControl":case 11:t.endpoints[n]=11;break;case"Whitelist":case 12:t.endpoints[n]=12;break;case"Generic0":case 13:t.endpoints[n]=13;break;case"Generic1":case 14:t.endpoints[n]=14;break;case"Generic2":case 15:t.endpoints[n]=15;break;case"Generic3":case 16:t.endpoints[n]=16;break;case"Generic4":case 17:t.endpoints[n]=17;break;case"Generic5":case 18:t.endpoints[n]=18;break;case"Generic6":case 19:t.endpoints[n]=19;break;case"Generic7":case 20:t.endpoints[n]=20;break;case"Generic8":case 21:t.endpoints[n]=21;break;case"Generic9":case 22:t.endpoints[n]=22;break;case"Generic10":case 23:t.endpoints[n]=23;break;case"Generic11":case 24:t.endpoints[n]=24;break;case"Generic12":case 25:t.endpoints[n]=25;break;case"Generic13":case 26:t.endpoints[n]=26;break;case"Generic14":case 27:t.endpoints[n]=27;break;case"Generic15":case 28:t.endpoints[n]=28;break;case"Generic16":case 29:t.endpoints[n]=29;break;case"Generic17":case 30:t.endpoints[n]=30;break;case"Generic18":case 31:t.endpoints[n]=31;break;case"Generic19":case 32:t.endpoints[n]=32;break;case"Generic20":case 33:t.endpoints[n]=33;break;case"Generic21":case 34:t.endpoints[n]=34;break;case"Generic22":case 35:t.endpoints[n]=35;break;case"Generic23":case 36:t.endpoints[n]=36;break;case"Generic24":case 37:t.endpoints[n]=37;break;case"Generic25":case 38:t.endpoints[n]=38;break;case"Generic26":case 39:t.endpoints[n]=39;break;case"Generic27":case 40:t.endpoints[n]=40;break;case"Generic28":case 41:t.endpoints[n]=41;break;case"Generic29":case 42:t.endpoints[n]=42;break;case"Generic30":case 43:t.endpoints[n]=43;break;case"Generic31":case 44:t.endpoints[n]=44;break;case"RxBLEModel":case 45:t.endpoints[n]=45}}if(e.maxDuration){if(!Array.isArray(e.maxDuration))throw TypeError(".Buttplug.ServerMessage.MessageAttributes.maxDuration: array expected");t.maxDuration=[];for(let n=0;n<e.maxDuration.length;++n)t.maxDuration[n]=e.maxDuration[n]>>>0}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.stepCount=[],n.endpoints=[],n.maxDuration=[]),t.defaults&&(n.messageType=t.enums===String?"VibrateCmd":0,n.featureCount=0),null!=e.messageType&&e.hasOwnProperty("messageType")&&(n.messageType=t.enums===String?c.Buttplug.ServerMessage.MessageAttributeType[e.messageType]:e.messageType),null!=e.featureCount&&e.hasOwnProperty("featureCount")&&(n.featureCount=e.featureCount),e.stepCount&&e.stepCount.length){n.stepCount=[];for(let t=0;t<e.stepCount.length;++t)n.stepCount[t]=e.stepCount[t]}if(e.endpoints&&e.endpoints.length){n.endpoints=[];for(let r=0;r<e.endpoints.length;++r)n.endpoints[r]=t.enums===String?c.Buttplug.Endpoint[e.endpoints[r]]:e.endpoints[r]}if(e.maxDuration&&e.maxDuration.length){n.maxDuration=[];for(let t=0;t<e.maxDuration.length;++t)n.maxDuration[t]=e.maxDuration[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.Ok=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage.Ok;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ServerMessage.Ok?e:new c.Buttplug.ServerMessage.Ok},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.Error=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.errorType=0,e.prototype.message="",e.prototype.backtrace="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.errorType&&Object.hasOwnProperty.call(e,"errorType")&&t.uint32(8).int32(e.errorType),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&t.uint32(18).string(e.message),null!=e.backtrace&&Object.hasOwnProperty.call(e,"backtrace")&&t.uint32(26).string(e.backtrace),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage.Error;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.errorType=e.int32();break;case 2:r.message=e.string();break;case 3:r.backtrace=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.errorType&&e.hasOwnProperty("errorType"))switch(e.errorType){default:return"errorType: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:}return null!=e.message&&e.hasOwnProperty("message")&&!a.isString(e.message)?"message: string expected":null!=e.backtrace&&e.hasOwnProperty("backtrace")&&!a.isString(e.backtrace)?"backtrace: string expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.ServerMessage.Error)return e;let t=new c.Buttplug.ServerMessage.Error;switch(e.errorType){case"ButtplugConnectorError":case 0:t.errorType=0;break;case"ButtplugHandshakeError":case 1:t.errorType=1;break;case"ButtplugDeviceError":case 2:t.errorType=2;break;case"ButtplugPingError":case 3:t.errorType=3;break;case"ButtplugMessageError":case 4:t.errorType=4;break;case"ButtplugUnknownError":case 5:t.errorType=5}return null!=e.message&&(t.message=String(e.message)),null!=e.backtrace&&(t.backtrace=String(e.backtrace)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.errorType=t.enums===String?"ButtplugConnectorError":0,n.message="",n.backtrace=""),null!=e.errorType&&e.hasOwnProperty("errorType")&&(n.errorType=t.enums===String?c.Buttplug.ServerMessage.ButtplugErrorType[e.errorType]:e.errorType),null!=e.message&&e.hasOwnProperty("message")&&(n.message=e.message),null!=e.backtrace&&e.hasOwnProperty("backtrace")&&(n.backtrace=e.backtrace),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.ScanningFinished=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage.ScanningFinished;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ServerMessage.ScanningFinished?e:new c.Buttplug.ServerMessage.ScanningFinished},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.DeviceAdded=function(){function e(e){if(this.messageAttributes=[],e)for(let 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.index=0,e.prototype.messageAttributes=a.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(16).uint32(e.index),null!=e.messageAttributes&&e.messageAttributes.length)for(let n=0;n<e.messageAttributes.length;++n)c.Buttplug.ServerMessage.MessageAttributes.encode(e.messageAttributes[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage.DeviceAdded;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.name=e.string();break;case 2:r.index=e.uint32();break;case 3:r.messageAttributes&&r.messageAttributes.length||(r.messageAttributes=[]),r.messageAttributes.push(c.Buttplug.ServerMessage.MessageAttributes.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index))return"index: integer expected";if(null!=e.messageAttributes&&e.hasOwnProperty("messageAttributes")){if(!Array.isArray(e.messageAttributes))return"messageAttributes: array expected";for(let t=0;t<e.messageAttributes.length;++t){let n=c.Buttplug.ServerMessage.MessageAttributes.verify(e.messageAttributes[t]);if(n)return"messageAttributes."+n}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.ServerMessage.DeviceAdded)return e;let t=new c.Buttplug.ServerMessage.DeviceAdded;if(null!=e.name&&(t.name=String(e.name)),null!=e.index&&(t.index=e.index>>>0),e.messageAttributes){if(!Array.isArray(e.messageAttributes))throw TypeError(".Buttplug.ServerMessage.DeviceAdded.messageAttributes: array expected");t.messageAttributes=[];for(let n=0;n<e.messageAttributes.length;++n){if("object"!=typeof e.messageAttributes[n])throw TypeError(".Buttplug.ServerMessage.DeviceAdded.messageAttributes: object expected");t.messageAttributes[n]=c.Buttplug.ServerMessage.MessageAttributes.fromObject(e.messageAttributes[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.messageAttributes=[]),t.defaults&&(n.name="",n.index=0),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),e.messageAttributes&&e.messageAttributes.length){n.messageAttributes=[];for(let r=0;r<e.messageAttributes.length;++r)n.messageAttributes[r]=c.Buttplug.ServerMessage.MessageAttributes.toObject(e.messageAttributes[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.DeviceRemoved=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage.DeviceRemoved;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index)?"index: integer expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.ServerMessage.DeviceRemoved)return e;let t=new c.Buttplug.ServerMessage.DeviceRemoved;return null!=e.index&&(t.index=e.index>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.Disconnect=function(){function e(e){if(e)for(let 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=o.create()),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ServerMessage.Disconnect;for(;e.pos<n;){let t=e.uint32();e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},e.fromObject=function(e){return e instanceof c.Buttplug.ServerMessage.Disconnect?e:new c.Buttplug.ServerMessage.Disconnect},e.toObject=function(){return{}},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e}(),e.DeviceEvent=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.disconnect=null,e.prototype.batteryLevelReading=null,e.prototype.rssiLevelReading=null,e.prototype.rawReading=null,Object.defineProperty(e.prototype,"msg",{get:a.oneOfGetter(t=["disconnect","batteryLevelReading","rssiLevelReading","rawReading"]),set:a.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.disconnect&&Object.hasOwnProperty.call(e,"disconnect")&&c.Buttplug.DeviceEvent.Disconnect.encode(e.disconnect,t.uint32(10).fork()).ldelim(),null!=e.batteryLevelReading&&Object.hasOwnProperty.call(e,"batteryLevelReading")&&c.Buttplug.DeviceEvent.BatteryLevelReading.encode(e.batteryLevelReading,t.uint32(18).fork()).ldelim(),null!=e.rssiLevelReading&&Object.hasOwnProperty.call(e,"rssiLevelReading")&&c.Buttplug.DeviceEvent.RSSILevelReading.encode(e.rssiLevelReading,t.uint32(26).fork()).ldelim(),null!=e.rawReading&&Object.hasOwnProperty.call(e,"rawReading")&&c.Buttplug.DeviceEvent.RawReading.encode(e.rawReading,t.uint32(34).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceEvent;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.disconnect=c.Buttplug.DeviceEvent.Disconnect.decode(e,e.uint32());break;case 2:r.batteryLevelReading=c.Buttplug.DeviceEvent.BatteryLevelReading.decode(e,e.uint32());break;case 3:r.rssiLevelReading=c.Buttplug.DeviceEvent.RSSILevelReading.decode(e,e.uint32());break;case 4:r.rawReading=c.Buttplug.DeviceEvent.RawReading.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";let t={};if(null!=e.disconnect&&e.hasOwnProperty("disconnect")){t.msg=1;{let t=c.Buttplug.DeviceEvent.Disconnect.verify(e.disconnect);if(t)return"disconnect."+t}}if(null!=e.batteryLevelReading&&e.hasOwnProperty("batteryLevelReading")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceEvent.BatteryLevelReading.verify(e.batteryLevelReading);if(t)return"batteryLevelReading."+t}}if(null!=e.rssiLevelReading&&e.hasOwnProperty("rssiLevelReading")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceEvent.RSSILevelReading.verify(e.rssiLevelReading);if(t)return"rssiLevelReading."+t}}if(null!=e.rawReading&&e.hasOwnProperty("rawReading")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceEvent.RawReading.verify(e.rawReading);if(t)return"rawReading."+t}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceEvent)return e;let t=new c.Buttplug.DeviceEvent;if(null!=e.disconnect){if("object"!=typeof e.disconnect)throw TypeError(".Buttplug.DeviceEvent.disconnect: object expected");t.disconnect=c.Buttplug.DeviceEvent.Disconnect.fromObject(e.disconnect)}if(null!=e.batteryLevelReading){if("object"!=typeof e.batteryLevelReading)throw TypeError(".Buttplug.DeviceEvent.batteryLevelReading: object expected");t.batteryLevelReading=c.Buttplug.DeviceEvent.BatteryLevelReading.fromObject(e.batteryLevelReading)}if(null!=e.rssiLevelReading){if("object"!=typeof e.rssiLevelReading)throw TypeError(".Buttplug.DeviceEvent.rssiLevelReading: object expected");t.rssiLevelReading=c.Buttplug.DeviceEvent.RSSILevelReading.fromObject(e.rssiLevelReading)}if(null!=e.rawReading){if("object"!=typeof e.rawReading)throw TypeError(".Buttplug.DeviceEvent.rawReading: object expected");t.rawReading=c.Buttplug.DeviceEvent.RawReading.fromObject(e.rawReading)}return t},e.toObject=function(e,t){t||(t={});let n={};return null!=e.disconnect&&e.hasOwnProperty("disconnect")&&(n.disconnect=c.Buttplug.DeviceEvent.Disconnect.toObject(e.disconnect,t),t.oneofs&&(n.msg="disconnect")),null!=e.batteryLevelReading&&e.hasOwnProperty("batteryLevelReading")&&(n.batteryLevelReading=c.Buttplug.DeviceEvent.BatteryLevelReading.toObject(e.batteryLevelReading,t),t.oneofs&&(n.msg="batteryLevelReading")),null!=e.rssiLevelReading&&e.hasOwnProperty("rssiLevelReading")&&(n.rssiLevelReading=c.Buttplug.DeviceEvent.RSSILevelReading.toObject(e.rssiLevelReading,t),t.oneofs&&(n.msg="rssiLevelReading")),null!=e.rawReading&&e.hasOwnProperty("rawReading")&&(n.rawReading=c.Buttplug.DeviceEvent.RawReading.toObject(e.rawReading,t),t.oneofs&&(n.msg="rawReading")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e.Disconnect=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceEvent.Disconnect;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index)?"index: integer expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceEvent.Disconnect)return e;let t=new c.Buttplug.DeviceEvent.Disconnect;return null!=e.index&&(t.index=e.index>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RawReading=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.prototype.endpoint=0,e.prototype.data=a.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),null!=e.endpoint&&Object.hasOwnProperty.call(e,"endpoint")&&t.uint32(16).int32(e.endpoint),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).bytes(e.data),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceEvent.RawReading;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;case 2:r.endpoint=e.int32();break;case 3:r.data=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index))return"index: integer expected";if(null!=e.endpoint&&e.hasOwnProperty("endpoint"))switch(e.endpoint){default:return"endpoint: enum value expected";case 0: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:}return null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||a.isString(e.data))?"data: buffer expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceEvent.RawReading)return e;let t=new c.Buttplug.DeviceEvent.RawReading;switch(null!=e.index&&(t.index=e.index>>>0),e.endpoint){case"Command":case 0:t.endpoint=0;break;case"Firmware":case 1:t.endpoint=1;break;case"Rx":case 2:t.endpoint=2;break;case"RxAccel":case 3:t.endpoint=3;break;case"RxBLEBattery":case 4:t.endpoint=4;break;case"RxPressure":case 5:t.endpoint=5;break;case"RxTouch":case 6:t.endpoint=6;break;case"Tx":case 7:t.endpoint=7;break;case"TxMode":case 8:t.endpoint=8;break;case"TxShock":case 9:t.endpoint=9;break;case"TxVibrate":case 10:t.endpoint=10;break;case"TxVendorControl":case 11:t.endpoint=11;break;case"Whitelist":case 12:t.endpoint=12;break;case"Generic0":case 13:t.endpoint=13;break;case"Generic1":case 14:t.endpoint=14;break;case"Generic2":case 15:t.endpoint=15;break;case"Generic3":case 16:t.endpoint=16;break;case"Generic4":case 17:t.endpoint=17;break;case"Generic5":case 18:t.endpoint=18;break;case"Generic6":case 19:t.endpoint=19;break;case"Generic7":case 20:t.endpoint=20;break;case"Generic8":case 21:t.endpoint=21;break;case"Generic9":case 22:t.endpoint=22;break;case"Generic10":case 23:t.endpoint=23;break;case"Generic11":case 24:t.endpoint=24;break;case"Generic12":case 25:t.endpoint=25;break;case"Generic13":case 26:t.endpoint=26;break;case"Generic14":case 27:t.endpoint=27;break;case"Generic15":case 28:t.endpoint=28;break;case"Generic16":case 29:t.endpoint=29;break;case"Generic17":case 30:t.endpoint=30;break;case"Generic18":case 31:t.endpoint=31;break;case"Generic19":case 32:t.endpoint=32;break;case"Generic20":case 33:t.endpoint=33;break;case"Generic21":case 34:t.endpoint=34;break;case"Generic22":case 35:t.endpoint=35;break;case"Generic23":case 36:t.endpoint=36;break;case"Generic24":case 37:t.endpoint=37;break;case"Generic25":case 38:t.endpoint=38;break;case"Generic26":case 39:t.endpoint=39;break;case"Generic27":case 40:t.endpoint=40;break;case"Generic28":case 41:t.endpoint=41;break;case"Generic29":case 42:t.endpoint=42;break;case"Generic30":case 43:t.endpoint=43;break;case"Generic31":case 44:t.endpoint=44;break;case"RxBLEModel":case 45:t.endpoint=45}return null!=e.data&&("string"==typeof e.data?a.base64.decode(e.data,t.data=a.newBuffer(a.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0,n.endpoint=t.enums===String?"Command":0,t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=a.newBuffer(n.data)))),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),null!=e.endpoint&&e.hasOwnProperty("endpoint")&&(n.endpoint=t.enums===String?c.Buttplug.Endpoint[e.endpoint]:e.endpoint),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?a.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.BatteryLevelReading=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.prototype.reading=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),null!=e.reading&&Object.hasOwnProperty.call(e,"reading")&&t.uint32(17).double(e.reading),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceEvent.BatteryLevelReading;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;case 2:r.reading=e.double();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index)?"index: integer expected":null!=e.reading&&e.hasOwnProperty("reading")&&"number"!=typeof e.reading?"reading: number expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceEvent.BatteryLevelReading)return e;let t=new c.Buttplug.DeviceEvent.BatteryLevelReading;return null!=e.index&&(t.index=e.index>>>0),null!=e.reading&&(t.reading=Number(e.reading)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0,n.reading=0),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),null!=e.reading&&e.hasOwnProperty("reading")&&(n.reading=t.json&&!isFinite(e.reading)?String(e.reading):e.reading),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e.RSSILevelReading=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index=0,e.prototype.reading=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&t.uint32(8).uint32(e.index),null!=e.reading&&Object.hasOwnProperty.call(e,"reading")&&t.uint32(16).int32(e.reading),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.DeviceEvent.RSSILevelReading;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.index=e.uint32();break;case 2:r.reading=e.int32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.index&&e.hasOwnProperty("index")&&!a.isInteger(e.index)?"index: integer expected":null!=e.reading&&e.hasOwnProperty("reading")&&!a.isInteger(e.reading)?"reading: integer expected":null},e.fromObject=function(e){if(e instanceof c.Buttplug.DeviceEvent.RSSILevelReading)return e;let t=new c.Buttplug.DeviceEvent.RSSILevelReading;return null!=e.index&&(t.index=e.index>>>0),null!=e.reading&&(t.reading=0|e.reading),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.index=0,n.reading=0),null!=e.index&&e.hasOwnProperty("index")&&(n.index=e.index),null!=e.reading&&e.hasOwnProperty("reading")&&(n.reading=e.reading),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e}(),e.ButtplugFFIServerMessage=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id=0,e.prototype.message=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(8).uint32(e.id),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&c.Buttplug.ButtplugFFIServerMessage.FFIMessage.encode(e.message,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ButtplugFFIServerMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.uint32();break;case 2:r.message=c.Buttplug.ButtplugFFIServerMessage.FFIMessage.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!a.isInteger(e.id))return"id: integer expected";if(null!=e.message&&e.hasOwnProperty("message")){let t=c.Buttplug.ButtplugFFIServerMessage.FFIMessage.verify(e.message);if(t)return"message."+t}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.ButtplugFFIServerMessage)return e;let t=new c.Buttplug.ButtplugFFIServerMessage;if(null!=e.id&&(t.id=e.id>>>0),null!=e.message){if("object"!=typeof e.message)throw TypeError(".Buttplug.ButtplugFFIServerMessage.message: object expected");t.message=c.Buttplug.ButtplugFFIServerMessage.FFIMessage.fromObject(e.message)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id=0,n.message=null),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.message&&e.hasOwnProperty("message")&&(n.message=c.Buttplug.ButtplugFFIServerMessage.FFIMessage.toObject(e.message,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e.FFIMessage=function(){function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}let t;return e.prototype.serverMessage=null,e.prototype.deviceEvent=null,Object.defineProperty(e.prototype,"msg",{get:a.oneOfGetter(t=["serverMessage","deviceEvent"]),set:a.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=o.create()),null!=e.serverMessage&&Object.hasOwnProperty.call(e,"serverMessage")&&c.Buttplug.ServerMessage.encode(e.serverMessage,t.uint32(10).fork()).ldelim(),null!=e.deviceEvent&&Object.hasOwnProperty.call(e,"deviceEvent")&&c.Buttplug.DeviceEvent.encode(e.deviceEvent,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));let n=void 0===t?e.len:e.pos+t,r=new c.Buttplug.ButtplugFFIServerMessage.FFIMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.serverMessage=c.Buttplug.ServerMessage.decode(e,e.uint32());break;case 2:r.deviceEvent=c.Buttplug.DeviceEvent.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";let t={};if(null!=e.serverMessage&&e.hasOwnProperty("serverMessage")){t.msg=1;{let t=c.Buttplug.ServerMessage.verify(e.serverMessage);if(t)return"serverMessage."+t}}if(null!=e.deviceEvent&&e.hasOwnProperty("deviceEvent")){if(1===t.msg)return"msg: multiple values";t.msg=1;{let t=c.Buttplug.DeviceEvent.verify(e.deviceEvent);if(t)return"deviceEvent."+t}}return null},e.fromObject=function(e){if(e instanceof c.Buttplug.ButtplugFFIServerMessage.FFIMessage)return e;let t=new c.Buttplug.ButtplugFFIServerMessage.FFIMessage;if(null!=e.serverMessage){if("object"!=typeof e.serverMessage)throw TypeError(".Buttplug.ButtplugFFIServerMessage.FFIMessage.serverMessage: object expected");t.serverMessage=c.Buttplug.ServerMessage.fromObject(e.serverMessage)}if(null!=e.deviceEvent){if("object"!=typeof e.deviceEvent)throw TypeError(".Buttplug.ButtplugFFIServerMessage.FFIMessage.deviceEvent: object expected");t.deviceEvent=c.Buttplug.DeviceEvent.fromObject(e.deviceEvent)}return t},e.toObject=function(e,t){t||(t={});let n={};return null!=e.serverMessage&&e.hasOwnProperty("serverMessage")&&(n.serverMessage=c.Buttplug.ServerMessage.toObject(e.serverMessage,t),t.oneofs&&(n.msg="serverMessage")),null!=e.deviceEvent&&e.hasOwnProperty("deviceEvent")&&(n.deviceEvent=c.Buttplug.DeviceEvent.toObject(e.deviceEvent,t),t.oneofs&&(n.msg="deviceEvent")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.a.util.toJSONOptions)},e}(),e}(),e})()},function(e,t,n){"use strict";e.exports=n(8)},function(e,t,n){"use strict";(function(e){n.d(t,"c",(function(){return g})),n.d(t,"d",(function(){return b})),n.d(t,"e",(function(){return m})),n.d(t,"h",(function(){return v})),n.d(t,"r",(function(){return y})),n.d(t,"u",(function(){return w})),n.d(t,"s",(function(){return O})),n.d(t,"v",(function(){return k})),n.d(t,"p",(function(){return x})),n.d(t,"k",(function(){return _})),n.d(t,"t",(function(){return M})),n.d(t,"b",(function(){return B})),n.d(t,"q",(function(){return j})),n.d(t,"l",(function(){return S})),n.d(t,"o",(function(){return D})),n.d(t,"m",(function(){return R})),n.d(t,"n",(function(){return P})),n.d(t,"f",(function(){return A})),n.d(t,"g",(function(){return E})),n.d(t,"i",(function(){return L})),n.d(t,"j",(function(){return T})),n.d(t,"a",(function(){return G}));var r=n(0);function i(e){throw new Error("Must run buttplugInit() async before calling any Buttplug methods!")}function s(e,t,n,r){throw new Error("Must run buttplugInit() async before calling any Buttplug methods!")}let o=function(e,t,n){throw new Error("Must run buttplugInit() async before calling any Buttplug methods!")},a=i,c=s,u=i,l=i,d=function(e,t){throw new Error("Must run buttplugInit() async before calling any Buttplug methods!")},p=s,f=!1;async function g(){if(f)return void console.log("buttplugInit function has already run successfully. This only needs to be run once, but doesn't affect anything (other than printing this message) if called again.");let e=await n.e(1).then(n.bind(null,27)).catch(e=>(console.log(e),Promise.reject(e)));o=e.buttplug_create_protobuf_client,a=e.buttplug_free_client,c=e.buttplug_client_protobuf_message,u=e.buttplug_activate_env_logger,l=e.buttplug_free_device,d=e.buttplug_create_device,p=e.buttplug_device_protobuf_message,f=!0}function h(t,n,i,s){let o=t.PrepareOutgoingMessage(i),a=e.from(r.a.ClientMessage.encode(i).finish());return c(n,a,s,0),o}function b(e,t,n,i){return h(e,t,r.a.ClientMessage.create({message:r.a.ClientMessage.FFIMessage.create({connectLocal:r.a.ClientMessage.ConnectLocal.create({serverName:n.ServerName,allowRawMessages:n.AllowRawMessages,deviceConfigurationJson:n.DeviceConfigJSON,userDeviceConfigurationJson:n.UserDeviceConfigJSON,commManagerTypes:n.DeviceCommunicationManagerTypes,maxPingTime:n.MaxPingTime})}),id:1}),i)}function m(e,t,n,i){return h(e,t,r.a.ClientMessage.create({message:r.a.ClientMessage.FFIMessage.create({connectWebsocket:r.a.ClientMessage.ConnectWebsocket.create({address:n.Address})}),id:1}),i)}function v(e,t,n){return h(e,t,r.a.ClientMessage.create({message:r.a.ClientMessage.FFIMessage.create({disconnect:r.a.ClientMessage.Disconnect.create({})})}),n)}function y(e,t,n){return h(e,t,r.a.ClientMessage.create({message:r.a.ClientMessage.FFIMessage.create({startScanning:r.a.ClientMessage.StartScanning.create({})}),id:1}),n)}function w(e,t,n){return h(e,t,r.a.ClientMessage.create({message:r.a.ClientMessage.FFIMessage.create({stopScanning:r.a.ClientMessage.StopScanning.create({})}),id:1}),n)}function O(e,t,n){return h(e,t,r.a.ClientMessage.create({message:r.a.ClientMessage.FFIMessage.create({stopAllDevices:r.a.ClientMessage.StopAllDevices.create({})}),id:1}),n)}function C(t,n,i,s){let o=t.PrepareOutgoingMessage(i),a=e.from(r.a.DeviceMessage.encode(i).finish());return p(n,a,s,0),o}function k(e,t,n,i){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({vibrateCmd:r.a.DeviceMessage.VibrateCmd.create({speeds:n})}),id:1}),i)}function x(e,t,n,i){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({rotateCmd:r.a.DeviceMessage.RotateCmd.create({rotations:n})}),id:1}),i)}function _(e,t,n,i){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({linearCmd:r.a.DeviceMessage.LinearCmd.create({movements:n})}),id:1}),i)}function M(e,t,n){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({stopDeviceCmd:r.a.DeviceMessage.StopDeviceCmd.create({})}),id:1}),n)}function B(e,t,n){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({batteryLevelCmd:r.a.DeviceMessage.BatteryLevelCmd.create({})}),id:1}),n)}function j(e,t,n){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({rssiLevelCmd:r.a.DeviceMessage.RSSILevelCmd.create({})}),id:1}),n)}function S(e,t,n,i,s,o){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({rawReadCmd:r.a.DeviceMessage.RawReadCmd.create({endpoint:n,expectedLength:i,timeout:s})}),id:1}),o)}function D(e,t,n,i,s,o){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({rawWriteCmd:r.a.DeviceMessage.RawWriteCmd.create({endpoint:n,data:i,writeWithResponse:s})}),id:1}),o)}function R(e,t,n,i){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({rawSubscribeCmd:r.a.DeviceMessage.RawSubscribeCmd.create({endpoint:n})}),id:1}),i)}function P(e,t,n,i){return C(e,t,r.a.DeviceMessage.create({message:r.a.DeviceMessage.FFIMessage.create({rawUnsubscribeCmd:r.a.DeviceMessage.RawUnsubscribeCmd.create({endpoint:n})}),id:1}),i)}function A(e,t){return o(t,e,0)}function E(e,t){return d(e,t)}function L(e){a(e)}function T(e){l(e)}function G(e){u(e)}}).call(this,n(22).Buffer)},function(e,t,n){"use strict";(function(e){var r=t;function i(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)void 0!==e[r[i]]&&n||(e[r[i]]=t[r[i]]);return e}function s(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&i(this,n)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}r.asPromise=n(9),r.base64=n(10),r.EventEmitter=n(11),r.float=n(12),r.inquire=n(13),r.utf8=n(14),r.pool=n(15),r.LongBits=n(16),r.isNode=Boolean(void 0!==e&&e&&e.process&&e.process.versions&&e.process.versions.node),r.global=r.isNode&&e||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.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)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=i,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=s,r.ProtocolError=s("ProtocolError"),r.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]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}}).call(this,n(5))},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,s=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}m(e,t,s,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,n)}(e,i,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,s,o,a;if(u(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=l(e))>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,a=c,console&&console.warn&&console.warn(a)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=p.bind(r);return i.listener=n,r.wrapFn=i,i}function g(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):b(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function b(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function m(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(s){r.once&&e.removeEventListener(t,i),n(s)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)s(c,this,t);else{var u=c.length,l=b(c,u);for(n=0;n<u;++n)s(l[n],this,t)}return!0},a.prototype.addListener=function(e,t){return d(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return d(this,e,t,!0)},a.prototype.once=function(e,t){return u(t),this.on(e,f(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,f(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,i,s,o;if(u(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return g(this,e,!0)},a.prototype.rawListeners=function(e){return g(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},a.prototype.listenerCount=h,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";e.exports=d;var r,i=n(3),s=i.LongBits,o=i.base64,a=i.utf8;function c(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function u(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};function f(e,t,n){t[n]=255&e}function g(e,t){this.len=e,this.next=void 0,this.val=t}function h(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 b(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}d.create=p(),d.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(e,t,n){return this.tail=this.tail.next=new c(e,t,n),this.len+=t,this},g.prototype=Object.create(c.prototype),g.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new g((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(h,10,s.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=s.from(e);return this._push(h,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(h,t.length(),t)},d.prototype.bool=function(e){return this._push(f,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(b,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=s.from(e);return this._push(b,4,t.lo)._push(b,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var m=i.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]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(i.isString(e)){var n=d.alloc(t=o.length(e));o.decode(e,n,0),e=n}return this.uint32(t)._push(m,t,e)},d.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(f,1,0)},d.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.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(u,0,0),this.len=0),this},d.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},d.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},d._configure=function(e){r=e,d.create=p(),r._configure()}},function(e,t,n){"use strict";e.exports=c;var r,i=n(3),s=i.LongBits,o=i.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 u,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")},d=function(){return i.Buffer?function(e){return(c.create=function(e){return i.Buffer.isBuffer(e)?new r(e):l(e)})(e)}:l};function p(){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 f(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function g(){if(this.pos+8>this.len)throw a(this,8);return new s(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}c.create=d(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),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 f(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|f(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=i.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=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},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){r=e,c.create=d(),r._configure();var t=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return g.call(this)[t](!0)},sfixed64:function(){return g.call(this)[t](!1)}})}},function(e,t,n){"use strict";var r=t;function i(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(6),r.BufferWriter=n(17),r.Reader=n(7),r.BufferReader=n(18),r.util=n(3),r.rpc=n(19),r.roots=n(21),r.configure=i,i()},function(e,t,n){"use strict";e.exports=function(e,t){var n=new Array(arguments.length-1),r=0,i=2,s=!0;for(;i<arguments.length;)n[r++]=arguments[i++];return new Promise((function(i,o){n[r]=function(e){if(s)if(s=!1,e)o(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){s&&(s=!1,o(e))}}))}},function(e,t,n){"use strict";var r=t;r.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 i=new Array(64),s=new Array(123),o=0;o<64;)s[i[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;r.encode=function(e,t,n){for(var r,s=null,o=[],a=0,c=0;t<n;){var u=e[t++];switch(c){case 0:o[a++]=i[u>>2],r=(3&u)<<4,c=1;break;case 1:o[a++]=i[r|u>>4],r=(15&u)<<2,c=2;break;case 2:o[a++]=i[r|u>>6],o[a++]=i[63&u],c=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0)}return c&&(o[a++]=i[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))};r.decode=function(e,t,n){for(var r,i=n,o=0,a=0;a<e.length;){var c=e.charCodeAt(a++);if(61===c&&o>1)break;if(void 0===(c=s[c]))throw Error("invalid encoding");switch(o){case 0:r=c,o=1;break;case 1:t[n++]=r<<2|(48&c)>>4,r=c,o=2;break;case 2:t[n++]=(15&r)<<4|(60&c)>>2,r=c,o=3;break;case 3:t[n++]=(3&r)<<6|c,o=0}}if(1===o)throw Error("invalid encoding");return n-i},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},function(e,t,n){"use strict";function r(){this._listeners={}}e.exports=r,r.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},r.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},r.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}},function(e,t,n){"use strict";function r(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function s(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}function o(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 a(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?i:s,e.writeFloatBE=r?s:i,e.readFloatLE=r?o:a,e.readFloatBE=r?a:o}():function(){function t(e,t,n,r){var i=t<0?1:0;if(i&&(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((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(t)/Math.LN2);e((i<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,n,r)}}function n(e,t,n){var r=e(t,n),i=2*(r>>31)+1,s=r>>>23&255,o=8388607&r;return 255===s?o?NaN:i*(1/0):0===s?1401298464324817e-60*i*o:i*Math.pow(2,s-150)*(o+8388608)}e.writeFloatLE=t.bind(null,i),e.writeFloatBE=t.bind(null,s),e.readFloatLE=n.bind(null,o),e.readFloatBE=n.bind(null,a)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function s(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}function o(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 a(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?i:s,e.writeDoubleBE=r?s:i,e.readDoubleLE=r?o:a,e.readDoubleBE=r?a:o}():function(){function t(e,t,n,r,i,s){var o=r<0?1:0;if(o&&(r=-r),0===r)e(0,i,s+t),e(1/r>0?0:2147483648,i,s+n);else if(isNaN(r))e(0,i,s+t),e(2146959360,i,s+n);else if(r>17976931348623157e292)e(0,i,s+t),e((o<<31|2146435072)>>>0,i,s+n);else{var a;if(r<22250738585072014e-324)e((a=r/5e-324)>>>0,i,s+t),e((o<<31|a/4294967296)>>>0,i,s+n);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=r*Math.pow(2,-c))>>>0,i,s+t),e((o<<31|c+1023<<20|1048576*a&1048575)>>>0,i,s+n)}}}function n(e,t,n,r,i){var s=e(r,i+t),o=e(r,i+n),a=2*(o>>31)+1,c=o>>>20&2047,u=4294967296*(1048575&o)+s;return 2047===c?u?NaN:a*(1/0):0===c?5e-324*a*u:a*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,i,0,4),e.writeDoubleBE=t.bind(null,s,4,0),e.readDoubleLE=n.bind(null,o,0,4),e.readDoubleBE=n.bind(null,a,4,0)}(),e}function i(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 s(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 o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function a(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=r(r)},function(module,exports,__webpack_require__){"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},function(e,t,n){"use strict";var r=t;r.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},r.read=function(e,t,n){if(n-t<1)return"";for(var r,i=null,s=[],o=0;t<n;)(r=e[t++])<128?s[o++]=r:r>191&&r<224?s[o++]=(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,s[o++]=55296+(r>>10),s[o++]=56320+(1023&r)):s[o++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i?(o&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))},r.write=function(e,t,n){for(var r,i,s=n,o=0;o<e.length;++o)(r=e.charCodeAt(o))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=e.charCodeAt(o+1)))?(r=65536+((1023&r)<<10)+(1023&i),++o,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-s}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r=n||8192,i=r>>>1,s=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(s=e(r),o=0);var a=t.call(s,o,o+=n);return 7&o&&(o=1+(7|o)),a}}},function(e,t,n){"use strict";e.exports=i;var r=n(3);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=i.zero=new i(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var o=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new i(n,r)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(r.isString(e)){if(!r.Long)return i.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):s},i.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},i.prototype.toLong=function(e){return r.Long?new r.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;i.fromHash=function(e){return e===o?s:new i((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)},i.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)},i.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},i.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},i.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}},function(e,t,n){"use strict";e.exports=s;var r=n(6);(s.prototype=Object.create(r.prototype)).constructor=s;var i=n(3);function s(){r.call(this)}function o(e,t,n){e.length<40?i.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}s._configure=function(){s.alloc=i._Buffer_allocUnsafe,s.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.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++]}},s.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},s._configure()},function(e,t,n){"use strict";e.exports=s;var r=n(7);(s.prototype=Object.create(r.prototype)).constructor=s;var i=n(3);function s(e){r.call(this,e)}s._configure=function(){i.Buffer&&(s.prototype._slice=i.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()},function(e,t,n){"use strict";t.Service=n(20)},function(e,t,n){"use strict";e.exports=i;var r=n(3);function i(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(i.prototype=Object.create(r.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,n,i,s,o){if(!s)throw TypeError("request must be specified");var a=this;if(!o)return r.asPromise(e,a,t,n,i,s);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(e,n){if(e)return a.emit("error",e,t),o(e);if(null!==n){if(!(n instanceof i))try{n=i[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),o(e)}return a.emit("data",n,t),o(null,n)}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)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},function(e,t,n){"use strict";e.exports={}},function(e,t,n){"use strict";(function(e){
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|