@nutrient-sdk/viewer
Version:
View and annotate PDF files in your web app. Full support for mobile and desktop. Runs in the browser using WASM.
13 lines • 79.4 kB
JavaScript
/*!
* Nutrient Web SDK 1.15.1 (https://www.nutrient.io/sdk/web)
*
* Copyright (c) 2016-2026 PSPDFKit GmbH. All rights reserved.
*
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
* This notice may not be removed from this file.
*
* PSPDFKit uses several open source third-party components: https://www.nutrient.io/legal/acknowledgements/web-acknowledgements/
*/
"use strict";(self.webpackChunkNutrientViewer=self.webpackChunkNutrientViewer||[]).push([[825],{825(e,t,n){function r(e,t){return!(null===e||"object"!=typeof e||!("$typeName"in e)||"string"!=typeof e.$typeName)&&(void 0===t||t.typeName===e.$typeName)}var a;function o(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(127&r)<<n,!(128&r))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(15&n)<<28,t=(112&n)>>4,!(128&n))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(127&r)<<n,!(128&r))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function i(e,t,n){for(let r=0;r<28;r+=7){const a=e>>>r,o=!(a>>>7==0&&0==t),i=255&(o?128|a:a);if(n.push(i),!o)return}const r=e>>>28&15|(7&t)<<4,a=!!(t>>3);if(n.push(255&(a?128|r:r)),a){for(let e=3;e<31;e+=7){const r=t>>>e,a=!(r>>>7==0),o=255&(a?128|r:r);if(n.push(o),!a)return}n.push(t>>>31&1)}}n.d(t,{prepareUpload:()=>_n}),function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"}(a||(a={}));const s=4294967296;function u(e){const t="-"===e[0];t&&(e=e.slice(1));const n=1e6;let r=0,a=0;function o(t,o){const i=Number(e.slice(t,o));a*=n,r=r*n+i,r>=s&&(a+=r/s|0,r%=s)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?c(r,a):m(r,a)}function l(e,t){if(({lo:e,hi:t}=function(e,t){return{lo:e>>>0,hi:t>>>0}}(e,t)),t<=2097151)return String(s*t+e);const n=16777215&(e>>>24|t<<8),r=t>>16&65535;let a=(16777215&e)+6777216*n+6710656*r,o=n+8147497*r,i=2*r;const u=1e7;return a>=u&&(o+=Math.floor(a/u),a%=u),o>=u&&(i+=Math.floor(o/u),o%=u),i.toString()+p(o)+p(a)}function m(e,t){return{lo:0|e,hi:0|t}}function c(e,t){return t=~t,e?e=1+~e:t+=1,m(e,t)}const p=e=>{const t=String(e);return"0000000".slice(t.length)+t};function d(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(127&e|128),e>>=7;t.push(1)}}function f(){let e=this.buf[this.pos++],t=127&e;if(!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<7,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<14,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<21,!(128&e))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(15&e)<<28;for(let t=5;128&e&&t<10;t++)e=this.buf[this.pos++];if(128&e)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const b=g();function g(){const e=new DataView(new ArrayBuffer(8));if("function"==typeof BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"==typeof e.setBigUint64&&(!!globalThis.Deno||"object"!=typeof process||"object"!=typeof process.env||"1"!==process.env.BUF_BIGINT_DISABLE)){const t=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),r=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(e){const r="bigint"==typeof e?e:BigInt(e);if(r>n||r<t)throw new Error(`invalid int64: ${e}`);return r},uParse(e){const t="bigint"==typeof e?e:BigInt(e);if(t>a||t<r)throw new Error(`invalid uint64: ${e}`);return t},enc(t){return e.setBigInt64(0,this.parse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(t){return e.setBigInt64(0,this.uParse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigInt64(0,!0)),uDec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigUint64(0,!0))}}return{zero:"0",supported:!1,parse:e=>("string"!=typeof e&&(e=e.toString()),E(e),e),uParse:e=>("string"!=typeof e&&(e=e.toString()),y(e),e),enc:e=>("string"!=typeof e&&(e=e.toString()),E(e),u(e)),uEnc:e=>("string"!=typeof e&&(e=e.toString()),y(e),u(e)),dec:(e,t)=>function(e,t){let n=m(e,t);const r=2147483648&n.hi;r&&(n=c(n.lo,n.hi));const a=l(n.lo,n.hi);return r?"-"+a:a}(e,t),uDec:(e,t)=>l(e,t)}}function E(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function y(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}function N(e,t){switch(e){case a.STRING:return"";case a.BOOL:return!1;case a.DOUBLE:case a.FLOAT:return 0;case a.INT64:case a.UINT64:case a.SFIXED64:case a.FIXED64:case a.SINT64:return t?"0":b.zero;case a.BYTES:return new Uint8Array(0);default:return 0}}const T=Symbol.for("reflect unsafe local");function I(e,t){const n=e[t.localName].case;return void 0===n?n:t.fields.find(e=>e.localName===n)}function h(e,t){const n=t.localName;if(t.oneof)return e[t.oneof.localName].case===n;if(2!=t.presence)return void 0!==e[n]&&Object.prototype.hasOwnProperty.call(e,n);switch(t.fieldKind){case"list":return e[n].length>0;case"map":return Object.keys(e[n]).length>0;case"scalar":return!function(e,t){switch(e){case a.BOOL:return!1===t;case a.STRING:return""===t;case a.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return 0==t}}(t.scalar,e[n]);case"enum":return e[n]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&void 0!==e[t]}function v(e,t){if(t.oneof){const n=e[t.oneof.localName];return n.case===t.localName?n.value:void 0}return e[t.localName]}function O(e,t,n){t.oneof?e[t.oneof.localName]={case:t.localName,value:n}:e[t.localName]=n}function S(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function A(e,t){var n,r,a,o;if(S(e)&&T in e&&"add"in e&&"field"in e&&"function"==typeof e.field){if(void 0!==t){const i=t,s=e.field();return i.listKind==s.listKind&&i.scalar===s.scalar&&(null===(n=i.message)||void 0===n?void 0:n.typeName)===(null===(r=s.message)||void 0===r?void 0:r.typeName)&&(null===(a=i.enum)||void 0===a?void 0:a.typeName)===(null===(o=s.enum)||void 0===o?void 0:o.typeName)}return!0}return!1}function D(e,t){var n,r,a,o;if(S(e)&&T in e&&"has"in e&&"field"in e&&"function"==typeof e.field){if(void 0!==t){const i=t,s=e.field();return i.mapKey===s.mapKey&&i.mapKind==s.mapKind&&i.scalar===s.scalar&&(null===(n=i.message)||void 0===n?void 0:n.typeName)===(null===(r=s.message)||void 0===r?void 0:r.typeName)&&(null===(a=i.enum)||void 0===a?void 0:a.typeName)===(null===(o=s.enum)||void 0===o?void 0:o.typeName)}return!0}return!1}function F(e,t){return S(e)&&T in e&&"desc"in e&&S(e.desc)&&"message"===e.desc.kind&&(void 0===t||e.desc.typeName==t.typeName)}function L(e){const t=e.fields[0];return R(e.typeName)&&void 0!==t&&"scalar"==t.fieldKind&&"value"==t.name&&1==t.number}function R(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}function k(e,t){if(r(t,e))return t;const n=function(e){let t;if(function(e){switch(e.file.edition){case 999:return!1;case 998:return!0;default:return e.fields.some(e=>2!=e.presence&&"message"!=e.fieldKind&&!e.oneof)}}(e)){const n=B.get(e);let r,a;if(n)({prototype:r,members:a}=n);else{r={},a=new Set;for(const t of e.members)"oneof"!=t.kind&&("scalar"!=t.fieldKind&&"enum"!=t.fieldKind||2!=t.presence&&(a.add(t),r[t.localName]=K(t)));B.set(e,{prototype:r,members:a})}t=Object.create(r),t.$typeName=e.typeName;for(const n of e.members)if(!a.has(n)){if("field"==n.kind){if("message"==n.fieldKind)continue;if(("scalar"==n.fieldKind||"enum"==n.fieldKind)&&2!=n.presence)continue}t[n.localName]=K(n)}}else{t={$typeName:e.typeName};for(const n of e.members)"oneof"!=n.kind&&2!=n.presence||(t[n.localName]=K(n))}return t}(e);return void 0!==t&&function(e,t,n){for(const r of e.members){let e,a=n[r.localName];if(null!=a){if("oneof"==r.kind){const t=I(n,r);if(!t)continue;e=t,a=v(n,t)}else e=r;switch(e.fieldKind){case"message":a=Y(e,a);break;case"scalar":a=P(e,a);break;case"list":a=w(e,a);break;case"map":a=U(e,a)}O(t,e,a)}}}(e,n,t),n}function P(e,t){return e.scalar==a.BYTES?V(t):t}function U(e,t){if(S(t)){if(e.scalar==a.BYTES)return G(t,V);if("message"==e.mapKind)return G(t,t=>Y(e,t))}return t}function w(e,t){if(Array.isArray(t)){if(e.scalar==a.BYTES)return t.map(V);if("message"==e.listKind)return t.map(t=>Y(e,t))}return t}function Y(e,t){if("message"==e.fieldKind&&!e.oneof&&L(e.message))return P(e.message.fields[0],t);if(S(t)){if("google.protobuf.Struct"==e.message.typeName&&"google.protobuf.Value"!==e.parent.typeName)return t;if(!r(t,e.message))return k(e.message,t)}return t}function V(e){return Array.isArray(e)?new Uint8Array(e):e}function G(e,t){const n={};for(const r of Object.entries(e))n[r[0]]=t(r[1]);return n}const W=Symbol(),B=new WeakMap;function K(e){if("oneof"==e.kind)return{case:void 0};if("list"==e.fieldKind)return[];if("map"==e.fieldKind)return{};if("message"==e.fieldKind)return W;const t=e.getDefaultValue();return void 0!==t?"scalar"==e.fieldKind&&e.longAsString?t.toString():t:"scalar"==e.fieldKind?N(e.scalar,e.longAsString):e.enum.values[0].number}class C extends Error{constructor(e,t,n="FieldValueInvalidError"){super(t),this.name=n,this.field=()=>e}}const j=Symbol.for("@bufbuild/protobuf/text-encoding");function M(){if(null==globalThis[j]){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[j]={encodeUtf8:t=>e.encode(t),decodeUtf8:e=>t.decode(e),checkUtf8(e){try{return encodeURIComponent(e),!0}catch(e){return!1}}}}return globalThis[j]}var x;!function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"}(x||(x={}));const X=34028234663852886e22,$=-34028234663852886e22,Z=4294967295,J=2147483647,H=-2147483648;class Q{constructor(e=M().encodeUtf8){this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let e=0;for(let t=0;t<this.chunks.length;t++)e+=this.chunks[t].length;let t=new Uint8Array(e),n=0;for(let e=0;e<this.chunks.length;e++)t.set(this.chunks[e],n),n+=this.chunks[e].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(ee(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}int32(e){return q(e),d(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}float(e){!function(e){if("string"==typeof e){const t=e;if(e=Number(e),Number.isNaN(e)&&"NaN"!==t)throw new Error("invalid float32: "+t)}else if("number"!=typeof e)throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>X||e<$))throw new Error("invalid float32: "+e)}(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){ee(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){q(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return q(e),d(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=b.enc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=b.uEnc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}int64(e){let t=b.enc(e);return i(t.lo,t.hi,this.buf),this}sint64(e){const t=b.enc(e),n=t.hi>>31;return i(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}uint64(e){const t=b.uEnc(e);return i(t.lo,t.hi,this.buf),this}}class z{constructor(e,t=M().decodeUtf8){this.decodeUtf8=t,this.varint64=o,this.uint32=f,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),t=e>>>3,n=7&e;if(t<=0||n<0||n>5)throw new Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}skip(e,t){let n=this.pos;switch(e){case x.Varint:for(;128&this.buf[this.pos++];);break;case x.Bit64:this.pos+=4;case x.Bit32:this.pos+=4;break;case x.LengthDelimited:let n=this.uint32();this.pos+=n;break;case x.StartGroup:for(;;){const[e,n]=this.tag();if(n===x.EndGroup){if(void 0!==t&&e!==t)throw new Error("invalid end group tag");break}this.skip(n,e)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let e=this.uint32();return e>>>1^-(1&e)}int64(){return b.dec(...this.varint64())}uint64(){return b.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(1&e);return e=(e>>>1|(1&t)<<31)^n,t=t>>>1^n,b.dec(e,t)}bool(){let[e,t]=this.varint64();return 0!==e||0!==t}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return b.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return b.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.decodeUtf8(this.bytes())}}function q(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>J||e<H)throw new Error("invalid int32: "+e)}function ee(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>Z||e<0)throw new Error("invalid uint32: "+e)}function te(e,t,n){const r=ne(e,n);if(!0!==r)return new C(e,`list item #${t+1}: ${ae(e,n,r)}`)}function ne(e,t){return void 0!==e.scalar?re(t,e.scalar):void 0!==e.enum?e.enum.open?Number.isInteger(t):e.enum.values.some(e=>e.number===t):F(t,e.message)}function re(e,t){switch(t){case a.DOUBLE:return"number"==typeof e;case a.FLOAT:return"number"==typeof e&&(!(!Number.isNaN(e)&&Number.isFinite(e))||(!(e>X||e<$)||`${e.toFixed()} out of range`));case a.INT32:case a.SFIXED32:case a.SINT32:return!("number"!=typeof e||!Number.isInteger(e))&&(!(e>J||e<H)||`${e.toFixed()} out of range`);case a.FIXED32:case a.UINT32:return!("number"!=typeof e||!Number.isInteger(e))&&(!(e>Z||e<0)||`${e.toFixed()} out of range`);case a.BOOL:return"boolean"==typeof e;case a.STRING:return"string"==typeof e&&(M().checkUtf8(e)||"invalid UTF8");case a.BYTES:return e instanceof Uint8Array;case a.INT64:case a.SFIXED64:case a.SINT64:if("bigint"==typeof e||"number"==typeof e||"string"==typeof e&&e.length>0)try{return b.parse(e),!0}catch(t){return`${e} out of range`}return!1;case a.FIXED64:case a.UINT64:if("bigint"==typeof e||"number"==typeof e||"string"==typeof e&&e.length>0)try{return b.uParse(e),!0}catch(t){return`${e} out of range`}return!1}}function ae(e,t,n){return n="string"==typeof n?`: ${n}`:`, got ${oe(t)}`,void 0!==e.scalar?`expected ${function(e){switch(e){case a.STRING:return"string";case a.BOOL:return"boolean";case a.INT64:case a.SINT64:case a.SFIXED64:return"bigint (int64)";case a.UINT64:case a.FIXED64:return"bigint (uint64)";case a.BYTES:return"Uint8Array";case a.DOUBLE:return"number (float64)";case a.FLOAT:return"number (float32)";case a.FIXED32:case a.UINT32:return"number (uint32)";case a.INT32:case a.SFIXED32:case a.SINT32:return"number (int32)"}}(e.scalar)}`+n:void 0!==e.enum?`expected ${e.enum.toString()}`+n:`expected ${ie(e.message)}`+n}function oe(e){switch(typeof e){case"object":return null===e?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:A(e)?se(e.field()):D(e)?ue(e.field()):F(e)?ie(e.desc):r(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function ie(e){return`ReflectMessage (${e.typeName})`}function se(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${a[e.scalar]})`}}function ue(e){switch(e.mapKind){case"message":return`ReflectMap (${a[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${a[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${a[e.mapKey]}, ${a[e.scalar]})`}}function le(e,t,n=!0){return new ce(e,t,n)}const me=new WeakMap;class ce{get sortedFields(){const e=me.get(this.desc);if(e)return e;const t=this.desc.fields.concat().sort((e,t)=>e.number-t.number);return me.set(this.desc,t),t}constructor(e,t,n=!0){this.lists=new Map,this.maps=new Map,this.check=n,this.desc=e,this.message=this[T]=null!=t?t:k(e),this.fields=e.fields,this.oneofs=e.oneofs,this.members=e.members}findNumber(e){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(e=>[e.number,e]))),this._fieldsByNumber.get(e)}oneofCase(e){return pe(this.message,e),I(this.message,e)}isSet(e){return pe(this.message,e),h(this.message,e)}clear(e){pe(this.message,e),function(e,t){const n=t.localName;if(t.oneof){const r=t.oneof.localName;e[r].case===n&&(e[r]={case:void 0})}else if(2!=t.presence)delete e[n];else switch(t.fieldKind){case"map":e[n]={};break;case"list":e[n]=[];break;case"enum":e[n]=t.enum.values[0].number;break;case"scalar":e[n]=N(t.scalar,t.longAsString)}}(this.message,e)}get(e){pe(this.message,e);const t=v(this.message,e);switch(e.fieldKind){case"list":let n=this.lists.get(e);return n&&n[T]===t||this.lists.set(e,n=new de(e,t,this.check)),n;case"map":let r=this.maps.get(e);return r&&r[T]===t||this.maps.set(e,r=new fe(e,t,this.check)),r;case"message":return ge(e,t,this.check);case"scalar":return void 0===t?N(e.scalar,!1):he(e,t);case"enum":return null!=t?t:e.enum.values[0].number}}set(e,t){if(pe(this.message,e),this.check){const n=function(e,t){const n="list"==e.fieldKind?A(t,e):"map"==e.fieldKind?D(t,e):ne(e,t);if(!0===n)return;let r;switch(e.fieldKind){case"list":r=`expected ${se(e)}, got ${oe(t)}`;break;case"map":r=`expected ${ue(e)}, got ${oe(t)}`;break;default:r=ae(e,t,n)}return new C(e,r)}(e,t);if(n)throw n}let n;n="message"==e.fieldKind?be(e,t):D(t)||A(t)?t[T]:_e(e,t),O(this.message,e,n)}getUnknown(){return this.message.$unknown}setUnknown(e){this.message.$unknown=e}}function pe(e,t){if(t.parent.typeName!==e.$typeName)throw new C(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}class de{field(){return this._field}get size(){return this._arr.length}constructor(e,t,n){this._field=e,this._arr=this[T]=t,this.check=n}get(e){const t=this._arr[e];return void 0===t?void 0:ye(this._field,t,this.check)}set(e,t){if(e<0||e>=this._arr.length)throw new C(this._field,`list item #${e+1}: out of range`);if(this.check){const n=te(this._field,e,t);if(n)throw n}this._arr[e]=Ee(this._field,t)}add(e){if(this.check){const t=te(this._field,this._arr.length,e);if(t)throw t}this._arr.push(Ee(this._field,e))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const e of this._arr)yield ye(this._field,e,this.check)}*entries(){for(let e=0;e<this._arr.length;e++)yield[e,ye(this._field,this._arr[e],this.check)]}}class fe{constructor(e,t,n=!0){this.obj=this[T]=null!=t?t:{},this.check=n,this._field=e}field(){return this._field}set(e,t){if(this.check){const n=function(e,t,n){const r=re(t,e.mapKey);if(!0!==r)return new C(e,`invalid map key: ${ae({scalar:e.mapKey},t,r)}`);const a=ne(e,n);return!0!==a?new C(e,`map entry ${oe(t)}: ${ae(e,n,a)}`):void 0}(this._field,e,t);if(n)throw n}return this.obj[Te(e)]=function(e,t){if("message"==e.mapKind)return be(e,t);return _e(e,t)}(this._field,t),this}delete(e){const t=Te(e),n=Object.prototype.hasOwnProperty.call(this.obj,t);return n&&delete this.obj[t],n}clear(){for(const e of Object.keys(this.obj))delete this.obj[e]}get(e){let t=this.obj[Te(e)];return void 0!==t&&(t=Ne(this._field,t,this.check)),t}has(e){return Object.prototype.hasOwnProperty.call(this.obj,Te(e))}*keys(){for(const e of Object.keys(this.obj))yield Ie(e,this._field.mapKey)}*entries(){for(const e of Object.entries(this.obj))yield[Ie(e[0],this._field.mapKey),Ne(this._field,e[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const e of Object.values(this.obj))yield Ne(this._field,e,this.check)}forEach(e,t){for(const n of this.entries())e.call(t,n[1],n[0],this)}}function be(e,t){return F(t)?R(t.message.$typeName)&&!e.oneof&&"message"==e.fieldKind?t.message.value:"google.protobuf.Struct"==t.desc.typeName&&"google.protobuf.Value"!=e.parent.typeName?Oe(t.message):t.message:t}function ge(e,t,n){return void 0!==t&&(L(e.message)&&!e.oneof&&"message"==e.fieldKind?t={$typeName:e.message.typeName,value:he(e.message.fields[0],t)}:"google.protobuf.Struct"==e.message.typeName&&"google.protobuf.Value"!=e.parent.typeName&&S(t)&&(t=ve(t))),new ce(e.message,t,n)}function Ee(e,t){return"message"==e.listKind?be(e,t):_e(e,t)}function ye(e,t,n){return"message"==e.listKind?ge(e,t,n):he(e,t)}function Ne(e,t,n){return"message"==e.mapKind?ge(e,t,n):t}function Te(e){return"string"==typeof e||"number"==typeof e?e:String(e)}function Ie(e,t){switch(t){case a.STRING:return e;case a.INT32:case a.FIXED32:case a.UINT32:case a.SFIXED32:case a.SINT32:{const t=Number.parseInt(e);if(Number.isFinite(t))return t;break}case a.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case a.UINT64:case a.FIXED64:try{return b.uParse(e)}catch(e){}break;default:try{return b.parse(e)}catch(e){}}return e}function he(e,t){switch(e.scalar){case a.INT64:case a.SFIXED64:case a.SINT64:"longAsString"in e&&e.longAsString&&"string"==typeof t&&(t=b.parse(t));break;case a.FIXED64:case a.UINT64:"longAsString"in e&&e.longAsString&&"string"==typeof t&&(t=b.uParse(t))}return t}function _e(e,t){switch(e.scalar){case a.INT64:case a.SFIXED64:case a.SINT64:"longAsString"in e&&e.longAsString?t=String(t):"string"!=typeof t&&"number"!=typeof t||(t=b.parse(t));break;case a.FIXED64:case a.UINT64:"longAsString"in e&&e.longAsString?t=String(t):"string"!=typeof t&&"number"!=typeof t||(t=b.uParse(t))}return t}function ve(e){const t={$typeName:"google.protobuf.Struct",fields:{}};if(S(e))for(const[n,r]of Object.entries(e))t.fields[n]=Ae(r);return t}function Oe(e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=Se(r);return t}function Se(e){switch(e.kind.case){case"structValue":return Oe(e.kind.value);case"listValue":return e.kind.value.values.map(Se);case"nullValue":case void 0:return null;default:return e.kind.value}}function Ae(e){const t={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(null===e){const e=0;t.kind={case:"nullValue",value:e}}else if(Array.isArray(e)){const n={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(const t of e)n.values.push(Ae(t));t.kind={case:"listValue",value:n}}else t.kind={case:"structValue",value:ve(e)}}return t}function De(e){const t=function(){if(!Re){Re=[];const e=ke("std");for(let t=0;t<e.length;t++)Re[e[t].charCodeAt(0)]=t;Re["-".charCodeAt(0)]=e.indexOf("+"),Re["_".charCodeAt(0)]=e.indexOf("/")}return Re}();let n=3*e.length/4;"="==e[e.length-2]?n-=2:"="==e[e.length-1]&&(n-=1);let r,a=new Uint8Array(n),o=0,i=0,s=0;for(let n=0;n<e.length;n++){if(r=t[e.charCodeAt(n)],void 0===r)switch(e[n]){case"=":i=0;case"\n":case"\r":case"\t":case" ":continue;default:throw Error("invalid base64 string")}switch(i){case 0:s=r,i=1;break;case 1:a[o++]=s<<2|(48&r)>>4,s=r,i=2;break;case 2:a[o++]=(15&s)<<4|(60&r)>>2,s=r,i=3;break;case 3:a[o++]=(3&s)<<6|r,i=0}}if(1==i)throw Error("invalid base64 string");return a.subarray(0,o)}let Fe,Le,Re;function ke(e){return Fe||(Fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Le=Fe.slice(0,-2).concat("-","_")),"url"==e?Le:Fe}function Pe(e){let t=!1;const n=[];for(let r=0;r<e.length;r++){let a=e.charAt(r);switch(a){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(a),t=!1;break;default:t&&(t=!1,a=a.toUpperCase()),n.push(a)}}return n.join("")}const Ue=new Set(["constructor","toString","toJSON","valueOf"]);function we(e){return Ue.has(e)?e+"$":e}function Ye(e){for(const t of e.field)_(t,"jsonName")||(t.jsonName=Pe(t.name));e.nestedType.forEach(Ye)}function Ve(e,t){switch(e){case a.STRING:return t;case a.BYTES:{const n=function(e){const t=[],n={tail:e,c:"",next(){return 0!=this.tail.length&&(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(e){if(this.tail.length>=e){const t=this.tail.substring(0,e);return this.tail=this.tail.substring(e),t}return!1}};for(;n.next();)if("\\"===n.c){if(n.next())switch(n.c){case"\\":t.push(n.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const e=n.c,r=n.take(2);if(!1===r)return!1;const a=parseInt(e+r,8);if(Number.isNaN(a))return!1;t.push(a);break}case"x":{const e=n.c,r=n.take(2);if(!1===r)return!1;const a=parseInt(e+r,16);if(Number.isNaN(a))return!1;t.push(a);break}case"u":{const e=n.c,r=n.take(4);if(!1===r)return!1;const a=parseInt(e+r,16);if(Number.isNaN(a))return!1;const o=new Uint8Array(4);new DataView(o.buffer).setInt32(0,a,!0),t.push(o[0],o[1],o[2],o[3]);break}case"U":{const e=n.c,r=n.take(8);if(!1===r)return!1;const a=b.uEnc(e+r),o=new Uint8Array(8),i=new DataView(o.buffer);i.setInt32(0,a.lo,!0),i.setInt32(4,a.hi,!0),t.push(o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7]);break}}}else t.push(n.c.charCodeAt(0));return new Uint8Array(t)}(t);if(!1===n)throw new Error(`cannot parse ${a[e]} default value: ${t}`);return n}case a.INT64:case a.SFIXED64:case a.SINT64:return b.parse(t);case a.UINT64:case a.FIXED64:return b.uParse(t);case a.DOUBLE:case a.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(t)}case a.BOOL:return"true"===t;case a.INT32:case a.UINT32:case a.SINT32:case a.FIXED32:case a.SFIXED32:return parseInt(t,10)}}function*Ge(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*Ge(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*Ge(t);yield*e.nestedEnums,yield*e.nestedExtensions}}function We(...e){const t=Be();if(!e.length)return t;if("$typeName"in e[0]&&"google.protobuf.FileDescriptorSet"==e[0].$typeName){for(const n of e[0].file)Me(n,t);return t}if("$typeName"in e[0]){const r=e[0],a=e[1],o=new Set;function i(e){const n=[];for(const r of e.dependency){if(null!=t.getFile(r))continue;if(o.has(r))continue;const i=a(r);if(!i)throw new Error(`Unable to resolve ${r}, imported by ${e.name}`);"kind"in i?t.addFile(i,!1,!0):(o.add(i.name),n.push(i))}return n.concat(...n.map(i))}for(const s of[r,...i(r)].reverse())Me(s,t)}else for(const u of e)for(const l of u.files)t.addFile(l);return t}function Be(){const e=new Map,t=new Map,n=new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator]:()=>e.values(),get files(){return n.values()},addFile(e,t,r){if(n.set(e.proto.name,e),!t)for(const t of Ge(e))this.add(t);if(r)for(const n of e.dependencies)this.addFile(n,t,r)},add(n){if("extension"==n.kind){let e=t.get(n.extendee.typeName);e||t.set(n.extendee.typeName,e=new Map),e.set(n.number,n)}e.set(n.typeName,n)},get:t=>e.get(t),getFile:e=>n.get(e),getMessage(t){const n=e.get(t);return"message"==(null==n?void 0:n.kind)?n:void 0},getEnum(t){const n=e.get(t);return"enum"==(null==n?void 0:n.kind)?n:void 0},getExtension(t){const n=e.get(t);return"extension"==(null==n?void 0:n.kind)?n:void 0},getExtensionFor(e,n){var r;return null===(r=t.get(e.typeName))||void 0===r?void 0:r.get(n)},getService(t){const n=e.get(t);return"service"==(null==n?void 0:n.kind)?n:void 0}}}const Ke=10,Ce=11,je={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function Me(e,t){var n,r;const a={kind:"file",proto:e,deprecated:null!==(r=null===(n=e.options)||void 0===n?void 0:n.deprecated)&&void 0!==r&&r,edition:ze(e),name:e.name.replace(/\.proto$/,""),dependencies:qe(e,t),enums:[],messages:[],extensions:[],services:[],toString:()=>`file ${e.name}`},o=new Map,i={get:e=>o.get(e),add(e){var t;it(!0===(null===(t=e.proto.options)||void 0===t?void 0:t.mapEntry)),o.set(e.typeName,e)}};for(const n of e.enumType)$e(n,a,void 0,t);for(const n of e.messageType)Ze(n,a,void 0,t,i);for(const n of e.service)Je(n,a,t);xe(a,t);for(const e of o.values())Xe(e,t,i);for(const e of a.messages)Xe(e,t,i),xe(e,t);t.addFile(a,!0)}function xe(e,t){switch(e.kind){case"file":for(const n of e.proto.extension){const r=Qe(n,e,t);e.extensions.push(r),t.add(r)}break;case"message":for(const n of e.proto.extension){const r=Qe(n,e,t);e.nestedExtensions.push(r),t.add(r)}for(const n of e.nestedMessages)xe(n,t)}}function Xe(e,t,n){const r=e.proto.oneofDecl.map(t=>function(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:we(Pe(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}(t,e)),a=new Set;for(const o of e.proto.field){const i=nt(o,r),s=Qe(o,e,t,i,n);e.fields.push(s),e.field[s.localName]=s,void 0===i?e.members.push(s):(i.fields.push(s),a.has(i)||(a.add(i),e.members.push(i)))}for(const t of r.filter(e=>a.has(e)))e.oneofs.push(t);for(const r of e.nestedMessages)Xe(r,t,n)}function $e(e,t,n,r){var a,o,i,s,u;const l=function(e,t){const n=(r=e,(r.substring(0,1)+r.substring(1).replace(/[A-Z]/g,e=>"_"+e)).toLowerCase()+"_");var r;for(const e of t){if(!e.name.toLowerCase().startsWith(n))return;const t=e.name.substring(n.length);if(0==t.length)return;if(/^\d/.test(t))return}return n}(e.name,e.value),m={kind:"enum",proto:e,deprecated:null!==(o=null===(a=e.options)||void 0===a?void 0:a.deprecated)&&void 0!==o&&o,file:t,parent:n,open:!0,name:e.name,typeName:et(e,n,t),value:{},values:[],sharedPrefix:l,toString(){return`enum ${this.typeName}`}};m.open=function(e){var t;return 1==ot("enumType",{proto:e.proto,parent:null!==(t=e.parent)&&void 0!==t?t:e.file})}(m),r.add(m);for(const t of e.value){const e=t.name;m.values.push(m.value[t.number]={kind:"enum_value",proto:t,deprecated:null!==(s=null===(i=t.options)||void 0===i?void 0:i.deprecated)&&void 0!==s&&s,parent:m,name:e,localName:we(null==l?e:e.substring(l.length)),number:t.number,toString:()=>`enum value ${m.typeName}.${e}`})}(null!==(u=null==n?void 0:n.nestedEnums)&&void 0!==u?u:t.enums).push(m)}function Ze(e,t,n,r,a){var o,i,s,u;const l={kind:"message",proto:e,deprecated:null!==(i=null===(o=e.options)||void 0===o?void 0:o.deprecated)&&void 0!==i&&i,file:t,parent:n,name:e.name,typeName:et(e,n,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};!0===(null===(s=e.options)||void 0===s?void 0:s.mapEntry)?a.add(l):((null!==(u=null==n?void 0:n.nestedMessages)&&void 0!==u?u:t.messages).push(l),r.add(l));for(const n of e.enumType)$e(n,t,l,r);for(const n of e.nestedType)Ze(n,t,l,r,a)}function Je(e,t,n){var r,a;const o={kind:"service",proto:e,deprecated:null!==(a=null===(r=e.options)||void 0===r?void 0:r.deprecated)&&void 0!==a&&a,file:t,name:e.name,typeName:et(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(o),n.add(o);for(const t of e.method){const e=He(t,o,n);o.methods.push(e),o.method[e.localName]=e}}function He(e,t,n){var r,a,o,i;let s;s=e.clientStreaming&&e.serverStreaming?"bidi_streaming":e.clientStreaming?"client_streaming":e.serverStreaming?"server_streaming":"unary";const u=n.getMessage(tt(e.inputType)),l=n.getMessage(tt(e.outputType));it(u,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),it(l,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const m=e.name;return{kind:"rpc",proto:e,deprecated:null!==(a=null===(r=e.options)||void 0===r?void 0:r.deprecated)&&void 0!==a&&a,parent:t,name:m,localName:we(m.length?we(m[0].toLowerCase()+m.substring(1)):m),methodKind:s,input:u,output:l,idempotency:null!==(i=null===(o=e.options)||void 0===o?void 0:o.idempotencyLevel)&&void 0!==i?i:0,toString:()=>`rpc ${t.typeName}.${m}`}}function Qe(e,t,n,r,o){var i,s,u;const l=void 0===o,m={kind:"field",proto:e,deprecated:null!==(s=null===(i=e.options)||void 0===i?void 0:i.deprecated)&&void 0!==s&&s,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:rt(e,r,l,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(l){const r="file"==t.kind?t:t.file,a="file"==t.kind?void 0:t,o=et(e,a,r);m.kind="extension",m.file=r,m.parent=a,m.oneof=void 0,m.typeName=o,m.jsonName=`[${o}]`,m.toString=()=>`extension ${o}`;const i=n.getMessage(tt(e.extendee));it(i,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),m.extendee=i}else{const n=t;it("message"==n.kind),m.parent=n,m.oneof=r,m.localName=r?Pe(e.name):we(Pe(e.name)),m.jsonName=e.jsonName,m.toString=()=>`field ${n.typeName}.${e.name}`}const c=e.label,p=e.type,d=null===(u=e.options)||void 0===u?void 0:u.jstype;if(3===c){const r=11==p?null==o?void 0:o.get(tt(e.typeName)):void 0;if(r){m.fieldKind="map";const{key:e,value:t}=function(e){const t=e.fields.find(e=>1===e.number),n=e.fields.find(e=>2===e.number);return it(t&&"scalar"==t.fieldKind&&t.scalar!=a.BYTES&&t.scalar!=a.FLOAT&&t.scalar!=a.DOUBLE&&n&&"list"!=n.fieldKind&&"map"!=n.fieldKind),{key:t,value:n}}(r);return m.mapKey=e.scalar,m.mapKind=t.fieldKind,m.message=t.message,m.delimitedEncoding=!1,m.enum=t.enum,m.scalar=t.scalar,m}switch(m.fieldKind="list",p){case 11:case 10:m.listKind="message",m.message=n.getMessage(tt(e.typeName)),it(m.message),m.delimitedEncoding=at(e,t);break;case 14:m.listKind="enum",m.enum=n.getEnum(tt(e.typeName)),it(m.enum);break;default:m.listKind="scalar",m.scalar=p,m.longAsString=1==d}return m.packed=function(e,t){if(3!=e.label)return!1;switch(e.type){case 9:case 12:case Ke:case Ce:return!1}const n=e.options;if(n&&_(n,"packed"))return n.packed;return 1==ot("repeatedFieldEncoding",{proto:e,parent:t})}(e,t),m}switch(p){case Ce:case Ke:m.fieldKind="message",m.message=n.getMessage(tt(e.typeName)),it(m.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),m.delimitedEncoding=at(e,t),m.getDefaultValue=()=>{};break;case 14:{const t=n.getEnum(tt(e.typeName));it(void 0!==t,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),m.fieldKind="enum",m.enum=n.getEnum(tt(e.typeName)),m.getDefaultValue=()=>_(e,"defaultValue")?function(e,t){const n=e.values.find(e=>e.name===t);if(!n)throw new Error(`cannot parse ${e} default value: ${t}`);return n.number}(t,e.defaultValue):void 0;break}default:m.fieldKind="scalar",m.scalar=p,m.longAsString=1==d,m.getDefaultValue=()=>_(e,"defaultValue")?Ve(p,e.defaultValue):void 0}return m}function ze(e){switch(e.syntax){case"":case"proto2":return 998;case"proto3":return 999;case"editions":if(e.edition in je)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function qe(e,t){return e.dependency.map(n=>{const r=t.getFile(n);if(!r)throw new Error(`Cannot find ${n}, imported by ${e.name}`);return r})}function et(e,t,n){let r;return r=t?`${t.typeName}.${e.name}`:n.proto.package.length>0?`${n.proto.package}.${e.name}`:`${e.name}`,r}function tt(e){return e.startsWith(".")?e.substring(1):e}function nt(e,t){if(!_(e,"oneofIndex"))return;if(e.proto3Optional)return;const n=t[e.oneofIndex];return it(n,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),n}function rt(e,t,n,r){if(2==e.label)return 3;if(3==e.label)return 2;if(t||e.proto3Optional)return 1;if(n)return 1;const a=ot("fieldPresence",{proto:e,parent:r});return 2!=a||e.type!=Ce&&e.type!=Ke?a:1}function at(e,t){return e.type==Ke||2==ot("messageEncoding",{proto:e,parent:t})}function ot(e,t){var n,r;const a=null===(n=t.proto.options)||void 0===n?void 0:n.features;if(a){const t=a[e];if(0!=t)return t}if("kind"in t){if("message"==t.kind)return ot(e,null!==(r=t.parent)&&void 0!==r?r:t.file);const n=je[t.edition];if(!n)throw new Error(`feature default for edition ${t.edition} not found`);return n[e]}return ot(e,t.parent)}function it(e,t){if(!e)throw new Error(t)}function st(e){const t=function(e){const t=Object.create({syntax:"",edition:0});return Object.assign(t,Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(ut),enumType:e.enumType.map(ct)}))}(e);t.messageType.forEach(Ye);return We(t,()=>{}).getFile(t.name)}function ut(e){var t,n,r,a,o,i,s,u;const l=Object.create({visibility:0});return Object.assign(l,{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:null!==(n=null===(t=e.field)||void 0===t?void 0:t.map(lt))&&void 0!==n?n:[],extension:[],nestedType:null!==(a=null===(r=e.nestedType)||void 0===r?void 0:r.map(ut))&&void 0!==a?a:[],enumType:null!==(i=null===(o=e.enumType)||void 0===o?void 0:o.map(ct))&&void 0!==i?i:[],extensionRange:null!==(u=null===(s=e.extensionRange)||void 0===s?void 0:s.map(e=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},e)))&&void 0!==u?u:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function lt(e){const t=Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1});return Object.assign(t,Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?mt(e.options):void 0}))}function mt(e){var t,n,r;const a=Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0});return Object.assign(a,Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:null!==(t=e.targets)&&void 0!==t?t:[],editionDefaults:null!==(r=null===(n=e.editionDefaults)||void 0===n?void 0:n.map(e=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},e)))&&void 0!==r?r:[],uninterpretedOption:[]}))}function ct(e){const t=Object.create({visibility:0});return Object.assign(t,{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(e=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},e))})}function pt(e,t,...n){return n.reduce((e,t)=>e.nestedMessages[t],e.messages[t])}const dt=st({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.