dd-trace 6.13.0 → 6.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-3rdparty.csv +3 -1
- package/ci/init.js +8 -3
- package/ci/test-optimization-validation/ci-package-scripts.js +2 -2
- package/ci/test-optimization-validation/ci-remediation.js +6 -6
- package/ci/test-optimization-validation/command-blocker.js +7 -5
- package/ci/test-optimization-validation/framework-adapters/cucumber.js +1 -1
- package/ci/test-optimization-validation/framework-adapters/vitest.js +3 -3
- package/ci/test-optimization-validation/package-check.js +1 -1
- package/ci/test-optimization-validation/report-writer.js +7 -5
- package/ci/vitest-no-worker-init-runner-setup.mjs +8 -0
- package/ci/vitest-no-worker-init-setup.mjs +13 -13
- package/ci/vitest-no-worker-init-v5-setup.mjs +4 -0
- package/package.json +13 -10
- package/packages/datadog-esbuild/index.js +3 -1
- package/packages/datadog-instrumentations/src/cypress-config.js +19 -17
- package/packages/datadog-instrumentations/src/fs.js +24 -20
- package/packages/datadog-instrumentations/src/google-cloud-vertexai.js +2 -2
- package/packages/datadog-instrumentations/src/graphql.js +16 -16
- package/packages/datadog-instrumentations/src/helpers/graphql-jit-runtime.js +504 -0
- package/packages/datadog-instrumentations/src/helpers/hooks.js +2 -0
- package/packages/datadog-instrumentations/src/helpers/pool-acquire.js +265 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/compiler.js +1 -2
- package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +95 -30
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/ai.js +0 -25
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/graphql-jit.js +83 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/graphql.js +85 -1
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +1 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/mercurius.js +30 -12
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/playwright.js +13 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/webdriverio.js +251 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/targets.json +11 -1
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +562 -27
- package/packages/datadog-instrumentations/src/jest.js +25 -20
- package/packages/datadog-instrumentations/src/knex.js +76 -0
- package/packages/datadog-instrumentations/src/mariadb.js +6 -0
- package/packages/datadog-instrumentations/src/mocha/common.js +59 -2
- package/packages/datadog-instrumentations/src/mocha/main.js +25 -15
- package/packages/datadog-instrumentations/src/mocha/utils.js +2 -1
- package/packages/datadog-instrumentations/src/mocha/webdriverio-protocol.js +98 -0
- package/packages/datadog-instrumentations/src/mocha/worker.js +12 -8
- package/packages/datadog-instrumentations/src/net.js +14 -17
- package/packages/datadog-instrumentations/src/next.js +212 -62
- package/packages/datadog-instrumentations/src/openai.js +42 -40
- package/packages/datadog-instrumentations/src/pg.js +15 -0
- package/packages/datadog-instrumentations/src/playwright.js +109 -13
- package/packages/datadog-instrumentations/src/rum-browser-scripts.js +40 -0
- package/packages/datadog-instrumentations/src/sequelize.js +94 -2
- package/packages/datadog-instrumentations/src/undici.js +53 -4
- package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +37 -3
- package/packages/datadog-instrumentations/src/vitest-main.js +92 -9
- package/packages/datadog-instrumentations/src/vitest-worker.js +71 -14
- package/packages/datadog-instrumentations/src/webdriverio.js +965 -6
- package/packages/datadog-plugin-amqp10/src/consumer.js +3 -1
- package/packages/datadog-plugin-amqp10/src/producer.js +3 -1
- package/packages/datadog-plugin-amqp10/src/util.js +2 -1
- package/packages/datadog-plugin-avsc/src/schema_iterator.js +6 -1
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/utils.js +16 -5
- package/packages/datadog-plugin-cassandra-driver/src/index.js +8 -3
- package/packages/datadog-plugin-cucumber/src/index.js +0 -2
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +262 -48
- package/packages/datadog-plugin-google-cloud-pubsub/src/client.js +4 -1
- package/packages/datadog-plugin-graphql/src/execute.js +998 -196
- package/packages/datadog-plugin-graphql/src/index.js +27 -7
- package/packages/datadog-plugin-graphql/src/jit.js +136 -0
- package/packages/datadog-plugin-graphql/src/request.js +18 -27
- package/packages/datadog-plugin-graphql/src/resolve-error.js +108 -0
- package/packages/datadog-plugin-graphql/src/tools/signature.js +1 -2
- package/packages/datadog-plugin-graphql/src/tools/transforms.js +45 -3
- package/packages/datadog-plugin-graphql/src/utils.js +208 -120
- package/packages/datadog-plugin-graphql/src/validate.js +10 -23
- package/packages/datadog-plugin-jest/src/index.js +0 -6
- package/packages/datadog-plugin-langchain/src/tracing.js +7 -0
- package/packages/datadog-plugin-mocha/src/index.js +403 -75
- package/packages/datadog-plugin-mongodb-core/src/query.js +6 -0
- package/packages/datadog-plugin-mysql/src/index.js +41 -15
- package/packages/datadog-plugin-net/src/tcp.js +3 -1
- package/packages/datadog-plugin-next/src/index.js +63 -29
- package/packages/datadog-plugin-playwright/src/index.js +167 -27
- package/packages/datadog-plugin-undici/src/index.js +27 -41
- package/packages/datadog-plugin-vitest/src/index.js +6 -12
- package/packages/dd-trace/src/aiguard/evaluation.js +2 -1
- package/packages/dd-trace/src/aiguard/messages/anthropic.js +8 -1
- package/packages/dd-trace/src/aiguard/messages/openai.js +8 -1
- package/packages/dd-trace/src/aiguard/messages/vercel-ai.js +20 -6
- package/packages/dd-trace/src/appsec/api_security/index.js +23 -6
- package/packages/dd-trace/src/appsec/api_security/sampler.js +99 -40
- package/packages/dd-trace/src/appsec/graphql.js +6 -2
- package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +3 -3
- package/packages/dd-trace/src/appsec/iast/taint-tracking/taint-tracking-impl.js +2 -1
- package/packages/dd-trace/src/appsec/iast/telemetry/span-tags.js +8 -2
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/sql-sensitive-analyzer.js +11 -36
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/url-sensitive-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/lambda.js +44 -26
- package/packages/dd-trace/src/ci-visibility/encode/json-encoder.js +32 -2
- package/packages/dd-trace/src/ci-visibility/exporters/agent-proxy/index.js +8 -8
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +6 -4
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/di-logs-writer.js +20 -4
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/request-tracker.js +5 -173
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +7 -6
- package/packages/dd-trace/src/ci-visibility/exporters/agents.js +54 -0
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/writer.js +1 -2
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +394 -225
- package/packages/dd-trace/src/ci-visibility/exporters/limits.js +9 -0
- package/packages/dd-trace/src/ci-visibility/exporters/request.js +323 -31
- package/packages/dd-trace/src/ci-visibility/exporters/settings-cache-key.js +42 -0
- package/packages/dd-trace/src/ci-visibility/final-flush.js +2 -1
- package/packages/dd-trace/src/ci-visibility/requests/fs-cache.js +57 -18
- package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +0 -3
- package/packages/dd-trace/src/ci-visibility/requests/upload-test-screenshot.js +164 -71
- package/packages/dd-trace/src/ci-visibility/requests/video-request.js +176 -0
- package/packages/dd-trace/src/ci-visibility/telemetry.js +10 -7
- package/packages/dd-trace/src/ci-visibility/test-video.js +61 -0
- package/packages/dd-trace/src/config/generated-config-types.d.ts +4 -0
- package/packages/dd-trace/src/config/index.js +73 -13
- package/packages/dd-trace/src/config/parsers.js +11 -1
- package/packages/dd-trace/src/config/stable.js +3 -3
- package/packages/dd-trace/src/config/supported-configurations.json +20 -2
- package/packages/dd-trace/src/crashtracking/crashtracker.js +82 -18
- package/packages/dd-trace/src/debugger/config.js +12 -1
- package/packages/dd-trace/src/debugger/constants.js +1 -0
- package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +2 -1
- package/packages/dd-trace/src/debugger/devtools_client/request-options.js +33 -0
- package/packages/dd-trace/src/debugger/devtools_client/send.js +7 -40
- package/packages/dd-trace/src/debugger/devtools_client/status.js +11 -6
- package/packages/dd-trace/src/debugger/devtools_client/tags.js +41 -0
- package/packages/dd-trace/src/debugger/index.js +23 -3
- package/packages/dd-trace/src/dogstatsd.js +510 -76
- package/packages/dd-trace/src/encode/0.4-cross-payload.js +170 -0
- package/packages/dd-trace/src/encode/0.4.js +5 -5
- package/packages/dd-trace/src/encode/agentless-ci-visibility.js +9 -8
- package/packages/dd-trace/src/evp_proxy/direct.js +27 -23
- package/packages/dd-trace/src/exporters/agent/index.js +2 -1
- package/packages/dd-trace/src/exporters/agent/writer.js +24 -7
- package/packages/dd-trace/src/exporters/agentless/index.js +7 -9
- package/packages/dd-trace/src/exporters/agentless/writer.js +100 -118
- package/packages/dd-trace/src/exporters/common/agents.js +28 -6
- package/packages/dd-trace/src/exporters/common/buffering-exporter.js +2 -2
- package/packages/dd-trace/src/exporters/common/final-flush-request-tracker.js +191 -0
- package/packages/dd-trace/src/exporters/common/request.js +31 -11
- package/packages/dd-trace/src/exporters/common/url.js +40 -1
- package/packages/dd-trace/src/exporters/common/writer.js +9 -7
- package/packages/dd-trace/src/flush.js +6 -3
- package/packages/dd-trace/src/id.js +14 -0
- package/packages/dd-trace/src/index.js +5 -2
- package/packages/dd-trace/src/llmobs/experiments/dataset.js +2 -1
- package/packages/dd-trace/src/llmobs/index.js +32 -32
- package/packages/dd-trace/src/llmobs/plugins/ai/ddTelemetry.js +22 -71
- package/packages/dd-trace/src/llmobs/plugins/ai/vercelTelemetry.js +23 -13
- package/packages/dd-trace/src/llmobs/plugins/langchain/index.js +7 -0
- package/packages/dd-trace/src/llmobs/util.js +0 -33
- package/packages/dd-trace/src/llmobs/writers/base.js +49 -32
- package/packages/dd-trace/src/log/index.js +7 -1
- package/packages/dd-trace/src/{ci-visibility/log-submission → log-submission}/log-submission-plugin.js +48 -19
- package/packages/dd-trace/src/openfeature/writers/base.js +14 -12
- package/packages/dd-trace/src/openfeature/writers/util.js +1 -1
- package/packages/dd-trace/src/opentelemetry/logs/index.js +5 -24
- package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +14 -4
- package/packages/dd-trace/src/opentelemetry/metrics/index.js +15 -22
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_http_metric_exporter.js +14 -4
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_exporter.js +10 -0
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +19 -4
- package/packages/dd-trace/src/opentelemetry/resource-attributes.js +55 -0
- package/packages/dd-trace/src/opentelemetry/trace/index.js +6 -1
- package/packages/dd-trace/src/opentelemetry/trace/otlp_http_trace_exporter.js +10 -0
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +93 -18
- package/packages/dd-trace/src/payload-tagging/index.js +2 -1
- package/packages/dd-trace/src/plugins/ci_plugin.js +1 -6
- package/packages/dd-trace/src/plugins/tracing.js +12 -10
- package/packages/dd-trace/src/plugins/util/ci.js +3 -1
- package/packages/dd-trace/src/plugins/util/inferred_proxy.js +16 -15
- package/packages/dd-trace/src/plugins/util/test.js +83 -20
- package/packages/dd-trace/src/plugins/util/url.js +2 -2
- package/packages/dd-trace/src/plugins/util/web.js +4 -9
- package/packages/dd-trace/src/profiling/config.js +1 -0
- package/packages/dd-trace/src/profiling/oom.js +7 -2
- package/packages/dd-trace/src/profiling/profiler.js +23 -13
- package/packages/dd-trace/src/profiling/profilers/space.js +38 -11
- package/packages/dd-trace/src/profiling/webspan-utils.js +7 -4
- package/packages/dd-trace/src/proxy.js +75 -5
- package/packages/dd-trace/src/remote_config/index.js +319 -101
- package/packages/dd-trace/src/remote_config/scheduler.js +37 -12
- package/packages/dd-trace/src/runtime_metrics/client.js +37 -8
- package/packages/dd-trace/src/runtime_metrics/otlp_runtime_metrics.js +5 -1
- package/packages/dd-trace/src/runtime_metrics/runtime_metrics.js +5 -1
- package/packages/dd-trace/src/sampling_rule.js +36 -9
- package/packages/dd-trace/src/serverless/telemetry-delivery-tracker.js +4 -8
- package/packages/dd-trace/src/serverless/vercel.js +53 -20
- package/packages/dd-trace/src/serverless.js +10 -3
- package/packages/dd-trace/src/service-naming/schemas/util.js +1 -1
- package/packages/dd-trace/src/span_stats.js +24 -28
- package/packages/dd-trace/src/startup-log.js +3 -2
- package/packages/dd-trace/src/telemetry/agentless-url.js +28 -0
- package/packages/dd-trace/src/telemetry/send-data.js +18 -16
- package/packages/dd-trace/src/telemetry/session-propagation.js +3 -2
- package/packages/dd-trace/src/tracer.js +4 -5
- package/packages/dd-trace/src/tracer_metadata.js +11 -3
- package/vendor/dist/@datadog/sketches-js/index.js +1 -1
- package/vendor/dist/protobufjs/index.js +1 -1
- package/vendor/dist/protobufjs/minimal/index.js +1 -1
- package/packages/datadog-instrumentations/src/playwright-browser-scripts.js +0 -27
- package/packages/dd-trace/src/encode/agentless-json.js +0 -210
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var t={"./long/umd/index.js"(t,r){!function(i,e){function preferDefault(t){return t.default||t}"function"==typeof define&&define.amd?define([],function(){var t={};return e(t),preferDefault(t)}):(e(r),t.exports=preferDefault(r))}("u">typeof globalThis?globalThis:"u">typeof self&&self,function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Long(t,r,i){this.low=0|t,this.high=0|r,this.unsigned=!!i}function isLong(t){return!0===(t&&t.__isLong__)}function ctz32(t){var r=Math.clz32(t&-t);return t?31-r:r}Long.prototype.__isLong__,Object.defineProperty(Long.prototype,"__isLong__",{value:!0}),Long.isLong=isLong;var i={},e={};function fromInt(t,r){var o,s,n;if(r)return(t>>>=0,(n=0<=t&&t<256)&&(s=e[t]))?s:(o=fromBits(t,0,!0),n&&(e[t]=o),o);return(t|=0,(n=-128<=t&&t<128)&&(s=i[t]))?s:(o=fromBits(t,t<0?-1:0,!1),n&&(i[t]=o),o)}function fromNumber(t,r){if(isNaN(t))return r?a:f;if(r){if(t<0)return a;if(t>=n)return d}else{if(t<=-u)return v;if(t+1>=u)return g}return t<0?fromNumber(-t,r).neg():fromBits(t%s|0,t/s|0,r)}function fromBits(t,r,i){return new Long(t,r,i)}Long.fromInt=fromInt,Long.fromNumber=fromNumber,Long.fromBits=fromBits;var o=Math.pow;function fromString(t,r,i){if(0===t.length)throw Error("empty string");if("number"==typeof r?(i=r,r=!1):r=!!r,"NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return r?a:f;if((i=i||10)<2||36<i)throw RangeError("radix");if((e=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===e)return fromString(t.substring(1),r,i).neg();for(var e,s=fromNumber(o(i,8)),n=f,u=0;u<t.length;u+=8){var h=Math.min(8,t.length-u),l=parseInt(t.substring(u,u+h),i);if(h<8){var p=fromNumber(o(i,h));n=n.mul(p).add(fromNumber(l))}else n=(n=n.mul(s)).add(fromNumber(l))}return n.unsigned=r,n}function fromValue(t,r){return"number"==typeof t?fromNumber(t,r):"string"==typeof t?fromString(t,r):fromBits(t.low,t.high,"boolean"==typeof r?r:t.unsigned)}Long.fromString=fromString,Long.fromValue=fromValue;var s=0x100000000,n=0xffffffffffffffff,u=0x8000000000000000,h=fromInt(0x1000000),f=fromInt(0);Long.ZERO=f;var a=fromInt(0,!0);Long.UZERO=a;var l=fromInt(1);Long.ONE=l;var p=fromInt(1,!0);Long.UONE=p;var c=fromInt(-1);Long.NEG_ONE=c;var g=fromBits(-1,0x7fffffff,!1);Long.MAX_VALUE=g;var d=fromBits(-1,-1,!0);Long.MAX_UNSIGNED_VALUE=d;var v=fromBits(0,-0x80000000,!1);Long.MIN_VALUE=v;var b=Long.prototype;b.toInt=function(){return this.unsigned?this.low>>>0:this.low},b.toNumber=function(){return this.unsigned?(this.high>>>0)*s+(this.low>>>0):this.high*s+(this.low>>>0)},b.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(!this.eq(v))return"-"+this.neg().toString(t);else{var r=fromNumber(t),i=this.div(r),e=i.mul(r).sub(this);return i.toString(t)+e.toInt().toString(t)}for(var s=fromNumber(o(t,6),this.unsigned),n=this,u="";;){var h=n.div(s),f=(n.sub(h.mul(s)).toInt()>>>0).toString(t);if((n=h).isZero())return f+u;for(;f.length<6;)f="0"+f;u=""+f+u}},b.getHighBits=function(){return this.high},b.getHighBitsUnsigned=function(){return this.high>>>0},b.getLowBits=function(){return this.low},b.getLowBitsUnsigned=function(){return this.low>>>0},b.getNumBitsAbs=function(){if(this.isNegative())return this.eq(v)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,r=31;r>0&&(t&1<<r)==0;r--);return 0!=this.high?r+33:r+1},b.isSafeInteger=function(){var t=this.high>>21;return!t||!this.unsigned&&-1===t&&(0!==this.low||-2097152!==this.high)},b.isZero=function(){return 0===this.high&&0===this.low},b.eqz=b.isZero,b.isNegative=function(){return!this.unsigned&&this.high<0},b.isPositive=function(){return this.unsigned||this.high>=0},b.isOdd=function(){return(1&this.low)==1},b.isEven=function(){return(1&this.low)==0},b.equals=function(t){return isLong(t)||(t=fromValue(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},b.eq=b.equals,b.notEquals=function(t){return!this.eq(t)},b.neq=b.notEquals,b.ne=b.notEquals,b.lessThan=function(t){return 0>this.comp(t)},b.lt=b.lessThan,b.lessThanOrEqual=function(t){return 0>=this.comp(t)},b.lte=b.lessThanOrEqual,b.le=b.lessThanOrEqual,b.greaterThan=function(t){return this.comp(t)>0},b.gt=b.greaterThan,b.greaterThanOrEqual=function(t){return this.comp(t)>=0},b.gte=b.greaterThanOrEqual,b.ge=b.greaterThanOrEqual,b.compare=function(t){if(isLong(t)||(t=fromValue(t)),this.eq(t))return 0;var r=this.isNegative(),i=t.isNegative();return r&&!i?-1:!r&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},b.comp=b.compare,b.negate=function(){return!this.unsigned&&this.eq(v)?v:this.not().add(l)},b.neg=b.negate,b.add=function(t){isLong(t)||(t=fromValue(t));var r,i,e=this.high>>>16,o=65535&this.high,s=this.low>>>16,n=65535&this.low,u=t.high>>>16,h=65535&t.high,f=t.low>>>16,a=65535&t.low,l=0,p=0;return r=0+((i=0+(n+a))>>>16),i&=65535,r+=s+f,p+=r>>>16,r&=65535,p+=o+h,l+=p>>>16,p&=65535,l+=e+u,fromBits(r<<16|i,(l&=65535)<<16|p,this.unsigned)},b.subtract=function(t){return isLong(t)||(t=fromValue(t)),this.add(t.neg())},b.sub=b.subtract,b.multiply=function(t){if(this.isZero())return this;if(isLong(t)||(t=fromValue(t)),r)return fromBits(r.mul(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned);if(t.isZero())return this.unsigned?a:f;if(this.eq(v))return t.isOdd()?v:f;if(t.eq(v))return this.isOdd()?v:f;if(this.isNegative())if(t.isNegative())return this.neg().mul(t.neg());else return this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(h)&&t.lt(h))return fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var i,e,o=this.high>>>16,s=65535&this.high,n=this.low>>>16,u=65535&this.low,l=t.high>>>16,p=65535&t.high,c=t.low>>>16,g=65535&t.low,d=0,b=0;return i=0+((e=0+u*g)>>>16),e&=65535,i+=n*g,b+=i>>>16,i&=65535,i+=u*c,b+=i>>>16,i&=65535,b+=s*g,d+=b>>>16,b&=65535,b+=n*c,d+=b>>>16,b&=65535,b+=u*p,d+=b>>>16,b&=65535,d+=o*g+s*c+n*p+u*l,fromBits(i<<16|e,(d&=65535)<<16|b,this.unsigned)},b.mul=b.multiply,b.divide=function(t){if(isLong(t)||(t=fromValue(t)),t.isZero())throw Error("division by zero");if(r){var i,e,s;return this.unsigned||-0x80000000!==this.high||-1!==t.low||-1!==t.high?fromBits((this.unsigned?r.div_u:r.div_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this}if(this.isZero())return this.unsigned?a:f;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return a;if(t.gt(this.shru(1)))return p;s=a}else{if(this.eq(v))if(t.eq(l)||t.eq(c))return v;else return t.eq(v)?l:(i=this.shr(1).div(t).shl(1)).eq(f)?t.isNegative()?l:c:(e=this.sub(t.mul(i)),s=i.add(e.div(t)));if(t.eq(v))return this.unsigned?a:f;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();s=f}for(e=this;e.gte(t);){for(var n=Math.ceil(Math.log(i=Math.max(1,Math.floor(e.toNumber()/t.toNumber())))/Math.LN2),u=n<=48?1:o(2,n-48),h=fromNumber(i),g=h.mul(t);g.isNegative()||g.gt(e);)i-=u,g=(h=fromNumber(i,this.unsigned)).mul(t);h.isZero()&&(h=l),s=s.add(h),e=e.sub(g)}return s},b.div=b.divide,b.modulo=function(t){return(isLong(t)||(t=fromValue(t)),r)?fromBits((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},b.mod=b.modulo,b.rem=b.modulo,b.not=function(){return fromBits(~this.low,~this.high,this.unsigned)},b.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},b.clz=b.countLeadingZeros,b.countTrailingZeros=function(){return this.low?ctz32(this.low):ctz32(this.high)+32},b.ctz=b.countTrailingZeros,b.and=function(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low&t.low,this.high&t.high,this.unsigned)},b.or=function(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low|t.low,this.high|t.high,this.unsigned)},b.xor=function(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low^t.low,this.high^t.high,this.unsigned)},b.shiftLeft=function(t){return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:t<32?fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):fromBits(0,this.low<<t-32,this.unsigned)},b.shl=b.shiftLeft,b.shiftRight=function(t){return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:t<32?fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},b.shr=b.shiftRight,b.shiftRightUnsigned=function(t){return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:t<32?fromBits(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):32===t?fromBits(this.high,0,this.unsigned):fromBits(this.high>>>t-32,0,this.unsigned)},b.shru=b.shiftRightUnsigned,b.shr_u=b.shiftRightUnsigned,b.rotateLeft=function(t){var r;return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:32===t?fromBits(this.high,this.low,this.unsigned):t<32?(r=32-t,fromBits(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,fromBits(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))},b.rotl=b.rotateLeft,b.rotateRight=function(t){var r;return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:32===t?fromBits(this.high,this.low,this.unsigned):t<32?(r=32-t,fromBits(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,fromBits(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))},b.rotr=b.rotateRight,b.toSigned=function(){return this.unsigned?fromBits(this.low,this.high,!1):this},b.toUnsigned=function(){return this.unsigned?this:fromBits(this.low,this.high,!0)},b.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},b.toBytesLE=function(){var t=this.high,r=this.low;return[255&r,r>>>8&255,r>>>16&255,r>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},b.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,r>>>24,r>>>16&255,r>>>8&255,255&r]},Long.fromBytes=function(t,r,i){return i?Long.fromBytesLE(t,r):Long.fromBytesBE(t,r)},Long.fromBytesLE=function(t,r){return new Long(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)},Long.fromBytesBE=function(t,r){return new Long(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)},"function"==typeof BigInt&&(Long.fromBigInt=function(t,r){return fromBits(Number(BigInt.asIntN(32,t)),Number(BigInt.asIntN(32,t>>BigInt(32))),r)},Long.fromValue=function(t,r){return"bigint"==typeof t?Long.fromBigInt(t,r):fromValue(t,r)},b.toBigInt=function(){var t=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|t}),t.default=Long})},"./protobufjs/minimal.js"(t,r,i){"use strict";t.exports=i("./protobufjs/src/index-minimal.js")},"./protobufjs/src/index-minimal.js"(t,r,i){"use strict";function configure(){r.util.LongBits._configure(r.util.Long),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=i("./protobufjs/src/writer.js"),r.BufferWriter=i("./protobufjs/src/writer_buffer.js"),r.Reader=i("./protobufjs/src/reader.js"),r.BufferReader=i("./protobufjs/src/reader_buffer.js"),r.util=i("./protobufjs/src/util/minimal.js"),r.rpc=i("./protobufjs/src/rpc.js"),r.roots=i("./protobufjs/src/roots.js"),r.configure=configure,configure()},"./protobufjs/src/reader.js"(t,r,i){"use strict";t.exports=Reader;var e,o=i("./protobufjs/src/util/minimal.js"),s=o.LongBits,n=o.utf8;function indexOutOfRange(t,r){return RangeError("index out of range: "+t.pos+" + "+(r||1)+" > "+t.len)}function Reader(t){this.buf=t,this.pos=0,this.len=t.length,this.view=null,this.discardUnknown=Reader.discardUnknown}function create_array(t){if(Array.isArray(t)&&(t=new Uint8Array(t)),t instanceof Uint8Array)return new Reader(t);throw Error("illegal buffer")}var create=function(){return o.Buffer?function(t){return(Reader.create=function(t){return o.Buffer.isBuffer(t)?new e(t):create_array(t)})(t)}:create_array};function readLongVarint(){var t=new s(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*r)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;r=0}else{for(;r<4&&!(this.pos>=this.len);++r)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*r)>>>0,this.buf[this.pos++]<128)return t;throw indexOutOfRange(this)}if(this.len-this.pos>4){for(;r<5;++r)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*r+3)>>>0,this.buf[this.pos++]<128)return t}else for(;r<5;++r){if(this.pos>=this.len)throw indexOutOfRange(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*r+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function readFixed32_end(t,r){return(t[r-4]|t[r-3]<<8|t[r-2]<<16|t[r-1]<<24)>>>0}function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new s(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}function getLazyView(t,r,i){var e=t.view;if(e||r<i)return e;var o=t.buf;return t.view=new DataView(o.buffer,o.byteOffset,o.byteLength)}Reader.create=create(),Reader.prototype.raw=function(t,r){return this.buf.subarray(t,r)},Reader.prototype.uint32=function(){var t=this.buf,r=this.pos,i=(127&t[r])>>>0;if(t[r++]<128||(i=(i|(127&t[r])<<7)>>>0,t[r++]<128)||(i=(i|(127&t[r])<<14)>>>0,t[r++]<128)||(i=(i|(127&t[r])<<21)>>>0,t[r++]<128)||(i=(i|(15&t[r])<<28)>>>0,t[r++]<128))return this.pos=r,i;for(var e=0;e<5;++e){if(r>=this.len)throw this.pos=r,indexOutOfRange(this);if(t[r++]<128)return this.pos=r,i}throw this.pos=r,Error("invalid varint encoding")},Reader.prototype.tag=function(){var t=this.buf,r=this.pos,i=(127&t[r])>>>0;if(t[r++]<128||(i=(i|(127&t[r])<<7)>>>0,t[r++]<128)||(i=(i|(127&t[r])<<14)>>>0,t[r++]<128)||(i=(i|(127&t[r])<<21)>>>0,t[r++]<128))return this.pos=r,i;if(i=(i|(15&t[r])<<28)>>>0,t[r]<128&&(112&t[r])==0)return this.pos=r+1,i;throw this.pos=r+1,Error("invalid tag encoding")},Reader.prototype.int32=function(){return 0|this.uint32()},Reader.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)},Reader.prototype.bool=function(){for(var t,r=!1,i=0;i<10;++i){if(this.pos>=this.len)throw indexOutOfRange(this);if(127&(t=this.buf[this.pos++])&&(r=!0),t<128)return r}throw Error("invalid varint encoding")},Reader.prototype.fixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.sfixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return 0|readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.float=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var t=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},Reader.prototype.double=function(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var t=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},Reader.prototype.uint32s=function(t){void 0===t&&(t=[]);for(var r,i=this.uint32()+this.pos,e=this.buf,o=this.pos;o<i;)(r=e[o++])<128?t.push(r):(this.pos=o-1,t.push(this.uint32()),o=this.pos);return this.pos=o,t},Reader.prototype.int32s=function(t){void 0===t&&(t=[]);for(var r,i=this.uint32()+this.pos,e=this.buf,o=this.pos;o<i;)(r=e[o++])<128?t.push(r):(this.pos=o-1,t.push(this.int32()),o=this.pos);return this.pos=o,t},Reader.prototype.sint32s=function(t){void 0===t&&(t=[]);for(var r=this.uint32()+this.pos;this.pos<r;)t.push(this.sint32());return t},Reader.prototype.bools=function(t){void 0===t&&(t=[]);for(var r,i=this.uint32()+this.pos,e=this.buf,o=this.pos;o<i;)(r=e[o++])<128?t.push(0!==r):(this.pos=o-1,t.push(this.bool()),o=this.pos);return this.pos=o,t},Reader.prototype.fixed32s=function(t){void 0===t&&(t=[]);var r=this.uint32(),i=this.pos+r;if(i>this.len)throw indexOutOfRange(this,r);var e=r>>>2,o=t.length,s=this.pos;t.length=o+e;var n=getLazyView(this,e,128);if(n)for(var u=0;u<e;++u,s+=4)t[o++]=n.getUint32(s,!0);else for(var h=this.buf,f=0;f<e;++f,s+=4)t[o++]=readFixed32_end(h,s+4);if(this.pos=s,s!==i)throw indexOutOfRange(this,4);return t},Reader.prototype.sfixed32s=function(t){void 0===t&&(t=[]);var r=this.uint32(),i=this.pos+r;if(i>this.len)throw indexOutOfRange(this,r);var e=r>>>2,o=t.length,s=this.pos;t.length=o+e;var n=getLazyView(this,e,128);if(n)for(var u=0;u<e;++u,s+=4)t[o++]=n.getInt32(s,!0);else for(var h=this.buf,f=0;f<e;++f,s+=4)t[o++]=0|readFixed32_end(h,s+4);if(this.pos=s,s!==i)throw indexOutOfRange(this,4);return t},Reader.prototype.floats=function(t){void 0===t&&(t=[]);var r=this.uint32(),i=this.pos+r;if(i>this.len)throw indexOutOfRange(this,r);var e=r>>>2,s=t.length,n=this.pos;t.length=s+e;var u=getLazyView(this,e,8);if(u)for(var h=0;h<e;++h,n+=4)t[s++]=u.getFloat32(n,!0);else for(var f=this.buf,a=0;a<e;++a,n+=4)t[s++]=o.float.readFloatLE(f,n);if(this.pos=n,n!==i)throw indexOutOfRange(this,4);return t},Reader.prototype.doubles=function(t){void 0===t&&(t=[]);var r=this.uint32(),i=this.pos+r;if(i>this.len)throw indexOutOfRange(this,r);var e=r>>>3,s=t.length,n=this.pos;t.length=s+e;var u=getLazyView(this,e,8);if(u)for(var h=0;h<e;++h,n+=8)t[s++]=u.getFloat64(n,!0);else for(var f=this.buf,a=0;a<e;++a,n+=8)t[s++]=o.float.readDoubleLE(f,n);if(this.pos=n,n!==i)throw indexOutOfRange(this,8);return t},Reader.prototype.uint64s=function(t){void 0===t&&(t=[]);for(var r=this.uint32()+this.pos;this.pos<r;)t.push(this.uint64());return t},Reader.prototype.int64s=function(t){void 0===t&&(t=[]);for(var r=this.uint32()+this.pos;this.pos<r;)t.push(this.int64());return t},Reader.prototype.sint64s=function(t){void 0===t&&(t=[]);for(var r=this.uint32()+this.pos;this.pos<r;)t.push(this.sint64());return t},Reader.prototype.fixed64s=function(t){void 0===t&&(t=[]);var r=this.uint32(),i=this.pos+r,e=t.length;if(i>this.len)throw indexOutOfRange(this,r);var o=r>>>3;t.length=e+o;for(var s=0;s<o;++s)t[e++]=this.fixed64();if(this.pos!==i)throw indexOutOfRange(this,8);return t},Reader.prototype.sfixed64s=function(t){void 0===t&&(t=[]);var r=this.uint32(),i=this.pos+r,e=t.length;if(i>this.len)throw indexOutOfRange(this,r);var o=r>>>3;t.length=e+o;for(var s=0;s<o;++s)t[e++]=this.sfixed64();if(this.pos!==i)throw indexOutOfRange(this,8);return t},Reader.prototype.bytes=function(){var t=this.uint32(),r=this.pos,i=this.pos+t;if(i>this.len)throw indexOutOfRange(this,t);return this.pos=i,this.raw(r,i)},Reader.prototype.string=function(){var t=this.uint32(),r=this.pos,i=this.pos+t;if(i>this.len)throw indexOutOfRange(this,t);return this.pos=i,n.read(this.buf,r,i)},Reader.prototype.stringVerify=function(){var t=this.uint32(),r=this.pos,i=this.pos+t;if(i>this.len)throw indexOutOfRange(this,t);return this.pos=i,n.readStrict(this.buf,r,i)},Reader.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw indexOutOfRange(this,t);this.pos+=t}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(128&this.buf[this.pos++]);return this},Reader.recursionLimit=o.recursionLimit,Reader.discardUnknown=!0,Reader.prototype.skipType=function(t,r,i){if(void 0===r&&(r=0),r>Reader.recursionLimit)throw Error("max depth exceeded");if(0===i)throw Error("illegal tag: field number 0");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(),o=e>>>3;if(t=7&e,!o)throw Error("illegal tag: field number 0");if(4===t){if(void 0!==i&&o!==i)throw Error("invalid end group tag");break}this.skipType(t,r+1,o)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},Reader._configure=function(t){e=t,Reader.create=create(),e._configure();var r=o.Long?"toLong":"toNumber";o.merge(Reader.prototype,{int64:function(){return readLongVarint.call(this)[r](!1)},uint64:function(){return readLongVarint.call(this)[r](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[r](!1)},fixed64:function(){return readFixed64.call(this)[r](!0)},sfixed64:function(){return readFixed64.call(this)[r](!1)}})}},"./protobufjs/src/reader_buffer.js"(t,r,i){"use strict";t.exports=BufferReader;var e=i("./protobufjs/src/reader.js");BufferReader.prototype=Object.create(e.prototype,{constructor:{value:BufferReader,writable:!0,enumerable:!1,configurable:!0}});var o=i("./protobufjs/src/util/minimal.js");function BufferReader(t){e.call(this,t)}BufferReader._configure=function(){o.Buffer&&(BufferReader.prototype._slice=o.Buffer.prototype.slice)},BufferReader.prototype.raw=function(t,r){return this._slice.call(this.buf,t,r)},BufferReader.prototype.string=function(){var t=this.uint32(),r=this.pos,i=this.pos+t;if(i>this.len)throw RangeError("index out of range: "+this.pos+" + "+t+" > "+this.len);return this.pos=i,this.buf.utf8Slice?this.buf.utf8Slice(r,i):this.buf.toString("utf-8",r,i)},BufferReader._configure()},"./protobufjs/src/roots.js"(t){"use strict";t.exports=Object.create(null)},"./protobufjs/src/rpc.js"(t,r,i){"use strict";r.Service=i("./protobufjs/src/rpc/service.js")},"./protobufjs/src/rpc/service.js"(t,r,i){"use strict";t.exports=Service;var e=i("./protobufjs/src/util/minimal.js");function Service(t,r,i){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!r,this.responseDelimited=!!i}Service.prototype=Object.create(e.EventEmitter.prototype,{constructor:{value:Service,writable:!0,enumerable:!1,configurable:!0}}),Service.prototype.rpcCall=function rpcCall(t,r,i,o,s){if(!o)throw TypeError("request must be specified");var n=this;if(!s)return e.asPromise(rpcCall,n,t,r,i,o);if(!n.rpcImpl)return void setTimeout(function(){s(Error("already ended"))},0);try{return n.rpcImpl(t,r[n.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(r,e){if(r)return n.emit("error",r,t),s(r);if(null===e)return void n.end(!0);if(!(e instanceof i))try{e=i[n.responseDelimited?"decodeDelimited":"decode"](e)}catch(r){return n.emit("error",r,t),s(r)}return n.emit("data",e,t),s(null,e)})}catch(r){n.emit("error",r,t),setTimeout(function(){s(r)},0);return}},Service.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},"./protobufjs/src/util/aspromise.js"(t){"use strict";t.exports=function asPromise(t,r){for(var i=Array(arguments.length-1),e=0,o=2,s=!0;o<arguments.length;)i[e++]=arguments[o++];return new Promise(function(o,n){i[e]=function(t){if(s)if(s=!1,t)n(t);else{for(var r=Array(arguments.length-1),i=0;i<r.length;)r[i++]=arguments[i];o.apply(null,r)}};try{t.apply(r||null,i)}catch(t){s&&(s=!1,n(t))}})}},"./protobufjs/src/util/base64.js"(t,r){"use strict";r.length=function(t){var r=t.length;if(!r)return 0;for(;r>0&&"="===t.charAt(r-1);)--r;return Math.floor(3*r/4)};for(var i=Array(64),e=Array(123),o=0;o<64;)e[i[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;e[45]=62,e[95]=63,r.encode=function(t,r,e){for(var o,s=null,n=[],u=0,h=0;r<e;){var f=t[r++];switch(h){case 0:n[u++]=i[f>>2],o=(3&f)<<4,h=1;break;case 1:n[u++]=i[o|f>>4],o=(15&f)<<2,h=2;break;case 2:n[u++]=i[o|f>>6],n[u++]=i[63&f],h=0}u>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,n)),u=0)}return(h&&(n[u++]=i[o],n[u++]=61,1===h&&(n[u++]=61)),s)?(u&&s.push(String.fromCharCode.apply(String,n.slice(0,u))),s.join("")):String.fromCharCode.apply(String,n.slice(0,u))};var s="invalid encoding";r.decode=function(t,r,i){for(var o,n=i,u=0,h=0;h<t.length;){var f=t.charCodeAt(h++);if(61===f&&u>1)break;if(void 0===(f=e[f]))throw Error(s);switch(u){case 0:o=f,u=1;break;case 1:r[i++]=o<<2|(48&f)>>4,o=f,u=2;break;case 2:r[i++]=(15&o)<<4|(60&f)>>2,o=f,u=3;break;case 3:r[i++]=(3&o)<<6|f,u=0}}if(1===u)throw Error(s);return i-n};var n=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,u=/[-_]/,h=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;r.test=function(t){return n.test(t)||u.test(t)&&h.test(t)}},"./protobufjs/src/util/eventemitter.js"(t){"use strict";function EventEmitter(){this._listeners=Object.create(null)}t.exports=EventEmitter,EventEmitter.prototype.on=function(t,r,i){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:r,ctx:i||this}),this},EventEmitter.prototype.off=function(t,r){if(void 0===t)this._listeners=Object.create(null);else if(void 0===r)this._listeners[t]=[];else{var i=this._listeners[t];if(!i)return this;for(var e=0;e<i.length;)i[e].fn===r?i.splice(e,1):++e}return this},EventEmitter.prototype.emit=function(t){var r=this._listeners[t];if(r){for(var i=[],e=1;e<arguments.length;)i.push(arguments[e++]);for(e=0;e<r.length;)r[e].fn.apply(r[e++].ctx,i)}return this}},"./protobufjs/src/util/float.js"(t){"use strict";function factory(t){if("u">typeof Float32Array)!function(){var r=new Float32Array([-0]),i=new Uint8Array(r.buffer),e=128===i[3];function writeFloat_f32_cpy(t,e,o){r[0]=t,e[o]=i[0],e[o+1]=i[1],e[o+2]=i[2],e[o+3]=i[3]}function writeFloat_f32_rev(t,e,o){r[0]=t,e[o]=i[3],e[o+1]=i[2],e[o+2]=i[1],e[o+3]=i[0]}function readFloat_f32_cpy(t,e){return i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],r[0]}function readFloat_f32_rev(t,e){return i[3]=t[e],i[2]=t[e+1],i[1]=t[e+2],i[0]=t[e+3],r[0]}t.writeFloatLE=e?writeFloat_f32_cpy:writeFloat_f32_rev,t.writeFloatBE=e?writeFloat_f32_rev:writeFloat_f32_cpy,t.readFloatLE=e?readFloat_f32_cpy:readFloat_f32_rev,t.readFloatBE=e?readFloat_f32_rev:readFloat_f32_cpy}();else{function writeFloat_ieee754(t,r,i,e){var o=+(r<0);if(o&&(r=-r),0===r)t(1/r>0?0:0x80000000,i,e);else if(isNaN(r))t(0x7fc00000,i,e);else if(r>34028234663852886e22)t((o<<31|0x7f800000)>>>0,i,e);else if(r<11754943508222875e-54)t((o<<31|Math.round(r/1401298464324817e-60))>>>0,i,e);else{var s=Math.floor(Math.log(r)/Math.LN2),n=8388607&Math.round(r*Math.pow(2,-s)*8388608);t((o<<31|s+127<<23|n)>>>0,i,e)}}function readFloat_ieee754(t,r,i){var e=t(r,i),o=(e>>31)*2+1,s=e>>>23&255,n=8388607&e;return 255===s?n?NaN:1/0*o:0===s?1401298464324817e-60*o*n:o*Math.pow(2,s-150)*(n+8388608)}t.writeFloatLE=writeFloat_ieee754.bind(null,writeUintLE),t.writeFloatBE=writeFloat_ieee754.bind(null,writeUintBE),t.readFloatLE=readFloat_ieee754.bind(null,readUintLE),t.readFloatBE=readFloat_ieee754.bind(null,readUintBE)}if("u">typeof Float64Array)!function(){var r=new Float64Array([-0]),i=new Uint8Array(r.buffer),e=128===i[7];function writeDouble_f64_cpy(t,e,o){r[0]=t,e[o]=i[0],e[o+1]=i[1],e[o+2]=i[2],e[o+3]=i[3],e[o+4]=i[4],e[o+5]=i[5],e[o+6]=i[6],e[o+7]=i[7]}function writeDouble_f64_rev(t,e,o){r[0]=t,e[o]=i[7],e[o+1]=i[6],e[o+2]=i[5],e[o+3]=i[4],e[o+4]=i[3],e[o+5]=i[2],e[o+6]=i[1],e[o+7]=i[0]}function readDouble_f64_cpy(t,e){return i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],i[4]=t[e+4],i[5]=t[e+5],i[6]=t[e+6],i[7]=t[e+7],r[0]}function readDouble_f64_rev(t,e){return i[7]=t[e],i[6]=t[e+1],i[5]=t[e+2],i[4]=t[e+3],i[3]=t[e+4],i[2]=t[e+5],i[1]=t[e+6],i[0]=t[e+7],r[0]}t.writeDoubleLE=e?writeDouble_f64_cpy:writeDouble_f64_rev,t.writeDoubleBE=e?writeDouble_f64_rev:writeDouble_f64_cpy,t.readDoubleLE=e?readDouble_f64_cpy:readDouble_f64_rev,t.readDoubleBE=e?readDouble_f64_rev:readDouble_f64_cpy}();else{function writeDouble_ieee754(t,r,i,e,o,s){var n,u=+(e<0);if(u&&(e=-e),0===e)t(0,o,s+r),t(1/e>0?0:0x80000000,o,s+i);else if(isNaN(e))t(0,o,s+r),t(0x7ff80000,o,s+i);else if(e>17976931348623157e292)t(0,o,s+r),t((u<<31|0x7ff00000)>>>0,o,s+i);else if(e<22250738585072014e-324)t((n=e/5e-324)>>>0,o,s+r),t((u<<31|n/0x100000000)>>>0,o,s+i);else{var h=Math.floor(Math.log(e)/Math.LN2);1024===h&&(h=1023),t(0x10000000000000*(n=e*Math.pow(2,-h))>>>0,o,s+r),t((u<<31|h+1023<<20|1048576*n&1048575)>>>0,o,s+i)}}function readDouble_ieee754(t,r,i,e,o){var s=t(e,o+r),n=t(e,o+i),u=(n>>31)*2+1,h=n>>>20&2047,f=0x100000000*(1048575&n)+s;return 2047===h?f?NaN:1/0*u:0===h?5e-324*u*f:u*Math.pow(2,h-1075)*(f+0x10000000000000)}t.writeDoubleLE=writeDouble_ieee754.bind(null,writeUintLE,0,4),t.writeDoubleBE=writeDouble_ieee754.bind(null,writeUintBE,4,0),t.readDoubleLE=readDouble_ieee754.bind(null,readUintLE,0,4),t.readDoubleBE=readDouble_ieee754.bind(null,readUintBE,4,0)}return t}function writeUintLE(t,r,i){r[i]=255&t,r[i+1]=t>>>8&255,r[i+2]=t>>>16&255,r[i+3]=t>>>24}function writeUintBE(t,r,i){r[i]=t>>>24,r[i+1]=t>>>16&255,r[i+2]=t>>>8&255,r[i+3]=255&t}function readUintLE(t,r){return(t[r]|t[r+1]<<8|t[r+2]<<16|t[r+3]<<24)>>>0}function readUintBE(t,r){return(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0}t.exports=factory(factory)},"./protobufjs/src/util/longbits.js"(t){"use strict";function LongBits(t,r){this.lo=t>>>0,this.hi=r>>>0}t.exports=LongBits;var r,i=LongBits.zero=new LongBits(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var e=LongBits.zeroHash="\0\0\0\0\0\0\0\0";LongBits.fromNumber=function(t){if(0===t)return i;var r=t<0;r&&(t=-t);var e=t>>>0,o=(t-e)/0x100000000>>>0;return r&&(o=~o>>>0,e=~e>>>0,++e>0xffffffff&&(e=0,++o>0xffffffff&&(o=0))),new LongBits(e,o)},LongBits.from=function(t){if("number"==typeof t)return LongBits.fromNumber(t);if("string"==typeof t||t instanceof String)if(!r)return LongBits.fromNumber(parseInt(t,10));else t=r.fromString(t);return t.low||t.high?new LongBits(t.low>>>0,t.high>>>0):i},LongBits.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var r=~this.lo+1>>>0,i=~this.hi>>>0;return r||(i=i+1>>>0),-(r+0x100000000*i)}return this.lo+0x100000000*this.hi},LongBits.prototype.toLong=function(t){return r?new r(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var o=String.prototype.charCodeAt;LongBits.fromHash=function(t){return t===e?i:new LongBits((o.call(t,0)|o.call(t,1)<<8|o.call(t,2)<<16|o.call(t,3)<<24)>>>0,(o.call(t,4)|o.call(t,5)<<8|o.call(t,6)<<16|o.call(t,7)<<24)>>>0)},LongBits.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},LongBits.prototype.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},LongBits.prototype.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},LongBits.prototype.length=function(){var t=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===r?t<16384?t<128?1:2:t<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:i<128?9:10},LongBits._configure=function(t){r=t}},"./protobufjs/src/util/minimal.js"(t,r,i){"use strict";function isUnsafeProperty(t){return"__proto__"===t||"prototype"===t||"constructor"===t}function merge(t){var r="boolean"==typeof arguments[arguments.length-1],i=r?arguments.length-1:arguments.length;r=r&&arguments[arguments.length-1];for(var e=1;e<i;++e){var o=arguments[e];if(o)for(var s=Object.keys(o),n=0;n<s.length;++n)isUnsafeProperty(s[n])||r&&Object.prototype.hasOwnProperty.call(t,s[n])&&void 0!==t[s[n]]||(t[s[n]]=o[s[n]])}return t}function newError(t){function CustomError(t,r){if(!(this instanceof CustomError))return new CustomError(t,r);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,CustomError):Object.defineProperty(this,"stack",{value:Error().stack||""}),r&&merge(this,r)}return CustomError.prototype=Object.create(Error.prototype,{constructor:{value:CustomError,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),CustomError}r.asPromise=i("./protobufjs/src/util/aspromise.js"),r.base64=i("./protobufjs/src/util/base64.js"),r.EventEmitter=i("./protobufjs/src/util/eventemitter.js"),r.float=i("./protobufjs/src/util/float.js"),r.utf8=i("./protobufjs/src/util/utf8.js"),r.pool=i("./protobufjs/src/util/pool.js"),r.LongBits=i("./protobufjs/src/util/longbits.js"),r.isUnsafeProperty=isUnsafeProperty,r.isNode=!!("u">typeof global&&global&&global.process&&global.process.versions&&global.process.versions.node),r.global=r.isNode&&global||"u">typeof window&&window||"u">typeof self&&self||"u">typeof globalThis&&globalThis||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},r.isString=function(t){return"string"==typeof t||t instanceof String},r.isObject=function(t){return t&&"object"==typeof t},r.isset=r.isSet=function(t,r){var i=t[r];return!!(null!=i&&Object.hasOwnProperty.call(t,r))&&("object"!=typeof i||(Array.isArray(i)?i.length:Object.keys(i).length)>0)},r.Buffer=function(){try{var t=r.global.Buffer;return t.prototype.utf8Write||r.isNode?t:null}catch(t){return null}}(),r.newBuffer=function(t){var i=r.Buffer;return"number"==typeof t?i?i.allocUnsafe(t):new Uint8Array(t):i?i.from(t):new Uint8Array(t)},r.rawField=function(t,i,e){var o=[],s=t<<3|i;for(s>>>=0;s>127;)o.push(127&s|128),s>>>=7;o.push(s);for(var n=0;n<e.length;++n)o.push(e[n]);return r.newBuffer(o)},r.Array=Uint8Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||function(){try{var t=i("./long/umd/index.js");return t&&t.isLong?t:null}catch(t){return null}}(),r.key2Re=/^(?:true|false|0|1)$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(t){return t?r.LongBits.from(t).toHash():r.LongBits.zeroHash},r.longFromHash=function(t,i){var e=r.LongBits.fromHash(t);return r.Long?r.Long.fromBits(e.lo,e.hi,i):e.toNumber(!!i)},r.longFromKey=function(t,i){return r.key64Re.test(t)&&!r.key32Re.test(t)?r.longFromHash(t,i):t},r.boolFromKey=function(t){return"true"===t||"1"===t},r.merge=merge,r.nestingLimit=32,r.recursionLimit=100,r.makeProp=function(t,r,i){Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:void 0===i||i,configurable:!0,writable:!0})},r.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},r.newError=newError,r.ProtocolError=newError("ProtocolError"),r.oneOfGetter=function(t){for(var r={},i=0;i<t.length;++i)r[t[i]]=1;return function(){for(var t=Object.keys(this),i=t.length-1;i>-1;--i)if(1===r[t[i]]&&void 0!==this[t[i]]&&null!==this[t[i]])return t[i]}},r.oneOfSetter=function(t){return function(r){for(var i=0;i<t.length;++i)t[i]!==r&&delete this[t[i]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0}},"./protobufjs/src/util/pool.js"(t){"use strict";t.exports=function pool(t,r,i){var e=i||8192,o=e>>>1,s=null,n=e;return function(i){if(i<1||i>o)return t(i);n+i>e&&(s=t(e),n=0);var u=r.call(s,n,n+=i);return 7&n&&(n=(7|n)+1),u}}},"./protobufjs/src/util/utf8.js"(t,r){"use strict";var i,e=new TextDecoder("utf-8",{ignoreBOM:!0});try{i=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch(t){i=e}function utf8_read_decoder(t,r,i,e){var o=0===i&&e===r.length?r:r.subarray(i,e);return t.decode(o)}r.length=function(t){for(var r=0,i=0,e=0;e<t.length;++e)(i=t.charCodeAt(e))<128?r+=1:i<2048?r+=2:(64512&i)==55296&&(64512&t.charCodeAt(e+1))==56320?(++e,r+=4):r+=3;return r},r.read=function(t,r,i){if(i-r<1)return"";if(i-r>=64)return utf8_read_decoder(e,t,r,i);for(var o,s,n,u,h,f,a,l,p="",c=r;c+7<i;c+=8){if(o=t[c],s=t[c+1],n=t[c+2],u=t[c+3],h=t[c+4],f=t[c+5],(o|s|n|u|h|f|(a=t[c+6])|(l=t[c+7]))&128)return p+utf8_read_decoder(e,t,c,i);p+=String.fromCharCode(o,s,n,u,h,f,a,l)}for(;c<i;++c){if(128&(o=t[c]))return p+utf8_read_decoder(e,t,c,i);p+=String.fromCharCode(o)}return p},r.readStrict=function(t,r,e){if(e-r<1)return"";if(e-r>=64)return utf8_read_decoder(i,t,r,e);for(var o,s,n,u,h,f,a,l,p="",c=r;c+7<e;c+=8){if(o=t[c],s=t[c+1],n=t[c+2],u=t[c+3],h=t[c+4],f=t[c+5],(o|s|n|u|h|f|(a=t[c+6])|(l=t[c+7]))&128)return p+utf8_read_decoder(i,t,c,e);p+=String.fromCharCode(o,s,n,u,h,f,a,l)}for(;c<e;++c){if(128&(o=t[c]))return p+utf8_read_decoder(i,t,c,e);p+=String.fromCharCode(o)}return p},r.write=function(t,r,i){for(var e,o,s=i,n=0;n<t.length;++n)(e=t.charCodeAt(n))<128?r[i++]=e:(e<2048?r[i++]=e>>6|192:((64512&e)==55296&&(64512&(o=t.charCodeAt(n+1)))==56320?(e=65536+((1023&e)<<10)+(1023&o),++n,r[i++]=e>>18|240,r[i++]=e>>12&63|128):r[i++]=e>>12|224,r[i++]=e>>6&63|128),r[i++]=63&e|128);return i-s}},"./protobufjs/src/writer.js"(t,r,i){"use strict";t.exports=Writer;var e,o=i("./protobufjs/src/util/minimal.js"),s=o.LongBits,n=o.base64,u=o.utf8;function Writer(){this.pos=0,this.buf=this.constructor.alloc(Writer.initialBufferSize),this.view=null,this.states=null}Writer.initialBufferSize=128,Object.defineProperty(Writer.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var create=function(){return o.Buffer?function(){return(Writer.create=function(){return new e})()}:function(){return new Writer}};function sizeVarint32(t){return t<128?1:t<16384?2:t<2097152?3:t<0x10000000?4:5}function writeStringAscii(t,r,i){for(var e=0;e<t.length;)r[i++]=t.charCodeAt(e++)}function writeVarint32(t,r,i){for(;t>127;)r[i++]=127&t|128,t>>>=7;return r[i]=t,i+1}function writeVarint64(t,r,i){for(var e=t.lo,o=t.hi;o;)r[i++]=127&e|128,e=(e>>>7|o<<25)>>>0,o>>>=7;for(;e>127;)r[i++]=127&e|128,e>>>=7;return r[i]=e,i+1}function writeFixed32(t,r,i){r[i]=255&t,r[i+1]=t>>>8&255,r[i+2]=t>>>16&255,r[i+3]=t>>>24}function getLazyView(t,r,i){var e=t.view;if(e||r<i)return e;var o=t.buf;return t.view=new DataView(o.buffer,o.byteOffset,o.byteLength)}Writer.create=create(),Writer.alloc=function(t){return new Uint8Array(t)},Writer.alloc=o.pool(Writer.alloc,Uint8Array.prototype.subarray),Writer.prototype._reserve=function(t){var r=this.pos+t;if(r>this.buf.length){var i=this.buf.length<<1;i<r&&(i=r);var e=this.constructor.alloc(i);e.set(this.buf.subarray(0,this.pos),0),this.buf=e,this.view=null}},Writer.prototype.uint32=function(t){t>>>=0,this._reserve(5);var r=this.pos;return this.pos=writeVarint32(t,this.buf,r),this},Writer.prototype.int32=function(t){return(t|=0)<0?(this._reserve(10),writeVarint64(s.fromNumber(t),this.buf,this.pos),this.pos+=10,this):this.uint32(t)},Writer.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},Writer.prototype.uint64=function(t){var r=s.from(t);this._reserve(10);var i=this.pos;return this.pos=writeVarint64(r,this.buf,i),this},Writer.prototype.int64=Writer.prototype.uint64,Writer.prototype.sint64=function(t){var r=s.from(t).zzEncode();this._reserve(10);var i=this.pos;return this.pos=writeVarint64(r,this.buf,i),this},Writer.prototype.bool=function(t){return this._reserve(1),this.buf[this.pos++]=+!!t,this},Writer.prototype.fixed32=function(t){return this._reserve(4),writeFixed32(t>>>0,this.buf,this.pos),this.pos+=4,this},Writer.prototype.sfixed32=Writer.prototype.fixed32,Writer.prototype.fixed64=function(t){var r=s.from(t);return this._reserve(8),writeFixed32(r.lo,this.buf,this.pos),writeFixed32(r.hi,this.buf,this.pos+4),this.pos+=8,this},Writer.prototype.sfixed64=Writer.prototype.fixed64,Writer.prototype.float=function(t){return this._reserve(4),o.float.writeFloatLE(t,this.buf,this.pos),this.pos+=4,this},Writer.prototype.double=function(t){return this._reserve(8),o.float.writeDoubleLE(t,this.buf,this.pos),this.pos+=8,this},Writer.prototype.bytes=function(t){var r=t.length>>>0;if(!r)return this._reserve(1),this.buf[this.pos++]=0,this;if(o.isString(t)){var i=Writer.alloc(r=n.length(t));n.decode(t,i,0),t=i}return this.uint32(r),this._reserve(r),this.buf.set(t,this.pos),this.pos+=r,this},Writer.prototype.raw=function(t){var r=t.length>>>0;return r&&(this._reserve(r),this.buf.set(t,this.pos),this.pos+=r),this},Writer.prototype._delim=function(t,r){var i=sizeVarint32(r);return i>1&&this.buf.copyWithin(t+i,t+1,t+1+r),writeVarint32(r,this.buf,t),this.pos=t+i+r,this},Writer.prototype.string=function(t){var r=t.length;if(!r)return this._reserve(1),this.buf[this.pos++]=0,this;if(r<128){this._reserve(3*r+5);var i=this.pos;return this._delim(i,u.write(t,this.buf,i+1))}var e=u.length(t);return this.uint32(e),this._reserve(e),e===t.length?writeStringAscii(t,this.buf,this.pos):u.write(t,this.buf,this.pos),this.pos+=e,this},Writer.prototype.uint32s=function(t){var r=t.length;this._reserve(5*r+5);for(var i=this.buf,e=this.pos,o=e+1,s=0;s<r;++s)o=writeVarint32(t[s]>>>0,i,o);return this._delim(e,o-e-1)},Writer.prototype.int32s=function(t){var r=t.length;this._reserve(10*r+5);for(var i,e=this.buf,o=this.pos,n=o+1,u=0;u<r;++u)n=(i=0|t[u])<0?writeVarint64(s.fromNumber(i),e,n):writeVarint32(i,e,n);return this._delim(o,n-o-1)},Writer.prototype.sint32s=function(t){var r=t.length;this._reserve(5*r+5);for(var i=this.buf,e=this.pos,o=e+1,s=0;s<r;++s)o=writeVarint32((t[s]<<1^t[s]>>31)>>>0,i,o);return this._delim(e,o-e-1)},Writer.prototype.uint64s=function(t){var r=t.length;this._reserve(10*r+5);for(var i=this.buf,e=this.pos,o=e+1,n=0;n<r;++n)o=writeVarint64(s.from(t[n]),i,o);return this._delim(e,o-e-1)},Writer.prototype.int64s=Writer.prototype.uint64s,Writer.prototype.sint64s=function(t){var r=t.length;this._reserve(10*r+5);for(var i=this.buf,e=this.pos,o=e+1,n=0;n<r;++n)o=writeVarint64(s.from(t[n]).zzEncode(),i,o);return this._delim(e,o-e-1)},Writer.prototype.bools=function(t){var r=t.length;this.uint32(r),this._reserve(r);for(var i=this.buf,e=this.pos,o=0;o<r;++o)i[e++]=+!!t[o];return this.pos+=r,this},Writer.prototype.fixed32s=function(t){var r=t.length,i=4*r;this.uint32(i),this._reserve(i);var e,o=this.pos,s=getLazyView(this,r,128);if(s)for(e=0;e<r;++e)s.setUint32(o,t[e]>>>0,!0),o+=4;else{var n=this.buf;for(e=0;e<r;++e)writeFixed32(t[e]>>>0,n,o),o+=4}return this.pos+=i,this},Writer.prototype.sfixed32s=Writer.prototype.fixed32s,Writer.prototype.fixed64s=function(t){var r=t.length,i=8*r;this.uint32(i),this._reserve(i);var e,o,n=this.pos,u=getLazyView(this,r,128);if(u)for(e=0;e<r;++e)o=s.from(t[e]),u.setUint32(n,o.lo,!0),u.setUint32(n+4,o.hi,!0),n+=8;else{var h=this.buf;for(e=0;e<r;++e)writeFixed32((o=s.from(t[e])).lo,h,n),writeFixed32(o.hi,h,n+4),n+=8}return this.pos+=i,this},Writer.prototype.sfixed64s=Writer.prototype.fixed64s,Writer.prototype.floats=function(t){var r=t.length,i=4*r;this.uint32(i),this._reserve(i);var e,s=this.pos,n=getLazyView(this,r,16);if(n)for(e=0;e<r;++e)n.setFloat32(s,t[e],!0),s+=4;else{var u=this.buf;for(e=0;e<r;++e)o.float.writeFloatLE(t[e],u,s),s+=4}return this.pos+=i,this},Writer.prototype.doubles=function(t){var r=t.length,i=8*r;this.uint32(i),this._reserve(i);var e,s=this.pos,n=getLazyView(this,r,16);if(n)for(e=0;e<r;++e)n.setFloat64(s,t[e],!0),s+=8;else{var u=this.buf;for(e=0;e<r;++e)o.float.writeDoubleLE(t[e],u,s),s+=8}return this.pos+=i,this},Writer.prototype.fork=function(){return this._reserve(1),(this.states||(this.states=[])).push(this.pos),this.pos+=1,this},Writer.prototype.reset=function(){var t=this.states;return t&&t.length?this.pos=t.pop():this.pos=0,this},Writer.prototype.ldelim=function(){var t,r,i=this.states;if(i&&i.length){var e=i.pop();(r=sizeVarint32(t=this.pos-e-1))>1?(this._reserve(r-1),this.buf.copyWithin(e+r,e+1,e+1+t),this.pos+=r-1,writeVarint32(t,this.buf,e)):this.buf[e]=t}else r=sizeVarint32(t=this.pos),this._reserve(r),this.buf.copyWithin(r,0,t),writeVarint32(t,this.buf,0),this.pos+=r;return this},Writer.prototype.finish=function(t){if(t)return this.buf.subarray(0,this.pos);var r=this.constructor.alloc(this.pos);return r.set(this.buf.subarray(0,this.pos),0),r},Writer.prototype.finishInto=function(t,r){return void 0===r&&(r=0),t.set(this.buf.subarray(0,this.pos),r),t},Writer._configure=function(t){e=t,Writer.create=create(),e._configure()}},"./protobufjs/src/writer_buffer.js"(t,r,i){"use strict";t.exports=BufferWriter;var e,o=i("./protobufjs/src/writer.js");BufferWriter.prototype=Object.create(o.prototype,{constructor:{value:BufferWriter,writable:!0,enumerable:!1,configurable:!0}});var s=i("./protobufjs/src/util/minimal.js");function BufferWriter(){o.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=s.Buffer&&s.Buffer.allocUnsafe,e=s.Buffer&&s.Buffer.prototype.utf8Write?function(t,r,i){return r.utf8Write(t,i)}:function(t,r,i){return r.write(t,i)}},BufferWriter.prototype.bytes=function(t){s.isString(t)&&(t=s.Buffer.from(t,"base64"));var r=t.length>>>0;return this.uint32(r),r&&(this._reserve(r),this.buf.set(t,this.pos),this.pos+=r),this},BufferWriter.prototype.string=function(t){var r=t.length;if(!r)return this._reserve(1),this.buf[this.pos++]=0,this;if(r<128){this._reserve(3*r+5);var i=this.pos,o=this.buf;return this._delim(i,r<40?s.utf8.write(t,o,i+1):e(t,o,i+1))}var n=s.Buffer.byteLength(t);return this.uint32(n),this._reserve(n),e(t,this.buf,this.pos),this.pos+=n,this},BufferWriter._configure()}},r={};function __webpack_require__(i){var e=r[i];if(void 0!==e)return e.exports;var o=r[i]={exports:{}};return t[i].call(o.exports,o,o.exports,__webpack_require__),o.exports}var i=__webpack_require__("./protobufjs/minimal.js");module.exports=i})();
|
|
1
|
+
(()=>{var t={"./long/umd/index.js"(t,r){!function(i,e){function preferDefault(t){return t.default||t}"function"==typeof define&&define.amd?define([],function(){var t={};return e(t),preferDefault(t)}):(e(r),t.exports=preferDefault(r))}("u">typeof globalThis?globalThis:"u">typeof self&&self,function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Long(t,r,i){this.low=0|t,this.high=0|r,this.unsigned=!!i}function isLong(t){return!0===(t&&t.__isLong__)}function ctz32(t){var r=Math.clz32(t&-t);return t?31-r:r}Long.prototype.__isLong__,Object.defineProperty(Long.prototype,"__isLong__",{value:!0}),Long.isLong=isLong;var i={},e={};function fromInt(t,r){var n,s,o;if(r)return(t>>>=0,(o=0<=t&&t<256)&&(s=e[t]))?s:(n=fromBits(t,0,!0),o&&(e[t]=n),n);return(t|=0,(o=-128<=t&&t<128)&&(s=i[t]))?s:(n=fromBits(t,t<0?-1:0,!1),o&&(i[t]=n),n)}function fromNumber(t,r){if(isNaN(t))return r?a:f;if(r){if(t<0)return a;if(t>=o)return d}else{if(t<=-h)return b;if(t+1>=h)return g}return t<0?fromNumber(-t,r).neg():fromBits(t%s|0,t/s|0,r)}function fromBits(t,r,i){return new Long(t,r,i)}Long.fromInt=fromInt,Long.fromNumber=fromNumber,Long.fromBits=fromBits;var n=Math.pow;function fromString(t,r,i){if(0===t.length)throw Error("empty string");if("number"==typeof r?(i=r,r=!1):r=!!r,"NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return r?a:f;if((i=i||10)<2||36<i)throw RangeError("radix");if((e=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===e)return fromString(t.substring(1),r,i).neg();for(var e,s=fromNumber(n(i,8)),o=f,h=0;h<t.length;h+=8){var u=Math.min(8,t.length-h),l=parseInt(t.substring(h,h+u),i);if(u<8){var p=fromNumber(n(i,u));o=o.mul(p).add(fromNumber(l))}else o=(o=o.mul(s)).add(fromNumber(l))}return o.unsigned=r,o}function fromValue(t,r){return"number"==typeof t?fromNumber(t,r):"string"==typeof t?fromString(t,r):fromBits(t.low,t.high,"boolean"==typeof r?r:t.unsigned)}Long.fromString=fromString,Long.fromValue=fromValue;var s=0x100000000,o=0xffffffffffffffff,h=0x8000000000000000,u=fromInt(0x1000000),f=fromInt(0);Long.ZERO=f;var a=fromInt(0,!0);Long.UZERO=a;var l=fromInt(1);Long.ONE=l;var p=fromInt(1,!0);Long.UONE=p;var c=fromInt(-1);Long.NEG_ONE=c;var g=fromBits(-1,0x7fffffff,!1);Long.MAX_VALUE=g;var d=fromBits(-1,-1,!0);Long.MAX_UNSIGNED_VALUE=d;var b=fromBits(0,-0x80000000,!1);Long.MIN_VALUE=b;var v=Long.prototype;v.toInt=function(){return this.unsigned?this.low>>>0:this.low},v.toNumber=function(){return this.unsigned?(this.high>>>0)*s+(this.low>>>0):this.high*s+(this.low>>>0)},v.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(!this.eq(b))return"-"+this.neg().toString(t);else{var r=fromNumber(t),i=this.div(r),e=i.mul(r).sub(this);return i.toString(t)+e.toInt().toString(t)}for(var s=fromNumber(n(t,6),this.unsigned),o=this,h="";;){var u=o.div(s),f=(o.sub(u.mul(s)).toInt()>>>0).toString(t);if((o=u).isZero())return f+h;for(;f.length<6;)f="0"+f;h=""+f+h}},v.getHighBits=function(){return this.high},v.getHighBitsUnsigned=function(){return this.high>>>0},v.getLowBits=function(){return this.low},v.getLowBitsUnsigned=function(){return this.low>>>0},v.getNumBitsAbs=function(){if(this.isNegative())return this.eq(b)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,r=31;r>0&&(t&1<<r)==0;r--);return 0!=this.high?r+33:r+1},v.isSafeInteger=function(){var t=this.high>>21;return!t||!this.unsigned&&-1===t&&(0!==this.low||-2097152!==this.high)},v.isZero=function(){return 0===this.high&&0===this.low},v.eqz=v.isZero,v.isNegative=function(){return!this.unsigned&&this.high<0},v.isPositive=function(){return this.unsigned||this.high>=0},v.isOdd=function(){return(1&this.low)==1},v.isEven=function(){return(1&this.low)==0},v.equals=function(t){return isLong(t)||(t=fromValue(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},v.eq=v.equals,v.notEquals=function(t){return!this.eq(t)},v.neq=v.notEquals,v.ne=v.notEquals,v.lessThan=function(t){return 0>this.comp(t)},v.lt=v.lessThan,v.lessThanOrEqual=function(t){return 0>=this.comp(t)},v.lte=v.lessThanOrEqual,v.le=v.lessThanOrEqual,v.greaterThan=function(t){return this.comp(t)>0},v.gt=v.greaterThan,v.greaterThanOrEqual=function(t){return this.comp(t)>=0},v.gte=v.greaterThanOrEqual,v.ge=v.greaterThanOrEqual,v.compare=function(t){if(isLong(t)||(t=fromValue(t)),this.eq(t))return 0;var r=this.isNegative(),i=t.isNegative();return r&&!i?-1:!r&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},v.comp=v.compare,v.negate=function(){return!this.unsigned&&this.eq(b)?b:this.not().add(l)},v.neg=v.negate,v.add=function(t){isLong(t)||(t=fromValue(t));var r,i,e=this.high>>>16,n=65535&this.high,s=this.low>>>16,o=65535&this.low,h=t.high>>>16,u=65535&t.high,f=t.low>>>16,a=65535&t.low,l=0,p=0;return r=0+((i=0+(o+a))>>>16),i&=65535,r+=s+f,p+=r>>>16,r&=65535,p+=n+u,l+=p>>>16,p&=65535,l+=e+h,fromBits(r<<16|i,(l&=65535)<<16|p,this.unsigned)},v.subtract=function(t){return isLong(t)||(t=fromValue(t)),this.add(t.neg())},v.sub=v.subtract,v.multiply=function(t){if(this.isZero())return this;if(isLong(t)||(t=fromValue(t)),r)return fromBits(r.mul(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned);if(t.isZero())return this.unsigned?a:f;if(this.eq(b))return t.isOdd()?b:f;if(t.eq(b))return this.isOdd()?b:f;if(this.isNegative())if(t.isNegative())return this.neg().mul(t.neg());else return this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(u)&&t.lt(u))return fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var i,e,n=this.high>>>16,s=65535&this.high,o=this.low>>>16,h=65535&this.low,l=t.high>>>16,p=65535&t.high,c=t.low>>>16,g=65535&t.low,d=0,v=0;return i=0+((e=0+h*g)>>>16),e&=65535,i+=o*g,v+=i>>>16,i&=65535,i+=h*c,v+=i>>>16,i&=65535,v+=s*g,d+=v>>>16,v&=65535,v+=o*c,d+=v>>>16,v&=65535,v+=h*p,d+=v>>>16,v&=65535,d+=n*g+s*c+o*p+h*l,fromBits(i<<16|e,(d&=65535)<<16|v,this.unsigned)},v.mul=v.multiply,v.divide=function(t){if(isLong(t)||(t=fromValue(t)),t.isZero())throw Error("division by zero");if(r){var i,e,s;return this.unsigned||-0x80000000!==this.high||-1!==t.low||-1!==t.high?fromBits((this.unsigned?r.div_u:r.div_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this}if(this.isZero())return this.unsigned?a:f;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return a;if(t.gt(this.shru(1)))return p;s=a}else{if(this.eq(b))if(t.eq(l)||t.eq(c))return b;else return t.eq(b)?l:(i=this.shr(1).div(t).shl(1)).eq(f)?t.isNegative()?l:c:(e=this.sub(t.mul(i)),s=i.add(e.div(t)));if(t.eq(b))return this.unsigned?a:f;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();s=f}for(e=this;e.gte(t);){for(var o=Math.ceil(Math.log(i=Math.max(1,Math.floor(e.toNumber()/t.toNumber())))/Math.LN2),h=o<=48?1:n(2,o-48),u=fromNumber(i),g=u.mul(t);g.isNegative()||g.gt(e);)i-=h,g=(u=fromNumber(i,this.unsigned)).mul(t);u.isZero()&&(u=l),s=s.add(u),e=e.sub(g)}return s},v.div=v.divide,v.modulo=function(t){return(isLong(t)||(t=fromValue(t)),r)?fromBits((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},v.mod=v.modulo,v.rem=v.modulo,v.not=function(){return fromBits(~this.low,~this.high,this.unsigned)},v.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},v.clz=v.countLeadingZeros,v.countTrailingZeros=function(){return this.low?ctz32(this.low):ctz32(this.high)+32},v.ctz=v.countTrailingZeros,v.and=function(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low&t.low,this.high&t.high,this.unsigned)},v.or=function(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low|t.low,this.high|t.high,this.unsigned)},v.xor=function(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low^t.low,this.high^t.high,this.unsigned)},v.shiftLeft=function(t){return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:t<32?fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):fromBits(0,this.low<<t-32,this.unsigned)},v.shl=v.shiftLeft,v.shiftRight=function(t){return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:t<32?fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},v.shr=v.shiftRight,v.shiftRightUnsigned=function(t){return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:t<32?fromBits(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):32===t?fromBits(this.high,0,this.unsigned):fromBits(this.high>>>t-32,0,this.unsigned)},v.shru=v.shiftRightUnsigned,v.shr_u=v.shiftRightUnsigned,v.rotateLeft=function(t){var r;return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:32===t?fromBits(this.high,this.low,this.unsigned):t<32?(r=32-t,fromBits(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,fromBits(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))},v.rotl=v.rotateLeft,v.rotateRight=function(t){var r;return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:32===t?fromBits(this.high,this.low,this.unsigned):t<32?(r=32-t,fromBits(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,fromBits(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))},v.rotr=v.rotateRight,v.toSigned=function(){return this.unsigned?fromBits(this.low,this.high,!1):this},v.toUnsigned=function(){return this.unsigned?this:fromBits(this.low,this.high,!0)},v.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},v.toBytesLE=function(){var t=this.high,r=this.low;return[255&r,r>>>8&255,r>>>16&255,r>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},v.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,r>>>24,r>>>16&255,r>>>8&255,255&r]},Long.fromBytes=function(t,r,i){return i?Long.fromBytesLE(t,r):Long.fromBytesBE(t,r)},Long.fromBytesLE=function(t,r){return new Long(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)},Long.fromBytesBE=function(t,r){return new Long(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)},"function"==typeof BigInt&&(Long.fromBigInt=function(t,r){return fromBits(Number(BigInt.asIntN(32,t)),Number(BigInt.asIntN(32,t>>BigInt(32))),r)},Long.fromValue=function(t,r){return"bigint"==typeof t?Long.fromBigInt(t,r):fromValue(t,r)},v.toBigInt=function(){var t=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|t}),t.default=Long})},"./protobufjs/minimal.js"(t,r,i){"use strict";t.exports=i("./protobufjs/src/index-minimal.js")},"./protobufjs/src/index-minimal.js"(t,r,i){"use strict";function configure(){r.util.LongBits._configure(r.util.Long),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=i("./protobufjs/src/writer.js"),r.BufferWriter=i("./protobufjs/src/writer_buffer.js"),r.Reader=i("./protobufjs/src/reader.js"),r.BufferReader=i("./protobufjs/src/reader_buffer.js"),r.util=i("./protobufjs/src/util/minimal.js"),r.rpc=i("./protobufjs/src/rpc.js"),r.roots=i("./protobufjs/src/roots.js"),r.configure=configure,configure()},"./protobufjs/src/reader.js"(t,r,i){"use strict";t.exports=Reader;var e,n=i("./protobufjs/src/util/minimal.js"),s=n.LongBits,o=n.utf8;function indexOutOfRange(t,r){return RangeError("index out of range: "+t.pos+" + "+(r||1)+" > "+t.len)}function Reader(t){this.buf=t,this.pos=0,this.len=t.length,this.view=null,this.discardUnknown=Reader.discardUnknown}function create_array(t){if(Array.isArray(t)&&(t=new Uint8Array(t)),t instanceof Uint8Array)return new Reader(t);throw Error("illegal buffer")}var create=function(){return n.Buffer?function(t){return(Reader.create=function(t){return n.Buffer.isBuffer(t)?new e(t):create_array(t)})(t)}:create_array};function readVarint32NearEnd(t){for(var r=0,i=0;i<4&&!(t.pos>=t.len);++i){var e=t.buf[t.pos++];if(r=(r|(127&e)<<7*i)>>>0,e<128)return r}throw indexOutOfRange(t)}function readLongVarint(){var t=new s(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*r)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;r=0}else{for(;r<4&&!(this.pos>=this.len);++r)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*r)>>>0,this.buf[this.pos++]<128)return t;throw indexOutOfRange(this)}if(this.len-this.pos>4){for(;r<5;++r)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*r+3)>>>0,this.buf[this.pos++]<128)return t}else for(;r<5;++r){if(this.pos>=this.len)throw indexOutOfRange(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*r+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function readFixed32_end(t,r){return(t[r-4]|t[r-3]<<8|t[r-2]<<16|t[r-1]<<24)>>>0}function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new s(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}function getLazyView(t,r,i){var e=t.view;if(e||r<i)return e;var n=t.buf;return t.view=new DataView(n.buffer,n.byteOffset,n.byteLength)}Reader.create=create(),Reader.prototype.raw=function(t,r){return this.buf.subarray(t,r)},Reader.prototype.uint32=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw indexOutOfRange(this);if(this.buf[this.pos]>=128)return readVarint32NearEnd(this)}var t=this.buf,r=this.pos,i=(127&t[r])>>>0;if(t[r++]<128||(i=(i|(127&t[r])<<7)>>>0,t[r++]<128)||(i=(i|(127&t[r])<<14)>>>0,t[r++]<128)||(i=(i|(127&t[r])<<21)>>>0,t[r++]<128)||(i=(i|(15&t[r])<<28)>>>0,t[r++]<128))return this.pos=r,i;for(var e=0;e<5;++e){if(r>=this.len)throw this.pos=r,indexOutOfRange(this);if(t[r++]<128)return this.pos=r,i}throw this.pos=r,Error("invalid varint encoding")},Reader.prototype.tag=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw indexOutOfRange(this);if(this.buf[this.pos]>=128)return readVarint32NearEnd(this)}var t=this.buf,r=this.pos,i=(127&t[r])>>>0;if(t[r++]<128||(i=(i|(127&t[r])<<7)>>>0,t[r++]<128)||(i=(i|(127&t[r])<<14)>>>0,t[r++]<128)||(i=(i|(127&t[r])<<21)>>>0,t[r++]<128))return this.pos=r,i;if(i=(i|(15&t[r])<<28)>>>0,t[r]<128&&(112&t[r])==0)return this.pos=r+1,i;throw this.pos=r+1,Error("invalid tag encoding")},Reader.prototype.int32=function(){return 0|this.uint32()},Reader.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)},Reader.prototype.bool=function(){for(var t,r=!1,i=0;i<10;++i){if(this.pos>=this.len)throw indexOutOfRange(this);if(127&(t=this.buf[this.pos++])&&(r=!0),t<128)return r}throw Error("invalid varint encoding")},Reader.prototype.fixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.sfixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return 0|readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.float=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var t=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},Reader.prototype.double=function(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var t=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},Reader.prototype.uint32s=function(t){void 0===t&&(t=[]);var r,i=this.uint32()+this.pos,e=this.len,n=this.buf,s=this.pos;if(i>e)throw indexOutOfRange(this,i-this.pos);for(this.len=i;s<i;)(r=n[s++])<128?t.push(r):(this.pos=s-1,t.push(this.uint32()),s=this.pos);if(this.pos=s,s!==i)throw RangeError("index out of range");return this.len=e,t},Reader.prototype.int32s=function(t){void 0===t&&(t=[]);var r,i=this.uint32()+this.pos,e=this.len,n=this.buf,s=this.pos;if(i>e)throw indexOutOfRange(this,i-this.pos);for(this.len=i;s<i;)(r=n[s++])<128?t.push(r):(this.pos=s-1,t.push(this.int32()),s=this.pos);if(this.pos=s,s!==i)throw RangeError("index out of range");return this.len=e,t},Reader.prototype.sint32s=function(t){void 0===t&&(t=[]);var r=this.uint32()+this.pos,i=this.len;if(r>i)throw indexOutOfRange(this,r-this.pos);for(this.len=r;this.pos<r;)t.push(this.sint32());if(this.pos!==r)throw RangeError("index out of range");return this.len=i,t},Reader.prototype.bools=function(t){void 0===t&&(t=[]);var r,i=this.uint32()+this.pos,e=this.len,n=this.buf,s=this.pos;if(i>e)throw indexOutOfRange(this,i-this.pos);for(this.len=i;s<i;)(r=n[s++])<128?t.push(0!==r):(this.pos=s-1,t.push(this.bool()),s=this.pos);if(this.pos=s,s!==i)throw RangeError("index out of range");return this.len=e,t},Reader.prototype.fixed32s=function(t){void 0===t&&(t=[]);var r=this.uint32(),i=this.pos+r;if(i>this.len)throw indexOutOfRange(this,r);var e=r>>>2,n=t.length,s=this.pos;t.length=n+e;var o=getLazyView(this,e,128);if(o)for(var h=0;h<e;++h,s+=4)t[n++]=o.getUint32(s,!0);else for(var u=this.buf,f=0;f<e;++f,s+=4)t[n++]=readFixed32_end(u,s+4);if(this.pos=s,s!==i)throw indexOutOfRange(this,4);return t},Reader.prototype.sfixed32s=function(t){void 0===t&&(t=[]);var r=this.uint32(),i=this.pos+r;if(i>this.len)throw indexOutOfRange(this,r);var e=r>>>2,n=t.length,s=this.pos;t.length=n+e;var o=getLazyView(this,e,128);if(o)for(var h=0;h<e;++h,s+=4)t[n++]=o.getInt32(s,!0);else for(var u=this.buf,f=0;f<e;++f,s+=4)t[n++]=0|readFixed32_end(u,s+4);if(this.pos=s,s!==i)throw indexOutOfRange(this,4);return t},Reader.prototype.floats=function(t){void 0===t&&(t=[]);var r=this.uint32(),i=this.pos+r;if(i>this.len)throw indexOutOfRange(this,r);var e=r>>>2,s=t.length,o=this.pos;t.length=s+e;var h=getLazyView(this,e,8);if(h)for(var u=0;u<e;++u,o+=4)t[s++]=h.getFloat32(o,!0);else for(var f=this.buf,a=0;a<e;++a,o+=4)t[s++]=n.float.readFloatLE(f,o);if(this.pos=o,o!==i)throw indexOutOfRange(this,4);return t},Reader.prototype.doubles=function(t){void 0===t&&(t=[]);var r=this.uint32(),i=this.pos+r;if(i>this.len)throw indexOutOfRange(this,r);var e=r>>>3,s=t.length,o=this.pos;t.length=s+e;var h=getLazyView(this,e,8);if(h)for(var u=0;u<e;++u,o+=8)t[s++]=h.getFloat64(o,!0);else for(var f=this.buf,a=0;a<e;++a,o+=8)t[s++]=n.float.readDoubleLE(f,o);if(this.pos=o,o!==i)throw indexOutOfRange(this,8);return t},Reader.prototype.uint64s=function(t){void 0===t&&(t=[]);var r=this.uint32()+this.pos,i=this.len;if(r>i)throw indexOutOfRange(this,r-this.pos);for(this.len=r;this.pos<r;)t.push(this.uint64());if(this.pos!==r)throw RangeError("index out of range");return this.len=i,t},Reader.prototype.int64s=function(t){void 0===t&&(t=[]);var r=this.uint32()+this.pos,i=this.len;if(r>i)throw indexOutOfRange(this,r-this.pos);for(this.len=r;this.pos<r;)t.push(this.int64());if(this.pos!==r)throw RangeError("index out of range");return this.len=i,t},Reader.prototype.sint64s=function(t){void 0===t&&(t=[]);var r=this.uint32()+this.pos,i=this.len;if(r>i)throw indexOutOfRange(this,r-this.pos);for(this.len=r;this.pos<r;)t.push(this.sint64());if(this.pos!==r)throw RangeError("index out of range");return this.len=i,t},Reader.prototype.fixed64s=function(t){void 0===t&&(t=[]);var r=this.uint32(),i=this.pos+r,e=t.length;if(i>this.len)throw indexOutOfRange(this,r);var n=r>>>3;t.length=e+n;for(var s=0;s<n;++s)t[e++]=this.fixed64();if(this.pos!==i)throw indexOutOfRange(this,8);return t},Reader.prototype.sfixed64s=function(t){void 0===t&&(t=[]);var r=this.uint32(),i=this.pos+r,e=t.length;if(i>this.len)throw indexOutOfRange(this,r);var n=r>>>3;t.length=e+n;for(var s=0;s<n;++s)t[e++]=this.sfixed64();if(this.pos!==i)throw indexOutOfRange(this,8);return t},Reader.prototype.bytes=function(){var t=this.uint32(),r=this.pos,i=this.pos+t;if(i>this.len)throw indexOutOfRange(this,t);return this.pos=i,this.raw(r,i)},Reader.prototype.string=function(){var t=this.uint32(),r=this.pos,i=this.pos+t;if(i>this.len)throw indexOutOfRange(this,t);return this.pos=i,o.read(this.buf,r,i)},Reader.prototype.stringVerify=function(){var t=this.uint32(),r=this.pos,i=this.pos+t;if(i>this.len)throw indexOutOfRange(this,t);return this.pos=i,o.readStrict(this.buf,r,i)},Reader.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw indexOutOfRange(this,t);this.pos+=t}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(128&this.buf[this.pos++]);return this},Reader.recursionLimit=n.recursionLimit,Reader.discardUnknown=!0,Reader.prototype.skipType=function(t,r,i){if(void 0===r&&(r=0),r>Reader.recursionLimit)throw Error("max depth exceeded");if(0===i)throw Error("illegal tag: field number 0");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(),n=e>>>3;if(t=7&e,!n)throw Error("illegal tag: field number 0");if(4===t){if(void 0!==i&&n!==i)throw Error("invalid end group tag");break}this.skipType(t,r+1,n)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},Reader._configure=function(t){e=t,Reader.create=create(),e._configure();var r=n.Long?"toLong":"toNumber";n.merge(Reader.prototype,{int64:function(){return readLongVarint.call(this)[r](!1)},uint64:function(){return readLongVarint.call(this)[r](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[r](!1)},fixed64:function(){return readFixed64.call(this)[r](!0)},sfixed64:function(){return readFixed64.call(this)[r](!1)}})}},"./protobufjs/src/reader_buffer.js"(t,r,i){"use strict";t.exports=BufferReader;var e=i("./protobufjs/src/reader.js");BufferReader.prototype=Object.create(e.prototype,{constructor:{value:BufferReader,writable:!0,enumerable:!1,configurable:!0}});var n=i("./protobufjs/src/util/minimal.js");function BufferReader(t){e.call(this,t)}BufferReader._configure=function(){n.Buffer&&(BufferReader.prototype._slice=n.Buffer.prototype.slice)},BufferReader.prototype.raw=function(t,r){return this._slice.call(this.buf,t,r)},BufferReader.prototype.string=function(){var t=this.uint32(),r=this.pos,i=this.pos+t;if(i>this.len)throw RangeError("index out of range: "+this.pos+" + "+t+" > "+this.len);return this.pos=i,this.buf.utf8Slice?this.buf.utf8Slice(r,i):this.buf.toString("utf-8",r,i)},BufferReader._configure()},"./protobufjs/src/roots.js"(t){"use strict";t.exports=Object.create(null)},"./protobufjs/src/rpc.js"(t,r,i){"use strict";r.Service=i("./protobufjs/src/rpc/service.js")},"./protobufjs/src/rpc/service.js"(t,r,i){"use strict";t.exports=Service;var e=i("./protobufjs/src/util/minimal.js");function Service(t,r,i){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!r,this.responseDelimited=!!i}Service.prototype=Object.create(e.EventEmitter.prototype,{constructor:{value:Service,writable:!0,enumerable:!1,configurable:!0}}),Service.prototype.rpcCall=function rpcCall(t,r,i,n,s){if(!n)throw TypeError("request must be specified");var o=this;if(!s)return e.asPromise(rpcCall,o,t,r,i,n);if(!o.rpcImpl)return void setTimeout(function(){s(Error("already ended"))},0);try{return o.rpcImpl(t,r[o.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(r,e){if(r)return o.emit("error",r,t),s(r);if(null===e)return void o.end(!0);if(!(e instanceof i))try{e=i[o.responseDelimited?"decodeDelimited":"decode"](e)}catch(r){return o.emit("error",r,t),s(r)}return o.emit("data",e,t),s(null,e)})}catch(r){o.emit("error",r,t),setTimeout(function(){s(r)},0);return}},Service.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},"./protobufjs/src/util/aspromise.js"(t){"use strict";t.exports=function asPromise(t,r){for(var i=Array(arguments.length-1),e=0,n=2,s=!0;n<arguments.length;)i[e++]=arguments[n++];return new Promise(function(n,o){i[e]=function(t){if(s)if(s=!1,t)o(t);else{for(var r=Array(arguments.length-1),i=0;i<r.length;)r[i++]=arguments[i];n.apply(null,r)}};try{t.apply(r||null,i)}catch(t){s&&(s=!1,o(t))}})}},"./protobufjs/src/util/base64.js"(t,r){"use strict";r.length=function(t){var r=t.length;if(!r)return 0;for(;r>0&&"="===t.charAt(r-1);)--r;return Math.floor(3*r/4)};for(var i=Array(64),e=Array(123),n=0;n<64;)e[i[n]=n<26?n+65:n<52?n+71:n<62?n-4:n-59|43]=n++;e[45]=62,e[95]=63,r.encode=function(t,r,e){for(var n,s=null,o=[],h=0,u=0;r<e;){var f=t[r++];switch(u){case 0:o[h++]=i[f>>2],n=(3&f)<<4,u=1;break;case 1:o[h++]=i[n|f>>4],n=(15&f)<<2,u=2;break;case 2:o[h++]=i[n|f>>6],o[h++]=i[63&f],u=0}h>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),h=0)}return(u&&(o[h++]=i[n],o[h++]=61,1===u&&(o[h++]=61)),s)?(h&&s.push(String.fromCharCode.apply(String,o.slice(0,h))),s.join("")):String.fromCharCode.apply(String,o.slice(0,h))};var s="invalid encoding";r.decode=function(t,r,i){for(var n,o=i,h=0,u=0;u<t.length;){var f=t.charCodeAt(u++);if(61===f&&h>1)break;if(void 0===(f=e[f]))throw Error(s);switch(h){case 0:n=f,h=1;break;case 1:r[i++]=n<<2|(48&f)>>4,n=f,h=2;break;case 2:r[i++]=(15&n)<<4|(60&f)>>2,n=f,h=3;break;case 3:r[i++]=(3&n)<<6|f,h=0}}if(1===h)throw Error(s);return i-o};var o=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,h=/[-_]/,u=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;r.test=function(t){return o.test(t)||h.test(t)&&u.test(t)}},"./protobufjs/src/util/eventemitter.js"(t){"use strict";function EventEmitter(){this._listeners=Object.create(null)}t.exports=EventEmitter,EventEmitter.prototype.on=function(t,r,i){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:r,ctx:i||this}),this},EventEmitter.prototype.off=function(t,r){if(void 0===t)this._listeners=Object.create(null);else if(void 0===r)this._listeners[t]=[];else{var i=this._listeners[t];if(!i)return this;for(var e=0;e<i.length;)i[e].fn===r?i.splice(e,1):++e}return this},EventEmitter.prototype.emit=function(t){var r=this._listeners[t];if(r){for(var i=[],e=1;e<arguments.length;)i.push(arguments[e++]);for(e=0;e<r.length;)r[e].fn.apply(r[e++].ctx,i)}return this}},"./protobufjs/src/util/float.js"(t){"use strict";function factory(t){if("u">typeof Float32Array)!function(){var r=new Float32Array([-0]),i=new Uint8Array(r.buffer),e=128===i[3];function writeFloat_f32_cpy(t,e,n){r[0]=t,e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3]}function writeFloat_f32_rev(t,e,n){r[0]=t,e[n]=i[3],e[n+1]=i[2],e[n+2]=i[1],e[n+3]=i[0]}function readFloat_f32_cpy(t,e){return i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],r[0]}function readFloat_f32_rev(t,e){return i[3]=t[e],i[2]=t[e+1],i[1]=t[e+2],i[0]=t[e+3],r[0]}t.writeFloatLE=e?writeFloat_f32_cpy:writeFloat_f32_rev,t.writeFloatBE=e?writeFloat_f32_rev:writeFloat_f32_cpy,t.readFloatLE=e?readFloat_f32_cpy:readFloat_f32_rev,t.readFloatBE=e?readFloat_f32_rev:readFloat_f32_cpy}();else{function writeFloat_ieee754(t,r,i,e){var n=+(r<0);if(n&&(r=-r),0===r)t(1/r>0?0:0x80000000,i,e);else if(isNaN(r))t(0x7fc00000,i,e);else if(r>34028234663852886e22)t((n<<31|0x7f800000)>>>0,i,e);else if(r<11754943508222875e-54)t((n<<31|Math.round(r/1401298464324817e-60))>>>0,i,e);else{var s=Math.floor(Math.log(r)/Math.LN2),o=8388607&Math.round(r*Math.pow(2,-s)*8388608);t((n<<31|s+127<<23|o)>>>0,i,e)}}function readFloat_ieee754(t,r,i){var e=t(r,i),n=(e>>31)*2+1,s=e>>>23&255,o=8388607&e;return 255===s?o?NaN:1/0*n:0===s?1401298464324817e-60*n*o:n*Math.pow(2,s-150)*(o+8388608)}t.writeFloatLE=writeFloat_ieee754.bind(null,writeUintLE),t.writeFloatBE=writeFloat_ieee754.bind(null,writeUintBE),t.readFloatLE=readFloat_ieee754.bind(null,readUintLE),t.readFloatBE=readFloat_ieee754.bind(null,readUintBE)}if("u">typeof Float64Array)!function(){var r=new Float64Array([-0]),i=new Uint8Array(r.buffer),e=128===i[7];function writeDouble_f64_cpy(t,e,n){r[0]=t,e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7]}function writeDouble_f64_rev(t,e,n){r[0]=t,e[n]=i[7],e[n+1]=i[6],e[n+2]=i[5],e[n+3]=i[4],e[n+4]=i[3],e[n+5]=i[2],e[n+6]=i[1],e[n+7]=i[0]}function readDouble_f64_cpy(t,e){return i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],i[4]=t[e+4],i[5]=t[e+5],i[6]=t[e+6],i[7]=t[e+7],r[0]}function readDouble_f64_rev(t,e){return i[7]=t[e],i[6]=t[e+1],i[5]=t[e+2],i[4]=t[e+3],i[3]=t[e+4],i[2]=t[e+5],i[1]=t[e+6],i[0]=t[e+7],r[0]}t.writeDoubleLE=e?writeDouble_f64_cpy:writeDouble_f64_rev,t.writeDoubleBE=e?writeDouble_f64_rev:writeDouble_f64_cpy,t.readDoubleLE=e?readDouble_f64_cpy:readDouble_f64_rev,t.readDoubleBE=e?readDouble_f64_rev:readDouble_f64_cpy}();else{function writeDouble_ieee754(t,r,i,e,n,s){var o,h=+(e<0);if(h&&(e=-e),0===e)t(0,n,s+r),t(1/e>0?0:0x80000000,n,s+i);else if(isNaN(e))t(0,n,s+r),t(0x7ff80000,n,s+i);else if(e>17976931348623157e292)t(0,n,s+r),t((h<<31|0x7ff00000)>>>0,n,s+i);else if(e<22250738585072014e-324)t((o=e/5e-324)>>>0,n,s+r),t((h<<31|o/0x100000000)>>>0,n,s+i);else{var u=Math.floor(Math.log(e)/Math.LN2);1024===u&&(u=1023),t(0x10000000000000*(o=e*Math.pow(2,-u))>>>0,n,s+r),t((h<<31|u+1023<<20|1048576*o&1048575)>>>0,n,s+i)}}function readDouble_ieee754(t,r,i,e,n){var s=t(e,n+r),o=t(e,n+i),h=(o>>31)*2+1,u=o>>>20&2047,f=0x100000000*(1048575&o)+s;return 2047===u?f?NaN:1/0*h:0===u?5e-324*h*f:h*Math.pow(2,u-1075)*(f+0x10000000000000)}t.writeDoubleLE=writeDouble_ieee754.bind(null,writeUintLE,0,4),t.writeDoubleBE=writeDouble_ieee754.bind(null,writeUintBE,4,0),t.readDoubleLE=readDouble_ieee754.bind(null,readUintLE,0,4),t.readDoubleBE=readDouble_ieee754.bind(null,readUintBE,4,0)}return t}function writeUintLE(t,r,i){r[i]=255&t,r[i+1]=t>>>8&255,r[i+2]=t>>>16&255,r[i+3]=t>>>24}function writeUintBE(t,r,i){r[i]=t>>>24,r[i+1]=t>>>16&255,r[i+2]=t>>>8&255,r[i+3]=255&t}function readUintLE(t,r){return(t[r]|t[r+1]<<8|t[r+2]<<16|t[r+3]<<24)>>>0}function readUintBE(t,r){return(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0}t.exports=factory(factory)},"./protobufjs/src/util/longbits.js"(t){"use strict";function LongBits(t,r){this.lo=t>>>0,this.hi=r>>>0}t.exports=LongBits;var r,i=LongBits.zero=new LongBits(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var e=LongBits.zeroHash="\0\0\0\0\0\0\0\0";LongBits.fromNumber=function(t){if(0===t)return i;var r=t<0;r&&(t=-t);var e=t>>>0,n=(t-e)/0x100000000>>>0;return r&&(n=~n>>>0,e=~e>>>0,++e>0xffffffff&&(e=0,++n>0xffffffff&&(n=0))),new LongBits(e,n)},LongBits.from=function(t){if("number"==typeof t)return LongBits.fromNumber(t);if("string"==typeof t||t instanceof String)if(!r)return LongBits.fromNumber(parseInt(t,10));else t=r.fromString(t);return t.low||t.high?new LongBits(t.low>>>0,t.high>>>0):i},LongBits.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var r=~this.lo+1>>>0,i=~this.hi>>>0;return r||(i=i+1>>>0),-(r+0x100000000*i)}return this.lo+0x100000000*this.hi},LongBits.prototype.toLong=function(t){return r?new r(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var n=String.prototype.charCodeAt;LongBits.fromHash=function(t){return t===e?i:new LongBits((n.call(t,0)|n.call(t,1)<<8|n.call(t,2)<<16|n.call(t,3)<<24)>>>0,(n.call(t,4)|n.call(t,5)<<8|n.call(t,6)<<16|n.call(t,7)<<24)>>>0)},LongBits.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},LongBits.prototype.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},LongBits.prototype.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},LongBits.prototype.length=function(){var t=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===r?t<16384?t<128?1:2:t<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:i<128?9:10},LongBits._configure=function(t){r=t}},"./protobufjs/src/util/minimal.js"(t,r,i){"use strict";function isUnsafeProperty(t){return"__proto__"===t||"prototype"===t||"constructor"===t}function merge(t){var r="boolean"==typeof arguments[arguments.length-1],i=r?arguments.length-1:arguments.length;r=r&&arguments[arguments.length-1];for(var e=1;e<i;++e){var n=arguments[e];if(n)for(var s=Object.keys(n),o=0;o<s.length;++o)isUnsafeProperty(s[o])||r&&Object.prototype.hasOwnProperty.call(t,s[o])&&void 0!==t[s[o]]||(t[s[o]]=n[s[o]])}return t}function newError(t){function CustomError(t,r){if(!(this instanceof CustomError))return new CustomError(t,r);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,CustomError):Object.defineProperty(this,"stack",{value:Error().stack||""}),r&&merge(this,r)}return CustomError.prototype=Object.create(Error.prototype,{constructor:{value:CustomError,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),CustomError}r.asPromise=i("./protobufjs/src/util/aspromise.js"),r.base64=i("./protobufjs/src/util/base64.js"),r.EventEmitter=i("./protobufjs/src/util/eventemitter.js"),r.float=i("./protobufjs/src/util/float.js"),r.utf8=i("./protobufjs/src/util/utf8.js"),r.pool=i("./protobufjs/src/util/pool.js"),r.LongBits=i("./protobufjs/src/util/longbits.js"),r.isUnsafeProperty=isUnsafeProperty,r.isNode=!!("u">typeof global&&global&&global.process&&global.process.versions&&global.process.versions.node),r.global=r.isNode&&global||"u">typeof window&&window||"u">typeof self&&self||"u">typeof globalThis&&globalThis||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},r.isString=function(t){return"string"==typeof t||t instanceof String},r.isObject=function(t){return t&&"object"==typeof t},r.isset=r.isSet=function(t,r){var i=t[r];return!!(null!=i&&Object.hasOwnProperty.call(t,r))&&("object"!=typeof i||(Array.isArray(i)?i.length:Object.keys(i).length)>0)},r.Buffer=function(){try{var t=r.global.Buffer;return t.prototype.utf8Write||r.isNode?t:null}catch(t){return null}}(),r.newBuffer=function(t){var i=r.Buffer;return"number"==typeof t?i?i.allocUnsafe(t):new Uint8Array(t):i?i.from(t):new Uint8Array(t)},r.rawField=function(t,i,e){var n=[],s=t<<3|i;for(s>>>=0;s>127;)n.push(127&s|128),s>>>=7;n.push(s);for(var o=0;o<e.length;++o)n.push(e[o]);return r.newBuffer(n)},r.Array=Uint8Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||function(){try{var t=i("./long/umd/index.js");return t&&t.isLong?t:null}catch(t){return null}}(),r.key2Re=/^(?:true|false|0|1)$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(t){return t?r.LongBits.from(t).toHash():r.LongBits.zeroHash},r.longFromHash=function(t,i){var e=r.LongBits.fromHash(t);return r.Long?r.Long.fromBits(e.lo,e.hi,i):e.toNumber(!!i)},r.longFromKey=function(t,i){return r.key64Re.test(t)&&!r.key32Re.test(t)?r.longFromHash(t,i):t},r.boolFromKey=function(t){return"true"===t||"1"===t},r.merge=merge,r.nestingLimit=32,r.recursionLimit=100,r.makeProp=function(t,r,i){Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:void 0===i||i,configurable:!0,writable:!0})},r.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},r.newError=newError,r.ProtocolError=newError("ProtocolError"),r.oneOfGetter=function(t){for(var r={},i=0;i<t.length;++i)r[t[i]]=1;return function(){for(var t=Object.keys(this),i=t.length-1;i>-1;--i)if(1===r[t[i]]&&void 0!==this[t[i]]&&null!==this[t[i]])return t[i]}},r.oneOfSetter=function(t){return function(r){for(var i=0;i<t.length;++i)t[i]!==r&&delete this[t[i]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0}},"./protobufjs/src/util/pool.js"(t){"use strict";t.exports=function pool(t,r,i){var e=i||8192,n=e>>>1,s=null,o=e;return function(i){if(i<1||i>n)return t(i);o+i>e&&(s=t(e),o=0);var h=r.call(s,o,o+=i);return 7&o&&(o=(7|o)+1),h}}},"./protobufjs/src/util/utf8.js"(t,r){"use strict";var i,e=new TextDecoder("utf-8",{ignoreBOM:!0});try{i=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch(t){i=e}function utf8_read_decoder(t,r,i,e){var n=0===i&&e===r.length?r:r.subarray(i,e);return t.decode(n)}r.length=function(t){for(var r=0,i=0,e=0;e<t.length;++e)(i=t.charCodeAt(e))<128?r+=1:i<2048?r+=2:(64512&i)==55296&&(64512&t.charCodeAt(e+1))==56320?(++e,r+=4):r+=3;return r},r.read=function(t,r,i){if(i-r<1)return"";if(i-r>=64)return utf8_read_decoder(e,t,r,i);for(var n,s,o,h,u,f,a,l,p="",c=r;c+7<i;c+=8){if(n=t[c],s=t[c+1],o=t[c+2],h=t[c+3],u=t[c+4],f=t[c+5],(n|s|o|h|u|f|(a=t[c+6])|(l=t[c+7]))&128)return p+utf8_read_decoder(e,t,c,i);p+=String.fromCharCode(n,s,o,h,u,f,a,l)}for(;c<i;++c){if(128&(n=t[c]))return p+utf8_read_decoder(e,t,c,i);p+=String.fromCharCode(n)}return p},r.readStrict=function(t,r,e){if(e-r<1)return"";if(e-r>=64)return utf8_read_decoder(i,t,r,e);for(var n,s,o,h,u,f,a,l,p="",c=r;c+7<e;c+=8){if(n=t[c],s=t[c+1],o=t[c+2],h=t[c+3],u=t[c+4],f=t[c+5],(n|s|o|h|u|f|(a=t[c+6])|(l=t[c+7]))&128)return p+utf8_read_decoder(i,t,c,e);p+=String.fromCharCode(n,s,o,h,u,f,a,l)}for(;c<e;++c){if(128&(n=t[c]))return p+utf8_read_decoder(i,t,c,e);p+=String.fromCharCode(n)}return p},r.write=function(t,r,i){for(var e,n,s=i,o=0;o<t.length;++o)(e=t.charCodeAt(o))<128?r[i++]=e:(e<2048?r[i++]=e>>6|192:((64512&e)==55296&&(64512&(n=t.charCodeAt(o+1)))==56320?(e=65536+((1023&e)<<10)+(1023&n),++o,r[i++]=e>>18|240,r[i++]=e>>12&63|128):r[i++]=e>>12|224,r[i++]=e>>6&63|128),r[i++]=63&e|128);return i-s}},"./protobufjs/src/writer.js"(t,r,i){"use strict";t.exports=Writer;var e,n=i("./protobufjs/src/util/minimal.js"),s=n.LongBits,o=n.base64,h=n.utf8;function Writer(){this.pos=0,this.buf=this.constructor.alloc(Writer.initialBufferSize),this.view=null,this.states=null}Writer.initialBufferSize=128,Object.defineProperty(Writer.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var create=function(){return n.Buffer?function(){return(Writer.create=function(){return new e})()}:function(){return new Writer}};function sizeVarint32(t){return t<128?1:t<16384?2:t<2097152?3:t<0x10000000?4:5}function writeStringAscii(t,r,i){for(var e=0;e<t.length;)r[i++]=t.charCodeAt(e++)}function writeVarint32(t,r,i){for(;t>127;)r[i++]=127&t|128,t>>>=7;return r[i]=t,i+1}function writeVarint64(t,r,i){for(var e=t.lo,n=t.hi;n;)r[i++]=127&e|128,e=(e>>>7|n<<25)>>>0,n>>>=7;for(;e>127;)r[i++]=127&e|128,e>>>=7;return r[i]=e,i+1}function writeFixed32(t,r,i){r[i]=255&t,r[i+1]=t>>>8&255,r[i+2]=t>>>16&255,r[i+3]=t>>>24}function getLazyView(t,r,i){var e=t.view;if(e||r<i)return e;var n=t.buf;return t.view=new DataView(n.buffer,n.byteOffset,n.byteLength)}Writer.create=create(),Writer.alloc=function(t){return new Uint8Array(t)},Writer.alloc=n.pool(Writer.alloc,Uint8Array.prototype.subarray),Writer.prototype._reserve=function(t){var r=this.pos+t;if(r>this.buf.length){var i=this.buf.length<<1;i<r&&(i=r);var e=this.constructor.alloc(i);e.set(this.buf.subarray(0,this.pos),0),this.buf=e,this.view=null}},Writer.prototype.uint32=function(t){t>>>=0,this._reserve(5);var r=this.pos;return this.pos=writeVarint32(t,this.buf,r),this},Writer.prototype.int32=function(t){return(t|=0)<0?(this._reserve(10),writeVarint64(s.fromNumber(t),this.buf,this.pos),this.pos+=10,this):this.uint32(t)},Writer.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},Writer.prototype.uint64=function(t){var r=s.from(t);this._reserve(10);var i=this.pos;return this.pos=writeVarint64(r,this.buf,i),this},Writer.prototype.int64=Writer.prototype.uint64,Writer.prototype.sint64=function(t){var r=s.from(t).zzEncode();this._reserve(10);var i=this.pos;return this.pos=writeVarint64(r,this.buf,i),this},Writer.prototype.bool=function(t){return this._reserve(1),this.buf[this.pos++]=+!!t,this},Writer.prototype.fixed32=function(t){return this._reserve(4),writeFixed32(t>>>0,this.buf,this.pos),this.pos+=4,this},Writer.prototype.sfixed32=Writer.prototype.fixed32,Writer.prototype.fixed64=function(t){var r=s.from(t);return this._reserve(8),writeFixed32(r.lo,this.buf,this.pos),writeFixed32(r.hi,this.buf,this.pos+4),this.pos+=8,this},Writer.prototype.sfixed64=Writer.prototype.fixed64,Writer.prototype.float=function(t){return this._reserve(4),n.float.writeFloatLE(t,this.buf,this.pos),this.pos+=4,this},Writer.prototype.double=function(t){return this._reserve(8),n.float.writeDoubleLE(t,this.buf,this.pos),this.pos+=8,this},Writer.prototype.bytes=function(t){var r=t.length>>>0;if(!r)return this._reserve(1),this.buf[this.pos++]=0,this;if(n.isString(t)){var i=Writer.alloc(r=o.length(t));o.decode(t,i,0),t=i}return this.uint32(r),this._reserve(r),this.buf.set(t,this.pos),this.pos+=r,this},Writer.prototype.raw=function(t){var r=t.length>>>0;return r&&(this._reserve(r),this.buf.set(t,this.pos),this.pos+=r),this},Writer.prototype._delim=function(t,r){var i=sizeVarint32(r);return i>1&&this.buf.copyWithin(t+i,t+1,t+1+r),writeVarint32(r,this.buf,t),this.pos=t+i+r,this},Writer.prototype.string=function(t){var r=t.length;if(!r)return this._reserve(1),this.buf[this.pos++]=0,this;if(r<128){this._reserve(3*r+5);var i=this.pos;return this._delim(i,h.write(t,this.buf,i+1))}var e=h.length(t);return this.uint32(e),this._reserve(e),e===t.length?writeStringAscii(t,this.buf,this.pos):h.write(t,this.buf,this.pos),this.pos+=e,this},Writer.prototype.uint32s=function(t){var r=t.length;this._reserve(5*r+5);for(var i=this.buf,e=this.pos,n=e+1,s=0;s<r;++s)n=writeVarint32(t[s]>>>0,i,n);return this._delim(e,n-e-1)},Writer.prototype.int32s=function(t){var r=t.length;this._reserve(10*r+5);for(var i,e=this.buf,n=this.pos,o=n+1,h=0;h<r;++h)o=(i=0|t[h])<0?writeVarint64(s.fromNumber(i),e,o):writeVarint32(i,e,o);return this._delim(n,o-n-1)},Writer.prototype.sint32s=function(t){var r=t.length;this._reserve(5*r+5);for(var i=this.buf,e=this.pos,n=e+1,s=0;s<r;++s)n=writeVarint32((t[s]<<1^t[s]>>31)>>>0,i,n);return this._delim(e,n-e-1)},Writer.prototype.uint64s=function(t){var r=t.length;this._reserve(10*r+5);for(var i=this.buf,e=this.pos,n=e+1,o=0;o<r;++o)n=writeVarint64(s.from(t[o]),i,n);return this._delim(e,n-e-1)},Writer.prototype.int64s=Writer.prototype.uint64s,Writer.prototype.sint64s=function(t){var r=t.length;this._reserve(10*r+5);for(var i=this.buf,e=this.pos,n=e+1,o=0;o<r;++o)n=writeVarint64(s.from(t[o]).zzEncode(),i,n);return this._delim(e,n-e-1)},Writer.prototype.bools=function(t){var r=t.length;this.uint32(r),this._reserve(r);for(var i=this.buf,e=this.pos,n=0;n<r;++n)i[e++]=+!!t[n];return this.pos+=r,this},Writer.prototype.fixed32s=function(t){var r=t.length,i=4*r;this.uint32(i),this._reserve(i);var e,n=this.pos,s=getLazyView(this,r,128);if(s)for(e=0;e<r;++e)s.setUint32(n,t[e]>>>0,!0),n+=4;else{var o=this.buf;for(e=0;e<r;++e)writeFixed32(t[e]>>>0,o,n),n+=4}return this.pos+=i,this},Writer.prototype.sfixed32s=Writer.prototype.fixed32s,Writer.prototype.fixed64s=function(t){var r=t.length,i=8*r;this.uint32(i),this._reserve(i);var e,n,o=this.pos,h=getLazyView(this,r,128);if(h)for(e=0;e<r;++e)n=s.from(t[e]),h.setUint32(o,n.lo,!0),h.setUint32(o+4,n.hi,!0),o+=8;else{var u=this.buf;for(e=0;e<r;++e)writeFixed32((n=s.from(t[e])).lo,u,o),writeFixed32(n.hi,u,o+4),o+=8}return this.pos+=i,this},Writer.prototype.sfixed64s=Writer.prototype.fixed64s,Writer.prototype.floats=function(t){var r=t.length,i=4*r;this.uint32(i),this._reserve(i);var e,s=this.pos,o=getLazyView(this,r,16);if(o)for(e=0;e<r;++e)o.setFloat32(s,t[e],!0),s+=4;else{var h=this.buf;for(e=0;e<r;++e)n.float.writeFloatLE(t[e],h,s),s+=4}return this.pos+=i,this},Writer.prototype.doubles=function(t){var r=t.length,i=8*r;this.uint32(i),this._reserve(i);var e,s=this.pos,o=getLazyView(this,r,16);if(o)for(e=0;e<r;++e)o.setFloat64(s,t[e],!0),s+=8;else{var h=this.buf;for(e=0;e<r;++e)n.float.writeDoubleLE(t[e],h,s),s+=8}return this.pos+=i,this},Writer.prototype.fork=function(){return this._reserve(1),(this.states||(this.states=[])).push(this.pos),this.pos+=1,this},Writer.prototype.reset=function(){var t=this.states;return t&&t.length?this.pos=t.pop():this.pos=0,this},Writer.prototype.ldelim=function(){var t,r,i=this.states;if(i&&i.length){var e=i.pop();(r=sizeVarint32(t=this.pos-e-1))>1?(this._reserve(r-1),this.buf.copyWithin(e+r,e+1,e+1+t),this.pos+=r-1,writeVarint32(t,this.buf,e)):this.buf[e]=t}else r=sizeVarint32(t=this.pos),this._reserve(r),this.buf.copyWithin(r,0,t),writeVarint32(t,this.buf,0),this.pos+=r;return this},Writer.prototype.finish=function(t){if(t)return this.buf.subarray(0,this.pos);var r=this.constructor.alloc(this.pos);return r.set(this.buf.subarray(0,this.pos),0),r},Writer.prototype.finishInto=function(t,r){return void 0===r&&(r=0),t.set(this.buf.subarray(0,this.pos),r),t},Writer._configure=function(t){e=t,Writer.create=create(),e._configure()}},"./protobufjs/src/writer_buffer.js"(t,r,i){"use strict";t.exports=BufferWriter;var e,n=i("./protobufjs/src/writer.js");BufferWriter.prototype=Object.create(n.prototype,{constructor:{value:BufferWriter,writable:!0,enumerable:!1,configurable:!0}});var s=i("./protobufjs/src/util/minimal.js");function BufferWriter(){n.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=s.Buffer&&s.Buffer.allocUnsafe,e=s.Buffer&&s.Buffer.prototype.utf8Write?function(t,r,i){return r.utf8Write(t,i)}:function(t,r,i){return r.write(t,i)}},BufferWriter.prototype.bytes=function(t){s.isString(t)&&(t=s.Buffer.from(t,"base64"));var r=t.length>>>0;return this.uint32(r),r&&(this._reserve(r),this.buf.set(t,this.pos),this.pos+=r),this},BufferWriter.prototype.string=function(t){var r=t.length;if(!r)return this._reserve(1),this.buf[this.pos++]=0,this;if(r<128){this._reserve(3*r+5);var i=this.pos,n=this.buf;return this._delim(i,r<40?s.utf8.write(t,n,i+1):e(t,n,i+1))}var o=s.Buffer.byteLength(t);return this.uint32(o),this._reserve(o),e(t,this.buf,this.pos),this.pos+=o,this},BufferWriter._configure()}},r={};function __webpack_require__(i){var e=r[i];if(void 0!==e)return e.exports;var n=r[i]={exports:{}};return t[i].call(n.exports,n,n.exports,__webpack_require__),n.exports}var i=__webpack_require__("./protobufjs/minimal.js");module.exports=i})();
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
// Serialized into chromium via Playwright's `page.evaluate`. Excluded from coverage by filename.
|
|
4
|
-
// Rename only if you update that glob too.
|
|
5
|
-
|
|
6
|
-
/** @returns {{ isRumInstrumented: boolean, isRumActive: boolean, rumSamplingRate: number | null }} */
|
|
7
|
-
function detectRum () {
|
|
8
|
-
const isRumInstrumented = !!window.DD_RUM
|
|
9
|
-
const isRumActive = window.DD_RUM && window.DD_RUM.getInternalContext
|
|
10
|
-
? !!window.DD_RUM.getInternalContext()
|
|
11
|
-
: false
|
|
12
|
-
const rumSamplingRate = window.DD_RUM && window.DD_RUM.getInitConfiguration
|
|
13
|
-
? window.DD_RUM.getInitConfiguration().sessionSampleRate
|
|
14
|
-
: null
|
|
15
|
-
return { isRumInstrumented, isRumActive, rumSamplingRate }
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/** @returns {boolean} */
|
|
19
|
-
function stopRumSession () {
|
|
20
|
-
if (window.DD_RUM && window.DD_RUM.stopSession) {
|
|
21
|
-
window.DD_RUM.stopSession()
|
|
22
|
-
return true
|
|
23
|
-
}
|
|
24
|
-
return false
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
module.exports = { detectRum, stopRumSession }
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const log = require('../log')
|
|
4
|
-
const { TOP_LEVEL_KEY } = require('../constants')
|
|
5
|
-
const { normalizeSpan } = require('./tags-processors')
|
|
6
|
-
const { stringifySpanEvents } = require('./0.4')
|
|
7
|
-
|
|
8
|
-
// Soft limit for estimated payload size. Triggers an early flush to stay under intake request size limits.
|
|
9
|
-
const SOFT_LIMIT = 8 * 1024 * 1024 // 8MB
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Formats a span for JSON encoding.
|
|
13
|
-
* @param {object} span - The span to format
|
|
14
|
-
* @param {boolean} isFirstSpan - Whether this is the first span in the trace
|
|
15
|
-
* @returns {object} The formatted span
|
|
16
|
-
*/
|
|
17
|
-
function formatSpan (span, isFirstSpan) {
|
|
18
|
-
span = normalizeSpan(span)
|
|
19
|
-
|
|
20
|
-
// Remove _dd.p.tid (the upper 64 bits of a 128-bit trace ID) since trace_id is truncated to lower 64 bits
|
|
21
|
-
delete span.meta['_dd.p.tid']
|
|
22
|
-
|
|
23
|
-
if (span.span_events) {
|
|
24
|
-
// Events arrive raw (`{ name, startTime, attributes? }`); stringifySpanEvents
|
|
25
|
-
// derives `time_unix_nano` and drops empty attributes, matching the JSON the
|
|
26
|
-
// reshaped array used to produce.
|
|
27
|
-
span.meta.events = stringifySpanEvents(span.span_events)
|
|
28
|
-
delete span.span_events
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (isFirstSpan) {
|
|
32
|
-
span.meta['_dd.compute_stats'] = '1'
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (span.parent_id?.toString(10) === '0') {
|
|
36
|
-
span.metrics._trace_root = 1
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (span.metrics[TOP_LEVEL_KEY]) {
|
|
40
|
-
span.metrics._top_level = 1
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return span
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Converts a span to JSON-serializable format.
|
|
48
|
-
* IDs are converted to lowercase hex strings. Start time is converted from
|
|
49
|
-
* nanoseconds to seconds for the intake format.
|
|
50
|
-
* @param {object} span - The formatted span
|
|
51
|
-
* @returns {object} JSON-serializable span object
|
|
52
|
-
*/
|
|
53
|
-
function spanToJSON (span) {
|
|
54
|
-
const result = {
|
|
55
|
-
trace_id: span.trace_id.toString(16).toLowerCase().slice(-16),
|
|
56
|
-
span_id: span.span_id.toString(16).toLowerCase(),
|
|
57
|
-
parent_id: span.parent_id.toString(16).toLowerCase(),
|
|
58
|
-
name: span.name,
|
|
59
|
-
resource: span.resource,
|
|
60
|
-
service: span.service,
|
|
61
|
-
error: span.error,
|
|
62
|
-
start: Math.floor(span.start / 1e9),
|
|
63
|
-
duration: span.duration,
|
|
64
|
-
meta: span.meta,
|
|
65
|
-
metrics: span.metrics,
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (span.type) {
|
|
69
|
-
result.type = span.type
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (span.meta_struct) {
|
|
73
|
-
result.meta_struct = span.meta_struct
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (span.links && span.links.length > 0) {
|
|
77
|
-
result.links = span.links
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return result
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* JSON encoder for agentless trace intake.
|
|
85
|
-
* Encodes multiple traces as JSON with the payload format: {"traces": [{spans: [...], ...metadata}, ...]}
|
|
86
|
-
*
|
|
87
|
-
* Traces are accumulated until flushed (timer-based, size-based, or explicit).
|
|
88
|
-
*/
|
|
89
|
-
class AgentlessJSONEncoder {
|
|
90
|
-
/**
|
|
91
|
-
* @param {object} writer - Writer instance with a flush() method, called when the buffer exceeds the soft limit
|
|
92
|
-
* @param {object} [metadata] - Shared metadata spread into each trace object (hostname, env, tracerVersion, etc.)
|
|
93
|
-
* @param {number} [softLimit] - Estimated payload-size threshold that triggers an early flush. Defaults to 8 MiB.
|
|
94
|
-
*/
|
|
95
|
-
constructor (writer, metadata = {}, softLimit = SOFT_LIMIT) {
|
|
96
|
-
this._writer = writer
|
|
97
|
-
this._metadata = metadata
|
|
98
|
-
this._softLimit = softLimit
|
|
99
|
-
this._reset()
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Returns the number of traces encoded.
|
|
104
|
-
* @returns {number}
|
|
105
|
-
*/
|
|
106
|
-
count () {
|
|
107
|
-
return this._traceCount
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Encodes a trace (array of spans) and adds it to the pending batch.
|
|
112
|
-
* @param {object[]} trace - Array of spans to encode
|
|
113
|
-
*/
|
|
114
|
-
encode (trace) {
|
|
115
|
-
const spanStrings = []
|
|
116
|
-
let traceSize = 0
|
|
117
|
-
|
|
118
|
-
for (const span of trace) {
|
|
119
|
-
try {
|
|
120
|
-
const formattedSpan = formatSpan(span, spanStrings.length === 0)
|
|
121
|
-
const serialized = JSON.stringify(spanToJSON(formattedSpan))
|
|
122
|
-
spanStrings.push(serialized)
|
|
123
|
-
traceSize += serialized.length
|
|
124
|
-
} catch (err) {
|
|
125
|
-
log.error(
|
|
126
|
-
'Failed to encode span (name: %s, service: %s). Span will be dropped. Error: %s\n%s',
|
|
127
|
-
span?.name || 'unknown',
|
|
128
|
-
span?.service || 'unknown',
|
|
129
|
-
err.message,
|
|
130
|
-
err.stack
|
|
131
|
-
)
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (spanStrings.length > 0) {
|
|
136
|
-
this._traces.push(spanStrings)
|
|
137
|
-
this._traceCount++
|
|
138
|
-
this._estimatedSize += traceSize
|
|
139
|
-
} else if (trace.length > 0) {
|
|
140
|
-
log.error('All %d span(s) in trace failed to encode. Entire trace dropped.', trace.length)
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (this._estimatedSize > this._softLimit) {
|
|
144
|
-
log.debug('Buffer went over soft limit, flushing')
|
|
145
|
-
try {
|
|
146
|
-
this._writer.flush()
|
|
147
|
-
} catch (err) {
|
|
148
|
-
log.error('Failed to flush on soft limit: %s\n%s', err.message, err.stack)
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Creates the JSON payload for the encoded traces.
|
|
155
|
-
* Builds the payload via string concatenation from pre-serialized spans to avoid double-stringify.
|
|
156
|
-
* @returns {Buffer} JSON payload as a buffer, or empty buffer if no traces
|
|
157
|
-
*/
|
|
158
|
-
makePayload () {
|
|
159
|
-
if (this._traces.length === 0) {
|
|
160
|
-
this._reset()
|
|
161
|
-
return Buffer.alloc(0)
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
try {
|
|
165
|
-
const metadataJson = JSON.stringify(this._metadata)
|
|
166
|
-
// Strip trailing '}' so we can append ',"spans":[...]}'
|
|
167
|
-
const metadataPrefix = metadataJson.slice(0, -1)
|
|
168
|
-
const hasMetadata = metadataPrefix.length > 1 // more than just '{'
|
|
169
|
-
|
|
170
|
-
let tracesJson = ''
|
|
171
|
-
for (const spanStrings of this._traces) {
|
|
172
|
-
const spansJson = '[' + spanStrings.join(',') + ']'
|
|
173
|
-
if (tracesJson) tracesJson += ','
|
|
174
|
-
if (hasMetadata) {
|
|
175
|
-
tracesJson += metadataPrefix + ',"spans":' + spansJson + '}'
|
|
176
|
-
} else {
|
|
177
|
-
tracesJson += '{"spans":' + spansJson + '}'
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
const payload = '{"traces":[' + tracesJson + ']}'
|
|
182
|
-
this._reset()
|
|
183
|
-
return Buffer.from(payload, 'utf8')
|
|
184
|
-
} catch (err) {
|
|
185
|
-
log.error(
|
|
186
|
-
'Failed to encode traces as JSON (%d traces). Traces will be dropped. Error: %s\n%s',
|
|
187
|
-
this._traces.length,
|
|
188
|
-
err.message,
|
|
189
|
-
err.stack
|
|
190
|
-
)
|
|
191
|
-
this._reset()
|
|
192
|
-
return Buffer.alloc(0)
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Resets the encoder state.
|
|
198
|
-
*/
|
|
199
|
-
reset () {
|
|
200
|
-
this._reset()
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
_reset () {
|
|
204
|
-
this._traces = []
|
|
205
|
-
this._traceCount = 0
|
|
206
|
-
this._estimatedSize = 0
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
module.exports = { AgentlessJSONEncoder }
|