UNPKG

@nutrient-sdk/node

Version:

Convert documents in your Node.js apps.

3 lines (2 loc) 399 kB
"use strict";let e,t,n,r,a,i,s;var o,l,u,d,c,m,p,f=require("url").pathToFileURL(__filename),h=Object.create,g=Object.defineProperty,b=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyNames,E=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty,_=(e,t)=>()=>(e&&(t=e(e=0)),t),I=(e,t)=>{for(var n in t)g(e,n,{get:t[n],enumerable:!0})},w=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of y(t))v.call(e,a)||a===n||g(e,a,{get:()=>t[a],enumerable:!(r=b(t,a))||r.enumerable});return e},N=(e,t,n)=>(n=null!=e?h(E(e)):{},w(!t&&e&&e.__esModule?n:g(n,"default",{value:e,enumerable:!0}),e)),A=_(()=>{c={BUNDLE:"/vendor",BACKEND_BUILD:"true",GDPICTURE_HASH:"935f5ee62b7829a10574cea718090250ade8f886"}}),S=_(()=>{"use strict";A(),(m=function e(t){let n;return Object.setPrototypeOf(n=t instanceof Error?t:Error(t),e.prototype),n}).prototype=Object.create(Error.prototype,{name:{value:"PSPDFKitError",enumerable:!1}}),p=m});function k(e,t){if(!e)throw new p(`Assertion failed: ${t||"Condition not met"} For further assistance, please go to: https://www.nutrient.io/support/request`)}var F=_(()=>{"use strict";A(),S()}),T=_(()=>{"use strict";A()}),O=_(()=>{"use strict";A()}),D=_(()=>{"use strict";A()}),R=_(()=>{"use strict";A()}),x=_(()=>{"use strict";A()});function C(e){console.log(e)}var B,P,V,L,U,Z,G=_(()=>{"use strict";A()}),W=_(()=>{"use strict";A()}),j=_(()=>{"use strict";A()}),M=_(()=>{"use strict";A()}),Y=_(()=>{"use strict";A()}),X=_(()=>{"use strict";A()}),$=_(()=>{"use strict";A(),F()}),K=_(()=>{"use strict";A()}),J=_(()=>{"use strict";A()}),Q=_(()=>{"use strict";A()}),z=_(()=>{"use strict";A(),B=">=1.4"}),H=_(()=>{"use strict";A(),F(),S(),T(),O(),D(),R(),x(),G(),W(),j(),M(),Y(),X(),$(),K(),J(),Q(),z()}),q=_(()=>{A(),P=[];for(let e=0;e<256;++e)P.push((e+256).toString(16).slice(1))}),ee=_(()=>{A(),V=require("crypto"),U=(L=new Uint8Array(256)).length}),et=_(()=>{A(),Z={randomUUID:require("crypto").randomUUID}});function en(e,t,n){if(Z.randomUUID&&!t&&!e)return Z.randomUUID();let r=(e=e||{}).random??e.rng?.()??(U>L.length-16&&((0,V.randomFillSync)(L),U=0),L.slice(U,U+=16));if(r.length<16)throw Error("Random bytes length must be >= 16");if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){if((n=n||0)<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(P[e[t+0]]+P[e[t+1]]+P[e[t+2]]+P[e[t+3]]+"-"+P[e[t+4]]+P[e[t+5]]+"-"+P[e[t+6]]+P[e[t+7]]+"-"+P[e[t+8]]+P[e[t+9]]+"-"+P[e[t+10]]+P[e[t+11]]+P[e[t+12]]+P[e[t+13]]+P[e[t+14]]+P[e[t+15]]).toLowerCase()}(r)}var er,ea=_(()=>{A(),et(),ee(),q(),er=en}),ei=_(()=>{A(),ea()});async function es(e){try{let t=await fetch(e).catch(t=>{throw new p(`Error fetching dynamic fonts file ${e}. ${t}`)});if(200!==t.status)throw new p(`Error fetching dynamic fonts file ${e}. Status code: ${t.status}`);return t}catch(e){throw e}}async function eo(e){return(await es(e)).json().catch(t=>{throw new p(`Error parsing dynamic fonts file ${e}. ${t}`)})}var el=_(()=>{"use strict";A(),H()}),eu=(e=(e,t)=>{var n,r;A(),n=e,r=function(e){"use strict";let t=Symbol("Comlink.proxy"),n=Symbol("Comlink.endpoint"),r=Symbol("Comlink.releaseProxy"),a=Symbol("Comlink.finalizer"),i=Symbol("Comlink.thrown"),s=e=>"object"==typeof e&&null!==e||"function"==typeof e,o=new Map([["proxy",{canHandle:e=>s(e)&&e[t],serialize(e){let{port1:t,port2:n}=new MessageChannel;return l(e,t),[n,[n]]},deserialize:e=>(e.start(),d(e))}],["throw",{canHandle:e=>s(e)&&i in e,serialize:({value:e})=>[e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[]],deserialize(e){throw e.isError?Object.assign(Error(e.value.message),e.value):e.value}}]]);function l(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(s){if(!s||!s.data)return;if(!function(e,t){for(let n of e)if(t===n||"*"===n||n instanceof RegExp&&n.test(t))return!0;return!1}(n,s.origin))return void console.warn(`Invalid origin '${s.origin}' for comlink proxy`);let{id:o,type:d,path:c}=Object.assign({path:[]},s.data),m=(s.data.argumentList||[]).map(v),p;try{let t=c.slice(0,-1).reduce((e,t)=>e[t],e),n=c.reduce((e,t)=>e[t],e);switch(d){case"GET":p=n;break;case"SET":t[c.slice(-1)[0]]=v(s.data.value),p=!0;break;case"APPLY":p=n.apply(t,m);break;case"CONSTRUCT":{let e=new n(...m);p=y(e)}break;case"ENDPOINT":{let{port1:t,port2:n}=new MessageChannel;l(e,n),p=b(t,[t])}break;case"RELEASE":p=void 0;break;default:return}}catch(e){p={value:e,[i]:0}}Promise.resolve(p).catch(e=>({value:e,[i]:0})).then(n=>{let[i,s]=E(n);t.postMessage(Object.assign(Object.assign({},i),{id:o}),s),"RELEASE"===d&&(t.removeEventListener("message",r),u(t),a in e&&"function"==typeof e[a]&&e[a]())}).catch(e=>{let[n,r]=E({value:TypeError("Unserializable return value"),[i]:0});t.postMessage(Object.assign(Object.assign({},n),{id:o}),r)})}),t.start&&t.start()}function u(e){"MessagePort"===e.constructor.name&&e.close()}function d(e,t){let a=new Map;return e.addEventListener("message",function(e){let{data:t}=e;if(!t||!t.id)return;let n=a.get(t.id);if(n)try{n(t)}finally{a.delete(t.id)}}),function e(t,a,i=[],s=function(){}){let o,l=!1,u=new Proxy(s,{get(n,s){if(c(l),s===r)return()=>{f&&f.unregister(u),m(t),a.clear(),l=!0};if("then"===s){if(0===i.length)return{then:()=>u};let e=_(t,a,{type:"GET",path:i.map(e=>e.toString())}).then(v);return e.then.bind(e)}return e(t,a,[...i,s])},set(e,n,r){c(l);let[s,o]=E(r);return _(t,a,{type:"SET",path:[...i,n].map(e=>e.toString()),value:s},o).then(v)},apply(r,s,o){c(l);let u=i[i.length-1];if(u===n)return _(t,a,{type:"ENDPOINT"}).then(v);if("bind"===u)return e(t,a,i.slice(0,-1));let[d,m]=h(o);return _(t,a,{type:"APPLY",path:i.map(e=>e.toString()),argumentList:d},m).then(v)},construct(e,n){c(l);let[r,s]=h(n);return _(t,a,{type:"CONSTRUCT",path:i.map(e=>e.toString()),argumentList:r},s).then(v)}});return o=(p.get(t)||0)+1,p.set(t,o),f&&f.register(u,t,u),u}(e,a,[],t)}function c(e){if(e)throw Error("Proxy has been released and is not useable")}function m(e){return _(e,new Map,{type:"RELEASE"}).then(()=>{u(e)})}let p=new WeakMap,f="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{let t=(p.get(e)||0)-1;p.set(e,t),0===t&&m(e)});function h(e){var t;let n=e.map(E);return[n.map(e=>e[0]),(t=n.map(e=>e[1]),Array.prototype.concat.apply([],t))]}let g=new WeakMap;function b(e,t){return g.set(e,t),e}function y(e){return Object.assign(e,{[t]:!0})}function E(e){for(let[t,n]of o)if(n.canHandle(e)){let[r,a]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},a]}return[{type:"RAW",value:e},g.get(e)||[]]}function v(e){switch(e.type){case"HANDLER":return o.get(e.name).deserialize(e.value);case"RAW":return e.value}}function _(e,t,n,r){return new Promise(a=>{let i=[,,,,].fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.set(i,a),e.start&&e.start(),e.postMessage(Object.assign({id:i},n),r)})}e.createEndpoint=n,e.expose=l,e.finalizer=a,e.proxy=y,e.proxyMarker=t,e.releaseProxy=r,e.transfer=b,e.transferHandlers=o,e.windowEndpoint=function(e,t=globalThis,n="*"){return{postMessage:(t,r)=>e.postMessage(t,n,r),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}},e.wrap=d},"object"==typeof e&&"u">typeof t?r(e):"function"==typeof define&&define.amd?define(["exports"],r):r((n="u">typeof globalThis?globalThis:n||self).Comlink={})},()=>(t||e((t={exports:{}}).exports,t),t.exports)),ed=_(()=>{A()});function ec(e,t){return null!==e&&"object"==typeof e&&"$typeName"in e&&"string"==typeof e.$typeName&&(void 0===t||t.typeName===e.$typeName)}var em,ep=_(()=>{A()}),ef=_(()=>{var e;A(),(e=em||(em={}))[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"});function eh(){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)==0)return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(15&n)<<28,t=(112&n)>>4,(128&n)==0)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)==0)return this.assertBounds(),[e,t]}throw Error("invalid varint")}function eg(e,t,n){for(let r=0;r<28;r+=7){let a=e>>>r,i=!(!(a>>>7)&&0==t),s=(i?128|a:a)&255;if(n.push(s),!i)return}let r=e>>>28&15|(7&t)<<4,a=t>>3!=0;if(n.push((a?128|r:r)&255),a){for(let e=3;e<31;e+=7){let r=t>>>e,a=!!(r>>>7),i=(a?128|r:r)&255;if(n.push(i),!a)return}n.push(t>>>31&1)}}function eb(e){let t="-"===e[0];t&&(e=e.slice(1));let n=0,r=0;function a(t,a){let i=Number(e.slice(t,a));r*=1e6,(n=1e6*n+i)>=ew&&(r+=n/ew|0,n%=ew)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?ev(n,r):eE(n,r)}function ey(e,t){if({lo:e,hi:t}={lo:e>>>0,hi:t>>>0},t<=2097151)return String(ew*t+e);let n=0xffffff&e,r=(e>>>24|t<<8)&0xffffff,a=t>>16&65535,i=n+6777216*r+6710656*a,s=r+8147497*a,o=2*a;return i>=1e7&&(s+=Math.floor(i/1e7),i%=1e7),s>=1e7&&(o+=Math.floor(s/1e7),s%=1e7),o.toString()+eN(s)+eN(i)}function eE(e,t){return{lo:0|e,hi:0|t}}function ev(e,t){return t=~t,e?e=~e+1:t+=1,eE(e,t)}function e_(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 eI(){let e=this.buf[this.pos++],t=127&e;if((128&e)==0||(t|=(127&(e=this.buf[this.pos++]))<<7,(128&e)==0)||(t|=(127&(e=this.buf[this.pos++]))<<14,(128&e)==0)||(t|=(127&(e=this.buf[this.pos++]))<<21,(128&e)==0))return this.assertBounds(),t;t|=(15&(e=this.buf[this.pos++]))<<28;for(let t=5;(128&e)!=0&&t<10;t++)e=this.buf[this.pos++];if((128&e)!=0)throw Error("invalid varint");return this.assertBounds(),t>>>0}var ew,eN,eA=_(()=>{A(),ew=0x100000000,eN=e=>{let t=String(e);return"0000000".slice(t.length)+t}});function eS(e){if(!/^-?[0-9]+$/.test(e))throw Error("invalid int64: "+e)}function ek(e){if(!/^[0-9]+$/.test(e))throw Error("invalid uint64: "+e)}var eF,eT=_(()=>{A(),eA(),eF=function(){let 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)){let t=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),r=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(e){let r="bigint"==typeof e?e:BigInt(e);if(r>n||r<t)throw Error(`invalid int64: ${e}`);return r},uParse(e){let t="bigint"==typeof e?e:BigInt(e);if(t>a||t<r)throw 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()),eS(e),e),uParse:e=>("string"!=typeof e&&(e=e.toString()),ek(e),e),enc:e=>("string"!=typeof e&&(e=e.toString()),eS(e),eb(e)),uEnc:e=>("string"!=typeof e&&(e=e.toString()),ek(e),eb(e)),dec:(e,t)=>{let n,r,a;return(r=0x80000000&(n=eE(e,t)).hi)&&(n=ev(n.lo,n.hi)),a=ey(n.lo,n.hi),r?"-"+a:a},uDec:(e,t)=>ey(e,t)}}()});function eO(e,t){switch(e){case em.STRING:return"";case em.BOOL:return!1;case em.DOUBLE:case em.FLOAT:return 0;case em.INT64:case em.UINT64:case em.SFIXED64:case em.FIXED64:case em.SINT64:return t?"0":eF.zero;case em.BYTES:return new Uint8Array(0);default:return 0}}var eD=_(()=>{A(),eT(),ef()});function eR(e,t){let n=e[t.localName].case;return void 0===n?n:t.fields.find(e=>e.localName===n)}function ex(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&void 0!==e[t]}function eC(e,t){if(t.oneof){let n=e[t.oneof.localName];return n.case===t.localName?n.value:void 0}return e[t.localName]}function eB(e,t,n){t.oneof?e[t.oneof.localName]={case:t.localName,value:n}:e[t.localName]=n}var eP,eV,eL=_(()=>{A(),eD(),eP=2,eV=Symbol.for("reflect unsafe local")});function eU(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function eZ(e,t){var n,r,a,i;if(eU(e)&&eV in e&&"add"in e&&"field"in e&&"function"==typeof e.field){if(void 0!==t){let s=e.field();return t.listKind==s.listKind&&t.scalar===s.scalar&&(null==(n=t.message)?void 0:n.typeName)===(null==(r=s.message)?void 0:r.typeName)&&(null==(a=t.enum)?void 0:a.typeName)===(null==(i=s.enum)?void 0:i.typeName)}return!0}return!1}function eG(e,t){var n,r,a,i;if(eU(e)&&eV in e&&"has"in e&&"field"in e&&"function"==typeof e.field){if(void 0!==t){let s=e.field();return t.mapKey===s.mapKey&&t.mapKind==s.mapKind&&t.scalar===s.scalar&&(null==(n=t.message)?void 0:n.typeName)===(null==(r=s.message)?void 0:r.typeName)&&(null==(a=t.enum)?void 0:a.typeName)===(null==(i=s.enum)?void 0:i.typeName)}return!0}return!1}function eW(e,t){return eU(e)&&eV in e&&"desc"in e&&eU(e.desc)&&"message"===e.desc.kind&&(void 0===t||e.desc.typeName==t.typeName)}var ej=_(()=>{A(),eL()});function eM(e){let t=e.fields[0];return eY(e.typeName)&&void 0!==t&&"scalar"==t.fieldKind&&"value"==t.name&&1==t.number}function eY(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}var eX=_(()=>{A()});function e$(e,t){if(ec(t,e))return t;let n=function(e){let t;if(function(e){switch(e.file.edition){case eq:return!1;case e1:return!0;default:return e.fields.some(e=>e.presence!=e0&&"message"!=e.fieldKind&&!e.oneof)}}(e)){let n=e3.get(e),r,a;if(n)({prototype:r,members:a}=n);else{for(let t of(r={},a=new Set,e.members))"oneof"!=t.kind&&("scalar"!=t.fieldKind&&"enum"!=t.fieldKind||t.presence!=e0&&(a.add(t),r[t.localName]=eH(t)));e3.set(e,{prototype:r,members:a})}for(let n of((t=Object.create(r)).$typeName=e.typeName,e.members))a.has(n)||"field"==n.kind&&("message"==n.fieldKind||("scalar"==n.fieldKind||"enum"==n.fieldKind)&&n.presence!=e0)||(t[n.localName]=eH(n))}else for(let n of(t={$typeName:e.typeName},e.members))("oneof"==n.kind||n.presence==e0)&&(t[n.localName]=eH(n));return t}(e);return void 0!==t&&function(e,t,n){for(let r of e.members){let e,a=n[r.localName];if(null!=a){if("oneof"==r.kind){let t=eR(n,r);if(!t)continue;e=t,a=eC(n,t)}else e=r;switch(e.fieldKind){case"message":a=eJ(e,a);break;case"scalar":a=eK(e,a);break;case"list":a=function(e,t){if(Array.isArray(t)){if(e.scalar==em.BYTES)return t.map(eQ);if("message"==e.listKind)return t.map(t=>eJ(e,t))}return t}(e,a);break;case"map":a=function(e,t){if(eU(t)){if(e.scalar==em.BYTES)return ez(t,eQ);if("message"==e.mapKind)return ez(t,t=>eJ(e,t))}return t}(e,a)}eB(t,e,a)}}}(e,n,t),n}function eK(e,t){return e.scalar==em.BYTES?eQ(t):t}function eJ(e,t){if("message"==e.fieldKind&&!e.oneof&&eM(e.message))return eK(e.message.fields[0],t);if(eU(t)){if("google.protobuf.Struct"==e.message.typeName&&"google.protobuf.Value"!==e.parent.typeName)return t;if(!ec(t,e.message))return e$(e.message,t)}return t}function eQ(e){return Array.isArray(e)?new Uint8Array(e):e}function ez(e,t){let n={};for(let r of Object.entries(e))n[r[0]]=t(r[1]);return n}function eH(e){if("oneof"==e.kind)return{case:void 0};if("list"==e.fieldKind)return[];if("map"==e.fieldKind)return{};if("message"==e.fieldKind)return e2;let t=e.getDefaultValue();return void 0!==t?"scalar"==e.fieldKind&&e.longAsString?t.toString():t:"scalar"==e.fieldKind?eO(e.scalar,e.longAsString):e.enum.values[0].number}var eq,e1,e0,e2,e3,e9,e4=_(()=>{A(),ep(),ef(),eD(),ej(),eL(),eX(),eq=999,e1=998,e0=2,e2=Symbol(),e3=new WeakMap}),e5=_(()=>{A(),e9=class extends Error{constructor(e,t,n="FieldValueInvalidError"){super(t),this.name=n,this.field=()=>e}}});function e6(){if(null==globalThis[e8]){let e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[e8]={encodeUtf8:t=>e.encode(t),decodeUtf8:e=>t.decode(e),checkUtf8(e){try{return encodeURIComponent(e),!0}catch{return!1}}}}return globalThis[e8]}var e8,e7=_(()=>{A(),e8=Symbol.for("@bufbuild/protobuf/text-encoding")});function te(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>ts||e<to)throw Error("invalid int32: "+e)}function tt(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>ti||e<0)throw Error("invalid uint32: "+e)}var tn,tr,ta,ti,ts,to,tl,tu,td=_(()=>{var e;A(),eA(),eT(),e7(),(e=tn||(tn={}))[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",tr=34028234663852886e22,ta=-34028234663852886e22,ti=0xffffffff,ts=0x7fffffff,to=-0x80000000,tl=class{constructor(e=e6().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 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(tt(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}int32(e){return te(e),e_(e,this.buf),this}bool(e){return this.buf.push(+!!e),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){var t=e;if("string"==typeof t){let e=t;if(Number.isNaN(t=Number(t))&&"NaN"!==e)throw Error("invalid float32: "+e)}else if("number"!=typeof t)throw Error("invalid float32: "+typeof t);if(Number.isFinite(t)&&(t>tr||t<ta))throw Error("invalid float32: "+t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,e,!0),this.raw(n)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){tt(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){te(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return te(e),e_(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=eF.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=eF.uEnc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}int64(e){let t=eF.enc(e);return eg(t.lo,t.hi,this.buf),this}sint64(e){let t=eF.enc(e),n=t.hi>>31;return eg(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}uint64(e){let t=eF.uEnc(e);return eg(t.lo,t.hi,this.buf),this}},tu=class{constructor(e,t=e6().decodeUtf8){this.decodeUtf8=t,this.varint64=eh,this.uint32=eI,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 Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}skip(e,t){let n=this.pos;switch(e){case tn.Varint:for(;128&this.buf[this.pos++];);break;case tn.Bit64:this.pos+=4;case tn.Bit32:this.pos+=4;break;case tn.LengthDelimited:let r=this.uint32();this.pos+=r;break;case tn.StartGroup:for(;;){let[e,n]=this.tag();if(n===tn.EndGroup){if(void 0!==t&&e!==t)throw Error("invalid end group tag");break}this.skip(n,e)}break;default:throw Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let e=this.uint32();return e>>>1^-(1&e)}int64(){return eF.dec(...this.varint64())}uint64(){return eF.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(1&e);return e=(e>>>1|(1&t)<<31)^n,t=t>>>1^n,eF.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 eF.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return eF.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 tc(e,t,n){let r=tm(e,n);if(!0!==r)return new e9(e,`list item #${t+1}: ${tf(e,n,r)}`)}function tm(e,t){return void 0!==e.scalar?tp(t,e.scalar):void 0!==e.enum?e.enum.open?Number.isInteger(t):e.enum.values.some(e=>e.number===t):eW(t,e.message)}function tp(e,t){switch(t){case em.DOUBLE:return"number"==typeof e;case em.FLOAT:return"number"==typeof e&&(!(!Number.isNaN(e)&&Number.isFinite(e))||!(e>tr)&&!(e<ta)||`${e.toFixed()} out of range`);case em.INT32:case em.SFIXED32:case em.SINT32:return"number"==typeof e&&!!Number.isInteger(e)&&(!(e>ts)&&!(e<to)||`${e.toFixed()} out of range`);case em.FIXED32:case em.UINT32:return"number"==typeof e&&!!Number.isInteger(e)&&(!(e>ti)&&!(e<0)||`${e.toFixed()} out of range`);case em.BOOL:return"boolean"==typeof e;case em.STRING:return"string"==typeof e&&(e6().checkUtf8(e)||"invalid UTF8");case em.BYTES:return e instanceof Uint8Array;case em.INT64:case em.SFIXED64:case em.SINT64:if("bigint"==typeof e||"number"==typeof e||"string"==typeof e&&e.length>0)try{return eF.parse(e),!0}catch{return`${e} out of range`}return!1;case em.FIXED64:case em.UINT64:if("bigint"==typeof e||"number"==typeof e||"string"==typeof e&&e.length>0)try{return eF.uParse(e),!0}catch{return`${e} out of range`}return!1}}function tf(e,t,n){return n="string"==typeof n?`: ${n}`:`, got ${th(t)}`,void 0!==e.scalar?`expected ${function(e){switch(e){case em.STRING:return"string";case em.BOOL:return"boolean";case em.INT64:case em.SINT64:case em.SFIXED64:return"bigint (int64)";case em.UINT64:case em.FIXED64:return"bigint (uint64)";case em.BYTES:return"Uint8Array";case em.DOUBLE:return"number (float64)";case em.FLOAT:return"number (float32)";case em.FIXED32:case em.UINT32:return"number (uint32)";case em.INT32:case em.SFIXED32:case em.SINT32:return"number (int32)"}}(e.scalar)}`+n:void 0!==e.enum?`expected ${e.enum.toString()}`+n:`expected ${tg(e.message)}`+n}function th(e){switch(typeof e){case"object":return null===e?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:eZ(e)?tb(e.field()):eG(e)?ty(e.field()):eW(e)?tg(e.desc):ec(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 tg(e){return`ReflectMessage (${e.typeName})`}function tb(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${em[e.scalar]})`}}function ty(e){switch(e.mapKind){case"message":return`ReflectMap (${em[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${em[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${em[e.mapKey]}, ${em[e.scalar]})`}}var tE=_(()=>{A(),ef(),ep(),e5(),ej(),td(),e7(),eT()});function tv(e,t,n=!0){return new tR(e,t,n)}function t_(e,t){if(t.parent.typeName!==e.$typeName)throw new e9(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}function tI(e,t){return eW(t)?eY(t.message.$typeName)&&!e.oneof&&"message"==e.fieldKind?t.message.value:"google.protobuf.Struct"==t.desc.typeName&&"google.protobuf.Value"!=e.parent.typeName?function e(t){let n={};for(let[r,a]of Object.entries(t.fields))n[r]=function t(n){switch(n.kind.case){case"structValue":return e(n.kind.value);case"listValue":return n.kind.value.values.map(t);case"nullValue":case void 0:return null;default:return n.kind.value}}(a);return n}(t.message):t.message:t}function tw(e,t,n){return void 0!==t&&(eM(e.message)&&!e.oneof&&"message"==e.fieldKind?t={$typeName:e.message.typeName,value:tT(e.message.fields[0],t)}:"google.protobuf.Struct"==e.message.typeName&&"google.protobuf.Value"!=e.parent.typeName&&eU(t)&&(t=function e(t){let n={$typeName:"google.protobuf.Struct",fields:{}};if(eU(t))for(let[r,a]of Object.entries(t))n.fields[r]=function t(n){let r={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof n){case"number":r.kind={case:"numberValue",value:n};break;case"string":r.kind={case:"stringValue",value:n};break;case"boolean":r.kind={case:"boolValue",value:n};break;case"object":if(null===n)r.kind={case:"nullValue",value:0};else if(Array.isArray(n)){let e={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(n))for(let r of n)e.values.push(t(r));r.kind={case:"listValue",value:e}}else r.kind={case:"structValue",value:e(n)}}return r}(a);return n}(t))),new tR(e.message,t,n)}function tN(e,t){return"message"==e.listKind?tI(e,t):tO(e,t)}function tA(e,t,n){return"message"==e.listKind?tw(e,t,n):tT(e,t)}function tS(e,t,n){return"message"==e.mapKind?tw(e,t,n):t}function tk(e){return"string"==typeof e||"number"==typeof e?e:String(e)}function tF(e,t){switch(t){case em.STRING:break;case em.INT32:case em.FIXED32:case em.UINT32:case em.SFIXED32:case em.SINT32:{let t=Number.parseInt(e);if(Number.isFinite(t))return t;break}case em.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case em.UINT64:case em.FIXED64:try{return eF.uParse(e)}catch{}break;default:try{return eF.parse(e)}catch{}}return e}function tT(e,t){switch(e.scalar){case em.INT64:case em.SFIXED64:case em.SINT64:"longAsString"in e&&e.longAsString&&"string"==typeof t&&(t=eF.parse(t));break;case em.FIXED64:case em.UINT64:"longAsString"in e&&e.longAsString&&"string"==typeof t&&(t=eF.uParse(t))}return t}function tO(e,t){switch(e.scalar){case em.INT64:case em.SFIXED64:case em.SINT64:"longAsString"in e&&e.longAsString?t=String(t):("string"==typeof t||"number"==typeof t)&&(t=eF.parse(t));break;case em.FIXED64:case em.UINT64:"longAsString"in e&&e.longAsString?t=String(t):("string"==typeof t||"number"==typeof t)&&(t=eF.uParse(t))}return t}var tD,tR,tx,tC,tB,tP,tV=_(()=>{A(),ef(),tE(),e5(),eL(),e4(),eX(),eD(),eT(),ej(),tD=new WeakMap,tR=class{get sortedFields(){let e=tD.get(this.desc);if(e)return e;let t=this.desc.fields.concat().sort((e,t)=>e.number-t.number);return tD.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[eV]=t??e$(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 t_(this.message,e),eR(this.message,e)}isSet(e){return t_(this.message,e),function(e,t){let n=t.localName;if(t.oneof)return e[t.oneof.localName].case===n;if(t.presence!=eP)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 em.BOOL:return!1===t;case em.STRING:return""===t;case em.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 Error("message field with implicit presence")}(this.message,e)}clear(e){t_(this.message,e),function(e,t){let n=t.localName;if(t.oneof){let r=t.oneof.localName;e[r].case===n&&(e[r]={case:void 0})}else if(t.presence!=eP)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]=eO(t.scalar,t.longAsString)}}(this.message,e)}get(e){t_(this.message,e);let t=eC(this.message,e);switch(e.fieldKind){case"list":let n=this.lists.get(e);return n&&n[eV]===t||this.lists.set(e,n=new tx(e,t,this.check)),n;case"map":let r=this.maps.get(e);return r&&r[eV]===t||this.maps.set(e,r=new tC(e,t,this.check)),r;case"message":return tw(e,t,this.check);case"scalar":return void 0===t?eO(e.scalar,!1):tT(e,t);case"enum":return t??e.enum.values[0].number}}set(e,t){let n;if(t_(this.message,e),this.check){let n=function(e,t){let n,r="list"==e.fieldKind?eZ(t,e):"map"==e.fieldKind?eG(t,e):tm(e,t);if(!0!==r){switch(e.fieldKind){case"list":n=`expected ${tb(e)}, got ${th(t)}`;break;case"map":n=`expected ${ty(e)}, got ${th(t)}`;break;default:n=tf(e,t,r)}return new e9(e,n)}}(e,t);if(n)throw n}n="message"==e.fieldKind?tI(e,t):eG(t)||eZ(t)?t[eV]:tO(e,t),eB(this.message,e,n)}getUnknown(){return this.message.$unknown}setUnknown(e){this.message.$unknown=e}},tx=class{field(){return this._field}get size(){return this._arr.length}constructor(e,t,n){this._field=e,this._arr=this[eV]=t,this.check=n}get(e){let t=this._arr[e];return void 0===t?void 0:tA(this._field,t,this.check)}set(e,t){if(e<0||e>=this._arr.length)throw new e9(this._field,`list item #${e+1}: out of range`);if(this.check){let n=tc(this._field,e,t);if(n)throw n}this._arr[e]=tN(this._field,t)}add(e){if(this.check){let t=tc(this._field,this._arr.length,e);if(t)throw t}this._arr.push(tN(this._field,e))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(let e of this._arr)yield tA(this._field,e,this.check)}*entries(){for(let e=0;e<this._arr.length;e++)yield[e,tA(this._field,this._arr[e],this.check)]}},tC=class{constructor(e,t,n=!0){this.obj=this[eV]=t??{},this.check=n,this._field=e}field(){return this._field}set(e,t){var n;if(this.check){let n=function(e,t,n){let r=tp(t,e.mapKey);if(!0!==r)return new e9(e,`invalid map key: ${tf({scalar:e.mapKey},t,r)}`);let a=tm(e,n);if(!0!==a)return new e9(e,`map entry ${th(t)}: ${tf(e,n,a)}`)}(this._field,e,t);if(n)throw n}return this.obj[tk(e)]=(n=this._field,"message"==n.mapKind?tI(n,t):tO(n,t)),this}delete(e){let t=tk(e),n=Object.prototype.hasOwnProperty.call(this.obj,t);return n&&delete this.obj[t],n}clear(){for(let e of Object.keys(this.obj))delete this.obj[e]}get(e){let t=this.obj[tk(e)];return void 0!==t&&(t=tS(this._field,t,this.check)),t}has(e){return Object.prototype.hasOwnProperty.call(this.obj,tk(e))}*keys(){for(let e of Object.keys(this.obj))yield tF(e,this._field.mapKey)}*entries(){for(let e of Object.entries(this.obj))yield[tF(e[0],this._field.mapKey),tS(this._field,e[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(let e of Object.values(this.obj))yield tS(this._field,e,this.check)}forEach(e,t){for(let n of this.entries())e.call(t,n[1],n[0],this)}}}),tL=_(()=>{A()}),tU=_(()=>{A()});function tZ(e){let t=!1,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("")}function tG(e){return tW.has(e)?e+"$":e}var tW,tj=_(()=>{A(),tW=new Set(["constructor","toString","toJSON","valueOf"])});function tM(e){for(let t of e.field)ex(t,"jsonName")||(t.jsonName=tZ(t.name));e.nestedType.forEach(tM)}var tY=_(()=>{A(),tj(),eL()}),tX=_(()=>{A(),ef(),eT()}),t$=_(()=>{A()});function tK(...e){let t,n,r,a=(t=new Map,n=new Map,r=new Map,{kind:"registry",types:t,extendees:n,[Symbol.iterator]:()=>t.values(),get files(){return r.values()},addFile(e,t,n){if(r.set(e.proto.name,e),!t)for(let t of function* e(t){switch(t.kind){case"file":for(let n of t.messages)yield n,yield*e(n);yield*t.enums,yield*t.services,yield*t.extensions;break;case"message":for(let n of t.nestedMessages)yield n,yield*e(n);yield*t.nestedEnums,yield*t.nestedExtensions}}(e))this.add(t);if(n)for(let r of e.dependencies)this.addFile(r,t,n)},add(e){if("extension"==e.kind){let t=n.get(e.extendee.typeName);t||n.set(e.extendee.typeName,t=new Map),t.set(e.number,e)}t.set(e.typeName,e)},get:e=>t.get(e),getFile:e=>r.get(e),getMessage(e){let n=t.get(e);return n?.kind=="message"?n:void 0},getEnum(e){let n=t.get(e);return n?.kind=="enum"?n:void 0},getExtension(e){let n=t.get(e);return n?.kind=="extension"?n:void 0},getExtensionFor(e,t){var r;return null==(r=n.get(e.typeName))?void 0:r.get(t)},getService(e){let n=t.get(e);return n?.kind=="service"?n:void 0}});if(!e.length)return a;if("$typeName"in e[0]&&"google.protobuf.FileDescriptorSet"==e[0].$typeName){for(let t of e[0].file)tJ(t,a);return a}if("$typeName"in e[0]){let t=function(e){let n=[];for(let t of e.dependency){if(null!=a.getFile(t)||i.has(t))continue;let s=r(t);if(!s)throw Error(`Unable to resolve ${t}, imported by ${e.name}`);"kind"in s?a.addFile(s,!1,!0):(i.add(s.name),n.push(s))}return n.concat(...n.map(t))},n=e[0],r=e[1],i=new Set;for(let e of[n,...t(n)].reverse())tJ(e,a)}else for(let t of e)for(let e of t.files)a.addFile(e);return a}function tJ(e,t){var n,r,a,i;let s={kind:"file",proto:e,deprecated:null!=(r=null==(n=e.options)?void 0:n.deprecated)&&r,edition:function(e){switch(e.syntax){case"":case"proto2":return t4;case"proto3":return t5;case"editions":if(e.edition in nm)return e.edition;throw Error(`${e.name}: unsupported edition`);default:throw Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}(e),name:e.name.replace(/\.proto$/,""),dependencies:(a=e,i=t,a.dependency.map(e=>{let t=i.getFile(e);if(!t)throw Error(`Cannot find ${e}, imported by ${a.name}`);return t})),enums:[],messages:[],extensions:[],services:[],toString:()=>`file ${e.name}`},o=new Map,l={get:e=>o.get(e),add(e){var t;t9((null==(t=e.proto.options)?void 0:t.mapEntry)===!0),o.set(e.typeName,e)}};for(let n of e.enumType)tH(n,s,void 0,t);for(let n of e.messageType)!function e(t,n,r,a,i){var s,o,l,u;let d={kind:"message",proto:t,deprecated:null!=(o=null==(s=t.options)?void 0:s.deprecated)&&o,file:n,parent:r,name:t.name,typeName:t1(t,r,n),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};for(let e of((null==(l=t.options)?void 0:l.mapEntry)===!0?i.add(d):((null!=(u=r?.nestedMessages)?u:n.messages).push(d),a.add(d)),t.enumType))tH(e,n,d,a);for(let r of t.nestedType)e(r,n,d,a,i)}(n,s,void 0,t,l);for(let n of e.service)!function(e,t,n){var r,a;let i={kind:"service",proto:e,deprecated:null!=(a=null==(r=e.options)?void 0:r.deprecated)&&a,file:t,name:e.name,typeName:t1(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};for(let r of(t.services.push(i),n.add(i),e.method)){let e=function(e,t,n){var r,a,i,s;let o;o=e.clientStreaming&&e.serverStreaming?"bidi_streaming":e.clientStreaming?"client_streaming":e.serverStreaming?"server_streaming":"unary";let l=n.getMessage(t0(e.inputType)),u=n.getMessage(t0(e.outputType));t9(l,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),t9(u,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);let d=e.name;return{kind:"rpc",proto:e,deprecated:null!=(a=null==(r=e.options)?void 0:r.deprecated)&&a,parent:t,name:d,localName:tG(d.length?tG(d[0].toLowerCase()+d.substring(1)):d),methodKind:o,input:l,output:u,idempotency:null!=(s=null==(i=e.options)?void 0:i.idempotencyLevel)?s:ni,toString:()=>`rpc ${t.typeName}.${d}`}}(r,i,n);i.methods.push(e),i.method[e.localName]=e}}(n,s,t);for(let e of(tQ(s,t),o.values()))tz(e,t,l);for(let e of s.messages)tz(e,t,l),tQ(e,t);t.addFile(s,!0)}function tQ(e,t){switch(e.kind){case"file":for(let n of e.proto.extension){let r=tq(n,e,t);e.extensions.push(r),t.add(r)}break;case"message":for(let n of e.proto.extension){let r=tq(n,e,t);e.nestedExtensions.push(r),t.add(r)}for(let n of e.nestedMessages)tQ(n,t)}}function tz(e,t,n){let r=e.proto.oneofDecl.map(t=>{var n,r;return{kind:"oneof",proto:n=t,deprecated:!1,parent:r=e,fields:[],name:n.name,localName:tG(tZ(n.name)),toString(){return`oneof ${r.typeName}.${this.name}`}}}),a=new Set;for(let i of e.proto.field){let s=function(e,t){if(!ex(e,"oneofIndex")||e.proto3Optional)return;let n=t[e.oneofIndex];return t9(n,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),n}(i,r),o=tq(i,e,t,s,n);e.fields.push(o),e.field[o.localName]=o,void 0===s?e.members.push(o):(s.fields.push(o),a.has(s)||(a.add(s),e.members.push(s)))}for(let t of r.filter(e=>a.has(e)))e.oneofs.push(t);for(let r of e.nestedMessages)tz(r,t,n)}function tH(e,t,n,r){var a,i,s,o,l,u,d;let c=function(e,t){var n;let r=((n=e).substring(0,1)+n.substring(1).replace(/[A-Z]/g,e=>"_"+e)).toLowerCase()+"_";for(let e of t){if(!e.name.toLowerCase().startsWith(r))return;let t=e.name.substring(r.length);if(0==t.length||/^\d/.test(t))return}return r}(e.name,e.value),m={kind:"enum",proto:e,deprecated:null!=(i=null==(a=e.options)?void 0:a.deprecated)&&i,file:t,parent:n,open:!0,name:e.name,typeName:t1(e,n,t),value:{},values:[],sharedPrefix:c,toString(){return`enum ${this.typeName}`}};for(let t of(m.open=nc==t3("enumType",{proto:(u=m).proto,parent:null!=(d=u.parent)?d:u.file}),r.add(m),e.value)){let e=t.name;m.values.push(m.value[t.number]={kind:"enum_value",proto:t,deprecated:null!=(o=null==(s=t.options)?void 0:s.deprecated)&&o,parent:m,name:e,localName:tG(null==c?e:e.substring(c.length)),number:t.number,toString:()=>`enum value ${m.typeName}.${e}`})}(null!=(l=n?.nestedEnums)?l:t.enums).push(m)}function tq(e,t,n,r,a){var i,s,o,l;let u=void 0===a,d={kind:"field",proto:e,deprecated:null!=(s=null==(i=e.options)?void 0:i.deprecated)&&s,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:function(e,t,n,r){if(e.label==nr)return nl;if(e.label==nn)return no;if(t||e.proto3Optional||n)return ns;let a=t3("fieldPresence",{proto:e,parent:r});return a==no&&(e.type==t7||e.type==t8)?ns:a}(e,r,u,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(u){let r="file"==t.kind?t:t.file,a="file"==t.kind?void 0:t,i=t1(e,a,r);d.kind="extension",d.file=r,d.parent=a,d.oneof=void 0,d.typeName=i,d.jsonName=`[${i}]`,d.toString=()=>`extension ${i}`;let s=n.getMessage(t0(e.extendee));t9(s,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),d.extendee=s}else t9("message"==t.kind),d.parent=t,d.oneof=r,d.localName=r?tZ(e.name):tG(tZ(e.name)),d.jsonName=e.jsonName,d.toString=()=>`field ${t.typeName}.${e.name}`;let c=e.label,m=e.type,p=null==(o=e.options)?void 0:o.jstype;if(c===nn){let r=m==t7?a?.get(t0(e.typeName)):void 0;if(r){let e,t;d.fieldKind="map";let{key:n,value:a}=(e=(l=r).fields.find(e=>1===e.number),t=l.fields.find(e=>2===e.number),t9(e&&"scalar"==e.fieldKind&&e.scalar!=em.BYTES&&e.scalar!=em.FLOAT&&e.scalar!=em.DOUBLE&&t&&"list"!=t.fieldKind&&"map"!=t.fieldKind),{key:e,value:t});return d.mapKey=n.scalar,d.mapKind=a.fieldKind,d.message=a.message,d.delimitedEncoding=!1,d.enum=a.enum,d.scalar=a.scalar,d}switch(d.fieldKind="list",m){case t7:case t8:d.listKind="message",d.message=n.getMessage(t0(e.typeName)),t9(d.message),d.delimitedEncoding=t2(e,t);break;case nt:d.listKind="enum",d.enum=n.getEnum(t0(e.typeName)),t9(d.enum);break;default:d.listKind="scalar",d.scalar=m,d.longAsString=p==na}return d.packed=function(e,t){if(e.label!=nn)return!1;switch(e.type){case t6:case ne:case t8:case t7:return!1}let n=e.options;return n&&ex(n,"packed")?n.packed:nu==t3("repeatedFieldEncoding",{proto:e,parent:t})}(e,t),d}switch(m){case t7:case t8:d.fieldKind="message",d.message=n.getMessage(t0(e.typeName)),t9(d.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),d.delimitedEncoding=t2(e,t),d.getDefaultValue=()=>{};break;case nt:{let t=n.getEnum(t0(e.typeName));t9(void 0!==t,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),d.fieldKind="enum",d.enum=n.getEnum(t0(e.typeName)),d.getDefaultValue=()=>ex(e,"defaultValue")?function(e,t){let n=e.values.find(e=>e.name===t);if(!n)throw Error(`cannot parse ${e} default value: ${t}`);return n.number}(t,e.defaultValue):void 0;break}default:d.fieldKind="scalar",d.scalar=m,d.longAsString=p==na,d.getDefaultValue=()=>ex(e,"defaultValue")?function(e,t){switch(e){case em.STRING:return t;case em.BYTES:{let n=function(e){let 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){let 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":{let e=n.c,r=n.take(2);if(!1===r)return!1;let a=parseInt(e+r,8);if(Number.isNaN(a))return!1;t.push(a);break}case"x":{let e=n.c,r=n.take(2);if(!1===r)return!1;let a=parseInt(e+r,16);if(Number.isNaN(a))return!1;t.push(a);break}case"u":{let e=n.c,r=n.take(4);if(!1===r)return!1;let a=parseInt(e+r,16);if(Number.isNaN(a))return!1;let i=new Uint8Array(4);new DataView(i.buffer).setInt32(0,a,!0),t.push(i[0],i[1],i[2],i[3]);break}case"U":{let e=n.c,r=n.take(8);if(!1===r)return!1;let a=eF.uEnc(e+r),i=new Uint8Array(8),s=new DataView(i.buffer);s.setInt32(0,a.lo,!0),s.setInt32(4,a.hi,!0),t.push(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7])}}}else t.push(n.c.charCodeAt(0));return new Uint8Array(t)}(t);if(!1===n)throw Error(`cannot parse ${em[e]} default value: ${t}`);return n}case em.INT64:case em.SFIXED64:case em.SINT64:return eF.parse(t);case em.UINT64:case em.FIXED64:return eF.uParse(t);case em.DOUBLE:case em.FLOAT:switch(t){case"inf":return 1/0;case"-inf":return-1/0;case"nan":return NaN;default:return parseFloat(t)}case em.BOOL:return"true"===t;case em.INT32:case em.UINT32:case em.SINT32:case em.FIXED32:case em.SFIXED32:return parseInt(t,10)}}(m,e.defaultValue):void 0}return d}function t1(e,t,n){return t?`${t.typeName}.${e.name}`:n.proto.package.length>0?`${n.proto.package}.${e.name}`:`${e.name}`}function t0(e){return e.startsWith(".")?e.substring(1):e}function t2(e,t){return e.type==t8||nd==t3("messageEncoding",{proto:e,parent:t})}function t3(e,t){var n,r;let a=null==(n=t.proto.options)?void 0:n.features;if(a){let t=a[e];if(0!=t)return t}if("kind"in t){if("message"==t.kind)return t3(e,null!=(r=t.parent)?r:t.file);let n=nm[t.edition];if(!n)throw Error(`feature default for edition ${t.edition} not found`);return n[e]}return t3(e,t.parent)}function t9(e,t){if(!e)throw Error(t)}var t4,t5,t6,t8,t7,ne,nt,nn,nr,na,ni,ns,no,nl,nu,nd,nc,nm,np=_(()=>{A(),ef(),tX(),t$(),eL(),tj(),t4=998,t5=999,t6=9,t8=10,t7=11,ne=12,nt=14,nn=3,nr=2,na=1,ni=0,ns=1,no=2,nl=3,nu=1,nd=2,nc=1,nm={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 nf(e){var t,n,r,a,i,s,o,l;return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:null!=(n=null==(t=e.field)?void 0:t.map(nh))?n:[],extension:[],nestedType:null!=(a=null==(r=e.nestedType)?void 0:r.map(nf))?a:[],enumType:null!=(s=null==(i=e.enumType)?void 0:i.map(ng))?s:[],extensionRange:null!=(l=null==(o=e.extensionRange)?void 0:o.map(e=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},e)))?l:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function nh(e){var t,n,r,a;return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?(t=e.options,Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},t),{targets:null!=(n=t.targets)?n:[],editionDefaults:null!=(a=null==(r=t.editionDefaults)?void 0:r.map(e=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},e)))?a:[],uninterpretedOption:[]}))):void 0}))}function ng(e){return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(e=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},e))})}var nb=_(()=>{A(),tY(),np()}),ny=_(()=>{A()});function nE(e){let t={};for(let n of e.values)t[n.localName]=n.number,t[n.number]=n.localName;return t}var nv,n_,nI,nw,nN,nA,nS,nk,nF,nT,nO,nD,nR,nx,nC,nB,nP,nV,nL,nU,nZ,nG=_(()=>{A()}),nW=_(()=>{var e,t,n,r,a,i,s,o,l,u,d,c,m,p,f,h,g,b,y,E,v;let _;A(),nb(),ny(),(v={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:0x1ff2b601}]},{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:0x20000000}]},{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: