@e2b/cli 1.2.0-beta.2 → 1.2.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -116,7 +116,7 @@ ${qT}
|
|
|
116
116
|
Try running with %s or get access `,Ae.cyan("sudo"))+`
|
|
117
117
|
to the local update config store via
|
|
118
118
|
`+Ae.cyan((0,Nu.format)(" sudo chown -R $USER:$(id -gn $USER) %s ",fs));Xn.default.on("exit",()=>{console.error(Qn(n,{textAlignment:"center"}))})}}check(){!this.config||this.config.get("optOut")||this.#n||(this.update=this.config.get("update"),this.update&&(this.update.current=this.#e,this.config.delete("update")),!(Date.now()-this.config.get("lastUpdateCheck")<this.#r)&&(0,FN.spawn)(Xn.default.execPath,[dE.default.join(zK,"check.js"),JSON.stringify(this.#t)],{detached:!0,stdio:"ignore"}).unref())}async fetchInfo(){let{distTag:t}=this.#t,n=await Hf(this._packageName,{version:t});return{latest:n,current:this.#e,type:yp(this.#e,n)||t,name:this._packageName}}notify(t){let n=!this._shouldNotifyInNpmScript&&yR;if(!Xn.default.stdout.isTTY||n||!this.update||!BN.default.gt(this.update.latest,this.update.current))return this;t={isGlobal:UN.default,isYarnGlobal:HR(),...t};let r;t.isYarnGlobal?r=`yarn global add ${this._packageName}`:t.isGlobal?r=`npm i -g ${this._packageName}`:zf()?r=`yarn add ${this._packageName}`:r=`npm i ${this._packageName}`;let i="Update available "+Ae.dim("{currentVersion}")+Ae.reset(" \u2192 ")+Ae.green("{latestVersion}")+`
|
|
119
|
-
Run `+Ae.cyan("{updateCommand}")+" to update",s=t.message||i;t.boxenOptions=t.boxenOptions||{padding:1,margin:1,textAlignment:"center",borderColor:"yellow",borderStyle:"round"};let a=Qn(uE(s,{packageName:this._packageName,currentVersion:this.update.current,latestVersion:this.update.latest,updateCommand:r}),t.boxenOptions);return t.defer===!1?console.error(a):(Xn.default.on("exit",()=>{console.error(a)}),Xn.default.on("SIGINT",()=>{console.error(""),Xn.default.exit()})),this}};function _E(e){let t=new Bo(e);return t.check(),t}l();var tA=$(eA(),1),{program:pbe,createCommand:fbe,createArgument:Ebe,createOption:gbe,CommanderError:hbe,InvalidArgumentError:Sbe,InvalidOptionArgumentError:Tbe,Command:xe,Argument:bbe,Option:Qr,Help:Cbe}=tA.default;var NE={};iT(NE,{author:()=>gW,bin:()=>NW,bugs:()=>hW,default:()=>IW,dependencies:()=>AW,description:()=>pW,devDependencies:()=>yW,engines:()=>OW,files:()=>RW,homepage:()=>fW,keywords:()=>bW,license:()=>EW,name:()=>mW,publishConfig:()=>TW,repository:()=>SW,scripts:()=>DW,sideEffects:()=>CW,version:()=>AE});var mW="@e2b/cli",AE="1.2.0-beta.
|
|
119
|
+
Run `+Ae.cyan("{updateCommand}")+" to update",s=t.message||i;t.boxenOptions=t.boxenOptions||{padding:1,margin:1,textAlignment:"center",borderColor:"yellow",borderStyle:"round"};let a=Qn(uE(s,{packageName:this._packageName,currentVersion:this.update.current,latestVersion:this.update.latest,updateCommand:r}),t.boxenOptions);return t.defer===!1?console.error(a):(Xn.default.on("exit",()=>{console.error(a)}),Xn.default.on("SIGINT",()=>{console.error(""),Xn.default.exit()})),this}};function _E(e){let t=new Bo(e);return t.check(),t}l();var tA=$(eA(),1),{program:pbe,createCommand:fbe,createArgument:Ebe,createOption:gbe,CommanderError:hbe,InvalidArgumentError:Sbe,InvalidOptionArgumentError:Tbe,Command:xe,Argument:bbe,Option:Qr,Help:Cbe}=tA.default;var NE={};iT(NE,{author:()=>gW,bin:()=>NW,bugs:()=>hW,default:()=>IW,dependencies:()=>AW,description:()=>pW,devDependencies:()=>yW,engines:()=>OW,files:()=>RW,homepage:()=>fW,keywords:()=>bW,license:()=>EW,name:()=>mW,publishConfig:()=>TW,repository:()=>SW,scripts:()=>DW,sideEffects:()=>CW,version:()=>AE});var mW="@e2b/cli",AE="1.2.0-beta.3",pW="CLI for managing e2b sandbox templates",fW="https://e2b.dev",EW="MIT",gW={name:"FoundryLabs, Inc.",email:"hello@e2b.dev",url:"https://e2b.dev"},hW="https://github.com/e2b-dev/e2b/issues",SW={type:"git",url:"https://github.com/e2b-dev/e2b",directory:"packages/cli"},TW={access:"public"},bW=["e2b","ai-agents","agents","ai","code-interpreter","sandbox","code","cli","runtime","vm","nodejs","javascript","typescript"],CW=!1,DW={prepublishOnly:"pnpm build",build:"tsc --noEmit --skipLibCheck && tsup --minify",dev:"tsup --watch",test:"pnpm build && cd testground/demo-basic && ../../dist/index.js template build","check-deps":"knip","update-deps":"ncu -u && pnpm i","generate-ref":"./scripts/generate_sdk_ref.sh"},yW={"@types/command-exists":"^1.2.3","@types/inquirer":"^9.0.7","@types/json2md":"^1.5.4","@types/node":"^18.18.6","@types/update-notifier":"6.0.5",json2md:"^2.0.1",knip:"^5.43.6","npm-check-updates":"^16.14.6",tsup:"^8.3.6",typescript:"^5.2.2"},RW=["dist","LICENSE","README","package.json"],NW={e2b:"dist/index.js"},AW={"@iarna/toml":"^2.2.5","async-listen":"^3.0.1",boxen:"^7.1.1",chalk:"^5.3.0","cli-highlight":"^2.1.11","command-exists":"^1.2.9",commander:"^11.1.0","console-table-printer":"^2.11.2",e2b:"1.2.0-beta.4",inquirer:"^9.2.12",open:"^9.1.0","strip-ansi":"^7.1.0","update-notifier":"^6.0.2",yup:"^1.3.2"},OW={node:">=18"},IW={name:mW,version:AE,description:pW,homepage:fW,license:EW,author:gW,bugs:hW,repository:SW,publishConfig:TW,keywords:bW,sideEffects:CW,scripts:DW,devDependencies:yW,files:RW,bin:NW,dependencies:AW,engines:OW};l();l();var ng=$(d5());l();var oa=$(require("path"));function tr(e){let t=process.cwd();return e?oa.isAbsolute(e)?e:oa.resolve(t,e):t}function _5(e){return oa.relative(process.cwd(),e)}var Pre="#FFB766";function Pd(e){let t=Ee(e.email),n=e.teamName?Ee(e.teamName):Fre("Log out and log in to get team name"),r=Ee(e.teamId||e.defaultTeamId);return`You are logged in as ${t},
|
|
120
120
|
Selected team: ${n} (${r})`}function f5(e,t){let n=Ee(e.name),r=Ee(e.teamID),i=e.teamID==t?_n(" (currently selected team)"):"";return`${n} (${r})${i}`}function ft(e,t){let n=ig(e.aliases),r=n?Ee(n):"",i=t?kre(" <-> ")+Pt(t):"";return`${`${e.templateID} `}${r}${i}`.trim()}function Fre(e){return Ae.redBright(e)}function yr(e,t){return Ae.redBright(`${e?`${e}
|
|
121
121
|
`:""}${t?t.stack:""}
|
|
122
122
|
`)}function kre(e){return Ae.dim(e)}function Ee(e){return Ae.bold(e)}function _n(e){return Ae.hex(Pre)(e)}function Fd(e){return Ae.blue(e)}function Mt(e){return Ae.blue(e)}function Pt(e){return e?Mt("./"+_5(e)):""}function rg(e){return Ae.blueBright(e)}function la(e){return Ae.underline(e)}function ig(e){if(e)return e.join(", ")}function E5(e){return ng.default(e,{language:"typescript",ignoreIllegals:!0})}function g5(e){return ng.default(e,{language:"python",ignoreIllegals:!0})}var Bre={topLeft:"",topRight:"",bottomLeft:"",bottomRight:"",top:"",bottom:"",left:"",right:""},m5=2,p5=1;function sg(e,t,n){return Qn(e,{borderStyle:{...Bre,top:"\u2500",bottom:n?"\u2500":""},titleAlignment:"center",float:"left",title:t?Ee(t):void 0,margin:{top:0,bottom:0,left:1,right:0},fullscreen:r=>[r,0],padding:{bottom:n?p5:0,left:m5,right:m5,top:p5}})}l();l();var Bl=$(require("fs")),Pr=$(require("path"));var Z3=$(R5());l();async function ji(e){return new Promise(t=>setTimeout(t,e))}l();l();l();l();var Wre={"Content-Type":"application/json"},zre=/\{[^{}]+\}/g,cg=class extends Request{constructor(t,n){super(t,n);for(let r in n)r in this||(this[r]=n[r])}};function cl(e){let{baseUrl:t="",fetch:n=globalThis.fetch,querySerializer:r,bodySerializer:i,headers:s,...a}={...e};t.endsWith("/")&&(t=t.substring(0,t.length-1)),s=A5(Wre,s);let o=[];async function c(u,d){let{fetch:_=n,headers:f,params:p={},parseAs:h="json",querySerializer:S,bodySerializer:b=i??Xre,...D}=d||{},I=typeof r=="function"?r:N5(r);S&&(I=typeof S=="function"?S:N5({...typeof r=="object"?r:{},...S}));let A={redirect:"follow",...a,...D,headers:A5(s,f,p.header)};A.body&&(A.body=b(A.body)),A.body instanceof FormData&&A.headers.delete("Content-Type");let L=new cg(jre(u,{baseUrl:t,params:p,querySerializer:I}),A),z={baseUrl:t,fetch:_,parseAs:h,querySerializer:I,bodySerializer:b};for(let B of o)if(B&&typeof B=="object"&&typeof B.onRequest=="function"){L.schemaPath=u,L.params=p;let y=await B.onRequest(L,z);if(y){if(!(y instanceof Request))throw new Error("Middleware must return new Request() when modifying the request");L=y}}let K=await _(L);for(let B=o.length-1;B>=0;B--){let y=o[B];if(y&&typeof y=="object"&&typeof y.onResponse=="function"){L.schemaPath=u,L.params=p;let H=await y.onResponse(K,z,L);if(H){if(!(H instanceof Response))throw new Error("Middleware must return new Response() when modifying the response");K=H}}}if(K.status===204||K.headers.get("Content-Length")==="0")return K.ok?{data:{},response:K}:{error:{},response:K};if(K.ok)return h==="stream"?{data:K.body,response:K}:{data:await K[h](),response:K};let Q=await K.text();try{Q=JSON.parse(Q)}catch{}return{error:Q,response:K}}return{async GET(u,d){return c(u,{...d,method:"GET"})},async PUT(u,d){return c(u,{...d,method:"PUT"})},async POST(u,d){return c(u,{...d,method:"POST"})},async DELETE(u,d){return c(u,{...d,method:"DELETE"})},async OPTIONS(u,d){return c(u,{...d,method:"OPTIONS"})},async HEAD(u,d){return c(u,{...d,method:"HEAD"})},async PATCH(u,d){return c(u,{...d,method:"PATCH"})},async TRACE(u,d){return c(u,{...d,method:"TRACE"})},use(...u){for(let d of u)if(d){if(typeof d!="object"||!("onRequest"in d||"onResponse"in d))throw new Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");o.push(d)}},eject(...u){for(let d of u){let _=o.indexOf(d);_!==-1&&o.splice(_,1)}}}}function Bd(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function O5(e,t,n){if(!t||typeof t!="object")return"";let r=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(let o in t)r.push(o,n.allowReserved===!0?t[o]:encodeURIComponent(t[o]));let a=r.join(",");switch(n.style){case"form":return`${e}=${a}`;case"label":return`.${a}`;case"matrix":return`;${e}=${a}`;default:return a}}for(let a in t){let o=n.style==="deepObject"?`${e}[${a}]`:a;r.push(Bd(o,t[a],n))}let s=r.join(i);return n.style==="label"||n.style==="matrix"?`${i}${s}`:s}function I5(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){let s={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",a=(n.allowReserved===!0?t:t.map(o=>encodeURIComponent(o))).join(s);switch(n.style){case"simple":return a;case"label":return`.${a}`;case"matrix":return`;${e}=${a}`;default:return`${e}=${a}`}}let r={simple:",",label:".",matrix:";"}[n.style]||"&",i=[];for(let s of t)n.style==="simple"||n.style==="label"?i.push(n.allowReserved===!0?s:encodeURIComponent(s)):i.push(Bd(e,s,n));return n.style==="label"||n.style==="matrix"?`${r}${i.join(r)}`:i.join(r)}function N5(e){return function(n){let r=[];if(n&&typeof n=="object")for(let i in n){let s=n[i];if(s!=null){if(Array.isArray(s)){r.push(I5(i,s,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof s=="object"){r.push(O5(i,s,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}r.push(Bd(i,s,e))}}return r.join("&")}}function Qre(e,t){let n=e;for(let r of e.match(zre)??[]){let i=r.substring(1,r.length-1),s=!1,a="simple";if(i.endsWith("*")&&(s=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(a="label",i=i.substring(1)):i.startsWith(";")&&(a="matrix",i=i.substring(1)),!t||t[i]===void 0||t[i]===null)continue;let o=t[i];if(Array.isArray(o)){n=n.replace(r,I5(i,o,{style:a,explode:s}));continue}if(typeof o=="object"){n=n.replace(r,O5(i,o,{style:a,explode:s}));continue}if(a==="matrix"){n=n.replace(r,`;${Bd(i,o)}`);continue}n=n.replace(r,a==="label"?`.${o}`:o)}return n}function Xre(e){return JSON.stringify(e)}function jre(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=Qre(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function A5(...e){let t=new Headers;for(let n of e){if(!n||typeof n!="object")continue;let r=n instanceof Headers?n.entries():Object.entries(n);for(let[i,s]of r)if(s===null)t.delete(i);else if(Array.isArray(s))for(let a of s)t.append(i,a);else s!==void 0&&t.set(i,s)}return t}l();var dl=$(v5());var x5="1.2.0-beta.4";function Jre(){return globalThis.Bun?{runtime:"bun",version:globalThis.Bun.version}:globalThis.Deno?{runtime:"deno",version:globalThis.Deno.version.deno}:globalThis.process?.release?.name==="node"?{runtime:"node",version:dl.default.version||"unknown"}:typeof EdgeRuntime=="string"?{runtime:"vercel-edge",version:"unknown"}:globalThis.navigator?.userAgent==="Cloudflare-Workers"?{runtime:"cloudflare-worker",version:"unknown"}:typeof window<"u"?{runtime:"browser",version:dl.default.version||"unknown"}:{runtime:"unknown",version:"unknown"}}var{runtime:Gd,version:eie}=Jre(),w5={browser:typeof window<"u"&&dl.default.name||"unknown",lang:"js",lang_version:eie,package_version:x5,publisher:"e2b",sdk_runtime:Gd,system:dl.default.os?.family||"unknown"};function _l(e){return Gd==="deno"?Deno.env.get(e):typeof process>"u"?"":process.env[e]}l();function qd(e){return new ua(`${e}: This error is likely due to sandbox timeout. You can modify the sandbox timeout by passing 'timeoutMs' when starting the sandbox or calling '.setTimeout' on the sandbox with the desired timeout.`)}var Dt=class extends Error{constructor(t){super(t),this.name="SandboxError"}},ua=class extends Dt{constructor(t){super(t),this.name="TimeoutError"}},da=class extends Dt{constructor(t){super(t),this.name="InvalidArgumentError"}},Hd=class extends Dt{constructor(t){super(t),this.name="NotEnoughSpaceError"}},Un=class extends Dt{constructor(t){super(t),this.name="NotFoundError"}},Rr=class extends Dt{constructor(t){super(t),this.name="AuthenticationError"}},_a=class extends Dt{constructor(t){super(t),this.name="TemplateError"}},Yd=class extends Dt{constructor(t){super(t),this.name="RateLimitError"}};l();function L5(e){return JSON.parse(JSON.stringify(e))}function M5(e){async function*t(n){for await(let r of n)e.debug?.("Response stream:",L5(r)),yield r}return n=>async r=>{e.info?.(`Request: POST ${r.url}`);let i=await n(r);return i.stream?{...i,message:t(i.message)}:(e.info?.("Response:",L5(i.message)),i)}}function $d(e){return{async onRequest(t){return e.info?.(`Request ${t.method} ${t.url}`),t},async onResponse(t){return t.status>=400?e.error?.("Response:",t.status,t.statusText):e.info?.("Response:",t.status,t.statusText),t}}}function ai(e){if(!e.error)return;if(e.response.status===429)return new Yd("Rate limit exceeded, please try again later.");let t=e.error?.message??e.error;return new Dt(`${e.response.status}: ${t}`)}var nn=class{api;constructor(t,n={requireAccessToken:!1,requireApiKey:!0}){if(!n?.requireApiKey&&!t.apiKey)throw new Rr("API key is required, please visit the Team tab at https://e2b.dev/dashboard to get your API key. You can either set the environment variable `E2B_API_KEY` or you can pass it directly to the sandbox like Sandbox.create({ apiKey: 'e2b_...' })");if(n?.requireAccessToken&&!t.accessToken)throw new Rr("Access token is required, please visit the Personal tab at https://e2b.dev/dashboard to get your access token. You can set the environment variable `E2B_ACCESS_TOKEN` or pass the `accessToken` in options.");this.api=cl({baseUrl:t.apiUrl,headers:{...w5,...t.apiKey&&{"X-API-KEY":t.apiKey},...t.accessToken&&{Authorization:`Bearer ${t.accessToken}`}},querySerializer:{array:{style:"form",explode:!1}}}),t.logger&&this.api.use($d(t.logger))}};l();var tie=6e4,Zi=50,Ji="Keepalive-Ping-Interval",yt=class e{debug;domain;apiUrl;logger;requestTimeoutMs;apiKey;accessToken;constructor(t){this.apiKey=t?.apiKey||e.apiKey,this.debug=t?.debug||e.debug,this.domain=t?.domain||e.domain,this.accessToken=t?.accessToken||e.accessToken,this.requestTimeoutMs=t?.requestTimeoutMs??tie,this.logger=t?.logger,this.apiUrl=this.debug?"http://localhost:3000":`https://api.${this.domain}`}static get domain(){return _l("E2B_DOMAIN")||"e2b.dev"}static get debug(){return(_l("E2B_DEBUG")||"false").toLowerCase()==="true"}static get apiKey(){return _l("E2B_API_KEY")}static get accessToken(){return _l("E2B_ACCESS_TOKEN")}getSignal(t){let n=t??this.requestTimeoutMs;return n?AbortSignal.timeout(n):void 0}},es="user";l();l();l();l();var Te;(function(e){e[e.Canceled=1]="Canceled",e[e.Unknown=2]="Unknown",e[e.InvalidArgument=3]="InvalidArgument",e[e.DeadlineExceeded=4]="DeadlineExceeded",e[e.NotFound=5]="NotFound",e[e.AlreadyExists=6]="AlreadyExists",e[e.PermissionDenied=7]="PermissionDenied",e[e.ResourceExhausted=8]="ResourceExhausted",e[e.FailedPrecondition=9]="FailedPrecondition",e[e.Aborted=10]="Aborted",e[e.OutOfRange=11]="OutOfRange",e[e.Unimplemented=12]="Unimplemented",e[e.Internal=13]="Internal",e[e.Unavailable=14]="Unavailable",e[e.DataLoss=15]="DataLoss",e[e.Unauthenticated=16]="Unauthenticated"})(Te||(Te={}));l();l();function ml(e,t){return e!==null&&typeof e=="object"&&"$typeName"in e&&typeof e.$typeName=="string"?t===void 0?!0:t.typeName===e.$typeName:!1}l();l();var k;(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"})(k||(k={}));l();l();l();function F5(){let e=0,t=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<r,!(i&128))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,t=(n&112)>>4,!(n&128))return this.assertBounds(),[e,t];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(t|=(i&127)<<r,!(i&128))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function Kd(e,t,n){for(let s=0;s<28;s=s+7){let a=e>>>s,o=!(!(a>>>7)&&t==0),c=(o?a|128:a)&255;if(n.push(c),!o)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),!!i){for(let s=3;s<31;s=s+7){let a=t>>>s,o=!!(a>>>7),c=(o?a|128:a)&255;if(n.push(c),!o)return}n.push(t>>>31&1)}}var Vd=4294967296;function ug(e){let t=e[0]==="-";t&&(e=e.slice(1));let n=1e6,r=0,i=0;function s(a,o){let c=Number(e.slice(a,o));i*=n,r=r*n+c,r>=Vd&&(i=i+(r/Vd|0),r=r%Vd)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),t?B5(r,i):_g(r,i)}function k5(e,t){let n=_g(e,t),r=n.hi&2147483648;r&&(n=B5(n.lo,n.hi));let i=dg(n.lo,n.hi);return r?"-"+i:i}function dg(e,t){if({lo:e,hi:t}=nie(e,t),t<=2097151)return String(Vd*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,s=n+r*6777216+i*6710656,a=r+i*8147497,o=i*2,c=1e7;return s>=c&&(a+=Math.floor(s/c),s%=c),a>=c&&(o+=Math.floor(a/c),a%=c),o.toString()+P5(a)+P5(s)}function nie(e,t){return{lo:e>>>0,hi:t>>>0}}function _g(e,t){return{lo:e|0,hi:t|0}}function B5(e,t){return t=~t,e?e=~e+1:t+=1,_g(e,t)}var P5=e=>{let t=String(e);return"0000000".slice(t.length)+t};function mg(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e=e>>7;t.push(1)}}function U5(){let e=this.buf[this.pos++],t=e&127;if(!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let n=5;e&128&&n<10;n++)e=this.buf[this.pos++];if(e&128)throw new Error("invalid varint");return this.assertBounds(),t>>>0}var Ge=rie();function rie(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let n=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),i=BigInt("0"),s=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){let o=typeof a=="bigint"?a:BigInt(a);if(o>r||o<n)throw new Error(`invalid int64: ${a}`);return o},uParse(a){let o=typeof a=="bigint"?a:BigInt(a);if(o>s||o<i)throw new Error(`invalid uint64: ${a}`);return o},enc(a){return e.setBigInt64(0,this.parse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(a){return e.setBigInt64(0,this.uParse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(a,o){return e.setInt32(0,a,!0),e.setInt32(4,o,!0),e.getBigInt64(0,!0)},uDec(a,o){return e.setInt32(0,a,!0),e.setInt32(4,o,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(n){return typeof n!="string"&&(n=n.toString()),G5(n),n},uParse(n){return typeof n!="string"&&(n=n.toString()),H5(n),n},enc(n){return typeof n!="string"&&(n=n.toString()),G5(n),ug(n)},uEnc(n){return typeof n!="string"&&(n=n.toString()),H5(n),ug(n)},dec(n,r){return k5(n,r)},uDec(n,r){return dg(n,r)}}}function G5(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function H5(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}function gn(e,t){switch(e){case k.STRING:return"";case k.BOOL:return!1;default:return 0;case k.DOUBLE:case k.FLOAT:return 0;case k.INT64:case k.UINT64:case k.SFIXED64:case k.FIXED64:case k.SINT64:return t?"0":Ge.zero;case k.BYTES:return new Uint8Array(0)}}function Y5(e,t){switch(e){case k.BOOL:return t===!1;case k.STRING:return t==="";case k.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}l();var iie=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"],Rt=class extends Error{constructor(t,n,r="FieldValueInvalidError"){super(n),this.name=r,this.field=()=>t}};function q5(e){return e instanceof Error&&iie.includes(e.name)&&"field"in e&&typeof e.field=="function"}l();l();var $5=2,Gn=Symbol.for("reflect unsafe local");function Wd(e,t){let n=e[t.localName].case;return n===void 0?n:t.fields.find(r=>r.localName===n)}function V5(e,t){let n=t.localName;if(t.oneof)return e[t.oneof.localName].case===n;if(t.presence!=$5)return e[n]!==void 0&&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!Y5(t.scalar,e[n]);case"enum":return e[n]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function ts(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}function zd(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 Qd(e,t,n){t.oneof?e[t.oneof.localName]={case:t.localName,value:n}:e[t.localName]=n}function K5(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!=$5)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]=gn(t.scalar,t.longAsString);break}}function nr(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function pl(e,t){var n,r,i,s;if(nr(e)&&Gn in e&&"add"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){let a=t,o=e.field();return a.listKind==o.listKind&&a.scalar===o.scalar&&((n=a.message)===null||n===void 0?void 0:n.typeName)===((r=o.message)===null||r===void 0?void 0:r.typeName)&&((i=a.enum)===null||i===void 0?void 0:i.typeName)===((s=o.enum)===null||s===void 0?void 0:s.typeName)}return!0}return!1}function fl(e,t){var n,r,i,s;if(nr(e)&&Gn in e&&"has"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){let a=t,o=e.field();return a.mapKey===o.mapKey&&a.mapKind==o.mapKind&&a.scalar===o.scalar&&((n=a.message)===null||n===void 0?void 0:n.typeName)===((r=o.message)===null||r===void 0?void 0:r.typeName)&&((i=a.enum)===null||i===void 0?void 0:i.typeName)===((s=o.enum)===null||s===void 0?void 0:s.typeName)}return!0}return!1}function El(e,t){return nr(e)&&Gn in e&&"desc"in e&&nr(e.desc)&&e.desc.kind==="message"&&(t===void 0||e.desc.typeName==t.typeName)}l();function W5(e){return z5(e.$typeName)}function rr(e){let t=e.fields[0];return z5(e.typeName)&&t!==void 0&&t.fieldKind=="scalar"&&t.name=="value"&&t.number==1}function z5(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}var sie=999,aie=998,Xd=2;function Yt(e,t){if(ml(t,e))return t;let n=die(e);return t!==void 0&&oie(e,n,t),n}function oie(e,t,n){for(let r of e.members){let i=n[r.localName];if(i==null)continue;let s;if(r.kind=="oneof"){let a=Wd(n,r);if(!a)continue;s=a,i=zd(n,a)}else s=r;switch(s.fieldKind){case"message":i=fg(s,i);break;case"scalar":i=j5(s,i);break;case"list":i=cie(s,i);break;case"map":i=lie(s,i);break}Qd(t,s,i)}return t}function j5(e,t){return e.scalar==k.BYTES?Eg(t):t}function lie(e,t){if(nr(t)){if(e.scalar==k.BYTES)return Q5(t,Eg);if(e.mapKind=="message")return Q5(t,n=>fg(e,n))}return t}function cie(e,t){if(Array.isArray(t)){if(e.scalar==k.BYTES)return t.map(Eg);if(e.listKind=="message")return t.map(n=>fg(e,n))}return t}function fg(e,t){if(e.fieldKind=="message"&&!e.oneof&&rr(e.message))return j5(e.message.fields[0],t);if(nr(t)){if(e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!=="google.protobuf.Value")return t;if(!ml(t,e.message))return Yt(e.message,t)}return t}function Eg(e){return Array.isArray(e)?new Uint8Array(e):e}function Q5(e,t){let n={};for(let r of Object.entries(e))n[r[0]]=t(r[1]);return n}var uie=Symbol(),X5=new WeakMap;function die(e){let t;if(_ie(e)){let n=X5.get(e),r,i;if(n)({prototype:r,members:i}=n);else{r={},i=new Set;for(let s of e.members)s.kind!="oneof"&&(s.fieldKind!="scalar"&&s.fieldKind!="enum"||s.presence!=Xd&&(i.add(s),r[s.localName]=pg(s)));X5.set(e,{prototype:r,members:i})}t=Object.create(r),t.$typeName=e.typeName;for(let s of e.members)i.has(s)||s.kind=="field"&&(s.fieldKind=="message"||(s.fieldKind=="scalar"||s.fieldKind=="enum")&&s.presence!=Xd)||(t[s.localName]=pg(s))}else{t={$typeName:e.typeName};for(let n of e.members)(n.kind=="oneof"||n.presence==Xd)&&(t[n.localName]=pg(n))}return t}function _ie(e){switch(e.file.edition){case sie:return!1;case aie:return!0;default:return e.fields.some(t=>t.presence!=Xd&&t.fieldKind!="message"&&!t.oneof)}}function pg(e){if(e.kind=="oneof")return{case:void 0};if(e.fieldKind=="list")return[];if(e.fieldKind=="map")return{};if(e.fieldKind=="message")return uie;let t=e.getDefaultValue();return t!==void 0?e.fieldKind=="scalar"&&e.longAsString?t.toString():t:e.fieldKind=="scalar"?gn(e.scalar,e.longAsString):e.enum.values[0].number}l();l();l();l();var gg=Symbol.for("@bufbuild/protobuf/text-encoding");function gl(){if(globalThis[gg]==null){let e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[gg]={encodeUtf8(n){return e.encode(n)},decodeUtf8(n){return t.decode(n)},checkUtf8(n){try{return encodeURIComponent(n),!0}catch{return!1}}}}return globalThis[gg]}var ot;(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"})(ot||(ot={}));var Sg=34028234663852886e22,Tg=-34028234663852886e22,bg=4294967295,Cg=2147483647,Dg=-2147483648,ma=class{constructor(t=gl().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let i=0;i<this.chunks.length;i++)t+=this.chunks[i].length;let n=new Uint8Array(t),r=0;for(let i=0;i<this.chunks.length;i++)n.set(this.chunks[i],r),r+=this.chunks[i].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,n){return this.uint32((t<<3|n)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(Z5(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return hg(t),mg(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let n=this.encodeUtf8(t);return this.uint32(n.byteLength),this.raw(n)}float(t){mie(t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,t,!0),this.raw(n)}double(t){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,t,!0),this.raw(n)}fixed32(t){Z5(t);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t,!0),this.raw(n)}sfixed32(t){hg(t);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),this.raw(n)}sint32(t){return hg(t),t=(t<<1^t>>31)>>>0,mg(t,this.buf),this}sfixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=Ge.enc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}fixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=Ge.uEnc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}int64(t){let n=Ge.enc(t);return Kd(n.lo,n.hi,this.buf),this}sint64(t){let n=Ge.enc(t),r=n.hi>>31,i=n.lo<<1^r,s=(n.hi<<1|n.lo>>>31)^r;return Kd(i,s,this.buf),this}uint64(t){let n=Ge.uEnc(t);return Kd(n.lo,n.hi,this.buf),this}},ns=class{constructor(t,n=gl().decodeUtf8){this.decodeUtf8=n,this.varint64=F5,this.uint32=U5,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),n=t>>>3,r=t&7;if(n<=0||r<0||r>5)throw new Error("illegal tag: field no "+n+" wire type "+r);return[n,r]}skip(t,n){let r=this.pos;switch(t){case ot.Varint:for(;this.buf[this.pos++]&128;);break;case ot.Bit64:this.pos+=4;case ot.Bit32:this.pos+=4;break;case ot.LengthDelimited:let i=this.uint32();this.pos+=i;break;case ot.StartGroup:for(;;){let[s,a]=this.tag();if(a===ot.EndGroup){if(n!==void 0&&s!==n)throw new Error("invalid end group tag");break}this.skip(a,s)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return Ge.dec(...this.varint64())}uint64(){return Ge.uDec(...this.varint64())}sint64(){let[t,n]=this.varint64(),r=-(t&1);return t=(t>>>1|(n&1)<<31)^r,n=n>>>1^r,Ge.dec(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Ge.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Ge.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 t=this.uint32(),n=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(n,n+t)}string(){return this.decodeUtf8(this.bytes())}};function hg(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>Cg||e<Dg)throw new Error("invalid int32: "+e)}function Z5(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>bg||e<0)throw new Error("invalid uint32: "+e)}function mie(e){if(typeof e=="string"){let t=e;if(e=Number(e),isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>Sg||e<Tg))throw new Error("invalid float32: "+e)}function Nr(e,t){let n=e.fieldKind=="list"?pl(t,e):e.fieldKind=="map"?fl(t,e):Rg(e,t);if(n===!0)return;let r;switch(e.fieldKind){case"list":r=`expected ${nF(e)}, got ${Et(t)}`;break;case"map":r=`expected ${rF(e)}, got ${Et(t)}`;break;default:r=jd(e,t,n)}return new Rt(e,r)}function yg(e,t,n){let r=Rg(e,n);if(r!==!0)return new Rt(e,`list item #${t+1}: ${jd(e,n,r)}`)}function J5(e,t,n){let r=eF(t,e.mapKey);if(r!==!0)return new Rt(e,`invalid map key: ${jd({scalar:e.mapKey},t,r)}`);let i=Rg(e,n);if(i!==!0)return new Rt(e,`map entry ${Et(t)}: ${jd(e,n,i)}`)}function Rg(e,t){return e.scalar!==void 0?eF(t,e.scalar):e.enum!==void 0?e.enum.open?Number.isInteger(t):e.enum.values.some(n=>n.number===t):El(t,e.message)}function eF(e,t){switch(t){case k.DOUBLE:return typeof e=="number";case k.FLOAT:return typeof e!="number"?!1:Number.isNaN(e)||!Number.isFinite(e)?!0:e>Sg||e<Tg?`${e.toFixed()} out of range`:!0;case k.INT32:case k.SFIXED32:case k.SINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>Cg||e<Dg?`${e.toFixed()} out of range`:!0;case k.FIXED32:case k.UINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>bg||e<0?`${e.toFixed()} out of range`:!0;case k.BOOL:return typeof e=="boolean";case k.STRING:return typeof e!="string"?!1:gl().checkUtf8(e)||"invalid UTF8";case k.BYTES:return e instanceof Uint8Array;case k.INT64:case k.SFIXED64:case k.SINT64:if(typeof e!="string"&&typeof e!="bigint"&&typeof e!="number")return!1;try{Ge.parse(e)}catch{return`${e} out of range`}return!0;case k.FIXED64:case k.UINT64:if(typeof e!="string"&&typeof e!="bigint"&&typeof e!="number")return!1;try{Ge.uParse(e)}catch{return`${e} out of range`}return!0}}function jd(e,t,n){return n=typeof n=="string"?`: ${n}`:`, got ${Et(t)}`,e.scalar!==void 0?`expected ${pie(e.scalar)}`+n:e.enum!==void 0?`expected ${e.enum.toString()}`+n:`expected ${tF(e.message)}`+n}function Et(e){switch(typeof e){case"object":return e===null?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:pl(e)?nF(e.field()):fl(e)?rF(e.field()):El(e)?tF(e.desc):ml(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":return String(e);case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function tF(e){return`ReflectMessage (${e.typeName})`}function nF(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${k[e.scalar]})`}}function rF(e){switch(e.mapKind){case"message":return`ReflectMap (${k[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${k[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${k[e.mapKey]}, ${k[e.scalar]})`}}function pie(e){switch(e){case k.STRING:return"string";case k.BOOL:return"boolean";case k.INT64:case k.SINT64:case k.SFIXED64:return"bigint (int64)";case k.UINT64:case k.FIXED64:return"bigint (uint64)";case k.BYTES:return"Uint8Array";case k.DOUBLE:return"number (float64)";case k.FLOAT:return"number (float32)";case k.FIXED32:case k.UINT32:return"number (uint32)";case k.INT32:case k.SFIXED32:case k.SINT32:return"number (int32)"}}function qt(e,t,n=!0){return new Jd(e,t,n)}var Jd=class{get sortedFields(){var t;return(t=this._sortedFields)!==null&&t!==void 0?t:this._sortedFields=this.desc.fields.concat().sort((n,r)=>n.number-r.number)}constructor(t,n,r=!0){this.lists=new Map,this.maps=new Map,this.check=r,this.desc=t,this.message=this[Gn]=n??Yt(t),this.fields=t.fields,this.oneofs=t.oneofs,this.members=t.members}findNumber(t){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(n=>[n.number,n]))),this._fieldsByNumber.get(t)}oneofCase(t){return hl(this.message,t),Wd(this.message,t)}isSet(t){return hl(this.message,t),V5(this.message,t)}clear(t){hl(this.message,t),K5(this.message,t)}get(t){hl(this.message,t);let n=zd(this.message,t);switch(t.fieldKind){case"list":let r=this.lists.get(t);return(!r||r[Gn]!==n)&&this.lists.set(t,r=new Og(t,n,this.check)),r;case"map":let i=this.maps.get(t);return(!i||i[Gn]!==n)&&this.maps.set(t,i=new Ig(t,n,this.check)),i;case"message":return xg(t,n,this.check);case"scalar":return n===void 0?gn(t.scalar,!1):wg(t,n);case"enum":return n??t.enum.values[0].number}}set(t,n){if(hl(this.message,t),this.check){let i=Nr(t,n);if(i)throw i}let r;t.fieldKind=="message"?r=vg(t,n):fl(n)||pl(n)?r=n[Gn]:r=Lg(t,n),Qd(this.message,t,r)}getUnknown(){return this.message.$unknown}setUnknown(t){this.message.$unknown=t}};function hl(e,t){if(t.parent.typeName!==e.$typeName)throw new Rt(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}var Og=class{field(){return this._field}get size(){return this._arr.length}constructor(t,n,r){this._field=t,this._arr=this[Gn]=n,this.check=r}get(t){let n=this._arr[t];return n===void 0?void 0:Ng(this._field,n,this.check)}set(t,n){if(t<0||t>=this._arr.length)throw new Rt(this._field,`list item #${t+1}: out of range`);if(this.check){let r=yg(this._field,t,n);if(r)throw r}this._arr[t]=iF(this._field,n)}add(t){if(this.check){let n=yg(this._field,this._arr.length,t);if(n)throw n}this._arr.push(iF(this._field,t))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(let t of this._arr)yield Ng(this._field,t,this.check)}*entries(){for(let t=0;t<this._arr.length;t++)yield[t,Ng(this._field,this._arr[t],this.check)]}};var Ig=class{constructor(t,n,r=!0){this.obj=this[Gn]=n??{},this.check=r,this._field=t}field(){return this._field}set(t,n){if(this.check){let r=J5(this._field,t,n);if(r)throw r}return this.obj[Zd(t)]=fie(this._field,n),this}delete(t){let n=Zd(t),r=Object.prototype.hasOwnProperty.call(this.obj,n);return r&&delete this.obj[n],r}clear(){for(let t of Object.keys(this.obj))delete this.obj[t]}get(t){let n=this.obj[Zd(t)];return n!==void 0&&(n=Ag(this._field,n,this.check)),n}has(t){return Object.prototype.hasOwnProperty.call(this.obj,Zd(t))}*keys(){for(let t of Object.keys(this.obj))yield sF(t,this._field.mapKey)}*entries(){for(let t of Object.entries(this.obj))yield[sF(t[0],this._field.mapKey),Ag(this._field,t[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(let t of Object.values(this.obj))yield Ag(this._field,t,this.check)}forEach(t,n){for(let r of this.entries())t.call(n,r[1],r[0],this)}};function vg(e,t){return El(t)?W5(t.message)&&!e.oneof&&e.fieldKind=="message"?t.message.value:t.desc.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"?oF(t.message):t.message:t}function xg(e,t,n){return t!==void 0&&(rr(e.message)&&!e.oneof&&e.fieldKind=="message"?t={$typeName:e.message.typeName,value:wg(e.message.fields[0],t)}:e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"&&nr(t)&&(t=aF(t))),new Jd(e.message,t,n)}function iF(e,t){return e.listKind=="message"?vg(e,t):Lg(e,t)}function Ng(e,t,n){return e.listKind=="message"?xg(e,t,n):wg(e,t)}function fie(e,t){return e.mapKind=="message"?vg(e,t):Lg(e,t)}function Ag(e,t,n){return e.mapKind=="message"?xg(e,t,n):t}function Zd(e){return typeof e=="string"||typeof e=="number"?e:String(e)}function sF(e,t){switch(t){case k.STRING:return e;case k.INT32:case k.FIXED32:case k.UINT32:case k.SFIXED32:case k.SINT32:{let n=Number.parseInt(e);if(Number.isFinite(n))return n;break}case k.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case k.UINT64:case k.FIXED64:try{return Ge.uParse(e)}catch{}break;default:try{return Ge.parse(e)}catch{}break}return e}function wg(e,t){switch(e.scalar){case k.INT64:case k.SFIXED64:case k.SINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=Ge.parse(t));break;case k.FIXED64:case k.UINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=Ge.uParse(t));break}return t}function Lg(e,t){switch(e.scalar){case k.INT64:case k.SFIXED64:case k.SINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=Ge.parse(t));break;case k.FIXED64:case k.UINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=Ge.uParse(t));break}return t}function aF(e){let t={$typeName:"google.protobuf.Struct",fields:{}};if(nr(e))for(let[n,r]of Object.entries(e))t.fields[n]=cF(r);return t}function oF(e){let t={};for(let[n,r]of Object.entries(e.fields))t[n]=lF(r);return t}function lF(e){switch(e.kind.case){case"structValue":return oF(e.kind.value);case"listValue":return e.kind.value.values.map(lF);case"nullValue":case void 0:return null;default:return e.kind.value}}function cF(e){let 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(e===null)t.kind={case:"nullValue",value:0};else if(Array.isArray(e)){let n={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(let r of e)n.values.push(cF(r));t.kind={case:"listValue",value:n}}else t.kind={case:"structValue",value:aF(e)};break}return t}l();l();function uF(e,t){let n=e.values.find(r=>r.name===t);if(!n)throw new Error(`cannot parse ${e} default value: ${t}`);return n.number}function dF(e,t){switch(e){case k.STRING:return t;case k.BYTES:{let n=Eie(t);if(n===!1)throw new Error(`cannot parse ${k[e]} default value: ${t}`);return n}case k.INT64:case k.SFIXED64:case k.SINT64:return Ge.parse(t);case k.UINT64:case k.FIXED64:return Ge.uParse(t);case k.DOUBLE:case k.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 k.BOOL:return t==="true";case k.INT32:case k.UINT32:case k.SINT32:case k.FIXED32:case k.SFIXED32:return parseInt(t,10)}}function Eie(e){let t=[],n={tail:e,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(r){if(this.tail.length>=r){let i=this.tail.substring(0,r);return this.tail=this.tail.substring(r),i}return!1}};for(;n.next();)switch(n.c){case"\\":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 r=n.c,i=n.take(2);if(i===!1)return!1;let s=parseInt(r+i,8);if(isNaN(s))return!1;t.push(s);break}case"x":{let r=n.c,i=n.take(2);if(i===!1)return!1;let s=parseInt(r+i,16);if(isNaN(s))return!1;t.push(s);break}case"u":{let r=n.c,i=n.take(4);if(i===!1)return!1;let s=parseInt(r+i,16);if(isNaN(s))return!1;let a=new Uint8Array(4);new DataView(a.buffer).setInt32(0,s,!0),t.push(a[0],a[1],a[2],a[3]);break}case"U":{let r=n.c,i=n.take(8);if(i===!1)return!1;let s=Ge.uEnc(r+i),a=new Uint8Array(8),o=new DataView(a.buffer);o.setInt32(0,s.lo,!0),o.setInt32(4,s.hi,!0),t.push(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]);break}}break;default:t.push(n.c.charCodeAt(0))}return new Uint8Array(t)}l();function*e_(e){switch(e.kind){case"file":for(let t of e.messages)yield t,yield*e_(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(let t of e.nestedMessages)yield t,yield*e_(t);yield*e.nestedEnums,yield*e.nestedExtensions;break}}l();function oi(e){let t=!1,n=[];for(let r=0;r<e.length;r++){let i=e.charAt(r);switch(i){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(i),t=!1;break;default:t&&(t=!1,i=i.toUpperCase()),n.push(i);break}}return n.join("")}var gie=new Set(["constructor","toString","toJSON","valueOf"]);function pa(e){return gie.has(e)?e+"$":e}function n_(...e){let t=hie();if(!e.length)return t;if("$typeName"in e[0]&&e[0].$typeName=="google.protobuf.FileDescriptorSet"){for(let r of e[0].file)pF(r,t);return t}if("$typeName"in e[0]){let a=function(o){let c=[];for(let u of o.dependency){if(t.getFile(u)!=null||s.has(u))continue;let d=i(u);if(!d)throw new Error(`Unable to resolve ${u}, imported by ${o.name}`);"kind"in d?t.addFile(d,!1,!0):(s.add(d.name),c.push(d))}return c.concat(...c.map(a))};var n=a;let r=e[0],i=e[1],s=new Set;for(let o of[r,...a(r)].reverse())pF(o,t)}else for(let r of e)for(let i of r.files)t.addFile(i);return t}function hie(){let e=new Map,t=new Map,n=new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator](){return e.values()},get files(){return n.values()},addFile(r,i,s){if(n.set(r.proto.name,r),!i)for(let a of e_(r))this.add(a);if(s)for(let a of r.dependencies)this.addFile(a,i,s)},add(r){if(r.kind=="extension"){let i=t.get(r.extendee.typeName);i||t.set(r.extendee.typeName,i=new Map),i.set(r.number,r)}e.set(r.typeName,r)},get(r){return e.get(r)},getFile(r){return n.get(r)},getMessage(r){let i=e.get(r);return i?.kind=="message"?i:void 0},getEnum(r){let i=e.get(r);return i?.kind=="enum"?i:void 0},getExtension(r){let i=e.get(r);return i?.kind=="extension"?i:void 0},getExtensionFor(r,i){var s;return(s=t.get(r.typeName))===null||s===void 0?void 0:s.get(i)},getService(r){let i=e.get(r);return i?.kind=="service"?i:void 0}}}var Sie=998,Tie=999,bie=9,t_=10,Sl=11,Cie=12,_F=14,Bg=3,Die=2,mF=1,yie=0,Mg=1,Rie=2,Nie=3,Aie=1,Oie=2,Iie=1;var EF={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1}};function pF(e,t){var n,r;let i={kind:"file",proto:e,deprecated:(r=(n=e.options)===null||n===void 0?void 0:n.deprecated)!==null&&r!==void 0?r:!1,edition:Lie(e),name:e.name.replace(/\.proto$/,""),dependencies:Mie(e,t),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${e.name}`}},s=new Map,a={get(o){return s.get(o)},add(o){var c;Hn(((c=o.proto.options)===null||c===void 0?void 0:c.mapEntry)===!0),s.set(o.typeName,o)}};for(let o of e.enumType)gF(o,i,void 0,t);for(let o of e.messageType)hF(o,i,void 0,t,a);for(let o of e.service)vie(o,i,t);Pg(i,t);for(let o of s.values())Fg(o,t,a);for(let o of i.messages)Fg(o,t,a),Pg(o,t);t.addFile(i,!0)}function Pg(e,t){switch(e.kind){case"file":for(let n of e.proto.extension){let r=kg(n,e,t);e.extensions.push(r),t.add(r)}break;case"message":for(let n of e.proto.extension){let r=kg(n,e,t);e.nestedExtensions.push(r),t.add(r)}for(let n of e.nestedMessages)Pg(n,t);break}}function Fg(e,t,n){let r=e.proto.oneofDecl.map(s=>wie(s,e)),i=new Set;for(let s of e.proto.field){let a=kie(s,r),o=kg(s,e,t,a,n);e.fields.push(o),e.field[o.localName]=o,a===void 0?e.members.push(o):(a.fields.push(o),i.has(a)||(i.add(a),e.members.push(a)))}for(let s of r.filter(a=>i.has(a)))e.oneofs.push(s);for(let s of e.nestedMessages)Fg(s,t,n)}function gF(e,t,n,r){var i,s,a;let o=Pie(e.name,e.value),c={kind:"enum",proto:e,deprecated:(s=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&s!==void 0?s:!1,file:t,parent:n,open:!0,name:e.name,typeName:r_(e,n,t),value:{},values:[],sharedPrefix:o,toString(){return`enum ${this.typeName}`}};c.open=Hie(c),r.add(c),e.value.forEach(u=>{var d,_;let f=u.name;c.values.push(c.value[u.number]={kind:"enum_value",proto:u,deprecated:(_=(d=u.options)===null||d===void 0?void 0:d.deprecated)!==null&&_!==void 0?_:!1,parent:c,name:f,localName:pa(o==null?f:f.substring(o.length)),number:u.number,toString(){return`enum value ${c.typeName}.${f}`}})}),((a=n?.nestedEnums)!==null&&a!==void 0?a:t.enums).push(c)}function hF(e,t,n,r,i){var s,a,o,c;let u={kind:"message",proto:e,deprecated:(a=(s=e.options)===null||s===void 0?void 0:s.deprecated)!==null&&a!==void 0?a:!1,file:t,parent:n,name:e.name,typeName:r_(e,n,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((o=e.options)===null||o===void 0?void 0:o.mapEntry)===!0?i.add(u):(((c=n?.nestedMessages)!==null&&c!==void 0?c:t.messages).push(u),r.add(u));for(let d of e.enumType)gF(d,t,u,r);for(let d of e.nestedType)hF(d,t,u,r,i)}function vie(e,t,n){var r,i;let s={kind:"service",proto:e,deprecated:(i=(r=e.options)===null||r===void 0?void 0:r.deprecated)!==null&&i!==void 0?i:!1,file:t,name:e.name,typeName:r_(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(s),n.add(s);for(let a of e.method){let o=xie(a,s,n);s.methods.push(o),s.method[o.localName]=o}}function xie(e,t,n){var r,i,s,a;let o;e.clientStreaming&&e.serverStreaming?o="bidi_streaming":e.clientStreaming?o="client_streaming":e.serverStreaming?o="server_streaming":o="unary";let c=n.getMessage(Ar(e.inputType)),u=n.getMessage(Ar(e.outputType));Hn(c,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),Hn(u,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);let d=e.name;return{kind:"rpc",proto:e,deprecated:(i=(r=e.options)===null||r===void 0?void 0:r.deprecated)!==null&&i!==void 0?i:!1,parent:t,name:d,localName:pa(d.length?pa(d[0].toLowerCase()+d.substring(1)):d),methodKind:o,input:c,output:u,idempotency:(a=(s=e.options)===null||s===void 0?void 0:s.idempotencyLevel)!==null&&a!==void 0?a:yie,toString(){return`rpc ${t.typeName}.${d}`}}}function wie(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:pa(oi(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}function kg(e,t,n,r,i){var s,a,o;let c=i===void 0,u={kind:"field",proto:e,deprecated:(a=(s=e.options)===null||s===void 0?void 0:s.deprecated)!==null&&a!==void 0?a:!1,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:Bie(e,r,c,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(c){let p=t.kind=="file"?t:t.file,h=t.kind=="file"?void 0:t,S=r_(e,h,p);u.kind="extension",u.file=p,u.parent=h,u.oneof=void 0,u.typeName=S,u.jsonName=`[${S}]`,u.toString=()=>`extension ${S}`;let b=n.getMessage(Ar(e.extendee));Hn(b,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),u.extendee=b}else{let p=t;Hn(p.kind=="message"),u.parent=p,u.oneof=r,u.localName=r?oi(e.name):pa(oi(e.name)),u.jsonName=e.jsonName,u.toString=()=>`field ${p.typeName}.${e.name}`}let d=e.label,_=e.type,f=(o=e.options)===null||o===void 0?void 0:o.jstype;if(d===Bg){let p=_==Sl?i?.get(Ar(e.typeName)):void 0;if(p){u.fieldKind="map";let{key:h,value:S}=Gie(p);return u.mapKey=h.scalar,u.mapKind=S.fieldKind,u.message=S.message,u.delimitedEncoding=!1,u.enum=S.enum,u.scalar=S.scalar,u}switch(u.fieldKind="list",_){case Sl:case t_:u.listKind="message",u.message=n.getMessage(Ar(e.typeName)),Hn(u.message),u.delimitedEncoding=fF(e,t);break;case _F:u.listKind="enum",u.enum=n.getEnum(Ar(e.typeName)),Hn(u.enum);break;default:u.listKind="scalar",u.scalar=_,u.longAsString=f==mF;break}return u.packed=Uie(e,t),u}switch(_){case Sl:case t_:u.fieldKind="message",u.message=n.getMessage(Ar(e.typeName)),Hn(u.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),u.delimitedEncoding=fF(e,t),u.getDefaultValue=()=>{};break;case _F:{let p=n.getEnum(Ar(e.typeName));Hn(p!==void 0,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),u.fieldKind="enum",u.enum=n.getEnum(Ar(e.typeName)),u.getDefaultValue=()=>ts(e,"defaultValue")?uF(p,e.defaultValue):void 0;break}default:{u.fieldKind="scalar",u.scalar=_,u.longAsString=f==mF,u.getDefaultValue=()=>ts(e,"defaultValue")?dF(_,e.defaultValue):void 0;break}}return u}function Lie(e){switch(e.syntax){case"":case"proto2":return Sie;case"proto3":return Tie;case"editions":if(e.edition in EF)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function Mie(e,t){return e.dependency.map(n=>{let r=t.getFile(n);if(!r)throw new Error(`Cannot find ${n}, imported by ${e.name}`);return r})}function Pie(e,t){let n=Fie(e)+"_";for(let r of t){if(!r.name.toLowerCase().startsWith(n))return;let i=r.name.substring(n.length);if(i.length==0||/^\d/.test(i))return}return n}function Fie(e){return(e.substring(0,1)+e.substring(1).replace(/[A-Z]/g,t=>"_"+t)).toLowerCase()}function r_(e,t,n){let r;return t?r=`${t.typeName}.${e.name}`:n.proto.package.length>0?r=`${n.proto.package}.${e.name}`:r=`${e.name}`,r}function Ar(e){return e.startsWith(".")?e.substring(1):e}function kie(e,t){if(!ts(e,"oneofIndex")||e.proto3Optional)return;let n=t[e.oneofIndex];return Hn(n,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),n}function Bie(e,t,n,r){return e.label==Die?Nie:e.label==Bg?Rie:t||e.proto3Optional||e.type==Sl||n?Mg:fa("fieldPresence",{proto:e,parent:r})}function Uie(e,t){if(e.label!=Bg)return!1;switch(e.type){case bie:case Cie:case t_:case Sl:return!1}let n=e.options;return n&&ts(n,"packed")?n.packed:Aie==fa("repeatedFieldEncoding",{proto:e,parent:t})}function Gie(e){let t=e.fields.find(r=>r.number===1),n=e.fields.find(r=>r.number===2);return Hn(t&&t.fieldKind=="scalar"&&t.scalar!=k.BYTES&&t.scalar!=k.FLOAT&&t.scalar!=k.DOUBLE&&n&&n.fieldKind!="list"&&n.fieldKind!="map"),{key:t,value:n}}function Hie(e){var t;return Iie==fa("enumType",{proto:e.proto,parent:(t=e.parent)!==null&&t!==void 0?t:e.file})}function fF(e,t){return e.type==t_?!0:Oie==fa("messageEncoding",{proto:e,parent:t})}function fa(e,t){var n,r;let i=(n=t.proto.options)===null||n===void 0?void 0:n.features;if(i){let s=i[e];if(s!=0)return s}if("kind"in t){if(t.kind=="message")return fa(e,(r=t.parent)!==null&&r!==void 0?r:t.file);let s=EF[t.edition];if(!s)throw new Error(`feature default for edition ${t.edition} not found`);return s[e]}return fa(e,t.parent)}function Hn(e,t){if(!e)throw new Error(t)}l();var Yie=3,SF={writeUnknownFields:!0};function qie(e){return e?Object.assign(Object.assign({},SF),e):SF}function Tl(e,t,n){return i_(new ma,qie(n),qt(e,t)).finish()}function i_(e,t,n){var r;for(let i of n.sortedFields){if(!n.isSet(i)){if(i.presence==Yie)throw new Error(`cannot encode field ${n.desc.typeName}.${i.name} to binary: required field not set`);continue}Ug(e,t,n,i)}if(t.writeUnknownFields)for(let{no:i,wireType:s,data:a}of(r=n.getUnknown())!==null&&r!==void 0?r:[])e.tag(i,s).raw(a);return e}function Ug(e,t,n,r){var i;switch(r.fieldKind){case"scalar":case"enum":s_(e,(i=r.scalar)!==null&&i!==void 0?i:k.INT32,r.number,n.get(r));break;case"list":$ie(e,t,r,n.get(r));break;case"message":TF(e,t,r,n.get(r));break;case"map":for(let[s,a]of n.get(r))Vie(e,t,r,s,a);break}}function s_(e,t,n,r){bF(e.tag(n,Kie(t)),t,r)}function TF(e,t,n,r){n.delimitedEncoding?i_(e.tag(n.number,ot.StartGroup),t,r).tag(n.number,ot.EndGroup):i_(e.tag(n.number,ot.LengthDelimited).fork(),t,r).join()}function $ie(e,t,n,r){var i;if(n.listKind=="message"){for(let a of r)TF(e,t,n,a);return}let s=(i=n.scalar)!==null&&i!==void 0?i:k.INT32;if(n.packed){if(!r.size)return;e.tag(n.number,ot.LengthDelimited).fork();for(let a of r)bF(e,s,a);e.join();return}for(let a of r)s_(e,s,n.number,a)}function Vie(e,t,n,r,i){var s;switch(e.tag(n.number,ot.LengthDelimited).fork(),s_(e,n.mapKey,1,r),n.mapKind){case"scalar":case"enum":s_(e,(s=n.scalar)!==null&&s!==void 0?s:k.INT32,2,i);break;case"message":i_(e.tag(2,ot.LengthDelimited).fork(),t,i).join();break}e.join()}function bF(e,t,n){switch(t){case k.STRING:e.string(n);break;case k.BOOL:e.bool(n);break;case k.DOUBLE:e.double(n);break;case k.FLOAT:e.float(n);break;case k.INT32:e.int32(n);break;case k.INT64:e.int64(n);break;case k.UINT64:e.uint64(n);break;case k.FIXED64:e.fixed64(n);break;case k.BYTES:e.bytes(n);break;case k.FIXED32:e.fixed32(n);break;case k.SFIXED32:e.sfixed32(n);break;case k.SFIXED64:e.sfixed64(n);break;case k.SINT64:e.sint64(n);break;case k.UINT32:e.uint32(n);break;case k.SINT32:e.sint32(n);break}}function Kie(e){switch(e){case k.BYTES:case k.STRING:return ot.LengthDelimited;case k.DOUBLE:case k.FIXED64:case k.SFIXED64:return ot.Bit64;case k.FIXED32:case k.SFIXED32:case k.FLOAT:return ot.Bit32;default:return ot.Varint}}l();var CF={readUnknownFields:!0};function Wie(e){return e?Object.assign(Object.assign({},CF),e):CF}function Or(e,t,n){let r=qt(e,void 0,!1);return DF(r,new ns(t),Wie(n),!1,t.byteLength),r.message}function DF(e,t,n,r,i){var s;let a=r?t.len:t.pos+i,o,c,u=(s=e.getUnknown())!==null&&s!==void 0?s:[];for(;t.pos<a&&([o,c]=t.tag(),!(r&&c==ot.EndGroup));){let d=e.findNumber(o);if(!d){let _=t.skip(c,o);n.readUnknownFields&&u.push({no:o,wireType:c,data:_});continue}Gg(e,t,d,c,n)}if(r&&(c!=ot.EndGroup||o!==i))throw new Error("invalid end group tag");u.length>0&&e.setUnknown(u)}function Gg(e,t,n,r,i){switch(n.fieldKind){case"scalar":e.set(n,Ea(t,n.scalar));break;case"enum":e.set(n,Ea(t,k.INT32));break;case"message":e.set(n,Hg(t,i,n,e.get(n)));break;case"list":Qie(t,r,e.get(n),i);break;case"map":zie(t,e.get(n),i);break}}function zie(e,t,n){let r=t.field(),i,s,a=e.pos+e.uint32();for(;e.pos<a;){let[o]=e.tag();switch(o){case 1:i=Ea(e,r.mapKey);break;case 2:switch(r.mapKind){case"scalar":s=Ea(e,r.scalar);break;case"enum":s=e.int32();break;case"message":s=Hg(e,n,r);break}break}}if(i===void 0&&(i=gn(r.mapKey,!1)),s===void 0)switch(r.mapKind){case"scalar":s=gn(r.scalar,!1);break;case"enum":s=r.enum.values[0].number;break;case"message":s=qt(r.message,void 0,!1);break}t.set(i,s)}function Qie(e,t,n,r){var i;let s=n.field();if(s.listKind==="message"){n.add(Hg(e,r,s));return}let a=(i=s.scalar)!==null&&i!==void 0?i:k.INT32;if(!(t==ot.LengthDelimited&&a!=k.STRING&&a!=k.BYTES)){n.add(Ea(e,a));return}let c=e.uint32()+e.pos;for(;e.pos<c;)n.add(Ea(e,a))}function Hg(e,t,n,r){let i=n.delimitedEncoding,s=r??qt(n.message,void 0,!1);return DF(s,e,t,i,i?n.number:e.uint32()),s}function Ea(e,t){switch(t){case k.STRING:return e.string();case k.BOOL:return e.bool();case k.DOUBLE:return e.double();case k.FLOAT:return e.float();case k.INT32:return e.int32();case k.INT64:return e.int64();case k.UINT64:return e.uint64();case k.FIXED64:return e.fixed64();case k.BYTES:return e.bytes();case k.FIXED32:return e.fixed32();case k.SFIXED32:return e.sfixed32();case k.SFIXED64:return e.sfixed64();case k.SINT64:return e.sint64();case k.UINT32:return e.uint32();case k.SINT32:return e.sint32()}}l();l();l();function ha(e){let t=Xie(),n=e.length*3/4;e[e.length-2]=="="?n-=2:e[e.length-1]=="="&&(n-=1);let r=new Uint8Array(n),i=0,s=0,a,o=0;for(let c=0;c<e.length;c++){if(a=t[e.charCodeAt(c)],a===void 0)switch(e[c]){case"=":s=0;case`
|