"use strict";var protobuf=require("../.."),debug=protobuf.debug=module.exports={},codegen=protobuf.util.codegen,debugFnRe=/function ([^(]+)\(([^)]*)\) {/g;function codegen_debug(){codegen_debug.supported=codegen.supported,codegen_debug.verbose=codegen.verbose;var e,o=codegen.apply(null,Array.prototype.slice.call(arguments));return e=o.str,o.str=function(){return e.apply(null,Array.prototype.slice.call(arguments)).replace(debugFnRe,"function $1($2) {\n	$1.calls=($1.calls|0)+1")},o}debug.unusedTypes=function e(o){if(!(o instanceof protobuf.Namespace))throw TypeError("ns must be a Namespace");if(!o.nested)return[];for(var n=[],t=Object.keys(o.nested),r=0;r<t.length;++r){var u=o.nested[t[r]];u instanceof protobuf.Type?(0|u.encode.calls)+(0|u.decode.calls)+(0|u.verify.calls)+(0|u.toObject.calls)+(0|u.fromObject.calls)||n.push(u):u instanceof protobuf.Namespace&&Array.prototype.push.apply(n,e(u))}return n},debug.enable=function(){protobuf.util.codegen=codegen_debug},debug.disable=function(){protobuf.util.codegen=codegen};