@loaders.gl/scene 5.0.0-beta.5 → 5.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dist.min.js CHANGED
@@ -9,7 +9,7 @@
9
9
  `;)this.offset++;else if(e==="/"&&this.source[this.offset+1]==="*"){for(this.offset+=2;this.offset<this.source.length&&!this.source.startsWith("*/",this.offset);)this.source[this.offset]===`
10
10
  `&&this.line++,this.offset++;this.offset+=2}else if(this.source.startsWith('"""',this.offset)){for(this.offset+=3;this.offset<this.source.length&&!this.source.startsWith('"""',this.offset);)this.source[this.offset]===`
11
11
  `&&this.line++,this.offset++;this.offset+=3}else break}}readQuotedString(e){this.offset++;let t="";for(;this.offset<this.source.length;){let n=this.source[this.offset++];if(n===e)break;if(n==="\\"&&this.offset<this.source.length){let s=this.source[this.offset++];t+=s==="n"?`
12
- `:s}else t+=n}return t}readDelimitedValue(e){this.offset++;let t=this.offset;for(;this.offset<this.source.length&&this.source[this.offset]!==e;)this.offset++;let n=this.source.slice(t,this.offset);return this.offset++,n}}});function Yw(r){let e=new DataView(r),t=FB(e),n=e.getUint16(t+10,!0),s=e.getUint32(t+16,!0),i=s,o=new Map,a=new TextDecoder,c=0;for(let u=0;u<n;u++){if(s+46>t)throw new Error("USDZ archive contains a truncated ZIP central-directory entry.");if(e.getUint32(s,!0)!==33639248)throw new Error("USDZ archive contains an invalid ZIP central-directory entry.");let l=e.getUint16(s+10,!0),f=e.getUint32(s+20,!0),d=e.getUint32(s+24,!0),h=e.getUint16(s+28,!0),m=e.getUint16(s+30,!0),b=e.getUint16(s+32,!0),g=e.getUint32(s+42,!0);if(s+46+h+m+b>t)throw new Error("USDZ archive contains a truncated ZIP filename or extra field.");let y=a.decode(new Uint8Array(r,s+46,h));if(l!==0)throw new Error(`USDZ entry "${y}" is compressed; USDZ requires stored ZIP entries.`);if(g+30>i||f!==d)throw new Error(`USDZ entry "${y}" has invalid stored ZIP bounds.`);if(e.getUint32(g,!0)!==67324752)throw new Error(`USDZ entry "${y}" has an invalid local ZIP header.`);let x=e.getUint16(g+26,!0),T=e.getUint16(g+28,!0),_=g+30+x+T;if((e.getUint16(s+8,!0)|e.getUint16(g+6,!0))&1)throw new Error(`USDZ entry "${y}" is encrypted.`);if(_+f>i||e.getUint16(g+8,!0)!==0||a.decode(new Uint8Array(r,g+30,x))!==y||o.has(y))throw new Error(`USDZ entry "${y}" has invalid or duplicate stored ZIP data.`);if(c+=f,c>r.byteLength)throw new Error("USDZ archive exceeds its stored data budget.");o.set(y,r.slice(_,_+f)),s+=46+h+m+b}return o}function FB(r){let e=Math.max(0,r.byteLength-65557);for(let t=r.byteLength-22;t>=e;t--)if(r.getUint32(t,!0)===101010256)return t;throw new Error("USDZ archive does not contain a ZIP end-of-central-directory record.")}var Qw=p(()=>{"use strict"});async function Jd(r,e={},t){let n=RB(e.core?.baseUrl,t?.url),s={fetch:async o=>{let a=await(t?.fetch||fetch)(o);if(!(a instanceof Response))throw new Error(`OpenUSD reference "${o}" did not return an HTTP response.`);if(!a.ok)throw new Error(`Unable to load OpenUSD reference "${o}": ${a.status}.`);return a},cache:new Map,archiveFiles:new Map,layers:new Set,options:{...e,usd:{...NB,...e.usd}}},i;if(VB(r)){let o=Yw(r),a=o.keys().next().value;if(!a||!/\.(?:usd[ac]?)$/i.test(a))throw new Error("USDZ archive has no supported USD root layer.");let c="https://usd.archive/",u=Object.create(null);for(let[f,d]of o){let h=new URL(f,c);if(f.startsWith("/")||/^[a-z][a-z\d+.-]*:/i.test(f)||f.includes("\\")||/[\u0000-\u001f\u007f]/.test(f)||f.trim()!==f||f.split("/").some(m=>{let b=m.replace(/%2e/gi,".");return b==="."||b===".."})||h.origin!==new URL(c).origin||h.search||h.hash||u[h.href])throw new Error(`USDZ entry "${f}" has an ambiguous package URL.`);s.archiveFiles.set(h.href,d),u[h.href]=DB(f,d)}let l=new URL(a,c).href;i=qd(o.get(a),l),i.format="usdz",i.assets=u}else i=qd(r,n);return i.url&&(tx(i,i.url),s.layers.add(i.url)),s.options.usd?.compose!==!1&&(i.rootPrims=await Kd(i.rootPrims,i.url,{},s,0)),i.layers=Array.from(s.layers),n&&(i.url=n),i}function DB(r,e){let t=r.slice(r.lastIndexOf(".")+1).toLowerCase(),n=t==="png"?"image/png":/^(?:jpe?g)$/.test(t)?"image/jpeg":void 0;return n?{path:r,data:e,mimeType:n}:{path:r,data:e}}function RB(r,e){let t=ex(r);return t||ex(e)||r||e}function ex(r){try{return r?new URL(r).href:void 0}catch{return}}function kB(r,e){try{return new URL(r,e).href}catch{let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t>=0?`${e.slice(0,t+1)}${r}`:r}}function qd(r,e){return Zw.decode(r.slice(0,8))===OB?qw(r,e):Hw(Zw.decode(r),e)}function tx(r,e){let t=[...r.rootPrims];for(;t.length;){let n=t.pop();for(let s of Object.values(n.attributes))s.sourceUrl=e;for(let s of n.children)t.push(s);if("variants"in n)for(let s of Object.values(n.variants))for(let i of Object.values(s))t.push(i)}}async function Kd(r,e,t,n,s){if(s>(n.options.usd?.maxReferenceDepth??12))throw new Error("OpenUSD reference composition exceeded the configured depth limit.");let i=[];for(let o of r){if(o.specifier==="class")continue;let c={...PB(o.metadata.variants),...t,...n.options.usd?.variantSelections},u=o.sourceUrl||e,l=ka(o);for(let[d,h]of Object.entries(l.variants)){let m=c[d]||Object.keys(h)[0],b=h[m];b&&(l=Hd(l,{...l,attributes:b.attributes,metadata:b.metadata,children:b.children,variants:{}}))}let f=nx(l);if(n.options.usd?.loadReferences!==!1&&f.length>0)for(let d of f){if(!u)throw new Error("OpenUSD references require a source URL or options.core.baseUrl.");let h=kB(d.assetPath,u),m=await CB(h,n),b=UB(m,d.primPath),g=await Kd(b,h,c,n,s+1);for(let y of g)l=Hd(sx(y,l.path),l)}l.children=await Kd(l.children,u,c,n,s),i.push(l)}return i}async function CB(r,e){let t=e.cache.get(r);return t||(t=(async()=>{let s=e.archiveFiles.get(r);if(!s){let o;try{o=await e.fetch(r)}catch(a){throw new Error(`Unable to fetch USD layer "${r}": ${String(a)}`)}s=o.arrayBuffer()}let i=qd(await s,r);return tx(i,r),e.layers.add(r),i})(),e.cache.set(r,t)),t}function UB(r,e){let t=e||r.metadata.defaultPrim;if(typeof t!="string")return r.rootPrims;let n=t.startsWith("/")?t:`/${t}`,s=rx(r.rootPrims,n);return s?[s]:[]}function rx(r,e){for(let t of r){if(t.path===e)return t;let n=rx(t.children,e);if(n)return n}}function nx(r){let e=[];for(let t of[r.metadata.references,r.metadata.payload,r.metadata.payloads])Array.isArray(t)?e.push(...t.filter(Xd)):Xd(t)&&e.push(t);return e}function PB(r){return!r||typeof r!="object"||Array.isArray(r)||Xd(r)?{}:Object.fromEntries(Object.entries(r).filter(e=>typeof e[1]=="string"))}function Xd(r){return!!(r&&typeof r=="object"&&!Array.isArray(r)&&"assetPath"in r)}function ka(r){return{...r,attributes:{...r.attributes},metadata:{...r.metadata},variants:{...r.variants},children:r.children.map(ka)}}function sx(r,e){let t=ka(r);return t.path=e,t.children=t.children.map(n=>sx(n,`${e}/${n.name}`)),t}function Hd(r,e){let t=r.children.map(ka);for(let n of e.children){let s=t.findIndex(i=>i.name===n.name);s>=0?t[s]=Hd(t[s],n):t.push(ka(n))}return{...r,...e,sourceUrl:nx(e).length>0?e.sourceUrl:r.sourceUrl||e.sourceUrl,type:e.type||r.type,attributes:{...r.attributes,...e.attributes},metadata:{...r.metadata,...e.metadata},variants:{...r.variants,...e.variants},children:t}}function VB(r){return r.byteLength>=4&&new DataView(r).getUint32(0,!0)===MB}var Zw,OB,MB,NB,ix=p(()=>{"use strict";Xw();Jw();Qw();Zw=new TextDecoder,OB="PXR-USDC",MB=67324752;NB={compose:!0,loadReferences:!0,maxReferenceDepth:12,variantSelections:{}}});async function zB(r,e,t){return Jd(new TextEncoder().encode(r).buffer,e,t)}var DU,jB,GB,ox=p(()=>{"use strict";ix();Yd();({preload:DU,...jB}=Na),GB={...jB,parse:Jd,parseText:zB}});var ax={};J(ax,{USDLoaderWithParser:()=>GB});var cx=p(()=>{"use strict";ox()});async function $B(){let{USDLoaderWithParser:r}=await Promise.resolve().then(()=>(cx(),ax));return r}var WB,Na,Yd=p(()=>{"use strict";WB="5.0.0-beta.5";Na={dataType:null,batchType:null,name:"Universal Scene Description",id:"usd",module:"scene",version:WB,extensions:["usd","usda","usdc","usdz"],mimeTypes:["model/vnd.usd","model/vnd.usda","model/vnd.usdc","model/vnd.usdz+zip"],text:!0,binary:!0,tests:["#usda","PXR-USDC","PK"],options:{usd:{compose:!0,loadReferences:!0,maxReferenceDepth:12,variantSelections:{}}},preload:$B}});var ux,lx=p(()=>{"use strict";ux={name:"OBJ",id:"obj",module:"scene",encoding:"text",format:"obj",extensions:["obj"],mimeTypes:["text/plain"]}});function dx(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(r);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(r,n[s])&&(t[n[s]]=r[n[s]]);return t}function F(r,e,t,n){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{u(n.next(l))}catch(f){o(f)}}function c(l){try{u(n.throw(l))}catch(f){o(f)}}function u(l){l.done?i(l.value):s(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})}function fx(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Y(r){return this instanceof Y?(this.v=r,this):new Y(r)}function _t(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(h){return function(m){return Promise.resolve(m).then(h,f)}}function a(h,m){n[h]&&(s[h]=function(b){return new Promise(function(g,y){i.push([h,b,g,y])>1||c(h,b)})},m&&(s[h]=m(s[h])))}function c(h,m){try{u(n[h](m))}catch(b){d(i[0][3],b)}}function u(h){h.value instanceof Y?Promise.resolve(h.value.v).then(l,f):d(i[0][2],h)}function l(h){c("next",h)}function f(h){c("throw",h)}function d(h,m){h(m),i.shift(),i.length&&c(i[0][0],i[0][1])}}function Ao(r){var e,t;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=r[s]?function(o){return(t=!t)?{value:Y(r[s](o)),done:!1}:i?i(o):o}:i}}function Ht(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof fx=="function"?fx(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=r[i]&&function(o){return new Promise(function(a,c){o=r[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},o)}}var kt=p(()=>{});var hx,vo,qB,Jt,gn=p(()=>{hx=new TextDecoder("utf-8"),vo=hx.decode.bind(hx),qB=new TextEncoder,Jt=r=>qB.encode(r)});var KB,px,qe,At,Yt,Br,br,Eu,Lu,Bu,Fu,Ou,mx,Ca,bx,Mu,gx,Yn=p(()=>{KB=r=>typeof r=="number",px=r=>typeof r=="boolean",qe=r=>typeof r=="function",At=r=>r!=null&&Object(r)===r,Yt=r=>At(r)&&qe(r.then),Br=r=>At(r)&&qe(r[Symbol.iterator]),br=r=>At(r)&&qe(r[Symbol.asyncIterator]),Eu=r=>At(r)&&At(r.schema),Lu=r=>At(r)&&"done"in r&&"value"in r,Bu=r=>At(r)&&qe(r.stat)&&KB(r.fd),Fu=r=>At(r)&&Ca(r.body),Ou=r=>"_getDOMStream"in r&&"_getNodeStream"in r,mx=r=>At(r)&&qe(r.abort)&&qe(r.getWriter)&&!Ou(r),Ca=r=>At(r)&&qe(r.cancel)&&qe(r.getReader)&&!Ou(r),bx=r=>At(r)&&qe(r.end)&&qe(r.write)&&px(r.writable)&&!Ou(r),Mu=r=>At(r)&&qe(r.read)&&qe(r.pipe)&&px(r.readable)&&!Ou(r),gx=r=>At(r)&&qe(r.clear)&&qe(r.bytes)&&qe(r.position)&&qe(r.setPosition)&&qe(r.capacity)&&qe(r.getBufferIdentifier)&&qe(r.createLong)});var nh={};J(nh,{compareArrayLike:()=>rh,joinUint8Arrays:()=>Qt,memcpy:()=>Ua,rebaseValueOffsets:()=>Du,toArrayBufferView:()=>ee,toArrayBufferViewAsyncIterator:()=>Fr,toArrayBufferViewIterator:()=>Xr,toBigInt64Array:()=>Pa,toBigUint64Array:()=>ZB,toFloat32Array:()=>eF,toFloat32ArrayAsyncIterator:()=>bF,toFloat32ArrayIterator:()=>cF,toFloat64Array:()=>tF,toFloat64ArrayAsyncIterator:()=>gF,toFloat64ArrayIterator:()=>uF,toInt16Array:()=>JB,toInt16ArrayAsyncIterator:()=>dF,toInt16ArrayIterator:()=>sF,toInt32Array:()=>ui,toInt32ArrayAsyncIterator:()=>hF,toInt32ArrayIterator:()=>iF,toInt8Array:()=>HB,toInt8ArrayAsyncIterator:()=>fF,toInt8ArrayIterator:()=>nF,toUint16Array:()=>YB,toUint16ArrayAsyncIterator:()=>pF,toUint16ArrayIterator:()=>oF,toUint32Array:()=>QB,toUint32ArrayAsyncIterator:()=>mF,toUint32ArrayIterator:()=>aF,toUint8Array:()=>k,toUint8ArrayAsyncIterator:()=>th,toUint8ArrayIterator:()=>eh,toUint8ClampedArray:()=>rF,toUint8ClampedArrayAsyncIterator:()=>yF,toUint8ClampedArrayIterator:()=>lF});function XB(r){let e=r[0]?[r[0]]:[],t,n,s,i;for(let o,a,c=0,u=0,l=r.length;++c<l;){if(o=e[u],a=r[c],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(e[++u]=a);continue}if({byteOffset:t,byteLength:s}=o,{byteOffset:n,byteLength:i}=a,t+s<n||n+i<t){a&&(e[++u]=a);continue}e[u]=new Uint8Array(o.buffer,t,n-t+i)}return e}function Ua(r,e,t=0,n=e.byteLength){let s=r.byteLength,i=new Uint8Array(r.buffer,r.byteOffset,s),o=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,s));return i.set(o,t),r}function Qt(r,e){let t=XB(r),n=t.reduce((l,f)=>l+f.byteLength,0),s,i,o,a=0,c=-1,u=Math.min(e||Number.POSITIVE_INFINITY,n);for(let l=t.length;++c<l;){if(s=t[c],i=s.subarray(0,Math.min(s.length,u-a)),u<=a+i.length){i.length<s.length?t[c]=s.subarray(i.length):i.length===s.length&&c++,o?Ua(o,i,a):o=i;break}Ua(o||(o=new Uint8Array(u)),i,a),a+=i.length}return[o||new Uint8Array(0),t.slice(c),n-(o?o.byteLength:0)]}function ee(r,e){let t=Lu(e)?e.value:e;return t instanceof r?r===Uint8Array?new r(t.buffer,t.byteOffset,t.byteLength):t:t?(typeof t=="string"&&(t=Jt(t)),t instanceof ArrayBuffer?new r(t):t instanceof Zd?new r(t):gx(t)?ee(r,t.bytes()):ArrayBuffer.isView(t)?t.byteLength<=0?new r(0):new r(t.buffer,t.byteOffset,t.byteLength/r.BYTES_PER_ELEMENT):r.from(t)):new r(0)}function*Xr(r,e){let t=function*(s){yield s},n=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Zd?t(e):Br(e)?e:t(e);return yield*Qd((function*(s){let i=null;do i=s.next(yield ee(r,i));while(!i.done)})(n[Symbol.iterator]())),new r}function Fr(r,e){return _t(this,arguments,function*(){if(Yt(e))return yield Y(yield Y(yield*Ao(Ht(Fr(r,yield Y(e))))));let n=function(o){return _t(this,arguments,function*(){yield yield Y(yield Y(o))})},s=function(o){return _t(this,arguments,function*(){yield Y(yield*Ao(Ht(Qd((function*(a){let c=null;do c=a.next(yield c?.value);while(!c.done)})(o[Symbol.iterator]())))))})},i=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Zd?n(e):Br(e)?s(e):br(e)?e:n(e);return yield Y(yield*Ao(Ht(Qd((function(o){return _t(this,arguments,function*(){let a=null;do a=yield Y(o.next(yield yield Y(ee(r,a))));while(!a.done)})})(i[Symbol.asyncIterator]()))))),yield Y(new r)})}function Du(r,e,t){if(r!==0){t=t.slice(0,e);let n=typeof t[0]=="bigint"?BigInt(r):r;for(let s=-1,i=t.length;++s<i;)t[s]+=n}return t.subarray(0,e)}function rh(r,e){let t=0,n=r.length;if(n!==e.length)return!1;if(n>0)do if(r[t]!==e[t])return!1;while(++t<n);return!0}var Zd,HB,JB,ui,Pa,k,YB,QB,ZB,eF,tF,rF,Qd,nF,sF,iF,eh,oF,aF,cF,uF,lF,fF,dF,hF,th,pF,mF,bF,gF,yF,Ke=p(()=>{kt();gn();Yn();Zd=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;HB=r=>ee(Int8Array,r),JB=r=>ee(Int16Array,r),ui=r=>ee(Int32Array,r),Pa=r=>ee(BigInt64Array,r),k=r=>ee(Uint8Array,r),YB=r=>ee(Uint16Array,r),QB=r=>ee(Uint32Array,r),ZB=r=>ee(BigUint64Array,r),eF=r=>ee(Float32Array,r),tF=r=>ee(Float64Array,r),rF=r=>ee(Uint8ClampedArray,r),Qd=r=>(r.next(),r);nF=r=>Xr(Int8Array,r),sF=r=>Xr(Int16Array,r),iF=r=>Xr(Int32Array,r),eh=r=>Xr(Uint8Array,r),oF=r=>Xr(Uint16Array,r),aF=r=>Xr(Uint32Array,r),cF=r=>Xr(Float32Array,r),uF=r=>Xr(Float64Array,r),lF=r=>Xr(Uint8ClampedArray,r);fF=r=>Fr(Int8Array,r),dF=r=>Fr(Int16Array,r),hF=r=>Fr(Int32Array,r),th=r=>Fr(Uint8Array,r),pF=r=>Fr(Uint16Array,r),mF=r=>Fr(Uint32Array,r),bF=r=>Fr(Float32Array,r),gF=r=>Fr(Float64Array,r),yF=r=>Fr(Uint8ClampedArray,r)});function*wF(r){let e,t=!1,n=[],s,i,o,a=0;function c(){return i==="peek"?Qt(n,o)[0]:([s,n,a]=Qt(n,o),s)}({cmd:i,size:o}=(yield null)||{cmd:"read",size:0});let u=eh(r)[Symbol.iterator]();try{do if({done:e,value:s}=Number.isNaN(o-a)?u.next():u.next(o-a),!e&&s.byteLength>0&&(n.push(s),a+=s.byteLength),e||o<=a)do({cmd:i,size:o}=yield c());while(o<a);while(!e)}catch(l){t=!0,typeof u.throw=="function"&&u.throw(l)}finally{t===!1&&typeof u.return=="function"&&u.return(null)}return null}function xF(r){return _t(this,arguments,function*(){let t,n=!1,s=[],i,o,a,c=0;function u(){return o==="peek"?Qt(s,a)[0]:([i,s,c]=Qt(s,a),i)}({cmd:o,size:a}=(yield yield Y(null))||{cmd:"read",size:0});let l=th(r)[Symbol.asyncIterator]();try{do if({done:t,value:i}=Number.isNaN(a-c)?yield Y(l.next()):yield Y(l.next(a-c)),!t&&i.byteLength>0&&(s.push(i),c+=i.byteLength),t||a<=c)do({cmd:o,size:a}=yield yield Y(u()));while(a<c);while(!t)}catch(f){n=!0,typeof l.throw=="function"&&(yield Y(l.throw(f)))}finally{n===!1&&typeof l.return=="function"&&(yield Y(l.return(new Uint8Array(0))))}return yield Y(null)})}function TF(r){return _t(this,arguments,function*(){let t=!1,n=!1,s=[],i,o,a,c=0;function u(){return o==="peek"?Qt(s,a)[0]:([i,s,c]=Qt(s,a),i)}({cmd:o,size:a}=(yield yield Y(null))||{cmd:"read",size:0});let l=new ih(r);try{do if({done:t,value:i}=Number.isNaN(a-c)?yield Y(l.read()):yield Y(l.read(a-c)),!t&&i.byteLength>0&&(s.push(k(i)),c+=i.byteLength),t||a<=c)do({cmd:o,size:a}=yield yield Y(u()));while(a<c);while(!t)}catch(f){n=!0,yield Y(l.cancel(f))}finally{n===!1?yield Y(l.cancel()):r.locked&&l.releaseLock()}return yield Y(null)})}function _F(r){return _t(this,arguments,function*(){let t=[],n="error",s=!1,i=null,o,a,c=0,u=[],l;function f(){return o==="peek"?Qt(u,a)[0]:([l,u,c]=Qt(u,a),l)}if({cmd:o,size:a}=(yield yield Y(null))||{cmd:"read",size:0},r.isTTY)return yield yield Y(new Uint8Array(0)),yield Y(null);try{t[0]=sh(r,"end"),t[1]=sh(r,"error");do{if(t[2]=sh(r,"readable"),[n,i]=yield Y(Promise.race(t.map(h=>h[2]))),n==="error")break;if((s=n==="end")||(Number.isFinite(a-c)?(l=k(r.read(a-c)),l.byteLength<a-c&&(l=k(r.read()))):l=k(r.read()),l.byteLength>0&&(u.push(l),c+=l.byteLength)),s||a<=c)do({cmd:o,size:a}=yield yield Y(f()));while(a<c)}while(!s)}finally{yield Y(d(t,n==="error"?i:null))}return yield Y(null);function d(h,m){return l=u=null,new Promise((b,g)=>{for(let[y,x]of h)r.off(y,x);try{let y=r.destroy;y&&y.call(r,m),m=void 0}catch(y){m=y||m}finally{m!=null?g(m):b()}})}})}var Qe,Ru,ih,sh,Va=p(()=>{kt();Ke();Qe={fromIterable(r){return Ru(wF(r))},fromAsyncIterable(r){return Ru(xF(r))},fromDOMStream(r){return Ru(TF(r))},fromNodeStream(r){return Ru(_F(r))},toDOMStream(r,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(r,e){throw new Error('"toNodeStream" not available in this environment')}},Ru=r=>(r.next(),r);ih=class{constructor(e){this.source=e,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(e){return F(this,void 0,void 0,function*(){let{reader:t,source:n}=this;t&&(yield t.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return F(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let t=yield this.reader.read();return!t.done&&(t.value=k(t)),t})}},sh=(r,e)=>{let t=s=>n([e,s]),n;return[e,t,new Promise(s=>(n=s)&&r.once(e,t))]}});var ge,ku=p(()=>{(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"})(ge||(ge={}))});var he,oh=p(()=>{(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(he||(he={}))});var le,ah=p(()=>{(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(le||(le={}))});var ye,ch=p(()=>{(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(ye||(ye={}))});var L,ja=p(()=>{(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(L||(L={}))});var ae,uh=p(()=>{(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"})(ae||(ae={}))});var Nu=p(()=>{});var Hr,Cu,Uu,Io,lh=p(()=>{Hr=new Int32Array(2),Cu=new Float32Array(Hr.buffer),Uu=new Float64Array(Hr.buffer),Io=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var Ga,fh=p(()=>{(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(Ga||(Ga={}))});var Ze,dh=p(()=>{Nu();fh();lh();Ze=class r{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new r(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return Hr[0]=this.readInt32(e),Cu[0]}readFloat64(e){return Hr[Io?0:1]=this.readInt32(e),Hr[Io?1:0]=this.readInt32(e+4),Uu[0]}writeInt8(e,t){this.bytes_[e]=t}writeUint8(e,t){this.bytes_[e]=t}writeInt16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){Cu[0]=t,this.writeInt32(e,Hr[0])}writeFloat64(e,t){Uu[0]=t,this.writeInt32(e,Hr[Io?0:1]),this.writeInt32(e+4,Hr[Io?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let t=0;t<4;t++)e+=String.fromCharCode(this.readInt8(this.position_+4+t));return e}__offset(e,t){let n=e-this.readInt32(e);return t<this.readInt16(n)?this.readInt16(n+t):0}__union(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e}__string(e,t){e+=this.readInt32(e);let n=this.readInt32(e);e+=4;let s=this.bytes_.subarray(e,e+n);return t===Ga.UTF8_BYTES?s:this.text_decoder_.decode(s)}__union_with_string(e,t){return typeof e=="string"?this.__string(t):this.__union(e,t)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+4}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let t=0;t<4;t++)if(e.charCodeAt(t)!=this.readInt8(this.position()+4+t))return!1;return!0}createScalarList(e,t){let n=[];for(let s=0;s<t;++s){let i=e(s);i!==null&&n.push(i)}return n}createObjList(e,t){let n=[];for(let s=0;s<t;++s){let i=e(s);i!==null&&n.push(i.unpack())}return n}}});var li,yx=p(()=>{dh();Nu();li=class r{constructor(e){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 t;e?t=e:t=1024,this.bb=Ze.allocate(t),this.space=t}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(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,t){e>this.minalign&&(this.minalign=e);let n=~(this.bb.capacity()-this.space+t)+1&e-1;for(;this.space<n+e+t;){let s=this.bb.capacity();this.bb=r.growByteBuffer(this.bb),this.space+=this.bb.capacity()-s}this.pad(n)}pad(e){for(let t=0;t<e;t++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,t,n){(this.force_defaults||t!=n)&&(this.addInt8(t),this.slot(e))}addFieldInt16(e,t,n){(this.force_defaults||t!=n)&&(this.addInt16(t),this.slot(e))}addFieldInt32(e,t,n){(this.force_defaults||t!=n)&&(this.addInt32(t),this.slot(e))}addFieldInt64(e,t,n){(this.force_defaults||t!==n)&&(this.addInt64(t),this.slot(e))}addFieldFloat32(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat32(t),this.slot(e))}addFieldFloat64(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat64(t),this.slot(e))}addFieldOffset(e,t,n){(this.force_defaults||t!=n)&&(this.addOffset(t),this.slot(e))}addFieldStruct(e,t,n){t!=n&&(this.nested(t),this.slot(e))}nested(e){if(e!=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(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){let t=e.capacity();if(t&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let n=t<<1,s=Ze.allocate(n);return s.setPosition(n-t),s.bytes().set(e.bytes(),n-t),s}addOffset(e){this.prep(4,0),this.writeInt32(this.offset()-e+4)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let t=0;t<e;t++)this.vtable[t]=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 e=this.offset(),t=this.vtable_in_use-1;for(;t>=0&&this.vtable[t]==0;t--);let n=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);let s=2;this.addInt16(e-this.object_start);let i=(n+s)*2;this.addInt16(i);let o=0,a=this.space;e:for(t=0;t<this.vtables.length;t++){let c=this.bb.capacity()-this.vtables[t];if(i==this.bb.readInt16(c)){for(let u=2;u<i;u+=2)if(this.bb.readInt16(a+u)!=this.bb.readInt16(c+u))continue e;o=this.vtables[t];break}}return o?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,o-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,t,n){let s=n?4:0;if(t){let i=t;if(this.prep(this.minalign,8+s),i.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let o=3;o>=0;o--)this.writeInt8(i.charCodeAt(o))}this.prep(this.minalign,4+s),this.addOffset(e),s&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){let n=this.bb.capacity()-e,s=n-this.bb.readInt32(n);if(!(t<this.bb.readInt16(s)&&this.bb.readInt16(s+t)!=0))throw new TypeError("FlatBuffers: field "+t+" must be set")}startVector(e,t,n){this.notNested(),this.vector_num_elems=t,this.prep(4,e*t),this.prep(n,e*t)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);let t=this.createString(e);return this.string_maps.set(e,t),t}createString(e){if(e==null)return 0;let t;return e instanceof Uint8Array?t=e:t=this.text_encoder.encode(e),this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector()}createByteVector(e){return e==null?0:(this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){let t=[];for(let n=0;n<e.length;++n){let s=e[n];if(s!==null)t.push(this.createObjectOffset(s));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return t}createStructOffsetList(e,t){return t(this,e.length),this.createObjectOffsetList(e.slice().reverse()),this.endVector()}}});var ce=p(()=>{Nu();lh();yx();dh();fh()});var fi,hh=p(()=>{(function(r){r[r.BUFFER=0]="BUFFER"})(fi||(fi={}))});var et,So=p(()=>{(function(r){r[r.LZ4_FRAME=0]="LZ4_FRAME",r[r.ZSTD=1]="ZSTD"})(et||(et={}))});var yn,ph=p(()=>{ce();hh();So();yn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBodyCompression(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):et.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):fi.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,t){e.addFieldInt8(0,t,et.LZ4_FRAME)}static addMethod(e,t){e.addFieldInt8(1,t,fi.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,t,n){return r.startBodyCompression(e),r.addCodec(e,t),r.addMethod(e,n),r.endBodyCompression(e)}}});var Eo,mh=p(()=>{Eo=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(e,t,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(t??0)),e.offset()}}});var Lo,bh=p(()=>{Lo=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(e,t,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(t??0)),e.offset()}}});var ot,gh=p(()=>{ce();ph();mh();bh();ot=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsRecordBatch(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}nodes(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new Lo).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Eo).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let t=this.bb.__offset(this.bb_pos,10);return t?(e||new yn).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}variadicBufferCounts(e){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}variadicBufferCountsLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startRecordBatch(e){e.startObject(5)}static addLength(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addNodes(e,t){e.addFieldOffset(1,t,0)}static startNodesVector(e,t){e.startVector(16,t,8)}static addBuffers(e,t){e.addFieldOffset(2,t,0)}static startBuffersVector(e,t){e.startVector(16,t,8)}static addCompression(e,t){e.addFieldOffset(3,t,0)}static addVariadicBufferCounts(e,t){e.addFieldOffset(4,t,0)}static createVariadicBufferCountsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startVariadicBufferCountsVector(e,t){e.startVector(8,t,8)}static endRecordBatch(e){return e.endObject()}}});var wn,wx=p(()=>{ce();gh();wn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryBatch(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}data(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new ot).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addData(e,t){e.addFieldOffset(1,t,0)}static addIsDelta(e,t){e.addFieldInt8(2,+t,0)}static endDictionaryBatch(e){return e.endObject()}}});var Qn,yh=p(()=>{(function(r){r[r.Little=0]="Little",r[r.Big=1]="Big"})(Qn||(Qn={}))});var za,xx=p(()=>{(function(r){r[r.DenseArray=0]="DenseArray"})(za||(za={}))});var Mr,Vu=p(()=>{ce();Mr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInt(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,t){e.addFieldInt32(0,t,0)}static addIsSigned(e,t){e.addFieldInt8(1,+t,0)}static endInt(e){return e.endObject()}static createInt(e,t,n){return r.startInt(e),r.addBitWidth(e,t),r.addIsSigned(e,n),r.endInt(e)}}});var Jr,wh=p(()=>{ce();xx();Vu();Jr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryEncoding(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}indexType(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Mr).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):za.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addIndexType(e,t){e.addFieldOffset(1,t,0)}static addIsOrdered(e,t){e.addFieldInt8(2,+t,0)}static addDictionaryKind(e,t){e.addFieldInt16(3,t,za.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}}});var Oe,Bo=p(()=>{ce();Oe=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKeyValue(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}key(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}value(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,t){e.addFieldOffset(0,t,0)}static addValue(e,t){e.addFieldOffset(1,t,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,t,n){return r.startKeyValue(e),r.addKey(e,t),r.addValue(e,n),r.endKeyValue(e)}}});var Wa,Tx=p(()=>{ce();Wa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinary(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return r.startBinary(e),r.endBinary(e)}}});var $a,_x=p(()=>{ce();$a=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinaryView(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinaryView(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startBinaryView(e){e.startObject(0)}static endBinaryView(e){return e.endObject()}static createBinaryView(e){return r.startBinaryView(e),r.endBinaryView(e)}}});var qa,Ax=p(()=>{ce();qa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBool(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return r.startBool(e),r.endBool(e)}}});var Zn,xh=p(()=>{ce();ch();Zn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDate(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ye.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,ye.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,t){return r.startDate(e),r.addUnit(e,t),r.endDate(e)}}});var Yr,Th=p(()=>{ce();Yr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDecimal(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,t){e.addFieldInt32(0,t,0)}static addScale(e,t){e.addFieldInt32(1,t,0)}static addBitWidth(e,t){e.addFieldInt32(2,t,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,t,n,s){return r.startDecimal(e),r.addPrecision(e,t),r.addScale(e,n),r.addBitWidth(e,s),r.endDecimal(e)}}});var es,_h=p(()=>{ce();ja();es=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDuration(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):L.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,L.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,t){return r.startDuration(e),r.addUnit(e,t),r.endDuration(e)}}});var ts,Ah=p(()=>{ce();ts=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeBinary(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,t){return r.startFixedSizeBinary(e),r.addByteWidth(e,t),r.endFixedSizeBinary(e)}}});var rs,vh=p(()=>{ce();rs=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeList(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,t){return r.startFixedSizeList(e),r.addListSize(e,t),r.endFixedSizeList(e)}}});var ns,Ih=p(()=>{ce();ah();ns=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFloatingPoint(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):le.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,t){e.addFieldInt16(0,t,le.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,t){return r.startFloatingPoint(e),r.addPrecision(e,t),r.endFloatingPoint(e)}}});var ss,Sh=p(()=>{ce();uh();ss=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInterval(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ae.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,ae.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,t){return r.startInterval(e),r.addUnit(e,t),r.endInterval(e)}}});var Ka,vx=p(()=>{ce();Ka=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeBinary(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return r.startLargeBinary(e),r.endLargeBinary(e)}}});var Xa,Ix=p(()=>{ce();Xa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeList(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeList(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startLargeList(e){e.startObject(0)}static endLargeList(e){return e.endObject()}static createLargeList(e){return r.startLargeList(e),r.endLargeList(e)}}});var Ha,Sx=p(()=>{ce();Ha=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeUtf8(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return r.startLargeUtf8(e),r.endLargeUtf8(e)}}});var Ja,Ex=p(()=>{ce();Ja=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsList(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return r.startList(e),r.endList(e)}}});var is,Eh=p(()=>{ce();is=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMap(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,t){e.addFieldInt8(0,+t,0)}static endMap(e){return e.endObject()}static createMap(e,t){return r.startMap(e),r.addKeysSorted(e,t),r.endMap(e)}}});var Ya,Lx=p(()=>{ce();Ya=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNull(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return r.startNull(e),r.endNull(e)}}});var Qa,Bx=p(()=>{ce();Qa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsStruct_(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return r.startStruct_(e),r.endStruct_(e)}}});var xn,Lh=p(()=>{ce();ja();xn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTime(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):L.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,L.MILLISECOND)}static addBitWidth(e,t){e.addFieldInt32(1,t,32)}static endTime(e){return e.endObject()}static createTime(e,t,n){return r.startTime(e),r.addUnit(e,t),r.addBitWidth(e,n),r.endTime(e)}}});var Tn,Bh=p(()=>{ce();ja();Tn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTimestamp(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):L.SECOND}timezone(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,L.SECOND)}static addTimezone(e,t){e.addFieldOffset(1,t,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,t,n){return r.startTimestamp(e),r.addUnit(e,t),r.addTimezone(e,n),r.endTimestamp(e)}}});var Dr,Fh=p(()=>{ce();oh();Dr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUnion(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):he.Sparse}typeIds(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,t){e.addFieldInt16(0,t,he.Sparse)}static addTypeIds(e,t){e.addFieldOffset(1,t,0)}static createTypeIdsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(e,t,n){return r.startUnion(e),r.addMode(e,t),r.addTypeIds(e,n),r.endUnion(e)}}});var Za,Fx=p(()=>{ce();Za=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return r.startUtf8(e),r.endUtf8(e)}}});var ec,Ox=p(()=>{ce();ec=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8View(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8View(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8View(e){e.startObject(0)}static endUtf8View(e){return e.endObject()}static createUtf8View(e){return r.startUtf8View(e),r.endUtf8View(e)}}});var z,ju=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.FloatingPoint=3]="FloatingPoint",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct_=13]="Struct_",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList",r[r.RunEndEncoded=22]="RunEndEncoded",r[r.BinaryView=23]="BinaryView",r[r.Utf8View=24]="Utf8View",r[r.ListView=25]="ListView",r[r.LargeListView=26]="LargeListView"})(z||(z={}))});var at,Oh=p(()=>{ce();wh();Bo();ju();at=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):z.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new Jr).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?(t||new r).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new Oe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,z.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){return e.endObject()}}});var Nt,Mh=p(()=>{ce();yh();Oh();Bo();Nt=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Qn.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new at).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Oe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,Qn.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){return e.endObject()}static createSchema(e,t,n,s,i){return r.startSchema(e),r.addEndianness(e,t),r.addFields(e,n),r.addCustomMetadata(e,s),r.addFeatures(e,i),r.endSchema(e)}}});var se,Gu=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(se||(se={}))});var w,re,Me=p(()=>{ku();oh();ah();ch();ja();uh();Gu();(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList",r[r.BinaryView=23]="BinaryView",r[r.Utf8View=24]="Utf8View",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth",r[r.DurationSecond=-27]="DurationSecond",r[r.DurationMillisecond=-28]="DurationMillisecond",r[r.DurationMicrosecond=-29]="DurationMicrosecond",r[r.DurationNanosecond=-30]="DurationNanosecond",r[r.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(w||(w={}));(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(re||(re={}))});var Dh={};J(Dh,{valueToString:()=>Rr});function Rr(r){if(r===null)return"null";if(r===void 0)return"undefined";switch(typeof r){case"number":return`${r}`;case"bigint":return`${r}`;case"string":return`"${r}"`}return typeof r[Symbol.toPrimitive]=="function"?r[Symbol.toPrimitive]("string"):ArrayBuffer.isView(r)?r instanceof BigInt64Array||r instanceof BigUint64Array?`[${[...r].map(e=>Rr(e))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(e,t)=>typeof t=="bigint"?`${t}`:t)}var tc=p(()=>{});function te(r){if(typeof r=="bigint"&&(r<Number.MIN_SAFE_INTEGER||r>Number.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function Rh(r,e){return te(r/e)+te(r%e)/te(e)}var Qr=p(()=>{});var Ch={};J(Ch,{BN:()=>di,bigNumToBigInt:()=>Dx,bigNumToNumber:()=>Nh,bigNumToString:()=>Mo,isArrowBigNumSymbol:()=>Mx});function kr(r,...e){return e.length===0?Object.setPrototypeOf(ee(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...e),this.constructor.prototype)}function Fo(...r){return kr.apply(this,r)}function Oo(...r){return kr.apply(this,r)}function rc(...r){return kr.apply(this,r)}function Nh(r,e){let{buffer:t,byteOffset:n,byteLength:s,signed:i}=r,o=new BigUint64Array(t,n,s/8),a=i&&o.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),u=0;if(a){for(let l of o)c|=(l^vF)*(BigInt(1)<<BigInt(64*u++));c*=BigInt(-1),c-=BigInt(1)}else for(let l of o)c|=l*(BigInt(1)<<BigInt(64*u++));if(typeof e=="number"&&e>0){let l=BigInt("1".padEnd(e+1,"0")),f=c/l,d=a?-(c%l):c%l,h=te(f),m=`${d}`.padStart(e,"0");return+`${a&&h===0?"-":""}${h}.${m}`}return te(c)}function Mo(r){if(r.byteLength===8)return`${new r.BigIntArray(r.buffer,r.byteOffset,1)[0]}`;if(!r.signed)return kh(r);let e=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2);if(new Int16Array([e.at(-1)])[0]>=0)return kh(r);e=e.slice();let n=1;for(let i=0;i<e.length;i++){let o=e[i],a=~o+n;e[i]=a,n&=o===0?1:0}return`-${kh(e)}`}function Dx(r){return r.byteLength===8?new r.BigIntArray(r.buffer,r.byteOffset,1)[0]:Mo(r)}function kh(r){let e="",t=new Uint32Array(2),n=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2),s=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),i=-1,o=n.length-1;do{for(t[0]=n[i=0];i<o;)n[i++]=t[1]=t[0]/10,t[0]=(t[0]-t[1]*10<<16)+n[i];n[i]=t[1]=t[0]/10,t[0]=t[0]-t[1]*10,e=`${t[0]}${e}`}while(s[0]||s[1]||s[2]||s[3]);return e??"0"}var Mx,AF,vF,di,zu=p(()=>{Ke();Qr();Mx=Symbol.for("isArrowBigNum");kr.prototype[Mx]=!0;kr.prototype.toJSON=function(){return`"${Mo(this)}"`};kr.prototype.valueOf=function(r){return Nh(this,r)};kr.prototype.toString=function(){return Mo(this)};kr.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Nh(this);case"string":return Mo(this);case"default":return Dx(this)}return Mo(this)};Object.setPrototypeOf(Fo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Oo.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(rc.prototype,Object.create(Uint32Array.prototype));Object.assign(Fo.prototype,kr.prototype,{constructor:Fo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Oo.prototype,kr.prototype,{constructor:Oo,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(rc.prototype,kr.prototype,{constructor:rc,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});AF=BigInt(4294967296)*BigInt(4294967296),vF=AF-BigInt(1);di=class r{static new(e,t){switch(t){case!0:return new Fo(e);case!1:return new Oo(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Fo(e)}return e.byteLength===16?new rc(e):new Oo(e)}static signed(e){return new Fo(e)}static unsigned(e){return new Oo(e)}static decimal(e){return new rc(e)}constructor(e,t){return r.new(e,t)}}});function or(r){let e=r;switch(r.typeId){case w.Decimal:return r.bitWidth/32;case w.Interval:return e.unit===ae.MONTH_DAY_NANO?4:1+e.unit;case w.BinaryView:case w.Utf8View:return 16;case w.FixedSizeList:return e.listSize;case w.FixedSizeBinary:return e.byteWidth;default:return 1}}var Rx,kx,Nx,Cx,Ux,Px,Vx,jx,Gx,zx,Wx,$x,qx,Kx,Xx,Hx,Jx,Yx,Qx,Zx,eT,tT,rT,nT,sT,iT,E,Ne,Fe,Zt,er,Pe,tr,rr,nr,vt,Nr,ct,Cr,It,sr,Ct,Z,Ur,ut,St,Pr,lt,Ut,Et,os,as,tt,cs,us,ls,fs,rt,ds,Zr,hs,ps,ft,ms,bs,nc,Lt,sc,ic,oc,ac,je,ir,pe,Bt,_n,gs,Pt,Be,dt,IF,Ge,we=p(()=>{Qr();Me();iT=Symbol.for("apache-arrow/DataType"),E=class r{static isDataType(e){return e?.[iT]===!0}static isNull(e){return e?.typeId===w.Null}static isInt(e){return e?.typeId===w.Int}static isFloat(e){return e?.typeId===w.Float}static isBinary(e){return e?.typeId===w.Binary}static isBinaryView(e){return e?.typeId===w.BinaryView}static isLargeBinary(e){return e?.typeId===w.LargeBinary}static isUtf8(e){return e?.typeId===w.Utf8}static isUtf8View(e){return e?.typeId===w.Utf8View}static isLargeUtf8(e){return e?.typeId===w.LargeUtf8}static isBool(e){return e?.typeId===w.Bool}static isDecimal(e){return e?.typeId===w.Decimal}static isDate(e){return e?.typeId===w.Date}static isTime(e){return e?.typeId===w.Time}static isTimestamp(e){return e?.typeId===w.Timestamp}static isInterval(e){return e?.typeId===w.Interval}static isDuration(e){return e?.typeId===w.Duration}static isList(e){return e?.typeId===w.List}static isLargeList(e){return e?.typeId===w.LargeList}static isStruct(e){return e?.typeId===w.Struct}static isUnion(e){return e?.typeId===w.Union}static isFixedSizeBinary(e){return e?.typeId===w.FixedSizeBinary}static isFixedSizeList(e){return e?.typeId===w.FixedSizeList}static isMap(e){return e?.typeId===w.Map}static isDictionary(e){return e?.typeId===w.Dictionary}static isDenseUnion(e){return r.isUnion(e)&&e.mode===he.Dense}static isSparseUnion(e){return r.isUnion(e)&&e.mode===he.Sparse}constructor(e){this.typeId=e}};Rx=Symbol.toStringTag;E[Rx]=(r=>(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[iT]=!0,r[Symbol.toStringTag]="DataType"))(E.prototype);Ne=class extends E{constructor(){super(w.Null)}toString(){return"Null"}};kx=Symbol.toStringTag;Ne[kx]=(r=>r[Symbol.toStringTag]="Null")(Ne.prototype);Fe=class extends E{constructor(e,t){super(w.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};Nx=Symbol.toStringTag;Fe[Nx]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Fe.prototype);Zt=class extends Fe{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},er=class extends Fe{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Pe=class extends Fe{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},tr=class extends Fe{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},rr=class extends Fe{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},nr=class extends Fe{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},vt=class extends Fe{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Nr=class extends Fe{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Zt.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(er.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Pe.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(tr.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(rr.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(nr.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(vt.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Nr.prototype,"ArrayType",{value:BigUint64Array});ct=class extends E{constructor(e){super(w.Float),this.precision=e}get ArrayType(){switch(this.precision){case le.HALF:return Uint16Array;case le.SINGLE:return Float32Array;case le.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};Cx=Symbol.toStringTag;ct[Cx]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(ct.prototype);Cr=class extends ct{constructor(){super(le.HALF)}},It=class extends ct{constructor(){super(le.SINGLE)}},sr=class extends ct{constructor(){super(le.DOUBLE)}};Object.defineProperty(Cr.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(It.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(sr.prototype,"ArrayType",{value:Float64Array});Ct=class extends E{constructor(){super(w.Binary)}toString(){return"Binary"}};Ux=Symbol.toStringTag;Ct[Ux]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Ct.prototype);Z=class extends E{constructor(){super(w.BinaryView)}toString(){return"BinaryView"}};Px=Symbol.toStringTag;Z.ELEMENT_WIDTH=16;Z.INLINE_CAPACITY=12;Z.LENGTH_OFFSET=0;Z.INLINE_OFFSET=4;Z.BUFFER_INDEX_OFFSET=8;Z.BUFFER_OFFSET_OFFSET=12;Z[Px]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="BinaryView"))(Z.prototype);Ur=class extends E{constructor(){super(w.LargeBinary)}toString(){return"LargeBinary"}};Vx=Symbol.toStringTag;Ur[Vx]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Ur.prototype);ut=class extends E{constructor(){super(w.Utf8)}toString(){return"Utf8"}};jx=Symbol.toStringTag;ut[jx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(ut.prototype);St=class extends E{constructor(){super(w.Utf8View)}toString(){return"Utf8View"}};Gx=Symbol.toStringTag;St.ELEMENT_WIDTH=Z.ELEMENT_WIDTH;St.INLINE_CAPACITY=Z.INLINE_CAPACITY;St[Gx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8View"))(St.prototype);Pr=class extends E{constructor(){super(w.LargeUtf8)}toString(){return"LargeUtf8"}};zx=Symbol.toStringTag;Pr[zx]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(Pr.prototype);lt=class extends E{constructor(){super(w.Bool)}toString(){return"Bool"}};Wx=Symbol.toStringTag;lt[Wx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(lt.prototype);Ut=class extends E{constructor(e,t,n=128){super(w.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};$x=Symbol.toStringTag;Ut[$x]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(Ut.prototype);Et=class extends E{constructor(e){super(w.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${ye[this.unit]}>`}get ArrayType(){return this.unit===ye.DAY?Int32Array:BigInt64Array}};qx=Symbol.toStringTag;Et[qx]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(Et.prototype);os=class extends Et{constructor(){super(ye.DAY)}},as=class extends Et{constructor(){super(ye.MILLISECOND)}},tt=class extends E{constructor(e,t){super(w.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${L[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Kx=Symbol.toStringTag;tt[Kx]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(tt.prototype);cs=class extends tt{constructor(){super(L.SECOND,32)}},us=class extends tt{constructor(){super(L.MILLISECOND,32)}},ls=class extends tt{constructor(){super(L.MICROSECOND,64)}},fs=class extends tt{constructor(){super(L.NANOSECOND,64)}},rt=class extends E{constructor(e,t){super(w.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${L[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};Xx=Symbol.toStringTag;rt[Xx]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(rt.prototype);ds=class extends rt{constructor(e){super(L.SECOND,e)}},Zr=class extends rt{constructor(e){super(L.MILLISECOND,e)}},hs=class extends rt{constructor(e){super(L.MICROSECOND,e)}},ps=class extends rt{constructor(e){super(L.NANOSECOND,e)}},ft=class extends E{constructor(e){super(w.Interval),this.unit=e}toString(){return`Interval<${ae[this.unit]}>`}};Hx=Symbol.toStringTag;ft[Hx]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(ft.prototype);ms=class extends ft{constructor(){super(ae.DAY_TIME)}},bs=class extends ft{constructor(){super(ae.YEAR_MONTH)}},nc=class extends ft{constructor(){super(ae.MONTH_DAY_NANO)}},Lt=class extends E{constructor(e){super(w.Duration),this.unit=e}toString(){return`Duration<${L[this.unit]}>`}};Jx=Symbol.toStringTag;Lt[Jx]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(Lt.prototype);sc=class extends Lt{constructor(){super(L.SECOND)}},ic=class extends Lt{constructor(){super(L.MILLISECOND)}},oc=class extends Lt{constructor(){super(L.MICROSECOND)}},ac=class extends Lt{constructor(){super(L.NANOSECOND)}},je=class extends E{constructor(e){super(w.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};Yx=Symbol.toStringTag;je[Yx]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(je.prototype);ir=class extends E{constructor(e){super(w.LargeList),this.children=[e]}toString(){return`LargeList<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};Qx=Symbol.toStringTag;ir[Qx]=(r=>(r.children=null,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeList"))(ir.prototype);pe=class extends E{constructor(e){super(w.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};Zx=Symbol.toStringTag;pe[Zx]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(pe.prototype);Bt=class extends E{constructor(e,t,n){super(w.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((s,i,o)=>(s[i]=o)&&s||s,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}};eT=Symbol.toStringTag;Bt[eT]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(Bt.prototype);_n=class extends Bt{constructor(e,t){super(he.Dense,e,t)}},gs=class extends Bt{constructor(e,t){super(he.Sparse,e,t)}},Pt=class extends E{constructor(e){super(w.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};tT=Symbol.toStringTag;Pt[tT]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Pt.prototype);Be=class extends E{constructor(e,t){super(w.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};rT=Symbol.toStringTag;Be[rT]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Be.prototype);dt=class extends E{constructor(e,t=!1){var n,s,i;if(super(w.Map),this.children=[e],this.keysSorted=t,e&&(e.name="entries",!((n=e?.type)===null||n===void 0)&&n.children)){let o=(s=e?.type)===null||s===void 0?void 0:s.children[0];o&&(o.name="key");let a=(i=e?.type)===null||i===void 0?void 0:i.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};nT=Symbol.toStringTag;dt[nT]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(dt.prototype);IF=(r=>()=>++r)(-1),Ge=class extends E{constructor(e,t,n,s){super(w.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=s||!1,this.id=n==null?IF():te(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};sT=Symbol.toStringTag;Ge[sT]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Ge.prototype)});function SF(r,e,t=!0){return typeof e=="number"?Do(r,e,t):typeof e=="string"&&e in w?Do(r,w[e],t):e&&e instanceof E?Do(r,aT(e),t):e?.type&&e.type instanceof E?Do(r,aT(e.type),t):Do(r,w.NONE,t)}function Do(r,e,t=!0){let n=null;switch(e){case w.Null:n=r.visitNull;break;case w.Bool:n=r.visitBool;break;case w.Int:n=r.visitInt;break;case w.Int8:n=r.visitInt8||r.visitInt;break;case w.Int16:n=r.visitInt16||r.visitInt;break;case w.Int32:n=r.visitInt32||r.visitInt;break;case w.Int64:n=r.visitInt64||r.visitInt;break;case w.Uint8:n=r.visitUint8||r.visitInt;break;case w.Uint16:n=r.visitUint16||r.visitInt;break;case w.Uint32:n=r.visitUint32||r.visitInt;break;case w.Uint64:n=r.visitUint64||r.visitInt;break;case w.Float:n=r.visitFloat;break;case w.Float16:n=r.visitFloat16||r.visitFloat;break;case w.Float32:n=r.visitFloat32||r.visitFloat;break;case w.Float64:n=r.visitFloat64||r.visitFloat;break;case w.Utf8:n=r.visitUtf8;break;case w.LargeUtf8:n=r.visitLargeUtf8;break;case w.Utf8View:n=r.visitUtf8View||r.visitUtf8;break;case w.Binary:n=r.visitBinary;break;case w.LargeBinary:n=r.visitLargeBinary;break;case w.BinaryView:n=r.visitBinaryView||r.visitBinary;break;case w.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case w.Date:n=r.visitDate;break;case w.DateDay:n=r.visitDateDay||r.visitDate;break;case w.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case w.Timestamp:n=r.visitTimestamp;break;case w.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case w.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case w.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case w.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case w.Time:n=r.visitTime;break;case w.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case w.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case w.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case w.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case w.Decimal:n=r.visitDecimal;break;case w.List:n=r.visitList;break;case w.LargeList:n=r.visitLargeList;break;case w.Struct:n=r.visitStruct;break;case w.Union:n=r.visitUnion;break;case w.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case w.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case w.Dictionary:n=r.visitDictionary;break;case w.Interval:n=r.visitInterval;break;case w.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case w.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case w.IntervalMonthDayNano:n=r.visitIntervalMonthDayNano||r.visitInterval;break;case w.Duration:n=r.visitDuration;break;case w.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case w.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case w.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case w.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case w.FixedSizeList:n=r.visitFixedSizeList;break;case w.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!t)return()=>null;throw new Error(`Unrecognized type '${w[e]}'`)}function aT(r){switch(r.typeId){case w.Null:return w.Null;case w.Int:{let{bitWidth:e,isSigned:t}=r;switch(e){case 8:return t?w.Int8:w.Uint8;case 16:return t?w.Int16:w.Uint16;case 32:return t?w.Int32:w.Uint32;case 64:return t?w.Int64:w.Uint64}return w.Int}case w.Float:switch(r.precision){case le.HALF:return w.Float16;case le.SINGLE:return w.Float32;case le.DOUBLE:return w.Float64}return w.Float;case w.Binary:return w.Binary;case w.LargeBinary:return w.LargeBinary;case w.BinaryView:return w.BinaryView;case w.Utf8:return w.Utf8;case w.LargeUtf8:return w.LargeUtf8;case w.Utf8View:return w.Utf8View;case w.Bool:return w.Bool;case w.Decimal:return w.Decimal;case w.Time:switch(r.unit){case L.SECOND:return w.TimeSecond;case L.MILLISECOND:return w.TimeMillisecond;case L.MICROSECOND:return w.TimeMicrosecond;case L.NANOSECOND:return w.TimeNanosecond}return w.Time;case w.Timestamp:switch(r.unit){case L.SECOND:return w.TimestampSecond;case L.MILLISECOND:return w.TimestampMillisecond;case L.MICROSECOND:return w.TimestampMicrosecond;case L.NANOSECOND:return w.TimestampNanosecond}return w.Timestamp;case w.Date:switch(r.unit){case ye.DAY:return w.DateDay;case ye.MILLISECOND:return w.DateMillisecond}return w.Date;case w.Interval:switch(r.unit){case ae.DAY_TIME:return w.IntervalDayTime;case ae.YEAR_MONTH:return w.IntervalYearMonth;case ae.MONTH_DAY_NANO:return w.IntervalMonthDayNano}return w.Interval;case w.Duration:switch(r.unit){case L.SECOND:return w.DurationSecond;case L.MILLISECOND:return w.DurationMillisecond;case L.MICROSECOND:return w.DurationMicrosecond;case L.NANOSECOND:return w.DurationNanosecond}return w.Duration;case w.Map:return w.Map;case w.List:return w.List;case w.LargeList:return w.LargeList;case w.Struct:return w.Struct;case w.Union:switch(r.mode){case he.Dense:return w.DenseUnion;case he.Sparse:return w.SparseUnion}return w.Union;case w.FixedSizeBinary:return w.FixedSizeBinary;case w.FixedSizeList:return w.FixedSizeList;case w.Dictionary:return w.Dictionary}throw new Error(`Unrecognized type '${w[r.typeId]}'`)}var R,Vt=p(()=>{Me();we();R=class{visitMany(e,...t){return e.map((n,s)=>this.visit(n,...t.map(i=>i[s])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return SF(this,e,t)}getVisitFnByTypeId(e,t=!0){return Do(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitUtf8View(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitBinaryView(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitLargeList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};R.prototype.visitInt8=null;R.prototype.visitInt16=null;R.prototype.visitInt32=null;R.prototype.visitInt64=null;R.prototype.visitUint8=null;R.prototype.visitUint16=null;R.prototype.visitUint32=null;R.prototype.visitUint64=null;R.prototype.visitFloat16=null;R.prototype.visitFloat32=null;R.prototype.visitFloat64=null;R.prototype.visitDateDay=null;R.prototype.visitDateMillisecond=null;R.prototype.visitTimestampSecond=null;R.prototype.visitTimestampMillisecond=null;R.prototype.visitTimestampMicrosecond=null;R.prototype.visitTimestampNanosecond=null;R.prototype.visitTimeSecond=null;R.prototype.visitTimeMillisecond=null;R.prototype.visitTimeMicrosecond=null;R.prototype.visitTimeNanosecond=null;R.prototype.visitDenseUnion=null;R.prototype.visitSparseUnion=null;R.prototype.visitIntervalDayTime=null;R.prototype.visitIntervalYearMonth=null;R.prototype.visitIntervalMonthDayNano=null;R.prototype.visitDuration=null;R.prototype.visitDurationSecond=null;R.prototype.visitDurationMillisecond=null;R.prototype.visitDurationMicrosecond=null;R.prototype.visitDurationNanosecond=null});var Uh={};J(Uh,{float64ToUint16:()=>cc,uint16ToFloat64:()=>Wu});function Wu(r){let e=(r&31744)>>10,t=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(e){case 31:return n*(t?Number.NaN:1/0);case 0:return n*(t?6103515625e-14*t:0)}return n*Math.pow(2,e-15)*(1+t)}function cc(r){if(r!==r)return 32256;cT[0]=r;let e=(Ro[1]&2147483648)>>16&65535,t=Ro[1]&2146435072,n=0;return t>=1089470464?Ro[0]>0?t=31744:(t=(t&2080374784)>>16,n=(Ro[1]&1048575)>>10):t<=1056964608?(n=1048576+(Ro[1]&1048575),n=1048576+(n<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,n=(Ro[1]&1048575)+512>>10),e|t|n&65535}var cT,Ro,uc=p(()=>{cT=new Float64Array(1),Ro=new Uint32Array(cT.buffer)});function q(r){return(e,t,n)=>{if(e.setValid(t,n!=null))return r(e,t,n)}}var j,EF,uT,LF,An,Ph,lT,BF,$u,qu,Vh,fT,FF,dT,OF,hT,MF,jh,Ku,Xu,Hu,Ju,Gh,Yu,Qu,Zu,el,zh,Wh,pT,DF,RF,kF,NF,CF,UF,PF,mT,bT,VF,$h,tl,rl,nl,sl,il,ol,al,qh,jF,nt,ar=p(()=>{ht();Vt();Qr();gn();uc();Me();we();j=class extends R{};EF=(r,e,t)=>{r[e]=Math.floor(t/864e5)},uT=(r,e,t,n)=>{if(t+1<e.length){let s=te(e[t]),i=te(e[t+1]);r.set(n.subarray(0,i-s),s)}},LF=({offset:r,values:e},t,n)=>{let s=r+t;n?e[s>>3]|=1<<s%8:e[s>>3]&=~(1<<s%8)},An=({values:r},e,t)=>{r[e]=t},Ph=({values:r},e,t)=>{r[e]=t},lT=({values:r},e,t)=>{r[e]=cc(t)},BF=(r,e,t)=>{switch(r.type.precision){case le.HALF:return lT(r,e,t);case le.SINGLE:case le.DOUBLE:return Ph(r,e,t)}},$u=({values:r},e,t)=>{EF(r,e,t.valueOf())},qu=({values:r},e,t)=>{r[e]=BigInt(t)},Vh=({stride:r,values:e},t,n)=>{e.set(n.subarray(0,r),r*t)},fT=({values:r,valueOffsets:e},t,n)=>uT(r,e,t,n),FF=r=>{let e=r.variadicBuffers;return(!Array.isArray(e)||Object.isFrozen(e))&&(e=Array.from(e),r.variadicBuffers=e),e},dT=(r,e,t)=>{var n,s,i,o;let a=r.values;if(!a)throw new Error("BinaryView data is missing view buffer");let c=Z.ELEMENT_WIDTH,u=e*c,l=u+c;if(u<0||l>a.length)throw new RangeError(`BinaryView index ${e} out of bounds`);a.fill(0,u,l);let f=new DataView(a.buffer,a.byteOffset+u,c),d=t.length;if(f.setInt32(Z.LENGTH_OFFSET,d,!0),d<=Z.INLINE_CAPACITY){a.set(t,u+Z.INLINE_OFFSET);return}let h=((n=t[0])!==null&&n!==void 0?n:0)|((s=t[1])!==null&&s!==void 0?s:0)<<8|((i=t[2])!==null&&i!==void 0?i:0)<<16|((o=t[3])!==null&&o!==void 0?o:0)<<24;f.setUint32(Z.INLINE_OFFSET,h>>>0,!0);let m=FF(r),b=t.slice(),g=m.push(b)-1;f.setInt32(Z.BUFFER_INDEX_OFFSET,g,!0),f.setInt32(Z.BUFFER_OFFSET_OFFSET,0,!0)},OF=(r,e,t)=>{let n=t instanceof Uint8Array?t:new Uint8Array(t);dT(r,e,n)},hT=({values:r,valueOffsets:e},t,n)=>uT(r,e,t,Jt(n)),MF=(r,e,t)=>{let n=Jt(t);dT(r,e,n)},jh=(r,e,t)=>{r.type.unit===ye.DAY?$u(r,e,t):qu(r,e,t)},Ku=({values:r},e,t)=>{r[e]=BigInt(t/1e3)},Xu=({values:r},e,t)=>{r[e]=BigInt(t)},Hu=({values:r},e,t)=>{r[e]=BigInt(t*1e3)},Ju=({values:r},e,t)=>{r[e]=BigInt(t*1e6)},Gh=(r,e,t)=>{switch(r.type.unit){case L.SECOND:return Ku(r,e,t);case L.MILLISECOND:return Xu(r,e,t);case L.MICROSECOND:return Hu(r,e,t);case L.NANOSECOND:return Ju(r,e,t)}},Yu=({values:r},e,t)=>{r[e]=t},Qu=({values:r},e,t)=>{r[e]=t},Zu=({values:r},e,t)=>{r[e]=t},el=({values:r},e,t)=>{r[e]=t},zh=(r,e,t)=>{switch(r.type.unit){case L.SECOND:return Yu(r,e,t);case L.MILLISECOND:return Qu(r,e,t);case L.MICROSECOND:return Zu(r,e,t);case L.NANOSECOND:return el(r,e,t)}},Wh=({values:r,stride:e},t,n)=>{r.set(n.subarray(0,e),e*t)},pT=(r,e,t)=>{let n=r.children[0],s=r.valueOffsets,i=nt.getVisitFn(n),o=te(s[e]),a=te(s[e+1]);if(Array.isArray(t))for(let c=-1,u=o;u<a;)i(n,u++,t[++c]);else for(let c=-1,u=o;u<a;)i(n,u++,t.get(++c))},DF=(r,e,t)=>{let n=r.children[0],{valueOffsets:s}=r,i=nt.getVisitFn(n),{[e]:o,[e+1]:a}=s,c=t instanceof Map?t.entries():Object.entries(t);for(let u of c)if(i(n,o,u),++o>=a)break},RF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e[i]),kF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e.get(i)),NF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e.get(s.name)),CF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e[s.name]),UF=(r,e,t)=>{let n=r.type.children.map(i=>nt.getVisitFn(i.type)),s=t instanceof Map?NF(e,t):t instanceof B?kF(e,t):Array.isArray(t)?RF(e,t):CF(e,t);r.type.children.forEach((i,o)=>s(n[o],r.children[o],i,o))},PF=(r,e,t)=>{r.type.mode===he.Dense?mT(r,e,t):bT(r,e,t)},mT=(r,e,t)=>{let n=r.type.typeIdToChildIndex[r.typeIds[e]],s=r.children[n];nt.visit(s,r.valueOffsets[e],t)},bT=(r,e,t)=>{let n=r.type.typeIdToChildIndex[r.typeIds[e]],s=r.children[n];nt.visit(s,e,t)},VF=(r,e,t)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[e],t)},$h=(r,e,t)=>{switch(r.type.unit){case ae.YEAR_MONTH:return rl(r,e,t);case ae.DAY_TIME:return tl(r,e,t);case ae.MONTH_DAY_NANO:return nl(r,e,t)}},tl=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},rl=({values:r},e,t)=>{r[e]=t[0]*12+t[1]%12},nl=({values:r,stride:e},t,n)=>{r.set(n.subarray(0,e),e*t)},sl=({values:r},e,t)=>{r[e]=t},il=({values:r},e,t)=>{r[e]=t},ol=({values:r},e,t)=>{r[e]=t},al=({values:r},e,t)=>{r[e]=t},qh=(r,e,t)=>{switch(r.type.unit){case L.SECOND:return sl(r,e,t);case L.MILLISECOND:return il(r,e,t);case L.MICROSECOND:return ol(r,e,t);case L.NANOSECOND:return al(r,e,t)}},jF=(r,e,t)=>{let{stride:n}=r,s=r.children[0],i=nt.getVisitFn(s);if(Array.isArray(t))for(let o=-1,a=e*n;++o<n;)i(s,a+o,t[o]);else for(let o=-1,a=e*n;++o<n;)i(s,a+o,t.get(o))};j.prototype.visitBool=q(LF);j.prototype.visitInt=q(An);j.prototype.visitInt8=q(An);j.prototype.visitInt16=q(An);j.prototype.visitInt32=q(An);j.prototype.visitInt64=q(An);j.prototype.visitUint8=q(An);j.prototype.visitUint16=q(An);j.prototype.visitUint32=q(An);j.prototype.visitUint64=q(An);j.prototype.visitFloat=q(BF);j.prototype.visitFloat16=q(lT);j.prototype.visitFloat32=q(Ph);j.prototype.visitFloat64=q(Ph);j.prototype.visitUtf8=q(hT);j.prototype.visitLargeUtf8=q(hT);j.prototype.visitUtf8View=q(MF);j.prototype.visitBinary=q(fT);j.prototype.visitLargeBinary=q(fT);j.prototype.visitBinaryView=q(OF);j.prototype.visitFixedSizeBinary=q(Vh);j.prototype.visitDate=q(jh);j.prototype.visitDateDay=q($u);j.prototype.visitDateMillisecond=q(qu);j.prototype.visitTimestamp=q(Gh);j.prototype.visitTimestampSecond=q(Ku);j.prototype.visitTimestampMillisecond=q(Xu);j.prototype.visitTimestampMicrosecond=q(Hu);j.prototype.visitTimestampNanosecond=q(Ju);j.prototype.visitTime=q(zh);j.prototype.visitTimeSecond=q(Yu);j.prototype.visitTimeMillisecond=q(Qu);j.prototype.visitTimeMicrosecond=q(Zu);j.prototype.visitTimeNanosecond=q(el);j.prototype.visitDecimal=q(Wh);j.prototype.visitList=q(pT);j.prototype.visitLargeList=q(pT);j.prototype.visitStruct=q(UF);j.prototype.visitUnion=q(PF);j.prototype.visitDenseUnion=q(mT);j.prototype.visitSparseUnion=q(bT);j.prototype.visitDictionary=q(VF);j.prototype.visitInterval=q($h);j.prototype.visitIntervalDayTime=q(tl);j.prototype.visitIntervalYearMonth=q(rl);j.prototype.visitIntervalMonthDayNano=q(nl);j.prototype.visitDuration=q(qh);j.prototype.visitDurationSecond=q(sl);j.prototype.visitDurationMillisecond=q(il);j.prototype.visitDurationMicrosecond=q(ol);j.prototype.visitDurationNanosecond=q(al);j.prototype.visitFixedSizeList=q(jF);j.prototype.visitMap=q(DF);nt=new j});var Vr,ko,en,Kh,Xh,GF,cl=p(()=>{tc();hi();ar();Vr=Symbol.for("parent"),ko=Symbol.for("rowIndex"),en=class{constructor(e,t){return this[Vr]=e,this[ko]=t,new Proxy(this,GF)}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[ko],t=this[Vr],n=t.type.children,s={};for(let i=-1,o=n.length;++i<o;)s[n[i].name]=ze.visit(t.children[i],e);return s}toString(){return`{${[...this].map(([e,t])=>`${Rr(e)}: ${Rr(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Kh(this[Vr],this[ko])}},Kh=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return e<this.numChildren?(this.childIndex=e+1,{done:!1,value:[this.childFields[e].name,ze.visit(this.children[e],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(en.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Vr]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ko]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});Xh=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Vr].type.children.map(t=>t.name)}has(e,t){return e[Vr].type.children.some(n=>n.name===t)}getOwnPropertyDescriptor(e,t){if(e[Vr].type.children.some(n=>n.name===t))return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Vr].type.children.findIndex(s=>s.name===t);if(n!==-1){let s=ze.visit(e[Vr].children[n],e[ko]);return Reflect.set(e,t,s),s}}set(e,t,n){let s=e[Vr].type.children.findIndex(i=>i.name===t);return s!==-1?(nt.visit(e[Vr].children[s],e[ko],n),Reflect.set(e,t,n)):Reflect.has(e,t)||typeof t=="symbol"?Reflect.set(e,t,n):!1}},GF=new Xh});function W(r){return(e,t)=>e.getValid(t)?r(e,t):null}var C,zF,No,WF,$F,gT,qF,yT,wT,ys,KF,xT,XF,TT,_T,HF,AT,JF,YF,QF,ZF,vT,IT,ST,ET,eO,LT,BT,FT,OT,tO,rO,MT,nO,sO,iO,DT,RT,oO,aO,kT,NT,CT,UT,PT,VT,jT,cO,uO,ze,hi=p(()=>{zu();ht();Vt();lc();cl();Qr();gn();uc();Me();C=class extends R{};zF=(r,e)=>864e5*r[e],No=16,WF=12,$F=(r,e)=>null,gT=(r,e,t)=>{if(t+1>=e.length)return null;let n=te(e[t]),s=te(e[t+1]);return r.subarray(n,s)},qF=({offset:r,values:e},t)=>{let n=r+t;return(e[n>>3]&1<<n%8)!==0},yT=({values:r},e)=>zF(r,e),wT=({values:r},e)=>te(r[e]),ys=({stride:r,values:e},t)=>e[r*t],KF=({stride:r,values:e},t)=>Wu(e[r*t]),xT=({values:r},e)=>r[e],XF=({stride:r,values:e},t)=>e.subarray(r*t,r*(t+1)),TT=({values:r,valueOffsets:e},t)=>gT(r,e,t),_T=(r,e)=>{var t;let n=r.values;if(!n)throw new Error("BinaryView data is missing view buffer");let s=e*No,i=s+No;if(s<0||i>n.length)throw new Error(`BinaryView data buffer is too short: expected ${No} bytes, got ${Math.max(0,n.length-s)}`);let o=n.subarray(s,i);if(o.length<No)throw new Error(`BinaryView data buffer is too short: expected ${No} bytes, got ${o.length}`);let a=new DataView(n.buffer,o.byteOffset,No),c=a.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=WF)return o.subarray(4,4+c);let u=a.getInt32(8,!0),l=a.getInt32(12,!0),f=(t=r.variadicBuffers)===null||t===void 0?void 0:t[u];if(!f)throw new Error(`BinaryView variadic buffer ${u} is missing`);return f.subarray(l,l+c)},HF=(r,e)=>_T(r,e),AT=({values:r,valueOffsets:e},t)=>{let n=gT(r,e,t);return n!==null?vo(n):null},JF=(r,e)=>{let t=_T(r,e);return vo(t)},YF=({values:r},e)=>r[e],QF=({type:r,values:e},t)=>r.precision!==le.HALF?e[t]:Wu(e[t]),ZF=(r,e)=>r.type.unit===ye.DAY?yT(r,e):wT(r,e),vT=({values:r},e)=>1e3*te(r[e]),IT=({values:r},e)=>te(r[e]),ST=({values:r},e)=>Rh(r[e],BigInt(1e3)),ET=({values:r},e)=>Rh(r[e],BigInt(1e6)),eO=(r,e)=>{switch(r.type.unit){case L.SECOND:return vT(r,e);case L.MILLISECOND:return IT(r,e);case L.MICROSECOND:return ST(r,e);case L.NANOSECOND:return ET(r,e)}},LT=({values:r},e)=>r[e],BT=({values:r},e)=>r[e],FT=({values:r},e)=>r[e],OT=({values:r},e)=>r[e],tO=(r,e)=>{switch(r.type.unit){case L.SECOND:return LT(r,e);case L.MILLISECOND:return BT(r,e);case L.MICROSECOND:return FT(r,e);case L.NANOSECOND:return OT(r,e)}},rO=({values:r,stride:e},t)=>di.decimal(r.subarray(e*t,e*(t+1))),MT=(r,e)=>{let{valueOffsets:t,stride:n,children:s}=r,i=te(t[e*n]),o=te(t[e*n+1]),c=s[0].slice(i,o-i);return new B([c])},nO=(r,e)=>{let{valueOffsets:t,children:n}=r,{[e]:s,[e+1]:i}=t,o=n[0];return new yr(o.slice(s,i-s))},sO=(r,e)=>new en(r,e),iO=(r,e)=>r.type.mode===he.Dense?DT(r,e):RT(r,e),DT=(r,e)=>{let t=r.type.typeIdToChildIndex[r.typeIds[e]],n=r.children[t];return ze.visit(n,r.valueOffsets[e])},RT=(r,e)=>{let t=r.type.typeIdToChildIndex[r.typeIds[e]],n=r.children[t];return ze.visit(n,e)},oO=(r,e)=>{var t;return(t=r.dictionary)===null||t===void 0?void 0:t.get(r.values[e])},aO=(r,e)=>r.type.unit===ae.MONTH_DAY_NANO?CT(r,e):r.type.unit===ae.DAY_TIME?kT(r,e):NT(r,e),kT=({values:r},e)=>r.subarray(2*e,2*(e+1)),NT=({values:r},e)=>{let t=r[e],n=new Int32Array(2);return n[0]=Math.trunc(t/12),n[1]=Math.trunc(t%12),n},CT=({values:r},e)=>r.subarray(4*e,4*(e+1)),UT=({values:r},e)=>r[e],PT=({values:r},e)=>r[e],VT=({values:r},e)=>r[e],jT=({values:r},e)=>r[e],cO=(r,e)=>{switch(r.type.unit){case L.SECOND:return UT(r,e);case L.MILLISECOND:return PT(r,e);case L.MICROSECOND:return VT(r,e);case L.NANOSECOND:return jT(r,e)}},uO=(r,e)=>{let{stride:t,children:n}=r,i=n[0].slice(e*t,t);return new B([i])};C.prototype.visitNull=W($F);C.prototype.visitBool=W(qF);C.prototype.visitInt=W(YF);C.prototype.visitInt8=W(ys);C.prototype.visitInt16=W(ys);C.prototype.visitInt32=W(ys);C.prototype.visitInt64=W(xT);C.prototype.visitUint8=W(ys);C.prototype.visitUint16=W(ys);C.prototype.visitUint32=W(ys);C.prototype.visitUint64=W(xT);C.prototype.visitFloat=W(QF);C.prototype.visitFloat16=W(KF);C.prototype.visitFloat32=W(ys);C.prototype.visitFloat64=W(ys);C.prototype.visitUtf8=W(AT);C.prototype.visitLargeUtf8=W(AT);C.prototype.visitUtf8View=W(JF);C.prototype.visitBinary=W(TT);C.prototype.visitLargeBinary=W(TT);C.prototype.visitBinaryView=W(HF);C.prototype.visitFixedSizeBinary=W(XF);C.prototype.visitDate=W(ZF);C.prototype.visitDateDay=W(yT);C.prototype.visitDateMillisecond=W(wT);C.prototype.visitTimestamp=W(eO);C.prototype.visitTimestampSecond=W(vT);C.prototype.visitTimestampMillisecond=W(IT);C.prototype.visitTimestampMicrosecond=W(ST);C.prototype.visitTimestampNanosecond=W(ET);C.prototype.visitTime=W(tO);C.prototype.visitTimeSecond=W(LT);C.prototype.visitTimeMillisecond=W(BT);C.prototype.visitTimeMicrosecond=W(FT);C.prototype.visitTimeNanosecond=W(OT);C.prototype.visitDecimal=W(rO);C.prototype.visitList=W(MT);C.prototype.visitLargeList=W(MT);C.prototype.visitStruct=W(sO);C.prototype.visitUnion=W(iO);C.prototype.visitDenseUnion=W(DT);C.prototype.visitSparseUnion=W(RT);C.prototype.visitDictionary=W(oO);C.prototype.visitInterval=W(aO);C.prototype.visitIntervalDayTime=W(kT);C.prototype.visitIntervalYearMonth=W(NT);C.prototype.visitIntervalMonthDayNano=W(CT);C.prototype.visitDuration=W(cO);C.prototype.visitDurationSecond=W(UT);C.prototype.visitDurationMillisecond=W(PT);C.prototype.visitDurationMicrosecond=W(VT);C.prototype.visitDurationNanosecond=W(jT);C.prototype.visitFixedSizeList=W(uO);C.prototype.visitMap=W(nO);ze=new C});var ws,Uo,Co,Hh,yr,Jh,Yh,lc=p(()=>{ht();tc();hi();ar();ws=Symbol.for("keys"),Uo=Symbol.for("vals"),Co=Symbol.for("kKeysAsStrings"),Hh=Symbol.for("_kKeysAsStrings"),yr=class{constructor(e){return this[ws]=new B([e.children[0]]).memoize(),this[Uo]=e.children[1],new Proxy(this,new Yh)}get[Co](){return this[Hh]||(this[Hh]=Array.from(this[ws].toArray(),String))}[Symbol.iterator](){return new Jh(this[ws],this[Uo])}get size(){return this[ws].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[ws],t=this[Uo],n={};for(let s=-1,i=e.length;++s<i;)n[e.get(s)]=ze.visit(t,s);return n}toString(){return`{${[...this].map(([e,t])=>`${Rr(e)}: ${Rr(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Jh=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),ze.visit(this.vals,e)]})}},Yh=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Co]}has(e,t){return e[Co].includes(t)}getOwnPropertyDescriptor(e,t){if(e[Co].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Co].indexOf(t);if(n!==-1){let s=ze.visit(Reflect.get(e,Uo),n);return Reflect.set(e,t,s),s}}set(e,t,n){let s=e[Co].indexOf(t);return s!==-1?(nt.visit(Reflect.get(e,Uo),s,n),Reflect.set(e,t,n)):Reflect.has(e,t)?Reflect.set(e,t,n):!1}};Object.defineProperties(yr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ws]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Uo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Hh]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var Qh={};J(Qh,{clampRange:()=>fc,createElementComparator:()=>xs,wrapIndex:()=>pi});function fc(r,e,t,n){let{length:s=0}=r,i=typeof e!="number"?0:e,o=typeof t!="number"?s:t;return i<0&&(i=(i%s+s)%s),o<0&&(o=(o%s+s)%s),o<i&&(GT=i,i=o,o=GT),o>s&&(o=s),n?n(r,i,o):[i,o]}function xs(r){if(typeof r!=="object"||r===null)return zT(r)?zT:t=>t===r;if(r instanceof Date){let t=r.valueOf();return n=>n instanceof Date?n.valueOf()===t:!1}return ArrayBuffer.isView(r)?t=>t?rh(r,t):!1:r instanceof Map?fO(r):Array.isArray(r)?lO(r):r instanceof B?dO(r):hO(r,!0)}function lO(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=xs(r[t]);return ul(e)}function fO(r){let e=-1,t=[];for(let n of r.values())t[++e]=xs(n);return ul(t)}function dO(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=xs(r.get(t));return ul(e)}function hO(r,e=!1){let t=Object.keys(r);if(!e&&t.length===0)return()=>!1;let n=[];for(let s=-1,i=t.length;++s<i;)n[s]=xs(r[t[s]]);return ul(n,t)}function ul(r,e){return t=>{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return pO(r,t);case Map:return WT(r,t,t.keys());case yr:case en:case Object:case void 0:return WT(r,t,e||Object.keys(t))}return t instanceof B?mO(r,t):!1}}function pO(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e[n]))return!1;return!0}function mO(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e.get(n)))return!1;return!0}function WT(r,e,t){let n=t[Symbol.iterator](),s=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),i=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),o=0,a=r.length,c=i.next(),u=n.next(),l=s.next();for(;o<a&&!u.done&&!l.done&&!c.done&&!(u.value!==l.value||!r[o](c.value));++o,u=n.next(),l=s.next(),c=i.next());return o===a&&u.done&&l.done&&c.done?!0:(n.return&&n.return(),s.return&&s.return(),i.return&&i.return(),!1)}var GT,pi,zT,Po=p(()=>{ht();lc();cl();Ke();pi=(r,e)=>r<0?e+r:r,zT=r=>r!==r});var Zh={};J(Zh,{BitIterator:()=>tn,getBit:()=>fl,getBool:()=>Vo,packBools:()=>bi,popcnt_array:()=>$T,popcnt_bit_range:()=>dc,popcnt_uint32:()=>ll,setBool:()=>bO,truncateBitmap:()=>mi});function Vo(r,e,t,n){return(t&1<<n)!==0}function fl(r,e,t,n){return(t&1<<n)>>n}function bO(r,e,t){return t?!!(r[e>>3]|=1<<e%8)||!0:!(r[e>>3]&=~(1<<e%8))&&!1}function mi(r,e,t){let n=t.byteLength+7&-8;if(r>0||t.byteLength<n){let s=new Uint8Array(n);return s.set(r%8===0?t.subarray(r>>3):bi(new tn(t,r,e,null,Vo)).subarray(0,n)),s}return t}function bi(r){let e=[],t=0,n=0,s=0;for(let o of r)o&&(s|=1<<n),++n===8&&(e[t++]=s,s=n=0);(t===0||n>0)&&(e[t++]=s);let i=new Uint8Array(e.length+7&-8);return i.set(e),i}function dc(r,e,t){if(t-e<=0)return 0;if(t-e<8){let i=0;for(let o of new tn(r,e,t-e,r,fl))i+=o;return i}let n=t>>3<<3,s=e+(e%8===0?0:8-e%8);return dc(r,e,s)+dc(r,n,t)+$T(r,s>>3,n-s>>3)}function $T(r,e,t){let n=0,s=Math.trunc(e),i=new DataView(r.buffer,r.byteOffset,r.byteLength),o=t===void 0?r.byteLength:s+t;for(;o-s>=4;)n+=ll(i.getUint32(s)),s+=4;for(;o-s>=2;)n+=ll(i.getUint16(s)),s+=2;for(;o-s>=1;)n+=ll(i.getUint8(s)),s+=1;return n}function ll(r){let e=Math.trunc(r);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}var tn,gi=p(()=>{tn=class{constructor(e,t,n,s,i){this.bytes=e,this.length=n,this.context=s,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}});function D(r){return yO.visit(r)}var gO,qT,G,ep,yO,wr=p(()=>{ht();Me();we();gi();we();Vt();Ke();gO=-1,qT=Symbol.for("apache-arrow/Data"),G=class r{static isData(e){return e?.[qT]===!0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return E.isSparseUnion(e)?this.children.some(t=>t.nullable):E.isDenseUnion(e)?this.children.some(t=>t.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:s,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),s&&(e+=s.byteLength),i&&(e+=i.byteLength),e+=this.variadicBuffers.reduce((o,a)=>{var c;return o+((c=a?.byteLength)!==null&&c!==void 0?c:0)},0),this.children.reduce((o,a)=>o+a.byteLength,e)}get nullCount(){if(E.isUnion(this.type))return this.children.reduce((n,s)=>n+s.nullCount,0);let e=this._nullCount,t;return e<=gO&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-dc(t,this.offset,this.offset+this.length)),e}constructor(e,t,n,s,i,o=[],a,c=[]){var u;this.type=e,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(t||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(s||0,-1));let l;i instanceof r?(this.stride=i.stride,this.values=i.values,this.typeIds=i.typeIds,this.nullBitmap=i.nullBitmap,this.valueOffsets=i.valueOffsets,this.variadicBuffers=i.variadicBuffers):(this.stride=or(e),i&&((l=i[0])&&(this.valueOffsets=l),(l=i[1])&&(this.values=l),(l=i[2])&&(this.nullBitmap=l),(l=i[3])&&(this.typeIds=l)),this.variadicBuffers=c),(u=this.variadicBuffers)!==null&&u!==void 0||(this.variadicBuffers=[])}getValid(e){let{type:t}=this;if(E.isUnion(t)){let n=t,s=this.typeIds[e],i=n.typeIdToChildIndex[s],o=this.children[i],a=this.valueOffsets,c=n.mode===he.Dense&&a?Number(a[e]):e;return o.getValid(c)}if(this.nullable&&this.nullCount>0){let n=this.offset+e;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(e,t){let n,{type:s}=this;if(E.isUnion(s)){let i=s,o=this.typeIds[e],a=i.typeIdToChildIndex[o],c=this.children[a],u=this.valueOffsets,l=i.mode===he.Dense&&u?Number(u[e]):e;n=c.getValid(l),c.setValid(l,t)}else{let{nullBitmap:i}=this,{offset:o,length:a}=this,c=o+e,u=1<<c%8,l=c>>3;(!i||i.byteLength<=l)&&(i=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(i.set(mi(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:i})):Object.assign(this,{nullBitmap:i,_nullCount:0}));let f=i[l];n=(f&u)!==0,i[l]=t?f|u:f&~u}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(e=this.type,t=this.offset,n=this.length,s=this._nullCount,i=this,o=this.children,a=this.variadicBuffers){return new r(e,t,n,s,i,o,this.dictionary,a)}slice(e,t){let{stride:n,typeId:s,children:i}=this,o=+(this._nullCount===0)-1,a=s===16?n:1,c=this._sliceBuffers(e,t,n,s);return this.clone(this.type,this.offset+e,t,o,c,i.length===0||this.valueOffsets?i:this._sliceChildren(i,a*e,a*t),this.variadicBuffers)}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===w.Null)return this.clone(this.type,0,e,0,this.buffers,this.children,this.variadicBuffers);let{length:t,nullCount:n}=this,s=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);s[t>>3]=(1<<t-(t&-8))-1,n>0&&s.set(mi(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[re.VALIDITY]=s,this.clone(this.type,0,e,n+(e-t),i,this.children,this.variadicBuffers)}_sliceBuffers(e,t,n,s){let i,{buffers:o}=this;if((i=o[re.TYPE])&&(o[re.TYPE]=i.subarray(e,e+t)),E.isBinaryView(this.type)||E.isUtf8View(this.type)){let a=Z.ELEMENT_WIDTH;(i=o[re.DATA])&&(o[re.DATA]=i.subarray(e*a,(e+t)*a))}else(i=o[re.OFFSET])&&(o[re.OFFSET]=i.subarray(e,e+t+1))||(i=o[re.DATA])&&(o[re.DATA]=s===6?i:i.subarray(n*e,n*(e+t)));return o}_sliceChildren(e,t,n){return e.map(s=>s.slice(t,n))}};G.prototype.children=Object.freeze([]);G.prototype[qT]=!0;Object.defineProperty(G,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===G&&G.isData(e)}});ep=class r extends R{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{["type"]:t,["offset"]:n=0,["length"]:s=0}=e;return new G(t,n,s,s)}visitBool(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length>>3,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitInt(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitFloat(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitUtf8(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitUtf8View(e){var t;let{["type"]:n,["offset"]:s=0}=e,i=ee(n.ArrayType,e.views),o=k(e.nullBitmap),a=(e.variadicBuffers||[]).map(l=>k(l)),c=(t=e.length)!==null&&t!==void 0?t:Math.trunc(i.length/St.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new G(n,s,c,u,[void 0,i,o],[],void 0,a)}visitLargeUtf8(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=Pa(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitBinaryView(e){var t;let{["type"]:n,["offset"]:s=0}=e,i=ee(n.ArrayType,e.views),o=k(e.nullBitmap),a=(e.variadicBuffers||[]).map(l=>k(l)),c=(t=e.length)!==null&&t!==void 0?t:Math.trunc(i.length/Z.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new G(n,s,c,u,[void 0,i,o],[],void 0,a)}visitLargeBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=Pa(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitFixedSizeBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitDate(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitTimestamp(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitTime(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitDecimal(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitList(e){let{["type"]:t,["offset"]:n=0,["child"]:s}=e,i=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,void 0,i],[s])}visitLargeList(e){let{["type"]:t,["offset"]:n=0,["child"]:s}=e,i=k(e.nullBitmap),o=Pa(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,void 0,i],[s])}visitStruct(e){let{["type"]:t,["offset"]:n=0,["children"]:s=[]}=e,i=k(e.nullBitmap),{length:o=s.reduce((c,{length:u})=>Math.max(c,u),0),nullCount:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,void 0,i],s)}visitUnion(e){let{["type"]:t,["offset"]:n=0,["children"]:s=[]}=e,i=ee(t.ArrayType,e.typeIds),{["length"]:o=i.length,["nullCount"]:a=-1}=e;if(E.isSparseUnion(t))return new G(t,n,o,a,[void 0,void 0,void 0,i],s);let c=ui(e.valueOffsets);return new G(t,n,o,a,[c,void 0,void 0,i],s)}visitDictionary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.indices.ArrayType,e.data),{["dictionary"]:o=new B([new r().visit({type:t.dictionary})])}=e,{["length"]:a=i.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[void 0,i,s],[],o)}visitInterval(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitDuration(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitFixedSizeList(e){let{["type"]:t,["offset"]:n=0,["child"]:s=new r().visit({type:t.valueType})}=e,i=k(e.nullBitmap),{["length"]:o=s.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,void 0,i],[s])}visitMap(e){let{["type"]:t,["offset"]:n=0,["child"]:s=new r().visit({type:t.childType})}=e,i=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,void 0,i],[s])}},yO=new ep});function KT(r){return r.some(e=>e.nullable)}function dl(r){return r.reduce((e,t)=>e+t.nullCount,0)}function hl(r){return r.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(r.length+1))}function pl(r,e,t,n){let s=[];for(let i=-1,o=r.length;++i<o;){let a=r[i],c=e[i],{length:u}=a;if(c>=n)break;if(t>=c+u)continue;if(c>=t&&c+u<=n){s.push(a);continue}let l=Math.max(0,t-c),f=Math.min(n-c,u);s.push(a.slice(l,f-l))}return s.length===0&&s.push(r[0].slice(0,0)),s}function tp(r,e,t,n){let s=0,i=0,o=e.length-1;do{if(s>=o-1)return t<e[o]?n(r,s,t-e[s]):null;i=s+Math.trunc((o-s)*.5),t<e[i]?o=i:s=i}while(s<o)}function pc(r,e){return r.getValid(e)}function jo(r){function e(t,n,s){return r(t[n],s)}return function(t){let n=this.data;return tp(n,this._offsets,t,e)}}function ml(r){let e;function t(n,s,i){return r(n[s],i,e)}return function(n,s){let i=this.data;e=s;let o=tp(i,this._offsets,n,t);return e=void 0,o}}function bl(r){let e;function t(n,s,i){let o=i,a=0,c=0;for(let u=s-1,l=n.length;++u<l;){let f=n[u];if(~(a=r(f,e,o)))return c+a;o=0,c+=f.length}return-1}return function(n,s){e=n;let i=this.data,o=typeof s!="number"?t(i,0,0):tp(i,this._offsets,s,t);return e=void 0,o}}var hc,gl=p(()=>{hc=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}});function wO(r,e){return e===null&&r.length>0?0:-1}function xO(r,e){let{nullBitmap:t}=r;if(!t||r.nullCount<=0)return-1;let n=0;for(let s of new tn(t,r.offset+(e||0),r.length,t,Vo)){if(!s)return n;++n}return-1}function X(r,e,t){if(e===void 0)return-1;if(e===null)switch(r.typeId){case w.Union:break;case w.Dictionary:break;default:return xO(r,t)}let n=ze.getVisitFn(r),s=xs(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(s(n(r,i)))return i;return-1}function XT(r,e,t){let n=ze.getVisitFn(r),s=xs(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(s(n(r,i)))return i;return-1}var U,yi,yl=p(()=>{Me();Vt();hi();gi();Po();U=class extends R{};U.prototype.visitNull=wO;U.prototype.visitBool=X;U.prototype.visitInt=X;U.prototype.visitInt8=X;U.prototype.visitInt16=X;U.prototype.visitInt32=X;U.prototype.visitInt64=X;U.prototype.visitUint8=X;U.prototype.visitUint16=X;U.prototype.visitUint32=X;U.prototype.visitUint64=X;U.prototype.visitFloat=X;U.prototype.visitFloat16=X;U.prototype.visitFloat32=X;U.prototype.visitFloat64=X;U.prototype.visitUtf8=X;U.prototype.visitLargeUtf8=X;U.prototype.visitUtf8View=X;U.prototype.visitBinary=X;U.prototype.visitLargeBinary=X;U.prototype.visitBinaryView=X;U.prototype.visitFixedSizeBinary=X;U.prototype.visitDate=X;U.prototype.visitDateDay=X;U.prototype.visitDateMillisecond=X;U.prototype.visitTimestamp=X;U.prototype.visitTimestampSecond=X;U.prototype.visitTimestampMillisecond=X;U.prototype.visitTimestampMicrosecond=X;U.prototype.visitTimestampNanosecond=X;U.prototype.visitTime=X;U.prototype.visitTimeSecond=X;U.prototype.visitTimeMillisecond=X;U.prototype.visitTimeMicrosecond=X;U.prototype.visitTimeNanosecond=X;U.prototype.visitDecimal=X;U.prototype.visitList=X;U.prototype.visitLargeList=X;U.prototype.visitStruct=X;U.prototype.visitUnion=X;U.prototype.visitDenseUnion=XT;U.prototype.visitSparseUnion=XT;U.prototype.visitDictionary=X;U.prototype.visitInterval=X;U.prototype.visitIntervalDayTime=X;U.prototype.visitIntervalYearMonth=X;U.prototype.visitIntervalMonthDayNano=X;U.prototype.visitDuration=X;U.prototype.visitDurationSecond=X;U.prototype.visitDurationMillisecond=X;U.prototype.visitDurationMicrosecond=X;U.prototype.visitDurationNanosecond=X;U.prototype.visitFixedSizeList=X;U.prototype.visitMap=X;yi=new U});function $(r){let{type:e}=r;if(r.nullCount===0&&r.stride===1&&(E.isInt(e)&&e.bitWidth!==64||E.isTime(e)&&e.bitWidth!==64||E.isFloat(e)&&e.precision!==le.HALF))return new hc(r.data.length,n=>{let s=r.data[n];return s.values.subarray(0,s.length)[Symbol.iterator]()});let t=0;return new hc(r.data.length,n=>{let i=r.data[n].length,o=r.slice(t,t+i);return t+=i,new rp(o)})}var P,rp,Go,wl=p(()=>{Vt();Me();we();gl();P=class extends R{};rp=class{constructor(e){this.vector=e,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};P.prototype.visitNull=$;P.prototype.visitBool=$;P.prototype.visitInt=$;P.prototype.visitInt8=$;P.prototype.visitInt16=$;P.prototype.visitInt32=$;P.prototype.visitInt64=$;P.prototype.visitUint8=$;P.prototype.visitUint16=$;P.prototype.visitUint32=$;P.prototype.visitUint64=$;P.prototype.visitFloat=$;P.prototype.visitFloat16=$;P.prototype.visitFloat32=$;P.prototype.visitFloat64=$;P.prototype.visitUtf8=$;P.prototype.visitLargeUtf8=$;P.prototype.visitUtf8View=$;P.prototype.visitBinary=$;P.prototype.visitLargeBinary=$;P.prototype.visitBinaryView=$;P.prototype.visitFixedSizeBinary=$;P.prototype.visitDate=$;P.prototype.visitDateDay=$;P.prototype.visitDateMillisecond=$;P.prototype.visitTimestamp=$;P.prototype.visitTimestampSecond=$;P.prototype.visitTimestampMillisecond=$;P.prototype.visitTimestampMicrosecond=$;P.prototype.visitTimestampNanosecond=$;P.prototype.visitTime=$;P.prototype.visitTimeSecond=$;P.prototype.visitTimeMillisecond=$;P.prototype.visitTimeMicrosecond=$;P.prototype.visitTimeNanosecond=$;P.prototype.visitDecimal=$;P.prototype.visitList=$;P.prototype.visitLargeList=$;P.prototype.visitStruct=$;P.prototype.visitUnion=$;P.prototype.visitDenseUnion=$;P.prototype.visitSparseUnion=$;P.prototype.visitDictionary=$;P.prototype.visitInterval=$;P.prototype.visitIntervalDayTime=$;P.prototype.visitIntervalYearMonth=$;P.prototype.visitIntervalMonthDayNano=$;P.prototype.visitDuration=$;P.prototype.visitDurationSecond=$;P.prototype.visitDurationMillisecond=$;P.prototype.visitDurationMicrosecond=$;P.prototype.visitDurationNanosecond=$;P.prototype.visitFixedSizeList=$;P.prototype.visitMap=$;Go=new P});function rn(r){if(r){if(r instanceof G)return new B([r]);if(r instanceof B)return new B(r.data);if(r.type instanceof E)return new B([D(r)]);if(Array.isArray(r))return new B(r.flatMap(e=>TO(e)));if(ArrayBuffer.isView(r)){r instanceof DataView&&(r=new Uint8Array(r.buffer));let e={offset:0,length:r.length,nullCount:-1,data:r};if(r instanceof Int8Array)return new B([D(Object.assign(Object.assign({},e),{type:new Zt}))]);if(r instanceof Int16Array)return new B([D(Object.assign(Object.assign({},e),{type:new er}))]);if(r instanceof Int32Array)return new B([D(Object.assign(Object.assign({},e),{type:new Pe}))]);if(r instanceof BigInt64Array)return new B([D(Object.assign(Object.assign({},e),{type:new tr}))]);if(r instanceof Uint8Array||r instanceof Uint8ClampedArray)return new B([D(Object.assign(Object.assign({},e),{type:new rr}))]);if(r instanceof Uint16Array)return new B([D(Object.assign(Object.assign({},e),{type:new nr}))]);if(r instanceof Uint32Array)return new B([D(Object.assign(Object.assign({},e),{type:new vt}))]);if(r instanceof BigUint64Array)return new B([D(Object.assign(Object.assign({},e),{type:new Nr}))]);if(r instanceof Float32Array)return new B([D(Object.assign(Object.assign({},e),{type:new It}))]);if(r instanceof Float64Array)return new B([D(Object.assign(Object.assign({},e),{type:new sr}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function TO(r){return r instanceof G?[r]:r instanceof B?r.data:rn(r).data}var HT,JT,YT,QT,B,xl,ht=p(()=>{Me();Po();we();wr();gl();hi();ar();yl();wl();we();JT=Symbol.for("apache-arrow/Vector"),YT={},QT={},B=class r{static isVector(e){return e?.[JT]===!0}constructor(e){var t,n,s;let i=e[0]instanceof r?e.flatMap(a=>a.data):e;if(i.length===0||i.some(a=>!(a instanceof G)))throw new TypeError("Vector constructor expects an Array of Data instances.");let o=(t=i[0])===null||t===void 0?void 0:t.type;switch(i.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:u}=YT[o.typeId],l=i[0];this.isValid=f=>pc(l,f),this.get=f=>a(l,f),this.set=(f,d)=>c(l,f,d),this.indexOf=f=>u(l,f),this._offsets=[0,l.length];break}default:Object.setPrototypeOf(this,QT[o.typeId]),this._offsets=hl(i);break}this.data=i,this.type=o,this.stride=or(o),this.numChildren=(s=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&s!==void 0?s:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return KT(this.data)}get nullCount(){return dl(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${w[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(pi(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return Go.visit(this)}concat(...e){return new r(this.data.concat(e.flatMap(t=>t.data).flat(Number.POSITIVE_INFINITY)))}slice(e,t){return new r(fc(this,e,t,({data:n,_offsets:s},i,o)=>pl(n,s,i,o)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:s,ArrayType:i}=this;switch(e.typeId){case w.Int:case w.Float:case w.Decimal:case w.Time:case w.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*s);default:return t.reduce((o,{values:a,length:c})=>(o.array.set(a.subarray(0,c*s),o.offset),o.offset+=c*s,o),{array:new i(n*s),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)===null||t===void 0?void 0:t.findIndex(n=>n.name===e))}getChildAt(e){return e>-1&&e<this.numChildren?new r(this.data.map(({children:t})=>t[e])):null}get isMemoized(){return E.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(E.isDictionary(this.type)){let e=new xl(this.data[0].dictionary),t=this.data.map(n=>{let s=n.clone();return s.dictionary=e,s});return new r(t)}return new xl(this)}unmemoize(){if(E.isDictionary(this.type)&&this.isMemoized){let e=this.data[0].dictionary.unmemoize(),t=this.data.map(n=>{let s=n.clone();return s.dictionary=e,s});return new r(t)}return this}};HT=Symbol.toStringTag;B[HT]=(r=>{r.type=E.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0,r[JT]=!0;let e=Object.keys(w).map(t=>w[t]).filter(t=>typeof t=="number"&&t!==w.NONE);for(let t of e){let n=ze.getVisitFnByTypeId(t),s=nt.getVisitFnByTypeId(t),i=yi.getVisitFnByTypeId(t);YT[t]={get:n,set:s,indexOf:i},QT[t]=Object.create(r,{isValid:{value:jo(pc)},get:{value:jo(ze.getVisitFnByTypeId(t))},set:{value:ml(nt.getVisitFnByTypeId(t))},indexOf:{value:bl(yi.getVisitFnByTypeId(t))}})}return"Vector"})(B.prototype);Object.defineProperty(B,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===B&&B.isVector(e)}});xl=class r extends B{constructor(e){super(e.data);let t=this.get,n=this.set,s=this.slice,i=new Array(this.length);Object.defineProperty(this,"get",{value(o){let a=i[o];if(a!==void 0)return a;let c=t.call(this,o);return i[o]=c,c}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),i[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new r(s.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new B(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function ZT(r){if(!r||r.length<=0)return function(s){return!0};let e="",t=r.filter(n=>n===n);return t.length>0&&(e=`
12
+ `:s}else t+=n}return t}readDelimitedValue(e){this.offset++;let t=this.offset;for(;this.offset<this.source.length&&this.source[this.offset]!==e;)this.offset++;let n=this.source.slice(t,this.offset);return this.offset++,n}}});function Yw(r){let e=new DataView(r),t=FB(e),n=e.getUint16(t+10,!0),s=e.getUint32(t+16,!0),i=s,o=new Map,a=new TextDecoder,c=0;for(let u=0;u<n;u++){if(s+46>t)throw new Error("USDZ archive contains a truncated ZIP central-directory entry.");if(e.getUint32(s,!0)!==33639248)throw new Error("USDZ archive contains an invalid ZIP central-directory entry.");let l=e.getUint16(s+10,!0),f=e.getUint32(s+20,!0),d=e.getUint32(s+24,!0),h=e.getUint16(s+28,!0),m=e.getUint16(s+30,!0),b=e.getUint16(s+32,!0),g=e.getUint32(s+42,!0);if(s+46+h+m+b>t)throw new Error("USDZ archive contains a truncated ZIP filename or extra field.");let y=a.decode(new Uint8Array(r,s+46,h));if(l!==0)throw new Error(`USDZ entry "${y}" is compressed; USDZ requires stored ZIP entries.`);if(g+30>i||f!==d)throw new Error(`USDZ entry "${y}" has invalid stored ZIP bounds.`);if(e.getUint32(g,!0)!==67324752)throw new Error(`USDZ entry "${y}" has an invalid local ZIP header.`);let x=e.getUint16(g+26,!0),T=e.getUint16(g+28,!0),_=g+30+x+T;if((e.getUint16(s+8,!0)|e.getUint16(g+6,!0))&1)throw new Error(`USDZ entry "${y}" is encrypted.`);if(_+f>i||e.getUint16(g+8,!0)!==0||a.decode(new Uint8Array(r,g+30,x))!==y||o.has(y))throw new Error(`USDZ entry "${y}" has invalid or duplicate stored ZIP data.`);if(c+=f,c>r.byteLength)throw new Error("USDZ archive exceeds its stored data budget.");o.set(y,r.slice(_,_+f)),s+=46+h+m+b}return o}function FB(r){let e=Math.max(0,r.byteLength-65557);for(let t=r.byteLength-22;t>=e;t--)if(r.getUint32(t,!0)===101010256)return t;throw new Error("USDZ archive does not contain a ZIP end-of-central-directory record.")}var Qw=p(()=>{"use strict"});async function Jd(r,e={},t){let n=RB(e.core?.baseUrl,t?.url),s={fetch:async o=>{let a=await(t?.fetch||fetch)(o);if(!(a instanceof Response))throw new Error(`OpenUSD reference "${o}" did not return an HTTP response.`);if(!a.ok)throw new Error(`Unable to load OpenUSD reference "${o}": ${a.status}.`);return a},cache:new Map,archiveFiles:new Map,layers:new Set,options:{...e,usd:{...NB,...e.usd}}},i;if(VB(r)){let o=Yw(r),a=o.keys().next().value;if(!a||!/\.(?:usd[ac]?)$/i.test(a))throw new Error("USDZ archive has no supported USD root layer.");let c="https://usd.archive/",u=Object.create(null);for(let[f,d]of o){let h=new URL(f,c);if(f.startsWith("/")||/^[a-z][a-z\d+.-]*:/i.test(f)||f.includes("\\")||/[\u0000-\u001f\u007f]/.test(f)||f.trim()!==f||f.split("/").some(m=>{let b=m.replace(/%2e/gi,".");return b==="."||b===".."})||h.origin!==new URL(c).origin||h.search||h.hash||u[h.href])throw new Error(`USDZ entry "${f}" has an ambiguous package URL.`);s.archiveFiles.set(h.href,d),u[h.href]=DB(f,d)}let l=new URL(a,c).href;i=qd(o.get(a),l),i.format="usdz",i.assets=u}else i=qd(r,n);return i.url&&(tx(i,i.url),s.layers.add(i.url)),s.options.usd?.compose!==!1&&(i.rootPrims=await Kd(i.rootPrims,i.url,{},s,0)),i.layers=Array.from(s.layers),n&&(i.url=n),i}function DB(r,e){let t=r.slice(r.lastIndexOf(".")+1).toLowerCase(),n=t==="png"?"image/png":/^(?:jpe?g)$/.test(t)?"image/jpeg":void 0;return n?{path:r,data:e,mimeType:n}:{path:r,data:e}}function RB(r,e){let t=ex(r);return t||ex(e)||r||e}function ex(r){try{return r?new URL(r).href:void 0}catch{return}}function kB(r,e){try{return new URL(r,e).href}catch{let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t>=0?`${e.slice(0,t+1)}${r}`:r}}function qd(r,e){return Zw.decode(r.slice(0,8))===OB?qw(r,e):Hw(Zw.decode(r),e)}function tx(r,e){let t=[...r.rootPrims];for(;t.length;){let n=t.pop();for(let s of Object.values(n.attributes))s.sourceUrl=e;for(let s of n.children)t.push(s);if("variants"in n)for(let s of Object.values(n.variants))for(let i of Object.values(s))t.push(i)}}async function Kd(r,e,t,n,s){if(s>(n.options.usd?.maxReferenceDepth??12))throw new Error("OpenUSD reference composition exceeded the configured depth limit.");let i=[];for(let o of r){if(o.specifier==="class")continue;let c={...PB(o.metadata.variants),...t,...n.options.usd?.variantSelections},u=o.sourceUrl||e,l=ka(o);for(let[d,h]of Object.entries(l.variants)){let m=c[d]||Object.keys(h)[0],b=h[m];b&&(l=Hd(l,{...l,attributes:b.attributes,metadata:b.metadata,children:b.children,variants:{}}))}let f=nx(l);if(n.options.usd?.loadReferences!==!1&&f.length>0)for(let d of f){if(!u)throw new Error("OpenUSD references require a source URL or options.core.baseUrl.");let h=kB(d.assetPath,u),m=await CB(h,n),b=UB(m,d.primPath),g=await Kd(b,h,c,n,s+1);for(let y of g)l=Hd(sx(y,l.path),l)}l.children=await Kd(l.children,u,c,n,s),i.push(l)}return i}async function CB(r,e){let t=e.cache.get(r);return t||(t=(async()=>{let s=e.archiveFiles.get(r);if(!s){let o;try{o=await e.fetch(r)}catch(a){throw new Error(`Unable to fetch USD layer "${r}": ${String(a)}`)}s=o.arrayBuffer()}let i=qd(await s,r);return tx(i,r),e.layers.add(r),i})(),e.cache.set(r,t)),t}function UB(r,e){let t=e||r.metadata.defaultPrim;if(typeof t!="string")return r.rootPrims;let n=t.startsWith("/")?t:`/${t}`,s=rx(r.rootPrims,n);return s?[s]:[]}function rx(r,e){for(let t of r){if(t.path===e)return t;let n=rx(t.children,e);if(n)return n}}function nx(r){let e=[];for(let t of[r.metadata.references,r.metadata.payload,r.metadata.payloads])Array.isArray(t)?e.push(...t.filter(Xd)):Xd(t)&&e.push(t);return e}function PB(r){return!r||typeof r!="object"||Array.isArray(r)||Xd(r)?{}:Object.fromEntries(Object.entries(r).filter(e=>typeof e[1]=="string"))}function Xd(r){return!!(r&&typeof r=="object"&&!Array.isArray(r)&&"assetPath"in r)}function ka(r){return{...r,attributes:{...r.attributes},metadata:{...r.metadata},variants:{...r.variants},children:r.children.map(ka)}}function sx(r,e){let t=ka(r);return t.path=e,t.children=t.children.map(n=>sx(n,`${e}/${n.name}`)),t}function Hd(r,e){let t=r.children.map(ka);for(let n of e.children){let s=t.findIndex(i=>i.name===n.name);s>=0?t[s]=Hd(t[s],n):t.push(ka(n))}return{...r,...e,sourceUrl:nx(e).length>0?e.sourceUrl:r.sourceUrl||e.sourceUrl,type:e.type||r.type,attributes:{...r.attributes,...e.attributes},metadata:{...r.metadata,...e.metadata},variants:{...r.variants,...e.variants},children:t}}function VB(r){return r.byteLength>=4&&new DataView(r).getUint32(0,!0)===MB}var Zw,OB,MB,NB,ix=p(()=>{"use strict";Xw();Jw();Qw();Zw=new TextDecoder,OB="PXR-USDC",MB=67324752;NB={compose:!0,loadReferences:!0,maxReferenceDepth:12,variantSelections:{}}});async function zB(r,e,t){return Jd(new TextEncoder().encode(r).buffer,e,t)}var DU,jB,GB,ox=p(()=>{"use strict";ix();Yd();({preload:DU,...jB}=Na),GB={...jB,parse:Jd,parseText:zB}});var ax={};J(ax,{USDLoaderWithParser:()=>GB});var cx=p(()=>{"use strict";ox()});async function $B(){let{USDLoaderWithParser:r}=await Promise.resolve().then(()=>(cx(),ax));return r}var WB,Na,Yd=p(()=>{"use strict";WB="5.0.0-beta.7";Na={dataType:null,batchType:null,name:"Universal Scene Description",id:"usd",module:"scene",version:WB,extensions:["usd","usda","usdc","usdz"],mimeTypes:["model/vnd.usd","model/vnd.usda","model/vnd.usdc","model/vnd.usdz+zip"],text:!0,binary:!0,tests:["#usda","PXR-USDC","PK"],options:{usd:{compose:!0,loadReferences:!0,maxReferenceDepth:12,variantSelections:{}}},preload:$B}});var ux,lx=p(()=>{"use strict";ux={name:"OBJ",id:"obj",module:"scene",encoding:"text",format:"obj",extensions:["obj"],mimeTypes:["text/plain"]}});function dx(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(r);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(r,n[s])&&(t[n[s]]=r[n[s]]);return t}function F(r,e,t,n){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{u(n.next(l))}catch(f){o(f)}}function c(l){try{u(n.throw(l))}catch(f){o(f)}}function u(l){l.done?i(l.value):s(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})}function fx(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Y(r){return this instanceof Y?(this.v=r,this):new Y(r)}function _t(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(h){return function(m){return Promise.resolve(m).then(h,f)}}function a(h,m){n[h]&&(s[h]=function(b){return new Promise(function(g,y){i.push([h,b,g,y])>1||c(h,b)})},m&&(s[h]=m(s[h])))}function c(h,m){try{u(n[h](m))}catch(b){d(i[0][3],b)}}function u(h){h.value instanceof Y?Promise.resolve(h.value.v).then(l,f):d(i[0][2],h)}function l(h){c("next",h)}function f(h){c("throw",h)}function d(h,m){h(m),i.shift(),i.length&&c(i[0][0],i[0][1])}}function Ao(r){var e,t;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=r[s]?function(o){return(t=!t)?{value:Y(r[s](o)),done:!1}:i?i(o):o}:i}}function Ht(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof fx=="function"?fx(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=r[i]&&function(o){return new Promise(function(a,c){o=r[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},o)}}var kt=p(()=>{});var hx,vo,qB,Jt,gn=p(()=>{hx=new TextDecoder("utf-8"),vo=hx.decode.bind(hx),qB=new TextEncoder,Jt=r=>qB.encode(r)});var KB,px,qe,At,Yt,Br,br,Eu,Lu,Bu,Fu,Ou,mx,Ca,bx,Mu,gx,Yn=p(()=>{KB=r=>typeof r=="number",px=r=>typeof r=="boolean",qe=r=>typeof r=="function",At=r=>r!=null&&Object(r)===r,Yt=r=>At(r)&&qe(r.then),Br=r=>At(r)&&qe(r[Symbol.iterator]),br=r=>At(r)&&qe(r[Symbol.asyncIterator]),Eu=r=>At(r)&&At(r.schema),Lu=r=>At(r)&&"done"in r&&"value"in r,Bu=r=>At(r)&&qe(r.stat)&&KB(r.fd),Fu=r=>At(r)&&Ca(r.body),Ou=r=>"_getDOMStream"in r&&"_getNodeStream"in r,mx=r=>At(r)&&qe(r.abort)&&qe(r.getWriter)&&!Ou(r),Ca=r=>At(r)&&qe(r.cancel)&&qe(r.getReader)&&!Ou(r),bx=r=>At(r)&&qe(r.end)&&qe(r.write)&&px(r.writable)&&!Ou(r),Mu=r=>At(r)&&qe(r.read)&&qe(r.pipe)&&px(r.readable)&&!Ou(r),gx=r=>At(r)&&qe(r.clear)&&qe(r.bytes)&&qe(r.position)&&qe(r.setPosition)&&qe(r.capacity)&&qe(r.getBufferIdentifier)&&qe(r.createLong)});var nh={};J(nh,{compareArrayLike:()=>rh,joinUint8Arrays:()=>Qt,memcpy:()=>Ua,rebaseValueOffsets:()=>Du,toArrayBufferView:()=>ee,toArrayBufferViewAsyncIterator:()=>Fr,toArrayBufferViewIterator:()=>Xr,toBigInt64Array:()=>Pa,toBigUint64Array:()=>ZB,toFloat32Array:()=>eF,toFloat32ArrayAsyncIterator:()=>bF,toFloat32ArrayIterator:()=>cF,toFloat64Array:()=>tF,toFloat64ArrayAsyncIterator:()=>gF,toFloat64ArrayIterator:()=>uF,toInt16Array:()=>JB,toInt16ArrayAsyncIterator:()=>dF,toInt16ArrayIterator:()=>sF,toInt32Array:()=>ui,toInt32ArrayAsyncIterator:()=>hF,toInt32ArrayIterator:()=>iF,toInt8Array:()=>HB,toInt8ArrayAsyncIterator:()=>fF,toInt8ArrayIterator:()=>nF,toUint16Array:()=>YB,toUint16ArrayAsyncIterator:()=>pF,toUint16ArrayIterator:()=>oF,toUint32Array:()=>QB,toUint32ArrayAsyncIterator:()=>mF,toUint32ArrayIterator:()=>aF,toUint8Array:()=>k,toUint8ArrayAsyncIterator:()=>th,toUint8ArrayIterator:()=>eh,toUint8ClampedArray:()=>rF,toUint8ClampedArrayAsyncIterator:()=>yF,toUint8ClampedArrayIterator:()=>lF});function XB(r){let e=r[0]?[r[0]]:[],t,n,s,i;for(let o,a,c=0,u=0,l=r.length;++c<l;){if(o=e[u],a=r[c],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(e[++u]=a);continue}if({byteOffset:t,byteLength:s}=o,{byteOffset:n,byteLength:i}=a,t+s<n||n+i<t){a&&(e[++u]=a);continue}e[u]=new Uint8Array(o.buffer,t,n-t+i)}return e}function Ua(r,e,t=0,n=e.byteLength){let s=r.byteLength,i=new Uint8Array(r.buffer,r.byteOffset,s),o=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,s));return i.set(o,t),r}function Qt(r,e){let t=XB(r),n=t.reduce((l,f)=>l+f.byteLength,0),s,i,o,a=0,c=-1,u=Math.min(e||Number.POSITIVE_INFINITY,n);for(let l=t.length;++c<l;){if(s=t[c],i=s.subarray(0,Math.min(s.length,u-a)),u<=a+i.length){i.length<s.length?t[c]=s.subarray(i.length):i.length===s.length&&c++,o?Ua(o,i,a):o=i;break}Ua(o||(o=new Uint8Array(u)),i,a),a+=i.length}return[o||new Uint8Array(0),t.slice(c),n-(o?o.byteLength:0)]}function ee(r,e){let t=Lu(e)?e.value:e;return t instanceof r?r===Uint8Array?new r(t.buffer,t.byteOffset,t.byteLength):t:t?(typeof t=="string"&&(t=Jt(t)),t instanceof ArrayBuffer?new r(t):t instanceof Zd?new r(t):gx(t)?ee(r,t.bytes()):ArrayBuffer.isView(t)?t.byteLength<=0?new r(0):new r(t.buffer,t.byteOffset,t.byteLength/r.BYTES_PER_ELEMENT):r.from(t)):new r(0)}function*Xr(r,e){let t=function*(s){yield s},n=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Zd?t(e):Br(e)?e:t(e);return yield*Qd((function*(s){let i=null;do i=s.next(yield ee(r,i));while(!i.done)})(n[Symbol.iterator]())),new r}function Fr(r,e){return _t(this,arguments,function*(){if(Yt(e))return yield Y(yield Y(yield*Ao(Ht(Fr(r,yield Y(e))))));let n=function(o){return _t(this,arguments,function*(){yield yield Y(yield Y(o))})},s=function(o){return _t(this,arguments,function*(){yield Y(yield*Ao(Ht(Qd((function*(a){let c=null;do c=a.next(yield c?.value);while(!c.done)})(o[Symbol.iterator]())))))})},i=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Zd?n(e):Br(e)?s(e):br(e)?e:n(e);return yield Y(yield*Ao(Ht(Qd((function(o){return _t(this,arguments,function*(){let a=null;do a=yield Y(o.next(yield yield Y(ee(r,a))));while(!a.done)})})(i[Symbol.asyncIterator]()))))),yield Y(new r)})}function Du(r,e,t){if(r!==0){t=t.slice(0,e);let n=typeof t[0]=="bigint"?BigInt(r):r;for(let s=-1,i=t.length;++s<i;)t[s]+=n}return t.subarray(0,e)}function rh(r,e){let t=0,n=r.length;if(n!==e.length)return!1;if(n>0)do if(r[t]!==e[t])return!1;while(++t<n);return!0}var Zd,HB,JB,ui,Pa,k,YB,QB,ZB,eF,tF,rF,Qd,nF,sF,iF,eh,oF,aF,cF,uF,lF,fF,dF,hF,th,pF,mF,bF,gF,yF,Ke=p(()=>{kt();gn();Yn();Zd=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;HB=r=>ee(Int8Array,r),JB=r=>ee(Int16Array,r),ui=r=>ee(Int32Array,r),Pa=r=>ee(BigInt64Array,r),k=r=>ee(Uint8Array,r),YB=r=>ee(Uint16Array,r),QB=r=>ee(Uint32Array,r),ZB=r=>ee(BigUint64Array,r),eF=r=>ee(Float32Array,r),tF=r=>ee(Float64Array,r),rF=r=>ee(Uint8ClampedArray,r),Qd=r=>(r.next(),r);nF=r=>Xr(Int8Array,r),sF=r=>Xr(Int16Array,r),iF=r=>Xr(Int32Array,r),eh=r=>Xr(Uint8Array,r),oF=r=>Xr(Uint16Array,r),aF=r=>Xr(Uint32Array,r),cF=r=>Xr(Float32Array,r),uF=r=>Xr(Float64Array,r),lF=r=>Xr(Uint8ClampedArray,r);fF=r=>Fr(Int8Array,r),dF=r=>Fr(Int16Array,r),hF=r=>Fr(Int32Array,r),th=r=>Fr(Uint8Array,r),pF=r=>Fr(Uint16Array,r),mF=r=>Fr(Uint32Array,r),bF=r=>Fr(Float32Array,r),gF=r=>Fr(Float64Array,r),yF=r=>Fr(Uint8ClampedArray,r)});function*wF(r){let e,t=!1,n=[],s,i,o,a=0;function c(){return i==="peek"?Qt(n,o)[0]:([s,n,a]=Qt(n,o),s)}({cmd:i,size:o}=(yield null)||{cmd:"read",size:0});let u=eh(r)[Symbol.iterator]();try{do if({done:e,value:s}=Number.isNaN(o-a)?u.next():u.next(o-a),!e&&s.byteLength>0&&(n.push(s),a+=s.byteLength),e||o<=a)do({cmd:i,size:o}=yield c());while(o<a);while(!e)}catch(l){t=!0,typeof u.throw=="function"&&u.throw(l)}finally{t===!1&&typeof u.return=="function"&&u.return(null)}return null}function xF(r){return _t(this,arguments,function*(){let t,n=!1,s=[],i,o,a,c=0;function u(){return o==="peek"?Qt(s,a)[0]:([i,s,c]=Qt(s,a),i)}({cmd:o,size:a}=(yield yield Y(null))||{cmd:"read",size:0});let l=th(r)[Symbol.asyncIterator]();try{do if({done:t,value:i}=Number.isNaN(a-c)?yield Y(l.next()):yield Y(l.next(a-c)),!t&&i.byteLength>0&&(s.push(i),c+=i.byteLength),t||a<=c)do({cmd:o,size:a}=yield yield Y(u()));while(a<c);while(!t)}catch(f){n=!0,typeof l.throw=="function"&&(yield Y(l.throw(f)))}finally{n===!1&&typeof l.return=="function"&&(yield Y(l.return(new Uint8Array(0))))}return yield Y(null)})}function TF(r){return _t(this,arguments,function*(){let t=!1,n=!1,s=[],i,o,a,c=0;function u(){return o==="peek"?Qt(s,a)[0]:([i,s,c]=Qt(s,a),i)}({cmd:o,size:a}=(yield yield Y(null))||{cmd:"read",size:0});let l=new ih(r);try{do if({done:t,value:i}=Number.isNaN(a-c)?yield Y(l.read()):yield Y(l.read(a-c)),!t&&i.byteLength>0&&(s.push(k(i)),c+=i.byteLength),t||a<=c)do({cmd:o,size:a}=yield yield Y(u()));while(a<c);while(!t)}catch(f){n=!0,yield Y(l.cancel(f))}finally{n===!1?yield Y(l.cancel()):r.locked&&l.releaseLock()}return yield Y(null)})}function _F(r){return _t(this,arguments,function*(){let t=[],n="error",s=!1,i=null,o,a,c=0,u=[],l;function f(){return o==="peek"?Qt(u,a)[0]:([l,u,c]=Qt(u,a),l)}if({cmd:o,size:a}=(yield yield Y(null))||{cmd:"read",size:0},r.isTTY)return yield yield Y(new Uint8Array(0)),yield Y(null);try{t[0]=sh(r,"end"),t[1]=sh(r,"error");do{if(t[2]=sh(r,"readable"),[n,i]=yield Y(Promise.race(t.map(h=>h[2]))),n==="error")break;if((s=n==="end")||(Number.isFinite(a-c)?(l=k(r.read(a-c)),l.byteLength<a-c&&(l=k(r.read()))):l=k(r.read()),l.byteLength>0&&(u.push(l),c+=l.byteLength)),s||a<=c)do({cmd:o,size:a}=yield yield Y(f()));while(a<c)}while(!s)}finally{yield Y(d(t,n==="error"?i:null))}return yield Y(null);function d(h,m){return l=u=null,new Promise((b,g)=>{for(let[y,x]of h)r.off(y,x);try{let y=r.destroy;y&&y.call(r,m),m=void 0}catch(y){m=y||m}finally{m!=null?g(m):b()}})}})}var Qe,Ru,ih,sh,Va=p(()=>{kt();Ke();Qe={fromIterable(r){return Ru(wF(r))},fromAsyncIterable(r){return Ru(xF(r))},fromDOMStream(r){return Ru(TF(r))},fromNodeStream(r){return Ru(_F(r))},toDOMStream(r,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(r,e){throw new Error('"toNodeStream" not available in this environment')}},Ru=r=>(r.next(),r);ih=class{constructor(e){this.source=e,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(e){return F(this,void 0,void 0,function*(){let{reader:t,source:n}=this;t&&(yield t.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return F(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let t=yield this.reader.read();return!t.done&&(t.value=k(t)),t})}},sh=(r,e)=>{let t=s=>n([e,s]),n;return[e,t,new Promise(s=>(n=s)&&r.once(e,t))]}});var ge,ku=p(()=>{(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"})(ge||(ge={}))});var he,oh=p(()=>{(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(he||(he={}))});var le,ah=p(()=>{(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(le||(le={}))});var ye,ch=p(()=>{(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(ye||(ye={}))});var L,ja=p(()=>{(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(L||(L={}))});var ae,uh=p(()=>{(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"})(ae||(ae={}))});var Nu=p(()=>{});var Hr,Cu,Uu,Io,lh=p(()=>{Hr=new Int32Array(2),Cu=new Float32Array(Hr.buffer),Uu=new Float64Array(Hr.buffer),Io=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var Ga,fh=p(()=>{(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(Ga||(Ga={}))});var Ze,dh=p(()=>{Nu();fh();lh();Ze=class r{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new r(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return Hr[0]=this.readInt32(e),Cu[0]}readFloat64(e){return Hr[Io?0:1]=this.readInt32(e),Hr[Io?1:0]=this.readInt32(e+4),Uu[0]}writeInt8(e,t){this.bytes_[e]=t}writeUint8(e,t){this.bytes_[e]=t}writeInt16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){Cu[0]=t,this.writeInt32(e,Hr[0])}writeFloat64(e,t){Uu[0]=t,this.writeInt32(e,Hr[Io?0:1]),this.writeInt32(e+4,Hr[Io?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let t=0;t<4;t++)e+=String.fromCharCode(this.readInt8(this.position_+4+t));return e}__offset(e,t){let n=e-this.readInt32(e);return t<this.readInt16(n)?this.readInt16(n+t):0}__union(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e}__string(e,t){e+=this.readInt32(e);let n=this.readInt32(e);e+=4;let s=this.bytes_.subarray(e,e+n);return t===Ga.UTF8_BYTES?s:this.text_decoder_.decode(s)}__union_with_string(e,t){return typeof e=="string"?this.__string(t):this.__union(e,t)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+4}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let t=0;t<4;t++)if(e.charCodeAt(t)!=this.readInt8(this.position()+4+t))return!1;return!0}createScalarList(e,t){let n=[];for(let s=0;s<t;++s){let i=e(s);i!==null&&n.push(i)}return n}createObjList(e,t){let n=[];for(let s=0;s<t;++s){let i=e(s);i!==null&&n.push(i.unpack())}return n}}});var li,yx=p(()=>{dh();Nu();li=class r{constructor(e){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 t;e?t=e:t=1024,this.bb=Ze.allocate(t),this.space=t}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(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,t){e>this.minalign&&(this.minalign=e);let n=~(this.bb.capacity()-this.space+t)+1&e-1;for(;this.space<n+e+t;){let s=this.bb.capacity();this.bb=r.growByteBuffer(this.bb),this.space+=this.bb.capacity()-s}this.pad(n)}pad(e){for(let t=0;t<e;t++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,t,n){(this.force_defaults||t!=n)&&(this.addInt8(t),this.slot(e))}addFieldInt16(e,t,n){(this.force_defaults||t!=n)&&(this.addInt16(t),this.slot(e))}addFieldInt32(e,t,n){(this.force_defaults||t!=n)&&(this.addInt32(t),this.slot(e))}addFieldInt64(e,t,n){(this.force_defaults||t!==n)&&(this.addInt64(t),this.slot(e))}addFieldFloat32(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat32(t),this.slot(e))}addFieldFloat64(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat64(t),this.slot(e))}addFieldOffset(e,t,n){(this.force_defaults||t!=n)&&(this.addOffset(t),this.slot(e))}addFieldStruct(e,t,n){t!=n&&(this.nested(t),this.slot(e))}nested(e){if(e!=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(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){let t=e.capacity();if(t&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let n=t<<1,s=Ze.allocate(n);return s.setPosition(n-t),s.bytes().set(e.bytes(),n-t),s}addOffset(e){this.prep(4,0),this.writeInt32(this.offset()-e+4)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let t=0;t<e;t++)this.vtable[t]=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 e=this.offset(),t=this.vtable_in_use-1;for(;t>=0&&this.vtable[t]==0;t--);let n=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);let s=2;this.addInt16(e-this.object_start);let i=(n+s)*2;this.addInt16(i);let o=0,a=this.space;e:for(t=0;t<this.vtables.length;t++){let c=this.bb.capacity()-this.vtables[t];if(i==this.bb.readInt16(c)){for(let u=2;u<i;u+=2)if(this.bb.readInt16(a+u)!=this.bb.readInt16(c+u))continue e;o=this.vtables[t];break}}return o?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,o-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,t,n){let s=n?4:0;if(t){let i=t;if(this.prep(this.minalign,8+s),i.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let o=3;o>=0;o--)this.writeInt8(i.charCodeAt(o))}this.prep(this.minalign,4+s),this.addOffset(e),s&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){let n=this.bb.capacity()-e,s=n-this.bb.readInt32(n);if(!(t<this.bb.readInt16(s)&&this.bb.readInt16(s+t)!=0))throw new TypeError("FlatBuffers: field "+t+" must be set")}startVector(e,t,n){this.notNested(),this.vector_num_elems=t,this.prep(4,e*t),this.prep(n,e*t)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);let t=this.createString(e);return this.string_maps.set(e,t),t}createString(e){if(e==null)return 0;let t;return e instanceof Uint8Array?t=e:t=this.text_encoder.encode(e),this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector()}createByteVector(e){return e==null?0:(this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){let t=[];for(let n=0;n<e.length;++n){let s=e[n];if(s!==null)t.push(this.createObjectOffset(s));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return t}createStructOffsetList(e,t){return t(this,e.length),this.createObjectOffsetList(e.slice().reverse()),this.endVector()}}});var ce=p(()=>{Nu();lh();yx();dh();fh()});var fi,hh=p(()=>{(function(r){r[r.BUFFER=0]="BUFFER"})(fi||(fi={}))});var et,So=p(()=>{(function(r){r[r.LZ4_FRAME=0]="LZ4_FRAME",r[r.ZSTD=1]="ZSTD"})(et||(et={}))});var yn,ph=p(()=>{ce();hh();So();yn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBodyCompression(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):et.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):fi.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,t){e.addFieldInt8(0,t,et.LZ4_FRAME)}static addMethod(e,t){e.addFieldInt8(1,t,fi.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,t,n){return r.startBodyCompression(e),r.addCodec(e,t),r.addMethod(e,n),r.endBodyCompression(e)}}});var Eo,mh=p(()=>{Eo=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(e,t,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(t??0)),e.offset()}}});var Lo,bh=p(()=>{Lo=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(e,t,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(t??0)),e.offset()}}});var ot,gh=p(()=>{ce();ph();mh();bh();ot=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsRecordBatch(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}nodes(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new Lo).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Eo).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let t=this.bb.__offset(this.bb_pos,10);return t?(e||new yn).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}variadicBufferCounts(e){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}variadicBufferCountsLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startRecordBatch(e){e.startObject(5)}static addLength(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addNodes(e,t){e.addFieldOffset(1,t,0)}static startNodesVector(e,t){e.startVector(16,t,8)}static addBuffers(e,t){e.addFieldOffset(2,t,0)}static startBuffersVector(e,t){e.startVector(16,t,8)}static addCompression(e,t){e.addFieldOffset(3,t,0)}static addVariadicBufferCounts(e,t){e.addFieldOffset(4,t,0)}static createVariadicBufferCountsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startVariadicBufferCountsVector(e,t){e.startVector(8,t,8)}static endRecordBatch(e){return e.endObject()}}});var wn,wx=p(()=>{ce();gh();wn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryBatch(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}data(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new ot).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addData(e,t){e.addFieldOffset(1,t,0)}static addIsDelta(e,t){e.addFieldInt8(2,+t,0)}static endDictionaryBatch(e){return e.endObject()}}});var Qn,yh=p(()=>{(function(r){r[r.Little=0]="Little",r[r.Big=1]="Big"})(Qn||(Qn={}))});var za,xx=p(()=>{(function(r){r[r.DenseArray=0]="DenseArray"})(za||(za={}))});var Mr,Vu=p(()=>{ce();Mr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInt(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,t){e.addFieldInt32(0,t,0)}static addIsSigned(e,t){e.addFieldInt8(1,+t,0)}static endInt(e){return e.endObject()}static createInt(e,t,n){return r.startInt(e),r.addBitWidth(e,t),r.addIsSigned(e,n),r.endInt(e)}}});var Jr,wh=p(()=>{ce();xx();Vu();Jr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryEncoding(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}indexType(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Mr).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):za.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addIndexType(e,t){e.addFieldOffset(1,t,0)}static addIsOrdered(e,t){e.addFieldInt8(2,+t,0)}static addDictionaryKind(e,t){e.addFieldInt16(3,t,za.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}}});var Oe,Bo=p(()=>{ce();Oe=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKeyValue(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}key(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}value(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,t){e.addFieldOffset(0,t,0)}static addValue(e,t){e.addFieldOffset(1,t,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,t,n){return r.startKeyValue(e),r.addKey(e,t),r.addValue(e,n),r.endKeyValue(e)}}});var Wa,Tx=p(()=>{ce();Wa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinary(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return r.startBinary(e),r.endBinary(e)}}});var $a,_x=p(()=>{ce();$a=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinaryView(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinaryView(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startBinaryView(e){e.startObject(0)}static endBinaryView(e){return e.endObject()}static createBinaryView(e){return r.startBinaryView(e),r.endBinaryView(e)}}});var qa,Ax=p(()=>{ce();qa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBool(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return r.startBool(e),r.endBool(e)}}});var Zn,xh=p(()=>{ce();ch();Zn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDate(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ye.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,ye.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,t){return r.startDate(e),r.addUnit(e,t),r.endDate(e)}}});var Yr,Th=p(()=>{ce();Yr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDecimal(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,t){e.addFieldInt32(0,t,0)}static addScale(e,t){e.addFieldInt32(1,t,0)}static addBitWidth(e,t){e.addFieldInt32(2,t,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,t,n,s){return r.startDecimal(e),r.addPrecision(e,t),r.addScale(e,n),r.addBitWidth(e,s),r.endDecimal(e)}}});var es,_h=p(()=>{ce();ja();es=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDuration(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):L.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,L.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,t){return r.startDuration(e),r.addUnit(e,t),r.endDuration(e)}}});var ts,Ah=p(()=>{ce();ts=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeBinary(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,t){return r.startFixedSizeBinary(e),r.addByteWidth(e,t),r.endFixedSizeBinary(e)}}});var rs,vh=p(()=>{ce();rs=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeList(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,t){return r.startFixedSizeList(e),r.addListSize(e,t),r.endFixedSizeList(e)}}});var ns,Ih=p(()=>{ce();ah();ns=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFloatingPoint(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):le.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,t){e.addFieldInt16(0,t,le.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,t){return r.startFloatingPoint(e),r.addPrecision(e,t),r.endFloatingPoint(e)}}});var ss,Sh=p(()=>{ce();uh();ss=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInterval(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ae.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,ae.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,t){return r.startInterval(e),r.addUnit(e,t),r.endInterval(e)}}});var Ka,vx=p(()=>{ce();Ka=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeBinary(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return r.startLargeBinary(e),r.endLargeBinary(e)}}});var Xa,Ix=p(()=>{ce();Xa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeList(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeList(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startLargeList(e){e.startObject(0)}static endLargeList(e){return e.endObject()}static createLargeList(e){return r.startLargeList(e),r.endLargeList(e)}}});var Ha,Sx=p(()=>{ce();Ha=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeUtf8(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return r.startLargeUtf8(e),r.endLargeUtf8(e)}}});var Ja,Ex=p(()=>{ce();Ja=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsList(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return r.startList(e),r.endList(e)}}});var is,Eh=p(()=>{ce();is=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMap(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,t){e.addFieldInt8(0,+t,0)}static endMap(e){return e.endObject()}static createMap(e,t){return r.startMap(e),r.addKeysSorted(e,t),r.endMap(e)}}});var Ya,Lx=p(()=>{ce();Ya=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNull(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return r.startNull(e),r.endNull(e)}}});var Qa,Bx=p(()=>{ce();Qa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsStruct_(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return r.startStruct_(e),r.endStruct_(e)}}});var xn,Lh=p(()=>{ce();ja();xn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTime(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):L.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,L.MILLISECOND)}static addBitWidth(e,t){e.addFieldInt32(1,t,32)}static endTime(e){return e.endObject()}static createTime(e,t,n){return r.startTime(e),r.addUnit(e,t),r.addBitWidth(e,n),r.endTime(e)}}});var Tn,Bh=p(()=>{ce();ja();Tn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTimestamp(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):L.SECOND}timezone(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,L.SECOND)}static addTimezone(e,t){e.addFieldOffset(1,t,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,t,n){return r.startTimestamp(e),r.addUnit(e,t),r.addTimezone(e,n),r.endTimestamp(e)}}});var Dr,Fh=p(()=>{ce();oh();Dr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUnion(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):he.Sparse}typeIds(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,t){e.addFieldInt16(0,t,he.Sparse)}static addTypeIds(e,t){e.addFieldOffset(1,t,0)}static createTypeIdsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(e,t,n){return r.startUnion(e),r.addMode(e,t),r.addTypeIds(e,n),r.endUnion(e)}}});var Za,Fx=p(()=>{ce();Za=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return r.startUtf8(e),r.endUtf8(e)}}});var ec,Ox=p(()=>{ce();ec=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8View(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8View(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8View(e){e.startObject(0)}static endUtf8View(e){return e.endObject()}static createUtf8View(e){return r.startUtf8View(e),r.endUtf8View(e)}}});var z,ju=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.FloatingPoint=3]="FloatingPoint",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct_=13]="Struct_",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList",r[r.RunEndEncoded=22]="RunEndEncoded",r[r.BinaryView=23]="BinaryView",r[r.Utf8View=24]="Utf8View",r[r.ListView=25]="ListView",r[r.LargeListView=26]="LargeListView"})(z||(z={}))});var at,Oh=p(()=>{ce();wh();Bo();ju();at=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):z.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new Jr).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?(t||new r).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new Oe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,z.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){return e.endObject()}}});var Nt,Mh=p(()=>{ce();yh();Oh();Bo();Nt=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Qn.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new at).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Oe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,Qn.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){return e.endObject()}static createSchema(e,t,n,s,i){return r.startSchema(e),r.addEndianness(e,t),r.addFields(e,n),r.addCustomMetadata(e,s),r.addFeatures(e,i),r.endSchema(e)}}});var se,Gu=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(se||(se={}))});var w,re,Me=p(()=>{ku();oh();ah();ch();ja();uh();Gu();(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList",r[r.BinaryView=23]="BinaryView",r[r.Utf8View=24]="Utf8View",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth",r[r.DurationSecond=-27]="DurationSecond",r[r.DurationMillisecond=-28]="DurationMillisecond",r[r.DurationMicrosecond=-29]="DurationMicrosecond",r[r.DurationNanosecond=-30]="DurationNanosecond",r[r.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(w||(w={}));(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(re||(re={}))});var Dh={};J(Dh,{valueToString:()=>Rr});function Rr(r){if(r===null)return"null";if(r===void 0)return"undefined";switch(typeof r){case"number":return`${r}`;case"bigint":return`${r}`;case"string":return`"${r}"`}return typeof r[Symbol.toPrimitive]=="function"?r[Symbol.toPrimitive]("string"):ArrayBuffer.isView(r)?r instanceof BigInt64Array||r instanceof BigUint64Array?`[${[...r].map(e=>Rr(e))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(e,t)=>typeof t=="bigint"?`${t}`:t)}var tc=p(()=>{});function te(r){if(typeof r=="bigint"&&(r<Number.MIN_SAFE_INTEGER||r>Number.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function Rh(r,e){return te(r/e)+te(r%e)/te(e)}var Qr=p(()=>{});var Ch={};J(Ch,{BN:()=>di,bigNumToBigInt:()=>Dx,bigNumToNumber:()=>Nh,bigNumToString:()=>Mo,isArrowBigNumSymbol:()=>Mx});function kr(r,...e){return e.length===0?Object.setPrototypeOf(ee(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...e),this.constructor.prototype)}function Fo(...r){return kr.apply(this,r)}function Oo(...r){return kr.apply(this,r)}function rc(...r){return kr.apply(this,r)}function Nh(r,e){let{buffer:t,byteOffset:n,byteLength:s,signed:i}=r,o=new BigUint64Array(t,n,s/8),a=i&&o.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),u=0;if(a){for(let l of o)c|=(l^vF)*(BigInt(1)<<BigInt(64*u++));c*=BigInt(-1),c-=BigInt(1)}else for(let l of o)c|=l*(BigInt(1)<<BigInt(64*u++));if(typeof e=="number"&&e>0){let l=BigInt("1".padEnd(e+1,"0")),f=c/l,d=a?-(c%l):c%l,h=te(f),m=`${d}`.padStart(e,"0");return+`${a&&h===0?"-":""}${h}.${m}`}return te(c)}function Mo(r){if(r.byteLength===8)return`${new r.BigIntArray(r.buffer,r.byteOffset,1)[0]}`;if(!r.signed)return kh(r);let e=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2);if(new Int16Array([e.at(-1)])[0]>=0)return kh(r);e=e.slice();let n=1;for(let i=0;i<e.length;i++){let o=e[i],a=~o+n;e[i]=a,n&=o===0?1:0}return`-${kh(e)}`}function Dx(r){return r.byteLength===8?new r.BigIntArray(r.buffer,r.byteOffset,1)[0]:Mo(r)}function kh(r){let e="",t=new Uint32Array(2),n=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2),s=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),i=-1,o=n.length-1;do{for(t[0]=n[i=0];i<o;)n[i++]=t[1]=t[0]/10,t[0]=(t[0]-t[1]*10<<16)+n[i];n[i]=t[1]=t[0]/10,t[0]=t[0]-t[1]*10,e=`${t[0]}${e}`}while(s[0]||s[1]||s[2]||s[3]);return e??"0"}var Mx,AF,vF,di,zu=p(()=>{Ke();Qr();Mx=Symbol.for("isArrowBigNum");kr.prototype[Mx]=!0;kr.prototype.toJSON=function(){return`"${Mo(this)}"`};kr.prototype.valueOf=function(r){return Nh(this,r)};kr.prototype.toString=function(){return Mo(this)};kr.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Nh(this);case"string":return Mo(this);case"default":return Dx(this)}return Mo(this)};Object.setPrototypeOf(Fo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Oo.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(rc.prototype,Object.create(Uint32Array.prototype));Object.assign(Fo.prototype,kr.prototype,{constructor:Fo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Oo.prototype,kr.prototype,{constructor:Oo,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(rc.prototype,kr.prototype,{constructor:rc,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});AF=BigInt(4294967296)*BigInt(4294967296),vF=AF-BigInt(1);di=class r{static new(e,t){switch(t){case!0:return new Fo(e);case!1:return new Oo(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Fo(e)}return e.byteLength===16?new rc(e):new Oo(e)}static signed(e){return new Fo(e)}static unsigned(e){return new Oo(e)}static decimal(e){return new rc(e)}constructor(e,t){return r.new(e,t)}}});function or(r){let e=r;switch(r.typeId){case w.Decimal:return r.bitWidth/32;case w.Interval:return e.unit===ae.MONTH_DAY_NANO?4:1+e.unit;case w.BinaryView:case w.Utf8View:return 16;case w.FixedSizeList:return e.listSize;case w.FixedSizeBinary:return e.byteWidth;default:return 1}}var Rx,kx,Nx,Cx,Ux,Px,Vx,jx,Gx,zx,Wx,$x,qx,Kx,Xx,Hx,Jx,Yx,Qx,Zx,eT,tT,rT,nT,sT,iT,E,Ne,Fe,Zt,er,Pe,tr,rr,nr,vt,Nr,ct,Cr,It,sr,Ct,Z,Ur,ut,St,Pr,lt,Ut,Et,os,as,tt,cs,us,ls,fs,rt,ds,Zr,hs,ps,ft,ms,bs,nc,Lt,sc,ic,oc,ac,je,ir,pe,Bt,_n,gs,Pt,Be,dt,IF,Ge,we=p(()=>{Qr();Me();iT=Symbol.for("apache-arrow/DataType"),E=class r{static isDataType(e){return e?.[iT]===!0}static isNull(e){return e?.typeId===w.Null}static isInt(e){return e?.typeId===w.Int}static isFloat(e){return e?.typeId===w.Float}static isBinary(e){return e?.typeId===w.Binary}static isBinaryView(e){return e?.typeId===w.BinaryView}static isLargeBinary(e){return e?.typeId===w.LargeBinary}static isUtf8(e){return e?.typeId===w.Utf8}static isUtf8View(e){return e?.typeId===w.Utf8View}static isLargeUtf8(e){return e?.typeId===w.LargeUtf8}static isBool(e){return e?.typeId===w.Bool}static isDecimal(e){return e?.typeId===w.Decimal}static isDate(e){return e?.typeId===w.Date}static isTime(e){return e?.typeId===w.Time}static isTimestamp(e){return e?.typeId===w.Timestamp}static isInterval(e){return e?.typeId===w.Interval}static isDuration(e){return e?.typeId===w.Duration}static isList(e){return e?.typeId===w.List}static isLargeList(e){return e?.typeId===w.LargeList}static isStruct(e){return e?.typeId===w.Struct}static isUnion(e){return e?.typeId===w.Union}static isFixedSizeBinary(e){return e?.typeId===w.FixedSizeBinary}static isFixedSizeList(e){return e?.typeId===w.FixedSizeList}static isMap(e){return e?.typeId===w.Map}static isDictionary(e){return e?.typeId===w.Dictionary}static isDenseUnion(e){return r.isUnion(e)&&e.mode===he.Dense}static isSparseUnion(e){return r.isUnion(e)&&e.mode===he.Sparse}constructor(e){this.typeId=e}};Rx=Symbol.toStringTag;E[Rx]=(r=>(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[iT]=!0,r[Symbol.toStringTag]="DataType"))(E.prototype);Ne=class extends E{constructor(){super(w.Null)}toString(){return"Null"}};kx=Symbol.toStringTag;Ne[kx]=(r=>r[Symbol.toStringTag]="Null")(Ne.prototype);Fe=class extends E{constructor(e,t){super(w.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};Nx=Symbol.toStringTag;Fe[Nx]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Fe.prototype);Zt=class extends Fe{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},er=class extends Fe{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Pe=class extends Fe{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},tr=class extends Fe{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},rr=class extends Fe{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},nr=class extends Fe{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},vt=class extends Fe{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Nr=class extends Fe{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Zt.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(er.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Pe.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(tr.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(rr.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(nr.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(vt.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Nr.prototype,"ArrayType",{value:BigUint64Array});ct=class extends E{constructor(e){super(w.Float),this.precision=e}get ArrayType(){switch(this.precision){case le.HALF:return Uint16Array;case le.SINGLE:return Float32Array;case le.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};Cx=Symbol.toStringTag;ct[Cx]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(ct.prototype);Cr=class extends ct{constructor(){super(le.HALF)}},It=class extends ct{constructor(){super(le.SINGLE)}},sr=class extends ct{constructor(){super(le.DOUBLE)}};Object.defineProperty(Cr.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(It.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(sr.prototype,"ArrayType",{value:Float64Array});Ct=class extends E{constructor(){super(w.Binary)}toString(){return"Binary"}};Ux=Symbol.toStringTag;Ct[Ux]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Ct.prototype);Z=class extends E{constructor(){super(w.BinaryView)}toString(){return"BinaryView"}};Px=Symbol.toStringTag;Z.ELEMENT_WIDTH=16;Z.INLINE_CAPACITY=12;Z.LENGTH_OFFSET=0;Z.INLINE_OFFSET=4;Z.BUFFER_INDEX_OFFSET=8;Z.BUFFER_OFFSET_OFFSET=12;Z[Px]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="BinaryView"))(Z.prototype);Ur=class extends E{constructor(){super(w.LargeBinary)}toString(){return"LargeBinary"}};Vx=Symbol.toStringTag;Ur[Vx]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Ur.prototype);ut=class extends E{constructor(){super(w.Utf8)}toString(){return"Utf8"}};jx=Symbol.toStringTag;ut[jx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(ut.prototype);St=class extends E{constructor(){super(w.Utf8View)}toString(){return"Utf8View"}};Gx=Symbol.toStringTag;St.ELEMENT_WIDTH=Z.ELEMENT_WIDTH;St.INLINE_CAPACITY=Z.INLINE_CAPACITY;St[Gx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8View"))(St.prototype);Pr=class extends E{constructor(){super(w.LargeUtf8)}toString(){return"LargeUtf8"}};zx=Symbol.toStringTag;Pr[zx]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(Pr.prototype);lt=class extends E{constructor(){super(w.Bool)}toString(){return"Bool"}};Wx=Symbol.toStringTag;lt[Wx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(lt.prototype);Ut=class extends E{constructor(e,t,n=128){super(w.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};$x=Symbol.toStringTag;Ut[$x]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(Ut.prototype);Et=class extends E{constructor(e){super(w.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${ye[this.unit]}>`}get ArrayType(){return this.unit===ye.DAY?Int32Array:BigInt64Array}};qx=Symbol.toStringTag;Et[qx]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(Et.prototype);os=class extends Et{constructor(){super(ye.DAY)}},as=class extends Et{constructor(){super(ye.MILLISECOND)}},tt=class extends E{constructor(e,t){super(w.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${L[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Kx=Symbol.toStringTag;tt[Kx]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(tt.prototype);cs=class extends tt{constructor(){super(L.SECOND,32)}},us=class extends tt{constructor(){super(L.MILLISECOND,32)}},ls=class extends tt{constructor(){super(L.MICROSECOND,64)}},fs=class extends tt{constructor(){super(L.NANOSECOND,64)}},rt=class extends E{constructor(e,t){super(w.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${L[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};Xx=Symbol.toStringTag;rt[Xx]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(rt.prototype);ds=class extends rt{constructor(e){super(L.SECOND,e)}},Zr=class extends rt{constructor(e){super(L.MILLISECOND,e)}},hs=class extends rt{constructor(e){super(L.MICROSECOND,e)}},ps=class extends rt{constructor(e){super(L.NANOSECOND,e)}},ft=class extends E{constructor(e){super(w.Interval),this.unit=e}toString(){return`Interval<${ae[this.unit]}>`}};Hx=Symbol.toStringTag;ft[Hx]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(ft.prototype);ms=class extends ft{constructor(){super(ae.DAY_TIME)}},bs=class extends ft{constructor(){super(ae.YEAR_MONTH)}},nc=class extends ft{constructor(){super(ae.MONTH_DAY_NANO)}},Lt=class extends E{constructor(e){super(w.Duration),this.unit=e}toString(){return`Duration<${L[this.unit]}>`}};Jx=Symbol.toStringTag;Lt[Jx]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(Lt.prototype);sc=class extends Lt{constructor(){super(L.SECOND)}},ic=class extends Lt{constructor(){super(L.MILLISECOND)}},oc=class extends Lt{constructor(){super(L.MICROSECOND)}},ac=class extends Lt{constructor(){super(L.NANOSECOND)}},je=class extends E{constructor(e){super(w.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};Yx=Symbol.toStringTag;je[Yx]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(je.prototype);ir=class extends E{constructor(e){super(w.LargeList),this.children=[e]}toString(){return`LargeList<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};Qx=Symbol.toStringTag;ir[Qx]=(r=>(r.children=null,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeList"))(ir.prototype);pe=class extends E{constructor(e){super(w.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};Zx=Symbol.toStringTag;pe[Zx]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(pe.prototype);Bt=class extends E{constructor(e,t,n){super(w.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((s,i,o)=>(s[i]=o)&&s||s,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}};eT=Symbol.toStringTag;Bt[eT]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(Bt.prototype);_n=class extends Bt{constructor(e,t){super(he.Dense,e,t)}},gs=class extends Bt{constructor(e,t){super(he.Sparse,e,t)}},Pt=class extends E{constructor(e){super(w.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};tT=Symbol.toStringTag;Pt[tT]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Pt.prototype);Be=class extends E{constructor(e,t){super(w.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};rT=Symbol.toStringTag;Be[rT]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Be.prototype);dt=class extends E{constructor(e,t=!1){var n,s,i;if(super(w.Map),this.children=[e],this.keysSorted=t,e&&(e.name="entries",!((n=e?.type)===null||n===void 0)&&n.children)){let o=(s=e?.type)===null||s===void 0?void 0:s.children[0];o&&(o.name="key");let a=(i=e?.type)===null||i===void 0?void 0:i.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};nT=Symbol.toStringTag;dt[nT]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(dt.prototype);IF=(r=>()=>++r)(-1),Ge=class extends E{constructor(e,t,n,s){super(w.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=s||!1,this.id=n==null?IF():te(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};sT=Symbol.toStringTag;Ge[sT]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Ge.prototype)});function SF(r,e,t=!0){return typeof e=="number"?Do(r,e,t):typeof e=="string"&&e in w?Do(r,w[e],t):e&&e instanceof E?Do(r,aT(e),t):e?.type&&e.type instanceof E?Do(r,aT(e.type),t):Do(r,w.NONE,t)}function Do(r,e,t=!0){let n=null;switch(e){case w.Null:n=r.visitNull;break;case w.Bool:n=r.visitBool;break;case w.Int:n=r.visitInt;break;case w.Int8:n=r.visitInt8||r.visitInt;break;case w.Int16:n=r.visitInt16||r.visitInt;break;case w.Int32:n=r.visitInt32||r.visitInt;break;case w.Int64:n=r.visitInt64||r.visitInt;break;case w.Uint8:n=r.visitUint8||r.visitInt;break;case w.Uint16:n=r.visitUint16||r.visitInt;break;case w.Uint32:n=r.visitUint32||r.visitInt;break;case w.Uint64:n=r.visitUint64||r.visitInt;break;case w.Float:n=r.visitFloat;break;case w.Float16:n=r.visitFloat16||r.visitFloat;break;case w.Float32:n=r.visitFloat32||r.visitFloat;break;case w.Float64:n=r.visitFloat64||r.visitFloat;break;case w.Utf8:n=r.visitUtf8;break;case w.LargeUtf8:n=r.visitLargeUtf8;break;case w.Utf8View:n=r.visitUtf8View||r.visitUtf8;break;case w.Binary:n=r.visitBinary;break;case w.LargeBinary:n=r.visitLargeBinary;break;case w.BinaryView:n=r.visitBinaryView||r.visitBinary;break;case w.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case w.Date:n=r.visitDate;break;case w.DateDay:n=r.visitDateDay||r.visitDate;break;case w.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case w.Timestamp:n=r.visitTimestamp;break;case w.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case w.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case w.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case w.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case w.Time:n=r.visitTime;break;case w.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case w.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case w.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case w.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case w.Decimal:n=r.visitDecimal;break;case w.List:n=r.visitList;break;case w.LargeList:n=r.visitLargeList;break;case w.Struct:n=r.visitStruct;break;case w.Union:n=r.visitUnion;break;case w.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case w.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case w.Dictionary:n=r.visitDictionary;break;case w.Interval:n=r.visitInterval;break;case w.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case w.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case w.IntervalMonthDayNano:n=r.visitIntervalMonthDayNano||r.visitInterval;break;case w.Duration:n=r.visitDuration;break;case w.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case w.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case w.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case w.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case w.FixedSizeList:n=r.visitFixedSizeList;break;case w.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!t)return()=>null;throw new Error(`Unrecognized type '${w[e]}'`)}function aT(r){switch(r.typeId){case w.Null:return w.Null;case w.Int:{let{bitWidth:e,isSigned:t}=r;switch(e){case 8:return t?w.Int8:w.Uint8;case 16:return t?w.Int16:w.Uint16;case 32:return t?w.Int32:w.Uint32;case 64:return t?w.Int64:w.Uint64}return w.Int}case w.Float:switch(r.precision){case le.HALF:return w.Float16;case le.SINGLE:return w.Float32;case le.DOUBLE:return w.Float64}return w.Float;case w.Binary:return w.Binary;case w.LargeBinary:return w.LargeBinary;case w.BinaryView:return w.BinaryView;case w.Utf8:return w.Utf8;case w.LargeUtf8:return w.LargeUtf8;case w.Utf8View:return w.Utf8View;case w.Bool:return w.Bool;case w.Decimal:return w.Decimal;case w.Time:switch(r.unit){case L.SECOND:return w.TimeSecond;case L.MILLISECOND:return w.TimeMillisecond;case L.MICROSECOND:return w.TimeMicrosecond;case L.NANOSECOND:return w.TimeNanosecond}return w.Time;case w.Timestamp:switch(r.unit){case L.SECOND:return w.TimestampSecond;case L.MILLISECOND:return w.TimestampMillisecond;case L.MICROSECOND:return w.TimestampMicrosecond;case L.NANOSECOND:return w.TimestampNanosecond}return w.Timestamp;case w.Date:switch(r.unit){case ye.DAY:return w.DateDay;case ye.MILLISECOND:return w.DateMillisecond}return w.Date;case w.Interval:switch(r.unit){case ae.DAY_TIME:return w.IntervalDayTime;case ae.YEAR_MONTH:return w.IntervalYearMonth;case ae.MONTH_DAY_NANO:return w.IntervalMonthDayNano}return w.Interval;case w.Duration:switch(r.unit){case L.SECOND:return w.DurationSecond;case L.MILLISECOND:return w.DurationMillisecond;case L.MICROSECOND:return w.DurationMicrosecond;case L.NANOSECOND:return w.DurationNanosecond}return w.Duration;case w.Map:return w.Map;case w.List:return w.List;case w.LargeList:return w.LargeList;case w.Struct:return w.Struct;case w.Union:switch(r.mode){case he.Dense:return w.DenseUnion;case he.Sparse:return w.SparseUnion}return w.Union;case w.FixedSizeBinary:return w.FixedSizeBinary;case w.FixedSizeList:return w.FixedSizeList;case w.Dictionary:return w.Dictionary}throw new Error(`Unrecognized type '${w[r.typeId]}'`)}var R,Vt=p(()=>{Me();we();R=class{visitMany(e,...t){return e.map((n,s)=>this.visit(n,...t.map(i=>i[s])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return SF(this,e,t)}getVisitFnByTypeId(e,t=!0){return Do(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitUtf8View(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitBinaryView(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitLargeList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};R.prototype.visitInt8=null;R.prototype.visitInt16=null;R.prototype.visitInt32=null;R.prototype.visitInt64=null;R.prototype.visitUint8=null;R.prototype.visitUint16=null;R.prototype.visitUint32=null;R.prototype.visitUint64=null;R.prototype.visitFloat16=null;R.prototype.visitFloat32=null;R.prototype.visitFloat64=null;R.prototype.visitDateDay=null;R.prototype.visitDateMillisecond=null;R.prototype.visitTimestampSecond=null;R.prototype.visitTimestampMillisecond=null;R.prototype.visitTimestampMicrosecond=null;R.prototype.visitTimestampNanosecond=null;R.prototype.visitTimeSecond=null;R.prototype.visitTimeMillisecond=null;R.prototype.visitTimeMicrosecond=null;R.prototype.visitTimeNanosecond=null;R.prototype.visitDenseUnion=null;R.prototype.visitSparseUnion=null;R.prototype.visitIntervalDayTime=null;R.prototype.visitIntervalYearMonth=null;R.prototype.visitIntervalMonthDayNano=null;R.prototype.visitDuration=null;R.prototype.visitDurationSecond=null;R.prototype.visitDurationMillisecond=null;R.prototype.visitDurationMicrosecond=null;R.prototype.visitDurationNanosecond=null});var Uh={};J(Uh,{float64ToUint16:()=>cc,uint16ToFloat64:()=>Wu});function Wu(r){let e=(r&31744)>>10,t=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(e){case 31:return n*(t?Number.NaN:1/0);case 0:return n*(t?6103515625e-14*t:0)}return n*Math.pow(2,e-15)*(1+t)}function cc(r){if(r!==r)return 32256;cT[0]=r;let e=(Ro[1]&2147483648)>>16&65535,t=Ro[1]&2146435072,n=0;return t>=1089470464?Ro[0]>0?t=31744:(t=(t&2080374784)>>16,n=(Ro[1]&1048575)>>10):t<=1056964608?(n=1048576+(Ro[1]&1048575),n=1048576+(n<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,n=(Ro[1]&1048575)+512>>10),e|t|n&65535}var cT,Ro,uc=p(()=>{cT=new Float64Array(1),Ro=new Uint32Array(cT.buffer)});function q(r){return(e,t,n)=>{if(e.setValid(t,n!=null))return r(e,t,n)}}var j,EF,uT,LF,An,Ph,lT,BF,$u,qu,Vh,fT,FF,dT,OF,hT,MF,jh,Ku,Xu,Hu,Ju,Gh,Yu,Qu,Zu,el,zh,Wh,pT,DF,RF,kF,NF,CF,UF,PF,mT,bT,VF,$h,tl,rl,nl,sl,il,ol,al,qh,jF,nt,ar=p(()=>{ht();Vt();Qr();gn();uc();Me();we();j=class extends R{};EF=(r,e,t)=>{r[e]=Math.floor(t/864e5)},uT=(r,e,t,n)=>{if(t+1<e.length){let s=te(e[t]),i=te(e[t+1]);r.set(n.subarray(0,i-s),s)}},LF=({offset:r,values:e},t,n)=>{let s=r+t;n?e[s>>3]|=1<<s%8:e[s>>3]&=~(1<<s%8)},An=({values:r},e,t)=>{r[e]=t},Ph=({values:r},e,t)=>{r[e]=t},lT=({values:r},e,t)=>{r[e]=cc(t)},BF=(r,e,t)=>{switch(r.type.precision){case le.HALF:return lT(r,e,t);case le.SINGLE:case le.DOUBLE:return Ph(r,e,t)}},$u=({values:r},e,t)=>{EF(r,e,t.valueOf())},qu=({values:r},e,t)=>{r[e]=BigInt(t)},Vh=({stride:r,values:e},t,n)=>{e.set(n.subarray(0,r),r*t)},fT=({values:r,valueOffsets:e},t,n)=>uT(r,e,t,n),FF=r=>{let e=r.variadicBuffers;return(!Array.isArray(e)||Object.isFrozen(e))&&(e=Array.from(e),r.variadicBuffers=e),e},dT=(r,e,t)=>{var n,s,i,o;let a=r.values;if(!a)throw new Error("BinaryView data is missing view buffer");let c=Z.ELEMENT_WIDTH,u=e*c,l=u+c;if(u<0||l>a.length)throw new RangeError(`BinaryView index ${e} out of bounds`);a.fill(0,u,l);let f=new DataView(a.buffer,a.byteOffset+u,c),d=t.length;if(f.setInt32(Z.LENGTH_OFFSET,d,!0),d<=Z.INLINE_CAPACITY){a.set(t,u+Z.INLINE_OFFSET);return}let h=((n=t[0])!==null&&n!==void 0?n:0)|((s=t[1])!==null&&s!==void 0?s:0)<<8|((i=t[2])!==null&&i!==void 0?i:0)<<16|((o=t[3])!==null&&o!==void 0?o:0)<<24;f.setUint32(Z.INLINE_OFFSET,h>>>0,!0);let m=FF(r),b=t.slice(),g=m.push(b)-1;f.setInt32(Z.BUFFER_INDEX_OFFSET,g,!0),f.setInt32(Z.BUFFER_OFFSET_OFFSET,0,!0)},OF=(r,e,t)=>{let n=t instanceof Uint8Array?t:new Uint8Array(t);dT(r,e,n)},hT=({values:r,valueOffsets:e},t,n)=>uT(r,e,t,Jt(n)),MF=(r,e,t)=>{let n=Jt(t);dT(r,e,n)},jh=(r,e,t)=>{r.type.unit===ye.DAY?$u(r,e,t):qu(r,e,t)},Ku=({values:r},e,t)=>{r[e]=BigInt(t/1e3)},Xu=({values:r},e,t)=>{r[e]=BigInt(t)},Hu=({values:r},e,t)=>{r[e]=BigInt(t*1e3)},Ju=({values:r},e,t)=>{r[e]=BigInt(t*1e6)},Gh=(r,e,t)=>{switch(r.type.unit){case L.SECOND:return Ku(r,e,t);case L.MILLISECOND:return Xu(r,e,t);case L.MICROSECOND:return Hu(r,e,t);case L.NANOSECOND:return Ju(r,e,t)}},Yu=({values:r},e,t)=>{r[e]=t},Qu=({values:r},e,t)=>{r[e]=t},Zu=({values:r},e,t)=>{r[e]=t},el=({values:r},e,t)=>{r[e]=t},zh=(r,e,t)=>{switch(r.type.unit){case L.SECOND:return Yu(r,e,t);case L.MILLISECOND:return Qu(r,e,t);case L.MICROSECOND:return Zu(r,e,t);case L.NANOSECOND:return el(r,e,t)}},Wh=({values:r,stride:e},t,n)=>{r.set(n.subarray(0,e),e*t)},pT=(r,e,t)=>{let n=r.children[0],s=r.valueOffsets,i=nt.getVisitFn(n),o=te(s[e]),a=te(s[e+1]);if(Array.isArray(t))for(let c=-1,u=o;u<a;)i(n,u++,t[++c]);else for(let c=-1,u=o;u<a;)i(n,u++,t.get(++c))},DF=(r,e,t)=>{let n=r.children[0],{valueOffsets:s}=r,i=nt.getVisitFn(n),{[e]:o,[e+1]:a}=s,c=t instanceof Map?t.entries():Object.entries(t);for(let u of c)if(i(n,o,u),++o>=a)break},RF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e[i]),kF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e.get(i)),NF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e.get(s.name)),CF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e[s.name]),UF=(r,e,t)=>{let n=r.type.children.map(i=>nt.getVisitFn(i.type)),s=t instanceof Map?NF(e,t):t instanceof B?kF(e,t):Array.isArray(t)?RF(e,t):CF(e,t);r.type.children.forEach((i,o)=>s(n[o],r.children[o],i,o))},PF=(r,e,t)=>{r.type.mode===he.Dense?mT(r,e,t):bT(r,e,t)},mT=(r,e,t)=>{let n=r.type.typeIdToChildIndex[r.typeIds[e]],s=r.children[n];nt.visit(s,r.valueOffsets[e],t)},bT=(r,e,t)=>{let n=r.type.typeIdToChildIndex[r.typeIds[e]],s=r.children[n];nt.visit(s,e,t)},VF=(r,e,t)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[e],t)},$h=(r,e,t)=>{switch(r.type.unit){case ae.YEAR_MONTH:return rl(r,e,t);case ae.DAY_TIME:return tl(r,e,t);case ae.MONTH_DAY_NANO:return nl(r,e,t)}},tl=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},rl=({values:r},e,t)=>{r[e]=t[0]*12+t[1]%12},nl=({values:r,stride:e},t,n)=>{r.set(n.subarray(0,e),e*t)},sl=({values:r},e,t)=>{r[e]=t},il=({values:r},e,t)=>{r[e]=t},ol=({values:r},e,t)=>{r[e]=t},al=({values:r},e,t)=>{r[e]=t},qh=(r,e,t)=>{switch(r.type.unit){case L.SECOND:return sl(r,e,t);case L.MILLISECOND:return il(r,e,t);case L.MICROSECOND:return ol(r,e,t);case L.NANOSECOND:return al(r,e,t)}},jF=(r,e,t)=>{let{stride:n}=r,s=r.children[0],i=nt.getVisitFn(s);if(Array.isArray(t))for(let o=-1,a=e*n;++o<n;)i(s,a+o,t[o]);else for(let o=-1,a=e*n;++o<n;)i(s,a+o,t.get(o))};j.prototype.visitBool=q(LF);j.prototype.visitInt=q(An);j.prototype.visitInt8=q(An);j.prototype.visitInt16=q(An);j.prototype.visitInt32=q(An);j.prototype.visitInt64=q(An);j.prototype.visitUint8=q(An);j.prototype.visitUint16=q(An);j.prototype.visitUint32=q(An);j.prototype.visitUint64=q(An);j.prototype.visitFloat=q(BF);j.prototype.visitFloat16=q(lT);j.prototype.visitFloat32=q(Ph);j.prototype.visitFloat64=q(Ph);j.prototype.visitUtf8=q(hT);j.prototype.visitLargeUtf8=q(hT);j.prototype.visitUtf8View=q(MF);j.prototype.visitBinary=q(fT);j.prototype.visitLargeBinary=q(fT);j.prototype.visitBinaryView=q(OF);j.prototype.visitFixedSizeBinary=q(Vh);j.prototype.visitDate=q(jh);j.prototype.visitDateDay=q($u);j.prototype.visitDateMillisecond=q(qu);j.prototype.visitTimestamp=q(Gh);j.prototype.visitTimestampSecond=q(Ku);j.prototype.visitTimestampMillisecond=q(Xu);j.prototype.visitTimestampMicrosecond=q(Hu);j.prototype.visitTimestampNanosecond=q(Ju);j.prototype.visitTime=q(zh);j.prototype.visitTimeSecond=q(Yu);j.prototype.visitTimeMillisecond=q(Qu);j.prototype.visitTimeMicrosecond=q(Zu);j.prototype.visitTimeNanosecond=q(el);j.prototype.visitDecimal=q(Wh);j.prototype.visitList=q(pT);j.prototype.visitLargeList=q(pT);j.prototype.visitStruct=q(UF);j.prototype.visitUnion=q(PF);j.prototype.visitDenseUnion=q(mT);j.prototype.visitSparseUnion=q(bT);j.prototype.visitDictionary=q(VF);j.prototype.visitInterval=q($h);j.prototype.visitIntervalDayTime=q(tl);j.prototype.visitIntervalYearMonth=q(rl);j.prototype.visitIntervalMonthDayNano=q(nl);j.prototype.visitDuration=q(qh);j.prototype.visitDurationSecond=q(sl);j.prototype.visitDurationMillisecond=q(il);j.prototype.visitDurationMicrosecond=q(ol);j.prototype.visitDurationNanosecond=q(al);j.prototype.visitFixedSizeList=q(jF);j.prototype.visitMap=q(DF);nt=new j});var Vr,ko,en,Kh,Xh,GF,cl=p(()=>{tc();hi();ar();Vr=Symbol.for("parent"),ko=Symbol.for("rowIndex"),en=class{constructor(e,t){return this[Vr]=e,this[ko]=t,new Proxy(this,GF)}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[ko],t=this[Vr],n=t.type.children,s={};for(let i=-1,o=n.length;++i<o;)s[n[i].name]=ze.visit(t.children[i],e);return s}toString(){return`{${[...this].map(([e,t])=>`${Rr(e)}: ${Rr(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Kh(this[Vr],this[ko])}},Kh=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return e<this.numChildren?(this.childIndex=e+1,{done:!1,value:[this.childFields[e].name,ze.visit(this.children[e],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(en.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Vr]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ko]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});Xh=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Vr].type.children.map(t=>t.name)}has(e,t){return e[Vr].type.children.some(n=>n.name===t)}getOwnPropertyDescriptor(e,t){if(e[Vr].type.children.some(n=>n.name===t))return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Vr].type.children.findIndex(s=>s.name===t);if(n!==-1){let s=ze.visit(e[Vr].children[n],e[ko]);return Reflect.set(e,t,s),s}}set(e,t,n){let s=e[Vr].type.children.findIndex(i=>i.name===t);return s!==-1?(nt.visit(e[Vr].children[s],e[ko],n),Reflect.set(e,t,n)):Reflect.has(e,t)||typeof t=="symbol"?Reflect.set(e,t,n):!1}},GF=new Xh});function W(r){return(e,t)=>e.getValid(t)?r(e,t):null}var C,zF,No,WF,$F,gT,qF,yT,wT,ys,KF,xT,XF,TT,_T,HF,AT,JF,YF,QF,ZF,vT,IT,ST,ET,eO,LT,BT,FT,OT,tO,rO,MT,nO,sO,iO,DT,RT,oO,aO,kT,NT,CT,UT,PT,VT,jT,cO,uO,ze,hi=p(()=>{zu();ht();Vt();lc();cl();Qr();gn();uc();Me();C=class extends R{};zF=(r,e)=>864e5*r[e],No=16,WF=12,$F=(r,e)=>null,gT=(r,e,t)=>{if(t+1>=e.length)return null;let n=te(e[t]),s=te(e[t+1]);return r.subarray(n,s)},qF=({offset:r,values:e},t)=>{let n=r+t;return(e[n>>3]&1<<n%8)!==0},yT=({values:r},e)=>zF(r,e),wT=({values:r},e)=>te(r[e]),ys=({stride:r,values:e},t)=>e[r*t],KF=({stride:r,values:e},t)=>Wu(e[r*t]),xT=({values:r},e)=>r[e],XF=({stride:r,values:e},t)=>e.subarray(r*t,r*(t+1)),TT=({values:r,valueOffsets:e},t)=>gT(r,e,t),_T=(r,e)=>{var t;let n=r.values;if(!n)throw new Error("BinaryView data is missing view buffer");let s=e*No,i=s+No;if(s<0||i>n.length)throw new Error(`BinaryView data buffer is too short: expected ${No} bytes, got ${Math.max(0,n.length-s)}`);let o=n.subarray(s,i);if(o.length<No)throw new Error(`BinaryView data buffer is too short: expected ${No} bytes, got ${o.length}`);let a=new DataView(n.buffer,o.byteOffset,No),c=a.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=WF)return o.subarray(4,4+c);let u=a.getInt32(8,!0),l=a.getInt32(12,!0),f=(t=r.variadicBuffers)===null||t===void 0?void 0:t[u];if(!f)throw new Error(`BinaryView variadic buffer ${u} is missing`);return f.subarray(l,l+c)},HF=(r,e)=>_T(r,e),AT=({values:r,valueOffsets:e},t)=>{let n=gT(r,e,t);return n!==null?vo(n):null},JF=(r,e)=>{let t=_T(r,e);return vo(t)},YF=({values:r},e)=>r[e],QF=({type:r,values:e},t)=>r.precision!==le.HALF?e[t]:Wu(e[t]),ZF=(r,e)=>r.type.unit===ye.DAY?yT(r,e):wT(r,e),vT=({values:r},e)=>1e3*te(r[e]),IT=({values:r},e)=>te(r[e]),ST=({values:r},e)=>Rh(r[e],BigInt(1e3)),ET=({values:r},e)=>Rh(r[e],BigInt(1e6)),eO=(r,e)=>{switch(r.type.unit){case L.SECOND:return vT(r,e);case L.MILLISECOND:return IT(r,e);case L.MICROSECOND:return ST(r,e);case L.NANOSECOND:return ET(r,e)}},LT=({values:r},e)=>r[e],BT=({values:r},e)=>r[e],FT=({values:r},e)=>r[e],OT=({values:r},e)=>r[e],tO=(r,e)=>{switch(r.type.unit){case L.SECOND:return LT(r,e);case L.MILLISECOND:return BT(r,e);case L.MICROSECOND:return FT(r,e);case L.NANOSECOND:return OT(r,e)}},rO=({values:r,stride:e},t)=>di.decimal(r.subarray(e*t,e*(t+1))),MT=(r,e)=>{let{valueOffsets:t,stride:n,children:s}=r,i=te(t[e*n]),o=te(t[e*n+1]),c=s[0].slice(i,o-i);return new B([c])},nO=(r,e)=>{let{valueOffsets:t,children:n}=r,{[e]:s,[e+1]:i}=t,o=n[0];return new yr(o.slice(s,i-s))},sO=(r,e)=>new en(r,e),iO=(r,e)=>r.type.mode===he.Dense?DT(r,e):RT(r,e),DT=(r,e)=>{let t=r.type.typeIdToChildIndex[r.typeIds[e]],n=r.children[t];return ze.visit(n,r.valueOffsets[e])},RT=(r,e)=>{let t=r.type.typeIdToChildIndex[r.typeIds[e]],n=r.children[t];return ze.visit(n,e)},oO=(r,e)=>{var t;return(t=r.dictionary)===null||t===void 0?void 0:t.get(r.values[e])},aO=(r,e)=>r.type.unit===ae.MONTH_DAY_NANO?CT(r,e):r.type.unit===ae.DAY_TIME?kT(r,e):NT(r,e),kT=({values:r},e)=>r.subarray(2*e,2*(e+1)),NT=({values:r},e)=>{let t=r[e],n=new Int32Array(2);return n[0]=Math.trunc(t/12),n[1]=Math.trunc(t%12),n},CT=({values:r},e)=>r.subarray(4*e,4*(e+1)),UT=({values:r},e)=>r[e],PT=({values:r},e)=>r[e],VT=({values:r},e)=>r[e],jT=({values:r},e)=>r[e],cO=(r,e)=>{switch(r.type.unit){case L.SECOND:return UT(r,e);case L.MILLISECOND:return PT(r,e);case L.MICROSECOND:return VT(r,e);case L.NANOSECOND:return jT(r,e)}},uO=(r,e)=>{let{stride:t,children:n}=r,i=n[0].slice(e*t,t);return new B([i])};C.prototype.visitNull=W($F);C.prototype.visitBool=W(qF);C.prototype.visitInt=W(YF);C.prototype.visitInt8=W(ys);C.prototype.visitInt16=W(ys);C.prototype.visitInt32=W(ys);C.prototype.visitInt64=W(xT);C.prototype.visitUint8=W(ys);C.prototype.visitUint16=W(ys);C.prototype.visitUint32=W(ys);C.prototype.visitUint64=W(xT);C.prototype.visitFloat=W(QF);C.prototype.visitFloat16=W(KF);C.prototype.visitFloat32=W(ys);C.prototype.visitFloat64=W(ys);C.prototype.visitUtf8=W(AT);C.prototype.visitLargeUtf8=W(AT);C.prototype.visitUtf8View=W(JF);C.prototype.visitBinary=W(TT);C.prototype.visitLargeBinary=W(TT);C.prototype.visitBinaryView=W(HF);C.prototype.visitFixedSizeBinary=W(XF);C.prototype.visitDate=W(ZF);C.prototype.visitDateDay=W(yT);C.prototype.visitDateMillisecond=W(wT);C.prototype.visitTimestamp=W(eO);C.prototype.visitTimestampSecond=W(vT);C.prototype.visitTimestampMillisecond=W(IT);C.prototype.visitTimestampMicrosecond=W(ST);C.prototype.visitTimestampNanosecond=W(ET);C.prototype.visitTime=W(tO);C.prototype.visitTimeSecond=W(LT);C.prototype.visitTimeMillisecond=W(BT);C.prototype.visitTimeMicrosecond=W(FT);C.prototype.visitTimeNanosecond=W(OT);C.prototype.visitDecimal=W(rO);C.prototype.visitList=W(MT);C.prototype.visitLargeList=W(MT);C.prototype.visitStruct=W(sO);C.prototype.visitUnion=W(iO);C.prototype.visitDenseUnion=W(DT);C.prototype.visitSparseUnion=W(RT);C.prototype.visitDictionary=W(oO);C.prototype.visitInterval=W(aO);C.prototype.visitIntervalDayTime=W(kT);C.prototype.visitIntervalYearMonth=W(NT);C.prototype.visitIntervalMonthDayNano=W(CT);C.prototype.visitDuration=W(cO);C.prototype.visitDurationSecond=W(UT);C.prototype.visitDurationMillisecond=W(PT);C.prototype.visitDurationMicrosecond=W(VT);C.prototype.visitDurationNanosecond=W(jT);C.prototype.visitFixedSizeList=W(uO);C.prototype.visitMap=W(nO);ze=new C});var ws,Uo,Co,Hh,yr,Jh,Yh,lc=p(()=>{ht();tc();hi();ar();ws=Symbol.for("keys"),Uo=Symbol.for("vals"),Co=Symbol.for("kKeysAsStrings"),Hh=Symbol.for("_kKeysAsStrings"),yr=class{constructor(e){return this[ws]=new B([e.children[0]]).memoize(),this[Uo]=e.children[1],new Proxy(this,new Yh)}get[Co](){return this[Hh]||(this[Hh]=Array.from(this[ws].toArray(),String))}[Symbol.iterator](){return new Jh(this[ws],this[Uo])}get size(){return this[ws].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[ws],t=this[Uo],n={};for(let s=-1,i=e.length;++s<i;)n[e.get(s)]=ze.visit(t,s);return n}toString(){return`{${[...this].map(([e,t])=>`${Rr(e)}: ${Rr(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Jh=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),ze.visit(this.vals,e)]})}},Yh=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Co]}has(e,t){return e[Co].includes(t)}getOwnPropertyDescriptor(e,t){if(e[Co].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Co].indexOf(t);if(n!==-1){let s=ze.visit(Reflect.get(e,Uo),n);return Reflect.set(e,t,s),s}}set(e,t,n){let s=e[Co].indexOf(t);return s!==-1?(nt.visit(Reflect.get(e,Uo),s,n),Reflect.set(e,t,n)):Reflect.has(e,t)?Reflect.set(e,t,n):!1}};Object.defineProperties(yr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ws]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Uo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Hh]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var Qh={};J(Qh,{clampRange:()=>fc,createElementComparator:()=>xs,wrapIndex:()=>pi});function fc(r,e,t,n){let{length:s=0}=r,i=typeof e!="number"?0:e,o=typeof t!="number"?s:t;return i<0&&(i=(i%s+s)%s),o<0&&(o=(o%s+s)%s),o<i&&(GT=i,i=o,o=GT),o>s&&(o=s),n?n(r,i,o):[i,o]}function xs(r){if(typeof r!=="object"||r===null)return zT(r)?zT:t=>t===r;if(r instanceof Date){let t=r.valueOf();return n=>n instanceof Date?n.valueOf()===t:!1}return ArrayBuffer.isView(r)?t=>t?rh(r,t):!1:r instanceof Map?fO(r):Array.isArray(r)?lO(r):r instanceof B?dO(r):hO(r,!0)}function lO(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=xs(r[t]);return ul(e)}function fO(r){let e=-1,t=[];for(let n of r.values())t[++e]=xs(n);return ul(t)}function dO(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=xs(r.get(t));return ul(e)}function hO(r,e=!1){let t=Object.keys(r);if(!e&&t.length===0)return()=>!1;let n=[];for(let s=-1,i=t.length;++s<i;)n[s]=xs(r[t[s]]);return ul(n,t)}function ul(r,e){return t=>{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return pO(r,t);case Map:return WT(r,t,t.keys());case yr:case en:case Object:case void 0:return WT(r,t,e||Object.keys(t))}return t instanceof B?mO(r,t):!1}}function pO(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e[n]))return!1;return!0}function mO(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e.get(n)))return!1;return!0}function WT(r,e,t){let n=t[Symbol.iterator](),s=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),i=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),o=0,a=r.length,c=i.next(),u=n.next(),l=s.next();for(;o<a&&!u.done&&!l.done&&!c.done&&!(u.value!==l.value||!r[o](c.value));++o,u=n.next(),l=s.next(),c=i.next());return o===a&&u.done&&l.done&&c.done?!0:(n.return&&n.return(),s.return&&s.return(),i.return&&i.return(),!1)}var GT,pi,zT,Po=p(()=>{ht();lc();cl();Ke();pi=(r,e)=>r<0?e+r:r,zT=r=>r!==r});var Zh={};J(Zh,{BitIterator:()=>tn,getBit:()=>fl,getBool:()=>Vo,packBools:()=>bi,popcnt_array:()=>$T,popcnt_bit_range:()=>dc,popcnt_uint32:()=>ll,setBool:()=>bO,truncateBitmap:()=>mi});function Vo(r,e,t,n){return(t&1<<n)!==0}function fl(r,e,t,n){return(t&1<<n)>>n}function bO(r,e,t){return t?!!(r[e>>3]|=1<<e%8)||!0:!(r[e>>3]&=~(1<<e%8))&&!1}function mi(r,e,t){let n=t.byteLength+7&-8;if(r>0||t.byteLength<n){let s=new Uint8Array(n);return s.set(r%8===0?t.subarray(r>>3):bi(new tn(t,r,e,null,Vo)).subarray(0,n)),s}return t}function bi(r){let e=[],t=0,n=0,s=0;for(let o of r)o&&(s|=1<<n),++n===8&&(e[t++]=s,s=n=0);(t===0||n>0)&&(e[t++]=s);let i=new Uint8Array(e.length+7&-8);return i.set(e),i}function dc(r,e,t){if(t-e<=0)return 0;if(t-e<8){let i=0;for(let o of new tn(r,e,t-e,r,fl))i+=o;return i}let n=t>>3<<3,s=e+(e%8===0?0:8-e%8);return dc(r,e,s)+dc(r,n,t)+$T(r,s>>3,n-s>>3)}function $T(r,e,t){let n=0,s=Math.trunc(e),i=new DataView(r.buffer,r.byteOffset,r.byteLength),o=t===void 0?r.byteLength:s+t;for(;o-s>=4;)n+=ll(i.getUint32(s)),s+=4;for(;o-s>=2;)n+=ll(i.getUint16(s)),s+=2;for(;o-s>=1;)n+=ll(i.getUint8(s)),s+=1;return n}function ll(r){let e=Math.trunc(r);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}var tn,gi=p(()=>{tn=class{constructor(e,t,n,s,i){this.bytes=e,this.length=n,this.context=s,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}});function D(r){return yO.visit(r)}var gO,qT,G,ep,yO,wr=p(()=>{ht();Me();we();gi();we();Vt();Ke();gO=-1,qT=Symbol.for("apache-arrow/Data"),G=class r{static isData(e){return e?.[qT]===!0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return E.isSparseUnion(e)?this.children.some(t=>t.nullable):E.isDenseUnion(e)?this.children.some(t=>t.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:s,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),s&&(e+=s.byteLength),i&&(e+=i.byteLength),e+=this.variadicBuffers.reduce((o,a)=>{var c;return o+((c=a?.byteLength)!==null&&c!==void 0?c:0)},0),this.children.reduce((o,a)=>o+a.byteLength,e)}get nullCount(){if(E.isUnion(this.type))return this.children.reduce((n,s)=>n+s.nullCount,0);let e=this._nullCount,t;return e<=gO&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-dc(t,this.offset,this.offset+this.length)),e}constructor(e,t,n,s,i,o=[],a,c=[]){var u;this.type=e,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(t||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(s||0,-1));let l;i instanceof r?(this.stride=i.stride,this.values=i.values,this.typeIds=i.typeIds,this.nullBitmap=i.nullBitmap,this.valueOffsets=i.valueOffsets,this.variadicBuffers=i.variadicBuffers):(this.stride=or(e),i&&((l=i[0])&&(this.valueOffsets=l),(l=i[1])&&(this.values=l),(l=i[2])&&(this.nullBitmap=l),(l=i[3])&&(this.typeIds=l)),this.variadicBuffers=c),(u=this.variadicBuffers)!==null&&u!==void 0||(this.variadicBuffers=[])}getValid(e){let{type:t}=this;if(E.isUnion(t)){let n=t,s=this.typeIds[e],i=n.typeIdToChildIndex[s],o=this.children[i],a=this.valueOffsets,c=n.mode===he.Dense&&a?Number(a[e]):e;return o.getValid(c)}if(this.nullable&&this.nullCount>0){let n=this.offset+e;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(e,t){let n,{type:s}=this;if(E.isUnion(s)){let i=s,o=this.typeIds[e],a=i.typeIdToChildIndex[o],c=this.children[a],u=this.valueOffsets,l=i.mode===he.Dense&&u?Number(u[e]):e;n=c.getValid(l),c.setValid(l,t)}else{let{nullBitmap:i}=this,{offset:o,length:a}=this,c=o+e,u=1<<c%8,l=c>>3;(!i||i.byteLength<=l)&&(i=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(i.set(mi(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:i})):Object.assign(this,{nullBitmap:i,_nullCount:0}));let f=i[l];n=(f&u)!==0,i[l]=t?f|u:f&~u}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(e=this.type,t=this.offset,n=this.length,s=this._nullCount,i=this,o=this.children,a=this.variadicBuffers){return new r(e,t,n,s,i,o,this.dictionary,a)}slice(e,t){let{stride:n,typeId:s,children:i}=this,o=+(this._nullCount===0)-1,a=s===16?n:1,c=this._sliceBuffers(e,t,n,s);return this.clone(this.type,this.offset+e,t,o,c,i.length===0||this.valueOffsets?i:this._sliceChildren(i,a*e,a*t),this.variadicBuffers)}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===w.Null)return this.clone(this.type,0,e,0,this.buffers,this.children,this.variadicBuffers);let{length:t,nullCount:n}=this,s=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);s[t>>3]=(1<<t-(t&-8))-1,n>0&&s.set(mi(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[re.VALIDITY]=s,this.clone(this.type,0,e,n+(e-t),i,this.children,this.variadicBuffers)}_sliceBuffers(e,t,n,s){let i,{buffers:o}=this;if((i=o[re.TYPE])&&(o[re.TYPE]=i.subarray(e,e+t)),E.isBinaryView(this.type)||E.isUtf8View(this.type)){let a=Z.ELEMENT_WIDTH;(i=o[re.DATA])&&(o[re.DATA]=i.subarray(e*a,(e+t)*a))}else(i=o[re.OFFSET])&&(o[re.OFFSET]=i.subarray(e,e+t+1))||(i=o[re.DATA])&&(o[re.DATA]=s===6?i:i.subarray(n*e,n*(e+t)));return o}_sliceChildren(e,t,n){return e.map(s=>s.slice(t,n))}};G.prototype.children=Object.freeze([]);G.prototype[qT]=!0;Object.defineProperty(G,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===G&&G.isData(e)}});ep=class r extends R{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{["type"]:t,["offset"]:n=0,["length"]:s=0}=e;return new G(t,n,s,s)}visitBool(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length>>3,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitInt(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitFloat(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitUtf8(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitUtf8View(e){var t;let{["type"]:n,["offset"]:s=0}=e,i=ee(n.ArrayType,e.views),o=k(e.nullBitmap),a=(e.variadicBuffers||[]).map(l=>k(l)),c=(t=e.length)!==null&&t!==void 0?t:Math.trunc(i.length/St.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new G(n,s,c,u,[void 0,i,o],[],void 0,a)}visitLargeUtf8(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=Pa(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitBinaryView(e){var t;let{["type"]:n,["offset"]:s=0}=e,i=ee(n.ArrayType,e.views),o=k(e.nullBitmap),a=(e.variadicBuffers||[]).map(l=>k(l)),c=(t=e.length)!==null&&t!==void 0?t:Math.trunc(i.length/Z.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new G(n,s,c,u,[void 0,i,o],[],void 0,a)}visitLargeBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=Pa(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitFixedSizeBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitDate(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitTimestamp(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitTime(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitDecimal(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitList(e){let{["type"]:t,["offset"]:n=0,["child"]:s}=e,i=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,void 0,i],[s])}visitLargeList(e){let{["type"]:t,["offset"]:n=0,["child"]:s}=e,i=k(e.nullBitmap),o=Pa(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,void 0,i],[s])}visitStruct(e){let{["type"]:t,["offset"]:n=0,["children"]:s=[]}=e,i=k(e.nullBitmap),{length:o=s.reduce((c,{length:u})=>Math.max(c,u),0),nullCount:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,void 0,i],s)}visitUnion(e){let{["type"]:t,["offset"]:n=0,["children"]:s=[]}=e,i=ee(t.ArrayType,e.typeIds),{["length"]:o=i.length,["nullCount"]:a=-1}=e;if(E.isSparseUnion(t))return new G(t,n,o,a,[void 0,void 0,void 0,i],s);let c=ui(e.valueOffsets);return new G(t,n,o,a,[c,void 0,void 0,i],s)}visitDictionary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.indices.ArrayType,e.data),{["dictionary"]:o=new B([new r().visit({type:t.dictionary})])}=e,{["length"]:a=i.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[void 0,i,s],[],o)}visitInterval(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitDuration(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitFixedSizeList(e){let{["type"]:t,["offset"]:n=0,["child"]:s=new r().visit({type:t.valueType})}=e,i=k(e.nullBitmap),{["length"]:o=s.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,void 0,i],[s])}visitMap(e){let{["type"]:t,["offset"]:n=0,["child"]:s=new r().visit({type:t.childType})}=e,i=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,void 0,i],[s])}},yO=new ep});function KT(r){return r.some(e=>e.nullable)}function dl(r){return r.reduce((e,t)=>e+t.nullCount,0)}function hl(r){return r.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(r.length+1))}function pl(r,e,t,n){let s=[];for(let i=-1,o=r.length;++i<o;){let a=r[i],c=e[i],{length:u}=a;if(c>=n)break;if(t>=c+u)continue;if(c>=t&&c+u<=n){s.push(a);continue}let l=Math.max(0,t-c),f=Math.min(n-c,u);s.push(a.slice(l,f-l))}return s.length===0&&s.push(r[0].slice(0,0)),s}function tp(r,e,t,n){let s=0,i=0,o=e.length-1;do{if(s>=o-1)return t<e[o]?n(r,s,t-e[s]):null;i=s+Math.trunc((o-s)*.5),t<e[i]?o=i:s=i}while(s<o)}function pc(r,e){return r.getValid(e)}function jo(r){function e(t,n,s){return r(t[n],s)}return function(t){let n=this.data;return tp(n,this._offsets,t,e)}}function ml(r){let e;function t(n,s,i){return r(n[s],i,e)}return function(n,s){let i=this.data;e=s;let o=tp(i,this._offsets,n,t);return e=void 0,o}}function bl(r){let e;function t(n,s,i){let o=i,a=0,c=0;for(let u=s-1,l=n.length;++u<l;){let f=n[u];if(~(a=r(f,e,o)))return c+a;o=0,c+=f.length}return-1}return function(n,s){e=n;let i=this.data,o=typeof s!="number"?t(i,0,0):tp(i,this._offsets,s,t);return e=void 0,o}}var hc,gl=p(()=>{hc=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}});function wO(r,e){return e===null&&r.length>0?0:-1}function xO(r,e){let{nullBitmap:t}=r;if(!t||r.nullCount<=0)return-1;let n=0;for(let s of new tn(t,r.offset+(e||0),r.length,t,Vo)){if(!s)return n;++n}return-1}function X(r,e,t){if(e===void 0)return-1;if(e===null)switch(r.typeId){case w.Union:break;case w.Dictionary:break;default:return xO(r,t)}let n=ze.getVisitFn(r),s=xs(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(s(n(r,i)))return i;return-1}function XT(r,e,t){let n=ze.getVisitFn(r),s=xs(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(s(n(r,i)))return i;return-1}var U,yi,yl=p(()=>{Me();Vt();hi();gi();Po();U=class extends R{};U.prototype.visitNull=wO;U.prototype.visitBool=X;U.prototype.visitInt=X;U.prototype.visitInt8=X;U.prototype.visitInt16=X;U.prototype.visitInt32=X;U.prototype.visitInt64=X;U.prototype.visitUint8=X;U.prototype.visitUint16=X;U.prototype.visitUint32=X;U.prototype.visitUint64=X;U.prototype.visitFloat=X;U.prototype.visitFloat16=X;U.prototype.visitFloat32=X;U.prototype.visitFloat64=X;U.prototype.visitUtf8=X;U.prototype.visitLargeUtf8=X;U.prototype.visitUtf8View=X;U.prototype.visitBinary=X;U.prototype.visitLargeBinary=X;U.prototype.visitBinaryView=X;U.prototype.visitFixedSizeBinary=X;U.prototype.visitDate=X;U.prototype.visitDateDay=X;U.prototype.visitDateMillisecond=X;U.prototype.visitTimestamp=X;U.prototype.visitTimestampSecond=X;U.prototype.visitTimestampMillisecond=X;U.prototype.visitTimestampMicrosecond=X;U.prototype.visitTimestampNanosecond=X;U.prototype.visitTime=X;U.prototype.visitTimeSecond=X;U.prototype.visitTimeMillisecond=X;U.prototype.visitTimeMicrosecond=X;U.prototype.visitTimeNanosecond=X;U.prototype.visitDecimal=X;U.prototype.visitList=X;U.prototype.visitLargeList=X;U.prototype.visitStruct=X;U.prototype.visitUnion=X;U.prototype.visitDenseUnion=XT;U.prototype.visitSparseUnion=XT;U.prototype.visitDictionary=X;U.prototype.visitInterval=X;U.prototype.visitIntervalDayTime=X;U.prototype.visitIntervalYearMonth=X;U.prototype.visitIntervalMonthDayNano=X;U.prototype.visitDuration=X;U.prototype.visitDurationSecond=X;U.prototype.visitDurationMillisecond=X;U.prototype.visitDurationMicrosecond=X;U.prototype.visitDurationNanosecond=X;U.prototype.visitFixedSizeList=X;U.prototype.visitMap=X;yi=new U});function $(r){let{type:e}=r;if(r.nullCount===0&&r.stride===1&&(E.isInt(e)&&e.bitWidth!==64||E.isTime(e)&&e.bitWidth!==64||E.isFloat(e)&&e.precision!==le.HALF))return new hc(r.data.length,n=>{let s=r.data[n];return s.values.subarray(0,s.length)[Symbol.iterator]()});let t=0;return new hc(r.data.length,n=>{let i=r.data[n].length,o=r.slice(t,t+i);return t+=i,new rp(o)})}var P,rp,Go,wl=p(()=>{Vt();Me();we();gl();P=class extends R{};rp=class{constructor(e){this.vector=e,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};P.prototype.visitNull=$;P.prototype.visitBool=$;P.prototype.visitInt=$;P.prototype.visitInt8=$;P.prototype.visitInt16=$;P.prototype.visitInt32=$;P.prototype.visitInt64=$;P.prototype.visitUint8=$;P.prototype.visitUint16=$;P.prototype.visitUint32=$;P.prototype.visitUint64=$;P.prototype.visitFloat=$;P.prototype.visitFloat16=$;P.prototype.visitFloat32=$;P.prototype.visitFloat64=$;P.prototype.visitUtf8=$;P.prototype.visitLargeUtf8=$;P.prototype.visitUtf8View=$;P.prototype.visitBinary=$;P.prototype.visitLargeBinary=$;P.prototype.visitBinaryView=$;P.prototype.visitFixedSizeBinary=$;P.prototype.visitDate=$;P.prototype.visitDateDay=$;P.prototype.visitDateMillisecond=$;P.prototype.visitTimestamp=$;P.prototype.visitTimestampSecond=$;P.prototype.visitTimestampMillisecond=$;P.prototype.visitTimestampMicrosecond=$;P.prototype.visitTimestampNanosecond=$;P.prototype.visitTime=$;P.prototype.visitTimeSecond=$;P.prototype.visitTimeMillisecond=$;P.prototype.visitTimeMicrosecond=$;P.prototype.visitTimeNanosecond=$;P.prototype.visitDecimal=$;P.prototype.visitList=$;P.prototype.visitLargeList=$;P.prototype.visitStruct=$;P.prototype.visitUnion=$;P.prototype.visitDenseUnion=$;P.prototype.visitSparseUnion=$;P.prototype.visitDictionary=$;P.prototype.visitInterval=$;P.prototype.visitIntervalDayTime=$;P.prototype.visitIntervalYearMonth=$;P.prototype.visitIntervalMonthDayNano=$;P.prototype.visitDuration=$;P.prototype.visitDurationSecond=$;P.prototype.visitDurationMillisecond=$;P.prototype.visitDurationMicrosecond=$;P.prototype.visitDurationNanosecond=$;P.prototype.visitFixedSizeList=$;P.prototype.visitMap=$;Go=new P});function rn(r){if(r){if(r instanceof G)return new B([r]);if(r instanceof B)return new B(r.data);if(r.type instanceof E)return new B([D(r)]);if(Array.isArray(r))return new B(r.flatMap(e=>TO(e)));if(ArrayBuffer.isView(r)){r instanceof DataView&&(r=new Uint8Array(r.buffer));let e={offset:0,length:r.length,nullCount:-1,data:r};if(r instanceof Int8Array)return new B([D(Object.assign(Object.assign({},e),{type:new Zt}))]);if(r instanceof Int16Array)return new B([D(Object.assign(Object.assign({},e),{type:new er}))]);if(r instanceof Int32Array)return new B([D(Object.assign(Object.assign({},e),{type:new Pe}))]);if(r instanceof BigInt64Array)return new B([D(Object.assign(Object.assign({},e),{type:new tr}))]);if(r instanceof Uint8Array||r instanceof Uint8ClampedArray)return new B([D(Object.assign(Object.assign({},e),{type:new rr}))]);if(r instanceof Uint16Array)return new B([D(Object.assign(Object.assign({},e),{type:new nr}))]);if(r instanceof Uint32Array)return new B([D(Object.assign(Object.assign({},e),{type:new vt}))]);if(r instanceof BigUint64Array)return new B([D(Object.assign(Object.assign({},e),{type:new Nr}))]);if(r instanceof Float32Array)return new B([D(Object.assign(Object.assign({},e),{type:new It}))]);if(r instanceof Float64Array)return new B([D(Object.assign(Object.assign({},e),{type:new sr}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function TO(r){return r instanceof G?[r]:r instanceof B?r.data:rn(r).data}var HT,JT,YT,QT,B,xl,ht=p(()=>{Me();Po();we();wr();gl();hi();ar();yl();wl();we();JT=Symbol.for("apache-arrow/Vector"),YT={},QT={},B=class r{static isVector(e){return e?.[JT]===!0}constructor(e){var t,n,s;let i=e[0]instanceof r?e.flatMap(a=>a.data):e;if(i.length===0||i.some(a=>!(a instanceof G)))throw new TypeError("Vector constructor expects an Array of Data instances.");let o=(t=i[0])===null||t===void 0?void 0:t.type;switch(i.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:u}=YT[o.typeId],l=i[0];this.isValid=f=>pc(l,f),this.get=f=>a(l,f),this.set=(f,d)=>c(l,f,d),this.indexOf=f=>u(l,f),this._offsets=[0,l.length];break}default:Object.setPrototypeOf(this,QT[o.typeId]),this._offsets=hl(i);break}this.data=i,this.type=o,this.stride=or(o),this.numChildren=(s=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&s!==void 0?s:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return KT(this.data)}get nullCount(){return dl(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${w[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(pi(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return Go.visit(this)}concat(...e){return new r(this.data.concat(e.flatMap(t=>t.data).flat(Number.POSITIVE_INFINITY)))}slice(e,t){return new r(fc(this,e,t,({data:n,_offsets:s},i,o)=>pl(n,s,i,o)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:s,ArrayType:i}=this;switch(e.typeId){case w.Int:case w.Float:case w.Decimal:case w.Time:case w.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*s);default:return t.reduce((o,{values:a,length:c})=>(o.array.set(a.subarray(0,c*s),o.offset),o.offset+=c*s,o),{array:new i(n*s),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)===null||t===void 0?void 0:t.findIndex(n=>n.name===e))}getChildAt(e){return e>-1&&e<this.numChildren?new r(this.data.map(({children:t})=>t[e])):null}get isMemoized(){return E.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(E.isDictionary(this.type)){let e=new xl(this.data[0].dictionary),t=this.data.map(n=>{let s=n.clone();return s.dictionary=e,s});return new r(t)}return new xl(this)}unmemoize(){if(E.isDictionary(this.type)&&this.isMemoized){let e=this.data[0].dictionary.unmemoize(),t=this.data.map(n=>{let s=n.clone();return s.dictionary=e,s});return new r(t)}return this}};HT=Symbol.toStringTag;B[HT]=(r=>{r.type=E.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0,r[JT]=!0;let e=Object.keys(w).map(t=>w[t]).filter(t=>typeof t=="number"&&t!==w.NONE);for(let t of e){let n=ze.getVisitFnByTypeId(t),s=nt.getVisitFnByTypeId(t),i=yi.getVisitFnByTypeId(t);YT[t]={get:n,set:s,indexOf:i},QT[t]=Object.create(r,{isValid:{value:jo(pc)},get:{value:jo(ze.getVisitFnByTypeId(t))},set:{value:ml(nt.getVisitFnByTypeId(t))},indexOf:{value:bl(yi.getVisitFnByTypeId(t))}})}return"Vector"})(B.prototype);Object.defineProperty(B,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===B&&B.isVector(e)}});xl=class r extends B{constructor(e){super(e.data);let t=this.get,n=this.set,s=this.slice,i=new Array(this.length);Object.defineProperty(this,"get",{value(o){let a=i[o];if(a!==void 0)return a;let c=t.call(this,o);return i[o]=c,c}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),i[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new r(s.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new B(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function ZT(r){if(!r||r.length<=0)return function(s){return!0};let e="",t=r.filter(n=>n===n);return t.length>0&&(e=`
13
13
  switch (x) {${t.map(n=>`
14
14
  case ${_O(n)}:`).join("")}
15
15
  return false;
@@ -28,7 +28,7 @@ return true;`)}function _O(r){return typeof r!="bigint"?Rr(r):`${Rr(r)}n`}var e0
28
28
  `:`,
29
29
  `),this._write(hM(this._recordBatches[e])),this._recordBatchBlocks.push(new Gr(0,0,0));this._write(`
30
30
  ]`)}return this._schema&&this._write(`
31
- }`),this._recordBatchesWithDictionaries=[],this._recordBatches=[],super.close()}}});function Q0(r,e){if(br(r))return mM(r,e);if(Br(r))return pM(r,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function pM(r,e){let t=null,n=e?.type==="bytes"||!1,s=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){i(o,t||(t=r[Symbol.iterator]()))},pull(o){t?i(o,t):o.close()},cancel(){t?.return&&t.return(),t=null}}),Object.assign({highWaterMark:n?s:void 0},e));function i(o,a){let c,u=null,l=o.desiredSize||null;for(;!(u=a.next(n?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=k(u.value))&&(l!=null&&n&&(l=l-c.byteLength+1),u.value=c),o.enqueue(u.value),l!=null&&--l<=0)return;o.close()}}function mM(r,e){let t=null,n=e?.type==="bytes"||!1,s=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){return F(this,void 0,void 0,function*(){yield i(o,t||(t=r[Symbol.asyncIterator]()))})},pull(o){return F(this,void 0,void 0,function*(){t?yield i(o,t):o.close()})},cancel(){return F(this,void 0,void 0,function*(){t?.return&&(yield t.return()),t=null})}}),Object.assign({highWaterMark:n?s:void 0},e));function i(o,a){return F(this,void 0,void 0,function*(){let c,u=null,l=o.desiredSize||null;for(;!(u=yield a.next(n?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=k(u.value))&&(l!=null&&n&&(l=l-c.byteLength+1),u.value=c),o.enqueue(u.value),l!=null&&--l<=0)return;o.close()})}}var Z0=p(()=>{kt();Ke();Yn()});function r_(r){return new am(r)}var am,e_,t_,n_=p(()=>{kt();xc();am=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:n,["queueingStrategy"]:s="count"}=e,i=dx(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=zr(i),this._getSize=s!=="bytes"?e_:t_;let{["highWaterMark"]:o=s==="bytes"?Math.pow(2,14):1e3}=Object.assign({},t),{["highWaterMark"]:a=s==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:o,size:s!=="bytes"?e_:t_}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(e){let t=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-t}_maybeFlush(e,t){t!=null&&(this._bufferedSize>=t.desiredSize&&++this._numChunks&&this._enqueue(t,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(t,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(t,null)))}_enqueue(e,t){this._bufferedSize=0,this._controller=null,t==null?e.close():e.enqueue(t)}},e_=r=>{var e;return(e=r?.length)!==null&&e!==void 0?e:0},t_=r=>{var e;return(e=r?.byteLength)!==null&&e!==void 0?e:0}});function Xl(r,e){let t=new Tr,n=null,s=new ReadableStream({cancel(){return F(this,void 0,void 0,function*(){yield t.close()})},start(a){return F(this,void 0,void 0,function*(){yield o(a,n||(n=yield i()))})},pull(a){return F(this,void 0,void 0,function*(){n?yield o(a,n):a.close()})}});return{writable:new WritableStream(t,Object.assign({highWaterMark:Math.pow(2,14)},r)),readable:s};function i(){return F(this,void 0,void 0,function*(){return yield(yield Mt.from(t)).open(e)})}function o(a,c){return F(this,void 0,void 0,function*(){let u=a.desiredSize,l=null;for(;!(l=yield c.next()).done;)if(a.enqueue(l.value),u!=null&&--u<=0)return;a.close()})}}var s_=p(()=>{kt();As();Ic()});function Hl(r,e){let t=new this(r),n=new Gt(t),s=new ReadableStream({cancel(){return F(this,void 0,void 0,function*(){yield n.cancel()})},pull(o){return F(this,void 0,void 0,function*(){yield i(o)})},start(o){return F(this,void 0,void 0,function*(){yield i(o)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(t,r),readable:s};function i(o){return F(this,void 0,void 0,function*(){let a=null,c=o.desiredSize;for(;a=yield n.read(c||null);)if(o.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;o.close()})}}var i_=p(()=>{kt();As()});function Zo(r){let e=Mt.from(r);return Yt(e)?e.then(t=>Zo(t)):e.isAsync()?e.readAll().then(t=>new me(t)):new me(e.readAll())}function Lc(r,e="stream",t=null){let n={compressionType:t};return(e==="stream"?Pn:Vn).writeAll(r,n).toUint8Array(!0)}var o_=p(()=>{$i();Yn();Ic();Kl()});var cm={};J(cm,{isArrowData:()=>Zl,isArrowDataType:()=>Ql,isArrowField:()=>Yl,isArrowRecordBatch:()=>tf,isArrowSchema:()=>Jl,isArrowTable:()=>rf,isArrowVector:()=>ef});function Jl(r){return Q.isSchema(r)}function Yl(r){return O.isField(r)}function Ql(r){return E.isDataType(r)}function Zl(r){return G.isData(r)}function ef(r){return B.isVector(r)}function tf(r){return de.isRecordBatch(r)}function rf(r){return me.isTable(r)}var um=p(()=>{mt();we();wr();ht();Rn();$i()});var a_,lm=p(()=>{Gu();So();Me();wr();we();$i();ht();Vt();mt();lc();cl();Se();xc();xp();Dp();Tp();_p();Ap();vp();Sp();Bp();Np();kp();Ep();Lp();Up();Vp();Pp();Bl();Ol();Fl();Fp();Op();Ip();Mp();Rp();Cp();As();Ic();Kl();o_();jl();Vl();_s();Rn();um();zu();pp();gi();uc();Ke();Po();tc();Sl();um();vc();a_=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ch),hp),Zh),Uh),nh),Qh),Dh),wp),cm),{compareSchemas:Wi,compareFields:B0,compareTypes:Rl})});var cn={};J(cn,{AsyncByteQueue:()=>Tr,AsyncByteStream:()=>Gt,AsyncMessageReader:()=>Ki,AsyncRecordBatchFileReader:()=>Jo,AsyncRecordBatchStreamReader:()=>kn,Binary:()=>Ct,BinaryBuilder:()=>Ln,BinaryView:()=>Z,BinaryViewBuilder:()=>On,Bool:()=>lt,BoolBuilder:()=>_i,BufferType:()=>re,Builder:()=>Te,ByteStream:()=>_r,CompressionType:()=>et,Data:()=>G,DataType:()=>E,DateBuilder:()=>nn,DateDay:()=>os,DateDayBuilder:()=>Is,DateMillisecond:()=>as,DateMillisecondBuilder:()=>Ss,DateUnit:()=>ye,Date_:()=>Et,Decimal:()=>Ut,DecimalBuilder:()=>Es,DenseUnion:()=>_n,DenseUnionBuilder:()=>Gi,Dictionary:()=>Ge,DictionaryBuilder:()=>Ai,Duration:()=>Lt,DurationBuilder:()=>Ar,DurationMicrosecond:()=>oc,DurationMicrosecondBuilder:()=>Rs,DurationMillisecond:()=>ic,DurationMillisecondBuilder:()=>Ds,DurationNanosecond:()=>ac,DurationNanosecondBuilder:()=>ks,DurationSecond:()=>sc,DurationSecondBuilder:()=>Ms,Field:()=>O,FixedSizeBinary:()=>Pt,FixedSizeBinaryBuilder:()=>Ls,FixedSizeList:()=>Be,FixedSizeListBuilder:()=>vi,Float:()=>ct,Float16:()=>Cr,Float16Builder:()=>Ii,Float32:()=>It,Float32Builder:()=>Si,Float64:()=>sr,Float64Builder:()=>Ei,FloatBuilder:()=>sn,Int:()=>Fe,Int16:()=>er,Int16Builder:()=>Bi,Int32:()=>Pe,Int32Builder:()=>Fi,Int64:()=>tr,Int64Builder:()=>Oi,Int8:()=>Zt,Int8Builder:()=>Li,IntBuilder:()=>Ft,Interval:()=>ft,IntervalBuilder:()=>Wr,IntervalDayTime:()=>ms,IntervalDayTimeBuilder:()=>Bs,IntervalMonthDayNano:()=>nc,IntervalMonthDayNanoBuilder:()=>Os,IntervalUnit:()=>ae,IntervalYearMonth:()=>bs,IntervalYearMonthBuilder:()=>Fs,JSONMessageReader:()=>Xi,LargeBinary:()=>Ur,LargeBinaryBuilder:()=>Bn,LargeList:()=>ir,LargeListBuilder:()=>Ci,LargeUtf8:()=>Pr,LargeUtf8Builder:()=>$s,List:()=>je,ListBuilder:()=>Ni,MapBuilder:()=>Ui,MapRow:()=>yr,Map_:()=>dt,Message:()=>gt,MessageHeader:()=>se,MessageReader:()=>qs,MetadataVersion:()=>ge,Null:()=>Ne,NullBuilder:()=>Pi,Precision:()=>le,RecordBatch:()=>de,RecordBatchFileReader:()=>Nn,RecordBatchFileWriter:()=>Vn,RecordBatchJSONWriter:()=>Ec,RecordBatchReader:()=>Mt,RecordBatchStreamReader:()=>$r,RecordBatchStreamWriter:()=>Pn,RecordBatchWriter:()=>an,Schema:()=>Q,SparseUnion:()=>gs,SparseUnionBuilder:()=>ji,Struct:()=>pe,StructBuilder:()=>Vi,StructRow:()=>en,Table:()=>me,Time:()=>tt,TimeBuilder:()=>Ir,TimeMicrosecond:()=>ls,TimeMicrosecondBuilder:()=>Gs,TimeMillisecond:()=>us,TimeMillisecondBuilder:()=>js,TimeNanosecond:()=>fs,TimeNanosecondBuilder:()=>zs,TimeSecond:()=>cs,TimeSecondBuilder:()=>Vs,TimeUnit:()=>L,Timestamp:()=>rt,TimestampBuilder:()=>vr,TimestampMicrosecond:()=>hs,TimestampMicrosecondBuilder:()=>Us,TimestampMillisecond:()=>Zr,TimestampMillisecondBuilder:()=>Cs,TimestampNanosecond:()=>ps,TimestampNanosecondBuilder:()=>Ps,TimestampSecond:()=>ds,TimestampSecondBuilder:()=>Ns,Type:()=>w,Uint16:()=>nr,Uint16Builder:()=>Di,Uint32:()=>vt,Uint32Builder:()=>Ri,Uint64:()=>Nr,Uint64Builder:()=>ki,Uint8:()=>rr,Uint8Builder:()=>Mi,Union:()=>Bt,UnionBuilder:()=>Fn,UnionMode:()=>he,Utf8:()=>ut,Utf8Builder:()=>Ws,Utf8View:()=>St,Utf8ViewBuilder:()=>zi,Vector:()=>B,Visitor:()=>R,builderThroughAsyncIterable:()=>$p,builderThroughIterable:()=>Nl,compressionRegistry:()=>Ks,isArrowData:()=>Zl,isArrowDataType:()=>Ql,isArrowField:()=>Yl,isArrowRecordBatch:()=>tf,isArrowSchema:()=>Jl,isArrowTable:()=>rf,isArrowVector:()=>ef,makeBuilder:()=>zr,makeData:()=>D,makeTable:()=>qp,makeVector:()=>rn,tableFromArrays:()=>Kp,tableFromIPC:()=>Zo,tableFromJSON:()=>Wp,tableToIPC:()=>Lc,util:()=>a_,vectorFromArray:()=>Ko});var jn=p(()=>{Va();Se();Ic();Kl();Z0();n_();s_();i_();lm();lm();Qe.toDOMStream=Q0;Te.throughDOM=r_;Mt.throughDOM=Xl;Nn.throughDOM=Xl;$r.throughDOM=Xl;an.throughDOM=Hl;Vn.throughDOM=Hl;Pn.throughDOM=Hl});function nf(r){return r.variadicBuffers??[]}function sf(r,e,t,n,s,i,o,a){return Reflect.construct(G,[r,e,t,n,s,i,o,a])}var fm=p(()=>{jn()});function c_(r,e={}){let t={...e,copies:new WeakMap};return bM(r)?wM(r,t):gM(r)?u_(r,t):yM(r)?l_(r,t):of(r,t)}function bM(r){return"batches"in r}function gM(r){return"schema"in r&&"data"in r&&!Array.isArray(r.data)}function yM(r){return"data"in r&&Array.isArray(r.data)}function wM(r,e){let t=r.batches.map(n=>u_(n,e));return new me(r.schema,t)}function u_(r,e){return new de(r.schema,of(r.data,e))}function of(r,e){let t=r.children.map(i=>of(i,e)),n=r.dictionary?l_(r.dictionary,e):void 0,s={[re.OFFSET]:Bc(r.buffers[re.OFFSET],e),[re.DATA]:Bc(r.buffers[re.DATA],e),[re.VALIDITY]:Bc(r.buffers[re.VALIDITY],e),[re.TYPE]:Bc(r.buffers[re.TYPE],e)};return sf(r.type,r.offset,r.length,r._nullCount,s,t,n,nf(r).map(i=>Bc(i,e)))}function l_(r,e){return new B(r.data.map(t=>of(t,e)))}function Bc(r,e){if(!xM(r)||e.copy==="none"||e.copy!=="all"&&r.byteOffset===0&&r.byteLength===r.buffer.byteLength)return r;let t=e.copies.get(r);return t||(t=r instanceof Uint8Array?new Uint8Array(r):r.slice(),e.copies.set(r,t)),t}function xM(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var dm=p(()=>{jn();fm()});var f_=p(()=>{});var d_=p(()=>{});var h_=p(()=>{});var p_=p(()=>{});function mm(r,e){let t=c_(r,e);return{transport:"arrow-js",version:1,schema:Lc(new me(t.schema,[])),metadataVersion:t.schema.metadataVersion,batches:t.batches.map(n=>hm(n.data))}}function bm(r){if(r.transport!=="arrow-js"||r.version!==1)throw new Error("Unsupported Arrow column-buffer transport protocol.");let e=Zo(r.schema).schema,t=new Q(e.fields,e.metadata,e.dictionaries,r.metadataVersion),n=new pe(t.fields),s=r.batches.map(i=>new de(t,pm(i,n)));return new me(t,s)}function hm(r){return{offset:r.offset,length:r.length,nullCount:r.nullCount,buffers:{[re.OFFSET]:r.buffers[re.OFFSET],[re.DATA]:r.buffers[re.DATA],[re.VALIDITY]:r.buffers[re.VALIDITY],[re.TYPE]:r.buffers[re.TYPE]},children:r.children.map(e=>hm(e)),variadicBuffers:nf(r),dictionary:r.dictionary?.data.map(e=>hm(e))}}function pm(r,e){let t=r.children.map((s,i)=>pm(s,e.children[i].type)),n=r.dictionary&&E.isDictionary(e)?new B(r.dictionary.map(s=>pm(s,e.dictionary))):void 0;return sf(e,r.offset,r.length,r.nullCount,r.buffers,t,n,r.variadicBuffers)}var m_=p(()=>{jn();fm();dm()});var b_=p(()=>{d_();f_();h_();p_();dm();m_()});var g_=p(()=>{b_()});function Hi(r){if(!y_(r))throw new Error("Workers require Arrow table output");let{data:e,...t}=r;return{...structuredClone(t),data:mm(e,{copy:"all"})}}function gm(r){if(!w_(r))throw new Error("Workers require Arrow column transport");return{...r,data:bm(r.data)}}function af(r,e){if(!y_(r))return r;let t=e,n=t?.core?.workerTransferBufferCopy??t?.workerTransferBufferCopy;return{...r,data:mm(r.data,n?{copy:n}:void 0)}}function cf(r){return w_(r)?{...r,data:bm(r.data)}:r}function y_(r){let e=r;return!!(e&&e.shape==="arrow-table"&&e.data&&typeof e.data=="object"&&"batches"in e.data)}function w_(r){let e=r;return!!(e&&e.shape==="arrow-table"&&e.data&&e.data.transport==="arrow-js"&&Array.isArray(e.data.batches))}var ea=p(()=>{"use strict";g_()});async function Xs(r,e,t,n){return n._parse(r,e,t,n)}var x_=p(()=>{"use strict"});function fr(r,e){if(!r)throw new Error(e||"loader assertion failed.")}var ym=p(()=>{"use strict"});var un,TM,_M,AM,vM,Gn,T_,IM,wm=p(()=>{"use strict";un={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},TM=un.self||un.window||un.global||{},_M=un.window||un.self||un.global||{},AM=un.global||un.self||un.window||{},vM=un.document||{},Gn=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),T_=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),IM=T_&&parseFloat(T_[1])||0});var __,A_=p(()=>{"use strict";__=r=>typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer});function Ji(r,e){return new Promise((t,n)=>{let s=!1;function i(a){s||(s=!0,n(a))}function o(a){if(!s){s=!0;try{t(e(a))}catch(c){n(c)}}}try{r(o,i)?.then(o,i)}catch(a){i(a)}})}var v_=p(()=>{"use strict"});function xm(r){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,r)}function Tm(r){return globalThis.loaders?.modules?.[r]||null}var _m=p(()=>{"use strict"});var I_,wq,xq,Am,S_=p(()=>{"use strict";I_="master",wq=`https://raw.githubusercontent.com/visgl/loaders.gl/${I_}/`,xq=`https://github.com/visgl/loaders.gl/raw/${I_}/`,Am="beta"});var E_=p(()=>{"use strict";S_()});function SM(){let r="5.0.0-beta.5";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=r,r}var L_,B_=p(()=>{"use strict";L_=SM()});function uf(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}var vm=p(()=>{"use strict"});var ln,Sq,Eq,Lq,Bq,Xe,Yi,O_,F_,Fq,Fc=p(()=>{"use strict";ln={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Sq=ln.self||ln.window||ln.global||{},Eq=ln.window||ln.self||ln.global||{},Lq=ln.global||ln.self||ln.window||{},Bq=ln.document||{},Xe=typeof process!="object"||String(process)!=="[object process]"||process.browser,Yi=typeof importScripts=="function",O_=typeof window<"u"&&typeof window.orientation<"u",F_=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Fq=F_&&parseFloat(F_[1])||0});var lf,Im=p(()=>{lf="latest"});function EM(){return typeof __VERSION__>"u"?lf:__VERSION__}var Sm,M_=p(()=>{Im();Sm=EM()});function Qi(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}var ff=p(()=>{});var fn,Nq,Cq,Uq,Pq,zt,R_,D_,Vq,ta=p(()=>{fn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Nq=fn.self||fn.window||fn.global||{},Cq=fn.window||fn.self||fn.global||{},Uq=fn.global||fn.self||fn.window||{},Pq=fn.document||{},zt=typeof process!="object"||String(process)!=="[object process]"||process.browser,R_=typeof window<"u"&&typeof window.orientation<"u",D_=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Vq=D_&&parseFloat(D_[1])||0});function k_(r){let e=new Error(r);return e.name="AbortError",e}var Oc,N_=p(()=>{Oc=class{constructor(e,t){this.isRunning=!0,this.isCancelled=!1,this.failed=!1,this.postMessageMs=0,this.complete=()=>{},this.processStarted=!1,this._resolve=()=>{},this._reject=()=>{},this.name=e,this.workerThread=t,this.completion=new Promise(n=>{this.complete=n}),this.result=new Promise((n,s)=>{this._resolve=n,this._reject=s})}postMessage(e,t,n){if(!this.isRunning||this.isCancelled)return;let s=performance.now();(e==="process"||e==="process-in-batches"||e==="preload")&&(this.processStarted=!0);try{this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t},n)}finally{this.postMessageMs+=performance.now()-s}}done(e){this.isRunning&&(this.isRunning=!1,this.executionMs=e?.executionMs,clearTimeout(this.cancellationTimer),this.complete(),this.isCancelled||this._resolve(e))}error(e){this.isRunning&&(this.isRunning=!1,this.failed=!0,this.sharedState?.snapshot.cancelled&&(this.isCancelled=!0),clearTimeout(this.cancellationTimer),this.complete(),this._reject(e))}cancel(e,t=1e3){if(!this.isRunning||this.isCancelled)return;if(!Number.isFinite(t)||t<0){this.abort(new RangeError("cancellationTimeout must be finite and nonnegative"));return}this.isCancelled=!0,this.sharedState?.cancel();let n=arguments.length?e:k_(`Worker job "${this.name}" was cancelled`);if(!this.processStarted){this.error(n);return}this._reject(n);try{this.workerThread.postMessage({source:"loaders.gl",type:"cancel",payload:{}},[]),this.cancellationTimer=setTimeout(()=>this.abort(e),t)}catch(s){this.abort(s)}}abort(e){this.isRunning&&(this.isCancelled=!0,this.sharedState?.cancel(),this.workerThread.destroy(),this.error(arguments.length?e:k_(`Worker job "${this.name}" was aborted`)))}}});var ra,zq,C_=p(()=>{ra=class{constructor(...e){let n=globalThis.process?.getBuiltinModule?.("node:worker_threads").Worker;if(n)return new n(...e)}terminate(){}},zq=globalThis.process?.getBuiltinModule?.("node:worker_threads")?.parentPort??null});function U_(r){if(Qi(r.source&&!r.url||!r.source&&r.url),r.url&&r.workerType==="module"){let t=globalThis.document?.baseURI??globalThis.location?.href;if(!t)return r.url;let n=new URL(r.url,t),s=globalThis.location?.origin;return/^https?:$/.test(n.protocol)&&n.origin!==s?Lm(`import ${JSON.stringify(n.href)};`):r.url}let e=Em.get(r.source||r.url);return e||(r.url&&(e=LM(r.url),Em.set(r.url,e)),r.source&&(e=Lm(r.source),Em.set(r.source,e))),Qi(e),e}function LM(r){if(!r.startsWith("http"))return r;let e=BM(r);return Lm(e)}function Lm(r){let e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function BM(r){return`try {
31
+ }`),this._recordBatchesWithDictionaries=[],this._recordBatches=[],super.close()}}});function Q0(r,e){if(br(r))return mM(r,e);if(Br(r))return pM(r,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function pM(r,e){let t=null,n=e?.type==="bytes"||!1,s=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){i(o,t||(t=r[Symbol.iterator]()))},pull(o){t?i(o,t):o.close()},cancel(){t?.return&&t.return(),t=null}}),Object.assign({highWaterMark:n?s:void 0},e));function i(o,a){let c,u=null,l=o.desiredSize||null;for(;!(u=a.next(n?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=k(u.value))&&(l!=null&&n&&(l=l-c.byteLength+1),u.value=c),o.enqueue(u.value),l!=null&&--l<=0)return;o.close()}}function mM(r,e){let t=null,n=e?.type==="bytes"||!1,s=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){return F(this,void 0,void 0,function*(){yield i(o,t||(t=r[Symbol.asyncIterator]()))})},pull(o){return F(this,void 0,void 0,function*(){t?yield i(o,t):o.close()})},cancel(){return F(this,void 0,void 0,function*(){t?.return&&(yield t.return()),t=null})}}),Object.assign({highWaterMark:n?s:void 0},e));function i(o,a){return F(this,void 0,void 0,function*(){let c,u=null,l=o.desiredSize||null;for(;!(u=yield a.next(n?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=k(u.value))&&(l!=null&&n&&(l=l-c.byteLength+1),u.value=c),o.enqueue(u.value),l!=null&&--l<=0)return;o.close()})}}var Z0=p(()=>{kt();Ke();Yn()});function r_(r){return new am(r)}var am,e_,t_,n_=p(()=>{kt();xc();am=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:n,["queueingStrategy"]:s="count"}=e,i=dx(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=zr(i),this._getSize=s!=="bytes"?e_:t_;let{["highWaterMark"]:o=s==="bytes"?Math.pow(2,14):1e3}=Object.assign({},t),{["highWaterMark"]:a=s==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:o,size:s!=="bytes"?e_:t_}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(e){let t=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-t}_maybeFlush(e,t){t!=null&&(this._bufferedSize>=t.desiredSize&&++this._numChunks&&this._enqueue(t,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(t,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(t,null)))}_enqueue(e,t){this._bufferedSize=0,this._controller=null,t==null?e.close():e.enqueue(t)}},e_=r=>{var e;return(e=r?.length)!==null&&e!==void 0?e:0},t_=r=>{var e;return(e=r?.byteLength)!==null&&e!==void 0?e:0}});function Xl(r,e){let t=new Tr,n=null,s=new ReadableStream({cancel(){return F(this,void 0,void 0,function*(){yield t.close()})},start(a){return F(this,void 0,void 0,function*(){yield o(a,n||(n=yield i()))})},pull(a){return F(this,void 0,void 0,function*(){n?yield o(a,n):a.close()})}});return{writable:new WritableStream(t,Object.assign({highWaterMark:Math.pow(2,14)},r)),readable:s};function i(){return F(this,void 0,void 0,function*(){return yield(yield Mt.from(t)).open(e)})}function o(a,c){return F(this,void 0,void 0,function*(){let u=a.desiredSize,l=null;for(;!(l=yield c.next()).done;)if(a.enqueue(l.value),u!=null&&--u<=0)return;a.close()})}}var s_=p(()=>{kt();As();Ic()});function Hl(r,e){let t=new this(r),n=new Gt(t),s=new ReadableStream({cancel(){return F(this,void 0,void 0,function*(){yield n.cancel()})},pull(o){return F(this,void 0,void 0,function*(){yield i(o)})},start(o){return F(this,void 0,void 0,function*(){yield i(o)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(t,r),readable:s};function i(o){return F(this,void 0,void 0,function*(){let a=null,c=o.desiredSize;for(;a=yield n.read(c||null);)if(o.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;o.close()})}}var i_=p(()=>{kt();As()});function Zo(r){let e=Mt.from(r);return Yt(e)?e.then(t=>Zo(t)):e.isAsync()?e.readAll().then(t=>new me(t)):new me(e.readAll())}function Lc(r,e="stream",t=null){let n={compressionType:t};return(e==="stream"?Pn:Vn).writeAll(r,n).toUint8Array(!0)}var o_=p(()=>{$i();Yn();Ic();Kl()});var cm={};J(cm,{isArrowData:()=>Zl,isArrowDataType:()=>Ql,isArrowField:()=>Yl,isArrowRecordBatch:()=>tf,isArrowSchema:()=>Jl,isArrowTable:()=>rf,isArrowVector:()=>ef});function Jl(r){return Q.isSchema(r)}function Yl(r){return O.isField(r)}function Ql(r){return E.isDataType(r)}function Zl(r){return G.isData(r)}function ef(r){return B.isVector(r)}function tf(r){return de.isRecordBatch(r)}function rf(r){return me.isTable(r)}var um=p(()=>{mt();we();wr();ht();Rn();$i()});var a_,lm=p(()=>{Gu();So();Me();wr();we();$i();ht();Vt();mt();lc();cl();Se();xc();xp();Dp();Tp();_p();Ap();vp();Sp();Bp();Np();kp();Ep();Lp();Up();Vp();Pp();Bl();Ol();Fl();Fp();Op();Ip();Mp();Rp();Cp();As();Ic();Kl();o_();jl();Vl();_s();Rn();um();zu();pp();gi();uc();Ke();Po();tc();Sl();um();vc();a_=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ch),hp),Zh),Uh),nh),Qh),Dh),wp),cm),{compareSchemas:Wi,compareFields:B0,compareTypes:Rl})});var cn={};J(cn,{AsyncByteQueue:()=>Tr,AsyncByteStream:()=>Gt,AsyncMessageReader:()=>Ki,AsyncRecordBatchFileReader:()=>Jo,AsyncRecordBatchStreamReader:()=>kn,Binary:()=>Ct,BinaryBuilder:()=>Ln,BinaryView:()=>Z,BinaryViewBuilder:()=>On,Bool:()=>lt,BoolBuilder:()=>_i,BufferType:()=>re,Builder:()=>Te,ByteStream:()=>_r,CompressionType:()=>et,Data:()=>G,DataType:()=>E,DateBuilder:()=>nn,DateDay:()=>os,DateDayBuilder:()=>Is,DateMillisecond:()=>as,DateMillisecondBuilder:()=>Ss,DateUnit:()=>ye,Date_:()=>Et,Decimal:()=>Ut,DecimalBuilder:()=>Es,DenseUnion:()=>_n,DenseUnionBuilder:()=>Gi,Dictionary:()=>Ge,DictionaryBuilder:()=>Ai,Duration:()=>Lt,DurationBuilder:()=>Ar,DurationMicrosecond:()=>oc,DurationMicrosecondBuilder:()=>Rs,DurationMillisecond:()=>ic,DurationMillisecondBuilder:()=>Ds,DurationNanosecond:()=>ac,DurationNanosecondBuilder:()=>ks,DurationSecond:()=>sc,DurationSecondBuilder:()=>Ms,Field:()=>O,FixedSizeBinary:()=>Pt,FixedSizeBinaryBuilder:()=>Ls,FixedSizeList:()=>Be,FixedSizeListBuilder:()=>vi,Float:()=>ct,Float16:()=>Cr,Float16Builder:()=>Ii,Float32:()=>It,Float32Builder:()=>Si,Float64:()=>sr,Float64Builder:()=>Ei,FloatBuilder:()=>sn,Int:()=>Fe,Int16:()=>er,Int16Builder:()=>Bi,Int32:()=>Pe,Int32Builder:()=>Fi,Int64:()=>tr,Int64Builder:()=>Oi,Int8:()=>Zt,Int8Builder:()=>Li,IntBuilder:()=>Ft,Interval:()=>ft,IntervalBuilder:()=>Wr,IntervalDayTime:()=>ms,IntervalDayTimeBuilder:()=>Bs,IntervalMonthDayNano:()=>nc,IntervalMonthDayNanoBuilder:()=>Os,IntervalUnit:()=>ae,IntervalYearMonth:()=>bs,IntervalYearMonthBuilder:()=>Fs,JSONMessageReader:()=>Xi,LargeBinary:()=>Ur,LargeBinaryBuilder:()=>Bn,LargeList:()=>ir,LargeListBuilder:()=>Ci,LargeUtf8:()=>Pr,LargeUtf8Builder:()=>$s,List:()=>je,ListBuilder:()=>Ni,MapBuilder:()=>Ui,MapRow:()=>yr,Map_:()=>dt,Message:()=>gt,MessageHeader:()=>se,MessageReader:()=>qs,MetadataVersion:()=>ge,Null:()=>Ne,NullBuilder:()=>Pi,Precision:()=>le,RecordBatch:()=>de,RecordBatchFileReader:()=>Nn,RecordBatchFileWriter:()=>Vn,RecordBatchJSONWriter:()=>Ec,RecordBatchReader:()=>Mt,RecordBatchStreamReader:()=>$r,RecordBatchStreamWriter:()=>Pn,RecordBatchWriter:()=>an,Schema:()=>Q,SparseUnion:()=>gs,SparseUnionBuilder:()=>ji,Struct:()=>pe,StructBuilder:()=>Vi,StructRow:()=>en,Table:()=>me,Time:()=>tt,TimeBuilder:()=>Ir,TimeMicrosecond:()=>ls,TimeMicrosecondBuilder:()=>Gs,TimeMillisecond:()=>us,TimeMillisecondBuilder:()=>js,TimeNanosecond:()=>fs,TimeNanosecondBuilder:()=>zs,TimeSecond:()=>cs,TimeSecondBuilder:()=>Vs,TimeUnit:()=>L,Timestamp:()=>rt,TimestampBuilder:()=>vr,TimestampMicrosecond:()=>hs,TimestampMicrosecondBuilder:()=>Us,TimestampMillisecond:()=>Zr,TimestampMillisecondBuilder:()=>Cs,TimestampNanosecond:()=>ps,TimestampNanosecondBuilder:()=>Ps,TimestampSecond:()=>ds,TimestampSecondBuilder:()=>Ns,Type:()=>w,Uint16:()=>nr,Uint16Builder:()=>Di,Uint32:()=>vt,Uint32Builder:()=>Ri,Uint64:()=>Nr,Uint64Builder:()=>ki,Uint8:()=>rr,Uint8Builder:()=>Mi,Union:()=>Bt,UnionBuilder:()=>Fn,UnionMode:()=>he,Utf8:()=>ut,Utf8Builder:()=>Ws,Utf8View:()=>St,Utf8ViewBuilder:()=>zi,Vector:()=>B,Visitor:()=>R,builderThroughAsyncIterable:()=>$p,builderThroughIterable:()=>Nl,compressionRegistry:()=>Ks,isArrowData:()=>Zl,isArrowDataType:()=>Ql,isArrowField:()=>Yl,isArrowRecordBatch:()=>tf,isArrowSchema:()=>Jl,isArrowTable:()=>rf,isArrowVector:()=>ef,makeBuilder:()=>zr,makeData:()=>D,makeTable:()=>qp,makeVector:()=>rn,tableFromArrays:()=>Kp,tableFromIPC:()=>Zo,tableFromJSON:()=>Wp,tableToIPC:()=>Lc,util:()=>a_,vectorFromArray:()=>Ko});var jn=p(()=>{Va();Se();Ic();Kl();Z0();n_();s_();i_();lm();lm();Qe.toDOMStream=Q0;Te.throughDOM=r_;Mt.throughDOM=Xl;Nn.throughDOM=Xl;$r.throughDOM=Xl;an.throughDOM=Hl;Vn.throughDOM=Hl;Pn.throughDOM=Hl});function nf(r){return r.variadicBuffers??[]}function sf(r,e,t,n,s,i,o,a){return Reflect.construct(G,[r,e,t,n,s,i,o,a])}var fm=p(()=>{jn()});function c_(r,e={}){let t={...e,copies:new WeakMap};return bM(r)?wM(r,t):gM(r)?u_(r,t):yM(r)?l_(r,t):of(r,t)}function bM(r){return"batches"in r}function gM(r){return"schema"in r&&"data"in r&&!Array.isArray(r.data)}function yM(r){return"data"in r&&Array.isArray(r.data)}function wM(r,e){let t=r.batches.map(n=>u_(n,e));return new me(r.schema,t)}function u_(r,e){return new de(r.schema,of(r.data,e))}function of(r,e){let t=r.children.map(i=>of(i,e)),n=r.dictionary?l_(r.dictionary,e):void 0,s={[re.OFFSET]:Bc(r.buffers[re.OFFSET],e),[re.DATA]:Bc(r.buffers[re.DATA],e),[re.VALIDITY]:Bc(r.buffers[re.VALIDITY],e),[re.TYPE]:Bc(r.buffers[re.TYPE],e)};return sf(r.type,r.offset,r.length,r._nullCount,s,t,n,nf(r).map(i=>Bc(i,e)))}function l_(r,e){return new B(r.data.map(t=>of(t,e)))}function Bc(r,e){if(!xM(r)||e.copy==="none"||e.copy!=="all"&&r.byteOffset===0&&r.byteLength===r.buffer.byteLength)return r;let t=e.copies.get(r);return t||(t=r instanceof Uint8Array?new Uint8Array(r):r.slice(),e.copies.set(r,t)),t}function xM(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var dm=p(()=>{jn();fm()});var f_=p(()=>{});var d_=p(()=>{});var h_=p(()=>{});var p_=p(()=>{});function mm(r,e){let t=c_(r,e);return{transport:"arrow-js",version:1,schema:Lc(new me(t.schema,[])),metadataVersion:t.schema.metadataVersion,batches:t.batches.map(n=>hm(n.data))}}function bm(r){if(r.transport!=="arrow-js"||r.version!==1)throw new Error("Unsupported Arrow column-buffer transport protocol.");let e=Zo(r.schema).schema,t=new Q(e.fields,e.metadata,e.dictionaries,r.metadataVersion),n=new pe(t.fields),s=r.batches.map(i=>new de(t,pm(i,n)));return new me(t,s)}function hm(r){return{offset:r.offset,length:r.length,nullCount:r.nullCount,buffers:{[re.OFFSET]:r.buffers[re.OFFSET],[re.DATA]:r.buffers[re.DATA],[re.VALIDITY]:r.buffers[re.VALIDITY],[re.TYPE]:r.buffers[re.TYPE]},children:r.children.map(e=>hm(e)),variadicBuffers:nf(r),dictionary:r.dictionary?.data.map(e=>hm(e))}}function pm(r,e){let t=r.children.map((s,i)=>pm(s,e.children[i].type)),n=r.dictionary&&E.isDictionary(e)?new B(r.dictionary.map(s=>pm(s,e.dictionary))):void 0;return sf(e,r.offset,r.length,r.nullCount,r.buffers,t,n,r.variadicBuffers)}var m_=p(()=>{jn();fm();dm()});var b_=p(()=>{d_();f_();h_();p_();dm();m_()});var g_=p(()=>{b_()});function Hi(r){if(!y_(r))throw new Error("Workers require Arrow table output");let{data:e,...t}=r;return{...structuredClone(t),data:mm(e,{copy:"all"})}}function gm(r){if(!w_(r))throw new Error("Workers require Arrow column transport");return{...r,data:bm(r.data)}}function af(r,e){if(!y_(r))return r;let t=e,n=t?.core?.workerTransferBufferCopy??t?.workerTransferBufferCopy;return{...r,data:mm(r.data,n?{copy:n}:void 0)}}function cf(r){return w_(r)?{...r,data:bm(r.data)}:r}function y_(r){let e=r;return!!(e&&e.shape==="arrow-table"&&e.data&&typeof e.data=="object"&&"batches"in e.data)}function w_(r){let e=r;return!!(e&&e.shape==="arrow-table"&&e.data&&e.data.transport==="arrow-js"&&Array.isArray(e.data.batches))}var ea=p(()=>{"use strict";g_()});async function Xs(r,e,t,n){return n._parse(r,e,t,n)}var x_=p(()=>{"use strict"});function fr(r,e){if(!r)throw new Error(e||"loader assertion failed.")}var ym=p(()=>{"use strict"});var un,TM,_M,AM,vM,Gn,T_,IM,wm=p(()=>{"use strict";un={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},TM=un.self||un.window||un.global||{},_M=un.window||un.self||un.global||{},AM=un.global||un.self||un.window||{},vM=un.document||{},Gn=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),T_=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),IM=T_&&parseFloat(T_[1])||0});var __,A_=p(()=>{"use strict";__=r=>typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer});function Ji(r,e){return new Promise((t,n)=>{let s=!1;function i(a){s||(s=!0,n(a))}function o(a){if(!s){s=!0;try{t(e(a))}catch(c){n(c)}}}try{r(o,i)?.then(o,i)}catch(a){i(a)}})}var v_=p(()=>{"use strict"});function xm(r){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,r)}function Tm(r){return globalThis.loaders?.modules?.[r]||null}var _m=p(()=>{"use strict"});var I_,wq,xq,Am,S_=p(()=>{"use strict";I_="master",wq=`https://raw.githubusercontent.com/visgl/loaders.gl/${I_}/`,xq=`https://github.com/visgl/loaders.gl/raw/${I_}/`,Am="beta"});var E_=p(()=>{"use strict";S_()});function SM(){let r="5.0.0-beta.7";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=r,r}var L_,B_=p(()=>{"use strict";L_=SM()});function uf(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}var vm=p(()=>{"use strict"});var ln,Sq,Eq,Lq,Bq,Xe,Yi,O_,F_,Fq,Fc=p(()=>{"use strict";ln={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Sq=ln.self||ln.window||ln.global||{},Eq=ln.window||ln.self||ln.global||{},Lq=ln.global||ln.self||ln.window||{},Bq=ln.document||{},Xe=typeof process!="object"||String(process)!=="[object process]"||process.browser,Yi=typeof importScripts=="function",O_=typeof window<"u"&&typeof window.orientation<"u",F_=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Fq=F_&&parseFloat(F_[1])||0});var lf,Im=p(()=>{lf="latest"});function EM(){return typeof __VERSION__>"u"?lf:__VERSION__}var Sm,M_=p(()=>{Im();Sm=EM()});function Qi(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}var ff=p(()=>{});var fn,Nq,Cq,Uq,Pq,zt,R_,D_,Vq,ta=p(()=>{fn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Nq=fn.self||fn.window||fn.global||{},Cq=fn.window||fn.self||fn.global||{},Uq=fn.global||fn.self||fn.window||{},Pq=fn.document||{},zt=typeof process!="object"||String(process)!=="[object process]"||process.browser,R_=typeof window<"u"&&typeof window.orientation<"u",D_=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Vq=D_&&parseFloat(D_[1])||0});function k_(r){let e=new Error(r);return e.name="AbortError",e}var Oc,N_=p(()=>{Oc=class{constructor(e,t){this.isRunning=!0,this.isCancelled=!1,this.failed=!1,this.postMessageMs=0,this.complete=()=>{},this.processStarted=!1,this._resolve=()=>{},this._reject=()=>{},this.name=e,this.workerThread=t,this.completion=new Promise(n=>{this.complete=n}),this.result=new Promise((n,s)=>{this._resolve=n,this._reject=s})}postMessage(e,t,n){if(!this.isRunning||this.isCancelled)return;let s=performance.now();(e==="process"||e==="process-in-batches"||e==="preload")&&(this.processStarted=!0);try{this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t},n)}finally{this.postMessageMs+=performance.now()-s}}done(e){this.isRunning&&(this.isRunning=!1,this.executionMs=e?.executionMs,clearTimeout(this.cancellationTimer),this.complete(),this.isCancelled||this._resolve(e))}error(e){this.isRunning&&(this.isRunning=!1,this.failed=!0,this.sharedState?.snapshot.cancelled&&(this.isCancelled=!0),clearTimeout(this.cancellationTimer),this.complete(),this._reject(e))}cancel(e,t=1e3){if(!this.isRunning||this.isCancelled)return;if(!Number.isFinite(t)||t<0){this.abort(new RangeError("cancellationTimeout must be finite and nonnegative"));return}this.isCancelled=!0,this.sharedState?.cancel();let n=arguments.length?e:k_(`Worker job "${this.name}" was cancelled`);if(!this.processStarted){this.error(n);return}this._reject(n);try{this.workerThread.postMessage({source:"loaders.gl",type:"cancel",payload:{}},[]),this.cancellationTimer=setTimeout(()=>this.abort(e),t)}catch(s){this.abort(s)}}abort(e){this.isRunning&&(this.isCancelled=!0,this.sharedState?.cancel(),this.workerThread.destroy(),this.error(arguments.length?e:k_(`Worker job "${this.name}" was aborted`)))}}});var ra,zq,C_=p(()=>{ra=class{constructor(...e){let n=globalThis.process?.getBuiltinModule?.("node:worker_threads").Worker;if(n)return new n(...e)}terminate(){}},zq=globalThis.process?.getBuiltinModule?.("node:worker_threads")?.parentPort??null});function U_(r){if(Qi(r.source&&!r.url||!r.source&&r.url),r.url&&r.workerType==="module"){let t=globalThis.document?.baseURI??globalThis.location?.href;if(!t)return r.url;let n=new URL(r.url,t),s=globalThis.location?.origin;return/^https?:$/.test(n.protocol)&&n.origin!==s?Lm(`import ${JSON.stringify(n.href)};`):r.url}let e=Em.get(r.source||r.url);return e||(r.url&&(e=LM(r.url),Em.set(r.url,e)),r.source&&(e=Lm(r.source),Em.set(r.source,e))),Qi(e),e}function LM(r){if(!r.startsWith("http"))return r;let e=BM(r);return Lm(e)}function Lm(r){let e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function BM(r){return`try {
32
32
  importScripts('${r}');
33
33
  } catch (error) {
34
34
  console.error(error);
@@ -39,8 +39,8 @@ return true;`)}function _O(r){return typeof r!="bigint"?Rr(r):`${Rr(r)}n`}var e0
39
39
  `)!==-1&&(r=r.replace(/\r\n/g,`
40
40
  `)),r.indexOf(`\\
41
41
  `)!==-1&&(r=r.replace(/\\\n/g,""));let t=r.split(`
42
- `),n="",s="",i=0,o=[],a=typeof"".trimLeft=="function";for(let l=0,f=t.length;l<f;l++)if(n=t[l],n=a?n.trimLeft():n.trim(),i=n.length,i!==0&&(s=n.charAt(0),s!=="#"))if(s==="v"){let d=n.split(/\s+/);switch(d[0]){case"v":e.vertices.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])),d.length>=7&&e.colors.push(parseFloat(d[4]),parseFloat(d[5]),parseFloat(d[6]));break;case"vn":e.normals.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));break;case"vt":e.uvs.push(parseFloat(d[1]),parseFloat(d[2]));break;default:}}else if(s==="f"){let h=n.substr(1).trim().split(/\s+/),m=[];for(let g=0,y=h.length;g<y;g++){let x=h[g];if(x.length>0){let T=x.split("/");m.push(T)}}let b=m[0];for(let g=1,y=m.length-1;g<y;g++){let x=m[g],T=m[g+1];e.addFace(b[0],x[0],T[0],b[1],x[1],T[1],b[2],x[2],T[2])}}else if(s==="l"){let d=n.substring(1).trim().split(" "),h,m=[];if(n.indexOf("/")===-1)h=d;else{h=[];for(let b=0,g=d.length;b<g;b++){let y=d[b].split("/");y[0]!==""&&h.push(y[0]),y[1]!==""&&m.push(y[1])}}e.addLineGeometry(h,m)}else if(s==="p"){let h=n.substr(1).trim().split(" ");e.addPointGeometry(h)}else if(Sv.test(n)){o=Sv.exec(n)||[];let d=(" "+o[0].substr(1).trim()).substr(1);e.startObject(d)}else if(iD.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(sD.test(n))e.materialLibraries.push(n.substring(7).trim());else if(s==="s"){if(o=n.split(" "),o.length>1){let h=o[1].trim().toLowerCase();e.object.smooth=h!=="0"&&h!=="off"}else e.object.smooth=!0;let d=e.object.currentMaterial();d&&(d.smooth=e.object.smooth)}else{if(n==="\0")continue;throw new Error(`Unexpected line: "${n}"`)}e.finalize();let c=[],u=[];for(let l of e.objects){let{geometry:f}=l;if(f.vertices.length===0)continue;let d={header:{vertexCount:f.vertices.length/3},attributes:{}};switch(f.type){case"Points":d.mode=0;break;case"Line":d.mode=1;break;default:d.mode=4;break}d.attributes.POSITION={value:new Float32Array(f.vertices),size:3},f.normals.length>0&&(d.attributes.NORMAL={value:new Float32Array(f.normals),size:3}),f.colors.length>0&&(d.attributes.COLOR_0={value:new Float32Array(f.colors),size:3}),f.uvs.length>0&&(d.attributes.TEXCOORD_0={value:new Float32Array(f.uvs),size:2}),d.materials=[];for(let h of l.materials){let m={name:h.name,flatShading:!h.smooth};d.materials.push(m),u.push(m)}d.name=l.name,c.push(d)}return{meshes:c,materials:u}}var Sv,sD,iD,zb,Wb,$b,Lv=p(()=>{"use strict";Sv=/^[og]\s*(.+)?/,sD=/^mtllib /,iD=/^usemtl /,zb=class r{constructor({index:e,name:t="",mtllib:n,smooth:s,groupStart:i}){this.index=e,this.name=t,this.mtllib=n,this.smooth=s,this.groupStart=i,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}clone(e=this.index){return new r({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}},Wb=class{constructor(e=""){this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0,this.fromDeclaration=null}startMaterial(e,t){let n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);let s=new zb({index:this.materials.length,name:e,mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:n!==void 0?n.smooth:this.smooth,groupStart:n!==void 0?n.groupEnd:0});return this.materials.push(s),s}currentMaterial(){if(this.materials.length>0)return this.materials[this.materials.length-1]}_finalize(e){let t=this.currentMaterial();if(t&&t.groupEnd===-1&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let n=this.materials.length-1;n>=0;n--)this.materials[n].groupCount<=0&&this.materials.splice(n,1);return e&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),t}},$b=class{constructor(){this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}startObject(e,t=!0){if(this.object&&!this.object.fromDeclaration){this.object.name=e,this.object.fromDeclaration=t;return}let n=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object=new Wb(e),this.object.fromDeclaration=t,n&&n.name&&typeof n.clone=="function"){let s=n.clone(0);s.inherited=!0,this.object.materials.push(s)}this.objects.push(this.object)}finalize(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)}parseVertexIndex(e,t){let n=parseInt(e);return(n>=0?n-1:n+t/3)*3}parseNormalIndex(e,t){let n=parseInt(e);return(n>=0?n-1:n+t/3)*3}parseUVIndex(e,t){let n=parseInt(e);return(n>=0?n-1:n+t/2)*2}addVertex(e,t,n){let s=this.vertices,i=this.object.geometry.vertices;i.push(s[e+0],s[e+1],s[e+2]),i.push(s[t+0],s[t+1],s[t+2]),i.push(s[n+0],s[n+1],s[n+2])}addVertexPoint(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])}addVertexLine(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])}addNormal(e,t,n){let s=this.normals,i=this.object.geometry.normals;i.push(s[e+0],s[e+1],s[e+2]),i.push(s[t+0],s[t+1],s[t+2]),i.push(s[n+0],s[n+1],s[n+2])}addColor(e,t,n){let s=this.colors,i=this.object.geometry.colors;i.push(s[e+0],s[e+1],s[e+2]),i.push(s[t+0],s[t+1],s[t+2]),i.push(s[n+0],s[n+1],s[n+2])}addUV(e,t,n){let s=this.uvs,i=this.object.geometry.uvs;i.push(s[e+0],s[e+1]),i.push(s[t+0],s[t+1]),i.push(s[n+0],s[n+1])}addUVLine(e){let t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])}addFace(e,t,n,s,i,o,a,c,u){let l=this.vertices.length,f=this.parseVertexIndex(e,l),d=this.parseVertexIndex(t,l),h=this.parseVertexIndex(n,l);if(this.addVertex(f,d,h),s!==void 0&&s!==""){let m=this.uvs.length;f=this.parseUVIndex(s,m),d=this.parseUVIndex(i,m),h=this.parseUVIndex(o,m),this.addUV(f,d,h)}if(a!==void 0&&a!==""){let m=this.normals.length;f=this.parseNormalIndex(a,m),d=a===c?f:this.parseNormalIndex(c,m),h=a===u?f:this.parseNormalIndex(u,m),this.addNormal(f,d,h)}this.colors.length>0&&this.addColor(f,d,h)}addPointGeometry(e){this.object.geometry.type="Points";let t=this.vertices.length;for(let n of e)this.addVertexPoint(this.parseVertexIndex(n,t))}addLineGeometry(e,t){this.object.geometry.type="Line";let n=this.vertices.length,s=this.uvs.length;for(let i of e)this.addVertexLine(this.parseVertexIndex(i,n));for(let i of t)this.addUVLine(this.parseUVIndex(i,s))}}});function Kf(r,e){let{meshes:t}=Ev(r),n=t.reduce((a,c)=>a+c.header.vertexCount,0),s=oD(t,n),i={vertexCount:n,boundingBox:Er(s)??void 0},o=qf(s,{mode:4,boundingBox:i.boundingBox});return{loaderData:{header:{}},schema:o,header:i,mode:4,topology:"point-list",attributes:s}}function oD(r,e){let t=new Float32Array(e*3),n,s,i,o=0;for(let c of r){let{POSITION:u,NORMAL:l,COLOR_0:f,TEXCOORD_0:d}=c.attributes;t.set(u.value,o*3),l&&(n=n||new Float32Array(e*3),n.set(l.value,o*3)),f&&(s=s||new Float32Array(e*3),s.set(f.value,o*3)),d&&(i=i||new Float32Array(e*2),i.set(d.value,o*2)),o+=u.value.length/3}let a={};return a.POSITION={value:t,size:3},n&&(a.NORMAL={value:n,size:3}),s&&(a.COLOR_0={value:s,size:3}),i&&(a.TEXCOORD_0={value:i,size:2}),a}var Bv=p(()=>{"use strict";mn();Lv();Gb()});function Fv(r,e){let t=ei(r,"arrow-table");return e?.obj?.shape==="mesh"?pn(t):t}function uD(r){let e=r?.batchSize??r?.core?.batchSize;return typeof e=="number"?e:void 0}function lD(r){return r.split(/\r?\n/).some(e=>{let t=e.trimStart();return t.startsWith("f ")||t.startsWith("l ")})}function*fD(r,e,t){let n=r.split(/\r?\n/).filter(s=>s.trimStart().startsWith("v "));yield*hD(n,e,t)}async function*dD(r,e,t){let n=t||1e3,s=[];for await(let i of r)i.trimStart().startsWith("v ")&&(s.push(i),s.length>=n&&(yield Xf(qb(s),e),s=[]));s.length>0&&(yield Xf(qb(s),e))}function*hD(r,e,t){let n=t||r.length||1;for(let s=0;s<r.length;s+=n){let i=qb(r.slice(s,s+n));yield Xf(i,e)}}function qb(r){let e=new Float32Array(r.length*3);for(let s=0;s<r.length;s++){let i=r[s].trim().split(/\s+/);e[s*3+0]=Number(i[1]),e[s*3+1]=Number(i[2]),e[s*3+2]=Number(i[3])}let t={POSITION:{value:e,size:3}},n=Er(t);return{loaderData:{header:{}},schema:qf(t,{mode:0,boundingBox:n??void 0}),header:{vertexCount:r.length,boundingBox:n??void 0},mode:0,topology:"point-list",attributes:t}}function Xf(r,e){let t=ei(r,"arrow-table");if(e?.obj?.shape==="mesh"){let n=pn(t);return{shape:"mesh",batchType:"data",data:n,length:n.header?.vertexCount||0}}return hb(t)}function pD(r,e){let t=gm(r);return e?.obj?.shape==="mesh"?pn(t):t}function mD(r,e){let t=gm(r);return e?.obj?.shape!=="mesh"?t:{shape:"mesh",batchType:"data",data:pn(t),length:t.length}}var eY,aD,cD,Ov=p(()=>{"use strict";Ue();ea();mn();Gb();Bv();Dv();({preload:eY,...aD}=Mv);cD={...aD,parse:async(r,e)=>Fv(Kf(new TextDecoder().decode(r),e),e),parseTextSync:(r,e)=>Fv(Kf(r,e),e),parseInBatches:async function*(r,e){let t=uD(e);if(e?.obj?.pointCloud){let i=ub(r),o=lb(i);yield*dD(o,e,t);return}let n=await fb(r),s=new TextDecoder().decode(n);if(lD(s)){yield Xf(Kf(s,e),e);return}yield*fD(s,e,t)},serializeWorkerResult:Hi,deserializeWorkerResult:pD,serializeWorkerBatch:Hi,deserializeWorkerBatch:mD}});var Kb={};J(Kb,{OBJLoaderWithParser:()=>cD});var Xb=p(()=>{"use strict";Ov()});async function gD(){let{OBJLoaderWithParser:r}=await Promise.resolve().then(()=>(Xb(),Kb));return r}function yD(r){return r[0]==="v"}var bD,Mv,Dv=p(()=>{"use strict";lx();ea();bD="5.0.0-beta.5";Mv={...ux,dataType:null,batchType:null,version:bD,worker:!0,workerInBatches:!0,serializeWorkerResult:Hi,text:!0,testText:yD,options:{obj:{shape:"arrow-table"}},preload:gD}});var Rv,kv=p(()=>{"use strict";Rv={name:"MTL",id:"mtl",module:"mtl",encoding:"text",format:"mtl",extensions:["mtl"],mimeTypes:["text/plain"]}});function Hb(r,e){let t=[],n={name:"placeholder"},s=r.split(`
43
- `);for(let i of s){if(i=i.trim(),i.length===0||i.charAt(0)==="#")continue;let o=i.indexOf(" "),a=o>=0?i.substring(0,o):i;a=a.toLowerCase();let c=o>=0?i.substring(o+1):"";switch(c=c.trim(),a){case"newmtl":n={name:c},t.push(n);break;case"ka":n.ambientColor=Hf(c);break;case"kd":n.diffuseColor=Hf(c);break;case"map_kd":n.diffuseTextureUrl=c;break;case"ks":n.specularColor=Hf(c);break;case"map_ks":n.specularTextureUrl=c;break;case"ke":n.emissiveColor=Hf(c);break;case"map_ke":n.emissiveTextureUrl=c;break;case"ns":n.shininess=parseFloat(c);break;case"map_ns":break;case"ni":n.refraction=parseFloat(c);break;case"illum":n.illumination=parseFloat(c);break;default:break}}return t}function Hf(r,e){let t=r.split(wD,3);return[parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])]}var wD,Nv=p(()=>{"use strict";wD=/\s+/});var fY,xD,dY,TD,_D,AD,Cv=p(()=>{"use strict";Nv();Jb();Jb();({preload:fY,...xD}=Jf),{preload:dY,...TD}=Jf,_D={...xD},AD={...TD,parse:async(r,e)=>Hb(new TextDecoder().decode(r),e?.mtl),parseTextSync:(r,e)=>Hb(r,e?.mtl)}});var Yb={};J(Yb,{MTLLoaderWithParser:()=>AD,MTLWorkerLoaderWithParser:()=>_D});var Qb=p(()=>{"use strict";Cv()});async function ID(){let{MTLLoaderWithParser:r}=await Promise.resolve().then(()=>(Qb(),Yb));return r}var vD,Jf,Jb=p(()=>{"use strict";kv();vD="5.0.0-beta.5";Jf={...Rv,dataType:null,batchType:null,version:vD,worker:!0,text:!0,testText:r=>r.includes("newmtl"),options:{mtl:{}},preload:ID}});var Yf,Zb=p(()=>{"use strict";Yf="5.0.0-beta.5"});var Uv,Pv,eg=p(()=>{"use strict";Uv={name:"glTF",id:"gltf",module:"scene",encoding:"binary",format:"gltf",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"]},Pv={name:"GLB",id:"glb",module:"scene",encoding:"binary",format:"glb",extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,tests:["glTF"]}});function Vv(r){return!BD(r,"ftyp",4)||(r[8]&96)===0?null:SD(r)}function SD(r){switch(ED(r,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function ED(r,e,t){return String.fromCharCode(...r.slice(e,t))}function LD(r){return[...r].map(e=>e.charCodeAt(0))}function BD(r,e,t=0){let n=LD(e);for(let s=0;s<n.length;++s)if(n[s]!==r[s+t])return!1;return!0}var jv=p(()=>{"use strict"});function $n(r){let e=Xc(r);return OD(e)||RD(e)||MD(e)||DD(e)||FD(e)}function FD(r){let e=new Uint8Array(r instanceof DataView?r.buffer:r),t=Vv(e);return t?{mimeType:t.mimeType,width:0,height:0}:null}function OD(r){let e=Xc(r);return e.byteLength>=33&&e.getUint32(0,dr)===2303741511&&e.getUint32(4,dr)===218765834&&e.getUint32(8,dr)===13&&e.getUint32(12,dr)===1229472850?{mimeType:"image/png",width:e.getUint32(16,dr),height:e.getUint32(20,dr)}:null}function MD(r){let e=Xc(r);return e.byteLength>=10&&e.getUint32(0,dr)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Kc),height:e.getUint16(8,Kc)}:null}function DD(r){let e=Xc(r);return e.byteLength>=14&&e.getUint16(0,dr)===16973&&e.getUint32(2,Kc)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Kc),height:e.getUint32(22,Kc)}:null}function RD(r){let e=Xc(r);if(!(e.byteLength>=3&&e.getUint16(0,dr)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=kD(),i=2;for(;i+9<e.byteLength;){let o=e.getUint16(i,dr);if(s.has(o))return{mimeType:"image/jpeg",height:e.getUint16(i+5,dr),width:e.getUint16(i+7,dr)};if(!n.has(o))return null;i+=2,i+=e.getUint16(i,dr)}return null}function kD(){let r=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)r.add(t);return{tableMarkers:r,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Xc(r){if(r instanceof DataView)return r;if(ArrayBuffer.isView(r))return new DataView(r.buffer);if(r instanceof ArrayBuffer)return new DataView(r);throw new Error("toDataView")}var dr,Kc,Qf=p(()=>{"use strict";jv();dr=!1,Kc=!0});var ND,CD,UD,Gv,zv=p(()=>{"use strict";Qf();ND=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],CD=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],UD={id:"image",module:"images",name:"Images",encoding:"image",format:"image",mimeTypes:CD,extensions:ND,tests:[r=>!!$n(new DataView(r))]},Gv={...UD,id:"imagebitmap",name:"ImageBitmap",format:"image-bitmap"}});var Zf,tg=p(()=>{"use strict";Zf="5.0.0-beta.5"});function da(r){if(!r)return!1;if(PD.test(r))return!0;for(let e=r.indexOf(".svg");e>=0;e=r.indexOf(".svg",e+4)){let t=r[e+4];if(t===void 0||t==="?"||t==="#")return!0}return!1}function Wv(r,e){if(da(e)){let n=new TextDecoder().decode(r);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return rg(r,e)}function rg(r,e){if(da(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(r)])}var PD,ed=p(()=>{"use strict";PD=/^data:image\/svg\+xml/});async function $v(r,e,t){let n=Wv(r,t),s=self.URL||self.webkitURL,i=typeof n!="string"&&s.createObjectURL(n);try{return await VD(i||n,e)}finally{i&&s.revokeObjectURL(i)}}async function VD(r,e){let t=new Image;return t.src=r,e?.image?.decode&&t.decode?(await t.decode(),t):await new Promise((n,s)=>{try{t.onload=()=>n(t),t.onerror=i=>{let o=i instanceof Error?i.message:"error";s(new Error(o))}}catch(i){s(i)}})}var qv=p(()=>{"use strict";ed()});async function Xv(r,e,t){let n;da(t)?n=await $v(r,e,t):n=rg(r,t);let s=e&&e.imagebitmap;return await Jv(n,s)}async function Hv(r,e){let t=e&&e.imagebitmap;return await Jv(r,t)}async function Jv(r,e=null){if((jD(e)||!Kv)&&(e=null),e)try{return await createImageBitmap(r,e)}catch(t){console.warn(t),Kv=!1}return await createImageBitmap(r)}function jD(r){if(!r)return!0;for(let e in r)if(Object.prototype.hasOwnProperty.call(r,e))return!1;return!0}var Kv,Yv=p(()=>{"use strict";ed();qv();Kv=!0});async function Qv(r,e){let{mimeType:t}=$n(r)||{},n=globalThis.loaders?.parseImageNode;fr(n);let s=globalThis.loaders?.createImageBitmapNode;if(!s)throw new Error("Install '@loaders.gl/core/polyfills' to parse images under Node.js");let i=await n(r,t);return s(i)}var Zv=p(()=>{"use strict";Ue();Qf()});async function ng(r,e,t){e=e||{},rI(e);let n=!!globalThis.loaders?.parseImageNode;if(!Gn||n)return await Qv(r,e);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(eI);return await Xv(r,e,t?.url)}async function tI(r,e,t){e=e||{},rI(e);let n=!!globalThis.loaders?.parseImageNode;if(!Gn||n||da(t?.url)||r.type.startsWith("image/svg+xml"))return await ng(await r.arrayBuffer(),e,t);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(eI);return await Hv(r,e)}function rI(r){let e=r.image?.type;if(e&&e!=="imagebitmap")throw new Error(GD)}var GD,eI,nI=p(()=>{"use strict";Ue();Yv();ed();Zv();GD="@loaders.gl/images: ImageLoader only accepts options.image.type='imagebitmap'. Remove legacy image/data/auto values and call getImageData(image) if you need raw pixels.",eI="@loaders.gl/images: ImageLoader requires browser ImageBitmap support. Use a browser with createImageBitmap support or load images under Node.js with @loaders.gl/core/polyfills."});var sI={};J(sI,{ImageLoaderWithParser:()=>WD});var jY,zD,WD,iI=p(()=>{"use strict";nI();sg();({preload:jY,...zD}=Hc),WD={...zD,parse:ng,parseBlob:tI}});async function qD(){let{ImageLoaderWithParser:r}=await Promise.resolve().then(()=>(iI(),sI));return r}var $D,Hc,sg=p(()=>{"use strict";tg();zv();$D={image:{}};Hc={dataType:null,batchType:null,...Gv,version:Zf,options:$D,preload:qD}});function aI(r){let e=JD(r);if(!e)throw new Error("Not an image");return e}function Jc(r){switch(aI(r)){case"data":return r;case"imagebitmap":return KD(r)?XD(r):oI(r);case"image":return oI(r);default:throw new Error("getImageData")}}function KD(r){let e=globalThis.loaders?.isImageBitmapNode;return!!e?.(r)}function XD(r){let e=globalThis.loaders?.getImageBitmapDataNode;if(!e)throw new Error("getImageData");return e(r)}function oI(r){let e=HD(r.width,r.height),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=r.width,e.height=r.height,t.drawImage(r,0,0),t.getImageData(0,0,r.width,r.height)}function HD(r,e){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(r,e);if(typeof document<"u"){let t=document.createElement("canvas");return t.width=r,t.height=e,t}throw new Error("getImageData")}function JD(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&r instanceof Image?"image":r&&typeof r=="object"&&r.data&&r.width&&r.height?"data":null}var cI=p(()=>{"use strict"});async function og(){return td?await td:(td=QD(),await td)}async function QD(){let r=new Set;for(let e of YD)(Gn?await tR(e):uI(e))&&r.add(e);return r}function ag(r){if(ig[r]===void 0){let e=Gn?ZD(r):uI(r);ig[r]=e}return ig[r]}function uI(r){let e=["image/png","image/jpeg","image/gif"],t=globalThis.loaders?.imageFormatsNode||e;return!!globalThis.loaders?.parseImageNode&&t.includes(r)}function ZD(r){switch(r){case"image/avif":case"image/webp":return rR(r);default:return!0}}async function tR(r){let e=eR[r];return e?await nR(e):!0}function rR(r){try{return document.createElement("canvas").toDataURL(r).indexOf(`data:${r}`)===0}catch{return!1}}async function nR(r){return new Promise(e=>{let t=new Image;t.src=r,t.onload=()=>e(t.height>0),t.onerror=()=>e(!1)})}var YD,td,ig,eR,cg=p(()=>{"use strict";Ue();YD=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/tiff","image/svg","image/svg+xml","image/bmp","image/vnd.microsoft.icon"],td=null;ig={};eR={"image/avif":"data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=","image/webp":"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"}});var lI,fI=p(()=>{"use strict";lI={name:"Basis",id:"basis",module:"images",encoding:"image",format:"basis",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],binary:!0,tests:["sB"]}});function hI(r){if(!rd){r=r||iR()||void 0,rd=new Set;for(let e of sR)for(let t in dI)if(r&&r.getExtension(`${e}${t}`))for(let n of dI[t])rd.add(n)}return rd}function iR(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var sR,dI,rd,pI=p(()=>{"use strict";sR=["","WEBKIT_","MOZ_"],dI={WEBGL_compressed_texture_s3tc:["bc1-rgb-unorm-webgl","bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"],WEBGL_compressed_texture_s3tc_srgb:["bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"],EXT_texture_compression_rgtc:["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"],EXT_texture_compression_bptc:["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"],WEBGL_compressed_texture_etc1:["etc1-rgb-unorm-webgl"],WEBGL_compressed_texture_etc:["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"],WEBGL_compressed_texture_pvrtc:["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"],WEBGL_compressed_texture_atc:["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"],WEBGL_compressed_texture_astc:["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]},rd=null});function bI(r=hI(),e,t={}){let n=new Set(r);if(!e)return aR(n);if(e.isHDR){let s=mI(e);return t.astcHDR&&(s==="astc-4x4"||s==="astc-6x6")&&nd(n,s.slice(5))?s==="astc-4x4"?"astc-hdr-4x4":"astc-hdr-6x6":n.has("bc6h-rgb-ufloat")?"bc6h":"rgba16f"}if(e.codec==="xubc7")return lg(n)?"bc7":"rgba32";if(e.codec.startsWith("xuastc-ldr-")||e.codec.startsWith("astc-ldr-")){let s=mI(e);return s&&nd(n,s.slice(5))?s:ug(n,e,["bc7","bc","etc2","atc"])}return e.codec==="uastc-ldr-4x4"?nd(n,"4x4")?"astc-4x4":ug(n,e,["bc7","bc","etc2","etc1","pvrtc","atc"]):ug(n,e,["etc2","etc1","bc7","bc","pvrtc","atc"])}function aR(r){return nd(r,"4x4")?"astc-4x4":lg(r)?"bc7":gI(r)?{alpha:"bc3",noAlpha:"bc1"}:yI(r)?"etc2":r.has("etc1-rgb-unorm-webgl")?{alpha:"rgba32",noAlpha:"etc1"}:wI(r)?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:xI(r)?{alpha:"atc-rgba-interpolated-alpha",noAlpha:"atc-rgb"}:{alpha:"rgba32",noAlpha:"rgb565"}}function ug(r,e,t){for(let n of t)switch(n){case"bc7":if(lg(r))return"bc7";break;case"bc":if(gI(r))return e.hasAlpha?"bc3":"bc1";break;case"etc2":if(yI(r))return"etc2";break;case"etc1":if(!e.hasAlpha&&r.has("etc1-rgb-unorm-webgl"))return"etc1";break;case"pvrtc":if(wI(r))return e.hasAlpha?"pvrtc1-4-rgba":"pvrtc1-4-rgb";break;case"atc":if(xI(r))return e.hasAlpha?"atc-rgba-interpolated-alpha":"atc-rgb";break;default:break}return e.hasAlpha?"rgba32":"rgb565"}function mI(r){let e=`${r.blockWidth}x${r.blockHeight}`;return oR.includes(e)?`astc-${e}`:null}function nd(r,e){return ha(r,[`astc-${e}-unorm`,`astc-${e}-unorm-srgb`])}function lg(r){return ha(r,["bc7-rgba-unorm","bc7-rgba-unorm-srgb"])}function gI(r){return ha(r,["bc1-rgb-unorm-webgl","bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb"])}function yI(r){return ha(r,["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb"])}function wI(r){return ha(r,["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"])}function xI(r){return ha(r,["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"])}function ha(r,e){return e.some(t=>r.has(t))}var oR,TI=p(()=>{"use strict";pI();oR=["4x4","5x4","5x5","6x5","6x6","8x5","8x6","8x8","10x5","10x6","10x8","10x10","12x10","12x12"]});async function vI(r){xm(r.modules);let e=Tm("basis");return e||(AI||=cR(r),await AI)}async function cR(r){let e=null,t=null;return[e,t]=await Promise.all([await ia(_I.TRANSCODER,"images",r,null,"basis_transcoder.mjs"),await ia(_I.TRANSCODER_WASM,"images",r)]),e=e||globalThis.BASIS,await uR(e,t)}function uR(r,e){let t={};return e&&(t.wasmBinary=e),Ji(()=>r(t),n=>{let{BasisFile:s,KTX2File:i,getBasisTexFormatBlockHeight:o,getBasisTexFormatBlockWidth:a,initializeBasis:c,isFormatSupported:u}=n;return c(),{BasisFile:s,KTX2File:i,getBasisTexFormatBlockHeight:o,getBasisTexFormatBlockWidth:a,isFormatSupported:u}})}var _I,AI,II=p(()=>{"use strict";Ue();Js();_I={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"}});function SI(r){if(r.byteLength<fg.byteLength)return!1;let e=new Uint8Array(r,0,fg.byteLength);return fg.every((t,n)=>e[n]===t)}var fg,EI=p(()=>{"use strict";fg=new Uint8Array([171,75,84,88,32,50,48,187,13,10,26,10])});async function hR(r){let e=LI,t;LI=new Promise(n=>{t=n}),await e;try{return await r()}finally{t()}}async function FI(r,e={}){return await hR(async()=>{let t=await vI(hn(e)),n=e.basis?.containerFormat||"auto";if(n==="ktx2"||n==="auto"&&SI(r)){if(!t.KTX2File)throw new Error("The injected Basis transcoder module does not provide KTX2File");return mR(t,r,e)}return pR(t,r,e)})}function pR(r,e,t){let n=new r.BasisFile(new Uint8Array(e));try{let s=MI(n,!1);if(!n.startTranscoding())throw new Error("Failed to start Basis transcoding");let i=[];for(let o=0;o<n.getNumImages();o++){let a=[];for(let c=0;c<n.getNumLevels(o);c++){let u=n.getImageWidth(o,c),l=n.getImageHeight(o,c);a.push(OI(n,s,u,l,t,f=>n.getImageTranscodedSizeInBytes(o,c,f),(f,d)=>n.transcodeImage(f,o,c,d,0,0)))}i.push(a)}return i}finally{n.close(),n.delete()}}function mR(r,e,t){let n=new r.KTX2File(new Uint8Array(e));try{if(!n.isValid())throw new Error("Invalid KTX2 texture");if(n.getHeader().pixelDepth>0)throw new Error("BasisLoader does not support 3D KTX2 textures");let i=MI(n,!0);if(!n.startTranscoding())throw new Error("Failed to start KTX2 transcoding");let o=Math.max(1,n.getLayers()),a=Math.max(1,n.getFaces()),c=[];for(let u=0;u<o;u++)for(let l=0;l<a;l++){let f=[];for(let d=0;d<n.getLevels();d++){let h=n.getImageLevelInfo(d,u,l);f.push(OI(n,{...i,hasAlpha:!!h.alphaFlag},h.width,h.height,t,m=>n.getImageTranscodedSizeInBytes(d,u,l,m),(m,b)=>n.transcodeImage(m,d,u,l,b,0,-1,-1)))}c.push(f)}return c}finally{n.close(),n.delete()}}function OI(r,e,t,n,s,i,o){let a=gR(s,e);bR(e,dg(s,e));let c=i(a.basisFormat),u=wR(c,a.dataType);if(!o(u,a.basisFormat))throw new Error(`Failed to transcode Basis texture to ${dg(s,e)}`);let l=e.isSRGB&&a.srgbTextureFormat;return{shape:"texture-level",width:t,height:n,data:u,compressed:a.compressed,format:l&&a.srgbFormat||a.format,textureFormat:l?a.srgbTextureFormat:a.textureFormat,levelSize:c,hasAlpha:e.hasAlpha}}function bR(r,e){let t=e==="bc6h"||e==="rgba16f"||e==="rgb9e5"||e.startsWith("astc-hdr-");if(r.isHDR!==t)throw new Error(`Basis source codec ${r.codec} cannot be transcoded to ${e}`);if(r.codec==="xubc7"&&e!=="bc7"&&e!=="rgba32")throw new Error(`Basis source codec ${r.codec} cannot be transcoded to ${e}`)}function gR(r,e){let t=dg(r,e),n=BI[t];if(!n)throw new Error(`Unknown Basis format ${t}`);return n}function dg(r,e){let t=r.basis?.format||"auto";return t==="auto"&&(t=bI(r.basis?.supportedTextureFormats,e,r.basis?.supportedTextureFeatures)),typeof t=="object"&&(t=e.hasAlpha?t.alpha:t.noAlpha),t.toLowerCase()}function MI(r,e){let t=r.getBasisTexFormat(),n=yR[t];if(!n)throw new Error(`Unsupported Basis source texture format ${t}`);return{codec:n,isHDR:!!r.isHDR(),isSRGB:e?!!r.isSRGB():!1,hasAlpha:!!r.getHasAlpha(),blockWidth:r.getBlockWidth(),blockHeight:r.getBlockHeight()}}function wR(r,e){return e==="uint16"?new Uint16Array(r/Uint16Array.BYTES_PER_ELEMENT):e==="uint32"?new Uint32Array(r/Uint32Array.BYTES_PER_ELEMENT):new Uint8Array(r)}function it(r,e,t){return{basisFormat:r,compressed:!0,format:e,textureFormat:t}}function pa(r,e,t,n,s){return{basisFormat:r,compressed:!1,format:e,textureFormat:t,srgbFormat:n,srgbTextureFormat:s}}function $t(r,e,t,n){return{...it(r,e,`astc-${n}-unorm`),srgbFormat:t,srgbTextureFormat:`astc-${n}-unorm-srgb`}}var Wt,BI,tZ,LI,yR,DI=p(()=>{"use strict";Js();TI();II();EI();Wt={"4x4":$t(10,37808,37840,"4x4"),"5x4":$t(28,37809,37841,"5x4"),"5x5":$t(29,37810,37842,"5x5"),"6x5":$t(30,37811,37843,"6x5"),"6x6":$t(31,37812,37844,"6x6"),"8x5":$t(32,37813,37845,"8x5"),"8x6":$t(33,37814,37846,"8x6"),"8x8":$t(36,37815,37847,"8x8"),"10x5":$t(34,37816,37848,"10x5"),"10x6":$t(35,37817,37849,"10x6"),"10x8":$t(37,37818,37850,"10x8"),"10x10":$t(38,37819,37851,"10x10"),"12x10":$t(39,37820,37852,"12x10"),"12x12":$t(40,37821,37853,"12x12")},BI={etc1:it(0,36196,"etc1-rgb-unorm-webgl"),etc2:{...it(1,37493,"etc2-rgba8unorm"),srgbFormat:37495,srgbTextureFormat:"etc2-rgba8unorm-srgb"},bc1:{...it(2,33776,"bc1-rgb-unorm-webgl"),srgbFormat:35916,srgbTextureFormat:"bc1-rgb-unorm-srgb-webgl"},bc3:{...it(3,33779,"bc3-rgba-unorm"),srgbFormat:35919,srgbTextureFormat:"bc3-rgba-unorm-srgb"},bc4:it(4,36283,"bc4-r-unorm"),bc5:it(5,36285,"bc5-rg-unorm"),bc7:{...it(6,36492,"bc7-rgba-unorm"),srgbFormat:36493,srgbTextureFormat:"bc7-rgba-unorm-srgb"},"pvrtc1-4-rgb":it(8,35840,"pvrtc-rgb4unorm-webgl"),"pvrtc1-4-rgba":it(9,35842,"pvrtc-rgba4unorm-webgl"),"astc-4x4":Wt["4x4"],"astc-5x4":Wt["5x4"],"astc-5x5":Wt["5x5"],"astc-6x5":Wt["6x5"],"astc-6x6":Wt["6x6"],"astc-8x5":Wt["8x5"],"astc-8x6":Wt["8x6"],"astc-8x8":Wt["8x8"],"astc-10x5":Wt["10x5"],"astc-10x6":Wt["10x6"],"astc-10x8":Wt["10x8"],"astc-10x10":Wt["10x10"],"astc-12x10":Wt["12x10"],"astc-12x12":Wt["12x12"],"atc-rgb":it(11,35986,"atc-rgb-unorm-webgl"),"atc-rgba-interpolated-alpha":it(12,34798,"atc-rgbai-unorm-webgl"),rgba32:pa(13,32856,"rgba8unorm",35907,"rgba8unorm-srgb"),rgb565:pa(14,36194,"rgb565unorm-webgl"),bgr565:pa(15,36194,"rgb565unorm-webgl"),rgba4444:pa(16,32854,"rgba4unorm-webgl"),"eac-r11":it(20,37488,"eac-r11unorm"),"eac-rg11":it(21,37490,"eac-rg11unorm"),bc6h:it(22,36495,"bc6h-rgb-ufloat"),"astc-hdr-4x4":it(23,37808,"astc-4x4-unorm"),rgba16f:{...pa(25,34842,"rgba16float"),dataType:"uint16"},rgb9e5:{...pa(26,35901,"rgb9e5ufloat"),dataType:"uint32"},"astc-hdr-6x6":it(27,37812,"astc-6x6-unorm")},tZ=Object.freeze(Object.keys(BI)),LI=Promise.resolve();yR={0:"etc1s",1:"uastc-ldr-4x4",2:"uastc-hdr-4x4",3:"astc-hdr-6x6",4:"uastc-hdr-6x6",5:"xuastc-ldr-4x4",6:"xuastc-ldr-5x4",7:"xuastc-ldr-5x5",8:"xuastc-ldr-6x5",9:"xuastc-ldr-6x6",10:"xuastc-ldr-8x5",11:"xuastc-ldr-8x6",12:"xuastc-ldr-10x5",13:"xuastc-ldr-10x6",14:"xuastc-ldr-8x8",15:"xuastc-ldr-10x8",16:"xuastc-ldr-10x10",17:"xuastc-ldr-12x10",18:"xuastc-ldr-12x12",19:"astc-ldr-4x4",20:"astc-ldr-5x4",21:"astc-ldr-5x5",22:"astc-ldr-6x5",23:"astc-ldr-6x6",24:"astc-ldr-8x5",25:"astc-ldr-8x6",26:"astc-ldr-10x5",27:"astc-ldr-10x6",28:"astc-ldr-8x8",29:"astc-ldr-10x8",30:"astc-ldr-10x10",31:"astc-ldr-12x10",32:"astc-ldr-12x12",33:"xubc7"}});var RI={};J(RI,{BasisLoaderWithParser:()=>AR,BasisWorkerLoaderWithParser:()=>_R});var oZ,xR,aZ,TR,_R,AR,kI=p(()=>{"use strict";DI();sd();sd();({preload:oZ,...xR}=io),{preload:aZ,...TR}=io,_R={...xR},AR={...TR,parse:FI}});async function vR(){let{BasisLoaderWithParser:r}=await Promise.resolve().then(()=>(kI(),RI));return r}var io,sd=p(()=>{"use strict";fI();tg();io={...lI,dataType:null,batchType:null,name:"Basis",id:"basis",module:"images",version:Zf,worker:!0,workerNode:"basis-worker-node.cjs",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",containerFormat:"auto"}},preload:vR}});var qn=p(()=>{"use strict";sg();Qf();cI();cg();cg();sd()});function H(r,e){if(!r)throw new Error(e||"assert failed: gltf")}var oo=p(()=>{"use strict"});function FR(r,e=0){return`${String.fromCharCode(r.getUint8(e+0))}${String.fromCharCode(r.getUint8(e+1))}${String.fromCharCode(r.getUint8(e+2))}${String.fromCharCode(r.getUint8(e+3))}`}function PI(r,e=0,t={}){let n=new DataView(r),{magic:s=NI}=t,i=n.getUint32(e,!1);return i===s||i===NI}function ad(r,e,t=0,n={}){let s=new DataView(e),i=FR(s,t+0),o=s.getUint32(t+4,ti),a=o===3?jI(s,t+8,"GLB byte length"):s.getUint32(t+8,ti);switch(Object.assign(r,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:i,version:o,json:{},jsonChunkIndex:-1,binChunks:[]}),r.version){case 1:return OR(r,s,t+id);case 2:return MR(r,s,t+id,n);case 3:return DR(r,s,t+UI,n);default:throw new Error(`Invalid GLB version ${r.version}. Only supports versions 1, 2 and 3.`)}}function OR(r,e,t){fr(r.header.byteLength>id+od);let n=r.header.byteOffset+r.header.byteLength;fr(n<=e.byteLength);let s=e.getUint32(t+0,ti),i=e.getUint32(t+4,ti);if(t+=od,fr(i===ER),t+s>n)throw new Error("GLB JSON content extends beyond the declared file length.");hg(r,e,t,s,0),t+=s;let o=n-t;return o>0&&pg(r,e,t,o,1),n}function MR(r,e,t,n){return fr(r.header.byteLength>id+od),VI(r,e,t,od,n),r.header.byteOffset+r.header.byteLength}function DR(r,e,t,n){return fr(r.header.byteLength>=UI+CI),VI(r,e,t,CI,n),r.header.byteOffset+r.header.byteLength}function VI(r,e,t,n,s){let i=r.header.byteOffset+r.header.byteLength;fr(i<=e.byteLength);let o=0;for(;t+n<=i;){let a=r.version===3,c=e.getUint32(t+(a?0:4),ti),u=a?e.getUint32(t+4,ti):0,l=a?jI(e,t+8,"GLB chunk length"):e.getUint32(t+0,ti);if(t+=n,u!==0)throw new Error(`Unsupported GLB chunk encoding ${u}.`);if(t+l>i)throw new Error("GLB chunk extends beyond the declared file length.");switch(c){case IR:(r.version!==3||r.jsonChunkIndex===-1)&&hg(r,e,t,l,o);break;case SR:pg(r,e,t,l,o);break;case LR:s.strict||hg(r,e,t,l,o);break;case BR:s.strict||pg(r,e,t,l,o);break;default:break}t+=mg(l),o++}return t}function hg(r,e,t,n,s){let i=new Uint8Array(e.buffer,t,n),a=new TextDecoder("utf8").decode(i);return r.json=JSON.parse(a),r.jsonChunkIndex=s,mg(n)}function pg(r,e,t,n,s){return r.header.hasBinChunk=!0,r.binChunks.push({chunkIndex:s,byteOffset:t,byteLength:n,arrayBuffer:e.buffer}),mg(n)}function jI(r,e,t){let n=r.getBigUint64(e,ti);if(n>BigInt(Number.MAX_SAFE_INTEGER))throw new Error(`${t} exceeds JavaScript's safe integer range.`);return Number(n)}function mg(r){return Math.ceil(r/4)*4}var ti,NI,id,UI,od,CI,IR,SR,ER,LR,BR,bg=p(()=>{"use strict";Ue();ti=!0,NI=1735152710,id=12,UI=16,od=8,CI=16,IR=1313821514,SR=5130562,ER=0,LR=0,BR=1});function Kn(r,e,t){if(r.startsWith("data:")||r.startsWith("http:")||r.startsWith("https:"))return cd(r);let s=t?.baseUrl||RR(e?.core?.baseUrl);if(!s)throw new Error(`'baseUrl' must be provided to resolve relative url ${r}`);let i=s.endsWith("/")?`${s}${r}`:`${s}/${r}`;return cd(i)}function cd(r){try{return new URL(r).href}catch{return r}}function RR(r){if(!r)return;if(r.endsWith("/"))return r;let e=r.lastIndexOf("/");return e>=0?r.slice(0,e+1):""}var Yc=p(()=>{"use strict"});var ud,Qc,gg=p(()=>{"use strict";ud={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Qc={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8}});function ma(r){return GI[r-1]||GI[0]}function Xn(r){let e=NR.get(r.constructor);if(!e)throw new Error("Illegal typed array");return e}function Zc(r,e){let t=PR[r.componentType],n=CR[r.type],s=UR[r.componentType],i=r.count*n,o=r.count*n*s;H(o>=0&&o<=e.byteLength);let a=Qc[r.componentType],c=ud[r.type];return{ArrayType:t,length:i,byteLength:o,componentByteSize:a,numberOfComponentsInElement:c}}var GI,kR,NR,CR,UR,PR,ri=p(()=>{"use strict";oo();gg();GI=["SCALAR","VEC2","VEC3","VEC4"],kR=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Int32Array,5124],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130],[BigInt64Array,5134],[BigUint64Array,5135]],NR=new Map(kR),CR={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},UR={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8},PR={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5124:Int32Array,5125:Uint32Array,5126:Float32Array,5130:Float64Array,5131:Uint16Array,5134:BigInt64Array,5135:BigUint64Array}});function hr(r,e,t){let n=typeof t=="number"?r.bufferViews[t]:t;H(n);let s=n.buffer,i=e[s];H(i),H((n.byteOffset||0)>=0&&n.byteLength>=0),H((n.byteOffset||0)+n.byteLength<=i.byteLength),H(i.byteOffset>=0&&i.byteOffset+i.byteLength<=i.arrayBuffer.byteLength);let o=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,n.byteLength)}function zI(r,e,t){let n=r.images[t];return hr(r,e,n.bufferView)}function ld(r,e,t){let n=typeof t=="number"?r.accessors?.[t]:t;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(t)}`);H(Number.isSafeInteger(n.count)&&n.count>=0);let{ArrayType:s,length:i,numberOfComponentsInElement:o}=Zc(n,{byteLength:1/0}),a=n.value,c;ArrayBuffer.isView(a)?(H(a.length===i),c=a):n.bufferView===void 0?c=new s(i):c=yg(r,e,n);let u=n.sparse;if(!u)return c;let l=new s(i);new Uint8Array(l.buffer).set(new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),H(u.count>=0&&u.count<=n.count),H([5121,5123,5125].includes(u.indices.componentType));let f=yg(r,e,{bufferView:u.indices.bufferView,byteOffset:u.indices.byteOffset,componentType:u.indices.componentType,count:u.count,type:"SCALAR"}),d=yg(r,e,{bufferView:u.values.bufferView,byteOffset:u.values.byteOffset,componentType:n.componentType,count:u.count,type:n.type}),h=-1,m=new Uint8Array(l.buffer),b=o*s.BYTES_PER_ELEMENT,g=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);for(let y=0;y<u.count;y++){let x=Number(f[y]);H(x>h&&x<n.count),m.set(g.subarray(y*b,(y+1)*b),x*b),h=x}return l}function yg(r,e,t){let n=r.bufferViews?.[t.bufferView];if(!n)throw new Error(`No gltf buffer view for accessor ${n}`);let s=e[n.buffer];H(s);let{arrayBuffer:i,byteOffset:o}=s;H((n.byteOffset||0)>=0&&n.byteLength>=0),H((n.byteOffset||0)+n.byteLength<=s.byteLength),H(o>=0&&o+s.byteLength<=i.byteLength),H((t.byteOffset||0)>=0);let a=(o||0)+(t.byteOffset||0)+(n.byteOffset||0),{ArrayType:c,length:u,componentByteSize:l,numberOfComponentsInElement:f}=Zc(t,n),d=l*f,h=t.type.startsWith("MAT")?Number(t.type.slice(3)):1,m=_e(h*l,4),b=h>1?h*m:d,g=n.byteStride??b,y=h>1?(h-1)*m+h*l:d;if(H(g>=b),H((t.byteOffset||0)+(t.count===0?0:(t.count-1)*g+y)<=n.byteLength),t.count===0)return new c(0);if(h>1&&m!==h*l){let _=n.byteStride??h*m,v=(h-1)*m+h*l;H((t.byteOffset||0)+(t.count-1)*_+v<=n.byteLength);let I=new c(u),N=new Uint8Array(I.buffer,I.byteOffset,I.byteLength);for(let K=0;K<t.count;K++)for(let ne=0;ne<h;ne++){let be=new Uint8Array(i,a+K*_+ne*m,h*l);N.set(be,K*d+ne*h*l)}return I}let x=n.byteStride||d;if(typeof n.byteStride>"u"||n.byteStride===d){if(a%l!==0){let v=new Uint8Array(i,a,u*l),I=new Uint8Array(v.byteLength);return I.set(v),new c(I.buffer,0,u)}return new c(i,a,u)}let T=new c(u);for(let _=0;_<t.count;_++){let v=a+_*x,I;if(v%l!==0){let N=new Uint8Array(i,v,d),K=new Uint8Array(d);K.set(N),I=new c(K.buffer,0,f)}else I=new c(i,v,f);T.set(I,_*f)}return T}var ao=p(()=>{"use strict";oo();Ue();ri()});function wg(r,e){let t=r.json.files||[],n=[];for(let s=0;s<t.length;s++){let i=t[s];(i.name===e||i.uri===e)&&n.push(s)}return H(n.length<=1,`glTF package file reference ${e} is ambiguous.`),n[0]??-1}async function fd(r,e,t,n){let s=r.json.files||[],i=typeof e=="number"?e:wg(r,e);H(Number.isInteger(i)&&i>=0&&i<s.length),r.files=r.files||new Array(s.length).fill(null);let o=r.files[i];if(o)return o;let a=s[i];H(a.mimeType,`glTF file ${i} must define mimeType.`);let c=a.uri!==void 0,u=a.bufferView!==void 0;H(c!==u,`glTF file ${i} must define exactly one of uri or bufferView.`);let l;if(a.uri!==void 0){let f=Kn(a.uri,t,n),d=await n.fetch(f);H(d?.ok,`Failed to fetch glTF file ${a.uri}: HTTP ${d?.status}.`);let h=await d.arrayBuffer();l={arrayBuffer:h,byteOffset:0,byteLength:h.byteLength,mimeType:a.mimeType,name:a.name,url:f}}else{let f=hr(r.json,r.buffers,a.bufferView);l={arrayBuffer:f.buffer,byteOffset:f.byteOffset,byteLength:f.byteLength,mimeType:a.mimeType,name:a.name}}return r.files[i]=l,l}var WI=p(()=>{"use strict";ao();Yc();oo()});var xg={};J(xg,{name:()=>co,preprocess:()=>VR});function VR(r){let{json:e}=r;if(!(!e.extensionsUsed?.includes(co)&&!e.extensionsRequired?.includes(co))){if(!e.extensionsUsed?.includes(co)||!e.extensionsRequired?.includes(co))throw new Error(`${co}: must be declared in extensionsUsed and extensionsRequired.`);for(let[t,n]of(e.accessors||[]).entries())if(n.componentType===5130&&n.normalized)throw new Error(`${co}: accessor ${t} must not be normalized.`)}}var co,$I=p(()=>{"use strict";co="KHR_accessor_float64"});function jR(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var bn,eu=p(()=>{"use strict";qn();Ue();oo();ri();ao();bn=class{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||jR(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=_e(this.gltf.buffers[0].byteLength,4),this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.getRequiredExtensions().find(s=>s===e);return typeof t=="string"||typeof n=="string"}getExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.json.extensions||{};return t?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if(typeof t=="object")return t;let n=this.json[e]&&this.json[e][t];if(!n)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return n}getTypedArrayForBufferView(e){return hr(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return ld(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForImageData(e){e=this.getAccessor(e);let t=this.getBufferView(e.bufferView),s=this.getBuffer(t.buffer).data,i=t.byteOffset||0;return new Uint8Array(s,i,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,n){return e.extensions=e.extensions||{},e.extensions[t]=n,this.registerUsedExtension(t),this}setObjectExtension(e,t,n){let s=e.extensions||{};s[t]=n}removeObjectExtension(e,t){let n=e?.extensions||{};if(n[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let s=this.json.extensionsRemoved;s.includes(t)||s.push(t)}delete n[t]}addExtension(e,t={}){return H(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return H(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){let{meshIndex:t,matrix:n}=e;this.json.nodes=this.json.nodes||[];let s={mesh:t};return n&&(s.matrix=n),this.json.nodes.push(s),this.json.nodes.length-1}addMesh(e){let{attributes:t,indices:n,material:s,mode:i=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(n){let c=this._addIndices(n);a.primitives[0].indices=c}return Number.isFinite(s)&&(a.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,t){let n=$n(e),s=t||n?.mimeType,o={bufferView:this.addBufferView(e),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e,t=0,n=this.byteLength){let s=e.byteLength;H(Number.isFinite(s)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let i={buffer:t,byteOffset:n,byteLength:s};return this.byteLength+=_e(s,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){let n=t.normalized,s={bufferView:e,...n===void 0?{}:{normalized:n},type:ma(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(s),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){let n=this.addBufferView(e),s={min:t.min,max:t.max};(!s.min||!s.max)&&(s=this._getAccessorMinMax(e,t.size));let i={size:t.size,componentType:Xn(e),count:Math.round(e.length/t.size),min:s.min,max:s.max};return this.addAccessor(n,Object.assign(i,t))}addTexture(e){let{imageIndex:t,samplerIndex:n}=e,s={source:t,...n===void 0?{}:{sampler:n}};return this.json.textures=this.json.textures||[],this.json.textures.push(s),this.json.textures.length-1}addSampler(e){return this.json.samplers=this.json.samplers||[],this.json.samplers.push({...e}),this.json.samplers.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){if(this.byteLength===0&&!this.json.buffers?.length){delete this.json.buffers,delete this.gltf.binary,this.sourceBuffers=[],this.gltf.buffers=[];return}let e=[0],t=this.byteLength;for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&(e[o]=_e(t,8),t=e[o]+_e(a.byteLength,4))}let n=new ArrayBuffer(t),s=new Uint8Array(n),i=0;for(let o of this.sourceBuffers||[])i=to(o,s,i);for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&to(a,s,e[o])}for(let o of this.json.bufferViews||[]){let a=e[o.buffer];H(a!==void 0),o.byteOffset=a+(o.byteOffset||0),o.buffer=0;for(let c of["EXT_meshopt_compression","KHR_meshopt_compression"]){let u=o.extensions?.[c];if(u){let l=e[u.buffer];H(l!==void 0),u.byteOffset=l+(u.byteOffset||0),u.buffer=0}}}this.byteLength=t,this.json.buffers=[{byteLength:t}],this.gltf.binary=n,this.sourceBuffers=[n],this.gltf.buffers=[{arrayBuffer:n,byteOffset:0,byteLength:n.byteLength}]}_removeStringFromArray(e,t){let n=!0;for(;n;){let s=e.indexOf(t);s>-1?e.splice(s,1):n=!1}}_addAttributes(e={}){let t={};for(let n in e){let s=e[n],i=this._getGltfAttributeName(n),o=s.value,a=o.BYTES_PER_ELEMENT*s.size,c=_e(a,4),u;if(c===a)u=this.addBinaryBuffer(o,s);else{let l=o.length/s.size,f=new Uint8Array(l*c),d=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);for(let m=0;m<l;m++)f.set(d.subarray(m*a,(m+1)*a),m*c);let h=this.addBufferView(f);this.json.bufferViews[h].byteStride=c,u=this.addAccessor(h,{...this._getAccessorMinMax(o,s.size),...s,componentType:Xn(o),count:l})}t[i]=u}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){let n={min:null,max:null};if(e.length<t)return n;n.min=[],n.max=[];let s=e.subarray(0,t);for(let i of s)n.min.push(i),n.max.push(i);for(let i=t;i<e.length;i+=t)for(let o=0;o<t;o++)n.min[0+o]=Math.min(n.min[0+o],e[i+o]),n.max[0+o]=Math.max(n.max[0+o],e[i+o]);return n}}});function GR(r){switch(r.type){case"accessor":return{get bufferView(){return r.bufferView?.data}};case"animation":return{get channels(){return uo(r.channels)},get samplers(){return uo(r.samplers)}};case"animationChannel":return{get sampler(){return r.sampler.data},get target(){return r.target.data}};case"animationChannelTarget":return{get node(){return r.node?.data}};case"animationSampler":return{get input(){return r.input.data},get output(){return r.output.data}};case"bufferView":return{get buffer(){return r.buffer.data}};case"externalAsset":return{get file(){return r.file.data}};case"file":case"image":return{get bufferView(){return r.bufferView?.data}};case"material":return{get baseColorTexture(){return r.baseColorTexture?.data},get metallicRoughnessTexture(){return r.metallicRoughnessTexture?.data},get normalTexture(){return r.normalTexture?.data},get occlusionTexture(){return r.occlusionTexture?.data},get emissiveTexture(){return r.emissiveTexture?.data},get textures(){return uo(r.textures)}};case"textureInfo":return{get texture(){return r.texture.data}};case"mesh":return{get primitives(){return uo(r.primitives)}};case"primitive":return{get attributes(){return qI(r.attributes)},get indices(){return r.indices?.data},get material(){return r.material?.data},get targets(){return r.targets.map(qI)}};case"node":return{get camera(){return r.camera?.data},get children(){return uo(r.children)},get skin(){return r.skin?.data},get mesh(){return r.mesh?.data},get externalAsset(){return r.externalAsset?.data}};case"scene":return{get nodes(){return uo(r.nodes)}};case"skin":return{get inverseBindMatrices(){return r.inverseBindMatrices?.data},get skeleton(){return r.skeleton?.data},get joints(){return uo(r.joints)}};case"texture":return{get sampler(){return r.sampler?.data},get source(){return r.source?.data}};default:return{}}}function lo(r,e){return(function*(){for(let n=0;n<r.length;n++)yield e(r[n],n)})()}function uo(r){return(function*(){for(let t of r)yield t.data})()}function qI(r){return new Map(Array.from(r,([e,t])=>[e,t.data]))}function zR(r){switch(r){case"bufferView":return"bufferViews";case"externalAsset":return"externalAssets";case"mesh":return"meshes";default:return`${r}s`}}function KI(r,e){if(r)for(let t=r.length-1;t>=0;t--)r[t]===e&&r.splice(t,1)}var Je,ni,Tg,_g,Ag,vg,dd,Ig,Sg,Eg,Lg,Bg,Fg,Og,Mg,Dg,Rg,kg,Ng,Cg,Ug,Pg,ie,He=p(()=>{"use strict";ao();ri();Je=class{gltf;type;index;data;path;iterator;constructor(e,t,n,s,i){this.iterator=e,this.gltf=e.gltf,this.type=t,this.index=n,this.data=s,this.path=i}},ni=class extends Je{parent;constructor(e,t,n,s,i,o){super(e,t,n,s,i),this.parent=o}},Tg=class extends Je{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}},_g=class extends Je{get channels(){return lo(this.data.channels,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Ag(this.iterator,"animationChannel",t,e,`${this.path}.channels[${t}]`,this)))}get samplers(){return lo(this.data.samplers,(e,t)=>this.iterator.getOrCreateNested(e,()=>new dd(this.iterator,"animationSampler",t,e,`${this.path}.samplers[${t}]`,this)))}},Ag=class extends ni{get sampler(){let t=this.parent.data.samplers[this.data.sampler];if(!t)throw new Error(`Invalid glTF reference at ${this.path}.sampler: animation sampler index ${this.data.sampler} is out of range`);return this.iterator.getOrCreateNested(t,()=>new dd(this.iterator,"animationSampler",this.data.sampler,t,`${this.parent.path}.samplers[${this.data.sampler}]`,this.parent))}get target(){return this.iterator.getOrCreateNested(this.data.target,()=>new vg(this.iterator,"animationChannelTarget",0,this.data.target,`${this.path}.target`,this))}},vg=class extends ni{get node(){return this.data.node===void 0?void 0:this.iterator.resolveNode(this.data.node,`${this.path}.node`)}},dd=class extends ni{get input(){return this.iterator.resolveAccessor(this.data.input,`${this.path}.input`)}get output(){return this.iterator.resolveAccessor(this.data.output,`${this.path}.output`)}},Ig=class extends Je{get loadedBuffer(){return this.gltf.buffers[this.index]}},Sg=class extends Je{get buffer(){return this.iterator.resolveBuffer(this.data.buffer,`${this.path}.buffer`)}get loadedBufferView(){let e=this.buffer.loadedBuffer;if(!e)return;let t=e.byteOffset+(this.data.byteOffset||0);return new Uint8Array(e.arrayBuffer,t,this.data.byteLength)}},Eg=class extends Je{},Lg=class extends Je{get file(){return this.iterator.resolveFile(this.data.file,`${this.path}.file`)}get loadedAsset(){return this.gltf.externalAssets?.[this.index]}},Bg=class extends Je{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedFile(){return this.gltf.files?.[this.index]}},Fg=class extends Je{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedImage(){return this.gltf.images?.[this.index]}},Og=class extends Je{get baseColorTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.baseColorTexture,0,"pbrMetallicRoughness.baseColorTexture")}get metallicRoughnessTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.metallicRoughnessTexture,1,"pbrMetallicRoughness.metallicRoughnessTexture")}get normalTexture(){return this.getTextureInfo(this.data.normalTexture,2,"normalTexture")}get occlusionTexture(){return this.getTextureInfo(this.data.occlusionTexture,3,"occlusionTexture")}get emissiveTexture(){return this.getTextureInfo(this.data.emissiveTexture,4,"emissiveTexture")}get textures(){return[this.baseColorTexture,this.metallicRoughnessTexture,this.normalTexture,this.occlusionTexture,this.emissiveTexture].filter(t=>!!t).values()}getTextureInfo(e,t,n){return e?this.iterator.getOrCreateNested(e,()=>new Mg(this.iterator,"textureInfo",t,e,`${this.path}.${n}`,this)):void 0}},Mg=class extends ni{get texture(){return this.iterator.resolveTexture(this.data.index,`${this.path}.index`)}},Dg=class extends Je{get primitives(){return lo(this.data.primitives,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Rg(this.iterator,"primitive",t,e,`${this.path}.primitives[${t}]`,this)))}},Rg=class extends ni{get attributes(){return new Map(Object.entries(this.data.attributes).map(([e,t])=>[e,this.iterator.resolveAccessor(t,`${this.path}.attributes.${e}`)]))}get indices(){return this.data.indices===void 0?void 0:this.iterator.resolveAccessor(this.data.indices,`${this.path}.indices`)}get material(){return this.data.material===void 0?void 0:this.iterator.resolveMaterial(this.data.material,`${this.path}.material`)}get targets(){return(this.data.targets||[]).map((e,t)=>new Map(Object.entries(e).map(([n,s])=>[n,this.iterator.resolveAccessor(s,`${this.path}.targets[${t}].${n}`)])))}},kg=class extends Je{get camera(){return this.data.camera===void 0?void 0:this.iterator.resolveCamera(this.data.camera,`${this.path}.camera`)}get children(){return lo(this.data.children||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.children[${t}]`))}get skin(){return this.data.skin===void 0?void 0:this.iterator.resolveSkin(this.data.skin,`${this.path}.skin`)}get mesh(){return this.data.mesh===void 0?void 0:this.iterator.resolveMesh(this.data.mesh,`${this.path}.mesh`)}get externalAsset(){return this.data.externalAsset===void 0?void 0:this.iterator.resolveExternalAsset(this.data.externalAsset,`${this.path}.externalAsset`)}},Ng=class extends Je{},Cg=class extends Je{get nodes(){return lo(this.data.nodes||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.nodes[${t}]`))}},Ug=class extends Je{get inverseBindMatrices(){return this.data.inverseBindMatrices===void 0?void 0:this.iterator.resolveAccessor(this.data.inverseBindMatrices,`${this.path}.inverseBindMatrices`)}get skeleton(){return this.data.skeleton===void 0?void 0:this.iterator.resolveNode(this.data.skeleton,`${this.path}.skeleton`)}get joints(){return lo(this.data.joints,(e,t)=>this.iterator.resolveNode(e,`${this.path}.joints[${t}]`))}},Pg=class extends Je{get sampler(){return this.data.sampler===void 0?void 0:this.iterator.resolveSampler(this.data.sampler,`${this.path}.sampler`)}get source(){return this.data.source===void 0?void 0:this.iterator.resolveImage(this.data.source,`${this.path}.source`)}},ie=class{gltf;objectCache=new WeakMap;referencesCache=new WeakMap;constructor(e){this.gltf=e}get data(){return this.gltf.json}getTypedArrayForBufferView(e){return hr(this.data,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return ld(this.data,this.gltf.buffers,e)}getTypedArrayForImageData(e){return zI(this.data,this.gltf.buffers,e)}getLoadedBuffer(e){let t=this.getMetadata(e);return this.gltf.buffers[t.index]}getLoadedBufferView(e){let t=this.getReferences(e).buffer,n=this.getLoadedBuffer(t);if(!n)return;let s=n.byteOffset+(e.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,e.byteLength)}getLoadedImage(e){return this.gltf.images?.[this.getMetadata(e).index]}getLoadedFile(e){return this.gltf.files?.[this.getMetadata(e).index]}getLoadedExternalAsset(e){return this.gltf.externalAssets?.[this.getMetadata(e).index]}addBuffer(e){let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return this.gltf.buffers.push({arrayBuffer:t,byteOffset:0,byteLength:e.byteLength}),this.data.buffers||=[],this.data.buffers.push({byteLength:e.byteLength}),this.data.buffers.length-1}addBufferView(e,t,n=0){return this.data.bufferViews||=[],this.data.bufferViews.push({buffer:e,byteOffset:n,byteLength:t}),this.data.bufferViews.length-1}addAccessor(e,t){return this.data.accessors||=[],this.data.accessors.push({bufferView:e,type:ma(t.size),componentType:t.componentType,count:t.count,min:t.min,max:t.max}),this.data.accessors.length-1}getReferences(e){let t=this.referencesCache.get(e);if(t)return t;let n=this.getObjectIterator(e),s=GR(n);return this.referencesCache.set(e,s),s}getMetadata(e){let t=this.getObjectIterator(e),n=t instanceof ni?t.parent.data:void 0;return{gltf:this.gltf,type:t.type,index:t.index,parent:n,path:t.path}}get scene(){return this.data.scene===void 0?void 0:this.resolveScene(this.data.scene,"scene").data}get thumbnail(){return this.data.asset.thumbnail===void 0?void 0:this.resolveImage(this.data.asset.thumbnail,"asset.thumbnail").data}get accessors(){return this.iterateCollectionData("accessor")}get animations(){return this.iterateCollectionData("animation")}get buffers(){return this.iterateCollectionData("buffer")}get bufferViews(){return this.iterateCollectionData("bufferView")}get cameras(){return this.iterateCollectionData("camera")}get externalAssets(){return this.iterateCollectionData("externalAsset")}get files(){return this.iterateCollectionData("file")}get images(){return this.iterateCollectionData("image")}get materials(){return this.iterateCollectionData("material")}get meshes(){return this.iterateCollectionData("mesh")}get nodes(){return this.iterateCollectionData("node")}get samplers(){return this.iterateCollectionData("sampler")}get scenes(){return this.iterateCollectionData("scene")}get skins(){return this.iterateCollectionData("skin")}get textures(){return this.iterateCollectionData("texture")}hasExtension(e){return!!this.data.extensionsUsed?.includes(e)||!!this.data.extensionsRequired?.includes(e)}isExtensionRequired(e){return!!this.data.extensionsRequired?.includes(e)}getExtension(e,t){let n=typeof e=="string"?this.data:e,s=typeof e=="string"?e:t;return n.extensions?.[s]}setExtension(e,t,n){let s=typeof e=="string",i=s?this.data:e,o=s?e:t,a=s?t:n,c=s?!!n:!1;i.extensions||={},i.extensions[o]=a,this.registerUsedExtension(o),c&&this.registerRequiredExtension(o)}registerUsedExtension(e){this.data.extensionsUsed||=[],this.data.extensionsUsed.includes(e)||this.data.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.data.extensionsRequired||=[],this.data.extensionsRequired.includes(e)||this.data.extensionsRequired.push(e)}removeExtension(e,t){let n=typeof e=="string",s=n?this.data:e,i=n?e:t;s.extensions?.[i]!==void 0&&(this.recordRemovedExtension(i),delete s.extensions[i]),n&&(KI(this.data.extensionsUsed,i),KI(this.data.extensionsRequired,i))}recordRemovedExtension(e){let t=this.data;t.extensionsRemoved||=[],t.extensionsRemoved.includes(e)||t.extensionsRemoved.push(e)}resolveAccessor(e,t){return this.resolveCollectionObject("accessor",e,t)}resolveBuffer(e,t){return this.resolveCollectionObject("buffer",e,t)}resolveBufferView(e,t){return this.resolveCollectionObject("bufferView",e,t)}resolveCamera(e,t){return this.resolveCollectionObject("camera",e,t)}resolveExternalAsset(e,t){return this.resolveCollectionObject("externalAsset",e,t)}resolveFile(e,t){return this.resolveCollectionObject("file",e,t)}resolveImage(e,t){return this.resolveCollectionObject("image",e,t)}resolveMaterial(e,t){return this.resolveCollectionObject("material",e,t)}resolveMesh(e,t){return this.resolveCollectionObject("mesh",e,t)}resolveNode(e,t){return this.resolveCollectionObject("node",e,t)}resolveSampler(e,t){return this.resolveCollectionObject("sampler",e,t)}resolveScene(e,t){return this.resolveCollectionObject("scene",e,t)}resolveSkin(e,t){return this.resolveCollectionObject("skin",e,t)}resolveTexture(e,t){return this.resolveCollectionObject("texture",e,t)}getOrCreateNested(e,t){return this.getOrCreate(e,t)}iterateCollection(e){let t=this.getCollection(e);return lo(t,(n,s)=>this.resolveCollectionObject(e,s,e))}iterateCollectionData(e){return(function*(n){for(let s of n.iterateCollection(e))yield s.data})(this)}getObjectIterator(e){let t=this.objectCache.get(e);if(!t)throw new Error("glTF object is not registered with this iterator");return t}resolveCollectionObject(e,t,n){let i=this.getCollection(e)[t];if(!i)throw new Error(`Invalid glTF reference at ${n}: ${e} index ${t} is out of range`);return this.getOrCreate(i,()=>this.createCollectionObject(e,t,i))}getCollection(e){switch(e){case"accessor":return this.data.accessors||[];case"animation":return this.data.animations||[];case"buffer":return this.data.buffers||[];case"bufferView":return this.data.bufferViews||[];case"camera":return this.data.cameras||[];case"externalAsset":return this.data.externalAssets||[];case"file":return this.data.files||[];case"image":return this.data.images||[];case"material":return this.data.materials||[];case"mesh":return this.data.meshes||[];case"node":return this.data.nodes||[];case"sampler":return this.data.samplers||[];case"scene":return this.data.scenes||[];case"skin":return this.data.skins||[];case"texture":return this.data.textures||[]}}createCollectionObject(e,t,n){let s=`${zR(e)}[${t}]`;switch(e){case"accessor":return new Tg(this,e,t,n,s);case"animation":return new _g(this,e,t,n,s);case"buffer":return new Ig(this,e,t,n,s);case"bufferView":return new Sg(this,e,t,n,s);case"camera":return new Eg(this,e,t,n,s);case"externalAsset":return new Lg(this,e,t,n,s);case"file":return new Bg(this,e,t,n,s);case"image":return new Fg(this,e,t,n,s);case"material":return new Og(this,e,t,n,s);case"mesh":return new Dg(this,e,t,n,s);case"node":return new kg(this,e,t,n,s);case"sampler":return new Ng(this,e,t,n,s);case"scene":return new Cg(this,e,t,n,s);case"skin":return new Ug(this,e,t,n,s);case"texture":return new Pg(this,e,t,n,s)}}getOrCreate(e,t){let n=this.objectCache.get(e);if(n)return n;let s=t();return this.objectCache.set(e,s),s}}});function XI(r){return(r%1+1)%1}function tu(r,e){return JI[e]*HI[r]}function ba(r,e,t,n){if(t!=="UINT8"&&t!=="UINT16"&&t!=="UINT32"&&t!=="UINT64")return null;let s=r.getTypedArrayForBufferView(e),i=ga(s,"SCALAR",t,n+1);if(i instanceof BigInt64Array||i instanceof BigUint64Array){let o=new Float64Array(i.length),a=BigInt(Number.MAX_SAFE_INTEGER);for(let c=0;c<i.length;c++){let u=i[c];if(u<0n||u>a)throw new Error("EXT_structural_metadata: UINT64 offset exceeds the safe integer range");o[c]=Number(u)}return o}return i}function ga(r,e,t,n=1){let s=HI[e],i=WR[t],o=JI[t],a=n*s,c=a*o,u=r.buffer,l=r.byteOffset;return l%o!==0&&(u=new Uint8Array(u).slice(l,l+c).buffer,l=0),new i(ro(u),l,a)}function ya(r,e,t){let n=`TEXCOORD_${e.texCoord||0}`,s=t.attributes[n],i=r.getTypedArrayForAccessor(s),o=r.gltf.json,a=e.index,c=o.textures?.[a]?.source;if(typeof c<"u"){let u=o.images?.[c]?.mimeType,l=r.gltf.images?.[c];if(l&&typeof l.width<"u"&&!("compressed"in l&&l.compressed)){let f=[];for(let d=0;d<i.length;d+=2){let h=$R(l,u,i,d,e.channels);f.push(h)}return f}}return[]}function hd(r,e,t,n,s){if(!t?.length)return;let i=[];for(let f of t){let d=n.findIndex(h=>h===f);d===-1&&(d=n.push(f)-1),i.push(d)}let o=new Uint32Array(i),a=r instanceof ie?r:new ie(r.gltf),c=a.addBuffer(o),u=a.addBufferView(c,o.byteLength),l=a.addAccessor(u,{size:1,componentType:Xn(o),count:o.length});s.attributes[e]=l}function $R(r,e,t,n,s=[0]){let i={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=t[n],a=t[n+1],c=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(c=4);let u=qR(o,a,r,c),l=0;for(let f of s){let d=typeof f=="number"?Object.values(i)[f]:i[f],h=u+d.offset,m=Jc(r);if(m.data.length<=h)throw new Error(`${m.data.length} <= ${h}`);let b=m.data[h];l|=b<<d.shift}return l}function qR(r,e,t,n=1){let s=t.width,i=XI(r)*(s-1),o=Math.round(i),a=t.height,c=XI(e)*(a-1),u=Math.round(c),l=t.components?t.components:n;return(u*s+o)*l}function ru(r,e,t,n=1){let s=[];for(let i=0;i<e;i++){let o=Number(t[i]),a=Number(t[i+1])-o;if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<0||(o+a)*n>r.length)break;let c=o*n,u=a*n;s.push(r.slice(c,c+u))}return s}function nu(r,e,t,n=1){let s=[],i=t*n;for(let o=0;o<e;o++){let a=o*i;s.push(r.slice(a,a+i))}return s}function pd(r,e,t,n,s){let i=new TextDecoder("utf8");if(t){if(!n)throw new Error("stringOffsets is required for variable-length string arrays");let o=[];for(let a=0;a<r;a++){let c=t[a],u=t[a+1],l=[];for(let f=c;f<u;f++){let d=n[f],h=n[f+1],m=e.subarray(d,h);l.push(i.decode(m))}o.push(l)}return o}if(n){let o=[],a=r*(s||1);for(let c=0;c<a;c++){let u=Number(n[c]),l=Number(n[c+1]);u>=0&&l>=u&&l<=e.length&&o.push(i.decode(e.subarray(u,l)))}return s?Array.from({length:r},(c,u)=>o.slice(u*s,(u+1)*s)):o}return[]}var HI,WR,JI,md=p(()=>{"use strict";He();ri();qn();Ue();HI={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},WR={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},JI={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8}});var Vg={};J(Vg,{createExtMeshFeatures:()=>ZR,decode:()=>XR,encode:()=>HR,name:()=>KR});async function XR(r,e){let t=new ie(r);JR(t,e)}function HR(r,e){let t=new bn(r);return QR(t,e),t.createBinaryChunk(),t.gltf}function JR(r,e){for(let t of r.meshes)for(let n of r.getReferences(t).primitives)YR(r,n,e)}function YR(r,e,t){let s=r.getExtension(e,wa)?.featureIds||[];if(s)for(let i of s){let o;if(typeof i.attribute<"u"){if(!t?.gltf?.loadBuffers)continue;let a=`_FEATURE_ID_${i.attribute}`,c=e.attributes[a];o=r.getTypedArrayForAccessor(c)}else if(typeof i.texture<"u"){if(!t?.gltf?.loadImages)continue;o=ya(r,i.texture,e)}else{let a=e.attributes.POSITION,c=typeof a=="number"?r.data.accessors?.[a]?.count:a?.count;if(typeof c!="number"||!Number.isInteger(c)||c<0)throw new Error("EXT_mesh_features: implicit feature IDs require a POSITION accessor");if(i.featureCount!==c)throw new Error(`EXT_mesh_features: implicit featureCount ${i.featureCount} does not match vertex count ${c}`);delete i.data,Object.defineProperty(i,"implicit",{configurable:!0,enumerable:!1,writable:!0,value:{start:0,count:c}})}o&&(i.data=o,delete i.implicit)}}function QR(r,e){let t=r.gltf.json.meshes;if(t)for(let n of t)for(let s of n.primitives)ek(r,s)}function ZR(r,e,t,n){e.extensions||(e.extensions={});let s=e.extensions[wa];s||(s={featureIds:[]},e.extensions[wa]=s);let{featureIds:i}=s,o={featureCount:t.length,propertyTable:n,data:t};i.push(o),r.addObjectExtension(e,wa,s)}function ek(r,e){let t=e.extensions?.[wa];if(!t)return;let n=t.featureIds;n.forEach((s,i)=>{if(s.data){let{accessorKey:o,index:a}=tk(e.attributes),c=new Uint32Array(s.data);n[i]={featureCount:c.length,propertyTable:s.propertyTable,attribute:a};let u=r.addBufferView(c),l=r.addAccessor(u,{size:1,componentType:Xn(c),count:c.length});e.attributes[o]=l}})}function tk(r){let e="_FEATURE_ID_",t=Object.keys(r).filter(i=>i.indexOf(e)===0),n=-1;for(let i of t){let o=Number(i.substring(e.length));o>n&&(n=o)}return n++,{accessorKey:`${e}${n}`,index:n}}var wa,KR,YI=p(()=>{"use strict";eu();He();md();ri();wa="EXT_mesh_features",KR=wa});var Wg={};J(Wg,{createExtStructuralMetadata:()=>Sk,decode:()=>nk,encode:()=>sk,name:()=>rk});async function nk(r,e,t){let n=new ie(r),s=n.getExtension(fo);if(e.gltf?.loadBuffers&&s?.schemaUri&&!s.schema){if(!t?.fetch)throw new Error("EXT_structural_metadata: a loader context is required to load schemaUri");let i=Kn(s.schemaUri,e,t),o=await t.fetch(i);if(!o.ok)throw new Error(`EXT_structural_metadata: failed to load schemaUri ${i} (${o.status})`);s.schema=await o.json()}ik(n,e)}function sk(r,e){let t=new bn(r);return vk(t,e),t.createBinaryChunk(),t.gltf}function ik(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(fo);t&&(e.gltf?.loadImages&&ok(r,t),ak(r,t))}function ok(r,e){let t=e.propertyTextures,n=r.data;if(t&&n.meshes)for(let s of n.meshes)for(let i of s.primitives)ck(r,t,i,e)}function ak(r,e){let t=e.schema;if(!t)return;let n=t.classes,s=e.propertyTables;if(n&&s)for(let i of s)i.class&&n[i.class]&&lk(r,t,i)}function ck(r,e,t,n){if(!e)return;let i=t.extensions?.[fo]?.propertyTextures;if(i)for(let o of i){let a=e[o];uk(r,a,t,n)}}function uk(r,e,t,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let s=e.class;for(let i in e.properties){let o=`${s}_${i}`,a=e.properties?.[i];if(!a)continue;a.data||(a.data=[]);let c=a.data,u=ya(r,a,t);u!==null&&(hd(r,o,u,c,t),a.data=c,n.dataAttributeNames.push(o))}}function lk(r,e,t){let n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);let s=t.count;for(let i in n.properties){let o=n.properties[i],a=t.properties?.[i];if(a){let c={},u=fk(r,e,o,s,a,c);a.data=u,c.value!==void 0&&Object.defineProperty(a,"rawData",{value:c.value,configurable:!0,enumerable:!1,writable:!0})}}}function fk(r,e,t,n,s,i){let o=[],a=s.values,c=r.getTypedArrayForBufferView(a),u=hk(r,t,s,n),l=pk(r,t,s,n,u);switch(t.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{let f=mk(t,s,n,c,u);o=f.data,i&&(i.value=f.rawData);break}case"BOOLEAN":{o=dk(t,n,c,u);break}case"STRING":{o=pd(n,c,u,l,t.array?t.count:void 0);break}case"ENUM":{o=wk(e,t,n,c,u);break}default:throw new Error(`Unknown classProperty type ${t.type}`)}return o}function dk(r,e,t,n){return r.array?n?Array.from({length:e},(s,i)=>{let o=Number(n[i]),a=Number(n[i+1]);if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<o)throw new Error("EXT_structural_metadata: invalid BOOLEAN array offsets");return jg(t,o,a-o)}):r.count===void 0?[]:Array.from({length:e},(s,i)=>jg(t,i*r.count,r.count)):jg(t,0,e)}function jg(r,e,t){if(e+t>r.byteLength*8)throw new Error("EXT_structural_metadata: BOOLEAN values exceed their buffer view");return Array.from({length:t},(n,s)=>{let i=e+s;return!!(r[Math.floor(i/8)]&1<<i%8)})}function hk(r,e,t,n){return e.array&&typeof e.count>"u"&&typeof t.arrayOffsets<"u"?ba(r,t.arrayOffsets,t.arrayOffsetType||"UINT32",n):null}function pk(r,e,t,n,s){if(typeof t.stringOffsets<"u"){let i=s?Number(s[n]):n*(e.array&&e.count||1);return ba(r,t.stringOffsets,t.stringOffsetType||"UINT32",i)}return null}function mk(r,e,t,n,s){let i=r.array,o=r.count,a={VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}[r.type]||1,c=tu(r.type,r.componentType),u=n.byteLength/c,l;r.componentType?l=ga(n,r.type,r.componentType,u):l=n;let f=l,d=e.offset??r.offset,h=e.scale??r.scale,m=r.normalized||d!==void 0||h!==void 0?bk(f,r.componentType,r.type,r.normalized,d,h):f;return i?s?{data:ru(m,t,s,a),rawData:ru(f,t,s,a)}:o?{data:nu(m,t,o,a),rawData:nu(f,t,o,a)}:{data:[],rawData:[]}:{data:m,rawData:f}}function bk(r,e,t,n,s,i){let o=yk(e),a=!!(n&&o!==void 0);if(!a&&s===void 0&&i===void 0)return r;let c=gk(t),u=new Float64Array(r.length);for(let l=0;l<r.length;l++){let f=Number(r[l]);a&&(f=e?.startsWith("INT")?Math.max(f/o,-1):f/o);let d=l%c,h=Array.isArray(s)?s[d]??0:s??0,m=Array.isArray(i)?i[d]??1:i??1;u[l]=f*m+h}return u}function gk(r){switch(r){case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4;case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:return 1}}function yk(r){switch(r){case"INT8":return 127;case"UINT8":return 255;case"INT16":return 32767;case"UINT16":return 65535;case"INT32":return 2147483647;case"UINT32":return 4294967295;case"INT64":return 2**63-1;case"UINT64":return 2**64-1;default:return}}function wk(r,e,t,n,s){let i=e.enumType;if(!i)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=r.enums?.[i];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${i}`);let a=o.valueType||"UINT16",c=tu(e.type,a),u=n.byteLength/c,l=ga(n,e.type,a,u);if(l||(l=n),e.array){if(s)return xk({valuesData:l,numberOfElements:t,arrayOffsets:s,enumEntry:o});let f=e.count;return f?Tk(l,t,f,o):[]}return zg(l,0,t,o)}function xk(r){let{valuesData:e,numberOfElements:t,arrayOffsets:n,enumEntry:s}=r,i=[];for(let o=0;o<t;o++){let a=Number(n[o]),c=Number(n[o+1])-a;if(!Number.isInteger(a)||!Number.isInteger(c)||a<0||c<0||a+c>e.length)break;let u=zg(e,a,c,s);i.push(u)}return i}function Tk(r,e,t,n){let s=[];for(let i=0;i<e;i++){let o=t*i,a=zg(r,o,t,n);s.push(a)}return s}function zg(r,e,t,n){let s=[];for(let i=0;i<t;i++){let o=r[e+i],a=_k(n,o);a?s.push(a.name):s.push("")}return s}function _k(r,e){for(let t of r.values)if(typeof e=="bigint"?Number.isSafeInteger(t.value)&&BigInt(t.value)===e:t.value===e)return t;return null}function vk(r,e){let t=r.getExtension(fo);if(t&&t.propertyTables)for(let n of t.propertyTables){let s=n.class,i=t.schema?.classes?.[s];n.properties&&i&&Ik(n,i,r)}}function Ik(r,e,t){for(let n in r.properties){let s=r.properties[n].data;if(s){let i=e.properties[n];if(i){let o=Bk(s,i,t);r.properties[n]=o}}}}function Sk(r,e,t=Ak){let n=r.getExtension(fo);n||(n=r.addExtension(fo)),n.schema=Ek(e,t,n.schema);let s=Lk(e,t,n.schema);return n.propertyTables||(n.propertyTables=[]),n.propertyTables.push(s)-1}function Ek(r,e,t){let n=t??{id:"schema_id"},s={properties:{}};for(let i of r){let o={type:i.elementType,componentType:i.componentType};s.properties[i.name]=o}return n.classes={},n.classes[e]=s,n}function Lk(r,e,t){let n={class:e,count:0},s=0,i=t.classes?.[e];for(let o of r){if(s===0&&(s=o.values.length),s!==o.values.length&&o.values.length)throw new Error("Illegal values in attributes");i?.properties[o.name]&&(n.properties||(n.properties={}),n.properties[o.name]={values:0,data:o.values})}return n.count=s,n}function Bk(r,e,t){let n={values:0};if(e.type==="STRING"){let{stringData:s,stringOffsets:i}=Mk(r);n.stringOffsets=Gg(i,t),n.values=Gg(s,t)}else if(e.type==="SCALAR"&&e.componentType){let s=Ok(r,e.componentType);n.values=Gg(s,t)}return n}function Ok(r,e){let t=[];for(let s of r)t.push(Number(s));let n=Fk[e];if(!n)throw new Error("Illegal component type");return new n(t)}function Mk(r){let e=new TextEncoder,t=[],n=0;for(let c of r){let u=e.encode(c);n+=u.length,t.push(u)}let s=new Uint8Array(n),i=[],o=0;for(let c of t)s.set(c,o),i.push(o),o+=c.length;i.push(o);let a=new Uint32Array(i);return{stringData:s,stringOffsets:a}}function Gg(r,e){return e.addBufferView(r)}var fo,rk,Ak,Fk,QI=p(()=>{"use strict";eu();He();md();Yc();fo="EXT_structural_metadata",rk=fo;Ak="schemaClassId";Fk={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array}});var qg={};J(qg,{SPZ_COMPRESSION_EXTENSION_NAME:()=>su,decode:()=>Rk,getGaussianSplatPrimitives:()=>ZI,name:()=>$g});async function Rk(r,e,t){let n=t?.loaders?.find(o=>o.extensions?.includes("spz")),s=ZI(r),i=new ie(r);for(let[o,a]of(r.json.meshes||[]).entries())for(let[c,u]of a.primitives.entries()){let l=u.extensions?.[$g];if(!l)continue;let f=s.find(b=>b.meshIndex===o&&b.primitiveIndex===c),d=e?.gltf?.legacyGaussianSplatColorSpace,h=d&&l.extensions?.[su]?{...l,kernel:l.kernel??"ellipse",colorSpace:l.colorSpace??d}:l;f&&(f.extension=h),Nk(r.json,u,h,o,c,i);let m=l.extensions?.[su];if(m&&f){let b=e?.gltf?.splatDecoder,g=r.json.bufferViews?.[m.bufferView];if(g&&r.buffers[g.buffer])f.compressedBytes=kk(r,m.bufferView);else if(b||n)throw new Error(`KHR_gaussian_splatting: bufferView ${m.bufferView} is not loaded for SPZ2 decoding.`);n&&t&&f.compressedBytes?f.decoded=await Xs(f.compressedBytes.buffer,n,{...e,splats:{...e.splats,sourceCoordinateSystem:"LUF"}},t):b&&f.compressedBytes&&(f.decoded=await b(f.compressedBytes.buffer,{sourceCoordinateSystem:"LUF"}))}}s.length&&(r.gaussianSplatPrimitives=s)}function kk(r,e){let t=r.json.bufferViews?.[e];if(!t)throw new Error(`KHR_gaussian_splatting: bufferView ${e} is not defined.`);let n=r.buffers[t.buffer];if(!n)throw new Error(`KHR_gaussian_splatting: buffer ${t.buffer} is not loaded for SPZ2 payload.`);let s=n.byteOffset+(t.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,t.byteLength).slice()}function ZI(r){let e="json"in r?r.json:r,t=[];for(let[n,s]of(e.meshes||[]).entries())for(let[i,o]of s.primitives.entries()){let a=o.extensions?.[$g];if(!a)continue;let c=a.extensions?.[su]?.bufferView;t.push({meshIndex:n,primitiveIndex:i,attributes:{...o.attributes},extension:a,compressedBufferView:c})}return t}function Nk(r,e,t,n,s,i){if((e.mode??4)!==0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} must use POINTS mode.`);if(typeof t.kernel!="string"||t.kernel.length===0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing kernel.`);if(typeof t.colorSpace!="string"||t.colorSpace.length===0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing colorSpace.`);let o=t.extensions?.[su]?.bufferView;if(o!==void 0){if(!Number.isInteger(o)||o<0||o>=(r.bufferViews||[]).length)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has an invalid SPZ bufferView.`)}else for(let a of Dk)if(e.attributes[a]===void 0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing ${a}.`);for(let[a,c]of Object.entries(e.attributes))if(!Number.isInteger(c)||c<0||c>=(r.accessors||[]).length)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has invalid accessor ${a}.`);Ck(r,e,i,n,s);for(let a=1;a<=3;a++){let c=a*2+1,u=Array.from({length:c},(l,f)=>e.attributes[`KHR_gaussian_splatting:SH_DEGREE_${a}_COEF_${f}`]!==void 0);if(u.some(Boolean)&&!u.every(Boolean))throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has incomplete SH degree ${a}.`);if(u.some(Boolean)&&a>1){let l=a-1,f=l*2+1;for(let d=0;d<f;d++)if(e.attributes[`KHR_gaussian_splatting:SH_DEGREE_${l}_COEF_${d}`]===void 0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} skips SH degree ${l}.`)}}}function Ck(r,e,t,n,s){let i=e.attributes["KHR_gaussian_splatting:SCALE"],o=e.attributes["KHR_gaussian_splatting:OPACITY"];for(let[a,c,u]of[["KHR_gaussian_splatting:SCALE",i,l=>l>=0],["KHR_gaussian_splatting:OPACITY",o,l=>l>=0&&l<=1]]){if(c===void 0||!Uk(r,t,c))continue;let l=t.getTypedArrayForAccessor(c);for(let f=0;f<l.length;f++)if(!u(Number(l[f])))throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has an invalid ${a} value.`)}}function Uk(r,e,t){let n=r.accessors?.[t],s=n?.bufferView===void 0?void 0:r.bufferViews?.[n.bufferView];return!!(s&&e.gltf.buffers[s.buffer])}var $g,su,Dk,eS=p(()=>{"use strict";Ue();He();$g="KHR_gaussian_splatting",su="KHR_gaussian_splatting_compression_spz_2",Dk=["POSITION","KHR_gaussian_splatting:ROTATION","KHR_gaussian_splatting:SCALE","KHR_gaussian_splatting:OPACITY","KHR_gaussian_splatting:SH_DEGREE_0_COEF_0"]});var Xg={};J(Xg,{decode:()=>Pk,getVoxelPrimitives:()=>Vk,name:()=>Kg});async function Pk(r){for(let[e,t]of(r.json.meshes||[]).entries())for(let[n,s]of t.primitives.entries()){let i=s.extensions?.[Kg];i&&jk(r.json,s,i,e,n)}}function Vk(r){let e="json"in r?r.json:r,t=[];for(let[n,s]of(e.meshes||[]).entries())for(let[i,o]of s.primitives.entries()){let a=o.extensions?.[Kg];a&&t.push({meshIndex:n,primitiveIndex:i,attributes:{...o.attributes},extension:a})}return t}function jk(r,e,t,n,s){if(!Number.isInteger(t.shape)||t.shape<0)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} has invalid shape.`);if(!Array.isArray(t.dimensions)||t.dimensions.length!==3||t.dimensions.some(i=>!Number.isInteger(i)||i<=0))throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} must provide three positive dimensions.`);if(e.mode!==void 0&&e.mode!==2147483647)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} must use voxel mode.`);for(let i of Object.keys(e.attributes)){let o=e.attributes[i];if(!Number.isInteger(o)||o<0||o>=(r.accessors||[]).length)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} has invalid accessor ${i}.`)}}var Kg,tS=p(()=>{"use strict";Kg="EXT_primitive_voxels"});var Hg={};J(Hg,{decode:()=>zk,getPrimitiveRestartRanges:()=>bd,name:()=>si});async function zk(r,e){if(!r.json.extensionsUsed?.includes(si))return;if(!r.json.extensionsRequired?.includes(si))throw new Error(`${si} must be declared in extensionsRequired`);if(!e.gltf?.loadBuffers)return;let t=new ie(r);for(let n of t.meshes)for(let s of t.getReferences(n).primitives)Wk(t,s)}function Wk(r,e){if(e.indices===void 0)return;let t=e.indices,n=typeof t=="number"?r.data.accessors?.[t]:t;if(!n)throw new Error(`${si}: primitive references missing indices accessor ${e.indices}`);let s=$k(n),i=r.getTypedArrayForAccessor(e.indices),o=Array.prototype.includes.call(i,s);if(!Gk.has(e.mode??4)){if(o)throw new Error(`${si}: primitive restart is not valid for mode ${e.mode??4}`);return}Object.defineProperty(e,"primitiveRestart",{configurable:!0,enumerable:!1,writable:!0,value:{restartIndex:s,ranges:bd(i,s)}})}function $k(r){if(r.type!=="SCALAR")throw new Error(`${si}: indices accessor must have SCALAR type`);switch(r.componentType){case 5121:return 255;case 5123:return 65535;case 5125:return 4294967295;default:throw new Error(`${si}: indices accessor must use an unsigned integer component type`)}}function bd(r,e){let t=[],n=0;for(let s=0;s<=r.length;s++)(s===r.length||r[s]===e)&&(s>n&&t.push({offset:n,count:s-n}),n=s+1);return t}var si,Gk,Jg=p(()=>{"use strict";He();si="KHR_mesh_primitive_restart",Gk=new Set([2,3,5,6])});var Yg={};J(Yg,{decode:()=>qk,name:()=>qt});async function qk(r,e){if(!e.gltf?.loadBuffers)return;let t=new ie(r);for(let n of t.meshes)for(let s of t.getReferences(n).primitives){let i=t.getExtension(s,qt);i&&Object.defineProperty(i,"data",{configurable:!0,enumerable:!1,writable:!0,value:Kk(t,s,i)})}}function Kk(r,e,t){if(!Number.isInteger(t.count)||t.count<1)throw new Error(`${qt}: count must be a positive integer`);if((e.mode??4)!==4||e.indices===void 0)throw new Error(`${qt}: primitive must use TRIANGLES mode with indices`);let n=gd(r,e.indices,"indices"),s=gd(r,t.indicesOffsets,"indicesOffsets",t.count),i=gd(r,t.loopIndices,"loopIndices"),o=gd(r,t.loopIndicesOffsets,"loopIndicesOffsets",t.count),a=r.data.accessors?.[t.loopIndices],c=Xk(a.componentType);rS(s,n.length,"indicesOffsets"),rS(o,i.length,"loopIndicesOffsets");let u=[];for(let l=0;l<t.count;l++){let f=Number(s[l]),d=l+1<t.count?Number(s[l+1]):n.length,h=Number(o[l]),m=l+1<t.count?Number(o[l+1]):i.length,b=Array.from(i).slice(h,m),g=bd(b,c).map(y=>({offset:y.offset+h,count:y.count}));if((d-f)%3!==0)throw new Error(`${qt}: polygon ${l} triangle range must contain complete triangles`);if(g.length===0)throw new Error(`${qt}: polygon ${l} must contain at least one loop`);if(g.some(y=>y.count<3))throw new Error(`${qt}: polygon ${l} loops must contain at least three indices`);u.push({triangleRange:{offset:f,count:d-f},loopRanges:g})}return{indicesOffsets:s,loopIndices:i,loopIndicesOffsets:o,polygons:u}}function gd(r,e,t,n){if(typeof e=="number"&&(!Number.isInteger(e)||e<0))throw new Error(`${qt}: ${t} must reference an accessor`);let s=typeof e=="number"?r.data.accessors?.[e]:e;if(!s)throw new Error(`${qt}: ${t} references missing accessor ${e}`);if(s.type!=="SCALAR"||![5121,5123,5125].includes(s.componentType))throw new Error(`${qt}: ${t} must be an unsigned integer SCALAR accessor`);if(n!==void 0&&s.count!==n)throw new Error(`${qt}: ${t} count must equal polygon count ${n}`);return r.getTypedArrayForAccessor(e)}function rS(r,e,t){if(Number(r[0])!==0)throw new Error(`${qt}: ${t} must begin at zero`);let n=-1;for(let s=0;s<r.length;s++){let i=Number(r[s]);if(!Number.isInteger(i)||i<0||i>=e||i<=n)throw new Error(`${qt}: ${t} must contain increasing in-bounds offsets`);n=i}}function Xk(r){switch(r){case 5121:return 255;case 5123:return 65535;case 5125:return 4294967295;default:throw new Error(`${qt}: unsupported loop index component type ${r}`)}}var qt,nS=p(()=>{"use strict";He();Jg();qt="EXT_mesh_polygon"});var Qg={};J(Qg,{decode:()=>Hk,getSpatialAudio:()=>sS,name:()=>xa});function sS(r){let e="asset"in r?r:r.json,t=[],n=e.extensions?.[xa];n&&t.push({nodeIndex:null,extension:n});for(let[s,i]of(e.nodes||[]).entries()){let o=i.extensions?.[xa];o&&t.push({nodeIndex:s,extension:o})}return t}async function Hk(r){let e=sS(r);for(let{extension:t,nodeIndex:n}of e){let s=n===null?"root":`node ${n}`;for(let i of t.sources||[]){if(!Array.isArray(i.accessors)||i.accessors.length===0)throw new Error(`${xa}: ${s} source ${i.id} requires audio accessors.`);for(let o of i.accessors)if(!Number.isInteger(o)||o<0||!r.json.accessors?.[o])throw new Error(`${xa}: ${s} source ${i.id} has invalid accessor ${o}.`);if(i.reverbFeedGain&&i.reverbFeedGain.length!==(i.reverbFeed?.length||0))throw new Error(`${xa}: ${s} source ${i.id} has mismatched reverb feed gains.`)}}e.length&&(r.spatialAudio=e)}var xa,iS=p(()=>{"use strict";xa="MPEG_audio_spatial"});var Zg={};J(Zg,{decode:()=>Jk,name:()=>Kt});async function Jk(r,e,t){let n=r.json.extensions?.[Kt],s=(n?.audio||[]).map(c=>({audio:c})),i=n?.sources||[],o=n?.emitters||[];for(let c of i)c.audio!==void 0&&yd(s,c.audio,"audio");for(let c of o){if(c.type!=="global"&&c.type!=="positional")throw new Error(`${Kt}: invalid emitter type ${c.type}.`);if(c.type==="global"&&c.positional!==void 0)throw new Error(`${Kt}: global emitters cannot have positional settings.`);for(let u of c.sources||[])yd(i,u,"source")}let a=[];for(let c of["nodes","scenes"])for(let[u,l]of(r.json[c]||[]).entries()){let f=l.extensions?.[Kt];if(f){if(!Array.isArray(f.emitters)||!f.emitters.length)throw new Error(`${Kt}: ${c} ${u} requires emitters.`);for(let d of f.emitters){let h=yd(o,d,"emitter");if(c==="scenes"&&h.type!=="global")throw new Error(`${Kt}: scenes may only reference global emitters.`);a.push({emitterIndex:d,nodeIndex:c==="nodes"?u:null,sceneIndex:c==="scenes"?u:null,emitter:h,sources:(h.sources||[]).map(m=>{let b=i[m];return{sourceIndex:m,source:b,clip:b.audio===void 0?void 0:s[b.audio]}})})}}}if(n){for(let c of s)Yk(r,c);e.gltf?.loadAudio!==!1&&await Promise.all(s.map(c=>Qk(r,c,e,t))),r.audioClips=s,r.audioEmitters=a}}function yd(r,e,t){if(!Number.isInteger(e)||e<0||!r[e])throw new Error(`${Kt}: invalid ${t} index ${e}.`);return r[e]}function Yk(r,e){let{audio:t}=e;if(t.bufferView!==void 0){if(yd(r.json.bufferViews||[],t.bufferView,"bufferView"),!t.mimeType)throw new Error(`${Kt}: buffer-view audio requires mimeType.`)}else if(!t.uri)throw new Error(`${Kt}: audio requires a uri or bufferView.`)}async function Qk(r,e,t,n){let{audio:s}=e;if(s.bufferView!==void 0){let a=r.json.bufferViews[s.bufferView],c=r.buffers[a.buffer];if(!c){if(t.gltf?.loadBuffers===!1)return;throw new Error(`${Kt}: audio buffer ${a.buffer} is not loaded.`)}let u=a.byteOffset??0,l=a.byteLength;if(!Number.isSafeInteger(u)||u<0||!Number.isSafeInteger(l)||l<0||u+l>c.byteLength||c.byteOffset+u+l>c.arrayBuffer.byteLength)throw new Error(`${Kt}: audio bufferView exceeds its buffer.`);e.data=new Uint8Array(c.arrayBuffer,c.byteOffset+u,l);return}if(!n?.fetch)throw new Error(`${Kt}: a loader context is required to load audio.`);let i=Kn(s.uri,t,n),o=await n.fetch(i);if(!o.ok)throw new Error(`${Kt}: failed to load audio ${i} (${o.status}).`);e.url=i,e.data=new Uint8Array(await o.arrayBuffer())}var Kt,oS=p(()=>{"use strict";Yc();Kt="KHR_audio_emitter"});var aS={};J(aS,{MeshoptDecoder:()=>Zk});var Zk,cS=p(()=>{"use strict";Zk=(function(){var r="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq;X8:kdbk:kYi5ud9:du8Jjjjjbcjq9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCaAcethXaxaDfhiaOaeaoaeao6E9RhQalcl4cifcd4hLazcjdfaAfhKcbhYabaOad2fg8AhEaHh3incbh5dnawTmbaxaYcd4fRbbh5kcbh8Eazcjdfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcjdfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcjdfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaL6mva8FaLfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:bsesu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhDaicefgiarfhqdndnaeci9pmbaqhexekcmcsawceSEhkcbhxcbhmaqhecbhlcbhoindndnaiRbbgrc;Ve0mbavc;abfaoarcu7gPcl4fcsGcitfgwydlhsawydbhzdndnarcsGgwak9pmbavalaPfcsGcdtfydbaxawEhraxawTgHfhxxekdnaeaD9nmbc9:hoxokdndnawcsSmbcehHamawcetfcWfhrxekaecefhrae8SbbgwcFeGhPdndnawcu9mmbarhexekaecvfheaPcFbGhPcrhwdninar8SbbgHcFbGawtaPVhPaHcu9kmearcefhrawcrfgwc8J9hmbxdkkarcefhekcehHaPce4cbaPceG9R7amfhrkarhmkavc;abfaocitfgwarBdbawasBdlavalcdtfarBdbavc;abfaocefcsGcitfgwazBdbawarBdlaocdfhoaHalfhldnadcd9hmbabar87elabas87edabaz87ebabcofhbxdkabarBdwabasBdlabazBdbabcxfhbxekdnarcpe0mbavalaDarcsGfRbbgwcl4gP9RcsGcdtfydbaxcefgsaPEhravalaw9RcsGcdtfydbasaPTgzfgsawcsGgPEhwaPThPdndnadcd9hmbabaw87elabar87edabax87ebcohHxekabawBdwabarBdlabaxBdbcxhHkavalcdtfaxBdbavc;abfaocitfgOarBdbaOaxBdlavalcefglcsGcdtfarBdbavc;abfaocefcsGcitfgOawBdbaOarBdlavalazfglcsGcdtfawBdbavc;abfaocdfcsGcitfgraxBdbarawBdlaocifhoabaHfhbalaPfhlasaPfhxxekdnaeaD9nmbc9:hoxlkaxcbaeRbbgwEgHarc;:eSgrfhsawcsGhOdndnawcl4gAmbascefhzxekashzavalaA9RcsGcdtfydbhskdndnaOmbazcefhxxekazhxavalaw9RcsGcdtfydbhzkdndnarTmbaecefhrxekaecdfhrae8SbegPcFeGhwdnaPcu9kmbaecofhHawcFbGhwcrhedninar8SbbgPcFbGaetawVhwaPcu9kmearcefhraecrfgec8J9hmbkaHhrxekarcefhrkawce4cbawceG9R7amfgmhHkdndnaAcsSmbarhwxekarcefhwar8SbbgecFeGhPdnaecu9kmbarcvfhsaPcFbGhPcrhedninaw8SbbgrcFbGaetaPVhParcu9kmeawcefhwaecrfgec8J9hmbkashwxekawcefhwkaPce4cbaPceG9R7amfgmhskdndnaOcsSmbawhexekawcefheaw8SbbgrcFeGhPdnarcu9kmbawcvfhzaPcFbGhPcrhrdninae8SbbgwcFbGartaPVhPawcu9kmeaecefhearcrfgrc8J9hmbkazhexekaecefhekaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabaz87elabas87edabaH87ebcohrxekabazBdwabasBdlabaHBdbcxhrkavc;abfaocitfgwasBdbawaHBdlavalcdtfaHBdbavc;abfaocefcsGcitfgwazBdbawasBdlavalcefglcsGcdtfasBdbavc;abfaocdfcsGcitfgwaHBdbawazBdlavalaATaAcsSVfglcsGcdtfazBdbalaOTaOcsSVfhlaocifhoabarfhbkaocsGhoalcsGhlaicefgiaq6mbkkcbc99aeaDSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:I9Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaocwffa8JRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbagaocdffa8JRb:q:W:cjbfhokalcdfhlaiczfgiaC6mbkkaohQaoTmoka8FaCfh8Fa8Ecefg8Ecl9hmbkdndndndnawTmbazaEcd4fRbbglciGPlbedwbkaCTmdaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep9Taapxeeeeeeeeeeeeeeeeghp9op9Hp9rgaa8Kp9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ughp9Abbbaladfglahaaaapmlvorlvorlvorlvorp9Ughp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp9Ughp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkpPesu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhDaicefgiarfhqdndnaeci9pmbaqhexekcmcsawceSEhkcbhxcbhmaqhecbhlcbhoindndnaiRbbgrc;Ve0mbavc;abfaoarcu7gPcl4fcsGcitfgwydlhsawydbhzdndnarcsGgwak9pmbavalaPfcsGcdtfydbaxawEhraxawTgHfhxxekdnaeaD9nmbc9:hoxokdndnawcsSmbcehHamawcetfcWfhrxekaecefhrae8SbbgwcFeGhPdndnawcu9mmbarhexekaecvfheaPcFbGhPcrhwdninar8SbbgHcFbGawtaPVhPaHcu9kmearcefhrawcrfgwc8J9hmbxdkkarcefhekcehHaPce4cbaPceG9R7amfhrkarhmkavc;abfaocitfgwarBdbawasBdlavalcdtfarBdbavc;abfaocefcsGcitfgwazBdbawarBdlaocdfhoaHalfhldnadcd9hmbabar87elabas87edabaz87ebabcofhbxdkabarBdwabasBdlabazBdbabcxfhbxekdnarcpe0mbavalaDarcsGfRbbgwcl4gP9RcsGcdtfydbaxcefgsaPEhravalaw9RcsGcdtfydbasaPTgzfgsawcsGgPEhwaPThPdndnadcd9hmbabaw87elabar87edabax87ebcohHxekabawBdwabarBdlabaxBdbcxhHkavalcdtfaxBdbavc;abfaocitfgOarBdbaOaxBdlavalcefglcsGcdtfarBdbavc;abfaocefcsGcitfgOawBdbaOarBdlavalazfglcsGcdtfawBdbavc;abfaocdfcsGcitfgraxBdbarawBdlaocifhoabaHfhbalaPfhlasaPfhxxekdnaeaD9nmbc9:hoxlkaxcbaeRbbgwEgHarc;:eSgrfhsawcsGhOdndnawcl4gAmbascefhzxekashzavalaA9RcsGcdtfydbhskdndnaOmbazcefhxxekazhxavalaw9RcsGcdtfydbhzkdndnarTmbaecefhrxekaecdfhrae8SbegPcFeGhwdnaPcu9kmbaecofhHawcFbGhwcrhedninar8SbbgPcFbGaetawVhwaPcu9kmearcefhraecrfgec8J9hmbkaHhrxekarcefhrkawce4cbawceG9R7amfgmhHkdndnaAcsSmbarhwxekarcefhwar8SbbgecFeGhPdnaecu9kmbarcvfhsaPcFbGhPcrhedninaw8SbbgrcFbGaetaPVhParcu9kmeawcefhwaecrfgec8J9hmbkashwxekawcefhwkaPce4cbaPceG9R7amfgmhskdndnaOcsSmbawhexekawcefheaw8SbbgrcFeGhPdnarcu9kmbawcvfhzaPcFbGhPcrhrdninae8SbbgwcFbGartaPVhPawcu9kmeaecefhearcrfgrc8J9hmbkazhexekaecefhekaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabaz87elabas87edabaH87ebcohrxekabazBdwabasBdlabaHBdbcxhrkavc;abfaocitfgwasBdbawaHBdlavalcdtfaHBdbavc;abfaocefcsGcitfgwazBdbawasBdlavalcefglcsGcdtfasBdbavc;abfaocdfcsGcitfgwaHBdbawazBdlavalaATaAcsSVfglcsGcdtfazBdbalaOTaOcsSVfhlaocifhoabarfhbkaocsGhoalcsGhlaicefgiaq6mbkkcbc99aeaDSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var s=WebAssembly.validate(t)?a(e):a(r),i,o=WebAssembly.instantiate(s,{}).then(function(y){i=y.instance,i.exports.__wasm_call_ctors()});function a(y){for(var x=new Uint8Array(y.length),T=0;T<y.length;++T){var _=y.charCodeAt(T);x[T]=_>96?_-97:_>64?_-39:_+4}for(var v=0,T=0;T<y.length;++T)x[v++]=x[T]<60?n[x[T]]:(x[T]-60)*64+x[++T];return x.buffer.slice(0,v)}function c(y,x,T,_,v,I,N){var K=y.exports.sbrk,ne=_+3&-4,be=K(ne*v),Re=K(I.length),ke=new Uint8Array(y.exports.memory.buffer);ke.set(I,Re);var ue=x(be,_,v,Re,I.length);if(ue==0&&N&&N(be,ne,v),T.set(ke.subarray(be,be+_*v)),K(be-K(0)),ue!=0)throw new Error("Malformed buffer data: "+ue)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},l={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},f=[],d=0;function h(y){var x={object:new Worker(y),pending:0,requests:{}};return x.object.onmessage=function(T){var _=T.data;x.pending-=_.count,x.requests[_.id][_.action](_.value),delete x.requests[_.id]},x}function m(y){for(var x="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(s)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+g.name+";"+c.toString()+g.toString(),T=new Blob([x],{type:"text/javascript"}),_=URL.createObjectURL(T),v=f.length;v<y;++v)f[v]=h(_);for(var v=y;v<f.length;++v)f[v].object.postMessage({});f.length=y,URL.revokeObjectURL(_)}function b(y,x,T,_,v){for(var I=f[0],N=1;N<f.length;++N)f[N].pending<I.pending&&(I=f[N]);return new Promise(function(K,ne){var be=new Uint8Array(T),Re=++d;I.pending+=y,I.requests[Re]={resolve:K,reject:ne},I.object.postMessage({id:Re,count:y,size:x,source:be,mode:_,filter:v},[be.buffer])})}function g(y){var x=y.data;self.ready.then(function(T){if(!x.id)return self.close();try{var _=new Uint8Array(x.count*x.size);c(T,T.exports[x.mode],_,x.count,x.size,x.source,T.exports[x.filter]),self.postMessage({id:x.id,count:x.count,action:"resolve",value:_},[_.buffer])}catch(v){self.postMessage({id:x.id,count:x.count,action:"reject",value:v})}})}return{ready:o,supported:!0,useWorkers:function(y){m(y)},decodeVertexBuffer:function(y,x,T,_,v){c(i,i.exports.meshopt_decodeVertexBuffer,y,x,T,_,i.exports[u[v]])},decodeIndexBuffer:function(y,x,T,_){c(i,i.exports.meshopt_decodeIndexBuffer,y,x,T,_)},decodeIndexSequence:function(y,x,T,_){c(i,i.exports.meshopt_decodeIndexSequence,y,x,T,_)},decodeGltfBuffer:function(y,x,T,_,v,I){c(i,i.exports[l[v]],y,x,T,_,i.exports[u[I]])},decodeGltfBufferAsync:function(y,x,T,_,v){return f.length>0?b(y,x,T,l[_],u[v]):o.then(function(){var I=new Uint8Array(y*x);return c(i,i.exports[l[_]],I,y,x,T,i.exports[u[v]]),I})}}})()});function uS(){return Promise.resolve().then(()=>(cS(),aS))}var lS=p(()=>{"use strict"});async function eN(){return wd||(wd=uS().then(async({MeshoptDecoder:r})=>(await r.ready,r),r=>{throw wd=void 0,new Error("Failed to load the packaged meshopt decoder.",{cause:r})})),wd}function tN(r){return typeof r=="string"?r:["NONE","OCTAHEDRAL","QUATERNION","EXPONENTIAL","COLOR"][r]}async function fS(r,e,t,n,s,i="NONE"){(await eN()).decodeGltfBuffer(r,e,t,n,s,tN(i))}var wd,dS=p(()=>{"use strict";lS()});async function xd(r,e,t){if(!e.gltf?.decompressMeshes&&e.gltf?.decompressBufferViewIndices===void 0||!e.gltf?.loadBuffers)return;rN(r.json);let n=new ie(r),s=e.gltf.decompressBufferViewIndices,i=s?new Set(typeof s=="function"?s(r.json):s):void 0,o=Array.from(n.bufferViews),a=o.map((c,u)=>i?.has(u)===!1?Promise.resolve():nN(n,c,t));if(await Promise.all(a),i){for(let c of i){let u=o[c];u&&n.removeExtension(u,t)}return}for(let c of o)n.removeExtension(c,t);for(let c of n.buffers)n.removeExtension(c,t);n.removeExtension(t)}function rN(r){let e=r.bufferViews||[];for(let n=0;n<e.length;n++){let s=e[n].extensions;if(s?.KHR_meshopt_compression&&s.EXT_meshopt_compression)throw new Error(`glTF bufferView ${n} cannot use both KHR_meshopt_compression and EXT_meshopt_compression.`)}let t=r.buffers||[];for(let n=0;n<t.length;n++){let s=t[n].extensions;if(s?.KHR_meshopt_compression&&s.EXT_meshopt_compression)throw new Error(`glTF buffer ${n} cannot use both KHR_meshopt_compression and EXT_meshopt_compression.`)}}async function nN(r,e,t){let n=r.getExtension(e,t);if(!n)return;let{byteOffset:s=0,byteLength:i,byteStride:o,count:a,mode:c,filter:u="NONE",buffer:l}=n,f=r.gltf.buffers[l],d=r.gltf.buffers[e.buffer],h=new Uint8Array(f.arrayBuffer,f.byteOffset+s,i),m=new Uint8Array(d.arrayBuffer,d.byteOffset+(e.byteOffset||0),e.byteLength);await fS(m,a,o,h,c,u)}var ey=p(()=>{"use strict";He();dS()});var ty={};J(ty,{decode:()=>sN,name:()=>hS});async function sN(r,e){await xd(r,e,hS)}var hS,pS=p(()=>{"use strict";ey();hS="EXT_meshopt_compression"});var ry={};J(ry,{decode:()=>iN,name:()=>mS});async function iN(r,e){await xd(r,e,mS)}var mS,bS=p(()=>{"use strict";ey();mS="KHR_meshopt_compression"});var ny={};J(ny,{name:()=>oN,preprocess:()=>aN});function aN(r,e){let t=new ie(r);if(t.hasExtension(ho)){if(!ag("image/webp")){if(t.isExtensionRequired(ho))throw new Error(`gltf: Required extension ${ho} not supported by browser`);return}for(let n of t.textures){let s=t.getExtension(n,ho);s&&(n.source=s.source),t.removeExtension(n,ho)}t.removeExtension(ho)}}var ho,oN,gS=p(()=>{"use strict";qn();He();ho="EXT_texture_webp",oN=ho});var sy={};J(sy,{name:()=>cN,preprocess:()=>uN});async function uN(r,e){let t=new ie(r);if(!t.hasExtension(po))return;if(!(await og()).has("image/avif")){if(t.isExtensionRequired(po))throw new Error(`gltf: Required extension ${po} not supported by browser`);return}for(let s of t.textures){let i=t.getExtension(s,po);i&&(s.source=i.source),t.removeExtension(s,po)}t.removeExtension(po)}var po,cN,yS=p(()=>{"use strict";qn();He();po="EXT_texture_avif",cN=po});var iy={};J(iy,{decode:()=>fN,getDDSLoader:()=>iu,name:()=>mo,preprocess:()=>lN});function iu(r){return r?.loaders?.find(e=>e.extensions?.includes("dds")||e.mimeTypes?.includes("image/vnd-ms.dds"))}function lN(r,e,t){let n=new ie(r);if(n.hasExtension(mo)){if(!iu(t)){if(n.isExtensionRequired(mo))throw new Error("gltf: Required extension MSFT_texture_dds needs a DDS parser");return}for(let s of n.textures){let i=n.getExtension(s,mo);i&&(s.source=i.source)}}}async function fN(r,e,t){if(!iu(t)||e.gltf?.loadImages===!1)return;let n=new ie(r);if(n.hasExtension(mo)){for(let s of n.textures)n.removeExtension(s,mo);n.removeExtension(mo)}}var mo,oy=p(()=>{"use strict";He();mo="MSFT_texture_dds"});var ay={};J(ay,{name:()=>dN,preprocess:()=>hN});function hN(r,e){let t=new ie(r);for(let n of t.textures){let s=t.getExtension(n,Td);s&&(n.source=s.source,t.removeExtension(n,Td))}t.removeExtension(Td)}var Td,dN,wS=p(()=>{"use strict";He();Td="KHR_texture_basisu",dN=Td});var ou,cy=p(()=>{"use strict";ou="5.0.0-beta.5"});var au,uy=p(()=>{"use strict";au={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]}});var xS,TS=p(()=>{"use strict";xS={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"}});async function bo(r,e=null,t={},n=null,s=null){if(Xe&&t.useLocalLibraries&&!t.CDN&&n&&t.modules?.[n]===void 0){let i=Yi?"./libs":`modules/${e}/dist/libs`;t={...t,modules:{[n]:`${i}/${n}`,...s?{[s]:`${i}/${s}`}:{},...t.modules}}}return await ia(r,e,t,n,s)}var _S=p(()=>{"use strict";Js()});var pN,mN,cu,AS,Ae,go,vS=p(()=>{"use strict";pN="1.5.7",mN="8786740086a9f4d83f44aa83badfbea4dce7a1b5",cu=`https://www.gstatic.com/draco/versioned/decoders/${pN}`,AS=`https://cdn.jsdelivr.net/gh/google/draco@${mN}/javascript`,Ae={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",GLTF_DECODER:"draco_wasm_wrapper_gltf.js",GLTF_DECODER_WASM:"draco_decoder_gltf.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js",ENCODER_WASM:"draco_encoder.wasm"},go={[Ae.DECODER]:`${cu}/${Ae.DECODER}`,[Ae.DECODER_WASM]:`${cu}/${Ae.DECODER_WASM}`,[Ae.GLTF_DECODER]:`${cu}/${Ae.GLTF_DECODER}`,[Ae.GLTF_DECODER_WASM]:`${cu}/${Ae.GLTF_DECODER_WASM}`,[Ae.FALLBACK_DECODER]:`${cu}/${Ae.FALLBACK_DECODER}`,[Ae.ENCODER]:`${AS}/${Ae.ENCODER}`,[Ae.ENCODER_WASM]:`${AS}/${Ae.ENCODER_WASM}`}});async function _d(r={},e,t="full"){let n=DS(r);return n?await dy(n):await bN(r,e==="js"?"javascript":e,t)}async function bN(r={},e,t="full"){let n=RS(`${e}:${t}`,r),s=IS.get(n);return s||(s=gN(r,e,t),IS.set(n,s)),await s}async function dy(r){let e=xN(r),t=ES.get(e);return t||(t=Ji(()=>e.createDecoderModule({}),n=>({draco:n})),ES.set(e,t)),await t}async function hy(r={}){let e=DS(r);if(e){let s=TN(e),i=LS.get(s);return i||(i=Ji(()=>s.createEncoderModule({}),o=>({draco:o})),LS.set(s,i)),await i}let t=RS("encoder",r),n=SS.get(t);return n||(n=wN(r),SS.set(t,n)),await n}async function gN(r,e,t){try{return await FS(r,e,t)}catch(n){if(e==="javascript")throw n;try{return await FS(r,"javascript","full")}catch(s){throw new AggregateError([n,s],"Draco decoder could not load either the WebAssembly or JavaScript backend")}}}async function FS(r,e,t){let n=BS.then(()=>yN(r,e,t));return BS=n.then(()=>{},()=>{}),await n}async function yN(r,e,t){if(e==="javascript"){let o;try{o=await bo(go[Ae.FALLBACK_DECODER],"scene",r,Ae.FALLBACK_DECODER,"draco_decoder.mjs")}catch(c){if(Xe||r.useLocalLibraries)throw c;o=await bo(go[Ae.FALLBACK_DECODER],"scene",{...r,useLocalLibraries:!0},Ae.FALLBACK_DECODER,"draco_decoder.mjs")}let a=fy(o,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await ly(a)}let n,s;try{[n,s]=await OS(r,t)}catch(o){if(Xe||r.useLocalLibraries)throw o;[n,s]=await OS({...r,useLocalLibraries:!0},t)}let i=fy(n,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await ly(i,s)}async function OS(r,e){let t=e==="gltf"?Ae.GLTF_DECODER:Ae.DECODER,n=e==="gltf"?Ae.GLTF_DECODER_WASM:Ae.DECODER_WASM;return await Promise.all([bo(go[t],"scene",r,t,e==="gltf"?"draco_wasm_wrapper_gltf.mjs":"draco_wasm_wrapper.mjs"),bo(go[n],"scene",r,n)])}async function wN(r){let e,t;try{[e,t]=await MS(r)}catch(s){if(Xe||r.useLocalLibraries)throw s;[e,t]=await MS({...r,useLocalLibraries:!0})}let n=fy(e,"DracoEncoderModule")||globalThis.DracoEncoderModule;return await ly(n,t)}async function MS(r){return await Promise.all([bo(go[Ae.ENCODER],"scene",r,Ae.ENCODER,"draco_encoder.mjs"),bo(go[Ae.ENCODER_WASM],"scene",r,Ae.ENCODER_WASM)])}function ly(r,e){if(typeof r!="function")throw new Error("Draco module initializer could not be loaded");return Ji(t=>r({...e?{wasmBinary:e}:{},onModuleLoaded:t}),t=>({draco:t}))}function fy(r,e){if(typeof r=="function")return r;if(r&&typeof r=="object"){let t=r,n=t[e]||t.default;return typeof n=="function"?n:void 0}}function DS(r){let e=r.modules?.draco3d;if(e){if(typeof e!="object"&&typeof e!="function")throw new Error("Invalid draco3d module");return e}}function xN(r){let e=r;if(typeof e?.createDecoderModule!="function")throw new Error("Invalid draco3d decoder module");return e}function TN(r){let e=r;if(typeof e?.createEncoderModule!="function")throw new Error("Invalid draco3d encoder module");return e}function RS(r,e){let t=Object.entries(e.modules||{}).filter(([n])=>n!=="draco3d").map(([n,s])=>`${n}:${String(s)}`).sort().join("|");return[r,e.useLocalLibraries?"local":"remote",e.CDN||"",t].join("|")}var IS,SS,ES,LS,BS,uu=p(()=>{"use strict";Ue();_S();vS();IS=new Map,SS=new Map,ES=new WeakMap,LS=new WeakMap;BS=Promise.resolve()});function NS(r,e,t){let n=CS(e.metadata),s=[],i=_N(e.attributes);for(let o in r){let a=r[o],c=kS(o,a,i[o]);s.push(c)}if(t){let o=kS("indices",t);s.push(o)}return{fields:s,metadata:n}}function _N(r){let e={};for(let t in r){let n=r[t];e[n.name||"undefined"]=n}return e}function kS(r,e,t){let n={...$f(e),...t?CS(t.metadata):{}};return Wf(r,e,n)}function CS(r){Object.entries(r);let e={};for(let t in r)e[`${t}.string`]=JSON.stringify(r[t]);return e}var US=p(()=>{"use strict";mn()});function SN(r,e){switch(e){case Float32Array:return r.DT_FLOAT32;case Int8Array:return r.DT_INT8;case Int16Array:return r.DT_INT16;case Int32Array:return r.DT_INT32;case Uint8Array:return r.DT_UINT8;case Uint16Array:return r.DT_UINT16;case Uint32Array:return r.DT_UINT32;default:return r.DT_INVALID}}function EN(r){let e=r.size(),t=new Int32Array(e);for(let n=0;n<e;n++)t[n]=r.GetValue(n);return t}function LN(r){let e=r.size(),t=new Uint32Array(e);for(let n=0;n<e;n++)t[n]=r.GetValue(n);return t}function BN(r,e){if(!Object.prototype.hasOwnProperty.call(e,r))return r;let t=/^(.*)_([0-9]+)$/.exec(r),n=t?t[1]:r,s=t?BigInt(t[2])+1n:1n;for(;Object.prototype.hasOwnProperty.call(e,`${n}_${s}`);)s++;return`${n}_${s}`}function FN(r){if(r.quantization_transform){let{quantization_bits:e,min_values:t,range:n}=r.quantization_transform;if(e!==void 0&&t&&n!==void 0)return{type:"quantization",bits:e,origin:Array.from(t),range:n}}if(r.octahedron_transform?.quantization_bits!==void 0)return{type:"octahedron",bits:r.octahedron_transform.quantization_bits}}function ON(r){if(r.includeAttributes&&r.excludeAttributes)throw new Error("DracoLoader: includeAttributes and excludeAttributes cannot be combined")}function MN(r,e){for(let t of r.includeAttributes||r.excludeAttributes||[])if(!e.includes(t))throw new Error(`DracoLoader: selected attribute "${t}" does not exist`)}function DN(r){let e=Er(r);if(!e)throw new Error("Decoded mesh is missing positions");let t=r.POSITION;if(t?.transform?.type!=="quantization")return e;let{bits:n,origin:s,range:i}=t.transform,o=i/(2**n-1);return e.map(a=>a.map((c,u)=>s[u]+c*o))}var PS,AN,vN,IN,lu,VS=p(()=>{"use strict";mn();US();PS={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},AN={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},vN=2,IN=4,lu=class{draco;decoder;metadataQuerier;constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){ON(t);let n=ArrayBuffer.isView(e)?new Int8Array(e.buffer,e.byteOffset,e.byteLength):new Int8Array(e);this._disableAttributeTransforms(t);let s=this.decoder.GetEncodedGeometryType(n),i=s===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud,o=null;try{switch(s){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeArrayToMesh(n,n.byteLength,i);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeArrayToPointCloud(n,n.byteLength,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!i.ptr){let d=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(d)}let a=this._getDracoLoaderData(i,s,t),c=this._getMeshData(i,a,t),u=DN(c.attributes),l=NS(c.attributes,a,c.indices);return{loader:"draco",loaderData:a,header:{vertexCount:i.num_points(),boundingBox:u},...c,schema:l}}finally{o&&this.draco.destroy(o),i&&this.draco.destroy(i)}}_getDracoLoaderData(e,t,n){let s=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,n);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:s,attributes:i}}_getDracoAttributes(e,t){let n={};for(let s=0;s<e.num_attributes();s++){let i=this.decoder.GetAttribute(e,s),o=this._getAttributeMetadata(e,s);n[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:s,metadata:o};let a=this._getQuantizationTransform(i,t);a&&(n[i.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(i,t);c&&(n[i.unique_id()].octahedron_transform=c)}return n}_getMeshData(e,t,n){let s=this._getMeshAttributes(t,e,n);if(!s.POSITION)throw new Error("DRACO: No position attribute found.");return e instanceof this.draco.Mesh?n.topology==="triangle-strip"?{topology:"triangle-strip",mode:5,attributes:s,indices:{value:this._getTriangleStripIndices(e),size:1}}:{topology:"triangle-list",mode:4,attributes:s,indices:{value:this._getTriangleListIndices(e),size:1}}:{topology:"point-list",mode:0,attributes:s}}_getMeshAttributes(e,t,n){let s={},i={},a=Object.values(e.attributes).sort((c,u)=>c.attribute_index-u.attribute_index).map(c=>{let u=this._deduceAttributeName(c,n),l=BN(u,i);return i[l]=!0,c.name=l,{attributeName:l,loaderAttribute:c}});MN(n,Object.keys(i));for(let{attributeName:c,loaderAttribute:u}of a){if(!this._shouldExtractAttribute(c,u,n))continue;let l=this._getAttributeValues(t,u);if(l){let{value:f,size:d}=l;s[c]={value:f,size:d,byteOffset:u.byte_offset,byteStride:u.byte_stride,normalized:u.normalized,transform:FN(u)}}}return s}_shouldExtractAttribute(e,t,n){if(t.attribute_type===this.draco.POSITION){if(n.excludeAttributes?.includes(e))throw new Error(`DracoLoader: position attribute "${e}" cannot be excluded`);return!0}return n.includeAttributes&&!n.includeAttributes.includes(e)?!1:!n.excludeAttributes?.includes(e)}_getTriangleListIndices(e){let n=e.num_faces()*3,s=e.num_points()<=65536,i=n*(s?vN:IN),o=this.draco._malloc(i);try{if(s){if(!this.decoder.GetTrianglesUInt16Array(e,i,o))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint16Array(this.draco.HEAPU8.buffer,o,n).slice()}if(!this.decoder.GetTrianglesUInt32Array(e,i,o))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint32Array(this.draco.HEAPU8.buffer,o,n).slice()}finally{this.draco._free(o)}}_getTriangleStripIndices(e){let t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),LN(t)}finally{this.draco.destroy(t)}}_getAttributeValues(e,t){let n=AN[t.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${t.data_type}`),null;let s=t.num_components,o=e.num_points()*s,a=o*n.BYTES_PER_ELEMENT,c=SN(this.draco,n),u,l=this.draco._malloc(a);try{let f=this.decoder.GetAttribute(e,t.attribute_index);if(!this.decoder.GetAttributeDataArrayForAllPoints(e,f,c,a,l))throw new Error(`DRACO: Failed to decode attribute ${t.unique_id}.`);u=new n(this.draco.HEAPU8.buffer,l,o).slice()}finally{this.draco._free(l)}return{value:u,size:s}}_deduceAttributeName(e,t){let n=e.unique_id;for(let[o,a]of Object.entries(t.extraAttributes||{}))if(a===n)return o;let s=t.attributeNameEntry||"name";if(e.metadata[s]){let o=e.metadata[s].string;return o==="COLOR"?"COLOR_0":o==="TEX_COORD"?"TEXCOORD_0":o}let i=e.attribute_type;for(let o in PS)if(this.draco[o]===i)return PS[o];return`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(e){let t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}_getAttributeMetadata(e,t){let n=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(n)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let t={},n=this.metadataQuerier.NumEntries(e);for(let s=0;s<n;s++){let i=this.metadataQuerier.GetEntryName(e,s);t[i]=this._getDracoMetadataField(e,i)}return t}_getDracoMetadataField(e,t){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,n);let s=EN(n);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:s}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:t=[],octahedronAttributes:n=[]}=e,s=[...t,...n];for(let i of s)this.decoder.SkipAttributeTransform(this.draco[i])}_getQuantizationTransform(e,t){let{quantizedAttributes:n=[]}=t,s=e.attribute_type();if(n.map(o=>this.draco[o]).includes(s)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:Float32Array.from({length:e.num_components()},(a,c)=>o.min_value(c))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){let{octahedronAttributes:n=[]}=t,s=e.attribute_type();if(n.map(o=>this.draco[o]).includes(s)){let o=new this.draco.AttributeOctahedronTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}});async function Ta(r,e,t,n){let s=n?.reportProgress||e?.onProgress;s?.({phase:"decode",completed:0,total:1,unit:"tasks"});let{draco:i}=await t();(e?.signal||n?.signal)?.throwIfAborted();let o=new lu(i);try{let a=o.parseSync(r,e?.draco);return s?.({phase:"decode",completed:1,total:1,unit:"tasks"}),e?.draco?.shape==="arrow-table"?ei(a,"arrow-table"):a}finally{o.destroy()}}var Ad=p(()=>{"use strict";mn();VS()});var qee,RN,kN,jS=p(()=>{"use strict";Js();uu();Ad();fu();({preload:qee,...RN}=Hn),kN={...RN,parse:async(r,e,t)=>await Ta(r,e,async()=>await _d(hn(e),"wasm",e?.draco?.decoderProfile),t)}});var py={};J(py,{DracoWASMLoaderWithParser:()=>kN});var my=p(()=>{"use strict";jS()});var Zee,NN,CN,GS=p(()=>{"use strict";Js();uu();Ad();fu();({preload:Zee,...NN}=Hn),CN={...NN,parse:async(r,e,t)=>await Ta(r,e,async()=>await _d(hn(e),"js"),t)}});var by={};J(by,{DracoJavaScriptLoaderWithParser:()=>CN});var gy=p(()=>{"use strict";GS()});function VN(r){let e=r?.modules?.draco3d;if(!e)throw new Error('DracoLoader: backend "draco3d" requires options.modules.draco3d');return e}var ite,UN,PN,zS=p(()=>{"use strict";uu();Ad();fu();({preload:ite,...UN}=Hn),PN={...UN,parse:async(r,e,t)=>await Ta(r,e,async()=>await dy(VN(e)),t)}});var yy={};J(yy,{Draco3DLoaderWithParser:()=>PN});var wy=p(()=>{"use strict";zS()});async function jN(r,e){let t=e;switch(GN(t)){case"wasm":{let{DracoWASMLoaderWithParser:n}=await Promise.resolve().then(()=>(my(),py));return n}case"javascript":{let{DracoJavaScriptLoaderWithParser:n}=await Promise.resolve().then(()=>(gy(),by));return n}case"draco3d":{let{Draco3DLoaderWithParser:n}=await Promise.resolve().then(()=>(wy(),yy));return n}default:throw new Error(`DracoLoader: unsupported backend "${t?.draco?.backend}"`)}}function GN(r){return r?.draco?.backend?r.draco.backend==="js"?"javascript":r.draco.backend:Hn.options.draco.backend}var Hn,fu=p(()=>{"use strict";ea();cy();uy();TS();Hn={dataType:null,batchType:null,...au,version:ou,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:af,deserializeWorkerResult:cf,options:{draco:xS},preload:jN}});var WS=p(()=>{"use strict";fu()});function $S(r){let e={};for(let t in r){let n=r[t];if(t!=="indices"){let s=xy(n);e[t]=s}}return e}function xy(r){let{buffer:e,size:t,count:n}=zN(r);return{value:e,size:t,byteOffset:0,count:n,type:ma(t),componentType:Xn(e)}}function zN(r){let e=r,t=1,n=0;return r&&r.value&&(e=r.value,t=r.size||1),e&&(ArrayBuffer.isView(e)||(e=WN(e,Float32Array)),n=e.length/t),{buffer:e,size:t,count:n}}function WN(r,e,t=!1){return r?Array.isArray(r)?new e(r):t&&!(r instanceof e)?new e(r):r:null}var qS=p(()=>{"use strict";ri()});var Ty={};J(Ty,{decode:()=>KN,name:()=>$N,preprocess:()=>qN});function qN(r,e,t){let n=new ie(r);for(let s of n.meshes)for(let i of n.getReferences(s).primitives)n.getExtension(i,_a)}async function KN(r,e,t){if(!e?.gltf?.decompressMeshes)return;let n=new ie(r),s=[];for(let i of n.meshes)for(let o of n.getReferences(i).primitives)n.getExtension(o,_a)&&s.push(XN(n,o,e,t));await Promise.all(s),n.removeExtension(_a)}async function XN(r,e,t,n){let s=r.getExtension(e,_a);if(!s)return;let i=hr(r.data,r.gltf.buffers,s.bufferView),o=eo(i.buffer,i.byteOffset,i.byteLength),a={...t,draco:{...t.draco,shape:"mesh",topology:"triangle-list",decoderProfile:t.draco?.decoderProfile||"gltf",extraAttributes:s.attributes}};delete a["3d-tiles"];let c=await Xs(o,Hn,a,n),u=$S(c.attributes);for(let l of Object.keys(s.attributes))if(!Object.hasOwn(u,l))throw new Error(`glTF: Draco decompression did not produce attribute ${l}`);for(let[l,f]of Object.entries(u))if(l in e.attributes){let d=e.attributes[l],h=r.data.accessors?.[d];h?.normalized!==void 0&&(f.normalized=h.normalized),h?.min&&h?.max&&(f.min=h.min,f.max=h.max)}e.attributes={...e.attributes,...u},c.indices&&(e.indices=xy(c.indices),e.mode=4),r.removeExtension(e,_a),HN(e)}function HN(r){if(!r.attributes||Object.keys(r.attributes).length===0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}var _a,$N,KS=p(()=>{"use strict";Ue();WS();He();qS();ao();_a="KHR_draco_mesh_compression",$N=_a});var Ay={};J(Ay,{decode:()=>ZN,name:()=>JN});async function ZN(r,e){let t=new ie(r);if(!t.hasExtension(Aa)||!e.gltf?.loadBuffers)return;let s=r.json.materials||[];for(let i=0;i<s.length;i++)eC(i,r,t);s.some(i=>_y(i).length>0)||t.removeExtension(Aa)}function eC(r,e,t){let n=e.json.materials?.[r],s=_y(n),i=new Map,o=rC(e);for(let a of s){let c=a.extensions?.[Aa];if(c){let u=c.texCoord??a.texCoord??0,l=nC(u,c),f=i.get(l);if(!f){if(f={sourceTexCoord:u,texCoord:o,matrix:aC(c)},!sC(e,r,f))continue;o++,i.set(l,f)}a.texCoord=f.texCoord,tC(t,a,Aa),a.extensions&&Object.keys(a.extensions).length===0&&delete a.extensions}}}function tC(r,e,t){e.extensions?.[t]!==void 0&&(r.recordRemovedExtension(t),delete e.extensions[t])}function _y(r){if(!r||typeof r!="object")return[];let e=r,t=[],n=e.extensions;Number.isFinite(e.index)&&n?.[Aa]&&t.push(e);for(let[s,i]of Object.entries(e))s!=="extras"&&t.push(..._y(i));return t}function rC(r){let e=-1;for(let t of r.json.meshes||[])for(let n of t.primitives)for(let s of Object.keys(n.attributes)){let i=/^TEXCOORD_(\d+)$/.exec(s);i&&(e=Math.max(e,Number(i[1])))}return e+1}function nC(r,e){let{offset:t=[0,0],rotation:n=0,scale:s=[1,1]}=e;return JSON.stringify([r,t,n,s])}function sC(r,e,t){let n=[],s=r.json.meshes||[];for(let i of s)for(let o of i.primitives){let a=o.material;Number.isFinite(a)&&e===a&&n.push(o)}if(n.length===0||n.some(i=>!iC(r,i,t.sourceTexCoord)))return!1;for(let i of n)oC(r,i,t);return!0}function iC(r,e,t){let n=e.attributes[`TEXCOORD_${t}`],s=n;if(ArrayBuffer.isView(s?.value))return!0;if(!Number.isFinite(n))return!1;let i=r.json.accessors?.[n];if(!i||i.bufferView===void 0||i.sparse)return!1;let o=r.json.bufferViews?.[i.bufferView];return!!(o&&r.buffers[o.buffer])}function oC(r,e,t){let{sourceTexCoord:n,texCoord:s,matrix:i}=t,o=e.attributes[`TEXCOORD_${n}`],a=o;if(ArrayBuffer.isView(a?.value)){let c=new Float32Array(a.count*2);for(let u=0;u<a.count;u++)XS(a.value.subarray(u*2,u*2+2),a,i,c,u*2);HS(s,a,e,r,c);return}if(Number.isFinite(o)){let c=r.json.accessors?.[o];if(c&&c.bufferView!==void 0){let u=r.json.bufferViews?.[c.bufferView];if(u){let{arrayBuffer:l,byteOffset:f}=r.buffers[u.buffer],d=(f||0)+(c.byteOffset||0)+(u.byteOffset||0),{ArrayType:h,length:m}=Zc(c,u),b=Qc[c.componentType],g=ud[c.type],y=u.byteStride||b*g,x=new Float32Array(m);for(let T=0;T<c.count;T++){let _=new h(l,d+T*y,2);XS(_,c,i,x,T*g)}HS(s,c,e,r,x)}}}}function XS(r,e,t,n,s){let i=e.componentType===5120||e.componentType===5122,o=2**(Qc[e.componentType]*8-(i?1:0))-1;vd.set(e.normalized?Math.max(r[0]/o,-1):r[0],e.normalized?Math.max(r[1]/o,-1):r[1],1),vd.transformByMatrix3(t),n.set([vd[0],vd[1]],s)}function HS(r,e,t,n,s){n.buffers.push({arrayBuffer:ro(s.buffer),byteOffset:0,byteLength:s.buffer.byteLength}),n.json.bufferViews=n.json.bufferViews||[];let i=n.json.bufferViews;i.push({buffer:n.buffers.length-1,byteLength:s.buffer.byteLength,byteOffset:0});let o=n.json.accessors;o&&(o.push({bufferView:i?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),t.attributes[`TEXCOORD_${r}`]=o.length-1)}function aC(r){let{offset:e=[0,0],rotation:t=0,scale:n=[1,1]}=r,s=new zn().set(1,0,0,0,1,0,e[0],e[1],1),i=YN.set(Math.cos(t),Math.sin(t),0,-Math.sin(t),Math.cos(t),0,0,0,1),o=QN.set(n[0],0,0,0,n[1],0,0,0,1);return s.multiplyRight(i).multiplyRight(o)}var Aa,JN,vd,YN,QN,JS=p(()=>{"use strict";Uf();ri();gg();He();Ue();Aa="KHR_texture_transform",JN=Aa,vd=new jc,YN=new zn,QN=new zn});var vy={};J(vy,{decode:()=>uC,encode:()=>lC,name:()=>cC});async function uC(r){let e=new ie(r),t=e.getExtension(yo);t&&(e.data.lights=t.lights,e.removeExtension(yo));for(let n of e.nodes){let s=e.getExtension(n,yo);s&&(n.light=s.light),e.removeExtension(n,yo)}}async function lC(r){let e=new bn(r),{json:t}=e;if(t.lights){let n=e.addExtension(yo);H(!n.lights),n.lights=t.lights,delete t.lights}if(e.json.lights){for(let n of e.json.lights){let s=n.node;e.addObjectExtension(s,yo,n)}delete e.json.lights}}var yo,cC,YS=p(()=>{"use strict";oo();He();eu();yo="KHR_lights_punctual",cC=yo});var Iy={};J(Iy,{decode:()=>dC,encode:()=>hC,name:()=>fC});async function dC(r){let e=new ie(r);for(let t of e.materials)e.getExtension(t,va)&&(t.unlit=!0),e.removeExtension(t,va);e.removeExtension(va)}function hC(r){let e=new bn(r);for(let t of r.json.materials||[]){let n=t;n.unlit&&(delete n.unlit,e.addObjectExtension(t,va,{}),e.registerRequiredExtension(va))}for(let t of["extensionsUsed","extensionsRequired"])r.json[t]?.length===0&&delete r.json[t]}var va,fC,QS=p(()=>{"use strict";He();eu();va="KHR_materials_unlit",fC=va});var Sy={};J(Sy,{decode:()=>mC,encode:()=>bC,name:()=>pC});async function mC(r){let e=new ie(r),t=e.getExtension(du);if(t){let n=gC(t,e);for(let s of e.materials){let i=e.getExtension(s,du);i&&(s.technique=Object.assign({},i,n[i.technique]),s.technique.values=yC(s.technique,e)),e.removeExtension(s,du)}e.removeExtension(du)}}async function bC(r,e){}function gC(r,e){let{programs:t=[],shaders:n=[],techniques:s=[]}=r,i=new TextDecoder;return n.forEach(o=>{if(Number.isFinite(o.bufferView))o.code=i.decode(hr(e.data,e.gltf.buffers,o.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),t.forEach(o=>{o.fragmentShader=n[o.fragmentShader],o.vertexShader=n[o.vertexShader]}),s.forEach(o=>{o.program=t[o.program]}),s}function yC(r,e){let t=Object.assign({},r.values);return Object.keys(r.uniforms||{}).forEach(n=>{r.uniforms[n].value&&!(n in t)&&(t[n]=r.uniforms[n].value)}),Object.keys(t).forEach(n=>{typeof t[n]=="object"&&t[n].index!==void 0&&(t[n].texture=e.resolveTexture(t[n].index,`technique.values.${n}.index`))}),t}var du,pC,ZS=p(()=>{"use strict";He();ao();du="KHR_techniques_webgl",pC=du});var Ey={};J(Ey,{decode:()=>xC,name:()=>wC});async function xC(r,e){let t=new ie(r);TC(t,e)}function TC(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(eE);t&&(e.gltf?.loadImages&&_C(r,t),AC(r,t))}function _C(r,e){let t=e.schema;if(!t)return;let n=t.classes,{featureTextures:s}=e;if(n&&s)for(let i in n){let o=n[i],a=IC(s,i);a&&EC(r,a,o)}}function AC(r,e){let t=e.schema;if(!t)return;let n=t.classes,s=e.featureTables;if(n&&s)for(let i in n){let o=vC(s,i);o&&SC(r,t,o)}}function vC(r,e){for(let t in r){let n=r[t];if(n.class===e)return n}return null}function IC(r,e){for(let t in r){let n=r[t];if(n.class===e)return n}return null}function SC(r,e,t){if(!t.class)return;let n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);let s=t.count;for(let i in n.properties){let o=n.properties[i],a=t.properties?.[i];if(a){let c=LC(r,e,o,s,a);a.data=c}}}function EC(r,e,t){let n=e.class;for(let s in t.properties){let i=e?.properties?.[s];if(i){let o=DC(r,i,n);i.data=o}}}function LC(r,e,t,n,s){let i=[],o=s.bufferView,a=r.getTypedArrayForBufferView(o),c=BC(r,t,s,n),u=FC(r,t,s,n,c);return t.type==="STRING"||t.componentType==="STRING"?i=pd(n,a,c,u,t.type==="ARRAY"?t.componentCount:void 0):OC(t)&&(i=MC(t,n,a,c)),i}function BC(r,e,t,n){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof t.arrayOffsetBufferView<"u"?ba(r,t.arrayOffsetBufferView,t.offsetType||"UINT32",n):null}function FC(r,e,t,n,s){if(typeof t.stringOffsetBufferView<"u"){let i=s?Number(s[n]):n*(e.type==="ARRAY"&&e.componentCount||1);return ba(r,t.stringOffsetBufferView,t.offsetType||"UINT32",i)}return null}function OC(r){let e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(r.type)||typeof r.componentType<"u"&&e.includes(r.componentType)}function MC(r,e,t,n){let s=r.type==="ARRAY",i=r.componentCount,o="SCALAR",a=r.componentType||r.type,c=tu(o,a),u=t.byteLength/c,l=ga(t,o,a,u);return s?n?ru(l,e,n):i?nu(l,e,i):[]:l}function DC(r,e,t){let n=r.data;if(!n.meshes)return[];let s=[];for(let i of n.meshes)for(let o of i.primitives)RC(r,t,e,s,o);return s}function RC(r,e,t,n,s){let i={channels:t.channels,...t.texture},o=ya(r,i,s);o&&hd(r,e,o,n,s)}var eE,wC,tE=p(()=>{"use strict";He();md();eE="EXT_feature_metadata",wC=eE});async function nE(r,e={},t){let n=rE.filter(s=>iE(s.name,e));for(let s of n)await s.preprocess?.(r,e,t)}async function sE(r,e={},t){let n=rE.filter(s=>iE(s.name,e));for(let s of n)await s.decode?.(r,e,t)}function iE(r,e){let t=e?.gltf?.excludeExtensions||{};return Array.isArray(t)?!t.includes(r):!(r in t&&!t[r])}var rE,oE=p(()=>{"use strict";$I();YI();QI();eS();tS();nS();iS();oS();pS();bS();gS();yS();oy();wS();KS();JS();Jg();YS();QS();ZS();tE();rE=[xg,ry,ty,Ty,Wg,Vg,qg,Xg,Hg,Yg,Qg,Zg,ny,sy,iy,ay,vy,Iy,Sy,Ay,Ey]});function aE(r){let e=new ie(r);for(let t of e.images){let n=e.getExtension(t,Ly);n&&(t.bufferView=n.bufferView,t.mimeType=n.mimeType,delete t.uri),e.removeExtension(t,Ly)}for(let t of e.data.buffers||[])t.id==="binary_glTF"&&delete t.uri;e.removeExtension(Ly)}var Ly,cE=p(()=>{"use strict";He();Ly="KHR_binary_glTF"});function lE(r,e){let t=r.accessors||[],n=r.bufferViews||[],s=NC(r),i=new Map;for(let[o,a]of t.entries()){let c=a.bufferView;if(c===void 0&&!a.byteStride){delete a.byteStride;continue}let u=n[c],l=s.get(o)||"unused",f=CC(a),d=a.byteStride===0?f:a.byteStride??f,h=a.byteOffset??0,m=u?.byteOffset??0,b=typeof a.componentType=="number"&&Object.hasOwn(Id,a.componentType)?Id[a.componentType]:0,g=l==="vertex",y=g?d>=f&&d>=4&&d<=252&&d%4===0&&h%4===0&&(m+h)%4===0:d===f;if(!u||!f||l==="mixed"||!Number.isInteger(d)||!y||g&&d>u.byteLength||!Number.isInteger(a.count)||a.count<1||!Number.isInteger(h)||h<0||!Number.isInteger(m)||m<0||h%b!==0||(m+h)%b!==0||a.type.startsWith("MAT")&&(m+h)%4!==0||!Number.isInteger(u.byteLength)||h+(a.count-1)*d+f>u.byteLength){e(o);continue}let x=`${c}:${l}:${g?d:0}`,T=i.get(x);if(T===void 0){let _={...u};delete _.id,delete _.byteStride,delete _.target,g?(_.byteStride=d,_.target=34962):l==="indices"&&(_.target=34963),T=n.length,n.push(_),i.set(x,T)}a.bufferView=T,delete a.byteStride}}function NC(r){let e=new Map,t=(n,s)=>{if(n===void 0)return;let i=e.get(n);e.set(n,i&&i!==s?"mixed":s)};for(let n of r.meshes||[])for(let s of n.primitives){for(let i of Object.values(s.attributes))t(i,"vertex");t(s.indices,"indices")}for(let n of r.animations||[])for(let s of n.samplers)t(s.input,"animation"),t(s.output,"animation");for(let n of r.skins||[])t(n.inverseBindMatrices,"inverseBind");return e}function CC(r){let e=typeof r.componentType=="number"&&Object.hasOwn(Id,r.componentType)?Id[r.componentType]:0,t=Object.hasOwn(uE,r.type)?uE[r.type]:0;if(!e||!t)return 0;let n=r.type==="MAT2"?2:r.type==="MAT3"?3:4;return r.type.startsWith("MAT")&&n*e%4!==0?0:(e||0)*t}var Id,uE,fE=p(()=>{"use strict";Id={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},uE={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}});function dE(r,e,t){let n=r.nodes||[],s=r.skins||[],i=s.length,o=!1;for(let a=0;a<i;a++){let c=s[a],u=c.jointNames;if(!Array.isArray(u)||u.length===0||u.some(m=>typeof m!="string"||!m)||new Set(u).size!==u.length){t(`skin ${a} has invalid joint names`),o=!0;continue}let l=n.flatMap((m,b)=>m.skin===a?[b]:[]),f=(l.length?l:[void 0]).map(m=>UC(n,u,m,e,b=>t(`skin ${a} ${b}`))),d=f.some(m=>!m);o||=d;let h=new Map;for(let m of f){if(!m)continue;let b=`${m.skeletonIndex}:${m.jointIndices.join(",")}`,g=h.get(b);if(g===void 0){let y={...c,joints:m.jointIndices,skeleton:m.skeletonIndex};delete y.jointNames,c.bindShapeMatrix!==void 0&&jC(c.bindShapeMatrix)&&delete y.bindShapeMatrix,!d&&h.size===0?(g=a,s[a]=y):(delete y.id,g=s.length,s.push(y)),h.set(b,g)}m.nodeIndex!==void 0&&(n[m.nodeIndex].skin=g,delete n[m.nodeIndex].skeletons)}}if(!o)for(let a of n)delete a.jointName}function UC(r,e,t,n,s){let i=t===void 0?void 0:r[t].skeletons;if(i!==void 0&&(!Array.isArray(i)||i.some(f=>typeof f!="string"||!f)||new Set(i).size!==i.length))return s("has invalid skeleton roots"),null;let o=(i||[]).map(n),a=o.length?PC(r,o):r.map((f,d)=>d);if(!a)return s("has invalid or overlapping skeleton subtrees"),null;let c=[],u=new Map;for(let f of a){let d=r[f].jointName;if(d===void 0)continue;let h=u.get(d)||[];h.push(f),u.set(d,h)}for(let f of e){let d=u.get(f)||[];if(d.length!==1)return s(`cannot uniquely resolve joint ${f}`),null;c.push(d[0])}let l=VC(r,[...c,...o]);return l===void 0?(s("joints have no unambiguous common hierarchy root"),null):{nodeIndex:t,jointIndices:c,skeletonIndex:o.length===1?o[0]:l}}function PC(r,e){let t=new Set,n=[...e];for(;n.length;){let s=n.pop();if(!Number.isSafeInteger(s)||!r[s]||t.has(s))return null;t.add(s),n.push(...r[s].children||[])}return Array.from(t)}function VC(r,e){let t=new Map;for(let[i,o]of r.entries())for(let a of o.children||[]){if(!Number.isSafeInteger(a)||!r[a]||t.has(a))return;t.set(a,i)}let n=e.map(i=>{let o=[],a=new Set,c=i;for(;c!==void 0;){if(a.has(c))return[];a.add(c),o.push(c),c=t.get(c)}return o}),s=n.map(i=>new Set(i));return n[0].find(i=>s.every(o=>o.has(i)))}function jC(r){return Array.isArray(r)&&r.length===16&&Array.from(r).every((e,t)=>e===(t%5===0?1:0))}var hE=p(()=>{"use strict"});function Sd(r,e){if(!e.length)return;let t=new Map;for(let n of e){let s=t.get(n.bufferIndex)||[];s.push(n),t.set(n.bufferIndex,s)}r.buffers=[...r.buffers],r.json.bufferViews||=[];for(let[n,s]of t){let i=r.json.buffers[n],o=r.buffers[n],a=_e(i.byteLength,4),c=a+s.reduce((f,d)=>f+_e(d.bytes.byteLength,4),0),u=new ArrayBuffer(c),l=new Uint8Array(u);l.set(new Uint8Array(o.arrayBuffer,o.byteOffset,i.byteLength));for(let f of s){l.set(new Uint8Array(f.bytes),a);let d=r.json.bufferViews.length;r.json.bufferViews.push({buffer:n,byteOffset:a,byteLength:f.bytes.byteLength,...f.byteStride===void 0?{}:{byteStride:f.byteStride},...f.target===void 0?{}:{target:f.target}}),f.apply(d),a+=_e(f.bytes.byteLength,4)}i.byteLength=c,i.uri!==void 0&&(i.uri=`data:application/octet-stream;base64,${cb(u)}`),r.buffers[n]={arrayBuffer:u,byteOffset:0,byteLength:c}}}var By=p(()=>{"use strict";Ue()});function pE(r,e){let t=new Map;for(let[n,s]of(r.json.skins||[]).entries()){if(s.bindShapeMatrix===void 0)continue;let i=s.bindShapeMatrix;if(!mE(i)){e(`skin ${n} non-identity bindShapeMatrix requires a finite affine matrix`);continue}let o=`${s.inverseBindMatrices}:${i.join(",")}`,a=t.get(o);if(a){if((s.joints||s.jointNames||[]).length>a.count){e(`skin ${n} non-identity bindShapeMatrix has too few inverse-bind matrices`);continue}a.skins.push(s);continue}let c=GC(r,s,i);if(typeof c=="string"){e(`skin ${n} non-identity bindShapeMatrix ${c}`);continue}t.set(o,c)}Sd(r,Array.from(t.values(),n=>({bufferIndex:n.bufferIndex,bytes:n.matrixBytes,apply:s=>{r.json.accessors||=[];let i=r.json.accessors.length;r.json.accessors.push({bufferView:s,byteOffset:0,componentType:5126,count:n.count,type:"MAT4"});for(let o of n.skins)o.inverseBindMatrices=i,delete o.bindShapeMatrix}})))}function GC(r,e,t){let n=r.json.accessors?.[e.inverseBindMatrices],s=(e.joints||e.jointNames||[]).length;if(!n||n.componentType!==5126||n.type!=="MAT4"||n.normalized||n.sparse||n.extensions||Object.hasOwn(n,"byteStride")||!Number.isSafeInteger(n.count)||n.count<1)return"requires packed FLOAT MAT4 inverse-bind matrices";if(n.count<s)return"has too few inverse-bind matrices";let i=r.json.bufferViews?.[n.bufferView],o=i?.buffer,a=r.json.buffers?.[o],c=r.buffers[o];if(!i||o===void 0||!a||!c)return"requires a loaded inverse-bind buffer";if(i.extensions)return"does not support inverse-bind buffer-view extensions";let u=i.byteOffset??0,l=n.byteOffset??0,f=n.count*64;if(!(c.arrayBuffer instanceof ArrayBuffer)||!Number.isSafeInteger(a.byteLength)||a.byteLength<1||!Number.isSafeInteger(c.byteOffset)||c.byteOffset<0||!Number.isSafeInteger(c.byteLength)||c.byteLength<a.byteLength||c.byteOffset+c.byteLength>c.arrayBuffer.byteLength||!Number.isSafeInteger(u)||u<0||u%4!==0||!Number.isSafeInteger(i.byteLength)||i.byteLength<1||i.byteStride!==void 0||u+i.byteLength>a.byteLength||!Number.isSafeInteger(l)||l<0||l%4!==0||l+f>i.byteLength)return"has an invalid inverse-bind buffer layout";let d=new DataView(c.arrayBuffer),h=c.byteOffset+u+l,m=new ArrayBuffer(f),b=new DataView(m);for(let g=0;g<n.count;g++){let y=Array.from({length:16},(x,T)=>d.getFloat32(h+g*64+T*4,!0));if(!mE(y))return"requires finite affine inverse-bind matrices";for(let x=0;x<4;x++)for(let T=0;T<4;T++){let _=0;for(let v=0;v<4;v++)_+=y[v*4+T]*t[x*4+v];if(!Number.isFinite(Math.fround(_)))return"produces non-finite FLOAT matrix values";b.setFloat32(g*64+(x*4+T)*4,_,!0)}}return{bufferIndex:o,count:n.count,matrixBytes:m,skins:[e]}}function mE(r){if(!Array.isArray(r)||r.length!==16)return!1;for(let e=0;e<16;e++)if(!Number.isFinite(r[e]))return!1;return r[3]===0&&r[7]===0&&r[11]===0&&r[15]===1}var bE=p(()=>{"use strict";By()});function yE(r){let e=r.accessors||[],t=new Map,n=new Map,s=Oy(r),i=(o,a)=>{if(!Number.isSafeInteger(o)||o<0||!Object.hasOwn(e,o))return o;let c=e[o];if(!c)return o;let u=t.get(o)||new Map,l=`${a.usage}:${a.mode}:${["unit","signed","direction"].includes(a.mode)?a.semantic?.split("_")[0]:""}:${a.hasOpaqueConsumer?"opaque":""}`,f=u.get(l);return f===void 0&&(f=u.size?e.length:o,u.size&&e.push({...c}),u.set(l,f),n.set(f,a),t.set(o,u)),f};for(let o of r.meshes||[])for(let a of o.primitives){for(let[c,u]of Object.entries(a.attributes)){let l=e[u],f=["NORMAL","TANGENT"].includes(c)&&l&&[5120,5121,5122,5123].includes(l.componentType)?"direction":/^JOINTS_\d+$/.test(c)?"joints":/^(COLOR|WEIGHTS|TEXCOORD)_\d+$/.test(c)&&l&&[5120,5122].includes(l.componentType)?"signed":/^(COLOR|WEIGHTS|TEXCOORD)_\d+$/.test(c)&&l&&[5121,5123].includes(l.componentType)&&!l.normalized?"unit":/^WEIGHTS_\d+$/.test(c)?"weights":"copy";a.attributes[c]=i(u,{usage:"vertex",mode:f,semantic:c,...["signed","direction"].includes(f)?{hasOpaqueConsumer:s}:{}})}a.indices!==void 0&&(a.indices=i(a.indices,{usage:"indices",mode:"copy",hasOpaqueConsumer:a.extensions!==void 0}))}for(let o of r.animations||[])for(let a of o.samplers)a.input=i(a.input,{usage:"animation",mode:"copy"}),a.output=i(a.output,{usage:"animation",mode:"copy"});for(let o of r.skins||[])o.inverseBindMatrices!==void 0&&(o.inverseBindMatrices=i(o.inverseBindMatrices,{usage:"inverseBind",mode:"copy"}));for(let o=0;o<e.length;o++)n.has(o)||n.set(o,{usage:"unused",mode:"copy"});return n}function wE(r,e,t,n,s){let i=[],o=[];for(let[a,c]of e){let u=r.json.accessors[a],l=c.mode==="joints"||c.mode==="weights"||c.semantic?.startsWith("WEIGHTS_"),f=!!(l&&["SCALAR","VEC2","VEC3"].includes(u.type)),d=c.mode==="weights"&&(u.type!=="VEC4"||![5121,5123,5126].includes(u.componentType)||u.componentType===5126&&u.normalized),h=c.mode==="signed",m=c.mode==="direction",b=h||m,g=c.mode==="joints"&&(![5121,5123].includes(u.componentType)||u.normalized||u.type!=="VEC4");if(!t.has(a)&&!g&&!d&&!b&&!f&&c.usage!=="indices"&&c.mode!=="unit")continue;let y=hu(r,a);if(typeof y=="string"){n(`accessor ${a} layout requires binary repacking: ${y}`);continue}if(l&&!["SCALAR","VEC2","VEC3","VEC4"].includes(u.type)){n(`accessor ${a} skin influences require scalar/vector data`);continue}if(c.mode==="weights"&&(![5121,5123,5126].includes(u.componentType)||u.componentType===5126&&u.normalized||u.componentType!==5126&&!u.normalized)){n(`accessor ${a} weights require FLOAT or normalized unsigned data`);continue}let x=u.componentType,T=u.normalized;if(b){if(c.hasOpaqueConsumer){n(`accessor ${a} integer conversion cannot interpret opaque extension consumers`);continue}if(!(m?[c.semantic==="NORMAL"?"VEC3":"VEC4"]:c.semantic?.startsWith("COLOR_")?["VEC3","VEC4"]:c.semantic?.startsWith("WEIGHTS_")?["SCALAR","VEC2","VEC3","VEC4"]:["VEC2"]).includes(u.type)||T!==void 0&&typeof T!="boolean"){n(`accessor ${a} integer ${c.semantic} has incompatible shape or normalization`);continue}let oe=!0;for(let xe=0;xe<u.count;xe++)if(m){let Rt=Math.hypot(Math.fround(Ia(y,xe,0)),Math.fround(Ia(y,xe,1)),Math.fround(Ia(y,xe,2)));(Math.abs(Rt-1)>1e-5||c.semantic==="TANGENT"&&![-1,1].includes(Ia(y,xe,3)))&&(oe=!1)}else if(!c.semantic?.startsWith("TEXCOORD_"))for(let Rt=0;Rt<y.rows;Rt++){let mr=Ia(y,xe,Rt);(mr<0||mr>1)&&(oe=!1)}if(!oe){n(m?`accessor ${a} integer ${c.semantic} requires unit directions and tangent handedness of +/-1; values are not repaired`:`accessor ${a} signed ${c.semantic} values must remain in [0, 1]`);continue}x=5126,T=!1}if(c.usage==="indices"){if(u.type!=="SCALAR"||![5121,5123,5125].includes(x)||T){n(`index accessor ${a} requires unnormalized unsigned SCALAR data`);continue}let ue=0;for(let xe=0;xe<u.count;xe++)ue=Math.max(ue,Xt(y,xe,0));if(ue===(x===5121?255:x===5123?65535:4294967295)){if(c.hasOpaqueConsumer){n(`index accessor ${a} cannot widen opaque primitive extension semantics`);continue}if(x===5125){n(`index accessor ${a} contains the unrepresentable uint32 restart value`);continue}x=x===5121?5123:5125}if(!t.has(a)&&x===u.componentType)continue}if(g||c.mode==="unit"){if(g&&u.normalized){n(`accessor ${a} joint indices require unnormalized scalar/vector data`);continue}if(c.mode==="unit"&&!(c.semantic?.startsWith("COLOR_")?["VEC3","VEC4"]:c.semantic?.startsWith("WEIGHTS_")?["SCALAR","VEC2","VEC3","VEC4"]:["VEC2"]).includes(u.type)){n(`accessor ${a} integer ${c.semantic} has an incompatible shape`);continue}let ue=0,oe=!0;for(let xe=0;xe<u.count;xe++)for(let Rt=0;Rt<y.rows*y.columns;Rt++){let mr=Xt(y,xe,Rt);(!Number.isInteger(mr)||mr<0||g&&mr>65535)&&(oe=!1),ue=Math.max(ue,mr)}if(!oe){n(`accessor ${a} joint indices require finite integers in [0, 65535]`);continue}if(g)x=ue<=255?5121:5123,T=!1;else if(ue<=1)x=5126,T=!1;else if(n(`accessor ${a} ambiguous integer attribute normalization; best effort assumes normalized unsigned values`),T=!0,!t.has(a)&&!f){o.push(()=>{u.normalized=!0});continue}}let _=f?4:y.rows,v=Fy[x],I=y.columns>1?_e(y.rows*v,4):_*v,N=I*y.columns,K=c.usage==="vertex"?_e(N,4):N,ne=new ArrayBuffer(u.count*K),be=new Uint8Array(ne),Re=new Uint8Array(y.data.buffer),ke=new DataView(ne);for(let ue=0;ue<u.count;ue++)for(let oe=0;oe<y.columns;oe++)if(x===u.componentType){let xe=y.byteOffset+ue*y.byteStride+oe*y.rows*y.componentSize;be.set(Re.subarray(xe,xe+y.rows*y.componentSize),ue*K+oe*I)}else for(let xe=0;xe<y.rows;xe++){let Rt=(b?Ia:Xt)(y,ue,oe*y.rows+xe),mr=ue*K+oe*I+xe*v;x===5126?ke.setFloat32(mr,Rt,!0):x===5121?ke.setUint8(mr,Rt):x===5125?ke.setUint32(mr,Rt,!0):ke.setUint16(mr,Rt,!0)}i.push({bufferIndex:y.bufferIndex,bytes:ne,...c.usage==="vertex"?{byteStride:K,target:34962}:c.usage==="indices"?{target:34963}:{},apply:ue=>{b&&s(`Converted ${h?"signed":"integer"} ${c.semantic} accessor ${a} to FLOAT, preserving ${y.accessor.normalized?"explicitly normalized":"literal"} values.`),c.usage==="indices"&&x!==u.componentType&&s(`Widened index accessor ${a} to preserve a glTF 1 index reserved by glTF 2.`),u.bufferView=ue,u.byteOffset=0,delete u.byteStride,(x!==u.componentType||f)&&(delete u.min,delete u.max),u.componentType=x,f&&(u.type="VEC4"),T?u.normalized=!0:delete u.normalized}})}Sd(r,i);for(let a of o)a()}function Ia(r,e,t){let n=Xt(r,e,t);if(r.accessor.normalized!==!0)return n;let s=zC[r.accessor.componentType];return Math.max(n/s,-1)}function Oy(r){let e=[r],t=new Set;for(;e.length;){let n=e.pop();if(!(!n||typeof n!="object"||t.has(n))){t.add(n);for(let[s,i]of Object.entries(n))if(s!=="extras"){if(s==="extensions"&&i&&typeof i=="object"&&Object.keys(i).some(o=>!["KHR_materials_unlit","KHR_materials_common"].includes(o)))return!0;e.push(i)}}}return!1}function hu(r,e){let t=r.json.accessors?.[e];if(!t||!Number.isSafeInteger(e)||e<0)return"invalid accessor reference";let n=typeof t.componentType=="number"&&Object.hasOwn(Fy,t.componentType)?Fy[t.componentType]:void 0,s=typeof t.type=="string"&&Object.hasOwn(gE,t.type)?gE[t.type]:void 0;if(!n||!s||!Number.isSafeInteger(t.count)||t.count<1)return"invalid component type, shape, or count";let[i,o]=s,a=r.json.bufferViews?.[t.bufferView],c=r.json.buffers?.[a?.buffer],u=r.buffers[a?.buffer];if(!a||!c||!u)return"requires a loaded accessor buffer";if(t.sparse||t.extensions||a.extensions)return"sparse or extension-bearing data is unsupported";let l=i*o*n,f=t.byteStride??a.byteStride??l,d=f===0?l:f,h=t.byteOffset??0,m=a.byteOffset??0;return!(u.arrayBuffer instanceof ArrayBuffer)||!Number.isSafeInteger(d)||d<l||t.byteStride!==void 0&&t.byteStride>255||!Number.isSafeInteger(h)||h<0||!Number.isSafeInteger(m)||m<0||!Number.isSafeInteger(a.byteLength)||a.byteLength<1||!Number.isSafeInteger(c.byteLength)||c.byteLength<1||m+a.byteLength>c.byteLength||h+(t.count-1)*d+l>a.byteLength||!Number.isSafeInteger(u.byteOffset)||u.byteOffset<0||!Number.isSafeInteger(u.byteLength)||u.byteLength<c.byteLength||u.byteOffset+u.byteLength>u.arrayBuffer.byteLength?"invalid source buffer span or stride":{accessor:t,bufferIndex:a.buffer,componentSize:n,rows:i,columns:o,byteStride:d,data:new DataView(u.arrayBuffer),byteOffset:u.byteOffset+m+h}}function Xt(r,e,t){let n=r.byteOffset+e*r.byteStride+t*r.componentSize;switch(r.accessor.componentType){case 5120:return r.data.getInt8(n);case 5121:return r.data.getUint8(n);case 5122:return r.data.getInt16(n,!0);case 5123:return r.data.getUint16(n,!0);case 5125:return r.data.getUint32(n,!0);default:return r.data.getFloat32(n,!0)}}var Fy,zC,gE,pu=p(()=>{"use strict";Ue();By();Fy={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},zC={5120:127,5121:255,5122:32767,5123:65535},gE={SCALAR:[1,1],VEC2:[2,1],VEC3:[3,1],VEC4:[4,1],MAT2:[2,2],MAT3:[3,3],MAT4:[4,4]}});function TE(r,e){let t=r.asset;t.premultipliedAlpha&&e("asset premultipliedAlpha rendering"),xE(t,["profile","premultipliedAlpha"]);for(let[n,s]of(r.textures||[]).entries()){let i=s;for(let[o,a]of Object.entries({format:6408,internalFormat:6408,target:3553,type:5121}))i[o]!==void 0&&i[o]!==a&&e(`texture ${n} non-default ${o} rendering`);xE(i,["format","internalFormat","target","type"])}}function xE(r,e){let t={};for(let a of e)Object.hasOwn(r,a)&&(t[a]=r[a],delete r[a]);if(!Object.keys(t).length)return;let n=My(r.extras)?r.extras:r.extras===void 0?{}:{originalExtras:r.extras},s=My(n.gltf1)?n.gltf1:n.gltf1===void 0?{}:{originalExtras:n.gltf1},i=My(s.legacyFields)?s.legacyFields:s.legacyFields===void 0?{}:{originalExtras:s.legacyFields},o=Object.keys(t).some(a=>Object.hasOwn(i,a));r.extras={...n,gltf1:{...s,legacyFields:{...i,...t,...o?{originalExtras:i}:{}}}}}function My(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function Dy(r){let e=/^(JOINTS?|WEIGHTS?|TEXCOORD|COLOR)(?:_(\d+))?$/.exec(r);if(e){let t=e[1].startsWith("JOINT")?"JOINTS":e[1].startsWith("WEIGHT")?"WEIGHTS":e[1],n=Number(e[2]||0);if(!Number.isSafeInteger(n)||n>999999999)throw new Error(`glTF v1: invalid attribute set index ${r}`);return`${t}_${n}`}return["POSITION","NORMAL","TANGENT"].includes(r)||r.startsWith("_")||r.includes(":")?r:`_${r}`}var _E=p(()=>{"use strict"});function AE(r,e,t){for(let[s,i]of(r.animations||[]).entries()){let f=function(d,h,m){try{let b=typeof d=="string"?e(d,h):d,g=h==="accessor"?r.accessors:r.nodes;if(typeof b=="number"&&Number.isSafeInteger(b)&&b>=0&&g?.[b])return b}catch{}return t(`animation ${s} ${m} unresolved ${h} reference`),d};var n=f;let o=i,a=o.parameters||{},c=new Map,u=i.samplers,l=Array.isArray(u)?u.map((d,h)=>[String(h),d]):Object.entries(u||{});i.samplers=l.map(([d,h],m)=>{c.set(d,m);for(let b of["input","output"]){let g=h[b],y=Object.hasOwn(a,g)?a[g]:g;h[b]=f(y,"accessor",`sampler ${d} ${b}`)}return h.interpolation??="LINEAR",h}),delete o.parameters;for(let[d,h]of(i.channels||[]).entries()){if(typeof h.sampler=="string"){let b=c.get(h.sampler);b===void 0?t(`animation ${s} channel ${d} unresolved sampler ${h.sampler}`):h.sampler=b}let m=h.target;m?.id!==void 0?(m.node=f(m.id,"node",`channel ${d} target`),delete m.id):typeof m?.node=="string"&&(m.node=f(m.node,"node",`channel ${d} target`))}}}var vE=p(()=>{"use strict"});function IE(r,e,t){let n=r.nodes||[],s=new Map;for(let[a,c]of n.entries())for(let u of c.children||[])s.set(u,s.has(u)?null:a);let i=[];for(let[a,c]of(r.scenes||[]).entries()){let u=o(c.nodes||[]);if(!u){e(`scene ${a} invalid node hierarchy`);continue}for(let l of Array.from(u)){let f=r.skins?.[n[l].skin];if(!Array.isArray(f?.joints)||!f.joints.length||f.skeleton===void 0||u.has(f.skeleton)&&f.joints.every(b=>u.has(b)))continue;let d=f.skeleton,h=new Set;for(;!h.has(d)&&typeof s.get(d)=="number";)h.add(d),d=s.get(d);let m=o([d]);if(h.has(d)||s.get(d)===null||!m||!f.joints.every(b=>m.has(b))||Array.from(m).some(b=>u.has(b)||n[b].mesh!==void 0||n[b].camera!==void 0||n[b].extensions!==void 0)){e(`scene ${a} skin ${n[l].skin} cannot safely attach detached skeleton`);continue}for(let b of m)u.add(b);i.push(()=>{c.nodes||=[],c.nodes.push(d),t(`Attached detached skeleton root ${d} to scene ${a}.`)})}}for(let a of i)a();function o(a){let c=new Set,u=[...a];for(;u.length;){let l=u.pop();if(!Number.isSafeInteger(l)||!n[l]||c.has(l)||s.get(l)===null)return null;c.add(l),u.push(...n[l].children||[])}return c}}var SE=p(()=>{"use strict"});function EE(r,e){for(let[t,n]of(r.cameras||[]).entries()){let s=n.perspective,i=n.orthographic;(n.type==="perspective"?s&&mu(s.yfov)&&mu(s.znear)&&(s.aspectRatio===void 0||mu(s.aspectRatio))&&(s.zfar===void 0||mu(s.zfar)&&s.zfar>s.znear):n.type==="orthographic"&&i&&Number.isFinite(i.xmag)&&i.xmag!==0&&Number.isFinite(i.ymag)&&i.ymag!==0&&Number.isFinite(i.znear)&&i.znear>=0&&mu(i.zfar)&&i.zfar>i.znear)||e(`camera ${t} invalid projection parameters`)}}function mu(r){return Number.isFinite(r)&&r>0}var LE=p(()=>{"use strict"});function BE(r,e,t){let n=new Map,s=new Set;for(let[i,o]of(r.json.meshes||[]).entries())for(let[a,c]of o.primitives.entries()){let u=`mesh ${i} primitive ${a}`;for(let b of["TEXCOORD","COLOR","JOINTS","WEIGHTS"])Object.keys(c.attributes).filter(y=>y.startsWith(`${b}_`)).map(y=>Number(y.slice(b.length+1))).sort((y,x)=>y-x).some((y,x)=>y!==x)&&t(`${u} ${b} sets must be contiguous starting at zero`);for(let[b,g]of Object.entries(c.attributes)){let y=b.split("_")[0];if(!["NORMAL","TANGENT","COLOR","TEXCOORD","JOINTS","WEIGHTS"].includes(y))continue;let x=`${y}:${g}`;if(s.has(x))continue;s.add(x);let T=e(g,`${b} accessor ${g}`);T&&WC(T,y,`${b} accessor ${g}`,t)}let l=Object.values(c.attributes).map(b=>(Number.isSafeInteger(b)?r.json.accessors?.[b]:void 0)?.count);if(!l.length||l.some(b=>!Number.isSafeInteger(b)||b<1)){t(`${u} requires valid vertex attribute accessors`);continue}l.some(b=>b!==l[0])&&t(`${u} vertex attribute counts do not match`);let f=c.indices===void 0?l[0]:r.json.accessors?.[c.indices]?.count,d=c.mode===void 0?4:c.mode;if(!Number.isInteger(d)||d<0||d>6?t(`${u} requires a primitive mode in [0, 6]`):(!c.extensions||!Object.keys(c.extensions).length)&&(!Number.isSafeInteger(f)||f<1||d===1&&f%2!==0||[2,3].includes(d)&&f<2||d===4&&f%3!==0||[5,6].includes(d)&&f<3)&&t(`${u} draw count ${f} is incompatible with primitive mode ${d}`),c.indices===void 0)continue;let h=e(c.indices,`${u} indices`);if(!h)continue;if(h.accessor.type!=="SCALAR"||![5121,5123,5125].includes(h.accessor.componentType)||h.accessor.normalized){t(`${u} indices require unnormalized unsigned SCALAR data`);continue}let m=n.get(c.indices);if(m===void 0){m=0;for(let b=0;b<h.accessor.count;b++)m=Math.max(m,Xt(h,b,0));n.set(c.indices,m)}l.some(b=>m>=b)&&t(`${u} index ${m} is outside its vertex attribute counts`)}}function WC(r,e,t,n){let s=r.accessor,i=s.componentType===5126&&!s.normalized,o=[5121,5123].includes(s.componentType)&&s.normalized===!0,a=s.normalized===void 0||typeof s.normalized=="boolean",c=e==="NORMAL"?s.type==="VEC3"&&i:e==="TANGENT"?s.type==="VEC4"&&i:e==="JOINTS"?s.type==="VEC4"&&[5121,5123].includes(s.componentType)&&!s.normalized:e==="COLOR"?["VEC3","VEC4"].includes(s.type)&&(i||o):s.type===(e==="TEXCOORD"?"VEC2":"VEC4")&&(i||o);if(!a||!c){n(`${t} has incompatible core attribute shape, component type, or normalization`);return}for(let u=0;u<s.count;u++){let l=Array.from({length:r.rows},(f,d)=>Xt(r,u,d));if(l.some(f=>!Number.isFinite(f))||["NORMAL","TANGENT"].includes(e)&&Math.abs(Math.hypot(...l.slice(0,3))-1)>1e-5||e==="TANGENT"&&l[3]!==1&&l[3]!==-1||["COLOR","WEIGHTS"].includes(e)&&i&&l.some(f=>f<0||f>1)){n(`${t} requires finite core values, unit directions, tangent handedness \xB11, and colors/weights in [0, 1]`);return}}}var FE=p(()=>{"use strict";pu()});function OE(r,e,t){let n=new Map,s=new Set,i=[],o=(f,d)=>{let h=n.get(f);return h===void 0&&(h=hu(r,f),n.set(f,h)),typeof h=="string"?(s.has(f)||(s.add(f),e(`${d}: ${h}`)),null):h},a=new Set;for(let f of r.json.meshes||[])for(let d of f.primitives)d.attributes.POSITION!==void 0&&a.add(d.attributes.POSITION);for(let f of a){let d=o(f,`POSITION accessor ${f}`);if(d){if(!Ed(d,"VEC3")){e(`POSITION accessor ${f} requires unnormalized FLOAT VEC3 data`);continue}u(d,f)}}l(),c(),$C(r,o,e),BE(r,o,e);for(let f of i)f();function c(){for(let[f,d]of(r.json.skins||[]).entries()){if(d.inverseBindMatrices===void 0)continue;let h=`skin ${f} inverse-bind matrices`,m=o(d.inverseBindMatrices,h);if(m){if(!Ed(m,"MAT4")||m.accessor.count<(d.joints?.length||0)){e(`${h} require FLOAT MAT4 data with at least one matrix per joint`);continue}for(let b=0;b<m.accessor.count;b++){let g=Array.from({length:16},(y,x)=>Xt(m,b,x));if(g.some(y=>!Number.isFinite(y))||g[3]!==0||g[7]!==0||g[11]!==0||g[15]!==1){e(`${h} require finite affine matrices`);break}}}}}function u(f,d){let h=new Array(f.rows).fill(1/0),m=new Array(f.rows).fill(-1/0);for(let b=0;b<f.accessor.count;b++)for(let g=0;g<f.rows;g++){let y=Xt(f,b,g);if(!Number.isFinite(y))return e(`accessor ${d} non-finite values cannot supply required bounds`),!1;h[g]=Math.min(h[g],y),m[g]=Math.max(m[g],y)}return(JSON.stringify(f.accessor.min)!==JSON.stringify(h)||JSON.stringify(f.accessor.max)!==JSON.stringify(m))&&i.push(()=>{f.accessor.min=h,f.accessor.max=m,t(`Calculated required bounds for accessor ${d}.`)}),!0}function l(){let f=new Set,d=new Set;for(let[h,m]of(r.json.animations||[]).entries()){let b=new Set;(!m.samplers.length||!m.channels?.length)&&e(`animation ${h} requires samplers and channels`);for(let[g,y]of m.samplers.entries()){let x=`animation ${h} sampler ${g}`;if(["LINEAR","STEP"].includes(y.interpolation??"LINEAR")||e(`${x} unsupported interpolation ${y.interpolation}`),!f.has(y.input)){f.add(y.input);let T=o(y.input,`${x} input`);if(T)if(!Ed(T,"SCALAR"))e(`${x} time input requires unnormalized FLOAT SCALAR data`);else{let _=-1/0,v=!0;for(let I=0;I<T.accessor.count;I++){let N=Xt(T,I,0);(!Number.isFinite(N)||N<0||N<=_)&&(v=!1),_=N}v?u(T,y.input):e(`${x} times must be finite, nonnegative, and strictly increasing`)}}}for(let[g,y]of(m.channels||[]).entries()){let x=`animation ${h} channel ${g}`,T=Number.isSafeInteger(y.sampler)?m.samplers[y.sampler]:void 0,_=y.target,v=Number.isSafeInteger(_?.node)?r.json.nodes?.[_.node]:void 0;if(!T||!v||!["translation","rotation","scale"].includes(_?.path)){e(`${x} invalid sampler, node, or TRS target`);continue}v.matrix!==void 0&&e(`${x} matrix node requires TRS decomposition`);let I=`${_.node}:${_.path}`;if(b.has(I)&&e(`${x} duplicate node/path target`),b.add(I),!["LINEAR","STEP"].includes(T.interpolation??"LINEAR"))continue;let N=r.json.accessors?.[T.input],K=o(T.output,`${x} output`);if(!K)continue;if(!Ed(K,_.path==="rotation"?"VEC4":"VEC3")||K.accessor.count!==N?.count){e(`${x} output shape, type, or count does not match its target and keys`);continue}let ne=`${T.output}:${_.path}`;if(!d.has(ne)){d.add(ne);for(let be=0;be<K.accessor.count;be++){let Re=Array.from({length:K.rows},(ke,ue)=>Xt(K,be,ue));if(Re.some(ke=>!Number.isFinite(ke))||_.path==="rotation"&&Math.abs(Math.hypot(...Re)-1)>1e-5){e(`${x} output requires finite values and unit rotation quaternions`);break}}}}}}}function Ed(r,e){return r.accessor.componentType===5126&&!r.accessor.normalized&&r.accessor.type===e}function $C(r,e,t){let n=new Set;for(let s of r.json.nodes||[]){let i=r.json.skins?.[s.skin],o=r.json.meshes?.[s.mesh];if(!Array.isArray(i?.joints)||!i.joints.length||!o)continue;let a=`${s.mesh}:${s.skin}`;if(!n.has(a)){n.add(a);for(let[c,u]of o.primitives.entries()){let l=`mesh ${s.mesh} primitive ${c} skin ${s.skin}`,f=Object.keys(u.attributes).filter(b=>/^JOINTS_\d+$/.test(b)).map(b=>Number(b.slice(7))).sort((b,g)=>b-g),d=Object.keys(u.attributes).filter(b=>/^WEIGHTS_\d+$/.test(b)).map(b=>Number(b.slice(8))).sort((b,g)=>b-g);if(!f.length&&!d.length){t(`${l} requires JOINTS_0 and WEIGHTS_0 skin influences`);continue}if(JSON.stringify(f)!==JSON.stringify(d)||f.some((b,g)=>b!==g)){t(`${l} requires matching contiguous joint/weight sets starting at zero`);continue}let h=r.json.accessors?.[u.attributes.POSITION]?.count,m=f.map(b=>({joints:e(u.attributes[`JOINTS_${b}`],`${l} joint set ${b}`),weights:e(u.attributes[`WEIGHTS_${b}`],`${l} weight set ${b}`)}));if(!m.some(({joints:b,weights:g})=>!b||!g)){if(m.some(({joints:b,weights:g})=>b.accessor.type!=="VEC4"||g.accessor.type!=="VEC4"||![5121,5123].includes(b.accessor.componentType)||b.accessor.normalized||!(g.accessor.componentType===5126&&!g.accessor.normalized||[5121,5123].includes(g.accessor.componentType)&&g.accessor.normalized)||b.accessor.count!==g.accessor.count||h!==void 0&&b.accessor.count!==h||b.accessor.count!==m[0].joints.accessor.count)){t(`${l} incompatible influence accessor types or vertex counts`);continue}for(let b=0;b<m[0].joints.accessor.count;b++){let g=0,y=0,x=!0,T=new Set;for(let{joints:_,weights:v}of m){let I=v.accessor.normalized?v.accessor.componentType===5121?255:65535:1;for(let N=0;N<4;N++){let K=Xt(_,b,N),ne=Xt(v,b,N)/I;(K>=i.joints.length||!Number.isFinite(ne)||ne<0||ne>1)&&(x=!1),ne>0&&(T.has(K)&&(x=!1),T.add(K),y++),g+=ne}}if(!x||Math.abs(g-1)>2e-7*Math.max(y,1)){t(`${l} invalid palette index, repeated weighted joint, or weights not summing to one at vertex ${b}`);break}}}}}}}var ME=p(()=>{"use strict";pu();FE()});function DE(r,e,t,n){let s=new Map,i=new Map,o=new Map;for(let[c,u]of(r.json.buffers||[]).entries()){let l=`buffer ${c}`,f=r.buffers[c],d=!!(f&&f.arrayBuffer instanceof ArrayBuffer&&Number.isSafeInteger(f.byteOffset)&&f.byteOffset>=0&&Number.isSafeInteger(f.byteLength)&&f.byteLength>=0&&Number.isSafeInteger(f.byteOffset+f.byteLength)&&f.byteOffset+f.byteLength<=f.arrayBuffer.byteLength);f&&!d&&t(`${l} invalid borrowed payload span`);let h=u.byteLength;if(h===void 0&&e.has(c)&&!u.extensions&&d&&f.byteLength>0&&(h=f.byteLength,i.set(c,h)),!Number.isSafeInteger(h)||h<1){t(`${l} requires a positive byteLength; missing lengths require unambiguous loaded URI data`);continue}s.set(c,h),d&&f.byteLength<h&&t(`${l} declared byteLength exceeds its loaded payload`)}let a=Oy(r.json);for(let[c,u]of(r.json.bufferViews||[]).entries()){let l=u.byteOffset===void 0?0:u.byteOffset,f=s.get(u.buffer),d=u.byteLength===void 0&&!a&&f!==void 0?qC(r,c,s):u.byteLength;u.byteLength===void 0&&d!==void 0&&o.set(c,d),(!Number.isSafeInteger(u.buffer)||u.buffer<0||f===void 0||!Number.isSafeInteger(l)||l<0||!Number.isSafeInteger(d)||(d??0)<1||!Number.isSafeInteger(l+(d??0))||l+(d??0)>f)&&t(`bufferView ${c} requires a valid buffer reference and contained positive byte span`)}for(let[c,u]of o)r.json.bufferViews[c].byteLength=u,n(`Inferred bufferView ${c} byteLength from its dense accessor spans.`);for(let[c,u]of i)r.json.buffers[c].byteLength=u,n(`Inferred buffer ${c} byteLength from its loaded URI payload.`)}function qC(r,e,t){let n=r.json.bufferViews[e];if(n.byteOffset!==void 0&&(!Number.isSafeInteger(n.byteOffset)||n.byteOffset<0)||n.byteStride!==void 0&&(!Number.isSafeInteger(n.byteStride)||n.byteStride<0)||r.json.images?.some(a=>a.bufferView===e)||r.json.accessors?.some(a=>!!a.sparse))return;let s=t.get(n.buffer)-(n.byteOffset??0),i={...r,json:{...r.json,buffers:r.json.buffers.map((a,c)=>({...a,byteLength:t.get(c)})),bufferViews:r.json.bufferViews.map((a,c)=>c===e?{...a,byteLength:s}:a)}},o=0;for(let[a,c]of(r.json.accessors||[]).entries()){if(c.bufferView!==e)continue;let u=c;for(let d of[u.byteOffset,u.byteStride])if(d!==void 0&&(!Number.isSafeInteger(d)||d<0))return;let l=hu(i,a);if(typeof l=="string")return;let f=(c.byteOffset??0)+(c.count-1)*l.byteStride+l.rows*l.columns*l.componentSize;o=Math.max(o,f)}return o>0?o:void 0}var RE=p(()=>{"use strict";pu()});function kE(r,e,t){let n=new Map;for(let i of r.animations||[])for(let o of i.channels||[]){let a=o.target?.node;if(!Number.isSafeInteger(a))continue;let c=n.get(a)||new Set;c.add(o.target.path),n.set(a,c)}let s=[];for(let[i,o]of n){let a=r.nodes?.[i];if(a?.matrix===void 0)continue;let c=`animated matrix node ${i}`;if(o.size!==1||!o.has("translation")){e(`${c} rotation or scale animation requires an unambiguous TRS basis`);continue}if(a.translation!==void 0||a.rotation!==void 0||a.scale!==void 0||a.extensions!==void 0){e(`${c} has conflicting TRS fields or opaque extensions`);continue}let u=KC(a.matrix);if(!u){e(`${c} requires a finite affine, nonsingular matrix without shear`);continue}s.push(()=>{Object.assign(a,u),delete a.matrix,t(`Decomposed translation-only animated matrix node ${i}, preserving its linear transform.`)})}for(let i of s)i()}function KC(r){if(!Array.isArray(r)||r.length!==16||Array.from(r).some(a=>!Number.isFinite(a))||r[3]!==0||r[7]!==0||r[11]!==0||r[15]!==1)return null;let e=[0,1,2].map(a=>Math.hypot(...r.slice(a*4,a*4+3)));if(e.some(a=>!Number.isFinite(a)||a===0))return null;let t=e.map((a,c)=>r.slice(c*4,c*4+3).map(u=>u/a));for(let a=0;a<3;a++)for(let c=a+1;c<3;c++)if(Math.abs(t[a].reduce((u,l,f)=>u+l*t[c][f],0))>1e-6)return null;let n=t[0][0]*(t[1][1]*t[2][2]-t[1][2]*t[2][1])-t[1][0]*(t[0][1]*t[2][2]-t[0][2]*t[2][1])+t[2][0]*(t[0][1]*t[1][2]-t[0][2]*t[1][1]);if(Math.abs(Math.abs(n)-1)>1e-6)return null;n<0&&(e[0]=-e[0],t[0]=t[0].map(a=>-a));let s=Array.from(new Gc().fromMatrix3(t.flat()).normalize()),i=r.slice(12,15),o=new Qs().translate(i).multiplyRight(new Qs().fromQuaternion(s)).scale(e);return Array.from(o).some((a,c)=>!Number.isFinite(a)||Math.abs(a-r[c])>1e-6*Math.max(1,Math.abs(r[c])))?null:{translation:i,rotation:s,scale:e}}var NE=p(()=>{"use strict";Uf()});function VE(r,e,t){let n=new Set,s=r.extensionsRequired?.includes(qr)||!1;for(let[o,a]of(r.materials||[]).entries()){let c=a,u=a.extensions?.[qr];if(u===void 0){XC(c,r,e,t);continue}zE(c,u);let l=`material ${o}`;if(!pr(u)||typeof u.technique!="string"||!["CONSTANT","LAMBERT","PHONG","BLINN"].includes(u.technique)){e(`${l} unknown ${qr} technique`);continue}if(u.values!==void 0&&!pr(u.values)){e(`${l} common material values must be an object`);continue}let f=u.values||{},d=Object.keys(u).filter(I=>!["technique","values","doubleSided","transparent","jointCount"].includes(I)),h=Object.keys(f).filter(I=>!["ambient","diffuse","emission","specular","shininess","transparency","doubleSided","transparent"].includes(I));(d.length||h.length)&&e(`${l} unrecognized common material fields ${[...d,...h].join(", ")}`),u.jointCount!==void 0&&(!Number.isSafeInteger(u.jointCount)||Number(u.jointCount)<0)&&e(`${l} invalid common material jointCount`);let m=CE(f.emission,r,`${l} emission`,e),b=u.technique==="CONSTANT",g=b?m:CE(f.diffuse,r,`${l} diffuse`,e),y=f.transparency===void 0?1:f.transparency,x=typeof y=="number"&&Number.isFinite(y)&&y>=0&&y<=1;x||e(`${l} common material transparency must be in [0, 1]`);let T=UE(u,f,"transparent",l,e),_=UE(u,f,"doubleSided",l,e);f.ambient!==void 0&&!PE(f.ambient)&&e(`${l} ambient lighting`),["PHONG","BLINN"].includes(String(u.technique))&&(f.specular!==void 0&&!PE(f.specular)&&e(`${l} specular/shininess lighting`),f.shininess!==void 0&&(typeof f.shininess!="number"||!Number.isFinite(f.shininess)||f.shininess<0)&&e(`${l} invalid common material shininess`)),a.pbrMetallicRoughness||={};let v=a.pbrMetallicRoughness;if(v.metallicFactor??=0,v.roughnessFactor??=1,g){let I=[...g.factor];I[3]*=x?y:1,v.baseColorFactor??=I,g.texture&&(v.baseColorTexture??=g.texture)}a.doubleSided??=_,a.alphaMode??=T?"BLEND":"OPAQUE",b?(a.extensions[Ry]??={},HC(r,Ry,s),t(`Converted ${l} CONSTANT emission to an unlit material.`)):(m&&(a.emissiveFactor??=m.factor.slice(0,3),m.texture&&(a.emissiveTexture??=m.texture)),t(`Approximated ${l} ${String(u.technique)} lighting with rough non-metallic PBR factors.`)),typeof c.technique=="string"?n.add(c.technique):c.technique!==void 0&&e(`${l} invalid fallback technique ID`),delete c.technique,delete c.values,delete a.extensions[qr],Object.keys(a.extensions).length||delete a.extensions}let i=WE(r);return(r.extensions?.[qr]!==void 0||(r.nodes||[]).some(o=>o.extensions?.[qr]!==void 0))&&e(`${qr} lights or scene payloads`),i.has(qr)||(r.extensionsUsed=r.extensionsUsed?.filter(o=>o!==qr),r.extensionsRequired=r.extensionsRequired?.filter(o=>o!==qr)),n}function jE(r,e){if(!e.size||[...WE(r)].some(c=>![qr,Ry].includes(c))||(r.materials||[]).some(c=>c.technique!==void 0||c.values!==void 0))return!1;let t=r;if(["techniques","programs","shaders"].some(c=>t[c]!==void 0&&!pr(t[c])))return!1;let n=pr(t.techniques)?t.techniques:{},s=pr(t.programs)?t.programs:{},i=pr(t.shaders)?t.shaders:{},o=new Set,a=new Set;if(Object.keys(n).some(c=>!e.has(c)))return!1;for(let c of Object.values(n))pr(c)&&typeof c.program=="string"&&o.add(c.program);if(Object.keys(s).some(c=>!o.has(c)))return!1;for(let c of Object.values(s))if(pr(c))for(let u of["vertexShader","fragmentShader"])typeof c[u]=="string"&&a.add(c[u]);return Object.keys(i).every(c=>a.has(c))}function XC(r,e,t,n){zE(r);let s=pr(r.values)?r.values:{},i=s.tex||s.texture2d_0||s.diffuseTex||s.diffuse,o=GE(e,i),a=ky(s.diffuse)?s.diffuse:void 0;if(o!==-1||a){let c=a?[...a]:[1,1,1,1],u=s.transparency;typeof u=="number"&&u>=0&&u<=1&&(c[3]*=u),r.pbrMetallicRoughness||={},r.pbrMetallicRoughness.metallicFactor??=0,r.pbrMetallicRoughness.roughnessFactor??=1,r.pbrMetallicRoughness.baseColorFactor??=c,o!==-1&&(r.pbrMetallicRoughness.baseColorTexture??={index:o}),r.pbrMetallicRoughness.baseColorFactor[3]<1&&(r.alphaMode||="BLEND"),n("Approximated glTF v1 diffuse material values with PBR material factors.")}(r.technique||r.values)&&t(`material technique ${r.technique||"<unnamed>"}`)}function CE(r,e,t,n){if(r===void 0)return{factor:[0,0,0,1]};if(ky(r))return{factor:[...r]};let s=GE(e,r);return s!==-1?{factor:[1,1,1,1],texture:{index:s}}:(n(`${t} requires an RGBA factor in [0, 1] or a resolved texture ID`),null)}function GE(r,e){return typeof e!="string"?-1:(r.textures||[]).findIndex(t=>t.id===e)}function UE(r,e,t,n,s){r[t]!==void 0&&e[t]!==void 0&&r[t]!==e[t]&&s(`${n} conflicting common material ${t}`);let i=e[t]!==void 0?e[t]:r[t]!==void 0?r[t]:!1;return typeof i=="boolean"?i:(s(`${n} common material ${t} must be boolean`),!1)}function zE(r,e){let t=pr(r.extras)?r.extras:r.extras===void 0?{}:{originalExtras:r.extras},n=pr(t.gltf1)?t.gltf1:t.gltf1===void 0?{}:{originalExtras:t.gltf1},s={technique:r.technique,values:r.values,...e===void 0?{}:{commonMaterial:e}},i=Object.keys(s).some(o=>Object.hasOwn(n,o));r.extras={...t,gltf1:{...n,...s,...i?{originalExtras:n}:{}}}}function HC(r,e,t){r.extensionsUsed=[...new Set([...r.extensionsUsed||[],e])],t&&(r.extensionsRequired=[...new Set([...r.extensionsRequired||[],e])])}function WE(r){let e=new Set,t=[r],n=new Set;for(;t.length;){let s=t.pop();if(!(!s||typeof s!="object"||n.has(s))){if(n.add(s),pr(s)&&pr(s.extensions))for(let i of Object.keys(s.extensions))e.add(i);for(let[i,o]of Object.entries(s))i!=="extras"&&t.push(o)}}return e}function ky(r){return Array.isArray(r)&&r.length===4&&r.every(e=>typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1)}function PE(r){return ky(r)&&r.slice(0,3).every(e=>e===0)}function pr(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}var qr,Ry,$E=p(()=>{"use strict";qr="KHR_materials_common",Ry="KHR_materials_unlit"});function qE(r,e={}){let t=new Cy;return t.normalize(r,e,!0),()=>t.finishNormalization(r)}var Ny,JC,Cy,KE=p(()=>{"use strict";cE();fE();hE();bE();pu();_E();vE();SE();LE();ME();RE();NE();$E();Ny={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",cameras:"camera",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},JC={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",camera:"cameras",inverseBindMatrices:"accessors",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Cy=class r{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;report={converted:!1,mutated:!1,unsupported:[],warnings:[]};strict=!1;log;finished=!1;pendingAccessors=new Set;accessorConversions=new Map;uriBufferIndices=new Set;normalize(e,t={},n=!1){if(t.mutate===!1){let o={...e,json:JSON.parse(JSON.stringify(e.json))},a=new r().normalize(o,{...t,mutate:!0});return a.mutated=!1,a}this.strict=t.normalize==="strict",this.log=t.log,this.json=e.json;let s=e.json;switch(s.asset&&s.asset.version){case"2.0":case"2.1":return this.report;case void 0:case"1.0":break;default:return this._warning(`Unknown glTF version ${s.asset.version}`),this.report}if(!t.normalize)throw new Error("glTF v1 is not supported.");this.report.converted=!0,this.report.mutated=!0,this.log?.log(1,"glTF: Converting glTF v1 to glTF v2 using experimental normalization.")(),this._addAsset(s),this._orderBinaryBufferPayloads(e),this._convertTopLevelObjectsToArrays(s),aE(e),this._convertObjectIdsToArrayIndices(s),this._updateObjects(s);for(let[o,a]of(s.buffers||[]).entries())typeof a.uri=="string"&&this.uriBufferIndices.add(o);let i=VE(s,o=>this._unsupported(o),o=>this._warning(o));return AE(s,(o,a)=>this._convertIdToIndex(o,a),o=>this._unsupported(o)),EE(s,o=>this._unsupported(o)),kE(s,o=>this._unsupported(o),o=>this._warning(o)),TE(s,o=>this._unsupported(o)),this.accessorConversions=yE(s),lE(s,o=>this.pendingAccessors.add(o)),dE(s,o=>this._convertIdToIndex(o,"node"),o=>this._unsupported(o)),this._updateNodes(s),IE(s,o=>this._unsupported(o),o=>this._warning(o)),this._preserveLegacyResources(s,i),this._removeEmptyCollections(s),n?this.report:this.finishNormalization(e)}finishNormalization(e){return this.report.converted&&!this.finished&&(DE(e,this.uriBufferIndices,t=>this._unsupported(t),t=>this._warning(t)),wE(e,this.accessorConversions,this.pendingAccessors,t=>this._unsupported(t),t=>this._warning(t)),pE(e,t=>this._unsupported(t)),OE(e,t=>this._unsupported(t),t=>this._warning(t)),this._finishReport(),this.log?.log(1,`glTF: Completed glTF v1 normalization (${this.report.unsupported.length} unsupported features).`)(),this.finished=!0),this.report}_unsupported(e){if(this.report.unsupported.push(e),this.log?.warn(`glTF v1 normalization does not support ${e}`)(),this.strict)throw new Error(`glTF v1 normalization does not support ${e}`)}_warning(e){this.report.warnings.push(e),this.log?.warn(`glTF: ${e}`)()}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_orderBinaryBufferPayloads(e){let t=this.json.buffers;if(!t||Array.isArray(t)||!t.binary_glTF)return;let s=Object.keys(t).indexOf("binary_glTF");s>0&&e.buffers?.length&&(e.buffers=[e.buffers[s],...e.buffers.filter((i,o)=>o!==s)])}_convertTopLevelObjectsToArrays(e){for(let t in Ny)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){let n=e[t];if(!n||Array.isArray(n))return;e[t]=[];let s=Object.keys(n),i=t==="buffers"&&s.includes("binary_glTF")?["binary_glTF",...s.filter(o=>o!=="binary_glTF")]:s;for(let o of i){let a=n[o];a.id=a.id||o;let c=e[t].length;e[t].push(a),this.idToIndexMap[t][o]=c}}_convertObjectIdsToArrayIndices(e){for(let t in Ny)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(let t of e.textures)this._convertTextureIds(t);for(let t of e.meshes)this._convertMeshIds(t);for(let t of e.nodes)this._convertNodeIds(t);for(let t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(let t of e.primitives){let{attributes:n,indices:s,material:i}=t,o=new Map;for(let a in n){let c=Dy(a),u=o.get(c);if(u!==void 0&&n[u]!==n[a])throw new Error(`glTF v1: conflicting attribute aliases ${u} and ${a}`);o.set(c,a)}t.attributes=Object.fromEntries(Object.entries(n).map(([a,c])=>[Dy(a),this._convertIdToIndex(c,"accessor")])),s&&(t.indices=this._convertIdToIndex(s,"accessor")),i&&(t.material=this._convertIdToIndex(i,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(e[t]=[]);for(let n of e[t])for(let s in n){let i=n[s],o=this._convertIdToIndex(i,s);n[s]=o}}_convertIdToIndex(e,t){let n=JC[t];if(n in this.idToIndexMap){let s=this.idToIndexMap[n][e];if(!Number.isFinite(s))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return s}return e}_updateObjects(e){for(let t of this.json.buffers)delete t.type}_updateNodes(e){let t=e.nodes||[];for(let n=0;n<t.length;n++){let s=t[n];if(!Array.isArray(s.meshes))continue;let i=s.meshes;delete s.meshes,s.mesh=i.shift();for(let o of i){let a={...s,mesh:o,children:void 0};delete a.id,delete a.matrix,delete a.translation,delete a.rotation,delete a.scale,t.push(a),s.children||=[],s.children.push(t.length-1)}}}_preserveLegacyResources(e,t){let n=jE(e,t),s={};for(let i of["techniques","programs","shaders"])e[i]&&(s[i]=e[i],delete e[i],n||this._unsupported(`legacy ${i}`));Object.keys(s).length&&(e.extras={...e.extras,gltf1Resources:s},n&&this._warning("Preserved shader resources overridden by converted common materials."))}_removeEmptyCollections(e){for(let t of e.nodes||[])Array.isArray(t.children)&&t.children.length===0&&delete t.children;for(let t of e.scenes||[])Array.isArray(t.nodes)&&t.nodes.length===0&&delete t.nodes;for(let t of[...Object.keys(Ny),"extensionsUsed","extensionsRequired"])Array.isArray(e[t])&&e[t].length===0&&delete e[t]}_finishReport(){this.report.unsupported.length&&this.report.warnings.push(`Converted glTF v1 with unsupported features: ${this.report.unsupported.join(", ")}`)}}});function YC(r,e){let t=r.basis;return{...r,core:{...r.core,mimeType:e},basis:{...t,format:t?.format||"auto"}}}async function XE(r,e,t=0,n,s){return await HE(r,e,t,n,s)}async function HE(r,e,t,n,s,i){QC(r,e,t,n);let o=qE(r,{normalize:n?.gltf?.normalize,log:n?.core?.log});return await nE(r,n,s),n?.gltf?.loadBuffers&&r.json.buffers&&await a3(r,n,s,n.gltf.loadBufferIndices),o(),n?.gltf?.loadFiles&&r.json.files&&await o3(r,n,s),n?.gltf?.loadExternalAssets&&r.json.externalAssets&&await e3(r,n,s,i),n?.gltf?.loadImages&&await c3(r,n,s),await sE(r,n,s),r}function QC(r,e,t,n){if(n.core?.baseUrl&&(r.baseUri=n.core?.baseUrl),e instanceof ArrayBuffer&&!PI(e,t,n.glb)&&(e=new TextDecoder().decode(e)),typeof e=="string")r.json=sb(e);else if(e instanceof ArrayBuffer){let l={};t=ad(l,e,t,n.glb),H(l.type==="glTF",`Invalid GLB magic string ${l.type}`),r._glb=l,r.json=l.json}else e&&typeof e=="object"?r.json=e:H(!1,"GLTF: must be ArrayBuffer, string, or parsed JSON object");let s=r.json.buffers||[],i=Array.isArray(s)?s:[],o=Array.isArray(s)?[]:Object.keys(s);if(r.buffers=new Array(Array.isArray(s)?s.length:o.length).fill(null),r._glb){let{binChunks:l}=r._glb;for(let g=0;g<i.length;g++){let y=i[g];if(y.chunk===void 0)continue;H(r._glb.version===3,"glTF buffer.chunk requires a GLB v3 container."),H(y.uri===void 0,`glTF buffer ${g} cannot define both uri and chunk.`);let x=l.find(T=>T.chunkIndex===y.chunk);H(x,`glTF buffer ${g} references missing GLB BIN chunk ${y.chunk}.`),H(y.byteLength<=x.byteLength,`glTF buffer ${g} is larger than GLB BIN chunk ${y.chunk}.`),r.buffers[g]={arrayBuffer:x.arrayBuffer,byteOffset:x.byteOffset,byteLength:y.byteLength}}let f=i.map((g,y)=>g.uri===void 0?y:-1).filter(g=>g!==-1),d=l.find(g=>g.chunkIndex===1),h=r._glb.version<3||r._glb.jsonChunkIndex===0&&i[0]?.chunk===void 0&&f.length===1&&f[0]===0&&!!d,m=r._glb.version<3?l[0]:d,b=r._glb.version===1&&!Array.isArray(s)?o.indexOf("binary_glTF"):0;if(h&&m&&b>=0&&(r.buffers[b]={arrayBuffer:m.arrayBuffer,byteOffset:m.byteOffset,byteLength:m.byteLength}),r._glb.version===3)for(let g of f)H(r.buffers[g],`glTF buffer ${g} without a uri must define a valid GLB v3 chunk.`)}if(!r._glb){let l=i.findIndex(f=>f.chunk!==void 0);H(l===-1,`glTF buffer ${l} uses chunk outside a GLB.`)}let a=r.json.images||[];r.images=new Array(a.length).fill({});let c=r.json.files||[];r.files=new Array(c.length).fill(null);let u=r.json.externalAssets||[];r.externalAssets=new Array(u.length).fill(null)}async function e3(r,e,t,n){let s=r.json.externalAssets||[],i=new Set;for(let a of r.json.nodes||[])a.externalAsset!==void 0&&(H(a.externalAsset>=0&&a.externalAsset<s.length,`glTF node references missing external asset ${a.externalAsset}.`),i.add(a.externalAsset));let o=n||r3(t.url?new Set([cd(t.url)]):new Set);for(let a of i)await t3(r,a,e,t,o)}async function t3(r,e,t,n,s){let i=r.json.externalAssets?.[e];if(!i)throw new Error(`Missing glTF external asset ${e}.`);H(Number.isInteger(i.file)&&i.file>=0&&i.file<(r.json.files?.length||0),`glTF external asset ${e} references missing file ${i.file}.`);let o=await fd(r,i.file,t,n),a=o.url;H(!a||!s.ancestors.has(a),`glTF external asset cycle detected at ${a}.`);let c=a?s.cache.get(a):void 0;if(!c){let u=n3(r,o,t,n,s),l={...s,ancestors:new Set(s.ancestors)};a&&l.ancestors.add(a);let f=eo(o.arrayBuffer,o.byteOffset,o.byteLength);c=HE({},f,0,t,u,l),a&&s.cache.set(a,c)}r.externalAssets=r.externalAssets||[],r.externalAssets[e]=await c}function r3(r){return{cache:new Map,ancestors:r,packageIds:{next:0}}}function n3(r,e,t,n,s){if(e.url&&!e.url.startsWith("data:"))return{...n,url:e.url,filename:i3(e.url),baseUrl:s3(e.url)};let i=`${ZC}${s.packageIds.next++}`,o=`${i}/`;return{...n,url:e.name,filename:e.name,baseUrl:i,fetch:async(a,c)=>{let u=a;if(u.startsWith("data:"))return await n.fetch(a,c);let l=u.startsWith(o)?u.slice(o.length):u,f=wg(r,l);H(f>=0,`glTF package does not contain file ${l}.`);let d=await fd(r,f,t,n),h=eo(d.arrayBuffer,d.byteOffset,d.byteLength);return new Response(h,{headers:{"content-type":d.mimeType}})}}}function s3(r){let e=r.lastIndexOf("/");return e>=0?r.slice(0,e):""}function i3(r){let e=r.lastIndexOf("/");return e>=0?r.slice(e+1):r}async function o3(r,e,t){let n=r.json.files||[];await Promise.all(n.map((s,i)=>fd(r,i,e,t)))}async function a3(r,e,t,n){let s=r.json.buffers||[],i=n?new Set(typeof n=="function"?n(r.json):n):void 0;for(let o=0;o<s.length;++o){if(i&&!i.has(o))continue;let a=s[o];if(a.uri){let{fetch:c}=t;H(c);let u=Kn(a.uri,e,t),f=await(await t?.fetch?.(u))?.arrayBuffer?.();r.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete a.uri}else r.buffers[o]===null&&(r.buffers[o]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}async function c3(r,e,t){let n=u3(r),s=r.json.images||[],i=[];for(let o of n)i.push(l3(r,s[o],o,e,t));return await Promise.all(i)}function u3(r){let e=new Set;r.json.asset.thumbnail!==void 0&&e.add(r.json.asset.thumbnail);let t=r.json.textures||[];for(let n of t)n.source!==void 0&&e.add(n.source);return Array.from(e).sort()}async function l3(r,e,t,n,s){let i;if(e.uri&&!e.hasOwnProperty("bufferView")){let l=Kn(e.uri,n,s),{fetch:f}=s;i=await(await f(l)).arrayBuffer(),e.bufferView={data:i}}if(Number.isFinite(e.bufferView)){let l=hr(r.json,r.buffers,e.bufferView);i=eo(l.buffer,l.byteOffset,l.byteLength)}H(i,"glTF image has no data");let o=YC(n,e.mimeType),a=iu(s);if(!!(a&&!n.gltf?.excludeExtensions?.includes("MSFT_texture_dds")&&r.json.textures?.some(l=>l.source===t&&l.extensions?.MSFT_texture_dds?.source===t))){let l=await Xs(i,a,n,s);H(l.length>0,"MSFT_texture_dds parser returned no texture levels"),r.images=r.images||[],r.images[t]={compressed:!0,mipmaps:!0,width:l[0].width,height:l[0].height,data:l};return}let u=await Xs(i,[Hc,io],o,s);u&&u[0]&&(u={compressed:!0,mipmaps:!1,width:u[0].width,height:u[0].height,data:u[0]}),r.images=r.images||[],r.images[t]=u}var ZC,JE=p(()=>{"use strict";Ue();qn();qn();oo();bg();Yc();WI();ao();oE();oy();KE();ZC="gltf-package://"});async function YE(r,e={},t){let n={...Uy.options,...e};n.gltf={...Uy.options.gltf,...n.gltf};let s=e?.glb?.byteOffset||0;return await XE({},r,s,n,t)}var Rre,f3,Uy,QE=p(()=>{"use strict";JE();eL();({preload:Rre,...f3}=ZE),Uy={...f3,parse:YE}});var Py={};J(Py,{GLTFLoaderWithParser:()=>Uy,parse:()=>YE});var Vy=p(()=>{"use strict";QE()});async function d3(){let{GLTFLoaderWithParser:r}=await Promise.resolve().then(()=>(Vy(),Py));return r}var ZE,eL=p(()=>{"use strict";Zb();eg();ZE={dataType:null,batchType:null,...Uv,version:Yf,preload:d3,options:{gltf:{normalize:!0,loadBuffers:!0,loadFiles:!1,loadExternalAssets:!1,loadImages:!0,loadAudio:!0,decompressMeshes:!0}}}});async function m3(r,e){return tL(r,e)}function tL(r,e){let t={};return ad(t,r,e?.glb?.byteOffset||0,e?.glb),t}var Gre,h3,p3,rL=p(()=>{"use strict";bg();sL();({preload:Gre,...h3}=nL),p3={...h3,parse:m3,parseSync:tL}});var jy={};J(jy,{GLBLoaderWithParser:()=>p3});var Gy=p(()=>{"use strict";rL()});async function b3(){let{GLBLoaderWithParser:r}=await Promise.resolve().then(()=>(Gy(),jy));return r}var nL,sL=p(()=>{"use strict";Zb();eg();nL={dataType:null,batchType:null,...Pv,version:Yf,preload:b3,options:{glb:{strict:!1}}}});function g3(r){return typeof r=="string"?r.charAt(0).toLowerCase()+r.slice(1):r}function Ld(r){if(Array.isArray(r))return r.map(e=>Ld(e));if(r&&typeof r=="object"){let e={};for(let[t,n]of Object.entries(r))Object.defineProperty(e,g3(t),{value:Ld(n),enumerable:!0,configurable:!0,writable:!0});return e}return r}var iL=p(()=>{"use strict"});var oL,y3,w3,x3,bu,zy,T3,_3,gu,Wy,Sa,aL=p(()=>{"use strict";oL={ontext:()=>{},onprocessinginstruction:()=>{},onsgmldeclaration:()=>{},ondoctype:()=>{},oncomment:()=>{},onopentagstart:()=>{},onattribute:()=>{},onopentag:()=>{},onclosetag:()=>{},onopencdata:()=>{},oncdata:()=>{},onclosecdata:()=>{},onerror:()=>{},onend:()=>{},onready:()=>{},onscript:()=>{},onopennamespace:()=>{},onclosenamespace:()=>{}},y3={...oL,strict:!1,MAX_BUFFER_LENGTH:64*1024,lowercase:!1,lowercasetags:!1,noscript:!1,strictEntities:!1,preserveCase:!1,caseInsensitiveTags:!1,processEntities:!0,xmlns:void 0,position:void 0,trim:void 0,normalize:void 0},w3=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],x3=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"],bu=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,zy=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,T3=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_3=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,gu={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(gu).forEach(r=>{let e=gu[r];gu[r]=typeof e=="number"?String.fromCharCode(e):e});Wy=class r{EVENTS=w3;ENTITIES={...gu};XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};S=0;opt;trackPosition=!1;column=0;line=0;c="";error;q="";bufferCheckPosition;closed=!1;tags=[];looseCase="";closedRoot=!1;sawRoot=!1;strict=!1;tag;strictEntities;state;noscript=!1;attribList=[];ns;position=0;STATE={BEGIN:this.S++,BEGIN_WHITESPACE:this.S++,TEXT:this.S++,TEXT_ENTITY:this.S++,OPEN_WAKA:this.S++,SGML_DECL:this.S++,SGML_DECL_QUOTED:this.S++,DOCTYPE:this.S++,DOCTYPE_QUOTED:this.S++,DOCTYPE_DTD:this.S++,DOCTYPE_DTD_QUOTED:this.S++,COMMENT_STARTING:this.S++,COMMENT:this.S++,COMMENT_ENDING:this.S++,COMMENT_ENDED:this.S++,CDATA:this.S++,CDATA_ENDING:this.S++,CDATA_ENDING_2:this.S++,PROC_INST:this.S++,PROC_INST_BODY:this.S++,PROC_INST_ENDING:this.S++,OPEN_TAG:this.S++,OPEN_TAG_SLASH:this.S++,ATTRIB:this.S++,ATTRIB_NAME:this.S++,ATTRIB_NAME_SAW_WHITE:this.S++,ATTRIB_VALUE:this.S++,ATTRIB_VALUE_QUOTED:this.S++,ATTRIB_VALUE_CLOSED:this.S++,ATTRIB_VALUE_UNQUOTED:this.S++,ATTRIB_VALUE_ENTITY_Q:this.S++,ATTRIB_VALUE_ENTITY_U:this.S++,CLOSE_TAG:this.S++,CLOSE_TAG_SAW_WHITE:this.S++,SCRIPT:this.S++,SCRIPT_ENDING:this.S++};BUFFERS=x3;CDATA="[CDATA[";DOCTYPE="DOCTYPE";XML_NAMESPACE="http://www.w3.org/XML/1998/namespace";XMLNS_NAMESPACE="http://www.w3.org/2000/xmlns/";rootNS={xml:this.XML_NAMESPACE,xmlns:this.XMLNS_NAMESPACE};comment;sgmlDecl;textNode="";tagName;doctype;procInstName;procInstBody;entity="";attribName;attribValue;cdata="";script="";startTagPosition=0;constructor(){this.S=0;for(let e in this.STATE)this.STATE.hasOwnProperty(e)&&(this.STATE[this.STATE[e]]=e);this.S=this.STATE}static charAt(e,t){let n="";return t<e.length&&(n=e.charAt(t)),n}static isWhitespace(e){return e===" "||e===`
42
+ `),n="",s="",i=0,o=[],a=typeof"".trimLeft=="function";for(let l=0,f=t.length;l<f;l++)if(n=t[l],n=a?n.trimLeft():n.trim(),i=n.length,i!==0&&(s=n.charAt(0),s!=="#"))if(s==="v"){let d=n.split(/\s+/);switch(d[0]){case"v":e.vertices.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])),d.length>=7&&e.colors.push(parseFloat(d[4]),parseFloat(d[5]),parseFloat(d[6]));break;case"vn":e.normals.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));break;case"vt":e.uvs.push(parseFloat(d[1]),parseFloat(d[2]));break;default:}}else if(s==="f"){let h=n.substr(1).trim().split(/\s+/),m=[];for(let g=0,y=h.length;g<y;g++){let x=h[g];if(x.length>0){let T=x.split("/");m.push(T)}}let b=m[0];for(let g=1,y=m.length-1;g<y;g++){let x=m[g],T=m[g+1];e.addFace(b[0],x[0],T[0],b[1],x[1],T[1],b[2],x[2],T[2])}}else if(s==="l"){let d=n.substring(1).trim().split(" "),h,m=[];if(n.indexOf("/")===-1)h=d;else{h=[];for(let b=0,g=d.length;b<g;b++){let y=d[b].split("/");y[0]!==""&&h.push(y[0]),y[1]!==""&&m.push(y[1])}}e.addLineGeometry(h,m)}else if(s==="p"){let h=n.substr(1).trim().split(" ");e.addPointGeometry(h)}else if(Sv.test(n)){o=Sv.exec(n)||[];let d=(" "+o[0].substr(1).trim()).substr(1);e.startObject(d)}else if(iD.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(sD.test(n))e.materialLibraries.push(n.substring(7).trim());else if(s==="s"){if(o=n.split(" "),o.length>1){let h=o[1].trim().toLowerCase();e.object.smooth=h!=="0"&&h!=="off"}else e.object.smooth=!0;let d=e.object.currentMaterial();d&&(d.smooth=e.object.smooth)}else{if(n==="\0")continue;throw new Error(`Unexpected line: "${n}"`)}e.finalize();let c=[],u=[];for(let l of e.objects){let{geometry:f}=l;if(f.vertices.length===0)continue;let d={header:{vertexCount:f.vertices.length/3},attributes:{}};switch(f.type){case"Points":d.mode=0;break;case"Line":d.mode=1;break;default:d.mode=4;break}d.attributes.POSITION={value:new Float32Array(f.vertices),size:3},f.normals.length>0&&(d.attributes.NORMAL={value:new Float32Array(f.normals),size:3}),f.colors.length>0&&(d.attributes.COLOR_0={value:new Float32Array(f.colors),size:3}),f.uvs.length>0&&(d.attributes.TEXCOORD_0={value:new Float32Array(f.uvs),size:2}),d.materials=[];for(let h of l.materials){let m={name:h.name,flatShading:!h.smooth};d.materials.push(m),u.push(m)}d.name=l.name,c.push(d)}return{meshes:c,materials:u}}var Sv,sD,iD,zb,Wb,$b,Lv=p(()=>{"use strict";Sv=/^[og]\s*(.+)?/,sD=/^mtllib /,iD=/^usemtl /,zb=class r{constructor({index:e,name:t="",mtllib:n,smooth:s,groupStart:i}){this.index=e,this.name=t,this.mtllib=n,this.smooth=s,this.groupStart=i,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}clone(e=this.index){return new r({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}},Wb=class{constructor(e=""){this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0,this.fromDeclaration=null}startMaterial(e,t){let n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);let s=new zb({index:this.materials.length,name:e,mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:n!==void 0?n.smooth:this.smooth,groupStart:n!==void 0?n.groupEnd:0});return this.materials.push(s),s}currentMaterial(){if(this.materials.length>0)return this.materials[this.materials.length-1]}_finalize(e){let t=this.currentMaterial();if(t&&t.groupEnd===-1&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let n=this.materials.length-1;n>=0;n--)this.materials[n].groupCount<=0&&this.materials.splice(n,1);return e&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),t}},$b=class{constructor(){this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}startObject(e,t=!0){if(this.object&&!this.object.fromDeclaration){this.object.name=e,this.object.fromDeclaration=t;return}let n=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object=new Wb(e),this.object.fromDeclaration=t,n&&n.name&&typeof n.clone=="function"){let s=n.clone(0);s.inherited=!0,this.object.materials.push(s)}this.objects.push(this.object)}finalize(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)}parseVertexIndex(e,t){let n=parseInt(e);return(n>=0?n-1:n+t/3)*3}parseNormalIndex(e,t){let n=parseInt(e);return(n>=0?n-1:n+t/3)*3}parseUVIndex(e,t){let n=parseInt(e);return(n>=0?n-1:n+t/2)*2}addVertex(e,t,n){let s=this.vertices,i=this.object.geometry.vertices;i.push(s[e+0],s[e+1],s[e+2]),i.push(s[t+0],s[t+1],s[t+2]),i.push(s[n+0],s[n+1],s[n+2])}addVertexPoint(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])}addVertexLine(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])}addNormal(e,t,n){let s=this.normals,i=this.object.geometry.normals;i.push(s[e+0],s[e+1],s[e+2]),i.push(s[t+0],s[t+1],s[t+2]),i.push(s[n+0],s[n+1],s[n+2])}addColor(e,t,n){let s=this.colors,i=this.object.geometry.colors;i.push(s[e+0],s[e+1],s[e+2]),i.push(s[t+0],s[t+1],s[t+2]),i.push(s[n+0],s[n+1],s[n+2])}addUV(e,t,n){let s=this.uvs,i=this.object.geometry.uvs;i.push(s[e+0],s[e+1]),i.push(s[t+0],s[t+1]),i.push(s[n+0],s[n+1])}addUVLine(e){let t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])}addFace(e,t,n,s,i,o,a,c,u){let l=this.vertices.length,f=this.parseVertexIndex(e,l),d=this.parseVertexIndex(t,l),h=this.parseVertexIndex(n,l);if(this.addVertex(f,d,h),s!==void 0&&s!==""){let m=this.uvs.length;f=this.parseUVIndex(s,m),d=this.parseUVIndex(i,m),h=this.parseUVIndex(o,m),this.addUV(f,d,h)}if(a!==void 0&&a!==""){let m=this.normals.length;f=this.parseNormalIndex(a,m),d=a===c?f:this.parseNormalIndex(c,m),h=a===u?f:this.parseNormalIndex(u,m),this.addNormal(f,d,h)}this.colors.length>0&&this.addColor(f,d,h)}addPointGeometry(e){this.object.geometry.type="Points";let t=this.vertices.length;for(let n of e)this.addVertexPoint(this.parseVertexIndex(n,t))}addLineGeometry(e,t){this.object.geometry.type="Line";let n=this.vertices.length,s=this.uvs.length;for(let i of e)this.addVertexLine(this.parseVertexIndex(i,n));for(let i of t)this.addUVLine(this.parseUVIndex(i,s))}}});function Kf(r,e){let{meshes:t}=Ev(r),n=t.reduce((a,c)=>a+c.header.vertexCount,0),s=oD(t,n),i={vertexCount:n,boundingBox:Er(s)??void 0},o=qf(s,{mode:4,boundingBox:i.boundingBox});return{loaderData:{header:{}},schema:o,header:i,mode:4,topology:"point-list",attributes:s}}function oD(r,e){let t=new Float32Array(e*3),n,s,i,o=0;for(let c of r){let{POSITION:u,NORMAL:l,COLOR_0:f,TEXCOORD_0:d}=c.attributes;t.set(u.value,o*3),l&&(n=n||new Float32Array(e*3),n.set(l.value,o*3)),f&&(s=s||new Float32Array(e*3),s.set(f.value,o*3)),d&&(i=i||new Float32Array(e*2),i.set(d.value,o*2)),o+=u.value.length/3}let a={};return a.POSITION={value:t,size:3},n&&(a.NORMAL={value:n,size:3}),s&&(a.COLOR_0={value:s,size:3}),i&&(a.TEXCOORD_0={value:i,size:2}),a}var Bv=p(()=>{"use strict";mn();Lv();Gb()});function Fv(r,e){let t=ei(r,"arrow-table");return e?.obj?.shape==="mesh"?pn(t):t}function uD(r){let e=r?.batchSize??r?.core?.batchSize;return typeof e=="number"?e:void 0}function lD(r){return r.split(/\r?\n/).some(e=>{let t=e.trimStart();return t.startsWith("f ")||t.startsWith("l ")})}function*fD(r,e,t){let n=r.split(/\r?\n/).filter(s=>s.trimStart().startsWith("v "));yield*hD(n,e,t)}async function*dD(r,e,t){let n=t||1e3,s=[];for await(let i of r)i.trimStart().startsWith("v ")&&(s.push(i),s.length>=n&&(yield Xf(qb(s),e),s=[]));s.length>0&&(yield Xf(qb(s),e))}function*hD(r,e,t){let n=t||r.length||1;for(let s=0;s<r.length;s+=n){let i=qb(r.slice(s,s+n));yield Xf(i,e)}}function qb(r){let e=new Float32Array(r.length*3);for(let s=0;s<r.length;s++){let i=r[s].trim().split(/\s+/);e[s*3+0]=Number(i[1]),e[s*3+1]=Number(i[2]),e[s*3+2]=Number(i[3])}let t={POSITION:{value:e,size:3}},n=Er(t);return{loaderData:{header:{}},schema:qf(t,{mode:0,boundingBox:n??void 0}),header:{vertexCount:r.length,boundingBox:n??void 0},mode:0,topology:"point-list",attributes:t}}function Xf(r,e){let t=ei(r,"arrow-table");if(e?.obj?.shape==="mesh"){let n=pn(t);return{shape:"mesh",batchType:"data",data:n,length:n.header?.vertexCount||0}}return hb(t)}function pD(r,e){let t=gm(r);return e?.obj?.shape==="mesh"?pn(t):t}function mD(r,e){let t=gm(r);return e?.obj?.shape!=="mesh"?t:{shape:"mesh",batchType:"data",data:pn(t),length:t.length}}var eY,aD,cD,Ov=p(()=>{"use strict";Ue();ea();mn();Gb();Bv();Dv();({preload:eY,...aD}=Mv);cD={...aD,parse:async(r,e)=>Fv(Kf(new TextDecoder().decode(r),e),e),parseTextSync:(r,e)=>Fv(Kf(r,e),e),parseInBatches:async function*(r,e){let t=uD(e);if(e?.obj?.pointCloud){let i=ub(r),o=lb(i);yield*dD(o,e,t);return}let n=await fb(r),s=new TextDecoder().decode(n);if(lD(s)){yield Xf(Kf(s,e),e);return}yield*fD(s,e,t)},serializeWorkerResult:Hi,deserializeWorkerResult:pD,serializeWorkerBatch:Hi,deserializeWorkerBatch:mD}});var Kb={};J(Kb,{OBJLoaderWithParser:()=>cD});var Xb=p(()=>{"use strict";Ov()});async function gD(){let{OBJLoaderWithParser:r}=await Promise.resolve().then(()=>(Xb(),Kb));return r}function yD(r){return r[0]==="v"}var bD,Mv,Dv=p(()=>{"use strict";lx();ea();bD="5.0.0-beta.7";Mv={...ux,dataType:null,batchType:null,version:bD,worker:!0,workerInBatches:!0,serializeWorkerResult:Hi,text:!0,testText:yD,options:{obj:{shape:"arrow-table"}},preload:gD}});var Rv,kv=p(()=>{"use strict";Rv={name:"MTL",id:"mtl",module:"mtl",encoding:"text",format:"mtl",extensions:["mtl"],mimeTypes:["text/plain"]}});function Hb(r,e){let t=[],n={name:"placeholder"},s=r.split(`
43
+ `);for(let i of s){if(i=i.trim(),i.length===0||i.charAt(0)==="#")continue;let o=i.indexOf(" "),a=o>=0?i.substring(0,o):i;a=a.toLowerCase();let c=o>=0?i.substring(o+1):"";switch(c=c.trim(),a){case"newmtl":n={name:c},t.push(n);break;case"ka":n.ambientColor=Hf(c);break;case"kd":n.diffuseColor=Hf(c);break;case"map_kd":n.diffuseTextureUrl=c;break;case"ks":n.specularColor=Hf(c);break;case"map_ks":n.specularTextureUrl=c;break;case"ke":n.emissiveColor=Hf(c);break;case"map_ke":n.emissiveTextureUrl=c;break;case"ns":n.shininess=parseFloat(c);break;case"map_ns":break;case"ni":n.refraction=parseFloat(c);break;case"illum":n.illumination=parseFloat(c);break;default:break}}return t}function Hf(r,e){let t=r.split(wD,3);return[parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])]}var wD,Nv=p(()=>{"use strict";wD=/\s+/});var fY,xD,dY,TD,_D,AD,Cv=p(()=>{"use strict";Nv();Jb();Jb();({preload:fY,...xD}=Jf),{preload:dY,...TD}=Jf,_D={...xD},AD={...TD,parse:async(r,e)=>Hb(new TextDecoder().decode(r),e?.mtl),parseTextSync:(r,e)=>Hb(r,e?.mtl)}});var Yb={};J(Yb,{MTLLoaderWithParser:()=>AD,MTLWorkerLoaderWithParser:()=>_D});var Qb=p(()=>{"use strict";Cv()});async function ID(){let{MTLLoaderWithParser:r}=await Promise.resolve().then(()=>(Qb(),Yb));return r}var vD,Jf,Jb=p(()=>{"use strict";kv();vD="5.0.0-beta.7";Jf={...Rv,dataType:null,batchType:null,version:vD,worker:!0,text:!0,testText:r=>r.includes("newmtl"),options:{mtl:{}},preload:ID}});var Yf,Zb=p(()=>{"use strict";Yf="5.0.0-beta.7"});var Uv,Pv,eg=p(()=>{"use strict";Uv={name:"glTF",id:"gltf",module:"scene",encoding:"binary",format:"gltf",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"]},Pv={name:"GLB",id:"glb",module:"scene",encoding:"binary",format:"glb",extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,tests:["glTF"]}});function Vv(r){return!BD(r,"ftyp",4)||(r[8]&96)===0?null:SD(r)}function SD(r){switch(ED(r,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function ED(r,e,t){return String.fromCharCode(...r.slice(e,t))}function LD(r){return[...r].map(e=>e.charCodeAt(0))}function BD(r,e,t=0){let n=LD(e);for(let s=0;s<n.length;++s)if(n[s]!==r[s+t])return!1;return!0}var jv=p(()=>{"use strict"});function $n(r){let e=Xc(r);return OD(e)||RD(e)||MD(e)||DD(e)||FD(e)}function FD(r){let e=new Uint8Array(r instanceof DataView?r.buffer:r),t=Vv(e);return t?{mimeType:t.mimeType,width:0,height:0}:null}function OD(r){let e=Xc(r);return e.byteLength>=33&&e.getUint32(0,dr)===2303741511&&e.getUint32(4,dr)===218765834&&e.getUint32(8,dr)===13&&e.getUint32(12,dr)===1229472850?{mimeType:"image/png",width:e.getUint32(16,dr),height:e.getUint32(20,dr)}:null}function MD(r){let e=Xc(r);return e.byteLength>=10&&e.getUint32(0,dr)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Kc),height:e.getUint16(8,Kc)}:null}function DD(r){let e=Xc(r);return e.byteLength>=14&&e.getUint16(0,dr)===16973&&e.getUint32(2,Kc)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Kc),height:e.getUint32(22,Kc)}:null}function RD(r){let e=Xc(r);if(!(e.byteLength>=3&&e.getUint16(0,dr)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=kD(),i=2;for(;i+9<e.byteLength;){let o=e.getUint16(i,dr);if(s.has(o))return{mimeType:"image/jpeg",height:e.getUint16(i+5,dr),width:e.getUint16(i+7,dr)};if(!n.has(o))return null;i+=2,i+=e.getUint16(i,dr)}return null}function kD(){let r=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)r.add(t);return{tableMarkers:r,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Xc(r){if(r instanceof DataView)return r;if(ArrayBuffer.isView(r))return new DataView(r.buffer);if(r instanceof ArrayBuffer)return new DataView(r);throw new Error("toDataView")}var dr,Kc,Qf=p(()=>{"use strict";jv();dr=!1,Kc=!0});var ND,CD,UD,Gv,zv=p(()=>{"use strict";Qf();ND=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],CD=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],UD={id:"image",module:"images",name:"Images",encoding:"image",format:"image",mimeTypes:CD,extensions:ND,tests:[r=>!!$n(new DataView(r))]},Gv={...UD,id:"imagebitmap",name:"ImageBitmap",format:"image-bitmap"}});var Zf,tg=p(()=>{"use strict";Zf="5.0.0-beta.7"});function da(r){if(!r)return!1;if(PD.test(r))return!0;for(let e=r.indexOf(".svg");e>=0;e=r.indexOf(".svg",e+4)){let t=r[e+4];if(t===void 0||t==="?"||t==="#")return!0}return!1}function Wv(r,e){if(da(e)){let n=new TextDecoder().decode(r);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return rg(r,e)}function rg(r,e){if(da(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(r)])}var PD,ed=p(()=>{"use strict";PD=/^data:image\/svg\+xml/});async function $v(r,e,t){let n=Wv(r,t),s=self.URL||self.webkitURL,i=typeof n!="string"&&s.createObjectURL(n);try{return await VD(i||n,e)}finally{i&&s.revokeObjectURL(i)}}async function VD(r,e){let t=new Image;return t.src=r,e?.image?.decode&&t.decode?(await t.decode(),t):await new Promise((n,s)=>{try{t.onload=()=>n(t),t.onerror=i=>{let o=i instanceof Error?i.message:"error";s(new Error(o))}}catch(i){s(i)}})}var qv=p(()=>{"use strict";ed()});async function Xv(r,e,t){let n;da(t)?n=await $v(r,e,t):n=rg(r,t);let s=e&&e.imagebitmap;return await Jv(n,s)}async function Hv(r,e){let t=e&&e.imagebitmap;return await Jv(r,t)}async function Jv(r,e=null){if((jD(e)||!Kv)&&(e=null),e)try{return await createImageBitmap(r,e)}catch(t){console.warn(t),Kv=!1}return await createImageBitmap(r)}function jD(r){if(!r)return!0;for(let e in r)if(Object.prototype.hasOwnProperty.call(r,e))return!1;return!0}var Kv,Yv=p(()=>{"use strict";ed();qv();Kv=!0});async function Qv(r,e){let{mimeType:t}=$n(r)||{},n=globalThis.loaders?.parseImageNode;fr(n);let s=globalThis.loaders?.createImageBitmapNode;if(!s)throw new Error("Install '@loaders.gl/core/polyfills' to parse images under Node.js");let i=await n(r,t);return s(i)}var Zv=p(()=>{"use strict";Ue();Qf()});async function ng(r,e,t){e=e||{},rI(e);let n=!!globalThis.loaders?.parseImageNode;if(!Gn||n)return await Qv(r,e);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(eI);return await Xv(r,e,t?.url)}async function tI(r,e,t){e=e||{},rI(e);let n=!!globalThis.loaders?.parseImageNode;if(!Gn||n||da(t?.url)||r.type.startsWith("image/svg+xml"))return await ng(await r.arrayBuffer(),e,t);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(eI);return await Hv(r,e)}function rI(r){let e=r.image?.type;if(e&&e!=="imagebitmap")throw new Error(GD)}var GD,eI,nI=p(()=>{"use strict";Ue();Yv();ed();Zv();GD="@loaders.gl/images: ImageLoader only accepts options.image.type='imagebitmap'. Remove legacy image/data/auto values and call getImageData(image) if you need raw pixels.",eI="@loaders.gl/images: ImageLoader requires browser ImageBitmap support. Use a browser with createImageBitmap support or load images under Node.js with @loaders.gl/core/polyfills."});var sI={};J(sI,{ImageLoaderWithParser:()=>WD});var jY,zD,WD,iI=p(()=>{"use strict";nI();sg();({preload:jY,...zD}=Hc),WD={...zD,parse:ng,parseBlob:tI}});async function qD(){let{ImageLoaderWithParser:r}=await Promise.resolve().then(()=>(iI(),sI));return r}var $D,Hc,sg=p(()=>{"use strict";tg();zv();$D={image:{}};Hc={dataType:null,batchType:null,...Gv,version:Zf,options:$D,preload:qD}});function aI(r){let e=JD(r);if(!e)throw new Error("Not an image");return e}function Jc(r){switch(aI(r)){case"data":return r;case"imagebitmap":return KD(r)?XD(r):oI(r);case"image":return oI(r);default:throw new Error("getImageData")}}function KD(r){let e=globalThis.loaders?.isImageBitmapNode;return!!e?.(r)}function XD(r){let e=globalThis.loaders?.getImageBitmapDataNode;if(!e)throw new Error("getImageData");return e(r)}function oI(r){let e=HD(r.width,r.height),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=r.width,e.height=r.height,t.drawImage(r,0,0),t.getImageData(0,0,r.width,r.height)}function HD(r,e){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(r,e);if(typeof document<"u"){let t=document.createElement("canvas");return t.width=r,t.height=e,t}throw new Error("getImageData")}function JD(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&r instanceof Image?"image":r&&typeof r=="object"&&r.data&&r.width&&r.height?"data":null}var cI=p(()=>{"use strict"});async function og(){return td?await td:(td=QD(),await td)}async function QD(){let r=new Set;for(let e of YD)(Gn?await tR(e):uI(e))&&r.add(e);return r}function ag(r){if(ig[r]===void 0){let e=Gn?ZD(r):uI(r);ig[r]=e}return ig[r]}function uI(r){let e=["image/png","image/jpeg","image/gif"],t=globalThis.loaders?.imageFormatsNode||e;return!!globalThis.loaders?.parseImageNode&&t.includes(r)}function ZD(r){switch(r){case"image/avif":case"image/webp":return rR(r);default:return!0}}async function tR(r){let e=eR[r];return e?await nR(e):!0}function rR(r){try{return document.createElement("canvas").toDataURL(r).indexOf(`data:${r}`)===0}catch{return!1}}async function nR(r){return new Promise(e=>{let t=new Image;t.src=r,t.onload=()=>e(t.height>0),t.onerror=()=>e(!1)})}var YD,td,ig,eR,cg=p(()=>{"use strict";Ue();YD=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/tiff","image/svg","image/svg+xml","image/bmp","image/vnd.microsoft.icon"],td=null;ig={};eR={"image/avif":"data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=","image/webp":"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"}});var lI,fI=p(()=>{"use strict";lI={name:"Basis",id:"basis",module:"images",encoding:"image",format:"basis",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],binary:!0,tests:["sB"]}});function hI(r){if(!rd){r=r||iR()||void 0,rd=new Set;for(let e of sR)for(let t in dI)if(r&&r.getExtension(`${e}${t}`))for(let n of dI[t])rd.add(n)}return rd}function iR(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var sR,dI,rd,pI=p(()=>{"use strict";sR=["","WEBKIT_","MOZ_"],dI={WEBGL_compressed_texture_s3tc:["bc1-rgb-unorm-webgl","bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"],WEBGL_compressed_texture_s3tc_srgb:["bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"],EXT_texture_compression_rgtc:["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"],EXT_texture_compression_bptc:["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"],WEBGL_compressed_texture_etc1:["etc1-rgb-unorm-webgl"],WEBGL_compressed_texture_etc:["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"],WEBGL_compressed_texture_pvrtc:["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"],WEBGL_compressed_texture_atc:["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"],WEBGL_compressed_texture_astc:["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]},rd=null});function bI(r=hI(),e,t={}){let n=new Set(r);if(!e)return aR(n);if(e.isHDR){let s=mI(e);return t.astcHDR&&(s==="astc-4x4"||s==="astc-6x6")&&nd(n,s.slice(5))?s==="astc-4x4"?"astc-hdr-4x4":"astc-hdr-6x6":n.has("bc6h-rgb-ufloat")?"bc6h":"rgba16f"}if(e.codec==="xubc7")return lg(n)?"bc7":"rgba32";if(e.codec.startsWith("xuastc-ldr-")||e.codec.startsWith("astc-ldr-")){let s=mI(e);return s&&nd(n,s.slice(5))?s:ug(n,e,["bc7","bc","etc2","atc"])}return e.codec==="uastc-ldr-4x4"?nd(n,"4x4")?"astc-4x4":ug(n,e,["bc7","bc","etc2","etc1","pvrtc","atc"]):ug(n,e,["etc2","etc1","bc7","bc","pvrtc","atc"])}function aR(r){return nd(r,"4x4")?"astc-4x4":lg(r)?"bc7":gI(r)?{alpha:"bc3",noAlpha:"bc1"}:yI(r)?"etc2":r.has("etc1-rgb-unorm-webgl")?{alpha:"rgba32",noAlpha:"etc1"}:wI(r)?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:xI(r)?{alpha:"atc-rgba-interpolated-alpha",noAlpha:"atc-rgb"}:{alpha:"rgba32",noAlpha:"rgb565"}}function ug(r,e,t){for(let n of t)switch(n){case"bc7":if(lg(r))return"bc7";break;case"bc":if(gI(r))return e.hasAlpha?"bc3":"bc1";break;case"etc2":if(yI(r))return"etc2";break;case"etc1":if(!e.hasAlpha&&r.has("etc1-rgb-unorm-webgl"))return"etc1";break;case"pvrtc":if(wI(r))return e.hasAlpha?"pvrtc1-4-rgba":"pvrtc1-4-rgb";break;case"atc":if(xI(r))return e.hasAlpha?"atc-rgba-interpolated-alpha":"atc-rgb";break;default:break}return e.hasAlpha?"rgba32":"rgb565"}function mI(r){let e=`${r.blockWidth}x${r.blockHeight}`;return oR.includes(e)?`astc-${e}`:null}function nd(r,e){return ha(r,[`astc-${e}-unorm`,`astc-${e}-unorm-srgb`])}function lg(r){return ha(r,["bc7-rgba-unorm","bc7-rgba-unorm-srgb"])}function gI(r){return ha(r,["bc1-rgb-unorm-webgl","bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb"])}function yI(r){return ha(r,["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb"])}function wI(r){return ha(r,["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"])}function xI(r){return ha(r,["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"])}function ha(r,e){return e.some(t=>r.has(t))}var oR,TI=p(()=>{"use strict";pI();oR=["4x4","5x4","5x5","6x5","6x6","8x5","8x6","8x8","10x5","10x6","10x8","10x10","12x10","12x12"]});async function vI(r){xm(r.modules);let e=Tm("basis");return e||(AI||=cR(r),await AI)}async function cR(r){let e=null,t=null;return[e,t]=await Promise.all([await ia(_I.TRANSCODER,"images",r,null,"basis_transcoder.mjs"),await ia(_I.TRANSCODER_WASM,"images",r)]),e=e||globalThis.BASIS,await uR(e,t)}function uR(r,e){let t={};return e&&(t.wasmBinary=e),Ji(()=>r(t),n=>{let{BasisFile:s,KTX2File:i,getBasisTexFormatBlockHeight:o,getBasisTexFormatBlockWidth:a,initializeBasis:c,isFormatSupported:u}=n;return c(),{BasisFile:s,KTX2File:i,getBasisTexFormatBlockHeight:o,getBasisTexFormatBlockWidth:a,isFormatSupported:u}})}var _I,AI,II=p(()=>{"use strict";Ue();Js();_I={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"}});function SI(r){if(r.byteLength<fg.byteLength)return!1;let e=new Uint8Array(r,0,fg.byteLength);return fg.every((t,n)=>e[n]===t)}var fg,EI=p(()=>{"use strict";fg=new Uint8Array([171,75,84,88,32,50,48,187,13,10,26,10])});async function hR(r){let e=LI,t;LI=new Promise(n=>{t=n}),await e;try{return await r()}finally{t()}}async function FI(r,e={}){return await hR(async()=>{let t=await vI(hn(e)),n=e.basis?.containerFormat||"auto";if(n==="ktx2"||n==="auto"&&SI(r)){if(!t.KTX2File)throw new Error("The injected Basis transcoder module does not provide KTX2File");return mR(t,r,e)}return pR(t,r,e)})}function pR(r,e,t){let n=new r.BasisFile(new Uint8Array(e));try{let s=MI(n,!1);if(!n.startTranscoding())throw new Error("Failed to start Basis transcoding");let i=[];for(let o=0;o<n.getNumImages();o++){let a=[];for(let c=0;c<n.getNumLevels(o);c++){let u=n.getImageWidth(o,c),l=n.getImageHeight(o,c);a.push(OI(n,s,u,l,t,f=>n.getImageTranscodedSizeInBytes(o,c,f),(f,d)=>n.transcodeImage(f,o,c,d,0,0)))}i.push(a)}return i}finally{n.close(),n.delete()}}function mR(r,e,t){let n=new r.KTX2File(new Uint8Array(e));try{if(!n.isValid())throw new Error("Invalid KTX2 texture");if(n.getHeader().pixelDepth>0)throw new Error("BasisLoader does not support 3D KTX2 textures");let i=MI(n,!0);if(!n.startTranscoding())throw new Error("Failed to start KTX2 transcoding");let o=Math.max(1,n.getLayers()),a=Math.max(1,n.getFaces()),c=[];for(let u=0;u<o;u++)for(let l=0;l<a;l++){let f=[];for(let d=0;d<n.getLevels();d++){let h=n.getImageLevelInfo(d,u,l);f.push(OI(n,{...i,hasAlpha:!!h.alphaFlag},h.width,h.height,t,m=>n.getImageTranscodedSizeInBytes(d,u,l,m),(m,b)=>n.transcodeImage(m,d,u,l,b,0,-1,-1)))}c.push(f)}return c}finally{n.close(),n.delete()}}function OI(r,e,t,n,s,i,o){let a=gR(s,e);bR(e,dg(s,e));let c=i(a.basisFormat),u=wR(c,a.dataType);if(!o(u,a.basisFormat))throw new Error(`Failed to transcode Basis texture to ${dg(s,e)}`);let l=e.isSRGB&&a.srgbTextureFormat;return{shape:"texture-level",width:t,height:n,data:u,compressed:a.compressed,format:l&&a.srgbFormat||a.format,textureFormat:l?a.srgbTextureFormat:a.textureFormat,levelSize:c,hasAlpha:e.hasAlpha}}function bR(r,e){let t=e==="bc6h"||e==="rgba16f"||e==="rgb9e5"||e.startsWith("astc-hdr-");if(r.isHDR!==t)throw new Error(`Basis source codec ${r.codec} cannot be transcoded to ${e}`);if(r.codec==="xubc7"&&e!=="bc7"&&e!=="rgba32")throw new Error(`Basis source codec ${r.codec} cannot be transcoded to ${e}`)}function gR(r,e){let t=dg(r,e),n=BI[t];if(!n)throw new Error(`Unknown Basis format ${t}`);return n}function dg(r,e){let t=r.basis?.format||"auto";return t==="auto"&&(t=bI(r.basis?.supportedTextureFormats,e,r.basis?.supportedTextureFeatures)),typeof t=="object"&&(t=e.hasAlpha?t.alpha:t.noAlpha),t.toLowerCase()}function MI(r,e){let t=r.getBasisTexFormat(),n=yR[t];if(!n)throw new Error(`Unsupported Basis source texture format ${t}`);return{codec:n,isHDR:!!r.isHDR(),isSRGB:e?!!r.isSRGB():!1,hasAlpha:!!r.getHasAlpha(),blockWidth:r.getBlockWidth(),blockHeight:r.getBlockHeight()}}function wR(r,e){return e==="uint16"?new Uint16Array(r/Uint16Array.BYTES_PER_ELEMENT):e==="uint32"?new Uint32Array(r/Uint32Array.BYTES_PER_ELEMENT):new Uint8Array(r)}function it(r,e,t){return{basisFormat:r,compressed:!0,format:e,textureFormat:t}}function pa(r,e,t,n,s){return{basisFormat:r,compressed:!1,format:e,textureFormat:t,srgbFormat:n,srgbTextureFormat:s}}function $t(r,e,t,n){return{...it(r,e,`astc-${n}-unorm`),srgbFormat:t,srgbTextureFormat:`astc-${n}-unorm-srgb`}}var Wt,BI,tZ,LI,yR,DI=p(()=>{"use strict";Js();TI();II();EI();Wt={"4x4":$t(10,37808,37840,"4x4"),"5x4":$t(28,37809,37841,"5x4"),"5x5":$t(29,37810,37842,"5x5"),"6x5":$t(30,37811,37843,"6x5"),"6x6":$t(31,37812,37844,"6x6"),"8x5":$t(32,37813,37845,"8x5"),"8x6":$t(33,37814,37846,"8x6"),"8x8":$t(36,37815,37847,"8x8"),"10x5":$t(34,37816,37848,"10x5"),"10x6":$t(35,37817,37849,"10x6"),"10x8":$t(37,37818,37850,"10x8"),"10x10":$t(38,37819,37851,"10x10"),"12x10":$t(39,37820,37852,"12x10"),"12x12":$t(40,37821,37853,"12x12")},BI={etc1:it(0,36196,"etc1-rgb-unorm-webgl"),etc2:{...it(1,37493,"etc2-rgba8unorm"),srgbFormat:37495,srgbTextureFormat:"etc2-rgba8unorm-srgb"},bc1:{...it(2,33776,"bc1-rgb-unorm-webgl"),srgbFormat:35916,srgbTextureFormat:"bc1-rgb-unorm-srgb-webgl"},bc3:{...it(3,33779,"bc3-rgba-unorm"),srgbFormat:35919,srgbTextureFormat:"bc3-rgba-unorm-srgb"},bc4:it(4,36283,"bc4-r-unorm"),bc5:it(5,36285,"bc5-rg-unorm"),bc7:{...it(6,36492,"bc7-rgba-unorm"),srgbFormat:36493,srgbTextureFormat:"bc7-rgba-unorm-srgb"},"pvrtc1-4-rgb":it(8,35840,"pvrtc-rgb4unorm-webgl"),"pvrtc1-4-rgba":it(9,35842,"pvrtc-rgba4unorm-webgl"),"astc-4x4":Wt["4x4"],"astc-5x4":Wt["5x4"],"astc-5x5":Wt["5x5"],"astc-6x5":Wt["6x5"],"astc-6x6":Wt["6x6"],"astc-8x5":Wt["8x5"],"astc-8x6":Wt["8x6"],"astc-8x8":Wt["8x8"],"astc-10x5":Wt["10x5"],"astc-10x6":Wt["10x6"],"astc-10x8":Wt["10x8"],"astc-10x10":Wt["10x10"],"astc-12x10":Wt["12x10"],"astc-12x12":Wt["12x12"],"atc-rgb":it(11,35986,"atc-rgb-unorm-webgl"),"atc-rgba-interpolated-alpha":it(12,34798,"atc-rgbai-unorm-webgl"),rgba32:pa(13,32856,"rgba8unorm",35907,"rgba8unorm-srgb"),rgb565:pa(14,36194,"rgb565unorm-webgl"),bgr565:pa(15,36194,"rgb565unorm-webgl"),rgba4444:pa(16,32854,"rgba4unorm-webgl"),"eac-r11":it(20,37488,"eac-r11unorm"),"eac-rg11":it(21,37490,"eac-rg11unorm"),bc6h:it(22,36495,"bc6h-rgb-ufloat"),"astc-hdr-4x4":it(23,37808,"astc-4x4-unorm"),rgba16f:{...pa(25,34842,"rgba16float"),dataType:"uint16"},rgb9e5:{...pa(26,35901,"rgb9e5ufloat"),dataType:"uint32"},"astc-hdr-6x6":it(27,37812,"astc-6x6-unorm")},tZ=Object.freeze(Object.keys(BI)),LI=Promise.resolve();yR={0:"etc1s",1:"uastc-ldr-4x4",2:"uastc-hdr-4x4",3:"astc-hdr-6x6",4:"uastc-hdr-6x6",5:"xuastc-ldr-4x4",6:"xuastc-ldr-5x4",7:"xuastc-ldr-5x5",8:"xuastc-ldr-6x5",9:"xuastc-ldr-6x6",10:"xuastc-ldr-8x5",11:"xuastc-ldr-8x6",12:"xuastc-ldr-10x5",13:"xuastc-ldr-10x6",14:"xuastc-ldr-8x8",15:"xuastc-ldr-10x8",16:"xuastc-ldr-10x10",17:"xuastc-ldr-12x10",18:"xuastc-ldr-12x12",19:"astc-ldr-4x4",20:"astc-ldr-5x4",21:"astc-ldr-5x5",22:"astc-ldr-6x5",23:"astc-ldr-6x6",24:"astc-ldr-8x5",25:"astc-ldr-8x6",26:"astc-ldr-10x5",27:"astc-ldr-10x6",28:"astc-ldr-8x8",29:"astc-ldr-10x8",30:"astc-ldr-10x10",31:"astc-ldr-12x10",32:"astc-ldr-12x12",33:"xubc7"}});var RI={};J(RI,{BasisLoaderWithParser:()=>AR,BasisWorkerLoaderWithParser:()=>_R});var oZ,xR,aZ,TR,_R,AR,kI=p(()=>{"use strict";DI();sd();sd();({preload:oZ,...xR}=io),{preload:aZ,...TR}=io,_R={...xR},AR={...TR,parse:FI}});async function vR(){let{BasisLoaderWithParser:r}=await Promise.resolve().then(()=>(kI(),RI));return r}var io,sd=p(()=>{"use strict";fI();tg();io={...lI,dataType:null,batchType:null,name:"Basis",id:"basis",module:"images",version:Zf,worker:!0,workerNode:"basis-worker-node.cjs",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",containerFormat:"auto"}},preload:vR}});var qn=p(()=>{"use strict";sg();Qf();cI();cg();cg();sd()});function H(r,e){if(!r)throw new Error(e||"assert failed: gltf")}var oo=p(()=>{"use strict"});function FR(r,e=0){return`${String.fromCharCode(r.getUint8(e+0))}${String.fromCharCode(r.getUint8(e+1))}${String.fromCharCode(r.getUint8(e+2))}${String.fromCharCode(r.getUint8(e+3))}`}function PI(r,e=0,t={}){let n=new DataView(r),{magic:s=NI}=t,i=n.getUint32(e,!1);return i===s||i===NI}function ad(r,e,t=0,n={}){let s=new DataView(e),i=FR(s,t+0),o=s.getUint32(t+4,ti),a=o===3?jI(s,t+8,"GLB byte length"):s.getUint32(t+8,ti);switch(Object.assign(r,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:i,version:o,json:{},jsonChunkIndex:-1,binChunks:[]}),r.version){case 1:return OR(r,s,t+id);case 2:return MR(r,s,t+id,n);case 3:return DR(r,s,t+UI,n);default:throw new Error(`Invalid GLB version ${r.version}. Only supports versions 1, 2 and 3.`)}}function OR(r,e,t){fr(r.header.byteLength>id+od);let n=r.header.byteOffset+r.header.byteLength;fr(n<=e.byteLength);let s=e.getUint32(t+0,ti),i=e.getUint32(t+4,ti);if(t+=od,fr(i===ER),t+s>n)throw new Error("GLB JSON content extends beyond the declared file length.");hg(r,e,t,s,0),t+=s;let o=n-t;return o>0&&pg(r,e,t,o,1),n}function MR(r,e,t,n){return fr(r.header.byteLength>id+od),VI(r,e,t,od,n),r.header.byteOffset+r.header.byteLength}function DR(r,e,t,n){return fr(r.header.byteLength>=UI+CI),VI(r,e,t,CI,n),r.header.byteOffset+r.header.byteLength}function VI(r,e,t,n,s){let i=r.header.byteOffset+r.header.byteLength;fr(i<=e.byteLength);let o=0;for(;t+n<=i;){let a=r.version===3,c=e.getUint32(t+(a?0:4),ti),u=a?e.getUint32(t+4,ti):0,l=a?jI(e,t+8,"GLB chunk length"):e.getUint32(t+0,ti);if(t+=n,u!==0)throw new Error(`Unsupported GLB chunk encoding ${u}.`);if(t+l>i)throw new Error("GLB chunk extends beyond the declared file length.");switch(c){case IR:(r.version!==3||r.jsonChunkIndex===-1)&&hg(r,e,t,l,o);break;case SR:pg(r,e,t,l,o);break;case LR:s.strict||hg(r,e,t,l,o);break;case BR:s.strict||pg(r,e,t,l,o);break;default:break}t+=mg(l),o++}return t}function hg(r,e,t,n,s){let i=new Uint8Array(e.buffer,t,n),a=new TextDecoder("utf8").decode(i);return r.json=JSON.parse(a),r.jsonChunkIndex=s,mg(n)}function pg(r,e,t,n,s){return r.header.hasBinChunk=!0,r.binChunks.push({chunkIndex:s,byteOffset:t,byteLength:n,arrayBuffer:e.buffer}),mg(n)}function jI(r,e,t){let n=r.getBigUint64(e,ti);if(n>BigInt(Number.MAX_SAFE_INTEGER))throw new Error(`${t} exceeds JavaScript's safe integer range.`);return Number(n)}function mg(r){return Math.ceil(r/4)*4}var ti,NI,id,UI,od,CI,IR,SR,ER,LR,BR,bg=p(()=>{"use strict";Ue();ti=!0,NI=1735152710,id=12,UI=16,od=8,CI=16,IR=1313821514,SR=5130562,ER=0,LR=0,BR=1});function Kn(r,e,t){if(r.startsWith("data:")||r.startsWith("http:")||r.startsWith("https:"))return cd(r);let s=t?.baseUrl||RR(e?.core?.baseUrl);if(!s)throw new Error(`'baseUrl' must be provided to resolve relative url ${r}`);let i=s.endsWith("/")?`${s}${r}`:`${s}/${r}`;return cd(i)}function cd(r){try{return new URL(r).href}catch{return r}}function RR(r){if(!r)return;if(r.endsWith("/"))return r;let e=r.lastIndexOf("/");return e>=0?r.slice(0,e+1):""}var Yc=p(()=>{"use strict"});var ud,Qc,gg=p(()=>{"use strict";ud={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Qc={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8}});function ma(r){return GI[r-1]||GI[0]}function Xn(r){let e=NR.get(r.constructor);if(!e)throw new Error("Illegal typed array");return e}function Zc(r,e){let t=PR[r.componentType],n=CR[r.type],s=UR[r.componentType],i=r.count*n,o=r.count*n*s;H(o>=0&&o<=e.byteLength);let a=Qc[r.componentType],c=ud[r.type];return{ArrayType:t,length:i,byteLength:o,componentByteSize:a,numberOfComponentsInElement:c}}var GI,kR,NR,CR,UR,PR,ri=p(()=>{"use strict";oo();gg();GI=["SCALAR","VEC2","VEC3","VEC4"],kR=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Int32Array,5124],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130],[BigInt64Array,5134],[BigUint64Array,5135]],NR=new Map(kR),CR={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},UR={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8},PR={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5124:Int32Array,5125:Uint32Array,5126:Float32Array,5130:Float64Array,5131:Uint16Array,5134:BigInt64Array,5135:BigUint64Array}});function hr(r,e,t){let n=typeof t=="number"?r.bufferViews[t]:t;H(n);let s=n.buffer,i=e[s];H(i),H((n.byteOffset||0)>=0&&n.byteLength>=0),H((n.byteOffset||0)+n.byteLength<=i.byteLength),H(i.byteOffset>=0&&i.byteOffset+i.byteLength<=i.arrayBuffer.byteLength);let o=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,n.byteLength)}function zI(r,e,t){let n=r.images[t];return hr(r,e,n.bufferView)}function ld(r,e,t){let n=typeof t=="number"?r.accessors?.[t]:t;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(t)}`);H(Number.isSafeInteger(n.count)&&n.count>=0);let{ArrayType:s,length:i,numberOfComponentsInElement:o}=Zc(n,{byteLength:1/0}),a=n.value,c;ArrayBuffer.isView(a)?(H(a.length===i),c=a):n.bufferView===void 0?c=new s(i):c=yg(r,e,n);let u=n.sparse;if(!u)return c;let l=new s(i);new Uint8Array(l.buffer).set(new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),H(u.count>=0&&u.count<=n.count),H([5121,5123,5125].includes(u.indices.componentType));let f=yg(r,e,{bufferView:u.indices.bufferView,byteOffset:u.indices.byteOffset,componentType:u.indices.componentType,count:u.count,type:"SCALAR"}),d=yg(r,e,{bufferView:u.values.bufferView,byteOffset:u.values.byteOffset,componentType:n.componentType,count:u.count,type:n.type}),h=-1,m=new Uint8Array(l.buffer),b=o*s.BYTES_PER_ELEMENT,g=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);for(let y=0;y<u.count;y++){let x=Number(f[y]);H(x>h&&x<n.count),m.set(g.subarray(y*b,(y+1)*b),x*b),h=x}return l}function yg(r,e,t){let n=r.bufferViews?.[t.bufferView];if(!n)throw new Error(`No gltf buffer view for accessor ${n}`);let s=e[n.buffer];H(s);let{arrayBuffer:i,byteOffset:o}=s;H((n.byteOffset||0)>=0&&n.byteLength>=0),H((n.byteOffset||0)+n.byteLength<=s.byteLength),H(o>=0&&o+s.byteLength<=i.byteLength),H((t.byteOffset||0)>=0);let a=(o||0)+(t.byteOffset||0)+(n.byteOffset||0),{ArrayType:c,length:u,componentByteSize:l,numberOfComponentsInElement:f}=Zc(t,n),d=l*f,h=t.type.startsWith("MAT")?Number(t.type.slice(3)):1,m=_e(h*l,4),b=h>1?h*m:d,g=n.byteStride??b,y=h>1?(h-1)*m+h*l:d;if(H(g>=b),H((t.byteOffset||0)+(t.count===0?0:(t.count-1)*g+y)<=n.byteLength),t.count===0)return new c(0);if(h>1&&m!==h*l){let _=n.byteStride??h*m,v=(h-1)*m+h*l;H((t.byteOffset||0)+(t.count-1)*_+v<=n.byteLength);let I=new c(u),N=new Uint8Array(I.buffer,I.byteOffset,I.byteLength);for(let K=0;K<t.count;K++)for(let ne=0;ne<h;ne++){let be=new Uint8Array(i,a+K*_+ne*m,h*l);N.set(be,K*d+ne*h*l)}return I}let x=n.byteStride||d;if(typeof n.byteStride>"u"||n.byteStride===d){if(a%l!==0){let v=new Uint8Array(i,a,u*l),I=new Uint8Array(v.byteLength);return I.set(v),new c(I.buffer,0,u)}return new c(i,a,u)}let T=new c(u);for(let _=0;_<t.count;_++){let v=a+_*x,I;if(v%l!==0){let N=new Uint8Array(i,v,d),K=new Uint8Array(d);K.set(N),I=new c(K.buffer,0,f)}else I=new c(i,v,f);T.set(I,_*f)}return T}var ao=p(()=>{"use strict";oo();Ue();ri()});function wg(r,e){let t=r.json.files||[],n=[];for(let s=0;s<t.length;s++){let i=t[s];(i.name===e||i.uri===e)&&n.push(s)}return H(n.length<=1,`glTF package file reference ${e} is ambiguous.`),n[0]??-1}async function fd(r,e,t,n){let s=r.json.files||[],i=typeof e=="number"?e:wg(r,e);H(Number.isInteger(i)&&i>=0&&i<s.length),r.files=r.files||new Array(s.length).fill(null);let o=r.files[i];if(o)return o;let a=s[i];H(a.mimeType,`glTF file ${i} must define mimeType.`);let c=a.uri!==void 0,u=a.bufferView!==void 0;H(c!==u,`glTF file ${i} must define exactly one of uri or bufferView.`);let l;if(a.uri!==void 0){let f=Kn(a.uri,t,n),d=await n.fetch(f);H(d?.ok,`Failed to fetch glTF file ${a.uri}: HTTP ${d?.status}.`);let h=await d.arrayBuffer();l={arrayBuffer:h,byteOffset:0,byteLength:h.byteLength,mimeType:a.mimeType,name:a.name,url:f}}else{let f=hr(r.json,r.buffers,a.bufferView);l={arrayBuffer:f.buffer,byteOffset:f.byteOffset,byteLength:f.byteLength,mimeType:a.mimeType,name:a.name}}return r.files[i]=l,l}var WI=p(()=>{"use strict";ao();Yc();oo()});var xg={};J(xg,{name:()=>co,preprocess:()=>VR});function VR(r){let{json:e}=r;if(!(!e.extensionsUsed?.includes(co)&&!e.extensionsRequired?.includes(co))){if(!e.extensionsUsed?.includes(co)||!e.extensionsRequired?.includes(co))throw new Error(`${co}: must be declared in extensionsUsed and extensionsRequired.`);for(let[t,n]of(e.accessors||[]).entries())if(n.componentType===5130&&n.normalized)throw new Error(`${co}: accessor ${t} must not be normalized.`)}}var co,$I=p(()=>{"use strict";co="KHR_accessor_float64"});function jR(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var bn,eu=p(()=>{"use strict";qn();Ue();oo();ri();ao();bn=class{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||jR(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=_e(this.gltf.buffers[0].byteLength,4),this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.getRequiredExtensions().find(s=>s===e);return typeof t=="string"||typeof n=="string"}getExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.json.extensions||{};return t?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if(typeof t=="object")return t;let n=this.json[e]&&this.json[e][t];if(!n)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return n}getTypedArrayForBufferView(e){return hr(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return ld(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForImageData(e){e=this.getAccessor(e);let t=this.getBufferView(e.bufferView),s=this.getBuffer(t.buffer).data,i=t.byteOffset||0;return new Uint8Array(s,i,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,n){return e.extensions=e.extensions||{},e.extensions[t]=n,this.registerUsedExtension(t),this}setObjectExtension(e,t,n){let s=e.extensions||{};s[t]=n}removeObjectExtension(e,t){let n=e?.extensions||{};if(n[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let s=this.json.extensionsRemoved;s.includes(t)||s.push(t)}delete n[t]}addExtension(e,t={}){return H(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return H(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){let{meshIndex:t,matrix:n}=e;this.json.nodes=this.json.nodes||[];let s={mesh:t};return n&&(s.matrix=n),this.json.nodes.push(s),this.json.nodes.length-1}addMesh(e){let{attributes:t,indices:n,material:s,mode:i=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(n){let c=this._addIndices(n);a.primitives[0].indices=c}return Number.isFinite(s)&&(a.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,t){let n=$n(e),s=t||n?.mimeType,o={bufferView:this.addBufferView(e),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e,t=0,n=this.byteLength){let s=e.byteLength;H(Number.isFinite(s)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let i={buffer:t,byteOffset:n,byteLength:s};return this.byteLength+=_e(s,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){let n=t.normalized,s={bufferView:e,...n===void 0?{}:{normalized:n},type:ma(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(s),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){let n=this.addBufferView(e),s={min:t.min,max:t.max};(!s.min||!s.max)&&(s=this._getAccessorMinMax(e,t.size));let i={size:t.size,componentType:Xn(e),count:Math.round(e.length/t.size),min:s.min,max:s.max};return this.addAccessor(n,Object.assign(i,t))}addTexture(e){let{imageIndex:t,samplerIndex:n}=e,s={source:t,...n===void 0?{}:{sampler:n}};return this.json.textures=this.json.textures||[],this.json.textures.push(s),this.json.textures.length-1}addSampler(e){return this.json.samplers=this.json.samplers||[],this.json.samplers.push({...e}),this.json.samplers.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){if(this.byteLength===0&&!this.json.buffers?.length){delete this.json.buffers,delete this.gltf.binary,this.sourceBuffers=[],this.gltf.buffers=[];return}let e=[0],t=this.byteLength;for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&(e[o]=_e(t,8),t=e[o]+_e(a.byteLength,4))}let n=new ArrayBuffer(t),s=new Uint8Array(n),i=0;for(let o of this.sourceBuffers||[])i=to(o,s,i);for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&to(a,s,e[o])}for(let o of this.json.bufferViews||[]){let a=e[o.buffer];H(a!==void 0),o.byteOffset=a+(o.byteOffset||0),o.buffer=0;for(let c of["EXT_meshopt_compression","KHR_meshopt_compression"]){let u=o.extensions?.[c];if(u){let l=e[u.buffer];H(l!==void 0),u.byteOffset=l+(u.byteOffset||0),u.buffer=0}}}this.byteLength=t,this.json.buffers=[{byteLength:t}],this.gltf.binary=n,this.sourceBuffers=[n],this.gltf.buffers=[{arrayBuffer:n,byteOffset:0,byteLength:n.byteLength}]}_removeStringFromArray(e,t){let n=!0;for(;n;){let s=e.indexOf(t);s>-1?e.splice(s,1):n=!1}}_addAttributes(e={}){let t={};for(let n in e){let s=e[n],i=this._getGltfAttributeName(n),o=s.value,a=o.BYTES_PER_ELEMENT*s.size,c=_e(a,4),u;if(c===a)u=this.addBinaryBuffer(o,s);else{let l=o.length/s.size,f=new Uint8Array(l*c),d=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);for(let m=0;m<l;m++)f.set(d.subarray(m*a,(m+1)*a),m*c);let h=this.addBufferView(f);this.json.bufferViews[h].byteStride=c,u=this.addAccessor(h,{...this._getAccessorMinMax(o,s.size),...s,componentType:Xn(o),count:l})}t[i]=u}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){let n={min:null,max:null};if(e.length<t)return n;n.min=[],n.max=[];let s=e.subarray(0,t);for(let i of s)n.min.push(i),n.max.push(i);for(let i=t;i<e.length;i+=t)for(let o=0;o<t;o++)n.min[0+o]=Math.min(n.min[0+o],e[i+o]),n.max[0+o]=Math.max(n.max[0+o],e[i+o]);return n}}});function GR(r){switch(r.type){case"accessor":return{get bufferView(){return r.bufferView?.data}};case"animation":return{get channels(){return uo(r.channels)},get samplers(){return uo(r.samplers)}};case"animationChannel":return{get sampler(){return r.sampler.data},get target(){return r.target.data}};case"animationChannelTarget":return{get node(){return r.node?.data}};case"animationSampler":return{get input(){return r.input.data},get output(){return r.output.data}};case"bufferView":return{get buffer(){return r.buffer.data}};case"externalAsset":return{get file(){return r.file.data}};case"file":case"image":return{get bufferView(){return r.bufferView?.data}};case"material":return{get baseColorTexture(){return r.baseColorTexture?.data},get metallicRoughnessTexture(){return r.metallicRoughnessTexture?.data},get normalTexture(){return r.normalTexture?.data},get occlusionTexture(){return r.occlusionTexture?.data},get emissiveTexture(){return r.emissiveTexture?.data},get textures(){return uo(r.textures)}};case"textureInfo":return{get texture(){return r.texture.data}};case"mesh":return{get primitives(){return uo(r.primitives)}};case"primitive":return{get attributes(){return qI(r.attributes)},get indices(){return r.indices?.data},get material(){return r.material?.data},get targets(){return r.targets.map(qI)}};case"node":return{get camera(){return r.camera?.data},get children(){return uo(r.children)},get skin(){return r.skin?.data},get mesh(){return r.mesh?.data},get externalAsset(){return r.externalAsset?.data}};case"scene":return{get nodes(){return uo(r.nodes)}};case"skin":return{get inverseBindMatrices(){return r.inverseBindMatrices?.data},get skeleton(){return r.skeleton?.data},get joints(){return uo(r.joints)}};case"texture":return{get sampler(){return r.sampler?.data},get source(){return r.source?.data}};default:return{}}}function lo(r,e){return(function*(){for(let n=0;n<r.length;n++)yield e(r[n],n)})()}function uo(r){return(function*(){for(let t of r)yield t.data})()}function qI(r){return new Map(Array.from(r,([e,t])=>[e,t.data]))}function zR(r){switch(r){case"bufferView":return"bufferViews";case"externalAsset":return"externalAssets";case"mesh":return"meshes";default:return`${r}s`}}function KI(r,e){if(r)for(let t=r.length-1;t>=0;t--)r[t]===e&&r.splice(t,1)}var Je,ni,Tg,_g,Ag,vg,dd,Ig,Sg,Eg,Lg,Bg,Fg,Og,Mg,Dg,Rg,kg,Ng,Cg,Ug,Pg,ie,He=p(()=>{"use strict";ao();ri();Je=class{gltf;type;index;data;path;iterator;constructor(e,t,n,s,i){this.iterator=e,this.gltf=e.gltf,this.type=t,this.index=n,this.data=s,this.path=i}},ni=class extends Je{parent;constructor(e,t,n,s,i,o){super(e,t,n,s,i),this.parent=o}},Tg=class extends Je{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}},_g=class extends Je{get channels(){return lo(this.data.channels,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Ag(this.iterator,"animationChannel",t,e,`${this.path}.channels[${t}]`,this)))}get samplers(){return lo(this.data.samplers,(e,t)=>this.iterator.getOrCreateNested(e,()=>new dd(this.iterator,"animationSampler",t,e,`${this.path}.samplers[${t}]`,this)))}},Ag=class extends ni{get sampler(){let t=this.parent.data.samplers[this.data.sampler];if(!t)throw new Error(`Invalid glTF reference at ${this.path}.sampler: animation sampler index ${this.data.sampler} is out of range`);return this.iterator.getOrCreateNested(t,()=>new dd(this.iterator,"animationSampler",this.data.sampler,t,`${this.parent.path}.samplers[${this.data.sampler}]`,this.parent))}get target(){return this.iterator.getOrCreateNested(this.data.target,()=>new vg(this.iterator,"animationChannelTarget",0,this.data.target,`${this.path}.target`,this))}},vg=class extends ni{get node(){return this.data.node===void 0?void 0:this.iterator.resolveNode(this.data.node,`${this.path}.node`)}},dd=class extends ni{get input(){return this.iterator.resolveAccessor(this.data.input,`${this.path}.input`)}get output(){return this.iterator.resolveAccessor(this.data.output,`${this.path}.output`)}},Ig=class extends Je{get loadedBuffer(){return this.gltf.buffers[this.index]}},Sg=class extends Je{get buffer(){return this.iterator.resolveBuffer(this.data.buffer,`${this.path}.buffer`)}get loadedBufferView(){let e=this.buffer.loadedBuffer;if(!e)return;let t=e.byteOffset+(this.data.byteOffset||0);return new Uint8Array(e.arrayBuffer,t,this.data.byteLength)}},Eg=class extends Je{},Lg=class extends Je{get file(){return this.iterator.resolveFile(this.data.file,`${this.path}.file`)}get loadedAsset(){return this.gltf.externalAssets?.[this.index]}},Bg=class extends Je{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedFile(){return this.gltf.files?.[this.index]}},Fg=class extends Je{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedImage(){return this.gltf.images?.[this.index]}},Og=class extends Je{get baseColorTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.baseColorTexture,0,"pbrMetallicRoughness.baseColorTexture")}get metallicRoughnessTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.metallicRoughnessTexture,1,"pbrMetallicRoughness.metallicRoughnessTexture")}get normalTexture(){return this.getTextureInfo(this.data.normalTexture,2,"normalTexture")}get occlusionTexture(){return this.getTextureInfo(this.data.occlusionTexture,3,"occlusionTexture")}get emissiveTexture(){return this.getTextureInfo(this.data.emissiveTexture,4,"emissiveTexture")}get textures(){return[this.baseColorTexture,this.metallicRoughnessTexture,this.normalTexture,this.occlusionTexture,this.emissiveTexture].filter(t=>!!t).values()}getTextureInfo(e,t,n){return e?this.iterator.getOrCreateNested(e,()=>new Mg(this.iterator,"textureInfo",t,e,`${this.path}.${n}`,this)):void 0}},Mg=class extends ni{get texture(){return this.iterator.resolveTexture(this.data.index,`${this.path}.index`)}},Dg=class extends Je{get primitives(){return lo(this.data.primitives,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Rg(this.iterator,"primitive",t,e,`${this.path}.primitives[${t}]`,this)))}},Rg=class extends ni{get attributes(){return new Map(Object.entries(this.data.attributes).map(([e,t])=>[e,this.iterator.resolveAccessor(t,`${this.path}.attributes.${e}`)]))}get indices(){return this.data.indices===void 0?void 0:this.iterator.resolveAccessor(this.data.indices,`${this.path}.indices`)}get material(){return this.data.material===void 0?void 0:this.iterator.resolveMaterial(this.data.material,`${this.path}.material`)}get targets(){return(this.data.targets||[]).map((e,t)=>new Map(Object.entries(e).map(([n,s])=>[n,this.iterator.resolveAccessor(s,`${this.path}.targets[${t}].${n}`)])))}},kg=class extends Je{get camera(){return this.data.camera===void 0?void 0:this.iterator.resolveCamera(this.data.camera,`${this.path}.camera`)}get children(){return lo(this.data.children||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.children[${t}]`))}get skin(){return this.data.skin===void 0?void 0:this.iterator.resolveSkin(this.data.skin,`${this.path}.skin`)}get mesh(){return this.data.mesh===void 0?void 0:this.iterator.resolveMesh(this.data.mesh,`${this.path}.mesh`)}get externalAsset(){return this.data.externalAsset===void 0?void 0:this.iterator.resolveExternalAsset(this.data.externalAsset,`${this.path}.externalAsset`)}},Ng=class extends Je{},Cg=class extends Je{get nodes(){return lo(this.data.nodes||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.nodes[${t}]`))}},Ug=class extends Je{get inverseBindMatrices(){return this.data.inverseBindMatrices===void 0?void 0:this.iterator.resolveAccessor(this.data.inverseBindMatrices,`${this.path}.inverseBindMatrices`)}get skeleton(){return this.data.skeleton===void 0?void 0:this.iterator.resolveNode(this.data.skeleton,`${this.path}.skeleton`)}get joints(){return lo(this.data.joints,(e,t)=>this.iterator.resolveNode(e,`${this.path}.joints[${t}]`))}},Pg=class extends Je{get sampler(){return this.data.sampler===void 0?void 0:this.iterator.resolveSampler(this.data.sampler,`${this.path}.sampler`)}get source(){return this.data.source===void 0?void 0:this.iterator.resolveImage(this.data.source,`${this.path}.source`)}},ie=class{gltf;objectCache=new WeakMap;referencesCache=new WeakMap;constructor(e){this.gltf=e}get data(){return this.gltf.json}getTypedArrayForBufferView(e){return hr(this.data,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return ld(this.data,this.gltf.buffers,e)}getTypedArrayForImageData(e){return zI(this.data,this.gltf.buffers,e)}getLoadedBuffer(e){let t=this.getMetadata(e);return this.gltf.buffers[t.index]}getLoadedBufferView(e){let t=this.getReferences(e).buffer,n=this.getLoadedBuffer(t);if(!n)return;let s=n.byteOffset+(e.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,e.byteLength)}getLoadedImage(e){return this.gltf.images?.[this.getMetadata(e).index]}getLoadedFile(e){return this.gltf.files?.[this.getMetadata(e).index]}getLoadedExternalAsset(e){return this.gltf.externalAssets?.[this.getMetadata(e).index]}addBuffer(e){let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return this.gltf.buffers.push({arrayBuffer:t,byteOffset:0,byteLength:e.byteLength}),this.data.buffers||=[],this.data.buffers.push({byteLength:e.byteLength}),this.data.buffers.length-1}addBufferView(e,t,n=0){return this.data.bufferViews||=[],this.data.bufferViews.push({buffer:e,byteOffset:n,byteLength:t}),this.data.bufferViews.length-1}addAccessor(e,t){return this.data.accessors||=[],this.data.accessors.push({bufferView:e,type:ma(t.size),componentType:t.componentType,count:t.count,min:t.min,max:t.max}),this.data.accessors.length-1}getReferences(e){let t=this.referencesCache.get(e);if(t)return t;let n=this.getObjectIterator(e),s=GR(n);return this.referencesCache.set(e,s),s}getMetadata(e){let t=this.getObjectIterator(e),n=t instanceof ni?t.parent.data:void 0;return{gltf:this.gltf,type:t.type,index:t.index,parent:n,path:t.path}}get scene(){return this.data.scene===void 0?void 0:this.resolveScene(this.data.scene,"scene").data}get thumbnail(){return this.data.asset.thumbnail===void 0?void 0:this.resolveImage(this.data.asset.thumbnail,"asset.thumbnail").data}get accessors(){return this.iterateCollectionData("accessor")}get animations(){return this.iterateCollectionData("animation")}get buffers(){return this.iterateCollectionData("buffer")}get bufferViews(){return this.iterateCollectionData("bufferView")}get cameras(){return this.iterateCollectionData("camera")}get externalAssets(){return this.iterateCollectionData("externalAsset")}get files(){return this.iterateCollectionData("file")}get images(){return this.iterateCollectionData("image")}get materials(){return this.iterateCollectionData("material")}get meshes(){return this.iterateCollectionData("mesh")}get nodes(){return this.iterateCollectionData("node")}get samplers(){return this.iterateCollectionData("sampler")}get scenes(){return this.iterateCollectionData("scene")}get skins(){return this.iterateCollectionData("skin")}get textures(){return this.iterateCollectionData("texture")}hasExtension(e){return!!this.data.extensionsUsed?.includes(e)||!!this.data.extensionsRequired?.includes(e)}isExtensionRequired(e){return!!this.data.extensionsRequired?.includes(e)}getExtension(e,t){let n=typeof e=="string"?this.data:e,s=typeof e=="string"?e:t;return n.extensions?.[s]}setExtension(e,t,n){let s=typeof e=="string",i=s?this.data:e,o=s?e:t,a=s?t:n,c=s?!!n:!1;i.extensions||={},i.extensions[o]=a,this.registerUsedExtension(o),c&&this.registerRequiredExtension(o)}registerUsedExtension(e){this.data.extensionsUsed||=[],this.data.extensionsUsed.includes(e)||this.data.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.data.extensionsRequired||=[],this.data.extensionsRequired.includes(e)||this.data.extensionsRequired.push(e)}removeExtension(e,t){let n=typeof e=="string",s=n?this.data:e,i=n?e:t;s.extensions?.[i]!==void 0&&(this.recordRemovedExtension(i),delete s.extensions[i]),n&&(KI(this.data.extensionsUsed,i),KI(this.data.extensionsRequired,i))}recordRemovedExtension(e){let t=this.data;t.extensionsRemoved||=[],t.extensionsRemoved.includes(e)||t.extensionsRemoved.push(e)}resolveAccessor(e,t){return this.resolveCollectionObject("accessor",e,t)}resolveBuffer(e,t){return this.resolveCollectionObject("buffer",e,t)}resolveBufferView(e,t){return this.resolveCollectionObject("bufferView",e,t)}resolveCamera(e,t){return this.resolveCollectionObject("camera",e,t)}resolveExternalAsset(e,t){return this.resolveCollectionObject("externalAsset",e,t)}resolveFile(e,t){return this.resolveCollectionObject("file",e,t)}resolveImage(e,t){return this.resolveCollectionObject("image",e,t)}resolveMaterial(e,t){return this.resolveCollectionObject("material",e,t)}resolveMesh(e,t){return this.resolveCollectionObject("mesh",e,t)}resolveNode(e,t){return this.resolveCollectionObject("node",e,t)}resolveSampler(e,t){return this.resolveCollectionObject("sampler",e,t)}resolveScene(e,t){return this.resolveCollectionObject("scene",e,t)}resolveSkin(e,t){return this.resolveCollectionObject("skin",e,t)}resolveTexture(e,t){return this.resolveCollectionObject("texture",e,t)}getOrCreateNested(e,t){return this.getOrCreate(e,t)}iterateCollection(e){let t=this.getCollection(e);return lo(t,(n,s)=>this.resolveCollectionObject(e,s,e))}iterateCollectionData(e){return(function*(n){for(let s of n.iterateCollection(e))yield s.data})(this)}getObjectIterator(e){let t=this.objectCache.get(e);if(!t)throw new Error("glTF object is not registered with this iterator");return t}resolveCollectionObject(e,t,n){let i=this.getCollection(e)[t];if(!i)throw new Error(`Invalid glTF reference at ${n}: ${e} index ${t} is out of range`);return this.getOrCreate(i,()=>this.createCollectionObject(e,t,i))}getCollection(e){switch(e){case"accessor":return this.data.accessors||[];case"animation":return this.data.animations||[];case"buffer":return this.data.buffers||[];case"bufferView":return this.data.bufferViews||[];case"camera":return this.data.cameras||[];case"externalAsset":return this.data.externalAssets||[];case"file":return this.data.files||[];case"image":return this.data.images||[];case"material":return this.data.materials||[];case"mesh":return this.data.meshes||[];case"node":return this.data.nodes||[];case"sampler":return this.data.samplers||[];case"scene":return this.data.scenes||[];case"skin":return this.data.skins||[];case"texture":return this.data.textures||[]}}createCollectionObject(e,t,n){let s=`${zR(e)}[${t}]`;switch(e){case"accessor":return new Tg(this,e,t,n,s);case"animation":return new _g(this,e,t,n,s);case"buffer":return new Ig(this,e,t,n,s);case"bufferView":return new Sg(this,e,t,n,s);case"camera":return new Eg(this,e,t,n,s);case"externalAsset":return new Lg(this,e,t,n,s);case"file":return new Bg(this,e,t,n,s);case"image":return new Fg(this,e,t,n,s);case"material":return new Og(this,e,t,n,s);case"mesh":return new Dg(this,e,t,n,s);case"node":return new kg(this,e,t,n,s);case"sampler":return new Ng(this,e,t,n,s);case"scene":return new Cg(this,e,t,n,s);case"skin":return new Ug(this,e,t,n,s);case"texture":return new Pg(this,e,t,n,s)}}getOrCreate(e,t){let n=this.objectCache.get(e);if(n)return n;let s=t();return this.objectCache.set(e,s),s}}});function XI(r){return(r%1+1)%1}function tu(r,e){return JI[e]*HI[r]}function ba(r,e,t,n){if(t!=="UINT8"&&t!=="UINT16"&&t!=="UINT32"&&t!=="UINT64")return null;let s=r.getTypedArrayForBufferView(e),i=ga(s,"SCALAR",t,n+1);if(i instanceof BigInt64Array||i instanceof BigUint64Array){let o=new Float64Array(i.length),a=BigInt(Number.MAX_SAFE_INTEGER);for(let c=0;c<i.length;c++){let u=i[c];if(u<0n||u>a)throw new Error("EXT_structural_metadata: UINT64 offset exceeds the safe integer range");o[c]=Number(u)}return o}return i}function ga(r,e,t,n=1){let s=HI[e],i=WR[t],o=JI[t],a=n*s,c=a*o,u=r.buffer,l=r.byteOffset;return l%o!==0&&(u=new Uint8Array(u).slice(l,l+c).buffer,l=0),new i(ro(u),l,a)}function ya(r,e,t){let n=`TEXCOORD_${e.texCoord||0}`,s=t.attributes[n],i=r.getTypedArrayForAccessor(s),o=r.gltf.json,a=e.index,c=o.textures?.[a]?.source;if(typeof c<"u"){let u=o.images?.[c]?.mimeType,l=r.gltf.images?.[c];if(l&&typeof l.width<"u"&&!("compressed"in l&&l.compressed)){let f=[];for(let d=0;d<i.length;d+=2){let h=$R(l,u,i,d,e.channels);f.push(h)}return f}}return[]}function hd(r,e,t,n,s){if(!t?.length)return;let i=[];for(let f of t){let d=n.findIndex(h=>h===f);d===-1&&(d=n.push(f)-1),i.push(d)}let o=new Uint32Array(i),a=r instanceof ie?r:new ie(r.gltf),c=a.addBuffer(o),u=a.addBufferView(c,o.byteLength),l=a.addAccessor(u,{size:1,componentType:Xn(o),count:o.length});s.attributes[e]=l}function $R(r,e,t,n,s=[0]){let i={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=t[n],a=t[n+1],c=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(c=4);let u=qR(o,a,r,c),l=0;for(let f of s){let d=typeof f=="number"?Object.values(i)[f]:i[f],h=u+d.offset,m=Jc(r);if(m.data.length<=h)throw new Error(`${m.data.length} <= ${h}`);let b=m.data[h];l|=b<<d.shift}return l}function qR(r,e,t,n=1){let s=t.width,i=XI(r)*(s-1),o=Math.round(i),a=t.height,c=XI(e)*(a-1),u=Math.round(c),l=t.components?t.components:n;return(u*s+o)*l}function ru(r,e,t,n=1){let s=[];for(let i=0;i<e;i++){let o=Number(t[i]),a=Number(t[i+1])-o;if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<0||(o+a)*n>r.length)break;let c=o*n,u=a*n;s.push(r.slice(c,c+u))}return s}function nu(r,e,t,n=1){let s=[],i=t*n;for(let o=0;o<e;o++){let a=o*i;s.push(r.slice(a,a+i))}return s}function pd(r,e,t,n,s){let i=new TextDecoder("utf8");if(t){if(!n)throw new Error("stringOffsets is required for variable-length string arrays");let o=[];for(let a=0;a<r;a++){let c=t[a],u=t[a+1],l=[];for(let f=c;f<u;f++){let d=n[f],h=n[f+1],m=e.subarray(d,h);l.push(i.decode(m))}o.push(l)}return o}if(n){let o=[],a=r*(s||1);for(let c=0;c<a;c++){let u=Number(n[c]),l=Number(n[c+1]);u>=0&&l>=u&&l<=e.length&&o.push(i.decode(e.subarray(u,l)))}return s?Array.from({length:r},(c,u)=>o.slice(u*s,(u+1)*s)):o}return[]}var HI,WR,JI,md=p(()=>{"use strict";He();ri();qn();Ue();HI={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},WR={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},JI={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8}});var Vg={};J(Vg,{createExtMeshFeatures:()=>ZR,decode:()=>XR,encode:()=>HR,name:()=>KR});async function XR(r,e){let t=new ie(r);JR(t,e)}function HR(r,e){let t=new bn(r);return QR(t,e),t.createBinaryChunk(),t.gltf}function JR(r,e){for(let t of r.meshes)for(let n of r.getReferences(t).primitives)YR(r,n,e)}function YR(r,e,t){let s=r.getExtension(e,wa)?.featureIds||[];if(s)for(let i of s){let o;if(typeof i.attribute<"u"){if(!t?.gltf?.loadBuffers)continue;let a=`_FEATURE_ID_${i.attribute}`,c=e.attributes[a];o=r.getTypedArrayForAccessor(c)}else if(typeof i.texture<"u"){if(!t?.gltf?.loadImages)continue;o=ya(r,i.texture,e)}else{let a=e.attributes.POSITION,c=typeof a=="number"?r.data.accessors?.[a]?.count:a?.count;if(typeof c!="number"||!Number.isInteger(c)||c<0)throw new Error("EXT_mesh_features: implicit feature IDs require a POSITION accessor");if(i.featureCount!==c)throw new Error(`EXT_mesh_features: implicit featureCount ${i.featureCount} does not match vertex count ${c}`);delete i.data,Object.defineProperty(i,"implicit",{configurable:!0,enumerable:!1,writable:!0,value:{start:0,count:c}})}o&&(i.data=o,delete i.implicit)}}function QR(r,e){let t=r.gltf.json.meshes;if(t)for(let n of t)for(let s of n.primitives)ek(r,s)}function ZR(r,e,t,n){e.extensions||(e.extensions={});let s=e.extensions[wa];s||(s={featureIds:[]},e.extensions[wa]=s);let{featureIds:i}=s,o={featureCount:t.length,propertyTable:n,data:t};i.push(o),r.addObjectExtension(e,wa,s)}function ek(r,e){let t=e.extensions?.[wa];if(!t)return;let n=t.featureIds;n.forEach((s,i)=>{if(s.data){let{accessorKey:o,index:a}=tk(e.attributes),c=new Uint32Array(s.data);n[i]={featureCount:c.length,propertyTable:s.propertyTable,attribute:a};let u=r.addBufferView(c),l=r.addAccessor(u,{size:1,componentType:Xn(c),count:c.length});e.attributes[o]=l}})}function tk(r){let e="_FEATURE_ID_",t=Object.keys(r).filter(i=>i.indexOf(e)===0),n=-1;for(let i of t){let o=Number(i.substring(e.length));o>n&&(n=o)}return n++,{accessorKey:`${e}${n}`,index:n}}var wa,KR,YI=p(()=>{"use strict";eu();He();md();ri();wa="EXT_mesh_features",KR=wa});var Wg={};J(Wg,{createExtStructuralMetadata:()=>Sk,decode:()=>nk,encode:()=>sk,name:()=>rk});async function nk(r,e,t){let n=new ie(r),s=n.getExtension(fo);if(e.gltf?.loadBuffers&&s?.schemaUri&&!s.schema){if(!t?.fetch)throw new Error("EXT_structural_metadata: a loader context is required to load schemaUri");let i=Kn(s.schemaUri,e,t),o=await t.fetch(i);if(!o.ok)throw new Error(`EXT_structural_metadata: failed to load schemaUri ${i} (${o.status})`);s.schema=await o.json()}ik(n,e)}function sk(r,e){let t=new bn(r);return vk(t,e),t.createBinaryChunk(),t.gltf}function ik(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(fo);t&&(e.gltf?.loadImages&&ok(r,t),ak(r,t))}function ok(r,e){let t=e.propertyTextures,n=r.data;if(t&&n.meshes)for(let s of n.meshes)for(let i of s.primitives)ck(r,t,i,e)}function ak(r,e){let t=e.schema;if(!t)return;let n=t.classes,s=e.propertyTables;if(n&&s)for(let i of s)i.class&&n[i.class]&&lk(r,t,i)}function ck(r,e,t,n){if(!e)return;let i=t.extensions?.[fo]?.propertyTextures;if(i)for(let o of i){let a=e[o];uk(r,a,t,n)}}function uk(r,e,t,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let s=e.class;for(let i in e.properties){let o=`${s}_${i}`,a=e.properties?.[i];if(!a)continue;a.data||(a.data=[]);let c=a.data,u=ya(r,a,t);u!==null&&(hd(r,o,u,c,t),a.data=c,n.dataAttributeNames.push(o))}}function lk(r,e,t){let n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);let s=t.count;for(let i in n.properties){let o=n.properties[i],a=t.properties?.[i];if(a){let c={},u=fk(r,e,o,s,a,c);a.data=u,c.value!==void 0&&Object.defineProperty(a,"rawData",{value:c.value,configurable:!0,enumerable:!1,writable:!0})}}}function fk(r,e,t,n,s,i){let o=[],a=s.values,c=r.getTypedArrayForBufferView(a),u=hk(r,t,s,n),l=pk(r,t,s,n,u);switch(t.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{let f=mk(t,s,n,c,u);o=f.data,i&&(i.value=f.rawData);break}case"BOOLEAN":{o=dk(t,n,c,u);break}case"STRING":{o=pd(n,c,u,l,t.array?t.count:void 0);break}case"ENUM":{o=wk(e,t,n,c,u);break}default:throw new Error(`Unknown classProperty type ${t.type}`)}return o}function dk(r,e,t,n){return r.array?n?Array.from({length:e},(s,i)=>{let o=Number(n[i]),a=Number(n[i+1]);if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<o)throw new Error("EXT_structural_metadata: invalid BOOLEAN array offsets");return jg(t,o,a-o)}):r.count===void 0?[]:Array.from({length:e},(s,i)=>jg(t,i*r.count,r.count)):jg(t,0,e)}function jg(r,e,t){if(e+t>r.byteLength*8)throw new Error("EXT_structural_metadata: BOOLEAN values exceed their buffer view");return Array.from({length:t},(n,s)=>{let i=e+s;return!!(r[Math.floor(i/8)]&1<<i%8)})}function hk(r,e,t,n){return e.array&&typeof e.count>"u"&&typeof t.arrayOffsets<"u"?ba(r,t.arrayOffsets,t.arrayOffsetType||"UINT32",n):null}function pk(r,e,t,n,s){if(typeof t.stringOffsets<"u"){let i=s?Number(s[n]):n*(e.array&&e.count||1);return ba(r,t.stringOffsets,t.stringOffsetType||"UINT32",i)}return null}function mk(r,e,t,n,s){let i=r.array,o=r.count,a={VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}[r.type]||1,c=tu(r.type,r.componentType),u=n.byteLength/c,l;r.componentType?l=ga(n,r.type,r.componentType,u):l=n;let f=l,d=e.offset??r.offset,h=e.scale??r.scale,m=r.normalized||d!==void 0||h!==void 0?bk(f,r.componentType,r.type,r.normalized,d,h):f;return i?s?{data:ru(m,t,s,a),rawData:ru(f,t,s,a)}:o?{data:nu(m,t,o,a),rawData:nu(f,t,o,a)}:{data:[],rawData:[]}:{data:m,rawData:f}}function bk(r,e,t,n,s,i){let o=yk(e),a=!!(n&&o!==void 0);if(!a&&s===void 0&&i===void 0)return r;let c=gk(t),u=new Float64Array(r.length);for(let l=0;l<r.length;l++){let f=Number(r[l]);a&&(f=e?.startsWith("INT")?Math.max(f/o,-1):f/o);let d=l%c,h=Array.isArray(s)?s[d]??0:s??0,m=Array.isArray(i)?i[d]??1:i??1;u[l]=f*m+h}return u}function gk(r){switch(r){case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4;case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:return 1}}function yk(r){switch(r){case"INT8":return 127;case"UINT8":return 255;case"INT16":return 32767;case"UINT16":return 65535;case"INT32":return 2147483647;case"UINT32":return 4294967295;case"INT64":return 2**63-1;case"UINT64":return 2**64-1;default:return}}function wk(r,e,t,n,s){let i=e.enumType;if(!i)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=r.enums?.[i];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${i}`);let a=o.valueType||"UINT16",c=tu(e.type,a),u=n.byteLength/c,l=ga(n,e.type,a,u);if(l||(l=n),e.array){if(s)return xk({valuesData:l,numberOfElements:t,arrayOffsets:s,enumEntry:o});let f=e.count;return f?Tk(l,t,f,o):[]}return zg(l,0,t,o)}function xk(r){let{valuesData:e,numberOfElements:t,arrayOffsets:n,enumEntry:s}=r,i=[];for(let o=0;o<t;o++){let a=Number(n[o]),c=Number(n[o+1])-a;if(!Number.isInteger(a)||!Number.isInteger(c)||a<0||c<0||a+c>e.length)break;let u=zg(e,a,c,s);i.push(u)}return i}function Tk(r,e,t,n){let s=[];for(let i=0;i<e;i++){let o=t*i,a=zg(r,o,t,n);s.push(a)}return s}function zg(r,e,t,n){let s=[];for(let i=0;i<t;i++){let o=r[e+i],a=_k(n,o);a?s.push(a.name):s.push("")}return s}function _k(r,e){for(let t of r.values)if(typeof e=="bigint"?Number.isSafeInteger(t.value)&&BigInt(t.value)===e:t.value===e)return t;return null}function vk(r,e){let t=r.getExtension(fo);if(t&&t.propertyTables)for(let n of t.propertyTables){let s=n.class,i=t.schema?.classes?.[s];n.properties&&i&&Ik(n,i,r)}}function Ik(r,e,t){for(let n in r.properties){let s=r.properties[n].data;if(s){let i=e.properties[n];if(i){let o=Bk(s,i,t);r.properties[n]=o}}}}function Sk(r,e,t=Ak){let n=r.getExtension(fo);n||(n=r.addExtension(fo)),n.schema=Ek(e,t,n.schema);let s=Lk(e,t,n.schema);return n.propertyTables||(n.propertyTables=[]),n.propertyTables.push(s)-1}function Ek(r,e,t){let n=t??{id:"schema_id"},s={properties:{}};for(let i of r){let o={type:i.elementType,componentType:i.componentType};s.properties[i.name]=o}return n.classes={},n.classes[e]=s,n}function Lk(r,e,t){let n={class:e,count:0},s=0,i=t.classes?.[e];for(let o of r){if(s===0&&(s=o.values.length),s!==o.values.length&&o.values.length)throw new Error("Illegal values in attributes");i?.properties[o.name]&&(n.properties||(n.properties={}),n.properties[o.name]={values:0,data:o.values})}return n.count=s,n}function Bk(r,e,t){let n={values:0};if(e.type==="STRING"){let{stringData:s,stringOffsets:i}=Mk(r);n.stringOffsets=Gg(i,t),n.values=Gg(s,t)}else if(e.type==="SCALAR"&&e.componentType){let s=Ok(r,e.componentType);n.values=Gg(s,t)}return n}function Ok(r,e){let t=[];for(let s of r)t.push(Number(s));let n=Fk[e];if(!n)throw new Error("Illegal component type");return new n(t)}function Mk(r){let e=new TextEncoder,t=[],n=0;for(let c of r){let u=e.encode(c);n+=u.length,t.push(u)}let s=new Uint8Array(n),i=[],o=0;for(let c of t)s.set(c,o),i.push(o),o+=c.length;i.push(o);let a=new Uint32Array(i);return{stringData:s,stringOffsets:a}}function Gg(r,e){return e.addBufferView(r)}var fo,rk,Ak,Fk,QI=p(()=>{"use strict";eu();He();md();Yc();fo="EXT_structural_metadata",rk=fo;Ak="schemaClassId";Fk={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array}});var qg={};J(qg,{SPZ_COMPRESSION_EXTENSION_NAME:()=>su,decode:()=>Rk,getGaussianSplatPrimitives:()=>ZI,name:()=>$g});async function Rk(r,e,t){let n=t?.loaders?.find(o=>o.extensions?.includes("spz")),s=ZI(r),i=new ie(r);for(let[o,a]of(r.json.meshes||[]).entries())for(let[c,u]of a.primitives.entries()){let l=u.extensions?.[$g];if(!l)continue;let f=s.find(b=>b.meshIndex===o&&b.primitiveIndex===c),d=e?.gltf?.legacyGaussianSplatColorSpace,h=d&&l.extensions?.[su]?{...l,kernel:l.kernel??"ellipse",colorSpace:l.colorSpace??d}:l;f&&(f.extension=h),Nk(r.json,u,h,o,c,i);let m=l.extensions?.[su];if(m&&f){let b=e?.gltf?.splatDecoder,g=r.json.bufferViews?.[m.bufferView];if(g&&r.buffers[g.buffer])f.compressedBytes=kk(r,m.bufferView);else if(b||n)throw new Error(`KHR_gaussian_splatting: bufferView ${m.bufferView} is not loaded for SPZ2 decoding.`);n&&t&&f.compressedBytes?f.decoded=await Xs(f.compressedBytes.buffer,n,{...e,splats:{...e.splats,sourceCoordinateSystem:"LUF"}},t):b&&f.compressedBytes&&(f.decoded=await b(f.compressedBytes.buffer,{sourceCoordinateSystem:"LUF"}))}}s.length&&(r.gaussianSplatPrimitives=s)}function kk(r,e){let t=r.json.bufferViews?.[e];if(!t)throw new Error(`KHR_gaussian_splatting: bufferView ${e} is not defined.`);let n=r.buffers[t.buffer];if(!n)throw new Error(`KHR_gaussian_splatting: buffer ${t.buffer} is not loaded for SPZ2 payload.`);let s=n.byteOffset+(t.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,t.byteLength).slice()}function ZI(r){let e="json"in r?r.json:r,t=[];for(let[n,s]of(e.meshes||[]).entries())for(let[i,o]of s.primitives.entries()){let a=o.extensions?.[$g];if(!a)continue;let c=a.extensions?.[su]?.bufferView;t.push({meshIndex:n,primitiveIndex:i,attributes:{...o.attributes},extension:a,compressedBufferView:c})}return t}function Nk(r,e,t,n,s,i){if((e.mode??4)!==0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} must use POINTS mode.`);if(typeof t.kernel!="string"||t.kernel.length===0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing kernel.`);if(typeof t.colorSpace!="string"||t.colorSpace.length===0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing colorSpace.`);let o=t.extensions?.[su]?.bufferView;if(o!==void 0){if(!Number.isInteger(o)||o<0||o>=(r.bufferViews||[]).length)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has an invalid SPZ bufferView.`)}else for(let a of Dk)if(e.attributes[a]===void 0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing ${a}.`);for(let[a,c]of Object.entries(e.attributes))if(!Number.isInteger(c)||c<0||c>=(r.accessors||[]).length)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has invalid accessor ${a}.`);Ck(r,e,i,n,s);for(let a=1;a<=3;a++){let c=a*2+1,u=Array.from({length:c},(l,f)=>e.attributes[`KHR_gaussian_splatting:SH_DEGREE_${a}_COEF_${f}`]!==void 0);if(u.some(Boolean)&&!u.every(Boolean))throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has incomplete SH degree ${a}.`);if(u.some(Boolean)&&a>1){let l=a-1,f=l*2+1;for(let d=0;d<f;d++)if(e.attributes[`KHR_gaussian_splatting:SH_DEGREE_${l}_COEF_${d}`]===void 0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} skips SH degree ${l}.`)}}}function Ck(r,e,t,n,s){let i=e.attributes["KHR_gaussian_splatting:SCALE"],o=e.attributes["KHR_gaussian_splatting:OPACITY"];for(let[a,c,u]of[["KHR_gaussian_splatting:SCALE",i,l=>l>=0],["KHR_gaussian_splatting:OPACITY",o,l=>l>=0&&l<=1]]){if(c===void 0||!Uk(r,t,c))continue;let l=t.getTypedArrayForAccessor(c);for(let f=0;f<l.length;f++)if(!u(Number(l[f])))throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has an invalid ${a} value.`)}}function Uk(r,e,t){let n=r.accessors?.[t],s=n?.bufferView===void 0?void 0:r.bufferViews?.[n.bufferView];return!!(s&&e.gltf.buffers[s.buffer])}var $g,su,Dk,eS=p(()=>{"use strict";Ue();He();$g="KHR_gaussian_splatting",su="KHR_gaussian_splatting_compression_spz_2",Dk=["POSITION","KHR_gaussian_splatting:ROTATION","KHR_gaussian_splatting:SCALE","KHR_gaussian_splatting:OPACITY","KHR_gaussian_splatting:SH_DEGREE_0_COEF_0"]});var Xg={};J(Xg,{decode:()=>Pk,getVoxelPrimitives:()=>Vk,name:()=>Kg});async function Pk(r){for(let[e,t]of(r.json.meshes||[]).entries())for(let[n,s]of t.primitives.entries()){let i=s.extensions?.[Kg];i&&jk(r.json,s,i,e,n)}}function Vk(r){let e="json"in r?r.json:r,t=[];for(let[n,s]of(e.meshes||[]).entries())for(let[i,o]of s.primitives.entries()){let a=o.extensions?.[Kg];a&&t.push({meshIndex:n,primitiveIndex:i,attributes:{...o.attributes},extension:a})}return t}function jk(r,e,t,n,s){if(!Number.isInteger(t.shape)||t.shape<0)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} has invalid shape.`);if(!Array.isArray(t.dimensions)||t.dimensions.length!==3||t.dimensions.some(i=>!Number.isInteger(i)||i<=0))throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} must provide three positive dimensions.`);if(e.mode!==void 0&&e.mode!==2147483647)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} must use voxel mode.`);for(let i of Object.keys(e.attributes)){let o=e.attributes[i];if(!Number.isInteger(o)||o<0||o>=(r.accessors||[]).length)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} has invalid accessor ${i}.`)}}var Kg,tS=p(()=>{"use strict";Kg="EXT_primitive_voxels"});var Hg={};J(Hg,{decode:()=>zk,getPrimitiveRestartRanges:()=>bd,name:()=>si});async function zk(r,e){if(!r.json.extensionsUsed?.includes(si))return;if(!r.json.extensionsRequired?.includes(si))throw new Error(`${si} must be declared in extensionsRequired`);if(!e.gltf?.loadBuffers)return;let t=new ie(r);for(let n of t.meshes)for(let s of t.getReferences(n).primitives)Wk(t,s)}function Wk(r,e){if(e.indices===void 0)return;let t=e.indices,n=typeof t=="number"?r.data.accessors?.[t]:t;if(!n)throw new Error(`${si}: primitive references missing indices accessor ${e.indices}`);let s=$k(n),i=r.getTypedArrayForAccessor(e.indices),o=Array.prototype.includes.call(i,s);if(!Gk.has(e.mode??4)){if(o)throw new Error(`${si}: primitive restart is not valid for mode ${e.mode??4}`);return}Object.defineProperty(e,"primitiveRestart",{configurable:!0,enumerable:!1,writable:!0,value:{restartIndex:s,ranges:bd(i,s)}})}function $k(r){if(r.type!=="SCALAR")throw new Error(`${si}: indices accessor must have SCALAR type`);switch(r.componentType){case 5121:return 255;case 5123:return 65535;case 5125:return 4294967295;default:throw new Error(`${si}: indices accessor must use an unsigned integer component type`)}}function bd(r,e){let t=[],n=0;for(let s=0;s<=r.length;s++)(s===r.length||r[s]===e)&&(s>n&&t.push({offset:n,count:s-n}),n=s+1);return t}var si,Gk,Jg=p(()=>{"use strict";He();si="KHR_mesh_primitive_restart",Gk=new Set([2,3,5,6])});var Yg={};J(Yg,{decode:()=>qk,name:()=>qt});async function qk(r,e){if(!e.gltf?.loadBuffers)return;let t=new ie(r);for(let n of t.meshes)for(let s of t.getReferences(n).primitives){let i=t.getExtension(s,qt);i&&Object.defineProperty(i,"data",{configurable:!0,enumerable:!1,writable:!0,value:Kk(t,s,i)})}}function Kk(r,e,t){if(!Number.isInteger(t.count)||t.count<1)throw new Error(`${qt}: count must be a positive integer`);if((e.mode??4)!==4||e.indices===void 0)throw new Error(`${qt}: primitive must use TRIANGLES mode with indices`);let n=gd(r,e.indices,"indices"),s=gd(r,t.indicesOffsets,"indicesOffsets",t.count),i=gd(r,t.loopIndices,"loopIndices"),o=gd(r,t.loopIndicesOffsets,"loopIndicesOffsets",t.count),a=r.data.accessors?.[t.loopIndices],c=Xk(a.componentType);rS(s,n.length,"indicesOffsets"),rS(o,i.length,"loopIndicesOffsets");let u=[];for(let l=0;l<t.count;l++){let f=Number(s[l]),d=l+1<t.count?Number(s[l+1]):n.length,h=Number(o[l]),m=l+1<t.count?Number(o[l+1]):i.length,b=Array.from(i).slice(h,m),g=bd(b,c).map(y=>({offset:y.offset+h,count:y.count}));if((d-f)%3!==0)throw new Error(`${qt}: polygon ${l} triangle range must contain complete triangles`);if(g.length===0)throw new Error(`${qt}: polygon ${l} must contain at least one loop`);if(g.some(y=>y.count<3))throw new Error(`${qt}: polygon ${l} loops must contain at least three indices`);u.push({triangleRange:{offset:f,count:d-f},loopRanges:g})}return{indicesOffsets:s,loopIndices:i,loopIndicesOffsets:o,polygons:u}}function gd(r,e,t,n){if(typeof e=="number"&&(!Number.isInteger(e)||e<0))throw new Error(`${qt}: ${t} must reference an accessor`);let s=typeof e=="number"?r.data.accessors?.[e]:e;if(!s)throw new Error(`${qt}: ${t} references missing accessor ${e}`);if(s.type!=="SCALAR"||![5121,5123,5125].includes(s.componentType))throw new Error(`${qt}: ${t} must be an unsigned integer SCALAR accessor`);if(n!==void 0&&s.count!==n)throw new Error(`${qt}: ${t} count must equal polygon count ${n}`);return r.getTypedArrayForAccessor(e)}function rS(r,e,t){if(Number(r[0])!==0)throw new Error(`${qt}: ${t} must begin at zero`);let n=-1;for(let s=0;s<r.length;s++){let i=Number(r[s]);if(!Number.isInteger(i)||i<0||i>=e||i<=n)throw new Error(`${qt}: ${t} must contain increasing in-bounds offsets`);n=i}}function Xk(r){switch(r){case 5121:return 255;case 5123:return 65535;case 5125:return 4294967295;default:throw new Error(`${qt}: unsupported loop index component type ${r}`)}}var qt,nS=p(()=>{"use strict";He();Jg();qt="EXT_mesh_polygon"});var Qg={};J(Qg,{decode:()=>Hk,getSpatialAudio:()=>sS,name:()=>xa});function sS(r){let e="asset"in r?r:r.json,t=[],n=e.extensions?.[xa];n&&t.push({nodeIndex:null,extension:n});for(let[s,i]of(e.nodes||[]).entries()){let o=i.extensions?.[xa];o&&t.push({nodeIndex:s,extension:o})}return t}async function Hk(r){let e=sS(r);for(let{extension:t,nodeIndex:n}of e){let s=n===null?"root":`node ${n}`;for(let i of t.sources||[]){if(!Array.isArray(i.accessors)||i.accessors.length===0)throw new Error(`${xa}: ${s} source ${i.id} requires audio accessors.`);for(let o of i.accessors)if(!Number.isInteger(o)||o<0||!r.json.accessors?.[o])throw new Error(`${xa}: ${s} source ${i.id} has invalid accessor ${o}.`);if(i.reverbFeedGain&&i.reverbFeedGain.length!==(i.reverbFeed?.length||0))throw new Error(`${xa}: ${s} source ${i.id} has mismatched reverb feed gains.`)}}e.length&&(r.spatialAudio=e)}var xa,iS=p(()=>{"use strict";xa="MPEG_audio_spatial"});var Zg={};J(Zg,{decode:()=>Jk,name:()=>Kt});async function Jk(r,e,t){let n=r.json.extensions?.[Kt],s=(n?.audio||[]).map(c=>({audio:c})),i=n?.sources||[],o=n?.emitters||[];for(let c of i)c.audio!==void 0&&yd(s,c.audio,"audio");for(let c of o){if(c.type!=="global"&&c.type!=="positional")throw new Error(`${Kt}: invalid emitter type ${c.type}.`);if(c.type==="global"&&c.positional!==void 0)throw new Error(`${Kt}: global emitters cannot have positional settings.`);for(let u of c.sources||[])yd(i,u,"source")}let a=[];for(let c of["nodes","scenes"])for(let[u,l]of(r.json[c]||[]).entries()){let f=l.extensions?.[Kt];if(f){if(!Array.isArray(f.emitters)||!f.emitters.length)throw new Error(`${Kt}: ${c} ${u} requires emitters.`);for(let d of f.emitters){let h=yd(o,d,"emitter");if(c==="scenes"&&h.type!=="global")throw new Error(`${Kt}: scenes may only reference global emitters.`);a.push({emitterIndex:d,nodeIndex:c==="nodes"?u:null,sceneIndex:c==="scenes"?u:null,emitter:h,sources:(h.sources||[]).map(m=>{let b=i[m];return{sourceIndex:m,source:b,clip:b.audio===void 0?void 0:s[b.audio]}})})}}}if(n){for(let c of s)Yk(r,c);e.gltf?.loadAudio!==!1&&await Promise.all(s.map(c=>Qk(r,c,e,t))),r.audioClips=s,r.audioEmitters=a}}function yd(r,e,t){if(!Number.isInteger(e)||e<0||!r[e])throw new Error(`${Kt}: invalid ${t} index ${e}.`);return r[e]}function Yk(r,e){let{audio:t}=e;if(t.bufferView!==void 0){if(yd(r.json.bufferViews||[],t.bufferView,"bufferView"),!t.mimeType)throw new Error(`${Kt}: buffer-view audio requires mimeType.`)}else if(!t.uri)throw new Error(`${Kt}: audio requires a uri or bufferView.`)}async function Qk(r,e,t,n){let{audio:s}=e;if(s.bufferView!==void 0){let a=r.json.bufferViews[s.bufferView],c=r.buffers[a.buffer];if(!c){if(t.gltf?.loadBuffers===!1)return;throw new Error(`${Kt}: audio buffer ${a.buffer} is not loaded.`)}let u=a.byteOffset??0,l=a.byteLength;if(!Number.isSafeInteger(u)||u<0||!Number.isSafeInteger(l)||l<0||u+l>c.byteLength||c.byteOffset+u+l>c.arrayBuffer.byteLength)throw new Error(`${Kt}: audio bufferView exceeds its buffer.`);e.data=new Uint8Array(c.arrayBuffer,c.byteOffset+u,l);return}if(!n?.fetch)throw new Error(`${Kt}: a loader context is required to load audio.`);let i=Kn(s.uri,t,n),o=await n.fetch(i);if(!o.ok)throw new Error(`${Kt}: failed to load audio ${i} (${o.status}).`);e.url=i,e.data=new Uint8Array(await o.arrayBuffer())}var Kt,oS=p(()=>{"use strict";Yc();Kt="KHR_audio_emitter"});var aS={};J(aS,{MeshoptDecoder:()=>Zk});var Zk,cS=p(()=>{"use strict";Zk=(function(){var r="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq;X8:kdbk:kYi5ud9:du8Jjjjjbcjq9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCaAcethXaxaDfhiaOaeaoaeao6E9RhQalcl4cifcd4hLazcjdfaAfhKcbhYabaOad2fg8AhEaHh3incbh5dnawTmbaxaYcd4fRbbh5kcbh8Eazcjdfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcjdfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcjdfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaL6mva8FaLfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:bsesu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhDaicefgiarfhqdndnaeci9pmbaqhexekcmcsawceSEhkcbhxcbhmaqhecbhlcbhoindndnaiRbbgrc;Ve0mbavc;abfaoarcu7gPcl4fcsGcitfgwydlhsawydbhzdndnarcsGgwak9pmbavalaPfcsGcdtfydbaxawEhraxawTgHfhxxekdnaeaD9nmbc9:hoxokdndnawcsSmbcehHamawcetfcWfhrxekaecefhrae8SbbgwcFeGhPdndnawcu9mmbarhexekaecvfheaPcFbGhPcrhwdninar8SbbgHcFbGawtaPVhPaHcu9kmearcefhrawcrfgwc8J9hmbxdkkarcefhekcehHaPce4cbaPceG9R7amfhrkarhmkavc;abfaocitfgwarBdbawasBdlavalcdtfarBdbavc;abfaocefcsGcitfgwazBdbawarBdlaocdfhoaHalfhldnadcd9hmbabar87elabas87edabaz87ebabcofhbxdkabarBdwabasBdlabazBdbabcxfhbxekdnarcpe0mbavalaDarcsGfRbbgwcl4gP9RcsGcdtfydbaxcefgsaPEhravalaw9RcsGcdtfydbasaPTgzfgsawcsGgPEhwaPThPdndnadcd9hmbabaw87elabar87edabax87ebcohHxekabawBdwabarBdlabaxBdbcxhHkavalcdtfaxBdbavc;abfaocitfgOarBdbaOaxBdlavalcefglcsGcdtfarBdbavc;abfaocefcsGcitfgOawBdbaOarBdlavalazfglcsGcdtfawBdbavc;abfaocdfcsGcitfgraxBdbarawBdlaocifhoabaHfhbalaPfhlasaPfhxxekdnaeaD9nmbc9:hoxlkaxcbaeRbbgwEgHarc;:eSgrfhsawcsGhOdndnawcl4gAmbascefhzxekashzavalaA9RcsGcdtfydbhskdndnaOmbazcefhxxekazhxavalaw9RcsGcdtfydbhzkdndnarTmbaecefhrxekaecdfhrae8SbegPcFeGhwdnaPcu9kmbaecofhHawcFbGhwcrhedninar8SbbgPcFbGaetawVhwaPcu9kmearcefhraecrfgec8J9hmbkaHhrxekarcefhrkawce4cbawceG9R7amfgmhHkdndnaAcsSmbarhwxekarcefhwar8SbbgecFeGhPdnaecu9kmbarcvfhsaPcFbGhPcrhedninaw8SbbgrcFbGaetaPVhParcu9kmeawcefhwaecrfgec8J9hmbkashwxekawcefhwkaPce4cbaPceG9R7amfgmhskdndnaOcsSmbawhexekawcefheaw8SbbgrcFeGhPdnarcu9kmbawcvfhzaPcFbGhPcrhrdninae8SbbgwcFbGartaPVhPawcu9kmeaecefhearcrfgrc8J9hmbkazhexekaecefhekaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabaz87elabas87edabaH87ebcohrxekabazBdwabasBdlabaHBdbcxhrkavc;abfaocitfgwasBdbawaHBdlavalcdtfaHBdbavc;abfaocefcsGcitfgwazBdbawasBdlavalcefglcsGcdtfasBdbavc;abfaocdfcsGcitfgwaHBdbawazBdlavalaATaAcsSVfglcsGcdtfazBdbalaOTaOcsSVfhlaocifhoabarfhbkaocsGhoalcsGhlaicefgiaq6mbkkcbc99aeaDSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:I9Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaocwffa8JRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbagaocdffa8JRb:q:W:cjbfhokalcdfhlaiczfgiaC6mbkkaohQaoTmoka8FaCfh8Fa8Ecefg8Ecl9hmbkdndndndnawTmbazaEcd4fRbbglciGPlbedwbkaCTmdaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep9Taapxeeeeeeeeeeeeeeeeghp9op9Hp9rgaa8Kp9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ughp9Abbbaladfglahaaaapmlvorlvorlvorlvorp9Ughp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp9Ughp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkpPesu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhDaicefgiarfhqdndnaeci9pmbaqhexekcmcsawceSEhkcbhxcbhmaqhecbhlcbhoindndnaiRbbgrc;Ve0mbavc;abfaoarcu7gPcl4fcsGcitfgwydlhsawydbhzdndnarcsGgwak9pmbavalaPfcsGcdtfydbaxawEhraxawTgHfhxxekdnaeaD9nmbc9:hoxokdndnawcsSmbcehHamawcetfcWfhrxekaecefhrae8SbbgwcFeGhPdndnawcu9mmbarhexekaecvfheaPcFbGhPcrhwdninar8SbbgHcFbGawtaPVhPaHcu9kmearcefhrawcrfgwc8J9hmbxdkkarcefhekcehHaPce4cbaPceG9R7amfhrkarhmkavc;abfaocitfgwarBdbawasBdlavalcdtfarBdbavc;abfaocefcsGcitfgwazBdbawarBdlaocdfhoaHalfhldnadcd9hmbabar87elabas87edabaz87ebabcofhbxdkabarBdwabasBdlabazBdbabcxfhbxekdnarcpe0mbavalaDarcsGfRbbgwcl4gP9RcsGcdtfydbaxcefgsaPEhravalaw9RcsGcdtfydbasaPTgzfgsawcsGgPEhwaPThPdndnadcd9hmbabaw87elabar87edabax87ebcohHxekabawBdwabarBdlabaxBdbcxhHkavalcdtfaxBdbavc;abfaocitfgOarBdbaOaxBdlavalcefglcsGcdtfarBdbavc;abfaocefcsGcitfgOawBdbaOarBdlavalazfglcsGcdtfawBdbavc;abfaocdfcsGcitfgraxBdbarawBdlaocifhoabaHfhbalaPfhlasaPfhxxekdnaeaD9nmbc9:hoxlkaxcbaeRbbgwEgHarc;:eSgrfhsawcsGhOdndnawcl4gAmbascefhzxekashzavalaA9RcsGcdtfydbhskdndnaOmbazcefhxxekazhxavalaw9RcsGcdtfydbhzkdndnarTmbaecefhrxekaecdfhrae8SbegPcFeGhwdnaPcu9kmbaecofhHawcFbGhwcrhedninar8SbbgPcFbGaetawVhwaPcu9kmearcefhraecrfgec8J9hmbkaHhrxekarcefhrkawce4cbawceG9R7amfgmhHkdndnaAcsSmbarhwxekarcefhwar8SbbgecFeGhPdnaecu9kmbarcvfhsaPcFbGhPcrhedninaw8SbbgrcFbGaetaPVhParcu9kmeawcefhwaecrfgec8J9hmbkashwxekawcefhwkaPce4cbaPceG9R7amfgmhskdndnaOcsSmbawhexekawcefheaw8SbbgrcFeGhPdnarcu9kmbawcvfhzaPcFbGhPcrhrdninae8SbbgwcFbGartaPVhPawcu9kmeaecefhearcrfgrc8J9hmbkazhexekaecefhekaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabaz87elabas87edabaH87ebcohrxekabazBdwabasBdlabaHBdbcxhrkavc;abfaocitfgwasBdbawaHBdlavalcdtfaHBdbavc;abfaocefcsGcitfgwazBdbawasBdlavalcefglcsGcdtfasBdbavc;abfaocdfcsGcitfgwaHBdbawazBdlavalaATaAcsSVfglcsGcdtfazBdbalaOTaOcsSVfhlaocifhoabarfhbkaocsGhoalcsGhlaicefgiaq6mbkkcbc99aeaDSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var s=WebAssembly.validate(t)?a(e):a(r),i,o=WebAssembly.instantiate(s,{}).then(function(y){i=y.instance,i.exports.__wasm_call_ctors()});function a(y){for(var x=new Uint8Array(y.length),T=0;T<y.length;++T){var _=y.charCodeAt(T);x[T]=_>96?_-97:_>64?_-39:_+4}for(var v=0,T=0;T<y.length;++T)x[v++]=x[T]<60?n[x[T]]:(x[T]-60)*64+x[++T];return x.buffer.slice(0,v)}function c(y,x,T,_,v,I,N){var K=y.exports.sbrk,ne=_+3&-4,be=K(ne*v),Re=K(I.length),ke=new Uint8Array(y.exports.memory.buffer);ke.set(I,Re);var ue=x(be,_,v,Re,I.length);if(ue==0&&N&&N(be,ne,v),T.set(ke.subarray(be,be+_*v)),K(be-K(0)),ue!=0)throw new Error("Malformed buffer data: "+ue)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},l={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},f=[],d=0;function h(y){var x={object:new Worker(y),pending:0,requests:{}};return x.object.onmessage=function(T){var _=T.data;x.pending-=_.count,x.requests[_.id][_.action](_.value),delete x.requests[_.id]},x}function m(y){for(var x="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(s)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+g.name+";"+c.toString()+g.toString(),T=new Blob([x],{type:"text/javascript"}),_=URL.createObjectURL(T),v=f.length;v<y;++v)f[v]=h(_);for(var v=y;v<f.length;++v)f[v].object.postMessage({});f.length=y,URL.revokeObjectURL(_)}function b(y,x,T,_,v){for(var I=f[0],N=1;N<f.length;++N)f[N].pending<I.pending&&(I=f[N]);return new Promise(function(K,ne){var be=new Uint8Array(T),Re=++d;I.pending+=y,I.requests[Re]={resolve:K,reject:ne},I.object.postMessage({id:Re,count:y,size:x,source:be,mode:_,filter:v},[be.buffer])})}function g(y){var x=y.data;self.ready.then(function(T){if(!x.id)return self.close();try{var _=new Uint8Array(x.count*x.size);c(T,T.exports[x.mode],_,x.count,x.size,x.source,T.exports[x.filter]),self.postMessage({id:x.id,count:x.count,action:"resolve",value:_},[_.buffer])}catch(v){self.postMessage({id:x.id,count:x.count,action:"reject",value:v})}})}return{ready:o,supported:!0,useWorkers:function(y){m(y)},decodeVertexBuffer:function(y,x,T,_,v){c(i,i.exports.meshopt_decodeVertexBuffer,y,x,T,_,i.exports[u[v]])},decodeIndexBuffer:function(y,x,T,_){c(i,i.exports.meshopt_decodeIndexBuffer,y,x,T,_)},decodeIndexSequence:function(y,x,T,_){c(i,i.exports.meshopt_decodeIndexSequence,y,x,T,_)},decodeGltfBuffer:function(y,x,T,_,v,I){c(i,i.exports[l[v]],y,x,T,_,i.exports[u[I]])},decodeGltfBufferAsync:function(y,x,T,_,v){return f.length>0?b(y,x,T,l[_],u[v]):o.then(function(){var I=new Uint8Array(y*x);return c(i,i.exports[l[_]],I,y,x,T,i.exports[u[v]]),I})}}})()});function uS(){return Promise.resolve().then(()=>(cS(),aS))}var lS=p(()=>{"use strict"});async function eN(){return wd||(wd=uS().then(async({MeshoptDecoder:r})=>(await r.ready,r),r=>{throw wd=void 0,new Error("Failed to load the packaged meshopt decoder.",{cause:r})})),wd}function tN(r){return typeof r=="string"?r:["NONE","OCTAHEDRAL","QUATERNION","EXPONENTIAL","COLOR"][r]}async function fS(r,e,t,n,s,i="NONE"){(await eN()).decodeGltfBuffer(r,e,t,n,s,tN(i))}var wd,dS=p(()=>{"use strict";lS()});async function xd(r,e,t){if(!e.gltf?.decompressMeshes&&e.gltf?.decompressBufferViewIndices===void 0||!e.gltf?.loadBuffers)return;rN(r.json);let n=new ie(r),s=e.gltf.decompressBufferViewIndices,i=s?new Set(typeof s=="function"?s(r.json):s):void 0,o=Array.from(n.bufferViews),a=o.map((c,u)=>i?.has(u)===!1?Promise.resolve():nN(n,c,t));if(await Promise.all(a),i){for(let c of i){let u=o[c];u&&n.removeExtension(u,t)}return}for(let c of o)n.removeExtension(c,t);for(let c of n.buffers)n.removeExtension(c,t);n.removeExtension(t)}function rN(r){let e=r.bufferViews||[];for(let n=0;n<e.length;n++){let s=e[n].extensions;if(s?.KHR_meshopt_compression&&s.EXT_meshopt_compression)throw new Error(`glTF bufferView ${n} cannot use both KHR_meshopt_compression and EXT_meshopt_compression.`)}let t=r.buffers||[];for(let n=0;n<t.length;n++){let s=t[n].extensions;if(s?.KHR_meshopt_compression&&s.EXT_meshopt_compression)throw new Error(`glTF buffer ${n} cannot use both KHR_meshopt_compression and EXT_meshopt_compression.`)}}async function nN(r,e,t){let n=r.getExtension(e,t);if(!n)return;let{byteOffset:s=0,byteLength:i,byteStride:o,count:a,mode:c,filter:u="NONE",buffer:l}=n,f=r.gltf.buffers[l],d=r.gltf.buffers[e.buffer],h=new Uint8Array(f.arrayBuffer,f.byteOffset+s,i),m=new Uint8Array(d.arrayBuffer,d.byteOffset+(e.byteOffset||0),e.byteLength);await fS(m,a,o,h,c,u)}var ey=p(()=>{"use strict";He();dS()});var ty={};J(ty,{decode:()=>sN,name:()=>hS});async function sN(r,e){await xd(r,e,hS)}var hS,pS=p(()=>{"use strict";ey();hS="EXT_meshopt_compression"});var ry={};J(ry,{decode:()=>iN,name:()=>mS});async function iN(r,e){await xd(r,e,mS)}var mS,bS=p(()=>{"use strict";ey();mS="KHR_meshopt_compression"});var ny={};J(ny,{name:()=>oN,preprocess:()=>aN});function aN(r,e){let t=new ie(r);if(t.hasExtension(ho)){if(!ag("image/webp")){if(t.isExtensionRequired(ho))throw new Error(`gltf: Required extension ${ho} not supported by browser`);return}for(let n of t.textures){let s=t.getExtension(n,ho);s&&(n.source=s.source),t.removeExtension(n,ho)}t.removeExtension(ho)}}var ho,oN,gS=p(()=>{"use strict";qn();He();ho="EXT_texture_webp",oN=ho});var sy={};J(sy,{name:()=>cN,preprocess:()=>uN});async function uN(r,e){let t=new ie(r);if(!t.hasExtension(po))return;if(!(await og()).has("image/avif")){if(t.isExtensionRequired(po))throw new Error(`gltf: Required extension ${po} not supported by browser`);return}for(let s of t.textures){let i=t.getExtension(s,po);i&&(s.source=i.source),t.removeExtension(s,po)}t.removeExtension(po)}var po,cN,yS=p(()=>{"use strict";qn();He();po="EXT_texture_avif",cN=po});var iy={};J(iy,{decode:()=>fN,getDDSLoader:()=>iu,name:()=>mo,preprocess:()=>lN});function iu(r){return r?.loaders?.find(e=>e.extensions?.includes("dds")||e.mimeTypes?.includes("image/vnd-ms.dds"))}function lN(r,e,t){let n=new ie(r);if(n.hasExtension(mo)){if(!iu(t)){if(n.isExtensionRequired(mo))throw new Error("gltf: Required extension MSFT_texture_dds needs a DDS parser");return}for(let s of n.textures){let i=n.getExtension(s,mo);i&&(s.source=i.source)}}}async function fN(r,e,t){if(!iu(t)||e.gltf?.loadImages===!1)return;let n=new ie(r);if(n.hasExtension(mo)){for(let s of n.textures)n.removeExtension(s,mo);n.removeExtension(mo)}}var mo,oy=p(()=>{"use strict";He();mo="MSFT_texture_dds"});var ay={};J(ay,{name:()=>dN,preprocess:()=>hN});function hN(r,e){let t=new ie(r);for(let n of t.textures){let s=t.getExtension(n,Td);s&&(n.source=s.source,t.removeExtension(n,Td))}t.removeExtension(Td)}var Td,dN,wS=p(()=>{"use strict";He();Td="KHR_texture_basisu",dN=Td});var ou,cy=p(()=>{"use strict";ou="5.0.0-beta.7"});var au,uy=p(()=>{"use strict";au={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]}});var xS,TS=p(()=>{"use strict";xS={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"}});async function bo(r,e=null,t={},n=null,s=null){if(Xe&&t.useLocalLibraries&&!t.CDN&&n&&t.modules?.[n]===void 0){let i=Yi?"./libs":`modules/${e}/dist/libs`;t={...t,modules:{[n]:`${i}/${n}`,...s?{[s]:`${i}/${s}`}:{},...t.modules}}}return await ia(r,e,t,n,s)}var _S=p(()=>{"use strict";Js()});var pN,mN,cu,AS,Ae,go,vS=p(()=>{"use strict";pN="1.5.7",mN="8786740086a9f4d83f44aa83badfbea4dce7a1b5",cu=`https://www.gstatic.com/draco/versioned/decoders/${pN}`,AS=`https://cdn.jsdelivr.net/gh/google/draco@${mN}/javascript`,Ae={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",GLTF_DECODER:"draco_wasm_wrapper_gltf.js",GLTF_DECODER_WASM:"draco_decoder_gltf.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js",ENCODER_WASM:"draco_encoder.wasm"},go={[Ae.DECODER]:`${cu}/${Ae.DECODER}`,[Ae.DECODER_WASM]:`${cu}/${Ae.DECODER_WASM}`,[Ae.GLTF_DECODER]:`${cu}/${Ae.GLTF_DECODER}`,[Ae.GLTF_DECODER_WASM]:`${cu}/${Ae.GLTF_DECODER_WASM}`,[Ae.FALLBACK_DECODER]:`${cu}/${Ae.FALLBACK_DECODER}`,[Ae.ENCODER]:`${AS}/${Ae.ENCODER}`,[Ae.ENCODER_WASM]:`${AS}/${Ae.ENCODER_WASM}`}});async function _d(r={},e,t="full"){let n=DS(r);return n?await dy(n):await bN(r,e==="js"?"javascript":e,t)}async function bN(r={},e,t="full"){let n=RS(`${e}:${t}`,r),s=IS.get(n);return s||(s=gN(r,e,t),IS.set(n,s)),await s}async function dy(r){let e=xN(r),t=ES.get(e);return t||(t=Ji(()=>e.createDecoderModule({}),n=>({draco:n})),ES.set(e,t)),await t}async function hy(r={}){let e=DS(r);if(e){let s=TN(e),i=LS.get(s);return i||(i=Ji(()=>s.createEncoderModule({}),o=>({draco:o})),LS.set(s,i)),await i}let t=RS("encoder",r),n=SS.get(t);return n||(n=wN(r),SS.set(t,n)),await n}async function gN(r,e,t){try{return await FS(r,e,t)}catch(n){if(e==="javascript")throw n;try{return await FS(r,"javascript","full")}catch(s){throw new AggregateError([n,s],"Draco decoder could not load either the WebAssembly or JavaScript backend")}}}async function FS(r,e,t){let n=BS.then(()=>yN(r,e,t));return BS=n.then(()=>{},()=>{}),await n}async function yN(r,e,t){if(e==="javascript"){let o;try{o=await bo(go[Ae.FALLBACK_DECODER],"scene",r,Ae.FALLBACK_DECODER,"draco_decoder.mjs")}catch(c){if(Xe||r.useLocalLibraries)throw c;o=await bo(go[Ae.FALLBACK_DECODER],"scene",{...r,useLocalLibraries:!0},Ae.FALLBACK_DECODER,"draco_decoder.mjs")}let a=fy(o,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await ly(a)}let n,s;try{[n,s]=await OS(r,t)}catch(o){if(Xe||r.useLocalLibraries)throw o;[n,s]=await OS({...r,useLocalLibraries:!0},t)}let i=fy(n,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await ly(i,s)}async function OS(r,e){let t=e==="gltf"?Ae.GLTF_DECODER:Ae.DECODER,n=e==="gltf"?Ae.GLTF_DECODER_WASM:Ae.DECODER_WASM;return await Promise.all([bo(go[t],"scene",r,t,e==="gltf"?"draco_wasm_wrapper_gltf.mjs":"draco_wasm_wrapper.mjs"),bo(go[n],"scene",r,n)])}async function wN(r){let e,t;try{[e,t]=await MS(r)}catch(s){if(Xe||r.useLocalLibraries)throw s;[e,t]=await MS({...r,useLocalLibraries:!0})}let n=fy(e,"DracoEncoderModule")||globalThis.DracoEncoderModule;return await ly(n,t)}async function MS(r){return await Promise.all([bo(go[Ae.ENCODER],"scene",r,Ae.ENCODER,"draco_encoder.mjs"),bo(go[Ae.ENCODER_WASM],"scene",r,Ae.ENCODER_WASM)])}function ly(r,e){if(typeof r!="function")throw new Error("Draco module initializer could not be loaded");return Ji(t=>r({...e?{wasmBinary:e}:{},onModuleLoaded:t}),t=>({draco:t}))}function fy(r,e){if(typeof r=="function")return r;if(r&&typeof r=="object"){let t=r,n=t[e]||t.default;return typeof n=="function"?n:void 0}}function DS(r){let e=r.modules?.draco3d;if(e){if(typeof e!="object"&&typeof e!="function")throw new Error("Invalid draco3d module");return e}}function xN(r){let e=r;if(typeof e?.createDecoderModule!="function")throw new Error("Invalid draco3d decoder module");return e}function TN(r){let e=r;if(typeof e?.createEncoderModule!="function")throw new Error("Invalid draco3d encoder module");return e}function RS(r,e){let t=Object.entries(e.modules||{}).filter(([n])=>n!=="draco3d").map(([n,s])=>`${n}:${String(s)}`).sort().join("|");return[r,e.useLocalLibraries?"local":"remote",e.CDN||"",t].join("|")}var IS,SS,ES,LS,BS,uu=p(()=>{"use strict";Ue();_S();vS();IS=new Map,SS=new Map,ES=new WeakMap,LS=new WeakMap;BS=Promise.resolve()});function NS(r,e,t){let n=CS(e.metadata),s=[],i=_N(e.attributes);for(let o in r){let a=r[o],c=kS(o,a,i[o]);s.push(c)}if(t){let o=kS("indices",t);s.push(o)}return{fields:s,metadata:n}}function _N(r){let e={};for(let t in r){let n=r[t];e[n.name||"undefined"]=n}return e}function kS(r,e,t){let n={...$f(e),...t?CS(t.metadata):{}};return Wf(r,e,n)}function CS(r){Object.entries(r);let e={};for(let t in r)e[`${t}.string`]=JSON.stringify(r[t]);return e}var US=p(()=>{"use strict";mn()});function SN(r,e){switch(e){case Float32Array:return r.DT_FLOAT32;case Int8Array:return r.DT_INT8;case Int16Array:return r.DT_INT16;case Int32Array:return r.DT_INT32;case Uint8Array:return r.DT_UINT8;case Uint16Array:return r.DT_UINT16;case Uint32Array:return r.DT_UINT32;default:return r.DT_INVALID}}function EN(r){let e=r.size(),t=new Int32Array(e);for(let n=0;n<e;n++)t[n]=r.GetValue(n);return t}function LN(r){let e=r.size(),t=new Uint32Array(e);for(let n=0;n<e;n++)t[n]=r.GetValue(n);return t}function BN(r,e){if(!Object.prototype.hasOwnProperty.call(e,r))return r;let t=/^(.*)_([0-9]+)$/.exec(r),n=t?t[1]:r,s=t?BigInt(t[2])+1n:1n;for(;Object.prototype.hasOwnProperty.call(e,`${n}_${s}`);)s++;return`${n}_${s}`}function FN(r){if(r.quantization_transform){let{quantization_bits:e,min_values:t,range:n}=r.quantization_transform;if(e!==void 0&&t&&n!==void 0)return{type:"quantization",bits:e,origin:Array.from(t),range:n}}if(r.octahedron_transform?.quantization_bits!==void 0)return{type:"octahedron",bits:r.octahedron_transform.quantization_bits}}function ON(r){if(r.includeAttributes&&r.excludeAttributes)throw new Error("DracoLoader: includeAttributes and excludeAttributes cannot be combined")}function MN(r,e){for(let t of r.includeAttributes||r.excludeAttributes||[])if(!e.includes(t))throw new Error(`DracoLoader: selected attribute "${t}" does not exist`)}function DN(r){let e=Er(r);if(!e)throw new Error("Decoded mesh is missing positions");let t=r.POSITION;if(t?.transform?.type!=="quantization")return e;let{bits:n,origin:s,range:i}=t.transform,o=i/(2**n-1);return e.map(a=>a.map((c,u)=>s[u]+c*o))}var PS,AN,vN,IN,lu,VS=p(()=>{"use strict";mn();US();PS={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},AN={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},vN=2,IN=4,lu=class{draco;decoder;metadataQuerier;constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){ON(t);let n=ArrayBuffer.isView(e)?new Int8Array(e.buffer,e.byteOffset,e.byteLength):new Int8Array(e);this._disableAttributeTransforms(t);let s=this.decoder.GetEncodedGeometryType(n),i=s===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud,o=null;try{switch(s){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeArrayToMesh(n,n.byteLength,i);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeArrayToPointCloud(n,n.byteLength,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!i.ptr){let d=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(d)}let a=this._getDracoLoaderData(i,s,t),c=this._getMeshData(i,a,t),u=DN(c.attributes),l=NS(c.attributes,a,c.indices);return{loader:"draco",loaderData:a,header:{vertexCount:i.num_points(),boundingBox:u},...c,schema:l}}finally{o&&this.draco.destroy(o),i&&this.draco.destroy(i)}}_getDracoLoaderData(e,t,n){let s=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,n);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:s,attributes:i}}_getDracoAttributes(e,t){let n={};for(let s=0;s<e.num_attributes();s++){let i=this.decoder.GetAttribute(e,s),o=this._getAttributeMetadata(e,s);n[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:s,metadata:o};let a=this._getQuantizationTransform(i,t);a&&(n[i.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(i,t);c&&(n[i.unique_id()].octahedron_transform=c)}return n}_getMeshData(e,t,n){let s=this._getMeshAttributes(t,e,n);if(!s.POSITION)throw new Error("DRACO: No position attribute found.");return e instanceof this.draco.Mesh?n.topology==="triangle-strip"?{topology:"triangle-strip",mode:5,attributes:s,indices:{value:this._getTriangleStripIndices(e),size:1}}:{topology:"triangle-list",mode:4,attributes:s,indices:{value:this._getTriangleListIndices(e),size:1}}:{topology:"point-list",mode:0,attributes:s}}_getMeshAttributes(e,t,n){let s={},i={},a=Object.values(e.attributes).sort((c,u)=>c.attribute_index-u.attribute_index).map(c=>{let u=this._deduceAttributeName(c,n),l=BN(u,i);return i[l]=!0,c.name=l,{attributeName:l,loaderAttribute:c}});MN(n,Object.keys(i));for(let{attributeName:c,loaderAttribute:u}of a){if(!this._shouldExtractAttribute(c,u,n))continue;let l=this._getAttributeValues(t,u);if(l){let{value:f,size:d}=l;s[c]={value:f,size:d,byteOffset:u.byte_offset,byteStride:u.byte_stride,normalized:u.normalized,transform:FN(u)}}}return s}_shouldExtractAttribute(e,t,n){if(t.attribute_type===this.draco.POSITION){if(n.excludeAttributes?.includes(e))throw new Error(`DracoLoader: position attribute "${e}" cannot be excluded`);return!0}return n.includeAttributes&&!n.includeAttributes.includes(e)?!1:!n.excludeAttributes?.includes(e)}_getTriangleListIndices(e){let n=e.num_faces()*3,s=e.num_points()<=65536,i=n*(s?vN:IN),o=this.draco._malloc(i);try{if(s){if(!this.decoder.GetTrianglesUInt16Array(e,i,o))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint16Array(this.draco.HEAPU8.buffer,o,n).slice()}if(!this.decoder.GetTrianglesUInt32Array(e,i,o))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint32Array(this.draco.HEAPU8.buffer,o,n).slice()}finally{this.draco._free(o)}}_getTriangleStripIndices(e){let t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),LN(t)}finally{this.draco.destroy(t)}}_getAttributeValues(e,t){let n=AN[t.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${t.data_type}`),null;let s=t.num_components,o=e.num_points()*s,a=o*n.BYTES_PER_ELEMENT,c=SN(this.draco,n),u,l=this.draco._malloc(a);try{let f=this.decoder.GetAttribute(e,t.attribute_index);if(!this.decoder.GetAttributeDataArrayForAllPoints(e,f,c,a,l))throw new Error(`DRACO: Failed to decode attribute ${t.unique_id}.`);u=new n(this.draco.HEAPU8.buffer,l,o).slice()}finally{this.draco._free(l)}return{value:u,size:s}}_deduceAttributeName(e,t){let n=e.unique_id;for(let[o,a]of Object.entries(t.extraAttributes||{}))if(a===n)return o;let s=t.attributeNameEntry||"name";if(e.metadata[s]){let o=e.metadata[s].string;return o==="COLOR"?"COLOR_0":o==="TEX_COORD"?"TEXCOORD_0":o}let i=e.attribute_type;for(let o in PS)if(this.draco[o]===i)return PS[o];return`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(e){let t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}_getAttributeMetadata(e,t){let n=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(n)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let t={},n=this.metadataQuerier.NumEntries(e);for(let s=0;s<n;s++){let i=this.metadataQuerier.GetEntryName(e,s);t[i]=this._getDracoMetadataField(e,i)}return t}_getDracoMetadataField(e,t){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,n);let s=EN(n);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:s}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:t=[],octahedronAttributes:n=[]}=e,s=[...t,...n];for(let i of s)this.decoder.SkipAttributeTransform(this.draco[i])}_getQuantizationTransform(e,t){let{quantizedAttributes:n=[]}=t,s=e.attribute_type();if(n.map(o=>this.draco[o]).includes(s)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:Float32Array.from({length:e.num_components()},(a,c)=>o.min_value(c))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){let{octahedronAttributes:n=[]}=t,s=e.attribute_type();if(n.map(o=>this.draco[o]).includes(s)){let o=new this.draco.AttributeOctahedronTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}});async function Ta(r,e,t,n){let s=n?.reportProgress||e?.onProgress;s?.({phase:"decode",completed:0,total:1,unit:"tasks"});let{draco:i}=await t();(e?.signal||n?.signal)?.throwIfAborted();let o=new lu(i);try{let a=o.parseSync(r,e?.draco);return s?.({phase:"decode",completed:1,total:1,unit:"tasks"}),e?.draco?.shape==="arrow-table"?ei(a,"arrow-table"):a}finally{o.destroy()}}var Ad=p(()=>{"use strict";mn();VS()});var qee,RN,kN,jS=p(()=>{"use strict";Js();uu();Ad();fu();({preload:qee,...RN}=Hn),kN={...RN,parse:async(r,e,t)=>await Ta(r,e,async()=>await _d(hn(e),"wasm",e?.draco?.decoderProfile),t)}});var py={};J(py,{DracoWASMLoaderWithParser:()=>kN});var my=p(()=>{"use strict";jS()});var Zee,NN,CN,GS=p(()=>{"use strict";Js();uu();Ad();fu();({preload:Zee,...NN}=Hn),CN={...NN,parse:async(r,e,t)=>await Ta(r,e,async()=>await _d(hn(e),"js"),t)}});var by={};J(by,{DracoJavaScriptLoaderWithParser:()=>CN});var gy=p(()=>{"use strict";GS()});function VN(r){let e=r?.modules?.draco3d;if(!e)throw new Error('DracoLoader: backend "draco3d" requires options.modules.draco3d');return e}var ite,UN,PN,zS=p(()=>{"use strict";uu();Ad();fu();({preload:ite,...UN}=Hn),PN={...UN,parse:async(r,e,t)=>await Ta(r,e,async()=>await dy(VN(e)),t)}});var yy={};J(yy,{Draco3DLoaderWithParser:()=>PN});var wy=p(()=>{"use strict";zS()});async function jN(r,e){let t=e;switch(GN(t)){case"wasm":{let{DracoWASMLoaderWithParser:n}=await Promise.resolve().then(()=>(my(),py));return n}case"javascript":{let{DracoJavaScriptLoaderWithParser:n}=await Promise.resolve().then(()=>(gy(),by));return n}case"draco3d":{let{Draco3DLoaderWithParser:n}=await Promise.resolve().then(()=>(wy(),yy));return n}default:throw new Error(`DracoLoader: unsupported backend "${t?.draco?.backend}"`)}}function GN(r){return r?.draco?.backend?r.draco.backend==="js"?"javascript":r.draco.backend:Hn.options.draco.backend}var Hn,fu=p(()=>{"use strict";ea();cy();uy();TS();Hn={dataType:null,batchType:null,...au,version:ou,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:af,deserializeWorkerResult:cf,options:{draco:xS},preload:jN}});var WS=p(()=>{"use strict";fu()});function $S(r){let e={};for(let t in r){let n=r[t];if(t!=="indices"){let s=xy(n);e[t]=s}}return e}function xy(r){let{buffer:e,size:t,count:n}=zN(r);return{value:e,size:t,byteOffset:0,count:n,type:ma(t),componentType:Xn(e)}}function zN(r){let e=r,t=1,n=0;return r&&r.value&&(e=r.value,t=r.size||1),e&&(ArrayBuffer.isView(e)||(e=WN(e,Float32Array)),n=e.length/t),{buffer:e,size:t,count:n}}function WN(r,e,t=!1){return r?Array.isArray(r)?new e(r):t&&!(r instanceof e)?new e(r):r:null}var qS=p(()=>{"use strict";ri()});var Ty={};J(Ty,{decode:()=>KN,name:()=>$N,preprocess:()=>qN});function qN(r,e,t){let n=new ie(r);for(let s of n.meshes)for(let i of n.getReferences(s).primitives)n.getExtension(i,_a)}async function KN(r,e,t){if(!e?.gltf?.decompressMeshes)return;let n=new ie(r),s=[];for(let i of n.meshes)for(let o of n.getReferences(i).primitives)n.getExtension(o,_a)&&s.push(XN(n,o,e,t));await Promise.all(s),n.removeExtension(_a)}async function XN(r,e,t,n){let s=r.getExtension(e,_a);if(!s)return;let i=hr(r.data,r.gltf.buffers,s.bufferView),o=eo(i.buffer,i.byteOffset,i.byteLength),a={...t,draco:{...t.draco,shape:"mesh",topology:"triangle-list",decoderProfile:t.draco?.decoderProfile||"gltf",extraAttributes:s.attributes}};delete a["3d-tiles"];let c=await Xs(o,Hn,a,n),u=$S(c.attributes);for(let l of Object.keys(s.attributes))if(!Object.hasOwn(u,l))throw new Error(`glTF: Draco decompression did not produce attribute ${l}`);for(let[l,f]of Object.entries(u))if(l in e.attributes){let d=e.attributes[l],h=r.data.accessors?.[d];h?.normalized!==void 0&&(f.normalized=h.normalized),h?.min&&h?.max&&(f.min=h.min,f.max=h.max)}e.attributes={...e.attributes,...u},c.indices&&(e.indices=xy(c.indices),e.mode=4),r.removeExtension(e,_a),HN(e)}function HN(r){if(!r.attributes||Object.keys(r.attributes).length===0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}var _a,$N,KS=p(()=>{"use strict";Ue();WS();He();qS();ao();_a="KHR_draco_mesh_compression",$N=_a});var Ay={};J(Ay,{decode:()=>ZN,name:()=>JN});async function ZN(r,e){let t=new ie(r);if(!t.hasExtension(Aa)||!e.gltf?.loadBuffers)return;let s=r.json.materials||[];for(let i=0;i<s.length;i++)eC(i,r,t);s.some(i=>_y(i).length>0)||t.removeExtension(Aa)}function eC(r,e,t){let n=e.json.materials?.[r],s=_y(n),i=new Map,o=rC(e);for(let a of s){let c=a.extensions?.[Aa];if(c){let u=c.texCoord??a.texCoord??0,l=nC(u,c),f=i.get(l);if(!f){if(f={sourceTexCoord:u,texCoord:o,matrix:aC(c)},!sC(e,r,f))continue;o++,i.set(l,f)}a.texCoord=f.texCoord,tC(t,a,Aa),a.extensions&&Object.keys(a.extensions).length===0&&delete a.extensions}}}function tC(r,e,t){e.extensions?.[t]!==void 0&&(r.recordRemovedExtension(t),delete e.extensions[t])}function _y(r){if(!r||typeof r!="object")return[];let e=r,t=[],n=e.extensions;Number.isFinite(e.index)&&n?.[Aa]&&t.push(e);for(let[s,i]of Object.entries(e))s!=="extras"&&t.push(..._y(i));return t}function rC(r){let e=-1;for(let t of r.json.meshes||[])for(let n of t.primitives)for(let s of Object.keys(n.attributes)){let i=/^TEXCOORD_(\d+)$/.exec(s);i&&(e=Math.max(e,Number(i[1])))}return e+1}function nC(r,e){let{offset:t=[0,0],rotation:n=0,scale:s=[1,1]}=e;return JSON.stringify([r,t,n,s])}function sC(r,e,t){let n=[],s=r.json.meshes||[];for(let i of s)for(let o of i.primitives){let a=o.material;Number.isFinite(a)&&e===a&&n.push(o)}if(n.length===0||n.some(i=>!iC(r,i,t.sourceTexCoord)))return!1;for(let i of n)oC(r,i,t);return!0}function iC(r,e,t){let n=e.attributes[`TEXCOORD_${t}`],s=n;if(ArrayBuffer.isView(s?.value))return!0;if(!Number.isFinite(n))return!1;let i=r.json.accessors?.[n];if(!i||i.bufferView===void 0||i.sparse)return!1;let o=r.json.bufferViews?.[i.bufferView];return!!(o&&r.buffers[o.buffer])}function oC(r,e,t){let{sourceTexCoord:n,texCoord:s,matrix:i}=t,o=e.attributes[`TEXCOORD_${n}`],a=o;if(ArrayBuffer.isView(a?.value)){let c=new Float32Array(a.count*2);for(let u=0;u<a.count;u++)XS(a.value.subarray(u*2,u*2+2),a,i,c,u*2);HS(s,a,e,r,c);return}if(Number.isFinite(o)){let c=r.json.accessors?.[o];if(c&&c.bufferView!==void 0){let u=r.json.bufferViews?.[c.bufferView];if(u){let{arrayBuffer:l,byteOffset:f}=r.buffers[u.buffer],d=(f||0)+(c.byteOffset||0)+(u.byteOffset||0),{ArrayType:h,length:m}=Zc(c,u),b=Qc[c.componentType],g=ud[c.type],y=u.byteStride||b*g,x=new Float32Array(m);for(let T=0;T<c.count;T++){let _=new h(l,d+T*y,2);XS(_,c,i,x,T*g)}HS(s,c,e,r,x)}}}}function XS(r,e,t,n,s){let i=e.componentType===5120||e.componentType===5122,o=2**(Qc[e.componentType]*8-(i?1:0))-1;vd.set(e.normalized?Math.max(r[0]/o,-1):r[0],e.normalized?Math.max(r[1]/o,-1):r[1],1),vd.transformByMatrix3(t),n.set([vd[0],vd[1]],s)}function HS(r,e,t,n,s){n.buffers.push({arrayBuffer:ro(s.buffer),byteOffset:0,byteLength:s.buffer.byteLength}),n.json.bufferViews=n.json.bufferViews||[];let i=n.json.bufferViews;i.push({buffer:n.buffers.length-1,byteLength:s.buffer.byteLength,byteOffset:0});let o=n.json.accessors;o&&(o.push({bufferView:i?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),t.attributes[`TEXCOORD_${r}`]=o.length-1)}function aC(r){let{offset:e=[0,0],rotation:t=0,scale:n=[1,1]}=r,s=new zn().set(1,0,0,0,1,0,e[0],e[1],1),i=YN.set(Math.cos(t),Math.sin(t),0,-Math.sin(t),Math.cos(t),0,0,0,1),o=QN.set(n[0],0,0,0,n[1],0,0,0,1);return s.multiplyRight(i).multiplyRight(o)}var Aa,JN,vd,YN,QN,JS=p(()=>{"use strict";Uf();ri();gg();He();Ue();Aa="KHR_texture_transform",JN=Aa,vd=new jc,YN=new zn,QN=new zn});var vy={};J(vy,{decode:()=>uC,encode:()=>lC,name:()=>cC});async function uC(r){let e=new ie(r),t=e.getExtension(yo);t&&(e.data.lights=t.lights,e.removeExtension(yo));for(let n of e.nodes){let s=e.getExtension(n,yo);s&&(n.light=s.light),e.removeExtension(n,yo)}}async function lC(r){let e=new bn(r),{json:t}=e;if(t.lights){let n=e.addExtension(yo);H(!n.lights),n.lights=t.lights,delete t.lights}if(e.json.lights){for(let n of e.json.lights){let s=n.node;e.addObjectExtension(s,yo,n)}delete e.json.lights}}var yo,cC,YS=p(()=>{"use strict";oo();He();eu();yo="KHR_lights_punctual",cC=yo});var Iy={};J(Iy,{decode:()=>dC,encode:()=>hC,name:()=>fC});async function dC(r){let e=new ie(r);for(let t of e.materials)e.getExtension(t,va)&&(t.unlit=!0),e.removeExtension(t,va);e.removeExtension(va)}function hC(r){let e=new bn(r);for(let t of r.json.materials||[]){let n=t;n.unlit&&(delete n.unlit,e.addObjectExtension(t,va,{}),e.registerRequiredExtension(va))}for(let t of["extensionsUsed","extensionsRequired"])r.json[t]?.length===0&&delete r.json[t]}var va,fC,QS=p(()=>{"use strict";He();eu();va="KHR_materials_unlit",fC=va});var Sy={};J(Sy,{decode:()=>mC,encode:()=>bC,name:()=>pC});async function mC(r){let e=new ie(r),t=e.getExtension(du);if(t){let n=gC(t,e);for(let s of e.materials){let i=e.getExtension(s,du);i&&(s.technique=Object.assign({},i,n[i.technique]),s.technique.values=yC(s.technique,e)),e.removeExtension(s,du)}e.removeExtension(du)}}async function bC(r,e){}function gC(r,e){let{programs:t=[],shaders:n=[],techniques:s=[]}=r,i=new TextDecoder;return n.forEach(o=>{if(Number.isFinite(o.bufferView))o.code=i.decode(hr(e.data,e.gltf.buffers,o.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),t.forEach(o=>{o.fragmentShader=n[o.fragmentShader],o.vertexShader=n[o.vertexShader]}),s.forEach(o=>{o.program=t[o.program]}),s}function yC(r,e){let t=Object.assign({},r.values);return Object.keys(r.uniforms||{}).forEach(n=>{r.uniforms[n].value&&!(n in t)&&(t[n]=r.uniforms[n].value)}),Object.keys(t).forEach(n=>{typeof t[n]=="object"&&t[n].index!==void 0&&(t[n].texture=e.resolveTexture(t[n].index,`technique.values.${n}.index`))}),t}var du,pC,ZS=p(()=>{"use strict";He();ao();du="KHR_techniques_webgl",pC=du});var Ey={};J(Ey,{decode:()=>xC,name:()=>wC});async function xC(r,e){let t=new ie(r);TC(t,e)}function TC(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(eE);t&&(e.gltf?.loadImages&&_C(r,t),AC(r,t))}function _C(r,e){let t=e.schema;if(!t)return;let n=t.classes,{featureTextures:s}=e;if(n&&s)for(let i in n){let o=n[i],a=IC(s,i);a&&EC(r,a,o)}}function AC(r,e){let t=e.schema;if(!t)return;let n=t.classes,s=e.featureTables;if(n&&s)for(let i in n){let o=vC(s,i);o&&SC(r,t,o)}}function vC(r,e){for(let t in r){let n=r[t];if(n.class===e)return n}return null}function IC(r,e){for(let t in r){let n=r[t];if(n.class===e)return n}return null}function SC(r,e,t){if(!t.class)return;let n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);let s=t.count;for(let i in n.properties){let o=n.properties[i],a=t.properties?.[i];if(a){let c=LC(r,e,o,s,a);a.data=c}}}function EC(r,e,t){let n=e.class;for(let s in t.properties){let i=e?.properties?.[s];if(i){let o=DC(r,i,n);i.data=o}}}function LC(r,e,t,n,s){let i=[],o=s.bufferView,a=r.getTypedArrayForBufferView(o),c=BC(r,t,s,n),u=FC(r,t,s,n,c);return t.type==="STRING"||t.componentType==="STRING"?i=pd(n,a,c,u,t.type==="ARRAY"?t.componentCount:void 0):OC(t)&&(i=MC(t,n,a,c)),i}function BC(r,e,t,n){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof t.arrayOffsetBufferView<"u"?ba(r,t.arrayOffsetBufferView,t.offsetType||"UINT32",n):null}function FC(r,e,t,n,s){if(typeof t.stringOffsetBufferView<"u"){let i=s?Number(s[n]):n*(e.type==="ARRAY"&&e.componentCount||1);return ba(r,t.stringOffsetBufferView,t.offsetType||"UINT32",i)}return null}function OC(r){let e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(r.type)||typeof r.componentType<"u"&&e.includes(r.componentType)}function MC(r,e,t,n){let s=r.type==="ARRAY",i=r.componentCount,o="SCALAR",a=r.componentType||r.type,c=tu(o,a),u=t.byteLength/c,l=ga(t,o,a,u);return s?n?ru(l,e,n):i?nu(l,e,i):[]:l}function DC(r,e,t){let n=r.data;if(!n.meshes)return[];let s=[];for(let i of n.meshes)for(let o of i.primitives)RC(r,t,e,s,o);return s}function RC(r,e,t,n,s){let i={channels:t.channels,...t.texture},o=ya(r,i,s);o&&hd(r,e,o,n,s)}var eE,wC,tE=p(()=>{"use strict";He();md();eE="EXT_feature_metadata",wC=eE});async function nE(r,e={},t){let n=rE.filter(s=>iE(s.name,e));for(let s of n)await s.preprocess?.(r,e,t)}async function sE(r,e={},t){let n=rE.filter(s=>iE(s.name,e));for(let s of n)await s.decode?.(r,e,t)}function iE(r,e){let t=e?.gltf?.excludeExtensions||{};return Array.isArray(t)?!t.includes(r):!(r in t&&!t[r])}var rE,oE=p(()=>{"use strict";$I();YI();QI();eS();tS();nS();iS();oS();pS();bS();gS();yS();oy();wS();KS();JS();Jg();YS();QS();ZS();tE();rE=[xg,ry,ty,Ty,Wg,Vg,qg,Xg,Hg,Yg,Qg,Zg,ny,sy,iy,ay,vy,Iy,Sy,Ay,Ey]});function aE(r){let e=new ie(r);for(let t of e.images){let n=e.getExtension(t,Ly);n&&(t.bufferView=n.bufferView,t.mimeType=n.mimeType,delete t.uri),e.removeExtension(t,Ly)}for(let t of e.data.buffers||[])t.id==="binary_glTF"&&delete t.uri;e.removeExtension(Ly)}var Ly,cE=p(()=>{"use strict";He();Ly="KHR_binary_glTF"});function lE(r,e){let t=r.accessors||[],n=r.bufferViews||[],s=NC(r),i=new Map;for(let[o,a]of t.entries()){let c=a.bufferView;if(c===void 0&&!a.byteStride){delete a.byteStride;continue}let u=n[c],l=s.get(o)||"unused",f=CC(a),d=a.byteStride===0?f:a.byteStride??f,h=a.byteOffset??0,m=u?.byteOffset??0,b=typeof a.componentType=="number"&&Object.hasOwn(Id,a.componentType)?Id[a.componentType]:0,g=l==="vertex",y=g?d>=f&&d>=4&&d<=252&&d%4===0&&h%4===0&&(m+h)%4===0:d===f;if(!u||!f||l==="mixed"||!Number.isInteger(d)||!y||g&&d>u.byteLength||!Number.isInteger(a.count)||a.count<1||!Number.isInteger(h)||h<0||!Number.isInteger(m)||m<0||h%b!==0||(m+h)%b!==0||a.type.startsWith("MAT")&&(m+h)%4!==0||!Number.isInteger(u.byteLength)||h+(a.count-1)*d+f>u.byteLength){e(o);continue}let x=`${c}:${l}:${g?d:0}`,T=i.get(x);if(T===void 0){let _={...u};delete _.id,delete _.byteStride,delete _.target,g?(_.byteStride=d,_.target=34962):l==="indices"&&(_.target=34963),T=n.length,n.push(_),i.set(x,T)}a.bufferView=T,delete a.byteStride}}function NC(r){let e=new Map,t=(n,s)=>{if(n===void 0)return;let i=e.get(n);e.set(n,i&&i!==s?"mixed":s)};for(let n of r.meshes||[])for(let s of n.primitives){for(let i of Object.values(s.attributes))t(i,"vertex");t(s.indices,"indices")}for(let n of r.animations||[])for(let s of n.samplers)t(s.input,"animation"),t(s.output,"animation");for(let n of r.skins||[])t(n.inverseBindMatrices,"inverseBind");return e}function CC(r){let e=typeof r.componentType=="number"&&Object.hasOwn(Id,r.componentType)?Id[r.componentType]:0,t=Object.hasOwn(uE,r.type)?uE[r.type]:0;if(!e||!t)return 0;let n=r.type==="MAT2"?2:r.type==="MAT3"?3:4;return r.type.startsWith("MAT")&&n*e%4!==0?0:(e||0)*t}var Id,uE,fE=p(()=>{"use strict";Id={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},uE={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}});function dE(r,e,t){let n=r.nodes||[],s=r.skins||[],i=s.length,o=!1;for(let a=0;a<i;a++){let c=s[a],u=c.jointNames;if(!Array.isArray(u)||u.length===0||u.some(m=>typeof m!="string"||!m)||new Set(u).size!==u.length){t(`skin ${a} has invalid joint names`),o=!0;continue}let l=n.flatMap((m,b)=>m.skin===a?[b]:[]),f=(l.length?l:[void 0]).map(m=>UC(n,u,m,e,b=>t(`skin ${a} ${b}`))),d=f.some(m=>!m);o||=d;let h=new Map;for(let m of f){if(!m)continue;let b=`${m.skeletonIndex}:${m.jointIndices.join(",")}`,g=h.get(b);if(g===void 0){let y={...c,joints:m.jointIndices,skeleton:m.skeletonIndex};delete y.jointNames,c.bindShapeMatrix!==void 0&&jC(c.bindShapeMatrix)&&delete y.bindShapeMatrix,!d&&h.size===0?(g=a,s[a]=y):(delete y.id,g=s.length,s.push(y)),h.set(b,g)}m.nodeIndex!==void 0&&(n[m.nodeIndex].skin=g,delete n[m.nodeIndex].skeletons)}}if(!o)for(let a of n)delete a.jointName}function UC(r,e,t,n,s){let i=t===void 0?void 0:r[t].skeletons;if(i!==void 0&&(!Array.isArray(i)||i.some(f=>typeof f!="string"||!f)||new Set(i).size!==i.length))return s("has invalid skeleton roots"),null;let o=(i||[]).map(n),a=o.length?PC(r,o):r.map((f,d)=>d);if(!a)return s("has invalid or overlapping skeleton subtrees"),null;let c=[],u=new Map;for(let f of a){let d=r[f].jointName;if(d===void 0)continue;let h=u.get(d)||[];h.push(f),u.set(d,h)}for(let f of e){let d=u.get(f)||[];if(d.length!==1)return s(`cannot uniquely resolve joint ${f}`),null;c.push(d[0])}let l=VC(r,[...c,...o]);return l===void 0?(s("joints have no unambiguous common hierarchy root"),null):{nodeIndex:t,jointIndices:c,skeletonIndex:o.length===1?o[0]:l}}function PC(r,e){let t=new Set,n=[...e];for(;n.length;){let s=n.pop();if(!Number.isSafeInteger(s)||!r[s]||t.has(s))return null;t.add(s),n.push(...r[s].children||[])}return Array.from(t)}function VC(r,e){let t=new Map;for(let[i,o]of r.entries())for(let a of o.children||[]){if(!Number.isSafeInteger(a)||!r[a]||t.has(a))return;t.set(a,i)}let n=e.map(i=>{let o=[],a=new Set,c=i;for(;c!==void 0;){if(a.has(c))return[];a.add(c),o.push(c),c=t.get(c)}return o}),s=n.map(i=>new Set(i));return n[0].find(i=>s.every(o=>o.has(i)))}function jC(r){return Array.isArray(r)&&r.length===16&&Array.from(r).every((e,t)=>e===(t%5===0?1:0))}var hE=p(()=>{"use strict"});function Sd(r,e){if(!e.length)return;let t=new Map;for(let n of e){let s=t.get(n.bufferIndex)||[];s.push(n),t.set(n.bufferIndex,s)}r.buffers=[...r.buffers],r.json.bufferViews||=[];for(let[n,s]of t){let i=r.json.buffers[n],o=r.buffers[n],a=_e(i.byteLength,4),c=a+s.reduce((f,d)=>f+_e(d.bytes.byteLength,4),0),u=new ArrayBuffer(c),l=new Uint8Array(u);l.set(new Uint8Array(o.arrayBuffer,o.byteOffset,i.byteLength));for(let f of s){l.set(new Uint8Array(f.bytes),a);let d=r.json.bufferViews.length;r.json.bufferViews.push({buffer:n,byteOffset:a,byteLength:f.bytes.byteLength,...f.byteStride===void 0?{}:{byteStride:f.byteStride},...f.target===void 0?{}:{target:f.target}}),f.apply(d),a+=_e(f.bytes.byteLength,4)}i.byteLength=c,i.uri!==void 0&&(i.uri=`data:application/octet-stream;base64,${cb(u)}`),r.buffers[n]={arrayBuffer:u,byteOffset:0,byteLength:c}}}var By=p(()=>{"use strict";Ue()});function pE(r,e){let t=new Map;for(let[n,s]of(r.json.skins||[]).entries()){if(s.bindShapeMatrix===void 0)continue;let i=s.bindShapeMatrix;if(!mE(i)){e(`skin ${n} non-identity bindShapeMatrix requires a finite affine matrix`);continue}let o=`${s.inverseBindMatrices}:${i.join(",")}`,a=t.get(o);if(a){if((s.joints||s.jointNames||[]).length>a.count){e(`skin ${n} non-identity bindShapeMatrix has too few inverse-bind matrices`);continue}a.skins.push(s);continue}let c=GC(r,s,i);if(typeof c=="string"){e(`skin ${n} non-identity bindShapeMatrix ${c}`);continue}t.set(o,c)}Sd(r,Array.from(t.values(),n=>({bufferIndex:n.bufferIndex,bytes:n.matrixBytes,apply:s=>{r.json.accessors||=[];let i=r.json.accessors.length;r.json.accessors.push({bufferView:s,byteOffset:0,componentType:5126,count:n.count,type:"MAT4"});for(let o of n.skins)o.inverseBindMatrices=i,delete o.bindShapeMatrix}})))}function GC(r,e,t){let n=r.json.accessors?.[e.inverseBindMatrices],s=(e.joints||e.jointNames||[]).length;if(!n||n.componentType!==5126||n.type!=="MAT4"||n.normalized||n.sparse||n.extensions||Object.hasOwn(n,"byteStride")||!Number.isSafeInteger(n.count)||n.count<1)return"requires packed FLOAT MAT4 inverse-bind matrices";if(n.count<s)return"has too few inverse-bind matrices";let i=r.json.bufferViews?.[n.bufferView],o=i?.buffer,a=r.json.buffers?.[o],c=r.buffers[o];if(!i||o===void 0||!a||!c)return"requires a loaded inverse-bind buffer";if(i.extensions)return"does not support inverse-bind buffer-view extensions";let u=i.byteOffset??0,l=n.byteOffset??0,f=n.count*64;if(!(c.arrayBuffer instanceof ArrayBuffer)||!Number.isSafeInteger(a.byteLength)||a.byteLength<1||!Number.isSafeInteger(c.byteOffset)||c.byteOffset<0||!Number.isSafeInteger(c.byteLength)||c.byteLength<a.byteLength||c.byteOffset+c.byteLength>c.arrayBuffer.byteLength||!Number.isSafeInteger(u)||u<0||u%4!==0||!Number.isSafeInteger(i.byteLength)||i.byteLength<1||i.byteStride!==void 0||u+i.byteLength>a.byteLength||!Number.isSafeInteger(l)||l<0||l%4!==0||l+f>i.byteLength)return"has an invalid inverse-bind buffer layout";let d=new DataView(c.arrayBuffer),h=c.byteOffset+u+l,m=new ArrayBuffer(f),b=new DataView(m);for(let g=0;g<n.count;g++){let y=Array.from({length:16},(x,T)=>d.getFloat32(h+g*64+T*4,!0));if(!mE(y))return"requires finite affine inverse-bind matrices";for(let x=0;x<4;x++)for(let T=0;T<4;T++){let _=0;for(let v=0;v<4;v++)_+=y[v*4+T]*t[x*4+v];if(!Number.isFinite(Math.fround(_)))return"produces non-finite FLOAT matrix values";b.setFloat32(g*64+(x*4+T)*4,_,!0)}}return{bufferIndex:o,count:n.count,matrixBytes:m,skins:[e]}}function mE(r){if(!Array.isArray(r)||r.length!==16)return!1;for(let e=0;e<16;e++)if(!Number.isFinite(r[e]))return!1;return r[3]===0&&r[7]===0&&r[11]===0&&r[15]===1}var bE=p(()=>{"use strict";By()});function yE(r){let e=r.accessors||[],t=new Map,n=new Map,s=Oy(r),i=(o,a)=>{if(!Number.isSafeInteger(o)||o<0||!Object.hasOwn(e,o))return o;let c=e[o];if(!c)return o;let u=t.get(o)||new Map,l=`${a.usage}:${a.mode}:${["unit","signed","direction"].includes(a.mode)?a.semantic?.split("_")[0]:""}:${a.hasOpaqueConsumer?"opaque":""}`,f=u.get(l);return f===void 0&&(f=u.size?e.length:o,u.size&&e.push({...c}),u.set(l,f),n.set(f,a),t.set(o,u)),f};for(let o of r.meshes||[])for(let a of o.primitives){for(let[c,u]of Object.entries(a.attributes)){let l=e[u],f=["NORMAL","TANGENT"].includes(c)&&l&&[5120,5121,5122,5123].includes(l.componentType)?"direction":/^JOINTS_\d+$/.test(c)?"joints":/^(COLOR|WEIGHTS|TEXCOORD)_\d+$/.test(c)&&l&&[5120,5122].includes(l.componentType)?"signed":/^(COLOR|WEIGHTS|TEXCOORD)_\d+$/.test(c)&&l&&[5121,5123].includes(l.componentType)&&!l.normalized?"unit":/^WEIGHTS_\d+$/.test(c)?"weights":"copy";a.attributes[c]=i(u,{usage:"vertex",mode:f,semantic:c,...["signed","direction"].includes(f)?{hasOpaqueConsumer:s}:{}})}a.indices!==void 0&&(a.indices=i(a.indices,{usage:"indices",mode:"copy",hasOpaqueConsumer:a.extensions!==void 0}))}for(let o of r.animations||[])for(let a of o.samplers)a.input=i(a.input,{usage:"animation",mode:"copy"}),a.output=i(a.output,{usage:"animation",mode:"copy"});for(let o of r.skins||[])o.inverseBindMatrices!==void 0&&(o.inverseBindMatrices=i(o.inverseBindMatrices,{usage:"inverseBind",mode:"copy"}));for(let o=0;o<e.length;o++)n.has(o)||n.set(o,{usage:"unused",mode:"copy"});return n}function wE(r,e,t,n,s){let i=[],o=[];for(let[a,c]of e){let u=r.json.accessors[a],l=c.mode==="joints"||c.mode==="weights"||c.semantic?.startsWith("WEIGHTS_"),f=!!(l&&["SCALAR","VEC2","VEC3"].includes(u.type)),d=c.mode==="weights"&&(u.type!=="VEC4"||![5121,5123,5126].includes(u.componentType)||u.componentType===5126&&u.normalized),h=c.mode==="signed",m=c.mode==="direction",b=h||m,g=c.mode==="joints"&&(![5121,5123].includes(u.componentType)||u.normalized||u.type!=="VEC4");if(!t.has(a)&&!g&&!d&&!b&&!f&&c.usage!=="indices"&&c.mode!=="unit")continue;let y=hu(r,a);if(typeof y=="string"){n(`accessor ${a} layout requires binary repacking: ${y}`);continue}if(l&&!["SCALAR","VEC2","VEC3","VEC4"].includes(u.type)){n(`accessor ${a} skin influences require scalar/vector data`);continue}if(c.mode==="weights"&&(![5121,5123,5126].includes(u.componentType)||u.componentType===5126&&u.normalized||u.componentType!==5126&&!u.normalized)){n(`accessor ${a} weights require FLOAT or normalized unsigned data`);continue}let x=u.componentType,T=u.normalized;if(b){if(c.hasOpaqueConsumer){n(`accessor ${a} integer conversion cannot interpret opaque extension consumers`);continue}if(!(m?[c.semantic==="NORMAL"?"VEC3":"VEC4"]:c.semantic?.startsWith("COLOR_")?["VEC3","VEC4"]:c.semantic?.startsWith("WEIGHTS_")?["SCALAR","VEC2","VEC3","VEC4"]:["VEC2"]).includes(u.type)||T!==void 0&&typeof T!="boolean"){n(`accessor ${a} integer ${c.semantic} has incompatible shape or normalization`);continue}let oe=!0;for(let xe=0;xe<u.count;xe++)if(m){let Rt=Math.hypot(Math.fround(Ia(y,xe,0)),Math.fround(Ia(y,xe,1)),Math.fround(Ia(y,xe,2)));(Math.abs(Rt-1)>1e-5||c.semantic==="TANGENT"&&![-1,1].includes(Ia(y,xe,3)))&&(oe=!1)}else if(!c.semantic?.startsWith("TEXCOORD_"))for(let Rt=0;Rt<y.rows;Rt++){let mr=Ia(y,xe,Rt);(mr<0||mr>1)&&(oe=!1)}if(!oe){n(m?`accessor ${a} integer ${c.semantic} requires unit directions and tangent handedness of +/-1; values are not repaired`:`accessor ${a} signed ${c.semantic} values must remain in [0, 1]`);continue}x=5126,T=!1}if(c.usage==="indices"){if(u.type!=="SCALAR"||![5121,5123,5125].includes(x)||T){n(`index accessor ${a} requires unnormalized unsigned SCALAR data`);continue}let ue=0;for(let xe=0;xe<u.count;xe++)ue=Math.max(ue,Xt(y,xe,0));if(ue===(x===5121?255:x===5123?65535:4294967295)){if(c.hasOpaqueConsumer){n(`index accessor ${a} cannot widen opaque primitive extension semantics`);continue}if(x===5125){n(`index accessor ${a} contains the unrepresentable uint32 restart value`);continue}x=x===5121?5123:5125}if(!t.has(a)&&x===u.componentType)continue}if(g||c.mode==="unit"){if(g&&u.normalized){n(`accessor ${a} joint indices require unnormalized scalar/vector data`);continue}if(c.mode==="unit"&&!(c.semantic?.startsWith("COLOR_")?["VEC3","VEC4"]:c.semantic?.startsWith("WEIGHTS_")?["SCALAR","VEC2","VEC3","VEC4"]:["VEC2"]).includes(u.type)){n(`accessor ${a} integer ${c.semantic} has an incompatible shape`);continue}let ue=0,oe=!0;for(let xe=0;xe<u.count;xe++)for(let Rt=0;Rt<y.rows*y.columns;Rt++){let mr=Xt(y,xe,Rt);(!Number.isInteger(mr)||mr<0||g&&mr>65535)&&(oe=!1),ue=Math.max(ue,mr)}if(!oe){n(`accessor ${a} joint indices require finite integers in [0, 65535]`);continue}if(g)x=ue<=255?5121:5123,T=!1;else if(ue<=1)x=5126,T=!1;else if(n(`accessor ${a} ambiguous integer attribute normalization; best effort assumes normalized unsigned values`),T=!0,!t.has(a)&&!f){o.push(()=>{u.normalized=!0});continue}}let _=f?4:y.rows,v=Fy[x],I=y.columns>1?_e(y.rows*v,4):_*v,N=I*y.columns,K=c.usage==="vertex"?_e(N,4):N,ne=new ArrayBuffer(u.count*K),be=new Uint8Array(ne),Re=new Uint8Array(y.data.buffer),ke=new DataView(ne);for(let ue=0;ue<u.count;ue++)for(let oe=0;oe<y.columns;oe++)if(x===u.componentType){let xe=y.byteOffset+ue*y.byteStride+oe*y.rows*y.componentSize;be.set(Re.subarray(xe,xe+y.rows*y.componentSize),ue*K+oe*I)}else for(let xe=0;xe<y.rows;xe++){let Rt=(b?Ia:Xt)(y,ue,oe*y.rows+xe),mr=ue*K+oe*I+xe*v;x===5126?ke.setFloat32(mr,Rt,!0):x===5121?ke.setUint8(mr,Rt):x===5125?ke.setUint32(mr,Rt,!0):ke.setUint16(mr,Rt,!0)}i.push({bufferIndex:y.bufferIndex,bytes:ne,...c.usage==="vertex"?{byteStride:K,target:34962}:c.usage==="indices"?{target:34963}:{},apply:ue=>{b&&s(`Converted ${h?"signed":"integer"} ${c.semantic} accessor ${a} to FLOAT, preserving ${y.accessor.normalized?"explicitly normalized":"literal"} values.`),c.usage==="indices"&&x!==u.componentType&&s(`Widened index accessor ${a} to preserve a glTF 1 index reserved by glTF 2.`),u.bufferView=ue,u.byteOffset=0,delete u.byteStride,(x!==u.componentType||f)&&(delete u.min,delete u.max),u.componentType=x,f&&(u.type="VEC4"),T?u.normalized=!0:delete u.normalized}})}Sd(r,i);for(let a of o)a()}function Ia(r,e,t){let n=Xt(r,e,t);if(r.accessor.normalized!==!0)return n;let s=zC[r.accessor.componentType];return Math.max(n/s,-1)}function Oy(r){let e=[r],t=new Set;for(;e.length;){let n=e.pop();if(!(!n||typeof n!="object"||t.has(n))){t.add(n);for(let[s,i]of Object.entries(n))if(s!=="extras"){if(s==="extensions"&&i&&typeof i=="object"&&Object.keys(i).some(o=>!["KHR_materials_unlit","KHR_materials_common"].includes(o)))return!0;e.push(i)}}}return!1}function hu(r,e){let t=r.json.accessors?.[e];if(!t||!Number.isSafeInteger(e)||e<0)return"invalid accessor reference";let n=typeof t.componentType=="number"&&Object.hasOwn(Fy,t.componentType)?Fy[t.componentType]:void 0,s=typeof t.type=="string"&&Object.hasOwn(gE,t.type)?gE[t.type]:void 0;if(!n||!s||!Number.isSafeInteger(t.count)||t.count<1)return"invalid component type, shape, or count";let[i,o]=s,a=r.json.bufferViews?.[t.bufferView],c=r.json.buffers?.[a?.buffer],u=r.buffers[a?.buffer];if(!a||!c||!u)return"requires a loaded accessor buffer";if(t.sparse||t.extensions||a.extensions)return"sparse or extension-bearing data is unsupported";let l=i*o*n,f=t.byteStride??a.byteStride??l,d=f===0?l:f,h=t.byteOffset??0,m=a.byteOffset??0;return!(u.arrayBuffer instanceof ArrayBuffer)||!Number.isSafeInteger(d)||d<l||t.byteStride!==void 0&&t.byteStride>255||!Number.isSafeInteger(h)||h<0||!Number.isSafeInteger(m)||m<0||!Number.isSafeInteger(a.byteLength)||a.byteLength<1||!Number.isSafeInteger(c.byteLength)||c.byteLength<1||m+a.byteLength>c.byteLength||h+(t.count-1)*d+l>a.byteLength||!Number.isSafeInteger(u.byteOffset)||u.byteOffset<0||!Number.isSafeInteger(u.byteLength)||u.byteLength<c.byteLength||u.byteOffset+u.byteLength>u.arrayBuffer.byteLength?"invalid source buffer span or stride":{accessor:t,bufferIndex:a.buffer,componentSize:n,rows:i,columns:o,byteStride:d,data:new DataView(u.arrayBuffer),byteOffset:u.byteOffset+m+h}}function Xt(r,e,t){let n=r.byteOffset+e*r.byteStride+t*r.componentSize;switch(r.accessor.componentType){case 5120:return r.data.getInt8(n);case 5121:return r.data.getUint8(n);case 5122:return r.data.getInt16(n,!0);case 5123:return r.data.getUint16(n,!0);case 5125:return r.data.getUint32(n,!0);default:return r.data.getFloat32(n,!0)}}var Fy,zC,gE,pu=p(()=>{"use strict";Ue();By();Fy={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},zC={5120:127,5121:255,5122:32767,5123:65535},gE={SCALAR:[1,1],VEC2:[2,1],VEC3:[3,1],VEC4:[4,1],MAT2:[2,2],MAT3:[3,3],MAT4:[4,4]}});function TE(r,e){let t=r.asset;t.premultipliedAlpha&&e("asset premultipliedAlpha rendering"),xE(t,["profile","premultipliedAlpha"]);for(let[n,s]of(r.textures||[]).entries()){let i=s;for(let[o,a]of Object.entries({format:6408,internalFormat:6408,target:3553,type:5121}))i[o]!==void 0&&i[o]!==a&&e(`texture ${n} non-default ${o} rendering`);xE(i,["format","internalFormat","target","type"])}}function xE(r,e){let t={};for(let a of e)Object.hasOwn(r,a)&&(t[a]=r[a],delete r[a]);if(!Object.keys(t).length)return;let n=My(r.extras)?r.extras:r.extras===void 0?{}:{originalExtras:r.extras},s=My(n.gltf1)?n.gltf1:n.gltf1===void 0?{}:{originalExtras:n.gltf1},i=My(s.legacyFields)?s.legacyFields:s.legacyFields===void 0?{}:{originalExtras:s.legacyFields},o=Object.keys(t).some(a=>Object.hasOwn(i,a));r.extras={...n,gltf1:{...s,legacyFields:{...i,...t,...o?{originalExtras:i}:{}}}}}function My(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function Dy(r){let e=/^(JOINTS?|WEIGHTS?|TEXCOORD|COLOR)(?:_(\d+))?$/.exec(r);if(e){let t=e[1].startsWith("JOINT")?"JOINTS":e[1].startsWith("WEIGHT")?"WEIGHTS":e[1],n=Number(e[2]||0);if(!Number.isSafeInteger(n)||n>999999999)throw new Error(`glTF v1: invalid attribute set index ${r}`);return`${t}_${n}`}return["POSITION","NORMAL","TANGENT"].includes(r)||r.startsWith("_")||r.includes(":")?r:`_${r}`}var _E=p(()=>{"use strict"});function AE(r,e,t){for(let[s,i]of(r.animations||[]).entries()){let f=function(d,h,m){try{let b=typeof d=="string"?e(d,h):d,g=h==="accessor"?r.accessors:r.nodes;if(typeof b=="number"&&Number.isSafeInteger(b)&&b>=0&&g?.[b])return b}catch{}return t(`animation ${s} ${m} unresolved ${h} reference`),d};var n=f;let o=i,a=o.parameters||{},c=new Map,u=i.samplers,l=Array.isArray(u)?u.map((d,h)=>[String(h),d]):Object.entries(u||{});i.samplers=l.map(([d,h],m)=>{c.set(d,m);for(let b of["input","output"]){let g=h[b],y=Object.hasOwn(a,g)?a[g]:g;h[b]=f(y,"accessor",`sampler ${d} ${b}`)}return h.interpolation??="LINEAR",h}),delete o.parameters;for(let[d,h]of(i.channels||[]).entries()){if(typeof h.sampler=="string"){let b=c.get(h.sampler);b===void 0?t(`animation ${s} channel ${d} unresolved sampler ${h.sampler}`):h.sampler=b}let m=h.target;m?.id!==void 0?(m.node=f(m.id,"node",`channel ${d} target`),delete m.id):typeof m?.node=="string"&&(m.node=f(m.node,"node",`channel ${d} target`))}}}var vE=p(()=>{"use strict"});function IE(r,e,t){let n=r.nodes||[],s=new Map;for(let[a,c]of n.entries())for(let u of c.children||[])s.set(u,s.has(u)?null:a);let i=[];for(let[a,c]of(r.scenes||[]).entries()){let u=o(c.nodes||[]);if(!u){e(`scene ${a} invalid node hierarchy`);continue}for(let l of Array.from(u)){let f=r.skins?.[n[l].skin];if(!Array.isArray(f?.joints)||!f.joints.length||f.skeleton===void 0||u.has(f.skeleton)&&f.joints.every(b=>u.has(b)))continue;let d=f.skeleton,h=new Set;for(;!h.has(d)&&typeof s.get(d)=="number";)h.add(d),d=s.get(d);let m=o([d]);if(h.has(d)||s.get(d)===null||!m||!f.joints.every(b=>m.has(b))||Array.from(m).some(b=>u.has(b)||n[b].mesh!==void 0||n[b].camera!==void 0||n[b].extensions!==void 0)){e(`scene ${a} skin ${n[l].skin} cannot safely attach detached skeleton`);continue}for(let b of m)u.add(b);i.push(()=>{c.nodes||=[],c.nodes.push(d),t(`Attached detached skeleton root ${d} to scene ${a}.`)})}}for(let a of i)a();function o(a){let c=new Set,u=[...a];for(;u.length;){let l=u.pop();if(!Number.isSafeInteger(l)||!n[l]||c.has(l)||s.get(l)===null)return null;c.add(l),u.push(...n[l].children||[])}return c}}var SE=p(()=>{"use strict"});function EE(r,e){for(let[t,n]of(r.cameras||[]).entries()){let s=n.perspective,i=n.orthographic;(n.type==="perspective"?s&&mu(s.yfov)&&mu(s.znear)&&(s.aspectRatio===void 0||mu(s.aspectRatio))&&(s.zfar===void 0||mu(s.zfar)&&s.zfar>s.znear):n.type==="orthographic"&&i&&Number.isFinite(i.xmag)&&i.xmag!==0&&Number.isFinite(i.ymag)&&i.ymag!==0&&Number.isFinite(i.znear)&&i.znear>=0&&mu(i.zfar)&&i.zfar>i.znear)||e(`camera ${t} invalid projection parameters`)}}function mu(r){return Number.isFinite(r)&&r>0}var LE=p(()=>{"use strict"});function BE(r,e,t){let n=new Map,s=new Set;for(let[i,o]of(r.json.meshes||[]).entries())for(let[a,c]of o.primitives.entries()){let u=`mesh ${i} primitive ${a}`;for(let b of["TEXCOORD","COLOR","JOINTS","WEIGHTS"])Object.keys(c.attributes).filter(y=>y.startsWith(`${b}_`)).map(y=>Number(y.slice(b.length+1))).sort((y,x)=>y-x).some((y,x)=>y!==x)&&t(`${u} ${b} sets must be contiguous starting at zero`);for(let[b,g]of Object.entries(c.attributes)){let y=b.split("_")[0];if(!["NORMAL","TANGENT","COLOR","TEXCOORD","JOINTS","WEIGHTS"].includes(y))continue;let x=`${y}:${g}`;if(s.has(x))continue;s.add(x);let T=e(g,`${b} accessor ${g}`);T&&WC(T,y,`${b} accessor ${g}`,t)}let l=Object.values(c.attributes).map(b=>(Number.isSafeInteger(b)?r.json.accessors?.[b]:void 0)?.count);if(!l.length||l.some(b=>!Number.isSafeInteger(b)||b<1)){t(`${u} requires valid vertex attribute accessors`);continue}l.some(b=>b!==l[0])&&t(`${u} vertex attribute counts do not match`);let f=c.indices===void 0?l[0]:r.json.accessors?.[c.indices]?.count,d=c.mode===void 0?4:c.mode;if(!Number.isInteger(d)||d<0||d>6?t(`${u} requires a primitive mode in [0, 6]`):(!c.extensions||!Object.keys(c.extensions).length)&&(!Number.isSafeInteger(f)||f<1||d===1&&f%2!==0||[2,3].includes(d)&&f<2||d===4&&f%3!==0||[5,6].includes(d)&&f<3)&&t(`${u} draw count ${f} is incompatible with primitive mode ${d}`),c.indices===void 0)continue;let h=e(c.indices,`${u} indices`);if(!h)continue;if(h.accessor.type!=="SCALAR"||![5121,5123,5125].includes(h.accessor.componentType)||h.accessor.normalized){t(`${u} indices require unnormalized unsigned SCALAR data`);continue}let m=n.get(c.indices);if(m===void 0){m=0;for(let b=0;b<h.accessor.count;b++)m=Math.max(m,Xt(h,b,0));n.set(c.indices,m)}l.some(b=>m>=b)&&t(`${u} index ${m} is outside its vertex attribute counts`)}}function WC(r,e,t,n){let s=r.accessor,i=s.componentType===5126&&!s.normalized,o=[5121,5123].includes(s.componentType)&&s.normalized===!0,a=s.normalized===void 0||typeof s.normalized=="boolean",c=e==="NORMAL"?s.type==="VEC3"&&i:e==="TANGENT"?s.type==="VEC4"&&i:e==="JOINTS"?s.type==="VEC4"&&[5121,5123].includes(s.componentType)&&!s.normalized:e==="COLOR"?["VEC3","VEC4"].includes(s.type)&&(i||o):s.type===(e==="TEXCOORD"?"VEC2":"VEC4")&&(i||o);if(!a||!c){n(`${t} has incompatible core attribute shape, component type, or normalization`);return}for(let u=0;u<s.count;u++){let l=Array.from({length:r.rows},(f,d)=>Xt(r,u,d));if(l.some(f=>!Number.isFinite(f))||["NORMAL","TANGENT"].includes(e)&&Math.abs(Math.hypot(...l.slice(0,3))-1)>1e-5||e==="TANGENT"&&l[3]!==1&&l[3]!==-1||["COLOR","WEIGHTS"].includes(e)&&i&&l.some(f=>f<0||f>1)){n(`${t} requires finite core values, unit directions, tangent handedness \xB11, and colors/weights in [0, 1]`);return}}}var FE=p(()=>{"use strict";pu()});function OE(r,e,t){let n=new Map,s=new Set,i=[],o=(f,d)=>{let h=n.get(f);return h===void 0&&(h=hu(r,f),n.set(f,h)),typeof h=="string"?(s.has(f)||(s.add(f),e(`${d}: ${h}`)),null):h},a=new Set;for(let f of r.json.meshes||[])for(let d of f.primitives)d.attributes.POSITION!==void 0&&a.add(d.attributes.POSITION);for(let f of a){let d=o(f,`POSITION accessor ${f}`);if(d){if(!Ed(d,"VEC3")){e(`POSITION accessor ${f} requires unnormalized FLOAT VEC3 data`);continue}u(d,f)}}l(),c(),$C(r,o,e),BE(r,o,e);for(let f of i)f();function c(){for(let[f,d]of(r.json.skins||[]).entries()){if(d.inverseBindMatrices===void 0)continue;let h=`skin ${f} inverse-bind matrices`,m=o(d.inverseBindMatrices,h);if(m){if(!Ed(m,"MAT4")||m.accessor.count<(d.joints?.length||0)){e(`${h} require FLOAT MAT4 data with at least one matrix per joint`);continue}for(let b=0;b<m.accessor.count;b++){let g=Array.from({length:16},(y,x)=>Xt(m,b,x));if(g.some(y=>!Number.isFinite(y))||g[3]!==0||g[7]!==0||g[11]!==0||g[15]!==1){e(`${h} require finite affine matrices`);break}}}}}function u(f,d){let h=new Array(f.rows).fill(1/0),m=new Array(f.rows).fill(-1/0);for(let b=0;b<f.accessor.count;b++)for(let g=0;g<f.rows;g++){let y=Xt(f,b,g);if(!Number.isFinite(y))return e(`accessor ${d} non-finite values cannot supply required bounds`),!1;h[g]=Math.min(h[g],y),m[g]=Math.max(m[g],y)}return(JSON.stringify(f.accessor.min)!==JSON.stringify(h)||JSON.stringify(f.accessor.max)!==JSON.stringify(m))&&i.push(()=>{f.accessor.min=h,f.accessor.max=m,t(`Calculated required bounds for accessor ${d}.`)}),!0}function l(){let f=new Set,d=new Set;for(let[h,m]of(r.json.animations||[]).entries()){let b=new Set;(!m.samplers.length||!m.channels?.length)&&e(`animation ${h} requires samplers and channels`);for(let[g,y]of m.samplers.entries()){let x=`animation ${h} sampler ${g}`;if(["LINEAR","STEP"].includes(y.interpolation??"LINEAR")||e(`${x} unsupported interpolation ${y.interpolation}`),!f.has(y.input)){f.add(y.input);let T=o(y.input,`${x} input`);if(T)if(!Ed(T,"SCALAR"))e(`${x} time input requires unnormalized FLOAT SCALAR data`);else{let _=-1/0,v=!0;for(let I=0;I<T.accessor.count;I++){let N=Xt(T,I,0);(!Number.isFinite(N)||N<0||N<=_)&&(v=!1),_=N}v?u(T,y.input):e(`${x} times must be finite, nonnegative, and strictly increasing`)}}}for(let[g,y]of(m.channels||[]).entries()){let x=`animation ${h} channel ${g}`,T=Number.isSafeInteger(y.sampler)?m.samplers[y.sampler]:void 0,_=y.target,v=Number.isSafeInteger(_?.node)?r.json.nodes?.[_.node]:void 0;if(!T||!v||!["translation","rotation","scale"].includes(_?.path)){e(`${x} invalid sampler, node, or TRS target`);continue}v.matrix!==void 0&&e(`${x} matrix node requires TRS decomposition`);let I=`${_.node}:${_.path}`;if(b.has(I)&&e(`${x} duplicate node/path target`),b.add(I),!["LINEAR","STEP"].includes(T.interpolation??"LINEAR"))continue;let N=r.json.accessors?.[T.input],K=o(T.output,`${x} output`);if(!K)continue;if(!Ed(K,_.path==="rotation"?"VEC4":"VEC3")||K.accessor.count!==N?.count){e(`${x} output shape, type, or count does not match its target and keys`);continue}let ne=`${T.output}:${_.path}`;if(!d.has(ne)){d.add(ne);for(let be=0;be<K.accessor.count;be++){let Re=Array.from({length:K.rows},(ke,ue)=>Xt(K,be,ue));if(Re.some(ke=>!Number.isFinite(ke))||_.path==="rotation"&&Math.abs(Math.hypot(...Re)-1)>1e-5){e(`${x} output requires finite values and unit rotation quaternions`);break}}}}}}}function Ed(r,e){return r.accessor.componentType===5126&&!r.accessor.normalized&&r.accessor.type===e}function $C(r,e,t){let n=new Set;for(let s of r.json.nodes||[]){let i=r.json.skins?.[s.skin],o=r.json.meshes?.[s.mesh];if(!Array.isArray(i?.joints)||!i.joints.length||!o)continue;let a=`${s.mesh}:${s.skin}`;if(!n.has(a)){n.add(a);for(let[c,u]of o.primitives.entries()){let l=`mesh ${s.mesh} primitive ${c} skin ${s.skin}`,f=Object.keys(u.attributes).filter(b=>/^JOINTS_\d+$/.test(b)).map(b=>Number(b.slice(7))).sort((b,g)=>b-g),d=Object.keys(u.attributes).filter(b=>/^WEIGHTS_\d+$/.test(b)).map(b=>Number(b.slice(8))).sort((b,g)=>b-g);if(!f.length&&!d.length){t(`${l} requires JOINTS_0 and WEIGHTS_0 skin influences`);continue}if(JSON.stringify(f)!==JSON.stringify(d)||f.some((b,g)=>b!==g)){t(`${l} requires matching contiguous joint/weight sets starting at zero`);continue}let h=r.json.accessors?.[u.attributes.POSITION]?.count,m=f.map(b=>({joints:e(u.attributes[`JOINTS_${b}`],`${l} joint set ${b}`),weights:e(u.attributes[`WEIGHTS_${b}`],`${l} weight set ${b}`)}));if(!m.some(({joints:b,weights:g})=>!b||!g)){if(m.some(({joints:b,weights:g})=>b.accessor.type!=="VEC4"||g.accessor.type!=="VEC4"||![5121,5123].includes(b.accessor.componentType)||b.accessor.normalized||!(g.accessor.componentType===5126&&!g.accessor.normalized||[5121,5123].includes(g.accessor.componentType)&&g.accessor.normalized)||b.accessor.count!==g.accessor.count||h!==void 0&&b.accessor.count!==h||b.accessor.count!==m[0].joints.accessor.count)){t(`${l} incompatible influence accessor types or vertex counts`);continue}for(let b=0;b<m[0].joints.accessor.count;b++){let g=0,y=0,x=!0,T=new Set;for(let{joints:_,weights:v}of m){let I=v.accessor.normalized?v.accessor.componentType===5121?255:65535:1;for(let N=0;N<4;N++){let K=Xt(_,b,N),ne=Xt(v,b,N)/I;(K>=i.joints.length||!Number.isFinite(ne)||ne<0||ne>1)&&(x=!1),ne>0&&(T.has(K)&&(x=!1),T.add(K),y++),g+=ne}}if(!x||Math.abs(g-1)>2e-7*Math.max(y,1)){t(`${l} invalid palette index, repeated weighted joint, or weights not summing to one at vertex ${b}`);break}}}}}}}var ME=p(()=>{"use strict";pu();FE()});function DE(r,e,t,n){let s=new Map,i=new Map,o=new Map;for(let[c,u]of(r.json.buffers||[]).entries()){let l=`buffer ${c}`,f=r.buffers[c],d=!!(f&&f.arrayBuffer instanceof ArrayBuffer&&Number.isSafeInteger(f.byteOffset)&&f.byteOffset>=0&&Number.isSafeInteger(f.byteLength)&&f.byteLength>=0&&Number.isSafeInteger(f.byteOffset+f.byteLength)&&f.byteOffset+f.byteLength<=f.arrayBuffer.byteLength);f&&!d&&t(`${l} invalid borrowed payload span`);let h=u.byteLength;if(h===void 0&&e.has(c)&&!u.extensions&&d&&f.byteLength>0&&(h=f.byteLength,i.set(c,h)),!Number.isSafeInteger(h)||h<1){t(`${l} requires a positive byteLength; missing lengths require unambiguous loaded URI data`);continue}s.set(c,h),d&&f.byteLength<h&&t(`${l} declared byteLength exceeds its loaded payload`)}let a=Oy(r.json);for(let[c,u]of(r.json.bufferViews||[]).entries()){let l=u.byteOffset===void 0?0:u.byteOffset,f=s.get(u.buffer),d=u.byteLength===void 0&&!a&&f!==void 0?qC(r,c,s):u.byteLength;u.byteLength===void 0&&d!==void 0&&o.set(c,d),(!Number.isSafeInteger(u.buffer)||u.buffer<0||f===void 0||!Number.isSafeInteger(l)||l<0||!Number.isSafeInteger(d)||(d??0)<1||!Number.isSafeInteger(l+(d??0))||l+(d??0)>f)&&t(`bufferView ${c} requires a valid buffer reference and contained positive byte span`)}for(let[c,u]of o)r.json.bufferViews[c].byteLength=u,n(`Inferred bufferView ${c} byteLength from its dense accessor spans.`);for(let[c,u]of i)r.json.buffers[c].byteLength=u,n(`Inferred buffer ${c} byteLength from its loaded URI payload.`)}function qC(r,e,t){let n=r.json.bufferViews[e];if(n.byteOffset!==void 0&&(!Number.isSafeInteger(n.byteOffset)||n.byteOffset<0)||n.byteStride!==void 0&&(!Number.isSafeInteger(n.byteStride)||n.byteStride<0)||r.json.images?.some(a=>a.bufferView===e)||r.json.accessors?.some(a=>!!a.sparse))return;let s=t.get(n.buffer)-(n.byteOffset??0),i={...r,json:{...r.json,buffers:r.json.buffers.map((a,c)=>({...a,byteLength:t.get(c)})),bufferViews:r.json.bufferViews.map((a,c)=>c===e?{...a,byteLength:s}:a)}},o=0;for(let[a,c]of(r.json.accessors||[]).entries()){if(c.bufferView!==e)continue;let u=c;for(let d of[u.byteOffset,u.byteStride])if(d!==void 0&&(!Number.isSafeInteger(d)||d<0))return;let l=hu(i,a);if(typeof l=="string")return;let f=(c.byteOffset??0)+(c.count-1)*l.byteStride+l.rows*l.columns*l.componentSize;o=Math.max(o,f)}return o>0?o:void 0}var RE=p(()=>{"use strict";pu()});function kE(r,e,t){let n=new Map;for(let i of r.animations||[])for(let o of i.channels||[]){let a=o.target?.node;if(!Number.isSafeInteger(a))continue;let c=n.get(a)||new Set;c.add(o.target.path),n.set(a,c)}let s=[];for(let[i,o]of n){let a=r.nodes?.[i];if(a?.matrix===void 0)continue;let c=`animated matrix node ${i}`;if(o.size!==1||!o.has("translation")){e(`${c} rotation or scale animation requires an unambiguous TRS basis`);continue}if(a.translation!==void 0||a.rotation!==void 0||a.scale!==void 0||a.extensions!==void 0){e(`${c} has conflicting TRS fields or opaque extensions`);continue}let u=KC(a.matrix);if(!u){e(`${c} requires a finite affine, nonsingular matrix without shear`);continue}s.push(()=>{Object.assign(a,u),delete a.matrix,t(`Decomposed translation-only animated matrix node ${i}, preserving its linear transform.`)})}for(let i of s)i()}function KC(r){if(!Array.isArray(r)||r.length!==16||Array.from(r).some(a=>!Number.isFinite(a))||r[3]!==0||r[7]!==0||r[11]!==0||r[15]!==1)return null;let e=[0,1,2].map(a=>Math.hypot(...r.slice(a*4,a*4+3)));if(e.some(a=>!Number.isFinite(a)||a===0))return null;let t=e.map((a,c)=>r.slice(c*4,c*4+3).map(u=>u/a));for(let a=0;a<3;a++)for(let c=a+1;c<3;c++)if(Math.abs(t[a].reduce((u,l,f)=>u+l*t[c][f],0))>1e-6)return null;let n=t[0][0]*(t[1][1]*t[2][2]-t[1][2]*t[2][1])-t[1][0]*(t[0][1]*t[2][2]-t[0][2]*t[2][1])+t[2][0]*(t[0][1]*t[1][2]-t[0][2]*t[1][1]);if(Math.abs(Math.abs(n)-1)>1e-6)return null;n<0&&(e[0]=-e[0],t[0]=t[0].map(a=>-a));let s=Array.from(new Gc().fromMatrix3(t.flat()).normalize()),i=r.slice(12,15),o=new Qs().translate(i).multiplyRight(new Qs().fromQuaternion(s)).scale(e);return Array.from(o).some((a,c)=>!Number.isFinite(a)||Math.abs(a-r[c])>1e-6*Math.max(1,Math.abs(r[c])))?null:{translation:i,rotation:s,scale:e}}var NE=p(()=>{"use strict";Uf()});function VE(r,e,t){let n=new Set,s=r.extensionsRequired?.includes(qr)||!1;for(let[o,a]of(r.materials||[]).entries()){let c=a,u=a.extensions?.[qr];if(u===void 0){XC(c,r,e,t);continue}zE(c,u);let l=`material ${o}`;if(!pr(u)||typeof u.technique!="string"||!["CONSTANT","LAMBERT","PHONG","BLINN"].includes(u.technique)){e(`${l} unknown ${qr} technique`);continue}if(u.values!==void 0&&!pr(u.values)){e(`${l} common material values must be an object`);continue}let f=u.values||{},d=Object.keys(u).filter(I=>!["technique","values","doubleSided","transparent","jointCount"].includes(I)),h=Object.keys(f).filter(I=>!["ambient","diffuse","emission","specular","shininess","transparency","doubleSided","transparent"].includes(I));(d.length||h.length)&&e(`${l} unrecognized common material fields ${[...d,...h].join(", ")}`),u.jointCount!==void 0&&(!Number.isSafeInteger(u.jointCount)||Number(u.jointCount)<0)&&e(`${l} invalid common material jointCount`);let m=CE(f.emission,r,`${l} emission`,e),b=u.technique==="CONSTANT",g=b?m:CE(f.diffuse,r,`${l} diffuse`,e),y=f.transparency===void 0?1:f.transparency,x=typeof y=="number"&&Number.isFinite(y)&&y>=0&&y<=1;x||e(`${l} common material transparency must be in [0, 1]`);let T=UE(u,f,"transparent",l,e),_=UE(u,f,"doubleSided",l,e);f.ambient!==void 0&&!PE(f.ambient)&&e(`${l} ambient lighting`),["PHONG","BLINN"].includes(String(u.technique))&&(f.specular!==void 0&&!PE(f.specular)&&e(`${l} specular/shininess lighting`),f.shininess!==void 0&&(typeof f.shininess!="number"||!Number.isFinite(f.shininess)||f.shininess<0)&&e(`${l} invalid common material shininess`)),a.pbrMetallicRoughness||={};let v=a.pbrMetallicRoughness;if(v.metallicFactor??=0,v.roughnessFactor??=1,g){let I=[...g.factor];I[3]*=x?y:1,v.baseColorFactor??=I,g.texture&&(v.baseColorTexture??=g.texture)}a.doubleSided??=_,a.alphaMode??=T?"BLEND":"OPAQUE",b?(a.extensions[Ry]??={},HC(r,Ry,s),t(`Converted ${l} CONSTANT emission to an unlit material.`)):(m&&(a.emissiveFactor??=m.factor.slice(0,3),m.texture&&(a.emissiveTexture??=m.texture)),t(`Approximated ${l} ${String(u.technique)} lighting with rough non-metallic PBR factors.`)),typeof c.technique=="string"?n.add(c.technique):c.technique!==void 0&&e(`${l} invalid fallback technique ID`),delete c.technique,delete c.values,delete a.extensions[qr],Object.keys(a.extensions).length||delete a.extensions}let i=WE(r);return(r.extensions?.[qr]!==void 0||(r.nodes||[]).some(o=>o.extensions?.[qr]!==void 0))&&e(`${qr} lights or scene payloads`),i.has(qr)||(r.extensionsUsed=r.extensionsUsed?.filter(o=>o!==qr),r.extensionsRequired=r.extensionsRequired?.filter(o=>o!==qr)),n}function jE(r,e){if(!e.size||[...WE(r)].some(c=>![qr,Ry].includes(c))||(r.materials||[]).some(c=>c.technique!==void 0||c.values!==void 0))return!1;let t=r;if(["techniques","programs","shaders"].some(c=>t[c]!==void 0&&!pr(t[c])))return!1;let n=pr(t.techniques)?t.techniques:{},s=pr(t.programs)?t.programs:{},i=pr(t.shaders)?t.shaders:{},o=new Set,a=new Set;if(Object.keys(n).some(c=>!e.has(c)))return!1;for(let c of Object.values(n))pr(c)&&typeof c.program=="string"&&o.add(c.program);if(Object.keys(s).some(c=>!o.has(c)))return!1;for(let c of Object.values(s))if(pr(c))for(let u of["vertexShader","fragmentShader"])typeof c[u]=="string"&&a.add(c[u]);return Object.keys(i).every(c=>a.has(c))}function XC(r,e,t,n){zE(r);let s=pr(r.values)?r.values:{},i=s.tex||s.texture2d_0||s.diffuseTex||s.diffuse,o=GE(e,i),a=ky(s.diffuse)?s.diffuse:void 0;if(o!==-1||a){let c=a?[...a]:[1,1,1,1],u=s.transparency;typeof u=="number"&&u>=0&&u<=1&&(c[3]*=u),r.pbrMetallicRoughness||={},r.pbrMetallicRoughness.metallicFactor??=0,r.pbrMetallicRoughness.roughnessFactor??=1,r.pbrMetallicRoughness.baseColorFactor??=c,o!==-1&&(r.pbrMetallicRoughness.baseColorTexture??={index:o}),r.pbrMetallicRoughness.baseColorFactor[3]<1&&(r.alphaMode||="BLEND"),n("Approximated glTF v1 diffuse material values with PBR material factors.")}(r.technique||r.values)&&t(`material technique ${r.technique||"<unnamed>"}`)}function CE(r,e,t,n){if(r===void 0)return{factor:[0,0,0,1]};if(ky(r))return{factor:[...r]};let s=GE(e,r);return s!==-1?{factor:[1,1,1,1],texture:{index:s}}:(n(`${t} requires an RGBA factor in [0, 1] or a resolved texture ID`),null)}function GE(r,e){return typeof e!="string"?-1:(r.textures||[]).findIndex(t=>t.id===e)}function UE(r,e,t,n,s){r[t]!==void 0&&e[t]!==void 0&&r[t]!==e[t]&&s(`${n} conflicting common material ${t}`);let i=e[t]!==void 0?e[t]:r[t]!==void 0?r[t]:!1;return typeof i=="boolean"?i:(s(`${n} common material ${t} must be boolean`),!1)}function zE(r,e){let t=pr(r.extras)?r.extras:r.extras===void 0?{}:{originalExtras:r.extras},n=pr(t.gltf1)?t.gltf1:t.gltf1===void 0?{}:{originalExtras:t.gltf1},s={technique:r.technique,values:r.values,...e===void 0?{}:{commonMaterial:e}},i=Object.keys(s).some(o=>Object.hasOwn(n,o));r.extras={...t,gltf1:{...n,...s,...i?{originalExtras:n}:{}}}}function HC(r,e,t){r.extensionsUsed=[...new Set([...r.extensionsUsed||[],e])],t&&(r.extensionsRequired=[...new Set([...r.extensionsRequired||[],e])])}function WE(r){let e=new Set,t=[r],n=new Set;for(;t.length;){let s=t.pop();if(!(!s||typeof s!="object"||n.has(s))){if(n.add(s),pr(s)&&pr(s.extensions))for(let i of Object.keys(s.extensions))e.add(i);for(let[i,o]of Object.entries(s))i!=="extras"&&t.push(o)}}return e}function ky(r){return Array.isArray(r)&&r.length===4&&r.every(e=>typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1)}function PE(r){return ky(r)&&r.slice(0,3).every(e=>e===0)}function pr(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}var qr,Ry,$E=p(()=>{"use strict";qr="KHR_materials_common",Ry="KHR_materials_unlit"});function qE(r,e={}){let t=new Cy;return t.normalize(r,e,!0),()=>t.finishNormalization(r)}var Ny,JC,Cy,KE=p(()=>{"use strict";cE();fE();hE();bE();pu();_E();vE();SE();LE();ME();RE();NE();$E();Ny={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",cameras:"camera",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},JC={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",camera:"cameras",inverseBindMatrices:"accessors",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Cy=class r{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;report={converted:!1,mutated:!1,unsupported:[],warnings:[]};strict=!1;log;finished=!1;pendingAccessors=new Set;accessorConversions=new Map;uriBufferIndices=new Set;normalize(e,t={},n=!1){if(t.mutate===!1){let o={...e,json:JSON.parse(JSON.stringify(e.json))},a=new r().normalize(o,{...t,mutate:!0});return a.mutated=!1,a}this.strict=t.normalize==="strict",this.log=t.log,this.json=e.json;let s=e.json;switch(s.asset&&s.asset.version){case"2.0":case"2.1":return this.report;case void 0:case"1.0":break;default:return this._warning(`Unknown glTF version ${s.asset.version}`),this.report}if(!t.normalize)throw new Error("glTF v1 is not supported.");this.report.converted=!0,this.report.mutated=!0,this.log?.log(1,"glTF: Converting glTF v1 to glTF v2 using experimental normalization.")(),this._addAsset(s),this._orderBinaryBufferPayloads(e),this._convertTopLevelObjectsToArrays(s),aE(e),this._convertObjectIdsToArrayIndices(s),this._updateObjects(s);for(let[o,a]of(s.buffers||[]).entries())typeof a.uri=="string"&&this.uriBufferIndices.add(o);let i=VE(s,o=>this._unsupported(o),o=>this._warning(o));return AE(s,(o,a)=>this._convertIdToIndex(o,a),o=>this._unsupported(o)),EE(s,o=>this._unsupported(o)),kE(s,o=>this._unsupported(o),o=>this._warning(o)),TE(s,o=>this._unsupported(o)),this.accessorConversions=yE(s),lE(s,o=>this.pendingAccessors.add(o)),dE(s,o=>this._convertIdToIndex(o,"node"),o=>this._unsupported(o)),this._updateNodes(s),IE(s,o=>this._unsupported(o),o=>this._warning(o)),this._preserveLegacyResources(s,i),this._removeEmptyCollections(s),n?this.report:this.finishNormalization(e)}finishNormalization(e){return this.report.converted&&!this.finished&&(DE(e,this.uriBufferIndices,t=>this._unsupported(t),t=>this._warning(t)),wE(e,this.accessorConversions,this.pendingAccessors,t=>this._unsupported(t),t=>this._warning(t)),pE(e,t=>this._unsupported(t)),OE(e,t=>this._unsupported(t),t=>this._warning(t)),this._finishReport(),this.log?.log(1,`glTF: Completed glTF v1 normalization (${this.report.unsupported.length} unsupported features).`)(),this.finished=!0),this.report}_unsupported(e){if(this.report.unsupported.push(e),this.log?.warn(`glTF v1 normalization does not support ${e}`)(),this.strict)throw new Error(`glTF v1 normalization does not support ${e}`)}_warning(e){this.report.warnings.push(e),this.log?.warn(`glTF: ${e}`)()}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_orderBinaryBufferPayloads(e){let t=this.json.buffers;if(!t||Array.isArray(t)||!t.binary_glTF)return;let s=Object.keys(t).indexOf("binary_glTF");s>0&&e.buffers?.length&&(e.buffers=[e.buffers[s],...e.buffers.filter((i,o)=>o!==s)])}_convertTopLevelObjectsToArrays(e){for(let t in Ny)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){let n=e[t];if(!n||Array.isArray(n))return;e[t]=[];let s=Object.keys(n),i=t==="buffers"&&s.includes("binary_glTF")?["binary_glTF",...s.filter(o=>o!=="binary_glTF")]:s;for(let o of i){let a=n[o];a.id=a.id||o;let c=e[t].length;e[t].push(a),this.idToIndexMap[t][o]=c}}_convertObjectIdsToArrayIndices(e){for(let t in Ny)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(let t of e.textures)this._convertTextureIds(t);for(let t of e.meshes)this._convertMeshIds(t);for(let t of e.nodes)this._convertNodeIds(t);for(let t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(let t of e.primitives){let{attributes:n,indices:s,material:i}=t,o=new Map;for(let a in n){let c=Dy(a),u=o.get(c);if(u!==void 0&&n[u]!==n[a])throw new Error(`glTF v1: conflicting attribute aliases ${u} and ${a}`);o.set(c,a)}t.attributes=Object.fromEntries(Object.entries(n).map(([a,c])=>[Dy(a),this._convertIdToIndex(c,"accessor")])),s&&(t.indices=this._convertIdToIndex(s,"accessor")),i&&(t.material=this._convertIdToIndex(i,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(e[t]=[]);for(let n of e[t])for(let s in n){let i=n[s],o=this._convertIdToIndex(i,s);n[s]=o}}_convertIdToIndex(e,t){let n=JC[t];if(n in this.idToIndexMap){let s=this.idToIndexMap[n][e];if(!Number.isFinite(s))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return s}return e}_updateObjects(e){for(let t of this.json.buffers)delete t.type}_updateNodes(e){let t=e.nodes||[];for(let n=0;n<t.length;n++){let s=t[n];if(!Array.isArray(s.meshes))continue;let i=s.meshes;delete s.meshes,s.mesh=i.shift();for(let o of i){let a={...s,mesh:o,children:void 0};delete a.id,delete a.matrix,delete a.translation,delete a.rotation,delete a.scale,t.push(a),s.children||=[],s.children.push(t.length-1)}}}_preserveLegacyResources(e,t){let n=jE(e,t),s={};for(let i of["techniques","programs","shaders"])e[i]&&(s[i]=e[i],delete e[i],n||this._unsupported(`legacy ${i}`));Object.keys(s).length&&(e.extras={...e.extras,gltf1Resources:s},n&&this._warning("Preserved shader resources overridden by converted common materials."))}_removeEmptyCollections(e){for(let t of e.nodes||[])Array.isArray(t.children)&&t.children.length===0&&delete t.children;for(let t of e.scenes||[])Array.isArray(t.nodes)&&t.nodes.length===0&&delete t.nodes;for(let t of[...Object.keys(Ny),"extensionsUsed","extensionsRequired"])Array.isArray(e[t])&&e[t].length===0&&delete e[t]}_finishReport(){this.report.unsupported.length&&this.report.warnings.push(`Converted glTF v1 with unsupported features: ${this.report.unsupported.join(", ")}`)}}});function YC(r,e){let t=r.basis;return{...r,core:{...r.core,mimeType:e},basis:{...t,format:t?.format||"auto"}}}async function XE(r,e,t=0,n,s){return await HE(r,e,t,n,s)}async function HE(r,e,t,n,s,i){QC(r,e,t,n);let o=qE(r,{normalize:n?.gltf?.normalize,log:n?.core?.log});return await nE(r,n,s),n?.gltf?.loadBuffers&&r.json.buffers&&await a3(r,n,s,n.gltf.loadBufferIndices),o(),n?.gltf?.loadFiles&&r.json.files&&await o3(r,n,s),n?.gltf?.loadExternalAssets&&r.json.externalAssets&&await e3(r,n,s,i),n?.gltf?.loadImages&&await c3(r,n,s),await sE(r,n,s),r}function QC(r,e,t,n){if(n.core?.baseUrl&&(r.baseUri=n.core?.baseUrl),e instanceof ArrayBuffer&&!PI(e,t,n.glb)&&(e=new TextDecoder().decode(e)),typeof e=="string")r.json=sb(e);else if(e instanceof ArrayBuffer){let l={};t=ad(l,e,t,n.glb),H(l.type==="glTF",`Invalid GLB magic string ${l.type}`),r._glb=l,r.json=l.json}else e&&typeof e=="object"?r.json=e:H(!1,"GLTF: must be ArrayBuffer, string, or parsed JSON object");let s=r.json.buffers||[],i=Array.isArray(s)?s:[],o=Array.isArray(s)?[]:Object.keys(s);if(r.buffers=new Array(Array.isArray(s)?s.length:o.length).fill(null),r._glb){let{binChunks:l}=r._glb;for(let g=0;g<i.length;g++){let y=i[g];if(y.chunk===void 0)continue;H(r._glb.version===3,"glTF buffer.chunk requires a GLB v3 container."),H(y.uri===void 0,`glTF buffer ${g} cannot define both uri and chunk.`);let x=l.find(T=>T.chunkIndex===y.chunk);H(x,`glTF buffer ${g} references missing GLB BIN chunk ${y.chunk}.`),H(y.byteLength<=x.byteLength,`glTF buffer ${g} is larger than GLB BIN chunk ${y.chunk}.`),r.buffers[g]={arrayBuffer:x.arrayBuffer,byteOffset:x.byteOffset,byteLength:y.byteLength}}let f=i.map((g,y)=>g.uri===void 0?y:-1).filter(g=>g!==-1),d=l.find(g=>g.chunkIndex===1),h=r._glb.version<3||r._glb.jsonChunkIndex===0&&i[0]?.chunk===void 0&&f.length===1&&f[0]===0&&!!d,m=r._glb.version<3?l[0]:d,b=r._glb.version===1&&!Array.isArray(s)?o.indexOf("binary_glTF"):0;if(h&&m&&b>=0&&(r.buffers[b]={arrayBuffer:m.arrayBuffer,byteOffset:m.byteOffset,byteLength:m.byteLength}),r._glb.version===3)for(let g of f)H(r.buffers[g],`glTF buffer ${g} without a uri must define a valid GLB v3 chunk.`)}if(!r._glb){let l=i.findIndex(f=>f.chunk!==void 0);H(l===-1,`glTF buffer ${l} uses chunk outside a GLB.`)}let a=r.json.images||[];r.images=new Array(a.length).fill({});let c=r.json.files||[];r.files=new Array(c.length).fill(null);let u=r.json.externalAssets||[];r.externalAssets=new Array(u.length).fill(null)}async function e3(r,e,t,n){let s=r.json.externalAssets||[],i=new Set;for(let a of r.json.nodes||[])a.externalAsset!==void 0&&(H(a.externalAsset>=0&&a.externalAsset<s.length,`glTF node references missing external asset ${a.externalAsset}.`),i.add(a.externalAsset));let o=n||r3(t.url?new Set([cd(t.url)]):new Set);for(let a of i)await t3(r,a,e,t,o)}async function t3(r,e,t,n,s){let i=r.json.externalAssets?.[e];if(!i)throw new Error(`Missing glTF external asset ${e}.`);H(Number.isInteger(i.file)&&i.file>=0&&i.file<(r.json.files?.length||0),`glTF external asset ${e} references missing file ${i.file}.`);let o=await fd(r,i.file,t,n),a=o.url;H(!a||!s.ancestors.has(a),`glTF external asset cycle detected at ${a}.`);let c=a?s.cache.get(a):void 0;if(!c){let u=n3(r,o,t,n,s),l={...s,ancestors:new Set(s.ancestors)};a&&l.ancestors.add(a);let f=eo(o.arrayBuffer,o.byteOffset,o.byteLength);c=HE({},f,0,t,u,l),a&&s.cache.set(a,c)}r.externalAssets=r.externalAssets||[],r.externalAssets[e]=await c}function r3(r){return{cache:new Map,ancestors:r,packageIds:{next:0}}}function n3(r,e,t,n,s){if(e.url&&!e.url.startsWith("data:"))return{...n,url:e.url,filename:i3(e.url),baseUrl:s3(e.url)};let i=`${ZC}${s.packageIds.next++}`,o=`${i}/`;return{...n,url:e.name,filename:e.name,baseUrl:i,fetch:async(a,c)=>{let u=a;if(u.startsWith("data:"))return await n.fetch(a,c);let l=u.startsWith(o)?u.slice(o.length):u,f=wg(r,l);H(f>=0,`glTF package does not contain file ${l}.`);let d=await fd(r,f,t,n),h=eo(d.arrayBuffer,d.byteOffset,d.byteLength);return new Response(h,{headers:{"content-type":d.mimeType}})}}}function s3(r){let e=r.lastIndexOf("/");return e>=0?r.slice(0,e):""}function i3(r){let e=r.lastIndexOf("/");return e>=0?r.slice(e+1):r}async function o3(r,e,t){let n=r.json.files||[];await Promise.all(n.map((s,i)=>fd(r,i,e,t)))}async function a3(r,e,t,n){let s=r.json.buffers||[],i=n?new Set(typeof n=="function"?n(r.json):n):void 0;for(let o=0;o<s.length;++o){if(i&&!i.has(o))continue;let a=s[o];if(a.uri){let{fetch:c}=t;H(c);let u=Kn(a.uri,e,t),f=await(await t?.fetch?.(u))?.arrayBuffer?.();r.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete a.uri}else r.buffers[o]===null&&(r.buffers[o]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}async function c3(r,e,t){let n=u3(r),s=r.json.images||[],i=[];for(let o of n)i.push(l3(r,s[o],o,e,t));return await Promise.all(i)}function u3(r){let e=new Set;r.json.asset.thumbnail!==void 0&&e.add(r.json.asset.thumbnail);let t=r.json.textures||[];for(let n of t)n.source!==void 0&&e.add(n.source);return Array.from(e).sort()}async function l3(r,e,t,n,s){let i;if(e.uri&&!e.hasOwnProperty("bufferView")){let l=Kn(e.uri,n,s),{fetch:f}=s;i=await(await f(l)).arrayBuffer(),e.bufferView={data:i}}if(Number.isFinite(e.bufferView)){let l=hr(r.json,r.buffers,e.bufferView);i=eo(l.buffer,l.byteOffset,l.byteLength)}H(i,"glTF image has no data");let o=YC(n,e.mimeType),a=iu(s);if(!!(a&&!n.gltf?.excludeExtensions?.includes("MSFT_texture_dds")&&r.json.textures?.some(l=>l.source===t&&l.extensions?.MSFT_texture_dds?.source===t))){let l=await Xs(i,a,n,s);H(l.length>0,"MSFT_texture_dds parser returned no texture levels"),r.images=r.images||[],r.images[t]={compressed:!0,mipmaps:!0,width:l[0].width,height:l[0].height,data:l};return}let u=await Xs(i,[Hc,io],o,s);u&&u[0]&&(u={compressed:!0,mipmaps:!1,width:u[0].width,height:u[0].height,data:u[0]}),r.images=r.images||[],r.images[t]=u}var ZC,JE=p(()=>{"use strict";Ue();qn();qn();oo();bg();Yc();WI();ao();oE();oy();KE();ZC="gltf-package://"});async function YE(r,e={},t){let n={...Uy.options,...e};n.gltf={...Uy.options.gltf,...n.gltf};let s=e?.glb?.byteOffset||0;return await XE({},r,s,n,t)}var Rre,f3,Uy,QE=p(()=>{"use strict";JE();eL();({preload:Rre,...f3}=ZE),Uy={...f3,parse:YE}});var Py={};J(Py,{GLTFLoaderWithParser:()=>Uy,parse:()=>YE});var Vy=p(()=>{"use strict";QE()});async function d3(){let{GLTFLoaderWithParser:r}=await Promise.resolve().then(()=>(Vy(),Py));return r}var ZE,eL=p(()=>{"use strict";Zb();eg();ZE={dataType:null,batchType:null,...Uv,version:Yf,preload:d3,options:{gltf:{normalize:!0,loadBuffers:!0,loadFiles:!1,loadExternalAssets:!1,loadImages:!0,loadAudio:!0,decompressMeshes:!0}}}});async function m3(r,e){return tL(r,e)}function tL(r,e){let t={};return ad(t,r,e?.glb?.byteOffset||0,e?.glb),t}var Gre,h3,p3,rL=p(()=>{"use strict";bg();sL();({preload:Gre,...h3}=nL),p3={...h3,parse:m3,parseSync:tL}});var jy={};J(jy,{GLBLoaderWithParser:()=>p3});var Gy=p(()=>{"use strict";rL()});async function b3(){let{GLBLoaderWithParser:r}=await Promise.resolve().then(()=>(Gy(),jy));return r}var nL,sL=p(()=>{"use strict";Zb();eg();nL={dataType:null,batchType:null,...Pv,version:Yf,preload:b3,options:{glb:{strict:!1}}}});function g3(r){return typeof r=="string"?r.charAt(0).toLowerCase()+r.slice(1):r}function Ld(r){if(Array.isArray(r))return r.map(e=>Ld(e));if(r&&typeof r=="object"){let e={};for(let[t,n]of Object.entries(r))Object.defineProperty(e,g3(t),{value:Ld(n),enumerable:!0,configurable:!0,writable:!0});return e}return r}var iL=p(()=>{"use strict"});var oL,y3,w3,x3,bu,zy,T3,_3,gu,Wy,Sa,aL=p(()=>{"use strict";oL={ontext:()=>{},onprocessinginstruction:()=>{},onsgmldeclaration:()=>{},ondoctype:()=>{},oncomment:()=>{},onopentagstart:()=>{},onattribute:()=>{},onopentag:()=>{},onclosetag:()=>{},onopencdata:()=>{},oncdata:()=>{},onclosecdata:()=>{},onerror:()=>{},onend:()=>{},onready:()=>{},onscript:()=>{},onopennamespace:()=>{},onclosenamespace:()=>{}},y3={...oL,strict:!1,MAX_BUFFER_LENGTH:64*1024,lowercase:!1,lowercasetags:!1,noscript:!1,strictEntities:!1,preserveCase:!1,caseInsensitiveTags:!1,processEntities:!0,xmlns:void 0,position:void 0,trim:void 0,normalize:void 0},w3=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],x3=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"],bu=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,zy=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,T3=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_3=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,gu={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(gu).forEach(r=>{let e=gu[r];gu[r]=typeof e=="number"?String.fromCharCode(e):e});Wy=class r{EVENTS=w3;ENTITIES={...gu};XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};S=0;opt;trackPosition=!1;column=0;line=0;c="";error;q="";bufferCheckPosition;closed=!1;tags=[];looseCase="";closedRoot=!1;sawRoot=!1;strict=!1;tag;strictEntities;state;noscript=!1;attribList=[];ns;position=0;STATE={BEGIN:this.S++,BEGIN_WHITESPACE:this.S++,TEXT:this.S++,TEXT_ENTITY:this.S++,OPEN_WAKA:this.S++,SGML_DECL:this.S++,SGML_DECL_QUOTED:this.S++,DOCTYPE:this.S++,DOCTYPE_QUOTED:this.S++,DOCTYPE_DTD:this.S++,DOCTYPE_DTD_QUOTED:this.S++,COMMENT_STARTING:this.S++,COMMENT:this.S++,COMMENT_ENDING:this.S++,COMMENT_ENDED:this.S++,CDATA:this.S++,CDATA_ENDING:this.S++,CDATA_ENDING_2:this.S++,PROC_INST:this.S++,PROC_INST_BODY:this.S++,PROC_INST_ENDING:this.S++,OPEN_TAG:this.S++,OPEN_TAG_SLASH:this.S++,ATTRIB:this.S++,ATTRIB_NAME:this.S++,ATTRIB_NAME_SAW_WHITE:this.S++,ATTRIB_VALUE:this.S++,ATTRIB_VALUE_QUOTED:this.S++,ATTRIB_VALUE_CLOSED:this.S++,ATTRIB_VALUE_UNQUOTED:this.S++,ATTRIB_VALUE_ENTITY_Q:this.S++,ATTRIB_VALUE_ENTITY_U:this.S++,CLOSE_TAG:this.S++,CLOSE_TAG_SAW_WHITE:this.S++,SCRIPT:this.S++,SCRIPT_ENDING:this.S++};BUFFERS=x3;CDATA="[CDATA[";DOCTYPE="DOCTYPE";XML_NAMESPACE="http://www.w3.org/XML/1998/namespace";XMLNS_NAMESPACE="http://www.w3.org/2000/xmlns/";rootNS={xml:this.XML_NAMESPACE,xmlns:this.XMLNS_NAMESPACE};comment;sgmlDecl;textNode="";tagName;doctype;procInstName;procInstBody;entity="";attribName;attribValue;cdata="";script="";startTagPosition=0;constructor(){this.S=0;for(let e in this.STATE)this.STATE.hasOwnProperty(e)&&(this.STATE[this.STATE[e]]=e);this.S=this.STATE}static charAt(e,t){let n="";return t<e.length&&(n=e.charAt(t)),n}static isWhitespace(e){return e===" "||e===`
44
44
  `||e==="\r"||e===" "}static isQuote(e){return e==='"'||e==="'"}static isAttribEnd(e){return e===">"||r.isWhitespace(e)}static isMatch(e,t){return e.test(t)}static notMatch(e,t){return!r.isMatch(e,t)}static qname(e,t){let s=e.indexOf(":")<0?["",e]:e.split(":"),i=s[0],o=s[1];return t&&e==="xmlns"&&(i="xmlns",o=""),{prefix:i,local:o}}write(e){if(this.error)throw this.error;if(this.closed)return this.errorFunction("Cannot write after close. Assign an onready handler.");if(e===null)return this.end();typeof e=="object"&&(e=e.toString());let t=0,n;for(;n=r.charAt(e,t++),this.c=n,!!n;)switch(this.trackPosition&&(this.position++,n===`
45
45
  `?(this.line++,this.column=0):this.column++),this.state){case this.S.BEGIN:if(this.state=this.S.BEGIN_WHITESPACE,n==="\uFEFF")continue;this.beginWhiteSpace(n);continue;case this.S.BEGIN_WHITESPACE:this.beginWhiteSpace(n);continue;case this.S.TEXT:if(this.sawRoot&&!this.closedRoot){let o=t-1;for(;n&&n!=="<"&&n!=="&";)n=r.charAt(e,t++),n&&this.trackPosition&&(this.position++,n===`
46
46
  `?(this.line++,this.column=0):this.column++);this.textNode+=e.substring(o,t-1)}n==="<"&&!(this.sawRoot&&this.closedRoot&&!this.strict)?(this.state=this.S.OPEN_WAKA,this.startTagPosition=this.position):(!r.isWhitespace(n)&&(!this.sawRoot||this.closedRoot)&&this.strictFail("Text data outside of root node."),n==="&"?this.state=this.S.TEXT_ENTITY:this.textNode+=n);continue;case this.S.SCRIPT:n==="<"?this.state=this.S.SCRIPT_ENDING:this.script+=n;continue;case this.S.SCRIPT_ENDING:n==="/"?this.state=this.S.CLOSE_TAG:(this.script+=`<${n}`,this.state=this.S.SCRIPT);continue;case this.S.OPEN_WAKA:if(n==="!")this.state=this.S.SGML_DECL,this.sgmlDecl="";else if(!r.isWhitespace(n))if(r.isMatch(bu,n))this.state=this.S.OPEN_TAG,this.tagName=n;else if(n==="/")this.state=this.S.CLOSE_TAG,this.tagName="";else if(n==="?")this.state=this.S.PROC_INST,this.procInstName=this.procInstBody="";else{if(this.strictFail("Unencoded <"),this.startTagPosition+1<this.position){let o=this.position-this.startTagPosition;n=new Array(o).join(" ")+n}this.textNode+=`<${n}`,this.state=this.S.TEXT}continue;case this.S.SGML_DECL:(this.sgmlDecl+n).toUpperCase()===this.CDATA?(this.emitNode("onopencdata"),this.state=this.S.CDATA,this.sgmlDecl="",this.cdata=""):this.sgmlDecl+n==="--"?(this.state=this.S.COMMENT,this.comment="",this.sgmlDecl=""):(this.sgmlDecl+n).toUpperCase()===this.DOCTYPE?(this.state=this.S.DOCTYPE,(this.doctype||this.sawRoot)&&this.strictFail("Inappropriately located doctype declaration"),this.doctype="",this.sgmlDecl=""):n===">"?(this.emitNode("onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=this.S.TEXT):r.isQuote(n)?(this.state=this.S.SGML_DECL_QUOTED,this.sgmlDecl+=n):this.sgmlDecl+=n;continue;case this.S.SGML_DECL_QUOTED:n===this.q&&(this.state=this.S.SGML_DECL,this.q=""),this.sgmlDecl+=n;continue;case this.S.DOCTYPE:n===">"?(this.state=this.S.TEXT,this.emitNode("ondoctype",this.doctype),this.doctype=!0):(this.doctype+=n,n==="["?this.state=this.S.DOCTYPE_DTD:r.isQuote(n)&&(this.state=this.S.DOCTYPE_QUOTED,this.q=n));continue;case this.S.DOCTYPE_QUOTED:this.doctype+=n,n===this.q&&(this.q="",this.state=this.S.DOCTYPE);continue;case this.S.DOCTYPE_DTD:this.doctype+=n,n==="]"?this.state=this.S.DOCTYPE:r.isQuote(n)&&(this.state=this.S.DOCTYPE_DTD_QUOTED,this.q=n);continue;case this.S.DOCTYPE_DTD_QUOTED:this.doctype+=n,n===this.q&&(this.state=this.S.DOCTYPE_DTD,this.q="");continue;case this.S.COMMENT:n==="-"?this.state=this.S.COMMENT_ENDING:this.comment+=n;continue;case this.S.COMMENT_ENDING:n==="-"?(this.state=this.S.COMMENT_ENDED,this.comment=this.textApplyOptions(this.comment),this.comment&&this.emitNode("oncomment",this.comment),this.comment=""):(this.comment+=`-${n}`,this.state=this.S.COMMENT);continue;case this.S.COMMENT_ENDED:n!==">"?(this.strictFail("Malformed comment"),this.comment+=`--${n}`,this.state=this.S.COMMENT):this.state=this.S.TEXT;continue;case this.S.CDATA:n==="]"?this.state=this.S.CDATA_ENDING:this.cdata+=n;continue;case this.S.CDATA_ENDING:n==="]"?this.state=this.S.CDATA_ENDING_2:(this.cdata+=`]${n}`,this.state=this.S.CDATA);continue;case this.S.CDATA_ENDING_2:n===">"?(this.cdata&&this.emitNode("oncdata",this.cdata),this.emitNode("onclosecdata"),this.cdata="",this.state=this.S.TEXT):n==="]"?this.cdata+="]":(this.cdata+=`]]${n}`,this.state=this.S.CDATA);continue;case this.S.PROC_INST:n==="?"?this.state=this.S.PROC_INST_ENDING:r.isWhitespace(n)?this.state=this.S.PROC_INST_BODY:this.procInstName+=n;continue;case this.S.PROC_INST_BODY:if(!this.procInstBody&&r.isWhitespace(n))continue;n==="?"?this.state=this.S.PROC_INST_ENDING:this.procInstBody+=n;continue;case this.S.PROC_INST_ENDING:n===">"?(this.emitNode("onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=this.S.TEXT):(this.procInstBody+=`?${n}`,this.state=this.S.PROC_INST_BODY);continue;case this.S.OPEN_TAG:r.isMatch(zy,n)?this.tagName+=n:(this.newTag(),n===">"?this.openTag():n==="/"?this.state=this.S.OPEN_TAG_SLASH:(r.isWhitespace(n)||this.strictFail("Invalid character in tag name"),this.state=this.S.ATTRIB));continue;case this.S.OPEN_TAG_SLASH:n===">"?(this.openTag(!0),this.closeTag()):(this.strictFail("Forward-slash in opening tag not followed by >"),this.state=this.S.ATTRIB);continue;case this.S.ATTRIB:if(r.isWhitespace(n))continue;n===">"?this.openTag():n==="/"?this.state=this.S.OPEN_TAG_SLASH:r.isMatch(bu,n)?(this.attribName=n,this.attribValue="",this.state=this.S.ATTRIB_NAME):this.strictFail("Invalid attribute name");continue;case this.S.ATTRIB_NAME:n==="="?this.state=this.S.ATTRIB_VALUE:n===">"?(this.strictFail("Attribute without value"),this.attribValue=this.attribName,this.attrib(),this.openTag()):r.isWhitespace(n)?this.state=this.S.ATTRIB_NAME_SAW_WHITE:r.isMatch(zy,n)?this.attribName+=n:this.strictFail("Invalid attribute name");continue;case this.S.ATTRIB_NAME_SAW_WHITE:if(n==="=")this.state=this.S.ATTRIB_VALUE;else{if(r.isWhitespace(n))continue;this.strictFail("Attribute without value"),Object.defineProperty(this.tag.attributes,this.attribName,{value:"",enumerable:!0,configurable:!0,writable:!0}),this.attribValue="",this.emitNode("onattribute",{name:this.attribName,value:""}),this.attribName="",n===">"?this.openTag():r.isMatch(bu,n)?(this.attribName=n,this.state=this.S.ATTRIB_NAME):(this.strictFail("Invalid attribute name"),this.state=this.S.ATTRIB)}continue;case this.S.ATTRIB_VALUE:if(r.isWhitespace(n))continue;r.isQuote(n)?(this.q=n,this.state=this.S.ATTRIB_VALUE_QUOTED):(this.strictFail("Unquoted attribute value"),this.state=this.S.ATTRIB_VALUE_UNQUOTED,this.attribValue=n);continue;case this.S.ATTRIB_VALUE_QUOTED:if(n!==this.q){n==="&"?this.state=this.S.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=n;continue}this.attrib(),this.q="",this.state=this.S.ATTRIB_VALUE_CLOSED;continue;case this.S.ATTRIB_VALUE_CLOSED:r.isWhitespace(n)?this.state=this.S.ATTRIB:n===">"?this.openTag():n==="/"?this.state=this.S.OPEN_TAG_SLASH:r.isMatch(bu,n)?(this.strictFail("No whitespace between attributes"),this.attribName=n,this.attribValue="",this.state=this.S.ATTRIB_NAME):this.strictFail("Invalid attribute name");continue;case this.S.ATTRIB_VALUE_UNQUOTED:if(!r.isAttribEnd(n)){n==="&"?this.state=this.S.ATTRIB_VALUE_ENTITY_U:this.attribValue+=n;continue}this.attrib(),n===">"?this.openTag():this.state=this.S.ATTRIB;continue;case this.S.CLOSE_TAG:if(this.tagName)n===">"?this.closeTag():r.isMatch(zy,n)?this.tagName+=n:this.script?(this.script+=`</${this.tagName}`,this.tagName="",this.state=this.S.SCRIPT):(r.isWhitespace(n)||this.strictFail("Invalid tagname in closing tag"),this.state=this.S.CLOSE_TAG_SAW_WHITE);else{if(r.isWhitespace(n))continue;r.notMatch(bu,n)?this.script?(this.script+=`</${n}`,this.state=this.S.SCRIPT):this.strictFail("Invalid tagname in closing tag."):this.tagName=n}continue;case this.S.CLOSE_TAG_SAW_WHITE:if(r.isWhitespace(n))continue;n===">"?this.closeTag():this.strictFail("Invalid characters in closing tag");continue;case this.S.TEXT_ENTITY:case this.S.ATTRIB_VALUE_ENTITY_Q:case this.S.ATTRIB_VALUE_ENTITY_U:let s,i;switch(this.state){case this.S.TEXT_ENTITY:s=this.S.TEXT,i="textNode";break;case this.S.ATTRIB_VALUE_ENTITY_Q:s=this.S.ATTRIB_VALUE_QUOTED,i="attribValue";break;case this.S.ATTRIB_VALUE_ENTITY_U:s=this.S.ATTRIB_VALUE_UNQUOTED,i="attribValue";break;default:throw new Error(`Unknown state: ${this.state}`)}n===";"?(this[i]+=this.parseEntity(),this.entity="",this.state=s):r.isMatch(this.entity.length?_3:T3,n)?this.entity+=n:(this.strictFail("Invalid character in entity name"),this[i]+=`&${this.entity}${n}`,this.entity="",this.state=s);continue;default:throw new Error(`Unknown state: ${this.state}`)}return this.position>=this.bufferCheckPosition&&this.checkBufferLength(),this}emit(e,t){if(this.events.hasOwnProperty(e)){let n=e.replace(/^on/,"");this.events[e](t,n,this)}}clearBuffers(){for(let e=0,t=this.BUFFERS.length;e<t;e++)this[this[e]]=""}flushBuffers(){this.closeText(),this.cdata!==""&&(this.emitNode("oncdata",this.cdata),this.cdata=""),this.script!==""&&(this.emitNode("onscript",this.script),this.script="")}end(){return this.sawRoot&&!this.closedRoot&&this.strictFail("Unclosed root tag"),this.strict&&this.state!==this.S.BEGIN&&this.state!==this.S.BEGIN_WHITESPACE&&this.state!==this.S.TEXT&&this.errorFunction("Unexpected end"),this.closeText(),this.c="",this.closed=!0,this.emit("onend"),new Sa(this.opt)}errorFunction(e){this.closeText(),this.trackPosition&&(e+=`
@@ -48,7 +48,7 @@ Line: ${this.line}
48
48
  Column: ${this.column}
49
49
  Char: ${this.c}`);let t=new Error(e);return this.error=t,this.emit("onerror",t),this}attrib(){if(!this.strict&&!this.opt.preserveCase&&(this.attribName=this.attribName[this.looseCase]()),this.attribList.indexOf(this.attribName)!==-1||Object.hasOwn(this.tag.attributes,this.attribName)){this.strictFail("Duplicate attribute"),this.attribName=this.attribValue="";return}if(this.opt.xmlns){let e=r.qname(this.attribName,!0),t=e.prefix,n=e.local;if(t==="xmlns")if(n==="xml"&&this.attribValue!==this.XML_NAMESPACE)this.strictFail(`xml: prefix must be bound to ${this.XML_NAMESPACE}
50
50
  Actual: ${this.attribValue}`);else if(n==="xmlns"&&this.attribValue!==this.XMLNS_NAMESPACE)this.strictFail(`xmlns: prefix must be bound to ${this.XMLNS_NAMESPACE}
51
- Actual: ${this.attribValue}`);else{let s=this.tag,i=this.tags[this.tags.length-1]||this;s.ns===i.ns&&(s.ns=Object.create(i.ns)),s.ns[n]=this.attribValue}this.attribList.push([this.attribName,this.attribValue])}else Object.defineProperty(this.tag.attributes,this.attribName,{value:this.attribValue,enumerable:!0,configurable:!0,writable:!0}),this.emitNode("onattribute",{name:this.attribName,value:this.attribValue});this.attribName=this.attribValue=""}newTag(){!this.strict&&!this.opt.preserveCase&&(this.tagName=this.tagName[this.looseCase]());let e=this.tags[this.tags.length-1]||this,t={name:this.tagName,attributes:{}};this.tag=t,this.opt.xmlns&&(t.ns=e.ns),this.attribList.length=0,this.emitNode("onopentagstart",t)}parseEntity(){let e=this.decodeEntity();return this.opt.processEntities===!1?`&${this.entity};`:e}decodeEntity(){let e=this.entity,t=e.toLowerCase(),n=NaN,s="";return typeof this.ENTITIES[e]=="string"||typeof this.ENTITIES[e]=="number"?this.ENTITIES[e]:typeof this.ENTITIES[t]=="string"||typeof this.ENTITIES[t]=="number"?this.ENTITIES[t]:(e=t,e.charAt(0)==="#"&&(e.charAt(1)==="x"?(e=e.slice(2),n=parseInt(e,16),s=n.toString(16)):(e=e.slice(1),n=parseInt(e,10),s=n.toString(10))),e=e.replace(/^0+/,""),Number.isNaN(n)||s.toLowerCase()!==e?(this.strictFail("Invalid character entity"),`&${this.entity};`):n<0||n>1114111||n>=55296&&n<=57343||n<32&&![9,10,13].includes(n)||n===65534||n===65535?(this.strictFail("Invalid character entity"),`&${this.entity};`):String.fromCodePoint(n))}beginWhiteSpace(e){e==="<"?(this.state=this.S.OPEN_WAKA,this.startTagPosition=this.position):r.isWhitespace(e)||(this.strictFail("Non-whitespace before first tag."),this.textNode=e,this.state=this.S.TEXT)}strictFail(e){if(typeof this!="object"||!(this instanceof Sa))throw new Error("bad call to strictFail");this.strict&&this.errorFunction(e)}textApplyOptions(e){return this.opt.trim&&(e=e.trim()),this.opt.normalize&&(e=e.replace(/\s+/g," ")),e}emitNode(e,t){this.textNode&&this.closeText(),this.emit(e,t)}closeText(){this.textNode=this.textApplyOptions(this.textNode),this.textNode!==void 0&&this.textNode!==""&&this.textNode!=="undefined"&&this.emit("ontext",this.textNode),this.textNode=""}checkBufferLength(){let e=Math.max(this.opt.MAX_BUFFER_LENGTH,10),t=0;for(let s=0,i=this.BUFFERS.length;s<i;s++){let o=this[this.BUFFERS[s]]?.length||0;if(o>e)switch(this.BUFFERS[s]){case"textNode":this.closeText();break;case"cdata":this.emitNode("oncdata",this.cdata),this.cdata="";break;case"script":this.emitNode("onscript",this.script),this.script="";break;default:this.errorFunction(`Max buffer length exceeded: ${this.BUFFERS[s]}`)}t=Math.max(t,o)}let n=this.opt.MAX_BUFFER_LENGTH-t;this.bufferCheckPosition=n+this.position}openTag(e){if(this.opt.xmlns){let t=this.tag,n=r.qname(this.tagName);t.prefix=n.prefix,t.local=n.local,t.uri=t.ns[n.prefix]||"",t.prefix&&!t.uri&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(this.tagName)}`),t.uri=n.prefix);let s=this.tags[this.tags.length-1]||this;if(t.ns&&s.ns!==t.ns){let i=this;Object.keys(t.ns).forEach(o=>{i.emitNode("onopennamespace",{prefix:o,uri:t.ns[o]})})}for(let i=0,o=this.attribList.length;i<o;i++){let a=this.attribList[i],c=a[0],u=a[1],l=r.qname(c,!0),f=l.prefix,d=l.local,h=f===""?"":t.ns[f]||"",m={name:c,value:u,prefix:f,local:d,uri:h};f&&f!=="xmlns"&&!h&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(f)}`),m.uri=f),Object.defineProperty(this.tag.attributes,c,{value:m,enumerable:!0,configurable:!0,writable:!0}),this.emitNode("onattribute",m)}this.attribList.length=0}this.tag.isSelfClosing=!!e,this.sawRoot=!0,this.tags.push(this.tag),this.emitNode("onopentag",this.tag),e||(!this.noscript&&this.tagName.toLowerCase()==="script"?this.state=this.S.SCRIPT:this.state=this.S.TEXT,this.tag=null,this.tagName=""),this.attribName=this.attribValue="",this.attribList.length=0}closeTag(){if(!this.tagName){this.strictFail("Weird empty close tag."),this.textNode+="</>",this.state=this.S.TEXT;return}let e=!this.strict&&(this.opt.caseInsensitiveTags||!this.opt.preserveCase);if(this.script){if((e?this.tagName.toLowerCase():this.tagName)!=="script"){this.script+=`</${this.tagName}>`,this.tagName="",this.state=this.S.SCRIPT;return}this.emitNode("onscript",this.script),this.script=""}let t=this.tags.length,n=this.tagName,s=e?n.toLowerCase():n;for(;t--;){let o=this.tags[t];if((e?o.name.toLowerCase():o.name)!==s)this.strictFail("Unexpected close tag");else break}if(t<0){this.strictFail(`Unmatched closing tag: ${this.tagName}`),this.textNode+=`</${this.tagName}>`,this.state=this.S.TEXT;return}this.tagName=n;let i=this.tags.length;for(;i-- >t;){let o=this.tags.pop();this.tag=o,this.tagName=this.tag.name,this.emitNode("onclosetag",this.tagName);let a={};for(let u in o.ns)o.ns.hasOwnProperty(u)&&(a[u]=o.ns[u]);let c=this.tags[this.tags.length-1]||this;if(this.opt.xmlns&&o.ns!==c.ns){let u=this;Object.keys(o.ns).forEach(l=>{let f=o.ns[l];u.emitNode("onclosenamespace",{prefix:l,uri:f})})}}t===0&&(this.closedRoot=!0),this.tagName=this.attribValue=this.attribName="",this.attribList.length=0,this.state=this.S.TEXT}},Sa=class extends Wy{static ENTITIES=gu;opt=y3;events=oL;constructor(e){super(),this.clearBuffers(),this.opt=e={...this.opt,...e},this.events={...this.events,...e},this.q=this.c="",this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags,this.bufferCheckPosition=this.opt.MAX_BUFFER_LENGTH,this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase",this.tags=[],this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.strict=!!this.opt.strict,this.noscript=!!(this.opt.strict||this.opt.noscript),this.state=this.S.BEGIN,this.strictEntities=this.opt.strictEntities,this.ENTITIES=this.strictEntities?Object.create(this.XML_ENTITIES):Object.create(this.ENTITIES),this.attribList=[],this.opt.xmlns&&(this.ns=Object.create(this.rootNS)),this.trackPosition=this.opt.position!==!1,this.trackPosition&&(this.position=this.line=this.column=0),this.emit("onready")}resume(){return this.error=null,this}close(){return this.write(null)}flush(){this.flushBuffers()}}});function Ea(r,e,t){Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0})}function cL(r,e={}){if(e.strict!==!1&&/[^\u0009\u000a\u000d\u0020-\ud7ff\ue000-\ufffd\u{10000}-\u{10ffff}]/u.test(r))throw new Error("XML: invalid XML character");let t=e.maxDepth??256;if(!Number.isSafeInteger(t)||t<1||t>4096)throw new Error("XML: maxDepth must be an integer between 1 and 4096");let n=new $y(e,t);if(new Sa({strict:e.strict!==!1,strictEntities:!e.htmlEntities,preserveCase:!0,caseInsensitiveTags:e.strict===!1,processEntities:e.processEntities!==!1,onopentag:i=>n.openElement(i.name,i.attributes||{}),ontext:i=>n.addText(i),oncdata:i=>n.addText(i),onscript:i=>n.addText(i),onclosetag:()=>n.closeElement(),onerror:i=>{throw i}}).write(r).close(),e.strict===!1)for(;n.stack.length;)n.closeElement();if(n.result===void 0)throw new Error("XML: document requires a root element");return n.result}var $y,uL=p(()=>{"use strict";aL();$y=class{options;maximumDepth;stack=[];result;constructor(e,t){this.options=e,this.maximumDepth=t}openElement(e,t){if(this.stack.length>=this.maximumDepth)throw new Error("XML: maximum nesting depth exceeded");if(!this.stack.length&&this.result!==void 0&&this.options.strict!==!1)throw new Error("XML: document requires a single root element");let n=this.normalizeName(e),s=this.stack[this.stack.length-1];this.stack.push({name:n,path:s?`${s.path}.${n}`:n,attributes:this.normalizeAttributes(t),children:{},orderedChildren:[],text:""})}addText(e){let t=this.stack[this.stack.length-1];t&&(t.text+=e)}closeElement(){let e=this.stack.pop();if(!e)return;let t=this.finalizeElement(e),n=this.stack[this.stack.length-1];if(this.options.preserveOrder){n?n.orderedChildren.push(t):this.result=t;return}n?this.addChild(n.children,e.name,e.path,t):(this.result===void 0&&(this.result={}),this.addChild(this.result,e.name,e.path,t))}finalizeElement(e){let t=this.options.trimValues===!1?e.text:e.text.trim();if(this.options.preserveOrder)return{name:e.name,attributes:e.attributes,children:e.orderedChildren,text:t};let n=Object.keys(e.attributes).length>0;if(!n&&!Object.keys(e.children).length)return this.parseValue(t,this.options.parseTagValue!==!1);let s=e.children;if(t&&Ea(s,this.options.textNodeName??"value",this.parseValue(t,this.options.parseTagValue!==!1)),n&&this.options.attributesGroupName)Ea(s,this.options.attributesGroupName,e.attributes);else for(let[i,o]of Object.entries(e.attributes))Ea(s,i,o);return s}addChild(e,t,n,s){if(!Object.hasOwn(e,t))Ea(e,t,this.options.arrayPaths?.includes(n)?[s]:s);else{let i=e[t];Array.isArray(i)?i.push(s):Ea(e,t,[i,s])}}normalizeAttributes(e){let t={};if(this.options.ignoreAttributes)return t;for(let[n,s]of Object.entries(e)){if(this.options.removeNSPrefix&&(n==="xmlns"||n.startsWith("xmlns:")))continue;let i=this.options.trimValues===!1?s:s.trim();Ea(t,(this.options.attributeNamePrefix??"")+this.normalizeName(n),this.parseValue(i,this.options.parseAttributeValue===!0))}return t}normalizeName(e){return this.options.removeNSPrefix?e.slice(e.indexOf(":")+1):e}parseValue(e,t){return t?e==="true"||e==="false"?e==="true":e!==""&&e.trim()!==""&&Number.isFinite(Number(e))?Number(e):e:e}}});function qy(r,e={}){if(Object.hasOwn(e,"_fastXML")||Object.hasOwn(e,"_sax"))throw new Error("XML: backend-specific options were removed; use native XML options");if(e._parser&&!["internal","sax"].includes(e._parser))throw new Error("XML: unsupported parser backend; use the native documents parser");let t=cL(r,e);return e.uncapitalizeKeys?Ld(t):t}var lL=p(()=>{"use strict";iL();uL()});var fL=p(()=>{"use strict";lL()});function yu(r){if(/<!DOCTYPE|<!ENTITY/i.test(r))throw new Error("MaterialX: document types and entity declarations are unsupported.");let e;try{e=qy(r,{preserveOrder:!0,parseAttributeValue:!1,trimValues:!1})}catch(n){throw new Error("MaterialX: malformed XML.",{cause:n})}if(e.name!=="materialx")throw new Error("MaterialX: expected a materialx root element.");let t=e.attributes.version;if(!t||!/^1\.\d+$/.test(t))throw new Error("MaterialX: expected a MaterialX 1.x version.");return{version:t,root:dL(e,0)}}function dL(r,e){return{category:r.name,attributes:r.attributes,children:r.children.map(t=>dL(t,e+1))}}var hL=p(()=>{"use strict";fL()});var Ky={};J(Ky,{MaterialXLoaderWithParser:()=>v3});var cne,A3,v3,Xy=p(()=>{"use strict";mL();hL();({preload:cne,...A3}=pL),v3={...A3,parse:async r=>yu(new TextDecoder().decode(r)),parseSync:r=>yu(new TextDecoder().decode(r)),parseText:async r=>yu(r),parseTextSync:yu}});async function I3(){let{MaterialXLoaderWithParser:r}=await Promise.resolve().then(()=>(Xy(),Ky));return r}var pL,mL=p(()=>{"use strict";pL={name:"MaterialX",id:"materialx",module:"scene",version:"latest",extensions:["mtlx"],mimeTypes:["application/xml"],text:!0,dataType:null,batchType:null,options:{},preload:I3}});function Hy(r){let e=new DataView(r),t=r.byteLength>=84&&84+e.getUint32(80,!0)*50===r.byteLength,n,s,i;if(t){let a=e.getUint32(80,!0);n=new Float32Array(a*9),s=new Float32Array(a*9),i=new TextDecoder().decode(r.slice(0,80));for(let c=0;c<a;c++){let u=84+c*50;for(let l=0;l<9;l++)n[c*9+l]=e.getFloat32(u+12+l*4,!0),s[c*9+l]=e.getFloat32(u+l%3*4,!0)}}else{let a=new TextDecoder().decode(r).trim().split(/\r?\n/).map(f=>f.trim()).filter(Boolean),c=[],u=[];i=a[0]||"";let l=0;for(;l<a.length;){if(!/^solid(?:\s|$)/i.test(a[l++]))throw new Error("STL: expected solid header or exact binary length");for(;l<a.length&&!/^endsolid(?:\s|$)/i.test(a[l]);){let f=bL(a[l++],"facet normal");if(!/^outer\s+loop$/i.test(a[l++]||""))throw new Error("STL: expected outer loop");for(let d=0;d<3;d++)c.push(...bL(a[l++],"vertex")),u.push(...f);if(!/^endloop$/i.test(a[l++]||"")||!/^endfacet$/i.test(a[l++]||""))throw new Error("STL: incomplete facet")}if(l>=a.length)throw new Error("STL: missing endsolid");l++}if(!a.length)throw new Error("STL: empty input");n=new Float32Array(c),s=new Float32Array(u)}if(!n.every(Number.isFinite)||!s.every(Number.isFinite))throw new Error("STL: non-finite coordinates");let o={POSITION:{value:n,size:3},NORMAL:{value:s,size:3}};return{topology:"triangle-list",mode:4,attributes:o,schema:jb(o),header:{vertexCount:n.length/3,boundingBox:Er(o)??void 0},loaderData:{header:i,format:t?"binary":"ascii"}}}function bL(r,e){let t=r?.split(/\s+/)||[],n=e.split(" "),s=t.slice(n.length);if(n.some((i,o)=>t[o]?.toLowerCase()!==i)||s.length!==3||s.some(i=>!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(i)))throw new Error(`STL: invalid ${e} record`);return s.map(Number)}var gL=p(()=>{"use strict";mn()});var Jy={};J(Jy,{STLLoaderWithParser:()=>E3});var pne,S3,E3,Yy=p(()=>{"use strict";wL();gL();({preload:pne,...S3}=yL),E3={...S3,parse:async r=>Hy(r),parseSync:Hy}});async function B3(){let{STLLoaderWithParser:r}=await Promise.resolve().then(()=>(Yy(),Jy));return r}var L3,yL,wL=p(()=>{"use strict";L3="5.0.0-beta.5";yL={name:"STL",id:"stl",module:"scene",version:L3,extensions:["stl"],mimeTypes:["model/stl"],binary:!0,dataType:null,batchType:null,options:{},preload:B3}});function ML(r){let e=r.size(),t=new ArrayBuffer(e),n=new Int8Array(t);for(let s=0;s<e;++s)n[s]=r.GetValue(s);return t}function J3(r){return r instanceof Map?r.entries():Object.entries(r)}function Tu(r){return ArrayBuffer.isView(r)?r:r&&typeof r=="object"&&"value"in r&&ArrayBuffer.isView(r.value)?r.value:null}function Dd(r,e){return ArrayBuffer.isView(r)?e:r.size}function Y3(r,e){for(let t of r)if(!Number.isInteger(t)||t<0||t>=e)throw new Error(`DracoWriter: triangle index ${t} is outside vertex range 0-${e-1}`)}function DL(r){return!!(r.attributeQuantization&&Object.keys(r.attributeQuantization).length)}function Rd(r,e,t){if(!Number.isInteger(e)||e<1||e>30)throw new Error(`DracoWriter: quantization bits for "${r}" must be an integer from 1 to 30`);if(t==="NORMAL"&&(e<2||e>29))throw new Error(`DracoWriter: quantization bits for NORMAL attribute "${r}" must be an integer from 2 to 29`)}function Q3(r,e,t){if(Rd(r,t.bits),!Array.isArray(t.origin)||t.origin.length!==e)throw new Error(`DracoWriter: quantization origin for "${r}" must contain ${e} values`);if(!t.origin.every(Number.isFinite))throw new Error(`DracoWriter: quantization origin for "${r}" must be finite`);if(!Number.isFinite(t.range)||t.range<=0)throw new Error(`DracoWriter: quantization range for "${r}" must be positive`)}function RL(r,e){for(let t of["POSITION","NORMAL","COLOR","TEX_COORD","GENERIC"])if(r[t]===e)return t;return"GENERIC"}function Z3(r){let e={gltf:{method:"MESH_EDGEBREAKER_ENCODING",speed:[5,5],quantization:{POSITION:14,NORMAL:10,TEX_COORD:12}},webgpu:{method:"MESH_SEQUENTIAL_ENCODING",speed:[5,5],quantization:{POSITION:14,NORMAL:10,TEX_COORD:12}},balanced:{method:"MESH_EDGEBREAKER_ENCODING",speed:[5,5],quantization:{POSITION:12,NORMAL:10,TEX_COORD:10}}},t=r.preset?e[r.preset]:{};return{...t,...r,quantization:{...t.quantization,...r.quantization}}}var H3,OL,Ma,kL=p(()=>{"use strict";H3={POSITION:"POSITION",NORMAL:"NORMAL",COLOR_0:"COLOR",TEXCOORD_0:"TEX_COORD"},OL=()=>{},Ma=class{draco;dracoEncoder;dracoMeshBuilder;dracoMetadataBuilder;log=OL;constructor(e){this.draco=e,this.dracoEncoder=new this.draco.Encoder,this.dracoMeshBuilder=new this.draco.MeshBuilder,this.dracoMetadataBuilder=new this.draco.MetadataBuilder}destroy(){this.destroyEncodedObject(this.dracoMeshBuilder),this.destroyEncodedObject(this.dracoEncoder),this.destroyEncodedObject(this.dracoMetadataBuilder)}destroyEncodedObject(e){e&&this.draco.destroy(e)}encodeSync(e,t={}){return this._encodeSync(e,t,!1).data}encodeSyncWithReport(e,t={}){return this._encodeSync(e,t,!0)}_encodeSync(e,t,n){return t=Z3(t),this.log=t.log||OL,t.pointcloud?this._encodePointCloud(e,t,n):this._encodeMesh(e,t,n)}_getAttributesFromMesh(e){return{...e.indices?{indices:e.indices}:{},...e.attributes}}_encodePointCloud(e,t,n){let s=new this.draco.PointCloud,i=new this.draco.DracoInt8Array,o=null;try{t.metadata&&this._addGeometryMetadata(s,t.metadata);let a=this._getAttributesFromMesh(e),c=this._createDracoPointCloud(s,a,t),u=DL(t),l,f;if(u?(o=new this.draco.ExpertEncoder(s),this._setExpertOptions(o,c,t),f=o,n&&f.SetTrackEncodedProperties(!0),l=o.EncodeToDracoBuffer(t.deduplicateValues??!1,i)):(this._setOptions(t),f=this.dracoEncoder,n&&f.SetTrackEncodedProperties(!0),l=this.dracoEncoder.EncodePointCloudToDracoBuffer(s,t.deduplicateValues??!1,i)),!(l>0))throw new Error("Draco encoding failed.");this.log(`DRACO encoded ${s.num_points()} points
51
+ Actual: ${this.attribValue}`);else{let s=this.tag,i=this.tags[this.tags.length-1]||this;s.ns===i.ns&&(s.ns=Object.create(i.ns)),s.ns[n]=this.attribValue}this.attribList.push([this.attribName,this.attribValue])}else Object.defineProperty(this.tag.attributes,this.attribName,{value:this.attribValue,enumerable:!0,configurable:!0,writable:!0}),this.emitNode("onattribute",{name:this.attribName,value:this.attribValue});this.attribName=this.attribValue=""}newTag(){!this.strict&&!this.opt.preserveCase&&(this.tagName=this.tagName[this.looseCase]());let e=this.tags[this.tags.length-1]||this,t={name:this.tagName,attributes:{}};this.tag=t,this.opt.xmlns&&(t.ns=e.ns),this.attribList.length=0,this.emitNode("onopentagstart",t)}parseEntity(){let e=this.decodeEntity();return this.opt.processEntities===!1?`&${this.entity};`:e}decodeEntity(){let e=this.entity,t=e.toLowerCase(),n=NaN,s="";return typeof this.ENTITIES[e]=="string"||typeof this.ENTITIES[e]=="number"?this.ENTITIES[e]:typeof this.ENTITIES[t]=="string"||typeof this.ENTITIES[t]=="number"?this.ENTITIES[t]:(e=t,e.charAt(0)==="#"&&(e.charAt(1)==="x"?(e=e.slice(2),n=parseInt(e,16),s=n.toString(16)):(e=e.slice(1),n=parseInt(e,10),s=n.toString(10))),e=e.replace(/^0+/,""),Number.isNaN(n)||s.toLowerCase()!==e?(this.strictFail("Invalid character entity"),`&${this.entity};`):n<0||n>1114111||n>=55296&&n<=57343||n<32&&![9,10,13].includes(n)||n===65534||n===65535?(this.strictFail("Invalid character entity"),`&${this.entity};`):String.fromCodePoint(n))}beginWhiteSpace(e){e==="<"?(this.state=this.S.OPEN_WAKA,this.startTagPosition=this.position):r.isWhitespace(e)||(this.strictFail("Non-whitespace before first tag."),this.textNode=e,this.state=this.S.TEXT)}strictFail(e){if(typeof this!="object"||!(this instanceof Sa))throw new Error("bad call to strictFail");this.strict&&this.errorFunction(e)}textApplyOptions(e){return this.opt.trim&&(e=e.trim()),this.opt.normalize&&(e=e.replace(/\s+/g," ")),e}emitNode(e,t){this.textNode&&this.closeText(),this.emit(e,t)}closeText(){this.textNode=this.textApplyOptions(this.textNode),this.textNode!==void 0&&this.textNode!==""&&this.textNode!=="undefined"&&this.emit("ontext",this.textNode),this.textNode=""}checkBufferLength(){let e=Math.max(this.opt.MAX_BUFFER_LENGTH,10),t=0;for(let s=0,i=this.BUFFERS.length;s<i;s++){let o=this[this.BUFFERS[s]]?.length||0;if(o>e)switch(this.BUFFERS[s]){case"textNode":this.closeText();break;case"cdata":this.emitNode("oncdata",this.cdata),this.cdata="";break;case"script":this.emitNode("onscript",this.script),this.script="";break;default:this.errorFunction(`Max buffer length exceeded: ${this.BUFFERS[s]}`)}t=Math.max(t,o)}let n=this.opt.MAX_BUFFER_LENGTH-t;this.bufferCheckPosition=n+this.position}openTag(e){if(this.opt.xmlns){let t=this.tag,n=r.qname(this.tagName);t.prefix=n.prefix,t.local=n.local,t.uri=t.ns[n.prefix]||"",t.prefix&&!t.uri&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(this.tagName)}`),t.uri=n.prefix);let s=this.tags[this.tags.length-1]||this;if(t.ns&&s.ns!==t.ns){let i=this;Object.keys(t.ns).forEach(o=>{i.emitNode("onopennamespace",{prefix:o,uri:t.ns[o]})})}for(let i=0,o=this.attribList.length;i<o;i++){let a=this.attribList[i],c=a[0],u=a[1],l=r.qname(c,!0),f=l.prefix,d=l.local,h=f===""?"":t.ns[f]||"",m={name:c,value:u,prefix:f,local:d,uri:h};f&&f!=="xmlns"&&!h&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(f)}`),m.uri=f),Object.defineProperty(this.tag.attributes,c,{value:m,enumerable:!0,configurable:!0,writable:!0}),this.emitNode("onattribute",m)}this.attribList.length=0}this.tag.isSelfClosing=!!e,this.sawRoot=!0,this.tags.push(this.tag),this.emitNode("onopentag",this.tag),e||(!this.noscript&&this.tagName.toLowerCase()==="script"?this.state=this.S.SCRIPT:this.state=this.S.TEXT,this.tag=null,this.tagName=""),this.attribName=this.attribValue="",this.attribList.length=0}closeTag(){if(!this.tagName){this.strictFail("Weird empty close tag."),this.textNode+="</>",this.state=this.S.TEXT;return}let e=!this.strict&&(this.opt.caseInsensitiveTags||!this.opt.preserveCase);if(this.script){if((e?this.tagName.toLowerCase():this.tagName)!=="script"){this.script+=`</${this.tagName}>`,this.tagName="",this.state=this.S.SCRIPT;return}this.emitNode("onscript",this.script),this.script=""}let t=this.tags.length,n=this.tagName,s=e?n.toLowerCase():n;for(;t--;){let o=this.tags[t];if((e?o.name.toLowerCase():o.name)!==s)this.strictFail("Unexpected close tag");else break}if(t<0){this.strictFail(`Unmatched closing tag: ${this.tagName}`),this.textNode+=`</${this.tagName}>`,this.state=this.S.TEXT;return}this.tagName=n;let i=this.tags.length;for(;i-- >t;){let o=this.tags.pop();this.tag=o,this.tagName=this.tag.name,this.emitNode("onclosetag",this.tagName);let a={};for(let u in o.ns)o.ns.hasOwnProperty(u)&&(a[u]=o.ns[u]);let c=this.tags[this.tags.length-1]||this;if(this.opt.xmlns&&o.ns!==c.ns){let u=this;Object.keys(o.ns).forEach(l=>{let f=o.ns[l];u.emitNode("onclosenamespace",{prefix:l,uri:f})})}}t===0&&(this.closedRoot=!0),this.tagName=this.attribValue=this.attribName="",this.attribList.length=0,this.state=this.S.TEXT}},Sa=class extends Wy{static ENTITIES=gu;opt=y3;events=oL;constructor(e){super(),this.clearBuffers(),this.opt=e={...this.opt,...e},this.events={...this.events,...e},this.q=this.c="",this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags,this.bufferCheckPosition=this.opt.MAX_BUFFER_LENGTH,this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase",this.tags=[],this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.strict=!!this.opt.strict,this.noscript=!!(this.opt.strict||this.opt.noscript),this.state=this.S.BEGIN,this.strictEntities=this.opt.strictEntities,this.ENTITIES=this.strictEntities?Object.create(this.XML_ENTITIES):Object.create(this.ENTITIES),this.attribList=[],this.opt.xmlns&&(this.ns=Object.create(this.rootNS)),this.trackPosition=this.opt.position!==!1,this.trackPosition&&(this.position=this.line=this.column=0),this.emit("onready")}resume(){return this.error=null,this}close(){return this.write(null)}flush(){this.flushBuffers()}}});function Ea(r,e,t){Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0})}function cL(r,e={}){if(e.strict!==!1&&/[^\u0009\u000a\u000d\u0020-\ud7ff\ue000-\ufffd\u{10000}-\u{10ffff}]/u.test(r))throw new Error("XML: invalid XML character");let t=e.maxDepth??256;if(!Number.isSafeInteger(t)||t<1||t>4096)throw new Error("XML: maxDepth must be an integer between 1 and 4096");let n=new $y(e,t);if(new Sa({strict:e.strict!==!1,strictEntities:!e.htmlEntities,preserveCase:!0,caseInsensitiveTags:e.strict===!1,processEntities:e.processEntities!==!1,onopentag:i=>n.openElement(i.name,i.attributes||{}),ontext:i=>n.addText(i),oncdata:i=>n.addText(i),onscript:i=>n.addText(i),onclosetag:()=>n.closeElement(),onerror:i=>{throw i}}).write(r).close(),e.strict===!1)for(;n.stack.length;)n.closeElement();if(n.result===void 0)throw new Error("XML: document requires a root element");return n.result}var $y,uL=p(()=>{"use strict";aL();$y=class{options;maximumDepth;stack=[];result;constructor(e,t){this.options=e,this.maximumDepth=t}openElement(e,t){if(this.stack.length>=this.maximumDepth)throw new Error("XML: maximum nesting depth exceeded");if(!this.stack.length&&this.result!==void 0&&this.options.strict!==!1)throw new Error("XML: document requires a single root element");let n=this.normalizeName(e),s=this.stack[this.stack.length-1];this.stack.push({name:n,path:s?`${s.path}.${n}`:n,attributes:this.normalizeAttributes(t),children:{},orderedChildren:[],text:""})}addText(e){let t=this.stack[this.stack.length-1];t&&(t.text+=e)}closeElement(){let e=this.stack.pop();if(!e)return;let t=this.finalizeElement(e),n=this.stack[this.stack.length-1];if(this.options.preserveOrder){n?n.orderedChildren.push(t):this.result=t;return}n?this.addChild(n.children,e.name,e.path,t):(this.result===void 0&&(this.result={}),this.addChild(this.result,e.name,e.path,t))}finalizeElement(e){let t=this.options.trimValues===!1?e.text:e.text.trim();if(this.options.preserveOrder)return{name:e.name,attributes:e.attributes,children:e.orderedChildren,text:t};let n=Object.keys(e.attributes).length>0;if(!n&&!Object.keys(e.children).length)return this.parseValue(t,this.options.parseTagValue!==!1);let s=e.children;if(t&&Ea(s,this.options.textNodeName??"value",this.parseValue(t,this.options.parseTagValue!==!1)),n&&this.options.attributesGroupName)Ea(s,this.options.attributesGroupName,e.attributes);else for(let[i,o]of Object.entries(e.attributes))Ea(s,i,o);return s}addChild(e,t,n,s){if(!Object.hasOwn(e,t))Ea(e,t,this.options.arrayPaths?.includes(n)?[s]:s);else{let i=e[t];Array.isArray(i)?i.push(s):Ea(e,t,[i,s])}}normalizeAttributes(e){let t={};if(this.options.ignoreAttributes)return t;for(let[n,s]of Object.entries(e)){if(this.options.removeNSPrefix&&(n==="xmlns"||n.startsWith("xmlns:")))continue;let i=this.options.trimValues===!1?s:s.trim();Ea(t,(this.options.attributeNamePrefix??"")+this.normalizeName(n),this.parseValue(i,this.options.parseAttributeValue===!0))}return t}normalizeName(e){return this.options.removeNSPrefix?e.slice(e.indexOf(":")+1):e}parseValue(e,t){return t?e==="true"||e==="false"?e==="true":e!==""&&e.trim()!==""&&Number.isFinite(Number(e))?Number(e):e:e}}});function qy(r,e={}){if(Object.hasOwn(e,"_fastXML")||Object.hasOwn(e,"_sax"))throw new Error("XML: backend-specific options were removed; use native XML options");if(e._parser&&!["internal","sax"].includes(e._parser))throw new Error("XML: unsupported parser backend; use the native documents parser");let t=cL(r,e);return e.uncapitalizeKeys?Ld(t):t}var lL=p(()=>{"use strict";iL();uL()});var fL=p(()=>{"use strict";lL()});function yu(r){if(/<!DOCTYPE|<!ENTITY/i.test(r))throw new Error("MaterialX: document types and entity declarations are unsupported.");let e;try{e=qy(r,{preserveOrder:!0,parseAttributeValue:!1,trimValues:!1})}catch(n){throw new Error("MaterialX: malformed XML.",{cause:n})}if(e.name!=="materialx")throw new Error("MaterialX: expected a materialx root element.");let t=e.attributes.version;if(!t||!/^1\.\d+$/.test(t))throw new Error("MaterialX: expected a MaterialX 1.x version.");return{version:t,root:dL(e,0)}}function dL(r,e){return{category:r.name,attributes:r.attributes,children:r.children.map(t=>dL(t,e+1))}}var hL=p(()=>{"use strict";fL()});var Ky={};J(Ky,{MaterialXLoaderWithParser:()=>v3});var cne,A3,v3,Xy=p(()=>{"use strict";mL();hL();({preload:cne,...A3}=pL),v3={...A3,parse:async r=>yu(new TextDecoder().decode(r)),parseSync:r=>yu(new TextDecoder().decode(r)),parseText:async r=>yu(r),parseTextSync:yu}});async function I3(){let{MaterialXLoaderWithParser:r}=await Promise.resolve().then(()=>(Xy(),Ky));return r}var pL,mL=p(()=>{"use strict";pL={name:"MaterialX",id:"materialx",module:"scene",version:"latest",extensions:["mtlx"],mimeTypes:["application/xml"],text:!0,dataType:null,batchType:null,options:{},preload:I3}});function Hy(r){let e=new DataView(r),t=r.byteLength>=84&&84+e.getUint32(80,!0)*50===r.byteLength,n,s,i;if(t){let a=e.getUint32(80,!0);n=new Float32Array(a*9),s=new Float32Array(a*9),i=new TextDecoder().decode(r.slice(0,80));for(let c=0;c<a;c++){let u=84+c*50;for(let l=0;l<9;l++)n[c*9+l]=e.getFloat32(u+12+l*4,!0),s[c*9+l]=e.getFloat32(u+l%3*4,!0)}}else{let a=new TextDecoder().decode(r).trim().split(/\r?\n/).map(f=>f.trim()).filter(Boolean),c=[],u=[];i=a[0]||"";let l=0;for(;l<a.length;){if(!/^solid(?:\s|$)/i.test(a[l++]))throw new Error("STL: expected solid header or exact binary length");for(;l<a.length&&!/^endsolid(?:\s|$)/i.test(a[l]);){let f=bL(a[l++],"facet normal");if(!/^outer\s+loop$/i.test(a[l++]||""))throw new Error("STL: expected outer loop");for(let d=0;d<3;d++)c.push(...bL(a[l++],"vertex")),u.push(...f);if(!/^endloop$/i.test(a[l++]||"")||!/^endfacet$/i.test(a[l++]||""))throw new Error("STL: incomplete facet")}if(l>=a.length)throw new Error("STL: missing endsolid");l++}if(!a.length)throw new Error("STL: empty input");n=new Float32Array(c),s=new Float32Array(u)}if(!n.every(Number.isFinite)||!s.every(Number.isFinite))throw new Error("STL: non-finite coordinates");let o={POSITION:{value:n,size:3},NORMAL:{value:s,size:3}};return{topology:"triangle-list",mode:4,attributes:o,schema:jb(o),header:{vertexCount:n.length/3,boundingBox:Er(o)??void 0},loaderData:{header:i,format:t?"binary":"ascii"}}}function bL(r,e){let t=r?.split(/\s+/)||[],n=e.split(" "),s=t.slice(n.length);if(n.some((i,o)=>t[o]?.toLowerCase()!==i)||s.length!==3||s.some(i=>!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(i)))throw new Error(`STL: invalid ${e} record`);return s.map(Number)}var gL=p(()=>{"use strict";mn()});var Jy={};J(Jy,{STLLoaderWithParser:()=>E3});var pne,S3,E3,Yy=p(()=>{"use strict";wL();gL();({preload:pne,...S3}=yL),E3={...S3,parse:async r=>Hy(r),parseSync:Hy}});async function B3(){let{STLLoaderWithParser:r}=await Promise.resolve().then(()=>(Yy(),Jy));return r}var L3,yL,wL=p(()=>{"use strict";L3="5.0.0-beta.7";yL={name:"STL",id:"stl",module:"scene",version:L3,extensions:["stl"],mimeTypes:["model/stl"],binary:!0,dataType:null,batchType:null,options:{},preload:B3}});function ML(r){let e=r.size(),t=new ArrayBuffer(e),n=new Int8Array(t);for(let s=0;s<e;++s)n[s]=r.GetValue(s);return t}function J3(r){return r instanceof Map?r.entries():Object.entries(r)}function Tu(r){return ArrayBuffer.isView(r)?r:r&&typeof r=="object"&&"value"in r&&ArrayBuffer.isView(r.value)?r.value:null}function Dd(r,e){return ArrayBuffer.isView(r)?e:r.size}function Y3(r,e){for(let t of r)if(!Number.isInteger(t)||t<0||t>=e)throw new Error(`DracoWriter: triangle index ${t} is outside vertex range 0-${e-1}`)}function DL(r){return!!(r.attributeQuantization&&Object.keys(r.attributeQuantization).length)}function Rd(r,e,t){if(!Number.isInteger(e)||e<1||e>30)throw new Error(`DracoWriter: quantization bits for "${r}" must be an integer from 1 to 30`);if(t==="NORMAL"&&(e<2||e>29))throw new Error(`DracoWriter: quantization bits for NORMAL attribute "${r}" must be an integer from 2 to 29`)}function Q3(r,e,t){if(Rd(r,t.bits),!Array.isArray(t.origin)||t.origin.length!==e)throw new Error(`DracoWriter: quantization origin for "${r}" must contain ${e} values`);if(!t.origin.every(Number.isFinite))throw new Error(`DracoWriter: quantization origin for "${r}" must be finite`);if(!Number.isFinite(t.range)||t.range<=0)throw new Error(`DracoWriter: quantization range for "${r}" must be positive`)}function RL(r,e){for(let t of["POSITION","NORMAL","COLOR","TEX_COORD","GENERIC"])if(r[t]===e)return t;return"GENERIC"}function Z3(r){let e={gltf:{method:"MESH_EDGEBREAKER_ENCODING",speed:[5,5],quantization:{POSITION:14,NORMAL:10,TEX_COORD:12}},webgpu:{method:"MESH_SEQUENTIAL_ENCODING",speed:[5,5],quantization:{POSITION:14,NORMAL:10,TEX_COORD:12}},balanced:{method:"MESH_EDGEBREAKER_ENCODING",speed:[5,5],quantization:{POSITION:12,NORMAL:10,TEX_COORD:10}}},t=r.preset?e[r.preset]:{};return{...t,...r,quantization:{...t.quantization,...r.quantization}}}var H3,OL,Ma,kL=p(()=>{"use strict";H3={POSITION:"POSITION",NORMAL:"NORMAL",COLOR_0:"COLOR",TEXCOORD_0:"TEX_COORD"},OL=()=>{},Ma=class{draco;dracoEncoder;dracoMeshBuilder;dracoMetadataBuilder;log=OL;constructor(e){this.draco=e,this.dracoEncoder=new this.draco.Encoder,this.dracoMeshBuilder=new this.draco.MeshBuilder,this.dracoMetadataBuilder=new this.draco.MetadataBuilder}destroy(){this.destroyEncodedObject(this.dracoMeshBuilder),this.destroyEncodedObject(this.dracoEncoder),this.destroyEncodedObject(this.dracoMetadataBuilder)}destroyEncodedObject(e){e&&this.draco.destroy(e)}encodeSync(e,t={}){return this._encodeSync(e,t,!1).data}encodeSyncWithReport(e,t={}){return this._encodeSync(e,t,!0)}_encodeSync(e,t,n){return t=Z3(t),this.log=t.log||OL,t.pointcloud?this._encodePointCloud(e,t,n):this._encodeMesh(e,t,n)}_getAttributesFromMesh(e){return{...e.indices?{indices:e.indices}:{},...e.attributes}}_encodePointCloud(e,t,n){let s=new this.draco.PointCloud,i=new this.draco.DracoInt8Array,o=null;try{t.metadata&&this._addGeometryMetadata(s,t.metadata);let a=this._getAttributesFromMesh(e),c=this._createDracoPointCloud(s,a,t),u=DL(t),l,f;if(u?(o=new this.draco.ExpertEncoder(s),this._setExpertOptions(o,c,t),f=o,n&&f.SetTrackEncodedProperties(!0),l=o.EncodeToDracoBuffer(t.deduplicateValues??!1,i)):(this._setOptions(t),f=this.dracoEncoder,n&&f.SetTrackEncodedProperties(!0),l=this.dracoEncoder.EncodePointCloudToDracoBuffer(s,t.deduplicateValues??!1,i)),!(l>0))throw new Error("Draco encoding failed.");this.log(`DRACO encoded ${s.num_points()} points
52
52
  with ${s.num_attributes()} attributes into ${l} bytes`);let d=ML(i);return{data:d,report:this._getEncodingReport("point-cloud",d.byteLength,s,f,c,t,n)}}finally{this.destroyEncodedObject(o),this.destroyEncodedObject(i),this.destroyEncodedObject(s)}}_encodeMesh(e,t,n){let s=new this.draco.Mesh,i=new this.draco.DracoInt8Array,o=null;try{t.metadata&&this._addGeometryMetadata(s,t.metadata);let a=this._getAttributesFromMesh(e),c=this._createDracoMesh(s,a,t),u=DL(t),l,f;if(u?(o=new this.draco.ExpertEncoder(s),this._setExpertOptions(o,c,t),f=o,n&&f.SetTrackEncodedProperties(!0),l=o.EncodeToDracoBuffer(!1,i)):(this._setOptions(t),f=this.dracoEncoder,n&&f.SetTrackEncodedProperties(!0),l=this.dracoEncoder.EncodeMeshToDracoBuffer(s,i)),l<=0)throw new Error("Draco encoding failed.");this.log(`DRACO encoded ${s.num_points()} points
53
53
  with ${s.num_attributes()} attributes into ${l} bytes`);let d=ML(i);return{data:d,report:this._getEncodingReport("mesh",d.byteLength,s,f,c,t,n)}}finally{this.destroyEncodedObject(o),this.destroyEncodedObject(i),this.destroyEncodedObject(s)}}_setOptions(e){if(e.speed&&this.dracoEncoder.SetSpeedOptions(...e.speed),e.method){let t=this.draco[e.method];this.dracoEncoder.SetEncodingMethod(t)}if(e.quantization)for(let t in e.quantization){let n=t,s=e.quantization[n];s!==void 0&&(Rd(n,s,n),this.dracoEncoder.SetAttributeQuantization(this.draco[n],s))}}_setExpertOptions(e,t,n){n.speed&&e.SetSpeedOptions(...n.speed),n.method&&e.SetEncodingMethod(this.draco[n.method]);let s=this._getAttributeQuantization(t,n);for(let[i,o]of s){let a=t[i];typeof o=="number"?e.SetAttributeQuantization(a.attributeId,o):e.SetAttributeExplicitQuantization(a.attributeId,o.bits,a.componentCount,o.origin,o.range)}}_getAttributeQuantization(e,t){let n=new Map;for(let i of Object.keys(t.quantization||{})){let o=t.quantization?.[i];o!==void 0&&(Rd(i,o,i),n.set(this.draco[i],o))}let s=new Map;for(let[i,o]of Object.entries(e)){let a=n.get(o.attributeType);a!==void 0&&s.set(i,a)}for(let[i,o]of Object.entries(t.attributeQuantization||{})){let a=e[i];if(!a)throw new Error(`DracoWriter: quantized attribute "${i}" does not exist`);if(typeof o=="number")Rd(i,o,a.attributeTypeName);else{if(a.attributeTypeName==="NORMAL")throw new Error(`DracoWriter: explicit quantization transforms are not supported for NORMAL attribute "${i}"`);Q3(i,e[i].componentCount,o)}s.set(i,o)}for(let i of s.keys())if(!e[i].supportsQuantization)throw new Error(`DracoWriter: quantization for "${i}" requires floating-point attribute data`);return s}_getEncodingReport(e,t,n,s,i,o,a){let c=this._getAttributeQuantization(i,o),u={};for(let[l,f]of Object.entries(i))u[l]={id:f.attributeId,type:f.attributeTypeName,componentCount:f.componentCount,...c.has(l)?{quantization:c.get(l)}:{}};return{geometryType:e,byteLength:t,pointCount:a?s.GetNumberOfEncodedPoints():n.num_points(),faceCount:a?s.GetNumberOfEncodedFaces():e==="mesh"&&typeof n.num_faces=="function"?n.num_faces():0,attributeCount:n.num_attributes(),...o.method?{method:o.method}:{},...o.speed?{speed:o.speed}:{},attributes:u}}_createDracoMesh(e,t,n){let s=n.attributesMetadata||{},i={},o=this._getVertexCount(t,n);for(let[a,c]of Object.entries(t)){let u=this._addAttributeToMesh(e,a,c,o,n);if(u!==-1){let l=Tu(c),f=this._getDracoAttributeType(a,n.attributeTypes);i[a]={attributeId:u,attributeType:f,attributeTypeName:RL(this.draco,f),componentCount:Dd(c,l.length/o),supportsQuantization:l instanceof Float32Array},this._addAttributeMetadata(e,u,{[n.attributeNameEntry||"name"]:a,...s[a]||{}})}}return i}_createDracoPointCloud(e,t,n){let s=n.attributesMetadata||{},i={},o=this._getVertexCount(t,n);for(let[a,c]of Object.entries(t)){let u=this._addAttributeToMesh(e,a,c,o,n);if(u!==-1){let l=Tu(c),f=this._getDracoAttributeType(a,n.attributeTypes);i[a]={attributeId:u,attributeType:f,attributeTypeName:RL(this.draco,f),componentCount:Dd(c,l.length/o),supportsQuantization:l instanceof Float32Array},this._addAttributeMetadata(e,u,{[n.attributeNameEntry||"name"]:a,...s[a]||{}})}}return i}_addAttributeToMesh(e,t,n,s,i={}){let o=Tu(n);if(!o)throw new Error(`DracoWriter: attribute "${t}" must contain a typed array`);let a=this._getDracoAttributeType(t,i.attributeTypes),c=Dd(n,o.length/s);if(a==="indices"){if(o.length%3!==0)throw new Error("DracoWriter: triangle indices length must be divisible by 3");Y3(o,s);let f=o.length/3;this.log(`Adding attribute ${t}, size ${f}`);let d=o instanceof Uint16Array||o instanceof Uint32Array?o:Uint32Array.from(o);return this.dracoMeshBuilder.AddFacesToMesh(e,f,d),-1}if(!Number.isInteger(c)||c<=0||o.length!==s*c)throw new Error(`DracoWriter: attribute "${t}" has ${o.length} values, expected ${s*c}`);this.log(`Adding attribute ${t}, size ${c}`);let u=this.dracoMeshBuilder,l=-1;if(o instanceof Int8Array)l=u.AddInt8Attribute(e,a,s,c,o);else if(o instanceof Int16Array)l=u.AddInt16Attribute(e,a,s,c,o);else if(o instanceof Int32Array)l=u.AddInt32Attribute(e,a,s,c,o);else if(o instanceof Uint8Array)l=u.AddUInt8Attribute(e,a,s,c,o);else if(o instanceof Uint8ClampedArray){let f=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);l=u.AddUInt8Attribute(e,a,s,c,f)}else if(o instanceof Uint16Array)l=u.AddUInt16Attribute(e,a,s,c,o);else if(o instanceof Uint32Array)l=u.AddUInt32Attribute(e,a,s,c,o);else if(o instanceof Float32Array)l=u.AddFloatAttribute(e,a,s,c,o);else throw new Error(`DracoWriter: attribute "${t}" uses unsupported ${o.constructor.name}`);return!ArrayBuffer.isView(n)&&n.normalized!==void 0&&u.SetNormalizedFlagForAttribute(e,l,n.normalized),l}_getDracoAttributeType(e,t={}){if(e.toLowerCase()==="indices")return"indices";let n=t[e];if(n)return this.draco[n];let s=H3[e];if(s)return this.draco[s];switch(e.toLowerCase()){case"position":case"positions":case"vertices":return this.draco.POSITION;case"normal":case"normals":return this.draco.NORMAL;case"color":case"colors":return this.draco.COLOR;case"texcoord":case"texcoords":return this.draco.TEX_COORD;default:return/^color_\d+$/i.test(e)?this.draco.COLOR:/^texcoord_\d+$/i.test(e)?this.draco.TEX_COORD:this.draco.GENERIC}}_getVertexCount(e,t){let n=this._getPositionAttribute(e,t.attributeTypes),s=n&&Tu(n);if(!n||!s)throw new Error("DracoWriter: POSITION attribute is required");let i=Dd(n,3);if(!Number.isInteger(i)||i<=0||s.length%i!==0)throw new Error("DracoWriter: POSITION attribute has an invalid size or value count");return s.length/i}_getPositionAttribute(e,t={}){for(let n in e){let s=e[n];if(this._getDracoAttributeType(n,t)===this.draco.POSITION&&Tu(s))return s}return null}_addGeometryMetadata(e,t){let n=new this.draco.Metadata;this._populateDracoMetadata(n,t),this.dracoMeshBuilder.AddMetadata(e,n)}_addAttributeMetadata(e,t,n){let s=new this.draco.Metadata;this._populateDracoMetadata(s,n),this.dracoMeshBuilder.SetMetadataForAttribute(e,t,s)}_populateDracoMetadata(e,t){for(let[n,s]of J3(t))switch(typeof s){case"number":Math.trunc(s)===s?this.dracoMetadataBuilder.AddIntEntry(e,n,s):this.dracoMetadataBuilder.AddDoubleEntry(e,n,s);break;case"object":s instanceof Int32Array&&this.dracoMetadataBuilder.AddIntEntryArray(e,n,s,s.length);break;default:this.dracoMetadataBuilder.AddStringEntry(e,n,s)}}}});async function r8(r,e={}){return(await NL(r,e)).data}async function NL(r,e={}){let{draco:t}=await hy(hn(e)),n=new Ma(t);try{return n.encodeSyncWithReport(PL(r),e.draco)}finally{n.destroy()}}async function n8(r,e={}){UL(e.signal);let t=[],n=0;for await(let s of aw([r],e))t.push(s),n++,e.onProgress?.({completed:n,total:r.length});return t}function aw(r,e={}){let t=i8(r);if(nb(ow,e)){let{onProgress:n,...s}=e;return eb(ow,t,s)}return CL(t,e)}async function*s8(r,e={}){let t=(async function*(){for await(let n of r)yield[n]})();for await(let n of aw(t,e))yield n.data}async function*CL(r,e={}){let{draco:t}=await hy(hn(e)),n=new Ma(t);try{for await(let s of r)for(let i of s)UL(e.signal),yield n.encodeSyncWithReport(i,e.draco)}finally{n.destroy()}}async function*i8(r){for await(let e of r)yield e.map(PL)}function UL(r){if(!r?.aborted)return;if(r.reason!==void 0)throw r.reason;let e=new Error("Draco batch encoding aborted");throw e.name="AbortError",e}function PL(r){if(o8(r))return pn(r);if(a8(r))return r;let{indices:e,...t}=r;return{attributes:t,...e?{indices:e}:{}}}function o8(r){return typeof r=="object"&&r!==null&&"shape"in r&&r.shape==="arrow-table"}function a8(r){return typeof r=="object"&&r!==null&&"attributes"in r&&typeof r.attributes=="object"&&r.attributes!==null&&!ArrayBuffer.isView(r.attributes)}var e8,ow,t8,VL=p(()=>{"use strict";Ue();mn();Js();kL();uu();cy();uy();e8={pointcloud:!1,attributeNameEntry:"name"},ow={...au,id:"draco-writer",name:"Draco compressed geometry writer",module:"scene",version:ou,worker:!0,workerNode:"draco-writer-worker-node.cjs",workerSourceNode:"draco/workers/draco-writer-worker-node.ts",options:{draco:{}}},t8={...au,name:"DRACO",version:ou,options:{draco:e8},encode:r8,encodeInBatches:s8}});var jL={};J(jL,{DracoWriter:()=>t8,DracoWriterWorker:()=>ow,encodeDraco:()=>NL,encodeDracoBatch:()=>n8,encodeDracoInBatches:()=>aw,encodeDracoInBatchesLocally:()=>CL});var GL=p(()=>{"use strict";VL()});var wU={};J(wU,{DRACO_EXTERNAL_LIBRARIES:()=>xt,DRACO_EXTERNAL_LIBRARY_URLS:()=>lB,DracoFormat:()=>Ud,DracoLoader:()=>Pd,DracoWorkerLoader:()=>cB,FetchError:()=>A.FetchError,GLBFormat:()=>Fa,GLBLoader:()=>nB,GLBWriter:()=>iB,GLTFFormat:()=>Ba,GLTFLoader:()=>IL,GLTFWriter:()=>rB,JSONLoader:()=>A.JSONLoader,MTLFormat:()=>Bd,MTLLoader:()=>Zy,MTLWorkerLoader:()=>TL,MaterialXLoader:()=>fB,NullLoader:()=>A.NullLoader,NullWorkerLoader:()=>A.NullWorkerLoader,OBJFormat:()=>La,OBJLoader:()=>Qy,OBJWorkerLoader:()=>xL,OBJWriter:()=>AL,RequestScheduler:()=>A.RequestScheduler,STLLoader:()=>dB,USDLoader:()=>Na,_BrowserFileSystem:()=>A._BrowserFileSystem,_fetchProgress:()=>A._fetchProgress,_selectSource:()=>A._selectSource,_unregisterLoaders:()=>A._unregisterLoaders,assert:()=>A.assert,concatenateArrayBuffersAsync:()=>A.concatenateArrayBuffersAsync,coreApi:()=>A.coreApi,createDataSource:()=>A.createDataSource,document:()=>A.document,encode:()=>A.encode,encodeInBatches:()=>A.encodeInBatches,encodeSync:()=>A.encodeSync,encodeTable:()=>A.encodeTable,encodeTableAsText:()=>A.encodeTableAsText,encodeTableInBatches:()=>A.encodeTableInBatches,encodeText:()=>A.encodeText,encodeTextSync:()=>A.encodeTextSync,encodeURLtoURL:()=>A.encodeURLtoURL,fetchFile:()=>A.fetchFile,forEach:()=>A.forEach,getLoaderOptions:()=>A.getLoaderOptions,getPathPrefix:()=>A.getPathPrefix,global:()=>A.global,isAsyncIterable:()=>A.isAsyncIterable,isBrowser:()=>A.isBrowser,isIterable:()=>A.isIterable,isIterator:()=>A.isIterator,isPromise:()=>A.isPromise,isPureObject:()=>A.isPureObject,isReadableStream:()=>A.isReadableStream,isResponse:()=>A.isResponse,isWorker:()=>A.isWorker,isWritableStream:()=>A.isWritableStream,load:()=>A.load,loadInBatches:()=>A.loadInBatches,makeIterator:()=>A.makeIterator,makeLineIterator:()=>A.makeLineIterator,makeNumberedLineIterator:()=>A.makeNumberedLineIterator,makeStream:()=>A.makeStream,makeTextDecoderIterator:()=>A.makeTextDecoderIterator,makeTextEncoderIterator:()=>A.makeTextEncoderIterator,parse:()=>A.parse,parseFile:()=>A.parseFile,parseInBatches:()=>A.parseInBatches,parseSync:()=>A.parseSync,preload:()=>A.preload,preloadSync:()=>A.preloadSync,readArrayBuffer:()=>A.readArrayBuffer,registerLoaders:()=>A.registerLoaders,resolvePath:()=>A.resolvePath,selectLoader:()=>A.selectLoader,selectLoaderSync:()=>A.selectLoaderSync,self:()=>A.self,setLoaderOptions:()=>A.setLoaderOptions,setPathPrefix:()=>A.setPathPrefix,window:()=>A.window});var A=wB(jw(),1);Yd();var La={name:"OBJ",id:"obj",module:"scene",encoding:"text",format:"obj",extensions:["obj"],mimeTypes:["text/plain"]};ea();var F3=typeof __VERSION__<"u"?__VERSION__:"latest";async function O3(){let{OBJLoaderWithParser:r}=await Promise.resolve().then(()=>(Xb(),Kb));return r}var Qy={...La,dataType:null,batchType:null,version:F3,worker:!0,workerInBatches:!0,serializeWorkerResult:Hi,text:!0,testText:M3,options:{obj:{shape:"arrow-table"}},preload:O3};function M3(r){return r[0]==="v"}var xL=Qy;var Bd={name:"MTL",id:"mtl",module:"mtl",encoding:"text",format:"mtl",extensions:["mtl"],mimeTypes:["text/plain"]};var D3=typeof __VERSION__<"u"?__VERSION__:"latest";async function R3(){let{MTLLoaderWithParser:r}=await Promise.resolve().then(()=>(Qb(),Yb));return r}var Zy={...Bd,dataType:null,batchType:null,version:D3,worker:!0,text:!0,testText:r=>r.includes("newmtl"),options:{mtl:{}},preload:R3},TL=Zy;mn();var k3=typeof __VERSION__<"u"?__VERSION__:"latest",AL={...La,dataType:null,batchType:null,version:k3,options:{obj:{}},text:!0,encode:async(r,e)=>_L(r,e),encodeSync:_L,encodeTextSync:vL};function _L(r,e){let t=vL(r,e);return new TextEncoder().encode(t).buffer}function vL(r,e){let t=pn(N3(r)),n=C3(t,"POSITION"),s=t.attributes.NORMAL,i=t.attributes.TEXCOORD_0,o=t.attributes.COLOR_0,a=n.value.length/n.size,c=["# loaders.gl OBJ"];for(let l=0;l<a;l++){let f=[Jn(n,l,0),Jn(n,l,1),Jn(n,l,2)];o&&f.push(ew(o,l,0),ew(o,l,1),ew(o,l,2)),c.push(`v ${f.join(" ")}`)}if(i)for(let l=0;l<a;l++)c.push(`vt ${Jn(i,l,0)} ${Jn(i,l,1)}`);if(s)for(let l=0;l<a;l++)c.push(`vn ${Jn(s,l,0)} ${Jn(s,l,1)} ${Jn(s,l,2)}`);let u=U3(t,a);for(let l=0;l<u.length;l+=3){let f=[tw(u[l],!!i,!!s),tw(u[l+1],!!i,!!s),tw(u[l+2],!!i,!!s)];c.push(`f ${f.join(" ")}`)}return`${c.join(`
54
54
  `)}