@influxdata/influxdb3-client 2.2.0 → 2.4.0-nightly.20641

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.
@@ -1,11 +1,15 @@
1
- var er=Object.defineProperty;var tr=(n,e,t)=>e in n?er(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var d=(n,e,t)=>tr(n,typeof e!="symbol"?e+"":e,t);function rr(n){if(!n||typeof n!="object"||Array.isArray(n))return;let e=typeof n.message=="string"?n.message:void 0;if(e)return e;let t=typeof n.error=="string"?n.error:void 0,r=n.data;if(t&&Array.isArray(r)){let i=[];for(let s of r){if(!s||typeof s!="object"||Array.isArray(s))continue;let o=s.line_number,a=s.error_message,u=s.original_line;o!=null&&typeof a=="string"&&a.length>0&&typeof u=="string"&&u.length>0?i.push(` line ${o}: ${a} (${u})`):typeof a=="string"&&a.length>0&&i.push(` ${a}`)}return i.length?`${t}:
2
- ${i.join(`
3
- `)}`:t}if(r&&typeof r=="object"&&!Array.isArray(r)){let i=r.error_message;if(typeof i=="string"&&i.length>0)return i}if(t)return t}var A=class n extends Error{constructor(e){super(e),this.name="IllegalArgumentError",Object.setPrototypeOf(this,n.prototype)}},_=class n extends Error{constructor(t,r,i,s,o,a){var u;super();this.statusCode=t;this.statusMessage=r;this.body=i;this.contentType=s;this.headers=o;d(this,"code");d(this,"json");if(Object.setPrototypeOf(this,n.prototype),a)this.message=a;else if(i&&(s!=null&&s.startsWith("application/json")||!s))try{this.json=JSON.parse(i),typeof((u=this.json)==null?void 0:u.code)=="string"&&(this.code=this.json.code);let c=rr(this.json);c&&(this.message=c)}catch(c){}this.message||(this.message=`${t} ${r} : ${i}`),this.name="HttpError"}statusCode;statusMessage;body;contentType;headers},rt=class n extends Error{constructor(){super(),Object.setPrototypeOf(this,n.prototype),this.name="RequestTimedOutError",this.message="Request timed out"}},K=class n extends Error{constructor(){super(),this.name="AbortError",Object.setPrototypeOf(this,n.prototype),this.message="Response aborted"}};function nt(){let n=new TextDecoder("utf-8");return{concat(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r},copy(e,t,r){let i=new Uint8Array(r-t);return i.set(e.subarray(t,r)),i},toUtf8String(e,t,r){return n.decode(e.subarray(t,r))}}}var it={timeout:void 0,writeTimeout:1e4,queryTimeout:6e4},st={precision:"ns",gzipThreshold:1e3,noSync:!1},we={type:"sql"};function ot(n){if(!n)throw Error("Connection string not set!");let e=new URL(n.trim(),"http://localhost"),t={host:n.indexOf("://")>0?e.origin+e.pathname:e.pathname};return e.searchParams.has("token")&&(t.token=e.searchParams.get("token")),e.searchParams.has("authScheme")&&(t.authScheme=e.searchParams.get("authScheme")),e.searchParams.has("database")&&(t.database=e.searchParams.get("database")),e.searchParams.has("timeout")&&(t.timeout=parseInt(e.searchParams.get("timeout"))),e.searchParams.has("precision")&&(t.writeOptions||(t.writeOptions={}),t.writeOptions.precision=ft(e.searchParams.get("precision"))),e.searchParams.has("gzipThreshold")&&(t.writeOptions||(t.writeOptions={}),t.writeOptions.gzipThreshold=parseInt(e.searchParams.get("gzipThreshold"))),e.searchParams.has("writeNoSync")&&(t.writeOptions||(t.writeOptions={}),t.writeOptions.noSync=ut(e.searchParams.get("writeNoSync"))),t}function at(){if(!process.env.INFLUX_HOST)throw Error("INFLUX_HOST variable not set!");if(!process.env.INFLUX_TOKEN)throw Error("INFLUX_TOKEN variable not set!");let n={host:process.env.INFLUX_HOST.trim()};if(process.env.INFLUX_TOKEN&&(n.token=process.env.INFLUX_TOKEN.trim()),process.env.INFLUX_AUTH_SCHEME&&(n.authScheme=process.env.INFLUX_AUTH_SCHEME.trim()),process.env.INFLUX_DATABASE&&(n.database=process.env.INFLUX_DATABASE.trim()),process.env.INFLUX_TIMEOUT&&(n.timeout=parseInt(process.env.INFLUX_TIMEOUT.trim())),process.env.INFLUX_PRECISION&&(n.writeOptions||(n.writeOptions={}),n.writeOptions.precision=ft(process.env.INFLUX_PRECISION)),process.env.INFLUX_GZIP_THRESHOLD&&(n.writeOptions||(n.writeOptions={}),n.writeOptions.gzipThreshold=parseInt(process.env.INFLUX_GZIP_THRESHOLD)),process.env.INFLUX_WRITE_NO_SYNC&&(n.writeOptions||(n.writeOptions={}),n.writeOptions.noSync=ut(process.env.INFLUX_WRITE_NO_SYNC)),process.env.INFLUX_GRPC_OPTIONS){let e=process.env.INFLUX_GRPC_OPTIONS.split(",");n.grpcOptions||(n.grpcOptions={});for(let t of e){let r=t.split("=");if(r.length!=2)continue;let i=parseInt(r[1]);Number.isNaN(i)&&(i=parseFloat(r[1]),Number.isNaN(i)&&(i=r[1])),n.grpcOptions[r[0]]=i}}return n}function ut(n){return["true","1","t","y","yes"].includes(n.trim().toLowerCase())}function lt(n){switch(n){case"ns":case"us":case"ms":case"s":return n;default:throw Error(`Unsupported precision '${n}'`)}}function ct(n){switch(n){case"ns":return"nanosecond";case"us":return"microsecond";case"ms":return"millisecond";case"s":return"second";default:throw Error(`Unsupported precision '${n}'`)}}function ft(n){switch(n.trim().toLowerCase()){case"ns":case"nanosecond":return"ns";case"us":case"microsecond":return"us";case"ms":case"millisecond":return"ms";case"s":case"second":return"s";default:throw Error(`Unsupported precision '${n}'`)}}var nr={error(n,e){console.error(`ERROR: ${n}`,e||"")},warn(n,e){console.warn(`WARN: ${n}`,e||"")}},Q=nr,L={error(n,e){Q.error(n,e)},warn(n,e){Q.warn(n,e)}};function Jr(n){let e=Q;return Q=n,e}function Oe(n,e){return function(t){let r="",i=0,s=0;for(;s<t.length;){let o=n.indexOf(t[s]);o>=0&&(r+=t.substring(i,s),r+=e[o],i=s+1),s++}return i==0?t:(i<t.length&&(r+=t.substring(i,t.length)),r)}}function ir(n,e){let t=Oe(n,e);return r=>`"${t(r)}"`}var B={measurement:Oe(`,
4
- \r `,["\\,","\\ ","\\n","\\r","\\t"]),quoted:ir('"\\',['\\"',"\\\\"]),tag:Oe(`, =
5
- \r `,["\\,","\\ ","\\=","\\n","\\r","\\t"])};var gt="000000000";function sr(n){return!1}sr(!0);var pt=Date.now(),Fe=0;function xe(){{let n=Date.now();n!==pt?(pt=n,Fe=0):Fe++;let e=String(Fe);return String(n)+gt.substr(0,6-e.length)+e}}function mt(){return String(Date.now())+gt.substr(0,3)}function ht(){return String(Date.now())}function dt(){return String(Math.floor(Date.now()/1e3))}var or={s:dt,ms:ht,us:mt,ns:xe,seconds:dt,millis:ht,micros:mt,nanos:xe},ar={s:n=>`${Math.floor(n.getTime()/1e3)}`,ms:n=>`${n.getTime()}`,us:n=>`${n.getTime()}000`,ns:n=>`${n.getTime()}000000`};function bt(n){return n===void 0?xe():typeof n=="string"?n.length>0?n:void 0:n instanceof Date?`${n.getTime()}000000`:String(typeof n=="number"?Math.floor(n):n)}var yt=(n,e="ns")=>n===void 0?or[e]():typeof n=="string"?n.length>0?n:void 0:n instanceof Date?ar[e](n):String(typeof n=="number"?Math.floor(n):n);var V=n=>{throw n},Tt=n=>n!==void 0,wt=n=>n instanceof Array||n instanceof Object&&typeof n.length=="number"&&(n.length===0||Object.getOwnPropertyNames(n).some(e=>e==="0")),Ot=n=>{let e=new Uint8Array(4);return e[0]=n>>0,e[1]=n>>8,e[2]=n>>16,e[3]=n>>24,e},ur=async n=>{let e=[];for await(let t of n)e.push(t);return e},q=n=>n===null||typeof n=="string"&&(n===""||n.indexOf(" ")!==-1)?!1:n!==""&&!isNaN(Number(n==null?void 0:n.toString())),Ft=n=>q(n)?typeof n=="string"?Number(n)>=0:typeof n=="number"&&n>=0:!1;var xt=(n,e,t)=>{let r=wt(n)&&typeof n!="string"?Array.from(n):[n];return r.length===0?[]:typeof r[0]=="string"?r:r.map(s=>s.toLineProtocol(void 0,e,t)).filter(Tt)};var lr=n=>typeof n=="number"?"float":typeof n=="string"?"string":typeof n=="boolean"?"boolean":void 0,Ie=class n extends Error{constructor(e,t,r){super(`field ${e} of type ${r} doesn't match expected type ${t}!`),this.name="GetFieldTypeMissmatchError",Object.setPrototypeOf(this,n.prototype)}},P=class n{constructor(){d(this,"_name");d(this,"_time");d(this,"_tags",{});d(this,"_fields",{})}getMeasurement(){return this._name}setMeasurement(e){return this._name=e,this}getTimestamp(){return this._time}setTimestamp(e){return this._time=e,this}getTag(e){return this._tags[e]}setTag(e,t){return this._tags[e]=t,this}removeTag(e){return delete this._tags[e],this}getTagNames(){return Object.keys(this._tags)}getFloatField(e){return this.getField(e,"float")}setFloatField(e,t){let r;if(typeof t=="number"?r=t:r=parseFloat(t),!isFinite(r))throw new Error(`invalid float value for field '${e}': '${t}'!`);return this._fields[e]=["float",r],this}getIntegerField(e){return this.getField(e,"integer")}setIntegerField(e,t){let r;if(typeof t=="number"?r=t:r=parseInt(String(t)),isNaN(r)||r<=-9223372036854776e3||r>=9223372036854776e3)throw new Error(`invalid integer value for field '${e}': '${t}'!`);return this._fields[e]=["integer",Math.floor(r)],this}getUintegerField(e){return this.getField(e,"uinteger")}setUintegerField(e,t){if(typeof t=="number"){if(isNaN(t)||t<0||t>Number.MAX_SAFE_INTEGER)throw new Error(`uint value for field '${e}' out of range: ${t}`);this._fields[e]=["uinteger",Math.floor(t)]}else{let r=String(t);for(let i=0;i<r.length;i++){let s=r.charCodeAt(i);if(s<48||s>57)throw new Error(`uint value has an unsupported character at pos ${i}: ${t}`)}if(r.length>20||r.length===20&&r.localeCompare("18446744073709551615")>0)throw new Error(`uint value for field '${e}' out of range: ${r}`);this._fields[e]=["uinteger",+r]}return this}getStringField(e){return this.getField(e,"string")}setStringField(e,t){return t!=null&&(typeof t!="string"&&(t=String(t)),this._fields[e]=["string",t]),this}getBooleanField(e){return this.getField(e,"boolean")}setBooleanField(e,t){return this._fields[e]=["boolean",!!t],this}getField(e,t){let r=this._fields[e];if(!r)return;let[i,s]=r;if(t!==void 0&&t!==i)throw new Ie(e,t,i);return s}getFieldType(e){let t=this._fields[e];if(t)return t[0]}setField(e,t,r){switch(r!=null?r:lr(t)){case"string":return this.setStringField(e,t);case"boolean":return this.setBooleanField(e,t);case"float":return this.setFloatField(e,t);case"integer":return this.setIntegerField(e,t);case"uinteger":return this.setUintegerField(e,t);case void 0:return this;default:throw new Error(`invalid field type for field '${e}': type -> ${r}, value -> ${t}!`)}}setFields(e){for(let[t,r]of Object.entries(e))this.setField(t,r);return this}removeField(e){return delete this._fields[e],this}getFieldNames(){return Object.keys(this._fields)}hasFields(){return this.getFieldNames().length>0}copy(){let e=new n;return e._name=this._name,e._time=this._time,e._tags=Object.fromEntries(Object.entries(this._tags)),e._fields=Object.fromEntries(Object.entries(this._fields).map(t=>[...t])),e}asPoint(e){return Z.fromValues(e?this.setMeasurement(e):this)}};var cr=(n,e)=>{switch(n){case"string":return B.quoted(e);case"boolean":return e?"T":"F";case"float":return`${e}`;case"integer":return`${e}i`;case"uinteger":return`${e}u`}},fr=(n,e)=>{if(!e)return[];let t=new Set(n);return Object.keys(e).filter(r=>!t.has(r)).sort()},pr=(n,e)=>{if(!e||e.length===0)return n;let t=new Set(n),r=[],i=new Set;for(let o of e)!o||i.has(o)||!t.has(o)||(r.push(o),i.add(o),t.delete(o));let s=Array.from(t).sort();return r.concat(s)},Z=class n{constructor(e){d(this,"_values");e instanceof P?this._values=e:this._values=new P,typeof e=="string"&&this._values.setMeasurement(e)}static measurement(e){return new n(e)}static fromValues(e){if(!e.getMeasurement()||e.getMeasurement()==="")throw new Error("Cannot convert values to point without measurement set!");return new n(e)}getMeasurement(){return this._values.getMeasurement()}setMeasurement(e){return e!==""&&this._values.setMeasurement(e),this}getTimestamp(){return this._values.getTimestamp()}setTimestamp(e){return this._values.setTimestamp(e),this}getTag(e){return this._values.getTag(e)}setTag(e,t){return this._values.setTag(e,t),this}removeTag(e){return this._values.removeTag(e),this}getTagNames(){return this._values.getTagNames()}getFloatField(e){return this._values.getFloatField(e)}setFloatField(e,t){return this._values.setFloatField(e,t),this}getIntegerField(e){return this._values.getIntegerField(e)}setIntegerField(e,t){return this._values.setIntegerField(e,t),this}getUintegerField(e){return this._values.getUintegerField(e)}setUintegerField(e,t){return this._values.setUintegerField(e,t),this}getStringField(e){return this._values.getStringField(e)}setStringField(e,t){return this._values.setStringField(e,t),this}getBooleanField(e){return this._values.getBooleanField(e)}setBooleanField(e,t){return this._values.setBooleanField(e,t),this}getField(e,t){return this._values.getField(e,t)}getFieldType(e){return this._values.getFieldType(e)}setField(e,t,r){return this._values.setField(e,t,r),this}setFields(e){return this._values.setFields(e),this}removeField(e){return this._values.removeField(e),this}getFieldNames(){return this._values.getFieldNames()}hasFields(){return this._values.hasFields()}copy(){return new n(this._values.copy())}toLineProtocol(e,t,r){if(!this._values.getMeasurement())return;let i="";if(this._values.getFieldNames().sort().forEach(f=>{if(f){let m=this._values.getFieldType(f),p=this._values.getField(f);if(m===void 0||p===void 0)return;let O=cr(m,p);i.length>0&&(i+=","),i+=`${B.tag(f)}=${O}`}}),i.length===0)return;let s="",o=this._values.getTagNames().sort(),a=fr(o,t);pr(a.concat(o),r).forEach(f=>{if(f){let m=this._values.getTag(f),p=m!==void 0?m:t==null?void 0:t[f];p&&(s+=",",s+=`${B.tag(f)}=${B.tag(p)}`)}});let c=this._values.getTimestamp();return e?typeof e=="string"?c=yt(c,e):c=e(c):c=bt(c),`${B.measurement(this.getMeasurement())}${s} ${i}${c!==void 0?` ${c}`:""}`}toString(){let e=this.toLineProtocol(void 0);return e||`invalid point: ${JSON.stringify(this,void 0)}`}};function Ne(n={}){let e=0,t={next:r=>{if(e===0&&n.next&&r!==null&&r!==void 0)return n.next(r)},error:r=>{e===0&&(e=1,n.error&&n.error(r))},complete:()=>{e===0&&(e=2,n.complete&&n.complete())},responseStarted:(r,i)=>{n.responseStarted&&n.responseStarted(r,i)}};return n.useCancellable&&(t.useCancellable=n.useCancellable.bind(n)),n.useResume&&(t.useResume=n.useResume.bind(n)),t}function Y(n){let e={};return n.headers.forEach((t,r)=>{let i=e[r];i===void 0?e[r]=t:Array.isArray(i)?i.push(t):e[r]=[i,t]}),e}var H=class{constructor(e){this._connectionOptions=e;d(this,"chunkCombiner",nt());d(this,"_defaultHeaders");d(this,"_url");d(this,"requestDecorator",function(){});var t;if(this._defaultHeaders={"content-type":"application/json; charset=utf-8",...e.headers},this._connectionOptions.token){let r=(t=this._connectionOptions.authScheme)!=null?t:"Token";this._defaultHeaders.Authorization=`${r} ${this._connectionOptions.token}`}this._url=String(this._connectionOptions.host),this._url.endsWith("/")&&(this._url=this._url.substring(0,this._url.length-1)),this._url.endsWith("/api/v2")&&(this._url=this._url.substring(0,this._url.length-7),L.warn(`Please remove '/api/v2' context path from InfluxDB base url, using ${this._url} !`))}_connectionOptions;send(e,t,r,i){let s=Ne(i),o=!1,a=r.signal,u,c=()=>{},f=c;if(i&&i.useCancellable){let m=new AbortController;a||(a=m.signal,r={...r,signal:a}),a.addEventListener("abort",()=>{f()}),i.useCancellable({cancel(){o=!0,m.abort()},isCancelled(){return o||a.aborted}})}this._fetch(e,t,r).then(async m=>{if(i!=null&&i.responseStarted&&s.responseStarted(Y(m),m.status),await this._throwOnErrorResponse(m),m.body){let p=m.body.getReader(),O;do{if(u&&await u,o)break;if(O=await p.read(),s.next(O.value)===!1){let h=s.useResume;if(!h){let x="Unable to pause, useResume is not configured!";return await p.cancel(x),Promise.reject(new Error(x))}u=new Promise(x=>{f=()=>{x(),u=void 0,f=c},h(f)})}}while(!O.done)}else if(m.arrayBuffer){let p=await m.arrayBuffer();s.next(new Uint8Array(p))}else{let p=await m.text();s.next(new TextEncoder().encode(p))}}).catch(m=>{o||s.error(m)}).finally(()=>s.complete())}async _throwOnErrorResponse(e){if(e.status>=300){let t="";try{if(t=await e.text(),!t){let r=e.headers.get("x-influxdb-error");r&&(t=r)}}catch(r){throw L.warn("Unable to receive error body",r),new _(e.status,e.statusText,void 0,e.headers.get("content-type"),Y(e))}throw new _(e.status,e.statusText,t,e.headers.get("content-type"),Y(e))}}async*iterate(e,t,r){var s;let i=await this._fetch(e,t,r);if(await this._throwOnErrorResponse(i),i.body){let o=i.body.getReader();for(;;){let{value:a,done:u}=await o.read();if(u)break;if((s=r.signal)!=null&&s.aborted)throw await i.body.cancel(),new K;yield a}}else if(i.arrayBuffer){let o=await i.arrayBuffer();yield new Uint8Array(o)}else{let o=await i.text();yield new TextEncoder().encode(o)}}async request(e,t,r,i){var c,f;let s=await this._fetch(e,t,r),{headers:o}=s,a=o.get("content-type")||"";i&&i(Y(s),s.status),await this._throwOnErrorResponse(s);let u=(f=(c=r.headers)==null?void 0:c.accept)!=null?f:a;if(u.includes("json"))return await s.json();if(u.includes("text")||u.startsWith("application/csv"))return await s.text()}_fetch(e,t,r){let{method:i,headers:s,...o}=r,a=`${this._url}${e}`,u={method:i,body:i==="GET"||i==="HEAD"?void 0:typeof t=="string"?t:JSON.stringify(t),headers:{...this._defaultHeaders,...s},credentials:"omit",...this._connectionOptions.transportOptions,...o};return this.requestDecorator(u,r,a),fetch(a,u)}};import{GrpcWebFetchTransport as mr}from"@protobuf-ts/grpcweb-transport";var It=({host:n,timeout:e,clientOptions:t})=>{var i;(t!=null&&t.grpcOptions||(i=t==null?void 0:t.queryOptions)!=null&&i.grpcOptions)&&console.warn(`Detected grpcClientOptions: such options are ignored in the GrpcWebFetchTransport:
1
+ var ar=Object.defineProperty;var ur=(r,e,t)=>e in r?ar(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var d=(r,e,t)=>ur(r,typeof e!="symbol"?e+"":e,t);function at(r){if(typeof r!="string"||r.length===0)return!1;let e=r.toLowerCase();return e.includes("partial write of line protocol occurred")||e.includes("parsing failed for write_lp endpoint")}function lr(r){if(r==null)return 0;if(typeof r=="number"&&Number.isFinite(r))return r;throw new Error("line_number must be number")}function cr(r){if(r==null)return"";if(typeof r=="string")return r;throw new Error("original_line must be string")}function ut(r){if(r==null)return null;if(typeof r!="object"||Array.isArray(r))throw new Error("item is not an object");let e=r.error_message;if(typeof e!="string")throw new Error("error_message must be string");if(e.length===0)return null;let t=lr(r.line_number),n=cr(r.original_line);return{lineNumber:t,errorMessage:e,originalLine:n}}function lt(r){if(!Array.isArray(r))return;let e=[];try{for(let t of r){let n=ut(t);n&&e.push(n)}}catch(t){return}return e.length>0?e:void 0}function ct(r){var e;try{return(e=ut(r))!=null?e:void 0}catch(t){return}}function st(r){let e=[];for(let t of r)t.lineNumber!==0?t.originalLine.length>0?e.push(` line ${t.lineNumber}: ${t.errorMessage} (${t.originalLine})`):e.push(` line ${t.lineNumber}: ${t.errorMessage}`):e.push(` ${t.errorMessage}`);return e}function fr(r){if(!r||typeof r!="object"||Array.isArray(r))return;let e=typeof r.message=="string"?r.message:void 0;if(e)return e;let t=typeof r.error=="string"?r.error:void 0,n=r.data;if(t&&at(t)){let i=lt(n);if(i){let o=st(i);return`${t}:
2
+ ${o.join(`
3
+ `)}`}if(Array.isArray(n)){let o=[];for(let a of n){if(a==null)continue;let u=JSON.stringify(a);u&&u.toLowerCase()!=="null"&&o.push(` ${u}`)}return o.length?`${t}:
4
+ ${o.join(`
5
+ `)}`:t}let s=ct(n);return s?`${t}:
6
+ ${st([s]).join(`
7
+ `)}`:t}if(t)return t}var S=class r extends Error{constructor(e){super(e),this.name="IllegalArgumentError",Object.setPrototypeOf(this,r.prototype)}},_=class r extends Error{constructor(t,n,i,s,o,a){var u;super();this.statusCode=t;this.statusMessage=n;this.body=i;this.contentType=s;this.headers=o;d(this,"code");d(this,"json");if(Object.setPrototypeOf(this,r.prototype),a)this.message=a;else if(i&&(s!=null&&s.startsWith("application/json")||!s))try{this.json=JSON.parse(i),typeof((u=this.json)==null?void 0:u.code)=="string"&&(this.code=this.json.code);let c=fr(this.json);c&&(this.message=c)}catch(c){}this.message||(this.message=`${t} ${n} : ${i}`),this.name="HttpError"}statusCode;statusMessage;body;contentType;headers},Z=class r extends _{constructor(t,n,i,s,o,a,u){super(t,n,i,s,o);this.lineErrors=u;this.message=a,this.name="PartialWriteError",Object.setPrototypeOf(this,r.prototype)}lineErrors;static fromHttpError(t){let n=t.json;if(!n||typeof n!="object"||Array.isArray(n))return;let i=n.error;if(!at(i))return;let s=n.data,o=lt(s);if(o)return new r(t.statusCode,t.statusMessage,t.body,t.contentType,t.headers,t.message,o);let a=ct(s);if(a)return new r(t.statusCode,t.statusMessage,t.body,t.contentType,t.headers,t.message,[a])}},ot=class r extends Error{constructor(){super(),Object.setPrototypeOf(this,r.prototype),this.name="RequestTimedOutError",this.message="Request timed out"}},Y=class r extends Error{constructor(){super(),this.name="AbortError",Object.setPrototypeOf(this,r.prototype),this.message="Response aborted"}};function ft(){let r=new TextDecoder("utf-8");return{concat(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n},copy(e,t,n){let i=new Uint8Array(n-t);return i.set(e.subarray(t,n)),i},toUtf8String(e,t,n){return r.decode(e.subarray(t,n))}}}var pt={timeout:void 0,writeTimeout:1e4,queryTimeout:6e4},mt={precision:"ns",gzipThreshold:1e3,noSync:!1,acceptPartial:!0,useV2Api:!0},Oe={type:"sql"};function k(r){return r.writeOptions||(r.writeOptions={}),r.writeOptions}function ht(r){if(!r)throw Error("Connection string not set!");let e=new URL(r.trim(),"http://localhost"),t={host:r.indexOf("://")>0?e.origin+e.pathname:e.pathname};return e.searchParams.has("token")&&(t.token=e.searchParams.get("token")),e.searchParams.has("authScheme")&&(t.authScheme=e.searchParams.get("authScheme")),e.searchParams.has("database")&&(t.database=e.searchParams.get("database")),e.searchParams.has("timeout")&&(t.timeout=parseInt(e.searchParams.get("timeout"))),e.searchParams.has("precision")&&(k(t).precision=yt(e.searchParams.get("precision"))),e.searchParams.has("gzipThreshold")&&(k(t).gzipThreshold=parseInt(e.searchParams.get("gzipThreshold"))),e.searchParams.has("writeNoSync")&&(k(t).noSync=V(e.searchParams.get("writeNoSync"))),e.searchParams.has("writeAcceptPartial")&&(k(t).acceptPartial=V(e.searchParams.get("writeAcceptPartial"))),e.searchParams.has("writeUseV2Api")&&(k(t).useV2Api=V(e.searchParams.get("writeUseV2Api"))),t}function dt(){if(!process.env.INFLUX_HOST)throw Error("INFLUX_HOST variable not set!");if(!process.env.INFLUX_TOKEN)throw Error("INFLUX_TOKEN variable not set!");let r={host:process.env.INFLUX_HOST.trim()};if(process.env.INFLUX_TOKEN&&(r.token=process.env.INFLUX_TOKEN.trim()),process.env.INFLUX_AUTH_SCHEME&&(r.authScheme=process.env.INFLUX_AUTH_SCHEME.trim()),process.env.INFLUX_DATABASE&&(r.database=process.env.INFLUX_DATABASE.trim()),process.env.INFLUX_TIMEOUT&&(r.timeout=parseInt(process.env.INFLUX_TIMEOUT.trim())),process.env.INFLUX_PRECISION&&(k(r).precision=yt(process.env.INFLUX_PRECISION)),process.env.INFLUX_GZIP_THRESHOLD&&(k(r).gzipThreshold=parseInt(process.env.INFLUX_GZIP_THRESHOLD)),process.env.INFLUX_WRITE_NO_SYNC&&(k(r).noSync=V(process.env.INFLUX_WRITE_NO_SYNC)),process.env.INFLUX_WRITE_ACCEPT_PARTIAL&&(k(r).acceptPartial=V(process.env.INFLUX_WRITE_ACCEPT_PARTIAL)),process.env.INFLUX_WRITE_USE_V2_API&&(k(r).useV2Api=V(process.env.INFLUX_WRITE_USE_V2_API)),process.env.INFLUX_GRPC_OPTIONS){let e=process.env.INFLUX_GRPC_OPTIONS.split(",");r.grpcOptions||(r.grpcOptions={});for(let t of e){let n=t.split("=");if(n.length!=2)continue;let i=parseInt(n[1]);Number.isNaN(i)&&(i=parseFloat(n[1]),Number.isNaN(i)&&(i=n[1])),r.grpcOptions[n[0]]=i}}return r}function V(r){return["true","1","t","y","yes"].includes(r.trim().toLowerCase())}function gt(r){switch(r){case"ns":case"us":case"ms":case"s":return r;default:throw Error(`Unsupported precision '${r}'`)}}function bt(r){switch(r){case"ns":return"nanosecond";case"us":return"microsecond";case"ms":return"millisecond";case"s":return"second";default:throw Error(`Unsupported precision '${r}'`)}}function yt(r){switch(r.trim().toLowerCase()){case"ns":case"nanosecond":return"ns";case"us":case"microsecond":return"us";case"ms":case"millisecond":return"ms";case"s":case"second":return"s";default:throw Error(`Unsupported precision '${r}'`)}}var pr={error(r,e){console.error(`ERROR: ${r}`,e||"")},warn(r,e){console.warn(`WARN: ${r}`,e||"")}},z=pr,B={error(r,e){z.error(r,e)},warn(r,e){z.warn(r,e)}};function rn(r){let e=z;return z=r,e}function Ie(r,e){return function(t){let n="",i=0,s=0;for(;s<t.length;){let o=r.indexOf(t[s]);o>=0&&(n+=t.substring(i,s),n+=e[o],i=s+1),s++}return i==0?t:(i<t.length&&(n+=t.substring(i,t.length)),n)}}function mr(r,e){let t=Ie(r,e);return n=>`"${t(n)}"`}var v={measurement:Ie(`,
8
+ \r `,["\\,","\\ ","\\n","\\r","\\t"]),quoted:mr('"\\',['\\"',"\\\\"]),tag:Ie(`, =
9
+ \r `,["\\,","\\ ","\\=","\\n","\\r","\\t"])};var Ot="000000000";function hr(r){return!1}hr(!0);var wt=Date.now(),Ne=0;function Ee(){{let r=Date.now();r!==wt?(wt=r,Ne=0):Ne++;let e=String(Ne);return String(r)+Ot.substr(0,6-e.length)+e}}function Tt(){return String(Date.now())+Ot.substr(0,3)}function Ft(){return String(Date.now())}function xt(){return String(Math.floor(Date.now()/1e3))}var dr={s:xt,ms:Ft,us:Tt,ns:Ee,seconds:xt,millis:Ft,micros:Tt,nanos:Ee},gr={s:r=>`${Math.floor(r.getTime()/1e3)}`,ms:r=>`${r.getTime()}`,us:r=>`${r.getTime()}000`,ns:r=>`${r.getTime()}000000`};function It(r){return r===void 0?Ee():typeof r=="string"?r.length>0?r:void 0:r instanceof Date?`${r.getTime()}000000`:String(typeof r=="number"?Math.floor(r):r)}var Nt=(r,e="ns")=>r===void 0?dr[e]():typeof r=="string"?r.length>0?r:void 0:r instanceof Date?gr[e](r):String(typeof r=="number"?Math.floor(r):r);var M=r=>{throw r},Et=r=>r!==void 0,_t=r=>r instanceof Array||r instanceof Object&&typeof r.length=="number"&&(r.length===0||Object.getOwnPropertyNames(r).some(e=>e==="0")),kt=r=>{let e=new Uint8Array(4);return e[0]=r>>0,e[1]=r>>8,e[2]=r>>16,e[3]=r>>24,e},br=async r=>{let e=[];for await(let t of r)e.push(t);return e},H=r=>r===null||typeof r=="string"&&(r===""||r.indexOf(" ")!==-1)?!1:r!==""&&!isNaN(Number(r==null?void 0:r.toString())),At=r=>H(r)?typeof r=="string"?Number(r)>=0:typeof r=="number"&&r>=0:!1;var St=(r,e,t,n)=>{let i=_t(r)&&typeof r!="string"?Array.from(r):[r];return i.length===0?[]:typeof i[0]=="string"?i:i.map(o=>o.getTimestamp()instanceof Date||o.getTimestamp()===void 0?o.toLineProtocol(n,e,t):o.toLineProtocol(void 0,e,t)).filter(Et)};var yr=r=>typeof r=="number"?"float":typeof r=="string"?"string":typeof r=="boolean"?"boolean":void 0,_e=class r extends Error{constructor(e,t,n){super(`field ${e} of type ${n} doesn't match expected type ${t}!`),this.name="GetFieldTypeMissmatchError",Object.setPrototypeOf(this,r.prototype)}},D=class r{constructor(){d(this,"_name");d(this,"_time");d(this,"_tags",{});d(this,"_fields",{})}getMeasurement(){return this._name}setMeasurement(e){return this._name=e,this}getTimestamp(){return this._time}setTimestamp(e){return this._time=e,this}getTag(e){return this._tags[e]}setTag(e,t){return this._tags[e]=t,this}removeTag(e){return delete this._tags[e],this}getTagNames(){return Object.keys(this._tags)}getFloatField(e){return this.getField(e,"float")}setFloatField(e,t){let n;if(typeof t=="number"?n=t:n=parseFloat(t),!isFinite(n))throw new Error(`invalid float value for field '${e}': '${t}'!`);return this._fields[e]=["float",n],this}getIntegerField(e){return this.getField(e,"integer")}setIntegerField(e,t){let n;if(typeof t=="number"?n=t:n=parseInt(String(t)),isNaN(n)||n<=-9223372036854776e3||n>=9223372036854776e3)throw new Error(`invalid integer value for field '${e}': '${t}'!`);return this._fields[e]=["integer",Math.floor(n)],this}getUintegerField(e){return this.getField(e,"uinteger")}setUintegerField(e,t){if(typeof t=="number"){if(isNaN(t)||t<0||t>Number.MAX_SAFE_INTEGER)throw new Error(`uint value for field '${e}' out of range: ${t}`);this._fields[e]=["uinteger",Math.floor(t)]}else{let n=String(t);for(let i=0;i<n.length;i++){let s=n.charCodeAt(i);if(s<48||s>57)throw new Error(`uint value has an unsupported character at pos ${i}: ${t}`)}if(n.length>20||n.length===20&&n.localeCompare("18446744073709551615")>0)throw new Error(`uint value for field '${e}' out of range: ${n}`);this._fields[e]=["uinteger",+n]}return this}getStringField(e){return this.getField(e,"string")}setStringField(e,t){return t!=null&&(typeof t!="string"&&(t=String(t)),this._fields[e]=["string",t]),this}getBooleanField(e){return this.getField(e,"boolean")}setBooleanField(e,t){return this._fields[e]=["boolean",!!t],this}getField(e,t){let n=this._fields[e];if(!n)return;let[i,s]=n;if(t!==void 0&&t!==i)throw new _e(e,t,i);return s}getFieldType(e){let t=this._fields[e];if(t)return t[0]}setField(e,t,n){switch(n!=null?n:yr(t)){case"string":return this.setStringField(e,t);case"boolean":return this.setBooleanField(e,t);case"float":return this.setFloatField(e,t);case"integer":return this.setIntegerField(e,t);case"uinteger":return this.setUintegerField(e,t);case void 0:return this;default:throw new Error(`invalid field type for field '${e}': type -> ${n}, value -> ${t}!`)}}setFields(e){for(let[t,n]of Object.entries(e))this.setField(t,n);return this}removeField(e){return delete this._fields[e],this}getFieldNames(){return Object.keys(this._fields)}hasFields(){return this.getFieldNames().length>0}copy(){let e=new r;return e._name=this._name,e._time=this._time,e._tags=Object.fromEntries(Object.entries(this._tags)),e._fields=Object.fromEntries(Object.entries(this._fields).map(t=>[...t])),e}asPoint(e){return ee.fromValues(e?this.setMeasurement(e):this)}};var wr=(r,e)=>{switch(r){case"string":return v.quoted(e);case"boolean":return e?"T":"F";case"float":return`${e}`;case"integer":return`${e}i`;case"uinteger":return`${e}u`}},Tr=(r,e)=>{if(!e)return[];let t=new Set(r);return Object.keys(e).filter(n=>!t.has(n)).sort()},Fr=(r,e)=>{if(!e||e.length===0)return r;let t=new Set(r),n=[],i=new Set;for(let o of e)!o||i.has(o)||!t.has(o)||(n.push(o),i.add(o),t.delete(o));let s=Array.from(t).sort();return n.concat(s)},ee=class r{constructor(e){d(this,"_values");e instanceof D?this._values=e:this._values=new D,typeof e=="string"&&this._values.setMeasurement(e)}static measurement(e){return new r(e)}static fromValues(e){if(!e.getMeasurement()||e.getMeasurement()==="")throw new Error("Cannot convert values to point without measurement set!");return new r(e)}getMeasurement(){return this._values.getMeasurement()}setMeasurement(e){return e!==""&&this._values.setMeasurement(e),this}getTimestamp(){return this._values.getTimestamp()}setTimestamp(e){return this._values.setTimestamp(e),this}getTag(e){return this._values.getTag(e)}setTag(e,t){return this._values.setTag(e,t),this}removeTag(e){return this._values.removeTag(e),this}getTagNames(){return this._values.getTagNames()}getFloatField(e){return this._values.getFloatField(e)}setFloatField(e,t){return this._values.setFloatField(e,t),this}getIntegerField(e){return this._values.getIntegerField(e)}setIntegerField(e,t){return this._values.setIntegerField(e,t),this}getUintegerField(e){return this._values.getUintegerField(e)}setUintegerField(e,t){return this._values.setUintegerField(e,t),this}getStringField(e){return this._values.getStringField(e)}setStringField(e,t){return this._values.setStringField(e,t),this}getBooleanField(e){return this._values.getBooleanField(e)}setBooleanField(e,t){return this._values.setBooleanField(e,t),this}getField(e,t){return this._values.getField(e,t)}getFieldType(e){return this._values.getFieldType(e)}setField(e,t,n){return this._values.setField(e,t,n),this}setFields(e){return this._values.setFields(e),this}removeField(e){return this._values.removeField(e),this}getFieldNames(){return this._values.getFieldNames()}hasFields(){return this._values.hasFields()}copy(){return new r(this._values.copy())}toLineProtocol(e,t,n){if(!this._values.getMeasurement())return;let i="";if(this._values.getFieldNames().sort().forEach(f=>{if(f){let m=this._values.getFieldType(f),p=this._values.getField(f);if(m===void 0||p===void 0)return;let F=wr(m,p);i.length>0&&(i+=","),i+=`${v.tag(f)}=${F}`}}),i.length===0)return;let s="",o=this._values.getTagNames().sort(),a=Tr(o,t);Fr(a.concat(o),n).forEach(f=>{if(f){let m=this._values.getTag(f),p=m!==void 0?m:t==null?void 0:t[f];p&&(s+=",",s+=`${v.tag(f)}=${v.tag(p)}`)}});let c=this._values.getTimestamp();return e?typeof e=="string"?c=Nt(c,e):c=e(c):c=It(c),`${v.measurement(this.getMeasurement())}${s} ${i}${c!==void 0?` ${c}`:""}`}toString(){let e=this.toLineProtocol(void 0);return e||`invalid point: ${JSON.stringify(this,void 0)}`}};function ke(r={}){let e=0,t={next:n=>{if(e===0&&r.next&&n!==null&&n!==void 0)return r.next(n)},error:n=>{e===0&&(e=1,r.error&&r.error(n))},complete:()=>{e===0&&(e=2,r.complete&&r.complete())},responseStarted:(n,i)=>{r.responseStarted&&r.responseStarted(n,i)}};return r.useCancellable&&(t.useCancellable=r.useCancellable.bind(r)),r.useResume&&(t.useResume=r.useResume.bind(r)),t}function te(r){let e={};return r.headers.forEach((t,n)=>{let i=e[n];i===void 0?e[n]=t:Array.isArray(i)?i.push(t):e[n]=[i,t]}),e}var X=class{constructor(e){this._connectionOptions=e;d(this,"chunkCombiner",ft());d(this,"_defaultHeaders");d(this,"_url");d(this,"requestDecorator",function(){});var t;if(this._defaultHeaders={"content-type":"application/json; charset=utf-8",...e.headers},this._connectionOptions.token){let n=(t=this._connectionOptions.authScheme)!=null?t:"Token";this._defaultHeaders.Authorization=`${n} ${this._connectionOptions.token}`}this._url=String(this._connectionOptions.host),this._url.endsWith("/")&&(this._url=this._url.substring(0,this._url.length-1)),this._url.endsWith("/api/v2")&&(this._url=this._url.substring(0,this._url.length-7),B.warn(`Please remove '/api/v2' context path from InfluxDB base url, using ${this._url} !`))}_connectionOptions;send(e,t,n,i){let s=ke(i),o=!1,a=n.signal,u,c=()=>{},f=c;if(i&&i.useCancellable){let m=new AbortController;a||(a=m.signal,n={...n,signal:a}),a.addEventListener("abort",()=>{f()}),i.useCancellable({cancel(){o=!0,m.abort()},isCancelled(){return o||a.aborted}})}this._fetch(e,t,n).then(async m=>{if(i!=null&&i.responseStarted&&s.responseStarted(te(m),m.status),await this._throwOnErrorResponse(m),m.body){let p=m.body.getReader(),F;do{if(u&&await u,o)break;if(F=await p.read(),s.next(F.value)===!1){let h=s.useResume;if(!h){let O="Unable to pause, useResume is not configured!";return await p.cancel(O),Promise.reject(new Error(O))}u=new Promise(O=>{f=()=>{O(),u=void 0,f=c},h(f)})}}while(!F.done)}else if(m.arrayBuffer){let p=await m.arrayBuffer();s.next(new Uint8Array(p))}else{let p=await m.text();s.next(new TextEncoder().encode(p))}}).catch(m=>{o||s.error(m)}).finally(()=>s.complete())}async _throwOnErrorResponse(e){if(e.status>=300){let t="";try{if(t=await e.text(),!t){let n=e.headers.get("x-influxdb-error");n&&(t=n)}}catch(n){throw B.warn("Unable to receive error body",n),new _(e.status,e.statusText,void 0,e.headers.get("content-type"),te(e))}throw new _(e.status,e.statusText,t,e.headers.get("content-type"),te(e))}}async*iterate(e,t,n){var s;let i=await this._fetch(e,t,n);if(await this._throwOnErrorResponse(i),i.body){let o=i.body.getReader();for(;;){let{value:a,done:u}=await o.read();if(u)break;if((s=n.signal)!=null&&s.aborted)throw await i.body.cancel(),new Y;yield a}}else if(i.arrayBuffer){let o=await i.arrayBuffer();yield new Uint8Array(o)}else{let o=await i.text();yield new TextEncoder().encode(o)}}async request(e,t,n,i){var c,f;let s=await this._fetch(e,t,n),{headers:o}=s,a=o.get("content-type")||"";i&&i(te(s),s.status),await this._throwOnErrorResponse(s);let u=(f=(c=n.headers)==null?void 0:c.accept)!=null?f:a;if(u.includes("json"))return await s.json();if(u.includes("text")||u.startsWith("application/csv"))return await s.text()}_fetch(e,t,n){let{method:i,headers:s,...o}=n,a=`${this._url}${e}`,u={method:i,body:i==="GET"||i==="HEAD"?void 0:typeof t=="string"?t:JSON.stringify(t),headers:{...this._defaultHeaders,...s},credentials:"omit",...this._connectionOptions.transportOptions,...o};return this.requestDecorator(u,n,a),fetch(a,u)}};import{GrpcWebFetchTransport as xr}from"@protobuf-ts/grpcweb-transport";var Pt=({host:r,timeout:e,clientOptions:t})=>{var i;(t!=null&&t.grpcOptions||(i=t==null?void 0:t.queryOptions)!=null&&i.grpcOptions)&&console.warn(`Detected grpcClientOptions: such options are ignored in the GrpcWebFetchTransport:
6
10
 
7
- ${JSON.stringify(t)}`);let{interceptors:r}=t!=null?t:{};return new mr({baseUrl:n,timeout:e,interceptors:r})};var hr={writeTransport:n=>new H(n),queryTransport:It},D=hr;var j=class{constructor(e){this._options=e;d(this,"_closed",!1);d(this,"_transport");var t;this._transport=(t=this._options.transport)!=null?t:D.writeTransport(this._options),this.doWrite=this.doWrite.bind(this)}_options;_createWritePath(e,t,r){let i=t.precision,s,o=[];return r&&o.push(`org=${encodeURIComponent(r)}`),t.noSync?(s="/api/v3/write_lp",o.push(`db=${encodeURIComponent(e)}`),o.push(`precision=${ct(i)}`),o.push("no_sync=true")):(s="/api/v2/write",o.push(`bucket=${encodeURIComponent(e)}`),o.push(`precision=${lt(i)}`)),`${s}?${o.join("&")}`}doWrite(e,t,r,i){if(this._closed)return Promise.reject(new Error("writeApi: already closed!"));if(e.length<=0||e.length===1&&e[0]==="")return Promise.resolve();let o,a,u=new Promise((h,x)=>{o=h,a=x}),c={...st,...i},f,m,p={responseStarted(h,x){f=x,m=h},error(h){if(h instanceof _&&h.json&&typeof h.json.error=="string"&&h.json.error.includes("hinted handoff queue not empty")){L.warn(`Write to InfluxDB returns: ${h.json.error}`),f=204,p.complete();return}h instanceof _&&h.statusCode==405&&c.noSync&&(h=new _(h.statusCode,"Server doesn't support write with noSync=true (supported by InfluxDB 3 Core/Enterprise servers only).",h.body,h.contentType,h.headers)),L.error("Write to InfluxDB failed.",h),a(h)},complete(){if(f==null||f>=200&&f<300)o();else{let h=`2xx HTTP response status code expected, but ${f} returned`,x=new _(f,h,void 0,"0",m);x.message=h,p.error(x)}}},O={method:"POST",headers:{"content-type":"text/plain; charset=utf-8",...i==null?void 0:i.headers},gzipThreshold:c.gzipThreshold,timeout:c.timeout};return this._transport.send(this._createWritePath(t,c,r),e.join(`
8
- `),O,p),u}async close(){this._closed=!0}};import{RecordBatchReader as Lr,Type as Br}from"apache-arrow";import{ServiceType as Fr}from"@protobuf-ts/runtime-rpc";function U(n){let e=typeof n;if(e=="object"){if(Array.isArray(n))return"array";if(n===null)return"null"}return e}function _e(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}var k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),z=[];for(let n=0;n<k.length;n++)z[k[n].charCodeAt(0)]=n;z[45]=k.indexOf("+");z[95]=k.indexOf("/");function Nt(n){let e=n.length*3/4;n[n.length-2]=="="?e-=2:n[n.length-1]=="="&&(e-=1);let t=new Uint8Array(e),r=0,i=0,s,o=0;for(let a=0;a<n.length;a++){if(s=z[n.charCodeAt(a)],s===void 0)switch(n[a]){case"=":i=0;case`
9
- `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:o=s,i=1;break;case 1:t[r++]=o<<2|(s&48)>>4,o=s,i=2;break;case 2:t[r++]=(o&15)<<4|(s&60)>>2,o=s,i=3;break;case 3:t[r++]=(o&3)<<6|s,i=0;break}}if(i==1)throw Error("invalid base64 string.");return t.subarray(0,r)}function _t(n){let e="",t=0,r,i=0;for(let s=0;s<n.length;s++)switch(r=n[s],t){case 0:e+=k[r>>2],i=(r&3)<<4,t=1;break;case 1:e+=k[i|r>>4],i=(r&15)<<2,t=2;break;case 2:e+=k[i|r>>6],e+=k[r&63],t=0;break}return t&&(e+=k[i],e+="=",t==1&&(e+="=")),e}var v;(function(n){n.symbol=Symbol.for("protobuf-ts/unknown"),n.onRead=(t,r,i,s,o)=>{(e(r)?r[n.symbol]:r[n.symbol]=[]).push({no:i,wireType:s,data:o})},n.onWrite=(t,r,i)=>{for(let{no:s,wireType:o,data:a}of n.list(r))i.tag(s,o).raw(a)},n.list=(t,r)=>{if(e(t)){let i=t[n.symbol];return r?i.filter(s=>s.no==r):i}return[]},n.last=(t,r)=>n.list(t,r).slice(-1)[0];let e=t=>t&&Array.isArray(t[n.symbol])})(v||(v={}));var w;(function(n){n[n.Varint=0]="Varint",n[n.Bit64=1]="Bit64",n[n.LengthDelimited=2]="LengthDelimited",n[n.StartGroup=3]="StartGroup",n[n.EndGroup=4]="EndGroup",n[n.Bit32=5]="Bit32"})(w||(w={}));function Et(){let n=0,e=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(n|=(i&127)<<r,(i&128)==0)return this.assertBounds(),[n,e]}let t=this.buf[this.pos++];if(n|=(t&15)<<28,e=(t&112)>>4,(t&128)==0)return this.assertBounds(),[n,e];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<r,(i&128)==0)return this.assertBounds(),[n,e]}throw new Error("invalid varint")}function te(n,e,t){for(let s=0;s<28;s=s+7){let o=n>>>s,a=!(!(o>>>7)&&e==0),u=(a?o|128:o)&255;if(t.push(u),!a)return}let r=n>>>28&15|(e&7)<<4,i=e>>3!=0;if(t.push((i?r|128:r)&255),!!i){for(let s=3;s<31;s=s+7){let o=e>>>s,a=!!(o>>>7),u=(a?o|128:o)&255;if(t.push(u),!a)return}t.push(e>>>31&1)}}var ee=65536*65536;function Ee(n){let e=n[0]=="-";e&&(n=n.slice(1));let t=1e6,r=0,i=0;function s(o,a){let u=Number(n.slice(o,a));i*=t,r=r*t+u,r>=ee&&(i=i+(r/ee|0),r=r%ee)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),[e,r,i]}function re(n,e){if(e>>>0<=2097151)return""+(ee*e+(n>>>0));let t=n&16777215,r=(n>>>24|e<<8)>>>0&16777215,i=e>>16&65535,s=t+r*6777216+i*6710656,o=r+i*8147497,a=i*2,u=1e7;s>=u&&(o+=Math.floor(s/u),s%=u),o>=u&&(a+=Math.floor(o/u),o%=u);function c(f,m){let p=f?String(f):"";return m?"0000000".slice(p.length)+p:p}return c(a,0)+c(o,a)+c(s,1)}function ke(n,e){if(n>=0){for(;n>127;)e.push(n&127|128),n=n>>>7;e.push(n)}else{for(let t=0;t<9;t++)e.push(n&127|128),n=n>>7;e.push(1)}}function kt(){let n=this.buf[this.pos++],e=n&127;if((n&128)==0)return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<7,(n&128)==0)return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<14,(n&128)==0)return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<21,(n&128)==0)return this.assertBounds(),e;n=this.buf[this.pos++],e|=(n&15)<<28;for(let t=5;(n&128)!==0&&t<10;t++)n=this.buf[this.pos++];if((n&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}var y;function dr(){let n=new DataView(new ArrayBuffer(8));y=globalThis.BigInt!==void 0&&typeof n.getBigInt64=="function"&&typeof n.getBigUint64=="function"&&typeof n.setBigInt64=="function"&&typeof n.setBigUint64=="function"?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:n}:void 0}dr();function St(n){if(!n)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}var Rt=/^-?[0-9]+$/,ie=4294967296,ne=2147483648,se=class{constructor(e,t){this.lo=e|0,this.hi=t|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let e=this.hi*ie+(this.lo>>>0);if(!Number.isSafeInteger(e))throw new Error("cannot convert to safe number");return e}},F=class n extends se{static from(e){if(y)switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=="")throw new Error("string is no integer");e=y.C(e);case"number":if(e===0)return this.ZERO;e=y.C(e);case"bigint":if(!e)return this.ZERO;if(e<y.UMIN)throw new Error("signed value for ulong");if(e>y.UMAX)throw new Error("ulong too large");return y.V.setBigUint64(0,e,!0),new n(y.V.getInt32(0,!0),y.V.getInt32(4,!0))}else switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=e.trim(),!Rt.test(e))throw new Error("string is no integer");let[t,r,i]=Ee(e);if(t)throw new Error("signed value for ulong");return new n(r,i);case"number":if(e==0)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");if(e<0)throw new Error("signed value for ulong");return new n(e,e/ie)}throw new Error("unknown value "+typeof e)}toString(){return y?this.toBigInt().toString():re(this.lo,this.hi)}toBigInt(){return St(y),y.V.setInt32(0,this.lo,!0),y.V.setInt32(4,this.hi,!0),y.V.getBigUint64(0,!0)}};F.ZERO=new F(0,0);var b=class n extends se{static from(e){if(y)switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=="")throw new Error("string is no integer");e=y.C(e);case"number":if(e===0)return this.ZERO;e=y.C(e);case"bigint":if(!e)return this.ZERO;if(e<y.MIN)throw new Error("signed long too small");if(e>y.MAX)throw new Error("signed long too large");return y.V.setBigInt64(0,e,!0),new n(y.V.getInt32(0,!0),y.V.getInt32(4,!0))}else switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=e.trim(),!Rt.test(e))throw new Error("string is no integer");let[t,r,i]=Ee(e);if(t){if(i>ne||i==ne&&r!=0)throw new Error("signed long too small")}else if(i>=ne)throw new Error("signed long too large");let s=new n(r,i);return t?s.negate():s;case"number":if(e==0)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");return e>0?new n(e,e/ie):new n(-e,-e/ie).negate()}throw new Error("unknown value "+typeof e)}isNegative(){return(this.hi&ne)!==0}negate(){let e=~this.hi,t=this.lo;return t?t=~t+1:e+=1,new n(t,e)}toString(){if(y)return this.toBigInt().toString();if(this.isNegative()){let e=this.negate();return"-"+re(e.lo,e.hi)}return re(this.lo,this.hi)}toBigInt(){return St(y),y.V.setInt32(0,this.lo,!0),y.V.setInt32(4,this.hi,!0),y.V.getBigInt64(0,!0)}};b.ZERO=new b(0,0);var At={readUnknownField:!0,readerFactory:n=>new Se(n)};function Pt(n){return n?Object.assign(Object.assign({},At),n):At}var Se=class{constructor(e,t){this.varint64=Et,this.uint32=kt,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t!=null?t:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let e=this.uint32(),t=e>>>3,r=e&7;if(t<=0||r<0||r>5)throw new Error("illegal tag: field no "+t+" wire type "+r);return[t,r]}skip(e){let t=this.pos;switch(e){case w.Varint:for(;this.buf[this.pos++]&128;);break;case w.Bit64:this.pos+=4;case w.Bit32:this.pos+=4;break;case w.LengthDelimited:let r=this.uint32();this.pos+=r;break;case w.StartGroup:let i;for(;(i=this.tag()[1])!==w.EndGroup;)this.skip(i);break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(t,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return new b(...this.varint64())}uint64(){return new F(...this.varint64())}sint64(){let[e,t]=this.varint64(),r=-(e&1);return e=(e>>>1|(t&1)<<31)^r,t=t>>>1^r,new b(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new F(this.sfixed32(),this.sfixed32())}sfixed64(){return new b(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.textDecoder.decode(this.bytes())}};function g(n,e){if(!n)throw new Error(e)}var gr=34028234663852886e22,br=-34028234663852886e22,yr=4294967295,Tr=2147483647,wr=-2147483648;function S(n){if(typeof n!="number")throw new Error("invalid int 32: "+typeof n);if(!Number.isInteger(n)||n>Tr||n<wr)throw new Error("invalid int 32: "+n)}function C(n){if(typeof n!="number")throw new Error("invalid uint 32: "+typeof n);if(!Number.isInteger(n)||n>yr||n<0)throw new Error("invalid uint 32: "+n)}function M(n){if(typeof n!="number")throw new Error("invalid float 32: "+typeof n);if(Number.isFinite(n)&&(n>gr||n<br))throw new Error("invalid float 32: "+n)}var Dt={writeUnknownFields:!0,writerFactory:()=>new Re};function Ut(n){return n?Object.assign(Object.assign({},Dt),n):Dt}var Re=class{constructor(e){this.stack=[],this.textEncoder=e!=null?e:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let i=0;i<this.chunks.length;i++)e+=this.chunks[i].length;let t=new Uint8Array(e),r=0;for(let i=0;i<this.chunks.length;i++)t.set(this.chunks[i],r),r+=this.chunks[i].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(C(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return S(e),ke(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){M(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){C(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){S(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return S(e),e=(e<<1^e>>31)>>>0,ke(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),i=b.from(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),i=F.from(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(t)}int64(e){let t=b.from(e);return te(t.lo,t.hi,this.buf),this}sint64(e){let t=b.from(e),r=t.hi>>31,i=t.lo<<1^r,s=(t.hi<<1|t.lo>>>31)^r;return te(i,s,this.buf),this}uint64(e){let t=F.from(e);return te(t.lo,t.hi,this.buf),this}};var Ct={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},Lt={ignoreUnknownFields:!1};function Bt(n){return n?Object.assign(Object.assign({},Lt),n):Lt}function Vt(n){return n?Object.assign(Object.assign({},Ct),n):Ct}var oe=Symbol.for("protobuf-ts/message-type");function Ae(n){let e=!1,t=[];for(let r=0;r<n.length;r++){let i=n.charAt(r);i=="_"?e=!0:/\d/.test(i)?(t.push(i),e=!0):e?(t.push(i.toUpperCase()),e=!1):r==0?t.push(i.toLowerCase()):t.push(i)}return t.join("")}var l;(function(n){n[n.DOUBLE=1]="DOUBLE",n[n.FLOAT=2]="FLOAT",n[n.INT64=3]="INT64",n[n.UINT64=4]="UINT64",n[n.INT32=5]="INT32",n[n.FIXED64=6]="FIXED64",n[n.FIXED32=7]="FIXED32",n[n.BOOL=8]="BOOL",n[n.STRING=9]="STRING",n[n.BYTES=12]="BYTES",n[n.UINT32=13]="UINT32",n[n.SFIXED32=15]="SFIXED32",n[n.SFIXED64=16]="SFIXED64",n[n.SINT32=17]="SINT32",n[n.SINT64=18]="SINT64"})(l||(l={}));var I;(function(n){n[n.BIGINT=0]="BIGINT",n[n.STRING=1]="STRING",n[n.NUMBER=2]="NUMBER"})(I||(I={}));var X;(function(n){n[n.NO=0]="NO",n[n.PACKED=1]="PACKED",n[n.UNPACKED=2]="UNPACKED"})(X||(X={}));function vt(n){var e,t,r,i;return n.localName=(e=n.localName)!==null&&e!==void 0?e:Ae(n.name),n.jsonName=(t=n.jsonName)!==null&&t!==void 0?t:Ae(n.name),n.repeat=(r=n.repeat)!==null&&r!==void 0?r:X.NO,n.opt=(i=n.opt)!==null&&i!==void 0?i:n.repeat||n.oneof?!1:n.kind=="message",n}function Mt(n){if(typeof n!="object"||n===null||!n.hasOwnProperty("oneofKind"))return!1;switch(typeof n.oneofKind){case"string":return n[n.oneofKind]===void 0?!1:Object.keys(n).length==2;case"undefined":return Object.keys(n).length==1;default:return!1}}var ae=class{constructor(e){var t;this.fields=(t=e.fields)!==null&&t!==void 0?t:[]}prepare(){if(this.data)return;let e=[],t=[],r=[];for(let i of this.fields)if(i.oneof)r.includes(i.oneof)||(r.push(i.oneof),e.push(i.oneof),t.push(i.oneof));else switch(t.push(i.localName),i.kind){case"scalar":case"enum":(!i.opt||i.repeat)&&e.push(i.localName);break;case"message":i.repeat&&e.push(i.localName);break;case"map":e.push(i.localName);break}this.data={req:e,known:t,oneofs:Object.values(r)}}is(e,t,r=!1){if(t<0)return!0;if(e==null||typeof e!="object")return!1;this.prepare();let i=Object.keys(e),s=this.data;if(i.length<s.req.length||s.req.some(o=>!i.includes(o))||!r&&i.some(o=>!s.known.includes(o)))return!1;if(t<1)return!0;for(let o of s.oneofs){let a=e[o];if(!Mt(a))return!1;if(a.oneofKind===void 0)continue;let u=this.fields.find(c=>c.localName===a.oneofKind);if(!u||!this.field(a[a.oneofKind],u,r,t))return!1}for(let o of this.fields)if(o.oneof===void 0&&!this.field(e[o.localName],o,r,t))return!1;return!0}field(e,t,r,i){let s=t.repeat;switch(t.kind){case"scalar":return e===void 0?t.opt:s?this.scalars(e,t.T,i,t.L):this.scalar(e,t.T,t.L);case"enum":return e===void 0?t.opt:s?this.scalars(e,l.INT32,i):this.scalar(e,l.INT32);case"message":return e===void 0?!0:s?this.messages(e,t.T(),r,i):this.message(e,t.T(),r,i);case"map":if(typeof e!="object"||e===null)return!1;if(i<2)return!0;if(!this.mapKeys(e,t.K,i))return!1;switch(t.V.kind){case"scalar":return this.scalars(Object.values(e),t.V.T,i,t.V.L);case"enum":return this.scalars(Object.values(e),l.INT32,i);case"message":return this.messages(Object.values(e),t.V.T(),r,i)}break}return!0}message(e,t,r,i){return r?t.isAssignable(e,i):t.is(e,i)}messages(e,t,r,i){if(!Array.isArray(e))return!1;if(i<2)return!0;if(r){for(let s=0;s<e.length&&s<i;s++)if(!t.isAssignable(e[s],i-1))return!1}else for(let s=0;s<e.length&&s<i;s++)if(!t.is(e[s],i-1))return!1;return!0}scalar(e,t,r){let i=typeof e;switch(t){case l.UINT64:case l.FIXED64:case l.INT64:case l.SFIXED64:case l.SINT64:switch(r){case I.BIGINT:return i=="bigint";case I.NUMBER:return i=="number"&&!isNaN(e);default:return i=="string"}case l.BOOL:return i=="boolean";case l.STRING:return i=="string";case l.BYTES:return e instanceof Uint8Array;case l.DOUBLE:case l.FLOAT:return i=="number"&&!isNaN(e);default:return i=="number"&&Number.isInteger(e)}}scalars(e,t,r,i){if(!Array.isArray(e))return!1;if(r<2)return!0;if(Array.isArray(e)){for(let s=0;s<e.length&&s<r;s++)if(!this.scalar(e[s],t,i))return!1}return!0}mapKeys(e,t,r){let i=Object.keys(e);switch(t){case l.INT32:case l.FIXED32:case l.SFIXED32:case l.SINT32:case l.UINT32:return this.scalars(i.slice(0,r).map(s=>parseInt(s)),t,r);case l.BOOL:return this.scalars(i.slice(0,r).map(s=>s=="true"?!0:s=="false"?!1:s),t,r);default:return this.scalars(i,t,r,I.STRING)}}};function N(n,e){switch(e){case I.BIGINT:return n.toBigInt();case I.NUMBER:return n.toNumber();default:return n.toString()}}var ue=class{constructor(e){this.info=e}prepare(){var e;if(this.fMap===void 0){this.fMap={};let t=(e=this.info.fields)!==null&&e!==void 0?e:[];for(let r of t)this.fMap[r.name]=r,this.fMap[r.jsonName]=r,this.fMap[r.localName]=r}}assert(e,t,r){if(!e){let i=U(r);throw(i=="number"||i=="boolean")&&(i=r.toString()),new Error(`Cannot parse JSON ${i} for ${this.info.typeName}#${t}`)}}read(e,t,r){this.prepare();let i=[];for(let[s,o]of Object.entries(e)){let a=this.fMap[s];if(!a){if(!r.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${s}`);continue}let u=a.localName,c;if(a.oneof){if(o===null&&(a.kind!=="enum"||a.T()[0]!=="google.protobuf.NullValue"))continue;if(i.includes(a.oneof))throw new Error(`Multiple members of the oneof group "${a.oneof}" of ${this.info.typeName} are present in JSON.`);i.push(a.oneof),c=t[a.oneof]={oneofKind:u}}else c=t;if(a.kind=="map"){if(o===null)continue;this.assert(_e(o),a.name,o);let f=c[u];for(let[m,p]of Object.entries(o)){this.assert(p!==null,a.name+" map value",null);let O;switch(a.V.kind){case"message":O=a.V.T().internalJsonRead(p,r);break;case"enum":if(O=this.enum(a.V.T(),p,a.name,r.ignoreUnknownFields),O===!1)continue;break;case"scalar":O=this.scalar(p,a.V.T,a.V.L,a.name);break}this.assert(O!==void 0,a.name+" map value",p);let h=m;a.K==l.BOOL&&(h=h=="true"?!0:h=="false"?!1:h),h=this.scalar(h,a.K,I.STRING,a.name).toString(),f[h]=O}}else if(a.repeat){if(o===null)continue;this.assert(Array.isArray(o),a.name,o);let f=c[u];for(let m of o){this.assert(m!==null,a.name,null);let p;switch(a.kind){case"message":p=a.T().internalJsonRead(m,r);break;case"enum":if(p=this.enum(a.T(),m,a.name,r.ignoreUnknownFields),p===!1)continue;break;case"scalar":p=this.scalar(m,a.T,a.L,a.name);break}this.assert(p!==void 0,a.name,o),f.push(p)}}else switch(a.kind){case"message":if(o===null&&a.T().typeName!="google.protobuf.Value"){this.assert(a.oneof===void 0,a.name+" (oneof member)",null);continue}c[u]=a.T().internalJsonRead(o,r,c[u]);break;case"enum":if(o===null)continue;let f=this.enum(a.T(),o,a.name,r.ignoreUnknownFields);if(f===!1)continue;c[u]=f;break;case"scalar":if(o===null)continue;c[u]=this.scalar(o,a.T,a.L,a.name);break}}}enum(e,t,r,i){if(e[0]=="google.protobuf.NullValue"&&g(t===null||t==="NULL_VALUE",`Unable to parse field ${this.info.typeName}#${r}, enum ${e[0]} only accepts null.`),t===null)return 0;switch(typeof t){case"number":return g(Number.isInteger(t),`Unable to parse field ${this.info.typeName}#${r}, enum can only be integral number, got ${t}.`),t;case"string":let s=t;e[2]&&t.substring(0,e[2].length)===e[2]&&(s=t.substring(e[2].length));let o=e[1][s];return typeof o=="undefined"&&i?!1:(g(typeof o=="number",`Unable to parse field ${this.info.typeName}#${r}, enum ${e[0]} has no value for "${t}".`),o)}g(!1,`Unable to parse field ${this.info.typeName}#${r}, cannot parse enum value from ${typeof t}".`)}scalar(e,t,r,i){let s;try{switch(t){case l.DOUBLE:case l.FLOAT:if(e===null)return 0;if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""){s="empty string";break}if(typeof e=="string"&&e.trim().length!==e.length){s="extra whitespace";break}if(typeof e!="string"&&typeof e!="number")break;let o=Number(e);if(Number.isNaN(o)){s="not a number";break}if(!Number.isFinite(o)){s="too large or small";break}return t==l.FLOAT&&M(o),o;case l.INT32:case l.FIXED32:case l.SFIXED32:case l.SINT32:case l.UINT32:if(e===null)return 0;let a;if(typeof e=="number"?a=e:e===""?s="empty string":typeof e=="string"&&(e.trim().length!==e.length?s="extra whitespace":a=Number(e)),a===void 0)break;return t==l.UINT32?C(a):S(a),a;case l.INT64:case l.SFIXED64:case l.SINT64:if(e===null)return N(b.ZERO,r);if(typeof e!="number"&&typeof e!="string")break;return N(b.from(e),r);case l.FIXED64:case l.UINT64:if(e===null)return N(F.ZERO,r);if(typeof e!="number"&&typeof e!="string")break;return N(F.from(e),r);case l.BOOL:if(e===null)return!1;if(typeof e!="boolean")break;return e;case l.STRING:if(e===null)return"";if(typeof e!="string"){s="extra whitespace";break}try{encodeURIComponent(e)}catch(u){u="invalid UTF8";break}return e;case l.BYTES:if(e===null||e==="")return new Uint8Array(0);if(typeof e!="string")break;return Nt(e)}}catch(o){s=o.message}this.assert(!1,i+(s?" - "+s:""),e)}};var le=class{constructor(e){var t;this.fields=(t=e.fields)!==null&&t!==void 0?t:[]}write(e,t){let r={},i=e;for(let s of this.fields){if(!s.oneof){let c=this.field(s,i[s.localName],t);c!==void 0&&(r[t.useProtoFieldName?s.name:s.jsonName]=c);continue}let o=i[s.oneof];if(o.oneofKind!==s.localName)continue;let a=s.kind=="scalar"||s.kind=="enum"?Object.assign(Object.assign({},t),{emitDefaultValues:!0}):t,u=this.field(s,o[s.localName],a);g(u!==void 0),r[t.useProtoFieldName?s.name:s.jsonName]=u}return r}field(e,t,r){let i;if(e.kind=="map"){g(typeof t=="object"&&t!==null);let s={};switch(e.V.kind){case"scalar":for(let[u,c]of Object.entries(t)){let f=this.scalar(e.V.T,c,e.name,!1,!0);g(f!==void 0),s[u.toString()]=f}break;case"message":let o=e.V.T();for(let[u,c]of Object.entries(t)){let f=this.message(o,c,e.name,r);g(f!==void 0),s[u.toString()]=f}break;case"enum":let a=e.V.T();for(let[u,c]of Object.entries(t)){g(c===void 0||typeof c=="number");let f=this.enum(a,c,e.name,!1,!0,r.enumAsInteger);g(f!==void 0),s[u.toString()]=f}break}(r.emitDefaultValues||Object.keys(s).length>0)&&(i=s)}else if(e.repeat){g(Array.isArray(t));let s=[];switch(e.kind){case"scalar":for(let u=0;u<t.length;u++){let c=this.scalar(e.T,t[u],e.name,e.opt,!0);g(c!==void 0),s.push(c)}break;case"enum":let o=e.T();for(let u=0;u<t.length;u++){g(t[u]===void 0||typeof t[u]=="number");let c=this.enum(o,t[u],e.name,e.opt,!0,r.enumAsInteger);g(c!==void 0),s.push(c)}break;case"message":let a=e.T();for(let u=0;u<t.length;u++){let c=this.message(a,t[u],e.name,r);g(c!==void 0),s.push(c)}break}(r.emitDefaultValues||s.length>0||r.emitDefaultValues)&&(i=s)}else switch(e.kind){case"scalar":i=this.scalar(e.T,t,e.name,e.opt,r.emitDefaultValues);break;case"enum":i=this.enum(e.T(),t,e.name,e.opt,r.emitDefaultValues,r.enumAsInteger);break;case"message":i=this.message(e.T(),t,e.name,r);break}return i}enum(e,t,r,i,s,o){if(e[0]=="google.protobuf.NullValue")return!s&&!i?void 0:null;if(t===void 0){g(i);return}if(!(t===0&&!s&&!i))return g(typeof t=="number"),g(Number.isInteger(t)),o||!e[1].hasOwnProperty(t)?t:e[2]?e[2]+e[1][t]:e[1][t]}message(e,t,r,i){return t===void 0?i.emitDefaultValues?null:void 0:e.internalJsonWrite(t,i)}scalar(e,t,r,i,s){if(t===void 0){g(i);return}let o=s||i;switch(e){case l.INT32:case l.SFIXED32:case l.SINT32:return t===0?o?0:void 0:(S(t),t);case l.FIXED32:case l.UINT32:return t===0?o?0:void 0:(C(t),t);case l.FLOAT:M(t);case l.DOUBLE:return t===0?o?0:void 0:(g(typeof t=="number"),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t);case l.STRING:return t===""?o?"":void 0:(g(typeof t=="string"),t);case l.BOOL:return t===!1?o?!1:void 0:(g(typeof t=="boolean"),t);case l.UINT64:case l.FIXED64:g(typeof t=="number"||typeof t=="string"||typeof t=="bigint");let a=F.from(t);return a.isZero()&&!o?void 0:a.toString();case l.INT64:case l.SFIXED64:case l.SINT64:g(typeof t=="number"||typeof t=="string"||typeof t=="bigint");let u=b.from(t);return u.isZero()&&!o?void 0:u.toString();case l.BYTES:return g(t instanceof Uint8Array),t.byteLength?_t(t):o?"":void 0}}};function J(n,e=I.STRING){switch(n){case l.BOOL:return!1;case l.UINT64:case l.FIXED64:return N(F.ZERO,e);case l.INT64:case l.SFIXED64:case l.SINT64:return N(b.ZERO,e);case l.DOUBLE:case l.FLOAT:return 0;case l.BYTES:return new Uint8Array(0);case l.STRING:return"";default:return 0}}var ce=class{constructor(e){this.info=e}prepare(){var e;if(!this.fieldNoToField){let t=(e=this.info.fields)!==null&&e!==void 0?e:[];this.fieldNoToField=new Map(t.map(r=>[r.no,r]))}}read(e,t,r,i){this.prepare();let s=i===void 0?e.len:e.pos+i;for(;e.pos<s;){let[o,a]=e.tag(),u=this.fieldNoToField.get(o);if(!u){let p=r.readUnknownField;if(p=="throw")throw new Error(`Unknown field ${o} (wire type ${a}) for ${this.info.typeName}`);let O=e.skip(a);p!==!1&&(p===!0?v.onRead:p)(this.info.typeName,t,o,a,O);continue}let c=t,f=u.repeat,m=u.localName;switch(u.oneof&&(c=c[u.oneof],c.oneofKind!==m&&(c=t[u.oneof]={oneofKind:m})),u.kind){case"scalar":case"enum":let p=u.kind=="enum"?l.INT32:u.T,O=u.kind=="scalar"?u.L:void 0;if(f){let R=c[m];if(a==w.LengthDelimited&&p!=l.STRING&&p!=l.BYTES){let $=e.uint32()+e.pos;for(;e.pos<$;)R.push(this.scalar(e,p,O))}else R.push(this.scalar(e,p,O))}else c[m]=this.scalar(e,p,O);break;case"message":if(f){let R=c[m],$=u.T().internalBinaryRead(e,e.uint32(),r);R.push($)}else c[m]=u.T().internalBinaryRead(e,e.uint32(),r,c[m]);break;case"map":let[h,x]=this.mapEntry(u,e,r);c[m][h]=x;break}}}mapEntry(e,t,r){let i=t.uint32(),s=t.pos+i,o,a;for(;t.pos<s;){let[u,c]=t.tag();switch(u){case 1:e.K==l.BOOL?o=t.bool().toString():o=this.scalar(t,e.K,I.STRING);break;case 2:switch(e.V.kind){case"scalar":a=this.scalar(t,e.V.T,e.V.L);break;case"enum":a=t.int32();break;case"message":a=e.V.T().internalBinaryRead(t,t.uint32(),r);break}break;default:throw new Error(`Unknown field ${u} (wire type ${c}) in map entry for ${this.info.typeName}#${e.name}`)}}if(o===void 0){let u=J(e.K);o=e.K==l.BOOL?u.toString():u}if(a===void 0)switch(e.V.kind){case"scalar":a=J(e.V.T,e.V.L);break;case"enum":a=0;break;case"message":a=e.V.T().create();break}return[o,a]}scalar(e,t,r){switch(t){case l.INT32:return e.int32();case l.STRING:return e.string();case l.BOOL:return e.bool();case l.DOUBLE:return e.double();case l.FLOAT:return e.float();case l.INT64:return N(e.int64(),r);case l.UINT64:return N(e.uint64(),r);case l.FIXED64:return N(e.fixed64(),r);case l.FIXED32:return e.fixed32();case l.BYTES:return e.bytes();case l.UINT32:return e.uint32();case l.SFIXED32:return e.sfixed32();case l.SFIXED64:return N(e.sfixed64(),r);case l.SINT32:return e.sint32();case l.SINT64:return N(e.sint64(),r)}}};var fe=class{constructor(e){this.info=e}prepare(){if(!this.fields){let e=this.info.fields?this.info.fields.concat():[];this.fields=e.sort((t,r)=>t.no-r.no)}}write(e,t,r){this.prepare();for(let s of this.fields){let o,a,u=s.repeat,c=s.localName;if(s.oneof){let f=e[s.oneof];if(f.oneofKind!==c)continue;o=f[c],a=!0}else o=e[c],a=!1;switch(s.kind){case"scalar":case"enum":let f=s.kind=="enum"?l.INT32:s.T;if(u)if(g(Array.isArray(o)),u==X.PACKED)this.packed(t,f,s.no,o);else for(let m of o)this.scalar(t,f,s.no,m,!0);else o===void 0?g(s.opt):this.scalar(t,f,s.no,o,a||s.opt);break;case"message":if(u){g(Array.isArray(o));for(let m of o)this.message(t,r,s.T(),s.no,m)}else this.message(t,r,s.T(),s.no,o);break;case"map":g(typeof o=="object"&&o!==null);for(let[m,p]of Object.entries(o))this.mapEntry(t,r,s,m,p);break}}let i=r.writeUnknownFields;i!==!1&&(i===!0?v.onWrite:i)(this.info.typeName,e,t)}mapEntry(e,t,r,i,s){e.tag(r.no,w.LengthDelimited),e.fork();let o=i;switch(r.K){case l.INT32:case l.FIXED32:case l.UINT32:case l.SFIXED32:case l.SINT32:o=Number.parseInt(i);break;case l.BOOL:g(i=="true"||i=="false"),o=i=="true";break}switch(this.scalar(e,r.K,1,o,!0),r.V.kind){case"scalar":this.scalar(e,r.V.T,2,s,!0);break;case"enum":this.scalar(e,l.INT32,2,s,!0);break;case"message":this.message(e,t,r.V.T(),2,s);break}e.join()}message(e,t,r,i,s){s!==void 0&&(r.internalBinaryWrite(s,e.tag(i,w.LengthDelimited).fork(),t),e.join())}scalar(e,t,r,i,s){let[o,a,u]=this.scalarInfo(t,i);(!u||s)&&(e.tag(r,o),e[a](i))}packed(e,t,r,i){if(!i.length)return;g(t!==l.BYTES&&t!==l.STRING),e.tag(r,w.LengthDelimited),e.fork();let[,s]=this.scalarInfo(t);for(let o=0;o<i.length;o++)e[s](i[o]);e.join()}scalarInfo(e,t){let r=w.Varint,i,s=t===void 0,o=t===0;switch(e){case l.INT32:i="int32";break;case l.STRING:o=s||!t.length,r=w.LengthDelimited,i="string";break;case l.BOOL:o=t===!1,i="bool";break;case l.UINT32:i="uint32";break;case l.DOUBLE:r=w.Bit64,i="double";break;case l.FLOAT:r=w.Bit32,i="float";break;case l.INT64:o=s||b.from(t).isZero(),i="int64";break;case l.UINT64:o=s||F.from(t).isZero(),i="uint64";break;case l.FIXED64:o=s||F.from(t).isZero(),r=w.Bit64,i="fixed64";break;case l.BYTES:o=s||!t.byteLength,r=w.LengthDelimited,i="bytes";break;case l.FIXED32:r=w.Bit32,i="fixed32";break;case l.SFIXED32:r=w.Bit32,i="sfixed32";break;case l.SFIXED64:o=s||b.from(t).isZero(),r=w.Bit64,i="sfixed64";break;case l.SINT32:i="sint32";break;case l.SINT64:o=s||b.from(t).isZero(),i="sint64";break}return[r,i,s||o]}};function Wt(n){let e=n.messagePrototype?Object.create(n.messagePrototype):Object.defineProperty({},oe,{value:n});for(let t of n.fields){let r=t.localName;if(!t.opt)if(t.oneof)e[t.oneof]={oneofKind:void 0};else if(t.repeat)e[r]=[];else switch(t.kind){case"scalar":e[r]=J(t.T,t.L);break;case"enum":e[r]=0;break;case"map":e[r]={};break}}return e}function pe(n,e,t){let r,i=t,s;for(let o of n.fields){let a=o.localName;if(o.oneof){let u=i[o.oneof];if((u==null?void 0:u.oneofKind)==null)continue;if(r=u[a],s=e[o.oneof],s.oneofKind=u.oneofKind,r==null){delete s[a];continue}}else if(r=i[a],s=e,r==null)continue;switch(o.repeat&&(s[a].length=r.length),o.kind){case"scalar":case"enum":if(o.repeat)for(let c=0;c<r.length;c++)s[a][c]=r[c];else s[a]=r;break;case"message":let u=o.T();if(o.repeat)for(let c=0;c<r.length;c++)s[a][c]=u.create(r[c]);else s[a]===void 0?s[a]=u.create(r):u.mergePartial(s[a],r);break;case"map":switch(o.V.kind){case"scalar":case"enum":Object.assign(s[a],r);break;case"message":let c=o.V.T();for(let f of Object.keys(r))s[a][f]=c.create(r[f]);break}break}}}function Ht(n,e,t){if(e===t)return!0;if(!e||!t)return!1;for(let r of n.fields){let i=r.localName,s=r.oneof?e[r.oneof][i]:e[i],o=r.oneof?t[r.oneof][i]:t[i];switch(r.kind){case"enum":case"scalar":let a=r.kind=="enum"?l.INT32:r.T;if(!(r.repeat?$t(a,s,o):jt(a,s,o)))return!1;break;case"map":if(!(r.V.kind=="message"?qt(r.V.T(),me(s),me(o)):$t(r.V.kind=="enum"?l.INT32:r.V.T,me(s),me(o))))return!1;break;case"message":let u=r.T();if(!(r.repeat?qt(u,s,o):u.equals(s,o)))return!1;break}}return!0}var me=Object.values;function jt(n,e,t){if(e===t)return!0;if(n!==l.BYTES)return!1;let r=e,i=t;if(r.length!==i.length)return!1;for(let s=0;s<r.length;s++)if(r[s]!=i[s])return!1;return!0}function $t(n,e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!jt(n,e[r],t[r]))return!1;return!0}function qt(n,e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!n.equals(e[r],t[r]))return!1;return!0}var Xt=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})),Or=Xt[oe]={},T=class{constructor(e,t,r){this.defaultCheckDepth=16,this.typeName=e,this.fields=t.map(vt),this.options=r!=null?r:{},Or.value=this,this.messagePrototype=Object.create(null,Xt),this.refTypeCheck=new ae(this),this.refJsonReader=new ue(this),this.refJsonWriter=new le(this),this.refBinReader=new ce(this),this.refBinWriter=new fe(this)}create(e){let t=Wt(this);return e!==void 0&&pe(this,t,e),t}clone(e){let t=this.create();return pe(this,t,e),t}equals(e,t){return Ht(this,e,t)}is(e,t=this.defaultCheckDepth){return this.refTypeCheck.is(e,t,!1)}isAssignable(e,t=this.defaultCheckDepth){return this.refTypeCheck.is(e,t,!0)}mergePartial(e,t){pe(this,e,t)}fromBinary(e,t){let r=Pt(t);return this.internalBinaryRead(r.readerFactory(e),e.byteLength,r)}fromJson(e,t){return this.internalJsonRead(e,Bt(t))}fromJsonString(e,t){let r=JSON.parse(e);return this.fromJson(r,t)}toJson(e,t){return this.internalJsonWrite(e,Vt(t))}toJsonString(e,t){var r;let i=this.toJson(e,t);return JSON.stringify(i,null,(r=t==null?void 0:t.prettySpaces)!==null&&r!==void 0?r:0)}toBinary(e,t){let r=Ut(t);return this.internalBinaryWrite(e,r.writerFactory(),r).finish()}internalJsonRead(e,t,r){if(e!==null&&typeof e=="object"&&!Array.isArray(e)){let i=r!=null?r:this.create();return this.refJsonReader.read(e,i,t),i}throw new Error(`Unable to parse message ${this.typeName} from JSON ${U(e)}.`)}internalJsonWrite(e,t){return this.refJsonWriter.write(e,t)}internalBinaryWrite(e,t,r){return this.refBinWriter.write(e,t,r),t}internalBinaryRead(e,t,r,i){let s=i!=null?i:this.create();return this.refBinReader.read(e,s,r,t),s}};var Pe=class extends T{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){let e=this.create(),t=Date.now();return e.seconds=b.from(Math.floor(t/1e3)).toBigInt(),e.nanos=t%1e3*1e6,e}toDate(e){return new Date(b.from(e.seconds).toNumber()*1e3+Math.ceil(e.nanos/1e6))}fromDate(e){let t=this.create(),r=e.getTime();return t.seconds=b.from(Math.floor(r/1e3)).toBigInt(),t.nanos=r%1e3*1e6,t}internalJsonWrite(e,t){let r=b.from(e.seconds).toNumber()*1e3;if(r<Date.parse("0001-01-01T00:00:00Z")||r>Date.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(e.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let i="Z";if(e.nanos>0){let s=(e.nanos+1e9).toString().substring(1);s.substring(3)==="000000"?i="."+s.substring(0,3)+"Z":s.substring(6)==="000"?i="."+s.substring(0,6)+"Z":i="."+s+"Z"}return new Date(r).toISOString().replace(".000Z",i)}internalJsonRead(e,t,r){if(typeof e!="string")throw new Error("Unable to parse Timestamp from JSON "+U(e)+".");let i=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!i)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let s=Date.parse(i[1]+"-"+i[2]+"-"+i[3]+"T"+i[4]+":"+i[5]+":"+i[6]+(i[8]?i[8]:"Z"));if(Number.isNaN(s))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(s<Date.parse("0001-01-01T00:00:00Z")||s>Date.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");return r||(r=this.create()),r.seconds=b.from(s/1e3).toBigInt(),r.nanos=0,i[7]&&(r.nanos=parseInt("1"+i[7]+"0".repeat(9-i[7].length))-1e9),r}},De=new Pe;var Jt=(r=>(r[r.UNKNOWN=0]="UNKNOWN",r[r.PATH=1]="PATH",r[r.CMD=2]="CMD",r))(Jt||{}),Gt=(i=>(i[i.UNSPECIFIED=0]="UNSPECIFIED",i[i.CANCELLED=1]="CANCELLED",i[i.CANCELLING=2]="CANCELLING",i[i.NOT_CANCELLABLE=3]="NOT_CANCELLABLE",i))(Gt||{}),Ue=class extends T{constructor(){super("arrow.flight.protocol.HandshakeRequest",[{no:1,name:"protocol_version",kind:"scalar",T:4,L:0},{no:2,name:"payload",kind:"scalar",T:12}])}},xr=new Ue,Ce=class extends T{constructor(){super("arrow.flight.protocol.HandshakeResponse",[{no:1,name:"protocol_version",kind:"scalar",T:4,L:0},{no:2,name:"payload",kind:"scalar",T:12}])}},Ir=new Ce,Le=class extends T{constructor(){super("arrow.flight.protocol.BasicAuth",[{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"password",kind:"scalar",T:9}])}},ps=new Le,Be=class extends T{constructor(){super("arrow.flight.protocol.Empty",[])}},Nr=new Be,Ve=class extends T{constructor(){super("arrow.flight.protocol.ActionType",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"description",kind:"scalar",T:9}])}},_r=new Ve,ve=class extends T{constructor(){super("arrow.flight.protocol.Criteria",[{no:1,name:"expression",kind:"scalar",T:12}])}},Er=new ve,Me=class extends T{constructor(){super("arrow.flight.protocol.Action",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"body",kind:"scalar",T:12}])}},kr=new Me,We=class extends T{constructor(){super("arrow.flight.protocol.CancelFlightInfoRequest",[{no:1,name:"info",kind:"message",T:()=>de}])}},ms=new We,$e=class extends T{constructor(){super("arrow.flight.protocol.RenewFlightEndpointRequest",[{no:1,name:"endpoint",kind:"message",T:()=>Kt}])}},hs=new $e,qe=class extends T{constructor(){super("arrow.flight.protocol.Result",[{no:1,name:"body",kind:"scalar",T:12}])}},Sr=new qe,He=class extends T{constructor(){super("arrow.flight.protocol.CancelFlightInfoResult",[{no:1,name:"status",kind:"enum",T:()=>["arrow.flight.protocol.CancelStatus",Gt,"CANCEL_STATUS_"]}])}},ds=new He,je=class extends T{constructor(){super("arrow.flight.protocol.SchemaResult",[{no:1,name:"schema",kind:"scalar",T:12}])}},Rr=new je,Xe=class extends T{constructor(){super("arrow.flight.protocol.FlightDescriptor",[{no:1,name:"type",kind:"enum",T:()=>["arrow.flight.protocol.FlightDescriptor.DescriptorType",Jt]},{no:2,name:"cmd",kind:"scalar",T:12},{no:3,name:"path",kind:"scalar",repeat:2,T:9}])}},W=new Xe,Je=class extends T{constructor(){super("arrow.flight.protocol.FlightInfo",[{no:1,name:"schema",kind:"scalar",T:12},{no:2,name:"flight_descriptor",kind:"message",T:()=>W},{no:3,name:"endpoint",kind:"message",repeat:1,T:()=>Kt},{no:4,name:"total_records",kind:"scalar",T:3,L:0},{no:5,name:"total_bytes",kind:"scalar",T:3,L:0},{no:6,name:"ordered",kind:"scalar",T:8},{no:7,name:"app_metadata",kind:"scalar",T:12}])}},de=new Je,Ge=class extends T{constructor(){super("arrow.flight.protocol.PollInfo",[{no:1,name:"info",kind:"message",T:()=>de},{no:2,name:"flight_descriptor",kind:"message",T:()=>W},{no:3,name:"progress",kind:"scalar",opt:!0,T:1},{no:4,name:"expiration_time",kind:"message",T:()=>De}])}},Ar=new Ge,Ke=class extends T{constructor(){super("arrow.flight.protocol.FlightEndpoint",[{no:1,name:"ticket",kind:"message",T:()=>ge},{no:2,name:"location",kind:"message",repeat:1,T:()=>Pr},{no:3,name:"expiration_time",kind:"message",T:()=>De},{no:4,name:"app_metadata",kind:"scalar",T:12}])}},Kt=new Ke,Qe=class extends T{constructor(){super("arrow.flight.protocol.Location",[{no:1,name:"uri",kind:"scalar",T:9}])}},Pr=new Qe,Ze=class extends T{constructor(){super("arrow.flight.protocol.Ticket",[{no:1,name:"ticket",kind:"scalar",T:12}])}},ge=new Ze,Ye=class extends T{constructor(){super("arrow.flight.protocol.FlightData",[{no:1,name:"flight_descriptor",kind:"message",T:()=>W},{no:2,name:"data_header",kind:"scalar",T:12},{no:3,name:"app_metadata",kind:"scalar",T:12},{no:1e3,name:"data_body",kind:"scalar",T:12}])}},he=new Ye,ze=class extends T{constructor(){super("arrow.flight.protocol.PutResult",[{no:1,name:"app_metadata",kind:"scalar",T:12}])}},Dr=new ze,be=new Fr("arrow.flight.protocol.FlightService",[{name:"Handshake",serverStreaming:!0,clientStreaming:!0,options:{},I:xr,O:Ir},{name:"ListFlights",serverStreaming:!0,options:{},I:Er,O:de},{name:"GetFlightInfo",options:{},I:W,O:de},{name:"PollFlightInfo",options:{},I:W,O:Ar},{name:"GetSchema",options:{},I:W,O:Rr},{name:"DoGet",serverStreaming:!0,options:{},I:ge,O:he},{name:"DoPut",serverStreaming:!0,clientStreaming:!0,options:{},I:he,O:Dr},{name:"DoExchange",serverStreaming:!0,clientStreaming:!0,options:{},I:he,O:he},{name:"DoAction",serverStreaming:!0,options:{},I:kr,O:Sr},{name:"ListActions",serverStreaming:!0,options:{},I:Nr,O:_r}]);import{stackIntercept as E}from"@protobuf-ts/runtime-rpc";var ye=class{constructor(e){this._transport=e;d(this,"typeName",be.typeName);d(this,"methods",be.methods);d(this,"options",be.options)}_transport;handshake(e){let t=this.methods[0],r=this._transport.mergeOptions(e);return E("duplex",this._transport,t,r)}listFlights(e,t){let r=this.methods[1],i=this._transport.mergeOptions(t);return E("serverStreaming",this._transport,r,i,e)}getFlightInfo(e,t){let r=this.methods[2],i=this._transport.mergeOptions(t);return E("unary",this._transport,r,i,e)}pollFlightInfo(e,t){let r=this.methods[3],i=this._transport.mergeOptions(t);return E("unary",this._transport,r,i,e)}getSchema(e,t){let r=this.methods[4],i=this._transport.mergeOptions(t);return E("unary",this._transport,r,i,e)}doGet(e,t){let r=this.methods[5],i=this._transport.mergeOptions(t);return E("serverStreaming",this._transport,r,i,e)}doPut(e){let t=this.methods[6],r=this._transport.mergeOptions(e);return E("duplex",this._transport,t,r)}doExchange(e){let t=this.methods[7],r=this._transport.mergeOptions(e);return E("duplex",this._transport,t,r)}doAction(e,t){let r=this.methods[8],i=this._transport.mergeOptions(t);return E("serverStreaming",this._transport,r,i,e)}listActions(e,t){let r=this.methods[9],i=this._transport.mergeOptions(t);return E("serverStreaming",this._transport,r,i,e)}};var Qt=/\$(\w+)/g;function Zt(n){return!!n.match(Qt)}function Yt(n,e){let t=n.match(Qt);if(t)for(let r of t)e[r.trim().replace("$","")]||V(new Error(`No parameter matching ${r} provided in the query params map`));return!0}var Ur="2.2.0",zt=`influxdb3-js/${Ur}`;import{Type as Cr}from"apache-arrow/enum";function et(n,e){if(e==null)return null;let t=n.metadata.get("iox::column::type");if(!t||n.typeId===Cr.Timestamp)return e;let[,,r,i]=t.split("::");if(r==="field")switch(i){case"integer":return q(e)?parseInt(e):(console.warn(`Value ${e} is not an integer`),e);case"uinteger":return Ft(e)?parseInt(e):(console.warn(`Value ${e} is not an unsigned integer`),e);case"float":return q(e)?parseFloat(e):(console.warn(`Value ${e} is not a float`),e);case"boolean":return typeof e=="boolean"||console.warn(`Value ${e} is not a boolean`),e;case"string":return typeof e=="string"?String(e):(console.warn(`Value ${e} is not a string`),e);default:return e}return e}var G=class{constructor(e){this._options=e;d(this,"_closed",!1);d(this,"_flightClient");d(this,"_transport");d(this,"_defaultHeaders");let{host:t,queryTimeout:r,grpcOptions:i}=this._options;this._defaultHeaders=this._options.headers;let s={};i!==void 0&&(s=i),this._transport=D.queryTransport({host:t,timeout:r,clientOptions:{...s}}),this._flightClient=new ye(this._transport)}_options;prepareTicket(e,t,r){let i={database:e,sql_query:t,query_type:r.type};if(r.params){let s={};for(let o of Object.keys(r.params))r.params[o]&&(s[o]=r.params[o]);i.params=s}return ge.create({ticket:new TextEncoder().encode(JSON.stringify(i))})}prepareMetadata(e){let t={"User-Agent":zt,...this._defaultHeaders,...e},r=this._options.token;return r&&(t.authorization=`Bearer ${r}`),t}async*_queryRawBatches(e,t,r){var m;if(r.params&&Zt(e)&&Yt(e,r.params),this._closed)throw new Error("queryApi: already closed!");let i=this._flightClient,s=this.prepareTicket(t,e,r),a={meta:this.prepareMetadata(r.headers)};a.timeout=(m=r.timeout)!=null?m:this._options.queryTimeout;let u=i.doGet(s,a),c=(async function*(){for await(let p of u.responses)yield Ot(p.dataHeader.length),yield p.dataHeader,yield p.dataBody})();yield*await Lr.from(c)}async*query(e,t,r){let i=this._queryRawBatches(e,t,r);for await(let s of i)for(let o of s){let a={};for(let u of s.schema.fields){let c=o[u.name];a[u.name]=et(u,c)}yield a}}async*queryPoints(e,t,r){var s;let i=this._queryRawBatches(e,t,r);for await(let o of i)for(let a=0;a<o.numRows;a++){let u=new P;for(let c=0;c<o.numCols;c++){let f=o.schema.fields[c],m=f.name,p=(s=o.getChildAt(c))==null?void 0:s.get(a),O=f.typeId,h=f.metadata.get("iox::column::type");if(p==null)continue;if((m==="measurement"||m=="iox::measurement")&&typeof p=="string"){u.setMeasurement(p);continue}if(!h){m==="time"&&O===Br.Timestamp?u.setTimestamp(p):u.setField(m,p);continue}let[,,x,R]=h.split("::");if(x==="field"){if(R&&p!==void 0&&p!==null){let $=et(f,p);u.setField(m,$,R)}}else x==="tag"?u.setTag(m,p):x==="timestamp"&&u.setTimestamp(p)}yield u}}async close(){var e,t;this._closed=!0,(t=(e=this._transport).close)==null||t.call(e)}};var tt=`Please specify the 'database' as a method parameter or use default configuration at 'ClientOptions.database'
10
- `,Te=class{constructor(...e){d(this,"_options");d(this,"_writeApi");d(this,"_queryApi");d(this,"_transport");d(this,"_mergeWriteOptions",e=>{var i;let t={...(i=this._options.writeOptions)==null?void 0:i.headers,...e==null?void 0:e.headers},r={...this._options.writeOptions,...e};return r.headers=t,r});d(this,"_mergeQueryOptions",e=>{var s,o;let t={...(s=this._options.queryOptions)==null?void 0:s.headers,...e==null?void 0:e.headers},r={...(o=this._options.queryOptions)==null?void 0:o.params,...e==null?void 0:e.params},i={...this._options.queryOptions,...e};return i.headers=t,i.params=r,i});var s,o,a,u,c,f,m,p;let t;switch(e.length){case 0:{t=at();break}case 1:{if(e[0]==null)throw new A("No configuration specified!");typeof e[0]=="string"?t=ot(e[0]):t=e[0];break}default:throw new A("Multiple arguments specified!")}this._options={...it,...t},this._options.grpcOptions?this._options.queryOptions={...t.queryOptions,grpcOptions:{...this._options.grpcOptions}}:(s=t.queryOptions)!=null&&s.grpcOptions&&(this._options.grpcOptions=(o=t.queryOptions)==null?void 0:o.grpcOptions);let r=this._options.host;if(typeof r!="string")throw new A("No host specified!");if(r.endsWith("/")&&(this._options.host=r.substring(0,r.length-1)),typeof this._options.token!="string")throw new A("No token specified!");this._queryApi=new G({...this._options,queryTimeout:(c=(a=this._options.queryOptions)==null?void 0:a.timeout)!=null?c:(u=this._options)==null?void 0:u.queryTimeout});let i=(p=(m=this._options.timeout)!=null?m:(f=this._options.writeOptions)==null?void 0:f.timeout)!=null?p:this._options.writeTimeout;this._transport=D.writeTransport({...this._options,writeTimeout:i}),this._writeApi=new j({transport:this._transport,...this._options})}async write(e,t,r,i){var o;let s=this._mergeWriteOptions(i);await this._writeApi.doWrite(xt(e,s==null?void 0:s.defaultTags,s==null?void 0:s.tagOrder),(o=t!=null?t:this._options.database)!=null?o:V(new Error(tt)),r,s)}query(e,t,r=(i=>(i=this._options.queryOptions)!=null?i:we)()){var o;let s=this._mergeQueryOptions(r);return this._queryApi.query(e,(o=t!=null?t:this._options.database)!=null?o:V(new Error(tt)),s)}queryPoints(e,t,r=(i=>(i=this._options.queryOptions)!=null?i:we)()){var o;let s=this._mergeQueryOptions(r);return this._queryApi.queryPoints(e,(o=t!=null?t:this._options.database)!=null?o:V(new Error(tt)),s)}async getServerVersion(){let e;try{let t=await this._transport.request("/ping",null,{method:"GET"},(r,i)=>{var s;e=(s=r["X-Influxdb-Version"])!=null?s:r["x-influxdb-version"]});t&&!e&&(e=t.version)}catch(t){return Promise.reject(t)}return Promise.resolve(e)}async close(){await this._writeApi.close(),await this._queryApi.close()}};export{K as AbortError,it as DEFAULT_ConnectionOptions,we as DEFAULT_QueryOptions,st as DEFAULT_WriteOptions,Ie as GetFieldTypeMissmatchError,_ as HttpError,A as IllegalArgumentError,Te as InfluxDBClient,L as Log,Z as Point,P as PointValues,rt as RequestTimedOutError,ur as collectAll,nr as consoleLogger,yt as convertTime,bt as convertTimeToNanos,nt as createTextDecoderCombiner,or as currentTime,ar as dateToProtocolTimestamp,B as escape,ot as fromConnectionString,at as fromEnv,q as isNumber,ft as parsePrecision,lt as precisionToV2ApiString,ct as precisionToV3ApiString,Jr as setLogger,sr as useProcessHrtime,xt as writableDataToLineProtocol};
11
+ ${JSON.stringify(t)}`);let{interceptors:n}=t!=null?t:{};return new xr({baseUrl:r,timeout:e,interceptors:n})};var Or={writeTransport:r=>new X(r),queryTransport:Pt},U=Or;var J=class{constructor(e){this._options=e;d(this,"_closed",!1);d(this,"_transport");var t;this._transport=(t=this._options.transport)!=null?t:U.writeTransport(this._options),this.doWrite=this.doWrite.bind(this)}_options;_createWritePath(e,t,n){let i=t.precision,s,o=[];return n&&o.push(`org=${encodeURIComponent(n)}`),t.useV2Api?(s="/api/v2/write",o.push(`bucket=${encodeURIComponent(e)}`),o.push(`precision=${gt(i)}`)):(s="/api/v3/write_lp",o.push(`db=${encodeURIComponent(e)}`),o.push(`precision=${bt(i)}`),t.noSync&&o.push("no_sync=true"),t.acceptPartial===!1&&o.push("accept_partial=false")),`${s}?${o.join("&")}`}doWrite(e,t,n,i){if(this._closed)return Promise.reject(new Error("writeApi: already closed!"));let o={...mt,...i};if(o.useV2Api&&o.noSync)return Promise.reject(new S("invalid write options: noSync requires useV2Api=false"));if(e.length<=0||e.length===1&&e[0]==="")return Promise.resolve();let a,u,c=new Promise((h,O)=>{a=h,u=O}),f,m,p={responseStarted(h,O){f=O,m=h},error(h){if(h instanceof _&&h.json&&typeof h.json.error=="string"&&h.json.error.includes("hinted handoff queue not empty")){B.warn(`Write to InfluxDB returns: ${h.json.error}`),f=204,p.complete();return}if(h instanceof _){let O=f!=null?f:h.statusCode;O===405&&o.useV2Api&&(h.message="Server doesn't support the V2 API endpoint (/api/v2/write). Set useV2Api=false to use the V3 API endpoint."),O===405&&!o.useV2Api&&(h.message="Server doesn't support the V3 API endpoint (/api/v3/write_lp). Set useV2Api=true to use the V2 API endpoint.");let E=Z.fromHttpError(h);E&&(h=E)}B.error("Write to InfluxDB failed.",h),u(h)},complete(){if(f==null||f>=200&&f<300)a();else{let h=`2xx HTTP response status code expected, but ${f} returned`,O=new _(f,h,void 0,"0",m);O.message=h,p.error(O)}}},F={method:"POST",headers:{"content-type":"text/plain; charset=utf-8",...i==null?void 0:i.headers},gzipThreshold:o.gzipThreshold,timeout:o.timeout};return this._transport.send(this._createWritePath(t,o,n),e.join(`
12
+ `),F,p),c}async close(){this._closed=!0}};import{RecordBatchReader as Hr,Type as Xr}from"apache-arrow";import{ServiceType as Pr}from"@protobuf-ts/runtime-rpc";function L(r){let e=typeof r;if(e=="object"){if(Array.isArray(r))return"array";if(r===null)return"null"}return e}function Ae(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}var P="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),re=[];for(let r=0;r<P.length;r++)re[P[r].charCodeAt(0)]=r;re[45]=P.indexOf("+");re[95]=P.indexOf("/");function Rt(r){let e=r.length*3/4;r[r.length-2]=="="?e-=2:r[r.length-1]=="="&&(e-=1);let t=new Uint8Array(e),n=0,i=0,s,o=0;for(let a=0;a<r.length;a++){if(s=re[r.charCodeAt(a)],s===void 0)switch(r[a]){case"=":i=0;case`
13
+ `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:o=s,i=1;break;case 1:t[n++]=o<<2|(s&48)>>4,o=s,i=2;break;case 2:t[n++]=(o&15)<<4|(s&60)>>2,o=s,i=3;break;case 3:t[n++]=(o&3)<<6|s,i=0;break}}if(i==1)throw Error("invalid base64 string.");return t.subarray(0,n)}function Dt(r){let e="",t=0,n,i=0;for(let s=0;s<r.length;s++)switch(n=r[s],t){case 0:e+=P[n>>2],i=(n&3)<<4,t=1;break;case 1:e+=P[i|n>>4],i=(n&15)<<2,t=2;break;case 2:e+=P[i|n>>6],e+=P[n&63],t=0;break}return t&&(e+=P[i],e+="=",t==1&&(e+="=")),e}var W;(function(r){r.symbol=Symbol.for("protobuf-ts/unknown"),r.onRead=(t,n,i,s,o)=>{(e(n)?n[r.symbol]:n[r.symbol]=[]).push({no:i,wireType:s,data:o})},r.onWrite=(t,n,i)=>{for(let{no:s,wireType:o,data:a}of r.list(n))i.tag(s,o).raw(a)},r.list=(t,n)=>{if(e(t)){let i=t[r.symbol];return n?i.filter(s=>s.no==n):i}return[]},r.last=(t,n)=>r.list(t,n).slice(-1)[0];let e=t=>t&&Array.isArray(t[r.symbol])})(W||(W={}));var T;(function(r){r[r.Varint=0]="Varint",r[r.Bit64=1]="Bit64",r[r.LengthDelimited=2]="LengthDelimited",r[r.StartGroup=3]="StartGroup",r[r.EndGroup=4]="EndGroup",r[r.Bit32=5]="Bit32"})(T||(T={}));function Ut(){let r=0,e=0;for(let n=0;n<28;n+=7){let i=this.buf[this.pos++];if(r|=(i&127)<<n,(i&128)==0)return this.assertBounds(),[r,e]}let t=this.buf[this.pos++];if(r|=(t&15)<<28,e=(t&112)>>4,(t&128)==0)return this.assertBounds(),[r,e];for(let n=3;n<=31;n+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<n,(i&128)==0)return this.assertBounds(),[r,e]}throw new Error("invalid varint")}function ie(r,e,t){for(let s=0;s<28;s=s+7){let o=r>>>s,a=!(!(o>>>7)&&e==0),u=(a?o|128:o)&255;if(t.push(u),!a)return}let n=r>>>28&15|(e&7)<<4,i=e>>3!=0;if(t.push((i?n|128:n)&255),!!i){for(let s=3;s<31;s=s+7){let o=e>>>s,a=!!(o>>>7),u=(a?o|128:o)&255;if(t.push(u),!a)return}t.push(e>>>31&1)}}var ne=65536*65536;function Se(r){let e=r[0]=="-";e&&(r=r.slice(1));let t=1e6,n=0,i=0;function s(o,a){let u=Number(r.slice(o,a));i*=t,n=n*t+u,n>=ne&&(i=i+(n/ne|0),n=n%ne)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),[e,n,i]}function se(r,e){if(e>>>0<=2097151)return""+(ne*e+(r>>>0));let t=r&16777215,n=(r>>>24|e<<8)>>>0&16777215,i=e>>16&65535,s=t+n*6777216+i*6710656,o=n+i*8147497,a=i*2,u=1e7;s>=u&&(o+=Math.floor(s/u),s%=u),o>=u&&(a+=Math.floor(o/u),o%=u);function c(f,m){let p=f?String(f):"";return m?"0000000".slice(p.length)+p:p}return c(a,0)+c(o,a)+c(s,1)}function Pe(r,e){if(r>=0){for(;r>127;)e.push(r&127|128),r=r>>>7;e.push(r)}else{for(let t=0;t<9;t++)e.push(r&127|128),r=r>>7;e.push(1)}}function Lt(){let r=this.buf[this.pos++],e=r&127;if((r&128)==0)return this.assertBounds(),e;if(r=this.buf[this.pos++],e|=(r&127)<<7,(r&128)==0)return this.assertBounds(),e;if(r=this.buf[this.pos++],e|=(r&127)<<14,(r&128)==0)return this.assertBounds(),e;if(r=this.buf[this.pos++],e|=(r&127)<<21,(r&128)==0)return this.assertBounds(),e;r=this.buf[this.pos++],e|=(r&15)<<28;for(let t=5;(r&128)!==0&&t<10;t++)r=this.buf[this.pos++];if((r&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}var y;function Ir(){let r=new DataView(new ArrayBuffer(8));y=globalThis.BigInt!==void 0&&typeof r.getBigInt64=="function"&&typeof r.getBigUint64=="function"&&typeof r.setBigInt64=="function"&&typeof r.setBigUint64=="function"?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:r}:void 0}Ir();function Ct(r){if(!r)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}var Vt=/^-?[0-9]+$/,ae=4294967296,oe=2147483648,ue=class{constructor(e,t){this.lo=e|0,this.hi=t|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let e=this.hi*ae+(this.lo>>>0);if(!Number.isSafeInteger(e))throw new Error("cannot convert to safe number");return e}},x=class r extends ue{static from(e){if(y)switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=="")throw new Error("string is no integer");e=y.C(e);case"number":if(e===0)return this.ZERO;e=y.C(e);case"bigint":if(!e)return this.ZERO;if(e<y.UMIN)throw new Error("signed value for ulong");if(e>y.UMAX)throw new Error("ulong too large");return y.V.setBigUint64(0,e,!0),new r(y.V.getInt32(0,!0),y.V.getInt32(4,!0))}else switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=e.trim(),!Vt.test(e))throw new Error("string is no integer");let[t,n,i]=Se(e);if(t)throw new Error("signed value for ulong");return new r(n,i);case"number":if(e==0)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");if(e<0)throw new Error("signed value for ulong");return new r(e,e/ae)}throw new Error("unknown value "+typeof e)}toString(){return y?this.toBigInt().toString():se(this.lo,this.hi)}toBigInt(){return Ct(y),y.V.setInt32(0,this.lo,!0),y.V.setInt32(4,this.hi,!0),y.V.getBigUint64(0,!0)}};x.ZERO=new x(0,0);var b=class r extends ue{static from(e){if(y)switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=="")throw new Error("string is no integer");e=y.C(e);case"number":if(e===0)return this.ZERO;e=y.C(e);case"bigint":if(!e)return this.ZERO;if(e<y.MIN)throw new Error("signed long too small");if(e>y.MAX)throw new Error("signed long too large");return y.V.setBigInt64(0,e,!0),new r(y.V.getInt32(0,!0),y.V.getInt32(4,!0))}else switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=e.trim(),!Vt.test(e))throw new Error("string is no integer");let[t,n,i]=Se(e);if(t){if(i>oe||i==oe&&n!=0)throw new Error("signed long too small")}else if(i>=oe)throw new Error("signed long too large");let s=new r(n,i);return t?s.negate():s;case"number":if(e==0)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");return e>0?new r(e,e/ae):new r(-e,-e/ae).negate()}throw new Error("unknown value "+typeof e)}isNegative(){return(this.hi&oe)!==0}negate(){let e=~this.hi,t=this.lo;return t?t=~t+1:e+=1,new r(t,e)}toString(){if(y)return this.toBigInt().toString();if(this.isNegative()){let e=this.negate();return"-"+se(e.lo,e.hi)}return se(this.lo,this.hi)}toBigInt(){return Ct(y),y.V.setInt32(0,this.lo,!0),y.V.setInt32(4,this.hi,!0),y.V.getBigInt64(0,!0)}};b.ZERO=new b(0,0);var Bt={readUnknownField:!0,readerFactory:r=>new Re(r)};function vt(r){return r?Object.assign(Object.assign({},Bt),r):Bt}var Re=class{constructor(e,t){this.varint64=Ut,this.uint32=Lt,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t!=null?t:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let e=this.uint32(),t=e>>>3,n=e&7;if(t<=0||n<0||n>5)throw new Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}skip(e){let t=this.pos;switch(e){case T.Varint:for(;this.buf[this.pos++]&128;);break;case T.Bit64:this.pos+=4;case T.Bit32:this.pos+=4;break;case T.LengthDelimited:let n=this.uint32();this.pos+=n;break;case T.StartGroup:let i;for(;(i=this.tag()[1])!==T.EndGroup;)this.skip(i);break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(t,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return new b(...this.varint64())}uint64(){return new x(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,new b(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new x(this.sfixed32(),this.sfixed32())}sfixed64(){return new b(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.textDecoder.decode(this.bytes())}};function g(r,e){if(!r)throw new Error(e)}var Nr=34028234663852886e22,Er=-34028234663852886e22,_r=4294967295,kr=2147483647,Ar=-2147483648;function R(r){if(typeof r!="number")throw new Error("invalid int 32: "+typeof r);if(!Number.isInteger(r)||r>kr||r<Ar)throw new Error("invalid int 32: "+r)}function C(r){if(typeof r!="number")throw new Error("invalid uint 32: "+typeof r);if(!Number.isInteger(r)||r>_r||r<0)throw new Error("invalid uint 32: "+r)}function $(r){if(typeof r!="number")throw new Error("invalid float 32: "+typeof r);if(Number.isFinite(r)&&(r>Nr||r<Er))throw new Error("invalid float 32: "+r)}var Mt={writeUnknownFields:!0,writerFactory:()=>new De};function Wt(r){return r?Object.assign(Object.assign({},Mt),r):Mt}var De=class{constructor(e){this.stack=[],this.textEncoder=e!=null?e:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let i=0;i<this.chunks.length;i++)e+=this.chunks[i].length;let t=new Uint8Array(e),n=0;for(let i=0;i<this.chunks.length;i++)t.set(this.chunks[i],n),n+=this.chunks[i].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(C(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return R(e),Pe(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){$(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){C(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){R(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return R(e),e=(e<<1^e>>31)>>>0,Pe(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),i=b.from(e);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),i=x.from(e);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(t)}int64(e){let t=b.from(e);return ie(t.lo,t.hi,this.buf),this}sint64(e){let t=b.from(e),n=t.hi>>31,i=t.lo<<1^n,s=(t.hi<<1|t.lo>>>31)^n;return ie(i,s,this.buf),this}uint64(e){let t=x.from(e);return ie(t.lo,t.hi,this.buf),this}};var $t={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},qt={ignoreUnknownFields:!1};function jt(r){return r?Object.assign(Object.assign({},qt),r):qt}function Ht(r){return r?Object.assign(Object.assign({},$t),r):$t}var le=Symbol.for("protobuf-ts/message-type");function Ue(r){let e=!1,t=[];for(let n=0;n<r.length;n++){let i=r.charAt(n);i=="_"?e=!0:/\d/.test(i)?(t.push(i),e=!0):e?(t.push(i.toUpperCase()),e=!1):n==0?t.push(i.toLowerCase()):t.push(i)}return t.join("")}var l;(function(r){r[r.DOUBLE=1]="DOUBLE",r[r.FLOAT=2]="FLOAT",r[r.INT64=3]="INT64",r[r.UINT64=4]="UINT64",r[r.INT32=5]="INT32",r[r.FIXED64=6]="FIXED64",r[r.FIXED32=7]="FIXED32",r[r.BOOL=8]="BOOL",r[r.STRING=9]="STRING",r[r.BYTES=12]="BYTES",r[r.UINT32=13]="UINT32",r[r.SFIXED32=15]="SFIXED32",r[r.SFIXED64=16]="SFIXED64",r[r.SINT32=17]="SINT32",r[r.SINT64=18]="SINT64"})(l||(l={}));var I;(function(r){r[r.BIGINT=0]="BIGINT",r[r.STRING=1]="STRING",r[r.NUMBER=2]="NUMBER"})(I||(I={}));var G;(function(r){r[r.NO=0]="NO",r[r.PACKED=1]="PACKED",r[r.UNPACKED=2]="UNPACKED"})(G||(G={}));function Xt(r){var e,t,n,i;return r.localName=(e=r.localName)!==null&&e!==void 0?e:Ue(r.name),r.jsonName=(t=r.jsonName)!==null&&t!==void 0?t:Ue(r.name),r.repeat=(n=r.repeat)!==null&&n!==void 0?n:G.NO,r.opt=(i=r.opt)!==null&&i!==void 0?i:r.repeat||r.oneof?!1:r.kind=="message",r}function Jt(r){if(typeof r!="object"||r===null||!r.hasOwnProperty("oneofKind"))return!1;switch(typeof r.oneofKind){case"string":return r[r.oneofKind]===void 0?!1:Object.keys(r).length==2;case"undefined":return Object.keys(r).length==1;default:return!1}}var ce=class{constructor(e){var t;this.fields=(t=e.fields)!==null&&t!==void 0?t:[]}prepare(){if(this.data)return;let e=[],t=[],n=[];for(let i of this.fields)if(i.oneof)n.includes(i.oneof)||(n.push(i.oneof),e.push(i.oneof),t.push(i.oneof));else switch(t.push(i.localName),i.kind){case"scalar":case"enum":(!i.opt||i.repeat)&&e.push(i.localName);break;case"message":i.repeat&&e.push(i.localName);break;case"map":e.push(i.localName);break}this.data={req:e,known:t,oneofs:Object.values(n)}}is(e,t,n=!1){if(t<0)return!0;if(e==null||typeof e!="object")return!1;this.prepare();let i=Object.keys(e),s=this.data;if(i.length<s.req.length||s.req.some(o=>!i.includes(o))||!n&&i.some(o=>!s.known.includes(o)))return!1;if(t<1)return!0;for(let o of s.oneofs){let a=e[o];if(!Jt(a))return!1;if(a.oneofKind===void 0)continue;let u=this.fields.find(c=>c.localName===a.oneofKind);if(!u||!this.field(a[a.oneofKind],u,n,t))return!1}for(let o of this.fields)if(o.oneof===void 0&&!this.field(e[o.localName],o,n,t))return!1;return!0}field(e,t,n,i){let s=t.repeat;switch(t.kind){case"scalar":return e===void 0?t.opt:s?this.scalars(e,t.T,i,t.L):this.scalar(e,t.T,t.L);case"enum":return e===void 0?t.opt:s?this.scalars(e,l.INT32,i):this.scalar(e,l.INT32);case"message":return e===void 0?!0:s?this.messages(e,t.T(),n,i):this.message(e,t.T(),n,i);case"map":if(typeof e!="object"||e===null)return!1;if(i<2)return!0;if(!this.mapKeys(e,t.K,i))return!1;switch(t.V.kind){case"scalar":return this.scalars(Object.values(e),t.V.T,i,t.V.L);case"enum":return this.scalars(Object.values(e),l.INT32,i);case"message":return this.messages(Object.values(e),t.V.T(),n,i)}break}return!0}message(e,t,n,i){return n?t.isAssignable(e,i):t.is(e,i)}messages(e,t,n,i){if(!Array.isArray(e))return!1;if(i<2)return!0;if(n){for(let s=0;s<e.length&&s<i;s++)if(!t.isAssignable(e[s],i-1))return!1}else for(let s=0;s<e.length&&s<i;s++)if(!t.is(e[s],i-1))return!1;return!0}scalar(e,t,n){let i=typeof e;switch(t){case l.UINT64:case l.FIXED64:case l.INT64:case l.SFIXED64:case l.SINT64:switch(n){case I.BIGINT:return i=="bigint";case I.NUMBER:return i=="number"&&!isNaN(e);default:return i=="string"}case l.BOOL:return i=="boolean";case l.STRING:return i=="string";case l.BYTES:return e instanceof Uint8Array;case l.DOUBLE:case l.FLOAT:return i=="number"&&!isNaN(e);default:return i=="number"&&Number.isInteger(e)}}scalars(e,t,n,i){if(!Array.isArray(e))return!1;if(n<2)return!0;if(Array.isArray(e)){for(let s=0;s<e.length&&s<n;s++)if(!this.scalar(e[s],t,i))return!1}return!0}mapKeys(e,t,n){let i=Object.keys(e);switch(t){case l.INT32:case l.FIXED32:case l.SFIXED32:case l.SINT32:case l.UINT32:return this.scalars(i.slice(0,n).map(s=>parseInt(s)),t,n);case l.BOOL:return this.scalars(i.slice(0,n).map(s=>s=="true"?!0:s=="false"?!1:s),t,n);default:return this.scalars(i,t,n,I.STRING)}}};function N(r,e){switch(e){case I.BIGINT:return r.toBigInt();case I.NUMBER:return r.toNumber();default:return r.toString()}}var fe=class{constructor(e){this.info=e}prepare(){var e;if(this.fMap===void 0){this.fMap={};let t=(e=this.info.fields)!==null&&e!==void 0?e:[];for(let n of t)this.fMap[n.name]=n,this.fMap[n.jsonName]=n,this.fMap[n.localName]=n}}assert(e,t,n){if(!e){let i=L(n);throw(i=="number"||i=="boolean")&&(i=n.toString()),new Error(`Cannot parse JSON ${i} for ${this.info.typeName}#${t}`)}}read(e,t,n){this.prepare();let i=[];for(let[s,o]of Object.entries(e)){let a=this.fMap[s];if(!a){if(!n.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${s}`);continue}let u=a.localName,c;if(a.oneof){if(o===null&&(a.kind!=="enum"||a.T()[0]!=="google.protobuf.NullValue"))continue;if(i.includes(a.oneof))throw new Error(`Multiple members of the oneof group "${a.oneof}" of ${this.info.typeName} are present in JSON.`);i.push(a.oneof),c=t[a.oneof]={oneofKind:u}}else c=t;if(a.kind=="map"){if(o===null)continue;this.assert(Ae(o),a.name,o);let f=c[u];for(let[m,p]of Object.entries(o)){this.assert(p!==null,a.name+" map value",null);let F;switch(a.V.kind){case"message":F=a.V.T().internalJsonRead(p,n);break;case"enum":if(F=this.enum(a.V.T(),p,a.name,n.ignoreUnknownFields),F===!1)continue;break;case"scalar":F=this.scalar(p,a.V.T,a.V.L,a.name);break}this.assert(F!==void 0,a.name+" map value",p);let h=m;a.K==l.BOOL&&(h=h=="true"?!0:h=="false"?!1:h),h=this.scalar(h,a.K,I.STRING,a.name).toString(),f[h]=F}}else if(a.repeat){if(o===null)continue;this.assert(Array.isArray(o),a.name,o);let f=c[u];for(let m of o){this.assert(m!==null,a.name,null);let p;switch(a.kind){case"message":p=a.T().internalJsonRead(m,n);break;case"enum":if(p=this.enum(a.T(),m,a.name,n.ignoreUnknownFields),p===!1)continue;break;case"scalar":p=this.scalar(m,a.T,a.L,a.name);break}this.assert(p!==void 0,a.name,o),f.push(p)}}else switch(a.kind){case"message":if(o===null&&a.T().typeName!="google.protobuf.Value"){this.assert(a.oneof===void 0,a.name+" (oneof member)",null);continue}c[u]=a.T().internalJsonRead(o,n,c[u]);break;case"enum":if(o===null)continue;let f=this.enum(a.T(),o,a.name,n.ignoreUnknownFields);if(f===!1)continue;c[u]=f;break;case"scalar":if(o===null)continue;c[u]=this.scalar(o,a.T,a.L,a.name);break}}}enum(e,t,n,i){if(e[0]=="google.protobuf.NullValue"&&g(t===null||t==="NULL_VALUE",`Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} only accepts null.`),t===null)return 0;switch(typeof t){case"number":return g(Number.isInteger(t),`Unable to parse field ${this.info.typeName}#${n}, enum can only be integral number, got ${t}.`),t;case"string":let s=t;e[2]&&t.substring(0,e[2].length)===e[2]&&(s=t.substring(e[2].length));let o=e[1][s];return typeof o=="undefined"&&i?!1:(g(typeof o=="number",`Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} has no value for "${t}".`),o)}g(!1,`Unable to parse field ${this.info.typeName}#${n}, cannot parse enum value from ${typeof t}".`)}scalar(e,t,n,i){let s;try{switch(t){case l.DOUBLE:case l.FLOAT:if(e===null)return 0;if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""){s="empty string";break}if(typeof e=="string"&&e.trim().length!==e.length){s="extra whitespace";break}if(typeof e!="string"&&typeof e!="number")break;let o=Number(e);if(Number.isNaN(o)){s="not a number";break}if(!Number.isFinite(o)){s="too large or small";break}return t==l.FLOAT&&$(o),o;case l.INT32:case l.FIXED32:case l.SFIXED32:case l.SINT32:case l.UINT32:if(e===null)return 0;let a;if(typeof e=="number"?a=e:e===""?s="empty string":typeof e=="string"&&(e.trim().length!==e.length?s="extra whitespace":a=Number(e)),a===void 0)break;return t==l.UINT32?C(a):R(a),a;case l.INT64:case l.SFIXED64:case l.SINT64:if(e===null)return N(b.ZERO,n);if(typeof e!="number"&&typeof e!="string")break;return N(b.from(e),n);case l.FIXED64:case l.UINT64:if(e===null)return N(x.ZERO,n);if(typeof e!="number"&&typeof e!="string")break;return N(x.from(e),n);case l.BOOL:if(e===null)return!1;if(typeof e!="boolean")break;return e;case l.STRING:if(e===null)return"";if(typeof e!="string"){s="extra whitespace";break}try{encodeURIComponent(e)}catch(u){u="invalid UTF8";break}return e;case l.BYTES:if(e===null||e==="")return new Uint8Array(0);if(typeof e!="string")break;return Rt(e)}}catch(o){s=o.message}this.assert(!1,i+(s?" - "+s:""),e)}};var pe=class{constructor(e){var t;this.fields=(t=e.fields)!==null&&t!==void 0?t:[]}write(e,t){let n={},i=e;for(let s of this.fields){if(!s.oneof){let c=this.field(s,i[s.localName],t);c!==void 0&&(n[t.useProtoFieldName?s.name:s.jsonName]=c);continue}let o=i[s.oneof];if(o.oneofKind!==s.localName)continue;let a=s.kind=="scalar"||s.kind=="enum"?Object.assign(Object.assign({},t),{emitDefaultValues:!0}):t,u=this.field(s,o[s.localName],a);g(u!==void 0),n[t.useProtoFieldName?s.name:s.jsonName]=u}return n}field(e,t,n){let i;if(e.kind=="map"){g(typeof t=="object"&&t!==null);let s={};switch(e.V.kind){case"scalar":for(let[u,c]of Object.entries(t)){let f=this.scalar(e.V.T,c,e.name,!1,!0);g(f!==void 0),s[u.toString()]=f}break;case"message":let o=e.V.T();for(let[u,c]of Object.entries(t)){let f=this.message(o,c,e.name,n);g(f!==void 0),s[u.toString()]=f}break;case"enum":let a=e.V.T();for(let[u,c]of Object.entries(t)){g(c===void 0||typeof c=="number");let f=this.enum(a,c,e.name,!1,!0,n.enumAsInteger);g(f!==void 0),s[u.toString()]=f}break}(n.emitDefaultValues||Object.keys(s).length>0)&&(i=s)}else if(e.repeat){g(Array.isArray(t));let s=[];switch(e.kind){case"scalar":for(let u=0;u<t.length;u++){let c=this.scalar(e.T,t[u],e.name,e.opt,!0);g(c!==void 0),s.push(c)}break;case"enum":let o=e.T();for(let u=0;u<t.length;u++){g(t[u]===void 0||typeof t[u]=="number");let c=this.enum(o,t[u],e.name,e.opt,!0,n.enumAsInteger);g(c!==void 0),s.push(c)}break;case"message":let a=e.T();for(let u=0;u<t.length;u++){let c=this.message(a,t[u],e.name,n);g(c!==void 0),s.push(c)}break}(n.emitDefaultValues||s.length>0||n.emitDefaultValues)&&(i=s)}else switch(e.kind){case"scalar":i=this.scalar(e.T,t,e.name,e.opt,n.emitDefaultValues);break;case"enum":i=this.enum(e.T(),t,e.name,e.opt,n.emitDefaultValues,n.enumAsInteger);break;case"message":i=this.message(e.T(),t,e.name,n);break}return i}enum(e,t,n,i,s,o){if(e[0]=="google.protobuf.NullValue")return!s&&!i?void 0:null;if(t===void 0){g(i);return}if(!(t===0&&!s&&!i))return g(typeof t=="number"),g(Number.isInteger(t)),o||!e[1].hasOwnProperty(t)?t:e[2]?e[2]+e[1][t]:e[1][t]}message(e,t,n,i){return t===void 0?i.emitDefaultValues?null:void 0:e.internalJsonWrite(t,i)}scalar(e,t,n,i,s){if(t===void 0){g(i);return}let o=s||i;switch(e){case l.INT32:case l.SFIXED32:case l.SINT32:return t===0?o?0:void 0:(R(t),t);case l.FIXED32:case l.UINT32:return t===0?o?0:void 0:(C(t),t);case l.FLOAT:$(t);case l.DOUBLE:return t===0?o?0:void 0:(g(typeof t=="number"),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t);case l.STRING:return t===""?o?"":void 0:(g(typeof t=="string"),t);case l.BOOL:return t===!1?o?!1:void 0:(g(typeof t=="boolean"),t);case l.UINT64:case l.FIXED64:g(typeof t=="number"||typeof t=="string"||typeof t=="bigint");let a=x.from(t);return a.isZero()&&!o?void 0:a.toString();case l.INT64:case l.SFIXED64:case l.SINT64:g(typeof t=="number"||typeof t=="string"||typeof t=="bigint");let u=b.from(t);return u.isZero()&&!o?void 0:u.toString();case l.BYTES:return g(t instanceof Uint8Array),t.byteLength?Dt(t):o?"":void 0}}};function K(r,e=I.STRING){switch(r){case l.BOOL:return!1;case l.UINT64:case l.FIXED64:return N(x.ZERO,e);case l.INT64:case l.SFIXED64:case l.SINT64:return N(b.ZERO,e);case l.DOUBLE:case l.FLOAT:return 0;case l.BYTES:return new Uint8Array(0);case l.STRING:return"";default:return 0}}var me=class{constructor(e){this.info=e}prepare(){var e;if(!this.fieldNoToField){let t=(e=this.info.fields)!==null&&e!==void 0?e:[];this.fieldNoToField=new Map(t.map(n=>[n.no,n]))}}read(e,t,n,i){this.prepare();let s=i===void 0?e.len:e.pos+i;for(;e.pos<s;){let[o,a]=e.tag(),u=this.fieldNoToField.get(o);if(!u){let p=n.readUnknownField;if(p=="throw")throw new Error(`Unknown field ${o} (wire type ${a}) for ${this.info.typeName}`);let F=e.skip(a);p!==!1&&(p===!0?W.onRead:p)(this.info.typeName,t,o,a,F);continue}let c=t,f=u.repeat,m=u.localName;switch(u.oneof&&(c=c[u.oneof],c.oneofKind!==m&&(c=t[u.oneof]={oneofKind:m})),u.kind){case"scalar":case"enum":let p=u.kind=="enum"?l.INT32:u.T,F=u.kind=="scalar"?u.L:void 0;if(f){let E=c[m];if(a==T.LengthDelimited&&p!=l.STRING&&p!=l.BYTES){let j=e.uint32()+e.pos;for(;e.pos<j;)E.push(this.scalar(e,p,F))}else E.push(this.scalar(e,p,F))}else c[m]=this.scalar(e,p,F);break;case"message":if(f){let E=c[m],j=u.T().internalBinaryRead(e,e.uint32(),n);E.push(j)}else c[m]=u.T().internalBinaryRead(e,e.uint32(),n,c[m]);break;case"map":let[h,O]=this.mapEntry(u,e,n);c[m][h]=O;break}}}mapEntry(e,t,n){let i=t.uint32(),s=t.pos+i,o,a;for(;t.pos<s;){let[u,c]=t.tag();switch(u){case 1:e.K==l.BOOL?o=t.bool().toString():o=this.scalar(t,e.K,I.STRING);break;case 2:switch(e.V.kind){case"scalar":a=this.scalar(t,e.V.T,e.V.L);break;case"enum":a=t.int32();break;case"message":a=e.V.T().internalBinaryRead(t,t.uint32(),n);break}break;default:throw new Error(`Unknown field ${u} (wire type ${c}) in map entry for ${this.info.typeName}#${e.name}`)}}if(o===void 0){let u=K(e.K);o=e.K==l.BOOL?u.toString():u}if(a===void 0)switch(e.V.kind){case"scalar":a=K(e.V.T,e.V.L);break;case"enum":a=0;break;case"message":a=e.V.T().create();break}return[o,a]}scalar(e,t,n){switch(t){case l.INT32:return e.int32();case l.STRING:return e.string();case l.BOOL:return e.bool();case l.DOUBLE:return e.double();case l.FLOAT:return e.float();case l.INT64:return N(e.int64(),n);case l.UINT64:return N(e.uint64(),n);case l.FIXED64:return N(e.fixed64(),n);case l.FIXED32:return e.fixed32();case l.BYTES:return e.bytes();case l.UINT32:return e.uint32();case l.SFIXED32:return e.sfixed32();case l.SFIXED64:return N(e.sfixed64(),n);case l.SINT32:return e.sint32();case l.SINT64:return N(e.sint64(),n)}}};var he=class{constructor(e){this.info=e}prepare(){if(!this.fields){let e=this.info.fields?this.info.fields.concat():[];this.fields=e.sort((t,n)=>t.no-n.no)}}write(e,t,n){this.prepare();for(let s of this.fields){let o,a,u=s.repeat,c=s.localName;if(s.oneof){let f=e[s.oneof];if(f.oneofKind!==c)continue;o=f[c],a=!0}else o=e[c],a=!1;switch(s.kind){case"scalar":case"enum":let f=s.kind=="enum"?l.INT32:s.T;if(u)if(g(Array.isArray(o)),u==G.PACKED)this.packed(t,f,s.no,o);else for(let m of o)this.scalar(t,f,s.no,m,!0);else o===void 0?g(s.opt):this.scalar(t,f,s.no,o,a||s.opt);break;case"message":if(u){g(Array.isArray(o));for(let m of o)this.message(t,n,s.T(),s.no,m)}else this.message(t,n,s.T(),s.no,o);break;case"map":g(typeof o=="object"&&o!==null);for(let[m,p]of Object.entries(o))this.mapEntry(t,n,s,m,p);break}}let i=n.writeUnknownFields;i!==!1&&(i===!0?W.onWrite:i)(this.info.typeName,e,t)}mapEntry(e,t,n,i,s){e.tag(n.no,T.LengthDelimited),e.fork();let o=i;switch(n.K){case l.INT32:case l.FIXED32:case l.UINT32:case l.SFIXED32:case l.SINT32:o=Number.parseInt(i);break;case l.BOOL:g(i=="true"||i=="false"),o=i=="true";break}switch(this.scalar(e,n.K,1,o,!0),n.V.kind){case"scalar":this.scalar(e,n.V.T,2,s,!0);break;case"enum":this.scalar(e,l.INT32,2,s,!0);break;case"message":this.message(e,t,n.V.T(),2,s);break}e.join()}message(e,t,n,i,s){s!==void 0&&(n.internalBinaryWrite(s,e.tag(i,T.LengthDelimited).fork(),t),e.join())}scalar(e,t,n,i,s){let[o,a,u]=this.scalarInfo(t,i);(!u||s)&&(e.tag(n,o),e[a](i))}packed(e,t,n,i){if(!i.length)return;g(t!==l.BYTES&&t!==l.STRING),e.tag(n,T.LengthDelimited),e.fork();let[,s]=this.scalarInfo(t);for(let o=0;o<i.length;o++)e[s](i[o]);e.join()}scalarInfo(e,t){let n=T.Varint,i,s=t===void 0,o=t===0;switch(e){case l.INT32:i="int32";break;case l.STRING:o=s||!t.length,n=T.LengthDelimited,i="string";break;case l.BOOL:o=t===!1,i="bool";break;case l.UINT32:i="uint32";break;case l.DOUBLE:n=T.Bit64,i="double";break;case l.FLOAT:n=T.Bit32,i="float";break;case l.INT64:o=s||b.from(t).isZero(),i="int64";break;case l.UINT64:o=s||x.from(t).isZero(),i="uint64";break;case l.FIXED64:o=s||x.from(t).isZero(),n=T.Bit64,i="fixed64";break;case l.BYTES:o=s||!t.byteLength,n=T.LengthDelimited,i="bytes";break;case l.FIXED32:n=T.Bit32,i="fixed32";break;case l.SFIXED32:n=T.Bit32,i="sfixed32";break;case l.SFIXED64:o=s||b.from(t).isZero(),n=T.Bit64,i="sfixed64";break;case l.SINT32:i="sint32";break;case l.SINT64:o=s||b.from(t).isZero(),i="sint64";break}return[n,i,s||o]}};function Gt(r){let e=r.messagePrototype?Object.create(r.messagePrototype):Object.defineProperty({},le,{value:r});for(let t of r.fields){let n=t.localName;if(!t.opt)if(t.oneof)e[t.oneof]={oneofKind:void 0};else if(t.repeat)e[n]=[];else switch(t.kind){case"scalar":e[n]=K(t.T,t.L);break;case"enum":e[n]=0;break;case"map":e[n]={};break}}return e}function de(r,e,t){let n,i=t,s;for(let o of r.fields){let a=o.localName;if(o.oneof){let u=i[o.oneof];if((u==null?void 0:u.oneofKind)==null)continue;if(n=u[a],s=e[o.oneof],s.oneofKind=u.oneofKind,n==null){delete s[a];continue}}else if(n=i[a],s=e,n==null)continue;switch(o.repeat&&(s[a].length=n.length),o.kind){case"scalar":case"enum":if(o.repeat)for(let c=0;c<n.length;c++)s[a][c]=n[c];else s[a]=n;break;case"message":let u=o.T();if(o.repeat)for(let c=0;c<n.length;c++)s[a][c]=u.create(n[c]);else s[a]===void 0?s[a]=u.create(n):u.mergePartial(s[a],n);break;case"map":switch(o.V.kind){case"scalar":case"enum":Object.assign(s[a],n);break;case"message":let c=o.V.T();for(let f of Object.keys(n))s[a][f]=c.create(n[f]);break}break}}}function Zt(r,e,t){if(e===t)return!0;if(!e||!t)return!1;for(let n of r.fields){let i=n.localName,s=n.oneof?e[n.oneof][i]:e[i],o=n.oneof?t[n.oneof][i]:t[i];switch(n.kind){case"enum":case"scalar":let a=n.kind=="enum"?l.INT32:n.T;if(!(n.repeat?Kt(a,s,o):Yt(a,s,o)))return!1;break;case"map":if(!(n.V.kind=="message"?Qt(n.V.T(),ge(s),ge(o)):Kt(n.V.kind=="enum"?l.INT32:n.V.T,ge(s),ge(o))))return!1;break;case"message":let u=n.T();if(!(n.repeat?Qt(u,s,o):u.equals(s,o)))return!1;break}}return!0}var ge=Object.values;function Yt(r,e,t){if(e===t)return!0;if(r!==l.BYTES)return!1;let n=e,i=t;if(n.length!==i.length)return!1;for(let s=0;s<n.length;s++)if(n[s]!=i[s])return!1;return!0}function Kt(r,e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Yt(r,e[n],t[n]))return!1;return!0}function Qt(r,e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!r.equals(e[n],t[n]))return!1;return!0}var zt=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})),Sr=zt[le]={},w=class{constructor(e,t,n){this.defaultCheckDepth=16,this.typeName=e,this.fields=t.map(Xt),this.options=n!=null?n:{},Sr.value=this,this.messagePrototype=Object.create(null,zt),this.refTypeCheck=new ce(this),this.refJsonReader=new fe(this),this.refJsonWriter=new pe(this),this.refBinReader=new me(this),this.refBinWriter=new he(this)}create(e){let t=Gt(this);return e!==void 0&&de(this,t,e),t}clone(e){let t=this.create();return de(this,t,e),t}equals(e,t){return Zt(this,e,t)}is(e,t=this.defaultCheckDepth){return this.refTypeCheck.is(e,t,!1)}isAssignable(e,t=this.defaultCheckDepth){return this.refTypeCheck.is(e,t,!0)}mergePartial(e,t){de(this,e,t)}fromBinary(e,t){let n=vt(t);return this.internalBinaryRead(n.readerFactory(e),e.byteLength,n)}fromJson(e,t){return this.internalJsonRead(e,jt(t))}fromJsonString(e,t){let n=JSON.parse(e);return this.fromJson(n,t)}toJson(e,t){return this.internalJsonWrite(e,Ht(t))}toJsonString(e,t){var n;let i=this.toJson(e,t);return JSON.stringify(i,null,(n=t==null?void 0:t.prettySpaces)!==null&&n!==void 0?n:0)}toBinary(e,t){let n=Wt(t);return this.internalBinaryWrite(e,n.writerFactory(),n).finish()}internalJsonRead(e,t,n){if(e!==null&&typeof e=="object"&&!Array.isArray(e)){let i=n!=null?n:this.create();return this.refJsonReader.read(e,i,t),i}throw new Error(`Unable to parse message ${this.typeName} from JSON ${L(e)}.`)}internalJsonWrite(e,t){return this.refJsonWriter.write(e,t)}internalBinaryWrite(e,t,n){return this.refBinWriter.write(e,t,n),t}internalBinaryRead(e,t,n,i){let s=i!=null?i:this.create();return this.refBinReader.read(e,s,n,t),s}};var Le=class extends w{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){let e=this.create(),t=Date.now();return e.seconds=b.from(Math.floor(t/1e3)).toBigInt(),e.nanos=t%1e3*1e6,e}toDate(e){return new Date(b.from(e.seconds).toNumber()*1e3+Math.ceil(e.nanos/1e6))}fromDate(e){let t=this.create(),n=e.getTime();return t.seconds=b.from(Math.floor(n/1e3)).toBigInt(),t.nanos=n%1e3*1e6,t}internalJsonWrite(e,t){let n=b.from(e.seconds).toNumber()*1e3;if(n<Date.parse("0001-01-01T00:00:00Z")||n>Date.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(e.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let i="Z";if(e.nanos>0){let s=(e.nanos+1e9).toString().substring(1);s.substring(3)==="000000"?i="."+s.substring(0,3)+"Z":s.substring(6)==="000"?i="."+s.substring(0,6)+"Z":i="."+s+"Z"}return new Date(n).toISOString().replace(".000Z",i)}internalJsonRead(e,t,n){if(typeof e!="string")throw new Error("Unable to parse Timestamp from JSON "+L(e)+".");let i=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!i)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let s=Date.parse(i[1]+"-"+i[2]+"-"+i[3]+"T"+i[4]+":"+i[5]+":"+i[6]+(i[8]?i[8]:"Z"));if(Number.isNaN(s))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(s<Date.parse("0001-01-01T00:00:00Z")||s>Date.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");return n||(n=this.create()),n.seconds=b.from(s/1e3).toBigInt(),n.nanos=0,i[7]&&(n.nanos=parseInt("1"+i[7]+"0".repeat(9-i[7].length))-1e9),n}},Ce=new Le;var er=(n=>(n[n.UNKNOWN=0]="UNKNOWN",n[n.PATH=1]="PATH",n[n.CMD=2]="CMD",n))(er||{}),tr=(i=>(i[i.UNSPECIFIED=0]="UNSPECIFIED",i[i.CANCELLED=1]="CANCELLED",i[i.CANCELLING=2]="CANCELLING",i[i.NOT_CANCELLABLE=3]="NOT_CANCELLABLE",i))(tr||{}),Ve=class extends w{constructor(){super("arrow.flight.protocol.HandshakeRequest",[{no:1,name:"protocol_version",kind:"scalar",T:4,L:0},{no:2,name:"payload",kind:"scalar",T:12}])}},Rr=new Ve,Be=class extends w{constructor(){super("arrow.flight.protocol.HandshakeResponse",[{no:1,name:"protocol_version",kind:"scalar",T:4,L:0},{no:2,name:"payload",kind:"scalar",T:12}])}},Dr=new Be,ve=class extends w{constructor(){super("arrow.flight.protocol.BasicAuth",[{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"password",kind:"scalar",T:9}])}},Fs=new ve,Me=class extends w{constructor(){super("arrow.flight.protocol.Empty",[])}},Ur=new Me,We=class extends w{constructor(){super("arrow.flight.protocol.ActionType",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"description",kind:"scalar",T:9}])}},Lr=new We,$e=class extends w{constructor(){super("arrow.flight.protocol.Criteria",[{no:1,name:"expression",kind:"scalar",T:12}])}},Cr=new $e,qe=class extends w{constructor(){super("arrow.flight.protocol.Action",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"body",kind:"scalar",T:12}])}},Vr=new qe,je=class extends w{constructor(){super("arrow.flight.protocol.CancelFlightInfoRequest",[{no:1,name:"info",kind:"message",T:()=>ye}])}},xs=new je,He=class extends w{constructor(){super("arrow.flight.protocol.RenewFlightEndpointRequest",[{no:1,name:"endpoint",kind:"message",T:()=>rr}])}},Os=new He,Xe=class extends w{constructor(){super("arrow.flight.protocol.Result",[{no:1,name:"body",kind:"scalar",T:12}])}},Br=new Xe,Je=class extends w{constructor(){super("arrow.flight.protocol.CancelFlightInfoResult",[{no:1,name:"status",kind:"enum",T:()=>["arrow.flight.protocol.CancelStatus",tr,"CANCEL_STATUS_"]}])}},Is=new Je,Ge=class extends w{constructor(){super("arrow.flight.protocol.SchemaResult",[{no:1,name:"schema",kind:"scalar",T:12}])}},vr=new Ge,Ke=class extends w{constructor(){super("arrow.flight.protocol.FlightDescriptor",[{no:1,name:"type",kind:"enum",T:()=>["arrow.flight.protocol.FlightDescriptor.DescriptorType",er]},{no:2,name:"cmd",kind:"scalar",T:12},{no:3,name:"path",kind:"scalar",repeat:2,T:9}])}},q=new Ke,Qe=class extends w{constructor(){super("arrow.flight.protocol.FlightInfo",[{no:1,name:"schema",kind:"scalar",T:12},{no:2,name:"flight_descriptor",kind:"message",T:()=>q},{no:3,name:"endpoint",kind:"message",repeat:1,T:()=>rr},{no:4,name:"total_records",kind:"scalar",T:3,L:0},{no:5,name:"total_bytes",kind:"scalar",T:3,L:0},{no:6,name:"ordered",kind:"scalar",T:8},{no:7,name:"app_metadata",kind:"scalar",T:12}])}},ye=new Qe,Ze=class extends w{constructor(){super("arrow.flight.protocol.PollInfo",[{no:1,name:"info",kind:"message",T:()=>ye},{no:2,name:"flight_descriptor",kind:"message",T:()=>q},{no:3,name:"progress",kind:"scalar",opt:!0,T:1},{no:4,name:"expiration_time",kind:"message",T:()=>Ce}])}},Mr=new Ze,Ye=class extends w{constructor(){super("arrow.flight.protocol.FlightEndpoint",[{no:1,name:"ticket",kind:"message",T:()=>we},{no:2,name:"location",kind:"message",repeat:1,T:()=>Wr},{no:3,name:"expiration_time",kind:"message",T:()=>Ce},{no:4,name:"app_metadata",kind:"scalar",T:12}])}},rr=new Ye,ze=class extends w{constructor(){super("arrow.flight.protocol.Location",[{no:1,name:"uri",kind:"scalar",T:9}])}},Wr=new ze,et=class extends w{constructor(){super("arrow.flight.protocol.Ticket",[{no:1,name:"ticket",kind:"scalar",T:12}])}},we=new et,tt=class extends w{constructor(){super("arrow.flight.protocol.FlightData",[{no:1,name:"flight_descriptor",kind:"message",T:()=>q},{no:2,name:"data_header",kind:"scalar",T:12},{no:3,name:"app_metadata",kind:"scalar",T:12},{no:1e3,name:"data_body",kind:"scalar",T:12}])}},be=new tt,rt=class extends w{constructor(){super("arrow.flight.protocol.PutResult",[{no:1,name:"app_metadata",kind:"scalar",T:12}])}},$r=new rt,Te=new Pr("arrow.flight.protocol.FlightService",[{name:"Handshake",serverStreaming:!0,clientStreaming:!0,options:{},I:Rr,O:Dr},{name:"ListFlights",serverStreaming:!0,options:{},I:Cr,O:ye},{name:"GetFlightInfo",options:{},I:q,O:ye},{name:"PollFlightInfo",options:{},I:q,O:Mr},{name:"GetSchema",options:{},I:q,O:vr},{name:"DoGet",serverStreaming:!0,options:{},I:we,O:be},{name:"DoPut",serverStreaming:!0,clientStreaming:!0,options:{},I:be,O:$r},{name:"DoExchange",serverStreaming:!0,clientStreaming:!0,options:{},I:be,O:be},{name:"DoAction",serverStreaming:!0,options:{},I:Vr,O:Br},{name:"ListActions",serverStreaming:!0,options:{},I:Ur,O:Lr}]);import{stackIntercept as A}from"@protobuf-ts/runtime-rpc";var Fe=class{constructor(e){this._transport=e;d(this,"typeName",Te.typeName);d(this,"methods",Te.methods);d(this,"options",Te.options)}_transport;handshake(e){let t=this.methods[0],n=this._transport.mergeOptions(e);return A("duplex",this._transport,t,n)}listFlights(e,t){let n=this.methods[1],i=this._transport.mergeOptions(t);return A("serverStreaming",this._transport,n,i,e)}getFlightInfo(e,t){let n=this.methods[2],i=this._transport.mergeOptions(t);return A("unary",this._transport,n,i,e)}pollFlightInfo(e,t){let n=this.methods[3],i=this._transport.mergeOptions(t);return A("unary",this._transport,n,i,e)}getSchema(e,t){let n=this.methods[4],i=this._transport.mergeOptions(t);return A("unary",this._transport,n,i,e)}doGet(e,t){let n=this.methods[5],i=this._transport.mergeOptions(t);return A("serverStreaming",this._transport,n,i,e)}doPut(e){let t=this.methods[6],n=this._transport.mergeOptions(e);return A("duplex",this._transport,t,n)}doExchange(e){let t=this.methods[7],n=this._transport.mergeOptions(e);return A("duplex",this._transport,t,n)}doAction(e,t){let n=this.methods[8],i=this._transport.mergeOptions(t);return A("serverStreaming",this._transport,n,i,e)}listActions(e,t){let n=this.methods[9],i=this._transport.mergeOptions(t);return A("serverStreaming",this._transport,n,i,e)}};var nr=/\$(\w+)/g;function ir(r){return!!r.match(nr)}function sr(r,e){let t=r.match(nr);if(t)for(let n of t)e[n.trim().replace("$","")]||M(new Error(`No parameter matching ${n} provided in the query params map`));return!0}var qr="2.4.0.nightly",or=`influxdb3-js/${qr}`;import{Type as jr}from"apache-arrow/enum";function nt(r,e){if(e==null)return null;let t=r.metadata.get("iox::column::type");if(!t||r.typeId===jr.Timestamp)return e;let[,,n,i]=t.split("::");if(n==="field")switch(i){case"integer":return H(e)?parseInt(e):(console.warn(`Value ${e} is not an integer`),e);case"uinteger":return At(e)?parseInt(e):(console.warn(`Value ${e} is not an unsigned integer`),e);case"float":return H(e)?parseFloat(e):(console.warn(`Value ${e} is not a float`),e);case"boolean":return typeof e=="boolean"||console.warn(`Value ${e} is not a boolean`),e;case"string":return typeof e=="string"?String(e):(console.warn(`Value ${e} is not a string`),e);default:return e}return e}var Q=class{constructor(e){this._options=e;d(this,"_closed",!1);d(this,"_flightClient");d(this,"_transport");d(this,"_defaultHeaders");let{host:t,queryTimeout:n,grpcOptions:i}=this._options;this._defaultHeaders=this._options.headers;let s={};i!==void 0&&(s=i),this._transport=U.queryTransport({host:t,timeout:n,clientOptions:{...s}}),this._flightClient=new Fe(this._transport)}_options;prepareTicket(e,t,n){let i={database:e,sql_query:t,query_type:n.type};if(n.params){let s={};for(let o of Object.keys(n.params))n.params[o]&&(s[o]=n.params[o]);i.params=s}return we.create({ticket:new TextEncoder().encode(JSON.stringify(i))})}prepareMetadata(e){let t={"User-Agent":or,...this._defaultHeaders,...e},n=this._options.token;return n&&(t.authorization=`Bearer ${n}`),t}async*_queryRawBatches(e,t,n){var m;if(n.params&&ir(e)&&sr(e,n.params),this._closed)throw new Error("queryApi: already closed!");let i=this._flightClient,s=this.prepareTicket(t,e,n),a={meta:this.prepareMetadata(n.headers)};a.timeout=(m=n.timeout)!=null?m:this._options.queryTimeout;let u=i.doGet(s,a),c=(async function*(){for await(let p of u.responses)yield kt(p.dataHeader.length),yield p.dataHeader,yield p.dataBody})();yield*await Hr.from(c)}async*query(e,t,n){let i=this._queryRawBatches(e,t,n);for await(let s of i)for(let o of s){let a={};for(let u of s.schema.fields){let c=o[u.name];a[u.name]=nt(u,c)}yield a}}async*queryPoints(e,t,n){var s;let i=this._queryRawBatches(e,t,n);for await(let o of i)for(let a=0;a<o.numRows;a++){let u=new D;for(let c=0;c<o.numCols;c++){let f=o.schema.fields[c],m=f.name,p=(s=o.getChildAt(c))==null?void 0:s.get(a),F=f.typeId,h=f.metadata.get("iox::column::type");if(p==null)continue;if((m==="measurement"||m=="iox::measurement")&&typeof p=="string"){u.setMeasurement(p);continue}if(!h){m==="time"&&F===Xr.Timestamp?u.setTimestamp(p):u.setField(m,p);continue}let[,,O,E]=h.split("::");if(O==="field"){if(E&&p!==void 0&&p!==null){let j=nt(f,p);u.setField(m,j,E)}}else O==="tag"?u.setTag(m,p):O==="timestamp"&&u.setTimestamp(p)}yield u}}async close(){var e,t;this._closed=!0,(t=(e=this._transport).close)==null||t.call(e)}};var it=`Please specify the 'database' as a method parameter or use default configuration at 'ClientOptions.database'
14
+ `,xe=class{constructor(...e){d(this,"_options");d(this,"_writeApi");d(this,"_queryApi");d(this,"_transport");d(this,"_mergeWriteOptions",e=>{var i;let t={...(i=this._options.writeOptions)==null?void 0:i.headers,...e==null?void 0:e.headers},n={...this._options.writeOptions,...e};return n.headers=t,n});d(this,"_mergeQueryOptions",e=>{var s,o;let t={...(s=this._options.queryOptions)==null?void 0:s.headers,...e==null?void 0:e.headers},n={...(o=this._options.queryOptions)==null?void 0:o.params,...e==null?void 0:e.params},i={...this._options.queryOptions,...e};return i.headers=t,i.params=n,i});var s,o,a,u,c,f,m,p;let t;switch(e.length){case 0:{t=dt();break}case 1:{if(e[0]==null)throw new S("No configuration specified!");typeof e[0]=="string"?t=ht(e[0]):t=e[0];break}default:throw new S("Multiple arguments specified!")}this._options={...pt,...t},this._options.grpcOptions?this._options.queryOptions={...t.queryOptions,grpcOptions:{...this._options.grpcOptions}}:(s=t.queryOptions)!=null&&s.grpcOptions&&(this._options.grpcOptions=(o=t.queryOptions)==null?void 0:o.grpcOptions);let n=this._options.host;if(typeof n!="string")throw new S("No host specified!");if(n.endsWith("/")&&(this._options.host=n.substring(0,n.length-1)),typeof this._options.token!="string")throw new S("No token specified!");this._queryApi=new Q({...this._options,queryTimeout:(c=(a=this._options.queryOptions)==null?void 0:a.timeout)!=null?c:(u=this._options)==null?void 0:u.queryTimeout});let i=(p=(m=this._options.timeout)!=null?m:(f=this._options.writeOptions)==null?void 0:f.timeout)!=null?p:this._options.writeTimeout;this._transport=U.writeTransport({...this._options,writeTimeout:i}),this._writeApi=new J({transport:this._transport,...this._options})}async write(e,t,n,i){var o;let s=this._mergeWriteOptions(i);await this._writeApi.doWrite(St(e,s==null?void 0:s.defaultTags,s==null?void 0:s.tagOrder,s==null?void 0:s.precision),(o=t!=null?t:this._options.database)!=null?o:M(new Error(it)),n,s)}query(e,t,n=(i=>(i=this._options.queryOptions)!=null?i:Oe)()){var o;let s=this._mergeQueryOptions(n);return this._queryApi.query(e,(o=t!=null?t:this._options.database)!=null?o:M(new Error(it)),s)}queryPoints(e,t,n=(i=>(i=this._options.queryOptions)!=null?i:Oe)()){var o;let s=this._mergeQueryOptions(n);return this._queryApi.queryPoints(e,(o=t!=null?t:this._options.database)!=null?o:M(new Error(it)),s)}async getServerVersion(){let e;try{let t=await this._transport.request("/ping",null,{method:"GET"},(n,i)=>{var s;e=(s=n["X-Influxdb-Version"])!=null?s:n["x-influxdb-version"]});t&&!e&&(e=t.version)}catch(t){return Promise.reject(t)}return Promise.resolve(e)}async close(){await this._writeApi.close(),await this._queryApi.close()}};export{Y as AbortError,pt as DEFAULT_ConnectionOptions,Oe as DEFAULT_QueryOptions,mt as DEFAULT_WriteOptions,_e as GetFieldTypeMissmatchError,_ as HttpError,S as IllegalArgumentError,xe as InfluxDBClient,B as Log,Z as PartialWriteError,ee as Point,D as PointValues,ot as RequestTimedOutError,br as collectAll,pr as consoleLogger,Nt as convertTime,It as convertTimeToNanos,ft as createTextDecoderCombiner,dr as currentTime,gr as dateToProtocolTimestamp,v as escape,ht as fromConnectionString,dt as fromEnv,H as isNumber,yt as parsePrecision,gt as precisionToV2ApiString,bt as precisionToV3ApiString,rn as setLogger,hr as useProcessHrtime,St as writableDataToLineProtocol};
11
15
  //# sourceMappingURL=index.browser.mjs.map
Binary file