{"version":3,"file":"c_init_data_runtime.js","sources":["../../../../node_modules/@bufbuild/protobuf/dist/esm/private/assert.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/private/enum.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/message.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/private/proto-runtime.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/private/message-type.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/field.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/google/varint.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/binary-encoding.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/private/field-wrapper.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/private/scalars.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/private/binary-format-common.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/proto-base64.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/private/json-format-common.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/private/util-common.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/private/field-list.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/private/names.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/private/field.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/proto3.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/private/json-format-proto3.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/private/binary-format-proto3.js","../../../../node_modules/@bufbuild/protobuf/dist/esm/google/protobuf/any_pb.js","../../../../js/proto_utils/unpack.ts","../../../../typescript/dropbox/proto/init_data/device_pb.ts","../../../../typescript/dropbox/proto/init_data/auth_request_info_pb.ts","../../../../typescript/dropbox/proto/init_data/debug_panel_info_pb.ts","../../../../typescript/dropbox/proto/init_data/messages_pb.ts","../../../../js/init_data/internal.ts","../../../../js/init_data/data.ts","../../../../js/init_data/runtime.ts"],"sourcesContent":["// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n/**\n * Assert that condition is truthy or throw error (with message)\n */\nexport function assert(condition, msg) {\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions -- we want the implicit conversion to boolean\n if (!condition) {\n throw new Error(msg);\n }\n}\nconst FLOAT32_MAX = 3.4028234663852886e38, FLOAT32_MIN = -3.4028234663852886e38, UINT32_MAX = 0xffffffff, INT32_MAX = 0x7fffffff, INT32_MIN = -0x80000000;\n/**\n * Assert a valid signed protobuf 32-bit integer.\n */\nexport function assertInt32(arg) {\n if (typeof arg !== \"number\")\n throw new Error(\"invalid int 32: \" + typeof arg);\n if (!Number.isInteger(arg) || arg \u003e INT32_MAX || arg \u003c INT32_MIN)\n throw new Error(\"invalid int 32: \" + arg); // eslint-disable-line @typescript-eslint/restrict-plus-operands -- we want the implicit conversion to string\n}\n/**\n * Assert a valid unsigned protobuf 32-bit integer.\n */\nexport function assertUInt32(arg) {\n if (typeof arg !== \"number\")\n throw new Error(\"invalid uint 32: \" + typeof arg);\n if (!Number.isInteger(arg) || arg \u003e UINT32_MAX || arg \u003c 0)\n throw new Error(\"invalid uint 32: \" + arg); // eslint-disable-line @typescript-eslint/restrict-plus-operands -- we want the implicit conversion to string\n}\n/**\n * Assert a valid protobuf float value.\n */\nexport function assertFloat32(arg) {\n if (typeof arg !== \"number\")\n throw new Error(\"invalid float 32: \" + typeof arg);\n if (!Number.isFinite(arg))\n return;\n if (arg \u003e FLOAT32_MAX || arg \u003c FLOAT32_MIN)\n throw new Error(\"invalid float 32: \" + arg); // eslint-disable-line @typescript-eslint/restrict-plus-operands -- we want the implicit conversion to string\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { assert } from \"./assert.js\";\nconst enumTypeSymbol = Symbol(\"@bufbuild/protobuf/enum-type\");\n/**\n * Get reflection information from a generated enum.\n * If this function is called on something other than a generated\n * enum, it raises an error.\n */\nexport function getEnumType(enumObject) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-explicit-any\n const t = enumObject[enumTypeSymbol];\n assert(t, \"missing enum type on enum object\");\n return t; // eslint-disable-line @typescript-eslint/no-unsafe-return\n}\n/**\n * Sets reflection information on a generated enum.\n */\nexport function setEnumType(enumObject, typeName, values, opt) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n enumObject[enumTypeSymbol] = makeEnumType(typeName, values.map((v) =\u003e ({\n no: v.no,\n name: v.name,\n localName: enumObject[v.no],\n })), opt);\n}\n/**\n * Create a new EnumType with the given values.\n */\nexport function makeEnumType(typeName, values, \n// eslint-disable-next-line @typescript-eslint/no-unused-vars\n_opt) {\n const names = Object.create(null);\n const numbers = Object.create(null);\n const normalValues = [];\n for (const value of values) {\n // We do not surface options at this time\n // const value: EnumValueInfo = {...v, options: v.options ?? emptyReadonlyObject};\n const n = normalizeEnumValue(value);\n normalValues.push(n);\n names[value.name] = n;\n numbers[value.no] = n;\n }\n return {\n typeName,\n values: normalValues,\n // We do not surface options at this time\n // options: opt?.options ?? Object.create(null),\n findName(name) {\n return names[name];\n },\n findNumber(no) {\n return numbers[no];\n },\n };\n}\n/**\n * Create a new enum object with the given values.\n * Sets reflection information.\n */\nexport function makeEnum(typeName, values, opt) {\n const enumObject = {};\n for (const value of values) {\n const n = normalizeEnumValue(value);\n enumObject[n.localName] = n.no;\n enumObject[n.no] = n.localName;\n }\n setEnumType(enumObject, typeName, values, opt);\n return enumObject;\n}\nfunction normalizeEnumValue(value) {\n if (\"localName\" in value) {\n return value;\n }\n return Object.assign(Object.assign({}, value), { localName: value.name });\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n/**\n * Message is the base class of every message, generated, or created at\n * runtime.\n *\n * It is _not_ safe to extend this class. If you want to create a message at\n * run time, use proto3.makeMessageType().\n */\nexport class Message {\n /**\n * Compare with a message of the same type.\n */\n equals(other) {\n return this.getType().runtime.util.equals(this.getType(), this, other);\n }\n /**\n * Create a deep copy.\n */\n clone() {\n // return this.getType().runtime.util.clone(this);\n return this.getType().runtime.util.clone(this);\n }\n /**\n * Parse from binary data, merging fields.\n *\n * Repeated fields are appended. Map entries are added, overwriting\n * existing keys.\n *\n * If a message field is already present, it will be merged with the\n * new data.\n */\n fromBinary(bytes, options) {\n const type = this.getType(), format = type.runtime.bin, opt = format.makeReadOptions(options);\n format.readMessage(this, opt.readerFactory(bytes), bytes.byteLength, opt);\n return this;\n }\n /**\n * Parse a message from a JSON value.\n */\n fromJson(jsonValue, options) {\n const type = this.getType(), format = type.runtime.json, opt = format.makeReadOptions(options);\n format.readMessage(type, jsonValue, opt, this);\n return this;\n }\n /**\n * Parse a message from a JSON string.\n */\n fromJsonString(jsonString, options) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- assigning to JsonValue is safe here\n return this.fromJson(JSON.parse(jsonString), options);\n }\n /**\n * Serialize the message to binary data.\n */\n toBinary(options) {\n const type = this.getType(), bin = type.runtime.bin, opt = bin.makeWriteOptions(options), writer = opt.writerFactory();\n bin.writeMessage(this, writer, opt);\n return writer.finish();\n }\n /**\n * Serialize the message to a JSON value, a JavaScript value that can be\n * passed to JSON.stringify().\n */\n toJson(options) {\n const type = this.getType(), json = type.runtime.json, opt = json.makeWriteOptions(options);\n return json.writeMessage(this, opt);\n }\n /**\n * Serialize the message to a JSON string.\n */\n toJsonString(options) {\n var _a;\n const value = this.toJson(options);\n return JSON.stringify(value, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null \u0026\u0026 _a !== void 0 ? _a : 0);\n }\n /**\n * Retrieve the MessageType of this message - a singleton that represents\n * the protobuf message declaration and provides metadata for reflection-\n * based operations.\n */\n getType() {\n // Any class that extends Message _must_ provide a complete static\n // implementation of MessageType.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-return\n return Object.getPrototypeOf(this).constructor;\n }\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { getEnumType, makeEnum, makeEnumType } from \"./enum.js\";\nimport { makeMessageType } from \"./message-type.js\";\nexport function makeProtoRuntime(syntax, json, bin, util) {\n return {\n syntax,\n json,\n bin,\n util,\n makeMessageType(typeName, fields, opt) {\n return makeMessageType(this, typeName, fields, opt);\n },\n makeEnum,\n makeEnumType,\n getEnumType,\n };\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { Message, } from \"../message.js\";\n/**\n * Create a new message type using the given runtime.\n */\nexport function makeMessageType(runtime, typeName, fields, opt) {\n var _a;\n const localName = (_a = opt === null || opt === void 0 ? void 0 : opt.localName) !== null \u0026\u0026 _a !== void 0 ? _a : typeName.substring(typeName.lastIndexOf(\".\") + 1);\n const type = {\n [localName]: function (data) {\n runtime.util.initFields(this);\n runtime.util.initPartial(data, this);\n },\n }[localName];\n Object.setPrototypeOf(type.prototype, new Message());\n Object.assign(type, {\n runtime,\n typeName,\n fields: runtime.util.newFieldList(fields),\n fromBinary(bytes, options) {\n return new type().fromBinary(bytes, options);\n },\n fromJson(jsonValue, options) {\n return new type().fromJson(jsonValue, options);\n },\n fromJsonString(jsonString, options) {\n return new type().fromJsonString(jsonString, options);\n },\n equals(a, b) {\n return runtime.util.equals(type, a, b);\n },\n });\n return type;\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n/**\n * Scalar value types. This is a subset of field types declared by protobuf\n * enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE\n * are omitted, but the numerical values are identical.\n */\nexport var ScalarType;\n(function (ScalarType) {\n // 0 is reserved for errors.\n // Order is weird for historical reasons.\n ScalarType[ScalarType[\"DOUBLE\"] = 1] = \"DOUBLE\";\n ScalarType[ScalarType[\"FLOAT\"] = 2] = \"FLOAT\";\n // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if\n // negative values are likely.\n ScalarType[ScalarType[\"INT64\"] = 3] = \"INT64\";\n ScalarType[ScalarType[\"UINT64\"] = 4] = \"UINT64\";\n // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if\n // negative values are likely.\n ScalarType[ScalarType[\"INT32\"] = 5] = \"INT32\";\n ScalarType[ScalarType[\"FIXED64\"] = 6] = \"FIXED64\";\n ScalarType[ScalarType[\"FIXED32\"] = 7] = \"FIXED32\";\n ScalarType[ScalarType[\"BOOL\"] = 8] = \"BOOL\";\n ScalarType[ScalarType[\"STRING\"] = 9] = \"STRING\";\n // Tag-delimited aggregate.\n // Group type is deprecated and not supported in proto3. However, Proto3\n // implementations should still be able to parse the group wire format and\n // treat group fields as unknown fields.\n // TYPE_GROUP = 10,\n // TYPE_MESSAGE = 11, // Length-delimited aggregate.\n // New in version 2.\n ScalarType[ScalarType[\"BYTES\"] = 12] = \"BYTES\";\n ScalarType[ScalarType[\"UINT32\"] = 13] = \"UINT32\";\n // TYPE_ENUM = 14,\n ScalarType[ScalarType[\"SFIXED32\"] = 15] = \"SFIXED32\";\n ScalarType[ScalarType[\"SFIXED64\"] = 16] = \"SFIXED64\";\n ScalarType[ScalarType[\"SINT32\"] = 17] = \"SINT32\";\n ScalarType[ScalarType[\"SINT64\"] = 18] = \"SINT64\";\n})(ScalarType || (ScalarType = {}));\n","// Copyright 2008 Google Inc. All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n// * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Code generated by the Protocol Buffer compiler is owned by the owner\n// of the input file used when generating it. This code is not\n// standalone and requires a support library to be linked with it. This\n// support library is itself covered by the above license.\n/* eslint-disable prefer-const,@typescript-eslint/restrict-plus-operands */\n/**\n * Read a 64 bit varint as two JS numbers.\n *\n * Returns tuple:\n * [0]: low bits\n * [1]: high bits\n *\n * Copyright 2008 Google Inc. All rights reserved.\n *\n * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175\n */\nexport function varint64read() {\n let lowBits = 0;\n let highBits = 0;\n for (let shift = 0; shift \u003c 28; shift += 7) {\n let b = this.buf[this.pos++];\n lowBits |= (b \u0026 0x7f) \u003c\u003c shift;\n if ((b \u0026 0x80) == 0) {\n this.assertBounds();\n return [lowBits, highBits];\n }\n }\n let middleByte = this.buf[this.pos++];\n // last four bits of the first 32 bit number\n lowBits |= (middleByte \u0026 0x0f) \u003c\u003c 28;\n // 3 upper bits are part of the next 32 bit number\n highBits = (middleByte \u0026 0x70) \u003e\u003e 4;\n if ((middleByte \u0026 0x80) == 0) {\n this.assertBounds();\n return [lowBits, highBits];\n }\n for (let shift = 3; shift \u003c= 31; shift += 7) {\n let b = this.buf[this.pos++];\n highBits |= (b \u0026 0x7f) \u003c\u003c shift;\n if ((b \u0026 0x80) == 0) {\n this.assertBounds();\n return [lowBits, highBits];\n }\n }\n throw new Error(\"invalid varint\");\n}\n/**\n * Write a 64 bit varint, given as two JS numbers, to the given bytes array.\n *\n * Copyright 2008 Google Inc. All rights reserved.\n *\n * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344\n */\nexport function varint64write(lo, hi, bytes) {\n for (let i = 0; i \u003c 28; i = i + 7) {\n const shift = lo \u003e\u003e\u003e i;\n const hasNext = !(shift \u003e\u003e\u003e 7 == 0 \u0026\u0026 hi == 0);\n const byte = (hasNext ? shift | 0x80 : shift) \u0026 0xff;\n bytes.push(byte);\n if (!hasNext) {\n return;\n }\n }\n const splitBits = ((lo \u003e\u003e\u003e 28) \u0026 0x0f) | ((hi \u0026 0x07) \u003c\u003c 4);\n const hasMoreBits = !(hi \u003e\u003e 3 == 0);\n bytes.push((hasMoreBits ? splitBits | 0x80 : splitBits) \u0026 0xff);\n if (!hasMoreBits) {\n return;\n }\n for (let i = 3; i \u003c 31; i = i + 7) {\n const shift = hi \u003e\u003e\u003e i;\n const hasNext = !(shift \u003e\u003e\u003e 7 == 0);\n const byte = (hasNext ? shift | 0x80 : shift) \u0026 0xff;\n bytes.push(byte);\n if (!hasNext) {\n return;\n }\n }\n bytes.push((hi \u003e\u003e\u003e 31) \u0026 0x01);\n}\n// constants for binary math\nconst TWO_PWR_32_DBL = 0x100000000;\n/**\n * Parse decimal string of 64 bit integer value as two JS numbers.\n *\n * Copyright 2008 Google Inc. All rights reserved.\n *\n * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10\n */\nexport function int64FromString(dec) {\n // Check for minus sign.\n const minus = dec[0] === \"-\";\n if (minus) {\n dec = dec.slice(1);\n }\n // Work 6 decimal digits at a time, acting like we're converting base 1e6\n // digits to binary. This is safe to do with floating point math because\n // Number.isSafeInteger(ALL_32_BITS * 1e6) == true.\n const base = 1e6;\n let lowBits = 0;\n let highBits = 0;\n function add1e6digit(begin, end) {\n // Note: Number('') is 0.\n const digit1e6 = Number(dec.slice(begin, end));\n highBits *= base;\n lowBits = lowBits * base + digit1e6;\n // Carry bits from lowBits to\n if (lowBits \u003e= TWO_PWR_32_DBL) {\n highBits = highBits + ((lowBits / TWO_PWR_32_DBL) | 0);\n lowBits = lowBits % TWO_PWR_32_DBL;\n }\n }\n add1e6digit(-24, -18);\n add1e6digit(-18, -12);\n add1e6digit(-12, -6);\n add1e6digit(-6);\n return minus ? negate(lowBits, highBits) : newBits(lowBits, highBits);\n}\n/**\n * Losslessly converts a 64-bit signed integer in 32:32 split representation\n * into a decimal string.\n *\n * Copyright 2008 Google Inc. All rights reserved.\n *\n * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10\n */\nexport function int64ToString(lo, hi) {\n let bits = newBits(lo, hi);\n // If we're treating the input as a signed value and the high bit is set, do\n // a manual two's complement conversion before the decimal conversion.\n const negative = (bits.hi \u0026 0x80000000);\n if (negative) {\n bits = negate(bits.lo, bits.hi);\n }\n const result = uInt64ToString(bits.lo, bits.hi);\n return negative ? \"-\" + result : result;\n}\n/**\n * Losslessly converts a 64-bit unsigned integer in 32:32 split representation\n * into a decimal string.\n *\n * Copyright 2008 Google Inc. All rights reserved.\n *\n * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10\n */\nexport function uInt64ToString(lo, hi) {\n ({ lo, hi } = toUnsigned(lo, hi));\n // Skip the expensive conversion if the number is small enough to use the\n // built-in conversions.\n // Number.MAX_SAFE_INTEGER = 0x001FFFFF FFFFFFFF, thus any number with\n // highBits \u003c= 0x1FFFFF can be safely expressed with a double and retain\n // integer precision.\n // Proven by: Number.isSafeInteger(0x1FFFFF * 2**32 + 0xFFFFFFFF) == true.\n if (hi \u003c= 0x1FFFFF) {\n return String(TWO_PWR_32_DBL * hi + lo);\n }\n // What this code is doing is essentially converting the input number from\n // base-2 to base-1e7, which allows us to represent the 64-bit range with\n // only 3 (very large) digits. Those digits are then trivial to convert to\n // a base-10 string.\n // The magic numbers used here are -\n // 2^24 = 16777216 = (1,6777216) in base-1e7.\n // 2^48 = 281474976710656 = (2,8147497,6710656) in base-1e7.\n // Split 32:32 representation into 16:24:24 representation so our\n // intermediate digits don't overflow.\n const low = lo \u0026 0xFFFFFF;\n const mid = ((lo \u003e\u003e\u003e 24) | (hi \u003c\u003c 8)) \u0026 0xFFFFFF;\n const high = (hi \u003e\u003e 16) \u0026 0xFFFF;\n // Assemble our three base-1e7 digits, ignoring carries. The maximum\n // value in a digit at this step is representable as a 48-bit integer, which\n // can be stored in a 64-bit floating point number.\n let digitA = low + (mid * 6777216) + (high * 6710656);\n let digitB = mid + (high * 8147497);\n let digitC = (high * 2);\n // Apply carries from A to B and from B to C.\n const base = 10000000;\n if (digitA \u003e= base) {\n digitB += Math.floor(digitA / base);\n digitA %= base;\n }\n if (digitB \u003e= base) {\n digitC += Math.floor(digitB / base);\n digitB %= base;\n }\n // If digitC is 0, then we should have returned in the trivial code path\n // at the top for non-safe integers. Given this, we can assume both digitB\n // and digitA need leading zeros.\n return digitC.toString() + decimalFrom1e7WithLeadingZeros(digitB) +\n decimalFrom1e7WithLeadingZeros(digitA);\n}\nfunction toUnsigned(lo, hi) {\n return { lo: lo \u003e\u003e\u003e 0, hi: hi \u003e\u003e\u003e 0 };\n}\nfunction newBits(lo, hi) {\n return { lo: lo | 0, hi: hi | 0 };\n}\n/**\n * Returns two's compliment negation of input.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Signed_32-bit_integers\n */\nfunction negate(lowBits, highBits) {\n highBits = ~highBits;\n if (lowBits) {\n lowBits = ~lowBits + 1;\n }\n else {\n // If lowBits is 0, then bitwise-not is 0xFFFFFFFF,\n // adding 1 to that, results in 0x100000000, which leaves\n // the low bits 0x0 and simply adds one to the high bits.\n highBits += 1;\n }\n return newBits(lowBits, highBits);\n}\n/**\n * Returns decimal representation of digit1e7 with leading zeros.\n */\nconst decimalFrom1e7WithLeadingZeros = (digit1e7) =\u003e {\n const partial = String(digit1e7);\n return \"0000000\".slice(partial.length) + partial;\n};\n/**\n * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)`\n *\n * Copyright 2008 Google Inc. All rights reserved.\n *\n * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144\n */\nexport function varint32write(value, bytes) {\n if (value \u003e= 0) {\n // write value as varint 32\n while (value \u003e 0x7f) {\n bytes.push((value \u0026 0x7f) | 0x80);\n value = value \u003e\u003e\u003e 7;\n }\n bytes.push(value);\n }\n else {\n for (let i = 0; i \u003c 9; i++) {\n bytes.push((value \u0026 127) | 128);\n value = value \u003e\u003e 7;\n }\n bytes.push(1);\n }\n}\n/**\n * Read an unsigned 32 bit varint.\n *\n * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220\n */\nexport function varint32read() {\n let b = this.buf[this.pos++];\n let result = b \u0026 0x7f;\n if ((b \u0026 0x80) == 0) {\n this.assertBounds();\n return result;\n }\n b = this.buf[this.pos++];\n result |= (b \u0026 0x7f) \u003c\u003c 7;\n if ((b \u0026 0x80) == 0) {\n this.assertBounds();\n return result;\n }\n b = this.buf[this.pos++];\n result |= (b \u0026 0x7f) \u003c\u003c 14;\n if ((b \u0026 0x80) == 0) {\n this.assertBounds();\n return result;\n }\n b = this.buf[this.pos++];\n result |= (b \u0026 0x7f) \u003c\u003c 21;\n if ((b \u0026 0x80) == 0) {\n this.assertBounds();\n return result;\n }\n // Extract only last 4 bits\n b = this.buf[this.pos++];\n result |= (b \u0026 0x0f) \u003c\u003c 28;\n for (let readBytes = 5; (b \u0026 0x80) !== 0 \u0026\u0026 readBytes \u003c 10; readBytes++)\n b = this.buf[this.pos++];\n if ((b \u0026 0x80) != 0)\n throw new Error(\"invalid varint\");\n this.assertBounds();\n // Result can have 32 bits, convert it to unsigned\n return result \u003e\u003e\u003e 0;\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { assert } from \"./private/assert.js\";\nimport { int64FromString, int64ToString, uInt64ToString, } from \"./google/varint.js\";\nfunction makeInt64Support() {\n const dv = new DataView(new ArrayBuffer(8));\n // note that Safari 14 implements BigInt, but not the DataView methods\n const ok = globalThis.BigInt !== undefined \u0026\u0026\n typeof dv.getBigInt64 === \"function\" \u0026\u0026\n typeof dv.getBigUint64 === \"function\" \u0026\u0026\n typeof dv.setBigInt64 === \"function\" \u0026\u0026\n typeof dv.setBigUint64 === \"function\" \u0026\u0026\n (typeof process != \"object\" ||\n typeof process.env != \"object\" ||\n process.env.BUF_BIGINT_DISABLE !== \"1\");\n if (ok) {\n const MIN = BigInt(\"-9223372036854775808\"), MAX = BigInt(\"9223372036854775807\"), UMIN = BigInt(\"0\"), UMAX = BigInt(\"18446744073709551615\");\n return {\n zero: BigInt(0),\n supported: true,\n parse(value) {\n const bi = typeof value == \"bigint\" ? value : BigInt(value);\n if (bi \u003e MAX || bi \u003c MIN) {\n throw new Error(`int64 invalid: ${value}`);\n }\n return bi;\n },\n uParse(value) {\n const bi = typeof value == \"bigint\" ? value : BigInt(value);\n if (bi \u003e UMAX || bi \u003c UMIN) {\n throw new Error(`uint64 invalid: ${value}`);\n }\n return bi;\n },\n enc(value) {\n dv.setBigInt64(0, this.parse(value), true);\n return {\n lo: dv.getInt32(0, true),\n hi: dv.getInt32(4, true),\n };\n },\n uEnc(value) {\n dv.setBigInt64(0, this.uParse(value), true);\n return {\n lo: dv.getInt32(0, true),\n hi: dv.getInt32(4, true),\n };\n },\n dec(lo, hi) {\n dv.setInt32(0, lo, true);\n dv.setInt32(4, hi, true);\n return dv.getBigInt64(0, true);\n },\n uDec(lo, hi) {\n dv.setInt32(0, lo, true);\n dv.setInt32(4, hi, true);\n return dv.getBigUint64(0, true);\n },\n };\n }\n const assertInt64String = (value) =\u003e assert(/^-?[0-9]+$/.test(value), `int64 invalid: ${value}`);\n const assertUInt64String = (value) =\u003e assert(/^[0-9]+$/.test(value), `uint64 invalid: ${value}`);\n return {\n zero: \"0\",\n supported: false,\n parse(value) {\n if (typeof value != \"string\") {\n value = value.toString();\n }\n assertInt64String(value);\n return value;\n },\n uParse(value) {\n if (typeof value != \"string\") {\n value = value.toString();\n }\n assertUInt64String(value);\n return value;\n },\n enc(value) {\n if (typeof value != \"string\") {\n value = value.toString();\n }\n assertInt64String(value);\n return int64FromString(value);\n },\n uEnc(value) {\n if (typeof value != \"string\") {\n value = value.toString();\n }\n assertUInt64String(value);\n return int64FromString(value);\n },\n dec(lo, hi) {\n return int64ToString(lo, hi);\n },\n uDec(lo, hi) {\n return uInt64ToString(lo, hi);\n },\n };\n}\nexport const protoInt64 = makeInt64Support();\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { varint32read, varint32write, varint64read, varint64write, } from \"./google/varint.js\";\nimport { assertFloat32, assertInt32, assertUInt32 } from \"./private/assert.js\";\nimport { protoInt64 } from \"./proto-int64.js\";\n/* eslint-disable prefer-const,no-case-declarations,@typescript-eslint/restrict-plus-operands */\n/**\n * Protobuf binary format wire types.\n *\n * A wire type provides just enough information to find the length of the\n * following value.\n *\n * See https://developers.google.com/protocol-buffers/docs/encoding#structure\n */\nexport var WireType;\n(function (WireType) {\n /**\n * Used for int32, int64, uint32, uint64, sint32, sint64, bool, enum\n */\n WireType[WireType[\"Varint\"] = 0] = \"Varint\";\n /**\n * Used for fixed64, sfixed64, double.\n * Always 8 bytes with little-endian byte order.\n */\n WireType[WireType[\"Bit64\"] = 1] = \"Bit64\";\n /**\n * Used for string, bytes, embedded messages, packed repeated fields\n *\n * Only repeated numeric types (types which use the varint, 32-bit,\n * or 64-bit wire types) can be packed. In proto3, such fields are\n * packed by default.\n */\n WireType[WireType[\"LengthDelimited\"] = 2] = \"LengthDelimited\";\n /**\n * Used for groups\n * @deprecated\n */\n WireType[WireType[\"StartGroup\"] = 3] = \"StartGroup\";\n /**\n * Used for groups\n * @deprecated\n */\n WireType[WireType[\"EndGroup\"] = 4] = \"EndGroup\";\n /**\n * Used for fixed32, sfixed32, float.\n * Always 4 bytes with little-endian byte order.\n */\n WireType[WireType[\"Bit32\"] = 5] = \"Bit32\";\n})(WireType || (WireType = {}));\nexport class BinaryWriter {\n constructor(textEncoder) {\n /**\n * Previous fork states.\n */\n this.stack = [];\n this.textEncoder = textEncoder !== null \u0026\u0026 textEncoder !== void 0 ? textEncoder : new TextEncoder();\n this.chunks = [];\n this.buf = [];\n }\n /**\n * Return all bytes written and reset this writer.\n */\n finish() {\n this.chunks.push(new Uint8Array(this.buf)); // flush the buffer\n let len = 0;\n for (let i = 0; i \u003c this.chunks.length; i++)\n len += this.chunks[i].length;\n let bytes = new Uint8Array(len);\n let offset = 0;\n for (let i = 0; i \u003c this.chunks.length; i++) {\n bytes.set(this.chunks[i], offset);\n offset += this.chunks[i].length;\n }\n this.chunks = [];\n return bytes;\n }\n /**\n * Start a new fork for length-delimited data like a message\n * or a packed repeated field.\n *\n * Must be joined later with `join()`.\n */\n fork() {\n this.stack.push({ chunks: this.chunks, buf: this.buf });\n this.chunks = [];\n this.buf = [];\n return this;\n }\n /**\n * Join the last fork. Write its length and bytes, then\n * return to the previous state.\n */\n join() {\n // get chunk of fork\n let chunk = this.finish();\n // restore previous state\n let prev = this.stack.pop();\n if (!prev)\n throw new Error(\"invalid state, fork stack empty\");\n this.chunks = prev.chunks;\n this.buf = prev.buf;\n // write length of chunk as varint\n this.uint32(chunk.byteLength);\n return this.raw(chunk);\n }\n /**\n * Writes a tag (field number and wire type).\n *\n * Equivalent to `uint32( (fieldNo \u003c\u003c 3 | type) \u003e\u003e\u003e 0 )`.\n *\n * Generated code should compute the tag ahead of time and call `uint32()`.\n */\n tag(fieldNo, type) {\n return this.uint32(((fieldNo \u003c\u003c 3) | type) \u003e\u003e\u003e 0);\n }\n /**\n * Write a chunk of raw bytes.\n */\n raw(chunk) {\n if (this.buf.length) {\n this.chunks.push(new Uint8Array(this.buf));\n this.buf = [];\n }\n this.chunks.push(chunk);\n return this;\n }\n /**\n * Write a `uint32` value, an unsigned 32 bit varint.\n */\n uint32(value) {\n assertUInt32(value);\n // write value as varint 32, inlined for speed\n while (value \u003e 0x7f) {\n this.buf.push((value \u0026 0x7f) | 0x80);\n value = value \u003e\u003e\u003e 7;\n }\n this.buf.push(value);\n return this;\n }\n /**\n * Write a `int32` value, a signed 32 bit varint.\n */\n int32(value) {\n assertInt32(value);\n varint32write(value, this.buf);\n return this;\n }\n /**\n * Write a `bool` value, a variant.\n */\n bool(value) {\n this.buf.push(value ? 1 : 0);\n return this;\n }\n /**\n * Write a `bytes` value, length-delimited arbitrary data.\n */\n bytes(value) {\n this.uint32(value.byteLength); // write length of chunk as varint\n return this.raw(value);\n }\n /**\n * Write a `string` value, length-delimited data converted to UTF-8 text.\n */\n string(value) {\n let chunk = this.textEncoder.encode(value);\n this.uint32(chunk.byteLength); // write length of chunk as varint\n return this.raw(chunk);\n }\n /**\n * Write a `float` value, 32-bit floating point number.\n */\n float(value) {\n assertFloat32(value);\n let chunk = new Uint8Array(4);\n new DataView(chunk.buffer).setFloat32(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `double` value, a 64-bit floating point number.\n */\n double(value) {\n let chunk = new Uint8Array(8);\n new DataView(chunk.buffer).setFloat64(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.\n */\n fixed32(value) {\n assertUInt32(value);\n let chunk = new Uint8Array(4);\n new DataView(chunk.buffer).setUint32(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `sfixed32` value, a signed, fixed-length 32-bit integer.\n */\n sfixed32(value) {\n assertInt32(value);\n let chunk = new Uint8Array(4);\n new DataView(chunk.buffer).setInt32(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.\n */\n sint32(value) {\n assertInt32(value);\n // zigzag encode\n value = ((value \u003c\u003c 1) ^ (value \u003e\u003e 31)) \u003e\u003e\u003e 0;\n varint32write(value, this.buf);\n return this;\n }\n /**\n * Write a `fixed64` value, a signed, fixed-length 64-bit integer.\n */\n sfixed64(value) {\n let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = protoInt64.enc(value);\n view.setInt32(0, tc.lo, true);\n view.setInt32(4, tc.hi, true);\n return this.raw(chunk);\n }\n /**\n * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer.\n */\n fixed64(value) {\n let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = protoInt64.uEnc(value);\n view.setInt32(0, tc.lo, true);\n view.setInt32(4, tc.hi, true);\n return this.raw(chunk);\n }\n /**\n * Write a `int64` value, a signed 64-bit varint.\n */\n int64(value) {\n let tc = protoInt64.enc(value);\n varint64write(tc.lo, tc.hi, this.buf);\n return this;\n }\n /**\n * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint.\n */\n sint64(value) {\n let tc = protoInt64.enc(value), \n // zigzag encode\n sign = tc.hi \u003e\u003e 31, lo = (tc.lo \u003c\u003c 1) ^ sign, hi = ((tc.hi \u003c\u003c 1) | (tc.lo \u003e\u003e\u003e 31)) ^ sign;\n varint64write(lo, hi, this.buf);\n return this;\n }\n /**\n * Write a `uint64` value, an unsigned 64-bit varint.\n */\n uint64(value) {\n let tc = protoInt64.uEnc(value);\n varint64write(tc.lo, tc.hi, this.buf);\n return this;\n }\n}\nexport class BinaryReader {\n constructor(buf, textDecoder) {\n this.varint64 = varint64read; // dirty cast for `this`\n /**\n * Read a `uint32` field, an unsigned 32 bit varint.\n */\n this.uint32 = varint32read; // dirty cast for `this` and access to protected `buf`\n this.buf = buf;\n this.len = buf.length;\n this.pos = 0;\n this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);\n this.textDecoder = textDecoder !== null \u0026\u0026 textDecoder !== void 0 ? textDecoder : new TextDecoder();\n }\n /**\n * Reads a tag - field number and wire type.\n */\n tag() {\n let tag = this.uint32(), fieldNo = tag \u003e\u003e\u003e 3, wireType = tag \u0026 7;\n if (fieldNo \u003c= 0 || wireType \u003c 0 || wireType \u003e 5)\n throw new Error(\"illegal tag: field no \" + fieldNo + \" wire type \" + wireType);\n return [fieldNo, wireType];\n }\n /**\n * Skip one element on the wire and return the skipped data.\n * Supports WireType.StartGroup since v2.0.0-alpha.23.\n */\n skip(wireType) {\n let start = this.pos;\n switch (wireType) {\n case WireType.Varint:\n while (this.buf[this.pos++] \u0026 0x80) {\n // ignore\n }\n break;\n // eslint-disable-next-line\n // @ts-ignore TS7029: Fallthrough case in switch\n case WireType.Bit64:\n this.pos += 4;\n // eslint-disable-next-line\n // @ts-ignore TS7029: Fallthrough case in switch\n case WireType.Bit32:\n this.pos += 4;\n break;\n case WireType.LengthDelimited:\n let len = this.uint32();\n this.pos += len;\n break;\n case WireType.StartGroup:\n // From descriptor.proto: Group type is deprecated, not supported in proto3.\n // But we must still be able to parse and treat as unknown.\n let t;\n while ((t = this.tag()[1]) !== WireType.EndGroup) {\n this.skip(t);\n }\n break;\n default:\n throw new Error(\"cant skip wire type \" + wireType);\n }\n this.assertBounds();\n return this.buf.subarray(start, this.pos);\n }\n /**\n * Throws error if position in byte array is out of range.\n */\n assertBounds() {\n if (this.pos \u003e this.len)\n throw new RangeError(\"premature EOF\");\n }\n /**\n * Read a `int32` field, a signed 32 bit varint.\n */\n int32() {\n return this.uint32() | 0;\n }\n /**\n * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint.\n */\n sint32() {\n let zze = this.uint32();\n // decode zigzag\n return (zze \u003e\u003e\u003e 1) ^ -(zze \u0026 1);\n }\n /**\n * Read a `int64` field, a signed 64-bit varint.\n */\n int64() {\n return protoInt64.dec(...this.varint64());\n }\n /**\n * Read a `uint64` field, an unsigned 64-bit varint.\n */\n uint64() {\n return protoInt64.uDec(...this.varint64());\n }\n /**\n * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint.\n */\n sint64() {\n let [lo, hi] = this.varint64();\n // decode zig zag\n let s = -(lo \u0026 1);\n lo = ((lo \u003e\u003e\u003e 1) | ((hi \u0026 1) \u003c\u003c 31)) ^ s;\n hi = (hi \u003e\u003e\u003e 1) ^ s;\n return protoInt64.dec(lo, hi);\n }\n /**\n * Read a `bool` field, a variant.\n */\n bool() {\n let [lo, hi] = this.varint64();\n return lo !== 0 || hi !== 0;\n }\n /**\n * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer.\n */\n fixed32() {\n return this.view.getUint32((this.pos += 4) - 4, true);\n }\n /**\n * Read a `sfixed32` field, a signed, fixed-length 32-bit integer.\n */\n sfixed32() {\n return this.view.getInt32((this.pos += 4) - 4, true);\n }\n /**\n * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer.\n */\n fixed64() {\n return protoInt64.uDec(this.sfixed32(), this.sfixed32());\n }\n /**\n * Read a `fixed64` field, a signed, fixed-length 64-bit integer.\n */\n sfixed64() {\n return protoInt64.dec(this.sfixed32(), this.sfixed32());\n }\n /**\n * Read a `float` field, 32-bit floating point number.\n */\n float() {\n return this.view.getFloat32((this.pos += 4) - 4, true);\n }\n /**\n * Read a `double` field, a 64-bit floating point number.\n */\n double() {\n return this.view.getFloat64((this.pos += 8) - 8, true);\n }\n /**\n * Read a `bytes` field, length-delimited arbitrary data.\n */\n bytes() {\n let len = this.uint32(), start = this.pos;\n this.pos += len;\n this.assertBounds();\n return this.buf.subarray(start, start + len);\n }\n /**\n * Read a `string` field, length-delimited data converted to UTF-8 text.\n */\n string() {\n return this.textDecoder.decode(this.bytes());\n }\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { ScalarType } from \"../field.js\";\n/**\n * Wrap field values whose message type has a wrapper.\n */\nexport function wrapField(type, value) {\n if (value instanceof type) {\n return value;\n }\n if (type.fieldWrapper) {\n return type.fieldWrapper.wrapField(value);\n }\n throw new Error(`cannot unwrap field value, ${type.typeName} does not define a field wrapper`);\n}\n/**\n * Unwrap field values whose message type has a wrapper.\n */\nexport function unwrapField(type, value) {\n return type.fieldWrapper ? type.fieldWrapper.unwrapField(value) : value;\n}\n/**\n * If the given field uses one of the well-known wrapper types, return\n * the base type it wraps.\n */\nexport function getUnwrappedFieldType(field) {\n if (field.fieldKind !== \"message\") {\n return undefined;\n }\n if (field.repeated) {\n return undefined;\n }\n if (field.oneof != undefined) {\n return undefined;\n }\n return wktWrapperToScalarType[field.message.typeName];\n}\nconst wktWrapperToScalarType = {\n \"google.protobuf.DoubleValue\": ScalarType.DOUBLE,\n \"google.protobuf.FloatValue\": ScalarType.FLOAT,\n \"google.protobuf.Int64Value\": ScalarType.INT64,\n \"google.protobuf.UInt64Value\": ScalarType.UINT64,\n \"google.protobuf.Int32Value\": ScalarType.INT32,\n \"google.protobuf.UInt32Value\": ScalarType.UINT32,\n \"google.protobuf.BoolValue\": ScalarType.BOOL,\n \"google.protobuf.StringValue\": ScalarType.STRING,\n \"google.protobuf.BytesValue\": ScalarType.BYTES,\n};\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { ScalarType } from \"../field.js\";\nimport { WireType } from \"../binary-encoding.js\";\nimport { protoInt64 } from \"../proto-int64.js\";\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Returns true if both scalar values are equal.\n */\nexport function scalarEquals(type, a, b) {\n if (a === b) {\n // This correctly matches equal values except BYTES and (possibly) 64-bit integers.\n return true;\n }\n // Special case BYTES - we need to compare each byte individually\n if (type == ScalarType.BYTES) {\n if (!(a instanceof Uint8Array) || !(b instanceof Uint8Array)) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i \u003c a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }\n // Special case 64-bit integers - we support number, string and bigint representation.\n // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check\n switch (type) {\n case ScalarType.UINT64:\n case ScalarType.FIXED64:\n case ScalarType.INT64:\n case ScalarType.SFIXED64:\n case ScalarType.SINT64:\n // Loose comparison will match between 0n, 0 and \"0\".\n return a == b;\n }\n // Anything that hasn't been caught by strict comparison or special cased\n // BYTES and 64-bit integers is not equal.\n return false;\n}\n/**\n * Returns the default value for the given scalar type, following\n * proto3 semantics.\n */\nexport function scalarDefaultValue(type) {\n switch (type) {\n case ScalarType.BOOL:\n return false;\n case ScalarType.UINT64:\n case ScalarType.FIXED64:\n case ScalarType.INT64:\n case ScalarType.SFIXED64:\n case ScalarType.SINT64:\n return protoInt64.zero;\n case ScalarType.DOUBLE:\n case ScalarType.FLOAT:\n return 0.0;\n case ScalarType.BYTES:\n return new Uint8Array(0);\n case ScalarType.STRING:\n return \"\";\n default:\n // Handles INT32, UINT32, SINT32, FIXED32, SFIXED32.\n // We do not use individual cases to save a few bytes code size.\n return 0;\n }\n}\n/**\n * Get information for writing a scalar value.\n *\n * Returns tuple:\n * [0]: appropriate WireType\n * [1]: name of the appropriate method of IBinaryWriter\n * [2]: whether the given value is a default value for proto3 semantics\n *\n * If argument `value` is omitted, [2] is always false.\n */\nexport function scalarTypeInfo(type, value) {\n const isUndefined = value === undefined;\n let wireType = WireType.Varint;\n let isIntrinsicDefault = value === 0;\n // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check -- INT32, UINT32, SINT32 are covered by the defaults\n switch (type) {\n case ScalarType.STRING:\n isIntrinsicDefault = isUndefined || !value.length;\n wireType = WireType.LengthDelimited;\n break;\n case ScalarType.BOOL:\n isIntrinsicDefault = value === false;\n break;\n case ScalarType.DOUBLE:\n wireType = WireType.Bit64;\n break;\n case ScalarType.FLOAT:\n wireType = WireType.Bit32;\n break;\n case ScalarType.INT64:\n isIntrinsicDefault = isUndefined || value == 0;\n break;\n case ScalarType.UINT64:\n isIntrinsicDefault = isUndefined || value == 0;\n break;\n case ScalarType.FIXED64:\n isIntrinsicDefault = isUndefined || value == 0;\n wireType = WireType.Bit64;\n break;\n case ScalarType.BYTES:\n isIntrinsicDefault = isUndefined || !value.byteLength;\n wireType = WireType.LengthDelimited;\n break;\n case ScalarType.FIXED32:\n wireType = WireType.Bit32;\n break;\n case ScalarType.SFIXED32:\n wireType = WireType.Bit32;\n break;\n case ScalarType.SFIXED64:\n isIntrinsicDefault = isUndefined || value == 0;\n wireType = WireType.Bit64;\n break;\n case ScalarType.SINT64:\n isIntrinsicDefault = isUndefined || value == 0;\n break;\n }\n const method = ScalarType[type].toLowerCase();\n return [wireType, method, isUndefined || isIntrinsicDefault];\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { BinaryReader, BinaryWriter, WireType, } from \"../binary-encoding.js\";\nimport { ScalarType } from \"../field.js\";\nimport { unwrapField, wrapField } from \"./field-wrapper.js\";\nimport { scalarDefaultValue, scalarTypeInfo } from \"./scalars.js\";\nimport { assert } from \"./assert.js\";\n/* eslint-disable @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unnecessary-condition, no-case-declarations, prefer-const */\nconst unknownFieldsSymbol = Symbol(\"@bufbuild/protobuf/unknown-fields\");\n// Default options for parsing binary data.\nconst readDefaults = {\n readUnknownFields: true,\n readerFactory: (bytes) =\u003e new BinaryReader(bytes),\n};\n// Default options for serializing binary data.\nconst writeDefaults = {\n writeUnknownFields: true,\n writerFactory: () =\u003e new BinaryWriter(),\n};\nfunction makeReadOptions(options) {\n return options ? Object.assign(Object.assign({}, readDefaults), options) : readDefaults;\n}\nfunction makeWriteOptions(options) {\n return options ? Object.assign(Object.assign({}, writeDefaults), options) : writeDefaults;\n}\nexport function makeBinaryFormatCommon() {\n return {\n makeReadOptions,\n makeWriteOptions,\n listUnknownFields(message) {\n var _a;\n return (_a = message[unknownFieldsSymbol]) !== null \u0026\u0026 _a !== void 0 ? _a : [];\n },\n discardUnknownFields(message) {\n delete message[unknownFieldsSymbol];\n },\n writeUnknownFields(message, writer) {\n const m = message;\n const c = m[unknownFieldsSymbol];\n if (c) {\n for (const f of c) {\n writer.tag(f.no, f.wireType).raw(f.data);\n }\n }\n },\n onUnknownField(message, no, wireType, data) {\n const m = message;\n if (!Array.isArray(m[unknownFieldsSymbol])) {\n m[unknownFieldsSymbol] = [];\n }\n m[unknownFieldsSymbol].push({ no, wireType, data });\n },\n readMessage(message, reader, length, options) {\n const type = message.getType();\n const end = length === undefined ? reader.len : reader.pos + length;\n while (reader.pos \u003c end) {\n const [fieldNo, wireType] = reader.tag(), field = type.fields.find(fieldNo);\n if (!field) {\n const data = reader.skip(wireType);\n if (options.readUnknownFields) {\n this.onUnknownField(message, fieldNo, wireType, data);\n }\n continue;\n }\n let target = message, repeated = field.repeated, localName = field.localName;\n if (field.oneof) {\n target = target[field.oneof.localName];\n if (target.case != localName) {\n delete target.value;\n }\n target.case = localName;\n localName = \"value\";\n }\n switch (field.kind) {\n case \"scalar\":\n case \"enum\":\n const scalarType = field.kind == \"enum\" ? ScalarType.INT32 : field.T;\n if (repeated) {\n let arr = target[localName]; // safe to assume presence of array, oneof cannot contain repeated values\n if (wireType == WireType.LengthDelimited \u0026\u0026\n scalarType != ScalarType.STRING \u0026\u0026\n scalarType != ScalarType.BYTES) {\n let e = reader.uint32() + reader.pos;\n while (reader.pos \u003c e) {\n arr.push(readScalar(reader, scalarType));\n }\n }\n else {\n arr.push(readScalar(reader, scalarType));\n }\n }\n else {\n target[localName] = readScalar(reader, scalarType);\n }\n break;\n case \"message\":\n const messageType = field.T;\n if (repeated) {\n // safe to assume presence of array, oneof cannot contain repeated values\n target[localName].push(messageType.fromBinary(reader.bytes(), options));\n }\n else {\n if (target[localName] instanceof messageType) {\n target[localName].fromBinary(reader.bytes(), options);\n }\n else {\n target[localName] = unwrapField(messageType, messageType.fromBinary(reader.bytes(), options));\n }\n }\n break;\n case \"map\":\n let [mapKey, mapVal] = readMapEntry(field, reader, options);\n // safe to assume presence of map object, oneof cannot contain repeated values\n target[localName][mapKey] = mapVal;\n break;\n }\n }\n },\n };\n}\n// Read a map field, expecting key field = 1, value field = 2\nfunction readMapEntry(field, reader, options) {\n const length = reader.uint32(), end = reader.pos + length;\n let key, val;\n while (reader.pos \u003c end) {\n let [fieldNo] = reader.tag();\n switch (fieldNo) {\n case 1:\n key = readScalar(reader, field.K);\n break;\n case 2:\n switch (field.V.kind) {\n case \"scalar\":\n val = readScalar(reader, field.V.T);\n break;\n case \"enum\":\n val = reader.int32();\n break;\n case \"message\":\n val = field.V.T.fromBinary(reader.bytes(), options);\n break;\n }\n break;\n }\n }\n if (key === undefined) {\n let keyRaw = scalarDefaultValue(field.K);\n key =\n field.K == ScalarType.BOOL\n ? keyRaw.toString()\n : keyRaw;\n }\n if (typeof key != \"string\" \u0026\u0026 typeof key != \"number\") {\n key = key.toString();\n }\n if (val === undefined) {\n switch (field.V.kind) {\n case \"scalar\":\n val = scalarDefaultValue(field.V.T);\n break;\n case \"enum\":\n val = 0;\n break;\n case \"message\":\n val = new field.V.T();\n break;\n }\n }\n return [key, val];\n}\nfunction readScalar(reader, type) {\n let [, method] = scalarTypeInfo(type);\n return reader[method]();\n}\nexport function writeMapEntry(writer, options, field, key, value) {\n writer.tag(field.no, WireType.LengthDelimited);\n writer.fork();\n // javascript only allows number or string for object properties\n // we convert from our representation to the protobuf type\n let keyValue = key;\n // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check -- we deliberately handle just the special cases for map keys\n switch (field.K) {\n case ScalarType.INT32:\n case ScalarType.FIXED32:\n case ScalarType.UINT32:\n case ScalarType.SFIXED32:\n case ScalarType.SINT32:\n keyValue = Number.parseInt(key);\n break;\n case ScalarType.BOOL:\n assert(key == \"true\" || key == \"false\");\n keyValue = key == \"true\";\n break;\n }\n // write key, expecting key field number = 1\n writeScalar(writer, field.K, 1, keyValue, true);\n // write value, expecting value field number = 2\n switch (field.V.kind) {\n case \"scalar\":\n writeScalar(writer, field.V.T, 2, value, true);\n break;\n case \"enum\":\n writeScalar(writer, ScalarType.INT32, 2, value, true);\n break;\n case \"message\":\n writeMessageField(writer, options, field.V.T, 2, value);\n break;\n }\n writer.join();\n}\nexport function writeMessageField(writer, options, type, fieldNo, value) {\n if (value !== undefined) {\n const message = wrapField(type, value);\n writer\n .tag(fieldNo, WireType.LengthDelimited)\n .bytes(message.toBinary(options));\n }\n}\nexport function writeScalar(writer, type, fieldNo, value, emitIntrinsicDefault) {\n let [wireType, method, isIntrinsicDefault] = scalarTypeInfo(type, value);\n if (!isIntrinsicDefault || emitIntrinsicDefault) {\n writer.tag(fieldNo, wireType)[method](value);\n }\n}\nexport function writePacked(writer, type, fieldNo, value) {\n if (!value.length) {\n return;\n }\n writer.tag(fieldNo, WireType.LengthDelimited).fork();\n let [, method] = scalarTypeInfo(type);\n for (let i = 0; i \u003c value.length; i++) {\n writer[method](value[i]);\n }\n writer.join();\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n/* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/no-unnecessary-condition, prefer-const */\n// lookup table from base64 character to byte\nlet encTable = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".split(\"\");\n// lookup table from base64 character *code* to byte because lookup by number is fast\nlet decTable = [];\nfor (let i = 0; i \u003c encTable.length; i++)\n decTable[encTable[i].charCodeAt(0)] = i;\n// support base64url variants\ndecTable[\"-\".charCodeAt(0)] = encTable.indexOf(\"+\");\ndecTable[\"_\".charCodeAt(0)] = encTable.indexOf(\"/\");\nexport const protoBase64 = {\n /**\n * Decodes a base64 string to a byte array.\n *\n * - ignores white-space, including line breaks and tabs\n * - allows inner padding (can decode concatenated base64 strings)\n * - does not require padding\n * - understands base64url encoding:\n * \"-\" instead of \"+\",\n * \"_\" instead of \"/\",\n * no padding\n */\n dec(base64Str) {\n // estimate byte size, not accounting for inner padding and whitespace\n let es = (base64Str.length * 3) / 4;\n // if (es % 3 !== 0)\n // throw new Error(\"invalid base64 string\");\n if (base64Str[base64Str.length - 2] == \"=\")\n es -= 2;\n else if (base64Str[base64Str.length - 1] == \"=\")\n es -= 1;\n let bytes = new Uint8Array(es), bytePos = 0, // position in byte array\n groupPos = 0, // position in base64 group\n b, // current byte\n p = 0; // previous byte\n for (let i = 0; i \u003c base64Str.length; i++) {\n b = decTable[base64Str.charCodeAt(i)];\n if (b === undefined) {\n switch (base64Str[i]) {\n // @ts-ignore TS7029: Fallthrough case in switch\n case \"=\":\n groupPos = 0; // reset state when padding found\n // @ts-ignore TS7029: Fallthrough case in switch\n case \"\\n\":\n case \"\\r\":\n case \"\\t\":\n case \" \":\n continue; // skip white-space, and padding\n default:\n throw Error(\"invalid base64 string.\");\n }\n }\n switch (groupPos) {\n case 0:\n p = b;\n groupPos = 1;\n break;\n case 1:\n bytes[bytePos++] = (p \u003c\u003c 2) | ((b \u0026 48) \u003e\u003e 4);\n p = b;\n groupPos = 2;\n break;\n case 2:\n bytes[bytePos++] = ((p \u0026 15) \u003c\u003c 4) | ((b \u0026 60) \u003e\u003e 2);\n p = b;\n groupPos = 3;\n break;\n case 3:\n bytes[bytePos++] = ((p \u0026 3) \u003c\u003c 6) | b;\n groupPos = 0;\n break;\n }\n }\n if (groupPos == 1)\n throw Error(\"invalid base64 string.\");\n return bytes.subarray(0, bytePos);\n },\n /**\n * Decodes a base64 string to a byte array.\n *\n * - ignores white-space, including line breaks and tabs\n * - allows inner padding (can decode concatenated base64 strings)\n * - does not require padding\n * - understands base64url encoding:\n * \"-\" instead of \"+\",\n * \"_\" instead of \"/\",\n * no padding\n */\n enc(bytes) {\n let base64 = \"\", groupPos = 0, // position in base64 group\n b, // current byte\n p = 0; // carry over from previous byte\n for (let i = 0; i \u003c bytes.length; i++) {\n b = bytes[i];\n switch (groupPos) {\n case 0:\n base64 += encTable[b \u003e\u003e 2];\n p = (b \u0026 3) \u003c\u003c 4;\n groupPos = 1;\n break;\n case 1:\n base64 += encTable[p | (b \u003e\u003e 4)];\n p = (b \u0026 15) \u003c\u003c 2;\n groupPos = 2;\n break;\n case 2:\n base64 += encTable[p | (b \u003e\u003e 6)];\n base64 += encTable[b \u0026 63];\n groupPos = 0;\n break;\n }\n }\n // padding required?\n if (groupPos) {\n base64 += encTable[p];\n base64 += \"=\";\n if (groupPos == 1)\n base64 += \"=\";\n }\n return base64;\n },\n};\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { unwrapField, wrapField } from \"./field-wrapper.js\";\nimport { ScalarType } from \"../field.js\";\nimport { assert, assertFloat32, assertInt32, assertUInt32 } from \"./assert.js\";\nimport { protoInt64 } from \"../proto-int64.js\";\nimport { protoBase64 } from \"../proto-base64.js\";\n/* eslint-disable no-case-declarations, @typescript-eslint/restrict-plus-operands,@typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-argument */\n// Default options for parsing JSON.\nconst jsonReadDefaults = {\n ignoreUnknownFields: false,\n};\n// Default options for serializing to JSON.\nconst jsonWriteDefaults = {\n emitDefaultValues: false,\n enumAsInteger: false,\n useProtoFieldName: false,\n prettySpaces: 0,\n};\nfunction makeReadOptions(options) {\n return options ? Object.assign(Object.assign({}, jsonReadDefaults), options) : jsonReadDefaults;\n}\nfunction makeWriteOptions(options) {\n return options ? Object.assign(Object.assign({}, jsonWriteDefaults), options) : jsonWriteDefaults;\n}\nexport function makeJsonFormatCommon(makeWriteField) {\n const writeField = makeWriteField(writeEnum, writeScalar);\n return {\n makeReadOptions,\n makeWriteOptions,\n readMessage(type, json, options, message) {\n if (json == null || Array.isArray(json) || typeof json != \"object\") {\n throw new Error(`cannot decode message ${type.typeName} from JSON: ${this.debug(json)}`);\n }\n message = message !== null \u0026\u0026 message !== void 0 ? message : new type();\n const oneofSeen = {};\n for (const [jsonKey, jsonValue] of Object.entries(json)) {\n const field = type.fields.findJsonName(jsonKey);\n if (!field) {\n if (!options.ignoreUnknownFields) {\n throw new Error(`cannot decode message ${type.typeName} from JSON: key \"${jsonKey}\" is unknown`);\n }\n continue;\n }\n let localName = field.localName;\n let target = message;\n if (field.oneof) {\n if (jsonValue === null \u0026\u0026 field.kind == \"scalar\") {\n // see conformance test Required.Proto3.JsonInput.OneofFieldNull{First,Second}\n continue;\n }\n const seen = oneofSeen[field.oneof.localName];\n if (seen) {\n throw new Error(`cannot decode message ${type.typeName} from JSON: multiple keys for oneof \"${field.oneof.name}\" present: \"${seen}\", \"${jsonKey}\"`);\n }\n oneofSeen[field.oneof.localName] = jsonKey;\n target = target[field.oneof.localName] = { case: localName };\n localName = \"value\";\n }\n if (field.repeated) {\n if (jsonValue === null) {\n continue;\n }\n if (!Array.isArray(jsonValue)) {\n throw new Error(`cannot decode field ${type.typeName}.${field.name} from JSON: ${this.debug(jsonValue)}`);\n }\n const targetArray = target[localName];\n for (const jsonItem of jsonValue) {\n if (jsonItem === null) {\n throw new Error(`cannot decode field ${type.typeName}.${field.name} from JSON: ${this.debug(jsonItem)}`);\n }\n let val;\n // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check -- \"map\" is invalid for repeated fields\n switch (field.kind) {\n case \"message\":\n val = field.T.fromJson(jsonItem, options);\n break;\n case \"enum\":\n val = readEnum(field.T, jsonItem, options.ignoreUnknownFields);\n if (val === undefined)\n continue;\n break;\n case \"scalar\":\n try {\n val = readScalar(field.T, jsonItem);\n }\n catch (e) {\n let m = `cannot decode field ${type.typeName}.${field.name} from JSON: ${this.debug(jsonItem)}`;\n if (e instanceof Error \u0026\u0026 e.message.length \u003e 0) {\n m += `: ${e.message}`;\n }\n throw new Error(m);\n }\n break;\n }\n targetArray.push(val);\n }\n }\n else if (field.kind == \"map\") {\n if (jsonValue === null) {\n continue;\n }\n if (Array.isArray(jsonValue) || typeof jsonValue != \"object\") {\n throw new Error(`cannot decode field ${type.typeName}.${field.name} from JSON: ${this.debug(jsonValue)}`);\n }\n const targetMap = target[localName];\n for (const [jsonMapKey, jsonMapValue] of Object.entries(jsonValue)) {\n if (jsonMapValue === null) {\n throw new Error(`cannot decode field ${type.typeName}.${field.name} from JSON: map value null`);\n }\n let val;\n switch (field.V.kind) {\n case \"message\":\n val = field.V.T.fromJson(jsonMapValue, options);\n break;\n case \"enum\":\n val = readEnum(field.V.T, jsonMapValue, options.ignoreUnknownFields);\n if (val === undefined)\n continue;\n break;\n case \"scalar\":\n try {\n val = readScalar(field.V.T, jsonMapValue);\n }\n catch (e) {\n let m = `cannot decode map value for field ${type.typeName}.${field.name} from JSON: ${this.debug(jsonValue)}`;\n if (e instanceof Error \u0026\u0026 e.message.length \u003e 0) {\n m += `: ${e.message}`;\n }\n throw new Error(m);\n }\n break;\n }\n try {\n targetMap[readScalar(field.K, field.K == ScalarType.BOOL\n ? jsonMapKey == \"true\"\n ? true\n : jsonMapKey == \"false\"\n ? false\n : jsonMapKey\n : jsonMapKey).toString()] = val;\n }\n catch (e) {\n let m = `cannot decode map key for field ${type.typeName}.${field.name} from JSON: ${this.debug(jsonValue)}`;\n if (e instanceof Error \u0026\u0026 e.message.length \u003e 0) {\n m += `: ${e.message}`;\n }\n throw new Error(m);\n }\n }\n }\n else {\n switch (field.kind) {\n case \"message\":\n const messageType = field.T;\n if (jsonValue === null \u0026\u0026\n messageType.typeName != \"google.protobuf.Value\") {\n if (field.oneof) {\n throw new Error(`cannot decode field ${type.typeName}.${field.name} from JSON: null is invalid for oneof field \"${jsonKey}\"`);\n }\n continue;\n }\n const targetMessage = target[localName] === undefined\n ? new messageType()\n : wrapField(messageType, target[localName]);\n target[localName] = unwrapField(messageType, targetMessage.fromJson(jsonValue, options));\n break;\n case \"enum\":\n const enumValue = readEnum(field.T, jsonValue, options.ignoreUnknownFields);\n if (enumValue !== undefined) {\n target[localName] = enumValue;\n }\n break;\n case \"scalar\":\n try {\n target[localName] = readScalar(field.T, jsonValue);\n }\n catch (e) {\n let m = `cannot decode field ${type.typeName}.${field.name} from JSON: ${this.debug(jsonValue)}`;\n if (e instanceof Error \u0026\u0026 e.message.length \u003e 0) {\n m += `: ${e.message}`;\n }\n throw new Error(m);\n }\n break;\n }\n }\n }\n return message;\n },\n writeMessage(message, options) {\n const type = message.getType();\n const json = {};\n let field;\n try {\n for (const member of type.fields.byMember()) {\n let jsonValue;\n if (member.kind == \"oneof\") {\n const oneof = message[member.localName];\n if (oneof.value === undefined) {\n continue;\n }\n field = member.findField(oneof.case);\n if (!field) {\n throw \"oneof case not found: \" + oneof.case;\n }\n jsonValue = writeField(field, oneof.value, options);\n }\n else {\n field = member;\n jsonValue = writeField(field, message[field.localName], options);\n }\n if (jsonValue !== undefined) {\n json[options.useProtoFieldName ? field.name : field.jsonName] =\n jsonValue;\n }\n }\n }\n catch (e) {\n const m = field\n ? `cannot encode field ${type.typeName}.${field.name} to JSON`\n : `cannot encode message ${type.typeName} to JSON`;\n const r = e instanceof Error ? e.message : String(e);\n throw new Error(m + (r.length \u003e 0 ? `: ${r}` : \"\"));\n }\n return json;\n },\n readScalar,\n writeScalar,\n debug: debugJsonValue,\n };\n}\nfunction debugJsonValue(json) {\n if (json === null) {\n return \"null\";\n }\n switch (typeof json) {\n case \"object\":\n return Array.isArray(json) ? \"array\" : \"object\";\n case \"string\":\n return json.length \u003e 100 ? \"string\" : `\"${json.split('\"').join('\\\\\"')}\"`;\n default:\n return json.toString();\n }\n}\n// May throw an error. If the error message is non-blank, it should be shown.\n// It is up to the caller to provide context.\nfunction readScalar(type, json) {\n // every valid case in the switch below returns, and every fall\n // through is regarded as a failure.\n switch (type) {\n // float, double: JSON value will be a number or one of the special string values \"NaN\", \"Infinity\", and \"-Infinity\".\n // Either numbers or strings are accepted. Exponent notation is also accepted.\n case ScalarType.DOUBLE:\n case ScalarType.FLOAT:\n if (json === null)\n return 0.0;\n if (json === \"NaN\")\n return Number.NaN;\n if (json === \"Infinity\")\n return Number.POSITIVE_INFINITY;\n if (json === \"-Infinity\")\n return Number.NEGATIVE_INFINITY;\n if (json === \"\") {\n // empty string is not a number\n break;\n }\n if (typeof json == \"string\" \u0026\u0026 json.trim().length !== json.length) {\n // extra whitespace\n break;\n }\n if (typeof json != \"string\" \u0026\u0026 typeof json != \"number\") {\n break;\n }\n const float = Number(json);\n if (Number.isNaN(float)) {\n // not a number\n break;\n }\n if (!Number.isFinite(float)) {\n // infinity and -infinity are handled by string representation above, so this is an error\n break;\n }\n if (type == ScalarType.FLOAT)\n assertFloat32(float);\n return float;\n // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted.\n case ScalarType.INT32:\n case ScalarType.FIXED32:\n case ScalarType.SFIXED32:\n case ScalarType.SINT32:\n case ScalarType.UINT32:\n if (json === null)\n return 0;\n let int32;\n if (typeof json == \"number\")\n int32 = json;\n else if (typeof json == \"string\" \u0026\u0026 json.length \u003e 0) {\n if (json.trim().length === json.length)\n int32 = Number(json);\n }\n if (int32 === undefined)\n break;\n if (type == ScalarType.UINT32)\n assertUInt32(int32);\n else\n assertInt32(int32);\n return int32;\n // int64, fixed64, uint64: JSON value will be a decimal string. Either numbers or strings are accepted.\n case ScalarType.INT64:\n case ScalarType.SFIXED64:\n case ScalarType.SINT64:\n if (json === null)\n return protoInt64.zero;\n if (typeof json != \"number\" \u0026\u0026 typeof json != \"string\")\n break;\n return protoInt64.parse(json);\n case ScalarType.FIXED64:\n case ScalarType.UINT64:\n if (json === null)\n return protoInt64.zero;\n if (typeof json != \"number\" \u0026\u0026 typeof json != \"string\")\n break;\n return protoInt64.uParse(json);\n // bool:\n case ScalarType.BOOL:\n if (json === null)\n return false;\n if (typeof json !== \"boolean\")\n break;\n return json;\n // string:\n case ScalarType.STRING:\n if (json === null)\n return \"\";\n if (typeof json !== \"string\") {\n break;\n }\n // A string must always contain UTF-8 encoded or 7-bit ASCII.\n // We validate with encodeURIComponent, which appears to be the fastest widely available option.\n try {\n encodeURIComponent(json);\n }\n catch (e) {\n throw new Error(\"invalid UTF8\");\n }\n return json;\n // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings.\n // Either standard or URL-safe base64 encoding with/without paddings are accepted.\n case ScalarType.BYTES:\n if (json === null || json === \"\")\n return new Uint8Array(0);\n if (typeof json !== \"string\")\n break;\n return protoBase64.dec(json);\n }\n throw new Error();\n}\nfunction readEnum(type, json, ignoreUnknownFields) {\n if (json === null) {\n // proto3 requires 0 to be default value for all enums\n return 0;\n }\n // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check\n switch (typeof json) {\n case \"number\":\n if (Number.isInteger(json)) {\n return json;\n }\n break;\n case \"string\":\n const value = type.findName(json);\n if (value || ignoreUnknownFields) {\n return value === null || value === void 0 ? void 0 : value.no;\n }\n break;\n }\n throw new Error(`cannot decode enum ${type.typeName} from JSON: ${debugJsonValue(json)}`);\n}\nfunction writeEnum(type, value, emitIntrinsicDefault, enumAsInteger) {\n var _a;\n if (value === undefined) {\n return value;\n }\n if (value === 0 \u0026\u0026 !emitIntrinsicDefault) {\n // proto3 requires 0 to be default value for all enums\n return undefined;\n }\n if (enumAsInteger) {\n return value;\n }\n if (type.typeName == \"google.protobuf.NullValue\") {\n return null;\n }\n const val = type.findNumber(value);\n return (_a = val === null || val === void 0 ? void 0 : val.name) !== null \u0026\u0026 _a !== void 0 ? _a : value; // if we don't know the enum value, just return the number\n}\nfunction writeScalar(type, value, emitIntrinsicDefault) {\n if (value === undefined) {\n return undefined;\n }\n switch (type) {\n // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted.\n case ScalarType.INT32:\n case ScalarType.SFIXED32:\n case ScalarType.SINT32:\n case ScalarType.FIXED32:\n case ScalarType.UINT32:\n assert(typeof value == \"number\");\n return value != 0 || emitIntrinsicDefault ? value : undefined;\n // float, double: JSON value will be a number or one of the special string values \"NaN\", \"Infinity\", and \"-Infinity\".\n // Either numbers or strings are accepted. Exponent notation is also accepted.\n case ScalarType.FLOAT:\n // assertFloat32(value);\n case ScalarType.DOUBLE: // eslint-disable-line no-fallthrough\n assert(typeof value == \"number\");\n if (Number.isNaN(value))\n return \"NaN\";\n if (value === Number.POSITIVE_INFINITY)\n return \"Infinity\";\n if (value === Number.NEGATIVE_INFINITY)\n return \"-Infinity\";\n return value !== 0 || emitIntrinsicDefault ? value : undefined;\n // string:\n case ScalarType.STRING:\n assert(typeof value == \"string\");\n return value.length \u003e 0 || emitIntrinsicDefault ? value : undefined;\n // bool:\n case ScalarType.BOOL:\n assert(typeof value == \"boolean\");\n return value || emitIntrinsicDefault ? value : undefined;\n // JSON value will be a decimal string. Either numbers or strings are accepted.\n case ScalarType.UINT64:\n case ScalarType.FIXED64:\n case ScalarType.INT64:\n case ScalarType.SFIXED64:\n case ScalarType.SINT64:\n assert(typeof value == \"bigint\" ||\n typeof value == \"string\" ||\n typeof value == \"number\");\n // We use implicit conversion with `value != 0` to catch both 0n and \"0\"\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return emitIntrinsicDefault || value != 0\n ? value.toString(10)\n : undefined;\n // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings.\n // Either standard or URL-safe base64 encoding with/without paddings are accepted.\n case ScalarType.BYTES:\n assert(value instanceof Uint8Array);\n return emitIntrinsicDefault || value.byteLength \u003e 0\n ? protoBase64.enc(value)\n : undefined;\n }\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { setEnumType } from \"./enum.js\";\nimport { ScalarType } from \"../field.js\";\nimport { scalarEquals } from \"./scalars.js\";\n/* eslint-disable @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-argument,no-case-declarations */\nexport function makeUtilCommon() {\n return {\n setEnumType,\n initPartial(source, target) {\n if (source === undefined) {\n return;\n }\n const type = target.getType();\n for (const member of type.fields.byMember()) {\n const localName = member.localName, t = target, s = source;\n if (s[localName] === undefined) {\n continue;\n }\n switch (member.kind) {\n case \"oneof\":\n const sk = s[localName].case;\n if (sk === undefined) {\n continue;\n }\n const sourceField = member.findField(sk);\n let val = s[localName].value;\n if (sourceField \u0026\u0026\n sourceField.kind == \"message\" \u0026\u0026\n !(val instanceof sourceField.T)) {\n val = new sourceField.T(val);\n }\n t[localName] = { case: sk, value: val };\n break;\n case \"scalar\":\n case \"enum\":\n t[localName] = s[localName];\n break;\n case \"map\":\n switch (member.V.kind) {\n case \"scalar\":\n case \"enum\":\n Object.assign(t[localName], s[localName]);\n break;\n case \"message\":\n const messageType = member.V.T;\n for (const k of Object.keys(s[localName])) {\n let val = s[localName][k];\n if (!messageType.fieldWrapper) {\n // We only take partial input for messages that are not a wrapper type.\n // For those messages, we recursively normalize the partial input.\n val = new messageType(val);\n }\n t[localName][k] = val;\n }\n break;\n }\n break;\n case \"message\":\n const mt = member.T;\n if (member.repeated) {\n t[localName] = s[localName].map((val) =\u003e val instanceof mt ? val : new mt(val));\n }\n else if (s[localName] !== undefined) {\n const val = s[localName];\n if (mt.fieldWrapper) {\n t[localName] = val;\n }\n else {\n t[localName] = val instanceof mt ? val : new mt(val);\n }\n }\n break;\n }\n }\n },\n equals(type, a, b) {\n if (a === b) {\n return true;\n }\n if (!a || !b) {\n return false;\n }\n return type.fields.byMember().every((m) =\u003e {\n const va = a[m.localName];\n const vb = b[m.localName];\n if (m.repeated) {\n if (va.length !== vb.length) {\n return false;\n }\n // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check -- repeated fields are never \"map\"\n switch (m.kind) {\n case \"message\":\n return va.every((a, i) =\u003e m.T.equals(a, vb[i]));\n case \"scalar\":\n return va.every((a, i) =\u003e scalarEquals(m.T, a, vb[i]));\n case \"enum\":\n return va.every((a, i) =\u003e scalarEquals(ScalarType.INT32, a, vb[i]));\n }\n throw new Error(`repeated cannot contain ${m.kind}`);\n }\n switch (m.kind) {\n case \"message\":\n return m.T.equals(va, vb);\n case \"enum\":\n return scalarEquals(ScalarType.INT32, va, vb);\n case \"scalar\":\n return scalarEquals(m.T, va, vb);\n case \"oneof\":\n if (va.case !== vb.case) {\n return false;\n }\n const k = va.case, s = m.findField(k);\n if (s === undefined) {\n return true;\n }\n // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check -- oneof fields are never \"map\"\n switch (s.kind) {\n case \"message\":\n return s.T.equals(va[k], vb[k]);\n case \"enum\":\n return scalarEquals(ScalarType.INT32, va, vb);\n case \"scalar\":\n return scalarEquals(s.T, va, vb);\n }\n throw new Error(`oneof cannot contain ${s.kind}`);\n case \"map\":\n const keys = Object.keys(va);\n if (keys.some((k) =\u003e vb[k] === undefined)) {\n return false;\n }\n switch (m.V.kind) {\n case \"message\":\n const messageType = m.V.T;\n return keys.every((k) =\u003e messageType.equals(va[k], vb[k]));\n case \"enum\":\n return keys.every((k) =\u003e scalarEquals(ScalarType.INT32, va[k], vb[k]));\n case \"scalar\":\n const scalarType = m.V.T;\n return keys.every((k) =\u003e scalarEquals(scalarType, va[k], vb[k]));\n }\n break;\n }\n });\n },\n clone(message) {\n const type = message.getType(), target = new type(), any = target;\n for (const member of type.fields.byMember()) {\n const source = message[member.localName];\n let copy;\n if (member.repeated) {\n copy = source.map((e) =\u003e cloneSingularField(member, e));\n }\n else if (member.kind == \"map\") {\n copy = any[member.localName];\n for (const [key, v] of Object.entries(source)) {\n copy[key] = cloneSingularField(member.V, v);\n }\n }\n else if (member.kind == \"oneof\") {\n const f = member.findField(source.case);\n copy = f\n ? { case: source.case, value: cloneSingularField(f, source.value) }\n : { case: undefined };\n }\n else {\n copy = cloneSingularField(member, source);\n }\n any[member.localName] = copy;\n }\n return target;\n },\n };\n}\n// clone a single field value - i.e. the element type of repeated fields, the value type of maps\nfunction cloneSingularField(field, value) {\n if (value === undefined) {\n return value;\n }\n // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check -- unmatched \"map\" is unsupported\n switch (field.kind) {\n case \"enum\":\n return value;\n case \"scalar\":\n if (field.T === ScalarType.BYTES) {\n const c = new Uint8Array(value.byteLength);\n c.set(value);\n return c;\n }\n return value;\n case \"message\":\n if (field.T.fieldWrapper) {\n return field.T.fieldWrapper.unwrapField(field.T.fieldWrapper.wrapField(value).clone());\n }\n return value.clone();\n }\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nexport class InternalFieldList {\n constructor(fields, normalizer) {\n this._fields = fields;\n this._normalizer = normalizer;\n }\n findJsonName(jsonName) {\n if (!this.jsonNames) {\n const t = {};\n for (const f of this.list()) {\n t[f.jsonName] = t[f.name] = f;\n }\n this.jsonNames = t;\n }\n return this.jsonNames[jsonName];\n }\n find(fieldNo) {\n if (!this.numbers) {\n const t = {};\n for (const f of this.list()) {\n t[f.no] = f;\n }\n this.numbers = t;\n }\n return this.numbers[fieldNo];\n }\n list() {\n if (!this.all) {\n this.all = this._normalizer(this._fields);\n }\n return this.all;\n }\n byNumber() {\n if (!this.numbersAsc) {\n this.numbersAsc = this.list()\n .concat()\n .sort((a, b) =\u003e a.no - b.no);\n }\n return this.numbersAsc;\n }\n byMember() {\n if (!this.members) {\n this.members = [];\n const a = this.members;\n let o;\n for (const f of this.list()) {\n if (f.oneof) {\n if (f.oneof !== o) {\n o = f.oneof;\n a.push(o);\n }\n }\n else {\n a.push(f);\n }\n }\n }\n return this.members;\n }\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n/**\n * Returns the name of a protobuf element in generated code.\n *\n * Field names - including oneofs - are converted to lowerCamelCase. For\n * messages, enumerations and services, the package name is stripped from\n * the type name. For nested messages and enumerations, the names are joined\n * with an underscore. For methods, the first character is made lowercase.\n */\nexport function localName(desc) {\n switch (desc.kind) {\n case \"field\":\n return localFieldName(desc.name, desc.oneof !== undefined);\n case \"oneof\":\n return localOneofName(desc.name);\n case \"enum\":\n case \"message\":\n case \"service\": {\n const pkg = desc.file.proto.package;\n const offset = pkg === undefined ? 0 : pkg.length + 1;\n const name = desc.typeName.substring(offset).replace(/\\./g, \"_\");\n if (reservedIdent[name]) {\n return name + \"$\";\n }\n return name;\n }\n case \"enum_value\": {\n const sharedPrefix = desc.parent.sharedPrefix;\n if (sharedPrefix === undefined) {\n return desc.name;\n }\n const name = desc.name.substring(sharedPrefix.length);\n if (reservedObjectProperties[name]) {\n return name + \"$\";\n }\n return name;\n }\n case \"rpc\": {\n let name = desc.name;\n if (name.length == 0) {\n return name;\n }\n name = name[0].toLowerCase() + name.substring(1);\n if (reservedObjectProperties[name]) {\n return name + \"$\";\n }\n return name;\n }\n }\n}\n/**\n * Returns the name of a field in generated code.\n */\nexport function localFieldName(protoName, inOneof) {\n let name = protoCamelCase(protoName);\n if (inOneof) {\n // oneof member names are not properties, but values of the `case` property.\n return name;\n }\n if (reservedObjectProperties[name] || reservedMessageProperties[name]) {\n name = name + \"$\";\n }\n return name;\n}\n/**\n * Returns the name of a oneof group in generated code.\n */\nexport function localOneofName(protoName) {\n return localFieldName(protoName, false);\n}\n/**\n * Returns the JSON name for a protobuf field, exactly like protoc does.\n */\nexport const fieldJsonName = protoCamelCase;\n/**\n * Finds a prefix shared by enum values, for example `MY_ENUM_` for\n * `enum MyEnum {MY_ENUM_A=0; MY_ENUM_B=1;}`.\n */\nexport function findEnumSharedPrefix(enumName, valueNames) {\n const prefix = camelToSnakeCase(enumName) + \"_\";\n for (const name of valueNames) {\n if (!name.toLowerCase().startsWith(prefix)) {\n return undefined;\n }\n const shortName = name.substring(prefix.length);\n if (shortName.length == 0) {\n return undefined;\n }\n if (/^\\d/.test(shortName)) {\n // identifiers must not start with numbers\n return undefined;\n }\n }\n return prefix;\n}\n/**\n * Converts lowerCamelCase or UpperCamelCase into lower_snake_case.\n * This is used to find shared prefixes in an enum.\n */\nfunction camelToSnakeCase(camel) {\n return (camel.substring(0, 1) + camel.substring(1).replace(/[A-Z]/g, (c) =\u003e \"_\" + c)).toLowerCase();\n}\n/**\n * Converts snake_case to protoCamelCase according to the convention\n * used by protoc to convert a field name to a JSON name.\n */\nfunction protoCamelCase(snakeCase) {\n let capNext = false;\n const b = [];\n for (let i = 0; i \u003c snakeCase.length; i++) {\n let c = snakeCase.charAt(i);\n switch (c) {\n case \"_\":\n capNext = true;\n break;\n case \"0\":\n case \"1\":\n case \"2\":\n case \"3\":\n case \"4\":\n case \"5\":\n case \"6\":\n case \"7\":\n case \"8\":\n case \"9\":\n b.push(c);\n capNext = false;\n break;\n default:\n if (capNext) {\n capNext = false;\n c = c.toUpperCase();\n }\n b.push(c);\n break;\n }\n }\n return b.join(\"\");\n}\n// Names that cannot be used for identifiers, such as class names,\n// but _can_ be used for object properties.\nconst reservedIdent = {\n // ECMAScript 2015 keywords\n break: true,\n case: true,\n catch: true,\n class: true,\n const: true,\n continue: true,\n debugger: true,\n default: true,\n delete: true,\n do: true,\n else: true,\n export: true,\n extends: true,\n false: true,\n finally: true,\n for: true,\n function: true,\n if: true,\n import: true,\n in: true,\n instanceof: true,\n new: true,\n null: true,\n return: true,\n super: true,\n switch: true,\n this: true,\n throw: true,\n true: true,\n try: true,\n typeof: true,\n var: true,\n void: true,\n while: true,\n with: true,\n yield: true,\n // ECMAScript 2015 future reserved keywords\n enum: true,\n implements: true,\n interface: true,\n let: true,\n package: true,\n private: true,\n protected: true,\n public: true,\n static: true,\n // Class name cannot be 'Object' when targeting ES5 with module CommonJS\n Object: true,\n // TypeScript keywords that cannot be used for types (as opposed to variables)\n bigint: true,\n number: true,\n boolean: true,\n string: true,\n object: true,\n // Identifiers reserved for the runtime, so we can generate legible code\n globalThis: true,\n Uint8Array: true,\n Partial: true,\n};\n// Names that cannot be used for object properties because they are reserved\n// by built-in JavaScript properties.\nconst reservedObjectProperties = {\n // names reserved by JavaScript\n constructor: true,\n toString: true,\n toJSON: true,\n valueOf: true,\n};\n// Names that cannot be used for object properties because they are reserved\n// by the runtime.\nconst reservedMessageProperties = {\n // names reserved by the runtime\n getType: true,\n clone: true,\n equals: true,\n fromBinary: true,\n fromJson: true,\n fromJsonString: true,\n toBinary: true,\n toJson: true,\n toJsonString: true,\n // names reserved by the runtime for the future\n toObject: true,\n};\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { localOneofName } from \"./names.js\";\nimport { assert } from \"./assert.js\";\nexport class InternalOneofInfo {\n constructor(name) {\n this.kind = \"oneof\";\n this.repeated = false;\n this.packed = false;\n this.opt = false;\n this.default = undefined;\n this.fields = [];\n this.name = name;\n this.localName = localOneofName(name);\n }\n addField(field) {\n assert(field.oneof === this, `field ${field.name} not one of ${this.name}`);\n this.fields.push(field);\n }\n findField(localName) {\n if (!this._lookup) {\n this._lookup = Object.create(null);\n for (let i = 0; i \u003c this.fields.length; i++) {\n this._lookup[this.fields[i].localName] = this.fields[i];\n }\n }\n return this._lookup[localName];\n }\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { makeProtoRuntime } from \"./private/proto-runtime.js\";\nimport { makeBinaryFormatProto3 } from \"./private/binary-format-proto3.js\";\nimport { makeJsonFormatProto3 } from \"./private/json-format-proto3.js\";\nimport { makeUtilCommon } from \"./private/util-common.js\";\nimport { InternalFieldList } from \"./private/field-list.js\";\nimport { scalarDefaultValue } from \"./private/scalars.js\";\nimport { ScalarType } from \"./field.js\";\nimport { InternalOneofInfo } from \"./private/field.js\";\nimport { localFieldName, fieldJsonName } from \"./private/names.js\";\n/**\n * Provides functionality for messages defined with the proto3 syntax.\n */\nexport const proto3 = makeProtoRuntime(\"proto3\", makeJsonFormatProto3(), makeBinaryFormatProto3(), Object.assign(Object.assign({}, makeUtilCommon()), { newFieldList(fields) {\n return new InternalFieldList(fields, normalizeFieldInfosProto3);\n },\n initFields(target) {\n for (const member of target.getType().fields.byMember()) {\n if (member.opt) {\n continue;\n }\n const name = member.localName, t = target;\n if (member.repeated) {\n t[name] = [];\n continue;\n }\n switch (member.kind) {\n case \"oneof\":\n t[name] = { case: undefined };\n break;\n case \"enum\":\n t[name] = 0;\n break;\n case \"map\":\n t[name] = {};\n break;\n case \"scalar\":\n t[name] = scalarDefaultValue(member.T); // eslint-disable-line @typescript-eslint/no-unsafe-assignment\n break;\n case \"message\":\n // message fields are always optional in proto3\n break;\n }\n }\n } }));\n/* eslint-disable @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-argument */\nfunction normalizeFieldInfosProto3(fieldInfos) {\n var _a, _b, _c;\n const r = [];\n let o;\n for (const field of typeof fieldInfos == \"function\"\n ? fieldInfos()\n : fieldInfos) {\n const f = field;\n f.localName = localFieldName(field.name, field.oneof !== undefined);\n f.jsonName = (_a = field.jsonName) !== null \u0026\u0026 _a !== void 0 ? _a : fieldJsonName(field.name);\n f.repeated = (_b = field.repeated) !== null \u0026\u0026 _b !== void 0 ? _b : false;\n // From the proto3 language guide:\n // \u003e In proto3, repeated fields of scalar numeric types are packed by default.\n // This information is incomplete - according to the conformance tests, BOOL\n // and ENUM are packed by default as well. This means only STRING and BYTES\n // are not packed by default, which makes sense because they are length-delimited.\n f.packed =\n (_c = field.packed) !== null \u0026\u0026 _c !== void 0 ? _c : (field.kind == \"enum\" ||\n (field.kind == \"scalar\" \u0026\u0026\n field.T != ScalarType.BYTES \u0026\u0026\n field.T != ScalarType.STRING));\n // We do not surface options at this time\n // f.options = field.options ?? emptyReadonlyObject;\n if (field.oneof !== undefined) {\n const ooname = typeof field.oneof == \"string\" ? field.oneof : field.oneof.name;\n if (!o || o.name != ooname) {\n o = new InternalOneofInfo(ooname);\n }\n f.oneof = o;\n o.addField(f);\n }\n r.push(f);\n }\n return r;\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { wrapField } from \"./field-wrapper.js\";\nimport { assert } from \"./assert.js\";\nimport { makeJsonFormatCommon } from \"./json-format-common.js\";\n/* eslint-disable no-case-declarations, @typescript-eslint/restrict-plus-operands,@typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-argument */\nexport function makeJsonFormatProto3() {\n return makeJsonFormatCommon((writeEnum, writeScalar) =\u003e {\n return function writeField(field, value, options) {\n if (field.kind == \"map\") {\n const jsonObj = {};\n switch (field.V.kind) {\n case \"scalar\":\n for (const [entryKey, entryValue] of Object.entries(value)) {\n const val = writeScalar(field.V.T, entryValue, true);\n assert(val !== undefined);\n jsonObj[entryKey.toString()] = val; // JSON standard allows only (double quoted) string as property key\n }\n break;\n case \"message\":\n for (const [entryKey, entryValue] of Object.entries(value)) {\n // JSON standard allows only (double quoted) string as property key\n jsonObj[entryKey.toString()] = entryValue.toJson(options);\n }\n break;\n case \"enum\":\n const enumType = field.V.T;\n for (const [entryKey, entryValue] of Object.entries(value)) {\n assert(entryValue === undefined || typeof entryValue == \"number\");\n const val = writeEnum(enumType, entryValue, true, options.enumAsInteger);\n assert(val !== undefined);\n jsonObj[entryKey.toString()] = val; // JSON standard allows only (double quoted) string as property key\n }\n break;\n }\n return options.emitDefaultValues || Object.keys(jsonObj).length \u003e 0\n ? jsonObj\n : undefined;\n }\n else if (field.repeated) {\n const jsonArr = [];\n switch (field.kind) {\n case \"scalar\":\n for (let i = 0; i \u003c value.length; i++) {\n jsonArr.push(writeScalar(field.T, value[i], true));\n }\n break;\n case \"enum\":\n for (let i = 0; i \u003c value.length; i++) {\n jsonArr.push(writeEnum(field.T, value[i], true, options.enumAsInteger));\n }\n break;\n case \"message\":\n for (let i = 0; i \u003c value.length; i++) {\n jsonArr.push(wrapField(field.T, value[i]).toJson(options));\n }\n break;\n }\n return options.emitDefaultValues || jsonArr.length \u003e 0\n ? jsonArr\n : undefined;\n }\n else {\n switch (field.kind) {\n case \"scalar\":\n return writeScalar(field.T, value, !!field.oneof || field.opt || options.emitDefaultValues);\n case \"enum\":\n return writeEnum(field.T, value, !!field.oneof || field.opt || options.emitDefaultValues, options.enumAsInteger);\n case \"message\":\n return value !== undefined\n ? wrapField(field.T, value).toJson(options)\n : undefined;\n }\n }\n };\n });\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { ScalarType } from \"../field.js\";\nimport { makeBinaryFormatCommon, writeMapEntry, writeMessageField, writePacked, writeScalar, } from \"./binary-format-common.js\";\n/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unnecessary-condition, @typescript-eslint/strict-boolean-expressions, prefer-const, no-case-declarations */\nexport function makeBinaryFormatProto3() {\n return Object.assign(Object.assign({}, makeBinaryFormatCommon()), { writeMessage(message, writer, options) {\n const type = message.getType();\n for (const field of type.fields.byNumber()) {\n let value, // this will be our field value, whether it is member of a oneof or regular field\n repeated = field.repeated, localName = field.localName;\n if (field.oneof) {\n const oneof = message[field.oneof.localName];\n if (oneof.case !== localName) {\n continue; // field is not selected, skip\n }\n value = oneof.value;\n }\n else {\n value = message[localName];\n }\n switch (field.kind) {\n case \"scalar\":\n case \"enum\":\n let scalarType = field.kind == \"enum\" ? ScalarType.INT32 : field.T;\n if (repeated) {\n if (field.packed) {\n writePacked(writer, scalarType, field.no, value);\n }\n else {\n for (const item of value) {\n writeScalar(writer, scalarType, field.no, item, true);\n }\n }\n }\n else {\n if (value !== undefined) {\n writeScalar(writer, scalarType, field.no, value, !!field.oneof || field.opt);\n }\n }\n break;\n case \"message\":\n if (repeated) {\n for (const item of value) {\n writeMessageField(writer, options, field.T, field.no, item);\n }\n }\n else {\n writeMessageField(writer, options, field.T, field.no, value);\n }\n break;\n case \"map\":\n for (const [key, val] of Object.entries(value)) {\n writeMapEntry(writer, options, field, key, val);\n }\n break;\n }\n }\n if (options.writeUnknownFields) {\n this.writeUnknownFields(message, writer);\n }\n return writer;\n } });\n}\n","// Copyright 2021-2022 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { Message } from \"../../message.js\";\nimport { proto3 } from \"../../proto3.js\";\n/**\n * `Any` contains an arbitrary serialized protocol buffer message along with a\n * URL that describes the type of the serialized message.\n *\n * Protobuf library provides support to pack/unpack Any values in the form\n * of utility functions or additional generated methods of the Any type.\n *\n * Example 1: Pack and unpack a message in C++.\n *\n * Foo foo = ...;\n * Any any;\n * any.PackFrom(foo);\n * ...\n * if (any.UnpackTo(\u0026foo)) {\n * ...\n * }\n *\n * Example 2: Pack and unpack a message in Java.\n *\n * Foo foo = ...;\n * Any any = Any.pack(foo);\n * ...\n * if (any.is(Foo.class)) {\n * foo = any.unpack(Foo.class);\n * }\n *\n * Example 3: Pack and unpack a message in Python.\n *\n * foo = Foo(...)\n * any = Any()\n * any.Pack(foo)\n * ...\n * if any.Is(Foo.DESCRIPTOR):\n * any.Unpack(foo)\n * ...\n *\n * Example 4: Pack and unpack a message in Go\n *\n * foo := \u0026pb.Foo{...}\n * any, err := anypb.New(foo)\n * if err != nil {\n * ...\n * }\n * ...\n * foo := \u0026pb.Foo{}\n * if err := any.UnmarshalTo(foo); err != nil {\n * ...\n * }\n *\n * The pack methods provided by protobuf library will by default use\n * 'type.googleapis.com/full.type.name' as the type URL and the unpack\n * methods only use the fully qualified type name after the last '/'\n * in the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n * name \"y.z\".\n *\n *\n * JSON\n *\n * The JSON representation of an `Any` value uses the regular\n * representation of the deserialized, embedded message, with an\n * additional field `@type` which contains the type URL. Example:\n *\n * package google.profile;\n * message Person {\n * string first_name = 1;\n * string last_name = 2;\n * }\n *\n * {\n * \"@type\": \"type.googleapis.com/google.profile.Person\",\n * \"firstName\": \u003cstring\u003e,\n * \"lastName\": \u003cstring\u003e\n * }\n *\n * If the embedded message type is well-known and has a custom JSON\n * representation, that representation will be embedded adding a field\n * `value` which holds the custom JSON in addition to the `@type`\n * field. Example (for message [google.protobuf.Duration][]):\n *\n * {\n * \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n * \"value\": \"1.212s\"\n * }\n *\n *\n * @generated from message google.protobuf.Any\n */\nexport class Any extends Message {\n constructor(data) {\n super();\n /**\n * A URL/resource name that uniquely identifies the type of the serialized\n * protocol buffer message. This string must contain at least\n * one \"/\" character. The last segment of the URL's path must represent\n * the fully qualified name of the type (as in\n * `path/google.protobuf.Duration`). The name should be in a canonical form\n * (e.g., leading \".\" is not accepted).\n *\n * In practice, teams usually precompile into the binary all types that they\n * expect it to use in the context of Any. However, for URLs which use the\n * scheme `http`, `https`, or no scheme, one can optionally set up a type\n * server that maps type URLs to message definitions as follows:\n *\n * * If no scheme is provided, `https` is assumed.\n * * An HTTP GET on the URL must yield a [google.protobuf.Type][]\n * value in binary format, or produce an error.\n * * Applications are allowed to cache lookup results based on the\n * URL, or have them precompiled into a binary to avoid any\n * lookup. Therefore, binary compatibility needs to be preserved\n * on changes to types. (Use versioned type names to manage\n * breaking changes.)\n *\n * Note: this functionality is not currently available in the official\n * protobuf release, and it is not used for type URLs beginning with\n * type.googleapis.com.\n *\n * Schemes other than `http`, `https` (or the empty scheme) might be\n * used with implementation specific semantics.\n *\n *\n * @generated from field: string type_url = 1;\n */\n this.typeUrl = \"\";\n /**\n * Must be a valid serialized protocol buffer of the above specified type.\n *\n * @generated from field: bytes value = 2;\n */\n this.value = new Uint8Array(0);\n proto3.util.initPartial(data, this);\n }\n toJson(options) {\n var _a;\n if (this.typeUrl === \"\") {\n return {};\n }\n const typeName = this.typeUrlToName(this.typeUrl);\n const messageType = (_a = options === null || options === void 0 ? void 0 : options.typeRegistry) === null || _a === void 0 ? void 0 : _a.findMessage(typeName);\n if (!messageType) {\n throw new Error(`cannot encode message google.protobuf.Any to JSON: \"${this.typeUrl}\" is not in the type registry`);\n }\n const message = messageType.fromBinary(this.value);\n let json = message.toJson(options);\n if (typeName.startsWith(\"google.protobuf.\") || (json === null || Array.isArray(json) || typeof json !== \"object\")) {\n json = { value: json };\n }\n json[\"@type\"] = this.typeUrl;\n return json;\n }\n fromJson(json, options) {\n var _a;\n if (json === null || Array.isArray(json) || typeof json != \"object\") {\n throw new Error(`cannot decode message google.protobuf.Any from JSON: expected object but got ${json === null ? \"null\" : Array.isArray(json) ? \"array\" : typeof json}`);\n }\n if (Object.keys(json).length == 0) {\n return this;\n }\n const typeUrl = json[\"@type\"];\n if (typeof typeUrl != \"string\" || typeUrl == \"\") {\n throw new Error(`cannot decode message google.protobuf.Any from JSON: \"@type\" is empty`);\n }\n const typeName = this.typeUrlToName(typeUrl), messageType = (_a = options === null || options === void 0 ? void 0 : options.typeRegistry) === null || _a === void 0 ? void 0 : _a.findMessage(typeName);\n if (!messageType) {\n throw new Error(`cannot decode message google.protobuf.Any from JSON: ${typeUrl} is not in the type registry`);\n }\n let message;\n if (typeName.startsWith(\"google.protobuf.\") \u0026\u0026 Object.prototype.hasOwnProperty.call(json, \"value\")) {\n message = messageType.fromJson(json[\"value\"], options);\n }\n else {\n const copy = Object.assign({}, json);\n delete copy[\"@type\"];\n message = messageType.fromJson(copy, options);\n }\n this.packFrom(message);\n return this;\n }\n packFrom(message) {\n this.value = message.toBinary();\n this.typeUrl = this.typeNameToUrl(message.getType().typeName);\n }\n unpackTo(target) {\n if (!this.is(target.getType())) {\n return false;\n }\n target.fromBinary(this.value);\n return true;\n }\n is(type) {\n return this.typeUrl === this.typeNameToUrl(type.typeName);\n }\n typeNameToUrl(name) {\n return `type.googleapis.com/${name}`;\n }\n typeUrlToName(url) {\n if (!url.length) {\n throw new Error(`invalid type url: ${url}`);\n }\n const slash = url.lastIndexOf(\"/\");\n const name = slash \u003e 0 ? url.substring(slash + 1) : url;\n if (!name.length) {\n throw new Error(`invalid type url: ${url}`);\n }\n return name;\n }\n static pack(message) {\n const any = new Any();\n any.packFrom(message);\n return any;\n }\n static fromBinary(bytes, options) {\n return new Any().fromBinary(bytes, options);\n }\n static fromJson(jsonValue, options) {\n return new Any().fromJson(jsonValue, options);\n }\n static fromJsonString(jsonString, options) {\n return new Any().fromJsonString(jsonString, options);\n }\n static equals(a, b) {\n return proto3.util.equals(Any, a, b);\n }\n}\nAny.runtime = proto3;\nAny.typeName = \"google.protobuf.Any\";\nAny.fields = proto3.util.newFieldList(() =\u003e [\n { no: 1, name: \"type_url\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 2, name: \"value\", kind: \"scalar\", T: 12 /* ScalarType.BYTES */ },\n]);\n","import type {Message, MessageType} from '@bufbuild/protobuf';\nimport {reportStack, SEVERITY} from 'metaserver/static/js/core/exception';\n\nimport {Any, protoBase64} from '@bufbuild/protobuf';\n\n/**\n * Unmarshalls given base64-encoded proto message to a protobuf-es proto object of a known type.\n * This function is used for migration to prorobuf-es.\n */\nexport function unmarshalProto\u003cT extends Message\u003cT\u003e\u003e(\n encodedProto: string | Uint8Array,\n expectedProto: MessageType\u003cT\u003e\n): T {\n const decodedData =\n typeof encodedProto === 'string' ? protoBase64.dec(encodedProto) : encodedProto;\n try {\n const any = Any.fromBinary(decodedData);\n if (any \u0026\u0026 any.typeUrl \u0026\u0026 any.typeUrl.startsWith('type.googleapis.com/') \u0026\u0026 any.value) {\n return expectedProto.fromBinary(any.value);\n }\n } catch (e) {\n // no-op: this just means we couldn't successfully decode the binary as a\n // proto any. it still might be a valid non-wrapped proto message\n }\n try {\n return expectedProto.fromBinary(decodedData);\n } catch (e) {\n throw new Error(`Invalid data while trying to unpack encoded proto: ${e}`);\n }\n}\n\n/**\n * Marshals given proto message to a base64 encoded string.\n * This function is used for migration to prorobuf-es.\n */\nexport function marshalProto\u003cT extends Message\u003cT\u003e\u003e(protoMessage: T): string {\n return protoBase64.enc(protoMessage.toBinary());\n}\n\n/**\n * Wraps given data in protobuf Any.\n */\nexport function wrapInAny\u003cP extends Message\u003cP\u003e\u003e(data: P, typeUrl?: string): Any {\n return new Any({\n // NOTE(lennart) when we create proto anys with this function for unit testing\n // purposes we know the type of what we're trying to serialize, so allow\n // setting the typeUrl manually\n typeUrl,\n value: data.toBinary(),\n });\n}\n\nconst MAX_SAFE_INT = 2 ** 53;\n\nexport function toNumber(value: bigint | number | string | undefined | null): number | undefined {\n switch (typeof value) {\n case 'string':\n return value ? Number(value) : undefined;\n case 'number':\n return value as number;\n case 'bigint':\n // bigint values with absolute value \u003e 2^53 will lose precision when\n // represented in js numbers which is double-precision floating point.\n // If these are used for various ids instead of numeric values (number\n // of users, number of bytes in a file, etc) then the loss of precision\n // will cause the code to be completely wrong instead of just inaccurate;\n // and for normal numeric measurements, it would be unusual for us to\n // be dealing with such large numbers. If that someday becomes a problem\n // it would be reasonable to add an opt-out option for this bounds check,\n // which could be used when it's known that losing precision is not a\n // major problem.\n if (value \u003e MAX_SAFE_INT || value \u003c -MAX_SAFE_INT) {\n reportStack(`${value} cannot be represented as a number without loss of precision`, {\n severity: SEVERITY.NONCRITICAL,\n tags: ['proto-utils-bigint-precision-loss'],\n });\n }\n return Number(value);\n default:\n return undefined;\n }\n}\n","// @generated by bzl gen\n// @generated by protoc-gen-es v0.2.1 with parameter \"target=ts\"\n// @generated from file dropbox/proto/init_data/device.proto (package init_data, syntax proto3)\n/* eslint-disable */\n/* @ts-nocheck */\n\nimport type {BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage} from \"@bufbuild/protobuf\";\nimport {Message, proto3} from \"@bufbuild/protobuf\";\n\n/**\n * Device represents information about what is making requests and rendering views. Examples:\n * * For web pages, the device is the browser, so device_id is the browser_id (gvc cookie) for www pages\n * * For Electron apps, it could be some identifier representing the installation or the physical device.\n *\n * @generated from message init_data.Device\n */\nexport class Device extends Message\u003cDevice\u003e {\n /**\n * @generated from field: string id = 1;\n */\n id = \"\";\n\n /**\n * hex representation of id, the reason we have this field is because id is a big decimal that requires\n * BigInt support to be converted to hex in browser. But Safari 12 doesn't support BigInt.\n *\n * @generated from field: string hex_id = 2;\n */\n hexId = \"\";\n\n /**\n * Indicates whether user agent (browser) version is not supported.\n *\n * @generated from field: bool is_user_agent_not_supported = 3;\n */\n isUserAgentNotSupported = false;\n\n constructor(data?: PartialMessage\u003cDevice\u003e) {\n super();\n proto3.util.initPartial(data, this);\n }\n\n static readonly runtime = proto3;\n static readonly typeName = \"init_data.Device\";\n static readonly fields: FieldList = proto3.util.newFieldList(() =\u003e [\n { no: 1, name: \"id\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 2, name: \"hex_id\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 3, name: \"is_user_agent_not_supported\", kind: \"scalar\", T: 8 /* ScalarType.BOOL */ },\n ]);\n\n static fromBinary(bytes: Uint8Array, options?: Partial\u003cBinaryReadOptions\u003e): Device {\n return new Device().fromBinary(bytes, options);\n }\n\n static fromJson(jsonValue: JsonValue, options?: Partial\u003cJsonReadOptions\u003e): Device {\n return new Device().fromJson(jsonValue, options);\n }\n\n static fromJsonString(jsonString: string, options?: Partial\u003cJsonReadOptions\u003e): Device {\n return new Device().fromJsonString(jsonString, options);\n }\n\n static equals(a: Device | PlainMessage\u003cDevice\u003e | undefined, b: Device | PlainMessage\u003cDevice\u003e | undefined): boolean {\n return proto3.util.equals(Device, a, b);\n }\n}\n\n","// @generated by bzl gen\n// @generated by protoc-gen-es v0.2.1 with parameter \"target=ts\"\n// @generated from file dropbox/proto/init_data/auth_request_info.proto (package init_data, syntax proto3)\n/* eslint-disable */\n/* @ts-nocheck */\n\nimport type {BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage} from \"@bufbuild/protobuf\";\nimport {Message, proto3, protoInt64} from \"@bufbuild/protobuf\";\n\n/**\n * @generated from message init_data.User\n */\nexport class User extends Message\u003cUser\u003e {\n /**\n * @generated from field: uint64 id = 1;\n */\n id = protoInt64.zero;\n\n /**\n * user's root namespace ID\n *\n * @generated from field: uint64 root_ns_id = 2;\n */\n rootNsId = protoInt64.zero;\n\n /**\n * customer public user id, it used in growthbook, etc\n *\n * @generated from field: string customer_public_user_id = 3;\n */\n customerPublicUserId = \"\";\n\n constructor(data?: PartialMessage\u003cUser\u003e) {\n super();\n proto3.util.initPartial(data, this);\n }\n\n static readonly runtime = proto3;\n static readonly typeName = \"init_data.User\";\n static readonly fields: FieldList = proto3.util.newFieldList(() =\u003e [\n { no: 1, name: \"id\", kind: \"scalar\", T: 4 /* ScalarType.UINT64 */ },\n { no: 2, name: \"root_ns_id\", kind: \"scalar\", T: 4 /* ScalarType.UINT64 */ },\n { no: 3, name: \"customer_public_user_id\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n ]);\n\n static fromBinary(bytes: Uint8Array, options?: Partial\u003cBinaryReadOptions\u003e): User {\n return new User().fromBinary(bytes, options);\n }\n\n static fromJson(jsonValue: JsonValue, options?: Partial\u003cJsonReadOptions\u003e): User {\n return new User().fromJson(jsonValue, options);\n }\n\n static fromJsonString(jsonString: string, options?: Partial\u003cJsonReadOptions\u003e): User {\n return new User().fromJsonString(jsonString, options);\n }\n\n static equals(a: User | PlainMessage\u003cUser\u003e | undefined, b: User | PlainMessage\u003cUser\u003e | undefined): boolean {\n return proto3.util.equals(User, a, b);\n }\n}\n\n/**\n * @generated from message init_data.Team\n */\nexport class Team extends Message\u003cTeam\u003e {\n /**\n * @generated from field: uint64 id = 1;\n */\n id = protoInt64.zero;\n\n /**\n * customer public team id, it used in growthbook, etc\n *\n * @generated from field: string customer_public_team_id = 2;\n */\n customerPublicTeamId = \"\";\n\n constructor(data?: PartialMessage\u003cTeam\u003e) {\n super();\n proto3.util.initPartial(data, this);\n }\n\n static readonly runtime = proto3;\n static readonly typeName = \"init_data.Team\";\n static readonly fields: FieldList = proto3.util.newFieldList(() =\u003e [\n { no: 1, name: \"id\", kind: \"scalar\", T: 4 /* ScalarType.UINT64 */ },\n { no: 2, name: \"customer_public_team_id\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n ]);\n\n static fromBinary(bytes: Uint8Array, options?: Partial\u003cBinaryReadOptions\u003e): Team {\n return new Team().fromBinary(bytes, options);\n }\n\n static fromJson(jsonValue: JsonValue, options?: Partial\u003cJsonReadOptions\u003e): Team {\n return new Team().fromJson(jsonValue, options);\n }\n\n static fromJsonString(jsonString: string, options?: Partial\u003cJsonReadOptions\u003e): Team {\n return new Team().fromJsonString(jsonString, options);\n }\n\n static equals(a: Team | PlainMessage\u003cTeam\u003e | undefined, b: Team | PlainMessage\u003cTeam\u003e | undefined): boolean {\n return proto3.util.equals(Team, a, b);\n }\n}\n\n/**\n * AuthRequestInfo is primary used for setting proper values for XHR requests auth headers.\n *\n * @generated from message init_data.AuthRequestInfo\n */\nexport class AuthRequestInfo extends Message\u003cAuthRequestInfo\u003e {\n /**\n * active_user represents a user that has been selected by route user_selection,\n * or undefined if no user is chosen (e.g. on a session_optional or no_auth page).\n *\n * @generated from field: init_data.User active_user = 1;\n */\n activeUser?: User;\n\n /**\n * active_team represents currently active team. The active team is always one of these cases:\n * * the authenticated team\n * * the authenticated user's team or a team they can assume/act on\n * * not set if the authenticated user is not associated with any team\n * Also see:\n * https://dropbox.sourcegraphcloud.com/github.com/dropbox-internal/server/-/blob/configs/proto/dropbox/proto/user_auth/session.proto?L181\n *\n * @generated from field: init_data.Team active_team = 2;\n */\n activeTeam?: Team;\n\n /**\n * auth_role and auth_action_type are used to set X-Dropbox-Team-Authorization header for\n * XHR requests. Required to support federation_on_behalf_of auth mode.\n *\n * @generated from field: uint32 auth_role = 3;\n */\n authRole = 0;\n\n /**\n * @generated from field: uint32 auth_action_type = 4;\n */\n authActionType = 0;\n\n constructor(data?: PartialMessage\u003cAuthRequestInfo\u003e) {\n super();\n proto3.util.initPartial(data, this);\n }\n\n static readonly runtime = proto3;\n static readonly typeName = \"init_data.AuthRequestInfo\";\n static readonly fields: FieldList = proto3.util.newFieldList(() =\u003e [\n { no: 1, name: \"active_user\", kind: \"message\", T: User },\n { no: 2, name: \"active_team\", kind: \"message\", T: Team },\n { no: 3, name: \"auth_role\", kind: \"scalar\", T: 13 /* ScalarType.UINT32 */ },\n { no: 4, name: \"auth_action_type\", kind: \"scalar\", T: 13 /* ScalarType.UINT32 */ },\n ]);\n\n static fromBinary(bytes: Uint8Array, options?: Partial\u003cBinaryReadOptions\u003e): AuthRequestInfo {\n return new AuthRequestInfo().fromBinary(bytes, options);\n }\n\n static fromJson(jsonValue: JsonValue, options?: Partial\u003cJsonReadOptions\u003e): AuthRequestInfo {\n return new AuthRequestInfo().fromJson(jsonValue, options);\n }\n\n static fromJsonString(jsonString: string, options?: Partial\u003cJsonReadOptions\u003e): AuthRequestInfo {\n return new AuthRequestInfo().fromJsonString(jsonString, options);\n }\n\n static equals(a: AuthRequestInfo | PlainMessage\u003cAuthRequestInfo\u003e | undefined, b: AuthRequestInfo | PlainMessage\u003cAuthRequestInfo\u003e | undefined): boolean {\n return proto3.util.equals(AuthRequestInfo, a, b);\n }\n}\n\n","// @generated by bzl gen\n// @generated by protoc-gen-es v0.2.1 with parameter \"target=ts\"\n// @generated from file dropbox/proto/init_data/debug_panel_info.proto (package init_data, syntax proto3)\n/* eslint-disable */\n/* @ts-nocheck */\n\nimport type {BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage} from \"@bufbuild/protobuf\";\nimport {Message, proto3} from \"@bufbuild/protobuf\";\n\n/**\n * @generated from message init_data.DebugPanelInfo\n */\nexport class DebugPanelInfo extends Message\u003cDebugPanelInfo\u003e {\n /**\n * @generated from field: string entry_point_module_name = 1;\n */\n entryPointModuleName = \"\";\n\n /**\n * @generated from field: string dws2_revision = 2;\n */\n dws2Revision = \"\";\n\n /**\n * @generated from field: string dws2_lifecycle = 3;\n */\n dws2Lifecycle = \"\";\n\n constructor(data?: PartialMessage\u003cDebugPanelInfo\u003e) {\n super();\n proto3.util.initPartial(data, this);\n }\n\n static readonly runtime = proto3;\n static readonly typeName = \"init_data.DebugPanelInfo\";\n static readonly fields: FieldList = proto3.util.newFieldList(() =\u003e [\n { no: 1, name: \"entry_point_module_name\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 2, name: \"dws2_revision\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 3, name: \"dws2_lifecycle\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n ]);\n\n static fromBinary(bytes: Uint8Array, options?: Partial\u003cBinaryReadOptions\u003e): DebugPanelInfo {\n return new DebugPanelInfo().fromBinary(bytes, options);\n }\n\n static fromJson(jsonValue: JsonValue, options?: Partial\u003cJsonReadOptions\u003e): DebugPanelInfo {\n return new DebugPanelInfo().fromJson(jsonValue, options);\n }\n\n static fromJsonString(jsonString: string, options?: Partial\u003cJsonReadOptions\u003e): DebugPanelInfo {\n return new DebugPanelInfo().fromJsonString(jsonString, options);\n }\n\n static equals(a: DebugPanelInfo | PlainMessage\u003cDebugPanelInfo\u003e | undefined, b: DebugPanelInfo | PlainMessage\u003cDebugPanelInfo\u003e | undefined): boolean {\n return proto3.util.equals(DebugPanelInfo, a, b);\n }\n}\n\n","// @generated by bzl gen\n// @generated by protoc-gen-es v0.2.1 with parameter \"target=ts\"\n// @generated from file dropbox/proto/init_data/messages.proto (package init_data, syntax proto3)\n/* eslint-disable */\n/* @ts-nocheck */\n\nimport type {BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage} from \"@bufbuild/protobuf\";\nimport {Message, proto3, protoInt64} from \"@bufbuild/protobuf\";\nimport {Device} from \"./device_pb\";\nimport {AuthRequestInfo} from \"./auth_request_info_pb\";\nimport {DebugPanelInfo} from \"./debug_panel_info_pb\";\n\n/**\n * AuthChannel is the authentication token/identifier format used for the\n * initial page request. WEB_COOKIES is the default existing code path for all\n * of dropbox.com. The ability to make requests to dropbox.com authenticating\n * using an oauth bearer token (OAUTH_TOKEN) is a newer platform feature being\n * implemented in 2024.\n *\n * @generated from enum init_data.AuthChannel\n */\nexport enum AuthChannel {\n /**\n * @generated from enum value: WEB_COOKIES = 0;\n */\n WEB_COOKIES = 0,\n\n /**\n * perhaps UATs will be a separate entry here?\n *\n * @generated from enum value: OAUTH_TOKEN = 1;\n */\n OAUTH_TOKEN = 1,\n}\n// Retrieve enum metadata with: proto3.getEnumType(AuthChannel)\nproto3.util.setEnumType(AuthChannel, \"init_data.AuthChannel\", [\n { no: 0, name: \"WEB_COOKIES\" },\n { no: 1, name: \"OAUTH_TOKEN\" },\n]);\n\n/**\n * @generated from message init_data.InitData\n */\nexport class InitData extends Message\u003cInitData\u003e {\n /**\n * @generated from field: bool is_selenium_test = 1;\n */\n isSeleniumTest = false;\n\n /**\n * Request related fields.\n *\n * @generated from field: string request_id = 2;\n */\n requestId = \"\";\n\n /**\n * @generated from field: int64 request_start_time_ms = 3;\n */\n requestStartTimeMs = protoInt64.zero;\n\n /**\n * @generated from field: string request_original_url = 4;\n */\n requestOriginalUrl = \"\";\n\n /**\n * @generated from field: string request_original_referer = 5;\n */\n requestOriginalReferer = \"\";\n\n /**\n * Indicates if the request came from an office IP.\n * WARNING: Do not use this value for security-critical decisions.\n * Important security logic must be done server-side, as users can modify JS in their browser.\n *\n * @generated from field: bool unsafe_request_from_office_ip = 6;\n */\n unsafeRequestFromOfficeIp = false;\n\n /**\n * @generated from field: init_data.Device device = 7;\n */\n device?: Device;\n\n /**\n * @generated from field: string project = 8;\n */\n project = \"\";\n\n /**\n * what part of the release lifecycle the served code is part of\n * e.g. canary, control, stage, prod, alpha, beta, stable, etc\n * - whatever is appropriate for the platform doing the serving.\n *\n * @generated from field: string lifecycle = 9;\n */\n lifecycle = \"\";\n\n /**\n * non-prod only, name of the host that served the page. Used for composing\n * the unique hostnames or cookie names for each dev domain.\n *\n * @generated from field: string dev_server_hostname = 24;\n */\n devServerHostname = \"\";\n\n /**\n * optional, name of the page/view/etc.\n * within the project, for projects that include multiple entry points.\n * * on Edison this is going to be a name of dbx_edison_page target;\n * * on DWS this is going to be DWS page name, ie window.ensemble.getPageName() value;\n * * on @web pages this value is not set.\n *\n * @generated from field: string page_name = 10;\n */\n pageName = \"\";\n\n /**\n * optional, used to disambiguate multiple front-end pages being served by the same Edison\n * page (e.g. W*RP) for performance metric tagging. Empty for non-edison routes.\n *\n * @generated from field: string sub_page = 19;\n */\n subPage = \"\";\n\n /**\n * @generated from field: string page_locale = 11;\n */\n pageLocale = \"\";\n\n /**\n * @generated from field: string page_revision = 12;\n */\n pageRevision = \"\";\n\n /**\n * We often want to include some headers on every api/ajax/grpc-web/etc request\n * we make from a page; this gives a way to configure such headers at init time.\n * Examples: X-Dropbox-Client-Yaps-Attribution,\n * x-dropbox-force-request-tracing (from REQUEST_TRACING_ENABLED).\n *\n * @generated from field: map\u003cstring, string\u003e extra_http_request_headers = 13;\n */\n extraHttpRequestHeaders: { [key: string]: string } = {};\n\n /**\n * @generated from field: init_data.AuthRequestInfo auth_request_info = 14;\n */\n authRequestInfo?: AuthRequestInfo;\n\n /**\n * These fields are needed to make Edison.fetch request to prompt.\n * Prompt controller/action are holdovers from pylons, and since prompt has depended\n * on them we've kept them around to ease migration to atlas \u0026 edison but long term these should not exist.\n *\n * @generated from field: string deprecated_prompt_controller = 15;\n */\n deprecatedPromptController = \"\";\n\n /**\n * @generated from field: string deprecated_prompt_action = 16;\n */\n deprecatedPromptAction = \"\";\n\n /**\n * @generated from field: init_data.DebugPanelInfo debug_panel_info = 18;\n */\n debugPanelInfo?: DebugPanelInfo;\n\n /**\n * @generated from field: init_data.AuthChannel auth_channel = 20;\n */\n authChannel = AuthChannel.WEB_COOKIES;\n\n /**\n * edison only\n * possible values: canary, stage, prod\n * this is for overriding edison atlasservlet (ie require config) versions\n *\n * @generated from field: string lifecycle_override = 21;\n */\n lifecycleOverride = \"\";\n\n /**\n * @generated from field: repeated uint64 authed_user_ids = 22;\n */\n authedUserIds: bigint[] = [];\n\n /**\n * next 25\n *\n * @generated from field: string country_code_from_ip = 23;\n */\n countryCodeFromIp = \"\";\n\n constructor(data?: PartialMessage\u003cInitData\u003e) {\n super();\n proto3.util.initPartial(data, this);\n }\n\n static readonly runtime = proto3;\n static readonly typeName = \"init_data.InitData\";\n static readonly fields: FieldList = proto3.util.newFieldList(() =\u003e [\n { no: 1, name: \"is_selenium_test\", kind: \"scalar\", T: 8 /* ScalarType.BOOL */ },\n { no: 2, name: \"request_id\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 3, name: \"request_start_time_ms\", kind: \"scalar\", T: 3 /* ScalarType.INT64 */ },\n { no: 4, name: \"request_original_url\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 5, name: \"request_original_referer\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 6, name: \"unsafe_request_from_office_ip\", kind: \"scalar\", T: 8 /* ScalarType.BOOL */ },\n { no: 7, name: \"device\", kind: \"message\", T: Device },\n { no: 8, name: \"project\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 9, name: \"lifecycle\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 24, name: \"dev_server_hostname\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 10, name: \"page_name\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 19, name: \"sub_page\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 11, name: \"page_locale\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 12, name: \"page_revision\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 13, name: \"extra_http_request_headers\", kind: \"map\", K: 9 /* ScalarType.STRING */, V: {kind: \"scalar\", T: 9 /* ScalarType.STRING */} },\n { no: 14, name: \"auth_request_info\", kind: \"message\", T: AuthRequestInfo },\n { no: 15, name: \"deprecated_prompt_controller\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 16, name: \"deprecated_prompt_action\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 18, name: \"debug_panel_info\", kind: \"message\", T: DebugPanelInfo },\n { no: 20, name: \"auth_channel\", kind: \"enum\", T: proto3.getEnumType(AuthChannel) },\n { no: 21, name: \"lifecycle_override\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n { no: 22, name: \"authed_user_ids\", kind: \"scalar\", T: 4 /* ScalarType.UINT64 */, repeated: true },\n { no: 23, name: \"country_code_from_ip\", kind: \"scalar\", T: 9 /* ScalarType.STRING */ },\n ]);\n\n static fromBinary(bytes: Uint8Array, options?: Partial\u003cBinaryReadOptions\u003e): InitData {\n return new InitData().fromBinary(bytes, options);\n }\n\n static fromJson(jsonValue: JsonValue, options?: Partial\u003cJsonReadOptions\u003e): InitData {\n return new InitData().fromJson(jsonValue, options);\n }\n\n static fromJsonString(jsonString: string, options?: Partial\u003cJsonReadOptions\u003e): InitData {\n return new InitData().fromJsonString(jsonString, options);\n }\n\n static equals(a: InitData | PlainMessage\u003cInitData\u003e | undefined, b: InitData | PlainMessage\u003cInitData\u003e | undefined): boolean {\n return proto3.util.equals(InitData, a, b);\n }\n}\n\n","// This flag indicates that we need to keep init_data in globalThis object.\n// Default value is true to avoid any issues with Pyxl/DWS different require.js contexts.\n// For other platforms (Edison) it make sense to follow best practises and encapsulate init_data\n// inside this module, so we can control access to it.\nlet _useGlobalThis: boolean = true;\nlet _rawInitData: string | null = null;\n\ntype GlobalThis = typeof globalThis;\ninterface Global extends GlobalThis {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n __init_data_raw__?: string;\n}\n\nconst callInitMessage =\n // @ts-ignore\n typeof jest === 'undefined'\n ? \"initial data wasn't initialized yet, you need to call js/init_data/init_raw:initRaw function first\"\n : \"initial data wasn't initialized yet, you need to call js/init_data/init_test.test_util:initTest function first\";\n\nexport function storeRawInitData(rawInitData: string, useGlobalThis: boolean = true): void {\n if (useGlobalThis) {\n /* dbx-global-decl: __init_data_raw__ needs to be a global to work across\n * all the requirejs contexts used in DWS. Once DWS is dead this can\n * stop being a global.\n */\n (globalThis as Global).__init_data_raw__ = rawInitData;\n } else {\n _rawInitData = rawInitData;\n _useGlobalThis = false;\n }\n}\n\nexport function getRawInitData(): string {\n if (_useGlobalThis) {\n /* __init_data_raw__is written above in storeRawInitData; this should be set\n * first thing in page initialization so that this function is safe to call ~everywhere\n */\n if (typeof (globalThis as Global).__init_data_raw__ !== 'string') {\n throw new Error(callInitMessage);\n }\n return (globalThis as Global).__init_data_raw__!;\n }\n if (typeof _rawInitData !== 'string') {\n throw new Error(callInitMessage);\n }\n return _rawInitData;\n}\n","/// \u003creference path=\"../../metaserver/static/js/typings/process.d.ts\" /\u003e\n\nimport {getRawInitData} from 'js/init_data/internal';\nimport {unmarshalProto} from 'js/proto_utils/unpack';\nimport {InitData} from 'typescript/dropbox/proto/init_data/messages_pb';\nimport type {PlainMessage} from '@bufbuild/protobuf';\n\ndeclare const process: NodeJS.Process;\n\n// avoid full dep on jest types; jest is often not used with this module so we don't want\n// it's global types\ndeclare const jest: unknown;\n\nlet parsedInitData: PlainMessage\u003cInitData\u003e | null = null;\n\n/* eslint-disable dbx/no-declare-global -- this is a jest test */\ndeclare global {\n // eslint-disable-next-line no-var -- necessary to augment globalThis\n var jsInitParsedInitData: PlainMessage\u003cInitData\u003e;\n}\n\nexport function getInitData(): PlainMessage\u003cInitData\u003e {\n if (parsedInitData) {\n return parsedInitData;\n } else if (\n process.env.NODE_ENV !== 'production' \u0026\u0026\n typeof jest !== 'undefined' \u0026\u0026\n globalThis.jsInitParsedInitData\n ) {\n // Don't lose init data in jest when jest.resetModules() is called\n return globalThis.jsInitParsedInitData;\n }\n const rawInitData = getRawInitData();\n const initDataUnmarshalled = unmarshalProto(rawInitData, InitData);\n init(initDataUnmarshalled);\n return initDataUnmarshalled;\n}\n\nexport function init(data: PlainMessage\u003cInitData\u003e): void {\n parsedInitData = data;\n if (process.env.NODE_ENV !== 'production' \u0026\u0026 typeof jest !== 'undefined') {\n /* dbx-global-decl: jsInitParsedInitData is only used in this file, but necessary\n * as a global so that when jest.resetModules() is called, future copies of this\n * module share the previously-initialized data\n */\n globalThis.jsInitParsedInitData = data;\n }\n}\n","/// \u003creference path=\"../../metaserver/static/js/typings/process.d.ts\" /\u003e\n/// \u003creference path=\"../edison/edison_external.d.ts\" /\u003e\nimport type {AuthRequestInfo} from 'typescript/dropbox/proto/init_data/auth_request_info_pb';\nimport {AuthChannel} from 'typescript/dropbox/proto/init_data/messages_pb';\nimport {getInitData} from 'js/init_data/data';\nimport {toNumber} from 'js/proto_utils/unpack';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\ndeclare const __SERVED_BY_EDISON_WEB_SERVER__: boolean | undefined;\n\ndeclare const process: NodeJS.Process;\n\n/**\n * Returns value of X-Dropbox-Request-Id header of request that was used to load page.\n */\nexport function getRequestId(): string {\n return getInitData().requestId;\n}\n\nexport function getRequestStartTime(): number {\n return toNumber(getInitData().requestStartTimeMs) || 0;\n}\n\nexport function isRequestTracingEnabled(): boolean {\n // Disabling this for LIT-1199 as it may be amplifying trace load.\n return false;\n}\n\nexport function getPageLocale(): string {\n if (\n // @ts-ignore: expected that jest is undefined\n typeof jest !== 'undefined'\n ) {\n // Jest tests fail because they try to access init_data at module scope,\n // which is usually before initData has been mocked. Try the normal way\n // of accessing the locale, and suppress errors and fall back to english\n try {\n return getInitData().pageLocale || 'en';\n } catch (e) {}\n return 'en';\n }\n // Production code uses the locale from page init data.\n return getInitData().pageLocale || 'en';\n}\n\nexport function getYapsProject(): string {\n return getInitData().project;\n}\n\nexport function getYapsDeployment(): string {\n return getInitData().lifecycle;\n}\n\nexport function getDevServerHostname(): string {\n return getInitData().devServerHostname;\n}\n\nexport function isSeleniumTest(): boolean {\n return getInitData().isSeleniumTest;\n}\n\nexport function getRepoRev(): string {\n return getInitData().pageRevision;\n}\n\nexport function getEdisonLifecycleOverride(): string {\n return getInitData().lifecycleOverride;\n}\n\nexport function getPublicModeOverride(): boolean {\n // public_mode_override is a query param\n const url = new URL(getInitData().requestOriginalUrl);\n const param = url.searchParams.get('public_mode_override');\n return param === 'true' || param === '1';\n}\n\nexport function getCountryOverride(): string {\n // country_override is a query param\n const url = new URL(getInitData().requestOriginalUrl);\n return url.searchParams.get('country_override') || '';\n}\n\nexport function getBrowserId(): string {\n return getInitData()?.device?.id || '';\n}\n\nexport function getActiveUserId(): number | undefined {\n const id = getInitData()?.authRequestInfo?.activeUser?.id\n ? toNumber(getInitData()?.authRequestInfo?.activeUser?.id)\n : undefined;\n if (id === 0) {\n return undefined;\n }\n return id;\n}\n\n/**\n * Similar to {@link getActiveUserId}, but will throw when no user is found.\n */\nexport function mustGetActiveUserId(): number {\n const userId = getActiveUserId();\n if (typeof userId !== 'number') {\n throw new Error('could not get active user id');\n }\n return userId;\n}\n\nexport function isAnyUserSignedIn(): boolean {\n return !!getActiveUserId();\n}\n\n/**\n * Returns the active team id if the user is part of a team.\n */\nexport function getActiveTeamId(): number | undefined {\n const id = getInitData()?.authRequestInfo?.activeTeam?.id\n ? toNumber(getInitData()?.authRequestInfo?.activeTeam?.id)\n : undefined;\n if (id === 0) {\n return undefined;\n }\n return id;\n}\n\nexport function getAuthedUserIds(): (number | undefined)[] {\n return getInitData()?.authedUserIds.map(toNumber) ?? [];\n}\n\n/**\n * Returns a hex representation of device id.\n * In browser device id is a browser id (aka session id).\n */\nexport function getDeviceIdHex(): string {\n return getInitData().device!.hexId;\n}\n\n/**\n * Returns true if code is running in prod, ie stage or prod.\n */\nexport function isProd(): boolean {\n return process.env.NODE_ENV === 'production';\n}\n\n/**\n * Returns current page name.\n * On Edison this is going to be a name of dbx_edison_page target.\n * On DWS this is going to be DWS page name, ie window.ensemble.getPageName() value.\n * On @web pages this function always returns empty string.\n */\nexport function getPageName(): string {\n return getInitData().pageName;\n}\n\n/**\n * Returns current sub page, an identifier primarily for logging purposes.\n */\nexport function getSubPage(): string {\n return getInitData().subPage;\n}\n\n/**\n * Returns value of original request URL.\n */\nexport function getRequestOriginalUrl(): string {\n return getInitData().requestOriginalUrl;\n}\n\n/**\n * Returns a value of original request Referer header.\n */\nexport function getRequestOriginalReferrer(): string | undefined {\n return getInitData().requestOriginalReferer || undefined;\n}\n\n/**\n * Returns a name of atlasservlet service, ie name of the directory under //atlas/.\n * For example files_app.\n */\nexport function getAtlasservlet(): string {\n // comes out as edison_atlasservlet.files_app-edison, in which case we want files_app\n // could also come out as just files_app in which case we want files_app\n const yapsProject = getYapsProject();\n if (yapsProject.startsWith('edison_atlasservlet.')) {\n return yapsProject.split('edison_atlasservlet.')[1].split('-edison')[0];\n }\n return yapsProject;\n}\n\n/**\n * Returns auth info that is associated with current request.\n */\nexport function getAuthRequestInfo(): AuthRequestInfo | undefined {\n const authRequestInfo = getInitData()?.authRequestInfo;\n return authRequestInfo ? authRequestInfo.clone() : undefined;\n}\n\n/**\n * Returns additional HTTP headers that needs to be added to all XHR requests.\n */\nexport function getExtraHttpRequestHeaders(): Record\u003cstring, string\u003e {\n return getInitData().extraHttpRequestHeaders || {};\n}\n\n/**\n * Returns true if this page was served by Edison web server.\n */\nexport function isServedByEdisonWebServer(): boolean {\n // @ts-ignore\n return typeof __SERVED_BY_EDISON_WEB_SERVER__ !== 'undefined';\n}\n\n/**\n * Returns true if code is running on the server side.\n */\nexport function isServerSide(): boolean {\n return typeof RUNNING_IN_REACTSERVER !== 'undefined';\n}\n\nexport function getCustomerPublicUserId(): string | undefined {\n return getInitData()?.authRequestInfo?.activeUser?.customerPublicUserId || undefined;\n}\n\nexport function getCustomerPublicTeamId(): string | undefined {\n return getInitData()?.authRequestInfo?.activeTeam?.customerPublicTeamId || undefined;\n}\n\nexport function getPageAuthChannel(): AuthChannel {\n return getInitData()?.authChannel ?? AuthChannel.WEB_COOKIES;\n}\n\n/**\n * Returns true if user's user agent (browser) is not supported.\n */\nexport function isUserAgentNotSupported(): boolean {\n return !!getInitData()?.device?.isUserAgentNotSupported;\n}\n\nexport function getCountryCodeFromIP(): string {\n return getInitData().countryCodeFromIp;\n}\n"],"names":["assert","condition","msg","Error","FLOAT32_MAX","FLOAT32_MIN","UINT32_MAX","INT32_MAX","INT32_MIN","assertInt32","arg","Number","isInteger","assertUInt32","assertFloat32","isFinite","enumTypeSymbol","Symbol","getEnumType","enumObject","t","setEnumType","typeName","values","opt","makeEnumType","map","v","no","name","localName","_opt","names","Object","create","numbers","normalValues","value","n","normalizeEnumValue","push","findName","findNumber","makeEnum","assign","Message$1","equals","other","this","getType","runtime","util","clone","fromBinary","bytes","options","format","bin","makeReadOptions","readMessage","readerFactory","byteLength","fromJson","jsonValue","type","json","fromJsonString","jsonString","JSON","parse","toBinary","makeWriteOptions","writer","writerFactory","writeMessage","finish","toJson","toJsonString","_a","stringify","prettySpaces","getPrototypeOf","constructor","makeProtoRuntime","syntax","makeMessageType","fields","substring","lastIndexOf","data","initFields","initPartial","setPrototypeOf","prototype","Message","newFieldList","a","b","ScalarType","varint64read","lowBits","highBits","shift","buf","pos","assertBounds","middleByte","varint64write","lo","hi","i","hasNext","byte","splitBits","hasMoreBits","exports","TWO_PWR_32_DBL","int64FromString","dec","minus","slice","base","add1e6digit","begin","end","digit1e6","negate","newBits","uInt64ToString","toUnsigned","String","mid","high","digitA","digitB","digitC","Math","floor","toString","decimalFrom1e7WithLeadingZeros","digit1e7","partial","length","varint32write","varint32read","result","readBytes","protoInt64","dv","DataView","ArrayBuffer","undefined","globalThis","BigInt","getBigInt64","getBigUint64","setBigInt64","setBigUint64","process","env","MIN","MAX","UMIN","UMAX","zero","supported","bi","uParse","enc","getInt32","uEnc","setInt32","uDec","assertInt64String","test","assertUInt64String","bits","negative","int64ToString","makeInt64Support","WireType","BinaryWriter","textEncoder","stack","TextEncoder","chunks","Uint8Array","len","offset","set","fork","join","chunk","prev","pop","uint32","raw","tag","fieldNo","int32","bool","string","encode","float","buffer","setFloat32","double","setFloat64","fixed32","setUint32","sfixed32","sint32","sfixed64","view","tc","fixed64","int64","sint64","sign","uint64","BinaryReader","textDecoder","varint64","byteOffset","TextDecoder","wireType","skip","start","Varint","Bit64","Bit32","LengthDelimited","StartGroup","EndGroup","subarray","RangeError","zze","s","getUint32","getFloat32","getFloat64","decode","wrapField","fieldWrapper","unwrapField","scalarEquals","BYTES","UINT64","FIXED64","INT64","SFIXED64","SINT64","scalarDefaultValue","BOOL","DOUBLE","FLOAT","STRING","scalarTypeInfo","isUndefined","isIntrinsicDefault","FIXED32","SFIXED32","toLowerCase","INT32","UINT32","unknownFieldsSymbol","readDefaults","readUnknownFields","writeDefaults","writeUnknownFields","makeBinaryFormatCommon","listUnknownFields","message","discardUnknownFields","c","f","onUnknownField","m","Array","isArray","reader","field","find","target","repeated","oneof","case","kind","scalarType","T","arr","e","readScalar","messageType","mapKey","mapVal","readMapEntry","key","val","K","V","keyRaw","method","writeMapEntry","keyValue","SINT32","parseInt","writeScalar","writeMessageField","emitIntrinsicDefault","writePacked","encTable","split","decTable","charCodeAt","indexOf","protoBase64","base64Str","es","bytePos","groupPos","p","base64","jsonReadDefaults","ignoreUnknownFields","jsonWriteDefaults","emitDefaultValues","enumAsInteger","useProtoFieldName","makeJsonFormatCommon","makeWriteField","writeField","writeEnum","debug","oneofSeen","jsonKey","entries","findJsonName","seen","targetArray","jsonItem","readEnum","targetMap","jsonMapKey","jsonMapValue","targetMessage","enumValue","member","byMember","findField","jsonName","r","debugJsonValue","NaN","POSITIVE_INFINITY","NEGATIVE_INFINITY","trim","isNaN","encodeURIComponent","makeUtilCommon","source","sk","sourceField","k","keys","mt","every","va","vb","some","any","copy","cloneSingularField","InternalFieldList","normalizer","_fields","_normalizer","jsonNames","list","all","byNumber","numbersAsc","concat","sort","members","o","localFieldName","protoName","inOneof","protoCamelCase","reservedObjectProperties","reservedMessageProperties","fieldJsonName","snakeCase","capNext","charAt","toUpperCase","toJSON","valueOf","toObject","InternalOneofInfo","packed","default","addField","_lookup","proto3","jsonObj","entryKey","entryValue","enumType","jsonArr","item","normalizeFieldInfosProto3","fieldInfos","_b","_c","ooname","Any","super","typeUrl","typeUrlToName","typeRegistry","findMessage","startsWith","hasOwnProperty","call","packFrom","typeNameToUrl","unpackTo","is","url","slash","pack","unmarshalProto","encodedProto","expectedProto","decodedData","MAX_SAFE_INT","toNumber","reportStack","severity","SEVERITY","NONCRITICAL","tags","Device","id","hexId","isUserAgentNotSupported","User","rootNsId","customerPublicUserId","Team","customerPublicTeamId","AuthRequestInfo","authRole","authActionType","DebugPanelInfo","entryPointModuleName","dws2Revision","dws2Lifecycle","AuthChannel","InitData","isSeleniumTest","requestId","requestStartTimeMs","requestOriginalUrl","requestOriginalReferer","unsafeRequestFromOfficeIp","project","lifecycle","devServerHostname","pageName","subPage","pageLocale","pageRevision","extraHttpRequestHeaders","deprecatedPromptController","deprecatedPromptAction","authChannel","WEB_COOKIES","lifecycleOverride","authedUserIds","countryCodeFromIp","callInitMessage","jest","parsedInitData","getInitData","initDataUnmarshalled","__init_data_raw__","getRawInitData","init","getYapsProject","getActiveUserId","authRequestInfo","activeUser","_f","_d","_e","activeTeam","yapsProject","device","URL","searchParams","get","param","__SERVED_BY_EDISON_WEB_SERVER__","RUNNING_IN_REACTSERVER","protoMessage","userId"],"mappings":";oEAgBO,SAASA,EAAOC,EAAWC,GAEhC,IAAKD,EACH,MAAM,IAAIE,MAAMD,EAEpB,CACA,MAAME,EAAc,qBAClBC,GAAe,qBACfC,EAAa,WACbC,EAAY,WACZC,GAAa,WAIR,SAASC,EAAYC,GAC1B,GAAmB,iBAARA,EAAkB,MAAM,IAAIP,MAAM,0BAA4BO,GACzE,IAAKC,OAAOC,UAAUF,IAAQA,EAAMH,GAAaG,EAAMF,EAAW,MAAM,IAAIL,MAAM,mBAAqBO,EACzG,CAIO,SAASG,EAAaH,GAC3B,GAAmB,iBAARA,EAAkB,MAAM,IAAIP,MAAM,2BAA6BO,GAC1E,IAAKC,OAAOC,UAAUF,IAA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"e4a29b46-0086-3f7f-86f5-41c361d0af51","debug_id":"e4a29b46-0086-3f7f-86f5-41c361d0af51"}