/* protobuf.js (c) 2013 Daniel Wirtz Released under the Apache License, Version 2.0 see: https://github.com/dcodeIO/protobuf.js for details */ var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,p,d){if(d.get||d.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[p]=d.value)};$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_"; $jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+$jscomp.symbolCounter_++}; $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(e){var p=0;return $jscomp.iteratorPrototype(function(){return p]/g,RULE:/^(?:required|optional|repeated|map)$/, TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,FQTYPEREF:/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/, BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g};d.DotProto=function(b,d){function e(b,c){var l,a=1;"-"==b.charAt(0)&&(a=-1,b=b.substring(1));if(d.NUMBER_DEC.test(b))l=parseInt(b);else if(d.NUMBER_HEX.test(b))l=parseInt(b.substring(2),16);else if(d.NUMBER_OCT.test(b))l= parseInt(b.substring(1),8);else throw Error("illegal id value: "+(0>a?"-":"")+b);l=a*l|0;if(!c&&0>l)throw Error("illegal id value: "+(0>a?"-":"")+b);return l}function t(b){var c=1;"-"==b.charAt(0)&&(c=-1,b=b.substring(1));if(d.NUMBER_DEC.test(b))return c*parseInt(b,10);if(d.NUMBER_HEX.test(b))return c*parseInt(b.substring(2),16);if(d.NUMBER_OCT.test(b))return c*parseInt(b.substring(1),8);if("inf"===b)return Infinity*c;if("nan"===b)return NaN;if(d.NUMBER_FLT.test(b))return c*parseFloat(b);throw Error("illegal number value: "+ (0>c?"-":"")+b);}function m(b,c,d){"undefined"===typeof b[c]?b[c]=d:(Array.isArray(b[c])||(b[c]=[b[c]]),b[c].push(d))}var n={},a=function(b){this.source=b+"";this.index=0;this.line=1;this.stack=[];this._stringOpen=null},g=a.prototype;g._readString=function(){var b='"'===this._stringOpen?d.STRING_DQ:d.STRING_SQ;b.lastIndex=this.index-1;var c=b.exec(this.source);if(!c)throw Error("unterminated string");this.index=b.lastIndex;this.stack.push(this._stringOpen);this._stringOpen=null;return c[1]};g.next= function(){if(0=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var b,c;do{for(b=!1;d.WHITESPACE.test(c=this.source.charAt(this.index));)if("\n"===c&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index; ++this.line;b=!0}else if("*"===(c=this.source.charAt(this.index))){do{"\n"===c&&++this.line;if(++this.index===this.source.length)return null;b=c;c=this.source.charAt(this.index)}while("*"!==b||"/"!==c);++this.index;b=!0}else return"/"}while(b);if(this.index===this.source.length)return null;c=this.index;d.DELIM.lastIndex=0;if(!d.DELIM.test(this.source.charAt(c++)))for(;c");c=this.tn.next(); if(!d.NAME.test(c))throw Error("illegal message field name: "+c);g.name=c;this.tn.skip("=");g.id=e(this.tn.next());c=this.tn.peek();"["===c&&this._parseFieldOptions(g);this.tn.skip(";")}else if(a="undefined"!==typeof a?a:this.tn.next(),"group"===a){c=this._parseMessage(b,g);if(!/^[A-Z]/.test(c.name))throw Error("illegal group name: "+c.name);g.type=c.name;g.name=c.name.toLowerCase();this.tn.omit(";")}else{if(!d.TYPE.test(a)&&!d.TYPEREF.test(a))throw Error("illegal message field type: "+a);g.type= a;c=this.tn.next();if(!d.NAME.test(c))throw Error("illegal message field name: "+c);g.name=c;this.tn.skip("=");g.id=e(this.tn.next());c=this.tn.peek();"["===c&&this._parseFieldOptions(g);this.tn.skip(";")}b.fields.push(g);return g};g._parseMessageOneOf=function(b){var c=this.tn.next();if(!d.NAME.test(c))throw Error("illegal oneof name: "+c);var a=c,g=[];for(this.tn.skip("{");"}"!==(c=this.tn.next());)c=this._parseMessageField(b,"optional",c),c.oneof=a,g.push(c.id);this.tn.omit(";");b.oneofs[a]=g}; g._parseFieldOptions=function(b){this.tn.skip("[");for(var c=!0;"]"!==this.tn.peek();)c||this.tn.skip(","),this._parseOption(b,!0),c=!1;this.tn.next()};g._parseEnum=function(b){var c={name:"",values:[],options:{}},a=this.tn.next();if(!d.NAME.test(a))throw Error("illegal name: "+a);c.name=a;for(this.tn.skip("{");"}"!==(a=this.tn.next());)if("option"===a)this._parseOption(c);else{if(!d.NAME.test(a))throw Error("illegal name: "+a);this.tn.skip("=");var g={name:a,id:e(this.tn.next(),!0)},a=this.tn.peek(); "["===a&&this._parseFieldOptions({options:{}});this.tn.skip(";");c.values.push(g)}this.tn.omit(";");b.enums.push(c)};g._parseExtensionRanges=function(){var a=[],c,d;do{for(d=[];;){c=this.tn.next();switch(c){case "min":c=b.ID_MIN;break;case "max":c=b.ID_MAX;break;default:c=t(c)}d.push(c);if(2===d.length)break;if("to"!==this.tn.peek()){d.push(c);break}this.tn.next()}a.push(d)}while(this.tn.omit(","));this.tn.skip(";");return a};g._parseExtend=function(b){var a=this.tn.next();if(!d.TYPEREF.test(a))throw Error("illegal extend reference: "+ a);var g={ref:a,fields:[]};for(this.tn.skip("{");"}"!==(a=this.tn.next());)if(d.RULE.test(a))this._parseMessageField(g,a);else if(d.TYPEREF.test(a)){if(!this.proto3)throw Error("illegal field rule: "+a);this._parseMessageField(g,"optional",a)}else throw Error("illegal extend token: "+a);this.tn.omit(";");b.messages.push(g);return g};g.toString=function(){return"Parser at line "+this.tn.line};n.Parser=h;return n}(d,d.Lang);d.Reflect=function(b){function d(f,k){if(f&&"number"===typeof f.low&&"number"=== typeof f.high&&"boolean"===typeof f.unsigned&&f.low===f.low&&f.high===f.high)return new b.Long(f.low,f.high,"undefined"===typeof k?f.unsigned:k);if("string"===typeof f)return b.Long.fromString(f,k||!1,10);if("number"===typeof f)return b.Long.fromNumber(f,k||!1);throw Error("not convertible to Long");}function y(f,k){var a=k.readVarint32(),c=a&7,a=a>>>3;switch(c){case b.WIRE_TYPES.VARINT:do a=k.readUint8();while(128===(a&128));break;case b.WIRE_TYPES.BITS64:k.offset+=8;break;case b.WIRE_TYPES.LDELIM:a= k.readVarint32();k.offset+=a;break;case b.WIRE_TYPES.STARTGROUP:y(a,k);break;case b.WIRE_TYPES.ENDGROUP:if(a===f)return!1;throw Error("Illegal GROUPEND after unknown group: "+a+" ("+f+" expected)");case b.WIRE_TYPES.BITS32:k.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+f+": "+c);}return!0}var r={},m=function(b,k,a){this.builder=b;this.parent=k;this.name=a},n=m.prototype;n.fqn=function(){var b=this.name,k=this;do{k=k.parent;if(null==k)break;b=k.name+"."+b}while(1);return b}; n.toString=function(b){return(b?this.className+" ":"")+this.fqn()};n.build=function(){throw Error(this.toString(!0)+" cannot be built directly");};r.T=m;var a=function(b,k,a,c,d){m.call(this,b,k,a);this.className="Namespace";this.children=[];this.options=c||{};this.syntax=d||"proto2"},n=a.prototype=Object.create(m.prototype);n.getChildren=function(b){b=b||null;if(null==b)return this.children.slice();for(var f=[],a=0,c=this.children.length;ab.MAP_KEY_TYPES.indexOf(f))throw Error("Invalid map key type: "+f.name);},h=g.prototype;g.defaultFieldValue=function(f){"string"===typeof f&&(f=b.TYPES[f]);if("undefined"===typeof f.defaultValue)throw Error("default value for type "+f.name+" is not supported");return f==b.TYPES.bytes?new e(0):f.defaultValue}; h.toString=function(){return(this.name||"")+(this.isMapKey?"map":"value")+" element"};h.verifyValue=function(f){function a(b,f){throw Error("Illegal value for "+c.toString(!0)+" of type "+c.type.name+": "+b+" ("+f+")");}var c=this;switch(this.type){case b.TYPES.int32:case b.TYPES.sint32:case b.TYPES.sfixed32:return("number"!==typeof f||f===f&&0!==f%1)&&a(typeof f,"not an integer"),4294967295f?f>>>0:f;case b.TYPES.int64:case b.TYPES.sint64:case b.TYPES.sfixed64:if(b.Long)try{return d(f,!1)}catch(x){a(typeof f,x.message)}else a(typeof f,"requires Long.js");case b.TYPES.uint64:case b.TYPES.fixed64:if(b.Long)try{return d(f,!0)}catch(x){a(typeof f,x.message)}else a(typeof f,"requires Long.js");case b.TYPES.bool:return"boolean"!==typeof f&&a(typeof f,"not a boolean"),f;case b.TYPES["float"]:case b.TYPES["double"]:return"number"!==typeof f&&a(typeof f,"not a number"),f;case b.TYPES.string:return"string"=== typeof f||f&&f instanceof String||a(typeof f,"not a string"),""+f;case b.TYPES.bytes:return e.isByteBuffer(f)?f:e.wrap(f,"base64");case b.TYPES["enum"]:for(var g=this.resolvedType.getChildren(b.Reflect.Enum.Value),h=0;hf)&&a(typeof f,"not in range for uint32"),f;a(f,"not a valid enum value");case b.TYPES.group:case b.TYPES.message:f&& "object"===typeof f||a(typeof f,"object expected");if(f instanceof this.resolvedType.clazz)return f;if(f instanceof b.Builder.Message){var g={},h;for(h in f)f.hasOwnProperty(h)&&(g[h]=f[h]);f=g}return new this.resolvedType.clazz(f)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+f+" (undefined type "+this.type+")");};h.calculateLength=function(f,a){if(null===a)return 0;var c;switch(this.type){case b.TYPES.int32:return 0>a?e.calculateVarint64(a):e.calculateVarint32(a);case b.TYPES.uint32:return e.calculateVarint32(a); case b.TYPES.sint32:return e.calculateVarint32(e.zigZagEncode32(a));case b.TYPES.fixed32:case b.TYPES.sfixed32:case b.TYPES["float"]:return 4;case b.TYPES.int64:case b.TYPES.uint64:return e.calculateVarint64(a);case b.TYPES.sint64:return e.calculateVarint64(e.zigZagEncode64(a));case b.TYPES.fixed64:case b.TYPES.sfixed64:return 8;case b.TYPES.bool:return 1;case b.TYPES["enum"]:return e.calculateVarint32(a);case b.TYPES["double"]:return 8;case b.TYPES.string:return c=e.calculateUTF8Bytes(a),e.calculateVarint32(c)+ c;case b.TYPES.bytes:if(0>a.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+a.remaining()+" bytes remaining");return e.calculateVarint32(a.remaining())+a.remaining();case b.TYPES.message:return c=this.resolvedType.calculate(a),e.calculateVarint32(c)+c;case b.TYPES.group:return c=this.resolvedType.calculate(a),c+e.calculateVarint32(f<<3|b.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+a+" (unknown type)");};h.encodeValue=function(f, a,c){if(null===a)return c;switch(this.type){case b.TYPES.int32:0>a?c.writeVarint64(a):c.writeVarint32(a);break;case b.TYPES.uint32:c.writeVarint32(a);break;case b.TYPES.sint32:c.writeVarint32ZigZag(a);break;case b.TYPES.fixed32:c.writeUint32(a);break;case b.TYPES.sfixed32:c.writeInt32(a);break;case b.TYPES.int64:case b.TYPES.uint64:c.writeVarint64(a);break;case b.TYPES.sint64:c.writeVarint64ZigZag(a);break;case b.TYPES.fixed64:c.writeUint64(a);break;case b.TYPES.sfixed64:c.writeInt64(a);break;case b.TYPES.bool:"string"=== typeof a?c.writeVarint32("false"===a.toLowerCase()?0:!!a):c.writeVarint32(a?1:0);break;case b.TYPES["enum"]:c.writeVarint32(a);break;case b.TYPES["float"]:c.writeFloat32(a);break;case b.TYPES["double"]:c.writeFloat64(a);break;case b.TYPES.string:c.writeVString(a);break;case b.TYPES.bytes:if(0>a.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+a.remaining()+" bytes remaining");f=a.offset;c.writeVarint32(a.remaining());c.append(a);a.offset=f;break;case b.TYPES.message:f=(new e).LE(); this.resolvedType.encode(a,f);c.writeVarint32(f.offset);c.append(f.flip());break;case b.TYPES.group:this.resolvedType.encode(a,c);c.writeVarint32(f<<3|b.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+a+" (unknown type)");}return c};h.decode=function(a,c,d){if(c!=this.type.wireType)throw Error("Unexpected wire type for element");switch(this.type){case b.TYPES.int32:return a.readVarint32()|0;case b.TYPES.uint32:return a.readVarint32()>>> 0;case b.TYPES.sint32:return a.readVarint32ZigZag()|0;case b.TYPES.fixed32:return a.readUint32()>>>0;case b.TYPES.sfixed32:return a.readInt32()|0;case b.TYPES.int64:return a.readVarint64();case b.TYPES.uint64:return a.readVarint64().toUnsigned();case b.TYPES.sint64:return a.readVarint64ZigZag();case b.TYPES.fixed64:return a.readUint64();case b.TYPES.sfixed64:return a.readInt64();case b.TYPES.bool:return!!a.readVarint32();case b.TYPES["enum"]:return a.readVarint32();case b.TYPES["float"]:return a.readFloat(); case b.TYPES["double"]:return a.readDouble();case b.TYPES.string:return a.readVString();case b.TYPES.bytes:d=a.readVarint32();if(a.remaining()b.remaining())return null;var c=b.offset,d=b.readVarint32();if(b.remaining()>>3;if(h===b.WIRE_TYPES.ENDGROUP){if(e!==d)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+e+" ("+(d?d+" expected":"not a group")+")");break}if(k=this._fieldsById[e])k.repeated&&!k.options.packed?g[k.name].push(k.decode(h, a)):k.map?(h=k.decode(h,a),g[k.name].set(h[0],h[1])):(g[k.name]=k.decode(h,a),k.oneof&&(h=g[k.oneof.name],null!==h&&h!==k.name&&(g[h]=null),g[k.oneof.name]=k.name));else switch(h){case b.WIRE_TYPES.VARINT:a.readVarint32();break;case b.WIRE_TYPES.BITS32:a.offset+=4;break;case b.WIRE_TYPES.BITS64:a.offset+=8;break;case b.WIRE_TYPES.LDELIM:k=a.readVarint32();a.offset+=k;break;case b.WIRE_TYPES.STARTGROUP:for(;y(e,a););break;default:throw Error("Illegal wire type for unknown field "+e+" in "+this.toString(!0)+ "#decode: "+h);}}a=0;for(c=this._fields.length;a>>=3,1===c)f=this.keyElement.decode(h,a,c);else if(2===c)d=this.element.decode(h,a,c);else throw Error("Unexpected tag in map field key/value submessage"); return[f,d]}return this.element.decode(c,a,this.id)};r.Message.Field=c;h=function(a,b,d,g,h,e,l){c.call(this,a,b,d,null,g,h,e,l)};h.prototype=Object.create(c.prototype);r.Message.ExtensionField=h;r.Message.OneOf=function(a,b,c){m.call(this,a,b,c);this.fields=[]};var v=function(b,c,d,g,h){a.call(this,b,c,d,g,h);this.className="Enum";this.object=null};v.getName=function(a,b){for(var c=Object.keys(a),d=0,g;d=b[0]&&a.id<=b[1]&&(c=!0)});if(!c)throw Error("illegal extended field id in "+l.name+": "+a.id+" (not within valid ranges)");}var d=a.name;this.options.convertFieldsToCamelCase&&(d=b.Util.toCamelCase(d));var d=new e.Message.ExtensionField(this,l,a.rule,a.type,this.ptr.fqn()+"."+d,a.id,a.options),g=new e.Extension(this,this.ptr,a.name,d);d.extension=g;this.ptr.addChild(g);l.addChild(d)},this);else{if(!/\.?google\.protobuf\./.test(h.ref))throw Error("extended message "+ h.ref+" is not defined");}else throw Error("not a valid definition: "+JSON.stringify(h));l=h=null}a=null;this.ptr=this.ptr.parent}this.resolved=!1;this.result=null;return this};n["import"]=function(a,d){var g="/";if("string"===typeof d){b.Util.IS_NODE&&(d=require("path").resolve(d));if(!0===this.files[d])return this.reset();this.files[d]=!0}else if("object"===typeof d){var e=d.root;b.Util.IS_NODE&&(e=require("path").resolve(e));if(0<=e.indexOf("\\")||0<=d.file.indexOf("\\"))g="\\";e=b.Util.IS_NODE? require("path").join(e,d.file):e+g+d.file;if(!0===this.files[e])return this.reset();this.files[e]=!0}if(a.imports&&0