@loaders.gl/csv
Version:
Framework-independent loader for CSV and DSV table formats
7 lines • 250 kB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if (typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if (typeof define === 'function' && define.amd) define([], factory);
else if (typeof exports === 'object') exports['loaders'] = factory();
else root['loaders'] = factory();})(globalThis, function () {
"use strict";var __exports__=(()=>{var nh=Object.create;var cn=Object.defineProperty;var sh=Object.getOwnPropertyDescriptor;var oh=Object.getOwnPropertyNames;var ah=Object.getPrototypeOf,ch=Object.prototype.hasOwnProperty;var lh=(r,t,e)=>t in r?cn(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var uh=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),or=(r,t)=>{for(var e in t)cn(r,e,{get:t[e],enumerable:!0})},os=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of oh(t))!ch.call(r,n)&&n!==e&&cn(r,n,{get:()=>t[n],enumerable:!(i=sh(t,n))||i.enumerable});return r},as=(r,t,e)=>(os(r,t,"default"),e&&os(e,t,"default")),hh=(r,t,e)=>(e=r!=null?nh(ah(r)):{},os(t||!r||!r.__esModule?cn(e,"default",{value:r,enumerable:!0}):e,r)),dh=r=>os(cn({},"__esModule",{value:!0}),r);var vc=(r,t,e)=>(lh(r,typeof t!="symbol"?t+"":t,e),e);var Sc=uh((Vp,Ic)=>{Ic.exports=globalThis.loaders});var ss={};or(ss,{CSVArrowLoader:()=>rh,CSVLoader:()=>Cr,CSVWriter:()=>th});as(ss,hh(Sc(),1));var cs=globalThis,fh=globalThis.document||{},ls=globalThis.process||{},ph=globalThis.console,jp=globalThis.navigator||{};function Bc(r){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let t=typeof navigator<"u"&&navigator.userAgent,e=r||t;return Boolean(e&&e.indexOf("Electron")>=0)}function Vr(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||Bc()}var Zo="4.1.1";function di(r,t){if(!r)throw new Error(t||"Assertion failed")}function qo(r){if(!r)return 0;let t;switch(typeof r){case"number":t=r;break;case"object":t=r.logLevel||r.priority||0;break;default:return 0}return di(Number.isFinite(t)&&t>=0),t}function xc(r){let{logLevel:t,message:e}=r;r.logLevel=qo(t);let i=r.args?Array.from(r.args):[];for(;i.length&&i.shift()!==e;);switch(typeof t){case"string":case"function":e!==void 0&&i.unshift(e),r.message=t;break;case"object":Object.assign(r,t);break;default:}typeof r.message=="function"&&(r.message=r.message());let n=typeof r.message;return di(n==="string"||n==="object"),Object.assign(r,{args:i},r.opts)}var jr=()=>{},us=class{constructor({level:t=0}={}){this.userData={},this._onceCache=new Set,this._level=t}set level(t){this.setLevel(t)}get level(){return this.getLevel()}setLevel(t){return this._level=t,this}getLevel(){return this._level}warn(t,...e){return this._log("warn",0,t,e,{once:!0})}error(t,...e){return this._log("error",0,t,e)}log(t,e,...i){return this._log("log",t,e,i)}info(t,e,...i){return this._log("info",t,e,i)}once(t,e,...i){return this._log("once",t,e,i,{once:!0})}_log(t,e,i,n,s={}){let o=xc({logLevel:e,message:i,args:this._buildArgs(e,i,n),opts:s});return this._createLogFunction(t,o,s)}_buildArgs(t,e,i){return[t,e,...i]}_createLogFunction(t,e,i){if(!this._shouldLog(e.logLevel))return jr;let n=this._getOnceTag(i.tag??e.tag??e.message);if((i.once||e.once)&&n!==void 0){if(this._onceCache.has(n))return jr;this._onceCache.add(n)}return this._emit(t,e)}_shouldLog(t){return this.getLevel()>=qo(t)}_getOnceTag(t){if(t!==void 0)try{return typeof t=="string"?t:String(t)}catch{return}}};function yh(r){try{let t=window[r],e="__storage_test__";return t.setItem(e,e),t.removeItem(e),t}catch{return null}}var hs=class{constructor(t,e,i="sessionStorage"){this.storage=yh(i),this.id=t,this.config=e,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}}_loadConfiguration(){let t={};if(this.storage){let e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}};function Ac(r){let t;return r<10?t=`${r.toFixed(2)}ms`:r<100?t=`${r.toFixed(1)}ms`:r<1e3?t=`${r.toFixed(0)}ms`:t=`${(r/1e3).toFixed(2)}s`,t}function Tc(r,t=8){let e=Math.max(t-r.length,0);return`${" ".repeat(e)}${r}`}var ds;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(ds||(ds={}));var gh=10;function Dc(r){return typeof r!="string"?r:(r=r.toUpperCase(),ds[r]||ds.WHITE)}function Fc(r,t,e){return!Vr&&typeof r=="string"&&(t&&(r=`\x1B[${Dc(t)}m${r}\x1B[39m`),e&&(r=`\x1B[${Dc(e)+gh}m${r}\x1B[49m`)),r}function Oc(r,t=["constructor"]){let e=Object.getPrototypeOf(r),i=Object.getOwnPropertyNames(e),n=r;for(let s of i){let o=n[s];typeof o=="function"&&(t.find(a=>s===a)||(n[s]=o.bind(r)))}}function fi(){let r;if(Vr()&&cs.performance)r=cs?.performance?.now?.();else if("hrtime"in ls){let t=ls?.hrtime?.();r=t[0]*1e3+t[1]/1e6}else r=Date.now();return r}var pi={debug:Vr()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Ko={enabled:!0,level:0},ar=class extends us{constructor({id:t}={id:""}){super({level:0}),this.VERSION=Zo,this._startTs=fi(),this._deltaTs=fi(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new hs(`__probe-${this.id}__`,{[this.id]:Ko}),this.timeStamp(`${this.id} started`),Oc(this),Object.seal(this)}isEnabled(){return this._getConfiguration().enabled}getLevel(){return this._getConfiguration().level}getTotal(){return Number((fi()-this._startTs).toPrecision(10))}getDelta(){return Number((fi()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._updateConfiguration({enabled:t}),this}setLevel(t){return this._updateConfiguration({level:t}),this}get(t){return this._getConfiguration()[t]}set(t,e){this._updateConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){if(!t)throw new Error(e||"Assertion failed")}warn(t,...e){return this._log("warn",0,t,e,{method:pi.warn,once:!0})}error(t,...e){return this._log("error",0,t,e,{method:pi.error})}deprecated(t,e){return this.warn(`\`${t}\` is deprecated and will be removed in a later version. Use \`${e}\` instead`)}removed(t,e){return this.error(`\`${t}\` has been removed. Use \`${e}\` instead`)}probe(t,e,...i){return this._log("log",t,e,i,{method:pi.log,time:!0,once:!0})}log(t,e,...i){return this._log("log",t,e,i,{method:pi.debug})}info(t,e,...i){return this._log("info",t,e,i,{method:console.info})}once(t,e,...i){return this._log("once",t,e,i,{method:pi.debug||pi.info,once:!0})}table(t,e,i){return e?this._log("table",t,e,i&&[i]||[],{method:console.table||jr,tag:_h(e)}):jr}time(t,e){return this._log("time",t,e,[],{method:console.time?console.time:console.info})}timeEnd(t,e){return this._log("time",t,e,[],{method:console.timeEnd?console.timeEnd:console.info})}timeStamp(t,e){return this._log("time",t,e,[],{method:console.timeStamp||jr})}group(t,e,i={collapsed:!1}){let n=(i.collapsed?console.groupCollapsed:console.group)||console.info;return this._log("group",t,e,[],{method:n})}groupCollapsed(t,e,i={}){return this.group(t,e,Object.assign({},i,{collapsed:!0}))}groupEnd(t){return this._log("groupEnd",t,"",[],{method:console.groupEnd||jr})}withGroup(t,e,i){this.group(t,e)();try{i()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&super._shouldLog(t)}_emit(t,e){let i=e.method;di(i),e.total=this.getTotal(),e.delta=this.getDelta(),this._deltaTs=fi();let n=bh(this.id,e.message,e);return i.bind(console,n,...e.args)}_getConfiguration(){return this._storage.config[this.id]||this._updateConfiguration(Ko),this._storage.config[this.id]}_updateConfiguration(t){let e=this._storage.config[this.id]||{...Ko};this._storage.setConfiguration({[this.id]:{...e,...t}})}};ar.VERSION=Zo;function bh(r,t,e){if(typeof t=="string"){let i=e.time?Tc(Ac(e.total)):"";t=e.time?`${r}: ${i} ${t}`:`${r}: ${t}`,t=Fc(t,e.color,e.background)}return t}function _h(r){for(let t in r)for(let e in r[t])return e||"untitled";return"empty"}globalThis.probe={};var mm=new ar({id:"@probe.gl/log"});var Xo="4.4.4",wh=Xo[0]>="0"&&Xo[0]<="9"?`v${Xo}`:"";function vh(){let r=new ar({id:"loaders.gl"});return globalThis.loaders||={},globalThis.loaders.log=r,globalThis.loaders.version=wh,globalThis.probe||={},globalThis.probe.loaders=r,r}var Qo=vh();async function*ta(r){for await(let t of r)yield Ih(t)}function Ih(r){if(r instanceof ArrayBuffer)return r;if(ArrayBuffer.isView(r)){let{buffer:t,byteOffset:e,byteLength:i}=r;return Nc(t,e,i)}return Nc(r)}function Nc(r,t=0,e=r.byteLength-t){let i=new Uint8Array(r,t,e),n=new Uint8Array(i.length);return n.set(i),n.buffer}function fs(r,t="float32"){return r instanceof Date?"date-millisecond":r instanceof Number?t:typeof r=="string"?"utf8":(r===null||r==="undefined","null")}function Mc(r){let t=Sh(r);return t!=="null"?{type:t,nullable:!1}:r.length>0?(t=fs(r[0]),{type:t,nullable:!0}):{type:"null",nullable:!0}}function Sh(r){switch(r.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function ps(r,t){if(!t)switch(r){case"int8":return Int8Array;case"uint8":return Uint8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;default:break}return Array}function Lc(r,t){var e={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&t.indexOf(i)<0&&(e[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(r);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(r,i[n])&&(e[i[n]]=r[i[n]]);return e}function y(r,t,e,i){function n(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(h){try{l(i.next(h))}catch(d){o(d)}}function c(h){try{l(i.throw(h))}catch(d){o(d)}}function l(h){h.done?s(h.value):n(h.value).then(a,c)}l((i=i.apply(r,t||[])).next())})}function Ec(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],i=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function U(r){return this instanceof U?(this.v=r,this):new U(r)}function ae(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(r,t||[]),n,s=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),n[Symbol.asyncIterator]=function(){return this},n;function o(m){return function(N){return Promise.resolve(N).then(m,d)}}function a(m,N){i[m]&&(n[m]=function(b){return new Promise(function(C,J){s.push([m,b,C,J])>1||c(m,b)})},N&&(n[m]=N(n[m])))}function c(m,N){try{l(i[m](N))}catch(b){p(s[0][3],b)}}function l(m){m.value instanceof U?Promise.resolve(m.value.v).then(h,d):p(s[0][2],m)}function h(m){c("next",m)}function d(m){c("throw",m)}function p(m,N){m(N),s.shift(),s.length&&c(s[0][0],s[0][1])}}function mi(r){var t,e;return t={},i("next"),i("throw",function(n){throw n}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(n,s){t[n]=r[n]?function(o){return(e=!e)?{value:U(r[n](o)),done:!1}:s?s(o):o}:s}}function Ae(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof Ec=="function"?Ec(r):r[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=r[s]&&function(o){return new Promise(function(a,c){o=r[s](o),n(a,c,o.done,o.value)})}}function n(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}var oa={};or(oa,{compareArrayLike:()=>sa,joinUint8Arrays:()=>ce,memcpy:()=>hn,rebaseValueOffsets:()=>Is,toArrayBufferView:()=>V,toArrayBufferViewAsyncIterator:()=>Fe,toArrayBufferViewIterator:()=>Pe,toBigInt64Array:()=>vs,toBigUint64Array:()=>Nh,toFloat32Array:()=>Mh,toFloat32ArrayAsyncIterator:()=>Jh,toFloat32ArrayIterator:()=>kh,toFloat64Array:()=>Eh,toFloat64ArrayAsyncIterator:()=>Zh,toFloat64ArrayIterator:()=>Ph,toInt16Array:()=>Dh,toInt16ArrayAsyncIterator:()=>Hh,toInt16ArrayIterator:()=>Rh,toInt32Array:()=>kr,toInt32ArrayAsyncIterator:()=>Wh,toInt32ArrayIterator:()=>Ch,toInt8Array:()=>Th,toInt8ArrayAsyncIterator:()=>$h,toInt8ArrayIterator:()=>Uh,toUint16Array:()=>Fh,toUint16ArrayAsyncIterator:()=>Gh,toUint16ArrayIterator:()=>Vh,toUint32Array:()=>Oh,toUint32ArrayAsyncIterator:()=>Yh,toUint32ArrayIterator:()=>jh,toUint8Array:()=>D,toUint8ArrayAsyncIterator:()=>na,toUint8ArrayIterator:()=>ia,toUint8ClampedArray:()=>Lh,toUint8ClampedArrayAsyncIterator:()=>qh,toUint8ClampedArrayIterator:()=>zh});var Uc=new TextDecoder("utf-8"),ln=Uc.decode.bind(Uc),Bh=new TextEncoder,ke=r=>Bh.encode(r);var xh=r=>typeof r=="number",Rc=r=>typeof r=="boolean",_t=r=>typeof r=="function",Rt=r=>r!=null&&Object(r)===r,Te=r=>Rt(r)&&_t(r.then);var De=r=>Rt(r)&&_t(r[Symbol.iterator]),pe=r=>Rt(r)&&_t(r[Symbol.asyncIterator]),ms=r=>Rt(r)&&Rt(r.schema);var ys=r=>Rt(r)&&"done"in r&&"value"in r;var gs=r=>Rt(r)&&_t(r.stat)&&xh(r.fd);var bs=r=>Rt(r)&&un(r.body),_s=r=>"_getDOMStream"in r&&"_getNodeStream"in r,Cc=r=>Rt(r)&&_t(r.abort)&&_t(r.getWriter)&&!_s(r),un=r=>Rt(r)&&_t(r.cancel)&&_t(r.getReader)&&!_s(r),Vc=r=>Rt(r)&&_t(r.end)&&_t(r.write)&&Rc(r.writable)&&!_s(r),ws=r=>Rt(r)&&_t(r.read)&&_t(r.pipe)&&Rc(r.readable)&&!_s(r),jc=r=>Rt(r)&&_t(r.clear)&&_t(r.bytes)&&_t(r.position)&&_t(r.setPosition)&&_t(r.capacity)&&_t(r.getBufferIdentifier)&&_t(r.createLong);var ra=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Ah(r){let t=r[0]?[r[0]]:[],e,i,n,s;for(let o,a,c=0,l=0,h=r.length;++c<h;){if(o=t[l],a=r[c],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(t[++l]=a);continue}if({byteOffset:e,byteLength:n}=o,{byteOffset:i,byteLength:s}=a,e+n<i||i+s<e){a&&(t[++l]=a);continue}t[l]=new Uint8Array(o.buffer,e,i-e+s)}return t}function hn(r,t,e=0,i=t.byteLength){let n=r.byteLength,s=new Uint8Array(r.buffer,r.byteOffset,n),o=new Uint8Array(t.buffer,t.byteOffset,Math.min(i,n));return s.set(o,e),r}function ce(r,t){let e=Ah(r),i=e.reduce((h,d)=>h+d.byteLength,0),n,s,o,a=0,c=-1,l=Math.min(t||Number.POSITIVE_INFINITY,i);for(let h=e.length;++c<h;){if(n=e[c],s=n.subarray(0,Math.min(n.length,l-a)),l<=a+s.length){s.length<n.length?e[c]=n.subarray(s.length):s.length===n.length&&c++,o?hn(o,s,a):o=s;break}hn(o||(o=new Uint8Array(l)),s,a),a+=s.length}return[o||new Uint8Array(0),e.slice(c),i-(o?o.byteLength:0)]}function V(r,t){let e=ys(t)?t.value:t;return e instanceof r?r===Uint8Array?new r(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=ke(e)),e instanceof ArrayBuffer?new r(e):e instanceof ra?new r(e):jc(e)?V(r,e.bytes()):ArrayBuffer.isView(e)?e.byteLength<=0?new r(0):new r(e.buffer,e.byteOffset,e.byteLength/r.BYTES_PER_ELEMENT):r.from(e)):new r(0)}var Th=r=>V(Int8Array,r),Dh=r=>V(Int16Array,r),kr=r=>V(Int32Array,r),vs=r=>V(BigInt64Array,r),D=r=>V(Uint8Array,r),Fh=r=>V(Uint16Array,r),Oh=r=>V(Uint32Array,r),Nh=r=>V(BigUint64Array,r),Mh=r=>V(Float32Array,r),Eh=r=>V(Float64Array,r),Lh=r=>V(Uint8ClampedArray,r),ea=r=>(r.next(),r);function*Pe(r,t){let e=function*(n){yield n},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof ra?e(t):De(t)?t:e(t);return yield*ea(function*(n){let s=null;do s=n.next(yield V(r,s));while(!s.done)}(i[Symbol.iterator]())),new r}var Uh=r=>Pe(Int8Array,r),Rh=r=>Pe(Int16Array,r),Ch=r=>Pe(Int32Array,r),ia=r=>Pe(Uint8Array,r),Vh=r=>Pe(Uint16Array,r),jh=r=>Pe(Uint32Array,r),kh=r=>Pe(Float32Array,r),Ph=r=>Pe(Float64Array,r),zh=r=>Pe(Uint8ClampedArray,r);function Fe(r,t){return ae(this,arguments,function*(){if(Te(t))return yield U(yield U(yield*mi(Ae(Fe(r,yield U(t))))));let i=function(o){return ae(this,arguments,function*(){yield yield U(yield U(o))})},n=function(o){return ae(this,arguments,function*(){yield U(yield*mi(Ae(ea(function*(a){let c=null;do c=a.next(yield c?.value);while(!c.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof ra?i(t):De(t)?n(t):pe(t)?t:i(t);return yield U(yield*mi(Ae(ea(function(o){return ae(this,arguments,function*(){let a=null;do a=yield U(o.next(yield yield U(V(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield U(new r)})}var $h=r=>Fe(Int8Array,r),Hh=r=>Fe(Int16Array,r),Wh=r=>Fe(Int32Array,r),na=r=>Fe(Uint8Array,r),Gh=r=>Fe(Uint16Array,r),Yh=r=>Fe(Uint32Array,r),Jh=r=>Fe(Float32Array,r),Zh=r=>Fe(Float64Array,r),qh=r=>Fe(Uint8ClampedArray,r);function Is(r,t,e){if(r!==0){e=e.slice(0,t);for(let i=-1,n=e.length;++i<n;)e[i]+=r}return e.subarray(0,t)}function sa(r,t){let e=0,i=r.length;if(i!==t.length)return!1;if(i>0)do if(r[e]!==t[e])return!1;while(++e<i);return!0}var Dt={fromIterable(r){return Ss(Kh(r))},fromAsyncIterable(r){return Ss(Xh(r))},fromDOMStream(r){return Ss(Qh(r))},fromNodeStream(r){return Ss(td(r))},toDOMStream(r,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(r,t){throw new Error('"toNodeStream" not available in this environment')}},Ss=r=>(r.next(),r);function*Kh(r){let t,e=!1,i=[],n,s,o,a=0;function c(){return s==="peek"?ce(i,o)[0]:([n,i,a]=ce(i,o),n)}({cmd:s,size:o}=(yield(()=>null)())||{cmd:"read",size:0});let l=ia(r)[Symbol.iterator]();try{do if({done:t,value:n}=Number.isNaN(o-a)?l.next():l.next(o-a),!t&&n.byteLength>0&&(i.push(n),a+=n.byteLength),t||o<=a)do({cmd:s,size:o}=yield c());while(o<a);while(!t)}catch(h){e=!0,typeof l.throw=="function"&&l.throw(h)}finally{e===!1&&typeof l.return=="function"&&l.return(null)}return null}function Xh(r){return ae(this,arguments,function*(){let e,i=!1,n=[],s,o,a,c=0;function l(){return o==="peek"?ce(n,a)[0]:([s,n,c]=ce(n,a),s)}({cmd:o,size:a}=(yield yield U((()=>null)()))||{cmd:"read",size:0});let h=na(r)[Symbol.asyncIterator]();try{do if({done:e,value:s}=Number.isNaN(a-c)?yield U(h.next()):yield U(h.next(a-c)),!e&&s.byteLength>0&&(n.push(s),c+=s.byteLength),e||a<=c)do({cmd:o,size:a}=yield yield U(l()));while(a<c);while(!e)}catch(d){i=!0,typeof h.throw=="function"&&(yield U(h.throw(d)))}finally{i===!1&&typeof h.return=="function"&&(yield U(h.return(new Uint8Array(0))))}return yield U(null)})}function Qh(r){return ae(this,arguments,function*(){let e=!1,i=!1,n=[],s,o,a,c=0;function l(){return o==="peek"?ce(n,a)[0]:([s,n,c]=ce(n,a),s)}({cmd:o,size:a}=(yield yield U((()=>null)()))||{cmd:"read",size:0});let h=new ca(r);try{do if({done:e,value:s}=Number.isNaN(a-c)?yield U(h.read()):yield U(h.read(a-c)),!e&&s.byteLength>0&&(n.push(D(s)),c+=s.byteLength),e||a<=c)do({cmd:o,size:a}=yield yield U(l()));while(a<c);while(!e)}catch(d){i=!0,yield U(h.cancel(d))}finally{i===!1?yield U(h.cancel()):r.locked&&h.releaseLock()}return yield U(null)})}var ca=class{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return y(this,void 0,void 0,function*(){let{reader:e,source:i}=this;e&&(yield e.cancel(t).catch(()=>{})),i&&i.locked&&this.releaseLock()})}read(t){return y(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};let e=yield this.reader.read();return!e.done&&(e.value=D(e)),e})}},aa=(r,t)=>{let e=n=>i([t,n]),i;return[t,e,new Promise(n=>(i=n)&&r.once(t,e))]};function td(r){return ae(this,arguments,function*(){let e=[],i="error",n=!1,s=null,o,a,c=0,l=[],h;function d(){return o==="peek"?ce(l,a)[0]:([h,l,c]=ce(l,a),h)}if({cmd:o,size:a}=(yield yield U((()=>null)()))||{cmd:"read",size:0},r.isTTY)return yield yield U(new Uint8Array(0)),yield U(null);try{e[0]=aa(r,"end"),e[1]=aa(r,"error");do{if(e[2]=aa(r,"readable"),[i,s]=yield U(Promise.race(e.map(m=>m[2]))),i==="error")break;if((n=i==="end")||(Number.isFinite(a-c)?(h=D(r.read(a-c)),h.byteLength<a-c&&(h=D(r.read()))):h=D(r.read()),h.byteLength>0&&(l.push(h),c+=h.byteLength)),n||a<=c)do({cmd:o,size:a}=yield yield U(d()));while(a<c)}while(!n)}finally{yield U(p(e,i==="error"?s:null))}return yield U(null);function p(m,N){return h=l=null,new Promise((b,C)=>{for(let[J,ht]of m)r.off(J,ht);try{let J=r.destroy;J&&J.call(r,N),N=void 0}catch(J){N=J||N}finally{N!=null?C(N):b()}})}})}var Y;(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(Y||(Y={}));var Q;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(Q||(Q={}));var Z;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(Z||(Z={}));var st;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(st||(st={}));var g;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(g||(g={}));var q;(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME",r[r.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(q||(q={}));var ze=new Int32Array(2),Bs=new Float32Array(ze.buffer),xs=new Float64Array(ze.buffer),yi=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var dn;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(dn||(dn={}));var wt=class{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new wt(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return ze[0]=this.readInt32(t),Bs[0]}readFloat64(t){return ze[yi?0:1]=this.readInt32(t),ze[yi?1:0]=this.readInt32(t+4),xs[0]}writeInt8(t,e){this.bytes_[t]=e}writeUint8(t,e){this.bytes_[t]=e}writeInt16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}writeUint64(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}writeFloat32(t,e){Bs[0]=e,this.writeInt32(t,ze[0])}writeFloat64(t,e){xs[0]=e,this.writeInt32(t,ze[yi?0:1]),this.writeInt32(t+4,ze[yi?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let e=0;e<4;e++)t+=String.fromCharCode(this.readInt8(this.position_+4+e));return t}__offset(t,e){let i=t-this.readInt32(t);return e<this.readInt16(i)?this.readInt16(i+e):0}__union(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t}__string(t,e){t+=this.readInt32(t);let i=this.readInt32(t);t+=4;let n=this.bytes_.subarray(t,t+i);return e===dn.UTF8_BYTES?n:this.text_decoder_.decode(n)}__union_with_string(t,e){return typeof t=="string"?this.__string(e):this.__union(t,e)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let e=0;e<4;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+4+e))return!1;return!0}createScalarList(t,e){let i=[];for(let n=0;n<e;++n){let s=t(n);s!==null&&i.push(s)}return i}createObjList(t,e){let i=[];for(let n=0;n<e;++n){let s=t(n);s!==null&&i.push(s.unpack())}return i}};var cr=class{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let e;t?e=t:e=1024,this.bb=wt.allocate(e),this.space=e}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,e){t>this.minalign&&(this.minalign=t);let i=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space<i+t+e;){let n=this.bb.capacity();this.bb=cr.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(i)}pad(t){for(let e=0;e<t;e++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,e,i){(this.force_defaults||e!=i)&&(this.addInt8(e),this.slot(t))}addFieldInt16(t,e,i){(this.force_defaults||e!=i)&&(this.addInt16(e),this.slot(t))}addFieldInt32(t,e,i){(this.force_defaults||e!=i)&&(this.addInt32(e),this.slot(t))}addFieldInt64(t,e,i){(this.force_defaults||e!==i)&&(this.addInt64(e),this.slot(t))}addFieldFloat32(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat32(e),this.slot(t))}addFieldFloat64(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat64(e),this.slot(t))}addFieldOffset(t,e,i){(this.force_defaults||e!=i)&&(this.addOffset(e),this.slot(t))}addFieldStruct(t,e,i){e!=i&&(this.nested(e),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let e=t.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let i=e<<1,n=wt.allocate(i);return n.setPosition(i-e),n.bytes().set(t.bytes(),i-e),n}addOffset(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let t=this.offset(),e=this.vtable_in_use-1;for(;e>=0&&this.vtable[e]==0;e--);let i=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);let n=2;this.addInt16(t-this.object_start);let s=(i+n)*2;this.addInt16(s);let o=0,a=this.space;t:for(e=0;e<this.vtables.length;e++){let c=this.bb.capacity()-this.vtables[e];if(s==this.bb.readInt16(c)){for(let l=2;l<s;l+=2)if(this.bb.readInt16(a+l)!=this.bb.readInt16(c+l))continue t;o=this.vtables[e];break}}return o?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,o-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,e,i){let n=i?4:0;if(e){let s=e;if(this.prep(this.minalign,4+4+n),s.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let o=4-1;o>=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,4+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){let i=this.bb.capacity()-t,n=i-this.bb.readInt32(i);if(!(e<this.bb.readInt16(n)&&this.bb.readInt16(n+e)!=0))throw new TypeError("FlatBuffers: field "+e+" must be set")}startVector(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(4,t*e),this.prep(i,t*e)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let e=this.createString(t);return this.string_maps.set(t,e),e}createString(t){if(t==null)return 0;let e;return t instanceof Uint8Array?e=t:e=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let e=[];for(let i=0;i<t.length;++i){let n=t[i];if(n!==null)e.push(this.createObjectOffset(n));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var Pr;(function(r){r[r.BUFFER=0]="BUFFER"})(Pr||(Pr={}));var Ct;(function(r){r[r.LZ4_FRAME=0]="LZ4_FRAME",r[r.ZSTD=1]="ZSTD"})(Ct||(Ct={}));var Nt=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBodyCompression(t,e){return(e||new Nt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+4),(e||new Nt).__init(t.readInt32(t.position())+t.position(),t)}codec(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):Ct.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Pr.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,Ct.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,Pr.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,i){return Nt.startBodyCompression(t),Nt.addCodec(t,e),Nt.addMethod(t,i),Nt.endBodyCompression(t)}};var gi=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,e,i){return t.prep(8,16),t.writeInt64(BigInt(i??0)),t.writeInt64(BigInt(e??0)),t.offset()}};var bi=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,e,i){return t.prep(8,16),t.writeInt64(BigInt(i??0)),t.writeInt64(BigInt(e??0)),t.offset()}};var Ft=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsRecordBatch(t,e){return(e||new Ft).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+4),(e||new Ft).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}nodes(t,e){let i=this.bb.__offset(this.bb_pos,6);return i?(e||new bi).__init(this.bb.__vector(this.bb_pos+i)+t*16,this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,e){let i=this.bb.__offset(this.bb_pos,8);return i?(e||new gi).__init(this.bb.__vector(this.bb_pos+i)+t*16,this.bb):null}buffersLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){let e=this.bb.__offset(this.bb_pos,10);return e?(t||new Nt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addNodes(t,e){t.addFieldOffset(1,e,0)}static startNodesVector(t,e){t.startVector(16,e,8)}static addBuffers(t,e){t.addFieldOffset(2,e,0)}static startBuffersVector(t,e){t.startVector(16,e,8)}static addCompression(t,e){t.addFieldOffset(3,e,0)}static endRecordBatch(t){return t.endObject()}};var ye=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryBatch(t,e){return(e||new ye).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+4),(e||new ye).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}data(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new Ft).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addData(t,e){t.addFieldOffset(1,e,0)}static addIsDelta(t,e){t.addFieldInt8(2,+e,0)}static endDictionaryBatch(t){return t.endObject()}};var Fr;(function(r){r[r.Little=0]="Little",r[r.Big=1]="Big"})(Fr||(Fr={}));var fn;(function(r){r[r.DenseArray=0]="DenseArray"})(fn||(fn={}));var It=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInt(t,e){return(e||new It).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+4),(e||new It).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startInt(t){t.startObject(2)}static addBitWidth(t,e){t.addFieldInt32(0,e,0)}static addIsSigned(t,e){t.addFieldInt8(1,+e,0)}static endInt(t){return t.endObject()}static createInt(t,e,i){return It.startInt(t),It.addBitWidth(t,e),It.addIsSigned(t,i),It.endInt(t)}};var le=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryEncoding(t,e){return(e||new le).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+4),(e||new le).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}indexType(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new It).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isOrdered(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):fn.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addIndexType(t,e){t.addFieldOffset(1,e,0)}static addIsOrdered(t,e){t.addFieldInt8(2,+e,0)}static addDictionaryKind(t,e){t.addFieldInt16(3,e,fn.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var tt=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKeyValue(t,e){return(e||new tt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+4),(e||new tt).__init(t.readInt32(t.position())+t.position(),t)}key(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}value(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,e){t.addFieldOffset(0,e,0)}static addValue(t,e){t.addFieldOffset(1,e,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,e,i){return tt.startKeyValue(t),tt.addKey(t,e),tt.addValue(t,i),tt.endKeyValue(t)}};var $e=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBinary(t,e){return(e||new $e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+4),(e||new $e).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return $e.startBinary(t),$e.endBinary(t)}};var He=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBool(t,e){return(e||new He).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+4),(e||new He).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return He.startBool(t),He.endBool(t)}};var $t=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDate(t,e){return(e||new $t).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+4),(e||new $t).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):st.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,st.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return $t.startDate(t),$t.addUnit(t,e),$t.endDate(t)}};var St=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDecimal(t,e){return(e||new St).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+4),(e||new St).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):128}static startDecimal(t){t.startObject(3)}static addPrecision(t,e){t.addFieldInt32(0,e,0)}static addScale(t,e){t.addFieldInt32(1,e,0)}static addBitWidth(t,e){t.addFieldInt32(2,e,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,e,i,n){return St.startDecimal(t),St.addPrecision(t,e),St.addScale(t,i),St.addBitWidth(t,n),St.endDecimal(t)}};var Ht=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDuration(t,e){return(e||new Ht).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(t,e){return t.setPosition(t.position()+4),(e||new Ht).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):g.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,g.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,e){return Ht.startDuration(t),Ht.addUnit(t,e),Ht.endDuration(t)}};var Wt=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeBinary(t,e){return(e||new Wt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+4),(e||new Wt).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,e){return Wt.startFixedSizeBinary(t),Wt.addByteWidth(t,e),Wt.endFixedSizeBinary(t)}};var Gt=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeList(t,e){return(e||new Gt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+4),(e||new Gt).__init(t.readInt32(t.position())+t.position(),t)}listSize(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,e){return Gt.startFixedSizeList(t),Gt.addListSize(t,e),Gt.endFixedSizeList(t)}};var Yt=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFloatingPoint(t,e){return(e||new Yt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+4),(e||new Yt).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Z.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,Z.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return Yt.startFloatingPoint(t),Yt.addPrecision(t,e),Yt.endFloatingPoint(t)}};var Jt=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInterval(t,e){return(e||new Jt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+4),(e||new Jt).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):q.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,q.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return Jt.startInterval(t),Jt.addUnit(t,e),Jt.endInterval(t)}};var We=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeBinary(t,e){return(e||new We).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeBinary(t,e){return t.setPosition(t.position()+4),(e||new We).__init(t.readInt32(t.position())+t.position(),t)}static startLargeBinary(t){t.startObject(0)}static endLargeBinary(t){return t.endObject()}static createLargeBinary(t){return We.startLargeBinary(t),We.endLargeBinary(t)}};var Ge=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeUtf8(t,e){return(e||new Ge).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeUtf8(t,e){return t.setPosition(t.position()+4),(e||new Ge).__init(t.readInt32(t.position())+t.position(),t)}static startLargeUtf8(t){t.startObject(0)}static endLargeUtf8(t){return t.endObject()}static createLargeUtf8(t){return Ge.startLargeUtf8(t),Ge.endLargeUtf8(t)}};var Ye=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsList(t,e){return(e||new Ye).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+4),(e||new Ye).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return Ye.startList(t),Ye.endList(t)}};var Zt=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMap(t,e){return(e||new Zt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+4),(e||new Zt).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){let t=this.bb.__offset(this.bb_pos,4);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startMap(t){t.startObject(1)}static addKeysSorted(t,e){t.addFieldInt8(0,+e,0)}static endMap(t){return t.endObject()}static createMap(t,e){return Zt.startMap(t),Zt.addKeysSorted(t,e),Zt.endMap(t)}};var Je=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNull(t,e){return(e||new Je).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,e){return t.setPosition(t.position()+4),(e||new Je).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return Je.startNull(t),Je.endNull(t)}};var Ze=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsStruct_(t,e){return(e||new Ze).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+4),(e||new Ze).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return Ze.startStruct_(t),Ze.endStruct_(t)}};var Mt=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTime(t,e){return(e||new Mt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+4),(e||new Mt).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):g.MILLISECOND}bitWidth(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(t,e){t.addFieldInt16(0,e,g.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,i){return Mt.startTime(t),Mt.addUnit(t,e),Mt.addBitWidth(t,i),Mt.endTime(t)}};var Et=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTimestamp(t,e){return(e||new Et).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+4),(e||new Et).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):g.SECOND}timezone(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,e){t.addFieldInt16(0,e,g.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,i){return Et.startTimestamp(t),Et.addUnit(t,e),Et.addTimezone(t,i),Et.endTimestamp(t)}};var Bt=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUnion(t,e){return(e||new Bt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+4),(e||new Bt).__init(t.readInt32(t.position())+t.position(),t)}mode(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Q.Sparse}typeIds(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+t*4):0}typeIdsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(t,e){t.addFieldInt16(0,e,Q.Sparse)}static addTypeIds(t,e){t.addFieldOffset(1,e,0)}static createTypeIdsVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addInt32(e[i]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,i){return Bt.startUnion(t),Bt.addMode(t,e),Bt.addTypeIds(t,i),Bt.endUnion(t)}};var qe=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUtf8(t,e){return(e||new qe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+4),(e||new qe).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return qe.startUtf8(t),qe.endUtf8(t)}};var K;(