diff --git a/README.md b/README.md index ae74589db..b8598669b 100644 --- a/README.md +++ b/README.md @@ -151,12 +151,11 @@ var root = new Root().define("awesomepackage").add(AwesomeMessage); ```js ... -var Prototype = protobuf.Prototype; function AwesomeMessage(properties) { - Prototype.call(this, properties); + protobuf.Message.call(this, properties); } -protobuf.inherits(AwesomeMessage, root.lookup("awesomepackage.AwesomeMessage") /* or use reflection */); +protobuf.Class.create(root.lookup("awesomepackage.AwesomeMessage") /* or use reflection */, AwesomeMessage); var message = new AwesomeMessage({ awesomeField: "AwesomeString" }); @@ -203,6 +202,8 @@ function rpcImpl(method, requestData, callback) { } ``` +There is also an [example for streaming RPC](https://github.com/dcodeIO/protobuf.js/blob/master/examples/streaming-rpc.js). + ### Usage with TypeScript ```ts @@ -218,8 +219,11 @@ The library exports a flat `protobuf` namespace with the following members, orde ### Parser -* **load(filename: `string|Array`, [root: `Root`], [callback: `function(err: Error, [root: Root])`]): `Promise`** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/index.js)]
- Loads one or multiple .proto files into the specified root or creates a new one when omitted. +* **load(filename: `string|Array`, [root: `Root`], [callback: `function(err: Error, [root: Root])`]): `Promise|undefined`** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/index.js)]
+ Loads one or multiple .proto or preprocessed .json files into a common root namespace. + +* **loadSync(filename: `string|string[]`, [root: `Root`]): `Root`** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/index.js)]
+ Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). * **tokenize(source: `string`): `Object`** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/tokenize.js)]
Tokenizes the given .proto source and returns an object with useful utility functions. @@ -256,14 +260,8 @@ The library exports a flat `protobuf` namespace with the following members, orde * **BufferReader** _extends **Reader**_ [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/reader.js)]
Wire format reader using node buffers. -* **Encoder** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/encoder.js)]
- Wire format encoder using code generation on top of reflection. - -* **Decoder** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/decoder.js)]
- Wire format decoder using code generation on top of reflection. - -* **Verifier** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/verifier.js)]
- Runtime message verifier using code generation on top of reflection. +* **codegen** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/codegen.js)]
+ A closure for generating functions programmatically. ### Reflection @@ -296,22 +294,25 @@ The library exports a flat `protobuf` namespace with the following members, orde ### Runtime -* **inherits(clazz: `Function`, type: `Type`, [options: `Object.`]): `Prototype`** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/inherits.js)]
- Inherits a custom class from the message prototype of the specified message type. +* **Class** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/class.js)]
+ Runtime class providing the tools to create your own custom classes. -* **Prototype** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/prototype.js)]
- Runtime message prototype ready to be extended by custom classes or generated code. +* **Message** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/message.js)]
+ Abstract runtime message. ### Utility -* **util: `Object`** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/util.js)]
- Utility functions. +* **types: `Object`** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/types.js)]
+ Common type constants. * **common(name: `string`, json: `Object`)** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/common.js)]
Provides common type definitions. -* **types: `Object`** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/types.js)]
- Common type constants. +* **rpc: `Object`** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/rpc.js)]
+ Streaming RPC helpers. + +* **util: `Object`** [[source](https://github.com/dcodeIO/protobuf.js/blob/master/src/util.js)]
+ Various utility functions. Documentation ------------- @@ -320,22 +321,6 @@ Documentation * [protobuf.js API Documentation](http://dcode.io/protobuf.js/) -### Data type recommendations - -| Value type | protobuf Type | Size / Notes -|---------------------|---------------|----------------------------------------------------------------------------------- -| Unsigned 32 bit int | uint32 | 1 to 5 bytes. -| Signed 32 bit int | sint32 | 1 to 5 bytes. Do not use int32 (always encodes negative values as 10 bytes). -| Unsigned 52 bit int | uint64 | 1 to 10 bytes. -| Signed 52 bit int | sint64 | 1 to 10 bytes. Do not use int64 (always encodes negative values as 10 bytes). -| Unsigned 64 bit int | uint64 | Use with long.js. 1 to 10 bytes. -| Signed 64 bit int | sint64 | Use with long.js. 1 to 10 bytes. Do not use int64 (always encodes negative values as 10 bytes). -| 32 bit float | float | 4 bytes. -| 64 bit float | double | 8 bytes. Use float if 32 bits of precision are enough. -| Boolean values | bool | 1 byte. -| Strings | string | 1 to 5 bytes + utf8 byte length. -| Buffers | bytes | 1 to 5 bytes + byte length. - Command line ------------ diff --git a/dist/protobuf.js b/dist/protobuf.js index 959ba39d3..55b33e69a 100644 --- a/dist/protobuf.js +++ b/dist/protobuf.js @@ -1,6 +1,6 @@ /*! * protobuf.js v6.1.0 (c) 2016 Daniel Wirtz - * Compiled Thu, 08 Dec 2016 19:14:46 UTC + * Compiled Fri, 09 Dec 2016 01:15:36 UTC * Licensed under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/protobuf.js for details */ @@ -126,6 +126,145 @@ exports.write = function writeIEEE754(buffer, value, offset, isBE, mLen, nBytes) },{}],2:[function(require,module,exports){ "use strict"; +module.exports = Class; + +var Message = require(11), + Type = require(23), + util = require(25); + +var _TypeError = util._TypeError; + +/** + * Constructs a class instance, which is also a message prototype. + * @classdesc Runtime class providing the tools to create your own custom classes. + * @constructor + * @param {Type} type Reflected type + * @abstract + */ +function Class(type) { + return Class.create(type); +} + +/** + * Constructs a new message prototype for the specified reflected type and sets up its constructor. + * @param {Type} type Reflected message type + * @param {*} [ctor] Custom constructor to set up, defaults to create a generic one if omitted + * @returns {Message} Message prototype + */ +Class.create = function create(type, ctor) { + if (!(type instanceof Type)) + throw _TypeError("type", "a Type"); + var clazz = ctor; + if (clazz) { + if (typeof clazz !== 'function') + throw _TypeError("ctor", "a function"); + } else + clazz = (function(MessageCtor) { // eslint-disable-line wrap-iife + return function Message(properties) { + MessageCtor.call(this, properties); + }; + })(Message); + + // Let's pretend... + clazz.constructor = Class; + + // new Class() -> Message.prototype + var prototype = clazz.prototype = new Message(); + prototype.constructor = clazz; + + // Static methods on Message are instance methods on Class and vice-versa. + util.merge(clazz, Message, true); + + // Classes and messages reference their reflected type + clazz.$type = type; + prototype.$type = type; + + // Messages have non-enumerable default values on their prototype + type.getFieldsArray().forEach(function(field) { + field.resolve(); + // objects on the prototype must be immmutable. users must assign a new object instance and + // cannot use Array#push on empty arrays on the prototype for example, as this would modify + // the value on the prototype for ALL messages of this type. Hence, these objects are frozen. + prototype[field.name] = Array.isArray(field.defaultValue) + ? util.emptyArray + : util.isObject(field.defaultValue) + ? util.emptyObject + : field.defaultValue; + }); + + // Runtime messages have non-enumerable getters and setters for each virtual oneof field + type.getOneofsArray().forEach(function(oneof) { + util.prop(prototype, oneof.resolve().name, { + get: function getVirtual() { + // > If the parser encounters multiple members of the same oneof on the wire, only the last member seen is used in the parsed message. + var keys = Object.keys(this); + for (var i = keys.length - 1; i > -1; --i) + if (oneof.oneof.indexOf(keys[i]) > -1) + return keys[i]; + return undefined; + }, + set: function setVirtual(value) { + var keys = oneof.oneof; + for (var i = 0; i < keys.length; ++i) + if (keys[i] !== value) + delete this[keys[i]]; + } + }); + }); + + // Register + type.ctor = clazz; + + return prototype; +}; + +// Static methods on Message are instance methods on Class and vice-versa. +Class.prototype = Message; + +/** + * Encodes a message of this type. + * @name Class#encode + * @function + * @param {Message|Object} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + */ + +/** + * Encodes a message of this type preceeded by its length as a varint. + * @name Class#encodeDelimited + * @function + * @param {Message|Object} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + */ + +/** + * Decodes a message of this type. + * @name Class#decode + * @function + * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode + * @returns {Message} Decoded message + */ + +/** + * Decodes a message of this type preceeded by its length as a varint. + * @name Class#decodeDelimited + * @function + * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode + * @returns {Message} Decoded message + */ + +/** + * Verifies a message of this type. + * @name Class#verify + * @function + * @param {Message|Object} message Message or plain object to verify + * @returns {?string} `null` if valid, otherwise the reason why it is not + */ + +},{"11":11,"23":23,"25":25}],3:[function(require,module,exports){ +"use strict"; module.exports = codegen; var util = require(25); @@ -239,11 +378,11 @@ function codegen() { codegen.supported = false; try { codegen.supported = codegen("a","b")("return a-b").eof()(2,1) === 1; } catch (e) {} // eslint-disable-line no-empty codegen.verbose = false; -codegen.encode = require(4); -codegen.decode = require(3); -codegen.verify = require(5); +codegen.encode = require(5); +codegen.decode = require(4); +codegen.verify = require(6); -},{"25":25,"3":3,"4":4,"5":5}],3:[function(require,module,exports){ +},{"25":25,"4":4,"5":5,"6":6}],4:[function(require,module,exports){ "use strict"; /** @@ -253,17 +392,17 @@ codegen.verify = require(5); */ var decode = exports; -var Enum = require(7), +var Enum = require(8), Reader = require(17), types = require(24), util = require(25), - codegen = require(2); + codegen = require(3); /** * Decodes a message of `this` message's type. * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from * @param {number} [length] Length of the message, if known beforehand - * @returns {Prototype} Populated runtime message + * @returns {Message} Populated runtime message * @this Type */ decode.fallback = function decode_fallback(readerOrBuffer, length) { @@ -421,7 +560,7 @@ decode.generate = function decode_generate(mtype) { /* eslint-enable no-unexpected-multiline */ }; -},{"17":17,"2":2,"24":24,"25":25,"7":7}],4:[function(require,module,exports){ +},{"17":17,"24":24,"25":25,"3":3,"8":8}],5:[function(require,module,exports){ "use strict"; /** @@ -431,15 +570,15 @@ decode.generate = function decode_generate(mtype) { */ var encode = exports; -var Enum = require(7), +var Enum = require(8), Writer = require(30), types = require(24), util = require(25), - codegen = require(2); + codegen = require(3); /** * Encodes a message of `this` message's type. - * @param {Prototype|Object} message Runtime message or plain object to encode + * @param {Message|Object} message Runtime message or plain object to encode * @param {Writer} [writer] Writer to encode to * @returns {Writer} writer * @this Type @@ -612,7 +751,7 @@ encode.generate = function encode_generate(mtype) { /* eslint-enable no-unexpected-multiline */ }; -},{"2":2,"24":24,"25":25,"30":30,"7":7}],5:[function(require,module,exports){ +},{"24":24,"25":25,"3":3,"30":30,"8":8}],6:[function(require,module,exports){ "use strict"; /** @@ -622,14 +761,14 @@ encode.generate = function encode_generate(mtype) { */ var verify = exports; -var Enum = require(7), +var Enum = require(8), Type = require(23), util = require(25), - codegen = require(2); + codegen = require(3); /** * Verifies a runtime message of `this` message type. - * @param {Prototype|Object} message Runtime message or plain object to verify + * @param {Message|Object} message Runtime message or plain object to verify * @returns {?string} `null` if valid, otherwise the reason why it is not * @this {Type} */ @@ -705,7 +844,7 @@ verify.generate = function verify_generate(mtype) { /* eslint-enable no-unexpected-multiline */ }; -},{"2":2,"23":23,"25":25,"7":7}],6:[function(require,module,exports){ +},{"23":23,"25":25,"3":3,"8":8}],7:[function(require,module,exports){ "use strict"; module.exports = common; @@ -838,11 +977,11 @@ common("struct", { } }); -},{}],7:[function(require,module,exports){ +},{}],8:[function(require,module,exports){ "use strict"; module.exports = Enum; -var ReflectionObject = require(13); +var ReflectionObject = require(14); /** @alias Enum.prototype */ var EnumPrototype = ReflectionObject.extend(Enum); @@ -851,7 +990,7 @@ var util = require(25); var _TypeError = util._TypeError; /** - * Constructs a new enum. + * Constructs a new enum instance. * @classdesc Reflected enum. * @extends ReflectionObject * @constructor @@ -979,16 +1118,16 @@ EnumPrototype.remove = function(name) { return clearCache(this); }; -},{"13":13,"25":25}],8:[function(require,module,exports){ +},{"14":14,"25":25}],9:[function(require,module,exports){ "use strict"; module.exports = Field; -var ReflectionObject = require(13); +var ReflectionObject = require(14); /** @alias Field.prototype */ var FieldPrototype = ReflectionObject.extend(Field); var Type = require(23), - Enum = require(7), + Enum = require(8), MapField = require(10), types = require(24), util = require(25); @@ -996,7 +1135,7 @@ var Type = require(23), var _TypeError = util._TypeError; /** - * Constructs a new message field. Note that {@link MapField|map fields} have their own class. + * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. * @classdesc Reflected message field. * @extends ReflectionObject * @constructor @@ -1237,7 +1376,7 @@ FieldPrototype.resolve = function resolve() { * @param {*} value Field value * @param {Object.} [options] Conversion options * @returns {*} Converted value - * @see {@link Prototype#asJSON} + * @see {@link Message#asJSON} */ FieldPrototype.jsonConvert = function(value, options) { if (options) { @@ -1253,219 +1392,22 @@ FieldPrototype.jsonConvert = function(value, options) { return value; }; -},{"10":10,"13":13,"23":23,"24":24,"25":25,"7":7}],9:[function(require,module,exports){ -"use strict"; -module.exports = inherits; - -var Prototype = require(16), - Type = require(23), - util = require(25); - -var _TypeError = util._TypeError; - -/** - * Options passed to {@link inherits}, modifying its behavior. - * @typedef InheritanceOptions - * @type {Object} - * @property {boolean} [noStatics=false] Skips adding the default static methods on top of the constructor - * @property {boolean} [noRegister=false] Skips registering the constructor with the reflected type - */ - -/** - * Inherits a custom class from the message prototype of the specified message type. - * @param {*} clazz Inheriting class constructor - * @param {Type} type Inherited message type - * @param {InheritanceOptions} [options] Inheritance options - * @returns {Prototype} Created prototype - */ -function inherits(clazz, type, options) { - if (typeof clazz !== 'function') - throw _TypeError("clazz", "a function"); - if (!(type instanceof Type)) - throw _TypeError("type", "a Type"); - if (!options) - options = {}; - - /** - * This is not an actual type but stands as a reference for any constructor of a custom message class that you pass to the library. - * @name Class - * @extends Prototype - * @constructor - * @param {Object.} [properties] Properties to set on the message - * @see {@link inherits} - */ - - var classProperties = { - - /** - * Reference to the reflected type. - * @name Class.$type - * @type {Type} - * @readonly - */ - $type: { - value: type - } - }; - - if (!options.noStatics) - util.merge(classProperties, { - - /** - * Encodes a message of this type to a buffer. - * @name Class.encode - * @function - * @param {Prototype|Object} message Message to encode - * @param {Writer} [writer] Writer to use - * @returns {Writer} Writer - */ - encode: { - value: function encode(message, writer) { - return this.$type.encode(message, writer); - } - }, - - /** - * Encodes a message of this type preceeded by its length as a varint to a buffer. - * @name Class.encodeDelimited - * @function - * @param {Prototype|Object} message Message to encode - * @param {Writer} [writer] Writer to use - * @returns {Writer} Writer - */ - encodeDelimited: { - value: function encodeDelimited(message, writer) { - return this.$type.encodeDelimited(message, writer); - } - }, - - /** - * Decodes a message of this type from a buffer. - * @name Class.decode - * @function - * @param {Uint8Array} buffer Buffer to decode - * @returns {Prototype} Decoded message - */ - decode: { - value: function decode(buffer) { - return this.$type.decode(buffer); - } - }, - - /** - * Decodes a message of this type preceeded by its length as a varint from a buffer. - * @name Class.decodeDelimited - * @function - * @param {Uint8Array} buffer Buffer to decode - * @returns {Prototype} Decoded message - */ - decodeDelimited: { - value: function decodeDelimited(buffer) { - return this.$type.decodeDelimited(buffer); - } - }, - - /** - * Verifies a message of this type. - * @name Class.verify - * @function - * @param {Prototype|Object} message Message or plain object to verify - * @returns {?string} `null` if valid, otherwise the reason why it is not - */ - verify: { - value: function verify(message) { - return this.$type.verify(message); - } - } - - }, true); - - util.props(clazz, classProperties); - var prototype = inherits.defineProperties(new Prototype(), type); - clazz.prototype = prototype; - prototype.constructor = clazz; - - if (!options.noRegister) - type.setCtor(clazz); - - return prototype; -} - -/** - * Defines the reflected type's default values and virtual oneof properties on the specified prototype. - * @memberof inherits - * @param {Prototype} prototype Prototype to define properties upon - * @param {Type} type Reflected message type - * @returns {Prototype} The specified prototype - */ -inherits.defineProperties = function defineProperties(prototype, type) { - - var prototypeProperties = { - - /** - * Reference to the reflected type. - * @name Prototype#$type - * @type {Type} - * @readonly - */ - $type: { - value: type - } - }; - - // Initialize default values - type.getFieldsArray().forEach(function(field) { - field.resolve(); - // objects on the prototype must be immmutable. users must assign a new object instance and - // cannot use Array#push on empty arrays on the prototype for example, as this would modify - // the value on the prototype for ALL messages of this type. Hence, these objects are frozen. - prototype[field.name] = Array.isArray(field.defaultValue) - ? util.emptyArray - : util.isObject(field.defaultValue) - ? util.emptyObject - : field.defaultValue; - }); - - // Define each oneof with a non-enumerable getter and setter for the present field - type.getOneofsArray().forEach(function(oneof) { - util.prop(prototype, oneof.resolve().name, { - get: function getVirtual() { - // > If the parser encounters multiple members of the same oneof on the wire, only the last member seen is used in the parsed message. - var keys = Object.keys(this); - for (var i = keys.length - 1; i > -1; --i) - if (oneof.oneof.indexOf(keys[i]) > -1) - return keys[i]; - return undefined; - }, - set: function setVirtual(value) { - var keys = oneof.oneof; - for (var i = 0; i < keys.length; ++i) - if (keys[i] !== value) - delete this[keys[i]]; - } - }); - }); - - util.props(prototype, prototypeProperties); - return prototype; -}; - -},{"16":16,"23":23,"25":25}],10:[function(require,module,exports){ +},{"10":10,"14":14,"23":23,"24":24,"25":25,"8":8}],10:[function(require,module,exports){ "use strict"; module.exports = MapField; -var Field = require(8); +var Field = require(9); /** @alias Field.prototype */ var FieldPrototype = Field.prototype; /** @alias MapField.prototype */ var MapFieldPrototype = Field.extend(MapField); -var Enum = require(7), +var Enum = require(8), types = require(24), util = require(25); /** - * Constructs a new map field. + * Constructs a new map field instance. * @classdesc Reflected map field. * @extends Field * @constructor @@ -1548,11 +1490,148 @@ MapFieldPrototype.resolve = function resolve() { return FieldPrototype.resolve.call(this); }; -},{"24":24,"25":25,"7":7,"8":8}],11:[function(require,module,exports){ +},{"24":24,"25":25,"8":8,"9":9}],11:[function(require,module,exports){ +"use strict"; +module.exports = Message; + +/** + * Constructs a new message instance. + * + * This method should be called from your custom constructors, i.e. `Message.call(this, properties)`. + * @classdesc Abstract runtime message. + * @extends {Object} + * @constructor + * @param {Object.} [properties] Properties to set + * @abstract + * @see {@link Class.create} + */ +function Message(properties) { + if (properties) { + var keys = Object.keys(properties); + for (var i = 0; i < keys.length; ++i) + this[keys[i]] = properties[keys[i]]; + } +} + +/** @alias Message.prototype */ +var MessagePrototype = Message.prototype; + +/** + * Converts this message to a JSON object. + * @param {Object.} [options] Conversion options + * @param {boolean} [options.fieldsOnly=false] Converts only properties that reference a field + * @param {*} [options.long] Long conversion type. Only relevant with a long library. + * Valid values are `String` and `Number` (the global types). + * Defaults to a possibly unsafe number without, and a `Long` with a long library. + * @param {*} [options.enum=Number] Enum value conversion type. + * Valid values are `String` and `Number` (the global types). + * Defaults to the numeric ids. + * @param {boolean} [options.defaults=false] Also sets default values on the resulting object + * @returns {Object.} JSON object + */ +MessagePrototype.asJSON = function asJSON(options) { + if (!options) + options = {}; + var fields = this.$type.fields, + json = {}; + var keys; + if (options.defaults) { + keys = []; + for (var k in this) // eslint-disable-line guard-for-in + keys.push(k); + } else + keys = Object.keys(this); + for (var i = 0, key; i < keys.length; ++i) { + var field = fields[key = keys[i]], + value = this[key]; + if (field) { + if (field.repeated) { + if (value && value.length) { + var array = new Array(value.length); + for (var j = 0, l = value.length; j < l; ++j) + array[j] = field.jsonConvert(value[j], options); + json[key] = array; + } + } else + json[key] = field.jsonConvert(value, options); + } else if (!options.fieldsOnly) + json[key] = value; + } + return json; +}; + +/** + * Reference to the reflected type. + * @name Message.$type + * @type {Type} + * @readonly + */ + +/** + * Reference to the reflected type. + * @name Message#$type + * @type {Type} + * @readonly + */ + +/** + * Encodes a message of this type. + * @param {Message|Object} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + */ +Message.encode = function encode(message, writer) { + return this.$type.encode(message, writer); +}; + +/** + * Encodes a message of this type preceeded by its length as a varint. + * @param {Message|Object} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + */ +Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.$type.encodeDelimited(message, writer); +}; + +/** + * Decodes a message of this type. + * @name Message.decode + * @function + * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode + * @returns {Message} Decoded message + */ +Message.decode = function decode(readerOrBuffer) { + return this.$type.decode(readerOrBuffer); +}; + +/** + * Decodes a message of this type preceeded by its length as a varint. + * @name Message.decodeDelimited + * @function + * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode + * @returns {Message} Decoded message + */ +Message.decodeDelimited = function decodeDelimited(readerOrBuffer) { + return this.$type.decodeDelimited(readerOrBuffer); +}; + +/** + * Verifies a message of this type. + * @name Message.verify + * @function + * @param {Message|Object} message Message or plain object to verify + * @returns {?string} `null` if valid, otherwise the reason why it is not + */ +Message.verify = function verify(message) { + return this.$type.verify(message); +}; + +},{}],12:[function(require,module,exports){ "use strict"; module.exports = Method; -var ReflectionObject = require(13); +var ReflectionObject = require(14); /** @alias Method.prototype */ var MethodPrototype = ReflectionObject.extend(Method); @@ -1562,7 +1641,7 @@ var Type = require(23), var _TypeError = util._TypeError; /** - * Constructs a new service method. + * Constructs a new service method instance. * @classdesc Reflected service method. * @extends ReflectionObject * @constructor @@ -1685,17 +1764,17 @@ MethodPrototype.resolve = function resolve() { return ReflectionObject.prototype.resolve.call(this); }; -},{"13":13,"23":23,"25":25}],12:[function(require,module,exports){ +},{"14":14,"23":23,"25":25}],13:[function(require,module,exports){ "use strict"; module.exports = Namespace; -var ReflectionObject = require(13); +var ReflectionObject = require(14); /** @alias Namespace.prototype */ var NamespacePrototype = ReflectionObject.extend(Namespace); -var Enum = require(7), +var Enum = require(8), Type = require(23), - Field = require(8), + Field = require(9), Service = require(21), util = require(25); @@ -1705,7 +1784,7 @@ var nestedTypes = [ Enum, Type, Service, Field, Namespace ], nestedError = "one of " + nestedTypes.map(function(ctor) { return ctor.name; }).join(', '); /** - * Constructs a new namespace. + * Constructs a new namespace instance. * @classdesc Reflected namespace and base class of all reflection objects containing nested objects. * @extends ReflectionObject * @constructor @@ -1956,7 +2035,7 @@ NamespacePrototype.lookup = function lookup(path, parentAlreadyChecked) { return this.parent.lookup(path); }; -},{"13":13,"21":21,"23":23,"25":25,"7":7,"8":8}],13:[function(require,module,exports){ +},{"14":14,"21":21,"23":23,"25":25,"8":8,"9":9}],14:[function(require,module,exports){ "use strict"; module.exports = ReflectionObject; @@ -1968,7 +2047,7 @@ var Root = require(18), var _TypeError = util._TypeError; /** - * Constructs a new reflection object. + * Constructs a new reflection object instance. * @classdesc Base class of all reflection objects. * @constructor * @param {string} name Object name @@ -2049,14 +2128,14 @@ util.props(ReflectionObjectPrototype, { * Lets the specified constructor extend this class. * @memberof ReflectionObject * @param {*} constructor Extending constructor - * @returns {Object} Prototype + * @returns {Object} Constructor prototype * @this ReflectionObject */ function extend(constructor) { - var proto = constructor.prototype = Object.create(this.prototype); - proto.constructor = constructor; + var prototype = constructor.prototype = Object.create(this.prototype); + prototype.constructor = constructor; constructor.extend = extend; - return proto; + return prototype; } /** @@ -2155,21 +2234,21 @@ ReflectionObjectPrototype.toString = function toString() { return this.constructor.name + " " + this.getFullName(); }; -},{"18":18,"25":25}],14:[function(require,module,exports){ +},{"18":18,"25":25}],15:[function(require,module,exports){ "use strict"; module.exports = OneOf; -var ReflectionObject = require(13); +var ReflectionObject = require(14); /** @alias OneOf.prototype */ var OneOfPrototype = ReflectionObject.extend(OneOf); -var Field = require(8), +var Field = require(9), util = require(25); var _TypeError = util._TypeError; /** - * Constructs a new oneof. + * Constructs a new oneof instance. * @classdesc Reflected oneof. * @extends ReflectionObject * @constructor @@ -2308,19 +2387,19 @@ OneOfPrototype.onRemove = function onRemove(parent) { ReflectionObject.prototype.onRemove.call(this, parent); }; -},{"13":13,"25":25,"8":8}],15:[function(require,module,exports){ +},{"14":14,"25":25,"9":9}],16:[function(require,module,exports){ "use strict"; module.exports = parse; var tokenize = require(22), Root = require(18), Type = require(23), - Field = require(8), + Field = require(9), MapField = require(10), - OneOf = require(14), - Enum = require(7), + OneOf = require(15), + Enum = require(8), Service = require(21), - Method = require(11), + Method = require(12), types = require(24), util = require(25); var camelCase = util.camelCase; @@ -2864,73 +2943,7 @@ function parse(source, root) { }; } -},{"10":10,"11":11,"14":14,"18":18,"21":21,"22":22,"23":23,"24":24,"25":25,"7":7,"8":8}],16:[function(require,module,exports){ -"use strict"; -module.exports = Prototype; - -/** - * Constructs a new prototype. - * This method should be called from your custom constructors, i.e. `Prototype.call(this, properties)`. - * @classdesc Runtime message prototype ready to be extended by custom classes or generated code. - * @constructor - * @param {Object.} [properties] Properties to set - * @abstract - * @see {@link inherits} - * @see {@link Class} - */ -function Prototype(properties) { - if (properties) { - var keys = Object.keys(properties); - for (var i = 0; i < keys.length; ++i) - this[keys[i]] = properties[keys[i]]; - } -} - -/** - * Converts a runtime message to a JSON object. - * @param {Object.} [options] Conversion options - * @param {boolean} [options.fieldsOnly=false] Converts only properties that reference a field - * @param {*} [options.long] Long conversion type. Only relevant with a long library. - * Valid values are `String` and `Number` (the global types). - * Defaults to a possibly unsafe number without, and a `Long` with a long library. - * @param {*} [options.enum=Number] Enum value conversion type. - * Valid values are `String` and `Number` (the global types). - * Defaults to the numeric ids. - * @param {boolean} [options.defaults=false] Also sets default values on the resulting object - * @returns {Object.} JSON object - */ -Prototype.prototype.asJSON = function asJSON(options) { - if (!options) - options = {}; - var fields = this.constructor.$type.fields, - json = {}; - var keys; - if (options.defaults) { - keys = []; - for (var k in this) // eslint-disable-line guard-for-in - keys.push(k); - } else - keys = Object.keys(this); - for (var i = 0, key; i < keys.length; ++i) { - var field = fields[key = keys[i]], - value = this[key]; - if (field) { - if (field.repeated) { - if (value && value.length) { - var array = new Array(value.length); - for (var j = 0, l = value.length; j < l; ++j) - array[j] = field.jsonConvert(value[j], options); - json[key] = array; - } - } else - json[key] = field.jsonConvert(value, options); - } else if (!options.fieldsOnly) - json[key] = value; - } - return json; -}; - -},{}],17:[function(require,module,exports){ +},{"10":10,"12":12,"15":15,"18":18,"21":21,"22":22,"23":23,"24":24,"25":25,"8":8,"9":9}],17:[function(require,module,exports){ "use strict"; module.exports = Reader; @@ -2969,7 +2982,7 @@ function configure() { Reader.configure = configure; /** - * Constructs a new reader using the specified buffer. + * Constructs a new reader instance using the specified buffer. * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. * @constructor * @param {Uint8Array} buffer Buffer to read from @@ -3488,7 +3501,7 @@ var initBufferReader = function() { }; /** - * Constructs a new buffer reader. + * Constructs a new buffer reader instance. * @classdesc Wire format reader using node buffers. * @extends Reader * @constructor @@ -3567,16 +3580,16 @@ configure(); "use strict"; module.exports = Root; -var Namespace = require(12); +var Namespace = require(13); /** @alias Root.prototype */ var RootPrototype = Namespace.extend(Root); -var Field = require(8), +var Field = require(9), util = require(25), - common = require(6); + common = require(7); /** - * Constructs a new root namespace. + * Constructs a new root namespace instance. * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. * @extends Namespace * @constructor @@ -3621,7 +3634,7 @@ Root.fromJSON = function fromJSON(json, root) { RootPrototype.resolvePath = util.resolvePath; // A symbol-like function to safely signal synchronous loading -function SYNC() {} +function SYNC() {} // eslint-disable-line no-empty-function /** * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. @@ -3653,7 +3666,7 @@ RootPrototype.load = function load(filename, callback) { if (!util.isString(source)) self.setOptions(source.options).addJSON(source.nested); else { - var parsed = require(15)(source, self); + var parsed = require(16)(source, self); if (parsed.imports) parsed.imports.forEach(function(name) { fetch(self.resolvePath(filename, name)); @@ -3844,11 +3857,11 @@ RootPrototype.toString = function toString() { return this.constructor.name; }; -},{"12":12,"15":15,"25":25,"6":6,"8":8}],19:[function(require,module,exports){ +},{"13":13,"16":16,"25":25,"7":7,"9":9}],19:[function(require,module,exports){ "use strict"; /** - * RPC helpers. + * Streaming RPC helpers. * @namespace */ var rpc = exports; @@ -3862,7 +3875,7 @@ module.exports = Service; var EventEmitter = require(26); /** - * Constructs a new RPC service. + * Constructs a new RPC service instance. * @classdesc An RPC service as returned by {@link Service#create}. * @memberof rpc * @extends util.EventEmitter @@ -3902,18 +3915,18 @@ ServicePrototype.end = function end(endedByRPC) { "use strict"; module.exports = Service; -var Namespace = require(12); +var Namespace = require(13); /** @alias Namespace.prototype */ var NamespacePrototype = Namespace.prototype; /** @alias Service.prototype */ var ServicePrototype = Namespace.extend(Service); -var Method = require(11), +var Method = require(12), util = require(25), rpc = require(19); /** - * Constructs a new service. + * Constructs a new service instance. * @classdesc Reflected service. * @extends Namespace * @constructor @@ -4100,7 +4113,7 @@ ServicePrototype.create = function create(rpcImpl, requestDelimited, responseDel return rpcService; }; -},{"11":11,"12":12,"19":19,"25":25}],22:[function(require,module,exports){ +},{"12":12,"13":13,"19":19,"25":25}],22:[function(require,module,exports){ "use strict"; module.exports = tokenize; @@ -4311,25 +4324,25 @@ function tokenize(source) { "use strict"; module.exports = Type; -var Namespace = require(12); +var Namespace = require(13); /** @alias Namespace.prototype */ var NamespacePrototype = Namespace.prototype; /** @alias Type.prototype */ var TypePrototype = Namespace.extend(Type); -var Enum = require(7), - OneOf = require(14), - Field = require(8), +var Enum = require(8), + OneOf = require(15), + Field = require(9), Service = require(21), - Prototype = require(16), + Class = require(2), + Message = require(11), Reader = require(17), Writer = require(30), - inherits = require(9), util = require(25), - codegen = require(2); + codegen = require(3); /** - * Constructs a new message type. + * Constructs a new reflected message type instance. * @classdesc Reflected message type. * @extends Namespace * @constructor @@ -4463,28 +4476,15 @@ util.props(TypePrototype, { /** * The registered constructor, if any registered, otherwise a generic constructor. * @name Type#ctor - * @type {Prototype} + * @type {Class} */ ctor: { get: function getCtor() { - if (this._ctor) - return this._ctor; - var ctor; - if (codegen.supported) - ctor = codegen("p")("P.call(this,p)").eof(this.getFullName() + "$ctor", { - P: Prototype - }); - else - ctor = function GenericMessage(properties) { - Prototype.call(this, properties); - }; - ctor.prototype = inherits(ctor, this); - this._ctor = ctor; - return ctor; + return this._ctor || (this._ctor = Class.create(this).constructor); }, set: function setCtor(ctor) { - if (ctor && !(ctor.prototype instanceof Prototype)) - throw util._TypeError("ctor", "a constructor inheriting from Prototype"); + if (ctor && !(ctor.prototype instanceof Message)) + throw util._TypeError("ctor", "a constructor inheriting from Message"); this._ctor = ctor; } } @@ -4634,27 +4634,15 @@ TypePrototype.remove = function remove(object) { /** * Creates a new message of this type using the specified properties. * @param {Object|*} [properties] Properties to set - * @param {*} [ctor] Constructor to use. - * Defaults to use the internal constuctor. - * @returns {Prototype} Message instance - */ -TypePrototype.create = function create(properties, ctor) { - if (!properties || typeof properties === 'function') { - ctor = properties; - properties = undefined; - } else if (properties /* already */ instanceof Prototype) - return properties; - if (ctor) { - if (!(ctor.prototype instanceof Prototype)) - throw util._TypeError("ctor", "a constructor inheriting from Prototype"); - } else - ctor = this.getCtor(); - return new ctor(properties); + * @returns {Message} Runtime message + */ +TypePrototype.create = function create(properties) { + return new (this.getCtor())(properties); }; /** * Encodes a message of this type. - * @param {Prototype|Object} message Message instance or plain object + * @param {Message|Object} message Message instance or plain object * @param {Writer} [writer] Writer to encode to * @returns {Writer} writer */ @@ -4671,7 +4659,7 @@ TypePrototype.encode = function encode(message, writer) { /** * Encodes a message of this type preceeded by its byte length as a varint. - * @param {Prototype|Object} message Message instance or plain object + * @param {Message|Object} message Message instance or plain object * @param {Writer} [writer] Writer to encode to * @returns {Writer} writer */ @@ -4683,7 +4671,7 @@ TypePrototype.encodeDelimited = function encodeDelimited(message, writer) { * Decodes a message of this type. * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from * @param {number} [length] Length of the message, if known beforehand - * @returns {Prototype} Decoded message + * @returns {Message} Decoded message */ TypePrototype.decode = function decode(readerOrBuffer, length) { return (this.decode = codegen.supported @@ -4699,7 +4687,7 @@ TypePrototype.decode = function decode(readerOrBuffer, length) { /** * Decodes a message of this type preceeded by its byte length as a varint. * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from - * @returns {Prototype} Decoded message + * @returns {Message} Decoded message */ TypePrototype.decodeDelimited = function decodeDelimited(readerOrBuffer) { readerOrBuffer = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer); @@ -4708,7 +4696,7 @@ TypePrototype.decodeDelimited = function decodeDelimited(readerOrBuffer) { /** * Verifies that enum values are valid and that any required fields are present. - * @param {Prototype|Object} message Message to verify + * @param {Message|Object} message Message to verify * @returns {?string} `null` if valid, otherwise the reason why it is not */ TypePrototype.verify = function verify(message) { @@ -4720,7 +4708,7 @@ TypePrototype.verify = function verify(message) { ).call(this, message); }; -},{"12":12,"14":14,"16":16,"17":17,"2":2,"21":21,"25":25,"30":30,"7":7,"8":8,"9":9}],24:[function(require,module,exports){ +},{"11":11,"13":13,"15":15,"17":17,"2":2,"21":21,"25":25,"3":3,"30":30,"8":8,"9":9}],24:[function(require,module,exports){ "use strict"; /** @@ -4855,7 +4843,7 @@ types.packed = bake([ "use strict"; /** - * Utility functions. + * Various utility functions. * @namespace */ var util = exports; @@ -5137,7 +5125,7 @@ util.merge(util, require(29)); module.exports = EventEmitter; /** - * Constructs a new event emitter. + * Constructs a new event emitter instance. * @classdesc A minimal event emitter. * @memberof util * @constructor @@ -5582,7 +5570,7 @@ var LongBits = util.LongBits, ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; /** - * Constructs a new writer operation. + * Constructs a new writer operation instance. * @classdesc Scheduled writer operation. * @memberof Writer * @constructor @@ -5624,7 +5612,7 @@ Writer.Op = Op; function noop() {} // eslint-disable-line no-empty-function /** - * Constructs a new writer state. + * Constructs a new writer state instance. * @classdesc Copied writer state. * @memberof Writer * @constructor @@ -5663,7 +5651,7 @@ function State(writer, next) { Writer.State = State; /** - * Constructs a new writer. + * Constructs a new writer instance. * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. * @constructor */ @@ -6118,7 +6106,7 @@ WriterPrototype.finish = function finish() { }; /** - * Constructs a new buffer writer. + * Constructs a new buffer writer instance. * @classdesc Wire format writer using node buffers. * @exports BufferWriter * @extends Writer @@ -6263,7 +6251,7 @@ function load(filename, root, callback) { protobuf.load = load; /** - * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace. + * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). * @param {string|string[]} filename One or multiple files to load * @param {Root} [root] Root namespace, defaults to create a new one if omitted. * @returns {Root} Root namespace @@ -6279,34 +6267,34 @@ protobuf.loadSync = loadSync; // Parser protobuf.tokenize = require(22); -protobuf.parse = require(15); +protobuf.parse = require(16); // Serialization protobuf.Writer = require(30); protobuf.BufferWriter = protobuf.Writer.BufferWriter; protobuf.Reader = require(17); protobuf.BufferReader = protobuf.Reader.BufferReader; -protobuf.codegen = require(2); +protobuf.codegen = require(3); // Reflection -protobuf.ReflectionObject = require(13); -protobuf.Namespace = require(12); +protobuf.ReflectionObject = require(14); +protobuf.Namespace = require(13); protobuf.Root = require(18); -protobuf.Enum = require(7); +protobuf.Enum = require(8); protobuf.Type = require(23); -protobuf.Field = require(8); -protobuf.OneOf = require(14); +protobuf.Field = require(9); +protobuf.OneOf = require(15); protobuf.MapField = require(10); protobuf.Service = require(21); -protobuf.Method = require(11); +protobuf.Method = require(12); // Runtime -protobuf.Prototype = require(16); -protobuf.inherits = require(9); +protobuf.Class = require(2); +protobuf.Message = require(11); // Utility protobuf.types = require(24); -protobuf.common = require(6); +protobuf.common = require(7); protobuf.rpc = require(19); protobuf.util = require(25); @@ -6322,7 +6310,7 @@ if (typeof define === 'function' && define.amd) }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"10":10,"11":11,"12":12,"13":13,"14":14,"15":15,"16":16,"17":17,"18":18,"19":19,"2":2,"21":21,"22":22,"23":23,"24":24,"25":25,"30":30,"6":6,"7":7,"8":8,"9":9}]},{},[31]) +},{"10":10,"11":11,"12":12,"13":13,"14":14,"15":15,"16":16,"17":17,"18":18,"19":19,"2":2,"21":21,"22":22,"23":23,"24":24,"25":25,"3":3,"30":30,"7":7,"8":8,"9":9}]},{},[31]) //# sourceMappingURL=protobuf.js.map diff --git a/dist/protobuf.js.map b/dist/protobuf.js.map index 4aaee6726..235a43c1e 100644 --- a/dist/protobuf.js.map +++ b/dist/protobuf.js.map @@ -1 +1 @@ -{"version":3,"sources":["node_modules/browser-pack/_prelude.js","lib/ieee754.js","src/codegen.js","src/codegen/decode.js","src/codegen/encode.js","src/codegen/verify.js","src/common.js","src/enum.js","src/field.js","src/inherits.js","src/mapfield.js","src/method.js","src/namespace.js","src/object.js","src/oneof.js","src/parse.js","src/prototype.js","src/reader.js","src/root.js","src/rpc.js","src/rpc/service.js","src/service.js","src/tokenize.js","src/type.js","src/types.js","src/util.js","src/util/eventemitter.js","src/util/longbits.js","src/util/pool.js","src/util/runtime.js","src/writer.js","src/index.js"],"names":[],"mappings":";;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1iBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACpoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"protobuf.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o> 1,\r\n nBits = -7,\r\n i = isBE ? 0 : (nBytes - 1),\r\n d = isBE ? 1 : -1,\r\n s = buffer[offset + i];\r\n\r\n i += d;\r\n\r\n e = s & ((1 << (-nBits)) - 1);\r\n s >>= (-nBits);\r\n nBits += eLen;\r\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n m = e & ((1 << (-nBits)) - 1);\r\n e >>= (-nBits);\r\n nBits += mLen;\r\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n if (e === 0) {\r\n e = 1 - eBias;\r\n } else if (e === eMax) {\r\n return m ? NaN : ((s ? -1 : 1) * Infinity);\r\n } else {\r\n m = m + Math.pow(2, mLen);\r\n e = e - eBias;\r\n }\r\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen);\r\n};\r\n\r\nexports.write = function writeIEEE754(buffer, value, offset, isBE, mLen, nBytes) {\r\n var e, m, c,\r\n eLen = nBytes * 8 - mLen - 1,\r\n eMax = (1 << eLen) - 1,\r\n eBias = eMax >> 1,\r\n rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),\r\n i = isBE ? (nBytes - 1) : 0,\r\n d = isBE ? -1 : 1,\r\n s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;\r\n\r\n value = Math.abs(value);\r\n\r\n if (isNaN(value) || value === Infinity) {\r\n m = isNaN(value) ? 1 : 0;\r\n e = eMax;\r\n } else {\r\n e = Math.floor(Math.log(value) / Math.LN2);\r\n if (value * (c = Math.pow(2, -e)) < 1) {\r\n e--;\r\n c *= 2;\r\n }\r\n if (e + eBias >= 1) {\r\n value += rt / c;\r\n } else {\r\n value += rt * Math.pow(2, 1 - eBias);\r\n }\r\n if (value * c >= 2) {\r\n e++;\r\n c /= 2;\r\n }\r\n\r\n if (e + eBias >= eMax) {\r\n m = 0;\r\n e = eMax;\r\n } else if (e + eBias >= 1) {\r\n m = (value * c - 1) * Math.pow(2, mLen);\r\n e = e + eBias;\r\n } else {\r\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\r\n e = 0;\r\n }\r\n }\r\n\r\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);\r\n\r\n e = (e << mLen) | m;\r\n eLen += mLen;\r\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);\r\n\r\n buffer[offset + i - d] |= s * 128;\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\nvar util = require(25);\r\n\r\nvar blockOpenRe = /[{[]$/,\r\n blockCloseRe = /^[}\\]]/,\r\n casingRe = /:$/,\r\n branchRe = /^\\s*(?:if|else if|while|for)\\b|\\b(?:else)\\s*$/,\r\n breakRe = /\\b(?:break|continue);?$|^\\s*return\\b/;\r\n\r\n/**\r\n * A closure for generating functions programmatically.\r\n * @namespace\r\n * @function\r\n * @param {...string} params Function parameter names\r\n * @returns {CodegenInstance} Codegen instance\r\n * @property {boolean} supported Whether code generation is supported by the environment.\r\n * @property {boolean} verbose=false When set to true, codegen will log generated code to console. Useful for debugging.\r\n */\r\nfunction codegen() {\r\n var args = Array.prototype.slice.call(arguments),\r\n src = ['\\t\"use strict\"'],\r\n indent = 1,\r\n inCase = false;\r\n\r\n /**\r\n * A codegen instance as returned by {@link codegen}, that also is a {@link util.sprintf|sprintf}-like appender function.\r\n * @typedef CodegenInstance\r\n * @type {function}\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {CodegenInstance} Itself\r\n * @property {function(string=):string} str Stringifies the so far generated function source.\r\n * @property {function(string=, Object=):function} eof Ends generation and builds the function whilst applying a scope.\r\n */\r\n /**/\r\n function gen() {\r\n var line = util.sprintf.apply(null, arguments);\r\n var level = indent;\r\n if (src.length) {\r\n var prev = src[src.length - 1];\r\n\r\n // block open or one time branch\r\n if (blockOpenRe.test(prev))\r\n level = ++indent; // keep\r\n else if (branchRe.test(prev))\r\n ++level; // once\r\n \r\n // casing\r\n if (casingRe.test(prev) && !casingRe.test(line)) {\r\n level = ++indent;\r\n inCase = true;\r\n } else if (inCase && breakRe.test(prev)) {\r\n level = --indent;\r\n inCase = false;\r\n }\r\n\r\n // block close\r\n if (blockCloseRe.test(line))\r\n level = --indent;\r\n }\r\n for (var index = 0; index < level; ++index)\r\n line = \"\\t\" + line;\r\n src.push(line);\r\n return gen;\r\n }\r\n\r\n /**\r\n * Stringifies the so far generated function source.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @returns {string} Function source using tabs for indentation\r\n * @inner\r\n */\r\n function str(name) {\r\n return \"function \" + (name ? name.replace(/[^\\w_$]/g, \"_\") : \"\") + \"(\" + args.join(\", \") + \") {\\n\" + src.join(\"\\n\") + \"\\n}\";\r\n }\r\n\r\n gen.str = str;\r\n\r\n /**\r\n * Ends generation and builds the function whilst applying a scope.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @param {Object} [scope] Function scope\r\n * @returns {function} The generated function, with scope applied if specified\r\n * @inner\r\n */\r\n function eof(name, scope) {\r\n if (typeof name === 'object') {\r\n scope = name;\r\n name = undefined;\r\n }\r\n var source = gen.str(name);\r\n if (codegen.verbose)\r\n console.log(\"--- codegen ---\\n\" + source.replace(/^/mg, \"> \").replace(/\\t/g, \" \")); // eslint-disable-line no-console\r\n var keys = Object.keys(scope || (scope = {}));\r\n return Function.apply(null, keys.concat(\"return \" + source)).apply(null, keys.map(function(key) { return scope[key]; })); // eslint-disable-line no-new-func\r\n // ^ Creates a wrapper function with the scoped variable names as its parameters,\r\n // calls it with the respective scoped variable values ^\r\n // and returns our brand-new properly scoped function.\r\n //\r\n // This works because \"Invoking the Function constructor as a function (without using the\r\n // new operator) has the same effect as invoking it as a constructor.\"\r\n // https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Function\r\n }\r\n\r\n gen.eof = eof;\r\n\r\n return gen;\r\n}\r\n\r\ncodegen.supported = false; try { codegen.supported = codegen(\"a\",\"b\")(\"return a-b\").eof()(2,1) === 1; } catch (e) {} // eslint-disable-line no-empty\r\ncodegen.verbose = false;\r\n\r\ncodegen.encode = require(4);\r\ncodegen.decode = require(3);\r\ncodegen.verify = require(5);\r\n","\"use strict\";\r\n\r\n/**\r\n * Wire format decoder using code generation on top of reflection that also provides a fallback.\r\n * @exports codegen.decode\r\n * @namespace\r\n */\r\nvar decode = exports;\r\n\r\nvar Enum = require(7),\r\n Reader = require(17),\r\n types = require(24),\r\n util = require(25),\r\n codegen = require(2);\r\n\r\n/**\r\n * Decodes a message of `this` message's type.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Prototype} Populated runtime message\r\n * @this Type\r\n */\r\ndecode.fallback = function decode_fallback(readerOrBuffer, length) {\r\n /* eslint-disable no-invalid-this, block-scoped-var, no-redeclare */\r\n var fields = this.getFieldsById(),\r\n reader = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer),\r\n limit = length === undefined ? reader.len : reader.pos + length,\r\n message = new (this.getCtor())();\r\n while (reader.pos < limit) {\r\n var tag = reader.tag(),\r\n field = fields[tag.id].resolve(),\r\n type = field.resolvedType instanceof Enum ? \"uint32\" : field.type;\r\n \r\n // Known fields\r\n if (field) {\r\n\r\n // Map fields\r\n if (field.map) {\r\n var keyType = field.resolvedKeyType /* only valid is enum */ ? \"uint32\" : field.keyType,\r\n length = reader.uint32();\r\n var map = message[field.name] = {};\r\n if (length) {\r\n length += reader.pos;\r\n var ks = [], vs = [];\r\n while (reader.pos < length) {\r\n if (reader.tag().id === 1)\r\n ks[ks.length] = reader[keyType]();\r\n else if (types.basic[type] !== undefined)\r\n vs[vs.length] = reader[type]();\r\n else\r\n vs[vs.length] = field.resolvedType.decode(reader, reader.uint32());\r\n }\r\n for (var i = 0; i < ks.length; ++i)\r\n map[typeof ks[i] === 'object' ? util.longToHash(ks[i]) : ks[i]] = vs[i];\r\n }\r\n\r\n // Repeated fields\r\n } else if (field.repeated) {\r\n var values = message[field.name] && message[field.name].length ? message[field.name] : message[field.name] = [];\r\n\r\n // Packed\r\n if (field.packed && types.packed[type] !== undefined && tag.wireType === 2) {\r\n var plimit = reader.uint32() + reader.pos;\r\n while (reader.pos < plimit)\r\n values[values.length] = reader[type]();\r\n\r\n // Non-packed\r\n } else if (types.basic[type] !== undefined)\r\n values[values.length] = reader[type]();\r\n else\r\n values[values.length] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Non-repeated\r\n } else if (types.basic[type] !== undefined)\r\n message[field.name] = reader[type]();\r\n else\r\n message[field.name] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Unknown fields\r\n } else\r\n reader.skipType(tag.wireType);\r\n }\r\n return message;\r\n /* eslint-enable no-invalid-this, block-scoped-var, no-redeclare */\r\n};\r\n\r\n/**\r\n * Generates a decoder specific to the specified message type, with an identical signature to {@link codegen.decode.fallback}.\r\n * @param {Type} mtype Message type\r\n * @returns {CodegenInstance} {@link codegen|Codegen} instance\r\n */\r\ndecode.generate = function decode_generate(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n var fields = mtype.getFieldsArray(); \r\n var gen = codegen(\"r\", \"l\")\r\n\r\n (\"r instanceof Reader||(r=Reader.create(r))\")\r\n (\"var c=l===undefined?r.len:r.pos+l,m=new(this.getCtor())\")\r\n (\"while(r.pos} [values] Enum values as an object, by name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Enum(name, values, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Enum values by name.\r\n * @type {Object.}\r\n */\r\n this.values = values || {}; // toJSON, marker\r\n\r\n /**\r\n * Cached values by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._valuesById = null;\r\n}\r\n\r\nutil.props(EnumPrototype, {\r\n\r\n /**\r\n * Enum values by id.\r\n * @name Enum#valuesById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n valuesById: {\r\n get: function getValuesById() {\r\n if (!this._valuesById) {\r\n this._valuesById = {};\r\n Object.keys(this.values).forEach(function(name) {\r\n var id = this.values[name];\r\n if (this._valuesById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._valuesById[id] = name;\r\n }, this);\r\n }\r\n return this._valuesById;\r\n }\r\n }\r\n\r\n /**\r\n * Gets this enum's values by id. This is an alias of {@link Enum#valuesById}'s getter for use within non-ES5 environments.\r\n * @name Enum#getValuesById\r\n * @function\r\n * @returns {Object.}\r\n */\r\n});\r\n\r\nfunction clearCache(enm) {\r\n enm._valuesById = null;\r\n return enm;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes an enum.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes an enum\r\n */\r\nEnum.testJSON = function testJSON(json) {\r\n return Boolean(json && json.values);\r\n};\r\n\r\n/**\r\n * Creates an enum from JSON.\r\n * @param {string} name Enum name\r\n * @param {Object.} json JSON object\r\n * @returns {Enum} Created enum\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nEnum.fromJSON = function fromJSON(name, json) {\r\n return new Enum(name, json.values, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nEnumPrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n values : this.values\r\n };\r\n};\r\n\r\n/**\r\n * Adds a value to this enum.\r\n * @param {string} name Value name\r\n * @param {number} id Value id\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a value with this name or id\r\n */\r\nEnumPrototype.add = function(name, id) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (this.values[name] !== undefined)\r\n throw Error('duplicate name \"' + name + '\" in ' + this);\r\n if (this.getValuesById()[id] !== undefined)\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this.values[name] = id;\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a value from this enum\r\n * @param {string} name Value name\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `name` is not a name of this enum\r\n */\r\nEnumPrototype.remove = function(name) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (this.values[name] === undefined)\r\n throw Error('\"' + name + '\" is not a name of ' + this);\r\n delete this.values[name];\r\n return clearCache(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Field;\r\n\r\nvar ReflectionObject = require(13);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = ReflectionObject.extend(Field);\r\n\r\nvar Type = require(23),\r\n Enum = require(7),\r\n MapField = require(10),\r\n types = require(24),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new message field. Note that {@link MapField|map fields} have their own class.\r\n * @classdesc Reflected message field.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object} [rule=\"optional\"] Field rule\r\n * @param {string|Object} [extend] Extended type if different from parent\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Field(name, id, type, rule, extend, options) {\r\n if (util.isObject(rule)) {\r\n options = rule;\r\n rule = extend = undefined;\r\n } else if (util.isObject(extend)) {\r\n options = extend;\r\n extend = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (!util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (extend !== undefined && !util.isString(extend))\r\n throw _TypeError(\"extend\");\r\n if (rule !== undefined && !/^required|optional|repeated$/.test(rule = rule.toString().toLowerCase()))\r\n throw _TypeError(\"rule\", \"a valid rule string\");\r\n\r\n /**\r\n * Field rule, if any.\r\n * @type {string|undefined}\r\n */\r\n this.rule = rule && rule !== 'optional' ? rule : undefined; // toJSON\r\n\r\n /**\r\n * Field type.\r\n * @type {string}\r\n */\r\n this.type = type; // toJSON\r\n\r\n /**\r\n * Unique field id.\r\n * @type {number}\r\n */\r\n this.id = id; // toJSON, marker\r\n\r\n /**\r\n * Extended type if different from parent.\r\n * @type {string|undefined}\r\n */\r\n this.extend = extend || undefined; // toJSON\r\n\r\n /**\r\n * Whether this field is required.\r\n * @type {boolean}\r\n */\r\n this.required = rule === \"required\";\r\n\r\n /**\r\n * Whether this field is optional.\r\n * @type {boolean}\r\n */\r\n this.optional = !this.required;\r\n\r\n /**\r\n * Whether this field is repeated.\r\n * @type {boolean}\r\n */\r\n this.repeated = rule === \"repeated\";\r\n\r\n /**\r\n * Whether this field is a map or not.\r\n * @type {boolean}\r\n */\r\n this.map = false;\r\n\r\n /**\r\n * Message this field belongs to.\r\n * @type {?Type}\r\n */\r\n this.message = null;\r\n\r\n /**\r\n * OneOf this field belongs to, if any,\r\n * @type {?OneOf}\r\n */\r\n this.partOf = null;\r\n\r\n /**\r\n * The field's default value. Only relevant when working with proto2.\r\n * @type {*}\r\n */\r\n this.defaultValue = null;\r\n\r\n /**\r\n * Whether this field's value should be treated as a long.\r\n * @type {boolean}\r\n */\r\n this.long = util.Long ? types.long[type] !== undefined : false;\r\n\r\n /**\r\n * Resolved type if not a basic type.\r\n * @type {?(Type|Enum)}\r\n */\r\n this.resolvedType = null;\r\n\r\n /**\r\n * Sister-field within the extended type if a declaring extension field.\r\n * @type {?Field}\r\n */\r\n this.extensionField = null;\r\n\r\n /**\r\n * Sister-field within the declaring namespace if an extended field.\r\n * @type {?Field}\r\n */\r\n this.declaringField = null;\r\n\r\n /**\r\n * Internally remembers whether this field is packed.\r\n * @type {?boolean}\r\n * @private\r\n */\r\n this._packed = null;\r\n}\r\n\r\nutil.props(FieldPrototype, {\r\n\r\n /**\r\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\r\n * @name Field#packed\r\n * @type {boolean}\r\n * @readonly\r\n */\r\n packed: {\r\n get: FieldPrototype.isPacked = function() {\r\n if (this._packed === null)\r\n this._packed = this.getOption(\"packed\") !== false;\r\n return this._packed;\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether this field is packed. This is an alias of {@link Field#packed}'s getter for use within non-ES5 environments.\r\n * @name Field#isPacked\r\n * @function\r\n * @returns {boolean}\r\n */\r\n});\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (name === \"packed\")\r\n this._packed = null;\r\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\r\n};\r\n\r\n/**\r\n * Tests if the specified JSON object describes a field.\r\n * @param {*} json Any JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nField.testJSON = function testJSON(json) {\r\n return Boolean(json && json.id !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {Field} Created field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nField.fromJSON = function fromJSON(name, json) {\r\n if (json.keyType !== undefined)\r\n return MapField.fromJSON(name, json);\r\n return new Field(name, json.id, json.type, json.role, json.extend, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n rule : this.rule !== \"optional\" && this.rule || undefined,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Resolves this field's type references.\r\n * @returns {Field} `this`\r\n * @throws {Error} If any reference cannot be resolved\r\n */\r\nFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n\r\n var typeDefault = types.defaults[this.type];\r\n\r\n // if not a basic type, resolve it\r\n if (typeDefault === undefined) {\r\n var resolved = this.parent.lookup(this.type);\r\n if (resolved instanceof Type) {\r\n this.resolvedType = resolved;\r\n typeDefault = null;\r\n } else if (resolved instanceof Enum) {\r\n this.resolvedType = resolved;\r\n typeDefault = 0;\r\n } else\r\n throw Error(\"unresolvable field type: \" + this.type);\r\n }\r\n\r\n // when everything is resolved determine the default value\r\n var optionDefault;\r\n if (this.map)\r\n this.defaultValue = {};\r\n else if (this.repeated)\r\n this.defaultValue = [];\r\n else if (this.options && (optionDefault = this.options['default']) !== undefined) // eslint-disable-line dot-notation\r\n this.defaultValue = optionDefault;\r\n else\r\n this.defaultValue = typeDefault;\r\n\r\n if (this.long)\r\n this.defaultValue = util.Long.fromValue(this.defaultValue);\r\n \r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Converts a field value to JSON using the specified options. Note that this method does not account for repeated fields and must be called once for each repeated element instead.\r\n * @param {*} value Field value\r\n * @param {Object.} [options] Conversion options\r\n * @returns {*} Converted value\r\n * @see {@link Prototype#asJSON}\r\n */\r\nFieldPrototype.jsonConvert = function(value, options) {\r\n if (options) {\r\n if (this.resolvedType instanceof Enum && options['enum'] === String) // eslint-disable-line dot-notation\r\n return this.resolvedType.getValuesById()[value];\r\n else if (this.long && options.long)\r\n return options.long === Number\r\n ? typeof value === 'number'\r\n ? value\r\n : util.Long.fromValue(value).toNumber()\r\n : util.Long.fromValue(value, this.type.charAt(0) === 'u').toString();\r\n }\r\n return value;\r\n};\r\n","\"use strict\";\r\nmodule.exports = inherits;\r\n\r\nvar Prototype = require(16),\r\n Type = require(23),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Options passed to {@link inherits}, modifying its behavior.\r\n * @typedef InheritanceOptions\r\n * @type {Object}\r\n * @property {boolean} [noStatics=false] Skips adding the default static methods on top of the constructor\r\n * @property {boolean} [noRegister=false] Skips registering the constructor with the reflected type\r\n */\r\n\r\n/**\r\n * Inherits a custom class from the message prototype of the specified message type.\r\n * @param {*} clazz Inheriting class constructor\r\n * @param {Type} type Inherited message type\r\n * @param {InheritanceOptions} [options] Inheritance options\r\n * @returns {Prototype} Created prototype\r\n */\r\nfunction inherits(clazz, type, options) {\r\n if (typeof clazz !== 'function')\r\n throw _TypeError(\"clazz\", \"a function\");\r\n if (!(type instanceof Type))\r\n throw _TypeError(\"type\", \"a Type\");\r\n if (!options)\r\n options = {};\r\n\r\n /**\r\n * This is not an actual type but stands as a reference for any constructor of a custom message class that you pass to the library.\r\n * @name Class\r\n * @extends Prototype\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set on the message\r\n * @see {@link inherits}\r\n */\r\n\r\n var classProperties = {\r\n\r\n /**\r\n * Reference to the reflected type.\r\n * @name Class.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n $type: {\r\n value: type\r\n }\r\n };\r\n\r\n if (!options.noStatics)\r\n util.merge(classProperties, {\r\n\r\n /**\r\n * Encodes a message of this type to a buffer.\r\n * @name Class.encode\r\n * @function\r\n * @param {Prototype|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n encode: {\r\n value: function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n }\r\n },\r\n\r\n /**\r\n * Encodes a message of this type preceeded by its length as a varint to a buffer.\r\n * @name Class.encodeDelimited\r\n * @function\r\n * @param {Prototype|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n encodeDelimited: {\r\n value: function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n }\r\n },\r\n\r\n /**\r\n * Decodes a message of this type from a buffer.\r\n * @name Class.decode\r\n * @function\r\n * @param {Uint8Array} buffer Buffer to decode\r\n * @returns {Prototype} Decoded message\r\n */\r\n decode: {\r\n value: function decode(buffer) {\r\n return this.$type.decode(buffer);\r\n }\r\n },\r\n\r\n /**\r\n * Decodes a message of this type preceeded by its length as a varint from a buffer.\r\n * @name Class.decodeDelimited\r\n * @function\r\n * @param {Uint8Array} buffer Buffer to decode\r\n * @returns {Prototype} Decoded message\r\n */\r\n decodeDelimited: {\r\n value: function decodeDelimited(buffer) {\r\n return this.$type.decodeDelimited(buffer);\r\n }\r\n },\r\n\r\n /**\r\n * Verifies a message of this type.\r\n * @name Class.verify\r\n * @function\r\n * @param {Prototype|Object} message Message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\n verify: {\r\n value: function verify(message) {\r\n return this.$type.verify(message);\r\n }\r\n }\r\n\r\n }, true);\r\n\r\n util.props(clazz, classProperties);\r\n var prototype = inherits.defineProperties(new Prototype(), type);\r\n clazz.prototype = prototype;\r\n prototype.constructor = clazz;\r\n\r\n if (!options.noRegister)\r\n type.setCtor(clazz);\r\n\r\n return prototype;\r\n}\r\n\r\n/**\r\n * Defines the reflected type's default values and virtual oneof properties on the specified prototype.\r\n * @memberof inherits\r\n * @param {Prototype} prototype Prototype to define properties upon\r\n * @param {Type} type Reflected message type\r\n * @returns {Prototype} The specified prototype\r\n */\r\ninherits.defineProperties = function defineProperties(prototype, type) {\r\n\r\n var prototypeProperties = {\r\n\r\n /**\r\n * Reference to the reflected type.\r\n * @name Prototype#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n $type: {\r\n value: type\r\n }\r\n };\r\n\r\n // Initialize default values\r\n type.getFieldsArray().forEach(function(field) {\r\n field.resolve();\r\n // objects on the prototype must be immmutable. users must assign a new object instance and\r\n // cannot use Array#push on empty arrays on the prototype for example, as this would modify\r\n // the value on the prototype for ALL messages of this type. Hence, these objects are frozen.\r\n prototype[field.name] = Array.isArray(field.defaultValue)\r\n ? util.emptyArray\r\n : util.isObject(field.defaultValue)\r\n ? util.emptyObject\r\n : field.defaultValue;\r\n });\r\n\r\n // Define each oneof with a non-enumerable getter and setter for the present field\r\n type.getOneofsArray().forEach(function(oneof) {\r\n util.prop(prototype, oneof.resolve().name, {\r\n get: function getVirtual() {\r\n // > If the parser encounters multiple members of the same oneof on the wire, only the last member seen is used in the parsed message.\r\n var keys = Object.keys(this);\r\n for (var i = keys.length - 1; i > -1; --i)\r\n if (oneof.oneof.indexOf(keys[i]) > -1)\r\n return keys[i];\r\n return undefined;\r\n },\r\n set: function setVirtual(value) {\r\n var keys = oneof.oneof;\r\n for (var i = 0; i < keys.length; ++i)\r\n if (keys[i] !== value)\r\n delete this[keys[i]];\r\n }\r\n });\r\n });\r\n\r\n util.props(prototype, prototypeProperties);\r\n return prototype;\r\n};\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\nvar Field = require(8);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = Field.prototype;\r\n/** @alias MapField.prototype */\r\nvar MapFieldPrototype = Field.extend(MapField);\r\n\r\nvar Enum = require(7),\r\n types = require(24),\r\n util = require(25);\r\n\r\n/**\r\n * Constructs a new map field.\r\n * @classdesc Reflected map field.\r\n * @extends Field\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} keyType Key type\r\n * @param {string} type Value type\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction MapField(name, id, keyType, type, options) {\r\n Field.call(this, name, id, type, options);\r\n if (!util.isString(keyType))\r\n throw util._TypeError(\"keyType\");\r\n \r\n /**\r\n * Key type.\r\n * @type {string}\r\n */\r\n this.keyType = keyType; // toJSON, marker\r\n\r\n /**\r\n * Resolved key type if not a basic type.\r\n * @type {?ReflectionObject}\r\n */\r\n this.resolvedKeyType = null;\r\n\r\n // Overrides Field#map\r\n this.map = true;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a map field.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nMapField.testJSON = function testJSON(json) {\r\n return Field.testJSON(json) && json.keyType !== undefined;\r\n};\r\n\r\n/**\r\n * Constructs a map field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created map field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMapField.fromJSON = function fromJSON(name, json) {\r\n return new MapField(name, json.id, json.keyType, json.type, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n keyType : this.keyType,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n \r\n // Besides a value type, map fields have a key type to resolve\r\n var keyWireType = types.mapKey[this.keyType];\r\n if (keyWireType === undefined) {\r\n var resolved = this.parent.lookup(this.keyType);\r\n if (!(resolved instanceof Enum))\r\n throw Error(\"unresolvable map key type: \" + this.keyType);\r\n this.resolvedKeyType = resolved;\r\n }\r\n\r\n return FieldPrototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Method;\r\n\r\nvar ReflectionObject = require(13);\r\n/** @alias Method.prototype */\r\nvar MethodPrototype = ReflectionObject.extend(Method);\r\n\r\nvar Type = require(23),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new service method.\r\n * @classdesc Reflected service method.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Method name\r\n * @param {string|undefined} type Method type, usually `\"rpc\"`\r\n * @param {string} requestType Request message type\r\n * @param {string} responseType Response message type\r\n * @param {boolean|Object} [requestStream] Whether the request is streamed\r\n * @param {boolean|Object} [responseStream] Whether the response is streamed\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options) {\r\n if (util.isObject(requestStream)) {\r\n options = requestStream;\r\n requestStream = responseStream = undefined;\r\n } else if (util.isObject(responseStream)) {\r\n options = responseStream;\r\n responseStream = undefined;\r\n }\r\n if (type && !util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (!util.isString(requestType))\r\n throw _TypeError(\"requestType\");\r\n if (!util.isString(responseType))\r\n throw _TypeError(\"responseType\");\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Method type.\r\n * @type {string}\r\n */\r\n this.type = type || \"rpc\"; // toJSON\r\n\r\n /**\r\n * Request type.\r\n * @type {string}\r\n */\r\n this.requestType = requestType; // toJSON, marker\r\n\r\n /**\r\n * Whether requests are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.requestStream = requestStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Response type.\r\n * @type {string}\r\n */\r\n this.responseType = responseType; // toJSON\r\n\r\n /**\r\n * Whether responses are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.responseStream = responseStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Resolved request type.\r\n * @type {?Type}\r\n */\r\n this.resolvedRequestType = null;\r\n\r\n /**\r\n * Resolved response type.\r\n * @type {?Type}\r\n */\r\n this.resolvedResponseType = null;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service method.\r\n * @param {Object} json JSON object\r\n * @returns {boolean} `true` if the object describes a map field\r\n */\r\nMethod.testJSON = function testJSON(json) {\r\n return Boolean(json && json.requestType !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a service method from JSON.\r\n * @param {string} name Method name\r\n * @param {Object} json JSON object\r\n * @returns {Method} Created method\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMethod.fromJSON = function fromJSON(name, json) {\r\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.toJSON = function toJSON() {\r\n return {\r\n type : this.type !== \"rpc\" && this.type || undefined,\r\n requestType : this.requestType,\r\n requestStream : this.requestStream,\r\n responseType : this.responseType,\r\n responseStream : this.responseStream,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var resolved = this.parent.lookup(this.requestType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable request type: \" + this.requestType);\r\n this.resolvedRequestType = resolved;\r\n resolved = this.parent.lookup(this.responseType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable response type: \" + this.requestType);\r\n this.resolvedResponseType = resolved;\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Namespace;\r\n\r\nvar ReflectionObject = require(13);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = ReflectionObject.extend(Namespace);\r\n\r\nvar Enum = require(7),\r\n Type = require(23),\r\n Field = require(8),\r\n Service = require(21),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\nvar nestedTypes = [ Enum, Type, Service, Field, Namespace ],\r\n nestedError = \"one of \" + nestedTypes.map(function(ctor) { return ctor.name; }).join(', ');\r\n\r\n/**\r\n * Constructs a new namespace.\r\n * @classdesc Reflected namespace and base class of all reflection objects containing nested objects.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Namespace(name, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Nested objects by name.\r\n * @type {Object.|undefined}\r\n */\r\n this.nested = undefined; // toJSON\r\n\r\n /**\r\n * Cached nested objects as an array.\r\n * @type {?ReflectionObject[]}\r\n * @private\r\n */\r\n this._nestedArray = null;\r\n}\r\n\r\nfunction clearCache(namespace) {\r\n namespace._nestedArray = null;\r\n return namespace;\r\n}\r\n\r\nutil.props(NamespacePrototype, {\r\n\r\n /**\r\n * Nested objects of this namespace as an array for iteration.\r\n * @name Namespace#nestedArray\r\n * @type {ReflectionObject[]}\r\n * @readonly\r\n */\r\n nestedArray: {\r\n get: function getNestedArray() {\r\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Tests if the specified JSON object describes not another reflection object.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes not another reflection object\r\n */\r\nNamespace.testJSON = function testJSON(json) {\r\n return Boolean(json\r\n && !json.fields // Type\r\n && !json.values // Enum\r\n && json.id === undefined // Field, MapField\r\n && !json.oneof // OneOf\r\n && !json.methods // Service\r\n && json.requestType === undefined // Method\r\n );\r\n};\r\n\r\n/**\r\n * Constructs a namespace from JSON.\r\n * @param {string} name Namespace name\r\n * @param {Object} json JSON object\r\n * @returns {Namespace} Created namespace\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nNamespace.fromJSON = function fromJSON(name, json) {\r\n return new Namespace(name, json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nNamespacePrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n nested : arrayToJSON(this.getNestedArray())\r\n };\r\n};\r\n\r\n/**\r\n * Converts an array of reflection objects to JSON.\r\n * @memberof Namespace\r\n * @param {ReflectionObject[]} array Object array\r\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\r\n */\r\nfunction arrayToJSON(array) {\r\n if (!(array && array.length))\r\n return undefined;\r\n var obj = {};\r\n for (var i = 0; i < array.length; ++i)\r\n obj[array[i].name] = array[i].toJSON();\r\n return obj;\r\n}\r\n\r\nNamespace.arrayToJSON = arrayToJSON;\r\n\r\n/**\r\n * Adds nested elements to this namespace from JSON.\r\n * @param {Object.} nestedJson Nested JSON\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.addJSON = function addJSON(nestedJson) {\r\n var ns = this;\r\n if (nestedJson)\r\n Object.keys(nestedJson).forEach(function(nestedName) {\r\n var nested = nestedJson[nestedName];\r\n for (var j = 0; j < nestedTypes.length; ++j)\r\n if (nestedTypes[j].testJSON(nested))\r\n return ns.add(nestedTypes[j].fromJSON(nestedName, nested));\r\n throw _TypeError(\"nested.\" + nestedName, \"JSON for \" + nestedError);\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets the nested object of the specified name.\r\n * @param {string} name Nested object name\r\n * @returns {?ReflectionObject} The reflection object or `null` if it doesn't exist\r\n */\r\nNamespacePrototype.get = function get(name) {\r\n if (this.nested === undefined) // prevents deopt\r\n return null;\r\n return this.nested[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this namespace.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name\r\n */\r\nNamespacePrototype.add = function add(object) {\r\n if (!object || nestedTypes.indexOf(object.constructor) < 0)\r\n throw _TypeError(\"object\", nestedError);\r\n if (object instanceof Field && object.extend === undefined)\r\n throw _TypeError(\"object\", \"an extension field when not part of a type\");\r\n if (!this.nested)\r\n this.nested = {};\r\n else {\r\n var prev = this.get(object.name);\r\n if (prev) {\r\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\r\n // replace plain namespace but keep existing nested elements and options\r\n var nested = prev.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i)\r\n object.add(nested[i]);\r\n this.remove(prev);\r\n if (!this.nested)\r\n this.nested = {};\r\n object.setOptions(prev.options, true);\r\n } else\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n }\r\n }\r\n this.nested[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this namespace.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this namespace\r\n */\r\nNamespacePrototype.remove = function remove(object) {\r\n if (!(object instanceof ReflectionObject))\r\n throw _TypeError(\"object\", \"a ReflectionObject\");\r\n if (object.parent !== this || !this.nested)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.nested[object.name];\r\n if (!Object.keys(this.nested).length)\r\n this.nested = undefined;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Defines additial namespaces within this one if not yet existing.\r\n * @param {string|string[]} path Path to create\r\n * @param {*} [json] Nested types to create from JSON\r\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\r\n */\r\nNamespacePrototype.define = function define(path, json) {\r\n if (util.isString(path))\r\n path = path.split('.');\r\n else if (!Array.isArray(path)) {\r\n json = path;\r\n path = undefined;\r\n }\r\n var ptr = this;\r\n if (path)\r\n while (path.length > 0) {\r\n var part = path.shift();\r\n if (ptr.nested && ptr.nested[part]) {\r\n ptr = ptr.nested[part];\r\n if (!(ptr instanceof Namespace))\r\n throw Error(\"path conflicts with non-namespace objects\");\r\n } else\r\n ptr.add(ptr = new Namespace(part));\r\n }\r\n if (json)\r\n ptr.addJSON(json);\r\n return ptr;\r\n};\r\n\r\n/**\r\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree.\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.resolveAll = function resolve() {\r\n var nested = this.getNestedArray(), i = 0;\r\n while (i < nested.length)\r\n if (nested[i] instanceof Namespace)\r\n nested[i++].resolveAll();\r\n else\r\n nested[i++].resolve();\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Looks up the reflection object at the specified path, relative to this namespace.\r\n * @param {string|string[]} path Path to look up\r\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\r\n * @returns {?ReflectionObject} Looked up object or `null` if none could be found\r\n */\r\nNamespacePrototype.lookup = function lookup(path, parentAlreadyChecked) {\r\n if (util.isString(path)) {\r\n if (!path.length)\r\n return null;\r\n path = path.split('.');\r\n } else if (!path.length)\r\n return null;\r\n // Start at root if path is absolute\r\n if (path[0] === \"\")\r\n return this.getRoot().lookup(path.slice(1));\r\n // Test if the first part matches any nested object, and if so, traverse if path contains more\r\n var found = this.get(path[0]);\r\n if (found && (path.length === 1 || found instanceof Namespace && (found = found.lookup(path.slice(1), true))))\r\n return found;\r\n // If there hasn't been a match, try again at the parent\r\n if (this.parent === null || parentAlreadyChecked)\r\n return null;\r\n return this.parent.lookup(path);\r\n};\r\n","\"use strict\";\r\nmodule.exports = ReflectionObject;\r\n\r\nReflectionObject.extend = extend;\r\n\r\nvar Root = require(18),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new reflection object.\r\n * @classdesc Base class of all reflection objects.\r\n * @constructor\r\n * @param {string} name Object name\r\n * @param {Object} [options] Declared options\r\n * @abstract\r\n */\r\nfunction ReflectionObject(name, options) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (options && !util.isObject(options))\r\n throw _TypeError(\"options\", \"an object\");\r\n\r\n /**\r\n * Options.\r\n * @type {Object.|undefined}\r\n */\r\n this.options = options; // toJSON\r\n\r\n /**\r\n * Unique name within its namespace.\r\n * @type {string}\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * Parent namespace.\r\n * @type {?Namespace}\r\n */\r\n this.parent = null;\r\n\r\n /**\r\n * Whether already resolved or not.\r\n * @type {boolean}\r\n */\r\n this.resolved = false;\r\n}\r\n\r\n/** @alias ReflectionObject.prototype */\r\nvar ReflectionObjectPrototype = ReflectionObject.prototype;\r\n\r\nutil.props(ReflectionObjectPrototype, {\r\n\r\n /**\r\n * Reference to the root namespace.\r\n * @name ReflectionObject#root\r\n * @type {Root}\r\n * @readonly\r\n */\r\n root: {\r\n get: function getRoot() {\r\n var ptr = this;\r\n while (ptr.parent !== null)\r\n ptr = ptr.parent;\r\n return ptr;\r\n }\r\n },\r\n\r\n /**\r\n * Full name including leading dot.\r\n * @name ReflectionObject#fullName\r\n * @type {string}\r\n * @readonly\r\n */\r\n fullName: {\r\n get: ReflectionObjectPrototype.getFullName = function getFullName() {\r\n var path = [ this.name ],\r\n ptr = this.parent;\r\n while (ptr) {\r\n path.unshift(ptr.name);\r\n ptr = ptr.parent;\r\n }\r\n return path.join('.');\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Lets the specified constructor extend this class.\r\n * @memberof ReflectionObject\r\n * @param {*} constructor Extending constructor\r\n * @returns {Object} Prototype\r\n * @this ReflectionObject\r\n */\r\nfunction extend(constructor) {\r\n var proto = constructor.prototype = Object.create(this.prototype);\r\n proto.constructor = constructor;\r\n constructor.extend = extend;\r\n return proto;\r\n}\r\n\r\n/**\r\n * Converts this reflection object to its JSON representation.\r\n * @returns {Object} JSON object\r\n * @abstract\r\n */\r\nReflectionObjectPrototype.toJSON = function toJSON() {\r\n throw Error(); // not implemented, shouldn't happen\r\n};\r\n\r\n/**\r\n * Called when this object is added to a parent.\r\n * @param {ReflectionObject} parent Parent added to\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onAdd = function onAdd(parent) {\r\n if (this.parent && this.parent !== parent)\r\n this.parent.remove(this);\r\n this.parent = parent;\r\n this.resolved = false;\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleAdd(this);\r\n};\r\n\r\n/**\r\n * Called when this object is removed from a parent.\r\n * @param {ReflectionObject} parent Parent removed from\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onRemove = function onRemove(parent) {\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleRemove(this);\r\n this.parent = null;\r\n this.resolved = false;\r\n};\r\n\r\n/**\r\n * Resolves this objects type references.\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var root = this.getRoot();\r\n if (root instanceof Root)\r\n this.resolved = true; // only if part of a root\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets an option value.\r\n * @param {string} name Option name\r\n * @returns {*} Option value or `undefined` if not set\r\n */\r\nReflectionObjectPrototype.getOption = function getOption(name) {\r\n if (this.options)\r\n return this.options[name];\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Sets an option.\r\n * @param {string} name Option name\r\n * @param {*} value Option value\r\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (!ifNotSet || !this.options || this.options[name] === undefined)\r\n (this.options || (this.options = {}))[name] = value;\r\n return this;\r\n};\r\n\r\n/**\r\n * Sets multiple options.\r\n * @param {Object.} options Options to set\r\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOptions = function setOptions(options, ifNotSet) {\r\n if (options)\r\n Object.keys(options).forEach(function(name) {\r\n this.setOption(name, options[name], ifNotSet);\r\n }, this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Converts this instance to its string representation.\r\n * @returns {string} Constructor name, space, full name\r\n */\r\nReflectionObjectPrototype.toString = function toString() {\r\n return this.constructor.name + \" \" + this.getFullName();\r\n};\r\n","\"use strict\";\r\nmodule.exports = OneOf;\r\n\r\nvar ReflectionObject = require(13);\r\n/** @alias OneOf.prototype */\r\nvar OneOfPrototype = ReflectionObject.extend(OneOf);\r\n\r\nvar Field = require(8),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new oneof.\r\n * @classdesc Reflected oneof.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Oneof name\r\n * @param {string[]|Object} [fieldNames] Field names\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction OneOf(name, fieldNames, options) {\r\n if (!Array.isArray(fieldNames)) {\r\n options = fieldNames;\r\n fieldNames = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (fieldNames && !Array.isArray(fieldNames))\r\n throw _TypeError(\"fieldNames\", \"an Array\");\r\n\r\n /**\r\n * Upper cased name for getter/setter calls.\r\n * @type {string}\r\n */\r\n this.ucName = this.name.substring(0, 1).toUpperCase() + this.name.substring(1);\r\n\r\n /**\r\n * Field names that belong to this oneof.\r\n * @type {string[]}\r\n */\r\n this.oneof = fieldNames || []; // toJSON, marker\r\n\r\n /**\r\n * Fields that belong to this oneof and are possibly not yet added to its parent.\r\n * @type {Field[]}\r\n * @private\r\n */\r\n this._fields = [];\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a oneof.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes a oneof\r\n */\r\nOneOf.testJSON = function testJSON(json) {\r\n return Boolean(json.oneof);\r\n};\r\n\r\n/**\r\n * Constructs a oneof from JSON.\r\n * @param {string} name Oneof name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created oneof\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nOneOf.fromJSON = function fromJSON(name, json) {\r\n return new OneOf(name, json.oneof, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.toJSON = function toJSON() {\r\n return {\r\n oneof : this.oneof,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Adds the fields of the specified oneof to the parent if not already done so.\r\n * @param {OneOf} oneof The oneof\r\n * @returns {undefined}\r\n * @inner\r\n * @ignore\r\n */\r\nfunction addFieldsToParent(oneof) {\r\n if (oneof.parent)\r\n oneof._fields.forEach(function(field) {\r\n if (!field.parent)\r\n oneof.parent.add(field);\r\n });\r\n}\r\n\r\n/**\r\n * Adds a field to this oneof.\r\n * @param {Field} field Field to add\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.add = function add(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n if (field.parent)\r\n field.parent.remove(field);\r\n this.oneof.push(field.name);\r\n this._fields.push(field);\r\n field.partOf = this; // field.parent remains null\r\n addFieldsToParent(this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a field from this oneof.\r\n * @param {Field} field Field to remove\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.remove = function remove(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n var index = this._fields.indexOf(field);\r\n if (index < 0)\r\n throw Error(field + \" is not a member of \" + this);\r\n this._fields.splice(index, 1);\r\n index = this.oneof.indexOf(field.name);\r\n if (index > -1)\r\n this.oneof.splice(index, 1);\r\n if (field.parent)\r\n field.parent.remove(field);\r\n field.partOf = null;\r\n return this;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onAdd = function onAdd(parent) {\r\n ReflectionObject.prototype.onAdd.call(this, parent);\r\n addFieldsToParent(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onRemove = function onRemove(parent) {\r\n this._fields.forEach(function(field) {\r\n if (field.parent)\r\n field.parent.remove(field);\r\n });\r\n ReflectionObject.prototype.onRemove.call(this, parent);\r\n};\r\n","\"use strict\";\r\nmodule.exports = parse;\r\n\r\nvar tokenize = require(22),\r\n Root = require(18),\r\n Type = require(23),\r\n Field = require(8),\r\n MapField = require(10),\r\n OneOf = require(14),\r\n Enum = require(7),\r\n Service = require(21),\r\n Method = require(11),\r\n types = require(24),\r\n util = require(25);\r\nvar camelCase = util.camelCase;\r\n\r\nvar nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,\r\n fqTypeRefRe = /^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/;\r\n\r\nfunction lower(token) {\r\n return token === null ? null : token.toLowerCase();\r\n}\r\n\r\nvar s_required = \"required\",\r\n s_repeated = \"repeated\",\r\n s_optional = \"optional\",\r\n s_option = \"option\",\r\n s_name = \"name\",\r\n s_type = \"type\";\r\nvar s_open = \"{\",\r\n s_close = \"}\",\r\n s_bopen = '(',\r\n s_bclose = ')',\r\n s_semi = \";\",\r\n s_dq = '\"',\r\n s_sq = \"'\";\r\n\r\n/**\r\n * Result object returned from {@link parse}.\r\n * @typedef ParserResult\r\n * @type {Object}\r\n * @property {string|undefined} package Package name, if declared\r\n * @property {string[]|undefined} imports Imports, if any\r\n * @property {string[]|undefined} weakImports Weak imports, if any\r\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\r\n * @property {Root} root Populated root instance\r\n */\r\n\r\n/**\r\n * Parses the given .proto source and returns an object with the parsed contents.\r\n * @param {string} source Source contents\r\n * @param {Root} [root] Root to populate\r\n * @returns {ParserResult} Parser result\r\n */\r\nfunction parse(source, root) {\r\n /* eslint-disable default-case, callback-return */\r\n if (!root)\r\n root = new Root();\r\n\r\n var tn = tokenize(source),\r\n next = tn.next,\r\n push = tn.push,\r\n peek = tn.peek,\r\n skip = tn.skip;\r\n\r\n var head = true,\r\n pkg,\r\n imports,\r\n weakImports,\r\n syntax,\r\n isProto3 = false;\r\n\r\n if (!root)\r\n root = new Root();\r\n\r\n var ptr = root;\r\n\r\n function illegal(token, name) {\r\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (line \" + tn.line() + s_bclose);\r\n }\r\n\r\n function readString() {\r\n var values = [],\r\n token;\r\n do {\r\n if ((token = next()) !== s_dq && token !== s_sq)\r\n throw illegal(token);\r\n values.push(next());\r\n skip(token);\r\n token = peek();\r\n } while (token === s_dq || token === s_sq);\r\n return values.join('');\r\n }\r\n\r\n function readValue(acceptTypeRef) {\r\n var token = next();\r\n switch (lower(token)) {\r\n case s_sq:\r\n case s_dq:\r\n push(token);\r\n return readString();\r\n case \"true\":\r\n return true;\r\n case \"false\":\r\n return false;\r\n }\r\n try {\r\n return parseNumber(token);\r\n } catch (e) {\r\n if (acceptTypeRef && typeRefRe.test(token))\r\n return token;\r\n throw illegal(token, \"value\");\r\n }\r\n }\r\n\r\n function readRange() {\r\n var start = parseId(next());\r\n var end = start;\r\n if (skip(\"to\", true))\r\n end = parseId(next());\r\n skip(s_semi);\r\n return [ start, end ];\r\n }\r\n\r\n function parseNumber(token) {\r\n var sign = 1;\r\n if (token.charAt(0) === '-') {\r\n sign = -1;\r\n token = token.substring(1);\r\n }\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"inf\": return sign * Infinity;\r\n case \"nan\": return NaN;\r\n case \"0\": return 0;\r\n }\r\n if (/^[1-9][0-9]*$/.test(token))\r\n return sign * parseInt(token, 10);\r\n if (/^0[x][0-9a-f]+$/.test(tokenLower))\r\n return sign * parseInt(token, 16);\r\n if (/^0[0-7]+$/.test(token))\r\n return sign * parseInt(token, 8);\r\n if (/^(?!e)[0-9]*(?:\\.[0-9]*)?(?:[e][+-]?[0-9]+)?$/.test(tokenLower))\r\n return sign * parseFloat(token);\r\n throw illegal(token, 'number');\r\n }\r\n\r\n function parseId(token, acceptNegative) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"min\": return 1;\r\n case \"max\": return 0x1FFFFFFF;\r\n case \"0\": return 0;\r\n }\r\n if (token.charAt(0) === '-' && !acceptNegative)\r\n throw illegal(token, \"id\");\r\n if (/^-?[1-9][0-9]*$/.test(token))\r\n return parseInt(token, 10);\r\n if (/^-?0[x][0-9a-f]+$/.test(tokenLower))\r\n return parseInt(token, 16);\r\n if (/^-?0[0-7]+$/.test(token))\r\n return parseInt(token, 8);\r\n throw illegal(token, \"id\");\r\n }\r\n\r\n function parsePackage() {\r\n if (pkg !== undefined)\r\n throw illegal(\"package\");\r\n pkg = next();\r\n if (!typeRefRe.test(pkg))\r\n throw illegal(pkg, s_name);\r\n ptr = ptr.define(pkg);\r\n skip(s_semi);\r\n }\r\n\r\n function parseImport() {\r\n var token = peek();\r\n var whichImports;\r\n switch (token) {\r\n case \"weak\":\r\n whichImports = weakImports || (weakImports = []);\r\n next();\r\n break;\r\n case \"public\":\r\n next();\r\n // eslint-disable-line no-fallthrough\r\n default:\r\n whichImports = imports || (imports = []);\r\n break;\r\n }\r\n token = readString();\r\n skip(s_semi);\r\n whichImports.push(token);\r\n }\r\n\r\n function parseSyntax() {\r\n skip(\"=\");\r\n syntax = lower(readString());\r\n var p3;\r\n if ([ \"proto2\", p3 = \"proto3\" ].indexOf(syntax) < 0)\r\n throw illegal(syntax, \"syntax\");\r\n isProto3 = syntax === p3;\r\n skip(s_semi);\r\n }\r\n\r\n function parseCommon(parent, token) {\r\n switch (token) {\r\n\r\n case s_option:\r\n parseOption(parent, token);\r\n skip(s_semi);\r\n return true;\r\n\r\n case \"message\":\r\n parseType(parent, token);\r\n return true;\r\n\r\n case \"enum\":\r\n parseEnum(parent, token);\r\n return true;\r\n\r\n case \"service\":\r\n parseService(parent, token);\r\n return true;\r\n\r\n case \"extend\":\r\n parseExtension(parent, token);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n function parseType(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, \"type name\");\r\n var type = new Type(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n if (parseCommon(type, token))\r\n continue;\r\n switch (tokenLower) {\r\n case \"map\":\r\n parseMapField(type, tokenLower);\r\n break;\r\n case s_required:\r\n case s_optional:\r\n case s_repeated:\r\n parseField(type, tokenLower);\r\n break;\r\n case \"oneof\":\r\n parseOneOf(type, tokenLower);\r\n break;\r\n case \"extensions\":\r\n (type.extensions || (type.extensions = [])).push(readRange(type, tokenLower));\r\n break;\r\n case \"reserved\":\r\n (type.reserved || (type.reserved = [])).push(readRange(type, tokenLower));\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(type, s_optional);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(type);\r\n }\r\n\r\n function parseField(parent, rule, extend) {\r\n var type = next();\r\n if (!typeRefRe.test(type))\r\n throw illegal(type, s_type);\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new Field(name, id, type, rule, extend));\r\n if (field.repeated)\r\n field.setOption(\"packed\", isProto3, /* ifNotSet */ true);\r\n parent.add(field);\r\n }\r\n\r\n function parseMapField(parent) {\r\n skip(\"<\");\r\n var keyType = next();\r\n if (types.mapKey[keyType] === undefined)\r\n throw illegal(keyType, s_type);\r\n skip(\",\");\r\n var valueType = next();\r\n if (!typeRefRe.test(valueType))\r\n throw illegal(valueType, s_type);\r\n skip(\">\");\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new MapField(name, id, keyType, valueType));\r\n parent.add(field);\r\n }\r\n\r\n function parseOneOf(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n var oneof = new OneOf(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (token === s_option) {\r\n parseOption(oneof, token);\r\n skip(s_semi);\r\n } else {\r\n push(token);\r\n parseField(oneof, s_optional);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(oneof);\r\n }\r\n\r\n function parseEnum(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var values = {};\r\n var enm = new Enum(name, values);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (lower(token) === s_option)\r\n parseOption(enm);\r\n else\r\n parseEnumField(enm, token);\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(enm);\r\n }\r\n\r\n function parseEnumField(parent, token) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n var name = token;\r\n skip(\"=\");\r\n var value = parseId(next(), true);\r\n parent.values[name] = value;\r\n parseInlineOptions({}); // skips enum value options\r\n }\r\n\r\n function parseOption(parent, token) {\r\n var custom = skip(s_bopen, true);\r\n var name = next();\r\n if (!typeRefRe.test(name))\r\n throw illegal(name, s_name);\r\n if (custom) {\r\n skip(s_bclose);\r\n name = s_bopen + name + s_bclose;\r\n token = peek();\r\n if (fqTypeRefRe.test(token)) {\r\n name += token;\r\n next();\r\n }\r\n }\r\n skip(\"=\");\r\n parseOptionValue(parent, name);\r\n }\r\n\r\n function parseOptionValue(parent, name) {\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n name = name + \".\" + token;\r\n if (skip(\":\", true))\r\n setOption(parent, name, readValue(true));\r\n else\r\n parseOptionValue(parent, name);\r\n }\r\n } else\r\n setOption(parent, name, readValue(true));\r\n // Does not enforce a delimiter to be universal\r\n }\r\n\r\n function setOption(parent, name, value) {\r\n if (parent.setOption)\r\n parent.setOption(name, value);\r\n else\r\n parent[name] = value;\r\n }\r\n\r\n function parseInlineOptions(parent) {\r\n if (skip(\"[\", true)) {\r\n do {\r\n parseOption(parent, s_option);\r\n } while (skip(\",\", true));\r\n skip(\"]\");\r\n }\r\n skip(s_semi);\r\n return parent;\r\n }\r\n\r\n function parseService(parent, token) {\r\n token = next();\r\n if (!nameRe.test(token))\r\n throw illegal(token, \"service name\");\r\n var name = token;\r\n var service = new Service(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(service, tokenLower);\r\n skip(s_semi);\r\n break;\r\n case \"rpc\":\r\n parseMethod(service, tokenLower);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(service);\r\n }\r\n\r\n function parseMethod(parent, token) {\r\n var type = token;\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var requestType, requestStream,\r\n responseType, responseStream;\r\n skip(s_bopen);\r\n var st;\r\n if (skip(st = \"stream\", true))\r\n requestStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n requestType = token;\r\n skip(s_bclose); skip(\"returns\"); skip(s_bopen);\r\n if (skip(st, true))\r\n responseStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n responseType = token;\r\n skip(s_bclose);\r\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(method, tokenLower);\r\n skip(s_semi);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(method);\r\n }\r\n\r\n function parseExtension(parent, token) {\r\n var reference = next();\r\n if (!typeRefRe.test(reference))\r\n throw illegal(reference, \"reference\");\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_required:\r\n case s_repeated:\r\n case s_optional:\r\n parseField(parent, tokenLower, reference);\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(parent, s_optional, reference);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n }\r\n\r\n var token;\r\n while ((token = next()) !== null) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n\r\n case \"package\":\r\n if (!head)\r\n throw illegal(token);\r\n parsePackage();\r\n break;\r\n\r\n case \"import\":\r\n if (!head)\r\n throw illegal(token);\r\n parseImport();\r\n break;\r\n\r\n case \"syntax\":\r\n if (!head)\r\n throw illegal(token);\r\n parseSyntax();\r\n break;\r\n\r\n case s_option:\r\n if (!head)\r\n throw illegal(token);\r\n parseOption(ptr, token);\r\n skip(s_semi);\r\n break;\r\n\r\n default:\r\n if (parseCommon(ptr, token)) {\r\n head = false;\r\n continue;\r\n }\r\n throw illegal(token);\r\n }\r\n }\r\n\r\n return {\r\n 'package' : pkg,\r\n 'imports' : imports,\r\n 'weakImports' : weakImports,\r\n 'syntax' : syntax,\r\n 'root' : root\r\n };\r\n}\r\n","\"use strict\";\r\nmodule.exports = Prototype;\r\n\r\n/**\r\n * Constructs a new prototype.\r\n * This method should be called from your custom constructors, i.e. `Prototype.call(this, properties)`.\r\n * @classdesc Runtime message prototype ready to be extended by custom classes or generated code.\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set\r\n * @abstract\r\n * @see {@link inherits}\r\n * @see {@link Class}\r\n */\r\nfunction Prototype(properties) {\r\n if (properties) {\r\n var keys = Object.keys(properties);\r\n for (var i = 0; i < keys.length; ++i)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n}\r\n\r\n/**\r\n * Converts a runtime message to a JSON object.\r\n * @param {Object.} [options] Conversion options\r\n * @param {boolean} [options.fieldsOnly=false] Converts only properties that reference a field\r\n * @param {*} [options.long] Long conversion type. Only relevant with a long library.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to a possibly unsafe number without, and a `Long` with a long library.\r\n * @param {*} [options.enum=Number] Enum value conversion type.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to the numeric ids.\r\n * @param {boolean} [options.defaults=false] Also sets default values on the resulting object\r\n * @returns {Object.} JSON object\r\n */\r\nPrototype.prototype.asJSON = function asJSON(options) {\r\n if (!options)\r\n options = {};\r\n var fields = this.constructor.$type.fields,\r\n json = {};\r\n var keys;\r\n if (options.defaults) {\r\n keys = [];\r\n for (var k in this) // eslint-disable-line guard-for-in\r\n keys.push(k);\r\n } else\r\n keys = Object.keys(this);\r\n for (var i = 0, key; i < keys.length; ++i) {\r\n var field = fields[key = keys[i]],\r\n value = this[key];\r\n if (field) {\r\n if (field.repeated) {\r\n if (value && value.length) {\r\n var array = new Array(value.length);\r\n for (var j = 0, l = value.length; j < l; ++j)\r\n array[j] = field.jsonConvert(value[j], options);\r\n json[key] = array;\r\n }\r\n } else\r\n json[key] = field.jsonConvert(value, options);\r\n } else if (!options.fieldsOnly)\r\n json[key] = value;\r\n }\r\n return json;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nReader.BufferReader = BufferReader;\r\n\r\nvar util = require(29),\r\n ieee754 = require(1);\r\nvar LongBits = util.LongBits,\r\n ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\r\n\r\nfunction indexOutOfRange(reader, writeLength) {\r\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\r\n}\r\n\r\n/**\r\n * Configures the Reader interface according to the environment.\r\n * @memberof Reader\r\n * @returns {undefined}\r\n */\r\nfunction configure() {\r\n if (util.Long) {\r\n ReaderPrototype.int64 = read_int64_long;\r\n ReaderPrototype.uint64 = read_uint64_long;\r\n ReaderPrototype.sint64 = read_sint64_long;\r\n ReaderPrototype.fixed64 = read_fixed64_long;\r\n ReaderPrototype.sfixed64 = read_sfixed64_long;\r\n } else {\r\n ReaderPrototype.int64 = read_int64_number;\r\n ReaderPrototype.uint64 = read_uint64_number;\r\n ReaderPrototype.sint64 = read_sint64_number;\r\n ReaderPrototype.fixed64 = read_fixed64_number;\r\n ReaderPrototype.sfixed64 = read_sfixed64_number;\r\n }\r\n}\r\n\r\nReader.configure = configure;\r\n\r\n/**\r\n * Constructs a new reader using the specified buffer.\r\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n * @param {Uint8Array} buffer Buffer to read from\r\n */\r\nfunction Reader(buffer) {\r\n \r\n /**\r\n * Read buffer.\r\n * @type {Uint8Array}\r\n */\r\n this.buf = buffer;\r\n\r\n /**\r\n * Read buffer position.\r\n * @type {number}\r\n */\r\n this.pos = 0;\r\n\r\n /**\r\n * Read buffer length.\r\n * @type {number}\r\n */\r\n this.len = buffer.length;\r\n}\r\n\r\n/**\r\n * Creates a new reader using the specified buffer.\r\n * @param {Uint8Array} buffer Buffer to read from\r\n * @returns {BufferReader|Reader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\r\n */\r\nReader.create = function create(buffer) {\r\n return new (util.Buffer && util.Buffer.isBuffer(buffer) && BufferReader || Reader)(buffer);\r\n};\r\n\r\n/** @alias Reader.prototype */\r\nvar ReaderPrototype = Reader.prototype;\r\n\r\nReaderPrototype._slice = ArrayImpl.prototype.subarray || ArrayImpl.prototype.slice;\r\n\r\n/**\r\n * Tag read.\r\n * @constructor\r\n * @param {number} id Field id\r\n * @param {number} wireType Wire type\r\n * @ignore\r\n */\r\nfunction Tag(id, wireType) {\r\n this.id = id;\r\n this.wireType = wireType;\r\n}\r\n\r\n/**\r\n * Reads a tag.\r\n * @returns {{id: number, wireType: number}} Field id and wire type\r\n */\r\nReaderPrototype.tag = function read_tag() {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n return new Tag(this.buf[this.pos] >>> 3, this.buf[this.pos++] & 7);\r\n};\r\n\r\n/**\r\n * Reads a varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.int32 = function read_int32() {\r\n // 1 byte\r\n var octet = this.buf[this.pos++],\r\n value = octet & 127;\r\n if (octet > 127) { // false if octet is undefined (pos >= len)\r\n // 2 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 7;\r\n if (octet > 127) {\r\n // 3 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 14;\r\n if (octet > 127) {\r\n // 4 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 21;\r\n if (octet > 127) {\r\n // 5 bytes\r\n octet = this.buf[this.pos++];\r\n value |= octet << 28;\r\n if (octet > 127) {\r\n // 6..10 bytes (sign extended)\r\n this.pos += 5;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (this.pos > this.len) {\r\n this.pos = this.len;\r\n throw indexOutOfRange(this);\r\n }\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a varint as an unsigned 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.uint32 = function read_uint32() {\r\n return this.int32() >>> 0;\r\n};\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sint32 = function read_sint32() {\r\n var value = this.int32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongVarint() {\r\n var lo = 0, hi = 0,\r\n i = 0, b = 0;\r\n if (this.len - this.pos > 9) { // fast route\r\n for (i = 0; i < 4; ++i) {\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n } else {\r\n for (i = 0; i < 4; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n }\r\n throw Error(\"invalid varint encoding\");\r\n}\r\n\r\nfunction read_int64_long() {\r\n return readLongVarint.call(this).toLong();\r\n}\r\n\r\nfunction read_int64_number() {\r\n return readLongVarint.call(this).toNumber();\r\n}\r\n\r\nfunction read_uint64_long() {\r\n return readLongVarint.call(this).toLong(true);\r\n}\r\n\r\nfunction read_uint64_number() {\r\n return readLongVarint.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sint64_long() {\r\n return readLongVarint.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sint64_number() {\r\n return readLongVarint.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads a varint as a signed 64 bit value.\r\n * @name Reader#int64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as an unsigned 64 bit value.\r\n * @name Reader#uint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 64 bit value.\r\n * @name Reader#sint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as a boolean.\r\n * @returns {boolean} Value read\r\n */\r\nReaderPrototype.bool = function read_bool() {\r\n return this.int32() !== 0;\r\n};\r\n\r\n/**\r\n * Reads fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.fixed32 = function read_fixed32() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n this.pos += 4;\r\n return this.buf[this.pos - 4]\r\n | this.buf[this.pos - 3] << 8\r\n | this.buf[this.pos - 2] << 16\r\n | this.buf[this.pos - 1] << 24;\r\n};\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sfixed32 = function read_sfixed32() {\r\n var value = this.fixed32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongFixed() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n return new LongBits(\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n ,\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n );\r\n}\r\n\r\nfunction read_fixed64_long() {\r\n return readLongFixed.call(this).toLong(true);\r\n}\r\n\r\nfunction read_fixed64_number() {\r\n return readLongFixed.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sfixed64_long() {\r\n return readLongFixed.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sfixed64_number() {\r\n return readLongFixed.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads fixed 64 bits.\r\n * @name Reader#fixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 64 bits.\r\n * @name Reader#sfixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\nvar readFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function readFloat_f32(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos ];\r\n return f32[0];\r\n }\r\n : function readFloat_f32_le(buf, pos) {\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f32[0];\r\n };\r\n })()\r\n : function readFloat_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Reads a float (32 bit) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.float = function read_float() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readFloat(this.buf, this.pos);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nvar readDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function readDouble_f64(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[7] = buf[pos ];\r\n return f64[0];\r\n }\r\n : function readDouble_f64_le(buf, pos) {\r\n f8b[7] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f64[0];\r\n };\r\n })()\r\n : function readDouble_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Reads a double (64 bit float) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.double = function read_double() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readDouble(this.buf, this.pos);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @returns {Uint8Array} Value read\r\n */\r\nReaderPrototype.bytes = function read_bytes() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\r\n ? new this.buf.constructor(0)\r\n : this._slice.call(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * Reads a string preceeded by its byte length as a varint.\r\n * @returns {string} Value read\r\n */\r\nReaderPrototype.string = function read_string() {\r\n // ref: https://github.com/google/closure-library/blob/master/closure/goog/crypt/crypt.js\r\n var bytes = this.bytes(),\r\n len = bytes.length;\r\n if (len) {\r\n var out = new Array(len), p = 0, c = 0;\r\n while (p < len) {\r\n var c1 = bytes[p++];\r\n if (c1 < 128)\r\n out[c++] = c1;\r\n else if (c1 > 191 && c1 < 224)\r\n out[c++] = (c1 & 31) << 6 | bytes[p++] & 63;\r\n else if (c1 > 239 && c1 < 365) {\r\n var u = ((c1 & 7) << 18 | (bytes[p++] & 63) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63) - 0x10000;\r\n out[c++] = 0xD800 + (u >> 10);\r\n out[c++] = 0xDC00 + (u & 1023);\r\n } else\r\n out[c++] = (c1 & 15) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63;\r\n }\r\n return String.fromCharCode.apply(String, out.slice(0, c));\r\n }\r\n return \"\";\r\n};\r\n\r\n/**\r\n * Skips the specified number of bytes if specified, otherwise skips a varint.\r\n * @param {number} [length] Length if known, otherwise a varint is assumed\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skip = function skip(length) {\r\n if (length === undefined) {\r\n do {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n } while (this.buf[this.pos++] & 128);\r\n } else {\r\n if (this.pos + length > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Skips the next element of the specified wire type.\r\n * @param {number} wireType Wire type received\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skipType = function(wireType) {\r\n switch (wireType) {\r\n case 0:\r\n this.skip();\r\n break;\r\n case 1:\r\n this.skip(8);\r\n break;\r\n case 2:\r\n this.skip(this.uint32());\r\n break;\r\n case 3:\r\n do { // eslint-disable-line no-constant-condition\r\n var tag = this.tag();\r\n if (tag.wireType === 4)\r\n break;\r\n this.skipType(tag.wireType);\r\n } while (true);\r\n break;\r\n case 5:\r\n this.skip(4);\r\n break;\r\n default:\r\n throw Error(\"invalid wire type: \" + wireType);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance and frees all resources.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.reset = function reset(buffer) {\r\n if (buffer) {\r\n this.buf = buffer;\r\n this.len = buffer.length;\r\n } else {\r\n this.buf = null; // makes it throw\r\n this.len = 0;\r\n }\r\n this.pos = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of read operations, frees all resources and returns the remaining buffer.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nReaderPrototype.finish = function finish(buffer) {\r\n var remain = this.pos\r\n ? this._slice.call(this.buf, this.pos)\r\n : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\n// One time function to initialize BufferReader with the now-known buffer implementation's slice method\r\nvar initBufferReader = function() {\r\n if (!util.Buffer)\r\n throw Error(\"Buffer is not supported\");\r\n BufferReaderPrototype._slice = util.Buffer.prototype.slice;\r\n readStringBuffer = util.Buffer.prototype.utf8Slice // around forever, but not present in browser buffer\r\n ? readStringBuffer_utf8Slice\r\n : readStringBuffer_toString;\r\n initBufferReader = false;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer reader.\r\n * @classdesc Wire format reader using node buffers.\r\n * @extends Reader\r\n * @constructor\r\n * @param {Buffer} buffer Buffer to read from\r\n */\r\nfunction BufferReader(buffer) {\r\n if (initBufferReader)\r\n initBufferReader();\r\n Reader.call(this, buffer);\r\n}\r\n\r\n/** @alias BufferReader.prototype */\r\nvar BufferReaderPrototype = BufferReader.prototype = Object.create(Reader.prototype);\r\n\r\nBufferReaderPrototype.constructor = BufferReader;\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.float = function read_float_buffer() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = this.buf.readFloatLE(this.pos, true);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.double = function read_double_buffer() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n var value = this.buf.readDoubleLE(this.pos, true);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\nvar readStringBuffer;\r\n\r\nfunction readStringBuffer_utf8Slice(buf, start, end) {\r\n return buf.utf8Slice(start, end); // fastest\r\n}\r\n\r\nfunction readStringBuffer_toString(buf, start, end) {\r\n return buf.toString(\"utf8\", start, end); // 2nd, again assertions\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.string = function read_string_buffer() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return readStringBuffer(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.finish = function finish_buffer(buffer) {\r\n var remain = this.pos ? this.buf.slice(this.pos) : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\nvar Namespace = require(12);\r\n/** @alias Root.prototype */\r\nvar RootPrototype = Namespace.extend(Root);\r\n\r\nvar Field = require(8),\r\n util = require(25),\r\n common = require(6);\r\n\r\n/**\r\n * Constructs a new root namespace.\r\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {Object} [options] Top level options\r\n */\r\nfunction Root(options) {\r\n Namespace.call(this, \"\", options);\r\n\r\n /**\r\n * Deferred extension fields.\r\n * @type {Field[]}\r\n */\r\n this.deferred = [];\r\n\r\n /**\r\n * Resolved file names of loaded files. \r\n * @type {string[]}\r\n */\r\n this.files = [];\r\n}\r\n\r\n/**\r\n * Loads a JSON definition into a root namespace.\r\n * @param {*} json JSON definition\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\r\n * @returns {Root} Root namespace\r\n */\r\nRoot.fromJSON = function fromJSON(json, root) {\r\n if (!root)\r\n root = new Root();\r\n return root.setOptions(json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Resolves the path of an imported file, relative to the importing origin.\r\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\r\n * @function\r\n * @param {string} origin The file name of the importing file\r\n * @param {string} target The file name being imported\r\n * @returns {string} Resolved path to `target`\r\n */\r\nRootPrototype.resolvePath = util.resolvePath;\r\n\r\n// A symbol-like function to safely signal synchronous loading\r\nfunction SYNC() {}\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {function(?Error, Root=)} callback Node-style callback function\r\n * @returns {undefined}\r\n */\r\nRootPrototype.load = function load(filename, callback) {\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(load, self, filename);\r\n\r\n // Finishes loading by calling the callback (exactly once)\r\n function finish(err, root) {\r\n if (!callback)\r\n return;\r\n var cb = callback;\r\n callback = null;\r\n cb(err, root);\r\n }\r\n\r\n var sync = callback === SYNC; // undocumented\r\n\r\n // Processes a single file\r\n function process(filename, source) {\r\n try {\r\n if (util.isString(source) && source.charAt(0) === \"{\")\r\n source = JSON.parse(source);\r\n if (!util.isString(source))\r\n self.setOptions(source.options).addJSON(source.nested);\r\n else {\r\n var parsed = require(15)(source, self);\r\n if (parsed.imports)\r\n parsed.imports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name));\r\n });\r\n if (parsed.weakImports)\r\n parsed.weakImports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name), true);\r\n });\r\n }\r\n } catch (err) {\r\n finish(err);\r\n return;\r\n }\r\n if (!sync && !queued)\r\n finish(null, self);\r\n }\r\n\r\n // Fetches a single file\r\n function fetch(filename, weak) {\r\n\r\n // Strip path if this file references a bundled definition\r\n var idx = filename.indexOf(\"google/protobuf/\");\r\n if (idx > -1) {\r\n var altname = filename.substring(idx);\r\n if (altname in common)\r\n filename = altname;\r\n }\r\n\r\n // Skip if already loaded\r\n if (self.files.indexOf(filename) > -1)\r\n return;\r\n self.files.push(filename);\r\n\r\n // Shortcut bundled definitions\r\n if (filename in common) {\r\n if (sync)\r\n process(filename, common[filename]);\r\n else {\r\n ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\r\n if (sync) {\r\n var source;\r\n try {\r\n source = util.fs.readFileSync(filename).toString(\"utf8\");\r\n } catch (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n } else {\r\n ++queued;\r\n util.fetch(filename, function(err, source) {\r\n --queued;\r\n if (!callback)\r\n return; // terminated meanwhile\r\n if (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n });\r\n }\r\n }\r\n var queued = 0;\r\n\r\n // Assembling the root namespace doesn't require working type\r\n // references anymore, so we can load everything in parallel\r\n if (util.isString(filename))\r\n filename = [ filename ];\r\n filename.forEach(function(filename) {\r\n fetch(self.resolvePath(\"\", filename));\r\n });\r\n\r\n if (sync)\r\n return self;\r\n if (!queued)\r\n finish(null, self);\r\n return undefined;\r\n};\r\n// function load(filename:string, callback:function):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\r\n * @name Root#load\r\n * @function\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Promise} Promise\r\n * @variation 2\r\n */\r\n// function load(filename:string):Promise\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nRootPrototype.loadSync = function loadSync(filename) {\r\n return this.load(filename, SYNC);\r\n};\r\n\r\n/**\r\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\r\n * @param {Field} field Declaring extension field witin the declaring type\r\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\r\n * @inner\r\n * @ignore\r\n */\r\nfunction handleExtension(field) {\r\n var extendedType = field.parent.lookup(field.extend);\r\n if (extendedType) {\r\n var sisterField = new Field(field.getFullName(), field.id, field.type, field.rule, undefined, field.options);\r\n sisterField.declaringField = field;\r\n field.extensionField = sisterField;\r\n extendedType.add(sisterField);\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Called when any object is added to this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object added\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleAdd = function handleAdd(object) {\r\n // Try to handle any deferred extensions\r\n var newDeferred = this.deferred.slice();\r\n this.deferred = []; // because the loop calls handleAdd\r\n var i = 0;\r\n while (i < newDeferred.length)\r\n if (handleExtension(newDeferred[i]))\r\n newDeferred.splice(i, 1);\r\n else\r\n ++i;\r\n this.deferred = newDeferred;\r\n // Handle new declaring extension fields without a sister field yet\r\n if (object instanceof Field && object.extend !== undefined && !object.extensionField && !handleExtension(object) && this.deferred.indexOf(object) < 0)\r\n this.deferred.push(object);\r\n else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleAdd(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * Called when any object is removed from this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object removed\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleRemove = function handleRemove(object) {\r\n if (object instanceof Field) {\r\n // If a deferred declaring extension field, cancel the extension\r\n if (object.extend !== undefined && !object.extensionField) {\r\n var index = this.deferred.indexOf(object);\r\n if (index > -1)\r\n this.deferred.splice(index, 1);\r\n }\r\n // If a declaring extension field with a sister field, remove its sister field\r\n if (object.extensionField) {\r\n object.extensionField.parent.remove(object.extensionField);\r\n object.extensionField = null;\r\n }\r\n } else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleRemove(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nRootPrototype.toString = function toString() {\r\n return this.constructor.name;\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * RPC helpers.\r\n * @namespace\r\n */\r\nvar rpc = exports;\r\n\r\nrpc.Service = require(20);\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar EventEmitter = require(26);\r\n\r\n/**\r\n * Constructs a new RPC service.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @memberof rpc\r\n * @extends util.EventEmitter\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n */\r\nfunction Service(rpcImpl) {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * RPC implementation. Becomes `null` when the service is ended.\r\n * @type {?RPCImpl}\r\n */\r\n this.$rpc = rpcImpl;\r\n}\r\n\r\n/** @alias rpc.Service.prototype */\r\nvar ServicePrototype = Service.prototype = Object.create(EventEmitter.prototype);\r\nServicePrototype.constructor = Service;\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.end = function end(endedByRPC) {\r\n if (this.$rpc) {\r\n if (!endedByRPC) // signal end to rpcImpl\r\n this.$rpc(null, null, null);\r\n this.$rpc = null;\r\n this.emit('end').off();\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar Namespace = require(12);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Service.prototype */\r\nvar ServicePrototype = Namespace.extend(Service);\r\n\r\nvar Method = require(11),\r\n util = require(25),\r\n rpc = require(19);\r\n\r\n/**\r\n * Constructs a new service.\r\n * @classdesc Reflected service.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Service name\r\n * @param {Object.} [options] Service options\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nfunction Service(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Service methods.\r\n * @type {Object.}\r\n */\r\n this.methods = {}; // toJSON, marker\r\n\r\n /**\r\n * Cached methods as an array.\r\n * @type {?Method[]}\r\n * @private\r\n */\r\n this._methodsArray = null;\r\n}\r\n\r\nutil.props(ServicePrototype, {\r\n\r\n /**\r\n * Methods of this service as an array for iteration.\r\n * @name Service#methodsArray\r\n * @type {Method[]}\r\n * @readonly\r\n */\r\n methodsArray: {\r\n get: function getMethodsArray() {\r\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\r\n }\r\n }\r\n\r\n});\r\n\r\nfunction clearCache(service) {\r\n service._methodsArray = null;\r\n return service;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a service\r\n */\r\nService.testJSON = function testJSON(json) {\r\n return Boolean(json && json.methods);\r\n};\r\n\r\n/**\r\n * Constructs a service from JSON.\r\n * @param {string} name Service name\r\n * @param {Object} json JSON object\r\n * @returns {Service} Created service\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nService.fromJSON = function fromJSON(name, json) {\r\n var service = new Service(name, json.options);\r\n if (json.methods)\r\n Object.keys(json.methods).forEach(function(methodName) {\r\n service.add(Method.fromJSON(methodName, json.methods[methodName]));\r\n });\r\n return service;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n methods : Namespace.arrayToJSON(this.getMethodsArray()) || {},\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.methods[name] || null;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.resolveAll = function resolve() {\r\n var methods = this.getMethodsArray();\r\n for (var i = 0; i < methods.length; ++i)\r\n methods[i].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Method) {\r\n this.methods[object.name] = object;\r\n object.parent = this;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.remove = function remove(object) {\r\n if (object instanceof Method) {\r\n if (this.methods[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.methods[object.name];\r\n object.parent = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\r\n * @typedef RPCImpl\r\n * @type {function}\r\n * @param {Method} method Reflected method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {function(?Error, Uint8Array=)} callback Node-style callback called with the error, if any, and the response data. `null` as response data signals an ended stream.\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Creates a runtime service using the specified rpc implementation.\r\n * @param {function(Method, Uint8Array, function)} rpcImpl RPC implementation ({@link RPCImpl|see})\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n * @returns {rpc.Service} Runtime RPC service. Useful where requests and/or responses are streamed.\r\n */\r\nServicePrototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\r\n var rpcService = new rpc.Service(rpcImpl);\r\n this.getMethodsArray().forEach(function(method) {\r\n rpcService[method.name.substring(0, 1).toLowerCase() + method.name.substring(1)] = function callVirtual(request, /* optional */ callback) {\r\n if (!rpcService.$rpc) // already ended?\r\n return;\r\n if (!request)\r\n throw util._TypeError(\"request\", \"not null\");\r\n method.resolve();\r\n var requestData;\r\n try {\r\n requestData = (requestDelimited && method.resolvedRequestType.encodeDelimited(request) || method.resolvedRequestType.encode(request)).finish();\r\n } catch (err) {\r\n (typeof setImmediate === 'function' && setImmediate || setTimeout)(function() { callback(err); });\r\n return;\r\n }\r\n // Calls the custom RPC implementation with the reflected method and binary request data\r\n // and expects the rpc implementation to call its callback with the binary response data.\r\n rpcImpl(method, requestData, function(err, responseData) {\r\n if (err) {\r\n rpcService.emit('error', err, method);\r\n return callback ? callback(err) : undefined;\r\n }\r\n if (responseData === null) {\r\n rpcService.end(/* endedByRPC */ true);\r\n return undefined;\r\n }\r\n var response;\r\n try {\r\n response = responseDelimited && method.resolvedResponseType.decodeDelimited(responseData) || method.resolvedResponseType.decode(responseData);\r\n } catch (err2) {\r\n rpcService.emit('error', err2, method);\r\n return callback ? callback('error', err2) : undefined;\r\n }\r\n rpcService.emit('data', response, method);\r\n return callback ? callback(null, response) : undefined;\r\n });\r\n };\r\n });\r\n return rpcService;\r\n};\r\n","\"use strict\";\r\nmodule.exports = tokenize;\r\n\r\nvar delimRe = /[\\s{}=;:[\\],'\"()<>]/g,\r\n stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\r\n stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\r\n\r\n/**\r\n * Handle object returned from {@link tokenize}.\r\n * @typedef {Object} TokenizerHandle\r\n * @property {function():number} line Gets the current line number\r\n * @property {function():?string} next Gets the next token and advances (`null` on eof)\r\n * @property {function():?string} peek Peeks for the next token (`null` on eof)\r\n * @property {function(string)} push Pushes a token back to the stack\r\n * @property {function(string, boolean=):boolean} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\r\n */\r\n\r\nvar s_nl = \"\\n\",\r\n s_sl = '/',\r\n s_as = '*';\r\n\r\nfunction unescape(str) {\r\n return str.replace(/\\\\(.?)/g, function($0, $1) {\r\n switch ($1) {\r\n case \"\\\\\":\r\n case \"\":\r\n return $1;\r\n case \"0\":\r\n return \"\\u0000\";\r\n default:\r\n return $1;\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Tokenizes the given .proto source and returns an object with useful utility functions.\r\n * @param {string} source Source contents\r\n * @returns {TokenizerHandle} Tokenizer handle\r\n */\r\nfunction tokenize(source) {\r\n /* eslint-disable default-case, callback-return */\r\n source = source.toString();\r\n \r\n var offset = 0,\r\n length = source.length,\r\n line = 1;\r\n \r\n var stack = [];\r\n\r\n var stringDelim = null;\r\n\r\n /**\r\n * Creates an error for illegal syntax.\r\n * @param {string} subject Subject\r\n * @returns {Error} Error created\r\n * @inner\r\n */\r\n function illegal(subject) {\r\n return Error(\"illegal \" + subject + \" (line \" + line + \")\");\r\n }\r\n\r\n /**\r\n * Reads a string till its end.\r\n * @returns {string} String read\r\n * @inner\r\n */\r\n function readString() {\r\n var re = stringDelim === '\"' ? stringDoubleRe : stringSingleRe;\r\n re.lastIndex = offset - 1;\r\n var match = re.exec(source);\r\n if (!match)\r\n throw illegal(\"string\");\r\n offset = re.lastIndex;\r\n push(stringDelim);\r\n stringDelim = null;\r\n return unescape(match[1]);\r\n }\r\n\r\n /**\r\n * Gets the character at `pos` within the source.\r\n * @param {number} pos Position\r\n * @returns {string} Character\r\n * @inner\r\n */\r\n function charAt(pos) {\r\n return source.charAt(pos);\r\n }\r\n\r\n /**\r\n * Obtains the next token.\r\n * @returns {?string} Next token or `null` on eof\r\n * @inner\r\n */\r\n function next() {\r\n if (stack.length > 0)\r\n return stack.shift();\r\n if (stringDelim)\r\n return readString();\r\n var repeat,\r\n prev,\r\n curr;\r\n do {\r\n if (offset === length)\r\n return null;\r\n repeat = false;\r\n while (/\\s/.test(curr = charAt(offset))) {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n }\r\n if (charAt(offset) === s_sl) {\r\n if (++offset === length)\r\n throw illegal(\"comment\");\r\n if (charAt(offset) === s_sl) { // Line\r\n while (charAt(++offset) !== s_nl)\r\n if (offset === length)\r\n return null;\r\n ++offset;\r\n ++line;\r\n repeat = true;\r\n } else if ((curr = charAt(offset)) === s_as) { /* Block */\r\n do {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n prev = curr;\r\n curr = charAt(offset);\r\n } while (prev !== s_as || curr !== s_sl);\r\n ++offset;\r\n repeat = true;\r\n } else\r\n return s_sl;\r\n }\r\n } while (repeat);\r\n\r\n if (offset === length)\r\n return null;\r\n var end = offset;\r\n delimRe.lastIndex = 0;\r\n var delim = delimRe.test(charAt(end++));\r\n if (!delim)\r\n while (end < length && !delimRe.test(charAt(end)))\r\n ++end;\r\n var token = source.substring(offset, offset = end);\r\n if (token === '\"' || token === \"'\")\r\n stringDelim = token;\r\n return token;\r\n }\r\n\r\n /**\r\n * Pushes a token back to the stack.\r\n * @param {string} token Token\r\n * @returns {undefined}\r\n * @inner\r\n */\r\n function push(token) {\r\n stack.push(token);\r\n }\r\n\r\n /**\r\n * Peeks for the next token.\r\n * @returns {?string} Token or `null` on eof\r\n * @inner\r\n */\r\n function peek() {\r\n if (!stack.length) {\r\n var token = next();\r\n if (token === null)\r\n return null;\r\n push(token);\r\n }\r\n return stack[0];\r\n }\r\n\r\n /**\r\n * Skips a token.\r\n * @param {string} expected Expected token\r\n * @param {boolean} [optional=false] Whether the token is optional\r\n * @returns {boolean} `true` when skipped, `false` if not\r\n * @throws {Error} When a required token is not present\r\n * @inner\r\n */\r\n function skip(expected, optional) {\r\n var actual = peek(),\r\n equals = actual === expected;\r\n if (equals) {\r\n next();\r\n return true;\r\n }\r\n if (!optional)\r\n throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\r\n return false;\r\n }\r\n\r\n return {\r\n line: function() { return line; },\r\n next: next,\r\n peek: peek,\r\n push: push,\r\n skip: skip\r\n };\r\n /* eslint-enable default-case, callback-return */\r\n}","\"use strict\";\r\nmodule.exports = Type; \r\n\r\nvar Namespace = require(12);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Type.prototype */\r\nvar TypePrototype = Namespace.extend(Type);\r\n\r\nvar Enum = require(7),\r\n OneOf = require(14),\r\n Field = require(8),\r\n Service = require(21),\r\n Prototype = require(16),\r\n Reader = require(17),\r\n Writer = require(30),\r\n inherits = require(9),\r\n util = require(25),\r\n codegen = require(2);\r\n\r\n/**\r\n * Constructs a new message type.\r\n * @classdesc Reflected message type.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Message name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Type(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Message fields.\r\n * @type {Object.}\r\n */\r\n this.fields = {}; // toJSON, marker\r\n\r\n /**\r\n * Oneofs declared within this namespace, if any.\r\n * @type {Object.}\r\n */\r\n this.oneofs = undefined; // toJSON\r\n\r\n /**\r\n * Extension ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.extensions = undefined; // toJSON\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n /**\r\n * Cached fields by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._fieldsById = null;\r\n\r\n /**\r\n * Cached fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._fieldsArray = null;\r\n\r\n /**\r\n * Cached repeated fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._repeatedFieldsArray = null;\r\n\r\n /**\r\n * Cached oneofs as an array.\r\n * @type {?OneOf[]}\r\n * @private\r\n */\r\n this._oneofsArray = null;\r\n\r\n /**\r\n * Cached constructor.\r\n * @type {*}\r\n * @private\r\n */\r\n this._ctor = null;\r\n}\r\n\r\nutil.props(TypePrototype, {\r\n\r\n /**\r\n * Message fields by id.\r\n * @name Type#fieldsById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n fieldsById: {\r\n get: function getFieldsById() {\r\n if (this._fieldsById)\r\n return this._fieldsById;\r\n this._fieldsById = {};\r\n var names = Object.keys(this.fields);\r\n for (var i = 0; i < names.length; ++i) {\r\n var field = this.fields[names[i]],\r\n id = field.id;\r\n if (this._fieldsById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._fieldsById[id] = field;\r\n }\r\n return this._fieldsById;\r\n }\r\n },\r\n\r\n /**\r\n * Fields of this message as an array for iteration.\r\n * @name Type#fieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n fieldsArray: {\r\n get: function getFieldsArray() {\r\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\r\n }\r\n },\r\n\r\n /**\r\n * Repeated fields of this message as an array for iteration.\r\n * @name Type#repeatedFieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n repeatedFieldsArray: {\r\n get: function getRepeatedFieldsArray() {\r\n return this._repeatedFieldsArray || (this._repeatedFieldsArray = this.getFieldsArray().filter(function(field) { return field.repeated; }));\r\n }\r\n },\r\n\r\n /**\r\n * Oneofs of this message as an array for iteration.\r\n * @name Type#oneofsArray\r\n * @type {OneOf[]}\r\n * @readonly\r\n */\r\n oneofsArray: {\r\n get: function getOneofsArray() {\r\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\r\n }\r\n },\r\n\r\n /**\r\n * The registered constructor, if any registered, otherwise a generic constructor.\r\n * @name Type#ctor\r\n * @type {Prototype}\r\n */\r\n ctor: {\r\n get: function getCtor() {\r\n if (this._ctor)\r\n return this._ctor;\r\n var ctor;\r\n if (codegen.supported)\r\n ctor = codegen(\"p\")(\"P.call(this,p)\").eof(this.getFullName() + \"$ctor\", {\r\n P: Prototype\r\n });\r\n else\r\n ctor = function GenericMessage(properties) {\r\n Prototype.call(this, properties);\r\n };\r\n ctor.prototype = inherits(ctor, this);\r\n this._ctor = ctor;\r\n return ctor;\r\n },\r\n set: function setCtor(ctor) {\r\n if (ctor && !(ctor.prototype instanceof Prototype))\r\n throw util._TypeError(\"ctor\", \"a constructor inheriting from Prototype\");\r\n this._ctor = ctor;\r\n }\r\n }\r\n});\r\n\r\nfunction clearCache(type) {\r\n type._fieldsById = type._fieldsArray = type._oneofsArray = type._ctor = null;\r\n delete type.encode;\r\n delete type.decode;\r\n return type;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a message type.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a message type\r\n */\r\nType.testJSON = function testJSON(json) {\r\n return Boolean(json && json.fields);\r\n};\r\n\r\nvar nestedTypes = [ Enum, Type, Field, Service ];\r\n\r\n/**\r\n * Creates a type from JSON.\r\n * @param {string} name Message name\r\n * @param {Object} json JSON object\r\n * @returns {Type} Created message type\r\n */\r\nType.fromJSON = function fromJSON(name, json) {\r\n var type = new Type(name, json.options);\r\n type.extensions = json.extensions;\r\n type.reserved = json.reserved;\r\n if (json.fields)\r\n Object.keys(json.fields).forEach(function(fieldName) {\r\n type.add(Field.fromJSON(fieldName, json.fields[fieldName]));\r\n });\r\n if (json.oneofs)\r\n Object.keys(json.oneofs).forEach(function(oneOfName) {\r\n type.add(OneOf.fromJSON(oneOfName, json.oneofs[oneOfName]));\r\n });\r\n if (json.nested)\r\n Object.keys(json.nested).forEach(function(nestedName) {\r\n var nested = json.nested[nestedName];\r\n for (var i = 0; i < nestedTypes.length; ++i) {\r\n if (nestedTypes[i].testJSON(nested)) {\r\n type.add(nestedTypes[i].fromJSON(nestedName, nested));\r\n return;\r\n }\r\n }\r\n throw Error(\"invalid nested object in \" + type + \": \" + nestedName);\r\n });\r\n if (json.extensions && json.extensions.length)\r\n type.extensions = json.extensions;\r\n if (json.reserved && json.reserved.length)\r\n type.reserved = json.reserved;\r\n return type;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n oneofs : Namespace.arrayToJSON(this.getOneofsArray()),\r\n fields : Namespace.arrayToJSON(this.getFieldsArray().filter(function(obj) { return !obj.declaringField; })) || {},\r\n extensions : this.extensions && this.extensions.length ? this.extensions : undefined,\r\n reserved : this.reserved && this.reserved.length ? this.reserved : undefined,\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.resolveAll = function resolve() {\r\n var fields = this.getFieldsArray(), i = 0;\r\n while (i < fields.length)\r\n fields[i++].resolve();\r\n var oneofs = this.getOneofsArray(); i = 0;\r\n while (i < oneofs.length)\r\n oneofs[i++].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.fields && this.fields[name] || this.oneofs && this.oneofs[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this type.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\r\n */\r\nTypePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Field && object.extend === undefined) {\r\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\r\n // The root object takes care of adding distinct sister-fields to the respective extended\r\n // type instead.\r\n if (this.getFieldsById()[object.id])\r\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\r\n if (object.parent)\r\n object.parent.remove(object);\r\n this.fields[object.name] = object;\r\n object.message = this;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n if (!this.oneofs)\r\n this.oneofs = {};\r\n this.oneofs[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this type.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this type\r\n */\r\nTypePrototype.remove = function remove(object) {\r\n if (object instanceof Field && object.extend === undefined) {\r\n // See Type#add for the reason why extension fields are excluded here.\r\n if (this.fields[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.fields[object.name];\r\n object.message = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object|*} [properties] Properties to set\r\n * @param {*} [ctor] Constructor to use.\r\n * Defaults to use the internal constuctor.\r\n * @returns {Prototype} Message instance\r\n */\r\nTypePrototype.create = function create(properties, ctor) {\r\n if (!properties || typeof properties === 'function') {\r\n ctor = properties;\r\n properties = undefined;\r\n } else if (properties /* already */ instanceof Prototype)\r\n return properties;\r\n if (ctor) {\r\n if (!(ctor.prototype instanceof Prototype))\r\n throw util._TypeError(\"ctor\", \"a constructor inheriting from Prototype\");\r\n } else\r\n ctor = this.getCtor();\r\n return new ctor(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Prototype|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encode = function encode(message, writer) {\r\n return (this.encode = codegen.supported\r\n ? codegen.encode.generate(this).eof(this.getFullName() + \"$encode\", {\r\n Writer : Writer,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : codegen.encode.fallback\r\n ).call(this, message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Prototype|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.encode(message, writer).ldelim();\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Prototype} Decoded message\r\n */\r\nTypePrototype.decode = function decode(readerOrBuffer, length) {\r\n return (this.decode = codegen.supported\r\n ? codegen.decode.generate(this).eof(this.getFullName() + \"$decode\", {\r\n Reader : Reader,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : codegen.decode.fallback\r\n ).call(this, readerOrBuffer, length);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @returns {Prototype} Decoded message\r\n */\r\nTypePrototype.decodeDelimited = function decodeDelimited(readerOrBuffer) {\r\n readerOrBuffer = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer);\r\n return this.decode(readerOrBuffer, readerOrBuffer.uint32());\r\n};\r\n\r\n/**\r\n * Verifies that enum values are valid and that any required fields are present.\r\n * @param {Prototype|Object} message Message to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\nTypePrototype.verify = function verify(message) {\r\n return (this.verify = codegen.supported\r\n ? codegen.verify.generate(this).eof(this.getFullName() + \"$verify\", {\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; })\r\n })\r\n : codegen.verify.fallback\r\n ).call(this, message);\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Common type constants.\r\n * @namespace\r\n */\r\nvar types = exports;\r\n\r\nvar util = require(25);\r\n\r\nvar s = [\r\n \"double\", // 0\r\n \"float\", // 1\r\n \"int32\", // 2\r\n \"uint32\", // 3\r\n \"sint32\", // 4\r\n \"fixed32\", // 5\r\n \"sfixed32\", // 6\r\n \"int64\", // 7\r\n \"uint64\", // 8\r\n \"sint64\", // 9\r\n \"fixed64\", // 10\r\n \"sfixed64\", // 11\r\n \"bool\", // 12\r\n \"string\", // 13\r\n \"bytes\" // 14\r\n];\r\n\r\nfunction bake(values, offset) {\r\n var i = 0, o = {};\r\n offset |= 0;\r\n while (i < values.length) o[s[i + offset]] = values[i++];\r\n return o;\r\n}\r\n\r\n/**\r\n * Basic type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.basic = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2,\r\n /* bytes */ 2\r\n]);\r\n\r\n/**\r\n * Basic type defaults.\r\n * @type {Object.}\r\n */\r\ntypes.defaults = bake([\r\n /* double */ 0,\r\n /* float */ 0,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 0,\r\n /* sfixed32 */ 0,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 0,\r\n /* sfixed64 */ 0,\r\n /* bool */ false,\r\n /* string */ \"\",\r\n /* bytes */ util.emptyArray\r\n]);\r\n\r\n/**\r\n * Basic long type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.long = bake([\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1\r\n], 7);\r\n\r\n/**\r\n * Allowed types for map keys with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.mapKey = bake([\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2\r\n], 2);\r\n\r\n/**\r\n * Allowed types for packed repeated fields with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.packed = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0\r\n]);\r\n","\"use strict\";\r\n\r\n/**\r\n * Utility functions.\r\n * @namespace\r\n */\r\nvar util = exports;\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @memberof util\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nfunction isString(value) {\r\n return typeof value === 'string' || value instanceof String;\r\n}\r\n\r\nutil.isString = isString;\r\n\r\n/**\r\n * Tests if the specified value is a non-null object.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a non-null object\r\n */\r\nutil.isObject = function isObject(value) {\r\n return Boolean(value && typeof value === 'object');\r\n};\r\n\r\n/**\r\n * Tests if the specified value is an integer.\r\n * @function\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is an integer\r\n */\r\nutil.isInteger = Number.isInteger || function isInteger(value) {\r\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\r\n};\r\n\r\n/**\r\n * Converts an object's values to an array.\r\n * @param {Object.} object Object to convert\r\n * @returns {Array.<*>} Converted array\r\n */\r\nutil.toArray = function toArray(object) {\r\n if (!object)\r\n return [];\r\n var names = Object.keys(object),\r\n length = names.length;\r\n var array = new Array(length);\r\n for (var i = 0; i < length; ++i)\r\n array[i] = object[names[i]];\r\n return array;\r\n};\r\n\r\n/**\r\n * Creates a type error.\r\n * @param {string} name Argument name\r\n * @param {string} [description=\"a string\"] Expected argument descripotion\r\n * @returns {TypeError} Created type error\r\n * @private\r\n */\r\nutil._TypeError = function(name, description) {\r\n return TypeError(name + \" must be \" + (description || \"a string\"));\r\n};\r\n\r\n/**\r\n * Returns a promise from a node-style function.\r\n * @memberof util\r\n * @param {function(Error, ...*)} fn Function to call\r\n * @param {Object} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var args = [];\r\n for (var i = 2; i < arguments.length; ++i)\r\n args.push(arguments[i]);\r\n return new Promise(function(resolve, reject) {\r\n fn.apply(ctx, args.concat(\r\n function(err/*, varargs */) {\r\n if (err) reject(err);\r\n else resolve.apply(null, Array.prototype.slice.call(arguments, 1));\r\n }\r\n ));\r\n });\r\n}\r\n\r\nutil.asPromise = asPromise;\r\n\r\n/**\r\n * Filesystem, if available.\r\n * @memberof util\r\n * @type {?Object}\r\n */\r\nvar fs = null; // Hide this from webpack. There is probably another, better way.\r\ntry { fs = eval(['req','uire'].join(''))(\"fs\"); } catch (e) {} // eslint-disable-line no-eval, no-empty\r\n\r\nutil.fs = fs;\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} path File path or url\r\n * @param {function(?Error, string=)} [callback] Node-style callback\r\n * @returns {Promise|undefined} A Promise if `callback` has been omitted \r\n */\r\nfunction fetch(path, callback) {\r\n if (!callback)\r\n return asPromise(fetch, util, path);\r\n if (fs && fs.readFile)\r\n return fs.readFile(path, \"utf8\", callback);\r\n var xhr = new XMLHttpRequest();\r\n function onload() {\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n if (isString(xhr.responseText))\r\n return callback(null, xhr.responseText);\r\n return callback(Error(\"request failed\"));\r\n }\r\n xhr.onreadystatechange = function() {\r\n if (xhr.readyState === 4)\r\n onload();\r\n };\r\n xhr.open(\"GET\", path, true);\r\n xhr.send();\r\n return undefined;\r\n}\r\n\r\nutil.fetch = fetch;\r\n\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @memberof util\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\nfunction isAbsolutePath(path) {\r\n return /^(?:\\/|[a-zA-Z0-9]+:)/.test(path);\r\n}\r\n\r\nutil.isAbsolutePath = isAbsolutePath;\r\n\r\n/**\r\n * Normalizes the specified path.\r\n * @memberof util\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\nfunction normalizePath(path) {\r\n path = path.replace(/\\\\/g, '/')\r\n .replace(/\\/{2,}/g, '/');\r\n var parts = path.split('/');\r\n var abs = isAbsolutePath(path);\r\n var prefix = \"\";\r\n if (abs)\r\n prefix = parts.shift() + '/';\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === '..') {\r\n if (i > 0)\r\n parts.splice(--i, 2);\r\n else if (abs)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === '.')\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join('/');\r\n}\r\n\r\nutil.normalizePath = normalizePath;\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path that was used to fetch the origin file\r\n * @param {string} importPath Import path specified in the origin file\r\n * @param {boolean} [alreadyNormalized] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the imported file\r\n */\r\nutil.resolvePath = function resolvePath(originPath, importPath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n importPath = normalizePath(importPath);\r\n if (isAbsolutePath(importPath))\r\n return importPath;\r\n if (!alreadyNormalized)\r\n originPath = normalizePath(originPath);\r\n originPath = originPath.replace(/(?:\\/|^)[^/]+$/, '');\r\n return originPath.length ? normalizePath(originPath + '/' + importPath) : importPath;\r\n};\r\n\r\n/**\r\n * Merges the properties of the source object into the destination object.\r\n * @param {Object} dst Destination object\r\n * @param {Object} src Source object\r\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\r\n * @returns {Object} Destination object\r\n */\r\nutil.merge = function merge(dst, src, ifNotSet) {\r\n if (src) {\r\n var keys = Object.keys(src);\r\n for (var i = 0; i < keys.length; ++i)\r\n if (dst[keys[i]] === undefined || !ifNotSet)\r\n dst[keys[i]] = src[keys[i]];\r\n }\r\n return dst;\r\n};\r\n\r\n/**\r\n * Returns a safe property accessor for the specified properly name.\r\n * @param {string} prop Property name\r\n * @returns {string} Safe accessor\r\n */\r\nutil.safeProp = function safeProp(prop) {\r\n return \"['\" + prop.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\") + \"']\";\r\n};\r\n\r\n/**\r\n * Minimalistic sprintf.\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {string} Formatted string\r\n */\r\nutil.sprintf = function sprintf(format) {\r\n var params = Array.prototype.slice.call(arguments, 1),\r\n index = 0;\r\n return format.replace(/%([djs])/g, function($0, $1) {\r\n var param = params[index++];\r\n switch ($1) {\r\n case \"j\":\r\n return JSON.stringify(param);\r\n case \"p\":\r\n return util.safeProp(param);\r\n default:\r\n return String(param);\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Converts a string to camel case notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.camelCase = function camelCase(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/_([a-z])(?=[a-z]|$)/g, function($0, $1) { return $1.toUpperCase(); });\r\n};\r\n\r\n/**\r\n * Converts a string to underscore notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.underScore = function underScore(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return \"_\" + $1.toLowerCase(); });\r\n};\r\n\r\n/**\r\n * Creates a new buffer of whatever type supported by the environment.\r\n * @param {number} [size=0] Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nutil.newBuffer = function newBuffer(size) {\r\n size = size || 0; \r\n return util.Buffer\r\n ? util.Buffer.allocUnsafe && util.Buffer.allocUnsafe(size) || new util.Buffer(size)\r\n : new (typeof Uint8Array !== 'undefined' && Uint8Array || Array)(size);\r\n};\r\n\r\nutil.EventEmitter = require(26);\r\n\r\n// Merge in runtime utility\r\nutil.merge(util, require(29));\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/** @alias util.EventEmitter.prototype */\r\nvar EventEmitterPrototype = EventEmitter.prototype;\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {Object} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = Array.prototype.slice.call(arguments, 1);\r\n for (var i = 0; i < listeners.length; ++i)\r\n listeners[i].fn.apply(listeners[i].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = LongBits;\r\n\r\nvar util = require(25);\r\n\r\n/**\r\n * Any compatible Long instance.\r\n * @typedef Long\r\n * @type {Object}\r\n * @property {number} low Low bits\r\n * @property {number} high High bits\r\n * @property {boolean} unsigned Whether unsigned or not\r\n */\r\n\r\n/**\r\n * Constructs new long bits.\r\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\r\n * @memberof util\r\n * @constructor\r\n * @param {number} lo Low bits\r\n * @param {number} hi High bits\r\n */\r\nfunction LongBits(lo, hi) { // make sure to always call this with unsigned 32bits for proper optimization\r\n\r\n /**\r\n * Low bits.\r\n * @type {number}\r\n */\r\n this.lo = lo;\r\n\r\n /**\r\n * High bits.\r\n * @type {number}\r\n */\r\n this.hi = hi;\r\n}\r\n\r\n/** @alias util.LongBits.prototype */\r\nvar LongBitsPrototype = LongBits.prototype;\r\n\r\n/**\r\n * Zero bits.\r\n * @memberof util.LongBits\r\n * @type {util.LongBits}\r\n */\r\nvar zero = LongBits.zero = new LongBits(0, 0);\r\n\r\nzero.toNumber = function() { return 0; };\r\nzero.zzEncode = zero.zzDecode = function() { return this; };\r\nzero.length = function() { return 1; };\r\n\r\n/**\r\n * Constructs new long bits from the specified number.\r\n * @param {number} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.fromNumber = function fromNumber(value) {\r\n if (value === 0)\r\n return zero;\r\n var sign = value < 0;\r\n value = Math.abs(value);\r\n var lo = value >>> 0,\r\n hi = (value - lo) / 4294967296 >>> 0;\r\n if (sign) {\r\n hi = ~hi >>> 0;\r\n lo = ~lo >>> 0;\r\n if (++lo > 4294967295) {\r\n lo = 0;\r\n if (++hi > 4294967295)\r\n hi = 0;\r\n }\r\n }\r\n return new LongBits(lo, hi);\r\n};\r\n\r\n/**\r\n * Constructs new long bits from a number, long or string.\r\n * @param {Long|number|string} value Value\r\n * @returns {util.LongBits} Instance\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nLongBits.from = function from(value) {\r\n switch (typeof value) { // eslint-disable-line default-case\r\n case 'number':\r\n return LongBits.fromNumber(value);\r\n case 'string':\r\n value = util.Long.fromString(value); // throws without a long lib\r\n }\r\n return (value.low || value.high) && new LongBits(value.low >>> 0, value.high >>> 0) || zero;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a possibly unsafe JavaScript number.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {number} Possibly unsafe number\r\n */\r\nLongBitsPrototype.toNumber = function toNumber(unsigned) {\r\n if (!unsigned && this.hi >>> 31) {\r\n this.lo = ~this.lo + 1 >>> 0;\r\n this.hi = ~this.hi >>> 0;\r\n if (!this.lo)\r\n this.hi = this.hi + 1 >>> 0;\r\n return -(this.lo + this.hi * 4294967296);\r\n }\r\n return this.lo + this.hi * 4294967296;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a long.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long} Long\r\n */\r\nLongBitsPrototype.toLong = function toLong(unsigned) {\r\n return new util.Long(this.lo, this.hi, unsigned);\r\n};\r\n\r\nvar charCodeAt = String.prototype.charCodeAt;\r\n\r\n/**\r\n * Constructs new long bits from the specified 8 characters long hash.\r\n * @param {string} hash Hash\r\n * @returns {util.LongBits} Bits\r\n */\r\nLongBits.fromHash = function fromHash(hash) {\r\n return new LongBits(\r\n ( charCodeAt.call(hash, 0)\r\n | charCodeAt.call(hash, 1) << 8\r\n | charCodeAt.call(hash, 2) << 16\r\n | charCodeAt.call(hash, 3) << 24) >>> 0\r\n ,\r\n ( charCodeAt.call(hash, 4)\r\n | charCodeAt.call(hash, 5) << 8\r\n | charCodeAt.call(hash, 6) << 16\r\n | charCodeAt.call(hash, 7) << 24) >>> 0\r\n );\r\n};\r\n\r\n/**\r\n * Converts this long bits to a 8 characters long hash.\r\n * @returns {string} Hash\r\n */\r\nLongBitsPrototype.toHash = function toHash() {\r\n return String.fromCharCode(\r\n this.lo & 255,\r\n this.lo >>> 8 & 255,\r\n this.lo >>> 16 & 255,\r\n this.lo >>> 24 & 255,\r\n this.hi & 255,\r\n this.hi >>> 8 & 255,\r\n this.hi >>> 16 & 255,\r\n this.hi >>> 24 & 255\r\n );\r\n};\r\n\r\n/**\r\n * Zig-zag encodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzEncode = function zzEncode() {\r\n var mask = this.hi >> 31;\r\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\r\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Zig-zag decodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzDecode = function zzDecode() {\r\n var mask = -(this.lo & 1);\r\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\r\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Calculates the length of this longbits when encoded as a varint.\r\n * @returns {number} Length\r\n */\r\nLongBitsPrototype.length = function length() {\r\n var part0 = this.lo,\r\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\r\n part2 = this.hi >>> 24;\r\n if (part2 === 0) {\r\n if (part1 === 0)\r\n return part0 < 1 << 14\r\n ? part0 < 1 << 7 ? 1 : 2\r\n : part0 < 1 << 21 ? 3 : 4;\r\n return part1 < 1 << 14\r\n ? part1 < 1 << 7 ? 5 : 6\r\n : part1 < 1 << 21 ? 7 : 8;\r\n }\r\n return part2 < 1 << 7 ? 9 : 10;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * A drop-in buffer pool, similar in functionality to what node uses for buffers.\r\n * @memberof util\r\n * @function\r\n * @param {function(number):Uint8Array} alloc Allocator\r\n * @param {function(number, number):Uint8Array} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {function(number):Uint8Array} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\nvar util = exports;\r\n\r\nvar LongBits = util.LongBits = require(\"./longbits\");\r\n\r\nutil.pool = require(\"./pool\");\r\n\r\n/**\r\n * Whether running within node or not.\r\n * @memberof util\r\n * @type {boolean}\r\n */\r\nvar isNode = util.isNode = Boolean(global.process && global.process.versions && global.process.versions.node);\r\n\r\n/**\r\n * Optional buffer class to use.\r\n * If you assign any compatible buffer implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Buffer = null;\r\n\r\nif (isNode)\r\n try { util.Buffer = require(\"buffer\").Buffer; } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Optional Long class to use.\r\n * If you assign any compatible long implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Long = global.dcodeIO && global.dcodeIO.Long || null;\r\n\r\nif (!util.Long && isNode)\r\n try { util.Long = require(\"long\"); } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Converts a number or long to an 8 characters long hash string.\r\n * @param {Long|number} value Value to convert\r\n * @returns {string} Hash\r\n */\r\nutil.longToHash = function longToHash(value) {\r\n return value\r\n ? LongBits.from(value).toHash()\r\n : '\\0\\0\\0\\0\\0\\0\\0\\0';\r\n};\r\n\r\n/**\r\n * Converts an 8 characters long hash string to a long or number.\r\n * @param {string} hash Hash\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long|number} Original value\r\n */\r\nutil.longFromHash = function longFromHash(hash, unsigned) {\r\n var bits = LongBits.fromHash(hash);\r\n if (util.Long)\r\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\r\n return bits.toNumber(Boolean(unsigned));\r\n};\r\n\r\n/**\r\n * Tests if two possibly long values are not equal.\r\n * @param {number|Long} a First value\r\n * @param {number|Long} b Second value\r\n * @returns {boolean} `true` if not equal\r\n */\r\nutil.longNeq = function longNeq(a, b) {\r\n return typeof a === 'number'\r\n ? typeof b === 'number'\r\n ? a !== b\r\n : (a = LongBits.fromNumber(a)).lo !== b.low || a.hi !== b.high\r\n : typeof b === 'number'\r\n ? (b = LongBits.fromNumber(b)).lo !== a.low || b.hi !== a.high\r\n : a.low !== b.low || a.high !== b.high;\r\n};\r\n\r\n/**\r\n * Defines the specified properties on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {Object} descriptors Property descriptors\r\n * @returns {undefined}\r\n */\r\nutil.props = function props(target, descriptors) {\r\n Object.keys(descriptors).forEach(function(key) {\r\n util.prop(target, key, descriptors[key]);\r\n });\r\n};\r\n\r\n/**\r\n * Defines the specified property on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {string} key Property name\r\n * @param {Object} descriptor Property descriptor\r\n * @returns {undefined}\r\n */\r\nutil.prop = function prop(target, key, descriptor) {\r\n var ie8 = !-[1,];\r\n var ucKey = key.substring(0, 1).toUpperCase() + key.substring(1);\r\n if (descriptor.get)\r\n target['get' + ucKey] = descriptor.get;\r\n if (descriptor.set)\r\n target['set' + ucKey] = ie8\r\n ? function(value) {\r\n descriptor.set.call(this, value);\r\n this[key] = value;\r\n }\r\n : descriptor.set;\r\n if (ie8) {\r\n if (descriptor.value !== undefined)\r\n target[key] = descriptor.value;\r\n } else\r\n Object.defineProperty(target, key, descriptor);\r\n};\r\n\r\n/**\r\n * An immuable empty array.\r\n * @memberof util\r\n * @type {Array.<*>}\r\n */\r\nutil.emptyArray = Object.freeze([]);\r\n\r\n/**\r\n * An immutable empty object.\r\n * @type {Object}\r\n */\r\nutil.emptyObject = Object.freeze({});\r\n","\"use strict\";\r\nmodule.exports = Writer;\r\n\r\nWriter.BufferWriter = BufferWriter;\r\n\r\nvar util = require(29),\r\n ieee754 = require(1);\r\nvar LongBits = util.LongBits,\r\n ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\r\n\r\n/**\r\n * Constructs a new writer operation.\r\n * @classdesc Scheduled writer operation.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {*} val Value to write\r\n * @param {number} len Value byte length\r\n * @private\r\n * @ignore\r\n */\r\nfunction Op(fn, val, len) {\r\n\r\n /**\r\n * Function to call.\r\n * @type {function(Uint8Array, number, *)}\r\n */\r\n this.fn = fn;\r\n\r\n /**\r\n * Value to write.\r\n * @type {*}\r\n */\r\n this.val = val;\r\n\r\n /**\r\n * Value byte length.\r\n * @type {number}\r\n */\r\n this.len = len;\r\n\r\n /**\r\n * Next operation.\r\n * @type {?Writer.Op}\r\n */\r\n this.next = null;\r\n}\r\n\r\nWriter.Op = Op;\r\n\r\nfunction noop() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Constructs a new writer state.\r\n * @classdesc Copied writer state.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {Writer} writer Writer to copy state from\r\n * @param {State} next Next state entry\r\n * @private\r\n * @ignore\r\n */\r\nfunction State(writer, next) {\r\n\r\n /**\r\n * Current head.\r\n * @type {Writer.Op}\r\n */\r\n this.head = writer.head;\r\n\r\n /**\r\n * Current tail.\r\n * @type {Writer.Op}\r\n */\r\n this.tail = writer.tail;\r\n\r\n /**\r\n * Current buffer length.\r\n * @type {number}\r\n */\r\n this.len = writer.len;\r\n\r\n /**\r\n * Next state.\r\n * @type {?State}\r\n */\r\n this.next = next;\r\n}\r\n\r\nWriter.State = State;\r\n\r\n/**\r\n * Constructs a new writer.\r\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n */\r\nfunction Writer() {\r\n\r\n /**\r\n * Current length.\r\n * @type {number}\r\n */\r\n this.len = 0;\r\n\r\n /**\r\n * Operations head.\r\n * @type {Object}\r\n */\r\n this.head = new Op(noop, 0, 0);\r\n\r\n /**\r\n * Operations tail\r\n * @type {Object}\r\n */\r\n this.tail = this.head;\r\n\r\n /**\r\n * Linked forked states.\r\n * @type {?Object}\r\n */\r\n this.states = null;\r\n\r\n // When a value is written, the writer calculates its byte length and puts it into a linked\r\n // list of operations to perform when finish() is called. This both allows us to allocate\r\n // buffers of the exact required size and reduces the amount of work we have to do compared\r\n // to first calculating over objects and then encoding over objects. In our case, the encoding\r\n // part is just a linked list walk calling linked operations with already prepared values.\r\n}\r\n\r\n/**\r\n * Creates a new writer.\r\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\r\n */\r\nWriter.create = function create() {\r\n return new (util.Buffer && BufferWriter || Writer);\r\n};\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nWriter.alloc = function alloc(size) {\r\n return new ArrayImpl(size);\r\n};\r\n\r\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\r\nif (ArrayImpl !== Array)\r\n Writer.alloc = util.pool(Writer.alloc, ArrayImpl.prototype.subarray || ArrayImpl.prototype.slice);\r\n\r\n/** @alias Writer.prototype */\r\nvar WriterPrototype = Writer.prototype;\r\n\r\n/**\r\n * Pushes a new operation to the queue.\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.push = function push(fn, len, val) {\r\n var op = new Op(fn, val, len);\r\n this.tail.next = op;\r\n this.tail = op;\r\n this.len += len;\r\n return this;\r\n};\r\n\r\nfunction writeByte(buf, pos, val) {\r\n buf[pos] = val & 255;\r\n}\r\n\r\n/**\r\n * Writes a tag.\r\n * @param {number} id Field id\r\n * @param {number} wireType Wire type\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.tag = function write_tag(id, wireType) {\r\n return this.push(writeByte, 1, id << 3 | wireType & 7);\r\n};\r\n\r\nfunction writeVarint32(buf, pos, val) {\r\n while (val > 127) {\r\n buf[pos++] = val & 127 | 128;\r\n val >>>= 7;\r\n }\r\n buf[pos] = val;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as a varint.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.uint32 = function write_uint32(value) {\r\n value >>>= 0;\r\n return value < 128\r\n ? this.push(writeByte, 1, value)\r\n : this.push(writeVarint32,\r\n value < 16384 ? 2\r\n : value < 2097152 ? 3\r\n : value < 268435456 ? 4\r\n : 5\r\n , value);\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as a varint.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.int32 = function write_int32(value) {\r\n return value < 0\r\n ? this.push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\r\n : this.uint32(value);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as a varint, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sint32 = function write_sint32(value) {\r\n return this.uint32(value << 1 ^ value >> 31);\r\n};\r\n\r\nfunction writeVarint64(buf, pos, val) {\r\n // tends to deoptimize. stays optimized when using bits directly.\r\n while (val.hi) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\r\n val.hi >>>= 7;\r\n }\r\n while (val.lo > 127) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = val.lo >>> 7;\r\n }\r\n buf[pos++] = val.lo;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as a varint.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.uint64 = function write_uint64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.int64 = WriterPrototype.uint64;\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sint64 = function write_sint64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a boolish value as a varint.\r\n * @param {boolean} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bool = function write_bool(value) {\r\n return this.push(writeByte, 1, value ? 1 : 0);\r\n};\r\n\r\nfunction writeFixed32(buf, pos, val) {\r\n buf[pos++] = val & 255;\r\n buf[pos++] = val >>> 8 & 255;\r\n buf[pos++] = val >>> 16 & 255;\r\n buf[pos ] = val >>> 24;\r\n}\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fixed32 = function write_fixed32(value) {\r\n return this.push(writeFixed32, 4, value >>> 0);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sfixed32 = function write_sfixed32(value) {\r\n return this.push(writeFixed32, 4, value << 1 ^ value >> 31);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.fixed64 = function write_fixed64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeFixed32, 4, bits.hi).push(writeFixed32, 4, bits.lo);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sfixed64 = function write_sfixed64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeFixed32, 4, bits.hi).push(writeFixed32, 4, bits.lo);\r\n};\r\n\r\nvar writeFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function writeFloat_f32(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos ] = f8b[3];\r\n }\r\n : function writeFloat_f32_le(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeFloat_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Writes a float (32 bit).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.float = function write_float(value) {\r\n return this.push(writeFloat, 4, value);\r\n};\r\n\r\nvar writeDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function writeDouble_f64(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[6];\r\n buf[pos ] = f8b[7];\r\n }\r\n : function writeDouble_f64_le(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[7];\r\n buf[pos++] = f8b[6];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeDouble_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Writes a double (64 bit float).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.double = function write_double(value) {\r\n return this.push(writeDouble, 8, value);\r\n};\r\n\r\nvar writeBytes = ArrayImpl.prototype.set\r\n ? function writeBytes_set(buf, pos, val) {\r\n buf.set(val, pos);\r\n }\r\n : function writeBytes_for(buf, pos, val) {\r\n for (var i = 0; i < val.length; ++i)\r\n buf[pos + i] = val[i];\r\n };\r\n\r\n/**\r\n * Writes a sequence of bytes.\r\n * @param {Uint8Array} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bytes = function write_bytes(value) {\r\n var len = value.length >>> 0;\r\n return len\r\n ? this.uint32(len).push(writeBytes, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\nfunction writeString(buf, pos, val) {\r\n for (var i = 0; i < val.length; ++i) {\r\n var c1 = val.charCodeAt(i), c2;\r\n if (c1 < 128) {\r\n buf[pos++] = c1;\r\n } else if (c1 < 2048) {\r\n buf[pos++] = c1 >> 6 | 192;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = val.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buf[pos++] = c1 >> 18 | 240;\r\n buf[pos++] = c1 >> 12 & 63 | 128;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else {\r\n buf[pos++] = c1 >> 12 | 224;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n }\r\n }\r\n}\r\n\r\nfunction byteLength(val) {\r\n var strlen = val.length >>> 0;\r\n var len = 0;\r\n for (var i = 0; i < strlen; ++i) {\r\n var c1 = val.charCodeAt(i);\r\n if (c1 < 128)\r\n len += 1;\r\n else if (c1 < 2048)\r\n len += 2;\r\n else if ((c1 & 0xFC00) === 0xD800 && (val.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n}\r\n\r\n/**\r\n * Writes a string.\r\n * @param {string} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.string = function write_string(value) {\r\n var len = byteLength(value);\r\n return len\r\n ? this.uint32(len).push(writeString, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Forks this writer's state by pushing it to a stack.\r\n * Calling {@link Writer#}, {@link Writer#reset} or {@link Writer#finish} resets the writer to the previous state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fork = function fork() {\r\n this.states = new State(this, this.states);\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance to the last state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.reset = function reset() {\r\n if (this.states) {\r\n this.head = this.states.head;\r\n this.tail = this.states.tail;\r\n this.len = this.states.len;\r\n this.states = this.states.next;\r\n } else {\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\r\n * @param {number} [id] Id with wire type 2 to prepend as a tag where applicable\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.ldelim = function ldelim(id) {\r\n var head = this.head,\r\n tail = this.tail,\r\n len = this.len;\r\n this.reset();\r\n if (id !== undefined)\r\n this.tag(id, 2);\r\n this.uint32(len);\r\n this.tail.next = head.next; // skip noop\r\n this.tail = tail;\r\n this.len += len;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of write operations and frees all resources.\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nWriterPrototype.finish = function finish() {\r\n var head = this.head.next, // skip noop\r\n buf = this.constructor.alloc(this.len);\r\n this.reset();\r\n var pos = 0;\r\n while (head) {\r\n head.fn(buf, pos, head.val);\r\n pos += head.len;\r\n head = head.next;\r\n }\r\n return buf;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer writer.\r\n * @classdesc Wire format writer using node buffers.\r\n * @exports BufferWriter\r\n * @extends Writer\r\n * @constructor\r\n */\r\nfunction BufferWriter() {\r\n Writer.call(this);\r\n}\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nBufferWriter.alloc = function alloc_buffer(size) {\r\n BufferWriter.alloc = util.Buffer.allocUnsafe\r\n ? util.Buffer.allocUnsafe\r\n : function allocUnsafeNew(size) { return new util.Buffer(size); };\r\n return BufferWriter.alloc(size);\r\n};\r\n\r\n/** @alias BufferWriter.prototype */\r\nvar BufferWriterPrototype = BufferWriter.prototype = Object.create(Writer.prototype);\r\nBufferWriterPrototype.constructor = BufferWriter;\r\n\r\nfunction writeFloatBuffer(buf, pos, val) {\r\n buf.writeFloatLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.float = function write_float_buffer(value) {\r\n return this.push(writeFloatBuffer, 4, value);\r\n};\r\n\r\nfunction writeDoubleBuffer(buf, pos, val) {\r\n buf.writeDoubleLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.double = function write_double_buffer(value) {\r\n return this.push(writeDoubleBuffer, 8, value);\r\n};\r\n\r\nfunction writeBytesBuffer(buf, pos, val) {\r\n if (val.length)\r\n val.copy(buf, pos, 0, val.length);\r\n // This could probably be optimized just like writeStringBuffer, but most real use cases won't benefit much.\r\n}\r\n\r\nif (!(ArrayImpl.prototype.set && util.Buffer && util.Buffer.prototype.set)) // set is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.bytes = function write_bytes_buffer(value) {\r\n var len = value.length >>> 0;\r\n return len\r\n ? this.uint32(len).push(writeBytesBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\nvar writeStringBuffer = (function() { // eslint-disable-line wrap-iife\r\n return util.Buffer && util.Buffer.prototype.utf8Write // around forever, but not present in browser buffer\r\n ? function writeString_buffer_utf8Write(buf, pos, val) {\r\n if (val.length < 40)\r\n writeString(buf, pos, val);\r\n else\r\n buf.utf8Write(val, pos);\r\n }\r\n : function writeString_buffer_write(buf, pos, val) {\r\n if (val.length < 40)\r\n writeString(buf, pos, val);\r\n else\r\n buf.write(val, pos);\r\n };\r\n // Note that the plain JS encoder is faster for short strings, probably because of redundant assertions.\r\n // For a raw utf8Write, the breaking point is about 20 characters, for write it is around 40 characters.\r\n // Unfortunately, this does not translate 1:1 to real use cases, hence the common \"good enough\" limit of 40.\r\n})();\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.string = function write_string_buffer(value) {\r\n var len = value.length < 40\r\n ? byteLength(value)\r\n : util.Buffer.byteLength(value);\r\n return len\r\n ? this.uint32(len).push(writeStringBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n","\"use strict\";\r\nvar protobuf = global.protobuf = exports;\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\r\n * @param {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction load(filename, root, callback) {\r\n if (typeof root === 'function') {\r\n callback = root;\r\n root = new protobuf.Root();\r\n } else if (!root)\r\n root = new protobuf.Root();\r\n return root.load(filename, callback);\r\n}\r\n// function load(filename:string, root:Root, callback:function):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:function):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n// function load(filename:string, [root:Root]):Promise\r\n\r\nprotobuf.load = load;\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace.\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nfunction loadSync(filename, root) {\r\n if (!root)\r\n root = new protobuf.Root();\r\n return root.loadSync(filename);\r\n}\r\n\r\nprotobuf.loadSync = loadSync;\r\n\r\n// Parser\r\nprotobuf.tokenize = require(\"./tokenize\");\r\nprotobuf.parse = require(\"./parse\");\r\n\r\n// Serialization\r\nprotobuf.Writer = require(\"./writer\");\r\nprotobuf.BufferWriter = protobuf.Writer.BufferWriter;\r\nprotobuf.Reader = require(\"./reader\");\r\nprotobuf.BufferReader = protobuf.Reader.BufferReader;\r\nprotobuf.codegen = require(\"./codegen\");\r\n\r\n// Reflection\r\nprotobuf.ReflectionObject = require(\"./object\");\r\nprotobuf.Namespace = require(\"./namespace\");\r\nprotobuf.Root = require(\"./root\");\r\nprotobuf.Enum = require(\"./enum\");\r\nprotobuf.Type = require(\"./type\");\r\nprotobuf.Field = require(\"./field\");\r\nprotobuf.OneOf = require(\"./oneof\");\r\nprotobuf.MapField = require(\"./mapfield\");\r\nprotobuf.Service = require(\"./service\");\r\nprotobuf.Method = require(\"./method\");\r\n\r\n// Runtime\r\nprotobuf.Prototype = require(\"./prototype\");\r\nprotobuf.inherits = require(\"./inherits\");\r\n\r\n// Utility\r\nprotobuf.types = require(\"./types\");\r\nprotobuf.common = require(\"./common\");\r\nprotobuf.rpc = require(\"./rpc\");\r\nprotobuf.util = require(\"./util\");\r\n\r\n// Be nice to AMD\r\nif (typeof define === 'function' && define.amd)\r\n define([\"long\"], function(Long) {\r\n if (Long) {\r\n protobuf.util.Long = Long;\r\n protobuf.Reader.configure();\r\n }\r\n return protobuf;\r\n });\r\n"],"sourceRoot":"."} \ No newline at end of file +{"version":3,"sources":["node_modules/browser-pack/_prelude.js","lib/ieee754.js","src/class.js","src/codegen.js","src/codegen/decode.js","src/codegen/encode.js","src/codegen/verify.js","src/common.js","src/enum.js","src/field.js","src/mapfield.js","src/message.js","src/method.js","src/namespace.js","src/object.js","src/oneof.js","src/parse.js","src/reader.js","src/root.js","src/rpc.js","src/rpc/service.js","src/service.js","src/tokenize.js","src/type.js","src/types.js","src/util.js","src/util/eventemitter.js","src/util/longbits.js","src/util/pool.js","src/util/runtime.js","src/writer.js","src/index.js"],"names":[],"mappings":";;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1iBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACpoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"protobuf.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o> 1,\r\n nBits = -7,\r\n i = isBE ? 0 : (nBytes - 1),\r\n d = isBE ? 1 : -1,\r\n s = buffer[offset + i];\r\n\r\n i += d;\r\n\r\n e = s & ((1 << (-nBits)) - 1);\r\n s >>= (-nBits);\r\n nBits += eLen;\r\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n m = e & ((1 << (-nBits)) - 1);\r\n e >>= (-nBits);\r\n nBits += mLen;\r\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n if (e === 0) {\r\n e = 1 - eBias;\r\n } else if (e === eMax) {\r\n return m ? NaN : ((s ? -1 : 1) * Infinity);\r\n } else {\r\n m = m + Math.pow(2, mLen);\r\n e = e - eBias;\r\n }\r\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen);\r\n};\r\n\r\nexports.write = function writeIEEE754(buffer, value, offset, isBE, mLen, nBytes) {\r\n var e, m, c,\r\n eLen = nBytes * 8 - mLen - 1,\r\n eMax = (1 << eLen) - 1,\r\n eBias = eMax >> 1,\r\n rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),\r\n i = isBE ? (nBytes - 1) : 0,\r\n d = isBE ? -1 : 1,\r\n s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;\r\n\r\n value = Math.abs(value);\r\n\r\n if (isNaN(value) || value === Infinity) {\r\n m = isNaN(value) ? 1 : 0;\r\n e = eMax;\r\n } else {\r\n e = Math.floor(Math.log(value) / Math.LN2);\r\n if (value * (c = Math.pow(2, -e)) < 1) {\r\n e--;\r\n c *= 2;\r\n }\r\n if (e + eBias >= 1) {\r\n value += rt / c;\r\n } else {\r\n value += rt * Math.pow(2, 1 - eBias);\r\n }\r\n if (value * c >= 2) {\r\n e++;\r\n c /= 2;\r\n }\r\n\r\n if (e + eBias >= eMax) {\r\n m = 0;\r\n e = eMax;\r\n } else if (e + eBias >= 1) {\r\n m = (value * c - 1) * Math.pow(2, mLen);\r\n e = e + eBias;\r\n } else {\r\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\r\n e = 0;\r\n }\r\n }\r\n\r\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);\r\n\r\n e = (e << mLen) | m;\r\n eLen += mLen;\r\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);\r\n\r\n buffer[offset + i - d] |= s * 128;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Class;\r\n\r\nvar Message = require(11),\r\n Type = require(23),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a class instance, which is also a message prototype.\r\n * @classdesc Runtime class providing the tools to create your own custom classes.\r\n * @constructor\r\n * @param {Type} type Reflected type\r\n * @abstract\r\n */\r\nfunction Class(type) {\r\n return Class.create(type);\r\n}\r\n\r\n/**\r\n * Constructs a new message prototype for the specified reflected type and sets up its constructor.\r\n * @param {Type} type Reflected message type\r\n * @param {*} [ctor] Custom constructor to set up, defaults to create a generic one if omitted\r\n * @returns {Message} Message prototype\r\n */\r\nClass.create = function create(type, ctor) {\r\n if (!(type instanceof Type))\r\n throw _TypeError(\"type\", \"a Type\");\r\n var clazz = ctor;\r\n if (clazz) {\r\n if (typeof clazz !== 'function')\r\n throw _TypeError(\"ctor\", \"a function\");\r\n } else\r\n clazz = (function(MessageCtor) { // eslint-disable-line wrap-iife\r\n return function Message(properties) {\r\n MessageCtor.call(this, properties);\r\n };\r\n })(Message);\r\n\r\n // Let's pretend...\r\n clazz.constructor = Class;\r\n \r\n // new Class() -> Message.prototype\r\n var prototype = clazz.prototype = new Message();\r\n prototype.constructor = clazz;\r\n\r\n // Static methods on Message are instance methods on Class and vice-versa.\r\n util.merge(clazz, Message, true);\r\n\r\n // Classes and messages reference their reflected type\r\n clazz.$type = type;\r\n prototype.$type = type;\r\n\r\n // Messages have non-enumerable default values on their prototype\r\n type.getFieldsArray().forEach(function(field) {\r\n field.resolve();\r\n // objects on the prototype must be immmutable. users must assign a new object instance and\r\n // cannot use Array#push on empty arrays on the prototype for example, as this would modify\r\n // the value on the prototype for ALL messages of this type. Hence, these objects are frozen.\r\n prototype[field.name] = Array.isArray(field.defaultValue)\r\n ? util.emptyArray\r\n : util.isObject(field.defaultValue)\r\n ? util.emptyObject\r\n : field.defaultValue;\r\n });\r\n\r\n // Runtime messages have non-enumerable getters and setters for each virtual oneof field\r\n type.getOneofsArray().forEach(function(oneof) {\r\n util.prop(prototype, oneof.resolve().name, {\r\n get: function getVirtual() {\r\n // > If the parser encounters multiple members of the same oneof on the wire, only the last member seen is used in the parsed message.\r\n var keys = Object.keys(this);\r\n for (var i = keys.length - 1; i > -1; --i)\r\n if (oneof.oneof.indexOf(keys[i]) > -1)\r\n return keys[i];\r\n return undefined;\r\n },\r\n set: function setVirtual(value) {\r\n var keys = oneof.oneof;\r\n for (var i = 0; i < keys.length; ++i)\r\n if (keys[i] !== value)\r\n delete this[keys[i]];\r\n }\r\n });\r\n });\r\n\r\n // Register\r\n type.ctor = clazz;\r\n\r\n return prototype;\r\n};\r\n\r\n// Static methods on Message are instance methods on Class and vice-versa.\r\nClass.prototype = Message;\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @name Class#encode\r\n * @function\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @name Class#encodeDelimited\r\n * @function\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Class#decode\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Class#decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Class#verify\r\n * @function\r\n * @param {Message|Object} message Message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\nvar util = require(25);\r\n\r\nvar blockOpenRe = /[{[]$/,\r\n blockCloseRe = /^[}\\]]/,\r\n casingRe = /:$/,\r\n branchRe = /^\\s*(?:if|else if|while|for)\\b|\\b(?:else)\\s*$/,\r\n breakRe = /\\b(?:break|continue);?$|^\\s*return\\b/;\r\n\r\n/**\r\n * A closure for generating functions programmatically.\r\n * @namespace\r\n * @function\r\n * @param {...string} params Function parameter names\r\n * @returns {CodegenInstance} Codegen instance\r\n * @property {boolean} supported Whether code generation is supported by the environment.\r\n * @property {boolean} verbose=false When set to true, codegen will log generated code to console. Useful for debugging.\r\n */\r\nfunction codegen() {\r\n var args = Array.prototype.slice.call(arguments),\r\n src = ['\\t\"use strict\"'],\r\n indent = 1,\r\n inCase = false;\r\n\r\n /**\r\n * A codegen instance as returned by {@link codegen}, that also is a {@link util.sprintf|sprintf}-like appender function.\r\n * @typedef CodegenInstance\r\n * @type {function}\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {CodegenInstance} Itself\r\n * @property {function(string=):string} str Stringifies the so far generated function source.\r\n * @property {function(string=, Object=):function} eof Ends generation and builds the function whilst applying a scope.\r\n */\r\n /**/\r\n function gen() {\r\n var line = util.sprintf.apply(null, arguments);\r\n var level = indent;\r\n if (src.length) {\r\n var prev = src[src.length - 1];\r\n\r\n // block open or one time branch\r\n if (blockOpenRe.test(prev))\r\n level = ++indent; // keep\r\n else if (branchRe.test(prev))\r\n ++level; // once\r\n \r\n // casing\r\n if (casingRe.test(prev) && !casingRe.test(line)) {\r\n level = ++indent;\r\n inCase = true;\r\n } else if (inCase && breakRe.test(prev)) {\r\n level = --indent;\r\n inCase = false;\r\n }\r\n\r\n // block close\r\n if (blockCloseRe.test(line))\r\n level = --indent;\r\n }\r\n for (var index = 0; index < level; ++index)\r\n line = \"\\t\" + line;\r\n src.push(line);\r\n return gen;\r\n }\r\n\r\n /**\r\n * Stringifies the so far generated function source.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @returns {string} Function source using tabs for indentation\r\n * @inner\r\n */\r\n function str(name) {\r\n return \"function \" + (name ? name.replace(/[^\\w_$]/g, \"_\") : \"\") + \"(\" + args.join(\", \") + \") {\\n\" + src.join(\"\\n\") + \"\\n}\";\r\n }\r\n\r\n gen.str = str;\r\n\r\n /**\r\n * Ends generation and builds the function whilst applying a scope.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @param {Object} [scope] Function scope\r\n * @returns {function} The generated function, with scope applied if specified\r\n * @inner\r\n */\r\n function eof(name, scope) {\r\n if (typeof name === 'object') {\r\n scope = name;\r\n name = undefined;\r\n }\r\n var source = gen.str(name);\r\n if (codegen.verbose)\r\n console.log(\"--- codegen ---\\n\" + source.replace(/^/mg, \"> \").replace(/\\t/g, \" \")); // eslint-disable-line no-console\r\n var keys = Object.keys(scope || (scope = {}));\r\n return Function.apply(null, keys.concat(\"return \" + source)).apply(null, keys.map(function(key) { return scope[key]; })); // eslint-disable-line no-new-func\r\n // ^ Creates a wrapper function with the scoped variable names as its parameters,\r\n // calls it with the respective scoped variable values ^\r\n // and returns our brand-new properly scoped function.\r\n //\r\n // This works because \"Invoking the Function constructor as a function (without using the\r\n // new operator) has the same effect as invoking it as a constructor.\"\r\n // https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Function\r\n }\r\n\r\n gen.eof = eof;\r\n\r\n return gen;\r\n}\r\n\r\ncodegen.supported = false; try { codegen.supported = codegen(\"a\",\"b\")(\"return a-b\").eof()(2,1) === 1; } catch (e) {} // eslint-disable-line no-empty\r\ncodegen.verbose = false;\r\n\r\ncodegen.encode = require(5);\r\ncodegen.decode = require(4);\r\ncodegen.verify = require(6);\r\n","\"use strict\";\r\n\r\n/**\r\n * Wire format decoder using code generation on top of reflection that also provides a fallback.\r\n * @exports codegen.decode\r\n * @namespace\r\n */\r\nvar decode = exports;\r\n\r\nvar Enum = require(8),\r\n Reader = require(17),\r\n types = require(24),\r\n util = require(25),\r\n codegen = require(3);\r\n\r\n/**\r\n * Decodes a message of `this` message's type.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message} Populated runtime message\r\n * @this Type\r\n */\r\ndecode.fallback = function decode_fallback(readerOrBuffer, length) {\r\n /* eslint-disable no-invalid-this, block-scoped-var, no-redeclare */\r\n var fields = this.getFieldsById(),\r\n reader = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer),\r\n limit = length === undefined ? reader.len : reader.pos + length,\r\n message = new (this.getCtor())();\r\n while (reader.pos < limit) {\r\n var tag = reader.tag(),\r\n field = fields[tag.id].resolve(),\r\n type = field.resolvedType instanceof Enum ? \"uint32\" : field.type;\r\n \r\n // Known fields\r\n if (field) {\r\n\r\n // Map fields\r\n if (field.map) {\r\n var keyType = field.resolvedKeyType /* only valid is enum */ ? \"uint32\" : field.keyType,\r\n length = reader.uint32();\r\n var map = message[field.name] = {};\r\n if (length) {\r\n length += reader.pos;\r\n var ks = [], vs = [];\r\n while (reader.pos < length) {\r\n if (reader.tag().id === 1)\r\n ks[ks.length] = reader[keyType]();\r\n else if (types.basic[type] !== undefined)\r\n vs[vs.length] = reader[type]();\r\n else\r\n vs[vs.length] = field.resolvedType.decode(reader, reader.uint32());\r\n }\r\n for (var i = 0; i < ks.length; ++i)\r\n map[typeof ks[i] === 'object' ? util.longToHash(ks[i]) : ks[i]] = vs[i];\r\n }\r\n\r\n // Repeated fields\r\n } else if (field.repeated) {\r\n var values = message[field.name] && message[field.name].length ? message[field.name] : message[field.name] = [];\r\n\r\n // Packed\r\n if (field.packed && types.packed[type] !== undefined && tag.wireType === 2) {\r\n var plimit = reader.uint32() + reader.pos;\r\n while (reader.pos < plimit)\r\n values[values.length] = reader[type]();\r\n\r\n // Non-packed\r\n } else if (types.basic[type] !== undefined)\r\n values[values.length] = reader[type]();\r\n else\r\n values[values.length] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Non-repeated\r\n } else if (types.basic[type] !== undefined)\r\n message[field.name] = reader[type]();\r\n else\r\n message[field.name] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Unknown fields\r\n } else\r\n reader.skipType(tag.wireType);\r\n }\r\n return message;\r\n /* eslint-enable no-invalid-this, block-scoped-var, no-redeclare */\r\n};\r\n\r\n/**\r\n * Generates a decoder specific to the specified message type, with an identical signature to {@link codegen.decode.fallback}.\r\n * @param {Type} mtype Message type\r\n * @returns {CodegenInstance} {@link codegen|Codegen} instance\r\n */\r\ndecode.generate = function decode_generate(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n var fields = mtype.getFieldsArray(); \r\n var gen = codegen(\"r\", \"l\")\r\n\r\n (\"r instanceof Reader||(r=Reader.create(r))\")\r\n (\"var c=l===undefined?r.len:r.pos+l,m=new(this.getCtor())\")\r\n (\"while(r.pos} [values] Enum values as an object, by name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Enum(name, values, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Enum values by name.\r\n * @type {Object.}\r\n */\r\n this.values = values || {}; // toJSON, marker\r\n\r\n /**\r\n * Cached values by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._valuesById = null;\r\n}\r\n\r\nutil.props(EnumPrototype, {\r\n\r\n /**\r\n * Enum values by id.\r\n * @name Enum#valuesById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n valuesById: {\r\n get: function getValuesById() {\r\n if (!this._valuesById) {\r\n this._valuesById = {};\r\n Object.keys(this.values).forEach(function(name) {\r\n var id = this.values[name];\r\n if (this._valuesById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._valuesById[id] = name;\r\n }, this);\r\n }\r\n return this._valuesById;\r\n }\r\n }\r\n\r\n /**\r\n * Gets this enum's values by id. This is an alias of {@link Enum#valuesById}'s getter for use within non-ES5 environments.\r\n * @name Enum#getValuesById\r\n * @function\r\n * @returns {Object.}\r\n */\r\n});\r\n\r\nfunction clearCache(enm) {\r\n enm._valuesById = null;\r\n return enm;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes an enum.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes an enum\r\n */\r\nEnum.testJSON = function testJSON(json) {\r\n return Boolean(json && json.values);\r\n};\r\n\r\n/**\r\n * Creates an enum from JSON.\r\n * @param {string} name Enum name\r\n * @param {Object.} json JSON object\r\n * @returns {Enum} Created enum\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nEnum.fromJSON = function fromJSON(name, json) {\r\n return new Enum(name, json.values, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nEnumPrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n values : this.values\r\n };\r\n};\r\n\r\n/**\r\n * Adds a value to this enum.\r\n * @param {string} name Value name\r\n * @param {number} id Value id\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a value with this name or id\r\n */\r\nEnumPrototype.add = function(name, id) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (this.values[name] !== undefined)\r\n throw Error('duplicate name \"' + name + '\" in ' + this);\r\n if (this.getValuesById()[id] !== undefined)\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this.values[name] = id;\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a value from this enum\r\n * @param {string} name Value name\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `name` is not a name of this enum\r\n */\r\nEnumPrototype.remove = function(name) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (this.values[name] === undefined)\r\n throw Error('\"' + name + '\" is not a name of ' + this);\r\n delete this.values[name];\r\n return clearCache(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Field;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = ReflectionObject.extend(Field);\r\n\r\nvar Type = require(23),\r\n Enum = require(8),\r\n MapField = require(10),\r\n types = require(24),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\r\n * @classdesc Reflected message field.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object} [rule=\"optional\"] Field rule\r\n * @param {string|Object} [extend] Extended type if different from parent\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Field(name, id, type, rule, extend, options) {\r\n if (util.isObject(rule)) {\r\n options = rule;\r\n rule = extend = undefined;\r\n } else if (util.isObject(extend)) {\r\n options = extend;\r\n extend = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (!util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (extend !== undefined && !util.isString(extend))\r\n throw _TypeError(\"extend\");\r\n if (rule !== undefined && !/^required|optional|repeated$/.test(rule = rule.toString().toLowerCase()))\r\n throw _TypeError(\"rule\", \"a valid rule string\");\r\n\r\n /**\r\n * Field rule, if any.\r\n * @type {string|undefined}\r\n */\r\n this.rule = rule && rule !== 'optional' ? rule : undefined; // toJSON\r\n\r\n /**\r\n * Field type.\r\n * @type {string}\r\n */\r\n this.type = type; // toJSON\r\n\r\n /**\r\n * Unique field id.\r\n * @type {number}\r\n */\r\n this.id = id; // toJSON, marker\r\n\r\n /**\r\n * Extended type if different from parent.\r\n * @type {string|undefined}\r\n */\r\n this.extend = extend || undefined; // toJSON\r\n\r\n /**\r\n * Whether this field is required.\r\n * @type {boolean}\r\n */\r\n this.required = rule === \"required\";\r\n\r\n /**\r\n * Whether this field is optional.\r\n * @type {boolean}\r\n */\r\n this.optional = !this.required;\r\n\r\n /**\r\n * Whether this field is repeated.\r\n * @type {boolean}\r\n */\r\n this.repeated = rule === \"repeated\";\r\n\r\n /**\r\n * Whether this field is a map or not.\r\n * @type {boolean}\r\n */\r\n this.map = false;\r\n\r\n /**\r\n * Message this field belongs to.\r\n * @type {?Type}\r\n */\r\n this.message = null;\r\n\r\n /**\r\n * OneOf this field belongs to, if any,\r\n * @type {?OneOf}\r\n */\r\n this.partOf = null;\r\n\r\n /**\r\n * The field's default value. Only relevant when working with proto2.\r\n * @type {*}\r\n */\r\n this.defaultValue = null;\r\n\r\n /**\r\n * Whether this field's value should be treated as a long.\r\n * @type {boolean}\r\n */\r\n this.long = util.Long ? types.long[type] !== undefined : false;\r\n\r\n /**\r\n * Resolved type if not a basic type.\r\n * @type {?(Type|Enum)}\r\n */\r\n this.resolvedType = null;\r\n\r\n /**\r\n * Sister-field within the extended type if a declaring extension field.\r\n * @type {?Field}\r\n */\r\n this.extensionField = null;\r\n\r\n /**\r\n * Sister-field within the declaring namespace if an extended field.\r\n * @type {?Field}\r\n */\r\n this.declaringField = null;\r\n\r\n /**\r\n * Internally remembers whether this field is packed.\r\n * @type {?boolean}\r\n * @private\r\n */\r\n this._packed = null;\r\n}\r\n\r\nutil.props(FieldPrototype, {\r\n\r\n /**\r\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\r\n * @name Field#packed\r\n * @type {boolean}\r\n * @readonly\r\n */\r\n packed: {\r\n get: FieldPrototype.isPacked = function() {\r\n if (this._packed === null)\r\n this._packed = this.getOption(\"packed\") !== false;\r\n return this._packed;\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether this field is packed. This is an alias of {@link Field#packed}'s getter for use within non-ES5 environments.\r\n * @name Field#isPacked\r\n * @function\r\n * @returns {boolean}\r\n */\r\n});\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (name === \"packed\")\r\n this._packed = null;\r\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\r\n};\r\n\r\n/**\r\n * Tests if the specified JSON object describes a field.\r\n * @param {*} json Any JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nField.testJSON = function testJSON(json) {\r\n return Boolean(json && json.id !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {Field} Created field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nField.fromJSON = function fromJSON(name, json) {\r\n if (json.keyType !== undefined)\r\n return MapField.fromJSON(name, json);\r\n return new Field(name, json.id, json.type, json.role, json.extend, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n rule : this.rule !== \"optional\" && this.rule || undefined,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Resolves this field's type references.\r\n * @returns {Field} `this`\r\n * @throws {Error} If any reference cannot be resolved\r\n */\r\nFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n\r\n var typeDefault = types.defaults[this.type];\r\n\r\n // if not a basic type, resolve it\r\n if (typeDefault === undefined) {\r\n var resolved = this.parent.lookup(this.type);\r\n if (resolved instanceof Type) {\r\n this.resolvedType = resolved;\r\n typeDefault = null;\r\n } else if (resolved instanceof Enum) {\r\n this.resolvedType = resolved;\r\n typeDefault = 0;\r\n } else\r\n throw Error(\"unresolvable field type: \" + this.type);\r\n }\r\n\r\n // when everything is resolved determine the default value\r\n var optionDefault;\r\n if (this.map)\r\n this.defaultValue = {};\r\n else if (this.repeated)\r\n this.defaultValue = [];\r\n else if (this.options && (optionDefault = this.options['default']) !== undefined) // eslint-disable-line dot-notation\r\n this.defaultValue = optionDefault;\r\n else\r\n this.defaultValue = typeDefault;\r\n\r\n if (this.long)\r\n this.defaultValue = util.Long.fromValue(this.defaultValue);\r\n \r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Converts a field value to JSON using the specified options. Note that this method does not account for repeated fields and must be called once for each repeated element instead.\r\n * @param {*} value Field value\r\n * @param {Object.} [options] Conversion options\r\n * @returns {*} Converted value\r\n * @see {@link Message#asJSON}\r\n */\r\nFieldPrototype.jsonConvert = function(value, options) {\r\n if (options) {\r\n if (this.resolvedType instanceof Enum && options['enum'] === String) // eslint-disable-line dot-notation\r\n return this.resolvedType.getValuesById()[value];\r\n else if (this.long && options.long)\r\n return options.long === Number\r\n ? typeof value === 'number'\r\n ? value\r\n : util.Long.fromValue(value).toNumber()\r\n : util.Long.fromValue(value, this.type.charAt(0) === 'u').toString();\r\n }\r\n return value;\r\n};\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\nvar Field = require(9);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = Field.prototype;\r\n/** @alias MapField.prototype */\r\nvar MapFieldPrototype = Field.extend(MapField);\r\n\r\nvar Enum = require(8),\r\n types = require(24),\r\n util = require(25);\r\n\r\n/**\r\n * Constructs a new map field instance.\r\n * @classdesc Reflected map field.\r\n * @extends Field\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} keyType Key type\r\n * @param {string} type Value type\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction MapField(name, id, keyType, type, options) {\r\n Field.call(this, name, id, type, options);\r\n if (!util.isString(keyType))\r\n throw util._TypeError(\"keyType\");\r\n \r\n /**\r\n * Key type.\r\n * @type {string}\r\n */\r\n this.keyType = keyType; // toJSON, marker\r\n\r\n /**\r\n * Resolved key type if not a basic type.\r\n * @type {?ReflectionObject}\r\n */\r\n this.resolvedKeyType = null;\r\n\r\n // Overrides Field#map\r\n this.map = true;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a map field.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nMapField.testJSON = function testJSON(json) {\r\n return Field.testJSON(json) && json.keyType !== undefined;\r\n};\r\n\r\n/**\r\n * Constructs a map field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created map field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMapField.fromJSON = function fromJSON(name, json) {\r\n return new MapField(name, json.id, json.keyType, json.type, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n keyType : this.keyType,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n \r\n // Besides a value type, map fields have a key type to resolve\r\n var keyWireType = types.mapKey[this.keyType];\r\n if (keyWireType === undefined) {\r\n var resolved = this.parent.lookup(this.keyType);\r\n if (!(resolved instanceof Enum))\r\n throw Error(\"unresolvable map key type: \" + this.keyType);\r\n this.resolvedKeyType = resolved;\r\n }\r\n\r\n return FieldPrototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Message;\r\n\r\n/**\r\n * Constructs a new message instance.\r\n * \r\n * This method should be called from your custom constructors, i.e. `Message.call(this, properties)`.\r\n * @classdesc Abstract runtime message.\r\n * @extends {Object}\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set\r\n * @abstract\r\n * @see {@link Class.create}\r\n */\r\nfunction Message(properties) {\r\n if (properties) {\r\n var keys = Object.keys(properties);\r\n for (var i = 0; i < keys.length; ++i)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n}\r\n\r\n/** @alias Message.prototype */\r\nvar MessagePrototype = Message.prototype;\r\n\r\n/**\r\n * Converts this message to a JSON object.\r\n * @param {Object.} [options] Conversion options\r\n * @param {boolean} [options.fieldsOnly=false] Converts only properties that reference a field\r\n * @param {*} [options.long] Long conversion type. Only relevant with a long library.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to a possibly unsafe number without, and a `Long` with a long library.\r\n * @param {*} [options.enum=Number] Enum value conversion type.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to the numeric ids.\r\n * @param {boolean} [options.defaults=false] Also sets default values on the resulting object\r\n * @returns {Object.} JSON object\r\n */\r\nMessagePrototype.asJSON = function asJSON(options) {\r\n if (!options)\r\n options = {};\r\n var fields = this.$type.fields,\r\n json = {};\r\n var keys;\r\n if (options.defaults) {\r\n keys = [];\r\n for (var k in this) // eslint-disable-line guard-for-in\r\n keys.push(k);\r\n } else\r\n keys = Object.keys(this);\r\n for (var i = 0, key; i < keys.length; ++i) {\r\n var field = fields[key = keys[i]],\r\n value = this[key];\r\n if (field) {\r\n if (field.repeated) {\r\n if (value && value.length) {\r\n var array = new Array(value.length);\r\n for (var j = 0, l = value.length; j < l; ++j)\r\n array[j] = field.jsonConvert(value[j], options);\r\n json[key] = array;\r\n }\r\n } else\r\n json[key] = field.jsonConvert(value, options);\r\n } else if (!options.fieldsOnly)\r\n json[key] = value;\r\n }\r\n return json;\r\n};\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\nMessage.encode = function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Message.decode\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\nMessage.decode = function decode(readerOrBuffer) {\r\n return this.$type.decode(readerOrBuffer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Message.decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\nMessage.decodeDelimited = function decodeDelimited(readerOrBuffer) {\r\n return this.$type.decodeDelimited(readerOrBuffer);\r\n};\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Message.verify\r\n * @function\r\n * @param {Message|Object} message Message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\nMessage.verify = function verify(message) {\r\n return this.$type.verify(message);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Method;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias Method.prototype */\r\nvar MethodPrototype = ReflectionObject.extend(Method);\r\n\r\nvar Type = require(23),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new service method instance.\r\n * @classdesc Reflected service method.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Method name\r\n * @param {string|undefined} type Method type, usually `\"rpc\"`\r\n * @param {string} requestType Request message type\r\n * @param {string} responseType Response message type\r\n * @param {boolean|Object} [requestStream] Whether the request is streamed\r\n * @param {boolean|Object} [responseStream] Whether the response is streamed\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options) {\r\n if (util.isObject(requestStream)) {\r\n options = requestStream;\r\n requestStream = responseStream = undefined;\r\n } else if (util.isObject(responseStream)) {\r\n options = responseStream;\r\n responseStream = undefined;\r\n }\r\n if (type && !util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (!util.isString(requestType))\r\n throw _TypeError(\"requestType\");\r\n if (!util.isString(responseType))\r\n throw _TypeError(\"responseType\");\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Method type.\r\n * @type {string}\r\n */\r\n this.type = type || \"rpc\"; // toJSON\r\n\r\n /**\r\n * Request type.\r\n * @type {string}\r\n */\r\n this.requestType = requestType; // toJSON, marker\r\n\r\n /**\r\n * Whether requests are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.requestStream = requestStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Response type.\r\n * @type {string}\r\n */\r\n this.responseType = responseType; // toJSON\r\n\r\n /**\r\n * Whether responses are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.responseStream = responseStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Resolved request type.\r\n * @type {?Type}\r\n */\r\n this.resolvedRequestType = null;\r\n\r\n /**\r\n * Resolved response type.\r\n * @type {?Type}\r\n */\r\n this.resolvedResponseType = null;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service method.\r\n * @param {Object} json JSON object\r\n * @returns {boolean} `true` if the object describes a map field\r\n */\r\nMethod.testJSON = function testJSON(json) {\r\n return Boolean(json && json.requestType !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a service method from JSON.\r\n * @param {string} name Method name\r\n * @param {Object} json JSON object\r\n * @returns {Method} Created method\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMethod.fromJSON = function fromJSON(name, json) {\r\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.toJSON = function toJSON() {\r\n return {\r\n type : this.type !== \"rpc\" && this.type || undefined,\r\n requestType : this.requestType,\r\n requestStream : this.requestStream,\r\n responseType : this.responseType,\r\n responseStream : this.responseStream,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var resolved = this.parent.lookup(this.requestType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable request type: \" + this.requestType);\r\n this.resolvedRequestType = resolved;\r\n resolved = this.parent.lookup(this.responseType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable response type: \" + this.requestType);\r\n this.resolvedResponseType = resolved;\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Namespace;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = ReflectionObject.extend(Namespace);\r\n\r\nvar Enum = require(8),\r\n Type = require(23),\r\n Field = require(9),\r\n Service = require(21),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\nvar nestedTypes = [ Enum, Type, Service, Field, Namespace ],\r\n nestedError = \"one of \" + nestedTypes.map(function(ctor) { return ctor.name; }).join(', ');\r\n\r\n/**\r\n * Constructs a new namespace instance.\r\n * @classdesc Reflected namespace and base class of all reflection objects containing nested objects.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Namespace(name, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Nested objects by name.\r\n * @type {Object.|undefined}\r\n */\r\n this.nested = undefined; // toJSON\r\n\r\n /**\r\n * Cached nested objects as an array.\r\n * @type {?ReflectionObject[]}\r\n * @private\r\n */\r\n this._nestedArray = null;\r\n}\r\n\r\nfunction clearCache(namespace) {\r\n namespace._nestedArray = null;\r\n return namespace;\r\n}\r\n\r\nutil.props(NamespacePrototype, {\r\n\r\n /**\r\n * Nested objects of this namespace as an array for iteration.\r\n * @name Namespace#nestedArray\r\n * @type {ReflectionObject[]}\r\n * @readonly\r\n */\r\n nestedArray: {\r\n get: function getNestedArray() {\r\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Tests if the specified JSON object describes not another reflection object.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes not another reflection object\r\n */\r\nNamespace.testJSON = function testJSON(json) {\r\n return Boolean(json\r\n && !json.fields // Type\r\n && !json.values // Enum\r\n && json.id === undefined // Field, MapField\r\n && !json.oneof // OneOf\r\n && !json.methods // Service\r\n && json.requestType === undefined // Method\r\n );\r\n};\r\n\r\n/**\r\n * Constructs a namespace from JSON.\r\n * @param {string} name Namespace name\r\n * @param {Object} json JSON object\r\n * @returns {Namespace} Created namespace\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nNamespace.fromJSON = function fromJSON(name, json) {\r\n return new Namespace(name, json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nNamespacePrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n nested : arrayToJSON(this.getNestedArray())\r\n };\r\n};\r\n\r\n/**\r\n * Converts an array of reflection objects to JSON.\r\n * @memberof Namespace\r\n * @param {ReflectionObject[]} array Object array\r\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\r\n */\r\nfunction arrayToJSON(array) {\r\n if (!(array && array.length))\r\n return undefined;\r\n var obj = {};\r\n for (var i = 0; i < array.length; ++i)\r\n obj[array[i].name] = array[i].toJSON();\r\n return obj;\r\n}\r\n\r\nNamespace.arrayToJSON = arrayToJSON;\r\n\r\n/**\r\n * Adds nested elements to this namespace from JSON.\r\n * @param {Object.} nestedJson Nested JSON\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.addJSON = function addJSON(nestedJson) {\r\n var ns = this;\r\n if (nestedJson)\r\n Object.keys(nestedJson).forEach(function(nestedName) {\r\n var nested = nestedJson[nestedName];\r\n for (var j = 0; j < nestedTypes.length; ++j)\r\n if (nestedTypes[j].testJSON(nested))\r\n return ns.add(nestedTypes[j].fromJSON(nestedName, nested));\r\n throw _TypeError(\"nested.\" + nestedName, \"JSON for \" + nestedError);\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets the nested object of the specified name.\r\n * @param {string} name Nested object name\r\n * @returns {?ReflectionObject} The reflection object or `null` if it doesn't exist\r\n */\r\nNamespacePrototype.get = function get(name) {\r\n if (this.nested === undefined) // prevents deopt\r\n return null;\r\n return this.nested[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this namespace.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name\r\n */\r\nNamespacePrototype.add = function add(object) {\r\n if (!object || nestedTypes.indexOf(object.constructor) < 0)\r\n throw _TypeError(\"object\", nestedError);\r\n if (object instanceof Field && object.extend === undefined)\r\n throw _TypeError(\"object\", \"an extension field when not part of a type\");\r\n if (!this.nested)\r\n this.nested = {};\r\n else {\r\n var prev = this.get(object.name);\r\n if (prev) {\r\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\r\n // replace plain namespace but keep existing nested elements and options\r\n var nested = prev.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i)\r\n object.add(nested[i]);\r\n this.remove(prev);\r\n if (!this.nested)\r\n this.nested = {};\r\n object.setOptions(prev.options, true);\r\n } else\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n }\r\n }\r\n this.nested[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this namespace.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this namespace\r\n */\r\nNamespacePrototype.remove = function remove(object) {\r\n if (!(object instanceof ReflectionObject))\r\n throw _TypeError(\"object\", \"a ReflectionObject\");\r\n if (object.parent !== this || !this.nested)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.nested[object.name];\r\n if (!Object.keys(this.nested).length)\r\n this.nested = undefined;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Defines additial namespaces within this one if not yet existing.\r\n * @param {string|string[]} path Path to create\r\n * @param {*} [json] Nested types to create from JSON\r\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\r\n */\r\nNamespacePrototype.define = function define(path, json) {\r\n if (util.isString(path))\r\n path = path.split('.');\r\n else if (!Array.isArray(path)) {\r\n json = path;\r\n path = undefined;\r\n }\r\n var ptr = this;\r\n if (path)\r\n while (path.length > 0) {\r\n var part = path.shift();\r\n if (ptr.nested && ptr.nested[part]) {\r\n ptr = ptr.nested[part];\r\n if (!(ptr instanceof Namespace))\r\n throw Error(\"path conflicts with non-namespace objects\");\r\n } else\r\n ptr.add(ptr = new Namespace(part));\r\n }\r\n if (json)\r\n ptr.addJSON(json);\r\n return ptr;\r\n};\r\n\r\n/**\r\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree.\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.resolveAll = function resolve() {\r\n var nested = this.getNestedArray(), i = 0;\r\n while (i < nested.length)\r\n if (nested[i] instanceof Namespace)\r\n nested[i++].resolveAll();\r\n else\r\n nested[i++].resolve();\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Looks up the reflection object at the specified path, relative to this namespace.\r\n * @param {string|string[]} path Path to look up\r\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\r\n * @returns {?ReflectionObject} Looked up object or `null` if none could be found\r\n */\r\nNamespacePrototype.lookup = function lookup(path, parentAlreadyChecked) {\r\n if (util.isString(path)) {\r\n if (!path.length)\r\n return null;\r\n path = path.split('.');\r\n } else if (!path.length)\r\n return null;\r\n // Start at root if path is absolute\r\n if (path[0] === \"\")\r\n return this.getRoot().lookup(path.slice(1));\r\n // Test if the first part matches any nested object, and if so, traverse if path contains more\r\n var found = this.get(path[0]);\r\n if (found && (path.length === 1 || found instanceof Namespace && (found = found.lookup(path.slice(1), true))))\r\n return found;\r\n // If there hasn't been a match, try again at the parent\r\n if (this.parent === null || parentAlreadyChecked)\r\n return null;\r\n return this.parent.lookup(path);\r\n};\r\n","\"use strict\";\r\nmodule.exports = ReflectionObject;\r\n\r\nReflectionObject.extend = extend;\r\n\r\nvar Root = require(18),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new reflection object instance.\r\n * @classdesc Base class of all reflection objects.\r\n * @constructor\r\n * @param {string} name Object name\r\n * @param {Object} [options] Declared options\r\n * @abstract\r\n */\r\nfunction ReflectionObject(name, options) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (options && !util.isObject(options))\r\n throw _TypeError(\"options\", \"an object\");\r\n\r\n /**\r\n * Options.\r\n * @type {Object.|undefined}\r\n */\r\n this.options = options; // toJSON\r\n\r\n /**\r\n * Unique name within its namespace.\r\n * @type {string}\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * Parent namespace.\r\n * @type {?Namespace}\r\n */\r\n this.parent = null;\r\n\r\n /**\r\n * Whether already resolved or not.\r\n * @type {boolean}\r\n */\r\n this.resolved = false;\r\n}\r\n\r\n/** @alias ReflectionObject.prototype */\r\nvar ReflectionObjectPrototype = ReflectionObject.prototype;\r\n\r\nutil.props(ReflectionObjectPrototype, {\r\n\r\n /**\r\n * Reference to the root namespace.\r\n * @name ReflectionObject#root\r\n * @type {Root}\r\n * @readonly\r\n */\r\n root: {\r\n get: function getRoot() {\r\n var ptr = this;\r\n while (ptr.parent !== null)\r\n ptr = ptr.parent;\r\n return ptr;\r\n }\r\n },\r\n\r\n /**\r\n * Full name including leading dot.\r\n * @name ReflectionObject#fullName\r\n * @type {string}\r\n * @readonly\r\n */\r\n fullName: {\r\n get: ReflectionObjectPrototype.getFullName = function getFullName() {\r\n var path = [ this.name ],\r\n ptr = this.parent;\r\n while (ptr) {\r\n path.unshift(ptr.name);\r\n ptr = ptr.parent;\r\n }\r\n return path.join('.');\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Lets the specified constructor extend this class.\r\n * @memberof ReflectionObject\r\n * @param {*} constructor Extending constructor\r\n * @returns {Object} Constructor prototype\r\n * @this ReflectionObject\r\n */\r\nfunction extend(constructor) {\r\n var prototype = constructor.prototype = Object.create(this.prototype);\r\n prototype.constructor = constructor;\r\n constructor.extend = extend;\r\n return prototype;\r\n}\r\n\r\n/**\r\n * Converts this reflection object to its JSON representation.\r\n * @returns {Object} JSON object\r\n * @abstract\r\n */\r\nReflectionObjectPrototype.toJSON = function toJSON() {\r\n throw Error(); // not implemented, shouldn't happen\r\n};\r\n\r\n/**\r\n * Called when this object is added to a parent.\r\n * @param {ReflectionObject} parent Parent added to\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onAdd = function onAdd(parent) {\r\n if (this.parent && this.parent !== parent)\r\n this.parent.remove(this);\r\n this.parent = parent;\r\n this.resolved = false;\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleAdd(this);\r\n};\r\n\r\n/**\r\n * Called when this object is removed from a parent.\r\n * @param {ReflectionObject} parent Parent removed from\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onRemove = function onRemove(parent) {\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleRemove(this);\r\n this.parent = null;\r\n this.resolved = false;\r\n};\r\n\r\n/**\r\n * Resolves this objects type references.\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var root = this.getRoot();\r\n if (root instanceof Root)\r\n this.resolved = true; // only if part of a root\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets an option value.\r\n * @param {string} name Option name\r\n * @returns {*} Option value or `undefined` if not set\r\n */\r\nReflectionObjectPrototype.getOption = function getOption(name) {\r\n if (this.options)\r\n return this.options[name];\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Sets an option.\r\n * @param {string} name Option name\r\n * @param {*} value Option value\r\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (!ifNotSet || !this.options || this.options[name] === undefined)\r\n (this.options || (this.options = {}))[name] = value;\r\n return this;\r\n};\r\n\r\n/**\r\n * Sets multiple options.\r\n * @param {Object.} options Options to set\r\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOptions = function setOptions(options, ifNotSet) {\r\n if (options)\r\n Object.keys(options).forEach(function(name) {\r\n this.setOption(name, options[name], ifNotSet);\r\n }, this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Converts this instance to its string representation.\r\n * @returns {string} Constructor name, space, full name\r\n */\r\nReflectionObjectPrototype.toString = function toString() {\r\n return this.constructor.name + \" \" + this.getFullName();\r\n};\r\n","\"use strict\";\r\nmodule.exports = OneOf;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias OneOf.prototype */\r\nvar OneOfPrototype = ReflectionObject.extend(OneOf);\r\n\r\nvar Field = require(9),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new oneof instance.\r\n * @classdesc Reflected oneof.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Oneof name\r\n * @param {string[]|Object} [fieldNames] Field names\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction OneOf(name, fieldNames, options) {\r\n if (!Array.isArray(fieldNames)) {\r\n options = fieldNames;\r\n fieldNames = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (fieldNames && !Array.isArray(fieldNames))\r\n throw _TypeError(\"fieldNames\", \"an Array\");\r\n\r\n /**\r\n * Upper cased name for getter/setter calls.\r\n * @type {string}\r\n */\r\n this.ucName = this.name.substring(0, 1).toUpperCase() + this.name.substring(1);\r\n\r\n /**\r\n * Field names that belong to this oneof.\r\n * @type {string[]}\r\n */\r\n this.oneof = fieldNames || []; // toJSON, marker\r\n\r\n /**\r\n * Fields that belong to this oneof and are possibly not yet added to its parent.\r\n * @type {Field[]}\r\n * @private\r\n */\r\n this._fields = [];\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a oneof.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes a oneof\r\n */\r\nOneOf.testJSON = function testJSON(json) {\r\n return Boolean(json.oneof);\r\n};\r\n\r\n/**\r\n * Constructs a oneof from JSON.\r\n * @param {string} name Oneof name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created oneof\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nOneOf.fromJSON = function fromJSON(name, json) {\r\n return new OneOf(name, json.oneof, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.toJSON = function toJSON() {\r\n return {\r\n oneof : this.oneof,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Adds the fields of the specified oneof to the parent if not already done so.\r\n * @param {OneOf} oneof The oneof\r\n * @returns {undefined}\r\n * @inner\r\n * @ignore\r\n */\r\nfunction addFieldsToParent(oneof) {\r\n if (oneof.parent)\r\n oneof._fields.forEach(function(field) {\r\n if (!field.parent)\r\n oneof.parent.add(field);\r\n });\r\n}\r\n\r\n/**\r\n * Adds a field to this oneof.\r\n * @param {Field} field Field to add\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.add = function add(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n if (field.parent)\r\n field.parent.remove(field);\r\n this.oneof.push(field.name);\r\n this._fields.push(field);\r\n field.partOf = this; // field.parent remains null\r\n addFieldsToParent(this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a field from this oneof.\r\n * @param {Field} field Field to remove\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.remove = function remove(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n var index = this._fields.indexOf(field);\r\n if (index < 0)\r\n throw Error(field + \" is not a member of \" + this);\r\n this._fields.splice(index, 1);\r\n index = this.oneof.indexOf(field.name);\r\n if (index > -1)\r\n this.oneof.splice(index, 1);\r\n if (field.parent)\r\n field.parent.remove(field);\r\n field.partOf = null;\r\n return this;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onAdd = function onAdd(parent) {\r\n ReflectionObject.prototype.onAdd.call(this, parent);\r\n addFieldsToParent(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onRemove = function onRemove(parent) {\r\n this._fields.forEach(function(field) {\r\n if (field.parent)\r\n field.parent.remove(field);\r\n });\r\n ReflectionObject.prototype.onRemove.call(this, parent);\r\n};\r\n","\"use strict\";\r\nmodule.exports = parse;\r\n\r\nvar tokenize = require(22),\r\n Root = require(18),\r\n Type = require(23),\r\n Field = require(9),\r\n MapField = require(10),\r\n OneOf = require(15),\r\n Enum = require(8),\r\n Service = require(21),\r\n Method = require(12),\r\n types = require(24),\r\n util = require(25);\r\nvar camelCase = util.camelCase;\r\n\r\nvar nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,\r\n fqTypeRefRe = /^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/;\r\n\r\nfunction lower(token) {\r\n return token === null ? null : token.toLowerCase();\r\n}\r\n\r\nvar s_required = \"required\",\r\n s_repeated = \"repeated\",\r\n s_optional = \"optional\",\r\n s_option = \"option\",\r\n s_name = \"name\",\r\n s_type = \"type\";\r\nvar s_open = \"{\",\r\n s_close = \"}\",\r\n s_bopen = '(',\r\n s_bclose = ')',\r\n s_semi = \";\",\r\n s_dq = '\"',\r\n s_sq = \"'\";\r\n\r\n/**\r\n * Result object returned from {@link parse}.\r\n * @typedef ParserResult\r\n * @type {Object}\r\n * @property {string|undefined} package Package name, if declared\r\n * @property {string[]|undefined} imports Imports, if any\r\n * @property {string[]|undefined} weakImports Weak imports, if any\r\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\r\n * @property {Root} root Populated root instance\r\n */\r\n\r\n/**\r\n * Parses the given .proto source and returns an object with the parsed contents.\r\n * @param {string} source Source contents\r\n * @param {Root} [root] Root to populate\r\n * @returns {ParserResult} Parser result\r\n */\r\nfunction parse(source, root) {\r\n /* eslint-disable default-case, callback-return */\r\n if (!root)\r\n root = new Root();\r\n\r\n var tn = tokenize(source),\r\n next = tn.next,\r\n push = tn.push,\r\n peek = tn.peek,\r\n skip = tn.skip;\r\n\r\n var head = true,\r\n pkg,\r\n imports,\r\n weakImports,\r\n syntax,\r\n isProto3 = false;\r\n\r\n if (!root)\r\n root = new Root();\r\n\r\n var ptr = root;\r\n\r\n function illegal(token, name) {\r\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (line \" + tn.line() + s_bclose);\r\n }\r\n\r\n function readString() {\r\n var values = [],\r\n token;\r\n do {\r\n if ((token = next()) !== s_dq && token !== s_sq)\r\n throw illegal(token);\r\n values.push(next());\r\n skip(token);\r\n token = peek();\r\n } while (token === s_dq || token === s_sq);\r\n return values.join('');\r\n }\r\n\r\n function readValue(acceptTypeRef) {\r\n var token = next();\r\n switch (lower(token)) {\r\n case s_sq:\r\n case s_dq:\r\n push(token);\r\n return readString();\r\n case \"true\":\r\n return true;\r\n case \"false\":\r\n return false;\r\n }\r\n try {\r\n return parseNumber(token);\r\n } catch (e) {\r\n if (acceptTypeRef && typeRefRe.test(token))\r\n return token;\r\n throw illegal(token, \"value\");\r\n }\r\n }\r\n\r\n function readRange() {\r\n var start = parseId(next());\r\n var end = start;\r\n if (skip(\"to\", true))\r\n end = parseId(next());\r\n skip(s_semi);\r\n return [ start, end ];\r\n }\r\n\r\n function parseNumber(token) {\r\n var sign = 1;\r\n if (token.charAt(0) === '-') {\r\n sign = -1;\r\n token = token.substring(1);\r\n }\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"inf\": return sign * Infinity;\r\n case \"nan\": return NaN;\r\n case \"0\": return 0;\r\n }\r\n if (/^[1-9][0-9]*$/.test(token))\r\n return sign * parseInt(token, 10);\r\n if (/^0[x][0-9a-f]+$/.test(tokenLower))\r\n return sign * parseInt(token, 16);\r\n if (/^0[0-7]+$/.test(token))\r\n return sign * parseInt(token, 8);\r\n if (/^(?!e)[0-9]*(?:\\.[0-9]*)?(?:[e][+-]?[0-9]+)?$/.test(tokenLower))\r\n return sign * parseFloat(token);\r\n throw illegal(token, 'number');\r\n }\r\n\r\n function parseId(token, acceptNegative) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"min\": return 1;\r\n case \"max\": return 0x1FFFFFFF;\r\n case \"0\": return 0;\r\n }\r\n if (token.charAt(0) === '-' && !acceptNegative)\r\n throw illegal(token, \"id\");\r\n if (/^-?[1-9][0-9]*$/.test(token))\r\n return parseInt(token, 10);\r\n if (/^-?0[x][0-9a-f]+$/.test(tokenLower))\r\n return parseInt(token, 16);\r\n if (/^-?0[0-7]+$/.test(token))\r\n return parseInt(token, 8);\r\n throw illegal(token, \"id\");\r\n }\r\n\r\n function parsePackage() {\r\n if (pkg !== undefined)\r\n throw illegal(\"package\");\r\n pkg = next();\r\n if (!typeRefRe.test(pkg))\r\n throw illegal(pkg, s_name);\r\n ptr = ptr.define(pkg);\r\n skip(s_semi);\r\n }\r\n\r\n function parseImport() {\r\n var token = peek();\r\n var whichImports;\r\n switch (token) {\r\n case \"weak\":\r\n whichImports = weakImports || (weakImports = []);\r\n next();\r\n break;\r\n case \"public\":\r\n next();\r\n // eslint-disable-line no-fallthrough\r\n default:\r\n whichImports = imports || (imports = []);\r\n break;\r\n }\r\n token = readString();\r\n skip(s_semi);\r\n whichImports.push(token);\r\n }\r\n\r\n function parseSyntax() {\r\n skip(\"=\");\r\n syntax = lower(readString());\r\n var p3;\r\n if ([ \"proto2\", p3 = \"proto3\" ].indexOf(syntax) < 0)\r\n throw illegal(syntax, \"syntax\");\r\n isProto3 = syntax === p3;\r\n skip(s_semi);\r\n }\r\n\r\n function parseCommon(parent, token) {\r\n switch (token) {\r\n\r\n case s_option:\r\n parseOption(parent, token);\r\n skip(s_semi);\r\n return true;\r\n\r\n case \"message\":\r\n parseType(parent, token);\r\n return true;\r\n\r\n case \"enum\":\r\n parseEnum(parent, token);\r\n return true;\r\n\r\n case \"service\":\r\n parseService(parent, token);\r\n return true;\r\n\r\n case \"extend\":\r\n parseExtension(parent, token);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n function parseType(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, \"type name\");\r\n var type = new Type(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n if (parseCommon(type, token))\r\n continue;\r\n switch (tokenLower) {\r\n case \"map\":\r\n parseMapField(type, tokenLower);\r\n break;\r\n case s_required:\r\n case s_optional:\r\n case s_repeated:\r\n parseField(type, tokenLower);\r\n break;\r\n case \"oneof\":\r\n parseOneOf(type, tokenLower);\r\n break;\r\n case \"extensions\":\r\n (type.extensions || (type.extensions = [])).push(readRange(type, tokenLower));\r\n break;\r\n case \"reserved\":\r\n (type.reserved || (type.reserved = [])).push(readRange(type, tokenLower));\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(type, s_optional);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(type);\r\n }\r\n\r\n function parseField(parent, rule, extend) {\r\n var type = next();\r\n if (!typeRefRe.test(type))\r\n throw illegal(type, s_type);\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new Field(name, id, type, rule, extend));\r\n if (field.repeated)\r\n field.setOption(\"packed\", isProto3, /* ifNotSet */ true);\r\n parent.add(field);\r\n }\r\n\r\n function parseMapField(parent) {\r\n skip(\"<\");\r\n var keyType = next();\r\n if (types.mapKey[keyType] === undefined)\r\n throw illegal(keyType, s_type);\r\n skip(\",\");\r\n var valueType = next();\r\n if (!typeRefRe.test(valueType))\r\n throw illegal(valueType, s_type);\r\n skip(\">\");\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new MapField(name, id, keyType, valueType));\r\n parent.add(field);\r\n }\r\n\r\n function parseOneOf(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n var oneof = new OneOf(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (token === s_option) {\r\n parseOption(oneof, token);\r\n skip(s_semi);\r\n } else {\r\n push(token);\r\n parseField(oneof, s_optional);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(oneof);\r\n }\r\n\r\n function parseEnum(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var values = {};\r\n var enm = new Enum(name, values);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (lower(token) === s_option)\r\n parseOption(enm);\r\n else\r\n parseEnumField(enm, token);\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(enm);\r\n }\r\n\r\n function parseEnumField(parent, token) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n var name = token;\r\n skip(\"=\");\r\n var value = parseId(next(), true);\r\n parent.values[name] = value;\r\n parseInlineOptions({}); // skips enum value options\r\n }\r\n\r\n function parseOption(parent, token) {\r\n var custom = skip(s_bopen, true);\r\n var name = next();\r\n if (!typeRefRe.test(name))\r\n throw illegal(name, s_name);\r\n if (custom) {\r\n skip(s_bclose);\r\n name = s_bopen + name + s_bclose;\r\n token = peek();\r\n if (fqTypeRefRe.test(token)) {\r\n name += token;\r\n next();\r\n }\r\n }\r\n skip(\"=\");\r\n parseOptionValue(parent, name);\r\n }\r\n\r\n function parseOptionValue(parent, name) {\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n name = name + \".\" + token;\r\n if (skip(\":\", true))\r\n setOption(parent, name, readValue(true));\r\n else\r\n parseOptionValue(parent, name);\r\n }\r\n } else\r\n setOption(parent, name, readValue(true));\r\n // Does not enforce a delimiter to be universal\r\n }\r\n\r\n function setOption(parent, name, value) {\r\n if (parent.setOption)\r\n parent.setOption(name, value);\r\n else\r\n parent[name] = value;\r\n }\r\n\r\n function parseInlineOptions(parent) {\r\n if (skip(\"[\", true)) {\r\n do {\r\n parseOption(parent, s_option);\r\n } while (skip(\",\", true));\r\n skip(\"]\");\r\n }\r\n skip(s_semi);\r\n return parent;\r\n }\r\n\r\n function parseService(parent, token) {\r\n token = next();\r\n if (!nameRe.test(token))\r\n throw illegal(token, \"service name\");\r\n var name = token;\r\n var service = new Service(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(service, tokenLower);\r\n skip(s_semi);\r\n break;\r\n case \"rpc\":\r\n parseMethod(service, tokenLower);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(service);\r\n }\r\n\r\n function parseMethod(parent, token) {\r\n var type = token;\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var requestType, requestStream,\r\n responseType, responseStream;\r\n skip(s_bopen);\r\n var st;\r\n if (skip(st = \"stream\", true))\r\n requestStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n requestType = token;\r\n skip(s_bclose); skip(\"returns\"); skip(s_bopen);\r\n if (skip(st, true))\r\n responseStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n responseType = token;\r\n skip(s_bclose);\r\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(method, tokenLower);\r\n skip(s_semi);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(method);\r\n }\r\n\r\n function parseExtension(parent, token) {\r\n var reference = next();\r\n if (!typeRefRe.test(reference))\r\n throw illegal(reference, \"reference\");\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_required:\r\n case s_repeated:\r\n case s_optional:\r\n parseField(parent, tokenLower, reference);\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(parent, s_optional, reference);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n }\r\n\r\n var token;\r\n while ((token = next()) !== null) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n\r\n case \"package\":\r\n if (!head)\r\n throw illegal(token);\r\n parsePackage();\r\n break;\r\n\r\n case \"import\":\r\n if (!head)\r\n throw illegal(token);\r\n parseImport();\r\n break;\r\n\r\n case \"syntax\":\r\n if (!head)\r\n throw illegal(token);\r\n parseSyntax();\r\n break;\r\n\r\n case s_option:\r\n if (!head)\r\n throw illegal(token);\r\n parseOption(ptr, token);\r\n skip(s_semi);\r\n break;\r\n\r\n default:\r\n if (parseCommon(ptr, token)) {\r\n head = false;\r\n continue;\r\n }\r\n throw illegal(token);\r\n }\r\n }\r\n\r\n return {\r\n 'package' : pkg,\r\n 'imports' : imports,\r\n 'weakImports' : weakImports,\r\n 'syntax' : syntax,\r\n 'root' : root\r\n };\r\n}\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nReader.BufferReader = BufferReader;\r\n\r\nvar util = require(29),\r\n ieee754 = require(1);\r\nvar LongBits = util.LongBits,\r\n ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\r\n\r\nfunction indexOutOfRange(reader, writeLength) {\r\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\r\n}\r\n\r\n/**\r\n * Configures the Reader interface according to the environment.\r\n * @memberof Reader\r\n * @returns {undefined}\r\n */\r\nfunction configure() {\r\n if (util.Long) {\r\n ReaderPrototype.int64 = read_int64_long;\r\n ReaderPrototype.uint64 = read_uint64_long;\r\n ReaderPrototype.sint64 = read_sint64_long;\r\n ReaderPrototype.fixed64 = read_fixed64_long;\r\n ReaderPrototype.sfixed64 = read_sfixed64_long;\r\n } else {\r\n ReaderPrototype.int64 = read_int64_number;\r\n ReaderPrototype.uint64 = read_uint64_number;\r\n ReaderPrototype.sint64 = read_sint64_number;\r\n ReaderPrototype.fixed64 = read_fixed64_number;\r\n ReaderPrototype.sfixed64 = read_sfixed64_number;\r\n }\r\n}\r\n\r\nReader.configure = configure;\r\n\r\n/**\r\n * Constructs a new reader instance using the specified buffer.\r\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n * @param {Uint8Array} buffer Buffer to read from\r\n */\r\nfunction Reader(buffer) {\r\n \r\n /**\r\n * Read buffer.\r\n * @type {Uint8Array}\r\n */\r\n this.buf = buffer;\r\n\r\n /**\r\n * Read buffer position.\r\n * @type {number}\r\n */\r\n this.pos = 0;\r\n\r\n /**\r\n * Read buffer length.\r\n * @type {number}\r\n */\r\n this.len = buffer.length;\r\n}\r\n\r\n/**\r\n * Creates a new reader using the specified buffer.\r\n * @param {Uint8Array} buffer Buffer to read from\r\n * @returns {BufferReader|Reader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\r\n */\r\nReader.create = function create(buffer) {\r\n return new (util.Buffer && util.Buffer.isBuffer(buffer) && BufferReader || Reader)(buffer);\r\n};\r\n\r\n/** @alias Reader.prototype */\r\nvar ReaderPrototype = Reader.prototype;\r\n\r\nReaderPrototype._slice = ArrayImpl.prototype.subarray || ArrayImpl.prototype.slice;\r\n\r\n/**\r\n * Tag read.\r\n * @constructor\r\n * @param {number} id Field id\r\n * @param {number} wireType Wire type\r\n * @ignore\r\n */\r\nfunction Tag(id, wireType) {\r\n this.id = id;\r\n this.wireType = wireType;\r\n}\r\n\r\n/**\r\n * Reads a tag.\r\n * @returns {{id: number, wireType: number}} Field id and wire type\r\n */\r\nReaderPrototype.tag = function read_tag() {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n return new Tag(this.buf[this.pos] >>> 3, this.buf[this.pos++] & 7);\r\n};\r\n\r\n/**\r\n * Reads a varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.int32 = function read_int32() {\r\n // 1 byte\r\n var octet = this.buf[this.pos++],\r\n value = octet & 127;\r\n if (octet > 127) { // false if octet is undefined (pos >= len)\r\n // 2 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 7;\r\n if (octet > 127) {\r\n // 3 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 14;\r\n if (octet > 127) {\r\n // 4 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 21;\r\n if (octet > 127) {\r\n // 5 bytes\r\n octet = this.buf[this.pos++];\r\n value |= octet << 28;\r\n if (octet > 127) {\r\n // 6..10 bytes (sign extended)\r\n this.pos += 5;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (this.pos > this.len) {\r\n this.pos = this.len;\r\n throw indexOutOfRange(this);\r\n }\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a varint as an unsigned 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.uint32 = function read_uint32() {\r\n return this.int32() >>> 0;\r\n};\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sint32 = function read_sint32() {\r\n var value = this.int32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongVarint() {\r\n var lo = 0, hi = 0,\r\n i = 0, b = 0;\r\n if (this.len - this.pos > 9) { // fast route\r\n for (i = 0; i < 4; ++i) {\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n } else {\r\n for (i = 0; i < 4; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n }\r\n throw Error(\"invalid varint encoding\");\r\n}\r\n\r\nfunction read_int64_long() {\r\n return readLongVarint.call(this).toLong();\r\n}\r\n\r\nfunction read_int64_number() {\r\n return readLongVarint.call(this).toNumber();\r\n}\r\n\r\nfunction read_uint64_long() {\r\n return readLongVarint.call(this).toLong(true);\r\n}\r\n\r\nfunction read_uint64_number() {\r\n return readLongVarint.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sint64_long() {\r\n return readLongVarint.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sint64_number() {\r\n return readLongVarint.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads a varint as a signed 64 bit value.\r\n * @name Reader#int64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as an unsigned 64 bit value.\r\n * @name Reader#uint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 64 bit value.\r\n * @name Reader#sint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as a boolean.\r\n * @returns {boolean} Value read\r\n */\r\nReaderPrototype.bool = function read_bool() {\r\n return this.int32() !== 0;\r\n};\r\n\r\n/**\r\n * Reads fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.fixed32 = function read_fixed32() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n this.pos += 4;\r\n return this.buf[this.pos - 4]\r\n | this.buf[this.pos - 3] << 8\r\n | this.buf[this.pos - 2] << 16\r\n | this.buf[this.pos - 1] << 24;\r\n};\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sfixed32 = function read_sfixed32() {\r\n var value = this.fixed32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongFixed() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n return new LongBits(\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n ,\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n );\r\n}\r\n\r\nfunction read_fixed64_long() {\r\n return readLongFixed.call(this).toLong(true);\r\n}\r\n\r\nfunction read_fixed64_number() {\r\n return readLongFixed.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sfixed64_long() {\r\n return readLongFixed.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sfixed64_number() {\r\n return readLongFixed.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads fixed 64 bits.\r\n * @name Reader#fixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 64 bits.\r\n * @name Reader#sfixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\nvar readFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function readFloat_f32(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos ];\r\n return f32[0];\r\n }\r\n : function readFloat_f32_le(buf, pos) {\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f32[0];\r\n };\r\n })()\r\n : function readFloat_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Reads a float (32 bit) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.float = function read_float() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readFloat(this.buf, this.pos);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nvar readDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function readDouble_f64(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[7] = buf[pos ];\r\n return f64[0];\r\n }\r\n : function readDouble_f64_le(buf, pos) {\r\n f8b[7] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f64[0];\r\n };\r\n })()\r\n : function readDouble_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Reads a double (64 bit float) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.double = function read_double() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readDouble(this.buf, this.pos);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @returns {Uint8Array} Value read\r\n */\r\nReaderPrototype.bytes = function read_bytes() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\r\n ? new this.buf.constructor(0)\r\n : this._slice.call(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * Reads a string preceeded by its byte length as a varint.\r\n * @returns {string} Value read\r\n */\r\nReaderPrototype.string = function read_string() {\r\n // ref: https://github.com/google/closure-library/blob/master/closure/goog/crypt/crypt.js\r\n var bytes = this.bytes(),\r\n len = bytes.length;\r\n if (len) {\r\n var out = new Array(len), p = 0, c = 0;\r\n while (p < len) {\r\n var c1 = bytes[p++];\r\n if (c1 < 128)\r\n out[c++] = c1;\r\n else if (c1 > 191 && c1 < 224)\r\n out[c++] = (c1 & 31) << 6 | bytes[p++] & 63;\r\n else if (c1 > 239 && c1 < 365) {\r\n var u = ((c1 & 7) << 18 | (bytes[p++] & 63) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63) - 0x10000;\r\n out[c++] = 0xD800 + (u >> 10);\r\n out[c++] = 0xDC00 + (u & 1023);\r\n } else\r\n out[c++] = (c1 & 15) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63;\r\n }\r\n return String.fromCharCode.apply(String, out.slice(0, c));\r\n }\r\n return \"\";\r\n};\r\n\r\n/**\r\n * Skips the specified number of bytes if specified, otherwise skips a varint.\r\n * @param {number} [length] Length if known, otherwise a varint is assumed\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skip = function skip(length) {\r\n if (length === undefined) {\r\n do {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n } while (this.buf[this.pos++] & 128);\r\n } else {\r\n if (this.pos + length > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Skips the next element of the specified wire type.\r\n * @param {number} wireType Wire type received\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skipType = function(wireType) {\r\n switch (wireType) {\r\n case 0:\r\n this.skip();\r\n break;\r\n case 1:\r\n this.skip(8);\r\n break;\r\n case 2:\r\n this.skip(this.uint32());\r\n break;\r\n case 3:\r\n do { // eslint-disable-line no-constant-condition\r\n var tag = this.tag();\r\n if (tag.wireType === 4)\r\n break;\r\n this.skipType(tag.wireType);\r\n } while (true);\r\n break;\r\n case 5:\r\n this.skip(4);\r\n break;\r\n default:\r\n throw Error(\"invalid wire type: \" + wireType);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance and frees all resources.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.reset = function reset(buffer) {\r\n if (buffer) {\r\n this.buf = buffer;\r\n this.len = buffer.length;\r\n } else {\r\n this.buf = null; // makes it throw\r\n this.len = 0;\r\n }\r\n this.pos = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of read operations, frees all resources and returns the remaining buffer.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nReaderPrototype.finish = function finish(buffer) {\r\n var remain = this.pos\r\n ? this._slice.call(this.buf, this.pos)\r\n : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\n// One time function to initialize BufferReader with the now-known buffer implementation's slice method\r\nvar initBufferReader = function() {\r\n if (!util.Buffer)\r\n throw Error(\"Buffer is not supported\");\r\n BufferReaderPrototype._slice = util.Buffer.prototype.slice;\r\n readStringBuffer = util.Buffer.prototype.utf8Slice // around forever, but not present in browser buffer\r\n ? readStringBuffer_utf8Slice\r\n : readStringBuffer_toString;\r\n initBufferReader = false;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer reader instance.\r\n * @classdesc Wire format reader using node buffers.\r\n * @extends Reader\r\n * @constructor\r\n * @param {Buffer} buffer Buffer to read from\r\n */\r\nfunction BufferReader(buffer) {\r\n if (initBufferReader)\r\n initBufferReader();\r\n Reader.call(this, buffer);\r\n}\r\n\r\n/** @alias BufferReader.prototype */\r\nvar BufferReaderPrototype = BufferReader.prototype = Object.create(Reader.prototype);\r\n\r\nBufferReaderPrototype.constructor = BufferReader;\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.float = function read_float_buffer() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = this.buf.readFloatLE(this.pos, true);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.double = function read_double_buffer() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n var value = this.buf.readDoubleLE(this.pos, true);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\nvar readStringBuffer;\r\n\r\nfunction readStringBuffer_utf8Slice(buf, start, end) {\r\n return buf.utf8Slice(start, end); // fastest\r\n}\r\n\r\nfunction readStringBuffer_toString(buf, start, end) {\r\n return buf.toString(\"utf8\", start, end); // 2nd, again assertions\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.string = function read_string_buffer() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return readStringBuffer(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.finish = function finish_buffer(buffer) {\r\n var remain = this.pos ? this.buf.slice(this.pos) : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\nvar Namespace = require(13);\r\n/** @alias Root.prototype */\r\nvar RootPrototype = Namespace.extend(Root);\r\n\r\nvar Field = require(9),\r\n util = require(25),\r\n common = require(7);\r\n\r\n/**\r\n * Constructs a new root namespace instance.\r\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {Object} [options] Top level options\r\n */\r\nfunction Root(options) {\r\n Namespace.call(this, \"\", options);\r\n\r\n /**\r\n * Deferred extension fields.\r\n * @type {Field[]}\r\n */\r\n this.deferred = [];\r\n\r\n /**\r\n * Resolved file names of loaded files. \r\n * @type {string[]}\r\n */\r\n this.files = [];\r\n}\r\n\r\n/**\r\n * Loads a JSON definition into a root namespace.\r\n * @param {*} json JSON definition\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\r\n * @returns {Root} Root namespace\r\n */\r\nRoot.fromJSON = function fromJSON(json, root) {\r\n if (!root)\r\n root = new Root();\r\n return root.setOptions(json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Resolves the path of an imported file, relative to the importing origin.\r\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\r\n * @function\r\n * @param {string} origin The file name of the importing file\r\n * @param {string} target The file name being imported\r\n * @returns {string} Resolved path to `target`\r\n */\r\nRootPrototype.resolvePath = util.resolvePath;\r\n\r\n// A symbol-like function to safely signal synchronous loading\r\nfunction SYNC() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {function(?Error, Root=)} callback Node-style callback function\r\n * @returns {undefined}\r\n */\r\nRootPrototype.load = function load(filename, callback) {\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(load, self, filename);\r\n\r\n // Finishes loading by calling the callback (exactly once)\r\n function finish(err, root) {\r\n if (!callback)\r\n return;\r\n var cb = callback;\r\n callback = null;\r\n cb(err, root);\r\n }\r\n\r\n var sync = callback === SYNC; // undocumented\r\n\r\n // Processes a single file\r\n function process(filename, source) {\r\n try {\r\n if (util.isString(source) && source.charAt(0) === \"{\")\r\n source = JSON.parse(source);\r\n if (!util.isString(source))\r\n self.setOptions(source.options).addJSON(source.nested);\r\n else {\r\n var parsed = require(16)(source, self);\r\n if (parsed.imports)\r\n parsed.imports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name));\r\n });\r\n if (parsed.weakImports)\r\n parsed.weakImports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name), true);\r\n });\r\n }\r\n } catch (err) {\r\n finish(err);\r\n return;\r\n }\r\n if (!sync && !queued)\r\n finish(null, self);\r\n }\r\n\r\n // Fetches a single file\r\n function fetch(filename, weak) {\r\n\r\n // Strip path if this file references a bundled definition\r\n var idx = filename.indexOf(\"google/protobuf/\");\r\n if (idx > -1) {\r\n var altname = filename.substring(idx);\r\n if (altname in common)\r\n filename = altname;\r\n }\r\n\r\n // Skip if already loaded\r\n if (self.files.indexOf(filename) > -1)\r\n return;\r\n self.files.push(filename);\r\n\r\n // Shortcut bundled definitions\r\n if (filename in common) {\r\n if (sync)\r\n process(filename, common[filename]);\r\n else {\r\n ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\r\n if (sync) {\r\n var source;\r\n try {\r\n source = util.fs.readFileSync(filename).toString(\"utf8\");\r\n } catch (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n } else {\r\n ++queued;\r\n util.fetch(filename, function(err, source) {\r\n --queued;\r\n if (!callback)\r\n return; // terminated meanwhile\r\n if (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n });\r\n }\r\n }\r\n var queued = 0;\r\n\r\n // Assembling the root namespace doesn't require working type\r\n // references anymore, so we can load everything in parallel\r\n if (util.isString(filename))\r\n filename = [ filename ];\r\n filename.forEach(function(filename) {\r\n fetch(self.resolvePath(\"\", filename));\r\n });\r\n\r\n if (sync)\r\n return self;\r\n if (!queued)\r\n finish(null, self);\r\n return undefined;\r\n};\r\n// function load(filename:string, callback:function):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\r\n * @name Root#load\r\n * @function\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Promise} Promise\r\n * @variation 2\r\n */\r\n// function load(filename:string):Promise\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nRootPrototype.loadSync = function loadSync(filename) {\r\n return this.load(filename, SYNC);\r\n};\r\n\r\n/**\r\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\r\n * @param {Field} field Declaring extension field witin the declaring type\r\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\r\n * @inner\r\n * @ignore\r\n */\r\nfunction handleExtension(field) {\r\n var extendedType = field.parent.lookup(field.extend);\r\n if (extendedType) {\r\n var sisterField = new Field(field.getFullName(), field.id, field.type, field.rule, undefined, field.options);\r\n sisterField.declaringField = field;\r\n field.extensionField = sisterField;\r\n extendedType.add(sisterField);\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Called when any object is added to this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object added\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleAdd = function handleAdd(object) {\r\n // Try to handle any deferred extensions\r\n var newDeferred = this.deferred.slice();\r\n this.deferred = []; // because the loop calls handleAdd\r\n var i = 0;\r\n while (i < newDeferred.length)\r\n if (handleExtension(newDeferred[i]))\r\n newDeferred.splice(i, 1);\r\n else\r\n ++i;\r\n this.deferred = newDeferred;\r\n // Handle new declaring extension fields without a sister field yet\r\n if (object instanceof Field && object.extend !== undefined && !object.extensionField && !handleExtension(object) && this.deferred.indexOf(object) < 0)\r\n this.deferred.push(object);\r\n else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleAdd(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * Called when any object is removed from this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object removed\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleRemove = function handleRemove(object) {\r\n if (object instanceof Field) {\r\n // If a deferred declaring extension field, cancel the extension\r\n if (object.extend !== undefined && !object.extensionField) {\r\n var index = this.deferred.indexOf(object);\r\n if (index > -1)\r\n this.deferred.splice(index, 1);\r\n }\r\n // If a declaring extension field with a sister field, remove its sister field\r\n if (object.extensionField) {\r\n object.extensionField.parent.remove(object.extensionField);\r\n object.extensionField = null;\r\n }\r\n } else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleRemove(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nRootPrototype.toString = function toString() {\r\n return this.constructor.name;\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Streaming RPC helpers.\r\n * @namespace\r\n */\r\nvar rpc = exports;\r\n\r\nrpc.Service = require(20);\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar EventEmitter = require(26);\r\n\r\n/**\r\n * Constructs a new RPC service instance.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @memberof rpc\r\n * @extends util.EventEmitter\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n */\r\nfunction Service(rpcImpl) {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * RPC implementation. Becomes `null` when the service is ended.\r\n * @type {?RPCImpl}\r\n */\r\n this.$rpc = rpcImpl;\r\n}\r\n\r\n/** @alias rpc.Service.prototype */\r\nvar ServicePrototype = Service.prototype = Object.create(EventEmitter.prototype);\r\nServicePrototype.constructor = Service;\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.end = function end(endedByRPC) {\r\n if (this.$rpc) {\r\n if (!endedByRPC) // signal end to rpcImpl\r\n this.$rpc(null, null, null);\r\n this.$rpc = null;\r\n this.emit('end').off();\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar Namespace = require(13);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Service.prototype */\r\nvar ServicePrototype = Namespace.extend(Service);\r\n\r\nvar Method = require(12),\r\n util = require(25),\r\n rpc = require(19);\r\n\r\n/**\r\n * Constructs a new service instance.\r\n * @classdesc Reflected service.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Service name\r\n * @param {Object.} [options] Service options\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nfunction Service(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Service methods.\r\n * @type {Object.}\r\n */\r\n this.methods = {}; // toJSON, marker\r\n\r\n /**\r\n * Cached methods as an array.\r\n * @type {?Method[]}\r\n * @private\r\n */\r\n this._methodsArray = null;\r\n}\r\n\r\nutil.props(ServicePrototype, {\r\n\r\n /**\r\n * Methods of this service as an array for iteration.\r\n * @name Service#methodsArray\r\n * @type {Method[]}\r\n * @readonly\r\n */\r\n methodsArray: {\r\n get: function getMethodsArray() {\r\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\r\n }\r\n }\r\n\r\n});\r\n\r\nfunction clearCache(service) {\r\n service._methodsArray = null;\r\n return service;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a service\r\n */\r\nService.testJSON = function testJSON(json) {\r\n return Boolean(json && json.methods);\r\n};\r\n\r\n/**\r\n * Constructs a service from JSON.\r\n * @param {string} name Service name\r\n * @param {Object} json JSON object\r\n * @returns {Service} Created service\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nService.fromJSON = function fromJSON(name, json) {\r\n var service = new Service(name, json.options);\r\n if (json.methods)\r\n Object.keys(json.methods).forEach(function(methodName) {\r\n service.add(Method.fromJSON(methodName, json.methods[methodName]));\r\n });\r\n return service;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n methods : Namespace.arrayToJSON(this.getMethodsArray()) || {},\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.methods[name] || null;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.resolveAll = function resolve() {\r\n var methods = this.getMethodsArray();\r\n for (var i = 0; i < methods.length; ++i)\r\n methods[i].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Method) {\r\n this.methods[object.name] = object;\r\n object.parent = this;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.remove = function remove(object) {\r\n if (object instanceof Method) {\r\n if (this.methods[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.methods[object.name];\r\n object.parent = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\r\n * @typedef RPCImpl\r\n * @type {function}\r\n * @param {Method} method Reflected method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {function(?Error, Uint8Array=)} callback Node-style callback called with the error, if any, and the response data. `null` as response data signals an ended stream.\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Creates a runtime service using the specified rpc implementation.\r\n * @param {function(Method, Uint8Array, function)} rpcImpl RPC implementation ({@link RPCImpl|see})\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n * @returns {rpc.Service} Runtime RPC service. Useful where requests and/or responses are streamed.\r\n */\r\nServicePrototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\r\n var rpcService = new rpc.Service(rpcImpl);\r\n this.getMethodsArray().forEach(function(method) {\r\n rpcService[method.name.substring(0, 1).toLowerCase() + method.name.substring(1)] = function callVirtual(request, /* optional */ callback) {\r\n if (!rpcService.$rpc) // already ended?\r\n return;\r\n if (!request)\r\n throw util._TypeError(\"request\", \"not null\");\r\n method.resolve();\r\n var requestData;\r\n try {\r\n requestData = (requestDelimited && method.resolvedRequestType.encodeDelimited(request) || method.resolvedRequestType.encode(request)).finish();\r\n } catch (err) {\r\n (typeof setImmediate === 'function' && setImmediate || setTimeout)(function() { callback(err); });\r\n return;\r\n }\r\n // Calls the custom RPC implementation with the reflected method and binary request data\r\n // and expects the rpc implementation to call its callback with the binary response data.\r\n rpcImpl(method, requestData, function(err, responseData) {\r\n if (err) {\r\n rpcService.emit('error', err, method);\r\n return callback ? callback(err) : undefined;\r\n }\r\n if (responseData === null) {\r\n rpcService.end(/* endedByRPC */ true);\r\n return undefined;\r\n }\r\n var response;\r\n try {\r\n response = responseDelimited && method.resolvedResponseType.decodeDelimited(responseData) || method.resolvedResponseType.decode(responseData);\r\n } catch (err2) {\r\n rpcService.emit('error', err2, method);\r\n return callback ? callback('error', err2) : undefined;\r\n }\r\n rpcService.emit('data', response, method);\r\n return callback ? callback(null, response) : undefined;\r\n });\r\n };\r\n });\r\n return rpcService;\r\n};\r\n","\"use strict\";\r\nmodule.exports = tokenize;\r\n\r\nvar delimRe = /[\\s{}=;:[\\],'\"()<>]/g,\r\n stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\r\n stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\r\n\r\n/**\r\n * Handle object returned from {@link tokenize}.\r\n * @typedef {Object} TokenizerHandle\r\n * @property {function():number} line Gets the current line number\r\n * @property {function():?string} next Gets the next token and advances (`null` on eof)\r\n * @property {function():?string} peek Peeks for the next token (`null` on eof)\r\n * @property {function(string)} push Pushes a token back to the stack\r\n * @property {function(string, boolean=):boolean} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\r\n */\r\n\r\nvar s_nl = \"\\n\",\r\n s_sl = '/',\r\n s_as = '*';\r\n\r\nfunction unescape(str) {\r\n return str.replace(/\\\\(.?)/g, function($0, $1) {\r\n switch ($1) {\r\n case \"\\\\\":\r\n case \"\":\r\n return $1;\r\n case \"0\":\r\n return \"\\u0000\";\r\n default:\r\n return $1;\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Tokenizes the given .proto source and returns an object with useful utility functions.\r\n * @param {string} source Source contents\r\n * @returns {TokenizerHandle} Tokenizer handle\r\n */\r\nfunction tokenize(source) {\r\n /* eslint-disable default-case, callback-return */\r\n source = source.toString();\r\n \r\n var offset = 0,\r\n length = source.length,\r\n line = 1;\r\n \r\n var stack = [];\r\n\r\n var stringDelim = null;\r\n\r\n /**\r\n * Creates an error for illegal syntax.\r\n * @param {string} subject Subject\r\n * @returns {Error} Error created\r\n * @inner\r\n */\r\n function illegal(subject) {\r\n return Error(\"illegal \" + subject + \" (line \" + line + \")\");\r\n }\r\n\r\n /**\r\n * Reads a string till its end.\r\n * @returns {string} String read\r\n * @inner\r\n */\r\n function readString() {\r\n var re = stringDelim === '\"' ? stringDoubleRe : stringSingleRe;\r\n re.lastIndex = offset - 1;\r\n var match = re.exec(source);\r\n if (!match)\r\n throw illegal(\"string\");\r\n offset = re.lastIndex;\r\n push(stringDelim);\r\n stringDelim = null;\r\n return unescape(match[1]);\r\n }\r\n\r\n /**\r\n * Gets the character at `pos` within the source.\r\n * @param {number} pos Position\r\n * @returns {string} Character\r\n * @inner\r\n */\r\n function charAt(pos) {\r\n return source.charAt(pos);\r\n }\r\n\r\n /**\r\n * Obtains the next token.\r\n * @returns {?string} Next token or `null` on eof\r\n * @inner\r\n */\r\n function next() {\r\n if (stack.length > 0)\r\n return stack.shift();\r\n if (stringDelim)\r\n return readString();\r\n var repeat,\r\n prev,\r\n curr;\r\n do {\r\n if (offset === length)\r\n return null;\r\n repeat = false;\r\n while (/\\s/.test(curr = charAt(offset))) {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n }\r\n if (charAt(offset) === s_sl) {\r\n if (++offset === length)\r\n throw illegal(\"comment\");\r\n if (charAt(offset) === s_sl) { // Line\r\n while (charAt(++offset) !== s_nl)\r\n if (offset === length)\r\n return null;\r\n ++offset;\r\n ++line;\r\n repeat = true;\r\n } else if ((curr = charAt(offset)) === s_as) { /* Block */\r\n do {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n prev = curr;\r\n curr = charAt(offset);\r\n } while (prev !== s_as || curr !== s_sl);\r\n ++offset;\r\n repeat = true;\r\n } else\r\n return s_sl;\r\n }\r\n } while (repeat);\r\n\r\n if (offset === length)\r\n return null;\r\n var end = offset;\r\n delimRe.lastIndex = 0;\r\n var delim = delimRe.test(charAt(end++));\r\n if (!delim)\r\n while (end < length && !delimRe.test(charAt(end)))\r\n ++end;\r\n var token = source.substring(offset, offset = end);\r\n if (token === '\"' || token === \"'\")\r\n stringDelim = token;\r\n return token;\r\n }\r\n\r\n /**\r\n * Pushes a token back to the stack.\r\n * @param {string} token Token\r\n * @returns {undefined}\r\n * @inner\r\n */\r\n function push(token) {\r\n stack.push(token);\r\n }\r\n\r\n /**\r\n * Peeks for the next token.\r\n * @returns {?string} Token or `null` on eof\r\n * @inner\r\n */\r\n function peek() {\r\n if (!stack.length) {\r\n var token = next();\r\n if (token === null)\r\n return null;\r\n push(token);\r\n }\r\n return stack[0];\r\n }\r\n\r\n /**\r\n * Skips a token.\r\n * @param {string} expected Expected token\r\n * @param {boolean} [optional=false] Whether the token is optional\r\n * @returns {boolean} `true` when skipped, `false` if not\r\n * @throws {Error} When a required token is not present\r\n * @inner\r\n */\r\n function skip(expected, optional) {\r\n var actual = peek(),\r\n equals = actual === expected;\r\n if (equals) {\r\n next();\r\n return true;\r\n }\r\n if (!optional)\r\n throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\r\n return false;\r\n }\r\n\r\n return {\r\n line: function() { return line; },\r\n next: next,\r\n peek: peek,\r\n push: push,\r\n skip: skip\r\n };\r\n /* eslint-enable default-case, callback-return */\r\n}","\"use strict\";\r\nmodule.exports = Type; \r\n\r\nvar Namespace = require(13);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Type.prototype */\r\nvar TypePrototype = Namespace.extend(Type);\r\n\r\nvar Enum = require(8),\r\n OneOf = require(15),\r\n Field = require(9),\r\n Service = require(21),\r\n Class = require(2),\r\n Message = require(11),\r\n Reader = require(17),\r\n Writer = require(30),\r\n util = require(25),\r\n codegen = require(3);\r\n\r\n/**\r\n * Constructs a new reflected message type instance.\r\n * @classdesc Reflected message type.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Message name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Type(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Message fields.\r\n * @type {Object.}\r\n */\r\n this.fields = {}; // toJSON, marker\r\n\r\n /**\r\n * Oneofs declared within this namespace, if any.\r\n * @type {Object.}\r\n */\r\n this.oneofs = undefined; // toJSON\r\n\r\n /**\r\n * Extension ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.extensions = undefined; // toJSON\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n /**\r\n * Cached fields by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._fieldsById = null;\r\n\r\n /**\r\n * Cached fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._fieldsArray = null;\r\n\r\n /**\r\n * Cached repeated fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._repeatedFieldsArray = null;\r\n\r\n /**\r\n * Cached oneofs as an array.\r\n * @type {?OneOf[]}\r\n * @private\r\n */\r\n this._oneofsArray = null;\r\n\r\n /**\r\n * Cached constructor.\r\n * @type {*}\r\n * @private\r\n */\r\n this._ctor = null;\r\n}\r\n\r\nutil.props(TypePrototype, {\r\n\r\n /**\r\n * Message fields by id.\r\n * @name Type#fieldsById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n fieldsById: {\r\n get: function getFieldsById() {\r\n if (this._fieldsById)\r\n return this._fieldsById;\r\n this._fieldsById = {};\r\n var names = Object.keys(this.fields);\r\n for (var i = 0; i < names.length; ++i) {\r\n var field = this.fields[names[i]],\r\n id = field.id;\r\n if (this._fieldsById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._fieldsById[id] = field;\r\n }\r\n return this._fieldsById;\r\n }\r\n },\r\n\r\n /**\r\n * Fields of this message as an array for iteration.\r\n * @name Type#fieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n fieldsArray: {\r\n get: function getFieldsArray() {\r\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\r\n }\r\n },\r\n\r\n /**\r\n * Repeated fields of this message as an array for iteration.\r\n * @name Type#repeatedFieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n repeatedFieldsArray: {\r\n get: function getRepeatedFieldsArray() {\r\n return this._repeatedFieldsArray || (this._repeatedFieldsArray = this.getFieldsArray().filter(function(field) { return field.repeated; }));\r\n }\r\n },\r\n\r\n /**\r\n * Oneofs of this message as an array for iteration.\r\n * @name Type#oneofsArray\r\n * @type {OneOf[]}\r\n * @readonly\r\n */\r\n oneofsArray: {\r\n get: function getOneofsArray() {\r\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\r\n }\r\n },\r\n\r\n /**\r\n * The registered constructor, if any registered, otherwise a generic constructor.\r\n * @name Type#ctor\r\n * @type {Class}\r\n */\r\n ctor: {\r\n get: function getCtor() {\r\n return this._ctor || (this._ctor = Class.create(this).constructor);\r\n },\r\n set: function setCtor(ctor) {\r\n if (ctor && !(ctor.prototype instanceof Message))\r\n throw util._TypeError(\"ctor\", \"a constructor inheriting from Message\");\r\n this._ctor = ctor;\r\n }\r\n }\r\n});\r\n\r\nfunction clearCache(type) {\r\n type._fieldsById = type._fieldsArray = type._oneofsArray = type._ctor = null;\r\n delete type.encode;\r\n delete type.decode;\r\n return type;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a message type.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a message type\r\n */\r\nType.testJSON = function testJSON(json) {\r\n return Boolean(json && json.fields);\r\n};\r\n\r\nvar nestedTypes = [ Enum, Type, Field, Service ];\r\n\r\n/**\r\n * Creates a type from JSON.\r\n * @param {string} name Message name\r\n * @param {Object} json JSON object\r\n * @returns {Type} Created message type\r\n */\r\nType.fromJSON = function fromJSON(name, json) {\r\n var type = new Type(name, json.options);\r\n type.extensions = json.extensions;\r\n type.reserved = json.reserved;\r\n if (json.fields)\r\n Object.keys(json.fields).forEach(function(fieldName) {\r\n type.add(Field.fromJSON(fieldName, json.fields[fieldName]));\r\n });\r\n if (json.oneofs)\r\n Object.keys(json.oneofs).forEach(function(oneOfName) {\r\n type.add(OneOf.fromJSON(oneOfName, json.oneofs[oneOfName]));\r\n });\r\n if (json.nested)\r\n Object.keys(json.nested).forEach(function(nestedName) {\r\n var nested = json.nested[nestedName];\r\n for (var i = 0; i < nestedTypes.length; ++i) {\r\n if (nestedTypes[i].testJSON(nested)) {\r\n type.add(nestedTypes[i].fromJSON(nestedName, nested));\r\n return;\r\n }\r\n }\r\n throw Error(\"invalid nested object in \" + type + \": \" + nestedName);\r\n });\r\n if (json.extensions && json.extensions.length)\r\n type.extensions = json.extensions;\r\n if (json.reserved && json.reserved.length)\r\n type.reserved = json.reserved;\r\n return type;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n oneofs : Namespace.arrayToJSON(this.getOneofsArray()),\r\n fields : Namespace.arrayToJSON(this.getFieldsArray().filter(function(obj) { return !obj.declaringField; })) || {},\r\n extensions : this.extensions && this.extensions.length ? this.extensions : undefined,\r\n reserved : this.reserved && this.reserved.length ? this.reserved : undefined,\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.resolveAll = function resolve() {\r\n var fields = this.getFieldsArray(), i = 0;\r\n while (i < fields.length)\r\n fields[i++].resolve();\r\n var oneofs = this.getOneofsArray(); i = 0;\r\n while (i < oneofs.length)\r\n oneofs[i++].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.fields && this.fields[name] || this.oneofs && this.oneofs[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this type.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\r\n */\r\nTypePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Field && object.extend === undefined) {\r\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\r\n // The root object takes care of adding distinct sister-fields to the respective extended\r\n // type instead.\r\n if (this.getFieldsById()[object.id])\r\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\r\n if (object.parent)\r\n object.parent.remove(object);\r\n this.fields[object.name] = object;\r\n object.message = this;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n if (!this.oneofs)\r\n this.oneofs = {};\r\n this.oneofs[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this type.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this type\r\n */\r\nTypePrototype.remove = function remove(object) {\r\n if (object instanceof Field && object.extend === undefined) {\r\n // See Type#add for the reason why extension fields are excluded here.\r\n if (this.fields[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.fields[object.name];\r\n object.message = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object|*} [properties] Properties to set\r\n * @returns {Message} Runtime message\r\n */\r\nTypePrototype.create = function create(properties) {\r\n return new (this.getCtor())(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Message|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encode = function encode(message, writer) {\r\n return (this.encode = codegen.supported\r\n ? codegen.encode.generate(this).eof(this.getFullName() + \"$encode\", {\r\n Writer : Writer,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : codegen.encode.fallback\r\n ).call(this, message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Message|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.encode(message, writer).ldelim();\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message} Decoded message\r\n */\r\nTypePrototype.decode = function decode(readerOrBuffer, length) {\r\n return (this.decode = codegen.supported\r\n ? codegen.decode.generate(this).eof(this.getFullName() + \"$decode\", {\r\n Reader : Reader,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : codegen.decode.fallback\r\n ).call(this, readerOrBuffer, length);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @returns {Message} Decoded message\r\n */\r\nTypePrototype.decodeDelimited = function decodeDelimited(readerOrBuffer) {\r\n readerOrBuffer = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer);\r\n return this.decode(readerOrBuffer, readerOrBuffer.uint32());\r\n};\r\n\r\n/**\r\n * Verifies that enum values are valid and that any required fields are present.\r\n * @param {Message|Object} message Message to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\nTypePrototype.verify = function verify(message) {\r\n return (this.verify = codegen.supported\r\n ? codegen.verify.generate(this).eof(this.getFullName() + \"$verify\", {\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; })\r\n })\r\n : codegen.verify.fallback\r\n ).call(this, message);\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Common type constants.\r\n * @namespace\r\n */\r\nvar types = exports;\r\n\r\nvar util = require(25);\r\n\r\nvar s = [\r\n \"double\", // 0\r\n \"float\", // 1\r\n \"int32\", // 2\r\n \"uint32\", // 3\r\n \"sint32\", // 4\r\n \"fixed32\", // 5\r\n \"sfixed32\", // 6\r\n \"int64\", // 7\r\n \"uint64\", // 8\r\n \"sint64\", // 9\r\n \"fixed64\", // 10\r\n \"sfixed64\", // 11\r\n \"bool\", // 12\r\n \"string\", // 13\r\n \"bytes\" // 14\r\n];\r\n\r\nfunction bake(values, offset) {\r\n var i = 0, o = {};\r\n offset |= 0;\r\n while (i < values.length) o[s[i + offset]] = values[i++];\r\n return o;\r\n}\r\n\r\n/**\r\n * Basic type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.basic = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2,\r\n /* bytes */ 2\r\n]);\r\n\r\n/**\r\n * Basic type defaults.\r\n * @type {Object.}\r\n */\r\ntypes.defaults = bake([\r\n /* double */ 0,\r\n /* float */ 0,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 0,\r\n /* sfixed32 */ 0,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 0,\r\n /* sfixed64 */ 0,\r\n /* bool */ false,\r\n /* string */ \"\",\r\n /* bytes */ util.emptyArray\r\n]);\r\n\r\n/**\r\n * Basic long type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.long = bake([\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1\r\n], 7);\r\n\r\n/**\r\n * Allowed types for map keys with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.mapKey = bake([\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2\r\n], 2);\r\n\r\n/**\r\n * Allowed types for packed repeated fields with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.packed = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0\r\n]);\r\n","\"use strict\";\r\n\r\n/**\r\n * Various utility functions.\r\n * @namespace\r\n */\r\nvar util = exports;\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @memberof util\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nfunction isString(value) {\r\n return typeof value === 'string' || value instanceof String;\r\n}\r\n\r\nutil.isString = isString;\r\n\r\n/**\r\n * Tests if the specified value is a non-null object.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a non-null object\r\n */\r\nutil.isObject = function isObject(value) {\r\n return Boolean(value && typeof value === 'object');\r\n};\r\n\r\n/**\r\n * Tests if the specified value is an integer.\r\n * @function\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is an integer\r\n */\r\nutil.isInteger = Number.isInteger || function isInteger(value) {\r\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\r\n};\r\n\r\n/**\r\n * Converts an object's values to an array.\r\n * @param {Object.} object Object to convert\r\n * @returns {Array.<*>} Converted array\r\n */\r\nutil.toArray = function toArray(object) {\r\n if (!object)\r\n return [];\r\n var names = Object.keys(object),\r\n length = names.length;\r\n var array = new Array(length);\r\n for (var i = 0; i < length; ++i)\r\n array[i] = object[names[i]];\r\n return array;\r\n};\r\n\r\n/**\r\n * Creates a type error.\r\n * @param {string} name Argument name\r\n * @param {string} [description=\"a string\"] Expected argument descripotion\r\n * @returns {TypeError} Created type error\r\n * @private\r\n */\r\nutil._TypeError = function(name, description) {\r\n return TypeError(name + \" must be \" + (description || \"a string\"));\r\n};\r\n\r\n/**\r\n * Returns a promise from a node-style function.\r\n * @memberof util\r\n * @param {function(Error, ...*)} fn Function to call\r\n * @param {Object} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var args = [];\r\n for (var i = 2; i < arguments.length; ++i)\r\n args.push(arguments[i]);\r\n return new Promise(function(resolve, reject) {\r\n fn.apply(ctx, args.concat(\r\n function(err/*, varargs */) {\r\n if (err) reject(err);\r\n else resolve.apply(null, Array.prototype.slice.call(arguments, 1));\r\n }\r\n ));\r\n });\r\n}\r\n\r\nutil.asPromise = asPromise;\r\n\r\n/**\r\n * Filesystem, if available.\r\n * @memberof util\r\n * @type {?Object}\r\n */\r\nvar fs = null; // Hide this from webpack. There is probably another, better way.\r\ntry { fs = eval(['req','uire'].join(''))(\"fs\"); } catch (e) {} // eslint-disable-line no-eval, no-empty\r\n\r\nutil.fs = fs;\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} path File path or url\r\n * @param {function(?Error, string=)} [callback] Node-style callback\r\n * @returns {Promise|undefined} A Promise if `callback` has been omitted \r\n */\r\nfunction fetch(path, callback) {\r\n if (!callback)\r\n return asPromise(fetch, util, path);\r\n if (fs && fs.readFile)\r\n return fs.readFile(path, \"utf8\", callback);\r\n var xhr = new XMLHttpRequest();\r\n function onload() {\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n if (isString(xhr.responseText))\r\n return callback(null, xhr.responseText);\r\n return callback(Error(\"request failed\"));\r\n }\r\n xhr.onreadystatechange = function() {\r\n if (xhr.readyState === 4)\r\n onload();\r\n };\r\n xhr.open(\"GET\", path, true);\r\n xhr.send();\r\n return undefined;\r\n}\r\n\r\nutil.fetch = fetch;\r\n\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @memberof util\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\nfunction isAbsolutePath(path) {\r\n return /^(?:\\/|[a-zA-Z0-9]+:)/.test(path);\r\n}\r\n\r\nutil.isAbsolutePath = isAbsolutePath;\r\n\r\n/**\r\n * Normalizes the specified path.\r\n * @memberof util\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\nfunction normalizePath(path) {\r\n path = path.replace(/\\\\/g, '/')\r\n .replace(/\\/{2,}/g, '/');\r\n var parts = path.split('/');\r\n var abs = isAbsolutePath(path);\r\n var prefix = \"\";\r\n if (abs)\r\n prefix = parts.shift() + '/';\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === '..') {\r\n if (i > 0)\r\n parts.splice(--i, 2);\r\n else if (abs)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === '.')\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join('/');\r\n}\r\n\r\nutil.normalizePath = normalizePath;\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path that was used to fetch the origin file\r\n * @param {string} importPath Import path specified in the origin file\r\n * @param {boolean} [alreadyNormalized] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the imported file\r\n */\r\nutil.resolvePath = function resolvePath(originPath, importPath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n importPath = normalizePath(importPath);\r\n if (isAbsolutePath(importPath))\r\n return importPath;\r\n if (!alreadyNormalized)\r\n originPath = normalizePath(originPath);\r\n originPath = originPath.replace(/(?:\\/|^)[^/]+$/, '');\r\n return originPath.length ? normalizePath(originPath + '/' + importPath) : importPath;\r\n};\r\n\r\n/**\r\n * Merges the properties of the source object into the destination object.\r\n * @param {Object} dst Destination object\r\n * @param {Object} src Source object\r\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\r\n * @returns {Object} Destination object\r\n */\r\nutil.merge = function merge(dst, src, ifNotSet) {\r\n if (src) {\r\n var keys = Object.keys(src);\r\n for (var i = 0; i < keys.length; ++i)\r\n if (dst[keys[i]] === undefined || !ifNotSet)\r\n dst[keys[i]] = src[keys[i]];\r\n }\r\n return dst;\r\n};\r\n\r\n/**\r\n * Returns a safe property accessor for the specified properly name.\r\n * @param {string} prop Property name\r\n * @returns {string} Safe accessor\r\n */\r\nutil.safeProp = function safeProp(prop) {\r\n return \"['\" + prop.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\") + \"']\";\r\n};\r\n\r\n/**\r\n * Minimalistic sprintf.\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {string} Formatted string\r\n */\r\nutil.sprintf = function sprintf(format) {\r\n var params = Array.prototype.slice.call(arguments, 1),\r\n index = 0;\r\n return format.replace(/%([djs])/g, function($0, $1) {\r\n var param = params[index++];\r\n switch ($1) {\r\n case \"j\":\r\n return JSON.stringify(param);\r\n case \"p\":\r\n return util.safeProp(param);\r\n default:\r\n return String(param);\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Converts a string to camel case notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.camelCase = function camelCase(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/_([a-z])(?=[a-z]|$)/g, function($0, $1) { return $1.toUpperCase(); });\r\n};\r\n\r\n/**\r\n * Converts a string to underscore notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.underScore = function underScore(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return \"_\" + $1.toLowerCase(); });\r\n};\r\n\r\n/**\r\n * Creates a new buffer of whatever type supported by the environment.\r\n * @param {number} [size=0] Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nutil.newBuffer = function newBuffer(size) {\r\n size = size || 0; \r\n return util.Buffer\r\n ? util.Buffer.allocUnsafe && util.Buffer.allocUnsafe(size) || new util.Buffer(size)\r\n : new (typeof Uint8Array !== 'undefined' && Uint8Array || Array)(size);\r\n};\r\n\r\nutil.EventEmitter = require(26);\r\n\r\n// Merge in runtime utility\r\nutil.merge(util, require(29));\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/** @alias util.EventEmitter.prototype */\r\nvar EventEmitterPrototype = EventEmitter.prototype;\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {Object} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = Array.prototype.slice.call(arguments, 1);\r\n for (var i = 0; i < listeners.length; ++i)\r\n listeners[i].fn.apply(listeners[i].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = LongBits;\r\n\r\nvar util = require(25);\r\n\r\n/**\r\n * Any compatible Long instance.\r\n * @typedef Long\r\n * @type {Object}\r\n * @property {number} low Low bits\r\n * @property {number} high High bits\r\n * @property {boolean} unsigned Whether unsigned or not\r\n */\r\n\r\n/**\r\n * Constructs new long bits.\r\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\r\n * @memberof util\r\n * @constructor\r\n * @param {number} lo Low bits\r\n * @param {number} hi High bits\r\n */\r\nfunction LongBits(lo, hi) { // make sure to always call this with unsigned 32bits for proper optimization\r\n\r\n /**\r\n * Low bits.\r\n * @type {number}\r\n */\r\n this.lo = lo;\r\n\r\n /**\r\n * High bits.\r\n * @type {number}\r\n */\r\n this.hi = hi;\r\n}\r\n\r\n/** @alias util.LongBits.prototype */\r\nvar LongBitsPrototype = LongBits.prototype;\r\n\r\n/**\r\n * Zero bits.\r\n * @memberof util.LongBits\r\n * @type {util.LongBits}\r\n */\r\nvar zero = LongBits.zero = new LongBits(0, 0);\r\n\r\nzero.toNumber = function() { return 0; };\r\nzero.zzEncode = zero.zzDecode = function() { return this; };\r\nzero.length = function() { return 1; };\r\n\r\n/**\r\n * Constructs new long bits from the specified number.\r\n * @param {number} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.fromNumber = function fromNumber(value) {\r\n if (value === 0)\r\n return zero;\r\n var sign = value < 0;\r\n value = Math.abs(value);\r\n var lo = value >>> 0,\r\n hi = (value - lo) / 4294967296 >>> 0;\r\n if (sign) {\r\n hi = ~hi >>> 0;\r\n lo = ~lo >>> 0;\r\n if (++lo > 4294967295) {\r\n lo = 0;\r\n if (++hi > 4294967295)\r\n hi = 0;\r\n }\r\n }\r\n return new LongBits(lo, hi);\r\n};\r\n\r\n/**\r\n * Constructs new long bits from a number, long or string.\r\n * @param {Long|number|string} value Value\r\n * @returns {util.LongBits} Instance\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nLongBits.from = function from(value) {\r\n switch (typeof value) { // eslint-disable-line default-case\r\n case 'number':\r\n return LongBits.fromNumber(value);\r\n case 'string':\r\n value = util.Long.fromString(value); // throws without a long lib\r\n }\r\n return (value.low || value.high) && new LongBits(value.low >>> 0, value.high >>> 0) || zero;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a possibly unsafe JavaScript number.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {number} Possibly unsafe number\r\n */\r\nLongBitsPrototype.toNumber = function toNumber(unsigned) {\r\n if (!unsigned && this.hi >>> 31) {\r\n this.lo = ~this.lo + 1 >>> 0;\r\n this.hi = ~this.hi >>> 0;\r\n if (!this.lo)\r\n this.hi = this.hi + 1 >>> 0;\r\n return -(this.lo + this.hi * 4294967296);\r\n }\r\n return this.lo + this.hi * 4294967296;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a long.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long} Long\r\n */\r\nLongBitsPrototype.toLong = function toLong(unsigned) {\r\n return new util.Long(this.lo, this.hi, unsigned);\r\n};\r\n\r\nvar charCodeAt = String.prototype.charCodeAt;\r\n\r\n/**\r\n * Constructs new long bits from the specified 8 characters long hash.\r\n * @param {string} hash Hash\r\n * @returns {util.LongBits} Bits\r\n */\r\nLongBits.fromHash = function fromHash(hash) {\r\n return new LongBits(\r\n ( charCodeAt.call(hash, 0)\r\n | charCodeAt.call(hash, 1) << 8\r\n | charCodeAt.call(hash, 2) << 16\r\n | charCodeAt.call(hash, 3) << 24) >>> 0\r\n ,\r\n ( charCodeAt.call(hash, 4)\r\n | charCodeAt.call(hash, 5) << 8\r\n | charCodeAt.call(hash, 6) << 16\r\n | charCodeAt.call(hash, 7) << 24) >>> 0\r\n );\r\n};\r\n\r\n/**\r\n * Converts this long bits to a 8 characters long hash.\r\n * @returns {string} Hash\r\n */\r\nLongBitsPrototype.toHash = function toHash() {\r\n return String.fromCharCode(\r\n this.lo & 255,\r\n this.lo >>> 8 & 255,\r\n this.lo >>> 16 & 255,\r\n this.lo >>> 24 & 255,\r\n this.hi & 255,\r\n this.hi >>> 8 & 255,\r\n this.hi >>> 16 & 255,\r\n this.hi >>> 24 & 255\r\n );\r\n};\r\n\r\n/**\r\n * Zig-zag encodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzEncode = function zzEncode() {\r\n var mask = this.hi >> 31;\r\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\r\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Zig-zag decodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzDecode = function zzDecode() {\r\n var mask = -(this.lo & 1);\r\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\r\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Calculates the length of this longbits when encoded as a varint.\r\n * @returns {number} Length\r\n */\r\nLongBitsPrototype.length = function length() {\r\n var part0 = this.lo,\r\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\r\n part2 = this.hi >>> 24;\r\n if (part2 === 0) {\r\n if (part1 === 0)\r\n return part0 < 1 << 14\r\n ? part0 < 1 << 7 ? 1 : 2\r\n : part0 < 1 << 21 ? 3 : 4;\r\n return part1 < 1 << 14\r\n ? part1 < 1 << 7 ? 5 : 6\r\n : part1 < 1 << 21 ? 7 : 8;\r\n }\r\n return part2 < 1 << 7 ? 9 : 10;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * A drop-in buffer pool, similar in functionality to what node uses for buffers.\r\n * @memberof util\r\n * @function\r\n * @param {function(number):Uint8Array} alloc Allocator\r\n * @param {function(number, number):Uint8Array} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {function(number):Uint8Array} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\nvar util = exports;\r\n\r\nvar LongBits = util.LongBits = require(\"./longbits\");\r\n\r\nutil.pool = require(\"./pool\");\r\n\r\n/**\r\n * Whether running within node or not.\r\n * @memberof util\r\n * @type {boolean}\r\n */\r\nvar isNode = util.isNode = Boolean(global.process && global.process.versions && global.process.versions.node);\r\n\r\n/**\r\n * Optional buffer class to use.\r\n * If you assign any compatible buffer implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Buffer = null;\r\n\r\nif (isNode)\r\n try { util.Buffer = require(\"buffer\").Buffer; } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Optional Long class to use.\r\n * If you assign any compatible long implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Long = global.dcodeIO && global.dcodeIO.Long || null;\r\n\r\nif (!util.Long && isNode)\r\n try { util.Long = require(\"long\"); } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Converts a number or long to an 8 characters long hash string.\r\n * @param {Long|number} value Value to convert\r\n * @returns {string} Hash\r\n */\r\nutil.longToHash = function longToHash(value) {\r\n return value\r\n ? LongBits.from(value).toHash()\r\n : '\\0\\0\\0\\0\\0\\0\\0\\0';\r\n};\r\n\r\n/**\r\n * Converts an 8 characters long hash string to a long or number.\r\n * @param {string} hash Hash\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long|number} Original value\r\n */\r\nutil.longFromHash = function longFromHash(hash, unsigned) {\r\n var bits = LongBits.fromHash(hash);\r\n if (util.Long)\r\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\r\n return bits.toNumber(Boolean(unsigned));\r\n};\r\n\r\n/**\r\n * Tests if two possibly long values are not equal.\r\n * @param {number|Long} a First value\r\n * @param {number|Long} b Second value\r\n * @returns {boolean} `true` if not equal\r\n */\r\nutil.longNeq = function longNeq(a, b) {\r\n return typeof a === 'number'\r\n ? typeof b === 'number'\r\n ? a !== b\r\n : (a = LongBits.fromNumber(a)).lo !== b.low || a.hi !== b.high\r\n : typeof b === 'number'\r\n ? (b = LongBits.fromNumber(b)).lo !== a.low || b.hi !== a.high\r\n : a.low !== b.low || a.high !== b.high;\r\n};\r\n\r\n/**\r\n * Defines the specified properties on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {Object} descriptors Property descriptors\r\n * @returns {undefined}\r\n */\r\nutil.props = function props(target, descriptors) {\r\n Object.keys(descriptors).forEach(function(key) {\r\n util.prop(target, key, descriptors[key]);\r\n });\r\n};\r\n\r\n/**\r\n * Defines the specified property on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {string} key Property name\r\n * @param {Object} descriptor Property descriptor\r\n * @returns {undefined}\r\n */\r\nutil.prop = function prop(target, key, descriptor) {\r\n var ie8 = !-[1,];\r\n var ucKey = key.substring(0, 1).toUpperCase() + key.substring(1);\r\n if (descriptor.get)\r\n target['get' + ucKey] = descriptor.get;\r\n if (descriptor.set)\r\n target['set' + ucKey] = ie8\r\n ? function(value) {\r\n descriptor.set.call(this, value);\r\n this[key] = value;\r\n }\r\n : descriptor.set;\r\n if (ie8) {\r\n if (descriptor.value !== undefined)\r\n target[key] = descriptor.value;\r\n } else\r\n Object.defineProperty(target, key, descriptor);\r\n};\r\n\r\n/**\r\n * An immuable empty array.\r\n * @memberof util\r\n * @type {Array.<*>}\r\n */\r\nutil.emptyArray = Object.freeze([]);\r\n\r\n/**\r\n * An immutable empty object.\r\n * @type {Object}\r\n */\r\nutil.emptyObject = Object.freeze({});\r\n","\"use strict\";\r\nmodule.exports = Writer;\r\n\r\nWriter.BufferWriter = BufferWriter;\r\n\r\nvar util = require(29),\r\n ieee754 = require(1);\r\nvar LongBits = util.LongBits,\r\n ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\r\n\r\n/**\r\n * Constructs a new writer operation instance.\r\n * @classdesc Scheduled writer operation.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {*} val Value to write\r\n * @param {number} len Value byte length\r\n * @private\r\n * @ignore\r\n */\r\nfunction Op(fn, val, len) {\r\n\r\n /**\r\n * Function to call.\r\n * @type {function(Uint8Array, number, *)}\r\n */\r\n this.fn = fn;\r\n\r\n /**\r\n * Value to write.\r\n * @type {*}\r\n */\r\n this.val = val;\r\n\r\n /**\r\n * Value byte length.\r\n * @type {number}\r\n */\r\n this.len = len;\r\n\r\n /**\r\n * Next operation.\r\n * @type {?Writer.Op}\r\n */\r\n this.next = null;\r\n}\r\n\r\nWriter.Op = Op;\r\n\r\nfunction noop() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Constructs a new writer state instance.\r\n * @classdesc Copied writer state.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {Writer} writer Writer to copy state from\r\n * @param {State} next Next state entry\r\n * @private\r\n * @ignore\r\n */\r\nfunction State(writer, next) {\r\n\r\n /**\r\n * Current head.\r\n * @type {Writer.Op}\r\n */\r\n this.head = writer.head;\r\n\r\n /**\r\n * Current tail.\r\n * @type {Writer.Op}\r\n */\r\n this.tail = writer.tail;\r\n\r\n /**\r\n * Current buffer length.\r\n * @type {number}\r\n */\r\n this.len = writer.len;\r\n\r\n /**\r\n * Next state.\r\n * @type {?State}\r\n */\r\n this.next = next;\r\n}\r\n\r\nWriter.State = State;\r\n\r\n/**\r\n * Constructs a new writer instance.\r\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n */\r\nfunction Writer() {\r\n\r\n /**\r\n * Current length.\r\n * @type {number}\r\n */\r\n this.len = 0;\r\n\r\n /**\r\n * Operations head.\r\n * @type {Object}\r\n */\r\n this.head = new Op(noop, 0, 0);\r\n\r\n /**\r\n * Operations tail\r\n * @type {Object}\r\n */\r\n this.tail = this.head;\r\n\r\n /**\r\n * Linked forked states.\r\n * @type {?Object}\r\n */\r\n this.states = null;\r\n\r\n // When a value is written, the writer calculates its byte length and puts it into a linked\r\n // list of operations to perform when finish() is called. This both allows us to allocate\r\n // buffers of the exact required size and reduces the amount of work we have to do compared\r\n // to first calculating over objects and then encoding over objects. In our case, the encoding\r\n // part is just a linked list walk calling linked operations with already prepared values.\r\n}\r\n\r\n/**\r\n * Creates a new writer.\r\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\r\n */\r\nWriter.create = function create() {\r\n return new (util.Buffer && BufferWriter || Writer);\r\n};\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nWriter.alloc = function alloc(size) {\r\n return new ArrayImpl(size);\r\n};\r\n\r\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\r\nif (ArrayImpl !== Array)\r\n Writer.alloc = util.pool(Writer.alloc, ArrayImpl.prototype.subarray || ArrayImpl.prototype.slice);\r\n\r\n/** @alias Writer.prototype */\r\nvar WriterPrototype = Writer.prototype;\r\n\r\n/**\r\n * Pushes a new operation to the queue.\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.push = function push(fn, len, val) {\r\n var op = new Op(fn, val, len);\r\n this.tail.next = op;\r\n this.tail = op;\r\n this.len += len;\r\n return this;\r\n};\r\n\r\nfunction writeByte(buf, pos, val) {\r\n buf[pos] = val & 255;\r\n}\r\n\r\n/**\r\n * Writes a tag.\r\n * @param {number} id Field id\r\n * @param {number} wireType Wire type\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.tag = function write_tag(id, wireType) {\r\n return this.push(writeByte, 1, id << 3 | wireType & 7);\r\n};\r\n\r\nfunction writeVarint32(buf, pos, val) {\r\n while (val > 127) {\r\n buf[pos++] = val & 127 | 128;\r\n val >>>= 7;\r\n }\r\n buf[pos] = val;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as a varint.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.uint32 = function write_uint32(value) {\r\n value >>>= 0;\r\n return value < 128\r\n ? this.push(writeByte, 1, value)\r\n : this.push(writeVarint32,\r\n value < 16384 ? 2\r\n : value < 2097152 ? 3\r\n : value < 268435456 ? 4\r\n : 5\r\n , value);\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as a varint.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.int32 = function write_int32(value) {\r\n return value < 0\r\n ? this.push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\r\n : this.uint32(value);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as a varint, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sint32 = function write_sint32(value) {\r\n return this.uint32(value << 1 ^ value >> 31);\r\n};\r\n\r\nfunction writeVarint64(buf, pos, val) {\r\n // tends to deoptimize. stays optimized when using bits directly.\r\n while (val.hi) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\r\n val.hi >>>= 7;\r\n }\r\n while (val.lo > 127) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = val.lo >>> 7;\r\n }\r\n buf[pos++] = val.lo;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as a varint.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.uint64 = function write_uint64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.int64 = WriterPrototype.uint64;\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sint64 = function write_sint64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a boolish value as a varint.\r\n * @param {boolean} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bool = function write_bool(value) {\r\n return this.push(writeByte, 1, value ? 1 : 0);\r\n};\r\n\r\nfunction writeFixed32(buf, pos, val) {\r\n buf[pos++] = val & 255;\r\n buf[pos++] = val >>> 8 & 255;\r\n buf[pos++] = val >>> 16 & 255;\r\n buf[pos ] = val >>> 24;\r\n}\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fixed32 = function write_fixed32(value) {\r\n return this.push(writeFixed32, 4, value >>> 0);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sfixed32 = function write_sfixed32(value) {\r\n return this.push(writeFixed32, 4, value << 1 ^ value >> 31);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.fixed64 = function write_fixed64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeFixed32, 4, bits.hi).push(writeFixed32, 4, bits.lo);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sfixed64 = function write_sfixed64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeFixed32, 4, bits.hi).push(writeFixed32, 4, bits.lo);\r\n};\r\n\r\nvar writeFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function writeFloat_f32(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos ] = f8b[3];\r\n }\r\n : function writeFloat_f32_le(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeFloat_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Writes a float (32 bit).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.float = function write_float(value) {\r\n return this.push(writeFloat, 4, value);\r\n};\r\n\r\nvar writeDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function writeDouble_f64(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[6];\r\n buf[pos ] = f8b[7];\r\n }\r\n : function writeDouble_f64_le(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[7];\r\n buf[pos++] = f8b[6];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeDouble_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Writes a double (64 bit float).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.double = function write_double(value) {\r\n return this.push(writeDouble, 8, value);\r\n};\r\n\r\nvar writeBytes = ArrayImpl.prototype.set\r\n ? function writeBytes_set(buf, pos, val) {\r\n buf.set(val, pos);\r\n }\r\n : function writeBytes_for(buf, pos, val) {\r\n for (var i = 0; i < val.length; ++i)\r\n buf[pos + i] = val[i];\r\n };\r\n\r\n/**\r\n * Writes a sequence of bytes.\r\n * @param {Uint8Array} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bytes = function write_bytes(value) {\r\n var len = value.length >>> 0;\r\n return len\r\n ? this.uint32(len).push(writeBytes, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\nfunction writeString(buf, pos, val) {\r\n for (var i = 0; i < val.length; ++i) {\r\n var c1 = val.charCodeAt(i), c2;\r\n if (c1 < 128) {\r\n buf[pos++] = c1;\r\n } else if (c1 < 2048) {\r\n buf[pos++] = c1 >> 6 | 192;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = val.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buf[pos++] = c1 >> 18 | 240;\r\n buf[pos++] = c1 >> 12 & 63 | 128;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else {\r\n buf[pos++] = c1 >> 12 | 224;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n }\r\n }\r\n}\r\n\r\nfunction byteLength(val) {\r\n var strlen = val.length >>> 0;\r\n var len = 0;\r\n for (var i = 0; i < strlen; ++i) {\r\n var c1 = val.charCodeAt(i);\r\n if (c1 < 128)\r\n len += 1;\r\n else if (c1 < 2048)\r\n len += 2;\r\n else if ((c1 & 0xFC00) === 0xD800 && (val.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n}\r\n\r\n/**\r\n * Writes a string.\r\n * @param {string} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.string = function write_string(value) {\r\n var len = byteLength(value);\r\n return len\r\n ? this.uint32(len).push(writeString, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Forks this writer's state by pushing it to a stack.\r\n * Calling {@link Writer#}, {@link Writer#reset} or {@link Writer#finish} resets the writer to the previous state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fork = function fork() {\r\n this.states = new State(this, this.states);\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance to the last state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.reset = function reset() {\r\n if (this.states) {\r\n this.head = this.states.head;\r\n this.tail = this.states.tail;\r\n this.len = this.states.len;\r\n this.states = this.states.next;\r\n } else {\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\r\n * @param {number} [id] Id with wire type 2 to prepend as a tag where applicable\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.ldelim = function ldelim(id) {\r\n var head = this.head,\r\n tail = this.tail,\r\n len = this.len;\r\n this.reset();\r\n if (id !== undefined)\r\n this.tag(id, 2);\r\n this.uint32(len);\r\n this.tail.next = head.next; // skip noop\r\n this.tail = tail;\r\n this.len += len;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of write operations and frees all resources.\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nWriterPrototype.finish = function finish() {\r\n var head = this.head.next, // skip noop\r\n buf = this.constructor.alloc(this.len);\r\n this.reset();\r\n var pos = 0;\r\n while (head) {\r\n head.fn(buf, pos, head.val);\r\n pos += head.len;\r\n head = head.next;\r\n }\r\n return buf;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer writer instance.\r\n * @classdesc Wire format writer using node buffers.\r\n * @exports BufferWriter\r\n * @extends Writer\r\n * @constructor\r\n */\r\nfunction BufferWriter() {\r\n Writer.call(this);\r\n}\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nBufferWriter.alloc = function alloc_buffer(size) {\r\n BufferWriter.alloc = util.Buffer.allocUnsafe\r\n ? util.Buffer.allocUnsafe\r\n : function allocUnsafeNew(size) { return new util.Buffer(size); };\r\n return BufferWriter.alloc(size);\r\n};\r\n\r\n/** @alias BufferWriter.prototype */\r\nvar BufferWriterPrototype = BufferWriter.prototype = Object.create(Writer.prototype);\r\nBufferWriterPrototype.constructor = BufferWriter;\r\n\r\nfunction writeFloatBuffer(buf, pos, val) {\r\n buf.writeFloatLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.float = function write_float_buffer(value) {\r\n return this.push(writeFloatBuffer, 4, value);\r\n};\r\n\r\nfunction writeDoubleBuffer(buf, pos, val) {\r\n buf.writeDoubleLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.double = function write_double_buffer(value) {\r\n return this.push(writeDoubleBuffer, 8, value);\r\n};\r\n\r\nfunction writeBytesBuffer(buf, pos, val) {\r\n if (val.length)\r\n val.copy(buf, pos, 0, val.length);\r\n // This could probably be optimized just like writeStringBuffer, but most real use cases won't benefit much.\r\n}\r\n\r\nif (!(ArrayImpl.prototype.set && util.Buffer && util.Buffer.prototype.set)) // set is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.bytes = function write_bytes_buffer(value) {\r\n var len = value.length >>> 0;\r\n return len\r\n ? this.uint32(len).push(writeBytesBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\nvar writeStringBuffer = (function() { // eslint-disable-line wrap-iife\r\n return util.Buffer && util.Buffer.prototype.utf8Write // around forever, but not present in browser buffer\r\n ? function writeString_buffer_utf8Write(buf, pos, val) {\r\n if (val.length < 40)\r\n writeString(buf, pos, val);\r\n else\r\n buf.utf8Write(val, pos);\r\n }\r\n : function writeString_buffer_write(buf, pos, val) {\r\n if (val.length < 40)\r\n writeString(buf, pos, val);\r\n else\r\n buf.write(val, pos);\r\n };\r\n // Note that the plain JS encoder is faster for short strings, probably because of redundant assertions.\r\n // For a raw utf8Write, the breaking point is about 20 characters, for write it is around 40 characters.\r\n // Unfortunately, this does not translate 1:1 to real use cases, hence the common \"good enough\" limit of 40.\r\n})();\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.string = function write_string_buffer(value) {\r\n var len = value.length < 40\r\n ? byteLength(value)\r\n : util.Buffer.byteLength(value);\r\n return len\r\n ? this.uint32(len).push(writeStringBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n","\"use strict\";\r\nvar protobuf = global.protobuf = exports;\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\r\n * @param {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction load(filename, root, callback) {\r\n if (typeof root === 'function') {\r\n callback = root;\r\n root = new protobuf.Root();\r\n } else if (!root)\r\n root = new protobuf.Root();\r\n return root.load(filename, callback);\r\n}\r\n// function load(filename:string, root:Root, callback:function):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:function):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n// function load(filename:string, [root:Root]):Promise\r\n\r\nprotobuf.load = load;\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nfunction loadSync(filename, root) {\r\n if (!root)\r\n root = new protobuf.Root();\r\n return root.loadSync(filename);\r\n}\r\n\r\nprotobuf.loadSync = loadSync;\r\n\r\n// Parser\r\nprotobuf.tokenize = require(\"./tokenize\");\r\nprotobuf.parse = require(\"./parse\");\r\n\r\n// Serialization\r\nprotobuf.Writer = require(\"./writer\");\r\nprotobuf.BufferWriter = protobuf.Writer.BufferWriter;\r\nprotobuf.Reader = require(\"./reader\");\r\nprotobuf.BufferReader = protobuf.Reader.BufferReader;\r\nprotobuf.codegen = require(\"./codegen\");\r\n\r\n// Reflection\r\nprotobuf.ReflectionObject = require(\"./object\");\r\nprotobuf.Namespace = require(\"./namespace\");\r\nprotobuf.Root = require(\"./root\");\r\nprotobuf.Enum = require(\"./enum\");\r\nprotobuf.Type = require(\"./type\");\r\nprotobuf.Field = require(\"./field\");\r\nprotobuf.OneOf = require(\"./oneof\");\r\nprotobuf.MapField = require(\"./mapfield\");\r\nprotobuf.Service = require(\"./service\");\r\nprotobuf.Method = require(\"./method\");\r\n\r\n// Runtime\r\nprotobuf.Class = require(\"./class\");\r\nprotobuf.Message = require(\"./message\");\r\n\r\n// Utility\r\nprotobuf.types = require(\"./types\");\r\nprotobuf.common = require(\"./common\");\r\nprotobuf.rpc = require(\"./rpc\");\r\nprotobuf.util = require(\"./util\");\r\n\r\n// Be nice to AMD\r\nif (typeof define === 'function' && define.amd)\r\n define([\"long\"], function(Long) {\r\n if (Long) {\r\n protobuf.util.Long = Long;\r\n protobuf.Reader.configure();\r\n }\r\n return protobuf;\r\n });\r\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/dist/protobuf.min.js b/dist/protobuf.min.js index f5b796abf..62b80fecb 100644 --- a/dist/protobuf.min.js +++ b/dist/protobuf.min.js @@ -1,9 +1,9 @@ /*! * protobuf.js v6.1.0 (c) 2016 Daniel Wirtz - * Compiled Thu, 08 Dec 2016 19:14:46 UTC + * Compiled Fri, 09 Dec 2016 01:15:36 UTC * Licensed under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/protobuf.js for details */ -!function t(e,i,r){function n(o,u){if(!i[o]){if(!e[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(s)return s(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=i[o]={exports:{}};e[o][0].call(l.exports,function(t){var i=e[o][1][t];return n(i?i:t)},l,l.exports,t,e,i,r)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o>1,l=-7,h=i?0:n-1,c=i?1:-1,d=t[e+h];for(h+=c,s=d&(1<<-l)-1,d>>=-l,l+=u;l>0;s=256*s+t[e+h],h+=c,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+t[e+h],h+=c,l-=8);if(0===s)s=1-f;else{if(s===a)return o?NaN:(d?-1:1)*(1/0);o+=Math.pow(2,r),s-=f}return(d?-1:1)*o*Math.pow(2,s-r)},i.write=function(t,e,i,r,n,s){var o,u,a,f=8*s-n-1,l=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?s-1:0,p=r?-1:1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-o))<1&&(o--,a*=2),e+=o+h>=1?c/a:c*Math.pow(2,1-h),e*a>=2&&(o++,a/=2),o+h>=l?(u=0,o=l):o+h>=1?(u=(e*a-1)*Math.pow(2,n),o+=h):(u=e*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;t[i+d]=255&u,d+=p,u/=256,n-=8);for(o=o<0;t[i+d]=255&o,d+=p,o/=256,f-=8);t[i+d-p]|=128*v}},{}],2:[function(t,e,i){"use strict";function r(){function t(){var e=n.sprintf.apply(null,arguments),i=c;if(h.length){var r=h[h.length-1];s.test(r)?i=++c:a.test(r)&&++i,u.test(r)&&!u.test(e)?(i=++c,d=!0):d&&f.test(r)&&(i=--c,d=!1),o.test(e)&&(i=--c)}for(var l=0;l ").replace(/\t/g," "));var s=Object.keys(i||(i={}));return Function.apply(null,s.concat("return "+n)).apply(null,s.map(function(t){return i[t]}))}var l=Array.prototype.slice.call(arguments),h=['\t"use strict"'],c=1,d=!1;return t.str=e,t.eof=i,t}e.exports=r;var n=t(25),s=/[{[]$/,o=/^[}\]]/,u=/:$/,a=/^\s*(?:if|else if|while|for)\b|\b(?:else)\s*$/,f=/\b(?:break|continue);?$|^\s*return\b/;r.supported=!1;try{r.supported=1===r("a","b")("return a-b").eof()(2,1)}catch(t){}r.verbose=!1,r.encode=t(4),r.decode=t(3),r.verify=t(5)},{25:25,3:3,4:4,5:5}],3:[function(t,e,i){"use strict";var r=i,n=t(7),s=t(17),o=t(24),u=t(25),a=t(2);r.fallback=function(t,e){for(var i=this.getFieldsById(),r=t instanceof s?t:s.create(t),a=void 0===e?r.len:r.pos+e,f=new(this.getCtor());r.pos-1;--i)if(e.oneof.indexOf(t[i])>-1)return t[i]},set:function(t){for(var i=e.oneof,r=0;r0;){var n=t.shift();if(i.nested&&i.nested[n]){if(i=i.nested[n],!(i instanceof r))throw Error("path conflicts with non-namespace objects")}else i.add(i=new r(n))}return e&&i.addJSON(e),i},u.resolveAll=function(){for(var t=this.getNestedArray(),e=0;e-1&&this.oneof.splice(e,1),t.parent&&t.parent.remove(t),t.partOf=null,this},o.onAdd=function(t){s.prototype.onAdd.call(this,t),n(this)},o.onRemove=function(t){this.g.forEach(function(t){t.parent&&t.parent.remove(t)}),s.prototype.onRemove.call(this,t)}},{13:13,25:25,8:8}],15:[function(t,e,i){"use strict";function r(t){return null===t?null:t.toLowerCase()}function n(t,e){function i(t,e){return Error("illegal "+(e||"token")+" '"+t+"' (line "+rt.line()+F)}function n(){var t,e=[];do{if((t=nt())!==B&&t!==J)throw i(t);e.push(nt()),ut(t),t=ot()}while(t===B||t===J);return e.join("")}function v(t){var e=nt();switch(r(e)){case J:case B:return st(e),n();case"true":return!0;case"false":return!1}try{return z(e)}catch(r){if(t&&m.test(e))return e;throw i(e,"value")}}function q(){var t=L(nt()),e=t;return ut("to",!0)&&(e=L(nt())),ut(E),[t,e]}function z(t){var e=1;"-"===t.charAt(0)&&(e=-1,t=t.substring(1));var n=r(t);switch(n){case"inf":return e*(1/0);case"nan":return NaN;case"0":return 0}if(/^[1-9][0-9]*$/.test(t))return e*parseInt(t,10);if(/^0[x][0-9a-f]+$/.test(n))return e*parseInt(t,16);if(/^0[0-7]+$/.test(t))return e*parseInt(t,8);if(/^(?!e)[0-9]*(?:\.[0-9]*)?(?:[e][+-]?[0-9]+)?$/.test(n))return e*parseFloat(t);throw i(t,"number")}function L(t,e){var n=r(t);switch(n){case"min":return 1;case"max":return 536870911;case"0":return 0}if("-"===t.charAt(0)&&!e)throw i(t,"id");if(/^-?[1-9][0-9]*$/.test(t))return parseInt(t,10);if(/^-?0[x][0-9a-f]+$/.test(n))return parseInt(t,16);if(/^-?0[0-7]+$/.test(t))return parseInt(t,8);throw i(t,"id")}function V(){if(void 0!==Y)throw i("package");if(Y=nt(),!m.test(Y))throw i(Y,A);ht=ht.define(Y),ut(E)}function P(){var t,e=ot();switch(e){case"weak":t=et||(et=[]),nt();break;case"public":nt();default:t=tt||(tt=[])}e=n(),ut(E),t.push(e)}function $(){ut("="),it=r(n());var t;if(["proto2",t="proto3"].indexOf(it)<0)throw i(it,"syntax");ft=it===t,ut(E)}function R(t,e){switch(e){case O:return K(t,e),ut(E),!0;case"message":return I(t,e),!0;case"enum":return D(t,e),!0;case"service":return G(t,e),!0;case"extend":return Q(t,e),!0}return!1}function I(t,e){var n=nt();if(!g.test(n))throw i(n,"type name");var s=new u(n);if(ut(S,!0)){for(;(e=nt())!==T;){var o=r(e);if(!R(s,e))switch(o){case"map":M(s,o);break;case b:case x:case k:C(s,o);break;case"oneof":U(s,o);break;case"extensions":(s.extensions||(s.extensions=[])).push(q(s,o));break;case"reserved":(s.reserved||(s.reserved=[])).push(q(s,o));break;default:if(!ft||!m.test(e))throw i(e);st(e),C(s,x)}}ut(E,!0)}else ut(E);t.add(s)}function C(t,e,r){var n=nt();if(!m.test(n))throw i(n,N);var s=nt();if(!g.test(s))throw i(s,A);s=y(s),ut("=");var o=L(nt()),u=Z(new a(s,o,n,e,r));u.repeated&&u.setOption("packed",ft,!0),t.add(u)}function M(t){ut("<");var e=nt();if(void 0===p.mapKey[e])throw i(e,N);ut(",");var r=nt();if(!m.test(r))throw i(r,N);ut(">");var n=nt();if(!g.test(n))throw i(n,A);n=y(n),ut("=");var s=L(nt()),o=Z(new f(n,s,e,r));t.add(o)}function U(t,e){var r=nt();if(!g.test(r))throw i(r,A);r=y(r);var n=new l(r);if(ut(S,!0)){for(;(e=nt())!==T;)e===O?(K(n,e),ut(E)):(st(e),C(n,x));ut(E,!0)}else ut(E);t.add(n)}function D(t,e){var n=nt();if(!g.test(n))throw i(n,A);var s={},o=new h(n,s);if(ut(S,!0)){for(;(e=nt())!==T;)r(e)===O?K(o):_(o,e);ut(E,!0)}else ut(E);t.add(o)}function _(t,e){if(!g.test(e))throw i(e,A);var r=e;ut("=");var n=L(nt(),!0);t.values[r]=n,Z({})}function K(t,e){var r=ut(j,!0),n=nt();if(!m.test(n))throw i(n,A);r&&(ut(F),n=j+n+F,e=ot(),w.test(e)&&(n+=e,nt())),ut("="),H(t,n)}function H(t,e){if(ut(S,!0))for(;(lt=nt())!==T;){if(!g.test(lt))throw i(lt,A);e=e+"."+lt,ut(":",!0)?W(t,e,v(!0)):H(t,e)}else W(t,e,v(!0))}function W(t,e,i){t.setOption?t.setOption(e,i):t[e]=i}function Z(t){if(ut("[",!0)){do K(t,O);while(ut(",",!0));ut("]")}return ut(E),t}function G(t,e){if(e=nt(),!g.test(e))throw i(e,"service name");var n=e,s=new c(n);if(ut(S,!0)){for(;(e=nt())!==T;){var o=r(e);switch(o){case O:K(s,o),ut(E);break;case"rpc":X(s,o);break;default:throw i(e)}}ut(E,!0)}else ut(E);t.add(s)}function X(t,e){var n=e,s=nt();if(!g.test(s))throw i(s,A);var o,u,a,f;ut(j);var l;if(ut(l="stream",!0)&&(u=!0),!m.test(e=nt()))throw i(e);if(o=e,ut(F),ut("returns"),ut(j),ut(l,!0)&&(f=!0),!m.test(e=nt()))throw i(e);a=e,ut(F);var h=new d(s,n,o,a,u,f);if(ut(S,!0)){for(;(e=nt())!==T;){var c=r(e);switch(c){case O:K(h,c),ut(E);break;default:throw i(e)}}ut(E,!0)}else ut(E);t.add(h)}function Q(t,e){var n=nt();if(!m.test(n))throw i(n,"reference");if(ut(S,!0)){for(;(e=nt())!==T;){var s=r(e);switch(s){case b:case k:case x:C(t,s,n);break;default:if(!ft||!m.test(e))throw i(e);st(e),C(t,x,n)}}ut(E,!0)}else ut(E)}e||(e=new o);var Y,tt,et,it,rt=s(t),nt=rt.next,st=rt.push,ot=rt.peek,ut=rt.skip,at=!0,ft=!1;e||(e=new o);for(var lt,ht=e;null!==(lt=nt());){var ct=r(lt);switch(ct){case"package":if(!at)throw i(lt);V();break;case"import":if(!at)throw i(lt);P();break;case"syntax":if(!at)throw i(lt);$();break;case O:if(!at)throw i(lt);K(ht,lt),ut(E);break;default:if(R(ht,lt)){at=!1;continue}throw i(lt)}}return{package:Y,imports:tt,weakImports:et,syntax:it,root:e}}e.exports=n;var s=t(22),o=t(18),u=t(23),a=t(8),f=t(10),l=t(14),h=t(7),c=t(21),d=t(11),p=t(24),v=t(25),y=v.camelCase,g=/^[a-zA-Z_][a-zA-Z_0-9]*$/,m=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,w=/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,b="required",k="repeated",x="optional",O="option",A="name",N="type",S="{",T="}",j="(",F=")",E=";",B='"',J="'"},{10:10,11:11,14:14,18:18,21:21,22:22,23:23,24:24,25:25,7:7,8:8}],16:[function(t,e,i){"use strict";function r(t){if(t)for(var e=Object.keys(t),i=0;i "+t.len)}function n(){x.Long?(S.int64=a,S.uint64=l,S.sint64=c,S.fixed64=v,S.sfixed64=g):(S.int64=f,S.uint64=h,S.sint64=d,S.fixed64=y,S.sfixed64=m)}function s(t){this.buf=t,this.pos=0,this.len=t.length}function o(t,e){this.id=t,this.wireType=e}function u(){var t=0,e=0,i=0,n=0;if(this.len-this.pos>9){for(i=0;i<4;++i)if(n=this.buf[this.pos++],t|=(127&n)<<7*i,n<128)return new A(t>>>0,e>>>0);if(n=this.buf[this.pos++],t|=(127&n)<<28,e|=(127&n)>>4,n<128)return new A(t>>>0,e>>>0);for(i=0;i<5;++i)if(n=this.buf[this.pos++],e|=(127&n)<<7*i+3,n<128)return new A(t>>>0,e>>>0)}else{for(i=0;i<4;++i){if(this.pos>=this.len)throw r(this);if(n=this.buf[this.pos++],t|=(127&n)<<7*i,n<128)return new A(t>>>0,e>>>0)}if(this.pos>=this.len)throw r(this);if(n=this.buf[this.pos++],t|=(127&n)<<28,e|=(127&n)>>4,n<128)return new A(t>>>0,e>>>0);for(i=0;i<5;++i){if(this.pos>=this.len)throw r(this);if(n=this.buf[this.pos++],e|=(127&n)<<7*i+3,n<128)return new A(t>>>0,e>>>0)}}throw Error("invalid varint encoding")}function a(){return u.call(this).toLong()}function f(){return u.call(this).toNumber()}function l(){return u.call(this).toLong(!0)}function h(){return u.call(this).toNumber(!0)}function c(){return u.call(this).zzDecode().toLong()}function d(){return u.call(this).zzDecode().toNumber()}function p(){if(this.pos+8>this.len)throw r(this,8);return new A((this.buf[this.pos++]|this.buf[this.pos++]<<8|this.buf[this.pos++]<<16|this.buf[this.pos++]<<24)>>>0,(this.buf[this.pos++]|this.buf[this.pos++]<<8|this.buf[this.pos++]<<16|this.buf[this.pos++]<<24)>>>0)}function v(){return p.call(this).toLong(!0)}function y(){return p.call(this).toNumber(!0)}function g(){return p.call(this).zzDecode().toLong()}function m(){return p.call(this).zzDecode().toNumber()}function w(t){F&&F(),s.call(this,t)}function b(t,e,i){return t.utf8Slice(e,i)}function k(t,e,i){return t.toString("utf8",e,i)}e.exports=s,s.BufferReader=w;var x=t(29),O=t(1),A=x.LongBits,N="undefined"!=typeof Uint8Array?Uint8Array:Array;s.configure=n,s.create=function(t){return new(x.Buffer&&x.Buffer.isBuffer(t)&&w||s)(t)};var S=s.prototype;S.h=N.prototype.subarray||N.prototype.slice,S.tag=function(){if(this.pos>=this.len)throw r(this);return new o(this.buf[this.pos]>>>3,7&this.buf[this.pos++])},S.int32=function(){var t=this.buf[this.pos++],e=127&t;if(t>127&&(t=this.buf[this.pos++],e|=(127&t)<<7,t>127&&(t=this.buf[this.pos++],e|=(127&t)<<14,t>127&&(t=this.buf[this.pos++],e|=(127&t)<<21,t>127&&(t=this.buf[this.pos++],e|=t<<28,t>127&&(this.pos+=5))))),this.pos>this.len)throw this.pos=this.len,r(this);return e},S.uint32=function(){return this.int32()>>>0},S.sint32=function(){var t=this.int32();return t>>>1^-(1&t)},S.bool=function(){return 0!==this.int32()},S.fixed32=function(){if(this.pos+4>this.len)throw r(this,4);return this.pos+=4,this.buf[this.pos-4]|this.buf[this.pos-3]<<8|this.buf[this.pos-2]<<16|this.buf[this.pos-1]<<24},S.sfixed32=function(){var t=this.fixed32();return t>>>1^-(1&t)};var T="undefined"!=typeof Float32Array?function(){var t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[3]?function(i,r){return e[0]=i[r++],e[1]=i[r++],e[2]=i[r++],e[3]=i[r],t[0]}:function(i,r){return e[3]=i[r++],e[2]=i[r++],e[1]=i[r++],e[0]=i[r],t[0]}}():function(t,e){return O.read(t,e,!1,23,4)};S.float=function(){if(this.pos+4>this.len)throw r(this,4);var t=T(this.buf,this.pos);return this.pos+=4,t};var j="undefined"!=typeof Float64Array?function(){var t=new Float64Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[7]?function(i,r){return e[0]=i[r++],e[1]=i[r++],e[2]=i[r++],e[3]=i[r++],e[4]=i[r++],e[5]=i[r++],e[6]=i[r++],e[7]=i[r],t[0]}:function(i,r){return e[7]=i[r++],e[6]=i[r++],e[5]=i[r++],e[4]=i[r++],e[3]=i[r++],e[2]=i[r++],e[1]=i[r++],e[0]=i[r],t[0]}}():function(t,e){return O.read(t,e,!1,52,8)};S.double=function(){if(this.pos+8>this.len)throw r(this,4);var t=j(this.buf,this.pos);return this.pos+=8,t},S.bytes=function(){var t=this.int32()>>>0,e=this.pos,i=this.pos+t;if(i>this.len)throw r(this,t);return this.pos+=t,e===i?new this.buf.constructor(0):this.h.call(this.buf,e,i)},S.string=function(){var t=this.bytes(),e=t.length;if(e){for(var i=new Array(e),r=0,n=0;r191&&s<224)i[n++]=(31&s)<<6|63&t[r++];else if(s>239&&s<365){var o=((7&s)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++])-65536;i[n++]=55296+(o>>10),i[n++]=56320+(1023&o)}else i[n++]=(15&s)<<12|(63&t[r++])<<6|63&t[r++]}return String.fromCharCode.apply(String,i.slice(0,n))}return""},S.skip=function(t){if(void 0===t){do if(this.pos>=this.len)throw r(this);while(128&this.buf[this.pos++])}else{if(this.pos+t>this.len)throw r(this,t);this.pos+=t}return this},S.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var e=this.tag();if(4===e.wireType)break;this.skipType(e.wireType)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type: "+t)}return this},S.reset=function(t){return t?(this.buf=t, -this.len=t.length):(this.buf=null,this.len=0),this.pos=0,this},S.finish=function(t){var e=this.pos?this.h.call(this.buf,this.pos):this.buf;return this.reset(t),e};var F=function(){if(!x.Buffer)throw Error("Buffer is not supported");E.h=x.Buffer.prototype.slice,B=x.Buffer.prototype.utf8Slice?b:k,F=!1},E=w.prototype=Object.create(s.prototype);E.constructor=w,"undefined"==typeof Float32Array&&(E.float=function(){if(this.pos+4>this.len)throw r(this,4);var t=this.buf.readFloatLE(this.pos,!0);return this.pos+=4,t}),"undefined"==typeof Float64Array&&(E.double=function(){if(this.pos+8>this.len)throw r(this,8);var t=this.buf.readDoubleLE(this.pos,!0);return this.pos+=8,t});var B;E.string=function(){var t=this.int32()>>>0,e=this.pos,i=this.pos+t;if(i>this.len)throw r(this,t);return this.pos+=t,B(this.buf,e,i)},E.finish=function(t){var e=this.pos?this.buf.slice(this.pos):this.buf;return this.reset(t),e},n()},{1:1,29:29}],18:[function(t,e,i){"use strict";function r(t){o.call(this,"",t),this.deferred=[],this.files=[]}function n(){}function s(t){var e=t.parent.lookup(t.extend);if(e){var i=new a(t.getFullName(),t.id,t.type,t.rule,(void 0),t.options);return i.declaringField=t,t.extensionField=i,e.add(i),!0}return!1}e.exports=r;var o=t(12),u=o.extend(r),a=t(8),f=t(25),l=t(6);r.fromJSON=function(t,e){return e||(e=new r),e.setOptions(t.options).addJSON(t.nested)},u.resolvePath=f.resolvePath,u.load=function e(i,r){function s(t,e){if(r){var i=r;r=null,i(t,e)}}function o(e,i){try{if(f.isString(i)&&"{"===i.charAt(0)&&(i=JSON.parse(i)),f.isString(i)){var r=t(15)(i,a);r.imports&&r.imports.forEach(function(t){u(a.resolvePath(e,t))}),r.weakImports&&r.weakImports.forEach(function(t){u(a.resolvePath(e,t),!0)})}else a.setOptions(i.options).addJSON(i.nested)}catch(t){return void s(t)}h||c||s(null,a)}function u(t,e){var i=t.indexOf("google/protobuf/");if(i>-1){var n=t.substring(i);n in l&&(t=n)}if(!(a.files.indexOf(t)>-1)){if(a.files.push(t),t in l)return void(h?o(t,l[t]):(++c,setTimeout(function(){--c,o(t,l[t])})));if(h){var u;try{u=f.fs.readFileSync(t).toString("utf8")}catch(t){return void(e||s(t))}o(t,u)}else++c,f.fetch(t,function(i,n){if(--c,r)return i?void(e||s(i)):void o(t,n)})}}var a=this;if(!r)return f.asPromise(e,a,i);var h=r===n,c=0;return f.isString(i)&&(i=[i]),i.forEach(function(t){u(a.resolvePath("",t))}),h?a:void(c||s(null,a))},u.loadSync=function(t){return this.load(t,n)},u.e=function(t){var e=this.deferred.slice();this.deferred=[];for(var i=0;i-1&&this.deferred.splice(e,1)}t.extensionField&&(t.extensionField.parent.remove(t.extensionField),t.extensionField=null)}else if(t instanceof o)for(var i=t.getNestedArray(),r=0;r0)return m.shift();if(w)return i();var r,o,u;do{if(v===y)return null;for(r=!1;/\s/.test(u=n(v));)if(u===a&&++g,++v===y)return null;if(n(v)===f){if(++v===y)throw e("comment");if(n(v)===f){for(;n(++v)!==a;)if(v===y)return null;++v,++g,r=!0}else{if((u=n(v))!==l)return f;do{if(u===a&&++g,++v===y)return null;o=u,u=n(v)}while(o!==l||u!==f);++v,r=!0}}}while(r);if(v===y)return null;var h=v;s.lastIndex=0;var c=s.test(n(h++));if(!c)for(;h]/g,o=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,u=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,a="\n",f="/",l="*"},{}],23:[function(t,e,i){"use strict";function r(t,e){s.call(this,t,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.j=null,this.k=null,this.l=null,this.m=null,this.n=null}function n(t){return t.j=t.k=t.m=t.n=null,delete t.encode,delete t.decode,t}e.exports=r;var s=t(12),o=s.prototype,u=s.extend(r),a=t(7),f=t(14),l=t(8),h=t(21),c=t(16),d=t(17),p=t(30),v=t(9),y=t(25),g=t(2);y.props(u,{fieldsById:{get:function(){if(this.j)return this.j;this.j={};for(var t=Object.keys(this.fields),e=0;e0?e.splice(--n,2):i?e.splice(n,1):++n:"."===e[n]?e.splice(n,1):++n;return r+e.join("/")}var util=exports;util.isString=isString,util.isObject=function(t){return Boolean(t&&"object"==typeof t)},util.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},util.toArray=function(t){if(!t)return[];for(var e=Object.keys(t),i=e.length,r=new Array(i),n=0;n>>0,n=(t-i)/4294967296>>>0;return e&&(n=~n>>>0,i=~i>>>0,++i>4294967295&&(i=0,++n>4294967295&&(n=0))),new r(i,n)},r.from=function(t){switch(typeof t){case"number":return r.fromNumber(t);case"string":t=n.Long.fromString(t)}return(t.low||t.high)&&new r(t.low>>>0,t.high>>>0)||o},s.toNumber=function(t){return!t&&this.hi>>>31?(this.lo=~this.lo+1>>>0,this.hi=~this.hi>>>0,this.lo||(this.hi=this.hi+1>>>0),-(this.lo+4294967296*this.hi)):this.lo+4294967296*this.hi},s.toLong=function(t){return new n.Long(this.lo,this.hi,t)};var u=String.prototype.charCodeAt;r.fromHash=function(t){return new r((u.call(t,0)|u.call(t,1)<<8|u.call(t,2)<<16|u.call(t,3)<<24)>>>0,(u.call(t,4)|u.call(t,5)<<8|u.call(t,6)<<16|u.call(t,7)<<24)>>>0)},s.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24&255,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24&255)},s.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},s.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},s.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===e?t<16384?t<128?1:2:t<1<<21?3:4:e<16384?e<128?5:6:e<1<<21?7:8:i<128?9:10}},{25:25}],28:[function(t,e,i){"use strict";function r(t,e,i){var r=i||8192,n=r>>>1,s=null,o=r;return function(i){if(i>n)return t(i);o+i>r&&(s=t(r),o=0);var u=e.call(s,o,o+=i);return 7&o&&(o=(7|o)+1),u}}e.exports=r},{}],29:[function(t,e,i){(function(e){"use strict";var r=i,n=r.LongBits=t(27);r.pool=t(28);var s=r.isNode=Boolean(e.process&&e.process.versions&&e.process.versions.node);if(r.Buffer=null,s)try{r.Buffer=t("buffer").Buffer}catch(t){}if(r.Long=e.dcodeIO&&e.dcodeIO.Long||null,!r.Long&&s)try{r.Long=t("long")}catch(t){}r.longToHash=function(t){return t?n.from(t).toHash():"\0\0\0\0\0\0\0\0"},r.longFromHash=function(t,e){var i=n.fromHash(t);return r.Long?r.Long.fromBits(i.lo,i.hi,e):i.toNumber(Boolean(e))},r.longNeq=function(t,e){return"number"==typeof t?"number"==typeof e?t!==e:(t=n.fromNumber(t)).lo!==e.low||t.hi!==e.high:"number"==typeof e?(e=n.fromNumber(e)).lo!==t.low||e.hi!==t.high:t.low!==e.low||t.high!==e.high},r.props=function(t,e){Object.keys(e).forEach(function(i){r.prop(t,i,e[i])})},r.prop=function(t,e,i){var r=!-[1],n=e.substring(0,1).toUpperCase()+e.substring(1);i.get&&(t["get"+n]=i.get),i.set&&(t["set"+n]=r?function(t){i.set.call(this,t),this[e]=t}:i.set),r?void 0!==i.value&&(t[e]=i.value):Object.defineProperty(t,e,i)},r.emptyArray=Object.freeze([]),r.emptyObject=Object.freeze({})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{27:27,28:28,buffer:"buffer",long:"long"}],30:[function(t,e,i){"use strict";function r(t,e,i){this.fn=t,this.val=e,this.len=i,this.next=null}function n(){}function s(t,e){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=e}function o(){this.len=0,this.head=new r(n,0,0),this.tail=this.head,this.states=null}function u(t,e,i){t[e]=255&i}function a(t,e,i){for(;i>127;)t[e++]=127&i|128,i>>>=7;t[e]=i}function f(t,e,i){for(;i.hi;)t[e++]=127&i.lo|128,i.lo=(i.lo>>>7|i.hi<<25)>>>0,i.hi>>>=7;for(;i.lo>127;)t[e++]=127&i.lo|128,i.lo=i.lo>>>7;t[e++]=i.lo}function l(t,e,i){t[e++]=255&i,t[e++]=i>>>8&255,t[e++]=i>>>16&255,t[e]=i>>>24}function h(t,e,i){for(var r=0;r>6|192,t[e++]=63&s|128):55296===(64512&s)&&56320===(64512&(n=i.charCodeAt(r+1)))?(s=65536+((1023&s)<<10)+(1023&n),++r,t[e++]=s>>18|240,t[e++]=s>>12&63|128,t[e++]=s>>6&63|128,t[e++]=63&s|128):(t[e++]=s>>12|224,t[e++]=s>>6&63|128,t[e++]=63&s|128)}}function c(t){for(var e=t.length>>>0,i=0,r=0;r>>=0,t<128?this.push(u,1,t):this.push(a,t<16384?2:t<2097152?3:t<268435456?4:5,t)},k.int32=function(t){return t<0?this.push(f,10,w.fromNumber(t)):this.uint32(t)},k.sint32=function(t){return this.uint32(t<<1^t>>31)},k.uint64=function(t){var e=w.from(t);return this.push(f,e.length(),e)},k.int64=k.uint64,k.sint64=function(t){var e=w.from(t).zzEncode();return this.push(f,e.length(),e)},k.bool=function(t){return this.push(u,1,t?1:0)},k.fixed32=function(t){return this.push(l,4,t>>>0)},k.sfixed32=function(t){return this.push(l,4,t<<1^t>>31)},k.fixed64=function(t){var e=w.from(t);return this.push(l,4,e.hi).push(l,4,e.lo)},k.sfixed64=function(t){var e=w.from(t).zzEncode();return this.push(l,4,e.hi).push(l,4,e.lo)};var x="undefined"!=typeof Float32Array?function(){var t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[3]?function(i,r,n){t[0]=n,i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r]=e[3]}:function(i,r,n){t[0]=n,i[r++]=e[3],i[r++]=e[2],i[r++]=e[1],i[r]=e[0]}}():function(t,e,i){m.write(t,i,e,!1,23,4)};k.float=function(t){return this.push(x,4,t)};var O="undefined"!=typeof Float64Array?function(){var t=new Float64Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[7]?function(i,r,n){t[0]=n,i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r++]=e[3],i[r++]=e[4],i[r++]=e[5],i[r++]=e[6],i[r]=e[7]}:function(i,r,n){t[0]=n,i[r++]=e[7],i[r++]=e[6],i[r++]=e[5],i[r++]=e[4],i[r++]=e[3],i[r++]=e[2],i[r++]=e[1],i[r]=e[0]}}():function(t,e,i){m.write(t,i,e,!1,52,8)};k.double=function(t){return this.push(O,8,t)};var A=b.prototype.set?function(t,e,i){t.set(i,e)}:function(t,e,i){for(var r=0;r>>0;return e?this.uint32(e).push(A,e,t):this.push(u,1,0)},k.string=function(t){var e=c(t);return e?this.uint32(e).push(h,e,t):this.push(u,1,0)},k.fork=function(){return this.states=new s(this,this.states),this.head=this.tail=new r(n,0,0),this.len=0,this},k.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 r(n,0,0),this.len=0),this},k.ldelim=function(t){var e=this.head,i=this.tail,r=this.len;return this.reset(),void 0!==t&&this.tag(t,2),this.uint32(r),this.tail.next=e.next,this.tail=i,this.len+=r,this},k.finish=function(){var t=this.head.next,e=this.constructor.alloc(this.len);this.reset();for(var i=0;t;)t.fn(e,i,t.val),i+=t.len,t=t.next;return e},d.alloc=function(t){return d.alloc=g.Buffer.allocUnsafe?g.Buffer.allocUnsafe:function(t){return new g.Buffer(t)},d.alloc(t)};var N=d.prototype=Object.create(o.prototype);N.constructor=d,"undefined"==typeof Float32Array&&(N.float=function(t){return this.push(p,4,t)}),"undefined"==typeof Float64Array&&(N.double=function(t){return this.push(v,8,t)}),b.prototype.set&&g.Buffer&&g.Buffer.prototype.set||(N.bytes=function(t){var e=t.length>>>0;return e?this.uint32(e).push(y,e,t):this.push(u,1,0)});var S=function(){return g.Buffer&&g.Buffer.prototype.utf8Write?function(t,e,i){i.length<40?h(t,e,i):t.utf8Write(i,e)}:function(t,e,i){i.length<40?h(t,e,i):t.write(i,e)}}();N.string=function(t){var e=t.length<40?c(t):g.Buffer.byteLength(t);return e?this.uint32(e).push(S,e,t):this.push(u,1,0)}},{1:1,29:29}],31:[function(t,e,i){(function(e){"use strict";function r(t,e,i){return"function"==typeof e?(i=e,e=new s.Root):e||(e=new s.Root),e.load(t,i)}function n(t,e){return e||(e=new s.Root),e.loadSync(t)}var s=e.protobuf=i;s.load=r,s.loadSync=n,s.tokenize=t(22),s.parse=t(15),s.Writer=t(30),s.BufferWriter=s.Writer.BufferWriter,s.Reader=t(17),s.BufferReader=s.Reader.BufferReader,s.codegen=t(2),s.ReflectionObject=t(13),s.Namespace=t(12),s.Root=t(18),s.Enum=t(7),s.Type=t(23),s.Field=t(8),s.OneOf=t(14),s.MapField=t(10),s.Service=t(21),s.Method=t(11),s.Prototype=t(16),s.inherits=t(9),s.types=t(24),s.common=t(6),s.rpc=t(19),s.util=t(25),"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&(s.util.Long=t,s.Reader.configure()),s})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,2:2,21:21,22:22,23:23,24:24,25:25,30:30,6:6,7:7,8:8,9:9}]},{},[31]); +!function t(e,i,r){function n(o,u){if(!i[o]){if(!e[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(s)return s(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=i[o]={exports:{}};e[o][0].call(l.exports,function(t){var i=e[o][1][t];return n(i?i:t)},l,l.exports,t,e,i,r)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o>1,l=-7,h=i?0:n-1,c=i?1:-1,d=t[e+h];for(h+=c,s=d&(1<<-l)-1,d>>=-l,l+=u;l>0;s=256*s+t[e+h],h+=c,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+t[e+h],h+=c,l-=8);if(0===s)s=1-f;else{if(s===a)return o?NaN:(d?-1:1)*(1/0);o+=Math.pow(2,r),s-=f}return(d?-1:1)*o*Math.pow(2,s-r)},i.write=function(t,e,i,r,n,s){var o,u,a,f=8*s-n-1,l=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?s-1:0,p=r?-1:1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-o))<1&&(o--,a*=2),e+=o+h>=1?c/a:c*Math.pow(2,1-h),e*a>=2&&(o++,a/=2),o+h>=l?(u=0,o=l):o+h>=1?(u=(e*a-1)*Math.pow(2,n),o+=h):(u=e*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;t[i+d]=255&u,d+=p,u/=256,n-=8);for(o=o<0;t[i+d]=255&o,d+=p,o/=256,f-=8);t[i+d-p]|=128*v}},{}],2:[function(t,e,i){"use strict";function r(t){return r.create(t)}e.exports=r;var n=t(11),s=t(23),o=t(25),u=o.a;r.create=function(t,e){if(!(t instanceof s))throw u("type","a Type");var i=e;if(i){if("function"!=typeof i)throw u("ctor","a function")}else i=function(t){return function(e){t.call(this,e)}}(n);i.constructor=r;var a=i.prototype=new n;return a.constructor=i,o.merge(i,n,!0),i.$type=t,a.$type=t,t.getFieldsArray().forEach(function(t){t.resolve(),a[t.name]=Array.isArray(t.defaultValue)?o.emptyArray:o.isObject(t.defaultValue)?o.emptyObject:t.defaultValue}),t.getOneofsArray().forEach(function(t){o.prop(a,t.resolve().name,{get:function(){for(var e=Object.keys(this),i=e.length-1;i>-1;--i)if(t.oneof.indexOf(e[i])>-1)return e[i]},set:function(e){for(var i=t.oneof,r=0;r ").replace(/\t/g," "));var s=Object.keys(i||(i={}));return Function.apply(null,s.concat("return "+n)).apply(null,s.map(function(t){return i[t]}))}var l=Array.prototype.slice.call(arguments),h=['\t"use strict"'],c=1,d=!1;return t.str=e,t.eof=i,t}e.exports=r;var n=t(25),s=/[{[]$/,o=/^[}\]]/,u=/:$/,a=/^\s*(?:if|else if|while|for)\b|\b(?:else)\s*$/,f=/\b(?:break|continue);?$|^\s*return\b/;r.supported=!1;try{r.supported=1===r("a","b")("return a-b").eof()(2,1)}catch(t){}r.verbose=!1,r.encode=t(5),r.decode=t(4),r.verify=t(6)},{25:25,4:4,5:5,6:6}],4:[function(t,e,i){"use strict";var r=i,n=t(8),s=t(17),o=t(24),u=t(25),a=t(3);r.fallback=function(t,e){for(var i=this.getFieldsById(),r=t instanceof s?t:s.create(t),a=void 0===e?r.len:r.pos+e,f=new(this.getCtor());r.pos0;){var n=t.shift();if(i.nested&&i.nested[n]){if(i=i.nested[n],!(i instanceof r))throw Error("path conflicts with non-namespace objects")}else i.add(i=new r(n))}return e&&i.addJSON(e),i},u.resolveAll=function(){for(var t=this.getNestedArray(),e=0;e-1&&this.oneof.splice(e,1),t.parent&&t.parent.remove(t),t.partOf=null,this},o.onAdd=function(t){s.prototype.onAdd.call(this,t),n(this)},o.onRemove=function(t){this.g.forEach(function(t){t.parent&&t.parent.remove(t)}),s.prototype.onRemove.call(this,t)}},{14:14,25:25,9:9}],16:[function(t,e,i){"use strict";function r(t){return null===t?null:t.toLowerCase()}function n(t,e){function i(t,e){return Error("illegal "+(e||"token")+" '"+t+"' (line "+rt.line()+F)}function n(){var t,e=[];do{if((t=nt())!==B&&t!==J)throw i(t);e.push(nt()),ut(t),t=ot()}while(t===B||t===J);return e.join("")}function v(t){var e=nt();switch(r(e)){case J:case B:return st(e),n();case"true":return!0;case"false":return!1}try{return z(e)}catch(r){if(t&&m.test(e))return e;throw i(e,"value")}}function q(){var t=L(nt()),e=t;return ut("to",!0)&&(e=L(nt())),ut(E),[t,e]}function z(t){var e=1;"-"===t.charAt(0)&&(e=-1,t=t.substring(1));var n=r(t);switch(n){case"inf":return e*(1/0);case"nan":return NaN;case"0":return 0}if(/^[1-9][0-9]*$/.test(t))return e*parseInt(t,10);if(/^0[x][0-9a-f]+$/.test(n))return e*parseInt(t,16);if(/^0[0-7]+$/.test(t))return e*parseInt(t,8);if(/^(?!e)[0-9]*(?:\.[0-9]*)?(?:[e][+-]?[0-9]+)?$/.test(n))return e*parseFloat(t);throw i(t,"number")}function L(t,e){var n=r(t);switch(n){case"min":return 1;case"max":return 536870911;case"0":return 0}if("-"===t.charAt(0)&&!e)throw i(t,"id");if(/^-?[1-9][0-9]*$/.test(t))return parseInt(t,10);if(/^-?0[x][0-9a-f]+$/.test(n))return parseInt(t,16);if(/^-?0[0-7]+$/.test(t))return parseInt(t,8);throw i(t,"id")}function V(){if(void 0!==Y)throw i("package");if(Y=nt(),!m.test(Y))throw i(Y,A);ht=ht.define(Y),ut(E)}function $(){var t,e=ot();switch(e){case"weak":t=et||(et=[]),nt();break;case"public":nt();default:t=tt||(tt=[])}e=n(),ut(E),t.push(e)}function R(){ut("="),it=r(n());var t;if(["proto2",t="proto3"].indexOf(it)<0)throw i(it,"syntax");ft=it===t,ut(E)}function P(t,e){switch(e){case O:return K(t,e),ut(E),!0;case"message":return I(t,e),!0;case"enum":return D(t,e),!0;case"service":return G(t,e),!0;case"extend":return Q(t,e),!0}return!1}function I(t,e){var n=nt();if(!g.test(n))throw i(n,"type name");var s=new u(n);if(ut(S,!0)){for(;(e=nt())!==T;){var o=r(e);if(!P(s,e))switch(o){case"map":M(s,o);break;case b:case x:case k:C(s,o);break;case"oneof":U(s,o);break;case"extensions":(s.extensions||(s.extensions=[])).push(q(s,o));break;case"reserved":(s.reserved||(s.reserved=[])).push(q(s,o));break;default:if(!ft||!m.test(e))throw i(e);st(e),C(s,x)}}ut(E,!0)}else ut(E);t.add(s)}function C(t,e,r){var n=nt();if(!m.test(n))throw i(n,N);var s=nt();if(!g.test(s))throw i(s,A);s=y(s),ut("=");var o=L(nt()),u=Z(new a(s,o,n,e,r));u.repeated&&u.setOption("packed",ft,!0),t.add(u)}function M(t){ut("<");var e=nt();if(void 0===p.mapKey[e])throw i(e,N);ut(",");var r=nt();if(!m.test(r))throw i(r,N);ut(">");var n=nt();if(!g.test(n))throw i(n,A);n=y(n),ut("=");var s=L(nt()),o=Z(new f(n,s,e,r));t.add(o)}function U(t,e){var r=nt();if(!g.test(r))throw i(r,A);r=y(r);var n=new l(r);if(ut(S,!0)){for(;(e=nt())!==T;)e===O?(K(n,e),ut(E)):(st(e),C(n,x));ut(E,!0)}else ut(E);t.add(n)}function D(t,e){var n=nt();if(!g.test(n))throw i(n,A);var s={},o=new h(n,s);if(ut(S,!0)){for(;(e=nt())!==T;)r(e)===O?K(o):_(o,e);ut(E,!0)}else ut(E);t.add(o)}function _(t,e){if(!g.test(e))throw i(e,A);var r=e;ut("=");var n=L(nt(),!0);t.values[r]=n,Z({})}function K(t,e){var r=ut(j,!0),n=nt();if(!m.test(n))throw i(n,A);r&&(ut(F),n=j+n+F,e=ot(),w.test(e)&&(n+=e,nt())),ut("="),H(t,n)}function H(t,e){if(ut(S,!0))for(;(lt=nt())!==T;){if(!g.test(lt))throw i(lt,A);e=e+"."+lt,ut(":",!0)?W(t,e,v(!0)):H(t,e)}else W(t,e,v(!0))}function W(t,e,i){t.setOption?t.setOption(e,i):t[e]=i}function Z(t){if(ut("[",!0)){do K(t,O);while(ut(",",!0));ut("]")}return ut(E),t}function G(t,e){if(e=nt(),!g.test(e))throw i(e,"service name");var n=e,s=new c(n);if(ut(S,!0)){for(;(e=nt())!==T;){var o=r(e);switch(o){case O:K(s,o),ut(E);break;case"rpc":X(s,o);break;default:throw i(e)}}ut(E,!0)}else ut(E);t.add(s)}function X(t,e){var n=e,s=nt();if(!g.test(s))throw i(s,A);var o,u,a,f;ut(j);var l;if(ut(l="stream",!0)&&(u=!0),!m.test(e=nt()))throw i(e);if(o=e,ut(F),ut("returns"),ut(j),ut(l,!0)&&(f=!0),!m.test(e=nt()))throw i(e);a=e,ut(F);var h=new d(s,n,o,a,u,f);if(ut(S,!0)){for(;(e=nt())!==T;){var c=r(e);switch(c){case O:K(h,c),ut(E);break;default:throw i(e)}}ut(E,!0)}else ut(E);t.add(h)}function Q(t,e){var n=nt();if(!m.test(n))throw i(n,"reference");if(ut(S,!0)){for(;(e=nt())!==T;){var s=r(e);switch(s){case b:case k:case x:C(t,s,n);break;default:if(!ft||!m.test(e))throw i(e);st(e),C(t,x,n)}}ut(E,!0)}else ut(E)}e||(e=new o);var Y,tt,et,it,rt=s(t),nt=rt.next,st=rt.push,ot=rt.peek,ut=rt.skip,at=!0,ft=!1;e||(e=new o);for(var lt,ht=e;null!==(lt=nt());){var ct=r(lt);switch(ct){case"package":if(!at)throw i(lt);V();break;case"import":if(!at)throw i(lt);$();break;case"syntax":if(!at)throw i(lt);R();break;case O:if(!at)throw i(lt);K(ht,lt),ut(E);break;default:if(P(ht,lt)){at=!1;continue}throw i(lt)}}return{package:Y,imports:tt,weakImports:et,syntax:it,root:e}}e.exports=n;var s=t(22),o=t(18),u=t(23),a=t(9),f=t(10),l=t(15),h=t(8),c=t(21),d=t(12),p=t(24),v=t(25),y=v.camelCase,g=/^[a-zA-Z_][a-zA-Z_0-9]*$/,m=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,w=/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,b="required",k="repeated",x="optional",O="option",A="name",N="type",S="{",T="}",j="(",F=")",E=";",B='"',J="'"},{10:10,12:12,15:15,18:18,21:21,22:22,23:23,24:24,25:25,8:8,9:9}],17:[function(t,e,i){"use strict";function r(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function n(){x.Long?(S.int64=a,S.uint64=l,S.sint64=c,S.fixed64=v,S.sfixed64=g):(S.int64=f,S.uint64=h,S.sint64=d,S.fixed64=y,S.sfixed64=m)}function s(t){this.buf=t,this.pos=0,this.len=t.length}function o(t,e){this.id=t,this.wireType=e}function u(){var t=0,e=0,i=0,n=0;if(this.len-this.pos>9){for(i=0;i<4;++i)if(n=this.buf[this.pos++],t|=(127&n)<<7*i,n<128)return new A(t>>>0,e>>>0);if(n=this.buf[this.pos++],t|=(127&n)<<28,e|=(127&n)>>4,n<128)return new A(t>>>0,e>>>0);for(i=0;i<5;++i)if(n=this.buf[this.pos++],e|=(127&n)<<7*i+3,n<128)return new A(t>>>0,e>>>0)}else{for(i=0;i<4;++i){if(this.pos>=this.len)throw r(this);if(n=this.buf[this.pos++],t|=(127&n)<<7*i,n<128)return new A(t>>>0,e>>>0)}if(this.pos>=this.len)throw r(this);if(n=this.buf[this.pos++],t|=(127&n)<<28,e|=(127&n)>>4,n<128)return new A(t>>>0,e>>>0);for(i=0;i<5;++i){if(this.pos>=this.len)throw r(this);if(n=this.buf[this.pos++],e|=(127&n)<<7*i+3,n<128)return new A(t>>>0,e>>>0)}}throw Error("invalid varint encoding")}function a(){return u.call(this).toLong()}function f(){return u.call(this).toNumber()}function l(){return u.call(this).toLong(!0)}function h(){return u.call(this).toNumber(!0)}function c(){return u.call(this).zzDecode().toLong()}function d(){return u.call(this).zzDecode().toNumber()}function p(){if(this.pos+8>this.len)throw r(this,8);return new A((this.buf[this.pos++]|this.buf[this.pos++]<<8|this.buf[this.pos++]<<16|this.buf[this.pos++]<<24)>>>0,(this.buf[this.pos++]|this.buf[this.pos++]<<8|this.buf[this.pos++]<<16|this.buf[this.pos++]<<24)>>>0)}function v(){return p.call(this).toLong(!0)}function y(){return p.call(this).toNumber(!0)}function g(){return p.call(this).zzDecode().toLong()}function m(){return p.call(this).zzDecode().toNumber()}function w(t){F&&F(),s.call(this,t)}function b(t,e,i){return t.utf8Slice(e,i)}function k(t,e,i){return t.toString("utf8",e,i)}e.exports=s,s.BufferReader=w;var x=t(29),O=t(1),A=x.LongBits,N="undefined"!=typeof Uint8Array?Uint8Array:Array;s.configure=n,s.create=function(t){return new(x.Buffer&&x.Buffer.isBuffer(t)&&w||s)(t)};var S=s.prototype;S.h=N.prototype.subarray||N.prototype.slice,S.tag=function(){if(this.pos>=this.len)throw r(this);return new o(this.buf[this.pos]>>>3,7&this.buf[this.pos++])},S.int32=function(){var t=this.buf[this.pos++],e=127&t;if(t>127&&(t=this.buf[this.pos++],e|=(127&t)<<7,t>127&&(t=this.buf[this.pos++],e|=(127&t)<<14,t>127&&(t=this.buf[this.pos++],e|=(127&t)<<21,t>127&&(t=this.buf[this.pos++],e|=t<<28,t>127&&(this.pos+=5))))),this.pos>this.len)throw this.pos=this.len,r(this);return e},S.uint32=function(){return this.int32()>>>0},S.sint32=function(){var t=this.int32();return t>>>1^-(1&t)},S.bool=function(){return 0!==this.int32()},S.fixed32=function(){if(this.pos+4>this.len)throw r(this,4);return this.pos+=4,this.buf[this.pos-4]|this.buf[this.pos-3]<<8|this.buf[this.pos-2]<<16|this.buf[this.pos-1]<<24},S.sfixed32=function(){var t=this.fixed32();return t>>>1^-(1&t)};var T="undefined"!=typeof Float32Array?function(){var t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[3]?function(i,r){return e[0]=i[r++],e[1]=i[r++],e[2]=i[r++],e[3]=i[r],t[0]}:function(i,r){return e[3]=i[r++],e[2]=i[r++],e[1]=i[r++],e[0]=i[r],t[0]}}():function(t,e){return O.read(t,e,!1,23,4)};S.float=function(){if(this.pos+4>this.len)throw r(this,4);var t=T(this.buf,this.pos);return this.pos+=4,t};var j="undefined"!=typeof Float64Array?function(){var t=new Float64Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[7]?function(i,r){return e[0]=i[r++],e[1]=i[r++],e[2]=i[r++],e[3]=i[r++],e[4]=i[r++],e[5]=i[r++],e[6]=i[r++],e[7]=i[r],t[0]}:function(i,r){return e[7]=i[r++],e[6]=i[r++],e[5]=i[r++],e[4]=i[r++],e[3]=i[r++],e[2]=i[r++],e[1]=i[r++],e[0]=i[r],t[0]}}():function(t,e){return O.read(t,e,!1,52,8)};S.double=function(){if(this.pos+8>this.len)throw r(this,4);var t=j(this.buf,this.pos);return this.pos+=8,t},S.bytes=function(){var t=this.int32()>>>0,e=this.pos,i=this.pos+t;if(i>this.len)throw r(this,t);return this.pos+=t,e===i?new this.buf.constructor(0):this.h.call(this.buf,e,i)},S.string=function(){var t=this.bytes(),e=t.length;if(e){for(var i=new Array(e),r=0,n=0;r191&&s<224)i[n++]=(31&s)<<6|63&t[r++];else if(s>239&&s<365){var o=((7&s)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++])-65536;i[n++]=55296+(o>>10),i[n++]=56320+(1023&o)}else i[n++]=(15&s)<<12|(63&t[r++])<<6|63&t[r++]}return String.fromCharCode.apply(String,i.slice(0,n))}return""},S.skip=function(t){if(void 0===t){do if(this.pos>=this.len)throw r(this);while(128&this.buf[this.pos++])}else{if(this.pos+t>this.len)throw r(this,t);this.pos+=t}return this},S.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var e=this.tag();if(4===e.wireType)break;this.skipType(e.wireType)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type: "+t)}return this},S.reset=function(t){return t?(this.buf=t,this.len=t.length):(this.buf=null,this.len=0),this.pos=0, +this},S.finish=function(t){var e=this.pos?this.h.call(this.buf,this.pos):this.buf;return this.reset(t),e};var F=function(){if(!x.Buffer)throw Error("Buffer is not supported");E.h=x.Buffer.prototype.slice,B=x.Buffer.prototype.utf8Slice?b:k,F=!1},E=w.prototype=Object.create(s.prototype);E.constructor=w,"undefined"==typeof Float32Array&&(E.float=function(){if(this.pos+4>this.len)throw r(this,4);var t=this.buf.readFloatLE(this.pos,!0);return this.pos+=4,t}),"undefined"==typeof Float64Array&&(E.double=function(){if(this.pos+8>this.len)throw r(this,8);var t=this.buf.readDoubleLE(this.pos,!0);return this.pos+=8,t});var B;E.string=function(){var t=this.int32()>>>0,e=this.pos,i=this.pos+t;if(i>this.len)throw r(this,t);return this.pos+=t,B(this.buf,e,i)},E.finish=function(t){var e=this.pos?this.buf.slice(this.pos):this.buf;return this.reset(t),e},n()},{1:1,29:29}],18:[function(t,e,i){"use strict";function r(t){o.call(this,"",t),this.deferred=[],this.files=[]}function n(){}function s(t){var e=t.parent.lookup(t.extend);if(e){var i=new a(t.getFullName(),t.id,t.type,t.rule,(void 0),t.options);return i.declaringField=t,t.extensionField=i,e.add(i),!0}return!1}e.exports=r;var o=t(13),u=o.extend(r),a=t(9),f=t(25),l=t(7);r.fromJSON=function(t,e){return e||(e=new r),e.setOptions(t.options).addJSON(t.nested)},u.resolvePath=f.resolvePath,u.load=function e(i,r){function s(t,e){if(r){var i=r;r=null,i(t,e)}}function o(e,i){try{if(f.isString(i)&&"{"===i.charAt(0)&&(i=JSON.parse(i)),f.isString(i)){var r=t(16)(i,a);r.imports&&r.imports.forEach(function(t){u(a.resolvePath(e,t))}),r.weakImports&&r.weakImports.forEach(function(t){u(a.resolvePath(e,t),!0)})}else a.setOptions(i.options).addJSON(i.nested)}catch(t){return void s(t)}h||c||s(null,a)}function u(t,e){var i=t.indexOf("google/protobuf/");if(i>-1){var n=t.substring(i);n in l&&(t=n)}if(!(a.files.indexOf(t)>-1)){if(a.files.push(t),t in l)return void(h?o(t,l[t]):(++c,setTimeout(function(){--c,o(t,l[t])})));if(h){var u;try{u=f.fs.readFileSync(t).toString("utf8")}catch(t){return void(e||s(t))}o(t,u)}else++c,f.fetch(t,function(i,n){if(--c,r)return i?void(e||s(i)):void o(t,n)})}}var a=this;if(!r)return f.asPromise(e,a,i);var h=r===n,c=0;return f.isString(i)&&(i=[i]),i.forEach(function(t){u(a.resolvePath("",t))}),h?a:void(c||s(null,a))},u.loadSync=function(t){return this.load(t,n)},u.e=function(t){var e=this.deferred.slice();this.deferred=[];for(var i=0;i-1&&this.deferred.splice(e,1)}t.extensionField&&(t.extensionField.parent.remove(t.extensionField),t.extensionField=null)}else if(t instanceof o)for(var i=t.getNestedArray(),r=0;r0)return m.shift();if(w)return i();var r,o,u;do{if(v===y)return null;for(r=!1;/\s/.test(u=n(v));)if(u===a&&++g,++v===y)return null;if(n(v)===f){if(++v===y)throw e("comment");if(n(v)===f){for(;n(++v)!==a;)if(v===y)return null;++v,++g,r=!0}else{if((u=n(v))!==l)return f;do{if(u===a&&++g,++v===y)return null;o=u,u=n(v)}while(o!==l||u!==f);++v,r=!0}}}while(r);if(v===y)return null;var h=v;s.lastIndex=0;var c=s.test(n(h++));if(!c)for(;h]/g,o=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,u=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,a="\n",f="/",l="*"},{}],23:[function(t,e,i){"use strict";function r(t,e){s.call(this,t,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.j=null,this.k=null,this.l=null,this.m=null,this.n=null}function n(t){return t.j=t.k=t.m=t.n=null,delete t.encode,delete t.decode,t}e.exports=r;var s=t(13),o=s.prototype,u=s.extend(r),a=t(8),f=t(15),l=t(9),h=t(21),c=t(2),d=t(11),p=t(17),v=t(30),y=t(25),g=t(3);y.props(u,{fieldsById:{get:function(){if(this.j)return this.j;this.j={};for(var t=Object.keys(this.fields),e=0;e0?e.splice(--n,2):i?e.splice(n,1):++n:"."===e[n]?e.splice(n,1):++n;return r+e.join("/")}var util=exports;util.isString=isString,util.isObject=function(t){return Boolean(t&&"object"==typeof t)},util.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},util.toArray=function(t){if(!t)return[];for(var e=Object.keys(t),i=e.length,r=new Array(i),n=0;n>>0,n=(t-i)/4294967296>>>0;return e&&(n=~n>>>0,i=~i>>>0,++i>4294967295&&(i=0,++n>4294967295&&(n=0))),new r(i,n)},r.from=function(t){switch(typeof t){case"number":return r.fromNumber(t);case"string":t=n.Long.fromString(t)}return(t.low||t.high)&&new r(t.low>>>0,t.high>>>0)||o},s.toNumber=function(t){return!t&&this.hi>>>31?(this.lo=~this.lo+1>>>0,this.hi=~this.hi>>>0,this.lo||(this.hi=this.hi+1>>>0),-(this.lo+4294967296*this.hi)):this.lo+4294967296*this.hi},s.toLong=function(t){return new n.Long(this.lo,this.hi,t)};var u=String.prototype.charCodeAt;r.fromHash=function(t){return new r((u.call(t,0)|u.call(t,1)<<8|u.call(t,2)<<16|u.call(t,3)<<24)>>>0,(u.call(t,4)|u.call(t,5)<<8|u.call(t,6)<<16|u.call(t,7)<<24)>>>0)},s.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24&255,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24&255)},s.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},s.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},s.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===e?t<16384?t<128?1:2:t<1<<21?3:4:e<16384?e<128?5:6:e<1<<21?7:8:i<128?9:10}},{25:25}],28:[function(t,e,i){"use strict";function r(t,e,i){var r=i||8192,n=r>>>1,s=null,o=r;return function(i){if(i>n)return t(i);o+i>r&&(s=t(r),o=0);var u=e.call(s,o,o+=i);return 7&o&&(o=(7|o)+1),u}}e.exports=r},{}],29:[function(t,e,i){(function(e){"use strict";var r=i,n=r.LongBits=t(27);r.pool=t(28);var s=r.isNode=Boolean(e.process&&e.process.versions&&e.process.versions.node);if(r.Buffer=null,s)try{r.Buffer=t("buffer").Buffer}catch(t){}if(r.Long=e.dcodeIO&&e.dcodeIO.Long||null,!r.Long&&s)try{r.Long=t("long")}catch(t){}r.longToHash=function(t){return t?n.from(t).toHash():"\0\0\0\0\0\0\0\0"},r.longFromHash=function(t,e){var i=n.fromHash(t);return r.Long?r.Long.fromBits(i.lo,i.hi,e):i.toNumber(Boolean(e))},r.longNeq=function(t,e){return"number"==typeof t?"number"==typeof e?t!==e:(t=n.fromNumber(t)).lo!==e.low||t.hi!==e.high:"number"==typeof e?(e=n.fromNumber(e)).lo!==t.low||e.hi!==t.high:t.low!==e.low||t.high!==e.high},r.props=function(t,e){Object.keys(e).forEach(function(i){r.prop(t,i,e[i])})},r.prop=function(t,e,i){var r=!-[1],n=e.substring(0,1).toUpperCase()+e.substring(1);i.get&&(t["get"+n]=i.get),i.set&&(t["set"+n]=r?function(t){i.set.call(this,t),this[e]=t}:i.set),r?void 0!==i.value&&(t[e]=i.value):Object.defineProperty(t,e,i)},r.emptyArray=Object.freeze([]),r.emptyObject=Object.freeze({})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{27:27,28:28,buffer:"buffer",long:"long"}],30:[function(t,e,i){"use strict";function r(t,e,i){this.fn=t,this.val=e,this.len=i,this.next=null}function n(){}function s(t,e){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=e}function o(){this.len=0,this.head=new r(n,0,0),this.tail=this.head,this.states=null}function u(t,e,i){t[e]=255&i}function a(t,e,i){for(;i>127;)t[e++]=127&i|128,i>>>=7;t[e]=i}function f(t,e,i){for(;i.hi;)t[e++]=127&i.lo|128,i.lo=(i.lo>>>7|i.hi<<25)>>>0,i.hi>>>=7;for(;i.lo>127;)t[e++]=127&i.lo|128,i.lo=i.lo>>>7;t[e++]=i.lo}function l(t,e,i){t[e++]=255&i,t[e++]=i>>>8&255,t[e++]=i>>>16&255,t[e]=i>>>24}function h(t,e,i){for(var r=0;r>6|192,t[e++]=63&s|128):55296===(64512&s)&&56320===(64512&(n=i.charCodeAt(r+1)))?(s=65536+((1023&s)<<10)+(1023&n),++r,t[e++]=s>>18|240,t[e++]=s>>12&63|128,t[e++]=s>>6&63|128,t[e++]=63&s|128):(t[e++]=s>>12|224,t[e++]=s>>6&63|128,t[e++]=63&s|128)}}function c(t){for(var e=t.length>>>0,i=0,r=0;r>>=0,t<128?this.push(u,1,t):this.push(a,t<16384?2:t<2097152?3:t<268435456?4:5,t)},k.int32=function(t){return t<0?this.push(f,10,w.fromNumber(t)):this.uint32(t)},k.sint32=function(t){return this.uint32(t<<1^t>>31)},k.uint64=function(t){var e=w.from(t);return this.push(f,e.length(),e)},k.int64=k.uint64,k.sint64=function(t){var e=w.from(t).zzEncode();return this.push(f,e.length(),e)},k.bool=function(t){return this.push(u,1,t?1:0)},k.fixed32=function(t){return this.push(l,4,t>>>0)},k.sfixed32=function(t){return this.push(l,4,t<<1^t>>31)},k.fixed64=function(t){var e=w.from(t);return this.push(l,4,e.hi).push(l,4,e.lo)},k.sfixed64=function(t){var e=w.from(t).zzEncode();return this.push(l,4,e.hi).push(l,4,e.lo)};var x="undefined"!=typeof Float32Array?function(){var t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[3]?function(i,r,n){t[0]=n,i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r]=e[3]}:function(i,r,n){t[0]=n,i[r++]=e[3],i[r++]=e[2],i[r++]=e[1],i[r]=e[0]}}():function(t,e,i){m.write(t,i,e,!1,23,4)};k.float=function(t){return this.push(x,4,t)};var O="undefined"!=typeof Float64Array?function(){var t=new Float64Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[7]?function(i,r,n){t[0]=n,i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r++]=e[3],i[r++]=e[4],i[r++]=e[5],i[r++]=e[6],i[r]=e[7]}:function(i,r,n){t[0]=n,i[r++]=e[7],i[r++]=e[6],i[r++]=e[5],i[r++]=e[4],i[r++]=e[3],i[r++]=e[2],i[r++]=e[1],i[r]=e[0]}}():function(t,e,i){m.write(t,i,e,!1,52,8)};k.double=function(t){return this.push(O,8,t)};var A=b.prototype.set?function(t,e,i){t.set(i,e)}:function(t,e,i){for(var r=0;r>>0;return e?this.uint32(e).push(A,e,t):this.push(u,1,0)},k.string=function(t){var e=c(t);return e?this.uint32(e).push(h,e,t):this.push(u,1,0)},k.fork=function(){return this.states=new s(this,this.states),this.head=this.tail=new r(n,0,0),this.len=0,this},k.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 r(n,0,0),this.len=0),this},k.ldelim=function(t){var e=this.head,i=this.tail,r=this.len;return this.reset(),void 0!==t&&this.tag(t,2),this.uint32(r),this.tail.next=e.next,this.tail=i,this.len+=r,this},k.finish=function(){var t=this.head.next,e=this.constructor.alloc(this.len);this.reset();for(var i=0;t;)t.fn(e,i,t.val),i+=t.len,t=t.next;return e},d.alloc=function(t){return d.alloc=g.Buffer.allocUnsafe?g.Buffer.allocUnsafe:function(t){return new g.Buffer(t)},d.alloc(t)};var N=d.prototype=Object.create(o.prototype);N.constructor=d,"undefined"==typeof Float32Array&&(N.float=function(t){return this.push(p,4,t)}),"undefined"==typeof Float64Array&&(N.double=function(t){return this.push(v,8,t)}),b.prototype.set&&g.Buffer&&g.Buffer.prototype.set||(N.bytes=function(t){var e=t.length>>>0;return e?this.uint32(e).push(y,e,t):this.push(u,1,0)});var S=function(){return g.Buffer&&g.Buffer.prototype.utf8Write?function(t,e,i){i.length<40?h(t,e,i):t.utf8Write(i,e)}:function(t,e,i){i.length<40?h(t,e,i):t.write(i,e)}}();N.string=function(t){var e=t.length<40?c(t):g.Buffer.byteLength(t);return e?this.uint32(e).push(S,e,t):this.push(u,1,0)}},{1:1,29:29}],31:[function(t,e,i){(function(e){"use strict";function r(t,e,i){return"function"==typeof e?(i=e,e=new s.Root):e||(e=new s.Root),e.load(t,i)}function n(t,e){return e||(e=new s.Root),e.loadSync(t)}var s=e.protobuf=i;s.load=r,s.loadSync=n,s.tokenize=t(22),s.parse=t(16),s.Writer=t(30),s.BufferWriter=s.Writer.BufferWriter,s.Reader=t(17),s.BufferReader=s.Reader.BufferReader,s.codegen=t(3),s.ReflectionObject=t(14),s.Namespace=t(13),s.Root=t(18),s.Enum=t(8),s.Type=t(23),s.Field=t(9),s.OneOf=t(15),s.MapField=t(10),s.Service=t(21),s.Method=t(12),s.Class=t(2),s.Message=t(11),s.types=t(24),s.common=t(7),s.rpc=t(19),s.util=t(25),"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&(s.util.Long=t,s.Reader.configure()),s})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,2:2,21:21,22:22,23:23,24:24,25:25,3:3,30:30,7:7,8:8,9:9}]},{},[31]); //# sourceMappingURL=protobuf.min.js.map diff --git a/dist/protobuf.min.js.gz b/dist/protobuf.min.js.gz index e19b34f67..d4999bad3 100644 Binary files a/dist/protobuf.min.js.gz and b/dist/protobuf.min.js.gz differ diff --git a/dist/protobuf.min.js.map b/dist/protobuf.min.js.map index 1244c4ce4..8803ac09a 100644 --- a/dist/protobuf.min.js.map +++ b/dist/protobuf.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["node_modules/browser-pack/_prelude.js","lib/ieee754.js","src/codegen.js","src/codegen/decode.js","src/codegen/encode.js","src/codegen/verify.js","src/common.js","src/enum.js","src/field.js","src/inherits.js","src/mapfield.js","src/method.js","src/namespace.js","src/object.js","src/oneof.js","src/parse.js","src/prototype.js","src/reader.js","src/root.js","src/rpc.js","src/rpc/service.js","src/service.js","src/tokenize.js","src/type.js","src/types.js","src/util.js","src/util/eventemitter.js","src/util/longbits.js","src/util/pool.js","src/util/runtime.js","src/writer.js","src/index.js"],"names":["e","t","n","r","s","o","u","a","require","i","f","Error","code","l","exports","call","length","1","module","read","buffer","offset","isBE","mLen","nBytes","m","eLen","eMax","eBias","nBits","d","NaN","Infinity","Math","pow","write","value","c","rt","abs","isNaN","floor","log","LN2","codegen","gen","line","util","sprintf","apply","arguments","level","indent","src","prev","blockOpenRe","test","branchRe","casingRe","inCase","breakRe","blockCloseRe","index","push","str","name","replace","args","join","eof","scope","undefined","source","verbose","console","keys","Object","Function","concat","map","key","Array","prototype","slice","supported","encode","decode","verify","Enum","Reader","types","fallback","readerOrBuffer","fields","this","getFieldsById","reader","create","limit","len","pos","message","getCtor","tag","field","id","resolve","type","resolvedType","keyType","resolvedKeyType","uint32","ks","vs","basic","longToHash","repeated","values","packed","wireType","plimit","skipType","generate","mtype","getFieldsArray","prop","safeProp","Writer","writer","fi","fork","mapKey","ldelim","required","long","longNeq","defaultValue","reset","keyWireType","Type","getFullName","getValuesById","reason","hasReasonVar","toArray","j","common","json","nested","google","protobuf","Any","type_url","timeType","Duration","seconds","nanos","Timestamp","Empty","Struct","Value","oneofs","kind","oneof","nullValue","numberValue","stringValue","boolValue","structValue","listValue","NullValue","NULL_VALUE","ListValue","rule","options","ReflectionObject","_valuesById","clearCache","enm","EnumPrototype","extend","_TypeError","props","valuesById","get","forEach","testJSON","Boolean","fromJSON","toJSON","add","isString","isInteger","remove","Field","isObject","toString","toLowerCase","optional","partOf","Long","extensionField","declaringField","_packed","FieldPrototype","MapField","isPacked","getOption","setOption","ifNotSet","role","resolved","typeDefault","defaults","parent","lookup","optionDefault","fromValue","jsonConvert","String","Number","toNumber","charAt","inherits","clazz","classProperties","$type","noStatics","merge","encodeDelimited","decodeDelimited","defineProperties","Prototype","constructor","noRegister","setCtor","prototypeProperties","isArray","emptyArray","emptyObject","getOneofsArray","indexOf","set","MapFieldPrototype","Method","requestType","responseType","requestStream","responseStream","resolvedRequestType","resolvedResponseType","MethodPrototype","Namespace","_nestedArray","namespace","arrayToJSON","array","obj","NamespacePrototype","Service","nestedTypes","nestedError","ctor","nestedArray","methods","addJSON","getNestedArray","nestedJson","ns","nestedName","object","setOptions","onAdd","onRemove","define","path","split","ptr","part","shift","resolveAll","parentAlreadyChecked","getRoot","found","proto","Root","ReflectionObjectPrototype","root","fullName","unshift","_handleAdd","_handleRemove","OneOf","fieldNames","ucName","substring","toUpperCase","_fields","addFieldsToParent","OneOfPrototype","splice","lower","token","parse","illegal","tn","s_bclose","readString","next","s_dq","s_sq","skip","peek","readValue","acceptTypeRef","parseNumber","typeRefRe","readRange","start","parseId","end","s_semi","sign","tokenLower","parseInt","parseFloat","acceptNegative","parsePackage","pkg","s_name","parseImport","whichImports","weakImports","imports","parseSyntax","syntax","p3","isProto3","parseCommon","s_option","parseOption","parseType","parseEnum","parseService","parseExtension","nameRe","s_open","s_close","parseMapField","s_required","s_optional","s_repeated","parseField","parseOneOf","extensions","reserved","s_type","camelCase","parseInlineOptions","valueType","parseEnumField","custom","s_bopen","fqTypeRefRe","parseOptionValue","service","parseMethod","st","method","reference","tokenize","head","package","properties","asJSON","k","fieldsOnly","indexOutOfRange","writeLength","RangeError","configure","ReaderPrototype","int64","read_int64_long","uint64","read_uint64_long","sint64","read_sint64_long","fixed64","read_fixed64_long","sfixed64","read_sfixed64_long","read_int64_number","read_uint64_number","read_sint64_number","read_fixed64_number","read_sfixed64_number","buf","Tag","readLongVarint","lo","hi","b","LongBits","toLong","zzDecode","readLongFixed","BufferReader","initBufferReader","readStringBuffer_utf8Slice","utf8Slice","readStringBuffer_toString","ieee754","ArrayImpl","Uint8Array","Buffer","isBuffer","_slice","subarray","int32","octet","sint32","bool","fixed32","sfixed32","readFloat","Float32Array","f32","f8b","float","readDouble","Float64Array","f64","double","bytes","string","out","p","c1","fromCharCode","finish","remain","BufferReaderPrototype","readStringBuffer","readFloatLE","readDoubleLE","deferred","files","SYNC","handleExtension","extendedType","sisterField","RootPrototype","resolvePath","load","filename","callback","err","cb","process","JSON","parsed","self","fetch","sync","queued","weak","idx","altname","setTimeout","fs","readFileSync","asPromise","loadSync","newDeferred","rpc","rpcImpl","EventEmitter","$rpc","ServicePrototype","endedByRPC","emit","off","_methodsArray","methodsArray","methodName","inherited","getMethodsArray","requestDelimited","responseDelimited","rpcService","request","requestData","setImmediate","responseData","response","err2","unescape","$0","$1","subject","re","stringDelim","stringDoubleRe","stringSingleRe","lastIndex","match","exec","stack","repeat","curr","s_nl","s_sl","s_as","delimRe","delim","expected","actual","equals","_fieldsById","_fieldsArray","_repeatedFieldsArray","_oneofsArray","_ctor","TypePrototype","fieldsById","names","fieldsArray","repeatedFieldsArray","filter","oneofsArray","P","fieldName","oneOfName","fld","bake","fn","ctx","Promise","reject","onload","xhr","status","responseText","readFile","XMLHttpRequest","onreadystatechange","readyState","open","send","isAbsolutePath","normalizePath","parts","prefix","isFinite","description","TypeError","eval","originPath","importPath","alreadyNormalized","dst","format","params","param","stringify","underScore","newBuffer","size","allocUnsafe","_listeners","EventEmitterPrototype","on","evt","listeners","LongBitsPrototype","zero","zzEncode","fromNumber","from","fromString","low","high","unsigned","charCodeAt","fromHash","hash","toHash","mask","part0","part1","part2","pool","alloc","SIZE","MAX","slab","isNode","global","versions","node","dcodeIO","longFromHash","bits","fromBits","target","descriptors","descriptor","ie8","ucKey","defineProperty","freeze","Op","val","noop","State","tail","states","writeByte","writeVarint32","writeVarint64","writeFixed32","writeString","c2","byteLength","strlen","BufferWriter","writeFloatBuffer","writeFloatLE","writeDoubleBuffer","writeDoubleLE","writeBytesBuffer","copy","WriterPrototype","op","writeFloat","writeDouble","writeBytes","BufferWriterPrototype","writeStringBuffer","utf8Write","amd"],"mappings":";;;;;;CAAA,QAAAA,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAK,GAAA,GAAAC,OAAA,uBAAAN,EAAA,IAAA,MAAAK,GAAAE,KAAA,mBAAAF,EAAA,GAAAG,GAAAX,EAAAG,IAAAS,WAAAb,GAAAI,GAAA,GAAAU,KAAAF,EAAAC,QAAA,SAAAd,GAAA,GAAAE,GAAAD,EAAAI,GAAA,GAAAL,EAAA,OAAAI,GAAAF,EAAAA,EAAAF,IAAAa,EAAAA,EAAAC,QAAAd,EAAAC,EAAAC,EAAAC,GAAA,MAAAD,GAAAG,GAAAS,QAAA,IAA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ArDA,GAAAjT,GAAAgc,EAAAhc,SAAAxI,CAyCAwI,GAAAgT,KAAAA,EAeAhT,EAAAmU,SAAAA,EAGAnU,EAAA4N,SAAA1W,EAAA,IACA8I,EAAAyJ,MAAAvS,EAAA,IAGA8I,EAAAvB,OAAAvH,EAAA,IACA8I,EAAA4d,aAAA5d,EAAAvB,OAAAmf,aACA5d,EAAA7D,OAAAjF,EAAA,IACA8I,EAAAiQ,aAAAjQ,EAAA7D,OAAA8T,aACAjQ,EAAA1G,QAAApC,EAAA,GAGA8I,EAAAyB,iBAAAvK,EAAA,IACA8I,EAAAsG,UAAApP,EAAA,IACA8I,EAAAuI,KAAArR,EAAA,IACA8I,EAAA9D,KAAAhF,EAAA,GACA8I,EAAAX,KAAAnI,EAAA,IACA8I,EAAA4C,MAAA1L,EAAA,GACA8I,EAAA8I,MAAA5R,EAAA,IACA8I,EAAAuD,SAAArM,EAAA,IACA8I,EAAA6G,QAAA3P,EAAA,IACA8I,EAAA8F,OAAA5O,EAAA,IAGA8I,EAAAkF,UAAAhO,EAAA,IACA8I,EAAAyE,SAAAvN,EAAA,GAGA8I,EAAA5D,MAAAlF,EAAA,IACA8I,EAAAJ,OAAA1I,EAAA,GACA8I,EAAAqU,IAAAnd,EAAA,IACA8I,EAAAvG,KAAAvC,EAAA,IAGA,kBAAA0Q,SAAAA,OAAA+W,KACA/W,QAAA,QAAA,SAAA1E,GAKA,MAJAA,KACAlD,EAAAvG,KAAAyJ,KAAAA,EACAlD,EAAA7D,OAAAmS,aAEAtO","file":"protobuf.min.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o> 1,\r\n nBits = -7,\r\n i = isBE ? 0 : (nBytes - 1),\r\n d = isBE ? 1 : -1,\r\n s = buffer[offset + i];\r\n\r\n i += d;\r\n\r\n e = s & ((1 << (-nBits)) - 1);\r\n s >>= (-nBits);\r\n nBits += eLen;\r\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n m = e & ((1 << (-nBits)) - 1);\r\n e >>= (-nBits);\r\n nBits += mLen;\r\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n if (e === 0) {\r\n e = 1 - eBias;\r\n } else if (e === eMax) {\r\n return m ? NaN : ((s ? -1 : 1) * Infinity);\r\n } else {\r\n m = m + Math.pow(2, mLen);\r\n e = e - eBias;\r\n }\r\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen);\r\n};\r\n\r\nexports.write = function writeIEEE754(buffer, value, offset, isBE, mLen, nBytes) {\r\n var e, m, c,\r\n eLen = nBytes * 8 - mLen - 1,\r\n eMax = (1 << eLen) - 1,\r\n eBias = eMax >> 1,\r\n rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),\r\n i = isBE ? (nBytes - 1) : 0,\r\n d = isBE ? -1 : 1,\r\n s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;\r\n\r\n value = Math.abs(value);\r\n\r\n if (isNaN(value) || value === Infinity) {\r\n m = isNaN(value) ? 1 : 0;\r\n e = eMax;\r\n } else {\r\n e = Math.floor(Math.log(value) / Math.LN2);\r\n if (value * (c = Math.pow(2, -e)) < 1) {\r\n e--;\r\n c *= 2;\r\n }\r\n if (e + eBias >= 1) {\r\n value += rt / c;\r\n } else {\r\n value += rt * Math.pow(2, 1 - eBias);\r\n }\r\n if (value * c >= 2) {\r\n e++;\r\n c /= 2;\r\n }\r\n\r\n if (e + eBias >= eMax) {\r\n m = 0;\r\n e = eMax;\r\n } else if (e + eBias >= 1) {\r\n m = (value * c - 1) * Math.pow(2, mLen);\r\n e = e + eBias;\r\n } else {\r\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\r\n e = 0;\r\n }\r\n }\r\n\r\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);\r\n\r\n e = (e << mLen) | m;\r\n eLen += mLen;\r\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);\r\n\r\n buffer[offset + i - d] |= s * 128;\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\nvar util = require(25);\r\n\r\nvar blockOpenRe = /[{[]$/,\r\n blockCloseRe = /^[}\\]]/,\r\n casingRe = /:$/,\r\n branchRe = /^\\s*(?:if|else if|while|for)\\b|\\b(?:else)\\s*$/,\r\n breakRe = /\\b(?:break|continue);?$|^\\s*return\\b/;\r\n\r\n/**\r\n * A closure for generating functions programmatically.\r\n * @namespace\r\n * @function\r\n * @param {...string} params Function parameter names\r\n * @returns {CodegenInstance} Codegen instance\r\n * @property {boolean} supported Whether code generation is supported by the environment.\r\n * @property {boolean} verbose=false When set to true, codegen will log generated code to console. Useful for debugging.\r\n */\r\nfunction codegen() {\r\n var args = Array.prototype.slice.call(arguments),\r\n src = ['\\t\"use strict\"'],\r\n indent = 1,\r\n inCase = false;\r\n\r\n /**\r\n * A codegen instance as returned by {@link codegen}, that also is a {@link util.sprintf|sprintf}-like appender function.\r\n * @typedef CodegenInstance\r\n * @type {function}\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {CodegenInstance} Itself\r\n * @property {function(string=):string} str Stringifies the so far generated function source.\r\n * @property {function(string=, Object=):function} eof Ends generation and builds the function whilst applying a scope.\r\n */\r\n /**/\r\n function gen() {\r\n var line = util.sprintf.apply(null, arguments);\r\n var level = indent;\r\n if (src.length) {\r\n var prev = src[src.length - 1];\r\n\r\n // block open or one time branch\r\n if (blockOpenRe.test(prev))\r\n level = ++indent; // keep\r\n else if (branchRe.test(prev))\r\n ++level; // once\r\n \r\n // casing\r\n if (casingRe.test(prev) && !casingRe.test(line)) {\r\n level = ++indent;\r\n inCase = true;\r\n } else if (inCase && breakRe.test(prev)) {\r\n level = --indent;\r\n inCase = false;\r\n }\r\n\r\n // block close\r\n if (blockCloseRe.test(line))\r\n level = --indent;\r\n }\r\n for (var index = 0; index < level; ++index)\r\n line = \"\\t\" + line;\r\n src.push(line);\r\n return gen;\r\n }\r\n\r\n /**\r\n * Stringifies the so far generated function source.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @returns {string} Function source using tabs for indentation\r\n * @inner\r\n */\r\n function str(name) {\r\n return \"function \" + (name ? name.replace(/[^\\w_$]/g, \"_\") : \"\") + \"(\" + args.join(\", \") + \") {\\n\" + src.join(\"\\n\") + \"\\n}\";\r\n }\r\n\r\n gen.str = str;\r\n\r\n /**\r\n * Ends generation and builds the function whilst applying a scope.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @param {Object} [scope] Function scope\r\n * @returns {function} The generated function, with scope applied if specified\r\n * @inner\r\n */\r\n function eof(name, scope) {\r\n if (typeof name === 'object') {\r\n scope = name;\r\n name = undefined;\r\n }\r\n var source = gen.str(name);\r\n if (codegen.verbose)\r\n console.log(\"--- codegen ---\\n\" + source.replace(/^/mg, \"> \").replace(/\\t/g, \" \")); // eslint-disable-line no-console\r\n var keys = Object.keys(scope || (scope = {}));\r\n return Function.apply(null, keys.concat(\"return \" + source)).apply(null, keys.map(function(key) { return scope[key]; })); // eslint-disable-line no-new-func\r\n // ^ Creates a wrapper function with the scoped variable names as its parameters,\r\n // calls it with the respective scoped variable values ^\r\n // and returns our brand-new properly scoped function.\r\n //\r\n // This works because \"Invoking the Function constructor as a function (without using the\r\n // new operator) has the same effect as invoking it as a constructor.\"\r\n // https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Function\r\n }\r\n\r\n gen.eof = eof;\r\n\r\n return gen;\r\n}\r\n\r\ncodegen.supported = false; try { codegen.supported = codegen(\"a\",\"b\")(\"return a-b\").eof()(2,1) === 1; } catch (e) {} // eslint-disable-line no-empty\r\ncodegen.verbose = false;\r\n\r\ncodegen.encode = require(4);\r\ncodegen.decode = require(3);\r\ncodegen.verify = require(5);\r\n","\"use strict\";\r\n\r\n/**\r\n * Wire format decoder using code generation on top of reflection that also provides a fallback.\r\n * @exports codegen.decode\r\n * @namespace\r\n */\r\nvar decode = exports;\r\n\r\nvar Enum = require(7),\r\n Reader = require(17),\r\n types = require(24),\r\n util = require(25),\r\n codegen = require(2);\r\n\r\n/**\r\n * Decodes a message of `this` message's type.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Prototype} Populated runtime message\r\n * @this Type\r\n */\r\ndecode.fallback = function decode_fallback(readerOrBuffer, length) {\r\n /* eslint-disable no-invalid-this, block-scoped-var, no-redeclare */\r\n var fields = this.getFieldsById(),\r\n reader = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer),\r\n limit = length === undefined ? reader.len : reader.pos + length,\r\n message = new (this.getCtor())();\r\n while (reader.pos < limit) {\r\n var tag = reader.tag(),\r\n field = fields[tag.id].resolve(),\r\n type = field.resolvedType instanceof Enum ? \"uint32\" : field.type;\r\n \r\n // Known fields\r\n if (field) {\r\n\r\n // Map fields\r\n if (field.map) {\r\n var keyType = field.resolvedKeyType /* only valid is enum */ ? \"uint32\" : field.keyType,\r\n length = reader.uint32();\r\n var map = message[field.name] = {};\r\n if (length) {\r\n length += reader.pos;\r\n var ks = [], vs = [];\r\n while (reader.pos < length) {\r\n if (reader.tag().id === 1)\r\n ks[ks.length] = reader[keyType]();\r\n else if (types.basic[type] !== undefined)\r\n vs[vs.length] = reader[type]();\r\n else\r\n vs[vs.length] = field.resolvedType.decode(reader, reader.uint32());\r\n }\r\n for (var i = 0; i < ks.length; ++i)\r\n map[typeof ks[i] === 'object' ? util.longToHash(ks[i]) : ks[i]] = vs[i];\r\n }\r\n\r\n // Repeated fields\r\n } else if (field.repeated) {\r\n var values = message[field.name] && message[field.name].length ? message[field.name] : message[field.name] = [];\r\n\r\n // Packed\r\n if (field.packed && types.packed[type] !== undefined && tag.wireType === 2) {\r\n var plimit = reader.uint32() + reader.pos;\r\n while (reader.pos < plimit)\r\n values[values.length] = reader[type]();\r\n\r\n // Non-packed\r\n } else if (types.basic[type] !== undefined)\r\n values[values.length] = reader[type]();\r\n else\r\n values[values.length] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Non-repeated\r\n } else if (types.basic[type] !== undefined)\r\n message[field.name] = reader[type]();\r\n else\r\n message[field.name] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Unknown fields\r\n } else\r\n reader.skipType(tag.wireType);\r\n }\r\n return message;\r\n /* eslint-enable no-invalid-this, block-scoped-var, no-redeclare */\r\n};\r\n\r\n/**\r\n * Generates a decoder specific to the specified message type, with an identical signature to {@link codegen.decode.fallback}.\r\n * @param {Type} mtype Message type\r\n * @returns {CodegenInstance} {@link codegen|Codegen} instance\r\n */\r\ndecode.generate = function decode_generate(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n var fields = mtype.getFieldsArray(); \r\n var gen = codegen(\"r\", \"l\")\r\n\r\n (\"r instanceof Reader||(r=Reader.create(r))\")\r\n (\"var c=l===undefined?r.len:r.pos+l,m=new(this.getCtor())\")\r\n (\"while(r.pos} [values] Enum values as an object, by name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Enum(name, values, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Enum values by name.\r\n * @type {Object.}\r\n */\r\n this.values = values || {}; // toJSON, marker\r\n\r\n /**\r\n * Cached values by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._valuesById = null;\r\n}\r\n\r\nutil.props(EnumPrototype, {\r\n\r\n /**\r\n * Enum values by id.\r\n * @name Enum#valuesById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n valuesById: {\r\n get: function getValuesById() {\r\n if (!this._valuesById) {\r\n this._valuesById = {};\r\n Object.keys(this.values).forEach(function(name) {\r\n var id = this.values[name];\r\n if (this._valuesById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._valuesById[id] = name;\r\n }, this);\r\n }\r\n return this._valuesById;\r\n }\r\n }\r\n\r\n /**\r\n * Gets this enum's values by id. This is an alias of {@link Enum#valuesById}'s getter for use within non-ES5 environments.\r\n * @name Enum#getValuesById\r\n * @function\r\n * @returns {Object.}\r\n */\r\n});\r\n\r\nfunction clearCache(enm) {\r\n enm._valuesById = null;\r\n return enm;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes an enum.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes an enum\r\n */\r\nEnum.testJSON = function testJSON(json) {\r\n return Boolean(json && json.values);\r\n};\r\n\r\n/**\r\n * Creates an enum from JSON.\r\n * @param {string} name Enum name\r\n * @param {Object.} json JSON object\r\n * @returns {Enum} Created enum\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nEnum.fromJSON = function fromJSON(name, json) {\r\n return new Enum(name, json.values, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nEnumPrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n values : this.values\r\n };\r\n};\r\n\r\n/**\r\n * Adds a value to this enum.\r\n * @param {string} name Value name\r\n * @param {number} id Value id\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a value with this name or id\r\n */\r\nEnumPrototype.add = function(name, id) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (this.values[name] !== undefined)\r\n throw Error('duplicate name \"' + name + '\" in ' + this);\r\n if (this.getValuesById()[id] !== undefined)\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this.values[name] = id;\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a value from this enum\r\n * @param {string} name Value name\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `name` is not a name of this enum\r\n */\r\nEnumPrototype.remove = function(name) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (this.values[name] === undefined)\r\n throw Error('\"' + name + '\" is not a name of ' + this);\r\n delete this.values[name];\r\n return clearCache(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Field;\r\n\r\nvar ReflectionObject = require(13);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = ReflectionObject.extend(Field);\r\n\r\nvar Type = require(23),\r\n Enum = require(7),\r\n MapField = require(10),\r\n types = require(24),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new message field. Note that {@link MapField|map fields} have their own class.\r\n * @classdesc Reflected message field.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object} [rule=\"optional\"] Field rule\r\n * @param {string|Object} [extend] Extended type if different from parent\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Field(name, id, type, rule, extend, options) {\r\n if (util.isObject(rule)) {\r\n options = rule;\r\n rule = extend = undefined;\r\n } else if (util.isObject(extend)) {\r\n options = extend;\r\n extend = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (!util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (extend !== undefined && !util.isString(extend))\r\n throw _TypeError(\"extend\");\r\n if (rule !== undefined && !/^required|optional|repeated$/.test(rule = rule.toString().toLowerCase()))\r\n throw _TypeError(\"rule\", \"a valid rule string\");\r\n\r\n /**\r\n * Field rule, if any.\r\n * @type {string|undefined}\r\n */\r\n this.rule = rule && rule !== 'optional' ? rule : undefined; // toJSON\r\n\r\n /**\r\n * Field type.\r\n * @type {string}\r\n */\r\n this.type = type; // toJSON\r\n\r\n /**\r\n * Unique field id.\r\n * @type {number}\r\n */\r\n this.id = id; // toJSON, marker\r\n\r\n /**\r\n * Extended type if different from parent.\r\n * @type {string|undefined}\r\n */\r\n this.extend = extend || undefined; // toJSON\r\n\r\n /**\r\n * Whether this field is required.\r\n * @type {boolean}\r\n */\r\n this.required = rule === \"required\";\r\n\r\n /**\r\n * Whether this field is optional.\r\n * @type {boolean}\r\n */\r\n this.optional = !this.required;\r\n\r\n /**\r\n * Whether this field is repeated.\r\n * @type {boolean}\r\n */\r\n this.repeated = rule === \"repeated\";\r\n\r\n /**\r\n * Whether this field is a map or not.\r\n * @type {boolean}\r\n */\r\n this.map = false;\r\n\r\n /**\r\n * Message this field belongs to.\r\n * @type {?Type}\r\n */\r\n this.message = null;\r\n\r\n /**\r\n * OneOf this field belongs to, if any,\r\n * @type {?OneOf}\r\n */\r\n this.partOf = null;\r\n\r\n /**\r\n * The field's default value. Only relevant when working with proto2.\r\n * @type {*}\r\n */\r\n this.defaultValue = null;\r\n\r\n /**\r\n * Whether this field's value should be treated as a long.\r\n * @type {boolean}\r\n */\r\n this.long = util.Long ? types.long[type] !== undefined : false;\r\n\r\n /**\r\n * Resolved type if not a basic type.\r\n * @type {?(Type|Enum)}\r\n */\r\n this.resolvedType = null;\r\n\r\n /**\r\n * Sister-field within the extended type if a declaring extension field.\r\n * @type {?Field}\r\n */\r\n this.extensionField = null;\r\n\r\n /**\r\n * Sister-field within the declaring namespace if an extended field.\r\n * @type {?Field}\r\n */\r\n this.declaringField = null;\r\n\r\n /**\r\n * Internally remembers whether this field is packed.\r\n * @type {?boolean}\r\n * @private\r\n */\r\n this._packed = null;\r\n}\r\n\r\nutil.props(FieldPrototype, {\r\n\r\n /**\r\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\r\n * @name Field#packed\r\n * @type {boolean}\r\n * @readonly\r\n */\r\n packed: {\r\n get: FieldPrototype.isPacked = function() {\r\n if (this._packed === null)\r\n this._packed = this.getOption(\"packed\") !== false;\r\n return this._packed;\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether this field is packed. This is an alias of {@link Field#packed}'s getter for use within non-ES5 environments.\r\n * @name Field#isPacked\r\n * @function\r\n * @returns {boolean}\r\n */\r\n});\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (name === \"packed\")\r\n this._packed = null;\r\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\r\n};\r\n\r\n/**\r\n * Tests if the specified JSON object describes a field.\r\n * @param {*} json Any JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nField.testJSON = function testJSON(json) {\r\n return Boolean(json && json.id !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {Field} Created field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nField.fromJSON = function fromJSON(name, json) {\r\n if (json.keyType !== undefined)\r\n return MapField.fromJSON(name, json);\r\n return new Field(name, json.id, json.type, json.role, json.extend, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n rule : this.rule !== \"optional\" && this.rule || undefined,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Resolves this field's type references.\r\n * @returns {Field} `this`\r\n * @throws {Error} If any reference cannot be resolved\r\n */\r\nFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n\r\n var typeDefault = types.defaults[this.type];\r\n\r\n // if not a basic type, resolve it\r\n if (typeDefault === undefined) {\r\n var resolved = this.parent.lookup(this.type);\r\n if (resolved instanceof Type) {\r\n this.resolvedType = resolved;\r\n typeDefault = null;\r\n } else if (resolved instanceof Enum) {\r\n this.resolvedType = resolved;\r\n typeDefault = 0;\r\n } else\r\n throw Error(\"unresolvable field type: \" + this.type);\r\n }\r\n\r\n // when everything is resolved determine the default value\r\n var optionDefault;\r\n if (this.map)\r\n this.defaultValue = {};\r\n else if (this.repeated)\r\n this.defaultValue = [];\r\n else if (this.options && (optionDefault = this.options['default']) !== undefined) // eslint-disable-line dot-notation\r\n this.defaultValue = optionDefault;\r\n else\r\n this.defaultValue = typeDefault;\r\n\r\n if (this.long)\r\n this.defaultValue = util.Long.fromValue(this.defaultValue);\r\n \r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Converts a field value to JSON using the specified options. Note that this method does not account for repeated fields and must be called once for each repeated element instead.\r\n * @param {*} value Field value\r\n * @param {Object.} [options] Conversion options\r\n * @returns {*} Converted value\r\n * @see {@link Prototype#asJSON}\r\n */\r\nFieldPrototype.jsonConvert = function(value, options) {\r\n if (options) {\r\n if (this.resolvedType instanceof Enum && options['enum'] === String) // eslint-disable-line dot-notation\r\n return this.resolvedType.getValuesById()[value];\r\n else if (this.long && options.long)\r\n return options.long === Number\r\n ? typeof value === 'number'\r\n ? value\r\n : util.Long.fromValue(value).toNumber()\r\n : util.Long.fromValue(value, this.type.charAt(0) === 'u').toString();\r\n }\r\n return value;\r\n};\r\n","\"use strict\";\r\nmodule.exports = inherits;\r\n\r\nvar Prototype = require(16),\r\n Type = require(23),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Options passed to {@link inherits}, modifying its behavior.\r\n * @typedef InheritanceOptions\r\n * @type {Object}\r\n * @property {boolean} [noStatics=false] Skips adding the default static methods on top of the constructor\r\n * @property {boolean} [noRegister=false] Skips registering the constructor with the reflected type\r\n */\r\n\r\n/**\r\n * Inherits a custom class from the message prototype of the specified message type.\r\n * @param {*} clazz Inheriting class constructor\r\n * @param {Type} type Inherited message type\r\n * @param {InheritanceOptions} [options] Inheritance options\r\n * @returns {Prototype} Created prototype\r\n */\r\nfunction inherits(clazz, type, options) {\r\n if (typeof clazz !== 'function')\r\n throw _TypeError(\"clazz\", \"a function\");\r\n if (!(type instanceof Type))\r\n throw _TypeError(\"type\", \"a Type\");\r\n if (!options)\r\n options = {};\r\n\r\n /**\r\n * This is not an actual type but stands as a reference for any constructor of a custom message class that you pass to the library.\r\n * @name Class\r\n * @extends Prototype\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set on the message\r\n * @see {@link inherits}\r\n */\r\n\r\n var classProperties = {\r\n\r\n /**\r\n * Reference to the reflected type.\r\n * @name Class.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n $type: {\r\n value: type\r\n }\r\n };\r\n\r\n if (!options.noStatics)\r\n util.merge(classProperties, {\r\n\r\n /**\r\n * Encodes a message of this type to a buffer.\r\n * @name Class.encode\r\n * @function\r\n * @param {Prototype|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n encode: {\r\n value: function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n }\r\n },\r\n\r\n /**\r\n * Encodes a message of this type preceeded by its length as a varint to a buffer.\r\n * @name Class.encodeDelimited\r\n * @function\r\n * @param {Prototype|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n encodeDelimited: {\r\n value: function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n }\r\n },\r\n\r\n /**\r\n * Decodes a message of this type from a buffer.\r\n * @name Class.decode\r\n * @function\r\n * @param {Uint8Array} buffer Buffer to decode\r\n * @returns {Prototype} Decoded message\r\n */\r\n decode: {\r\n value: function decode(buffer) {\r\n return this.$type.decode(buffer);\r\n }\r\n },\r\n\r\n /**\r\n * Decodes a message of this type preceeded by its length as a varint from a buffer.\r\n * @name Class.decodeDelimited\r\n * @function\r\n * @param {Uint8Array} buffer Buffer to decode\r\n * @returns {Prototype} Decoded message\r\n */\r\n decodeDelimited: {\r\n value: function decodeDelimited(buffer) {\r\n return this.$type.decodeDelimited(buffer);\r\n }\r\n },\r\n\r\n /**\r\n * Verifies a message of this type.\r\n * @name Class.verify\r\n * @function\r\n * @param {Prototype|Object} message Message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\n verify: {\r\n value: function verify(message) {\r\n return this.$type.verify(message);\r\n }\r\n }\r\n\r\n }, true);\r\n\r\n util.props(clazz, classProperties);\r\n var prototype = inherits.defineProperties(new Prototype(), type);\r\n clazz.prototype = prototype;\r\n prototype.constructor = clazz;\r\n\r\n if (!options.noRegister)\r\n type.setCtor(clazz);\r\n\r\n return prototype;\r\n}\r\n\r\n/**\r\n * Defines the reflected type's default values and virtual oneof properties on the specified prototype.\r\n * @memberof inherits\r\n * @param {Prototype} prototype Prototype to define properties upon\r\n * @param {Type} type Reflected message type\r\n * @returns {Prototype} The specified prototype\r\n */\r\ninherits.defineProperties = function defineProperties(prototype, type) {\r\n\r\n var prototypeProperties = {\r\n\r\n /**\r\n * Reference to the reflected type.\r\n * @name Prototype#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n $type: {\r\n value: type\r\n }\r\n };\r\n\r\n // Initialize default values\r\n type.getFieldsArray().forEach(function(field) {\r\n field.resolve();\r\n // objects on the prototype must be immmutable. users must assign a new object instance and\r\n // cannot use Array#push on empty arrays on the prototype for example, as this would modify\r\n // the value on the prototype for ALL messages of this type. Hence, these objects are frozen.\r\n prototype[field.name] = Array.isArray(field.defaultValue)\r\n ? util.emptyArray\r\n : util.isObject(field.defaultValue)\r\n ? util.emptyObject\r\n : field.defaultValue;\r\n });\r\n\r\n // Define each oneof with a non-enumerable getter and setter for the present field\r\n type.getOneofsArray().forEach(function(oneof) {\r\n util.prop(prototype, oneof.resolve().name, {\r\n get: function getVirtual() {\r\n // > If the parser encounters multiple members of the same oneof on the wire, only the last member seen is used in the parsed message.\r\n var keys = Object.keys(this);\r\n for (var i = keys.length - 1; i > -1; --i)\r\n if (oneof.oneof.indexOf(keys[i]) > -1)\r\n return keys[i];\r\n return undefined;\r\n },\r\n set: function setVirtual(value) {\r\n var keys = oneof.oneof;\r\n for (var i = 0; i < keys.length; ++i)\r\n if (keys[i] !== value)\r\n delete this[keys[i]];\r\n }\r\n });\r\n });\r\n\r\n util.props(prototype, prototypeProperties);\r\n return prototype;\r\n};\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\nvar Field = require(8);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = Field.prototype;\r\n/** @alias MapField.prototype */\r\nvar MapFieldPrototype = Field.extend(MapField);\r\n\r\nvar Enum = require(7),\r\n types = require(24),\r\n util = require(25);\r\n\r\n/**\r\n * Constructs a new map field.\r\n * @classdesc Reflected map field.\r\n * @extends Field\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} keyType Key type\r\n * @param {string} type Value type\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction MapField(name, id, keyType, type, options) {\r\n Field.call(this, name, id, type, options);\r\n if (!util.isString(keyType))\r\n throw util._TypeError(\"keyType\");\r\n \r\n /**\r\n * Key type.\r\n * @type {string}\r\n */\r\n this.keyType = keyType; // toJSON, marker\r\n\r\n /**\r\n * Resolved key type if not a basic type.\r\n * @type {?ReflectionObject}\r\n */\r\n this.resolvedKeyType = null;\r\n\r\n // Overrides Field#map\r\n this.map = true;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a map field.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nMapField.testJSON = function testJSON(json) {\r\n return Field.testJSON(json) && json.keyType !== undefined;\r\n};\r\n\r\n/**\r\n * Constructs a map field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created map field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMapField.fromJSON = function fromJSON(name, json) {\r\n return new MapField(name, json.id, json.keyType, json.type, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n keyType : this.keyType,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n \r\n // Besides a value type, map fields have a key type to resolve\r\n var keyWireType = types.mapKey[this.keyType];\r\n if (keyWireType === undefined) {\r\n var resolved = this.parent.lookup(this.keyType);\r\n if (!(resolved instanceof Enum))\r\n throw Error(\"unresolvable map key type: \" + this.keyType);\r\n this.resolvedKeyType = resolved;\r\n }\r\n\r\n return FieldPrototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Method;\r\n\r\nvar ReflectionObject = require(13);\r\n/** @alias Method.prototype */\r\nvar MethodPrototype = ReflectionObject.extend(Method);\r\n\r\nvar Type = require(23),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new service method.\r\n * @classdesc Reflected service method.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Method name\r\n * @param {string|undefined} type Method type, usually `\"rpc\"`\r\n * @param {string} requestType Request message type\r\n * @param {string} responseType Response message type\r\n * @param {boolean|Object} [requestStream] Whether the request is streamed\r\n * @param {boolean|Object} [responseStream] Whether the response is streamed\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options) {\r\n if (util.isObject(requestStream)) {\r\n options = requestStream;\r\n requestStream = responseStream = undefined;\r\n } else if (util.isObject(responseStream)) {\r\n options = responseStream;\r\n responseStream = undefined;\r\n }\r\n if (type && !util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (!util.isString(requestType))\r\n throw _TypeError(\"requestType\");\r\n if (!util.isString(responseType))\r\n throw _TypeError(\"responseType\");\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Method type.\r\n * @type {string}\r\n */\r\n this.type = type || \"rpc\"; // toJSON\r\n\r\n /**\r\n * Request type.\r\n * @type {string}\r\n */\r\n this.requestType = requestType; // toJSON, marker\r\n\r\n /**\r\n * Whether requests are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.requestStream = requestStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Response type.\r\n * @type {string}\r\n */\r\n this.responseType = responseType; // toJSON\r\n\r\n /**\r\n * Whether responses are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.responseStream = responseStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Resolved request type.\r\n * @type {?Type}\r\n */\r\n this.resolvedRequestType = null;\r\n\r\n /**\r\n * Resolved response type.\r\n * @type {?Type}\r\n */\r\n this.resolvedResponseType = null;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service method.\r\n * @param {Object} json JSON object\r\n * @returns {boolean} `true` if the object describes a map field\r\n */\r\nMethod.testJSON = function testJSON(json) {\r\n return Boolean(json && json.requestType !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a service method from JSON.\r\n * @param {string} name Method name\r\n * @param {Object} json JSON object\r\n * @returns {Method} Created method\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMethod.fromJSON = function fromJSON(name, json) {\r\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.toJSON = function toJSON() {\r\n return {\r\n type : this.type !== \"rpc\" && this.type || undefined,\r\n requestType : this.requestType,\r\n requestStream : this.requestStream,\r\n responseType : this.responseType,\r\n responseStream : this.responseStream,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var resolved = this.parent.lookup(this.requestType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable request type: \" + this.requestType);\r\n this.resolvedRequestType = resolved;\r\n resolved = this.parent.lookup(this.responseType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable response type: \" + this.requestType);\r\n this.resolvedResponseType = resolved;\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Namespace;\r\n\r\nvar ReflectionObject = require(13);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = ReflectionObject.extend(Namespace);\r\n\r\nvar Enum = require(7),\r\n Type = require(23),\r\n Field = require(8),\r\n Service = require(21),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\nvar nestedTypes = [ Enum, Type, Service, Field, Namespace ],\r\n nestedError = \"one of \" + nestedTypes.map(function(ctor) { return ctor.name; }).join(', ');\r\n\r\n/**\r\n * Constructs a new namespace.\r\n * @classdesc Reflected namespace and base class of all reflection objects containing nested objects.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Namespace(name, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Nested objects by name.\r\n * @type {Object.|undefined}\r\n */\r\n this.nested = undefined; // toJSON\r\n\r\n /**\r\n * Cached nested objects as an array.\r\n * @type {?ReflectionObject[]}\r\n * @private\r\n */\r\n this._nestedArray = null;\r\n}\r\n\r\nfunction clearCache(namespace) {\r\n namespace._nestedArray = null;\r\n return namespace;\r\n}\r\n\r\nutil.props(NamespacePrototype, {\r\n\r\n /**\r\n * Nested objects of this namespace as an array for iteration.\r\n * @name Namespace#nestedArray\r\n * @type {ReflectionObject[]}\r\n * @readonly\r\n */\r\n nestedArray: {\r\n get: function getNestedArray() {\r\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Tests if the specified JSON object describes not another reflection object.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes not another reflection object\r\n */\r\nNamespace.testJSON = function testJSON(json) {\r\n return Boolean(json\r\n && !json.fields // Type\r\n && !json.values // Enum\r\n && json.id === undefined // Field, MapField\r\n && !json.oneof // OneOf\r\n && !json.methods // Service\r\n && json.requestType === undefined // Method\r\n );\r\n};\r\n\r\n/**\r\n * Constructs a namespace from JSON.\r\n * @param {string} name Namespace name\r\n * @param {Object} json JSON object\r\n * @returns {Namespace} Created namespace\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nNamespace.fromJSON = function fromJSON(name, json) {\r\n return new Namespace(name, json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nNamespacePrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n nested : arrayToJSON(this.getNestedArray())\r\n };\r\n};\r\n\r\n/**\r\n * Converts an array of reflection objects to JSON.\r\n * @memberof Namespace\r\n * @param {ReflectionObject[]} array Object array\r\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\r\n */\r\nfunction arrayToJSON(array) {\r\n if (!(array && array.length))\r\n return undefined;\r\n var obj = {};\r\n for (var i = 0; i < array.length; ++i)\r\n obj[array[i].name] = array[i].toJSON();\r\n return obj;\r\n}\r\n\r\nNamespace.arrayToJSON = arrayToJSON;\r\n\r\n/**\r\n * Adds nested elements to this namespace from JSON.\r\n * @param {Object.} nestedJson Nested JSON\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.addJSON = function addJSON(nestedJson) {\r\n var ns = this;\r\n if (nestedJson)\r\n Object.keys(nestedJson).forEach(function(nestedName) {\r\n var nested = nestedJson[nestedName];\r\n for (var j = 0; j < nestedTypes.length; ++j)\r\n if (nestedTypes[j].testJSON(nested))\r\n return ns.add(nestedTypes[j].fromJSON(nestedName, nested));\r\n throw _TypeError(\"nested.\" + nestedName, \"JSON for \" + nestedError);\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets the nested object of the specified name.\r\n * @param {string} name Nested object name\r\n * @returns {?ReflectionObject} The reflection object or `null` if it doesn't exist\r\n */\r\nNamespacePrototype.get = function get(name) {\r\n if (this.nested === undefined) // prevents deopt\r\n return null;\r\n return this.nested[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this namespace.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name\r\n */\r\nNamespacePrototype.add = function add(object) {\r\n if (!object || nestedTypes.indexOf(object.constructor) < 0)\r\n throw _TypeError(\"object\", nestedError);\r\n if (object instanceof Field && object.extend === undefined)\r\n throw _TypeError(\"object\", \"an extension field when not part of a type\");\r\n if (!this.nested)\r\n this.nested = {};\r\n else {\r\n var prev = this.get(object.name);\r\n if (prev) {\r\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\r\n // replace plain namespace but keep existing nested elements and options\r\n var nested = prev.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i)\r\n object.add(nested[i]);\r\n this.remove(prev);\r\n if (!this.nested)\r\n this.nested = {};\r\n object.setOptions(prev.options, true);\r\n } else\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n }\r\n }\r\n this.nested[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this namespace.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this namespace\r\n */\r\nNamespacePrototype.remove = function remove(object) {\r\n if (!(object instanceof ReflectionObject))\r\n throw _TypeError(\"object\", \"a ReflectionObject\");\r\n if (object.parent !== this || !this.nested)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.nested[object.name];\r\n if (!Object.keys(this.nested).length)\r\n this.nested = undefined;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Defines additial namespaces within this one if not yet existing.\r\n * @param {string|string[]} path Path to create\r\n * @param {*} [json] Nested types to create from JSON\r\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\r\n */\r\nNamespacePrototype.define = function define(path, json) {\r\n if (util.isString(path))\r\n path = path.split('.');\r\n else if (!Array.isArray(path)) {\r\n json = path;\r\n path = undefined;\r\n }\r\n var ptr = this;\r\n if (path)\r\n while (path.length > 0) {\r\n var part = path.shift();\r\n if (ptr.nested && ptr.nested[part]) {\r\n ptr = ptr.nested[part];\r\n if (!(ptr instanceof Namespace))\r\n throw Error(\"path conflicts with non-namespace objects\");\r\n } else\r\n ptr.add(ptr = new Namespace(part));\r\n }\r\n if (json)\r\n ptr.addJSON(json);\r\n return ptr;\r\n};\r\n\r\n/**\r\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree.\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.resolveAll = function resolve() {\r\n var nested = this.getNestedArray(), i = 0;\r\n while (i < nested.length)\r\n if (nested[i] instanceof Namespace)\r\n nested[i++].resolveAll();\r\n else\r\n nested[i++].resolve();\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Looks up the reflection object at the specified path, relative to this namespace.\r\n * @param {string|string[]} path Path to look up\r\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\r\n * @returns {?ReflectionObject} Looked up object or `null` if none could be found\r\n */\r\nNamespacePrototype.lookup = function lookup(path, parentAlreadyChecked) {\r\n if (util.isString(path)) {\r\n if (!path.length)\r\n return null;\r\n path = path.split('.');\r\n } else if (!path.length)\r\n return null;\r\n // Start at root if path is absolute\r\n if (path[0] === \"\")\r\n return this.getRoot().lookup(path.slice(1));\r\n // Test if the first part matches any nested object, and if so, traverse if path contains more\r\n var found = this.get(path[0]);\r\n if (found && (path.length === 1 || found instanceof Namespace && (found = found.lookup(path.slice(1), true))))\r\n return found;\r\n // If there hasn't been a match, try again at the parent\r\n if (this.parent === null || parentAlreadyChecked)\r\n return null;\r\n return this.parent.lookup(path);\r\n};\r\n","\"use strict\";\r\nmodule.exports = ReflectionObject;\r\n\r\nReflectionObject.extend = extend;\r\n\r\nvar Root = require(18),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new reflection object.\r\n * @classdesc Base class of all reflection objects.\r\n * @constructor\r\n * @param {string} name Object name\r\n * @param {Object} [options] Declared options\r\n * @abstract\r\n */\r\nfunction ReflectionObject(name, options) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (options && !util.isObject(options))\r\n throw _TypeError(\"options\", \"an object\");\r\n\r\n /**\r\n * Options.\r\n * @type {Object.|undefined}\r\n */\r\n this.options = options; // toJSON\r\n\r\n /**\r\n * Unique name within its namespace.\r\n * @type {string}\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * Parent namespace.\r\n * @type {?Namespace}\r\n */\r\n this.parent = null;\r\n\r\n /**\r\n * Whether already resolved or not.\r\n * @type {boolean}\r\n */\r\n this.resolved = false;\r\n}\r\n\r\n/** @alias ReflectionObject.prototype */\r\nvar ReflectionObjectPrototype = ReflectionObject.prototype;\r\n\r\nutil.props(ReflectionObjectPrototype, {\r\n\r\n /**\r\n * Reference to the root namespace.\r\n * @name ReflectionObject#root\r\n * @type {Root}\r\n * @readonly\r\n */\r\n root: {\r\n get: function getRoot() {\r\n var ptr = this;\r\n while (ptr.parent !== null)\r\n ptr = ptr.parent;\r\n return ptr;\r\n }\r\n },\r\n\r\n /**\r\n * Full name including leading dot.\r\n * @name ReflectionObject#fullName\r\n * @type {string}\r\n * @readonly\r\n */\r\n fullName: {\r\n get: ReflectionObjectPrototype.getFullName = function getFullName() {\r\n var path = [ this.name ],\r\n ptr = this.parent;\r\n while (ptr) {\r\n path.unshift(ptr.name);\r\n ptr = ptr.parent;\r\n }\r\n return path.join('.');\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Lets the specified constructor extend this class.\r\n * @memberof ReflectionObject\r\n * @param {*} constructor Extending constructor\r\n * @returns {Object} Prototype\r\n * @this ReflectionObject\r\n */\r\nfunction extend(constructor) {\r\n var proto = constructor.prototype = Object.create(this.prototype);\r\n proto.constructor = constructor;\r\n constructor.extend = extend;\r\n return proto;\r\n}\r\n\r\n/**\r\n * Converts this reflection object to its JSON representation.\r\n * @returns {Object} JSON object\r\n * @abstract\r\n */\r\nReflectionObjectPrototype.toJSON = function toJSON() {\r\n throw Error(); // not implemented, shouldn't happen\r\n};\r\n\r\n/**\r\n * Called when this object is added to a parent.\r\n * @param {ReflectionObject} parent Parent added to\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onAdd = function onAdd(parent) {\r\n if (this.parent && this.parent !== parent)\r\n this.parent.remove(this);\r\n this.parent = parent;\r\n this.resolved = false;\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleAdd(this);\r\n};\r\n\r\n/**\r\n * Called when this object is removed from a parent.\r\n * @param {ReflectionObject} parent Parent removed from\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onRemove = function onRemove(parent) {\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleRemove(this);\r\n this.parent = null;\r\n this.resolved = false;\r\n};\r\n\r\n/**\r\n * Resolves this objects type references.\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var root = this.getRoot();\r\n if (root instanceof Root)\r\n this.resolved = true; // only if part of a root\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets an option value.\r\n * @param {string} name Option name\r\n * @returns {*} Option value or `undefined` if not set\r\n */\r\nReflectionObjectPrototype.getOption = function getOption(name) {\r\n if (this.options)\r\n return this.options[name];\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Sets an option.\r\n * @param {string} name Option name\r\n * @param {*} value Option value\r\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (!ifNotSet || !this.options || this.options[name] === undefined)\r\n (this.options || (this.options = {}))[name] = value;\r\n return this;\r\n};\r\n\r\n/**\r\n * Sets multiple options.\r\n * @param {Object.} options Options to set\r\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOptions = function setOptions(options, ifNotSet) {\r\n if (options)\r\n Object.keys(options).forEach(function(name) {\r\n this.setOption(name, options[name], ifNotSet);\r\n }, this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Converts this instance to its string representation.\r\n * @returns {string} Constructor name, space, full name\r\n */\r\nReflectionObjectPrototype.toString = function toString() {\r\n return this.constructor.name + \" \" + this.getFullName();\r\n};\r\n","\"use strict\";\r\nmodule.exports = OneOf;\r\n\r\nvar ReflectionObject = require(13);\r\n/** @alias OneOf.prototype */\r\nvar OneOfPrototype = ReflectionObject.extend(OneOf);\r\n\r\nvar Field = require(8),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new oneof.\r\n * @classdesc Reflected oneof.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Oneof name\r\n * @param {string[]|Object} [fieldNames] Field names\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction OneOf(name, fieldNames, options) {\r\n if (!Array.isArray(fieldNames)) {\r\n options = fieldNames;\r\n fieldNames = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (fieldNames && !Array.isArray(fieldNames))\r\n throw _TypeError(\"fieldNames\", \"an Array\");\r\n\r\n /**\r\n * Upper cased name for getter/setter calls.\r\n * @type {string}\r\n */\r\n this.ucName = this.name.substring(0, 1).toUpperCase() + this.name.substring(1);\r\n\r\n /**\r\n * Field names that belong to this oneof.\r\n * @type {string[]}\r\n */\r\n this.oneof = fieldNames || []; // toJSON, marker\r\n\r\n /**\r\n * Fields that belong to this oneof and are possibly not yet added to its parent.\r\n * @type {Field[]}\r\n * @private\r\n */\r\n this._fields = [];\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a oneof.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes a oneof\r\n */\r\nOneOf.testJSON = function testJSON(json) {\r\n return Boolean(json.oneof);\r\n};\r\n\r\n/**\r\n * Constructs a oneof from JSON.\r\n * @param {string} name Oneof name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created oneof\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nOneOf.fromJSON = function fromJSON(name, json) {\r\n return new OneOf(name, json.oneof, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.toJSON = function toJSON() {\r\n return {\r\n oneof : this.oneof,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Adds the fields of the specified oneof to the parent if not already done so.\r\n * @param {OneOf} oneof The oneof\r\n * @returns {undefined}\r\n * @inner\r\n * @ignore\r\n */\r\nfunction addFieldsToParent(oneof) {\r\n if (oneof.parent)\r\n oneof._fields.forEach(function(field) {\r\n if (!field.parent)\r\n oneof.parent.add(field);\r\n });\r\n}\r\n\r\n/**\r\n * Adds a field to this oneof.\r\n * @param {Field} field Field to add\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.add = function add(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n if (field.parent)\r\n field.parent.remove(field);\r\n this.oneof.push(field.name);\r\n this._fields.push(field);\r\n field.partOf = this; // field.parent remains null\r\n addFieldsToParent(this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a field from this oneof.\r\n * @param {Field} field Field to remove\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.remove = function remove(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n var index = this._fields.indexOf(field);\r\n if (index < 0)\r\n throw Error(field + \" is not a member of \" + this);\r\n this._fields.splice(index, 1);\r\n index = this.oneof.indexOf(field.name);\r\n if (index > -1)\r\n this.oneof.splice(index, 1);\r\n if (field.parent)\r\n field.parent.remove(field);\r\n field.partOf = null;\r\n return this;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onAdd = function onAdd(parent) {\r\n ReflectionObject.prototype.onAdd.call(this, parent);\r\n addFieldsToParent(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onRemove = function onRemove(parent) {\r\n this._fields.forEach(function(field) {\r\n if (field.parent)\r\n field.parent.remove(field);\r\n });\r\n ReflectionObject.prototype.onRemove.call(this, parent);\r\n};\r\n","\"use strict\";\r\nmodule.exports = parse;\r\n\r\nvar tokenize = require(22),\r\n Root = require(18),\r\n Type = require(23),\r\n Field = require(8),\r\n MapField = require(10),\r\n OneOf = require(14),\r\n Enum = require(7),\r\n Service = require(21),\r\n Method = require(11),\r\n types = require(24),\r\n util = require(25);\r\nvar camelCase = util.camelCase;\r\n\r\nvar nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,\r\n fqTypeRefRe = /^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/;\r\n\r\nfunction lower(token) {\r\n return token === null ? null : token.toLowerCase();\r\n}\r\n\r\nvar s_required = \"required\",\r\n s_repeated = \"repeated\",\r\n s_optional = \"optional\",\r\n s_option = \"option\",\r\n s_name = \"name\",\r\n s_type = \"type\";\r\nvar s_open = \"{\",\r\n s_close = \"}\",\r\n s_bopen = '(',\r\n s_bclose = ')',\r\n s_semi = \";\",\r\n s_dq = '\"',\r\n s_sq = \"'\";\r\n\r\n/**\r\n * Result object returned from {@link parse}.\r\n * @typedef ParserResult\r\n * @type {Object}\r\n * @property {string|undefined} package Package name, if declared\r\n * @property {string[]|undefined} imports Imports, if any\r\n * @property {string[]|undefined} weakImports Weak imports, if any\r\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\r\n * @property {Root} root Populated root instance\r\n */\r\n\r\n/**\r\n * Parses the given .proto source and returns an object with the parsed contents.\r\n * @param {string} source Source contents\r\n * @param {Root} [root] Root to populate\r\n * @returns {ParserResult} Parser result\r\n */\r\nfunction parse(source, root) {\r\n /* eslint-disable default-case, callback-return */\r\n if (!root)\r\n root = new Root();\r\n\r\n var tn = tokenize(source),\r\n next = tn.next,\r\n push = tn.push,\r\n peek = tn.peek,\r\n skip = tn.skip;\r\n\r\n var head = true,\r\n pkg,\r\n imports,\r\n weakImports,\r\n syntax,\r\n isProto3 = false;\r\n\r\n if (!root)\r\n root = new Root();\r\n\r\n var ptr = root;\r\n\r\n function illegal(token, name) {\r\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (line \" + tn.line() + s_bclose);\r\n }\r\n\r\n function readString() {\r\n var values = [],\r\n token;\r\n do {\r\n if ((token = next()) !== s_dq && token !== s_sq)\r\n throw illegal(token);\r\n values.push(next());\r\n skip(token);\r\n token = peek();\r\n } while (token === s_dq || token === s_sq);\r\n return values.join('');\r\n }\r\n\r\n function readValue(acceptTypeRef) {\r\n var token = next();\r\n switch (lower(token)) {\r\n case s_sq:\r\n case s_dq:\r\n push(token);\r\n return readString();\r\n case \"true\":\r\n return true;\r\n case \"false\":\r\n return false;\r\n }\r\n try {\r\n return parseNumber(token);\r\n } catch (e) {\r\n if (acceptTypeRef && typeRefRe.test(token))\r\n return token;\r\n throw illegal(token, \"value\");\r\n }\r\n }\r\n\r\n function readRange() {\r\n var start = parseId(next());\r\n var end = start;\r\n if (skip(\"to\", true))\r\n end = parseId(next());\r\n skip(s_semi);\r\n return [ start, end ];\r\n }\r\n\r\n function parseNumber(token) {\r\n var sign = 1;\r\n if (token.charAt(0) === '-') {\r\n sign = -1;\r\n token = token.substring(1);\r\n }\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"inf\": return sign * Infinity;\r\n case \"nan\": return NaN;\r\n case \"0\": return 0;\r\n }\r\n if (/^[1-9][0-9]*$/.test(token))\r\n return sign * parseInt(token, 10);\r\n if (/^0[x][0-9a-f]+$/.test(tokenLower))\r\n return sign * parseInt(token, 16);\r\n if (/^0[0-7]+$/.test(token))\r\n return sign * parseInt(token, 8);\r\n if (/^(?!e)[0-9]*(?:\\.[0-9]*)?(?:[e][+-]?[0-9]+)?$/.test(tokenLower))\r\n return sign * parseFloat(token);\r\n throw illegal(token, 'number');\r\n }\r\n\r\n function parseId(token, acceptNegative) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"min\": return 1;\r\n case \"max\": return 0x1FFFFFFF;\r\n case \"0\": return 0;\r\n }\r\n if (token.charAt(0) === '-' && !acceptNegative)\r\n throw illegal(token, \"id\");\r\n if (/^-?[1-9][0-9]*$/.test(token))\r\n return parseInt(token, 10);\r\n if (/^-?0[x][0-9a-f]+$/.test(tokenLower))\r\n return parseInt(token, 16);\r\n if (/^-?0[0-7]+$/.test(token))\r\n return parseInt(token, 8);\r\n throw illegal(token, \"id\");\r\n }\r\n\r\n function parsePackage() {\r\n if (pkg !== undefined)\r\n throw illegal(\"package\");\r\n pkg = next();\r\n if (!typeRefRe.test(pkg))\r\n throw illegal(pkg, s_name);\r\n ptr = ptr.define(pkg);\r\n skip(s_semi);\r\n }\r\n\r\n function parseImport() {\r\n var token = peek();\r\n var whichImports;\r\n switch (token) {\r\n case \"weak\":\r\n whichImports = weakImports || (weakImports = []);\r\n next();\r\n break;\r\n case \"public\":\r\n next();\r\n // eslint-disable-line no-fallthrough\r\n default:\r\n whichImports = imports || (imports = []);\r\n break;\r\n }\r\n token = readString();\r\n skip(s_semi);\r\n whichImports.push(token);\r\n }\r\n\r\n function parseSyntax() {\r\n skip(\"=\");\r\n syntax = lower(readString());\r\n var p3;\r\n if ([ \"proto2\", p3 = \"proto3\" ].indexOf(syntax) < 0)\r\n throw illegal(syntax, \"syntax\");\r\n isProto3 = syntax === p3;\r\n skip(s_semi);\r\n }\r\n\r\n function parseCommon(parent, token) {\r\n switch (token) {\r\n\r\n case s_option:\r\n parseOption(parent, token);\r\n skip(s_semi);\r\n return true;\r\n\r\n case \"message\":\r\n parseType(parent, token);\r\n return true;\r\n\r\n case \"enum\":\r\n parseEnum(parent, token);\r\n return true;\r\n\r\n case \"service\":\r\n parseService(parent, token);\r\n return true;\r\n\r\n case \"extend\":\r\n parseExtension(parent, token);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n function parseType(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, \"type name\");\r\n var type = new Type(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n if (parseCommon(type, token))\r\n continue;\r\n switch (tokenLower) {\r\n case \"map\":\r\n parseMapField(type, tokenLower);\r\n break;\r\n case s_required:\r\n case s_optional:\r\n case s_repeated:\r\n parseField(type, tokenLower);\r\n break;\r\n case \"oneof\":\r\n parseOneOf(type, tokenLower);\r\n break;\r\n case \"extensions\":\r\n (type.extensions || (type.extensions = [])).push(readRange(type, tokenLower));\r\n break;\r\n case \"reserved\":\r\n (type.reserved || (type.reserved = [])).push(readRange(type, tokenLower));\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(type, s_optional);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(type);\r\n }\r\n\r\n function parseField(parent, rule, extend) {\r\n var type = next();\r\n if (!typeRefRe.test(type))\r\n throw illegal(type, s_type);\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new Field(name, id, type, rule, extend));\r\n if (field.repeated)\r\n field.setOption(\"packed\", isProto3, /* ifNotSet */ true);\r\n parent.add(field);\r\n }\r\n\r\n function parseMapField(parent) {\r\n skip(\"<\");\r\n var keyType = next();\r\n if (types.mapKey[keyType] === undefined)\r\n throw illegal(keyType, s_type);\r\n skip(\",\");\r\n var valueType = next();\r\n if (!typeRefRe.test(valueType))\r\n throw illegal(valueType, s_type);\r\n skip(\">\");\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new MapField(name, id, keyType, valueType));\r\n parent.add(field);\r\n }\r\n\r\n function parseOneOf(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n var oneof = new OneOf(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (token === s_option) {\r\n parseOption(oneof, token);\r\n skip(s_semi);\r\n } else {\r\n push(token);\r\n parseField(oneof, s_optional);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(oneof);\r\n }\r\n\r\n function parseEnum(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var values = {};\r\n var enm = new Enum(name, values);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (lower(token) === s_option)\r\n parseOption(enm);\r\n else\r\n parseEnumField(enm, token);\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(enm);\r\n }\r\n\r\n function parseEnumField(parent, token) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n var name = token;\r\n skip(\"=\");\r\n var value = parseId(next(), true);\r\n parent.values[name] = value;\r\n parseInlineOptions({}); // skips enum value options\r\n }\r\n\r\n function parseOption(parent, token) {\r\n var custom = skip(s_bopen, true);\r\n var name = next();\r\n if (!typeRefRe.test(name))\r\n throw illegal(name, s_name);\r\n if (custom) {\r\n skip(s_bclose);\r\n name = s_bopen + name + s_bclose;\r\n token = peek();\r\n if (fqTypeRefRe.test(token)) {\r\n name += token;\r\n next();\r\n }\r\n }\r\n skip(\"=\");\r\n parseOptionValue(parent, name);\r\n }\r\n\r\n function parseOptionValue(parent, name) {\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n name = name + \".\" + token;\r\n if (skip(\":\", true))\r\n setOption(parent, name, readValue(true));\r\n else\r\n parseOptionValue(parent, name);\r\n }\r\n } else\r\n setOption(parent, name, readValue(true));\r\n // Does not enforce a delimiter to be universal\r\n }\r\n\r\n function setOption(parent, name, value) {\r\n if (parent.setOption)\r\n parent.setOption(name, value);\r\n else\r\n parent[name] = value;\r\n }\r\n\r\n function parseInlineOptions(parent) {\r\n if (skip(\"[\", true)) {\r\n do {\r\n parseOption(parent, s_option);\r\n } while (skip(\",\", true));\r\n skip(\"]\");\r\n }\r\n skip(s_semi);\r\n return parent;\r\n }\r\n\r\n function parseService(parent, token) {\r\n token = next();\r\n if (!nameRe.test(token))\r\n throw illegal(token, \"service name\");\r\n var name = token;\r\n var service = new Service(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(service, tokenLower);\r\n skip(s_semi);\r\n break;\r\n case \"rpc\":\r\n parseMethod(service, tokenLower);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(service);\r\n }\r\n\r\n function parseMethod(parent, token) {\r\n var type = token;\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var requestType, requestStream,\r\n responseType, responseStream;\r\n skip(s_bopen);\r\n var st;\r\n if (skip(st = \"stream\", true))\r\n requestStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n requestType = token;\r\n skip(s_bclose); skip(\"returns\"); skip(s_bopen);\r\n if (skip(st, true))\r\n responseStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n responseType = token;\r\n skip(s_bclose);\r\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(method, tokenLower);\r\n skip(s_semi);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(method);\r\n }\r\n\r\n function parseExtension(parent, token) {\r\n var reference = next();\r\n if (!typeRefRe.test(reference))\r\n throw illegal(reference, \"reference\");\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_required:\r\n case s_repeated:\r\n case s_optional:\r\n parseField(parent, tokenLower, reference);\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(parent, s_optional, reference);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n }\r\n\r\n var token;\r\n while ((token = next()) !== null) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n\r\n case \"package\":\r\n if (!head)\r\n throw illegal(token);\r\n parsePackage();\r\n break;\r\n\r\n case \"import\":\r\n if (!head)\r\n throw illegal(token);\r\n parseImport();\r\n break;\r\n\r\n case \"syntax\":\r\n if (!head)\r\n throw illegal(token);\r\n parseSyntax();\r\n break;\r\n\r\n case s_option:\r\n if (!head)\r\n throw illegal(token);\r\n parseOption(ptr, token);\r\n skip(s_semi);\r\n break;\r\n\r\n default:\r\n if (parseCommon(ptr, token)) {\r\n head = false;\r\n continue;\r\n }\r\n throw illegal(token);\r\n }\r\n }\r\n\r\n return {\r\n 'package' : pkg,\r\n 'imports' : imports,\r\n 'weakImports' : weakImports,\r\n 'syntax' : syntax,\r\n 'root' : root\r\n };\r\n}\r\n","\"use strict\";\r\nmodule.exports = Prototype;\r\n\r\n/**\r\n * Constructs a new prototype.\r\n * This method should be called from your custom constructors, i.e. `Prototype.call(this, properties)`.\r\n * @classdesc Runtime message prototype ready to be extended by custom classes or generated code.\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set\r\n * @abstract\r\n * @see {@link inherits}\r\n * @see {@link Class}\r\n */\r\nfunction Prototype(properties) {\r\n if (properties) {\r\n var keys = Object.keys(properties);\r\n for (var i = 0; i < keys.length; ++i)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n}\r\n\r\n/**\r\n * Converts a runtime message to a JSON object.\r\n * @param {Object.} [options] Conversion options\r\n * @param {boolean} [options.fieldsOnly=false] Converts only properties that reference a field\r\n * @param {*} [options.long] Long conversion type. Only relevant with a long library.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to a possibly unsafe number without, and a `Long` with a long library.\r\n * @param {*} [options.enum=Number] Enum value conversion type.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to the numeric ids.\r\n * @param {boolean} [options.defaults=false] Also sets default values on the resulting object\r\n * @returns {Object.} JSON object\r\n */\r\nPrototype.prototype.asJSON = function asJSON(options) {\r\n if (!options)\r\n options = {};\r\n var fields = this.constructor.$type.fields,\r\n json = {};\r\n var keys;\r\n if (options.defaults) {\r\n keys = [];\r\n for (var k in this) // eslint-disable-line guard-for-in\r\n keys.push(k);\r\n } else\r\n keys = Object.keys(this);\r\n for (var i = 0, key; i < keys.length; ++i) {\r\n var field = fields[key = keys[i]],\r\n value = this[key];\r\n if (field) {\r\n if (field.repeated) {\r\n if (value && value.length) {\r\n var array = new Array(value.length);\r\n for (var j = 0, l = value.length; j < l; ++j)\r\n array[j] = field.jsonConvert(value[j], options);\r\n json[key] = array;\r\n }\r\n } else\r\n json[key] = field.jsonConvert(value, options);\r\n } else if (!options.fieldsOnly)\r\n json[key] = value;\r\n }\r\n return json;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nReader.BufferReader = BufferReader;\r\n\r\nvar util = require(29),\r\n ieee754 = require(1);\r\nvar LongBits = util.LongBits,\r\n ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\r\n\r\nfunction indexOutOfRange(reader, writeLength) {\r\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\r\n}\r\n\r\n/**\r\n * Configures the Reader interface according to the environment.\r\n * @memberof Reader\r\n * @returns {undefined}\r\n */\r\nfunction configure() {\r\n if (util.Long) {\r\n ReaderPrototype.int64 = read_int64_long;\r\n ReaderPrototype.uint64 = read_uint64_long;\r\n ReaderPrototype.sint64 = read_sint64_long;\r\n ReaderPrototype.fixed64 = read_fixed64_long;\r\n ReaderPrototype.sfixed64 = read_sfixed64_long;\r\n } else {\r\n ReaderPrototype.int64 = read_int64_number;\r\n ReaderPrototype.uint64 = read_uint64_number;\r\n ReaderPrototype.sint64 = read_sint64_number;\r\n ReaderPrototype.fixed64 = read_fixed64_number;\r\n ReaderPrototype.sfixed64 = read_sfixed64_number;\r\n }\r\n}\r\n\r\nReader.configure = configure;\r\n\r\n/**\r\n * Constructs a new reader using the specified buffer.\r\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n * @param {Uint8Array} buffer Buffer to read from\r\n */\r\nfunction Reader(buffer) {\r\n \r\n /**\r\n * Read buffer.\r\n * @type {Uint8Array}\r\n */\r\n this.buf = buffer;\r\n\r\n /**\r\n * Read buffer position.\r\n * @type {number}\r\n */\r\n this.pos = 0;\r\n\r\n /**\r\n * Read buffer length.\r\n * @type {number}\r\n */\r\n this.len = buffer.length;\r\n}\r\n\r\n/**\r\n * Creates a new reader using the specified buffer.\r\n * @param {Uint8Array} buffer Buffer to read from\r\n * @returns {BufferReader|Reader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\r\n */\r\nReader.create = function create(buffer) {\r\n return new (util.Buffer && util.Buffer.isBuffer(buffer) && BufferReader || Reader)(buffer);\r\n};\r\n\r\n/** @alias Reader.prototype */\r\nvar ReaderPrototype = Reader.prototype;\r\n\r\nReaderPrototype._slice = ArrayImpl.prototype.subarray || ArrayImpl.prototype.slice;\r\n\r\n/**\r\n * Tag read.\r\n * @constructor\r\n * @param {number} id Field id\r\n * @param {number} wireType Wire type\r\n * @ignore\r\n */\r\nfunction Tag(id, wireType) {\r\n this.id = id;\r\n this.wireType = wireType;\r\n}\r\n\r\n/**\r\n * Reads a tag.\r\n * @returns {{id: number, wireType: number}} Field id and wire type\r\n */\r\nReaderPrototype.tag = function read_tag() {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n return new Tag(this.buf[this.pos] >>> 3, this.buf[this.pos++] & 7);\r\n};\r\n\r\n/**\r\n * Reads a varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.int32 = function read_int32() {\r\n // 1 byte\r\n var octet = this.buf[this.pos++],\r\n value = octet & 127;\r\n if (octet > 127) { // false if octet is undefined (pos >= len)\r\n // 2 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 7;\r\n if (octet > 127) {\r\n // 3 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 14;\r\n if (octet > 127) {\r\n // 4 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 21;\r\n if (octet > 127) {\r\n // 5 bytes\r\n octet = this.buf[this.pos++];\r\n value |= octet << 28;\r\n if (octet > 127) {\r\n // 6..10 bytes (sign extended)\r\n this.pos += 5;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (this.pos > this.len) {\r\n this.pos = this.len;\r\n throw indexOutOfRange(this);\r\n }\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a varint as an unsigned 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.uint32 = function read_uint32() {\r\n return this.int32() >>> 0;\r\n};\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sint32 = function read_sint32() {\r\n var value = this.int32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongVarint() {\r\n var lo = 0, hi = 0,\r\n i = 0, b = 0;\r\n if (this.len - this.pos > 9) { // fast route\r\n for (i = 0; i < 4; ++i) {\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n } else {\r\n for (i = 0; i < 4; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n }\r\n throw Error(\"invalid varint encoding\");\r\n}\r\n\r\nfunction read_int64_long() {\r\n return readLongVarint.call(this).toLong();\r\n}\r\n\r\nfunction read_int64_number() {\r\n return readLongVarint.call(this).toNumber();\r\n}\r\n\r\nfunction read_uint64_long() {\r\n return readLongVarint.call(this).toLong(true);\r\n}\r\n\r\nfunction read_uint64_number() {\r\n return readLongVarint.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sint64_long() {\r\n return readLongVarint.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sint64_number() {\r\n return readLongVarint.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads a varint as a signed 64 bit value.\r\n * @name Reader#int64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as an unsigned 64 bit value.\r\n * @name Reader#uint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 64 bit value.\r\n * @name Reader#sint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as a boolean.\r\n * @returns {boolean} Value read\r\n */\r\nReaderPrototype.bool = function read_bool() {\r\n return this.int32() !== 0;\r\n};\r\n\r\n/**\r\n * Reads fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.fixed32 = function read_fixed32() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n this.pos += 4;\r\n return this.buf[this.pos - 4]\r\n | this.buf[this.pos - 3] << 8\r\n | this.buf[this.pos - 2] << 16\r\n | this.buf[this.pos - 1] << 24;\r\n};\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sfixed32 = function read_sfixed32() {\r\n var value = this.fixed32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongFixed() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n return new LongBits(\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n ,\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n );\r\n}\r\n\r\nfunction read_fixed64_long() {\r\n return readLongFixed.call(this).toLong(true);\r\n}\r\n\r\nfunction read_fixed64_number() {\r\n return readLongFixed.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sfixed64_long() {\r\n return readLongFixed.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sfixed64_number() {\r\n return readLongFixed.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads fixed 64 bits.\r\n * @name Reader#fixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 64 bits.\r\n * @name Reader#sfixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\nvar readFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function readFloat_f32(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos ];\r\n return f32[0];\r\n }\r\n : function readFloat_f32_le(buf, pos) {\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f32[0];\r\n };\r\n })()\r\n : function readFloat_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Reads a float (32 bit) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.float = function read_float() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readFloat(this.buf, this.pos);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nvar readDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function readDouble_f64(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[7] = buf[pos ];\r\n return f64[0];\r\n }\r\n : function readDouble_f64_le(buf, pos) {\r\n f8b[7] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f64[0];\r\n };\r\n })()\r\n : function readDouble_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Reads a double (64 bit float) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.double = function read_double() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readDouble(this.buf, this.pos);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @returns {Uint8Array} Value read\r\n */\r\nReaderPrototype.bytes = function read_bytes() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\r\n ? new this.buf.constructor(0)\r\n : this._slice.call(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * Reads a string preceeded by its byte length as a varint.\r\n * @returns {string} Value read\r\n */\r\nReaderPrototype.string = function read_string() {\r\n // ref: https://github.com/google/closure-library/blob/master/closure/goog/crypt/crypt.js\r\n var bytes = this.bytes(),\r\n len = bytes.length;\r\n if (len) {\r\n var out = new Array(len), p = 0, c = 0;\r\n while (p < len) {\r\n var c1 = bytes[p++];\r\n if (c1 < 128)\r\n out[c++] = c1;\r\n else if (c1 > 191 && c1 < 224)\r\n out[c++] = (c1 & 31) << 6 | bytes[p++] & 63;\r\n else if (c1 > 239 && c1 < 365) {\r\n var u = ((c1 & 7) << 18 | (bytes[p++] & 63) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63) - 0x10000;\r\n out[c++] = 0xD800 + (u >> 10);\r\n out[c++] = 0xDC00 + (u & 1023);\r\n } else\r\n out[c++] = (c1 & 15) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63;\r\n }\r\n return String.fromCharCode.apply(String, out.slice(0, c));\r\n }\r\n return \"\";\r\n};\r\n\r\n/**\r\n * Skips the specified number of bytes if specified, otherwise skips a varint.\r\n * @param {number} [length] Length if known, otherwise a varint is assumed\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skip = function skip(length) {\r\n if (length === undefined) {\r\n do {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n } while (this.buf[this.pos++] & 128);\r\n } else {\r\n if (this.pos + length > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Skips the next element of the specified wire type.\r\n * @param {number} wireType Wire type received\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skipType = function(wireType) {\r\n switch (wireType) {\r\n case 0:\r\n this.skip();\r\n break;\r\n case 1:\r\n this.skip(8);\r\n break;\r\n case 2:\r\n this.skip(this.uint32());\r\n break;\r\n case 3:\r\n do { // eslint-disable-line no-constant-condition\r\n var tag = this.tag();\r\n if (tag.wireType === 4)\r\n break;\r\n this.skipType(tag.wireType);\r\n } while (true);\r\n break;\r\n case 5:\r\n this.skip(4);\r\n break;\r\n default:\r\n throw Error(\"invalid wire type: \" + wireType);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance and frees all resources.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.reset = function reset(buffer) {\r\n if (buffer) {\r\n this.buf = buffer;\r\n this.len = buffer.length;\r\n } else {\r\n this.buf = null; // makes it throw\r\n this.len = 0;\r\n }\r\n this.pos = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of read operations, frees all resources and returns the remaining buffer.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nReaderPrototype.finish = function finish(buffer) {\r\n var remain = this.pos\r\n ? this._slice.call(this.buf, this.pos)\r\n : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\n// One time function to initialize BufferReader with the now-known buffer implementation's slice method\r\nvar initBufferReader = function() {\r\n if (!util.Buffer)\r\n throw Error(\"Buffer is not supported\");\r\n BufferReaderPrototype._slice = util.Buffer.prototype.slice;\r\n readStringBuffer = util.Buffer.prototype.utf8Slice // around forever, but not present in browser buffer\r\n ? readStringBuffer_utf8Slice\r\n : readStringBuffer_toString;\r\n initBufferReader = false;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer reader.\r\n * @classdesc Wire format reader using node buffers.\r\n * @extends Reader\r\n * @constructor\r\n * @param {Buffer} buffer Buffer to read from\r\n */\r\nfunction BufferReader(buffer) {\r\n if (initBufferReader)\r\n initBufferReader();\r\n Reader.call(this, buffer);\r\n}\r\n\r\n/** @alias BufferReader.prototype */\r\nvar BufferReaderPrototype = BufferReader.prototype = Object.create(Reader.prototype);\r\n\r\nBufferReaderPrototype.constructor = BufferReader;\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.float = function read_float_buffer() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = this.buf.readFloatLE(this.pos, true);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.double = function read_double_buffer() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n var value = this.buf.readDoubleLE(this.pos, true);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\nvar readStringBuffer;\r\n\r\nfunction readStringBuffer_utf8Slice(buf, start, end) {\r\n return buf.utf8Slice(start, end); // fastest\r\n}\r\n\r\nfunction readStringBuffer_toString(buf, start, end) {\r\n return buf.toString(\"utf8\", start, end); // 2nd, again assertions\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.string = function read_string_buffer() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return readStringBuffer(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.finish = function finish_buffer(buffer) {\r\n var remain = this.pos ? this.buf.slice(this.pos) : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\nvar Namespace = require(12);\r\n/** @alias Root.prototype */\r\nvar RootPrototype = Namespace.extend(Root);\r\n\r\nvar Field = require(8),\r\n util = require(25),\r\n common = require(6);\r\n\r\n/**\r\n * Constructs a new root namespace.\r\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {Object} [options] Top level options\r\n */\r\nfunction Root(options) {\r\n Namespace.call(this, \"\", options);\r\n\r\n /**\r\n * Deferred extension fields.\r\n * @type {Field[]}\r\n */\r\n this.deferred = [];\r\n\r\n /**\r\n * Resolved file names of loaded files. \r\n * @type {string[]}\r\n */\r\n this.files = [];\r\n}\r\n\r\n/**\r\n * Loads a JSON definition into a root namespace.\r\n * @param {*} json JSON definition\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\r\n * @returns {Root} Root namespace\r\n */\r\nRoot.fromJSON = function fromJSON(json, root) {\r\n if (!root)\r\n root = new Root();\r\n return root.setOptions(json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Resolves the path of an imported file, relative to the importing origin.\r\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\r\n * @function\r\n * @param {string} origin The file name of the importing file\r\n * @param {string} target The file name being imported\r\n * @returns {string} Resolved path to `target`\r\n */\r\nRootPrototype.resolvePath = util.resolvePath;\r\n\r\n// A symbol-like function to safely signal synchronous loading\r\nfunction SYNC() {}\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {function(?Error, Root=)} callback Node-style callback function\r\n * @returns {undefined}\r\n */\r\nRootPrototype.load = function load(filename, callback) {\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(load, self, filename);\r\n\r\n // Finishes loading by calling the callback (exactly once)\r\n function finish(err, root) {\r\n if (!callback)\r\n return;\r\n var cb = callback;\r\n callback = null;\r\n cb(err, root);\r\n }\r\n\r\n var sync = callback === SYNC; // undocumented\r\n\r\n // Processes a single file\r\n function process(filename, source) {\r\n try {\r\n if (util.isString(source) && source.charAt(0) === \"{\")\r\n source = JSON.parse(source);\r\n if (!util.isString(source))\r\n self.setOptions(source.options).addJSON(source.nested);\r\n else {\r\n var parsed = require(15)(source, self);\r\n if (parsed.imports)\r\n parsed.imports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name));\r\n });\r\n if (parsed.weakImports)\r\n parsed.weakImports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name), true);\r\n });\r\n }\r\n } catch (err) {\r\n finish(err);\r\n return;\r\n }\r\n if (!sync && !queued)\r\n finish(null, self);\r\n }\r\n\r\n // Fetches a single file\r\n function fetch(filename, weak) {\r\n\r\n // Strip path if this file references a bundled definition\r\n var idx = filename.indexOf(\"google/protobuf/\");\r\n if (idx > -1) {\r\n var altname = filename.substring(idx);\r\n if (altname in common)\r\n filename = altname;\r\n }\r\n\r\n // Skip if already loaded\r\n if (self.files.indexOf(filename) > -1)\r\n return;\r\n self.files.push(filename);\r\n\r\n // Shortcut bundled definitions\r\n if (filename in common) {\r\n if (sync)\r\n process(filename, common[filename]);\r\n else {\r\n ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\r\n if (sync) {\r\n var source;\r\n try {\r\n source = util.fs.readFileSync(filename).toString(\"utf8\");\r\n } catch (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n } else {\r\n ++queued;\r\n util.fetch(filename, function(err, source) {\r\n --queued;\r\n if (!callback)\r\n return; // terminated meanwhile\r\n if (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n });\r\n }\r\n }\r\n var queued = 0;\r\n\r\n // Assembling the root namespace doesn't require working type\r\n // references anymore, so we can load everything in parallel\r\n if (util.isString(filename))\r\n filename = [ filename ];\r\n filename.forEach(function(filename) {\r\n fetch(self.resolvePath(\"\", filename));\r\n });\r\n\r\n if (sync)\r\n return self;\r\n if (!queued)\r\n finish(null, self);\r\n return undefined;\r\n};\r\n// function load(filename:string, callback:function):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\r\n * @name Root#load\r\n * @function\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Promise} Promise\r\n * @variation 2\r\n */\r\n// function load(filename:string):Promise\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nRootPrototype.loadSync = function loadSync(filename) {\r\n return this.load(filename, SYNC);\r\n};\r\n\r\n/**\r\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\r\n * @param {Field} field Declaring extension field witin the declaring type\r\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\r\n * @inner\r\n * @ignore\r\n */\r\nfunction handleExtension(field) {\r\n var extendedType = field.parent.lookup(field.extend);\r\n if (extendedType) {\r\n var sisterField = new Field(field.getFullName(), field.id, field.type, field.rule, undefined, field.options);\r\n sisterField.declaringField = field;\r\n field.extensionField = sisterField;\r\n extendedType.add(sisterField);\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Called when any object is added to this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object added\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleAdd = function handleAdd(object) {\r\n // Try to handle any deferred extensions\r\n var newDeferred = this.deferred.slice();\r\n this.deferred = []; // because the loop calls handleAdd\r\n var i = 0;\r\n while (i < newDeferred.length)\r\n if (handleExtension(newDeferred[i]))\r\n newDeferred.splice(i, 1);\r\n else\r\n ++i;\r\n this.deferred = newDeferred;\r\n // Handle new declaring extension fields without a sister field yet\r\n if (object instanceof Field && object.extend !== undefined && !object.extensionField && !handleExtension(object) && this.deferred.indexOf(object) < 0)\r\n this.deferred.push(object);\r\n else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleAdd(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * Called when any object is removed from this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object removed\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleRemove = function handleRemove(object) {\r\n if (object instanceof Field) {\r\n // If a deferred declaring extension field, cancel the extension\r\n if (object.extend !== undefined && !object.extensionField) {\r\n var index = this.deferred.indexOf(object);\r\n if (index > -1)\r\n this.deferred.splice(index, 1);\r\n }\r\n // If a declaring extension field with a sister field, remove its sister field\r\n if (object.extensionField) {\r\n object.extensionField.parent.remove(object.extensionField);\r\n object.extensionField = null;\r\n }\r\n } else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleRemove(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nRootPrototype.toString = function toString() {\r\n return this.constructor.name;\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * RPC helpers.\r\n * @namespace\r\n */\r\nvar rpc = exports;\r\n\r\nrpc.Service = require(20);\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar EventEmitter = require(26);\r\n\r\n/**\r\n * Constructs a new RPC service.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @memberof rpc\r\n * @extends util.EventEmitter\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n */\r\nfunction Service(rpcImpl) {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * RPC implementation. Becomes `null` when the service is ended.\r\n * @type {?RPCImpl}\r\n */\r\n this.$rpc = rpcImpl;\r\n}\r\n\r\n/** @alias rpc.Service.prototype */\r\nvar ServicePrototype = Service.prototype = Object.create(EventEmitter.prototype);\r\nServicePrototype.constructor = Service;\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.end = function end(endedByRPC) {\r\n if (this.$rpc) {\r\n if (!endedByRPC) // signal end to rpcImpl\r\n this.$rpc(null, null, null);\r\n this.$rpc = null;\r\n this.emit('end').off();\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar Namespace = require(12);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Service.prototype */\r\nvar ServicePrototype = Namespace.extend(Service);\r\n\r\nvar Method = require(11),\r\n util = require(25),\r\n rpc = require(19);\r\n\r\n/**\r\n * Constructs a new service.\r\n * @classdesc Reflected service.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Service name\r\n * @param {Object.} [options] Service options\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nfunction Service(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Service methods.\r\n * @type {Object.}\r\n */\r\n this.methods = {}; // toJSON, marker\r\n\r\n /**\r\n * Cached methods as an array.\r\n * @type {?Method[]}\r\n * @private\r\n */\r\n this._methodsArray = null;\r\n}\r\n\r\nutil.props(ServicePrototype, {\r\n\r\n /**\r\n * Methods of this service as an array for iteration.\r\n * @name Service#methodsArray\r\n * @type {Method[]}\r\n * @readonly\r\n */\r\n methodsArray: {\r\n get: function getMethodsArray() {\r\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\r\n }\r\n }\r\n\r\n});\r\n\r\nfunction clearCache(service) {\r\n service._methodsArray = null;\r\n return service;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a service\r\n */\r\nService.testJSON = function testJSON(json) {\r\n return Boolean(json && json.methods);\r\n};\r\n\r\n/**\r\n * Constructs a service from JSON.\r\n * @param {string} name Service name\r\n * @param {Object} json JSON object\r\n * @returns {Service} Created service\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nService.fromJSON = function fromJSON(name, json) {\r\n var service = new Service(name, json.options);\r\n if (json.methods)\r\n Object.keys(json.methods).forEach(function(methodName) {\r\n service.add(Method.fromJSON(methodName, json.methods[methodName]));\r\n });\r\n return service;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n methods : Namespace.arrayToJSON(this.getMethodsArray()) || {},\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.methods[name] || null;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.resolveAll = function resolve() {\r\n var methods = this.getMethodsArray();\r\n for (var i = 0; i < methods.length; ++i)\r\n methods[i].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Method) {\r\n this.methods[object.name] = object;\r\n object.parent = this;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.remove = function remove(object) {\r\n if (object instanceof Method) {\r\n if (this.methods[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.methods[object.name];\r\n object.parent = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\r\n * @typedef RPCImpl\r\n * @type {function}\r\n * @param {Method} method Reflected method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {function(?Error, Uint8Array=)} callback Node-style callback called with the error, if any, and the response data. `null` as response data signals an ended stream.\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Creates a runtime service using the specified rpc implementation.\r\n * @param {function(Method, Uint8Array, function)} rpcImpl RPC implementation ({@link RPCImpl|see})\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n * @returns {rpc.Service} Runtime RPC service. Useful where requests and/or responses are streamed.\r\n */\r\nServicePrototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\r\n var rpcService = new rpc.Service(rpcImpl);\r\n this.getMethodsArray().forEach(function(method) {\r\n rpcService[method.name.substring(0, 1).toLowerCase() + method.name.substring(1)] = function callVirtual(request, /* optional */ callback) {\r\n if (!rpcService.$rpc) // already ended?\r\n return;\r\n if (!request)\r\n throw util._TypeError(\"request\", \"not null\");\r\n method.resolve();\r\n var requestData;\r\n try {\r\n requestData = (requestDelimited && method.resolvedRequestType.encodeDelimited(request) || method.resolvedRequestType.encode(request)).finish();\r\n } catch (err) {\r\n (typeof setImmediate === 'function' && setImmediate || setTimeout)(function() { callback(err); });\r\n return;\r\n }\r\n // Calls the custom RPC implementation with the reflected method and binary request data\r\n // and expects the rpc implementation to call its callback with the binary response data.\r\n rpcImpl(method, requestData, function(err, responseData) {\r\n if (err) {\r\n rpcService.emit('error', err, method);\r\n return callback ? callback(err) : undefined;\r\n }\r\n if (responseData === null) {\r\n rpcService.end(/* endedByRPC */ true);\r\n return undefined;\r\n }\r\n var response;\r\n try {\r\n response = responseDelimited && method.resolvedResponseType.decodeDelimited(responseData) || method.resolvedResponseType.decode(responseData);\r\n } catch (err2) {\r\n rpcService.emit('error', err2, method);\r\n return callback ? callback('error', err2) : undefined;\r\n }\r\n rpcService.emit('data', response, method);\r\n return callback ? callback(null, response) : undefined;\r\n });\r\n };\r\n });\r\n return rpcService;\r\n};\r\n","\"use strict\";\r\nmodule.exports = tokenize;\r\n\r\nvar delimRe = /[\\s{}=;:[\\],'\"()<>]/g,\r\n stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\r\n stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\r\n\r\n/**\r\n * Handle object returned from {@link tokenize}.\r\n * @typedef {Object} TokenizerHandle\r\n * @property {function():number} line Gets the current line number\r\n * @property {function():?string} next Gets the next token and advances (`null` on eof)\r\n * @property {function():?string} peek Peeks for the next token (`null` on eof)\r\n * @property {function(string)} push Pushes a token back to the stack\r\n * @property {function(string, boolean=):boolean} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\r\n */\r\n\r\nvar s_nl = \"\\n\",\r\n s_sl = '/',\r\n s_as = '*';\r\n\r\nfunction unescape(str) {\r\n return str.replace(/\\\\(.?)/g, function($0, $1) {\r\n switch ($1) {\r\n case \"\\\\\":\r\n case \"\":\r\n return $1;\r\n case \"0\":\r\n return \"\\u0000\";\r\n default:\r\n return $1;\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Tokenizes the given .proto source and returns an object with useful utility functions.\r\n * @param {string} source Source contents\r\n * @returns {TokenizerHandle} Tokenizer handle\r\n */\r\nfunction tokenize(source) {\r\n /* eslint-disable default-case, callback-return */\r\n source = source.toString();\r\n \r\n var offset = 0,\r\n length = source.length,\r\n line = 1;\r\n \r\n var stack = [];\r\n\r\n var stringDelim = null;\r\n\r\n /**\r\n * Creates an error for illegal syntax.\r\n * @param {string} subject Subject\r\n * @returns {Error} Error created\r\n * @inner\r\n */\r\n function illegal(subject) {\r\n return Error(\"illegal \" + subject + \" (line \" + line + \")\");\r\n }\r\n\r\n /**\r\n * Reads a string till its end.\r\n * @returns {string} String read\r\n * @inner\r\n */\r\n function readString() {\r\n var re = stringDelim === '\"' ? stringDoubleRe : stringSingleRe;\r\n re.lastIndex = offset - 1;\r\n var match = re.exec(source);\r\n if (!match)\r\n throw illegal(\"string\");\r\n offset = re.lastIndex;\r\n push(stringDelim);\r\n stringDelim = null;\r\n return unescape(match[1]);\r\n }\r\n\r\n /**\r\n * Gets the character at `pos` within the source.\r\n * @param {number} pos Position\r\n * @returns {string} Character\r\n * @inner\r\n */\r\n function charAt(pos) {\r\n return source.charAt(pos);\r\n }\r\n\r\n /**\r\n * Obtains the next token.\r\n * @returns {?string} Next token or `null` on eof\r\n * @inner\r\n */\r\n function next() {\r\n if (stack.length > 0)\r\n return stack.shift();\r\n if (stringDelim)\r\n return readString();\r\n var repeat,\r\n prev,\r\n curr;\r\n do {\r\n if (offset === length)\r\n return null;\r\n repeat = false;\r\n while (/\\s/.test(curr = charAt(offset))) {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n }\r\n if (charAt(offset) === s_sl) {\r\n if (++offset === length)\r\n throw illegal(\"comment\");\r\n if (charAt(offset) === s_sl) { // Line\r\n while (charAt(++offset) !== s_nl)\r\n if (offset === length)\r\n return null;\r\n ++offset;\r\n ++line;\r\n repeat = true;\r\n } else if ((curr = charAt(offset)) === s_as) { /* Block */\r\n do {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n prev = curr;\r\n curr = charAt(offset);\r\n } while (prev !== s_as || curr !== s_sl);\r\n ++offset;\r\n repeat = true;\r\n } else\r\n return s_sl;\r\n }\r\n } while (repeat);\r\n\r\n if (offset === length)\r\n return null;\r\n var end = offset;\r\n delimRe.lastIndex = 0;\r\n var delim = delimRe.test(charAt(end++));\r\n if (!delim)\r\n while (end < length && !delimRe.test(charAt(end)))\r\n ++end;\r\n var token = source.substring(offset, offset = end);\r\n if (token === '\"' || token === \"'\")\r\n stringDelim = token;\r\n return token;\r\n }\r\n\r\n /**\r\n * Pushes a token back to the stack.\r\n * @param {string} token Token\r\n * @returns {undefined}\r\n * @inner\r\n */\r\n function push(token) {\r\n stack.push(token);\r\n }\r\n\r\n /**\r\n * Peeks for the next token.\r\n * @returns {?string} Token or `null` on eof\r\n * @inner\r\n */\r\n function peek() {\r\n if (!stack.length) {\r\n var token = next();\r\n if (token === null)\r\n return null;\r\n push(token);\r\n }\r\n return stack[0];\r\n }\r\n\r\n /**\r\n * Skips a token.\r\n * @param {string} expected Expected token\r\n * @param {boolean} [optional=false] Whether the token is optional\r\n * @returns {boolean} `true` when skipped, `false` if not\r\n * @throws {Error} When a required token is not present\r\n * @inner\r\n */\r\n function skip(expected, optional) {\r\n var actual = peek(),\r\n equals = actual === expected;\r\n if (equals) {\r\n next();\r\n return true;\r\n }\r\n if (!optional)\r\n throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\r\n return false;\r\n }\r\n\r\n return {\r\n line: function() { return line; },\r\n next: next,\r\n peek: peek,\r\n push: push,\r\n skip: skip\r\n };\r\n /* eslint-enable default-case, callback-return */\r\n}","\"use strict\";\r\nmodule.exports = Type; \r\n\r\nvar Namespace = require(12);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Type.prototype */\r\nvar TypePrototype = Namespace.extend(Type);\r\n\r\nvar Enum = require(7),\r\n OneOf = require(14),\r\n Field = require(8),\r\n Service = require(21),\r\n Prototype = require(16),\r\n Reader = require(17),\r\n Writer = require(30),\r\n inherits = require(9),\r\n util = require(25),\r\n codegen = require(2);\r\n\r\n/**\r\n * Constructs a new message type.\r\n * @classdesc Reflected message type.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Message name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Type(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Message fields.\r\n * @type {Object.}\r\n */\r\n this.fields = {}; // toJSON, marker\r\n\r\n /**\r\n * Oneofs declared within this namespace, if any.\r\n * @type {Object.}\r\n */\r\n this.oneofs = undefined; // toJSON\r\n\r\n /**\r\n * Extension ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.extensions = undefined; // toJSON\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n /**\r\n * Cached fields by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._fieldsById = null;\r\n\r\n /**\r\n * Cached fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._fieldsArray = null;\r\n\r\n /**\r\n * Cached repeated fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._repeatedFieldsArray = null;\r\n\r\n /**\r\n * Cached oneofs as an array.\r\n * @type {?OneOf[]}\r\n * @private\r\n */\r\n this._oneofsArray = null;\r\n\r\n /**\r\n * Cached constructor.\r\n * @type {*}\r\n * @private\r\n */\r\n this._ctor = null;\r\n}\r\n\r\nutil.props(TypePrototype, {\r\n\r\n /**\r\n * Message fields by id.\r\n * @name Type#fieldsById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n fieldsById: {\r\n get: function getFieldsById() {\r\n if (this._fieldsById)\r\n return this._fieldsById;\r\n this._fieldsById = {};\r\n var names = Object.keys(this.fields);\r\n for (var i = 0; i < names.length; ++i) {\r\n var field = this.fields[names[i]],\r\n id = field.id;\r\n if (this._fieldsById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._fieldsById[id] = field;\r\n }\r\n return this._fieldsById;\r\n }\r\n },\r\n\r\n /**\r\n * Fields of this message as an array for iteration.\r\n * @name Type#fieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n fieldsArray: {\r\n get: function getFieldsArray() {\r\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\r\n }\r\n },\r\n\r\n /**\r\n * Repeated fields of this message as an array for iteration.\r\n * @name Type#repeatedFieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n repeatedFieldsArray: {\r\n get: function getRepeatedFieldsArray() {\r\n return this._repeatedFieldsArray || (this._repeatedFieldsArray = this.getFieldsArray().filter(function(field) { return field.repeated; }));\r\n }\r\n },\r\n\r\n /**\r\n * Oneofs of this message as an array for iteration.\r\n * @name Type#oneofsArray\r\n * @type {OneOf[]}\r\n * @readonly\r\n */\r\n oneofsArray: {\r\n get: function getOneofsArray() {\r\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\r\n }\r\n },\r\n\r\n /**\r\n * The registered constructor, if any registered, otherwise a generic constructor.\r\n * @name Type#ctor\r\n * @type {Prototype}\r\n */\r\n ctor: {\r\n get: function getCtor() {\r\n if (this._ctor)\r\n return this._ctor;\r\n var ctor;\r\n if (codegen.supported)\r\n ctor = codegen(\"p\")(\"P.call(this,p)\").eof(this.getFullName() + \"$ctor\", {\r\n P: Prototype\r\n });\r\n else\r\n ctor = function GenericMessage(properties) {\r\n Prototype.call(this, properties);\r\n };\r\n ctor.prototype = inherits(ctor, this);\r\n this._ctor = ctor;\r\n return ctor;\r\n },\r\n set: function setCtor(ctor) {\r\n if (ctor && !(ctor.prototype instanceof Prototype))\r\n throw util._TypeError(\"ctor\", \"a constructor inheriting from Prototype\");\r\n this._ctor = ctor;\r\n }\r\n }\r\n});\r\n\r\nfunction clearCache(type) {\r\n type._fieldsById = type._fieldsArray = type._oneofsArray = type._ctor = null;\r\n delete type.encode;\r\n delete type.decode;\r\n return type;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a message type.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a message type\r\n */\r\nType.testJSON = function testJSON(json) {\r\n return Boolean(json && json.fields);\r\n};\r\n\r\nvar nestedTypes = [ Enum, Type, Field, Service ];\r\n\r\n/**\r\n * Creates a type from JSON.\r\n * @param {string} name Message name\r\n * @param {Object} json JSON object\r\n * @returns {Type} Created message type\r\n */\r\nType.fromJSON = function fromJSON(name, json) {\r\n var type = new Type(name, json.options);\r\n type.extensions = json.extensions;\r\n type.reserved = json.reserved;\r\n if (json.fields)\r\n Object.keys(json.fields).forEach(function(fieldName) {\r\n type.add(Field.fromJSON(fieldName, json.fields[fieldName]));\r\n });\r\n if (json.oneofs)\r\n Object.keys(json.oneofs).forEach(function(oneOfName) {\r\n type.add(OneOf.fromJSON(oneOfName, json.oneofs[oneOfName]));\r\n });\r\n if (json.nested)\r\n Object.keys(json.nested).forEach(function(nestedName) {\r\n var nested = json.nested[nestedName];\r\n for (var i = 0; i < nestedTypes.length; ++i) {\r\n if (nestedTypes[i].testJSON(nested)) {\r\n type.add(nestedTypes[i].fromJSON(nestedName, nested));\r\n return;\r\n }\r\n }\r\n throw Error(\"invalid nested object in \" + type + \": \" + nestedName);\r\n });\r\n if (json.extensions && json.extensions.length)\r\n type.extensions = json.extensions;\r\n if (json.reserved && json.reserved.length)\r\n type.reserved = json.reserved;\r\n return type;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n oneofs : Namespace.arrayToJSON(this.getOneofsArray()),\r\n fields : Namespace.arrayToJSON(this.getFieldsArray().filter(function(obj) { return !obj.declaringField; })) || {},\r\n extensions : this.extensions && this.extensions.length ? this.extensions : undefined,\r\n reserved : this.reserved && this.reserved.length ? this.reserved : undefined,\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.resolveAll = function resolve() {\r\n var fields = this.getFieldsArray(), i = 0;\r\n while (i < fields.length)\r\n fields[i++].resolve();\r\n var oneofs = this.getOneofsArray(); i = 0;\r\n while (i < oneofs.length)\r\n oneofs[i++].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.fields && this.fields[name] || this.oneofs && this.oneofs[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this type.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\r\n */\r\nTypePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Field && object.extend === undefined) {\r\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\r\n // The root object takes care of adding distinct sister-fields to the respective extended\r\n // type instead.\r\n if (this.getFieldsById()[object.id])\r\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\r\n if (object.parent)\r\n object.parent.remove(object);\r\n this.fields[object.name] = object;\r\n object.message = this;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n if (!this.oneofs)\r\n this.oneofs = {};\r\n this.oneofs[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this type.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this type\r\n */\r\nTypePrototype.remove = function remove(object) {\r\n if (object instanceof Field && object.extend === undefined) {\r\n // See Type#add for the reason why extension fields are excluded here.\r\n if (this.fields[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.fields[object.name];\r\n object.message = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object|*} [properties] Properties to set\r\n * @param {*} [ctor] Constructor to use.\r\n * Defaults to use the internal constuctor.\r\n * @returns {Prototype} Message instance\r\n */\r\nTypePrototype.create = function create(properties, ctor) {\r\n if (!properties || typeof properties === 'function') {\r\n ctor = properties;\r\n properties = undefined;\r\n } else if (properties /* already */ instanceof Prototype)\r\n return properties;\r\n if (ctor) {\r\n if (!(ctor.prototype instanceof Prototype))\r\n throw util._TypeError(\"ctor\", \"a constructor inheriting from Prototype\");\r\n } else\r\n ctor = this.getCtor();\r\n return new ctor(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Prototype|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encode = function encode(message, writer) {\r\n return (this.encode = codegen.supported\r\n ? codegen.encode.generate(this).eof(this.getFullName() + \"$encode\", {\r\n Writer : Writer,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : codegen.encode.fallback\r\n ).call(this, message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Prototype|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.encode(message, writer).ldelim();\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Prototype} Decoded message\r\n */\r\nTypePrototype.decode = function decode(readerOrBuffer, length) {\r\n return (this.decode = codegen.supported\r\n ? codegen.decode.generate(this).eof(this.getFullName() + \"$decode\", {\r\n Reader : Reader,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : codegen.decode.fallback\r\n ).call(this, readerOrBuffer, length);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @returns {Prototype} Decoded message\r\n */\r\nTypePrototype.decodeDelimited = function decodeDelimited(readerOrBuffer) {\r\n readerOrBuffer = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer);\r\n return this.decode(readerOrBuffer, readerOrBuffer.uint32());\r\n};\r\n\r\n/**\r\n * Verifies that enum values are valid and that any required fields are present.\r\n * @param {Prototype|Object} message Message to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\nTypePrototype.verify = function verify(message) {\r\n return (this.verify = codegen.supported\r\n ? codegen.verify.generate(this).eof(this.getFullName() + \"$verify\", {\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; })\r\n })\r\n : codegen.verify.fallback\r\n ).call(this, message);\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Common type constants.\r\n * @namespace\r\n */\r\nvar types = exports;\r\n\r\nvar util = require(25);\r\n\r\nvar s = [\r\n \"double\", // 0\r\n \"float\", // 1\r\n \"int32\", // 2\r\n \"uint32\", // 3\r\n \"sint32\", // 4\r\n \"fixed32\", // 5\r\n \"sfixed32\", // 6\r\n \"int64\", // 7\r\n \"uint64\", // 8\r\n \"sint64\", // 9\r\n \"fixed64\", // 10\r\n \"sfixed64\", // 11\r\n \"bool\", // 12\r\n \"string\", // 13\r\n \"bytes\" // 14\r\n];\r\n\r\nfunction bake(values, offset) {\r\n var i = 0, o = {};\r\n offset |= 0;\r\n while (i < values.length) o[s[i + offset]] = values[i++];\r\n return o;\r\n}\r\n\r\n/**\r\n * Basic type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.basic = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2,\r\n /* bytes */ 2\r\n]);\r\n\r\n/**\r\n * Basic type defaults.\r\n * @type {Object.}\r\n */\r\ntypes.defaults = bake([\r\n /* double */ 0,\r\n /* float */ 0,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 0,\r\n /* sfixed32 */ 0,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 0,\r\n /* sfixed64 */ 0,\r\n /* bool */ false,\r\n /* string */ \"\",\r\n /* bytes */ util.emptyArray\r\n]);\r\n\r\n/**\r\n * Basic long type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.long = bake([\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1\r\n], 7);\r\n\r\n/**\r\n * Allowed types for map keys with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.mapKey = bake([\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2\r\n], 2);\r\n\r\n/**\r\n * Allowed types for packed repeated fields with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.packed = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0\r\n]);\r\n","\"use strict\";\r\n\r\n/**\r\n * Utility functions.\r\n * @namespace\r\n */\r\nvar util = exports;\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @memberof util\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nfunction isString(value) {\r\n return typeof value === 'string' || value instanceof String;\r\n}\r\n\r\nutil.isString = isString;\r\n\r\n/**\r\n * Tests if the specified value is a non-null object.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a non-null object\r\n */\r\nutil.isObject = function isObject(value) {\r\n return Boolean(value && typeof value === 'object');\r\n};\r\n\r\n/**\r\n * Tests if the specified value is an integer.\r\n * @function\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is an integer\r\n */\r\nutil.isInteger = Number.isInteger || function isInteger(value) {\r\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\r\n};\r\n\r\n/**\r\n * Converts an object's values to an array.\r\n * @param {Object.} object Object to convert\r\n * @returns {Array.<*>} Converted array\r\n */\r\nutil.toArray = function toArray(object) {\r\n if (!object)\r\n return [];\r\n var names = Object.keys(object),\r\n length = names.length;\r\n var array = new Array(length);\r\n for (var i = 0; i < length; ++i)\r\n array[i] = object[names[i]];\r\n return array;\r\n};\r\n\r\n/**\r\n * Creates a type error.\r\n * @param {string} name Argument name\r\n * @param {string} [description=\"a string\"] Expected argument descripotion\r\n * @returns {TypeError} Created type error\r\n * @private\r\n */\r\nutil._TypeError = function(name, description) {\r\n return TypeError(name + \" must be \" + (description || \"a string\"));\r\n};\r\n\r\n/**\r\n * Returns a promise from a node-style function.\r\n * @memberof util\r\n * @param {function(Error, ...*)} fn Function to call\r\n * @param {Object} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var args = [];\r\n for (var i = 2; i < arguments.length; ++i)\r\n args.push(arguments[i]);\r\n return new Promise(function(resolve, reject) {\r\n fn.apply(ctx, args.concat(\r\n function(err/*, varargs */) {\r\n if (err) reject(err);\r\n else resolve.apply(null, Array.prototype.slice.call(arguments, 1));\r\n }\r\n ));\r\n });\r\n}\r\n\r\nutil.asPromise = asPromise;\r\n\r\n/**\r\n * Filesystem, if available.\r\n * @memberof util\r\n * @type {?Object}\r\n */\r\nvar fs = null; // Hide this from webpack. There is probably another, better way.\r\ntry { fs = eval(['req','uire'].join(''))(\"fs\"); } catch (e) {} // eslint-disable-line no-eval, no-empty\r\n\r\nutil.fs = fs;\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} path File path or url\r\n * @param {function(?Error, string=)} [callback] Node-style callback\r\n * @returns {Promise|undefined} A Promise if `callback` has been omitted \r\n */\r\nfunction fetch(path, callback) {\r\n if (!callback)\r\n return asPromise(fetch, util, path);\r\n if (fs && fs.readFile)\r\n return fs.readFile(path, \"utf8\", callback);\r\n var xhr = new XMLHttpRequest();\r\n function onload() {\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n if (isString(xhr.responseText))\r\n return callback(null, xhr.responseText);\r\n return callback(Error(\"request failed\"));\r\n }\r\n xhr.onreadystatechange = function() {\r\n if (xhr.readyState === 4)\r\n onload();\r\n };\r\n xhr.open(\"GET\", path, true);\r\n xhr.send();\r\n return undefined;\r\n}\r\n\r\nutil.fetch = fetch;\r\n\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @memberof util\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\nfunction isAbsolutePath(path) {\r\n return /^(?:\\/|[a-zA-Z0-9]+:)/.test(path);\r\n}\r\n\r\nutil.isAbsolutePath = isAbsolutePath;\r\n\r\n/**\r\n * Normalizes the specified path.\r\n * @memberof util\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\nfunction normalizePath(path) {\r\n path = path.replace(/\\\\/g, '/')\r\n .replace(/\\/{2,}/g, '/');\r\n var parts = path.split('/');\r\n var abs = isAbsolutePath(path);\r\n var prefix = \"\";\r\n if (abs)\r\n prefix = parts.shift() + '/';\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === '..') {\r\n if (i > 0)\r\n parts.splice(--i, 2);\r\n else if (abs)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === '.')\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join('/');\r\n}\r\n\r\nutil.normalizePath = normalizePath;\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path that was used to fetch the origin file\r\n * @param {string} importPath Import path specified in the origin file\r\n * @param {boolean} [alreadyNormalized] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the imported file\r\n */\r\nutil.resolvePath = function resolvePath(originPath, importPath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n importPath = normalizePath(importPath);\r\n if (isAbsolutePath(importPath))\r\n return importPath;\r\n if (!alreadyNormalized)\r\n originPath = normalizePath(originPath);\r\n originPath = originPath.replace(/(?:\\/|^)[^/]+$/, '');\r\n return originPath.length ? normalizePath(originPath + '/' + importPath) : importPath;\r\n};\r\n\r\n/**\r\n * Merges the properties of the source object into the destination object.\r\n * @param {Object} dst Destination object\r\n * @param {Object} src Source object\r\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\r\n * @returns {Object} Destination object\r\n */\r\nutil.merge = function merge(dst, src, ifNotSet) {\r\n if (src) {\r\n var keys = Object.keys(src);\r\n for (var i = 0; i < keys.length; ++i)\r\n if (dst[keys[i]] === undefined || !ifNotSet)\r\n dst[keys[i]] = src[keys[i]];\r\n }\r\n return dst;\r\n};\r\n\r\n/**\r\n * Returns a safe property accessor for the specified properly name.\r\n * @param {string} prop Property name\r\n * @returns {string} Safe accessor\r\n */\r\nutil.safeProp = function safeProp(prop) {\r\n return \"['\" + prop.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\") + \"']\";\r\n};\r\n\r\n/**\r\n * Minimalistic sprintf.\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {string} Formatted string\r\n */\r\nutil.sprintf = function sprintf(format) {\r\n var params = Array.prototype.slice.call(arguments, 1),\r\n index = 0;\r\n return format.replace(/%([djs])/g, function($0, $1) {\r\n var param = params[index++];\r\n switch ($1) {\r\n case \"j\":\r\n return JSON.stringify(param);\r\n case \"p\":\r\n return util.safeProp(param);\r\n default:\r\n return String(param);\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Converts a string to camel case notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.camelCase = function camelCase(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/_([a-z])(?=[a-z]|$)/g, function($0, $1) { return $1.toUpperCase(); });\r\n};\r\n\r\n/**\r\n * Converts a string to underscore notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.underScore = function underScore(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return \"_\" + $1.toLowerCase(); });\r\n};\r\n\r\n/**\r\n * Creates a new buffer of whatever type supported by the environment.\r\n * @param {number} [size=0] Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nutil.newBuffer = function newBuffer(size) {\r\n size = size || 0; \r\n return util.Buffer\r\n ? util.Buffer.allocUnsafe && util.Buffer.allocUnsafe(size) || new util.Buffer(size)\r\n : new (typeof Uint8Array !== 'undefined' && Uint8Array || Array)(size);\r\n};\r\n\r\nutil.EventEmitter = require(26);\r\n\r\n// Merge in runtime utility\r\nutil.merge(util, require(29));\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/** @alias util.EventEmitter.prototype */\r\nvar EventEmitterPrototype = EventEmitter.prototype;\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {Object} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = Array.prototype.slice.call(arguments, 1);\r\n for (var i = 0; i < listeners.length; ++i)\r\n listeners[i].fn.apply(listeners[i].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = LongBits;\r\n\r\nvar util = require(25);\r\n\r\n/**\r\n * Any compatible Long instance.\r\n * @typedef Long\r\n * @type {Object}\r\n * @property {number} low Low bits\r\n * @property {number} high High bits\r\n * @property {boolean} unsigned Whether unsigned or not\r\n */\r\n\r\n/**\r\n * Constructs new long bits.\r\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\r\n * @memberof util\r\n * @constructor\r\n * @param {number} lo Low bits\r\n * @param {number} hi High bits\r\n */\r\nfunction LongBits(lo, hi) { // make sure to always call this with unsigned 32bits for proper optimization\r\n\r\n /**\r\n * Low bits.\r\n * @type {number}\r\n */\r\n this.lo = lo;\r\n\r\n /**\r\n * High bits.\r\n * @type {number}\r\n */\r\n this.hi = hi;\r\n}\r\n\r\n/** @alias util.LongBits.prototype */\r\nvar LongBitsPrototype = LongBits.prototype;\r\n\r\n/**\r\n * Zero bits.\r\n * @memberof util.LongBits\r\n * @type {util.LongBits}\r\n */\r\nvar zero = LongBits.zero = new LongBits(0, 0);\r\n\r\nzero.toNumber = function() { return 0; };\r\nzero.zzEncode = zero.zzDecode = function() { return this; };\r\nzero.length = function() { return 1; };\r\n\r\n/**\r\n * Constructs new long bits from the specified number.\r\n * @param {number} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.fromNumber = function fromNumber(value) {\r\n if (value === 0)\r\n return zero;\r\n var sign = value < 0;\r\n value = Math.abs(value);\r\n var lo = value >>> 0,\r\n hi = (value - lo) / 4294967296 >>> 0;\r\n if (sign) {\r\n hi = ~hi >>> 0;\r\n lo = ~lo >>> 0;\r\n if (++lo > 4294967295) {\r\n lo = 0;\r\n if (++hi > 4294967295)\r\n hi = 0;\r\n }\r\n }\r\n return new LongBits(lo, hi);\r\n};\r\n\r\n/**\r\n * Constructs new long bits from a number, long or string.\r\n * @param {Long|number|string} value Value\r\n * @returns {util.LongBits} Instance\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nLongBits.from = function from(value) {\r\n switch (typeof value) { // eslint-disable-line default-case\r\n case 'number':\r\n return LongBits.fromNumber(value);\r\n case 'string':\r\n value = util.Long.fromString(value); // throws without a long lib\r\n }\r\n return (value.low || value.high) && new LongBits(value.low >>> 0, value.high >>> 0) || zero;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a possibly unsafe JavaScript number.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {number} Possibly unsafe number\r\n */\r\nLongBitsPrototype.toNumber = function toNumber(unsigned) {\r\n if (!unsigned && this.hi >>> 31) {\r\n this.lo = ~this.lo + 1 >>> 0;\r\n this.hi = ~this.hi >>> 0;\r\n if (!this.lo)\r\n this.hi = this.hi + 1 >>> 0;\r\n return -(this.lo + this.hi * 4294967296);\r\n }\r\n return this.lo + this.hi * 4294967296;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a long.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long} Long\r\n */\r\nLongBitsPrototype.toLong = function toLong(unsigned) {\r\n return new util.Long(this.lo, this.hi, unsigned);\r\n};\r\n\r\nvar charCodeAt = String.prototype.charCodeAt;\r\n\r\n/**\r\n * Constructs new long bits from the specified 8 characters long hash.\r\n * @param {string} hash Hash\r\n * @returns {util.LongBits} Bits\r\n */\r\nLongBits.fromHash = function fromHash(hash) {\r\n return new LongBits(\r\n ( charCodeAt.call(hash, 0)\r\n | charCodeAt.call(hash, 1) << 8\r\n | charCodeAt.call(hash, 2) << 16\r\n | charCodeAt.call(hash, 3) << 24) >>> 0\r\n ,\r\n ( charCodeAt.call(hash, 4)\r\n | charCodeAt.call(hash, 5) << 8\r\n | charCodeAt.call(hash, 6) << 16\r\n | charCodeAt.call(hash, 7) << 24) >>> 0\r\n );\r\n};\r\n\r\n/**\r\n * Converts this long bits to a 8 characters long hash.\r\n * @returns {string} Hash\r\n */\r\nLongBitsPrototype.toHash = function toHash() {\r\n return String.fromCharCode(\r\n this.lo & 255,\r\n this.lo >>> 8 & 255,\r\n this.lo >>> 16 & 255,\r\n this.lo >>> 24 & 255,\r\n this.hi & 255,\r\n this.hi >>> 8 & 255,\r\n this.hi >>> 16 & 255,\r\n this.hi >>> 24 & 255\r\n );\r\n};\r\n\r\n/**\r\n * Zig-zag encodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzEncode = function zzEncode() {\r\n var mask = this.hi >> 31;\r\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\r\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Zig-zag decodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzDecode = function zzDecode() {\r\n var mask = -(this.lo & 1);\r\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\r\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Calculates the length of this longbits when encoded as a varint.\r\n * @returns {number} Length\r\n */\r\nLongBitsPrototype.length = function length() {\r\n var part0 = this.lo,\r\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\r\n part2 = this.hi >>> 24;\r\n if (part2 === 0) {\r\n if (part1 === 0)\r\n return part0 < 1 << 14\r\n ? part0 < 1 << 7 ? 1 : 2\r\n : part0 < 1 << 21 ? 3 : 4;\r\n return part1 < 1 << 14\r\n ? part1 < 1 << 7 ? 5 : 6\r\n : part1 < 1 << 21 ? 7 : 8;\r\n }\r\n return part2 < 1 << 7 ? 9 : 10;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * A drop-in buffer pool, similar in functionality to what node uses for buffers.\r\n * @memberof util\r\n * @function\r\n * @param {function(number):Uint8Array} alloc Allocator\r\n * @param {function(number, number):Uint8Array} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {function(number):Uint8Array} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\nvar util = exports;\r\n\r\nvar LongBits = util.LongBits = require(\"./longbits\");\r\n\r\nutil.pool = require(\"./pool\");\r\n\r\n/**\r\n * Whether running within node or not.\r\n * @memberof util\r\n * @type {boolean}\r\n */\r\nvar isNode = util.isNode = Boolean(global.process && global.process.versions && global.process.versions.node);\r\n\r\n/**\r\n * Optional buffer class to use.\r\n * If you assign any compatible buffer implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Buffer = null;\r\n\r\nif (isNode)\r\n try { util.Buffer = require(\"buffer\").Buffer; } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Optional Long class to use.\r\n * If you assign any compatible long implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Long = global.dcodeIO && global.dcodeIO.Long || null;\r\n\r\nif (!util.Long && isNode)\r\n try { util.Long = require(\"long\"); } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Converts a number or long to an 8 characters long hash string.\r\n * @param {Long|number} value Value to convert\r\n * @returns {string} Hash\r\n */\r\nutil.longToHash = function longToHash(value) {\r\n return value\r\n ? LongBits.from(value).toHash()\r\n : '\\0\\0\\0\\0\\0\\0\\0\\0';\r\n};\r\n\r\n/**\r\n * Converts an 8 characters long hash string to a long or number.\r\n * @param {string} hash Hash\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long|number} Original value\r\n */\r\nutil.longFromHash = function longFromHash(hash, unsigned) {\r\n var bits = LongBits.fromHash(hash);\r\n if (util.Long)\r\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\r\n return bits.toNumber(Boolean(unsigned));\r\n};\r\n\r\n/**\r\n * Tests if two possibly long values are not equal.\r\n * @param {number|Long} a First value\r\n * @param {number|Long} b Second value\r\n * @returns {boolean} `true` if not equal\r\n */\r\nutil.longNeq = function longNeq(a, b) {\r\n return typeof a === 'number'\r\n ? typeof b === 'number'\r\n ? a !== b\r\n : (a = LongBits.fromNumber(a)).lo !== b.low || a.hi !== b.high\r\n : typeof b === 'number'\r\n ? (b = LongBits.fromNumber(b)).lo !== a.low || b.hi !== a.high\r\n : a.low !== b.low || a.high !== b.high;\r\n};\r\n\r\n/**\r\n * Defines the specified properties on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {Object} descriptors Property descriptors\r\n * @returns {undefined}\r\n */\r\nutil.props = function props(target, descriptors) {\r\n Object.keys(descriptors).forEach(function(key) {\r\n util.prop(target, key, descriptors[key]);\r\n });\r\n};\r\n\r\n/**\r\n * Defines the specified property on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {string} key Property name\r\n * @param {Object} descriptor Property descriptor\r\n * @returns {undefined}\r\n */\r\nutil.prop = function prop(target, key, descriptor) {\r\n var ie8 = !-[1,];\r\n var ucKey = key.substring(0, 1).toUpperCase() + key.substring(1);\r\n if (descriptor.get)\r\n target['get' + ucKey] = descriptor.get;\r\n if (descriptor.set)\r\n target['set' + ucKey] = ie8\r\n ? function(value) {\r\n descriptor.set.call(this, value);\r\n this[key] = value;\r\n }\r\n : descriptor.set;\r\n if (ie8) {\r\n if (descriptor.value !== undefined)\r\n target[key] = descriptor.value;\r\n } else\r\n Object.defineProperty(target, key, descriptor);\r\n};\r\n\r\n/**\r\n * An immuable empty array.\r\n * @memberof util\r\n * @type {Array.<*>}\r\n */\r\nutil.emptyArray = Object.freeze([]);\r\n\r\n/**\r\n * An immutable empty object.\r\n * @type {Object}\r\n */\r\nutil.emptyObject = Object.freeze({});\r\n","\"use strict\";\r\nmodule.exports = Writer;\r\n\r\nWriter.BufferWriter = BufferWriter;\r\n\r\nvar util = require(29),\r\n ieee754 = require(1);\r\nvar LongBits = util.LongBits,\r\n ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\r\n\r\n/**\r\n * Constructs a new writer operation.\r\n * @classdesc Scheduled writer operation.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {*} val Value to write\r\n * @param {number} len Value byte length\r\n * @private\r\n * @ignore\r\n */\r\nfunction Op(fn, val, len) {\r\n\r\n /**\r\n * Function to call.\r\n * @type {function(Uint8Array, number, *)}\r\n */\r\n this.fn = fn;\r\n\r\n /**\r\n * Value to write.\r\n * @type {*}\r\n */\r\n this.val = val;\r\n\r\n /**\r\n * Value byte length.\r\n * @type {number}\r\n */\r\n this.len = len;\r\n\r\n /**\r\n * Next operation.\r\n * @type {?Writer.Op}\r\n */\r\n this.next = null;\r\n}\r\n\r\nWriter.Op = Op;\r\n\r\nfunction noop() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Constructs a new writer state.\r\n * @classdesc Copied writer state.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {Writer} writer Writer to copy state from\r\n * @param {State} next Next state entry\r\n * @private\r\n * @ignore\r\n */\r\nfunction State(writer, next) {\r\n\r\n /**\r\n * Current head.\r\n * @type {Writer.Op}\r\n */\r\n this.head = writer.head;\r\n\r\n /**\r\n * Current tail.\r\n * @type {Writer.Op}\r\n */\r\n this.tail = writer.tail;\r\n\r\n /**\r\n * Current buffer length.\r\n * @type {number}\r\n */\r\n this.len = writer.len;\r\n\r\n /**\r\n * Next state.\r\n * @type {?State}\r\n */\r\n this.next = next;\r\n}\r\n\r\nWriter.State = State;\r\n\r\n/**\r\n * Constructs a new writer.\r\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n */\r\nfunction Writer() {\r\n\r\n /**\r\n * Current length.\r\n * @type {number}\r\n */\r\n this.len = 0;\r\n\r\n /**\r\n * Operations head.\r\n * @type {Object}\r\n */\r\n this.head = new Op(noop, 0, 0);\r\n\r\n /**\r\n * Operations tail\r\n * @type {Object}\r\n */\r\n this.tail = this.head;\r\n\r\n /**\r\n * Linked forked states.\r\n * @type {?Object}\r\n */\r\n this.states = null;\r\n\r\n // When a value is written, the writer calculates its byte length and puts it into a linked\r\n // list of operations to perform when finish() is called. This both allows us to allocate\r\n // buffers of the exact required size and reduces the amount of work we have to do compared\r\n // to first calculating over objects and then encoding over objects. In our case, the encoding\r\n // part is just a linked list walk calling linked operations with already prepared values.\r\n}\r\n\r\n/**\r\n * Creates a new writer.\r\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\r\n */\r\nWriter.create = function create() {\r\n return new (util.Buffer && BufferWriter || Writer);\r\n};\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nWriter.alloc = function alloc(size) {\r\n return new ArrayImpl(size);\r\n};\r\n\r\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\r\nif (ArrayImpl !== Array)\r\n Writer.alloc = util.pool(Writer.alloc, ArrayImpl.prototype.subarray || ArrayImpl.prototype.slice);\r\n\r\n/** @alias Writer.prototype */\r\nvar WriterPrototype = Writer.prototype;\r\n\r\n/**\r\n * Pushes a new operation to the queue.\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.push = function push(fn, len, val) {\r\n var op = new Op(fn, val, len);\r\n this.tail.next = op;\r\n this.tail = op;\r\n this.len += len;\r\n return this;\r\n};\r\n\r\nfunction writeByte(buf, pos, val) {\r\n buf[pos] = val & 255;\r\n}\r\n\r\n/**\r\n * Writes a tag.\r\n * @param {number} id Field id\r\n * @param {number} wireType Wire type\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.tag = function write_tag(id, wireType) {\r\n return this.push(writeByte, 1, id << 3 | wireType & 7);\r\n};\r\n\r\nfunction writeVarint32(buf, pos, val) {\r\n while (val > 127) {\r\n buf[pos++] = val & 127 | 128;\r\n val >>>= 7;\r\n }\r\n buf[pos] = val;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as a varint.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.uint32 = function write_uint32(value) {\r\n value >>>= 0;\r\n return value < 128\r\n ? this.push(writeByte, 1, value)\r\n : this.push(writeVarint32,\r\n value < 16384 ? 2\r\n : value < 2097152 ? 3\r\n : value < 268435456 ? 4\r\n : 5\r\n , value);\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as a varint.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.int32 = function write_int32(value) {\r\n return value < 0\r\n ? this.push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\r\n : this.uint32(value);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as a varint, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sint32 = function write_sint32(value) {\r\n return this.uint32(value << 1 ^ value >> 31);\r\n};\r\n\r\nfunction writeVarint64(buf, pos, val) {\r\n // tends to deoptimize. stays optimized when using bits directly.\r\n while (val.hi) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\r\n val.hi >>>= 7;\r\n }\r\n while (val.lo > 127) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = val.lo >>> 7;\r\n }\r\n buf[pos++] = val.lo;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as a varint.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.uint64 = function write_uint64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.int64 = WriterPrototype.uint64;\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sint64 = function write_sint64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a boolish value as a varint.\r\n * @param {boolean} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bool = function write_bool(value) {\r\n return this.push(writeByte, 1, value ? 1 : 0);\r\n};\r\n\r\nfunction writeFixed32(buf, pos, val) {\r\n buf[pos++] = val & 255;\r\n buf[pos++] = val >>> 8 & 255;\r\n buf[pos++] = val >>> 16 & 255;\r\n buf[pos ] = val >>> 24;\r\n}\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fixed32 = function write_fixed32(value) {\r\n return this.push(writeFixed32, 4, value >>> 0);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sfixed32 = function write_sfixed32(value) {\r\n return this.push(writeFixed32, 4, value << 1 ^ value >> 31);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.fixed64 = function write_fixed64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeFixed32, 4, bits.hi).push(writeFixed32, 4, bits.lo);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sfixed64 = function write_sfixed64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeFixed32, 4, bits.hi).push(writeFixed32, 4, bits.lo);\r\n};\r\n\r\nvar writeFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function writeFloat_f32(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos ] = f8b[3];\r\n }\r\n : function writeFloat_f32_le(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeFloat_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Writes a float (32 bit).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.float = function write_float(value) {\r\n return this.push(writeFloat, 4, value);\r\n};\r\n\r\nvar writeDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function writeDouble_f64(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[6];\r\n buf[pos ] = f8b[7];\r\n }\r\n : function writeDouble_f64_le(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[7];\r\n buf[pos++] = f8b[6];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeDouble_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Writes a double (64 bit float).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.double = function write_double(value) {\r\n return this.push(writeDouble, 8, value);\r\n};\r\n\r\nvar writeBytes = ArrayImpl.prototype.set\r\n ? function writeBytes_set(buf, pos, val) {\r\n buf.set(val, pos);\r\n }\r\n : function writeBytes_for(buf, pos, val) {\r\n for (var i = 0; i < val.length; ++i)\r\n buf[pos + i] = val[i];\r\n };\r\n\r\n/**\r\n * Writes a sequence of bytes.\r\n * @param {Uint8Array} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bytes = function write_bytes(value) {\r\n var len = value.length >>> 0;\r\n return len\r\n ? this.uint32(len).push(writeBytes, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\nfunction writeString(buf, pos, val) {\r\n for (var i = 0; i < val.length; ++i) {\r\n var c1 = val.charCodeAt(i), c2;\r\n if (c1 < 128) {\r\n buf[pos++] = c1;\r\n } else if (c1 < 2048) {\r\n buf[pos++] = c1 >> 6 | 192;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = val.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buf[pos++] = c1 >> 18 | 240;\r\n buf[pos++] = c1 >> 12 & 63 | 128;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else {\r\n buf[pos++] = c1 >> 12 | 224;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n }\r\n }\r\n}\r\n\r\nfunction byteLength(val) {\r\n var strlen = val.length >>> 0;\r\n var len = 0;\r\n for (var i = 0; i < strlen; ++i) {\r\n var c1 = val.charCodeAt(i);\r\n if (c1 < 128)\r\n len += 1;\r\n else if (c1 < 2048)\r\n len += 2;\r\n else if ((c1 & 0xFC00) === 0xD800 && (val.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n}\r\n\r\n/**\r\n * Writes a string.\r\n * @param {string} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.string = function write_string(value) {\r\n var len = byteLength(value);\r\n return len\r\n ? this.uint32(len).push(writeString, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Forks this writer's state by pushing it to a stack.\r\n * Calling {@link Writer#}, {@link Writer#reset} or {@link Writer#finish} resets the writer to the previous state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fork = function fork() {\r\n this.states = new State(this, this.states);\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance to the last state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.reset = function reset() {\r\n if (this.states) {\r\n this.head = this.states.head;\r\n this.tail = this.states.tail;\r\n this.len = this.states.len;\r\n this.states = this.states.next;\r\n } else {\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\r\n * @param {number} [id] Id with wire type 2 to prepend as a tag where applicable\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.ldelim = function ldelim(id) {\r\n var head = this.head,\r\n tail = this.tail,\r\n len = this.len;\r\n this.reset();\r\n if (id !== undefined)\r\n this.tag(id, 2);\r\n this.uint32(len);\r\n this.tail.next = head.next; // skip noop\r\n this.tail = tail;\r\n this.len += len;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of write operations and frees all resources.\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nWriterPrototype.finish = function finish() {\r\n var head = this.head.next, // skip noop\r\n buf = this.constructor.alloc(this.len);\r\n this.reset();\r\n var pos = 0;\r\n while (head) {\r\n head.fn(buf, pos, head.val);\r\n pos += head.len;\r\n head = head.next;\r\n }\r\n return buf;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer writer.\r\n * @classdesc Wire format writer using node buffers.\r\n * @exports BufferWriter\r\n * @extends Writer\r\n * @constructor\r\n */\r\nfunction BufferWriter() {\r\n Writer.call(this);\r\n}\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nBufferWriter.alloc = function alloc_buffer(size) {\r\n BufferWriter.alloc = util.Buffer.allocUnsafe\r\n ? util.Buffer.allocUnsafe\r\n : function allocUnsafeNew(size) { return new util.Buffer(size); };\r\n return BufferWriter.alloc(size);\r\n};\r\n\r\n/** @alias BufferWriter.prototype */\r\nvar BufferWriterPrototype = BufferWriter.prototype = Object.create(Writer.prototype);\r\nBufferWriterPrototype.constructor = BufferWriter;\r\n\r\nfunction writeFloatBuffer(buf, pos, val) {\r\n buf.writeFloatLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.float = function write_float_buffer(value) {\r\n return this.push(writeFloatBuffer, 4, value);\r\n};\r\n\r\nfunction writeDoubleBuffer(buf, pos, val) {\r\n buf.writeDoubleLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.double = function write_double_buffer(value) {\r\n return this.push(writeDoubleBuffer, 8, value);\r\n};\r\n\r\nfunction writeBytesBuffer(buf, pos, val) {\r\n if (val.length)\r\n val.copy(buf, pos, 0, val.length);\r\n // This could probably be optimized just like writeStringBuffer, but most real use cases won't benefit much.\r\n}\r\n\r\nif (!(ArrayImpl.prototype.set && util.Buffer && util.Buffer.prototype.set)) // set is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.bytes = function write_bytes_buffer(value) {\r\n var len = value.length >>> 0;\r\n return len\r\n ? this.uint32(len).push(writeBytesBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\nvar writeStringBuffer = (function() { // eslint-disable-line wrap-iife\r\n return util.Buffer && util.Buffer.prototype.utf8Write // around forever, but not present in browser buffer\r\n ? function writeString_buffer_utf8Write(buf, pos, val) {\r\n if (val.length < 40)\r\n writeString(buf, pos, val);\r\n else\r\n buf.utf8Write(val, pos);\r\n }\r\n : function writeString_buffer_write(buf, pos, val) {\r\n if (val.length < 40)\r\n writeString(buf, pos, val);\r\n else\r\n buf.write(val, pos);\r\n };\r\n // Note that the plain JS encoder is faster for short strings, probably because of redundant assertions.\r\n // For a raw utf8Write, the breaking point is about 20 characters, for write it is around 40 characters.\r\n // Unfortunately, this does not translate 1:1 to real use cases, hence the common \"good enough\" limit of 40.\r\n})();\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.string = function write_string_buffer(value) {\r\n var len = value.length < 40\r\n ? byteLength(value)\r\n : util.Buffer.byteLength(value);\r\n return len\r\n ? this.uint32(len).push(writeStringBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n","\"use strict\";\r\nvar protobuf = global.protobuf = exports;\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\r\n * @param {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction load(filename, root, callback) {\r\n if (typeof root === 'function') {\r\n callback = root;\r\n root = new protobuf.Root();\r\n } else if (!root)\r\n root = new protobuf.Root();\r\n return root.load(filename, callback);\r\n}\r\n// function load(filename:string, root:Root, callback:function):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:function):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n// function load(filename:string, [root:Root]):Promise\r\n\r\nprotobuf.load = load;\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace.\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nfunction loadSync(filename, root) {\r\n if (!root)\r\n root = new protobuf.Root();\r\n return root.loadSync(filename);\r\n}\r\n\r\nprotobuf.loadSync = loadSync;\r\n\r\n// Parser\r\nprotobuf.tokenize = require(\"./tokenize\");\r\nprotobuf.parse = require(\"./parse\");\r\n\r\n// Serialization\r\nprotobuf.Writer = require(\"./writer\");\r\nprotobuf.BufferWriter = protobuf.Writer.BufferWriter;\r\nprotobuf.Reader = require(\"./reader\");\r\nprotobuf.BufferReader = protobuf.Reader.BufferReader;\r\nprotobuf.codegen = require(\"./codegen\");\r\n\r\n// Reflection\r\nprotobuf.ReflectionObject = require(\"./object\");\r\nprotobuf.Namespace = require(\"./namespace\");\r\nprotobuf.Root = require(\"./root\");\r\nprotobuf.Enum = require(\"./enum\");\r\nprotobuf.Type = require(\"./type\");\r\nprotobuf.Field = require(\"./field\");\r\nprotobuf.OneOf = require(\"./oneof\");\r\nprotobuf.MapField = require(\"./mapfield\");\r\nprotobuf.Service = require(\"./service\");\r\nprotobuf.Method = require(\"./method\");\r\n\r\n// Runtime\r\nprotobuf.Prototype = require(\"./prototype\");\r\nprotobuf.inherits = require(\"./inherits\");\r\n\r\n// Utility\r\nprotobuf.types = require(\"./types\");\r\nprotobuf.common = require(\"./common\");\r\nprotobuf.rpc = require(\"./rpc\");\r\nprotobuf.util = require(\"./util\");\r\n\r\n// Be nice to AMD\r\nif (typeof define === 'function' && define.amd)\r\n define([\"long\"], function(Long) {\r\n if (Long) {\r\n protobuf.util.Long = Long;\r\n protobuf.Reader.configure();\r\n }\r\n return protobuf;\r\n });\r\n"],"sourceRoot":"."} \ No newline at end of file +{"version":3,"sources":["node_modules/browser-pack/_prelude.js","lib/ieee754.js","src/class.js","src/codegen.js","src/codegen/decode.js","src/codegen/encode.js","src/codegen/verify.js","src/common.js","src/enum.js","src/field.js","src/mapfield.js","src/message.js","src/method.js","src/namespace.js","src/object.js","src/oneof.js","src/parse.js","src/reader.js","src/root.js","src/rpc.js","src/rpc/service.js","src/service.js","src/tokenize.js","src/type.js","src/types.js","src/util.js","src/util/eventemitter.js","src/util/longbits.js","src/util/pool.js","src/util/runtime.js","src/writer.js","src/index.js"],"names":["e","t","n","r","s","o","u","a","require","i","f","Error","code","l","exports","call","length","1","module","read","buffer","offset","isBE","mLen","nBytes","m","eLen","eMax","eBias","nBits","d","NaN","Infinity","Math","pow","write","value","c","rt","abs","isNaN","floor","log","LN2","Class","type","create","Message","Type","util","_TypeError","ctor","clazz","MessageCtor","properties","this","constructor","prototype","merge","$type","getFieldsArray","forEach","field","resolve","name","Array","isArray","defaultValue","emptyArray","isObject","emptyObject","getOneofsArray","oneof","prop","get","keys","Object","indexOf","set","codegen","gen","line","sprintf","apply","arguments","level","indent","src","prev","blockOpenRe","test","branchRe","casingRe","inCase","breakRe","blockCloseRe","index","push","str","replace","args","join","eof","scope","undefined","source","verbose","console","Function","concat","map","key","slice","supported","encode","decode","verify","Enum","Reader","types","fallback","readerOrBuffer","fields","getFieldsById","reader","limit","len","pos","message","getCtor","tag","id","resolvedType","keyType","resolvedKeyType","uint32","ks","vs","basic","longToHash","repeated","values","packed","wireType","plimit","skipType","generate","mtype","safeProp","Writer","writer","fi","fork","mapKey","ldelim","required","long","longNeq","reset","keyWireType","getFullName","getValuesById","reason","hasReasonVar","toArray","j","common","json","nested","google","protobuf","Any","type_url","timeType","Duration","seconds","nanos","Timestamp","Empty","Struct","Value","oneofs","kind","nullValue","numberValue","stringValue","boolValue","structValue","listValue","NullValue","NULL_VALUE","ListValue","rule","options","ReflectionObject","_valuesById","clearCache","enm","EnumPrototype","extend","props","valuesById","testJSON","Boolean","fromJSON","toJSON","add","isString","isInteger","remove","Field","toString","toLowerCase","optional","partOf","Long","extensionField","declaringField","_packed","FieldPrototype","MapField","isPacked","getOption","setOption","ifNotSet","role","resolved","typeDefault","defaults","parent","lookup","optionDefault","fromValue","jsonConvert","String","Number","toNumber","charAt","MapFieldPrototype","MessagePrototype","asJSON","k","array","fieldsOnly","encodeDelimited","decodeDelimited","Method","requestType","responseType","requestStream","responseStream","resolvedRequestType","resolvedResponseType","MethodPrototype","Namespace","_nestedArray","namespace","arrayToJSON","obj","NamespacePrototype","Service","nestedTypes","nestedError","nestedArray","methods","addJSON","getNestedArray","nestedJson","ns","nestedName","object","setOptions","onAdd","onRemove","define","path","split","ptr","part","shift","resolveAll","parentAlreadyChecked","getRoot","found","Root","ReflectionObjectPrototype","root","fullName","unshift","_handleAdd","_handleRemove","OneOf","fieldNames","ucName","substring","toUpperCase","_fields","addFieldsToParent","OneOfPrototype","splice","lower","token","parse","illegal","tn","s_bclose","readString","next","s_dq","s_sq","skip","peek","readValue","acceptTypeRef","parseNumber","typeRefRe","readRange","start","parseId","end","s_semi","sign","tokenLower","parseInt","parseFloat","acceptNegative","parsePackage","pkg","s_name","parseImport","whichImports","weakImports","imports","parseSyntax","syntax","p3","isProto3","parseCommon","s_option","parseOption","parseType","parseEnum","parseService","parseExtension","nameRe","s_open","s_close","parseMapField","s_required","s_optional","s_repeated","parseField","parseOneOf","extensions","reserved","s_type","camelCase","parseInlineOptions","valueType","parseEnumField","custom","s_bopen","fqTypeRefRe","parseOptionValue","service","parseMethod","st","method","reference","tokenize","head","package","indexOutOfRange","writeLength","RangeError","configure","ReaderPrototype","int64","read_int64_long","uint64","read_uint64_long","sint64","read_sint64_long","fixed64","read_fixed64_long","sfixed64","read_sfixed64_long","read_int64_number","read_uint64_number","read_sint64_number","read_fixed64_number","read_sfixed64_number","buf","Tag","readLongVarint","lo","hi","b","LongBits","toLong","zzDecode","readLongFixed","BufferReader","initBufferReader","readStringBuffer_utf8Slice","utf8Slice","readStringBuffer_toString","ieee754","ArrayImpl","Uint8Array","Buffer","isBuffer","_slice","subarray","int32","octet","sint32","bool","fixed32","sfixed32","readFloat","Float32Array","f32","f8b","float","readDouble","Float64Array","f64","double","bytes","string","out","p","c1","fromCharCode","finish","remain","BufferReaderPrototype","readStringBuffer","readFloatLE","readDoubleLE","deferred","files","SYNC","handleExtension","extendedType","sisterField","RootPrototype","resolvePath","load","filename","callback","err","cb","process","JSON","parsed","self","fetch","sync","queued","weak","idx","altname","setTimeout","fs","readFileSync","asPromise","loadSync","newDeferred","rpc","rpcImpl","EventEmitter","$rpc","ServicePrototype","endedByRPC","emit","off","_methodsArray","methodsArray","methodName","inherited","getMethodsArray","requestDelimited","responseDelimited","rpcService","request","requestData","setImmediate","responseData","response","err2","unescape","$0","$1","subject","re","stringDelim","stringDoubleRe","stringSingleRe","lastIndex","match","exec","stack","repeat","curr","s_nl","s_sl","s_as","delimRe","delim","expected","actual","equals","_fieldsById","_fieldsArray","_repeatedFieldsArray","_oneofsArray","_ctor","TypePrototype","fieldsById","names","fieldsArray","repeatedFieldsArray","filter","oneofsArray","fieldName","oneOfName","fld","bake","fn","ctx","Promise","reject","onload","xhr","status","responseText","readFile","XMLHttpRequest","onreadystatechange","readyState","open","send","isAbsolutePath","normalizePath","parts","prefix","isFinite","description","TypeError","eval","originPath","importPath","alreadyNormalized","dst","format","params","param","stringify","underScore","newBuffer","size","allocUnsafe","_listeners","EventEmitterPrototype","on","evt","listeners","LongBitsPrototype","zero","zzEncode","fromNumber","from","fromString","low","high","unsigned","charCodeAt","fromHash","hash","toHash","mask","part0","part1","part2","pool","alloc","SIZE","MAX","slab","isNode","global","versions","node","dcodeIO","longFromHash","bits","fromBits","target","descriptors","descriptor","ie8","ucKey","defineProperty","freeze","Op","val","noop","State","tail","states","writeByte","writeVarint32","writeVarint64","writeFixed32","writeString","c2","byteLength","strlen","BufferWriter","writeFloatBuffer","writeFloatLE","writeDoubleBuffer","writeDoubleLE","writeBytesBuffer","copy","WriterPrototype","op","writeFloat","writeDouble","writeBytes","B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A,GACAkK,EAAA4S,IAAA9c,EAAA,IACAkK,EAAAzH,KAAAzC,EAAA,IAGA,kBAAA0Q,SAAAA,OAAAyW,KACAzW,QAAA,QAAA,SAAA3D,GAKA,MAJAA,KACA7C,EAAAzH,KAAAsK,KAAAA,EACA7C,EAAApD,OAAAiQ,aAEA7M","file":"protobuf.min.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o> 1,\r\n nBits = -7,\r\n i = isBE ? 0 : (nBytes - 1),\r\n d = isBE ? 1 : -1,\r\n s = buffer[offset + i];\r\n\r\n i += d;\r\n\r\n e = s & ((1 << (-nBits)) - 1);\r\n s >>= (-nBits);\r\n nBits += eLen;\r\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n m = e & ((1 << (-nBits)) - 1);\r\n e >>= (-nBits);\r\n nBits += mLen;\r\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n if (e === 0) {\r\n e = 1 - eBias;\r\n } else if (e === eMax) {\r\n return m ? NaN : ((s ? -1 : 1) * Infinity);\r\n } else {\r\n m = m + Math.pow(2, mLen);\r\n e = e - eBias;\r\n }\r\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen);\r\n};\r\n\r\nexports.write = function writeIEEE754(buffer, value, offset, isBE, mLen, nBytes) {\r\n var e, m, c,\r\n eLen = nBytes * 8 - mLen - 1,\r\n eMax = (1 << eLen) - 1,\r\n eBias = eMax >> 1,\r\n rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),\r\n i = isBE ? (nBytes - 1) : 0,\r\n d = isBE ? -1 : 1,\r\n s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;\r\n\r\n value = Math.abs(value);\r\n\r\n if (isNaN(value) || value === Infinity) {\r\n m = isNaN(value) ? 1 : 0;\r\n e = eMax;\r\n } else {\r\n e = Math.floor(Math.log(value) / Math.LN2);\r\n if (value * (c = Math.pow(2, -e)) < 1) {\r\n e--;\r\n c *= 2;\r\n }\r\n if (e + eBias >= 1) {\r\n value += rt / c;\r\n } else {\r\n value += rt * Math.pow(2, 1 - eBias);\r\n }\r\n if (value * c >= 2) {\r\n e++;\r\n c /= 2;\r\n }\r\n\r\n if (e + eBias >= eMax) {\r\n m = 0;\r\n e = eMax;\r\n } else if (e + eBias >= 1) {\r\n m = (value * c - 1) * Math.pow(2, mLen);\r\n e = e + eBias;\r\n } else {\r\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\r\n e = 0;\r\n }\r\n }\r\n\r\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);\r\n\r\n e = (e << mLen) | m;\r\n eLen += mLen;\r\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);\r\n\r\n buffer[offset + i - d] |= s * 128;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Class;\r\n\r\nvar Message = require(11),\r\n Type = require(23),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a class instance, which is also a message prototype.\r\n * @classdesc Runtime class providing the tools to create your own custom classes.\r\n * @constructor\r\n * @param {Type} type Reflected type\r\n * @abstract\r\n */\r\nfunction Class(type) {\r\n return Class.create(type);\r\n}\r\n\r\n/**\r\n * Constructs a new message prototype for the specified reflected type and sets up its constructor.\r\n * @param {Type} type Reflected message type\r\n * @param {*} [ctor] Custom constructor to set up, defaults to create a generic one if omitted\r\n * @returns {Message} Message prototype\r\n */\r\nClass.create = function create(type, ctor) {\r\n if (!(type instanceof Type))\r\n throw _TypeError(\"type\", \"a Type\");\r\n var clazz = ctor;\r\n if (clazz) {\r\n if (typeof clazz !== 'function')\r\n throw _TypeError(\"ctor\", \"a function\");\r\n } else\r\n clazz = (function(MessageCtor) { // eslint-disable-line wrap-iife\r\n return function Message(properties) {\r\n MessageCtor.call(this, properties);\r\n };\r\n })(Message);\r\n\r\n // Let's pretend...\r\n clazz.constructor = Class;\r\n \r\n // new Class() -> Message.prototype\r\n var prototype = clazz.prototype = new Message();\r\n prototype.constructor = clazz;\r\n\r\n // Static methods on Message are instance methods on Class and vice-versa.\r\n util.merge(clazz, Message, true);\r\n\r\n // Classes and messages reference their reflected type\r\n clazz.$type = type;\r\n prototype.$type = type;\r\n\r\n // Messages have non-enumerable default values on their prototype\r\n type.getFieldsArray().forEach(function(field) {\r\n field.resolve();\r\n // objects on the prototype must be immmutable. users must assign a new object instance and\r\n // cannot use Array#push on empty arrays on the prototype for example, as this would modify\r\n // the value on the prototype for ALL messages of this type. Hence, these objects are frozen.\r\n prototype[field.name] = Array.isArray(field.defaultValue)\r\n ? util.emptyArray\r\n : util.isObject(field.defaultValue)\r\n ? util.emptyObject\r\n : field.defaultValue;\r\n });\r\n\r\n // Runtime messages have non-enumerable getters and setters for each virtual oneof field\r\n type.getOneofsArray().forEach(function(oneof) {\r\n util.prop(prototype, oneof.resolve().name, {\r\n get: function getVirtual() {\r\n // > If the parser encounters multiple members of the same oneof on the wire, only the last member seen is used in the parsed message.\r\n var keys = Object.keys(this);\r\n for (var i = keys.length - 1; i > -1; --i)\r\n if (oneof.oneof.indexOf(keys[i]) > -1)\r\n return keys[i];\r\n return undefined;\r\n },\r\n set: function setVirtual(value) {\r\n var keys = oneof.oneof;\r\n for (var i = 0; i < keys.length; ++i)\r\n if (keys[i] !== value)\r\n delete this[keys[i]];\r\n }\r\n });\r\n });\r\n\r\n // Register\r\n type.ctor = clazz;\r\n\r\n return prototype;\r\n};\r\n\r\n// Static methods on Message are instance methods on Class and vice-versa.\r\nClass.prototype = Message;\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @name Class#encode\r\n * @function\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @name Class#encodeDelimited\r\n * @function\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Class#decode\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Class#decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Class#verify\r\n * @function\r\n * @param {Message|Object} message Message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\nvar util = require(25);\r\n\r\nvar blockOpenRe = /[{[]$/,\r\n blockCloseRe = /^[}\\]]/,\r\n casingRe = /:$/,\r\n branchRe = /^\\s*(?:if|else if|while|for)\\b|\\b(?:else)\\s*$/,\r\n breakRe = /\\b(?:break|continue);?$|^\\s*return\\b/;\r\n\r\n/**\r\n * A closure for generating functions programmatically.\r\n * @namespace\r\n * @function\r\n * @param {...string} params Function parameter names\r\n * @returns {CodegenInstance} Codegen instance\r\n * @property {boolean} supported Whether code generation is supported by the environment.\r\n * @property {boolean} verbose=false When set to true, codegen will log generated code to console. Useful for debugging.\r\n */\r\nfunction codegen() {\r\n var args = Array.prototype.slice.call(arguments),\r\n src = ['\\t\"use strict\"'],\r\n indent = 1,\r\n inCase = false;\r\n\r\n /**\r\n * A codegen instance as returned by {@link codegen}, that also is a {@link util.sprintf|sprintf}-like appender function.\r\n * @typedef CodegenInstance\r\n * @type {function}\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {CodegenInstance} Itself\r\n * @property {function(string=):string} str Stringifies the so far generated function source.\r\n * @property {function(string=, Object=):function} eof Ends generation and builds the function whilst applying a scope.\r\n */\r\n /**/\r\n function gen() {\r\n var line = util.sprintf.apply(null, arguments);\r\n var level = indent;\r\n if (src.length) {\r\n var prev = src[src.length - 1];\r\n\r\n // block open or one time branch\r\n if (blockOpenRe.test(prev))\r\n level = ++indent; // keep\r\n else if (branchRe.test(prev))\r\n ++level; // once\r\n \r\n // casing\r\n if (casingRe.test(prev) && !casingRe.test(line)) {\r\n level = ++indent;\r\n inCase = true;\r\n } else if (inCase && breakRe.test(prev)) {\r\n level = --indent;\r\n inCase = false;\r\n }\r\n\r\n // block close\r\n if (blockCloseRe.test(line))\r\n level = --indent;\r\n }\r\n for (var index = 0; index < level; ++index)\r\n line = \"\\t\" + line;\r\n src.push(line);\r\n return gen;\r\n }\r\n\r\n /**\r\n * Stringifies the so far generated function source.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @returns {string} Function source using tabs for indentation\r\n * @inner\r\n */\r\n function str(name) {\r\n return \"function \" + (name ? name.replace(/[^\\w_$]/g, \"_\") : \"\") + \"(\" + args.join(\", \") + \") {\\n\" + src.join(\"\\n\") + \"\\n}\";\r\n }\r\n\r\n gen.str = str;\r\n\r\n /**\r\n * Ends generation and builds the function whilst applying a scope.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @param {Object} [scope] Function scope\r\n * @returns {function} The generated function, with scope applied if specified\r\n * @inner\r\n */\r\n function eof(name, scope) {\r\n if (typeof name === 'object') {\r\n scope = name;\r\n name = undefined;\r\n }\r\n var source = gen.str(name);\r\n if (codegen.verbose)\r\n console.log(\"--- codegen ---\\n\" + source.replace(/^/mg, \"> \").replace(/\\t/g, \" \")); // eslint-disable-line no-console\r\n var keys = Object.keys(scope || (scope = {}));\r\n return Function.apply(null, keys.concat(\"return \" + source)).apply(null, keys.map(function(key) { return scope[key]; })); // eslint-disable-line no-new-func\r\n // ^ Creates a wrapper function with the scoped variable names as its parameters,\r\n // calls it with the respective scoped variable values ^\r\n // and returns our brand-new properly scoped function.\r\n //\r\n // This works because \"Invoking the Function constructor as a function (without using the\r\n // new operator) has the same effect as invoking it as a constructor.\"\r\n // https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Function\r\n }\r\n\r\n gen.eof = eof;\r\n\r\n return gen;\r\n}\r\n\r\ncodegen.supported = false; try { codegen.supported = codegen(\"a\",\"b\")(\"return a-b\").eof()(2,1) === 1; } catch (e) {} // eslint-disable-line no-empty\r\ncodegen.verbose = false;\r\n\r\ncodegen.encode = require(5);\r\ncodegen.decode = require(4);\r\ncodegen.verify = require(6);\r\n","\"use strict\";\r\n\r\n/**\r\n * Wire format decoder using code generation on top of reflection that also provides a fallback.\r\n * @exports codegen.decode\r\n * @namespace\r\n */\r\nvar decode = exports;\r\n\r\nvar Enum = require(8),\r\n Reader = require(17),\r\n types = require(24),\r\n util = require(25),\r\n codegen = require(3);\r\n\r\n/**\r\n * Decodes a message of `this` message's type.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message} Populated runtime message\r\n * @this Type\r\n */\r\ndecode.fallback = function decode_fallback(readerOrBuffer, length) {\r\n /* eslint-disable no-invalid-this, block-scoped-var, no-redeclare */\r\n var fields = this.getFieldsById(),\r\n reader = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer),\r\n limit = length === undefined ? reader.len : reader.pos + length,\r\n message = new (this.getCtor())();\r\n while (reader.pos < limit) {\r\n var tag = reader.tag(),\r\n field = fields[tag.id].resolve(),\r\n type = field.resolvedType instanceof Enum ? \"uint32\" : field.type;\r\n \r\n // Known fields\r\n if (field) {\r\n\r\n // Map fields\r\n if (field.map) {\r\n var keyType = field.resolvedKeyType /* only valid is enum */ ? \"uint32\" : field.keyType,\r\n length = reader.uint32();\r\n var map = message[field.name] = {};\r\n if (length) {\r\n length += reader.pos;\r\n var ks = [], vs = [];\r\n while (reader.pos < length) {\r\n if (reader.tag().id === 1)\r\n ks[ks.length] = reader[keyType]();\r\n else if (types.basic[type] !== undefined)\r\n vs[vs.length] = reader[type]();\r\n else\r\n vs[vs.length] = field.resolvedType.decode(reader, reader.uint32());\r\n }\r\n for (var i = 0; i < ks.length; ++i)\r\n map[typeof ks[i] === 'object' ? util.longToHash(ks[i]) : ks[i]] = vs[i];\r\n }\r\n\r\n // Repeated fields\r\n } else if (field.repeated) {\r\n var values = message[field.name] && message[field.name].length ? message[field.name] : message[field.name] = [];\r\n\r\n // Packed\r\n if (field.packed && types.packed[type] !== undefined && tag.wireType === 2) {\r\n var plimit = reader.uint32() + reader.pos;\r\n while (reader.pos < plimit)\r\n values[values.length] = reader[type]();\r\n\r\n // Non-packed\r\n } else if (types.basic[type] !== undefined)\r\n values[values.length] = reader[type]();\r\n else\r\n values[values.length] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Non-repeated\r\n } else if (types.basic[type] !== undefined)\r\n message[field.name] = reader[type]();\r\n else\r\n message[field.name] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Unknown fields\r\n } else\r\n reader.skipType(tag.wireType);\r\n }\r\n return message;\r\n /* eslint-enable no-invalid-this, block-scoped-var, no-redeclare */\r\n};\r\n\r\n/**\r\n * Generates a decoder specific to the specified message type, with an identical signature to {@link codegen.decode.fallback}.\r\n * @param {Type} mtype Message type\r\n * @returns {CodegenInstance} {@link codegen|Codegen} instance\r\n */\r\ndecode.generate = function decode_generate(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n var fields = mtype.getFieldsArray(); \r\n var gen = codegen(\"r\", \"l\")\r\n\r\n (\"r instanceof Reader||(r=Reader.create(r))\")\r\n (\"var c=l===undefined?r.len:r.pos+l,m=new(this.getCtor())\")\r\n (\"while(r.pos} [values] Enum values as an object, by name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Enum(name, values, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Enum values by name.\r\n * @type {Object.}\r\n */\r\n this.values = values || {}; // toJSON, marker\r\n\r\n /**\r\n * Cached values by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._valuesById = null;\r\n}\r\n\r\nutil.props(EnumPrototype, {\r\n\r\n /**\r\n * Enum values by id.\r\n * @name Enum#valuesById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n valuesById: {\r\n get: function getValuesById() {\r\n if (!this._valuesById) {\r\n this._valuesById = {};\r\n Object.keys(this.values).forEach(function(name) {\r\n var id = this.values[name];\r\n if (this._valuesById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._valuesById[id] = name;\r\n }, this);\r\n }\r\n return this._valuesById;\r\n }\r\n }\r\n\r\n /**\r\n * Gets this enum's values by id. This is an alias of {@link Enum#valuesById}'s getter for use within non-ES5 environments.\r\n * @name Enum#getValuesById\r\n * @function\r\n * @returns {Object.}\r\n */\r\n});\r\n\r\nfunction clearCache(enm) {\r\n enm._valuesById = null;\r\n return enm;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes an enum.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes an enum\r\n */\r\nEnum.testJSON = function testJSON(json) {\r\n return Boolean(json && json.values);\r\n};\r\n\r\n/**\r\n * Creates an enum from JSON.\r\n * @param {string} name Enum name\r\n * @param {Object.} json JSON object\r\n * @returns {Enum} Created enum\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nEnum.fromJSON = function fromJSON(name, json) {\r\n return new Enum(name, json.values, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nEnumPrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n values : this.values\r\n };\r\n};\r\n\r\n/**\r\n * Adds a value to this enum.\r\n * @param {string} name Value name\r\n * @param {number} id Value id\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a value with this name or id\r\n */\r\nEnumPrototype.add = function(name, id) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (this.values[name] !== undefined)\r\n throw Error('duplicate name \"' + name + '\" in ' + this);\r\n if (this.getValuesById()[id] !== undefined)\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this.values[name] = id;\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a value from this enum\r\n * @param {string} name Value name\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `name` is not a name of this enum\r\n */\r\nEnumPrototype.remove = function(name) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (this.values[name] === undefined)\r\n throw Error('\"' + name + '\" is not a name of ' + this);\r\n delete this.values[name];\r\n return clearCache(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Field;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = ReflectionObject.extend(Field);\r\n\r\nvar Type = require(23),\r\n Enum = require(8),\r\n MapField = require(10),\r\n types = require(24),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\r\n * @classdesc Reflected message field.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object} [rule=\"optional\"] Field rule\r\n * @param {string|Object} [extend] Extended type if different from parent\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Field(name, id, type, rule, extend, options) {\r\n if (util.isObject(rule)) {\r\n options = rule;\r\n rule = extend = undefined;\r\n } else if (util.isObject(extend)) {\r\n options = extend;\r\n extend = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (!util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (extend !== undefined && !util.isString(extend))\r\n throw _TypeError(\"extend\");\r\n if (rule !== undefined && !/^required|optional|repeated$/.test(rule = rule.toString().toLowerCase()))\r\n throw _TypeError(\"rule\", \"a valid rule string\");\r\n\r\n /**\r\n * Field rule, if any.\r\n * @type {string|undefined}\r\n */\r\n this.rule = rule && rule !== 'optional' ? rule : undefined; // toJSON\r\n\r\n /**\r\n * Field type.\r\n * @type {string}\r\n */\r\n this.type = type; // toJSON\r\n\r\n /**\r\n * Unique field id.\r\n * @type {number}\r\n */\r\n this.id = id; // toJSON, marker\r\n\r\n /**\r\n * Extended type if different from parent.\r\n * @type {string|undefined}\r\n */\r\n this.extend = extend || undefined; // toJSON\r\n\r\n /**\r\n * Whether this field is required.\r\n * @type {boolean}\r\n */\r\n this.required = rule === \"required\";\r\n\r\n /**\r\n * Whether this field is optional.\r\n * @type {boolean}\r\n */\r\n this.optional = !this.required;\r\n\r\n /**\r\n * Whether this field is repeated.\r\n * @type {boolean}\r\n */\r\n this.repeated = rule === \"repeated\";\r\n\r\n /**\r\n * Whether this field is a map or not.\r\n * @type {boolean}\r\n */\r\n this.map = false;\r\n\r\n /**\r\n * Message this field belongs to.\r\n * @type {?Type}\r\n */\r\n this.message = null;\r\n\r\n /**\r\n * OneOf this field belongs to, if any,\r\n * @type {?OneOf}\r\n */\r\n this.partOf = null;\r\n\r\n /**\r\n * The field's default value. Only relevant when working with proto2.\r\n * @type {*}\r\n */\r\n this.defaultValue = null;\r\n\r\n /**\r\n * Whether this field's value should be treated as a long.\r\n * @type {boolean}\r\n */\r\n this.long = util.Long ? types.long[type] !== undefined : false;\r\n\r\n /**\r\n * Resolved type if not a basic type.\r\n * @type {?(Type|Enum)}\r\n */\r\n this.resolvedType = null;\r\n\r\n /**\r\n * Sister-field within the extended type if a declaring extension field.\r\n * @type {?Field}\r\n */\r\n this.extensionField = null;\r\n\r\n /**\r\n * Sister-field within the declaring namespace if an extended field.\r\n * @type {?Field}\r\n */\r\n this.declaringField = null;\r\n\r\n /**\r\n * Internally remembers whether this field is packed.\r\n * @type {?boolean}\r\n * @private\r\n */\r\n this._packed = null;\r\n}\r\n\r\nutil.props(FieldPrototype, {\r\n\r\n /**\r\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\r\n * @name Field#packed\r\n * @type {boolean}\r\n * @readonly\r\n */\r\n packed: {\r\n get: FieldPrototype.isPacked = function() {\r\n if (this._packed === null)\r\n this._packed = this.getOption(\"packed\") !== false;\r\n return this._packed;\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether this field is packed. This is an alias of {@link Field#packed}'s getter for use within non-ES5 environments.\r\n * @name Field#isPacked\r\n * @function\r\n * @returns {boolean}\r\n */\r\n});\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (name === \"packed\")\r\n this._packed = null;\r\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\r\n};\r\n\r\n/**\r\n * Tests if the specified JSON object describes a field.\r\n * @param {*} json Any JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nField.testJSON = function testJSON(json) {\r\n return Boolean(json && json.id !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {Field} Created field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nField.fromJSON = function fromJSON(name, json) {\r\n if (json.keyType !== undefined)\r\n return MapField.fromJSON(name, json);\r\n return new Field(name, json.id, json.type, json.role, json.extend, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n rule : this.rule !== \"optional\" && this.rule || undefined,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Resolves this field's type references.\r\n * @returns {Field} `this`\r\n * @throws {Error} If any reference cannot be resolved\r\n */\r\nFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n\r\n var typeDefault = types.defaults[this.type];\r\n\r\n // if not a basic type, resolve it\r\n if (typeDefault === undefined) {\r\n var resolved = this.parent.lookup(this.type);\r\n if (resolved instanceof Type) {\r\n this.resolvedType = resolved;\r\n typeDefault = null;\r\n } else if (resolved instanceof Enum) {\r\n this.resolvedType = resolved;\r\n typeDefault = 0;\r\n } else\r\n throw Error(\"unresolvable field type: \" + this.type);\r\n }\r\n\r\n // when everything is resolved determine the default value\r\n var optionDefault;\r\n if (this.map)\r\n this.defaultValue = {};\r\n else if (this.repeated)\r\n this.defaultValue = [];\r\n else if (this.options && (optionDefault = this.options['default']) !== undefined) // eslint-disable-line dot-notation\r\n this.defaultValue = optionDefault;\r\n else\r\n this.defaultValue = typeDefault;\r\n\r\n if (this.long)\r\n this.defaultValue = util.Long.fromValue(this.defaultValue);\r\n \r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Converts a field value to JSON using the specified options. Note that this method does not account for repeated fields and must be called once for each repeated element instead.\r\n * @param {*} value Field value\r\n * @param {Object.} [options] Conversion options\r\n * @returns {*} Converted value\r\n * @see {@link Message#asJSON}\r\n */\r\nFieldPrototype.jsonConvert = function(value, options) {\r\n if (options) {\r\n if (this.resolvedType instanceof Enum && options['enum'] === String) // eslint-disable-line dot-notation\r\n return this.resolvedType.getValuesById()[value];\r\n else if (this.long && options.long)\r\n return options.long === Number\r\n ? typeof value === 'number'\r\n ? value\r\n : util.Long.fromValue(value).toNumber()\r\n : util.Long.fromValue(value, this.type.charAt(0) === 'u').toString();\r\n }\r\n return value;\r\n};\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\nvar Field = require(9);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = Field.prototype;\r\n/** @alias MapField.prototype */\r\nvar MapFieldPrototype = Field.extend(MapField);\r\n\r\nvar Enum = require(8),\r\n types = require(24),\r\n util = require(25);\r\n\r\n/**\r\n * Constructs a new map field instance.\r\n * @classdesc Reflected map field.\r\n * @extends Field\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} keyType Key type\r\n * @param {string} type Value type\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction MapField(name, id, keyType, type, options) {\r\n Field.call(this, name, id, type, options);\r\n if (!util.isString(keyType))\r\n throw util._TypeError(\"keyType\");\r\n \r\n /**\r\n * Key type.\r\n * @type {string}\r\n */\r\n this.keyType = keyType; // toJSON, marker\r\n\r\n /**\r\n * Resolved key type if not a basic type.\r\n * @type {?ReflectionObject}\r\n */\r\n this.resolvedKeyType = null;\r\n\r\n // Overrides Field#map\r\n this.map = true;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a map field.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nMapField.testJSON = function testJSON(json) {\r\n return Field.testJSON(json) && json.keyType !== undefined;\r\n};\r\n\r\n/**\r\n * Constructs a map field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created map field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMapField.fromJSON = function fromJSON(name, json) {\r\n return new MapField(name, json.id, json.keyType, json.type, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n keyType : this.keyType,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n \r\n // Besides a value type, map fields have a key type to resolve\r\n var keyWireType = types.mapKey[this.keyType];\r\n if (keyWireType === undefined) {\r\n var resolved = this.parent.lookup(this.keyType);\r\n if (!(resolved instanceof Enum))\r\n throw Error(\"unresolvable map key type: \" + this.keyType);\r\n this.resolvedKeyType = resolved;\r\n }\r\n\r\n return FieldPrototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Message;\r\n\r\n/**\r\n * Constructs a new message instance.\r\n * \r\n * This method should be called from your custom constructors, i.e. `Message.call(this, properties)`.\r\n * @classdesc Abstract runtime message.\r\n * @extends {Object}\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set\r\n * @abstract\r\n * @see {@link Class.create}\r\n */\r\nfunction Message(properties) {\r\n if (properties) {\r\n var keys = Object.keys(properties);\r\n for (var i = 0; i < keys.length; ++i)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n}\r\n\r\n/** @alias Message.prototype */\r\nvar MessagePrototype = Message.prototype;\r\n\r\n/**\r\n * Converts this message to a JSON object.\r\n * @param {Object.} [options] Conversion options\r\n * @param {boolean} [options.fieldsOnly=false] Converts only properties that reference a field\r\n * @param {*} [options.long] Long conversion type. Only relevant with a long library.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to a possibly unsafe number without, and a `Long` with a long library.\r\n * @param {*} [options.enum=Number] Enum value conversion type.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to the numeric ids.\r\n * @param {boolean} [options.defaults=false] Also sets default values on the resulting object\r\n * @returns {Object.} JSON object\r\n */\r\nMessagePrototype.asJSON = function asJSON(options) {\r\n if (!options)\r\n options = {};\r\n var fields = this.$type.fields,\r\n json = {};\r\n var keys;\r\n if (options.defaults) {\r\n keys = [];\r\n for (var k in this) // eslint-disable-line guard-for-in\r\n keys.push(k);\r\n } else\r\n keys = Object.keys(this);\r\n for (var i = 0, key; i < keys.length; ++i) {\r\n var field = fields[key = keys[i]],\r\n value = this[key];\r\n if (field) {\r\n if (field.repeated) {\r\n if (value && value.length) {\r\n var array = new Array(value.length);\r\n for (var j = 0, l = value.length; j < l; ++j)\r\n array[j] = field.jsonConvert(value[j], options);\r\n json[key] = array;\r\n }\r\n } else\r\n json[key] = field.jsonConvert(value, options);\r\n } else if (!options.fieldsOnly)\r\n json[key] = value;\r\n }\r\n return json;\r\n};\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\nMessage.encode = function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Message.decode\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\nMessage.decode = function decode(readerOrBuffer) {\r\n return this.$type.decode(readerOrBuffer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Message.decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\nMessage.decodeDelimited = function decodeDelimited(readerOrBuffer) {\r\n return this.$type.decodeDelimited(readerOrBuffer);\r\n};\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Message.verify\r\n * @function\r\n * @param {Message|Object} message Message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\nMessage.verify = function verify(message) {\r\n return this.$type.verify(message);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Method;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias Method.prototype */\r\nvar MethodPrototype = ReflectionObject.extend(Method);\r\n\r\nvar Type = require(23),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new service method instance.\r\n * @classdesc Reflected service method.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Method name\r\n * @param {string|undefined} type Method type, usually `\"rpc\"`\r\n * @param {string} requestType Request message type\r\n * @param {string} responseType Response message type\r\n * @param {boolean|Object} [requestStream] Whether the request is streamed\r\n * @param {boolean|Object} [responseStream] Whether the response is streamed\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options) {\r\n if (util.isObject(requestStream)) {\r\n options = requestStream;\r\n requestStream = responseStream = undefined;\r\n } else if (util.isObject(responseStream)) {\r\n options = responseStream;\r\n responseStream = undefined;\r\n }\r\n if (type && !util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (!util.isString(requestType))\r\n throw _TypeError(\"requestType\");\r\n if (!util.isString(responseType))\r\n throw _TypeError(\"responseType\");\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Method type.\r\n * @type {string}\r\n */\r\n this.type = type || \"rpc\"; // toJSON\r\n\r\n /**\r\n * Request type.\r\n * @type {string}\r\n */\r\n this.requestType = requestType; // toJSON, marker\r\n\r\n /**\r\n * Whether requests are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.requestStream = requestStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Response type.\r\n * @type {string}\r\n */\r\n this.responseType = responseType; // toJSON\r\n\r\n /**\r\n * Whether responses are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.responseStream = responseStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Resolved request type.\r\n * @type {?Type}\r\n */\r\n this.resolvedRequestType = null;\r\n\r\n /**\r\n * Resolved response type.\r\n * @type {?Type}\r\n */\r\n this.resolvedResponseType = null;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service method.\r\n * @param {Object} json JSON object\r\n * @returns {boolean} `true` if the object describes a map field\r\n */\r\nMethod.testJSON = function testJSON(json) {\r\n return Boolean(json && json.requestType !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a service method from JSON.\r\n * @param {string} name Method name\r\n * @param {Object} json JSON object\r\n * @returns {Method} Created method\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMethod.fromJSON = function fromJSON(name, json) {\r\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.toJSON = function toJSON() {\r\n return {\r\n type : this.type !== \"rpc\" && this.type || undefined,\r\n requestType : this.requestType,\r\n requestStream : this.requestStream,\r\n responseType : this.responseType,\r\n responseStream : this.responseStream,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var resolved = this.parent.lookup(this.requestType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable request type: \" + this.requestType);\r\n this.resolvedRequestType = resolved;\r\n resolved = this.parent.lookup(this.responseType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable response type: \" + this.requestType);\r\n this.resolvedResponseType = resolved;\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Namespace;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = ReflectionObject.extend(Namespace);\r\n\r\nvar Enum = require(8),\r\n Type = require(23),\r\n Field = require(9),\r\n Service = require(21),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\nvar nestedTypes = [ Enum, Type, Service, Field, Namespace ],\r\n nestedError = \"one of \" + nestedTypes.map(function(ctor) { return ctor.name; }).join(', ');\r\n\r\n/**\r\n * Constructs a new namespace instance.\r\n * @classdesc Reflected namespace and base class of all reflection objects containing nested objects.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Namespace(name, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Nested objects by name.\r\n * @type {Object.|undefined}\r\n */\r\n this.nested = undefined; // toJSON\r\n\r\n /**\r\n * Cached nested objects as an array.\r\n * @type {?ReflectionObject[]}\r\n * @private\r\n */\r\n this._nestedArray = null;\r\n}\r\n\r\nfunction clearCache(namespace) {\r\n namespace._nestedArray = null;\r\n return namespace;\r\n}\r\n\r\nutil.props(NamespacePrototype, {\r\n\r\n /**\r\n * Nested objects of this namespace as an array for iteration.\r\n * @name Namespace#nestedArray\r\n * @type {ReflectionObject[]}\r\n * @readonly\r\n */\r\n nestedArray: {\r\n get: function getNestedArray() {\r\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Tests if the specified JSON object describes not another reflection object.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes not another reflection object\r\n */\r\nNamespace.testJSON = function testJSON(json) {\r\n return Boolean(json\r\n && !json.fields // Type\r\n && !json.values // Enum\r\n && json.id === undefined // Field, MapField\r\n && !json.oneof // OneOf\r\n && !json.methods // Service\r\n && json.requestType === undefined // Method\r\n );\r\n};\r\n\r\n/**\r\n * Constructs a namespace from JSON.\r\n * @param {string} name Namespace name\r\n * @param {Object} json JSON object\r\n * @returns {Namespace} Created namespace\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nNamespace.fromJSON = function fromJSON(name, json) {\r\n return new Namespace(name, json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nNamespacePrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n nested : arrayToJSON(this.getNestedArray())\r\n };\r\n};\r\n\r\n/**\r\n * Converts an array of reflection objects to JSON.\r\n * @memberof Namespace\r\n * @param {ReflectionObject[]} array Object array\r\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\r\n */\r\nfunction arrayToJSON(array) {\r\n if (!(array && array.length))\r\n return undefined;\r\n var obj = {};\r\n for (var i = 0; i < array.length; ++i)\r\n obj[array[i].name] = array[i].toJSON();\r\n return obj;\r\n}\r\n\r\nNamespace.arrayToJSON = arrayToJSON;\r\n\r\n/**\r\n * Adds nested elements to this namespace from JSON.\r\n * @param {Object.} nestedJson Nested JSON\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.addJSON = function addJSON(nestedJson) {\r\n var ns = this;\r\n if (nestedJson)\r\n Object.keys(nestedJson).forEach(function(nestedName) {\r\n var nested = nestedJson[nestedName];\r\n for (var j = 0; j < nestedTypes.length; ++j)\r\n if (nestedTypes[j].testJSON(nested))\r\n return ns.add(nestedTypes[j].fromJSON(nestedName, nested));\r\n throw _TypeError(\"nested.\" + nestedName, \"JSON for \" + nestedError);\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets the nested object of the specified name.\r\n * @param {string} name Nested object name\r\n * @returns {?ReflectionObject} The reflection object or `null` if it doesn't exist\r\n */\r\nNamespacePrototype.get = function get(name) {\r\n if (this.nested === undefined) // prevents deopt\r\n return null;\r\n return this.nested[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this namespace.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name\r\n */\r\nNamespacePrototype.add = function add(object) {\r\n if (!object || nestedTypes.indexOf(object.constructor) < 0)\r\n throw _TypeError(\"object\", nestedError);\r\n if (object instanceof Field && object.extend === undefined)\r\n throw _TypeError(\"object\", \"an extension field when not part of a type\");\r\n if (!this.nested)\r\n this.nested = {};\r\n else {\r\n var prev = this.get(object.name);\r\n if (prev) {\r\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\r\n // replace plain namespace but keep existing nested elements and options\r\n var nested = prev.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i)\r\n object.add(nested[i]);\r\n this.remove(prev);\r\n if (!this.nested)\r\n this.nested = {};\r\n object.setOptions(prev.options, true);\r\n } else\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n }\r\n }\r\n this.nested[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this namespace.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this namespace\r\n */\r\nNamespacePrototype.remove = function remove(object) {\r\n if (!(object instanceof ReflectionObject))\r\n throw _TypeError(\"object\", \"a ReflectionObject\");\r\n if (object.parent !== this || !this.nested)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.nested[object.name];\r\n if (!Object.keys(this.nested).length)\r\n this.nested = undefined;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Defines additial namespaces within this one if not yet existing.\r\n * @param {string|string[]} path Path to create\r\n * @param {*} [json] Nested types to create from JSON\r\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\r\n */\r\nNamespacePrototype.define = function define(path, json) {\r\n if (util.isString(path))\r\n path = path.split('.');\r\n else if (!Array.isArray(path)) {\r\n json = path;\r\n path = undefined;\r\n }\r\n var ptr = this;\r\n if (path)\r\n while (path.length > 0) {\r\n var part = path.shift();\r\n if (ptr.nested && ptr.nested[part]) {\r\n ptr = ptr.nested[part];\r\n if (!(ptr instanceof Namespace))\r\n throw Error(\"path conflicts with non-namespace objects\");\r\n } else\r\n ptr.add(ptr = new Namespace(part));\r\n }\r\n if (json)\r\n ptr.addJSON(json);\r\n return ptr;\r\n};\r\n\r\n/**\r\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree.\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.resolveAll = function resolve() {\r\n var nested = this.getNestedArray(), i = 0;\r\n while (i < nested.length)\r\n if (nested[i] instanceof Namespace)\r\n nested[i++].resolveAll();\r\n else\r\n nested[i++].resolve();\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Looks up the reflection object at the specified path, relative to this namespace.\r\n * @param {string|string[]} path Path to look up\r\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\r\n * @returns {?ReflectionObject} Looked up object or `null` if none could be found\r\n */\r\nNamespacePrototype.lookup = function lookup(path, parentAlreadyChecked) {\r\n if (util.isString(path)) {\r\n if (!path.length)\r\n return null;\r\n path = path.split('.');\r\n } else if (!path.length)\r\n return null;\r\n // Start at root if path is absolute\r\n if (path[0] === \"\")\r\n return this.getRoot().lookup(path.slice(1));\r\n // Test if the first part matches any nested object, and if so, traverse if path contains more\r\n var found = this.get(path[0]);\r\n if (found && (path.length === 1 || found instanceof Namespace && (found = found.lookup(path.slice(1), true))))\r\n return found;\r\n // If there hasn't been a match, try again at the parent\r\n if (this.parent === null || parentAlreadyChecked)\r\n return null;\r\n return this.parent.lookup(path);\r\n};\r\n","\"use strict\";\r\nmodule.exports = ReflectionObject;\r\n\r\nReflectionObject.extend = extend;\r\n\r\nvar Root = require(18),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new reflection object instance.\r\n * @classdesc Base class of all reflection objects.\r\n * @constructor\r\n * @param {string} name Object name\r\n * @param {Object} [options] Declared options\r\n * @abstract\r\n */\r\nfunction ReflectionObject(name, options) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (options && !util.isObject(options))\r\n throw _TypeError(\"options\", \"an object\");\r\n\r\n /**\r\n * Options.\r\n * @type {Object.|undefined}\r\n */\r\n this.options = options; // toJSON\r\n\r\n /**\r\n * Unique name within its namespace.\r\n * @type {string}\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * Parent namespace.\r\n * @type {?Namespace}\r\n */\r\n this.parent = null;\r\n\r\n /**\r\n * Whether already resolved or not.\r\n * @type {boolean}\r\n */\r\n this.resolved = false;\r\n}\r\n\r\n/** @alias ReflectionObject.prototype */\r\nvar ReflectionObjectPrototype = ReflectionObject.prototype;\r\n\r\nutil.props(ReflectionObjectPrototype, {\r\n\r\n /**\r\n * Reference to the root namespace.\r\n * @name ReflectionObject#root\r\n * @type {Root}\r\n * @readonly\r\n */\r\n root: {\r\n get: function getRoot() {\r\n var ptr = this;\r\n while (ptr.parent !== null)\r\n ptr = ptr.parent;\r\n return ptr;\r\n }\r\n },\r\n\r\n /**\r\n * Full name including leading dot.\r\n * @name ReflectionObject#fullName\r\n * @type {string}\r\n * @readonly\r\n */\r\n fullName: {\r\n get: ReflectionObjectPrototype.getFullName = function getFullName() {\r\n var path = [ this.name ],\r\n ptr = this.parent;\r\n while (ptr) {\r\n path.unshift(ptr.name);\r\n ptr = ptr.parent;\r\n }\r\n return path.join('.');\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Lets the specified constructor extend this class.\r\n * @memberof ReflectionObject\r\n * @param {*} constructor Extending constructor\r\n * @returns {Object} Constructor prototype\r\n * @this ReflectionObject\r\n */\r\nfunction extend(constructor) {\r\n var prototype = constructor.prototype = Object.create(this.prototype);\r\n prototype.constructor = constructor;\r\n constructor.extend = extend;\r\n return prototype;\r\n}\r\n\r\n/**\r\n * Converts this reflection object to its JSON representation.\r\n * @returns {Object} JSON object\r\n * @abstract\r\n */\r\nReflectionObjectPrototype.toJSON = function toJSON() {\r\n throw Error(); // not implemented, shouldn't happen\r\n};\r\n\r\n/**\r\n * Called when this object is added to a parent.\r\n * @param {ReflectionObject} parent Parent added to\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onAdd = function onAdd(parent) {\r\n if (this.parent && this.parent !== parent)\r\n this.parent.remove(this);\r\n this.parent = parent;\r\n this.resolved = false;\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleAdd(this);\r\n};\r\n\r\n/**\r\n * Called when this object is removed from a parent.\r\n * @param {ReflectionObject} parent Parent removed from\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onRemove = function onRemove(parent) {\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleRemove(this);\r\n this.parent = null;\r\n this.resolved = false;\r\n};\r\n\r\n/**\r\n * Resolves this objects type references.\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var root = this.getRoot();\r\n if (root instanceof Root)\r\n this.resolved = true; // only if part of a root\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets an option value.\r\n * @param {string} name Option name\r\n * @returns {*} Option value or `undefined` if not set\r\n */\r\nReflectionObjectPrototype.getOption = function getOption(name) {\r\n if (this.options)\r\n return this.options[name];\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Sets an option.\r\n * @param {string} name Option name\r\n * @param {*} value Option value\r\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (!ifNotSet || !this.options || this.options[name] === undefined)\r\n (this.options || (this.options = {}))[name] = value;\r\n return this;\r\n};\r\n\r\n/**\r\n * Sets multiple options.\r\n * @param {Object.} options Options to set\r\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOptions = function setOptions(options, ifNotSet) {\r\n if (options)\r\n Object.keys(options).forEach(function(name) {\r\n this.setOption(name, options[name], ifNotSet);\r\n }, this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Converts this instance to its string representation.\r\n * @returns {string} Constructor name, space, full name\r\n */\r\nReflectionObjectPrototype.toString = function toString() {\r\n return this.constructor.name + \" \" + this.getFullName();\r\n};\r\n","\"use strict\";\r\nmodule.exports = OneOf;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias OneOf.prototype */\r\nvar OneOfPrototype = ReflectionObject.extend(OneOf);\r\n\r\nvar Field = require(9),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new oneof instance.\r\n * @classdesc Reflected oneof.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Oneof name\r\n * @param {string[]|Object} [fieldNames] Field names\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction OneOf(name, fieldNames, options) {\r\n if (!Array.isArray(fieldNames)) {\r\n options = fieldNames;\r\n fieldNames = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (fieldNames && !Array.isArray(fieldNames))\r\n throw _TypeError(\"fieldNames\", \"an Array\");\r\n\r\n /**\r\n * Upper cased name for getter/setter calls.\r\n * @type {string}\r\n */\r\n this.ucName = this.name.substring(0, 1).toUpperCase() + this.name.substring(1);\r\n\r\n /**\r\n * Field names that belong to this oneof.\r\n * @type {string[]}\r\n */\r\n this.oneof = fieldNames || []; // toJSON, marker\r\n\r\n /**\r\n * Fields that belong to this oneof and are possibly not yet added to its parent.\r\n * @type {Field[]}\r\n * @private\r\n */\r\n this._fields = [];\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a oneof.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes a oneof\r\n */\r\nOneOf.testJSON = function testJSON(json) {\r\n return Boolean(json.oneof);\r\n};\r\n\r\n/**\r\n * Constructs a oneof from JSON.\r\n * @param {string} name Oneof name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created oneof\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nOneOf.fromJSON = function fromJSON(name, json) {\r\n return new OneOf(name, json.oneof, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.toJSON = function toJSON() {\r\n return {\r\n oneof : this.oneof,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Adds the fields of the specified oneof to the parent if not already done so.\r\n * @param {OneOf} oneof The oneof\r\n * @returns {undefined}\r\n * @inner\r\n * @ignore\r\n */\r\nfunction addFieldsToParent(oneof) {\r\n if (oneof.parent)\r\n oneof._fields.forEach(function(field) {\r\n if (!field.parent)\r\n oneof.parent.add(field);\r\n });\r\n}\r\n\r\n/**\r\n * Adds a field to this oneof.\r\n * @param {Field} field Field to add\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.add = function add(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n if (field.parent)\r\n field.parent.remove(field);\r\n this.oneof.push(field.name);\r\n this._fields.push(field);\r\n field.partOf = this; // field.parent remains null\r\n addFieldsToParent(this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a field from this oneof.\r\n * @param {Field} field Field to remove\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.remove = function remove(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n var index = this._fields.indexOf(field);\r\n if (index < 0)\r\n throw Error(field + \" is not a member of \" + this);\r\n this._fields.splice(index, 1);\r\n index = this.oneof.indexOf(field.name);\r\n if (index > -1)\r\n this.oneof.splice(index, 1);\r\n if (field.parent)\r\n field.parent.remove(field);\r\n field.partOf = null;\r\n return this;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onAdd = function onAdd(parent) {\r\n ReflectionObject.prototype.onAdd.call(this, parent);\r\n addFieldsToParent(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onRemove = function onRemove(parent) {\r\n this._fields.forEach(function(field) {\r\n if (field.parent)\r\n field.parent.remove(field);\r\n });\r\n ReflectionObject.prototype.onRemove.call(this, parent);\r\n};\r\n","\"use strict\";\r\nmodule.exports = parse;\r\n\r\nvar tokenize = require(22),\r\n Root = require(18),\r\n Type = require(23),\r\n Field = require(9),\r\n MapField = require(10),\r\n OneOf = require(15),\r\n Enum = require(8),\r\n Service = require(21),\r\n Method = require(12),\r\n types = require(24),\r\n util = require(25);\r\nvar camelCase = util.camelCase;\r\n\r\nvar nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,\r\n fqTypeRefRe = /^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/;\r\n\r\nfunction lower(token) {\r\n return token === null ? null : token.toLowerCase();\r\n}\r\n\r\nvar s_required = \"required\",\r\n s_repeated = \"repeated\",\r\n s_optional = \"optional\",\r\n s_option = \"option\",\r\n s_name = \"name\",\r\n s_type = \"type\";\r\nvar s_open = \"{\",\r\n s_close = \"}\",\r\n s_bopen = '(',\r\n s_bclose = ')',\r\n s_semi = \";\",\r\n s_dq = '\"',\r\n s_sq = \"'\";\r\n\r\n/**\r\n * Result object returned from {@link parse}.\r\n * @typedef ParserResult\r\n * @type {Object}\r\n * @property {string|undefined} package Package name, if declared\r\n * @property {string[]|undefined} imports Imports, if any\r\n * @property {string[]|undefined} weakImports Weak imports, if any\r\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\r\n * @property {Root} root Populated root instance\r\n */\r\n\r\n/**\r\n * Parses the given .proto source and returns an object with the parsed contents.\r\n * @param {string} source Source contents\r\n * @param {Root} [root] Root to populate\r\n * @returns {ParserResult} Parser result\r\n */\r\nfunction parse(source, root) {\r\n /* eslint-disable default-case, callback-return */\r\n if (!root)\r\n root = new Root();\r\n\r\n var tn = tokenize(source),\r\n next = tn.next,\r\n push = tn.push,\r\n peek = tn.peek,\r\n skip = tn.skip;\r\n\r\n var head = true,\r\n pkg,\r\n imports,\r\n weakImports,\r\n syntax,\r\n isProto3 = false;\r\n\r\n if (!root)\r\n root = new Root();\r\n\r\n var ptr = root;\r\n\r\n function illegal(token, name) {\r\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (line \" + tn.line() + s_bclose);\r\n }\r\n\r\n function readString() {\r\n var values = [],\r\n token;\r\n do {\r\n if ((token = next()) !== s_dq && token !== s_sq)\r\n throw illegal(token);\r\n values.push(next());\r\n skip(token);\r\n token = peek();\r\n } while (token === s_dq || token === s_sq);\r\n return values.join('');\r\n }\r\n\r\n function readValue(acceptTypeRef) {\r\n var token = next();\r\n switch (lower(token)) {\r\n case s_sq:\r\n case s_dq:\r\n push(token);\r\n return readString();\r\n case \"true\":\r\n return true;\r\n case \"false\":\r\n return false;\r\n }\r\n try {\r\n return parseNumber(token);\r\n } catch (e) {\r\n if (acceptTypeRef && typeRefRe.test(token))\r\n return token;\r\n throw illegal(token, \"value\");\r\n }\r\n }\r\n\r\n function readRange() {\r\n var start = parseId(next());\r\n var end = start;\r\n if (skip(\"to\", true))\r\n end = parseId(next());\r\n skip(s_semi);\r\n return [ start, end ];\r\n }\r\n\r\n function parseNumber(token) {\r\n var sign = 1;\r\n if (token.charAt(0) === '-') {\r\n sign = -1;\r\n token = token.substring(1);\r\n }\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"inf\": return sign * Infinity;\r\n case \"nan\": return NaN;\r\n case \"0\": return 0;\r\n }\r\n if (/^[1-9][0-9]*$/.test(token))\r\n return sign * parseInt(token, 10);\r\n if (/^0[x][0-9a-f]+$/.test(tokenLower))\r\n return sign * parseInt(token, 16);\r\n if (/^0[0-7]+$/.test(token))\r\n return sign * parseInt(token, 8);\r\n if (/^(?!e)[0-9]*(?:\\.[0-9]*)?(?:[e][+-]?[0-9]+)?$/.test(tokenLower))\r\n return sign * parseFloat(token);\r\n throw illegal(token, 'number');\r\n }\r\n\r\n function parseId(token, acceptNegative) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"min\": return 1;\r\n case \"max\": return 0x1FFFFFFF;\r\n case \"0\": return 0;\r\n }\r\n if (token.charAt(0) === '-' && !acceptNegative)\r\n throw illegal(token, \"id\");\r\n if (/^-?[1-9][0-9]*$/.test(token))\r\n return parseInt(token, 10);\r\n if (/^-?0[x][0-9a-f]+$/.test(tokenLower))\r\n return parseInt(token, 16);\r\n if (/^-?0[0-7]+$/.test(token))\r\n return parseInt(token, 8);\r\n throw illegal(token, \"id\");\r\n }\r\n\r\n function parsePackage() {\r\n if (pkg !== undefined)\r\n throw illegal(\"package\");\r\n pkg = next();\r\n if (!typeRefRe.test(pkg))\r\n throw illegal(pkg, s_name);\r\n ptr = ptr.define(pkg);\r\n skip(s_semi);\r\n }\r\n\r\n function parseImport() {\r\n var token = peek();\r\n var whichImports;\r\n switch (token) {\r\n case \"weak\":\r\n whichImports = weakImports || (weakImports = []);\r\n next();\r\n break;\r\n case \"public\":\r\n next();\r\n // eslint-disable-line no-fallthrough\r\n default:\r\n whichImports = imports || (imports = []);\r\n break;\r\n }\r\n token = readString();\r\n skip(s_semi);\r\n whichImports.push(token);\r\n }\r\n\r\n function parseSyntax() {\r\n skip(\"=\");\r\n syntax = lower(readString());\r\n var p3;\r\n if ([ \"proto2\", p3 = \"proto3\" ].indexOf(syntax) < 0)\r\n throw illegal(syntax, \"syntax\");\r\n isProto3 = syntax === p3;\r\n skip(s_semi);\r\n }\r\n\r\n function parseCommon(parent, token) {\r\n switch (token) {\r\n\r\n case s_option:\r\n parseOption(parent, token);\r\n skip(s_semi);\r\n return true;\r\n\r\n case \"message\":\r\n parseType(parent, token);\r\n return true;\r\n\r\n case \"enum\":\r\n parseEnum(parent, token);\r\n return true;\r\n\r\n case \"service\":\r\n parseService(parent, token);\r\n return true;\r\n\r\n case \"extend\":\r\n parseExtension(parent, token);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n function parseType(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, \"type name\");\r\n var type = new Type(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n if (parseCommon(type, token))\r\n continue;\r\n switch (tokenLower) {\r\n case \"map\":\r\n parseMapField(type, tokenLower);\r\n break;\r\n case s_required:\r\n case s_optional:\r\n case s_repeated:\r\n parseField(type, tokenLower);\r\n break;\r\n case \"oneof\":\r\n parseOneOf(type, tokenLower);\r\n break;\r\n case \"extensions\":\r\n (type.extensions || (type.extensions = [])).push(readRange(type, tokenLower));\r\n break;\r\n case \"reserved\":\r\n (type.reserved || (type.reserved = [])).push(readRange(type, tokenLower));\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(type, s_optional);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(type);\r\n }\r\n\r\n function parseField(parent, rule, extend) {\r\n var type = next();\r\n if (!typeRefRe.test(type))\r\n throw illegal(type, s_type);\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new Field(name, id, type, rule, extend));\r\n if (field.repeated)\r\n field.setOption(\"packed\", isProto3, /* ifNotSet */ true);\r\n parent.add(field);\r\n }\r\n\r\n function parseMapField(parent) {\r\n skip(\"<\");\r\n var keyType = next();\r\n if (types.mapKey[keyType] === undefined)\r\n throw illegal(keyType, s_type);\r\n skip(\",\");\r\n var valueType = next();\r\n if (!typeRefRe.test(valueType))\r\n throw illegal(valueType, s_type);\r\n skip(\">\");\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new MapField(name, id, keyType, valueType));\r\n parent.add(field);\r\n }\r\n\r\n function parseOneOf(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n var oneof = new OneOf(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (token === s_option) {\r\n parseOption(oneof, token);\r\n skip(s_semi);\r\n } else {\r\n push(token);\r\n parseField(oneof, s_optional);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(oneof);\r\n }\r\n\r\n function parseEnum(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var values = {};\r\n var enm = new Enum(name, values);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (lower(token) === s_option)\r\n parseOption(enm);\r\n else\r\n parseEnumField(enm, token);\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(enm);\r\n }\r\n\r\n function parseEnumField(parent, token) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n var name = token;\r\n skip(\"=\");\r\n var value = parseId(next(), true);\r\n parent.values[name] = value;\r\n parseInlineOptions({}); // skips enum value options\r\n }\r\n\r\n function parseOption(parent, token) {\r\n var custom = skip(s_bopen, true);\r\n var name = next();\r\n if (!typeRefRe.test(name))\r\n throw illegal(name, s_name);\r\n if (custom) {\r\n skip(s_bclose);\r\n name = s_bopen + name + s_bclose;\r\n token = peek();\r\n if (fqTypeRefRe.test(token)) {\r\n name += token;\r\n next();\r\n }\r\n }\r\n skip(\"=\");\r\n parseOptionValue(parent, name);\r\n }\r\n\r\n function parseOptionValue(parent, name) {\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n name = name + \".\" + token;\r\n if (skip(\":\", true))\r\n setOption(parent, name, readValue(true));\r\n else\r\n parseOptionValue(parent, name);\r\n }\r\n } else\r\n setOption(parent, name, readValue(true));\r\n // Does not enforce a delimiter to be universal\r\n }\r\n\r\n function setOption(parent, name, value) {\r\n if (parent.setOption)\r\n parent.setOption(name, value);\r\n else\r\n parent[name] = value;\r\n }\r\n\r\n function parseInlineOptions(parent) {\r\n if (skip(\"[\", true)) {\r\n do {\r\n parseOption(parent, s_option);\r\n } while (skip(\",\", true));\r\n skip(\"]\");\r\n }\r\n skip(s_semi);\r\n return parent;\r\n }\r\n\r\n function parseService(parent, token) {\r\n token = next();\r\n if (!nameRe.test(token))\r\n throw illegal(token, \"service name\");\r\n var name = token;\r\n var service = new Service(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(service, tokenLower);\r\n skip(s_semi);\r\n break;\r\n case \"rpc\":\r\n parseMethod(service, tokenLower);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(service);\r\n }\r\n\r\n function parseMethod(parent, token) {\r\n var type = token;\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var requestType, requestStream,\r\n responseType, responseStream;\r\n skip(s_bopen);\r\n var st;\r\n if (skip(st = \"stream\", true))\r\n requestStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n requestType = token;\r\n skip(s_bclose); skip(\"returns\"); skip(s_bopen);\r\n if (skip(st, true))\r\n responseStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n responseType = token;\r\n skip(s_bclose);\r\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(method, tokenLower);\r\n skip(s_semi);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(method);\r\n }\r\n\r\n function parseExtension(parent, token) {\r\n var reference = next();\r\n if (!typeRefRe.test(reference))\r\n throw illegal(reference, \"reference\");\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_required:\r\n case s_repeated:\r\n case s_optional:\r\n parseField(parent, tokenLower, reference);\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(parent, s_optional, reference);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n }\r\n\r\n var token;\r\n while ((token = next()) !== null) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n\r\n case \"package\":\r\n if (!head)\r\n throw illegal(token);\r\n parsePackage();\r\n break;\r\n\r\n case \"import\":\r\n if (!head)\r\n throw illegal(token);\r\n parseImport();\r\n break;\r\n\r\n case \"syntax\":\r\n if (!head)\r\n throw illegal(token);\r\n parseSyntax();\r\n break;\r\n\r\n case s_option:\r\n if (!head)\r\n throw illegal(token);\r\n parseOption(ptr, token);\r\n skip(s_semi);\r\n break;\r\n\r\n default:\r\n if (parseCommon(ptr, token)) {\r\n head = false;\r\n continue;\r\n }\r\n throw illegal(token);\r\n }\r\n }\r\n\r\n return {\r\n 'package' : pkg,\r\n 'imports' : imports,\r\n 'weakImports' : weakImports,\r\n 'syntax' : syntax,\r\n 'root' : root\r\n };\r\n}\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nReader.BufferReader = BufferReader;\r\n\r\nvar util = require(29),\r\n ieee754 = require(1);\r\nvar LongBits = util.LongBits,\r\n ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\r\n\r\nfunction indexOutOfRange(reader, writeLength) {\r\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\r\n}\r\n\r\n/**\r\n * Configures the Reader interface according to the environment.\r\n * @memberof Reader\r\n * @returns {undefined}\r\n */\r\nfunction configure() {\r\n if (util.Long) {\r\n ReaderPrototype.int64 = read_int64_long;\r\n ReaderPrototype.uint64 = read_uint64_long;\r\n ReaderPrototype.sint64 = read_sint64_long;\r\n ReaderPrototype.fixed64 = read_fixed64_long;\r\n ReaderPrototype.sfixed64 = read_sfixed64_long;\r\n } else {\r\n ReaderPrototype.int64 = read_int64_number;\r\n ReaderPrototype.uint64 = read_uint64_number;\r\n ReaderPrototype.sint64 = read_sint64_number;\r\n ReaderPrototype.fixed64 = read_fixed64_number;\r\n ReaderPrototype.sfixed64 = read_sfixed64_number;\r\n }\r\n}\r\n\r\nReader.configure = configure;\r\n\r\n/**\r\n * Constructs a new reader instance using the specified buffer.\r\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n * @param {Uint8Array} buffer Buffer to read from\r\n */\r\nfunction Reader(buffer) {\r\n \r\n /**\r\n * Read buffer.\r\n * @type {Uint8Array}\r\n */\r\n this.buf = buffer;\r\n\r\n /**\r\n * Read buffer position.\r\n * @type {number}\r\n */\r\n this.pos = 0;\r\n\r\n /**\r\n * Read buffer length.\r\n * @type {number}\r\n */\r\n this.len = buffer.length;\r\n}\r\n\r\n/**\r\n * Creates a new reader using the specified buffer.\r\n * @param {Uint8Array} buffer Buffer to read from\r\n * @returns {BufferReader|Reader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\r\n */\r\nReader.create = function create(buffer) {\r\n return new (util.Buffer && util.Buffer.isBuffer(buffer) && BufferReader || Reader)(buffer);\r\n};\r\n\r\n/** @alias Reader.prototype */\r\nvar ReaderPrototype = Reader.prototype;\r\n\r\nReaderPrototype._slice = ArrayImpl.prototype.subarray || ArrayImpl.prototype.slice;\r\n\r\n/**\r\n * Tag read.\r\n * @constructor\r\n * @param {number} id Field id\r\n * @param {number} wireType Wire type\r\n * @ignore\r\n */\r\nfunction Tag(id, wireType) {\r\n this.id = id;\r\n this.wireType = wireType;\r\n}\r\n\r\n/**\r\n * Reads a tag.\r\n * @returns {{id: number, wireType: number}} Field id and wire type\r\n */\r\nReaderPrototype.tag = function read_tag() {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n return new Tag(this.buf[this.pos] >>> 3, this.buf[this.pos++] & 7);\r\n};\r\n\r\n/**\r\n * Reads a varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.int32 = function read_int32() {\r\n // 1 byte\r\n var octet = this.buf[this.pos++],\r\n value = octet & 127;\r\n if (octet > 127) { // false if octet is undefined (pos >= len)\r\n // 2 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 7;\r\n if (octet > 127) {\r\n // 3 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 14;\r\n if (octet > 127) {\r\n // 4 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 21;\r\n if (octet > 127) {\r\n // 5 bytes\r\n octet = this.buf[this.pos++];\r\n value |= octet << 28;\r\n if (octet > 127) {\r\n // 6..10 bytes (sign extended)\r\n this.pos += 5;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (this.pos > this.len) {\r\n this.pos = this.len;\r\n throw indexOutOfRange(this);\r\n }\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a varint as an unsigned 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.uint32 = function read_uint32() {\r\n return this.int32() >>> 0;\r\n};\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sint32 = function read_sint32() {\r\n var value = this.int32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongVarint() {\r\n var lo = 0, hi = 0,\r\n i = 0, b = 0;\r\n if (this.len - this.pos > 9) { // fast route\r\n for (i = 0; i < 4; ++i) {\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n } else {\r\n for (i = 0; i < 4; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n }\r\n throw Error(\"invalid varint encoding\");\r\n}\r\n\r\nfunction read_int64_long() {\r\n return readLongVarint.call(this).toLong();\r\n}\r\n\r\nfunction read_int64_number() {\r\n return readLongVarint.call(this).toNumber();\r\n}\r\n\r\nfunction read_uint64_long() {\r\n return readLongVarint.call(this).toLong(true);\r\n}\r\n\r\nfunction read_uint64_number() {\r\n return readLongVarint.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sint64_long() {\r\n return readLongVarint.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sint64_number() {\r\n return readLongVarint.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads a varint as a signed 64 bit value.\r\n * @name Reader#int64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as an unsigned 64 bit value.\r\n * @name Reader#uint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 64 bit value.\r\n * @name Reader#sint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as a boolean.\r\n * @returns {boolean} Value read\r\n */\r\nReaderPrototype.bool = function read_bool() {\r\n return this.int32() !== 0;\r\n};\r\n\r\n/**\r\n * Reads fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.fixed32 = function read_fixed32() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n this.pos += 4;\r\n return this.buf[this.pos - 4]\r\n | this.buf[this.pos - 3] << 8\r\n | this.buf[this.pos - 2] << 16\r\n | this.buf[this.pos - 1] << 24;\r\n};\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sfixed32 = function read_sfixed32() {\r\n var value = this.fixed32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongFixed() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n return new LongBits(\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n ,\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n );\r\n}\r\n\r\nfunction read_fixed64_long() {\r\n return readLongFixed.call(this).toLong(true);\r\n}\r\n\r\nfunction read_fixed64_number() {\r\n return readLongFixed.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sfixed64_long() {\r\n return readLongFixed.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sfixed64_number() {\r\n return readLongFixed.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads fixed 64 bits.\r\n * @name Reader#fixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 64 bits.\r\n * @name Reader#sfixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\nvar readFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function readFloat_f32(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos ];\r\n return f32[0];\r\n }\r\n : function readFloat_f32_le(buf, pos) {\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f32[0];\r\n };\r\n })()\r\n : function readFloat_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Reads a float (32 bit) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.float = function read_float() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readFloat(this.buf, this.pos);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nvar readDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function readDouble_f64(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[7] = buf[pos ];\r\n return f64[0];\r\n }\r\n : function readDouble_f64_le(buf, pos) {\r\n f8b[7] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f64[0];\r\n };\r\n })()\r\n : function readDouble_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Reads a double (64 bit float) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.double = function read_double() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readDouble(this.buf, this.pos);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @returns {Uint8Array} Value read\r\n */\r\nReaderPrototype.bytes = function read_bytes() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\r\n ? new this.buf.constructor(0)\r\n : this._slice.call(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * Reads a string preceeded by its byte length as a varint.\r\n * @returns {string} Value read\r\n */\r\nReaderPrototype.string = function read_string() {\r\n // ref: https://github.com/google/closure-library/blob/master/closure/goog/crypt/crypt.js\r\n var bytes = this.bytes(),\r\n len = bytes.length;\r\n if (len) {\r\n var out = new Array(len), p = 0, c = 0;\r\n while (p < len) {\r\n var c1 = bytes[p++];\r\n if (c1 < 128)\r\n out[c++] = c1;\r\n else if (c1 > 191 && c1 < 224)\r\n out[c++] = (c1 & 31) << 6 | bytes[p++] & 63;\r\n else if (c1 > 239 && c1 < 365) {\r\n var u = ((c1 & 7) << 18 | (bytes[p++] & 63) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63) - 0x10000;\r\n out[c++] = 0xD800 + (u >> 10);\r\n out[c++] = 0xDC00 + (u & 1023);\r\n } else\r\n out[c++] = (c1 & 15) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63;\r\n }\r\n return String.fromCharCode.apply(String, out.slice(0, c));\r\n }\r\n return \"\";\r\n};\r\n\r\n/**\r\n * Skips the specified number of bytes if specified, otherwise skips a varint.\r\n * @param {number} [length] Length if known, otherwise a varint is assumed\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skip = function skip(length) {\r\n if (length === undefined) {\r\n do {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n } while (this.buf[this.pos++] & 128);\r\n } else {\r\n if (this.pos + length > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Skips the next element of the specified wire type.\r\n * @param {number} wireType Wire type received\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skipType = function(wireType) {\r\n switch (wireType) {\r\n case 0:\r\n this.skip();\r\n break;\r\n case 1:\r\n this.skip(8);\r\n break;\r\n case 2:\r\n this.skip(this.uint32());\r\n break;\r\n case 3:\r\n do { // eslint-disable-line no-constant-condition\r\n var tag = this.tag();\r\n if (tag.wireType === 4)\r\n break;\r\n this.skipType(tag.wireType);\r\n } while (true);\r\n break;\r\n case 5:\r\n this.skip(4);\r\n break;\r\n default:\r\n throw Error(\"invalid wire type: \" + wireType);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance and frees all resources.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.reset = function reset(buffer) {\r\n if (buffer) {\r\n this.buf = buffer;\r\n this.len = buffer.length;\r\n } else {\r\n this.buf = null; // makes it throw\r\n this.len = 0;\r\n }\r\n this.pos = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of read operations, frees all resources and returns the remaining buffer.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nReaderPrototype.finish = function finish(buffer) {\r\n var remain = this.pos\r\n ? this._slice.call(this.buf, this.pos)\r\n : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\n// One time function to initialize BufferReader with the now-known buffer implementation's slice method\r\nvar initBufferReader = function() {\r\n if (!util.Buffer)\r\n throw Error(\"Buffer is not supported\");\r\n BufferReaderPrototype._slice = util.Buffer.prototype.slice;\r\n readStringBuffer = util.Buffer.prototype.utf8Slice // around forever, but not present in browser buffer\r\n ? readStringBuffer_utf8Slice\r\n : readStringBuffer_toString;\r\n initBufferReader = false;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer reader instance.\r\n * @classdesc Wire format reader using node buffers.\r\n * @extends Reader\r\n * @constructor\r\n * @param {Buffer} buffer Buffer to read from\r\n */\r\nfunction BufferReader(buffer) {\r\n if (initBufferReader)\r\n initBufferReader();\r\n Reader.call(this, buffer);\r\n}\r\n\r\n/** @alias BufferReader.prototype */\r\nvar BufferReaderPrototype = BufferReader.prototype = Object.create(Reader.prototype);\r\n\r\nBufferReaderPrototype.constructor = BufferReader;\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.float = function read_float_buffer() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = this.buf.readFloatLE(this.pos, true);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.double = function read_double_buffer() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n var value = this.buf.readDoubleLE(this.pos, true);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\nvar readStringBuffer;\r\n\r\nfunction readStringBuffer_utf8Slice(buf, start, end) {\r\n return buf.utf8Slice(start, end); // fastest\r\n}\r\n\r\nfunction readStringBuffer_toString(buf, start, end) {\r\n return buf.toString(\"utf8\", start, end); // 2nd, again assertions\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.string = function read_string_buffer() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return readStringBuffer(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.finish = function finish_buffer(buffer) {\r\n var remain = this.pos ? this.buf.slice(this.pos) : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\nvar Namespace = require(13);\r\n/** @alias Root.prototype */\r\nvar RootPrototype = Namespace.extend(Root);\r\n\r\nvar Field = require(9),\r\n util = require(25),\r\n common = require(7);\r\n\r\n/**\r\n * Constructs a new root namespace instance.\r\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {Object} [options] Top level options\r\n */\r\nfunction Root(options) {\r\n Namespace.call(this, \"\", options);\r\n\r\n /**\r\n * Deferred extension fields.\r\n * @type {Field[]}\r\n */\r\n this.deferred = [];\r\n\r\n /**\r\n * Resolved file names of loaded files. \r\n * @type {string[]}\r\n */\r\n this.files = [];\r\n}\r\n\r\n/**\r\n * Loads a JSON definition into a root namespace.\r\n * @param {*} json JSON definition\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\r\n * @returns {Root} Root namespace\r\n */\r\nRoot.fromJSON = function fromJSON(json, root) {\r\n if (!root)\r\n root = new Root();\r\n return root.setOptions(json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Resolves the path of an imported file, relative to the importing origin.\r\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\r\n * @function\r\n * @param {string} origin The file name of the importing file\r\n * @param {string} target The file name being imported\r\n * @returns {string} Resolved path to `target`\r\n */\r\nRootPrototype.resolvePath = util.resolvePath;\r\n\r\n// A symbol-like function to safely signal synchronous loading\r\nfunction SYNC() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {function(?Error, Root=)} callback Node-style callback function\r\n * @returns {undefined}\r\n */\r\nRootPrototype.load = function load(filename, callback) {\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(load, self, filename);\r\n\r\n // Finishes loading by calling the callback (exactly once)\r\n function finish(err, root) {\r\n if (!callback)\r\n return;\r\n var cb = callback;\r\n callback = null;\r\n cb(err, root);\r\n }\r\n\r\n var sync = callback === SYNC; // undocumented\r\n\r\n // Processes a single file\r\n function process(filename, source) {\r\n try {\r\n if (util.isString(source) && source.charAt(0) === \"{\")\r\n source = JSON.parse(source);\r\n if (!util.isString(source))\r\n self.setOptions(source.options).addJSON(source.nested);\r\n else {\r\n var parsed = require(16)(source, self);\r\n if (parsed.imports)\r\n parsed.imports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name));\r\n });\r\n if (parsed.weakImports)\r\n parsed.weakImports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name), true);\r\n });\r\n }\r\n } catch (err) {\r\n finish(err);\r\n return;\r\n }\r\n if (!sync && !queued)\r\n finish(null, self);\r\n }\r\n\r\n // Fetches a single file\r\n function fetch(filename, weak) {\r\n\r\n // Strip path if this file references a bundled definition\r\n var idx = filename.indexOf(\"google/protobuf/\");\r\n if (idx > -1) {\r\n var altname = filename.substring(idx);\r\n if (altname in common)\r\n filename = altname;\r\n }\r\n\r\n // Skip if already loaded\r\n if (self.files.indexOf(filename) > -1)\r\n return;\r\n self.files.push(filename);\r\n\r\n // Shortcut bundled definitions\r\n if (filename in common) {\r\n if (sync)\r\n process(filename, common[filename]);\r\n else {\r\n ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\r\n if (sync) {\r\n var source;\r\n try {\r\n source = util.fs.readFileSync(filename).toString(\"utf8\");\r\n } catch (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n } else {\r\n ++queued;\r\n util.fetch(filename, function(err, source) {\r\n --queued;\r\n if (!callback)\r\n return; // terminated meanwhile\r\n if (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n });\r\n }\r\n }\r\n var queued = 0;\r\n\r\n // Assembling the root namespace doesn't require working type\r\n // references anymore, so we can load everything in parallel\r\n if (util.isString(filename))\r\n filename = [ filename ];\r\n filename.forEach(function(filename) {\r\n fetch(self.resolvePath(\"\", filename));\r\n });\r\n\r\n if (sync)\r\n return self;\r\n if (!queued)\r\n finish(null, self);\r\n return undefined;\r\n};\r\n// function load(filename:string, callback:function):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\r\n * @name Root#load\r\n * @function\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Promise} Promise\r\n * @variation 2\r\n */\r\n// function load(filename:string):Promise\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nRootPrototype.loadSync = function loadSync(filename) {\r\n return this.load(filename, SYNC);\r\n};\r\n\r\n/**\r\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\r\n * @param {Field} field Declaring extension field witin the declaring type\r\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\r\n * @inner\r\n * @ignore\r\n */\r\nfunction handleExtension(field) {\r\n var extendedType = field.parent.lookup(field.extend);\r\n if (extendedType) {\r\n var sisterField = new Field(field.getFullName(), field.id, field.type, field.rule, undefined, field.options);\r\n sisterField.declaringField = field;\r\n field.extensionField = sisterField;\r\n extendedType.add(sisterField);\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Called when any object is added to this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object added\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleAdd = function handleAdd(object) {\r\n // Try to handle any deferred extensions\r\n var newDeferred = this.deferred.slice();\r\n this.deferred = []; // because the loop calls handleAdd\r\n var i = 0;\r\n while (i < newDeferred.length)\r\n if (handleExtension(newDeferred[i]))\r\n newDeferred.splice(i, 1);\r\n else\r\n ++i;\r\n this.deferred = newDeferred;\r\n // Handle new declaring extension fields without a sister field yet\r\n if (object instanceof Field && object.extend !== undefined && !object.extensionField && !handleExtension(object) && this.deferred.indexOf(object) < 0)\r\n this.deferred.push(object);\r\n else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleAdd(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * Called when any object is removed from this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object removed\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleRemove = function handleRemove(object) {\r\n if (object instanceof Field) {\r\n // If a deferred declaring extension field, cancel the extension\r\n if (object.extend !== undefined && !object.extensionField) {\r\n var index = this.deferred.indexOf(object);\r\n if (index > -1)\r\n this.deferred.splice(index, 1);\r\n }\r\n // If a declaring extension field with a sister field, remove its sister field\r\n if (object.extensionField) {\r\n object.extensionField.parent.remove(object.extensionField);\r\n object.extensionField = null;\r\n }\r\n } else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleRemove(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nRootPrototype.toString = function toString() {\r\n return this.constructor.name;\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Streaming RPC helpers.\r\n * @namespace\r\n */\r\nvar rpc = exports;\r\n\r\nrpc.Service = require(20);\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar EventEmitter = require(26);\r\n\r\n/**\r\n * Constructs a new RPC service instance.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @memberof rpc\r\n * @extends util.EventEmitter\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n */\r\nfunction Service(rpcImpl) {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * RPC implementation. Becomes `null` when the service is ended.\r\n * @type {?RPCImpl}\r\n */\r\n this.$rpc = rpcImpl;\r\n}\r\n\r\n/** @alias rpc.Service.prototype */\r\nvar ServicePrototype = Service.prototype = Object.create(EventEmitter.prototype);\r\nServicePrototype.constructor = Service;\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.end = function end(endedByRPC) {\r\n if (this.$rpc) {\r\n if (!endedByRPC) // signal end to rpcImpl\r\n this.$rpc(null, null, null);\r\n this.$rpc = null;\r\n this.emit('end').off();\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar Namespace = require(13);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Service.prototype */\r\nvar ServicePrototype = Namespace.extend(Service);\r\n\r\nvar Method = require(12),\r\n util = require(25),\r\n rpc = require(19);\r\n\r\n/**\r\n * Constructs a new service instance.\r\n * @classdesc Reflected service.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Service name\r\n * @param {Object.} [options] Service options\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nfunction Service(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Service methods.\r\n * @type {Object.}\r\n */\r\n this.methods = {}; // toJSON, marker\r\n\r\n /**\r\n * Cached methods as an array.\r\n * @type {?Method[]}\r\n * @private\r\n */\r\n this._methodsArray = null;\r\n}\r\n\r\nutil.props(ServicePrototype, {\r\n\r\n /**\r\n * Methods of this service as an array for iteration.\r\n * @name Service#methodsArray\r\n * @type {Method[]}\r\n * @readonly\r\n */\r\n methodsArray: {\r\n get: function getMethodsArray() {\r\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\r\n }\r\n }\r\n\r\n});\r\n\r\nfunction clearCache(service) {\r\n service._methodsArray = null;\r\n return service;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a service\r\n */\r\nService.testJSON = function testJSON(json) {\r\n return Boolean(json && json.methods);\r\n};\r\n\r\n/**\r\n * Constructs a service from JSON.\r\n * @param {string} name Service name\r\n * @param {Object} json JSON object\r\n * @returns {Service} Created service\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nService.fromJSON = function fromJSON(name, json) {\r\n var service = new Service(name, json.options);\r\n if (json.methods)\r\n Object.keys(json.methods).forEach(function(methodName) {\r\n service.add(Method.fromJSON(methodName, json.methods[methodName]));\r\n });\r\n return service;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n methods : Namespace.arrayToJSON(this.getMethodsArray()) || {},\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.methods[name] || null;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.resolveAll = function resolve() {\r\n var methods = this.getMethodsArray();\r\n for (var i = 0; i < methods.length; ++i)\r\n methods[i].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Method) {\r\n this.methods[object.name] = object;\r\n object.parent = this;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.remove = function remove(object) {\r\n if (object instanceof Method) {\r\n if (this.methods[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.methods[object.name];\r\n object.parent = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\r\n * @typedef RPCImpl\r\n * @type {function}\r\n * @param {Method} method Reflected method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {function(?Error, Uint8Array=)} callback Node-style callback called with the error, if any, and the response data. `null` as response data signals an ended stream.\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Creates a runtime service using the specified rpc implementation.\r\n * @param {function(Method, Uint8Array, function)} rpcImpl RPC implementation ({@link RPCImpl|see})\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n * @returns {rpc.Service} Runtime RPC service. Useful where requests and/or responses are streamed.\r\n */\r\nServicePrototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\r\n var rpcService = new rpc.Service(rpcImpl);\r\n this.getMethodsArray().forEach(function(method) {\r\n rpcService[method.name.substring(0, 1).toLowerCase() + method.name.substring(1)] = function callVirtual(request, /* optional */ callback) {\r\n if (!rpcService.$rpc) // already ended?\r\n return;\r\n if (!request)\r\n throw util._TypeError(\"request\", \"not null\");\r\n method.resolve();\r\n var requestData;\r\n try {\r\n requestData = (requestDelimited && method.resolvedRequestType.encodeDelimited(request) || method.resolvedRequestType.encode(request)).finish();\r\n } catch (err) {\r\n (typeof setImmediate === 'function' && setImmediate || setTimeout)(function() { callback(err); });\r\n return;\r\n }\r\n // Calls the custom RPC implementation with the reflected method and binary request data\r\n // and expects the rpc implementation to call its callback with the binary response data.\r\n rpcImpl(method, requestData, function(err, responseData) {\r\n if (err) {\r\n rpcService.emit('error', err, method);\r\n return callback ? callback(err) : undefined;\r\n }\r\n if (responseData === null) {\r\n rpcService.end(/* endedByRPC */ true);\r\n return undefined;\r\n }\r\n var response;\r\n try {\r\n response = responseDelimited && method.resolvedResponseType.decodeDelimited(responseData) || method.resolvedResponseType.decode(responseData);\r\n } catch (err2) {\r\n rpcService.emit('error', err2, method);\r\n return callback ? callback('error', err2) : undefined;\r\n }\r\n rpcService.emit('data', response, method);\r\n return callback ? callback(null, response) : undefined;\r\n });\r\n };\r\n });\r\n return rpcService;\r\n};\r\n","\"use strict\";\r\nmodule.exports = tokenize;\r\n\r\nvar delimRe = /[\\s{}=;:[\\],'\"()<>]/g,\r\n stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\r\n stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\r\n\r\n/**\r\n * Handle object returned from {@link tokenize}.\r\n * @typedef {Object} TokenizerHandle\r\n * @property {function():number} line Gets the current line number\r\n * @property {function():?string} next Gets the next token and advances (`null` on eof)\r\n * @property {function():?string} peek Peeks for the next token (`null` on eof)\r\n * @property {function(string)} push Pushes a token back to the stack\r\n * @property {function(string, boolean=):boolean} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\r\n */\r\n\r\nvar s_nl = \"\\n\",\r\n s_sl = '/',\r\n s_as = '*';\r\n\r\nfunction unescape(str) {\r\n return str.replace(/\\\\(.?)/g, function($0, $1) {\r\n switch ($1) {\r\n case \"\\\\\":\r\n case \"\":\r\n return $1;\r\n case \"0\":\r\n return \"\\u0000\";\r\n default:\r\n return $1;\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Tokenizes the given .proto source and returns an object with useful utility functions.\r\n * @param {string} source Source contents\r\n * @returns {TokenizerHandle} Tokenizer handle\r\n */\r\nfunction tokenize(source) {\r\n /* eslint-disable default-case, callback-return */\r\n source = source.toString();\r\n \r\n var offset = 0,\r\n length = source.length,\r\n line = 1;\r\n \r\n var stack = [];\r\n\r\n var stringDelim = null;\r\n\r\n /**\r\n * Creates an error for illegal syntax.\r\n * @param {string} subject Subject\r\n * @returns {Error} Error created\r\n * @inner\r\n */\r\n function illegal(subject) {\r\n return Error(\"illegal \" + subject + \" (line \" + line + \")\");\r\n }\r\n\r\n /**\r\n * Reads a string till its end.\r\n * @returns {string} String read\r\n * @inner\r\n */\r\n function readString() {\r\n var re = stringDelim === '\"' ? stringDoubleRe : stringSingleRe;\r\n re.lastIndex = offset - 1;\r\n var match = re.exec(source);\r\n if (!match)\r\n throw illegal(\"string\");\r\n offset = re.lastIndex;\r\n push(stringDelim);\r\n stringDelim = null;\r\n return unescape(match[1]);\r\n }\r\n\r\n /**\r\n * Gets the character at `pos` within the source.\r\n * @param {number} pos Position\r\n * @returns {string} Character\r\n * @inner\r\n */\r\n function charAt(pos) {\r\n return source.charAt(pos);\r\n }\r\n\r\n /**\r\n * Obtains the next token.\r\n * @returns {?string} Next token or `null` on eof\r\n * @inner\r\n */\r\n function next() {\r\n if (stack.length > 0)\r\n return stack.shift();\r\n if (stringDelim)\r\n return readString();\r\n var repeat,\r\n prev,\r\n curr;\r\n do {\r\n if (offset === length)\r\n return null;\r\n repeat = false;\r\n while (/\\s/.test(curr = charAt(offset))) {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n }\r\n if (charAt(offset) === s_sl) {\r\n if (++offset === length)\r\n throw illegal(\"comment\");\r\n if (charAt(offset) === s_sl) { // Line\r\n while (charAt(++offset) !== s_nl)\r\n if (offset === length)\r\n return null;\r\n ++offset;\r\n ++line;\r\n repeat = true;\r\n } else if ((curr = charAt(offset)) === s_as) { /* Block */\r\n do {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n prev = curr;\r\n curr = charAt(offset);\r\n } while (prev !== s_as || curr !== s_sl);\r\n ++offset;\r\n repeat = true;\r\n } else\r\n return s_sl;\r\n }\r\n } while (repeat);\r\n\r\n if (offset === length)\r\n return null;\r\n var end = offset;\r\n delimRe.lastIndex = 0;\r\n var delim = delimRe.test(charAt(end++));\r\n if (!delim)\r\n while (end < length && !delimRe.test(charAt(end)))\r\n ++end;\r\n var token = source.substring(offset, offset = end);\r\n if (token === '\"' || token === \"'\")\r\n stringDelim = token;\r\n return token;\r\n }\r\n\r\n /**\r\n * Pushes a token back to the stack.\r\n * @param {string} token Token\r\n * @returns {undefined}\r\n * @inner\r\n */\r\n function push(token) {\r\n stack.push(token);\r\n }\r\n\r\n /**\r\n * Peeks for the next token.\r\n * @returns {?string} Token or `null` on eof\r\n * @inner\r\n */\r\n function peek() {\r\n if (!stack.length) {\r\n var token = next();\r\n if (token === null)\r\n return null;\r\n push(token);\r\n }\r\n return stack[0];\r\n }\r\n\r\n /**\r\n * Skips a token.\r\n * @param {string} expected Expected token\r\n * @param {boolean} [optional=false] Whether the token is optional\r\n * @returns {boolean} `true` when skipped, `false` if not\r\n * @throws {Error} When a required token is not present\r\n * @inner\r\n */\r\n function skip(expected, optional) {\r\n var actual = peek(),\r\n equals = actual === expected;\r\n if (equals) {\r\n next();\r\n return true;\r\n }\r\n if (!optional)\r\n throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\r\n return false;\r\n }\r\n\r\n return {\r\n line: function() { return line; },\r\n next: next,\r\n peek: peek,\r\n push: push,\r\n skip: skip\r\n };\r\n /* eslint-enable default-case, callback-return */\r\n}","\"use strict\";\r\nmodule.exports = Type; \r\n\r\nvar Namespace = require(13);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Type.prototype */\r\nvar TypePrototype = Namespace.extend(Type);\r\n\r\nvar Enum = require(8),\r\n OneOf = require(15),\r\n Field = require(9),\r\n Service = require(21),\r\n Class = require(2),\r\n Message = require(11),\r\n Reader = require(17),\r\n Writer = require(30),\r\n util = require(25),\r\n codegen = require(3);\r\n\r\n/**\r\n * Constructs a new reflected message type instance.\r\n * @classdesc Reflected message type.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Message name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Type(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Message fields.\r\n * @type {Object.}\r\n */\r\n this.fields = {}; // toJSON, marker\r\n\r\n /**\r\n * Oneofs declared within this namespace, if any.\r\n * @type {Object.}\r\n */\r\n this.oneofs = undefined; // toJSON\r\n\r\n /**\r\n * Extension ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.extensions = undefined; // toJSON\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n /**\r\n * Cached fields by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._fieldsById = null;\r\n\r\n /**\r\n * Cached fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._fieldsArray = null;\r\n\r\n /**\r\n * Cached repeated fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._repeatedFieldsArray = null;\r\n\r\n /**\r\n * Cached oneofs as an array.\r\n * @type {?OneOf[]}\r\n * @private\r\n */\r\n this._oneofsArray = null;\r\n\r\n /**\r\n * Cached constructor.\r\n * @type {*}\r\n * @private\r\n */\r\n this._ctor = null;\r\n}\r\n\r\nutil.props(TypePrototype, {\r\n\r\n /**\r\n * Message fields by id.\r\n * @name Type#fieldsById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n fieldsById: {\r\n get: function getFieldsById() {\r\n if (this._fieldsById)\r\n return this._fieldsById;\r\n this._fieldsById = {};\r\n var names = Object.keys(this.fields);\r\n for (var i = 0; i < names.length; ++i) {\r\n var field = this.fields[names[i]],\r\n id = field.id;\r\n if (this._fieldsById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._fieldsById[id] = field;\r\n }\r\n return this._fieldsById;\r\n }\r\n },\r\n\r\n /**\r\n * Fields of this message as an array for iteration.\r\n * @name Type#fieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n fieldsArray: {\r\n get: function getFieldsArray() {\r\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\r\n }\r\n },\r\n\r\n /**\r\n * Repeated fields of this message as an array for iteration.\r\n * @name Type#repeatedFieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n repeatedFieldsArray: {\r\n get: function getRepeatedFieldsArray() {\r\n return this._repeatedFieldsArray || (this._repeatedFieldsArray = this.getFieldsArray().filter(function(field) { return field.repeated; }));\r\n }\r\n },\r\n\r\n /**\r\n * Oneofs of this message as an array for iteration.\r\n * @name Type#oneofsArray\r\n * @type {OneOf[]}\r\n * @readonly\r\n */\r\n oneofsArray: {\r\n get: function getOneofsArray() {\r\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\r\n }\r\n },\r\n\r\n /**\r\n * The registered constructor, if any registered, otherwise a generic constructor.\r\n * @name Type#ctor\r\n * @type {Class}\r\n */\r\n ctor: {\r\n get: function getCtor() {\r\n return this._ctor || (this._ctor = Class.create(this).constructor);\r\n },\r\n set: function setCtor(ctor) {\r\n if (ctor && !(ctor.prototype instanceof Message))\r\n throw util._TypeError(\"ctor\", \"a constructor inheriting from Message\");\r\n this._ctor = ctor;\r\n }\r\n }\r\n});\r\n\r\nfunction clearCache(type) {\r\n type._fieldsById = type._fieldsArray = type._oneofsArray = type._ctor = null;\r\n delete type.encode;\r\n delete type.decode;\r\n return type;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a message type.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a message type\r\n */\r\nType.testJSON = function testJSON(json) {\r\n return Boolean(json && json.fields);\r\n};\r\n\r\nvar nestedTypes = [ Enum, Type, Field, Service ];\r\n\r\n/**\r\n * Creates a type from JSON.\r\n * @param {string} name Message name\r\n * @param {Object} json JSON object\r\n * @returns {Type} Created message type\r\n */\r\nType.fromJSON = function fromJSON(name, json) {\r\n var type = new Type(name, json.options);\r\n type.extensions = json.extensions;\r\n type.reserved = json.reserved;\r\n if (json.fields)\r\n Object.keys(json.fields).forEach(function(fieldName) {\r\n type.add(Field.fromJSON(fieldName, json.fields[fieldName]));\r\n });\r\n if (json.oneofs)\r\n Object.keys(json.oneofs).forEach(function(oneOfName) {\r\n type.add(OneOf.fromJSON(oneOfName, json.oneofs[oneOfName]));\r\n });\r\n if (json.nested)\r\n Object.keys(json.nested).forEach(function(nestedName) {\r\n var nested = json.nested[nestedName];\r\n for (var i = 0; i < nestedTypes.length; ++i) {\r\n if (nestedTypes[i].testJSON(nested)) {\r\n type.add(nestedTypes[i].fromJSON(nestedName, nested));\r\n return;\r\n }\r\n }\r\n throw Error(\"invalid nested object in \" + type + \": \" + nestedName);\r\n });\r\n if (json.extensions && json.extensions.length)\r\n type.extensions = json.extensions;\r\n if (json.reserved && json.reserved.length)\r\n type.reserved = json.reserved;\r\n return type;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n oneofs : Namespace.arrayToJSON(this.getOneofsArray()),\r\n fields : Namespace.arrayToJSON(this.getFieldsArray().filter(function(obj) { return !obj.declaringField; })) || {},\r\n extensions : this.extensions && this.extensions.length ? this.extensions : undefined,\r\n reserved : this.reserved && this.reserved.length ? this.reserved : undefined,\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.resolveAll = function resolve() {\r\n var fields = this.getFieldsArray(), i = 0;\r\n while (i < fields.length)\r\n fields[i++].resolve();\r\n var oneofs = this.getOneofsArray(); i = 0;\r\n while (i < oneofs.length)\r\n oneofs[i++].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.fields && this.fields[name] || this.oneofs && this.oneofs[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this type.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\r\n */\r\nTypePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Field && object.extend === undefined) {\r\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\r\n // The root object takes care of adding distinct sister-fields to the respective extended\r\n // type instead.\r\n if (this.getFieldsById()[object.id])\r\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\r\n if (object.parent)\r\n object.parent.remove(object);\r\n this.fields[object.name] = object;\r\n object.message = this;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n if (!this.oneofs)\r\n this.oneofs = {};\r\n this.oneofs[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this type.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this type\r\n */\r\nTypePrototype.remove = function remove(object) {\r\n if (object instanceof Field && object.extend === undefined) {\r\n // See Type#add for the reason why extension fields are excluded here.\r\n if (this.fields[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.fields[object.name];\r\n object.message = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object|*} [properties] Properties to set\r\n * @returns {Message} Runtime message\r\n */\r\nTypePrototype.create = function create(properties) {\r\n return new (this.getCtor())(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Message|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encode = function encode(message, writer) {\r\n return (this.encode = codegen.supported\r\n ? codegen.encode.generate(this).eof(this.getFullName() + \"$encode\", {\r\n Writer : Writer,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : codegen.encode.fallback\r\n ).call(this, message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Message|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.encode(message, writer).ldelim();\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message} Decoded message\r\n */\r\nTypePrototype.decode = function decode(readerOrBuffer, length) {\r\n return (this.decode = codegen.supported\r\n ? codegen.decode.generate(this).eof(this.getFullName() + \"$decode\", {\r\n Reader : Reader,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : codegen.decode.fallback\r\n ).call(this, readerOrBuffer, length);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @returns {Message} Decoded message\r\n */\r\nTypePrototype.decodeDelimited = function decodeDelimited(readerOrBuffer) {\r\n readerOrBuffer = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer);\r\n return this.decode(readerOrBuffer, readerOrBuffer.uint32());\r\n};\r\n\r\n/**\r\n * Verifies that enum values are valid and that any required fields are present.\r\n * @param {Message|Object} message Message to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\nTypePrototype.verify = function verify(message) {\r\n return (this.verify = codegen.supported\r\n ? codegen.verify.generate(this).eof(this.getFullName() + \"$verify\", {\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; })\r\n })\r\n : codegen.verify.fallback\r\n ).call(this, message);\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Common type constants.\r\n * @namespace\r\n */\r\nvar types = exports;\r\n\r\nvar util = require(25);\r\n\r\nvar s = [\r\n \"double\", // 0\r\n \"float\", // 1\r\n \"int32\", // 2\r\n \"uint32\", // 3\r\n \"sint32\", // 4\r\n \"fixed32\", // 5\r\n \"sfixed32\", // 6\r\n \"int64\", // 7\r\n \"uint64\", // 8\r\n \"sint64\", // 9\r\n \"fixed64\", // 10\r\n \"sfixed64\", // 11\r\n \"bool\", // 12\r\n \"string\", // 13\r\n \"bytes\" // 14\r\n];\r\n\r\nfunction bake(values, offset) {\r\n var i = 0, o = {};\r\n offset |= 0;\r\n while (i < values.length) o[s[i + offset]] = values[i++];\r\n return o;\r\n}\r\n\r\n/**\r\n * Basic type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.basic = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2,\r\n /* bytes */ 2\r\n]);\r\n\r\n/**\r\n * Basic type defaults.\r\n * @type {Object.}\r\n */\r\ntypes.defaults = bake([\r\n /* double */ 0,\r\n /* float */ 0,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 0,\r\n /* sfixed32 */ 0,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 0,\r\n /* sfixed64 */ 0,\r\n /* bool */ false,\r\n /* string */ \"\",\r\n /* bytes */ util.emptyArray\r\n]);\r\n\r\n/**\r\n * Basic long type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.long = bake([\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1\r\n], 7);\r\n\r\n/**\r\n * Allowed types for map keys with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.mapKey = bake([\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2\r\n], 2);\r\n\r\n/**\r\n * Allowed types for packed repeated fields with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.packed = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0\r\n]);\r\n","\"use strict\";\r\n\r\n/**\r\n * Various utility functions.\r\n * @namespace\r\n */\r\nvar util = exports;\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @memberof util\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nfunction isString(value) {\r\n return typeof value === 'string' || value instanceof String;\r\n}\r\n\r\nutil.isString = isString;\r\n\r\n/**\r\n * Tests if the specified value is a non-null object.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a non-null object\r\n */\r\nutil.isObject = function isObject(value) {\r\n return Boolean(value && typeof value === 'object');\r\n};\r\n\r\n/**\r\n * Tests if the specified value is an integer.\r\n * @function\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is an integer\r\n */\r\nutil.isInteger = Number.isInteger || function isInteger(value) {\r\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\r\n};\r\n\r\n/**\r\n * Converts an object's values to an array.\r\n * @param {Object.} object Object to convert\r\n * @returns {Array.<*>} Converted array\r\n */\r\nutil.toArray = function toArray(object) {\r\n if (!object)\r\n return [];\r\n var names = Object.keys(object),\r\n length = names.length;\r\n var array = new Array(length);\r\n for (var i = 0; i < length; ++i)\r\n array[i] = object[names[i]];\r\n return array;\r\n};\r\n\r\n/**\r\n * Creates a type error.\r\n * @param {string} name Argument name\r\n * @param {string} [description=\"a string\"] Expected argument descripotion\r\n * @returns {TypeError} Created type error\r\n * @private\r\n */\r\nutil._TypeError = function(name, description) {\r\n return TypeError(name + \" must be \" + (description || \"a string\"));\r\n};\r\n\r\n/**\r\n * Returns a promise from a node-style function.\r\n * @memberof util\r\n * @param {function(Error, ...*)} fn Function to call\r\n * @param {Object} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var args = [];\r\n for (var i = 2; i < arguments.length; ++i)\r\n args.push(arguments[i]);\r\n return new Promise(function(resolve, reject) {\r\n fn.apply(ctx, args.concat(\r\n function(err/*, varargs */) {\r\n if (err) reject(err);\r\n else resolve.apply(null, Array.prototype.slice.call(arguments, 1));\r\n }\r\n ));\r\n });\r\n}\r\n\r\nutil.asPromise = asPromise;\r\n\r\n/**\r\n * Filesystem, if available.\r\n * @memberof util\r\n * @type {?Object}\r\n */\r\nvar fs = null; // Hide this from webpack. There is probably another, better way.\r\ntry { fs = eval(['req','uire'].join(''))(\"fs\"); } catch (e) {} // eslint-disable-line no-eval, no-empty\r\n\r\nutil.fs = fs;\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} path File path or url\r\n * @param {function(?Error, string=)} [callback] Node-style callback\r\n * @returns {Promise|undefined} A Promise if `callback` has been omitted \r\n */\r\nfunction fetch(path, callback) {\r\n if (!callback)\r\n return asPromise(fetch, util, path);\r\n if (fs && fs.readFile)\r\n return fs.readFile(path, \"utf8\", callback);\r\n var xhr = new XMLHttpRequest();\r\n function onload() {\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n if (isString(xhr.responseText))\r\n return callback(null, xhr.responseText);\r\n return callback(Error(\"request failed\"));\r\n }\r\n xhr.onreadystatechange = function() {\r\n if (xhr.readyState === 4)\r\n onload();\r\n };\r\n xhr.open(\"GET\", path, true);\r\n xhr.send();\r\n return undefined;\r\n}\r\n\r\nutil.fetch = fetch;\r\n\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @memberof util\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\nfunction isAbsolutePath(path) {\r\n return /^(?:\\/|[a-zA-Z0-9]+:)/.test(path);\r\n}\r\n\r\nutil.isAbsolutePath = isAbsolutePath;\r\n\r\n/**\r\n * Normalizes the specified path.\r\n * @memberof util\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\nfunction normalizePath(path) {\r\n path = path.replace(/\\\\/g, '/')\r\n .replace(/\\/{2,}/g, '/');\r\n var parts = path.split('/');\r\n var abs = isAbsolutePath(path);\r\n var prefix = \"\";\r\n if (abs)\r\n prefix = parts.shift() + '/';\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === '..') {\r\n if (i > 0)\r\n parts.splice(--i, 2);\r\n else if (abs)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === '.')\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join('/');\r\n}\r\n\r\nutil.normalizePath = normalizePath;\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path that was used to fetch the origin file\r\n * @param {string} importPath Import path specified in the origin file\r\n * @param {boolean} [alreadyNormalized] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the imported file\r\n */\r\nutil.resolvePath = function resolvePath(originPath, importPath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n importPath = normalizePath(importPath);\r\n if (isAbsolutePath(importPath))\r\n return importPath;\r\n if (!alreadyNormalized)\r\n originPath = normalizePath(originPath);\r\n originPath = originPath.replace(/(?:\\/|^)[^/]+$/, '');\r\n return originPath.length ? normalizePath(originPath + '/' + importPath) : importPath;\r\n};\r\n\r\n/**\r\n * Merges the properties of the source object into the destination object.\r\n * @param {Object} dst Destination object\r\n * @param {Object} src Source object\r\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\r\n * @returns {Object} Destination object\r\n */\r\nutil.merge = function merge(dst, src, ifNotSet) {\r\n if (src) {\r\n var keys = Object.keys(src);\r\n for (var i = 0; i < keys.length; ++i)\r\n if (dst[keys[i]] === undefined || !ifNotSet)\r\n dst[keys[i]] = src[keys[i]];\r\n }\r\n return dst;\r\n};\r\n\r\n/**\r\n * Returns a safe property accessor for the specified properly name.\r\n * @param {string} prop Property name\r\n * @returns {string} Safe accessor\r\n */\r\nutil.safeProp = function safeProp(prop) {\r\n return \"['\" + prop.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\") + \"']\";\r\n};\r\n\r\n/**\r\n * Minimalistic sprintf.\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {string} Formatted string\r\n */\r\nutil.sprintf = function sprintf(format) {\r\n var params = Array.prototype.slice.call(arguments, 1),\r\n index = 0;\r\n return format.replace(/%([djs])/g, function($0, $1) {\r\n var param = params[index++];\r\n switch ($1) {\r\n case \"j\":\r\n return JSON.stringify(param);\r\n case \"p\":\r\n return util.safeProp(param);\r\n default:\r\n return String(param);\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Converts a string to camel case notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.camelCase = function camelCase(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/_([a-z])(?=[a-z]|$)/g, function($0, $1) { return $1.toUpperCase(); });\r\n};\r\n\r\n/**\r\n * Converts a string to underscore notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.underScore = function underScore(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return \"_\" + $1.toLowerCase(); });\r\n};\r\n\r\n/**\r\n * Creates a new buffer of whatever type supported by the environment.\r\n * @param {number} [size=0] Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nutil.newBuffer = function newBuffer(size) {\r\n size = size || 0; \r\n return util.Buffer\r\n ? util.Buffer.allocUnsafe && util.Buffer.allocUnsafe(size) || new util.Buffer(size)\r\n : new (typeof Uint8Array !== 'undefined' && Uint8Array || Array)(size);\r\n};\r\n\r\nutil.EventEmitter = require(26);\r\n\r\n// Merge in runtime utility\r\nutil.merge(util, require(29));\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/** @alias util.EventEmitter.prototype */\r\nvar EventEmitterPrototype = EventEmitter.prototype;\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {Object} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = Array.prototype.slice.call(arguments, 1);\r\n for (var i = 0; i < listeners.length; ++i)\r\n listeners[i].fn.apply(listeners[i].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = LongBits;\r\n\r\nvar util = require(25);\r\n\r\n/**\r\n * Any compatible Long instance.\r\n * @typedef Long\r\n * @type {Object}\r\n * @property {number} low Low bits\r\n * @property {number} high High bits\r\n * @property {boolean} unsigned Whether unsigned or not\r\n */\r\n\r\n/**\r\n * Constructs new long bits.\r\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\r\n * @memberof util\r\n * @constructor\r\n * @param {number} lo Low bits\r\n * @param {number} hi High bits\r\n */\r\nfunction LongBits(lo, hi) { // make sure to always call this with unsigned 32bits for proper optimization\r\n\r\n /**\r\n * Low bits.\r\n * @type {number}\r\n */\r\n this.lo = lo;\r\n\r\n /**\r\n * High bits.\r\n * @type {number}\r\n */\r\n this.hi = hi;\r\n}\r\n\r\n/** @alias util.LongBits.prototype */\r\nvar LongBitsPrototype = LongBits.prototype;\r\n\r\n/**\r\n * Zero bits.\r\n * @memberof util.LongBits\r\n * @type {util.LongBits}\r\n */\r\nvar zero = LongBits.zero = new LongBits(0, 0);\r\n\r\nzero.toNumber = function() { return 0; };\r\nzero.zzEncode = zero.zzDecode = function() { return this; };\r\nzero.length = function() { return 1; };\r\n\r\n/**\r\n * Constructs new long bits from the specified number.\r\n * @param {number} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.fromNumber = function fromNumber(value) {\r\n if (value === 0)\r\n return zero;\r\n var sign = value < 0;\r\n value = Math.abs(value);\r\n var lo = value >>> 0,\r\n hi = (value - lo) / 4294967296 >>> 0;\r\n if (sign) {\r\n hi = ~hi >>> 0;\r\n lo = ~lo >>> 0;\r\n if (++lo > 4294967295) {\r\n lo = 0;\r\n if (++hi > 4294967295)\r\n hi = 0;\r\n }\r\n }\r\n return new LongBits(lo, hi);\r\n};\r\n\r\n/**\r\n * Constructs new long bits from a number, long or string.\r\n * @param {Long|number|string} value Value\r\n * @returns {util.LongBits} Instance\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nLongBits.from = function from(value) {\r\n switch (typeof value) { // eslint-disable-line default-case\r\n case 'number':\r\n return LongBits.fromNumber(value);\r\n case 'string':\r\n value = util.Long.fromString(value); // throws without a long lib\r\n }\r\n return (value.low || value.high) && new LongBits(value.low >>> 0, value.high >>> 0) || zero;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a possibly unsafe JavaScript number.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {number} Possibly unsafe number\r\n */\r\nLongBitsPrototype.toNumber = function toNumber(unsigned) {\r\n if (!unsigned && this.hi >>> 31) {\r\n this.lo = ~this.lo + 1 >>> 0;\r\n this.hi = ~this.hi >>> 0;\r\n if (!this.lo)\r\n this.hi = this.hi + 1 >>> 0;\r\n return -(this.lo + this.hi * 4294967296);\r\n }\r\n return this.lo + this.hi * 4294967296;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a long.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long} Long\r\n */\r\nLongBitsPrototype.toLong = function toLong(unsigned) {\r\n return new util.Long(this.lo, this.hi, unsigned);\r\n};\r\n\r\nvar charCodeAt = String.prototype.charCodeAt;\r\n\r\n/**\r\n * Constructs new long bits from the specified 8 characters long hash.\r\n * @param {string} hash Hash\r\n * @returns {util.LongBits} Bits\r\n */\r\nLongBits.fromHash = function fromHash(hash) {\r\n return new LongBits(\r\n ( charCodeAt.call(hash, 0)\r\n | charCodeAt.call(hash, 1) << 8\r\n | charCodeAt.call(hash, 2) << 16\r\n | charCodeAt.call(hash, 3) << 24) >>> 0\r\n ,\r\n ( charCodeAt.call(hash, 4)\r\n | charCodeAt.call(hash, 5) << 8\r\n | charCodeAt.call(hash, 6) << 16\r\n | charCodeAt.call(hash, 7) << 24) >>> 0\r\n );\r\n};\r\n\r\n/**\r\n * Converts this long bits to a 8 characters long hash.\r\n * @returns {string} Hash\r\n */\r\nLongBitsPrototype.toHash = function toHash() {\r\n return String.fromCharCode(\r\n this.lo & 255,\r\n this.lo >>> 8 & 255,\r\n this.lo >>> 16 & 255,\r\n this.lo >>> 24 & 255,\r\n this.hi & 255,\r\n this.hi >>> 8 & 255,\r\n this.hi >>> 16 & 255,\r\n this.hi >>> 24 & 255\r\n );\r\n};\r\n\r\n/**\r\n * Zig-zag encodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzEncode = function zzEncode() {\r\n var mask = this.hi >> 31;\r\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\r\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Zig-zag decodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzDecode = function zzDecode() {\r\n var mask = -(this.lo & 1);\r\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\r\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Calculates the length of this longbits when encoded as a varint.\r\n * @returns {number} Length\r\n */\r\nLongBitsPrototype.length = function length() {\r\n var part0 = this.lo,\r\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\r\n part2 = this.hi >>> 24;\r\n if (part2 === 0) {\r\n if (part1 === 0)\r\n return part0 < 1 << 14\r\n ? part0 < 1 << 7 ? 1 : 2\r\n : part0 < 1 << 21 ? 3 : 4;\r\n return part1 < 1 << 14\r\n ? part1 < 1 << 7 ? 5 : 6\r\n : part1 < 1 << 21 ? 7 : 8;\r\n }\r\n return part2 < 1 << 7 ? 9 : 10;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * A drop-in buffer pool, similar in functionality to what node uses for buffers.\r\n * @memberof util\r\n * @function\r\n * @param {function(number):Uint8Array} alloc Allocator\r\n * @param {function(number, number):Uint8Array} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {function(number):Uint8Array} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\nvar util = exports;\r\n\r\nvar LongBits = util.LongBits = require(\"./longbits\");\r\n\r\nutil.pool = require(\"./pool\");\r\n\r\n/**\r\n * Whether running within node or not.\r\n * @memberof util\r\n * @type {boolean}\r\n */\r\nvar isNode = util.isNode = Boolean(global.process && global.process.versions && global.process.versions.node);\r\n\r\n/**\r\n * Optional buffer class to use.\r\n * If you assign any compatible buffer implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Buffer = null;\r\n\r\nif (isNode)\r\n try { util.Buffer = require(\"buffer\").Buffer; } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Optional Long class to use.\r\n * If you assign any compatible long implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Long = global.dcodeIO && global.dcodeIO.Long || null;\r\n\r\nif (!util.Long && isNode)\r\n try { util.Long = require(\"long\"); } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Converts a number or long to an 8 characters long hash string.\r\n * @param {Long|number} value Value to convert\r\n * @returns {string} Hash\r\n */\r\nutil.longToHash = function longToHash(value) {\r\n return value\r\n ? LongBits.from(value).toHash()\r\n : '\\0\\0\\0\\0\\0\\0\\0\\0';\r\n};\r\n\r\n/**\r\n * Converts an 8 characters long hash string to a long or number.\r\n * @param {string} hash Hash\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long|number} Original value\r\n */\r\nutil.longFromHash = function longFromHash(hash, unsigned) {\r\n var bits = LongBits.fromHash(hash);\r\n if (util.Long)\r\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\r\n return bits.toNumber(Boolean(unsigned));\r\n};\r\n\r\n/**\r\n * Tests if two possibly long values are not equal.\r\n * @param {number|Long} a First value\r\n * @param {number|Long} b Second value\r\n * @returns {boolean} `true` if not equal\r\n */\r\nutil.longNeq = function longNeq(a, b) {\r\n return typeof a === 'number'\r\n ? typeof b === 'number'\r\n ? a !== b\r\n : (a = LongBits.fromNumber(a)).lo !== b.low || a.hi !== b.high\r\n : typeof b === 'number'\r\n ? (b = LongBits.fromNumber(b)).lo !== a.low || b.hi !== a.high\r\n : a.low !== b.low || a.high !== b.high;\r\n};\r\n\r\n/**\r\n * Defines the specified properties on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {Object} descriptors Property descriptors\r\n * @returns {undefined}\r\n */\r\nutil.props = function props(target, descriptors) {\r\n Object.keys(descriptors).forEach(function(key) {\r\n util.prop(target, key, descriptors[key]);\r\n });\r\n};\r\n\r\n/**\r\n * Defines the specified property on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {string} key Property name\r\n * @param {Object} descriptor Property descriptor\r\n * @returns {undefined}\r\n */\r\nutil.prop = function prop(target, key, descriptor) {\r\n var ie8 = !-[1,];\r\n var ucKey = key.substring(0, 1).toUpperCase() + key.substring(1);\r\n if (descriptor.get)\r\n target['get' + ucKey] = descriptor.get;\r\n if (descriptor.set)\r\n target['set' + ucKey] = ie8\r\n ? function(value) {\r\n descriptor.set.call(this, value);\r\n this[key] = value;\r\n }\r\n : descriptor.set;\r\n if (ie8) {\r\n if (descriptor.value !== undefined)\r\n target[key] = descriptor.value;\r\n } else\r\n Object.defineProperty(target, key, descriptor);\r\n};\r\n\r\n/**\r\n * An immuable empty array.\r\n * @memberof util\r\n * @type {Array.<*>}\r\n */\r\nutil.emptyArray = Object.freeze([]);\r\n\r\n/**\r\n * An immutable empty object.\r\n * @type {Object}\r\n */\r\nutil.emptyObject = Object.freeze({});\r\n","\"use strict\";\r\nmodule.exports = Writer;\r\n\r\nWriter.BufferWriter = BufferWriter;\r\n\r\nvar util = require(29),\r\n ieee754 = require(1);\r\nvar LongBits = util.LongBits,\r\n ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\r\n\r\n/**\r\n * Constructs a new writer operation instance.\r\n * @classdesc Scheduled writer operation.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {*} val Value to write\r\n * @param {number} len Value byte length\r\n * @private\r\n * @ignore\r\n */\r\nfunction Op(fn, val, len) {\r\n\r\n /**\r\n * Function to call.\r\n * @type {function(Uint8Array, number, *)}\r\n */\r\n this.fn = fn;\r\n\r\n /**\r\n * Value to write.\r\n * @type {*}\r\n */\r\n this.val = val;\r\n\r\n /**\r\n * Value byte length.\r\n * @type {number}\r\n */\r\n this.len = len;\r\n\r\n /**\r\n * Next operation.\r\n * @type {?Writer.Op}\r\n */\r\n this.next = null;\r\n}\r\n\r\nWriter.Op = Op;\r\n\r\nfunction noop() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Constructs a new writer state instance.\r\n * @classdesc Copied writer state.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {Writer} writer Writer to copy state from\r\n * @param {State} next Next state entry\r\n * @private\r\n * @ignore\r\n */\r\nfunction State(writer, next) {\r\n\r\n /**\r\n * Current head.\r\n * @type {Writer.Op}\r\n */\r\n this.head = writer.head;\r\n\r\n /**\r\n * Current tail.\r\n * @type {Writer.Op}\r\n */\r\n this.tail = writer.tail;\r\n\r\n /**\r\n * Current buffer length.\r\n * @type {number}\r\n */\r\n this.len = writer.len;\r\n\r\n /**\r\n * Next state.\r\n * @type {?State}\r\n */\r\n this.next = next;\r\n}\r\n\r\nWriter.State = State;\r\n\r\n/**\r\n * Constructs a new writer instance.\r\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n */\r\nfunction Writer() {\r\n\r\n /**\r\n * Current length.\r\n * @type {number}\r\n */\r\n this.len = 0;\r\n\r\n /**\r\n * Operations head.\r\n * @type {Object}\r\n */\r\n this.head = new Op(noop, 0, 0);\r\n\r\n /**\r\n * Operations tail\r\n * @type {Object}\r\n */\r\n this.tail = this.head;\r\n\r\n /**\r\n * Linked forked states.\r\n * @type {?Object}\r\n */\r\n this.states = null;\r\n\r\n // When a value is written, the writer calculates its byte length and puts it into a linked\r\n // list of operations to perform when finish() is called. This both allows us to allocate\r\n // buffers of the exact required size and reduces the amount of work we have to do compared\r\n // to first calculating over objects and then encoding over objects. In our case, the encoding\r\n // part is just a linked list walk calling linked operations with already prepared values.\r\n}\r\n\r\n/**\r\n * Creates a new writer.\r\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\r\n */\r\nWriter.create = function create() {\r\n return new (util.Buffer && BufferWriter || Writer);\r\n};\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nWriter.alloc = function alloc(size) {\r\n return new ArrayImpl(size);\r\n};\r\n\r\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\r\nif (ArrayImpl !== Array)\r\n Writer.alloc = util.pool(Writer.alloc, ArrayImpl.prototype.subarray || ArrayImpl.prototype.slice);\r\n\r\n/** @alias Writer.prototype */\r\nvar WriterPrototype = Writer.prototype;\r\n\r\n/**\r\n * Pushes a new operation to the queue.\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.push = function push(fn, len, val) {\r\n var op = new Op(fn, val, len);\r\n this.tail.next = op;\r\n this.tail = op;\r\n this.len += len;\r\n return this;\r\n};\r\n\r\nfunction writeByte(buf, pos, val) {\r\n buf[pos] = val & 255;\r\n}\r\n\r\n/**\r\n * Writes a tag.\r\n * @param {number} id Field id\r\n * @param {number} wireType Wire type\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.tag = function write_tag(id, wireType) {\r\n return this.push(writeByte, 1, id << 3 | wireType & 7);\r\n};\r\n\r\nfunction writeVarint32(buf, pos, val) {\r\n while (val > 127) {\r\n buf[pos++] = val & 127 | 128;\r\n val >>>= 7;\r\n }\r\n buf[pos] = val;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as a varint.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.uint32 = function write_uint32(value) {\r\n value >>>= 0;\r\n return value < 128\r\n ? this.push(writeByte, 1, value)\r\n : this.push(writeVarint32,\r\n value < 16384 ? 2\r\n : value < 2097152 ? 3\r\n : value < 268435456 ? 4\r\n : 5\r\n , value);\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as a varint.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.int32 = function write_int32(value) {\r\n return value < 0\r\n ? this.push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\r\n : this.uint32(value);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as a varint, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sint32 = function write_sint32(value) {\r\n return this.uint32(value << 1 ^ value >> 31);\r\n};\r\n\r\nfunction writeVarint64(buf, pos, val) {\r\n // tends to deoptimize. stays optimized when using bits directly.\r\n while (val.hi) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\r\n val.hi >>>= 7;\r\n }\r\n while (val.lo > 127) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = val.lo >>> 7;\r\n }\r\n buf[pos++] = val.lo;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as a varint.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.uint64 = function write_uint64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.int64 = WriterPrototype.uint64;\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sint64 = function write_sint64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a boolish value as a varint.\r\n * @param {boolean} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bool = function write_bool(value) {\r\n return this.push(writeByte, 1, value ? 1 : 0);\r\n};\r\n\r\nfunction writeFixed32(buf, pos, val) {\r\n buf[pos++] = val & 255;\r\n buf[pos++] = val >>> 8 & 255;\r\n buf[pos++] = val >>> 16 & 255;\r\n buf[pos ] = val >>> 24;\r\n}\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fixed32 = function write_fixed32(value) {\r\n return this.push(writeFixed32, 4, value >>> 0);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sfixed32 = function write_sfixed32(value) {\r\n return this.push(writeFixed32, 4, value << 1 ^ value >> 31);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.fixed64 = function write_fixed64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeFixed32, 4, bits.hi).push(writeFixed32, 4, bits.lo);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sfixed64 = function write_sfixed64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeFixed32, 4, bits.hi).push(writeFixed32, 4, bits.lo);\r\n};\r\n\r\nvar writeFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function writeFloat_f32(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos ] = f8b[3];\r\n }\r\n : function writeFloat_f32_le(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeFloat_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Writes a float (32 bit).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.float = function write_float(value) {\r\n return this.push(writeFloat, 4, value);\r\n};\r\n\r\nvar writeDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function writeDouble_f64(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[6];\r\n buf[pos ] = f8b[7];\r\n }\r\n : function writeDouble_f64_le(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[7];\r\n buf[pos++] = f8b[6];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeDouble_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Writes a double (64 bit float).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.double = function write_double(value) {\r\n return this.push(writeDouble, 8, value);\r\n};\r\n\r\nvar writeBytes = ArrayImpl.prototype.set\r\n ? function writeBytes_set(buf, pos, val) {\r\n buf.set(val, pos);\r\n }\r\n : function writeBytes_for(buf, pos, val) {\r\n for (var i = 0; i < val.length; ++i)\r\n buf[pos + i] = val[i];\r\n };\r\n\r\n/**\r\n * Writes a sequence of bytes.\r\n * @param {Uint8Array} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bytes = function write_bytes(value) {\r\n var len = value.length >>> 0;\r\n return len\r\n ? this.uint32(len).push(writeBytes, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\nfunction writeString(buf, pos, val) {\r\n for (var i = 0; i < val.length; ++i) {\r\n var c1 = val.charCodeAt(i), c2;\r\n if (c1 < 128) {\r\n buf[pos++] = c1;\r\n } else if (c1 < 2048) {\r\n buf[pos++] = c1 >> 6 | 192;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = val.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buf[pos++] = c1 >> 18 | 240;\r\n buf[pos++] = c1 >> 12 & 63 | 128;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else {\r\n buf[pos++] = c1 >> 12 | 224;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n }\r\n }\r\n}\r\n\r\nfunction byteLength(val) {\r\n var strlen = val.length >>> 0;\r\n var len = 0;\r\n for (var i = 0; i < strlen; ++i) {\r\n var c1 = val.charCodeAt(i);\r\n if (c1 < 128)\r\n len += 1;\r\n else if (c1 < 2048)\r\n len += 2;\r\n else if ((c1 & 0xFC00) === 0xD800 && (val.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n}\r\n\r\n/**\r\n * Writes a string.\r\n * @param {string} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.string = function write_string(value) {\r\n var len = byteLength(value);\r\n return len\r\n ? this.uint32(len).push(writeString, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Forks this writer's state by pushing it to a stack.\r\n * Calling {@link Writer#}, {@link Writer#reset} or {@link Writer#finish} resets the writer to the previous state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fork = function fork() {\r\n this.states = new State(this, this.states);\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance to the last state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.reset = function reset() {\r\n if (this.states) {\r\n this.head = this.states.head;\r\n this.tail = this.states.tail;\r\n this.len = this.states.len;\r\n this.states = this.states.next;\r\n } else {\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\r\n * @param {number} [id] Id with wire type 2 to prepend as a tag where applicable\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.ldelim = function ldelim(id) {\r\n var head = this.head,\r\n tail = this.tail,\r\n len = this.len;\r\n this.reset();\r\n if (id !== undefined)\r\n this.tag(id, 2);\r\n this.uint32(len);\r\n this.tail.next = head.next; // skip noop\r\n this.tail = tail;\r\n this.len += len;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of write operations and frees all resources.\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nWriterPrototype.finish = function finish() {\r\n var head = this.head.next, // skip noop\r\n buf = this.constructor.alloc(this.len);\r\n this.reset();\r\n var pos = 0;\r\n while (head) {\r\n head.fn(buf, pos, head.val);\r\n pos += head.len;\r\n head = head.next;\r\n }\r\n return buf;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer writer instance.\r\n * @classdesc Wire format writer using node buffers.\r\n * @exports BufferWriter\r\n * @extends Writer\r\n * @constructor\r\n */\r\nfunction BufferWriter() {\r\n Writer.call(this);\r\n}\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nBufferWriter.alloc = function alloc_buffer(size) {\r\n BufferWriter.alloc = util.Buffer.allocUnsafe\r\n ? util.Buffer.allocUnsafe\r\n : function allocUnsafeNew(size) { return new util.Buffer(size); };\r\n return BufferWriter.alloc(size);\r\n};\r\n\r\n/** @alias BufferWriter.prototype */\r\nvar BufferWriterPrototype = BufferWriter.prototype = Object.create(Writer.prototype);\r\nBufferWriterPrototype.constructor = BufferWriter;\r\n\r\nfunction writeFloatBuffer(buf, pos, val) {\r\n buf.writeFloatLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.float = function write_float_buffer(value) {\r\n return this.push(writeFloatBuffer, 4, value);\r\n};\r\n\r\nfunction writeDoubleBuffer(buf, pos, val) {\r\n buf.writeDoubleLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.double = function write_double_buffer(value) {\r\n return this.push(writeDoubleBuffer, 8, value);\r\n};\r\n\r\nfunction writeBytesBuffer(buf, pos, val) {\r\n if (val.length)\r\n val.copy(buf, pos, 0, val.length);\r\n // This could probably be optimized just like writeStringBuffer, but most real use cases won't benefit much.\r\n}\r\n\r\nif (!(ArrayImpl.prototype.set && util.Buffer && util.Buffer.prototype.set)) // set is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.bytes = function write_bytes_buffer(value) {\r\n var len = value.length >>> 0;\r\n return len\r\n ? this.uint32(len).push(writeBytesBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\nvar writeStringBuffer = (function() { // eslint-disable-line wrap-iife\r\n return util.Buffer && util.Buffer.prototype.utf8Write // around forever, but not present in browser buffer\r\n ? function writeString_buffer_utf8Write(buf, pos, val) {\r\n if (val.length < 40)\r\n writeString(buf, pos, val);\r\n else\r\n buf.utf8Write(val, pos);\r\n }\r\n : function writeString_buffer_write(buf, pos, val) {\r\n if (val.length < 40)\r\n writeString(buf, pos, val);\r\n else\r\n buf.write(val, pos);\r\n };\r\n // Note that the plain JS encoder is faster for short strings, probably because of redundant assertions.\r\n // For a raw utf8Write, the breaking point is about 20 characters, for write it is around 40 characters.\r\n // Unfortunately, this does not translate 1:1 to real use cases, hence the common \"good enough\" limit of 40.\r\n})();\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.string = function write_string_buffer(value) {\r\n var len = value.length < 40\r\n ? byteLength(value)\r\n : util.Buffer.byteLength(value);\r\n return len\r\n ? this.uint32(len).push(writeStringBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n","\"use strict\";\r\nvar protobuf = global.protobuf = exports;\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\r\n * @param {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction load(filename, root, callback) {\r\n if (typeof root === 'function') {\r\n callback = root;\r\n root = new protobuf.Root();\r\n } else if (!root)\r\n root = new protobuf.Root();\r\n return root.load(filename, callback);\r\n}\r\n// function load(filename:string, root:Root, callback:function):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:function):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n// function load(filename:string, [root:Root]):Promise\r\n\r\nprotobuf.load = load;\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nfunction loadSync(filename, root) {\r\n if (!root)\r\n root = new protobuf.Root();\r\n return root.loadSync(filename);\r\n}\r\n\r\nprotobuf.loadSync = loadSync;\r\n\r\n// Parser\r\nprotobuf.tokenize = require(\"./tokenize\");\r\nprotobuf.parse = require(\"./parse\");\r\n\r\n// Serialization\r\nprotobuf.Writer = require(\"./writer\");\r\nprotobuf.BufferWriter = protobuf.Writer.BufferWriter;\r\nprotobuf.Reader = require(\"./reader\");\r\nprotobuf.BufferReader = protobuf.Reader.BufferReader;\r\nprotobuf.codegen = require(\"./codegen\");\r\n\r\n// Reflection\r\nprotobuf.ReflectionObject = require(\"./object\");\r\nprotobuf.Namespace = require(\"./namespace\");\r\nprotobuf.Root = require(\"./root\");\r\nprotobuf.Enum = require(\"./enum\");\r\nprotobuf.Type = require(\"./type\");\r\nprotobuf.Field = require(\"./field\");\r\nprotobuf.OneOf = require(\"./oneof\");\r\nprotobuf.MapField = require(\"./mapfield\");\r\nprotobuf.Service = require(\"./service\");\r\nprotobuf.Method = require(\"./method\");\r\n\r\n// Runtime\r\nprotobuf.Class = require(\"./class\");\r\nprotobuf.Message = require(\"./message\");\r\n\r\n// Utility\r\nprotobuf.types = require(\"./types\");\r\nprotobuf.common = require(\"./common\");\r\nprotobuf.rpc = require(\"./rpc\");\r\nprotobuf.util = require(\"./util\");\r\n\r\n// Be nice to AMD\r\nif (typeof define === 'function' && define.amd)\r\n define([\"long\"], function(Long) {\r\n if (Long) {\r\n protobuf.util.Long = Long;\r\n protobuf.Reader.configure();\r\n }\r\n return protobuf;\r\n });\r\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/src/class.js b/src/class.js new file mode 100644 index 000000000..6f230e31e --- /dev/null +++ b/src/class.js @@ -0,0 +1,137 @@ +"use strict"; +module.exports = Class; + +var Message = require("./message"), + Type = require("./type"), + util = require("./util"); + +var _TypeError = util._TypeError; + +/** + * Constructs a class instance, which is also a message prototype. + * @classdesc Runtime class providing the tools to create your own custom classes. + * @constructor + * @param {Type} type Reflected type + * @abstract + */ +function Class(type) { + return Class.create(type); +} + +/** + * Constructs a new message prototype for the specified reflected type and sets up its constructor. + * @param {Type} type Reflected message type + * @param {*} [ctor] Custom constructor to set up, defaults to create a generic one if omitted + * @returns {Message} Message prototype + */ +Class.create = function create(type, ctor) { + if (!(type instanceof Type)) + throw _TypeError("type", "a Type"); + var clazz = ctor; + if (clazz) { + if (typeof clazz !== 'function') + throw _TypeError("ctor", "a function"); + } else + clazz = (function(MessageCtor) { // eslint-disable-line wrap-iife + return function Message(properties) { + MessageCtor.call(this, properties); + }; + })(Message); + + // Let's pretend... + clazz.constructor = Class; + + // new Class() -> Message.prototype + var prototype = clazz.prototype = new Message(); + prototype.constructor = clazz; + + // Static methods on Message are instance methods on Class and vice-versa. + util.merge(clazz, Message, true); + + // Classes and messages reference their reflected type + clazz.$type = type; + prototype.$type = type; + + // Messages have non-enumerable default values on their prototype + type.getFieldsArray().forEach(function(field) { + field.resolve(); + // objects on the prototype must be immmutable. users must assign a new object instance and + // cannot use Array#push on empty arrays on the prototype for example, as this would modify + // the value on the prototype for ALL messages of this type. Hence, these objects are frozen. + prototype[field.name] = Array.isArray(field.defaultValue) + ? util.emptyArray + : util.isObject(field.defaultValue) + ? util.emptyObject + : field.defaultValue; + }); + + // Runtime messages have non-enumerable getters and setters for each virtual oneof field + type.getOneofsArray().forEach(function(oneof) { + util.prop(prototype, oneof.resolve().name, { + get: function getVirtual() { + // > If the parser encounters multiple members of the same oneof on the wire, only the last member seen is used in the parsed message. + var keys = Object.keys(this); + for (var i = keys.length - 1; i > -1; --i) + if (oneof.oneof.indexOf(keys[i]) > -1) + return keys[i]; + return undefined; + }, + set: function setVirtual(value) { + var keys = oneof.oneof; + for (var i = 0; i < keys.length; ++i) + if (keys[i] !== value) + delete this[keys[i]]; + } + }); + }); + + // Register + type.ctor = clazz; + + return prototype; +}; + +// Static methods on Message are instance methods on Class and vice-versa. +Class.prototype = Message; + +/** + * Encodes a message of this type. + * @name Class#encode + * @function + * @param {Message|Object} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + */ + +/** + * Encodes a message of this type preceeded by its length as a varint. + * @name Class#encodeDelimited + * @function + * @param {Message|Object} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + */ + +/** + * Decodes a message of this type. + * @name Class#decode + * @function + * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode + * @returns {Message} Decoded message + */ + +/** + * Decodes a message of this type preceeded by its length as a varint. + * @name Class#decodeDelimited + * @function + * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode + * @returns {Message} Decoded message + */ + +/** + * Verifies a message of this type. + * @name Class#verify + * @function + * @param {Message|Object} message Message or plain object to verify + * @returns {?string} `null` if valid, otherwise the reason why it is not + */ diff --git a/src/codegen/decode.js b/src/codegen/decode.js index a270f9048..b29c04af3 100644 --- a/src/codegen/decode.js +++ b/src/codegen/decode.js @@ -17,7 +17,7 @@ var Enum = require("../enum"), * Decodes a message of `this` message's type. * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from * @param {number} [length] Length of the message, if known beforehand - * @returns {Prototype} Populated runtime message + * @returns {Message} Populated runtime message * @this Type */ decode.fallback = function decode_fallback(readerOrBuffer, length) { diff --git a/src/codegen/encode.js b/src/codegen/encode.js index b3c3c6580..404ad6b55 100644 --- a/src/codegen/encode.js +++ b/src/codegen/encode.js @@ -15,7 +15,7 @@ var Enum = require("../enum"), /** * Encodes a message of `this` message's type. - * @param {Prototype|Object} message Runtime message or plain object to encode + * @param {Message|Object} message Runtime message or plain object to encode * @param {Writer} [writer] Writer to encode to * @returns {Writer} writer * @this Type diff --git a/src/codegen/verify.js b/src/codegen/verify.js index 1b716a924..1513a4359 100644 --- a/src/codegen/verify.js +++ b/src/codegen/verify.js @@ -14,7 +14,7 @@ var Enum = require("../enum"), /** * Verifies a runtime message of `this` message type. - * @param {Prototype|Object} message Runtime message or plain object to verify + * @param {Message|Object} message Runtime message or plain object to verify * @returns {?string} `null` if valid, otherwise the reason why it is not * @this {Type} */ diff --git a/src/enum.js b/src/enum.js index 873654060..ba4295f97 100644 --- a/src/enum.js +++ b/src/enum.js @@ -10,7 +10,7 @@ var util = require("./util"); var _TypeError = util._TypeError; /** - * Constructs a new enum. + * Constructs a new enum instance. * @classdesc Reflected enum. * @extends ReflectionObject * @constructor diff --git a/src/field.js b/src/field.js index 30e85ef9d..c53fa10fb 100644 --- a/src/field.js +++ b/src/field.js @@ -14,7 +14,7 @@ var Type = require("./type"), var _TypeError = util._TypeError; /** - * Constructs a new message field. Note that {@link MapField|map fields} have their own class. + * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. * @classdesc Reflected message field. * @extends ReflectionObject * @constructor @@ -255,7 +255,7 @@ FieldPrototype.resolve = function resolve() { * @param {*} value Field value * @param {Object.} [options] Conversion options * @returns {*} Converted value - * @see {@link Prototype#asJSON} + * @see {@link Message#asJSON} */ FieldPrototype.jsonConvert = function(value, options) { if (options) { diff --git a/src/index.js b/src/index.js index 8e7ce1d17..16eaa2c5a 100644 --- a/src/index.js +++ b/src/index.js @@ -43,7 +43,7 @@ function load(filename, root, callback) { protobuf.load = load; /** - * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace. + * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). * @param {string|string[]} filename One or multiple files to load * @param {Root} [root] Root namespace, defaults to create a new one if omitted. * @returns {Root} Root namespace @@ -81,8 +81,8 @@ protobuf.Service = require("./service"); protobuf.Method = require("./method"); // Runtime -protobuf.Prototype = require("./prototype"); -protobuf.inherits = require("./inherits"); +protobuf.Class = require("./class"); +protobuf.Message = require("./message"); // Utility protobuf.types = require("./types"); diff --git a/src/inherits.js b/src/inherits.js deleted file mode 100644 index 9f21c5534..000000000 --- a/src/inherits.js +++ /dev/null @@ -1,195 +0,0 @@ -"use strict"; -module.exports = inherits; - -var Prototype = require("./prototype"), - Type = require("./type"), - util = require("./util"); - -var _TypeError = util._TypeError; - -/** - * Options passed to {@link inherits}, modifying its behavior. - * @typedef InheritanceOptions - * @type {Object} - * @property {boolean} [noStatics=false] Skips adding the default static methods on top of the constructor - * @property {boolean} [noRegister=false] Skips registering the constructor with the reflected type - */ - -/** - * Inherits a custom class from the message prototype of the specified message type. - * @param {*} clazz Inheriting class constructor - * @param {Type} type Inherited message type - * @param {InheritanceOptions} [options] Inheritance options - * @returns {Prototype} Created prototype - */ -function inherits(clazz, type, options) { - if (typeof clazz !== 'function') - throw _TypeError("clazz", "a function"); - if (!(type instanceof Type)) - throw _TypeError("type", "a Type"); - if (!options) - options = {}; - - /** - * This is not an actual type but stands as a reference for any constructor of a custom message class that you pass to the library. - * @name Class - * @extends Prototype - * @constructor - * @param {Object.} [properties] Properties to set on the message - * @see {@link inherits} - */ - - var classProperties = { - - /** - * Reference to the reflected type. - * @name Class.$type - * @type {Type} - * @readonly - */ - $type: { - value: type - } - }; - - if (!options.noStatics) - util.merge(classProperties, { - - /** - * Encodes a message of this type to a buffer. - * @name Class.encode - * @function - * @param {Prototype|Object} message Message to encode - * @param {Writer} [writer] Writer to use - * @returns {Writer} Writer - */ - encode: { - value: function encode(message, writer) { - return this.$type.encode(message, writer); - } - }, - - /** - * Encodes a message of this type preceeded by its length as a varint to a buffer. - * @name Class.encodeDelimited - * @function - * @param {Prototype|Object} message Message to encode - * @param {Writer} [writer] Writer to use - * @returns {Writer} Writer - */ - encodeDelimited: { - value: function encodeDelimited(message, writer) { - return this.$type.encodeDelimited(message, writer); - } - }, - - /** - * Decodes a message of this type from a buffer. - * @name Class.decode - * @function - * @param {Uint8Array} buffer Buffer to decode - * @returns {Prototype} Decoded message - */ - decode: { - value: function decode(buffer) { - return this.$type.decode(buffer); - } - }, - - /** - * Decodes a message of this type preceeded by its length as a varint from a buffer. - * @name Class.decodeDelimited - * @function - * @param {Uint8Array} buffer Buffer to decode - * @returns {Prototype} Decoded message - */ - decodeDelimited: { - value: function decodeDelimited(buffer) { - return this.$type.decodeDelimited(buffer); - } - }, - - /** - * Verifies a message of this type. - * @name Class.verify - * @function - * @param {Prototype|Object} message Message or plain object to verify - * @returns {?string} `null` if valid, otherwise the reason why it is not - */ - verify: { - value: function verify(message) { - return this.$type.verify(message); - } - } - - }, true); - - util.props(clazz, classProperties); - var prototype = inherits.defineProperties(new Prototype(), type); - clazz.prototype = prototype; - prototype.constructor = clazz; - - if (!options.noRegister) - type.setCtor(clazz); - - return prototype; -} - -/** - * Defines the reflected type's default values and virtual oneof properties on the specified prototype. - * @memberof inherits - * @param {Prototype} prototype Prototype to define properties upon - * @param {Type} type Reflected message type - * @returns {Prototype} The specified prototype - */ -inherits.defineProperties = function defineProperties(prototype, type) { - - var prototypeProperties = { - - /** - * Reference to the reflected type. - * @name Prototype#$type - * @type {Type} - * @readonly - */ - $type: { - value: type - } - }; - - // Initialize default values - type.getFieldsArray().forEach(function(field) { - field.resolve(); - // objects on the prototype must be immmutable. users must assign a new object instance and - // cannot use Array#push on empty arrays on the prototype for example, as this would modify - // the value on the prototype for ALL messages of this type. Hence, these objects are frozen. - prototype[field.name] = Array.isArray(field.defaultValue) - ? util.emptyArray - : util.isObject(field.defaultValue) - ? util.emptyObject - : field.defaultValue; - }); - - // Define each oneof with a non-enumerable getter and setter for the present field - type.getOneofsArray().forEach(function(oneof) { - util.prop(prototype, oneof.resolve().name, { - get: function getVirtual() { - // > If the parser encounters multiple members of the same oneof on the wire, only the last member seen is used in the parsed message. - var keys = Object.keys(this); - for (var i = keys.length - 1; i > -1; --i) - if (oneof.oneof.indexOf(keys[i]) > -1) - return keys[i]; - return undefined; - }, - set: function setVirtual(value) { - var keys = oneof.oneof; - for (var i = 0; i < keys.length; ++i) - if (keys[i] !== value) - delete this[keys[i]]; - } - }); - }); - - util.props(prototype, prototypeProperties); - return prototype; -}; diff --git a/src/mapfield.js b/src/mapfield.js index 1a3afa9f2..7590bae65 100644 --- a/src/mapfield.js +++ b/src/mapfield.js @@ -12,7 +12,7 @@ var Enum = require("./enum"), util = require("./util"); /** - * Constructs a new map field. + * Constructs a new map field instance. * @classdesc Reflected map field. * @extends Field * @constructor diff --git a/src/message.js b/src/message.js new file mode 100644 index 000000000..4826b5a3e --- /dev/null +++ b/src/message.js @@ -0,0 +1,135 @@ +"use strict"; +module.exports = Message; + +/** + * Constructs a new message instance. + * + * This method should be called from your custom constructors, i.e. `Message.call(this, properties)`. + * @classdesc Abstract runtime message. + * @extends {Object} + * @constructor + * @param {Object.} [properties] Properties to set + * @abstract + * @see {@link Class.create} + */ +function Message(properties) { + if (properties) { + var keys = Object.keys(properties); + for (var i = 0; i < keys.length; ++i) + this[keys[i]] = properties[keys[i]]; + } +} + +/** @alias Message.prototype */ +var MessagePrototype = Message.prototype; + +/** + * Converts this message to a JSON object. + * @param {Object.} [options] Conversion options + * @param {boolean} [options.fieldsOnly=false] Converts only properties that reference a field + * @param {*} [options.long] Long conversion type. Only relevant with a long library. + * Valid values are `String` and `Number` (the global types). + * Defaults to a possibly unsafe number without, and a `Long` with a long library. + * @param {*} [options.enum=Number] Enum value conversion type. + * Valid values are `String` and `Number` (the global types). + * Defaults to the numeric ids. + * @param {boolean} [options.defaults=false] Also sets default values on the resulting object + * @returns {Object.} JSON object + */ +MessagePrototype.asJSON = function asJSON(options) { + if (!options) + options = {}; + var fields = this.$type.fields, + json = {}; + var keys; + if (options.defaults) { + keys = []; + for (var k in this) // eslint-disable-line guard-for-in + keys.push(k); + } else + keys = Object.keys(this); + for (var i = 0, key; i < keys.length; ++i) { + var field = fields[key = keys[i]], + value = this[key]; + if (field) { + if (field.repeated) { + if (value && value.length) { + var array = new Array(value.length); + for (var j = 0, l = value.length; j < l; ++j) + array[j] = field.jsonConvert(value[j], options); + json[key] = array; + } + } else + json[key] = field.jsonConvert(value, options); + } else if (!options.fieldsOnly) + json[key] = value; + } + return json; +}; + +/** + * Reference to the reflected type. + * @name Message.$type + * @type {Type} + * @readonly + */ + +/** + * Reference to the reflected type. + * @name Message#$type + * @type {Type} + * @readonly + */ + +/** + * Encodes a message of this type. + * @param {Message|Object} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + */ +Message.encode = function encode(message, writer) { + return this.$type.encode(message, writer); +}; + +/** + * Encodes a message of this type preceeded by its length as a varint. + * @param {Message|Object} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + */ +Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.$type.encodeDelimited(message, writer); +}; + +/** + * Decodes a message of this type. + * @name Message.decode + * @function + * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode + * @returns {Message} Decoded message + */ +Message.decode = function decode(readerOrBuffer) { + return this.$type.decode(readerOrBuffer); +}; + +/** + * Decodes a message of this type preceeded by its length as a varint. + * @name Message.decodeDelimited + * @function + * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode + * @returns {Message} Decoded message + */ +Message.decodeDelimited = function decodeDelimited(readerOrBuffer) { + return this.$type.decodeDelimited(readerOrBuffer); +}; + +/** + * Verifies a message of this type. + * @name Message.verify + * @function + * @param {Message|Object} message Message or plain object to verify + * @returns {?string} `null` if valid, otherwise the reason why it is not + */ +Message.verify = function verify(message) { + return this.$type.verify(message); +}; diff --git a/src/method.js b/src/method.js index 5e125ce2f..bf97e2975 100644 --- a/src/method.js +++ b/src/method.js @@ -11,7 +11,7 @@ var Type = require("./type"), var _TypeError = util._TypeError; /** - * Constructs a new service method. + * Constructs a new service method instance. * @classdesc Reflected service method. * @extends ReflectionObject * @constructor diff --git a/src/namespace.js b/src/namespace.js index 23648d0fe..51e2b75f7 100644 --- a/src/namespace.js +++ b/src/namespace.js @@ -17,7 +17,7 @@ var nestedTypes = [ Enum, Type, Service, Field, Namespace ], nestedError = "one of " + nestedTypes.map(function(ctor) { return ctor.name; }).join(', '); /** - * Constructs a new namespace. + * Constructs a new namespace instance. * @classdesc Reflected namespace and base class of all reflection objects containing nested objects. * @extends ReflectionObject * @constructor diff --git a/src/object.js b/src/object.js index 41c86930e..274f50ab0 100644 --- a/src/object.js +++ b/src/object.js @@ -9,7 +9,7 @@ var Root = require("./root"), var _TypeError = util._TypeError; /** - * Constructs a new reflection object. + * Constructs a new reflection object instance. * @classdesc Base class of all reflection objects. * @constructor * @param {string} name Object name @@ -90,14 +90,14 @@ util.props(ReflectionObjectPrototype, { * Lets the specified constructor extend this class. * @memberof ReflectionObject * @param {*} constructor Extending constructor - * @returns {Object} Prototype + * @returns {Object} Constructor prototype * @this ReflectionObject */ function extend(constructor) { - var proto = constructor.prototype = Object.create(this.prototype); - proto.constructor = constructor; + var prototype = constructor.prototype = Object.create(this.prototype); + prototype.constructor = constructor; constructor.extend = extend; - return proto; + return prototype; } /** diff --git a/src/oneof.js b/src/oneof.js index c1a968435..25249ea4c 100644 --- a/src/oneof.js +++ b/src/oneof.js @@ -11,7 +11,7 @@ var Field = require("./field"), var _TypeError = util._TypeError; /** - * Constructs a new oneof. + * Constructs a new oneof instance. * @classdesc Reflected oneof. * @extends ReflectionObject * @constructor diff --git a/src/prototype.js b/src/prototype.js deleted file mode 100644 index 846b9f963..000000000 --- a/src/prototype.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict"; -module.exports = Prototype; - -/** - * Constructs a new prototype. - * This method should be called from your custom constructors, i.e. `Prototype.call(this, properties)`. - * @classdesc Runtime message prototype ready to be extended by custom classes or generated code. - * @constructor - * @param {Object.} [properties] Properties to set - * @abstract - * @see {@link inherits} - * @see {@link Class} - */ -function Prototype(properties) { - if (properties) { - var keys = Object.keys(properties); - for (var i = 0; i < keys.length; ++i) - this[keys[i]] = properties[keys[i]]; - } -} - -/** - * Converts a runtime message to a JSON object. - * @param {Object.} [options] Conversion options - * @param {boolean} [options.fieldsOnly=false] Converts only properties that reference a field - * @param {*} [options.long] Long conversion type. Only relevant with a long library. - * Valid values are `String` and `Number` (the global types). - * Defaults to a possibly unsafe number without, and a `Long` with a long library. - * @param {*} [options.enum=Number] Enum value conversion type. - * Valid values are `String` and `Number` (the global types). - * Defaults to the numeric ids. - * @param {boolean} [options.defaults=false] Also sets default values on the resulting object - * @returns {Object.} JSON object - */ -Prototype.prototype.asJSON = function asJSON(options) { - if (!options) - options = {}; - var fields = this.constructor.$type.fields, - json = {}; - var keys; - if (options.defaults) { - keys = []; - for (var k in this) // eslint-disable-line guard-for-in - keys.push(k); - } else - keys = Object.keys(this); - for (var i = 0, key; i < keys.length; ++i) { - var field = fields[key = keys[i]], - value = this[key]; - if (field) { - if (field.repeated) { - if (value && value.length) { - var array = new Array(value.length); - for (var j = 0, l = value.length; j < l; ++j) - array[j] = field.jsonConvert(value[j], options); - json[key] = array; - } - } else - json[key] = field.jsonConvert(value, options); - } else if (!options.fieldsOnly) - json[key] = value; - } - return json; -}; diff --git a/src/reader.js b/src/reader.js index 4f3cce0fc..9eaa569b8 100644 --- a/src/reader.js +++ b/src/reader.js @@ -36,7 +36,7 @@ function configure() { Reader.configure = configure; /** - * Constructs a new reader using the specified buffer. + * Constructs a new reader instance using the specified buffer. * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. * @constructor * @param {Uint8Array} buffer Buffer to read from @@ -555,7 +555,7 @@ var initBufferReader = function() { }; /** - * Constructs a new buffer reader. + * Constructs a new buffer reader instance. * @classdesc Wire format reader using node buffers. * @extends Reader * @constructor diff --git a/src/root.js b/src/root.js index 150a2fe8a..443780684 100644 --- a/src/root.js +++ b/src/root.js @@ -10,7 +10,7 @@ var Field = require("./field"), common = require("./common"); /** - * Constructs a new root namespace. + * Constructs a new root namespace instance. * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. * @extends Namespace * @constructor @@ -55,7 +55,7 @@ Root.fromJSON = function fromJSON(json, root) { RootPrototype.resolvePath = util.resolvePath; // A symbol-like function to safely signal synchronous loading -function SYNC() {} +function SYNC() {} // eslint-disable-line no-empty-function /** * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. diff --git a/src/rpc.js b/src/rpc.js index 70be9131a..f59602df2 100644 --- a/src/rpc.js +++ b/src/rpc.js @@ -1,7 +1,7 @@ "use strict"; /** - * RPC helpers. + * Streaming RPC helpers. * @namespace */ var rpc = exports; diff --git a/src/rpc/service.js b/src/rpc/service.js index e1f52cf3c..de5b8221e 100644 --- a/src/rpc/service.js +++ b/src/rpc/service.js @@ -4,7 +4,7 @@ module.exports = Service; var EventEmitter = require("../util/eventemitter"); /** - * Constructs a new RPC service. + * Constructs a new RPC service instance. * @classdesc An RPC service as returned by {@link Service#create}. * @memberof rpc * @extends util.EventEmitter diff --git a/src/service.js b/src/service.js index 9361b0dbb..cd7b3711f 100644 --- a/src/service.js +++ b/src/service.js @@ -12,7 +12,7 @@ var Method = require("./method"), rpc = require("./rpc"); /** - * Constructs a new service. + * Constructs a new service instance. * @classdesc Reflected service. * @extends Namespace * @constructor diff --git a/src/type.js b/src/type.js index d3dae5e3d..2b3f7a970 100644 --- a/src/type.js +++ b/src/type.js @@ -11,15 +11,15 @@ var Enum = require("./enum"), OneOf = require("./oneof"), Field = require("./field"), Service = require("./service"), - Prototype = require("./prototype"), + Class = require("./class"), + Message = require("./message"), Reader = require("./reader"), Writer = require("./writer"), - inherits = require("./inherits"), util = require("./util"), codegen = require("./codegen"); /** - * Constructs a new message type. + * Constructs a new reflected message type instance. * @classdesc Reflected message type. * @extends Namespace * @constructor @@ -153,28 +153,15 @@ util.props(TypePrototype, { /** * The registered constructor, if any registered, otherwise a generic constructor. * @name Type#ctor - * @type {Prototype} + * @type {Class} */ ctor: { get: function getCtor() { - if (this._ctor) - return this._ctor; - var ctor; - if (codegen.supported) - ctor = codegen("p")("P.call(this,p)").eof(this.getFullName() + "$ctor", { - P: Prototype - }); - else - ctor = function GenericMessage(properties) { - Prototype.call(this, properties); - }; - ctor.prototype = inherits(ctor, this); - this._ctor = ctor; - return ctor; + return this._ctor || (this._ctor = Class.create(this).constructor); }, set: function setCtor(ctor) { - if (ctor && !(ctor.prototype instanceof Prototype)) - throw util._TypeError("ctor", "a constructor inheriting from Prototype"); + if (ctor && !(ctor.prototype instanceof Message)) + throw util._TypeError("ctor", "a constructor inheriting from Message"); this._ctor = ctor; } } @@ -324,27 +311,15 @@ TypePrototype.remove = function remove(object) { /** * Creates a new message of this type using the specified properties. * @param {Object|*} [properties] Properties to set - * @param {*} [ctor] Constructor to use. - * Defaults to use the internal constuctor. - * @returns {Prototype} Message instance + * @returns {Message} Runtime message */ -TypePrototype.create = function create(properties, ctor) { - if (!properties || typeof properties === 'function') { - ctor = properties; - properties = undefined; - } else if (properties /* already */ instanceof Prototype) - return properties; - if (ctor) { - if (!(ctor.prototype instanceof Prototype)) - throw util._TypeError("ctor", "a constructor inheriting from Prototype"); - } else - ctor = this.getCtor(); - return new ctor(properties); +TypePrototype.create = function create(properties) { + return new (this.getCtor())(properties); }; /** * Encodes a message of this type. - * @param {Prototype|Object} message Message instance or plain object + * @param {Message|Object} message Message instance or plain object * @param {Writer} [writer] Writer to encode to * @returns {Writer} writer */ @@ -361,7 +336,7 @@ TypePrototype.encode = function encode(message, writer) { /** * Encodes a message of this type preceeded by its byte length as a varint. - * @param {Prototype|Object} message Message instance or plain object + * @param {Message|Object} message Message instance or plain object * @param {Writer} [writer] Writer to encode to * @returns {Writer} writer */ @@ -373,7 +348,7 @@ TypePrototype.encodeDelimited = function encodeDelimited(message, writer) { * Decodes a message of this type. * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from * @param {number} [length] Length of the message, if known beforehand - * @returns {Prototype} Decoded message + * @returns {Message} Decoded message */ TypePrototype.decode = function decode(readerOrBuffer, length) { return (this.decode = codegen.supported @@ -389,7 +364,7 @@ TypePrototype.decode = function decode(readerOrBuffer, length) { /** * Decodes a message of this type preceeded by its byte length as a varint. * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from - * @returns {Prototype} Decoded message + * @returns {Message} Decoded message */ TypePrototype.decodeDelimited = function decodeDelimited(readerOrBuffer) { readerOrBuffer = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer); @@ -398,7 +373,7 @@ TypePrototype.decodeDelimited = function decodeDelimited(readerOrBuffer) { /** * Verifies that enum values are valid and that any required fields are present. - * @param {Prototype|Object} message Message to verify + * @param {Message|Object} message Message to verify * @returns {?string} `null` if valid, otherwise the reason why it is not */ TypePrototype.verify = function verify(message) { diff --git a/src/util.js b/src/util.js index 627c83c60..911c64e34 100644 --- a/src/util.js +++ b/src/util.js @@ -1,7 +1,7 @@ "use strict"; /** - * Utility functions. + * Various utility functions. * @namespace */ var util = exports; diff --git a/src/util/eventemitter.js b/src/util/eventemitter.js index 3751069cb..d58e71573 100644 --- a/src/util/eventemitter.js +++ b/src/util/eventemitter.js @@ -2,7 +2,7 @@ module.exports = EventEmitter; /** - * Constructs a new event emitter. + * Constructs a new event emitter instance. * @classdesc A minimal event emitter. * @memberof util * @constructor diff --git a/src/writer.js b/src/writer.js index 74375a9b6..44def7276 100644 --- a/src/writer.js +++ b/src/writer.js @@ -9,7 +9,7 @@ var LongBits = util.LongBits, ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; /** - * Constructs a new writer operation. + * Constructs a new writer operation instance. * @classdesc Scheduled writer operation. * @memberof Writer * @constructor @@ -51,7 +51,7 @@ Writer.Op = Op; function noop() {} // eslint-disable-line no-empty-function /** - * Constructs a new writer state. + * Constructs a new writer state instance. * @classdesc Copied writer state. * @memberof Writer * @constructor @@ -90,7 +90,7 @@ function State(writer, next) { Writer.State = State; /** - * Constructs a new writer. + * Constructs a new writer instance. * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. * @constructor */ @@ -545,7 +545,7 @@ WriterPrototype.finish = function finish() { }; /** - * Constructs a new buffer writer. + * Constructs a new buffer writer instance. * @classdesc Wire format writer using node buffers. * @exports BufferWriter * @extends Writer diff --git a/tests/basics.js b/tests/basics.js index 0d91282fb..346a9d5e0 100644 --- a/tests/basics.js +++ b/tests/basics.js @@ -19,7 +19,7 @@ tape.test("google.protobuf.Any type", function(test) { test.test("instances", function(test) { - test.ok(any instanceof protobuf.Prototype, "should extend Prototype"); + test.ok(any instanceof protobuf.Message, "should extend Message"); test.deepEqual(any, { type_url: "some.type", value: valueBuffer diff --git a/tests/classes.js b/tests/classes.js index fce240d1a..e0afa17e3 100644 --- a/tests/classes.js +++ b/tests/classes.js @@ -1,18 +1,21 @@ var tape = require("tape"); -var protobuf = require(".."), - Prototype = protobuf.Prototype, - inherits = protobuf.inherits; +var protobuf = require(".."), + Class = protobuf.Class, + Message = protobuf.Message; tape.test("google.protobuf.Any class", function(test) { + + test.equal(Message, Class.prototype, "requires that prototypes are class instances"); + protobuf.load("tests/data/common.proto", function(err, root) { if (err) return test.fail(err.message); function Any(properties) { - Prototype.call(this, properties); + Message.call(this, properties); } - inherits(Any, root.lookup("google.protobuf.Any")); + Any.prototype = Class.create(root.lookup("google.protobuf.Any"), Any); var valueBuffer = protobuf.util.newBuffer(0); var any = new Any({ @@ -22,7 +25,7 @@ tape.test("google.protobuf.Any class", function(test) { test.test("instances", function(test) { - test.ok(any instanceof protobuf.Prototype, "should extend Prototype"); + test.ok(any instanceof protobuf.Message, "should extend Message"); test.ok(any instanceof Any, "should extend the custom class"); test.deepEqual(any, { type_url: "some.type", diff --git a/tests/package.js b/tests/package.js index 884befc18..15415e166 100644 --- a/tests/package.js +++ b/tests/package.js @@ -17,7 +17,7 @@ tape.test("package.json", function(test) { test.test("runtime message", function(test) { - test.ok(myPackage instanceof protobuf.Prototype, "should extend Prototype"); + test.ok(myPackage instanceof protobuf.Message, "should extend Message"); test.equal(myPackage.$type, Package, "should reference Package as its reflected type"); test.deepEqual(myPackage, pkg, "should have equal contents"); @@ -30,9 +30,9 @@ tape.test("package.json", function(test) { var buf = writer.finish(); var decoded = Package.decode(buf); - test.ok(decoded instanceof protobuf.Prototype, "should extend Prototype"); + test.ok(decoded instanceof protobuf.Message, "should extend Message"); test.equal(decoded.$type, Package, "should reference Package as its reflected type"); - test.ok(decoded.repository instanceof protobuf.Prototype, "submessages should also extend Prototype"); + test.ok(decoded.repository instanceof protobuf.Message, "submessages should also extend Message"); test.equal(decoded.repository.$type, Repository, "repository submessage should reference Repository as its reflected type"); test.deepEqual(decoded, pkg, "should have equal contents"); diff --git a/types/protobuf.js.d.ts b/types/protobuf.js.d.ts index d7c5b1740..2cc11a80a 100644 --- a/types/protobuf.js.d.ts +++ b/types/protobuf.js.d.ts @@ -1,9 +1,74 @@ /* * protobuf.js v6.1.0 TypeScript definitions - * Generated Thu, 08 Dec 2016 19:14:58 UTC + * Generated Fri, 09 Dec 2016 01:15:41 UTC */ declare module "protobufjs" { + /** + * Constructs a class instance, which is also a message prototype. + * @classdesc Runtime class providing the tools to create your own custom classes. + * @constructor + * @param {Type} type Reflected type + * @abstract + */ + abstract class Class { + /** + * Constructs a new message prototype for the specified reflected type and sets up its constructor. + * @param {Type} type Reflected message type + * @param {*} [ctor] Custom constructor to set up, defaults to create a generic one if omitted + * @returns {Message} Message prototype + */ + static create(type: Type, ctor?: any): Message; + + /** + * Encodes a message of this type. + * @name Class#encode + * @function + * @param {Message|Object} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + */ + encode(message: (Message|Object), writer?: Writer): Writer; + + /** + * Encodes a message of this type preceeded by its length as a varint. + * @name Class#encodeDelimited + * @function + * @param {Message|Object} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + */ + encodeDelimited(message: (Message|Object), writer?: Writer): Writer; + + /** + * Decodes a message of this type. + * @name Class#decode + * @function + * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode + * @returns {Message} Decoded message + */ + decode(readerOrBuffer: (Reader|Uint8Array)): Message; + + /** + * Decodes a message of this type preceeded by its length as a varint. + * @name Class#decodeDelimited + * @function + * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode + * @returns {Message} Decoded message + */ + decodeDelimited(readerOrBuffer: (Reader|Uint8Array)): Message; + + /** + * Verifies a message of this type. + * @name Class#verify + * @function + * @param {Message|Object} message Message or plain object to verify + * @returns {?string} `null` if valid, otherwise the reason why it is not + */ + verify(message: (Message|Object)): string; + + } + /** * A closure for generating functions programmatically. * @namespace @@ -42,7 +107,7 @@ declare module "protobufjs" { function common(name: string, json: Object): void; /** - * Constructs a new enum. + * Constructs a new enum instance. * @classdesc Reflected enum. * @extends ReflectionObject * @constructor @@ -52,7 +117,7 @@ declare module "protobufjs" { */ class Enum extends ReflectionObject { /** - * Constructs a new enum. + * Constructs a new enum instance. * @classdesc Reflected enum. * @extends ReflectionObject * @constructor @@ -122,7 +187,7 @@ declare module "protobufjs" { } /** - * Constructs a new message field. Note that {@link MapField|map fields} have their own class. + * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. * @classdesc Reflected message field. * @extends ReflectionObject * @constructor @@ -135,7 +200,7 @@ declare module "protobufjs" { */ class Field extends ReflectionObject { /** - * Constructs a new message field. Note that {@link MapField|map fields} have their own class. + * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. * @classdesc Reflected message field. * @extends ReflectionObject * @constructor @@ -282,7 +347,7 @@ declare module "protobufjs" { * @param {*} value Field value * @param {Object.} [options] Conversion options * @returns {*} Converted value - * @see {@link Prototype#asJSON} + * @see {@link Message#asJSON} */ jsonConvert(value: any, options?: { [k: string]: any }): any; @@ -320,7 +385,7 @@ declare module "protobufjs" { function load(filename: (string|string[]), root?: Root): Promise; /** - * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace. + * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). * @param {string|string[]} filename One or multiple files to load * @param {Root} [root] Root namespace, defaults to create a new one if omitted. * @returns {Root} Root namespace @@ -329,105 +394,7 @@ declare module "protobufjs" { function loadSync(filename: (string|string[]), root?: Root): Root; /** - * Options passed to {@link inherits}, modifying its behavior. - * @typedef InheritanceOptions - * @type {Object} - * @property {boolean} [noStatics=false] Skips adding the default static methods on top of the constructor - * @property {boolean} [noRegister=false] Skips registering the constructor with the reflected type - */ - interface InheritanceOptions { - noStatics: boolean; - noRegister: boolean; - } - - - /** - * Inherits a custom class from the message prototype of the specified message type. - * @param {*} clazz Inheriting class constructor - * @param {Type} type Inherited message type - * @param {InheritanceOptions} [options] Inheritance options - * @returns {Prototype} Created prototype - */ - function inherits(clazz: any, type: Type, options?: InheritanceOptions): Prototype; - - /** - * This is not an actual type but stands as a reference for any constructor of a custom message class that you pass to the library. - * @name Class - * @extends Prototype - * @constructor - * @param {Object.} [properties] Properties to set on the message - * @see {@link inherits} - */ - class Class extends Prototype { - /** - * This is not an actual type but stands as a reference for any constructor of a custom message class that you pass to the library. - * @name Class - * @extends Prototype - * @constructor - * @param {Object.} [properties] Properties to set on the message - * @see {@link inherits} - */ - constructor(properties?: { [k: string]: any }); - - /** - * Reference to the reflected type. - * @name Class.$type - * @type {Type} - * @readonly - */ - static $type: Type; - - /** - * Encodes a message of this type to a buffer. - * @name Class.encode - * @function - * @param {Prototype|Object} message Message to encode - * @param {Writer} [writer] Writer to use - * @returns {Writer} Writer - */ - static encode(message: (Prototype|Object), writer?: Writer): Writer; - - /** - * Encodes a message of this type preceeded by its length as a varint to a buffer. - * @name Class.encodeDelimited - * @function - * @param {Prototype|Object} message Message to encode - * @param {Writer} [writer] Writer to use - * @returns {Writer} Writer - */ - static encodeDelimited(message: (Prototype|Object), writer?: Writer): Writer; - - /** - * Decodes a message of this type from a buffer. - * @name Class.decode - * @function - * @param {Uint8Array} buffer Buffer to decode - * @returns {Prototype} Decoded message - */ - static decode(buffer: Uint8Array): Prototype; - - /** - * Decodes a message of this type preceeded by its length as a varint from a buffer. - * @name Class.decodeDelimited - * @function - * @param {Uint8Array} buffer Buffer to decode - * @returns {Prototype} Decoded message - */ - static decodeDelimited(buffer: Uint8Array): Prototype; - - /** - * Verifies a message of this type. - * @name Class.verify - * @function - * @param {Prototype|Object} message Message or plain object to verify - * @returns {?string} `null` if valid, otherwise the reason why it is not - */ - static verify(message: (Prototype|Object)): string; - - } - - /** - * Constructs a new map field. + * Constructs a new map field instance. * @classdesc Reflected map field. * @extends Field * @constructor @@ -439,7 +406,7 @@ declare module "protobufjs" { */ class MapField extends Field { /** - * Constructs a new map field. + * Constructs a new map field instance. * @classdesc Reflected map field. * @extends Field * @constructor @@ -482,7 +449,95 @@ declare module "protobufjs" { } /** - * Constructs a new service method. + * Constructs a new message instance. + * + * This method should be called from your custom constructors, i.e. `Message.call(this, properties)`. + * @classdesc Abstract runtime message. + * @extends {Object} + * @constructor + * @param {Object.} [properties] Properties to set + * @abstract + * @see {@link Class.create} + */ + abstract class Message extends Object { + /** + * Converts this message to a JSON object. + * @param {Object.} [options] Conversion options + * @param {boolean} [options.fieldsOnly=false] Converts only properties that reference a field + * @param {*} [options.long] Long conversion type. Only relevant with a long library. + * Valid values are `String` and `Number` (the global types). + * Defaults to a possibly unsafe number without, and a `Long` with a long library. + * @param {*} [options.enum=Number] Enum value conversion type. + * Valid values are `String` and `Number` (the global types). + * Defaults to the numeric ids. + * @param {boolean} [options.defaults=false] Also sets default values on the resulting object + * @returns {Object.} JSON object + */ + asJSON(options?: { [k: string]: any }): { [k: string]: any }; + + /** + * Reference to the reflected type. + * @name Message.$type + * @type {Type} + * @readonly + */ + static $type: Type; + + /** + * Reference to the reflected type. + * @name Message#$type + * @type {Type} + * @readonly + */ + $type: Type; + + /** + * Encodes a message of this type. + * @param {Message|Object} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + */ + static encode(message: (Message|Object), writer?: Writer): Writer; + + /** + * Encodes a message of this type preceeded by its length as a varint. + * @param {Message|Object} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + */ + static encodeDelimited(message: (Message|Object), writer?: Writer): Writer; + + /** + * Decodes a message of this type. + * @name Message.decode + * @function + * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode + * @returns {Message} Decoded message + */ + static decode(readerOrBuffer: (Reader|Uint8Array)): Message; + + /** + * Decodes a message of this type preceeded by its length as a varint. + * @name Message.decodeDelimited + * @function + * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode + * @returns {Message} Decoded message + */ + static decodeDelimited(readerOrBuffer: (Reader|Uint8Array)): Message; + + /** + * Verifies a message of this type. + * @name Message.verify + * @function + * @param {Message|Object} message Message or plain object to verify + * @returns {?string} `null` if valid, otherwise the reason why it is not + */ + static verify(message: (Message|Object)): string; + + } + + /** + * Constructs a new service method instance. * @classdesc Reflected service method. * @extends ReflectionObject * @constructor @@ -496,7 +551,7 @@ declare module "protobufjs" { */ class Method extends ReflectionObject { /** - * Constructs a new service method. + * Constructs a new service method instance. * @classdesc Reflected service method. * @extends ReflectionObject * @constructor @@ -571,7 +626,7 @@ declare module "protobufjs" { } /** - * Constructs a new namespace. + * Constructs a new namespace instance. * @classdesc Reflected namespace and base class of all reflection objects containing nested objects. * @extends ReflectionObject * @constructor @@ -580,7 +635,7 @@ declare module "protobufjs" { */ class Namespace extends ReflectionObject { /** - * Constructs a new namespace. + * Constructs a new namespace instance. * @classdesc Reflected namespace and base class of all reflection objects containing nested objects. * @extends ReflectionObject * @constructor @@ -684,7 +739,7 @@ declare module "protobufjs" { } /** - * Constructs a new reflection object. + * Constructs a new reflection object instance. * @classdesc Base class of all reflection objects. * @constructor * @param {string} name Object name @@ -736,7 +791,7 @@ declare module "protobufjs" { * Lets the specified constructor extend this class. * @memberof ReflectionObject * @param {*} constructor Extending constructor - * @returns {Object} Prototype + * @returns {Object} Constructor prototype * @this ReflectionObject */ static extend(constructor: any): Object; @@ -801,7 +856,7 @@ declare module "protobufjs" { } /** - * Constructs a new oneof. + * Constructs a new oneof instance. * @classdesc Reflected oneof. * @extends ReflectionObject * @constructor @@ -811,7 +866,7 @@ declare module "protobufjs" { */ class OneOf extends ReflectionObject { /** - * Constructs a new oneof. + * Constructs a new oneof instance. * @classdesc Reflected oneof. * @extends ReflectionObject * @constructor @@ -893,50 +948,14 @@ declare module "protobufjs" { function parse(source: string, root?: Root): ParserResult; /** - * Constructs a new prototype. - * This method should be called from your custom constructors, i.e. `Prototype.call(this, properties)`. - * @classdesc Runtime message prototype ready to be extended by custom classes or generated code. - * @constructor - * @param {Object.} [properties] Properties to set - * @abstract - * @see {@link inherits} - * @see {@link Class} - */ - abstract class Prototype { - /** - * Reference to the reflected type. - * @name Prototype#$type - * @type {Type} - * @readonly - */ - $type: Type; - - /** - * Converts a runtime message to a JSON object. - * @param {Object.} [options] Conversion options - * @param {boolean} [options.fieldsOnly=false] Converts only properties that reference a field - * @param {*} [options.long] Long conversion type. Only relevant with a long library. - * Valid values are `String` and `Number` (the global types). - * Defaults to a possibly unsafe number without, and a `Long` with a long library. - * @param {*} [options.enum=Number] Enum value conversion type. - * Valid values are `String` and `Number` (the global types). - * Defaults to the numeric ids. - * @param {boolean} [options.defaults=false] Also sets default values on the resulting object - * @returns {Object.} JSON object - */ - asJSON(options?: { [k: string]: any }): { [k: string]: any }; - - } - - /** - * Constructs a new reader using the specified buffer. + * Constructs a new reader instance using the specified buffer. * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. * @constructor * @param {Uint8Array} buffer Buffer to read from */ class Reader { /** - * Constructs a new reader using the specified buffer. + * Constructs a new reader instance using the specified buffer. * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. * @constructor * @param {Uint8Array} buffer Buffer to read from @@ -1114,7 +1133,7 @@ declare module "protobufjs" { } /** - * Constructs a new buffer reader. + * Constructs a new buffer reader instance. * @classdesc Wire format reader using node buffers. * @extends Reader * @constructor @@ -1122,7 +1141,7 @@ declare module "protobufjs" { */ class BufferReader extends Reader { /** - * Constructs a new buffer reader. + * Constructs a new buffer reader instance. * @classdesc Wire format reader using node buffers. * @extends Reader * @constructor @@ -1133,7 +1152,7 @@ declare module "protobufjs" { } /** - * Constructs a new root namespace. + * Constructs a new root namespace instance. * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. * @extends Namespace * @constructor @@ -1141,7 +1160,7 @@ declare module "protobufjs" { */ class Root extends Namespace { /** - * Constructs a new root namespace. + * Constructs a new root namespace instance. * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. * @extends Namespace * @constructor @@ -1208,12 +1227,12 @@ declare module "protobufjs" { } /** - * RPC helpers. + * Streaming RPC helpers. * @namespace */ module rpc { /** - * Constructs a new RPC service. + * Constructs a new RPC service instance. * @classdesc An RPC service as returned by {@link Service#create}. * @memberof rpc * @extends util.EventEmitter @@ -1222,7 +1241,7 @@ declare module "protobufjs" { */ class Service extends util.EventEmitter { /** - * Constructs a new RPC service. + * Constructs a new RPC service instance. * @classdesc An RPC service as returned by {@link Service#create}. * @memberof rpc * @extends util.EventEmitter @@ -1249,7 +1268,7 @@ declare module "protobufjs" { } /** - * Constructs a new service. + * Constructs a new service instance. * @classdesc Reflected service. * @extends Namespace * @constructor @@ -1259,7 +1278,7 @@ declare module "protobufjs" { */ class Service extends Namespace { /** - * Constructs a new service. + * Constructs a new service instance. * @classdesc Reflected service. * @extends Namespace * @constructor @@ -1347,7 +1366,7 @@ declare module "protobufjs" { function tokenize(source: string): TokenizerHandle; /** - * Constructs a new message type. + * Constructs a new reflected message type instance. * @classdesc Reflected message type. * @extends Namespace * @constructor @@ -1356,7 +1375,7 @@ declare module "protobufjs" { */ class Type extends Namespace { /** - * Constructs a new message type. + * Constructs a new reflected message type instance. * @classdesc Reflected message type. * @extends Namespace * @constructor @@ -1424,9 +1443,9 @@ declare module "protobufjs" { /** * The registered constructor, if any registered, otherwise a generic constructor. * @name Type#ctor - * @type {Prototype} + * @type {Class} */ - ctor: Prototype; + ctor: Class; /** * Tests if the specified JSON object describes a message type. @@ -1464,49 +1483,47 @@ declare module "protobufjs" { /** * Creates a new message of this type using the specified properties. * @param {Object|*} [properties] Properties to set - * @param {*} [ctor] Constructor to use. - * Defaults to use the internal constuctor. - * @returns {Prototype} Message instance + * @returns {Message} Runtime message */ - create(properties?: (Object|any), ctor?: any): Prototype; + create(properties?: (Object|any)): Message; /** * Encodes a message of this type. - * @param {Prototype|Object} message Message instance or plain object + * @param {Message|Object} message Message instance or plain object * @param {Writer} [writer] Writer to encode to * @returns {Writer} writer */ - encode(message: (Prototype|Object), writer?: Writer): Writer; + encode(message: (Message|Object), writer?: Writer): Writer; /** * Encodes a message of this type preceeded by its byte length as a varint. - * @param {Prototype|Object} message Message instance or plain object + * @param {Message|Object} message Message instance or plain object * @param {Writer} [writer] Writer to encode to * @returns {Writer} writer */ - encodeDelimited(message: (Prototype|Object), writer?: Writer): Writer; + encodeDelimited(message: (Message|Object), writer?: Writer): Writer; /** * Decodes a message of this type. * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from * @param {number} [length] Length of the message, if known beforehand - * @returns {Prototype} Decoded message + * @returns {Message} Decoded message */ - decode(readerOrBuffer: (Reader|Uint8Array), length?: number): Prototype; + decode(readerOrBuffer: (Reader|Uint8Array), length?: number): Message; /** * Decodes a message of this type preceeded by its byte length as a varint. * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from - * @returns {Prototype} Decoded message + * @returns {Message} Decoded message */ - decodeDelimited(readerOrBuffer: (Reader|Uint8Array)): Prototype; + decodeDelimited(readerOrBuffer: (Reader|Uint8Array)): Message; /** * Verifies that enum values are valid and that any required fields are present. - * @param {Prototype|Object} message Message to verify + * @param {Message|Object} message Message to verify * @returns {?string} `null` if valid, otherwise the reason why it is not */ - verify(message: (Prototype|Object)): string; + verify(message: (Message|Object)): string; } @@ -1563,19 +1580,19 @@ declare module "protobufjs" { /** - * Utility functions. + * Various utility functions. * @namespace */ module util { /** - * Constructs a new event emitter. + * Constructs a new event emitter instance. * @classdesc A minimal event emitter. * @memberof util * @constructor */ class EventEmitter { /** - * Constructs a new event emitter. + * Constructs a new event emitter instance. * @classdesc A minimal event emitter. * @memberof util * @constructor @@ -1923,13 +1940,13 @@ declare module "protobufjs" { } /** - * Constructs a new writer. + * Constructs a new writer instance. * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. * @constructor */ class Writer { /** - * Constructs a new writer. + * Constructs a new writer instance. * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. * @constructor */ @@ -2132,7 +2149,7 @@ declare module "protobufjs" { } /** - * Constructs a new buffer writer. + * Constructs a new buffer writer instance. * @classdesc Wire format writer using node buffers. * @exports BufferWriter * @extends Writer @@ -2140,7 +2157,7 @@ declare module "protobufjs" { */ class BufferWriter extends Writer { /** - * Constructs a new buffer writer. + * Constructs a new buffer writer instance. * @classdesc Wire format writer using node buffers. * @exports BufferWriter * @extends Writer diff --git a/types/test.ts b/types/test.ts index cfc9bf52b..e3812735f 100644 --- a/types/test.ts +++ b/types/test.ts @@ -1,4 +1,5 @@ /// +/// import * as protobuf from "protobufjs"; @@ -6,10 +7,21 @@ export const proto = {"nested":{"Hello":{"fields":{"value":{"rule":"required","t const root = protobuf.Root.fromJSON(proto); -export class Hello { - constructor (properties: any) { - protobuf.Prototype.call(this, properties); +export class Hello extends protobuf.Message { + constructor (properties?: any) { + super(properties); + } + + foo() { + this["value"] = "hi"; + return this; } } +protobuf.Class.create(root.lookup("Hello") as protobuf.Type, Hello); + +var hello = new Hello(); + +var buf = Hello.encode(hello.foo()).finish(); -protobuf.inherits(Hello, root.lookup("Hello") as protobuf.Type); +var hello2 = Hello.decode(buf) as Hello; +console.log(hello2.foo().asJSON());