'use strict'
!(function(require, directRequire) {
  'use strict'
  function a(a) {
    return k.ResponseType[a] || k.ClientRequestType[a] || '<unknown>'
  }
  function b(a) {
    return a === k.RequestType.Login
      ? k.RequestCmd.Login
      : a === k.RequestType.EventNotifyBegin
        ? k.RequestCmd.EventNotifyBegin
        : a === k.RequestType.EventNotifyBlock
          ? k.RequestCmd.EventNotifyBlock
          : a === k.RequestType.EventNotifyEnd
            ? k.RequestCmd.EventNotifyEnd
            : a === k.RequestType.Heartbeat
              ? k.RequestCmd.Heartbeat
              : a === k.RequestType.JoinRoom
                ? k.RequestCmd.JoinRoom
                : a === k.RequestType.MessageNotifyParallelly
                  ? k.RequestCmd.MessageNotifyParallelly
                  : a === k.RequestType.MessageNotify
                    ? k.RequestCmd.MessageNotify
                    : a === k.RequestType.QuitRoom
                      ? k.RequestCmd.QuitRoom
                      : a === k.RequestType.SendDebugMessage
                        ? k.RequestCmd.SendDebugMessage
                        : a === k.RequestType.SyncMessage
                          ? k.RequestCmd.SyncMessage
                          : a === k.RequestType.SendDebugMessageParallelly
                            ? k.RequestCmd.SendDebugMessageParallelly
                            : k.RequestCmd.Unknown
  }
  function c(a) {
    return a === k.ClientResponseType.Login
      ? k.ClientRequestCmd.Login
      : a === k.ClientResponseType.EventNotifyBegin
        ? k.ClientRequestCmd.EventNotifyBegin
        : a === k.ClientResponseType.EventNotifyBlock
          ? k.ClientRequestCmd.EventNotifyBlock
          : a === k.ClientResponseType.EventNotifyEnd
            ? k.ClientRequestCmd.EventNotifyEnd
            : a === k.ClientResponseType.Heartbeat
              ? k.ClientRequestCmd.Heartbeat
              : a === k.ClientResponseType.JoinRoom
                ? k.ClientRequestCmd.JoinRoom
                : a === k.ClientResponseType.MessageNotifyParallelly
                  ? k.ClientRequestCmd.MessageNotifyParallelly
                  : a === k.ClientResponseType.MessageNotify
                    ? k.ClientRequestCmd.MessageNotify
                    : a === k.ClientResponseType.QuitRoom
                      ? k.ClientRequestCmd.QuitRoom
                      : a === k.ClientResponseType.SendDebugMessage
                        ? k.ClientRequestCmd.SendDebugMessage
                        : a === k.ClientResponseType.SyncMessage
                          ? k.ClientRequestCmd.SyncMessage
                          : a ===
                            k.ClientResponseType.SendDebugMessageParallelly
                            ? k.ClientRequestCmd.SendDebugMessageParallelly
                            : k.ClientRequestCmd.Unknown
  }
  function d(a, b, c = 0) {
    let d = null
    switch (b) {
      case k.DebugMessageCategory.CallInterface: {
        const b = a,
          c = {
            objName: b.name,
            methodName: b.method,
            methodArgList: b.args.map(a => a + ''),
            callId: b.call_id
          },
          e = j.mmbizwxadevremote.WARemoteDebug_CallInterface.verify(c)
        l
          .expect(!!e, n)
          .toBe(!1)
          .fail(() => {
            throw (n.e('invalid callInterfaceObject obj', e), e)
          }),
          (d = j.mmbizwxadevremote.WARemoteDebug_CallInterface.encode(
            c
          ).finish())
        break
      }
      case k.DebugMessageCategory.EvaluateJavascriptResult: {
        const b = a,
          c = { ret: b.ret, evaluateId: b.evaluate_id },
          e = j.mmbizwxadevremote.WARemoteDebug_EvaluateJavascriptResult.verify(
            c
          )
        l
          .expect(!!e, n)
          .toBe(!1)
          .fail(() => {
            throw (n.e('invalid EvaluateJavascriptResult obj', e), e)
          }),
          (d = j.mmbizwxadevremote.WARemoteDebug_EvaluateJavascriptResult.encode(
            c
          ).finish())
        break
      }
      case k.DebugMessageCategory.Ping: {
        const b = a,
          c = { pingId: b.ping_id, payload: b.payload },
          e = j.mmbizwxadevremote.WARemoteDebug_Ping.verify(c)
        l
          .expect(!!e, n)
          .toBe(!1)
          .fail(() => {
            throw (n.e('invalid Ping obj', e), e)
          }),
          (d = j.mmbizwxadevremote.WARemoteDebug_Ping.encode(c).finish())
        break
      }
      case k.DebugMessageCategory.Breakpoint: {
        const b = { isHit: !!a.is_hit },
          c = j.mmbizwxadevremote.WARemoteDebug_Breakpoint.verify(b)
        l
          .expect(!!c, n)
          .toBe(!1)
          .fail(() => {
            throw (n.e('invalid Breakpoint obj', c), c)
          }),
          (d = j.mmbizwxadevremote.WARemoteDebug_Breakpoint.encode(b).finish())
        break
      }
      case k.DebugMessageCategory.DomOp: {
        const b = a,
          c = { params: b.params, webviewId: b.webview_id },
          e = j.mmbizwxadevremote.WARemoteDebug_DomOp.verify(c)
        l
          .expect(!!e, n)
          .toBe(!1)
          .fail(() => {
            throw (n.e('invalid DomOp obj', e), e)
          }),
          (d = j.mmbizwxadevremote.WARemoteDebug_DomOp.encode(c).finish())
        break
      }
      case k.DebugMessageCategory.DomEvent: {
        const b = a,
          c = { params: b.params, webviewId: b.webview_id },
          e = j.mmbizwxadevremote.WARemoteDebug_DomEvent.verify(c)
        l
          .expect(!!e, n)
          .toBe(!1)
          .fail(() => {
            throw (n.e('invalid DomOp obj', e), e)
          }),
          (d = j.mmbizwxadevremote.WARemoteDebug_DomEvent.encode(c).finish())
        break
      }
      default:
        throw (n.e('invalid debug message category', b),
        new Error('invalid debug message category ' + b))
    }
    let e = 0
    if (d && c && 0 != (c & k.CompressAlgo.Zlib)) {
      Date.now()
      ;(e = d.byteLength),
        (d = i.deflateSync(g(d))),
        (d = h(d)),
        (o.compressionSavedBytes += e - d.byteLength)
    }
    return { buffer: d, originalSize: e }
  }
  function e(a) {
    return a.map(a => {
      const b = d(a.data, a.category, a.compress_algo)
      return {
        seq: a.seq,
        delay: a.delay,
        category: a.category,
        data: b.buffer,
        compressAlgo: a.compress_algo,
        originalSize: b.originalSize
      }
    })
  }
  function f(a) {
    const b = 'string' == typeof a.data ? Buffer.from(a.data) : a.data
    let c = b,
      d = 0
    if (b && a.compressAlgo && 0 != (a.compressAlgo & k.CompressAlgo.Zlib)) {
      Date.now()
      ;(d = c.byteLength),
        (c = i.inflateSync(b)),
        (o.compressionSavedBytes += c.byteLength - d)
    }
    let e = null
    const f = a.category
    if (c)
      switch (a.category) {
        case k.DebugMessageCategory.Breakpoint: {
          const a = j.mmbizwxadevremote.WARemoteDebug_Breakpoint.decode(c),
            b = j.mmbizwxadevremote.WARemoteDebug_Breakpoint.toObject(a)
          e = { is_hit: b.isHit ? 1 : 0 }
          break
        }
        case k.DebugMessageCategory.CallInterface: {
          const a = j.mmbizwxadevremote.WARemoteDebug_CallInterface.decode(c),
            b = j.mmbizwxadevremote.WARemoteDebug_CallInterface.toObject(a)
          e = {
            name: b.objName,
            method: b.methodName,
            args: b.methodArgList,
            call_id: b.callId
          }
          break
        }
        case k.DebugMessageCategory.CallInterfaceResult: {
          const a = j.mmbizwxadevremote.WARemoteDebug_CallInterfaceResult.decode(
              c
            ),
            b = j.mmbizwxadevremote.WARemoteDebug_CallInterfaceResult.toObject(
              a
            )
          e = { ret: b.ret, call_id: b.callId, debug_info: b.debugInfo }
          break
        }
        case k.DebugMessageCategory.EvaluateJavascript: {
          const a = j.mmbizwxadevremote.WARemoteDebug_EvaluateJavascript.decode(
              c
            ),
            b = j.mmbizwxadevremote.WARemoteDebug_EvaluateJavascript.toObject(a)
          e = {
            script: b.script,
            evaluate_id: b.evaluateId,
            debug_info: b.debugInfo
          }
          break
        }
        case k.DebugMessageCategory.EvaluateJavascriptResult: {
          const a = j.mmbizwxadevremote.WARemoteDebug_EvaluateJavascriptResult.decode(
              c
            ),
            b = j.mmbizwxadevremote.WARemoteDebug_EvaluateJavascriptResult.toObject(
              a
            )
          e = { ret: b.ret, evaluate_id: b.evaluateId }
          break
        }
        case k.DebugMessageCategory.Ping: {
          const a = j.mmbizwxadevremote.WARemoteDebug_Ping.decode(c),
            b = j.mmbizwxadevremote.WARemoteDebug_Ping.toObject(a)
          e = { ping_id: b.pingId, payload: b.payload }
          break
        }
        case k.DebugMessageCategory.Pong: {
          const a = j.mmbizwxadevremote.WARemoteDebug_Pong.decode(c),
            b = j.mmbizwxadevremote.WARemoteDebug_Pong.toObject(a, {
              longs: Number
            })
          e = {
            ping_id: b.pingId,
            network_type: b.networkType,
            payload: b.payload
          }
          break
        }
        case k.DebugMessageCategory.SetupContext: {
          const a = j.mmbizwxadevremote.WARemoteDebug_SetupContext.decode(c),
            b = j.mmbizwxadevremote.WARemoteDebug_SetupContext.toObject(a)
          e = {
            register_interface: {
              obj_name: (b.registerInterface || {}).objName,
              obj_methods: (
                (b.registerInterface || {}).objMethodList || []
              ).map(a => {
                return {
                  method_name: a.methodName,
                  method_args: a.methodArgList
                }
              })
            },
            configure_js: b.configureJs,
            public_js_md5: b.publicJsMd5,
            three_js_md5: b.threeJsMd5,
            device_info: {
              device_name: (b.deviceInfo || {}).deviceName,
              device_model: (b.deviceInfo || {}).deviceModel,
              os: (b.deviceInfo || {}).systemVersion,
              wechat_version: (b.deviceInfo || {}).wechatVersion,
              pixel_ratio: (b.deviceInfo || {}).pixelRatio,
              screen_width: (b.deviceInfo || {}).screenWidth,
              publib: (b.deviceInfo || {}).publibVersion,
              user_agent: (b.deviceInfo || {}).userAgent
            },
            support_compress_algo: b.supportCompressAlgo
          }
          break
        }
        case k.DebugMessageCategory.DomOp: {
          const a = j.mmbizwxadevremote.WARemoteDebug_DomOp.decode(c),
            b = j.mmbizwxadevremote.WARemoteDebug_DomOp.toObject(a)
          e = { params: b.params, webview_id: b.webviewId }
          break
        }
        case k.DebugMessageCategory.DomEvent: {
          const a = j.mmbizwxadevremote.WARemoteDebug_DomEvent.decode(c),
            b = j.mmbizwxadevremote.WARemoteDebug_DomEvent.toObject(a)
          e = { params: b.params, webview_id: b.webviewId }
          break
        }
        case k.DebugMessageCategory.NetworkDebugAPI: {
          const a = j.mmbizwxadevremote.WARemoteDebug_NetworkDebugAPI.decode(c),
            b = j.mmbizwxadevremote.WARemoteDebug_NetworkDebugAPI.toObject(a)
          e = {
            api_name: b.apiName,
            task_id: b.taskId,
            request_headers: b.requestHeaders,
            timestamp: b.timestamp
          }
          break
        }
        default: {
          n.e('invalid debug object category'), (e = null)
          break
        }
      }
    else e = null
    return {
      seq: a.seq || 0,
      delay: a.after || 0,
      category: f || k.DebugMessageCategory.Ping,
      data: e || {},
      compress_algo: a.compressAlgo || 0,
      original_size: a.originalSize || d
    }
  }
  function g(a) {
    let b = Buffer.from(a.buffer)
    return (
      a.byteLength !== a.buffer.byteLength &&
        (b = b.slice(a.byteOffset, a.byteOffset + a.byteLength)),
      b
    )
  }
  function h(b) {
    if (!b) throw new Error('invalid buffer ' + b)
    if ('Uint8Array' === b.constructor.name || b.constructor === Uint8Array)
      return b
    'string' == typeof b && (b = Buffer.from(b))
    const c = new Uint8Array(b.length)
    for (var a = 0; a < b.length; a++) c[a] = b[a]
    return c
  }
  Object.defineProperty(exports, '__esModule', { value: !0 })
  const i = require('zlib'),
    j = require('./7a983d175ae5bf313342dd02835b3807.js'),
    k = require('./a148d3a11fd5268109e21fb40c9d527b.js'),
    l = require('./46d7303eb986fa402d60bf5e929aa077.js'),
    m = require('./56a764ae9cb4336bf6babe1c1da0275b.js'),
    n = m.default('[proto]')
  let o
  ;(exports.requestCmdForType = b),
    (exports.clientRequestCmdForType = c),
    (exports.wrapOutgoingToProto = function(a, c, d) {
      let f = null
      switch (c) {
        case k.RequestType.Login: {
          const b = a,
            c = {
              baseRequest: { clientVersion: b.base_request.clientversion },
              newticket: b.newticket
            },
            d = j.mmbizwxadevremote.WARemoteDebug_DevLoginReq.verify(c)
          l
            .expect(!!d, n)
            .toBe(!1)
            .fail(() => {
              throw (n.e('invalid login request obj', d), d)
            }),
            (f = j.mmbizwxadevremote.WARemoteDebug_DevLoginReq.encode(
              c
            ).finish())
          break
        }
        case k.RequestType.JoinRoom: {
          const b = a,
            c = {
              baseRequest: { clientVersion: b.base_request.clientversion },
              appid: b.appid,
              roomId: b.room_id,
              wxpkgInfo: b.wxpkg_info
            },
            d = j.mmbizwxadevremote.WARemoteDebug_DevJoinRoomReq.verify(c)
          l
            .expect(!!d, n)
            .toBe(!1)
            .fail(() => {
              throw (n.e('invalid join room request obj', d), d)
            }),
            (f = j.mmbizwxadevremote.WARemoteDebug_DevJoinRoomReq.encode(
              c
            ).finish())
          break
        }
        case k.RequestType.Heartbeat: {
          const b = a,
            c = {
              baseRequest: { clientVersion: b.base_request.clientversion },
              recvAck: b.recv_ack
            },
            d = j.mmbizwxadevremote.WARemoteDebug_DevHeartBeatReq.verify(c)
          l
            .expect(!!d, n)
            .toBe(!1)
            .fail(() => {
              throw (n.e('invalid heartbeat request obj', d), d)
            }),
            (f = j.mmbizwxadevremote.WARemoteDebug_DevHeartBeatReq.encode(
              c
            ).finish())
          break
        }
        case k.RequestType.SendDebugMessageParallelly: {
          const b = a,
            c = {
              baseRequest: { clientVersion: b.base_request.clientversion },
              recvAck: b.recv_ack,
              debugMessageList: e(b.debug_message)
            },
            d = j.mmbizwxadevremote.WARemoteDebug_NewSendDebugMessageReq.verify(
              c
            )
          l
            .expect(!!d, n)
            .toBe(!1)
            .fail(() => {
              throw (n.e('invalid SendDebugMessageParallelly request obj', d),
              d)
            }),
            (f = j.mmbizwxadevremote.WARemoteDebug_NewSendDebugMessageReq.encode(
              c
            ).finish())
          break
        }
        case k.RequestType.SendDebugMessage: {
          const b = a,
            c = {
              baseRequest: { clientVersion: b.base_request.clientversion },
              recvAck: b.recv_ack,
              debugMessageList: e(b.debug_message)
            },
            d = j.mmbizwxadevremote.WARemoteDebug_SendDebugMessageReq.verify(c)
          l
            .expect(!!d, n)
            .toBe(!1)
            .fail(() => {
              throw (n.e('invalid SendDebugMessage request obj', d), d)
            }),
            (f = j.mmbizwxadevremote.WARemoteDebug_SendDebugMessageReq.encode(
              c
            ).finish())
          break
        }
        case k.RequestType.QuitRoom: {
          const b = {
              baseRequest: { clientVersion: a.base_request.clientversion }
            },
            c = j.mmbizwxadevremote.WARemoteDebug_DevQuitRoomReq.verify(b)
          l
            .expect(!!c, n)
            .toBe(!1)
            .fail(() => {
              throw (n.e('invalid QuitRoom request obj', c), c)
            }),
            (f = j.mmbizwxadevremote.WARemoteDebug_DevQuitRoomReq.encode(
              b
            ).finish())
          break
        }
        case k.RequestType.SyncMessage: {
          const b = a,
            c = {
              baseRequest: { clientVersion: b.base_request.clientversion },
              minSeq: b.min_seq
            }
          'number' == typeof b.max_seq && (c.maxSeq = b.max_seq)
          const d = j.mmbizwxadevremote.WARemoteDebug_DevSyncMessageReq.verify(
            c
          )
          l
            .expect(!!d, n)
            .toBe(!1)
            .fail(() => {
              throw (n.e('invalid SyncMessage request obj', d), d)
            }),
            (f = j.mmbizwxadevremote.WARemoteDebug_DevSyncMessageReq.encode(
              c
            ).finish())
          break
        }
        default:
          throw (n.e('error wrapping outgoing object, invalid type', c),
          new Error('error wrapping outgoing object, invalid type ' + c))
      }
      const g = j.mmbizwxadevremote.WARemoteDebug_DataFormat.create({
        cmd: b(c),
        uuid: d,
        data: f
      })
      return j.mmbizwxadevremote.WARemoteDebug_DataFormat.encode(g).finish()
    }),
    (exports.unwrapProtoToDataFormat = function(b) {
      const c = j.mmbizwxadevremote.WARemoteDebug_DataFormat.decode(b),
        d = 'string' == typeof c.data ? Buffer.from(c.data) : c.data
      let e = null
      switch (c.cmd) {
        case k.ResponseType.Heartbeat: {
          const a = j.mmbizwxadevremote.WARemoteDebug_DevHeartBeatResp.decode(
              d
            ),
            b = j.mmbizwxadevremote.WARemoteDebug_DevHeartBeatResp.toObject(a)
          e = { base_response: b.baseResponse }
          break
        }
        case k.ResponseType.Login: {
          const a = j.mmbizwxadevremote.WARemoteDebug_DevLoginResp.decode(d),
            b = j.mmbizwxadevremote.WARemoteDebug_DevLoginResp.toObject(a)
          e = {
            base_response: b.baseResponse,
            room_info: {
              join_room: (b.roomInfo || {}).joinRoom,
              original_md5: (b.roomInfo || {}).originalMd5,
              room_status: (b.roomInfo || {}).roomStatus,
              wx_conn_status: (b.roomInfo || {}).wxConnStatus,
              dev_conn_status: (b.roomInfo || {}).devConnStatus,
              room_id: (b.roomInfo || {}).roomId
            }
          }
          break
        }
        case k.ResponseType.EventNotifyEnd:
        case k.ResponseType.EventNotifyBlock:
        case k.ResponseType.EventNotifyBegin: {
          const a = j.mmbizwxadevremote.WARemoteDebug_EventNotify.decode(d),
            b = j.mmbizwxadevremote.WARemoteDebug_EventNotify.toObject(a)
          e = { base_response: Object.assign({}, b.baseResponse || {}) }
          break
        }
        case k.ResponseType.JoinRoom: {
          const a = j.mmbizwxadevremote.WARemoteDebug_DevJoinRoomResp.decode(d),
            b = j.mmbizwxadevremote.WARemoteDebug_DevJoinRoomResp.toObject(a)
          e = { base_response: b.baseResponse }
          break
        }
        case k.ResponseType.MessageNotifyParallelly:
        case k.ResponseType.MessageNotify: {
          const a = j.mmbizwxadevremote.WARemoteDebug_MessageNotify.decode(d),
            b = a.debugMessageList,
            c = []
          for (const a of b) c.push(f(a))
          e = { debug_message: c }
          break
        }
        case k.ResponseType.QuitRoom: {
          const a = j.mmbizwxadevremote.WARemoteDebug_DevQuitRoomResp.decode(d),
            b = j.mmbizwxadevremote.WARemoteDebug_DevQuitRoomResp.toObject(a)
          e = { base_response: b.baseResponse }
          break
        }
        case k.ResponseType.SendDebugMessageParallelly: {
          const a = j.mmbizwxadevremote.WARemoteDebug_NewSendDebugMessageResp.decode(
              d
            ),
            b = j.mmbizwxadevremote.WARemoteDebug_NewSendDebugMessageResp.toObject(
              a
            )
          e = {
            base_response: b.baseResponse,
            max_ack: b.maxAck,
            min_ack: b.minAck
          }
          break
        }
        case k.ResponseType.SendDebugMessage: {
          const a = j.mmbizwxadevremote.WARemoteDebug_SendDebugMessageResp.decode(
              d
            ),
            b = j.mmbizwxadevremote.WARemoteDebug_SendDebugMessageResp.toObject(
              a
            )
          e = { base_response: b.baseResponse, send_ack: b.sendAck }
          break
        }
        case k.ResponseType.SyncMessage: {
          const a = j.mmbizwxadevremote.WARemoteDebug_DevSyncMessageResp.decode(
              d
            ),
            b = a.debugMessageList,
            c = []
          for (const a of b) c.push(f(a))
          e = {
            debug_message: c,
            send_ack: a.sendAck,
            base_response: a.baseResponse
          }
          break
        }
        default: {
          n.e('error receive invalid cmd', c.cmd), (e = {})
          break
        }
      }
      const g = { cmd: c.cmd, uuid: c.uuid, data: e, _comment: a(c.cmd) }
      return g
    }),
    (exports.uint8ArrayToBuffer = g),
    (exports.bufferToUint8Array = h),
    (exports.unwrapClientProtoToDataFormat = function(b) {
      const c = j.mmbizwxadevremote.WARemoteDebug_DataFormat.decode(b),
        d = 'string' == typeof c.data ? Buffer.from(c.data) : c.data
      let e = null
      switch (c.cmd) {
        case k.ClientRequestCmd.Login: {
          const a = j.mmbizwxadevremote.WARemoteDebug_WxLoginReq.decode(d),
            b = j.mmbizwxadevremote.WARemoteDebug_WxLoginReq.toObject(a)
          e = {
            base_request: { clientversion: b.baseRequest },
            loginticket: b.loginTicket
          }
          break
        }
        case k.ClientRequestCmd.Heartbeat: {
          const a = j.mmbizwxadevremote.WARemoteDebug_WxHeartBeatReq.decode(d),
            b = j.mmbizwxadevremote.WARemoteDebug_WxHeartBeatReq.toObject(a)
          e = {
            base_request: { clientversion: b.baseRequest },
            recv_ack: b.recvAck
          }
          break
        }
        case k.ClientRequestCmd.JoinRoom: {
          const a = j.mmbizwxadevremote.WARemoteDebug_WxJoinRoomReq.decode(d),
            b = j.mmbizwxadevremote.WARemoteDebug_WxJoinRoomReq.toObject(a)
          e = {
            base_request: { clientversion: b.baseRequest },
            wxpkg_info: b.wxpkgInfo,
            username: b.username,
            room_id: b.roomId
          }
          break
        }
        case k.ClientRequestCmd.JoinRoom: {
          const a = j.mmbizwxadevremote.WARemoteDebug_WxJoinRoomReq.decode(d),
            b = j.mmbizwxadevremote.WARemoteDebug_WxJoinRoomReq.toObject(a)
          e = {
            base_request: { clientversion: b.baseRequest },
            wxpkg_info: b.wxpkgInfo,
            username: b.username,
            room_id: b.roomId
          }
          break
        }
        case k.ClientRequestCmd.QuitRoom: {
          const a = j.mmbizwxadevremote.WARemoteDebug_WxQuitRoomReq.decode(d),
            b = j.mmbizwxadevremote.WARemoteDebug_WxQuitRoomReq.toObject(a)
          e = { base_request: { clientversion: b.baseRequest } }
          break
        }
        case k.ClientRequestCmd.SendDebugMessageParallelly: {
          const a = j.mmbizwxadevremote.WARemoteDebug_NewSendDebugMessageReq.decode(
              d
            ),
            b = j.mmbizwxadevremote.WARemoteDebug_NewSendDebugMessageReq.toObject(
              a
            )
          e = {
            base_request: { clientversion: b.baseRequest },
            debug_message: (b.debugMessageList || []).map(a => f(a)),
            recv_ack: b.recvAck
          }
          break
        }
        case k.ClientRequestCmd.SyncMessage: {
          const a = j.mmbizwxadevremote.WARemoteDebug_WxSyncMessageReq.decode(
              d
            ),
            b = j.mmbizwxadevremote.WARemoteDebug_WxSyncMessageReq.toObject(a)
          e = {
            base_request: { clientversion: b.baseRequest },
            min_seq: b.minSeq,
            max_seq: b.maxSeq
          }
          break
        }
        default: {
          n.e('error receive invalid cmd', c.cmd), (e = {})
          break
        }
      }
      const g = { cmd: c.cmd, uuid: c.uuid, data: e, _comment: a(c.cmd) }
      return g
    }),
    (exports.wrapClientResponseDataFormatToProto = function(a, b, d) {
      let f = null
      switch (b) {
        case k.ClientResponseType.Login: {
          const b = a,
            c = {
              baseResponse: {
                errcode: (b.base_response || {}).errcode,
                errmsg: (b.base_response || {}).errmsg
              },
              roomInfo: {
                joinRoom: (b.room_info || {}).join_room,
                originalMd5: (b.room_info || {}).original_md5,
                roomStatus: (b.room_info || {}).room_status,
                wxConnStatus: (b.room_info || {}).wx_conn_status,
                devConnStatus: (b.room_info || {}).dev_conn_status,
                roomId: (b.room_info || {}).room_id
              }
            },
            d = j.mmbizwxadevremote.WARemoteDebug_WxLoginResp.verify(c)
          l
            .expect(!!d, n)
            .toBe(!1)
            .fail(() => {
              throw (n.e('invalid client login response obj', d), d)
            }),
            (f = j.mmbizwxadevremote.WARemoteDebug_WxLoginResp.encode(
              c
            ).finish())
          break
        }
        case k.ClientResponseType.JoinRoom: {
          const b = { baseResponse: a.base_response },
            c = j.mmbizwxadevremote.WARemoteDebug_WxJoinRoomResp.verify(b)
          l
            .expect(!!c, n)
            .toBe(!1)
            .fail(() => {
              throw (n.e('invalid client join room response obj', c), c)
            }),
            (f = j.mmbizwxadevremote.WARemoteDebug_WxJoinRoomResp.encode(
              b
            ).finish())
          break
        }
        case k.ClientResponseType.Heartbeat: {
          const b = { baseResponse: a.base_response },
            c = j.mmbizwxadevremote.WARemoteDebug_WxHeartBeatResp.verify(b)
          l
            .expect(!!c, n)
            .toBe(!1)
            .fail(() => {
              throw (n.e('invalid client heartbeat response obj', c), c)
            }),
            (f = j.mmbizwxadevremote.WARemoteDebug_WxHeartBeatResp.encode(
              b
            ).finish())
          break
        }
        case k.ClientResponseType.SendDebugMessageParallelly: {
          const b = a,
            c = {
              baseResponse: b.base_response,
              maxAck: b.max_ack,
              minAck: b.min_ack
            },
            d = j.mmbizwxadevremote.WARemoteDebug_NewSendDebugMessageResp.verify(
              c
            )
          l
            .expect(!!d, n)
            .toBe(!1)
            .fail(() => {
              throw (n.e(
                'invalid client SendDebugMessageParallelly response obj',
                d
              ),
              d)
            }),
            (f = j.mmbizwxadevremote.WARemoteDebug_NewSendDebugMessageResp.encode(
              c
            ).finish())
          break
        }
        case k.ClientResponseType.QuitRoom: {
          const b = { baseResponse: a.base_response },
            c = j.mmbizwxadevremote.WARemoteDebug_WxQuitRoomResp.verify(b)
          l
            .expect(!!c, n)
            .toBe(!1)
            .fail(() => {
              throw (n.e('invalid client QuitRoom response obj', c), c)
            }),
            (f = j.mmbizwxadevremote.WARemoteDebug_WxQuitRoomResp.encode(
              b
            ).finish())
          break
        }
        case k.ClientResponseType.SyncMessage: {
          const b = a,
            c = {
              baseResponse: b.base_response,
              debugMessageList: e(b.debug_message),
              sendAck: b.send_ack
            },
            d = j.mmbizwxadevremote.WARemoteDebug_WxSyncMessageResp.verify(c)
          l
            .expect(!!d, n)
            .toBe(!1)
            .fail(() => {
              throw (n.e('invalid client sync message response obj', d), d)
            }),
            (f = j.mmbizwxadevremote.WARemoteDebug_WxSyncMessageResp.encode(
              c
            ).finish())
          break
        }
        case k.ClientResponseType.MessageNotifyParallelly: {
          const b = { debugMessageList: e(a.debug_message) },
            c = j.mmbizwxadevremote.WARemoteDebug_MessageNotify.verify(b)
          l
            .expect(!!c, n)
            .toBe(!1)
            .fail(() => {
              throw (n.e(
                'invalid client MessageNotifyParallelly response obj',
                c
              ),
              c)
            }),
            (f = j.mmbizwxadevremote.WARemoteDebug_MessageNotify.encode(
              b
            ).finish())
          break
        }
        case k.ClientResponseType.EventNotifyEnd:
        case k.ClientResponseType.EventNotifyBlock:
        case k.ClientResponseType.EventNotifyBegin: {
          const a = {},
            b = j.mmbizwxadevremote.WARemoteDebug_EventNotify.verify(a)
          l
            .expect(!!b, n)
            .toBe(!1)
            .fail(() => {
              throw (n.e('invalid client ClientEventNotify response obj', b), b)
            }),
            (f = j.mmbizwxadevremote.WARemoteDebug_EventNotify.encode(
              a
            ).finish())
          break
        }
        default:
          throw (n.e('error wrapping outgoing object, invalid type', b),
          new Error('error wrapping outgoing object, invalid type ' + b))
      }
      const g = j.mmbizwxadevremote.WARemoteDebug_DataFormat.create({
        cmd: c(b),
        uuid: d,
        data: f
      })
      return j.mmbizwxadevremote.WARemoteDebug_DataFormat.encode(g).finish()
    }),
    (exports.model = {
      resetStatistics() {
        o = { compressionSavedBytes: 0 }
      },
      getCompressionSavedBytes() {
        return o.compressionSavedBytes || 0
      }
    }),
    exports.model.resetStatistics()
})(require('lazyload'), require)
