PageSourceSearch

https://softbees.dev/840.f269a1bff68f71b2.js

js softbees.dev collected 2026-10-06 13:56:28 UTC 82,245 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[840],{2840:(qn,_t,rt)=>{rt.r(_t),rt.d(_t,{CompressedGaussianSplats:()=>et,GSplineBuffer:()=>bt,GaussianPLYData:()=>W});var st=rt(1528),Qt=Object.create,nt=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,Xt=Object.getOwnPropertyNames,Kt=Object.getPrototypeOf,Jt=Object.prototype.hasOwnProperty,G=(t,a)=>()=>(a||t((a={exports:{}}).exports,a),a.exports),ht=(t,a)=>{for(var s in a)nt(t,s,{get:a[s],enumerable:!0})},T=(t,a,s)=>(s=null!=t?Qt(Kt(t)):{},((t,a,s,n)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let i of Xt(a))!Jt.call(t,i)&&undefined!==i&&nt(t,i,{get:()=>a[i],enumerable:!(n=Zt(a,i))||n.enumerable});return t})(!a&&t&&t.__esModule?s:nt(s,"default",{value:t,enumerable:!0}),t)),$=(t,a,s)=>(((t,a,s)=>{a in t?nt(t,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[a]=s})(t,"symbol"!=typeof a?a+"":a,s),s),sa=G((t,a)=>{a.exports=function s(n){for(var i=new Array(n),e=0;e<n;++e)i[e]=e;return i}}),na=G((t,a)=>{function s(i){return!!i.constructor&&"function"==typeof i.constructor.isBuffer&&i.constructor.isBuffer(i)}a.exports=function(i){return null!=i&&(s(i)||function n(i){return"function"==typeof i.readFloatLE&&"function"==typeof i.slice&&s(i.slice(0,0))}(i)||!!i._isBuffer)}}),J=G((t,a)=>{var s=sa(),n=na(),i=typeof Float64Array<"u";function e(p,l){return p[0]-l[0]}function o(){var c,p=this.stride,l=new Array(p.length);for(c=0;c<l.length;++c)l[c]=[Math.abs(p[c]),c];l.sort(e);var d=new Array(l.length);for(c=0;c<d.length;++c)d[c]=l[c][1];return d}function r(p,l){var c=["View",l,"d",p].join("");l<0&&(c="View_Nil"+p);var d="generic"===p;if(-1===l){var y="function "+c+"(a){this.data=a;};var proto="+c+".prototype;proto.dtype='"+p+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+c+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+c+"(a){return new "+c+"(a);}";return new Function(y)()}if(0===l)return y="function "+c+"(a,d) {this.data = a;this.offset = d};var proto="+c+".prototype;proto.dtype='"+p+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+c+"_copy() {return new "+c+"(this.data,this.offset)};proto.pick=function "+c+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+c+"_get(){return "+(d?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+c+"_set(v){return "+(d?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+c+"(a,b,c,d){return new "+c+"(a,d)}",new Function("TrivialArray",y)(u[p][0]);y=["'use strict'"];var g=s(l),m=g.map(function(k){return"i"+k}),b="this.offset+"+g.map(function(k){return"this.stride["+k+"]*i"+k}).join("+"),_=g.map(function(k){return"b"+k}).join(","),M=g.map(function(k){return"c"+k}).join(",");y.push("function "+c+"(a,"+_+","+M+",d){this.data=a","this.shape=["+_+"]","this.stride=["+M+"]","this.offset=d|0}","var proto="+c+".prototype","proto.dtype='"+p+"'","proto.dimension="+l),y.push("Object.defineProperty(proto,'size',{get:function "+c+"_size(){return "+g.map(function(k){return"this.shape["+k+"]"}).join("*"),"}})"),1===l?y.push("proto.order=[0]"):(y.push("Object.defineProperty(proto,'order',{get:"),l<4?(y.push("function "+c+"_order(){"),2===l?y.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===l&&y.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):y.push("ORDER})")),y.push("proto.set=function "+c+"_set("+m.join(",")+",v){"),y.push(d?"return this.data.set("+b+",v)}":"return this.data["+b+"]=v}"),y.push("proto.get=function "+c+"_get("+m.join(",")+"){"),y.push(d?"return this.data.get("+b+")}":"return this.data["+b+"]}"),y.push("proto.index=function "+c+"_index(",m.join(),"){return "+b+"}"),y.push("proto.hi=function "+c+"_hi("+m.join(",")+"){return new "+c+"(this.data,"+g.map(function(k){return["(typeof i",k,"!=='number'||i",k,"<0)?this.shape[",k,"]:i",k,"|0"].join("")}).join(",")+","+g.map(function(k){return"this.stride["+k+"]"}).join(",")+",this.offset)}");var x=g.map(function(k){return"a"+k+"=this.shape["+k+"]"}),w=g.map(function(k){return"c"+k+"=this.stride["+k+"]"});y.push("proto.lo=function "+c+"_lo("+m.join(",")+"){var b=this.offset,d=0,"+x.join(",")+","+w.join(","));for(var v=0;v<l;++v)y.push("if(typeof i"+v+"==='number'&&i"+v+">=0){d=i"+v+"|0;b+=c"+v+"*d;a"+v+"-=d}");for(y.push("return new "+c+"(this.data,"+g.map(function(k){return"a"+k}).join(",")+","+g.map(function(k){return"c"+k}).join(",")+",b)}"),y.push("proto.step=function "+c+"_step("+m.join(",")+"){var "+g.map(function(k){return"a"+k+"=this.shape["+k+"]"}).join(",")+","+g.map(function(k){return"b"+k+"=this.stride["+k+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil"),v=0;v<l;
1++v)y.push("if(typeof i"+v+"==='number'){d=i"+v+"|0;if(d<0){c+=b"+v+"*(a"+v+"-1);a"+v+"=ceil(-a"+v+"/d)}else{a"+v+"=ceil(a"+v+"/d)}b"+v+"*=d}");y.push("return new "+c+"(this.data,"+g.map(function(k){return"a"+k}).join(",")+","+g.map(function(k){return"b"+k}).join(",")+",c)}");var A=new Array(l),S=new Array(l);for(v=0;v<l;++v)A[v]="a[i"+v+"]",S[v]="b[i"+v+"]";for(y.push("proto.transpose=function "+c+"_transpose("+m+"){"+m.map(function(k,F){return k+"=("+k+"===undefined?"+F+":"+k+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+c+"(this.data,"+A.join(",")+","+S.join(",")+",this.offset)}"),y.push("proto.pick=function "+c+"_pick("+m+"){var a=[],b=[],c=this.offset"),v=0;v<l;++v)y.push("if(typeof i"+v+"==='number'&&i"+v+">=0){c=(c+this.stride["+v+"]*i"+v+")|0}else{a.push(this.shape["+v+"]);b.push(this.stride["+v+"])}");return y.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),y.push("return function construct_"+c+"(data,shape,stride,offset){return new "+c+"(data,"+g.map(function(k){return"shape["+k+"]"}).join(",")+","+g.map(function(k){return"stride["+k+"]"}).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",y.join("\n"))(u[p],o)}var u={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};a.exports=function f(p,l,c,d){if(void 0===p)return(0,u.array[0])([]);"number"==typeof p&&(p=[p]),void 0===l&&(l=[p.length]);var y=l.length;if(void 0===c){c=new Array(y);for(var g=y-1,m=1;g>=0;--g)c[g]=m,m*=l[g]}if(void 0===d)for(d=0,g=0;g<y;++g)c[g]<0&&(d-=(l[g]-1)*c[g]);for(var b=function h(p){if(n(p))return"buffer";if(i)switch(Object.prototype.toString.call(p)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(p)?"array":"generic"}(p),_=u[b];_.length<=y+1;)_.push(r(b,_.length-1));return(0,_[y+1])(p,l,c,d)}}),ia=G((t,a)=>{a.exports=function i(e,o,r){return 0===e.length?e:o?(r||e.sort(o),function s(e,o){for(var r=1,h=e.length,u=e[0],f=e[0],p=1;p<h;++p)if(f=u,o(u=e[p],f)){if(p===r){r++;continue}e[r++]=u}return e.length=r,e}(e,o)):(r||e.sort(),function n(e){for(var o=1,r=e.length,h=e[0],u=e[0],f=1;f<r;++f,u=h)if(u=h,(h=e[f])!==u){if(f===o){o++;continue}e[o++]=h}return e.length=o,e}(e))}}),ea=G((t,a)=>{var s=ia();function n(u,f,p){var _,M,l=u.length,c=f.arrayArgs.length,d=f.indexArgs.length>0,y=[],g=[],m=0,b=0;for(_=0;_<l;++_)g.push(["i",_,"=0"].join(""));for(M=0;M<c;++M)for(_=0;_<l;++_)b=m,m=u[_],g.push(0===_?["d",M,"s",_,"=t",M,"p",m].join(""):["d",M,"s",_,"=(t",M,"p",m,"-s",b,"*t",M,"p",b,")"].join(""));for(g.length>0&&y.push("var "+g.join(",")),_=l-1;_>=0;--_)y.push(["for(i",_,"=0;i",_,"<s",m=u[_],";++i",_,"){"].join(""));for(y.push(p),_=0;_<l;++_){for(b=m,m=u[_],M=0;M<c;++M)y.push(["p",M,"+=d",M,"s",_].join(""));d&&(_>0&&y.push(["index[",b,"]-=s",b].join("")),y.push(["++index[",m,"]"].join(""))),y.push("}")}return y.join("\n")}function o(u,f,p){for(var l=u.body,c=[],d=[],y=0;y<u.args.length;++y){var g=u.args[y];if(!(g.count<=0)){var m=new RegExp(g.name,"g"),b="",_=f.arrayArgs.indexOf(y);switch(f.argTypes[y]){case"offset":var M=f.offsetArgIndex.indexOf(y);_=f.offsetArgs[M].array,b="+q"+M;case"array":b="p"+_+b;var w="l"+y,v="a"+_;if(0===f.arrayBlockIndices[_])1===g.count?"generic"===p[_]?g.lvalue?(c.push(["var ",w,"=",v,".get(",b,")"].join("")),l=l.replace(m,w),d.push([v,".set(",b,",",w,")"].join(""))):l=l.replace(m,[v,".get(",b,")"].join("")):l=l.replace(m,[v,"[",b,"]"].join("")):"generic"===p[_]?(c.push(["var ",w,"=",v,".get(",b,")"].join("")),l=l.replace(m,w),g.lvalue&&d.push([v,".set(",b,",",w,")"].join(""))):(c.push(["var ",w,"=",v,"[",b,"]"].join("")),l=l.replace(m,w),g.lvalue&&d.push([v,"[",b,"]=",w].join("")));else{for(var A=[g.name],S=[b],z=0;z<Math.abs(f.arrayBlockIndices[_]);z++)A.push("\\s*\\[([^\\]]+)\\]"),S.push("$"+(z+1)+"*t"+_+"b"+z);if(m=new RegExp(A.join(""),"g"),b=S.join("+"),"generic"===p[_])throw new Error("cwise: Generic arrays not supported in combination with blocks!");l=l.replace(m,[v,"[",b,"]"].join(""))}break;case"scalar":l=l.replace(m,"Y"+f.scalarArgs.indexOf(y));break;case"index":l=l.replace(m,"index");break;case"shape":l=l.replace(m,"shape")}}}return[c.join("\n"),l,d.join("\n")].join("\n").trim()}function r(u){for(var f=new Array(u.length),p=!0,l=0;l<u.length;++l){var c=u[l],d=c.match(/\d+/);
1d=d?d[0]:"",f[l]=0===c.charAt(0)?"u"+c.charAt(1)+d:c.charAt(0)+d,l>0&&(p=p&&f[l]===f[l-1])}return p?f[0]:f.join("")}a.exports=function h(u,f){for(var p=f[1].length-Math.abs(u.arrayBlockIndices[0])|0,l=new Array(u.arrayArgs.length),c=new Array(u.arrayArgs.length),d=0;d<u.arrayArgs.length;++d)c[d]=f[2*d],l[d]=f[2*d+1];var y=[],g=[],m=[],b=[],_=[];for(d=0;d<u.arrayArgs.length;++d){u.arrayBlockIndices[d]<0?(m.push(0),b.push(p),y.push(p),g.push(p+u.arrayBlockIndices[d])):(m.push(u.arrayBlockIndices[d]),b.push(u.arrayBlockIndices[d]+p),y.push(0),g.push(u.arrayBlockIndices[d]));for(var M=[],x=0;x<l[d].length;x++)m[d]<=l[d][x]&&l[d][x]<b[d]&&M.push(l[d][x]-m[d]);_.push(M)}var w=["SS"],v=["'use strict'"],A=[];for(x=0;x<p;++x)A.push(["s",x,"=SS[",x,"]"].join(""));for(d=0;d<u.arrayArgs.length;++d){for(w.push("a"+d),w.push("t"+d),w.push("p"+d),x=0;x<p;++x)A.push(["t",d,"p",x,"=t",d,"[",m[d]+x,"]"].join(""));for(x=0;x<Math.abs(u.arrayBlockIndices[d]);++x)A.push(["t",d,"b",x,"=t",d,"[",y[d]+x,"]"].join(""))}for(d=0;d<u.scalarArgs.length;++d)w.push("Y"+d);if(u.shapeArgs.length>0&&A.push("shape=SS.slice(0)"),u.indexArgs.length>0){var S=new Array(p);for(d=0;d<p;++d)S[d]="0";A.push(["index=[",S.join(","),"]"].join(""))}for(d=0;d<u.offsetArgs.length;++d){var z=u.offsetArgs[d],k=[];for(x=0;x<z.offset.length;++x)0!==z.offset[x]&&k.push(1===z.offset[x]?["t",z.array,"p",x].join(""):[z.offset[x],"*t",z.array,"p",x].join(""));A.push(0===k.length?"q"+d+"=0":["q",d,"=",k.join("+")].join(""))}var F=s([].concat(u.pre.thisVars).concat(u.body.thisVars).concat(u.post.thisVars));for((A=A.concat(F)).length>0&&v.push("var "+A.join(",")),d=0;d<u.arrayArgs.length;++d)v.push("p"+d+"|=0");u.pre.body.length>3&&v.push(o(u.pre,u,c));var N=o(u.body,u,c),q=function e(u){for(var f=0,p=u[0].length;f<p;){for(var l=1;l<u.length;++l)if(u[l][f]!==u[0][f])return f;++f}return f}(_);v.push(q<p?function i(u,f,p,l){for(var c=f.length,d=p.arrayArgs.length,y=p.blockSize,g=p.indexArgs.length>0,m=[],b=0;b<d;++b)m.push(["var offset",b,"=p",b].join(""));for(b=u;b<c;++b)m.push(["for(var j"+b+"=SS[",f[b],"]|0;j",b,">0;){"].join("")),m.push(["if(j",b,"<",y,"){"].join("")),m.push(["s",f[b],"=j",b].join("")),m.push(["j",b,"=0"].join("")),m.push(["}else{s",f[b],"=",y].join("")),m.push(["j",b,"-=",y,"}"].join("")),g&&m.push(["index[",f[b],"]=j",b].join(""));for(b=0;b<d;++b){for(var _=["offset"+b],M=u;M<c;++M)_.push(["j",M,"*t",b,"p",f[M]].join(""));m.push(["p",b,"=(",_.join("+"),")"].join(""))}for(m.push(n(f,p,l)),b=u;b<c;++b)m.push("}");return m.join("\n")}(q,_[0],u,N):n(_[0],u,N)),u.post.body.length>3&&v.push(o(u.post,u,c)),u.debug&&console.log("-----Generated cwise routine for ",f,":\n"+v.join("\n")+"\n----------");var E=[u.funcName||"unnamed","_cwise_loop_",l[0].join("s"),"m",q,r(c)].join("");return new Function(["function ",E,"(",w.join(","),"){",v.join("\n"),"} return ",E].join(""))()}}),oa=G((t,a)=>{var s=ea();a.exports=function n(i){var e=["'use strict'","var CACHED={}"],o=[];e.push(["return function ",i.funcName+"_cwise_thunk","(",i.shimArgs.join(","),"){"].join(""));for(var h=[],u=[],f=[["array",i.arrayArgs[0],".shape.slice(",Math.max(0,i.arrayBlockIndices[0]),i.arrayBlockIndices[0]<0?","+i.arrayBlockIndices[0]+")":")"].join("")],p=[],l=[],c=0;c<i.arrayArgs.length;++c){var d=i.arrayArgs[c];o.push(["t",d,"=array",d,".dtype,","r",d,"=array",d,".order"].join("")),h.push("t"+d),h.push("r"+d),u.push("t"+d),u.push("r"+d+".join()"),f.push("array"+d+".data"),f.push("array"+d+".stride"),f.push("array"+d+".offset|0"),c>0&&(p.push("array"+i.arrayArgs[0]+".shape.length===array"+d+".shape.length+"+(Math.abs(i.arrayBlockIndices[0])-Math.abs(i.arrayBlockIndices[c]))),l.push("array"+i.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,i.arrayBlockIndices[0])+"]===array"+d+".shape[shapeIndex+"+Math.max(0,i.arrayBlockIndices[c])+"]"))}for(i.arrayArgs.length>1&&(e.push("if (!("+p.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+i.arrayArgs[0]+".shape.length-"+Math.abs(i.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),c=0;c<i.scalarArgs.length;++c)f.push("scalar"+i.scalarArgs[c]);return o.push(["type=[",u.join(","),"].join()"].join("")),o.push("proc=CACHED[type]"),e.push("var "+o.join(",")),e.push(["if(!proc){","CACHED[type]=proc=compile([",h.join(","),"])}","return proc(",f.join(","),")}"].join("")),i.debug&&console.log("-----Generated thunk:\n"+e.join("\n")+"\n----------"),new Function("c
1ompile",e.join("\n"))(s.bind(void 0,i))}}),ra=G((t,a)=>{var s=oa();function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}a.exports=function i(e){var o=new n;o.pre=e.pre,o.body=e.body,o.post=e.post;var r=e.args.slice(0);o.argTypes=r;for(var h=0;h<r.length;++h){var u=r[h];if("array"===u||"object"==typeof u&&u.blockIndices){if(o.argTypes[h]="array",o.arrayArgs.push(h),o.arrayBlockIndices.push(u.blockIndices?u.blockIndices:0),o.shimArgs.push("array"+h),h<o.pre.args.length&&o.pre.args[h].count>0)throw new Error("cwise: pre() block may not reference array args");if(h<o.post.args.length&&o.post.args[h].count>0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===u)o.scalarArgs.push(h),o.shimArgs.push("scalar"+h);else if("index"===u){if(o.indexArgs.push(h),h<o.pre.args.length&&o.pre.args[h].count>0)throw new Error("cwise: pre() block may not reference array index");if(h<o.body.args.length&&o.body.args[h].lvalue)throw new Error("cwise: body() block may not write to array index");if(h<o.post.args.length&&o.post.args[h].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===u){if(o.shapeArgs.push(h),h<o.pre.args.length&&o.pre.args[h].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(h<o.body.args.length&&o.body.args[h].lvalue)throw new Error("cwise: body() block may not write to array shape");if(h<o.post.args.length&&o.post.args[h].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof u||!u.offset)throw new Error("cwise: Unknown argument type "+r[h]);o.argTypes[h]="offset",o.offsetArgs.push({array:u.array,offset:u.offset}),o.offsetArgIndex.push(h)}}if(o.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(o.pre.args.length>r.length)throw new Error("cwise: Too many arguments in pre() block");if(o.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(o.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return o.debug=!!e.printCode||!!e.debug,o.funcName=e.funcName||"cwise",o.blockSize=e.blockSize||64,s(o)}}),tt=G(t=>{var a=ra(),s={body:"",args:[],thisVars:[],localVars:[]};function n(l){if(!l)return s;for(var c=0;c<l.args.length;++c){var d=l.args[c];l.args[c]=0===c?{name:d,lvalue:!0,rvalue:!!l.rvalue,count:l.count||1}:{name:d,lvalue:!1,rvalue:!0,count:1}}return l.thisVars||(l.thisVars=[]),l.localVars||(l.localVars=[]),l}function e(l){for(var c=[],d=0;d<l.args.length;++d)c.push("a"+d);return new Function("P",["return function ",l.funcName,"_ndarrayops(",c.join(","),") {P(",c.join(","),");return a0}"].join(""))(function i(l){return a({args:l.args,pre:n(l.pre),body:n(l.body),post:n(l.proc),funcName:l.funcName})}(l))}var o={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var l in o){var c=o[l];t[l]=e({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+c+"c"},funcName:l}),t[l+"eq"]=e({args:["array","array"],body:{args:["a","b"],body:"a"+c+"=b"},rvalue:!0,funcName:l+"eq"}),t[l+"s"]=e({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+c+"s"},funcName:l+"s"}),t[l+"seq"]=e({args:["array","scalar"],body:{args:["a","s"],body:"a"+c+"=s"},rvalue:!0,funcName:l+"seq"})}}();var r={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var l in r){var c=r[l];t[l]=e({args:["array","array"],body:{args:["a","b"],body:"a="+c+"b"},funcName:l}),t[l+"eq"]=e({args:["array"],body:{args:["a"],body:"a="+c+"a"},rvalue:!0,count:2,funcName:l+"eq"})}}();var h={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var l in h){var c=h[l];t[l]=e({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+c+"c"},funcName:l}),t[l+"s"]=e({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+c+"s"},funcName:l+"s"}),t[l+"eq"]=e({args:["array","array"],body:{args:["a","b"],body:"a=a"+c+"b"},rvalue:!0,count:2,funcName:l+"eq"}),t[l+"seq"]=e({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+c+"s"},rvalue:!0,count:2,funcName:l+"seq"})}}();var u=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var l=0;l<u.length;++l){var c=u[l];t[c]=e({args:["array","array"],pre:{args:[],body:"this_f=Math."+c,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:c}),t[c+"eq"]=e({args:["array"],pre:{args:[],body:"this_f=Math."+c,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:c+"eq"})}}();var f=["max","min","atan2","pow"];!function(){for(var l=0;l<f.length;++l){var c=f[l];t[c]=e({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+c,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:c}),t[c+"s"]=e({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+c,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:c+"s"}),t[c+"eq"]=e({args:["array","array"],pre:{args:[],body:"this_f=Math."+c,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:c+"eq"}),t[c+"seq"]=e({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+c,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:c+"seq"})}}();var p=["atan2","pow"];(function(){for(var l=0;l<p.length;++l){var c=p[l];t[c+"op"]=e({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+c,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:c+"op"}),t[c+"ops"]=e({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+c,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:c+"ops"}),t[c+"opeq"]=e({args:["array","array"],pre:{args:[],body:"this_f=Math."+c,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:c+"opeq"}),t[c+"opseq"]=e({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+c,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:c+"opseq"})}})(),t.any=a({args:["array"],pre:s,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),t.all=a({args:["array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),t.sum=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),t.prod=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),t.norm2squared=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),t.norm2=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),t.norminf=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),t.norm1=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),t.sup=a({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),t.inf=a({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),t.argmin=a({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),t.argmax=a({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),t.random=e({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),t.assign=e({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),t.assigns=e({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),t.equals=a({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})}),P=T(J(),1),R=T(tt(),1),U=T(J(),1),j=T(tt(),1),it=class{constructor(t,a,s){this._dataNormalized=t,this._minD=a,this._maxD=s}static createFromUnnormalized(t){let a=j.sup(t),s=j.inf(t),n=(0,U.default)(new Float32Array(t.size),t.shape),i=a-s;return i<1e-4?j.assigns(n,0):(j.subs(n,t,s),j.divs(n,n,i)),new it(n,s,a)}get data(){return this._dataNormalized}get minD(){return this._minD}get maxD(){return this._maxD}denormalize(){let t=(0,U.default)(new Float32Array(this._dataNormalized.size),this._dataNormalized.shape);return j.muls(t,this._dataNormalized,this._maxD-this._minD),j.adds(t,t,this._minD),t}},B=class{constructor(t,a){this._quantized=t,this._method=a}get quantized(){return this._quantized}static maxIntBits(t){return 2**t-1}static fromNormalized(t,a){let n,s=t.data;if("norm8x"===a){let i=B.maxIntBits(8),e=(0,U.default)(new Float32Array(s.size),s.shape);j.muls(e,s,i),j.roundeq(e),n=(0,U.default)(new Uint8Array(e.data),s.shape)}else if("norm565"===a){let i=(0,U.default)(new Float32Array(s.size),s.shape);j.assign(i,s),j.mulseq(i.pick(null,0),B.maxIntBits(5)),j.mulseq(i.pick(null,1),B.maxIntBits(6)),j.mulseq(i.pick(null,2),B.maxIntBits(5)),j.roundeq(i);let e=(0,U.default)(new Uint16Array(i.data),s.shape),o=(0,U.default)(new Uint16Array(s.shape[0]),[s.shape[0]]),r=(0,U.default)(new Uint16Array(s.shape[0]),[s.shape[0]]);j.lshifts(o,e.pick(null,0),11),j.lshifts(r,e.pick(null,1),5),j.boreq(o,r),j.boreq(o,e.pick(null,2)),n=o}else{let i=(0,U.default)(new Float32Array(s.size),s.shape);j.assign(i,s),j.mulseq(i.pick(null,0),B.maxIntBits(11)),j.mulseq(i.pick(null,1),B.maxIntBits(10)),j.mulseq(i.pick(null,2),B.maxIntBits(11)),j.roundeq(i);let e=(0,U.default)(new Uint32Array(i.data),s.shape),o=(0,U.default)(new Uint32Array(s.shape[0]),[s.shape[0]]),r=(0,U.default)(new Uint32Array(s.shape[0]),[s.shape[0]]);j.lshifts(o,e.pick(null,0),21),j.lshifts(r,e.pick(null,1),11),j.boreq(o,r),j.boreq(o,e.pick(null,2)),n=o}return new B(n,a)}dequantize(t,a){let n,s=this._method,i=this._quantized;
1if("norm8x"===s){let e=B.maxIntBits(8);n=(0,U.default)(new Float32Array(i.size),i.shape),j.muls(n,i,1/e)}else if("norm565"===s){let e=(0,U.default)(new Uint8Array(i.shape[0]),[i.shape[0]]),o=(0,U.default)(new Uint8Array(i.shape[0]),[i.shape[0]]),r=(0,U.default)(new Uint8Array(i.shape[0]),[i.shape[0]]);j.rrshifts(e,i,11),j.rrshifts(o,i,5),j.bandseq(o,B.maxIntBits(6)),j.bands(r,i,B.maxIntBits(5)),n=(0,U.default)(new Float32Array(3*i.shape[0]),[i.shape[0],3]),j.muls(n.pick(null,0),e,1/B.maxIntBits(5)),j.muls(n.pick(null,1),o,1/B.maxIntBits(6)),j.muls(n.pick(null,2),r,1/B.maxIntBits(5))}else{let e=(0,U.default)(new Uint16Array(i.shape[0]),[i.shape[0]]),o=(0,U.default)(new Uint16Array(i.shape[0]),[i.shape[0]]),r=(0,U.default)(new Uint16Array(i.shape[0]),[i.shape[0]]);j.rrshifts(e,i,21),j.rrshifts(o,i,11),j.bandseq(o,B.maxIntBits(10)),j.bands(r,i,B.maxIntBits(11)),n=(0,U.default)(new Float32Array(3*i.shape[0]),[i.shape[0],3]),j.muls(n.pick(null,0),e,1/B.maxIntBits(11)),j.muls(n.pick(null,1),o,1/B.maxIntBits(10)),j.muls(n.pick(null,2),r,1/B.maxIntBits(11))}return new it(n,t,a)}},L=class{constructor(t,a,s,n,i,e=!1){this._quantized=t,this._minMaxMatrix=a,this._chunkSize=s,this._quantizationMethod=n,this._variableChunkSize=i,this._isDynamicChunks=e}get length(){return this._quantized.shape[0]}get nchunks(){return this._minMaxMatrix.shape[0]}get quantized(){return this._quantized}get method(){return this._quantizationMethod}get minmaxMatrix(){return this._minMaxMatrix}_createPrunedMinMax(t){let s=this.minmaxMatrix.shape[0]-t.length,n=(0,P.default)(new Float32Array(2*s),[s,2]),i=0,e=s,o=0,r=this.minmaxMatrix.shape[0];for(let h=0;h<t.length;h++)r=t[h],e=r-o+i,e>i&&R.assign(n.hi(e,2).lo(i,0),this.minmaxMatrix.hi(r,2).lo(o,0)),i=e,o=r+1;return i<s&&R.assign(n.lo(i,0),this.minmaxMatrix.lo(o,0)),n}_createPrunedQuantized(t){let i,e,s=this.quantized.shape[0]-t.length,n=this._quantizationMethod;"norm8x"===n?(e=this._quantized.shape[1],i=(0,P.default)(new Uint8Array(e?s*e:s),e?[s,e]:[s,1])):i=(0,P.default)("norm565"===n?new Uint16Array(s):new Uint32Array(s),[s]);let o=0,r=s,h=0,u=i.shape[0];for(let f=0;f<t.length;f++)u=t[f],r=u-h+o,r>o&&(e?R.assign(i.hi(r,e).lo(o,0),this._quantized.hi(u,e).lo(h,0)):R.assign(i.hi(r).lo(o),this._quantized.hi(u).lo(h))),o=r,h=u+1;return o<s&&(e?R.assign(i.lo(o,0),this._quantized.lo(h,0)):R.assign(i.lo(o),this._quantized.lo(h))),i}pruneFeature(t,a,s){let n=this._createPrunedQuantized(t),i=this._createPrunedMinMax(a);return new L(n,i,this._chunkSize,this._quantizationMethod,s,!0)}static getRequiredNChunks(t,a){return Math.floor(t/a)}static fromArray(t,a,s){let o,n=t.shape[0],i=Math.floor(n/s),e=(0,P.default)(new Float32Array(2*i),[i,2],[2,1]);o="norm8x"===a?(0,P.default)(new Uint8Array(t.size),t.shape):(0,P.default)("norm565"===a?new Uint16Array(t.shape[0]):new Uint32Array(t.shape[0]),[t.shape[0]]);for(let r=0;r<i;r++){let f,h=r*s,u=r+1<i?(r+1)*s:n;f=it.createFromUnnormalized(t.shape.length>1?t.hi(u,t.shape[1]).lo(h,0):t.hi(u).lo(h)),e.set(r,0,f.minD),e.set(r,1,f.maxD),R.assign(o.shape.length>1?o.hi(u,o.shape[1]).lo(h,0):o.hi(u).lo(h),B.fromNormalized(f,a).quantized)}return new L(o,e,s,a)}denormDequant(){let e,o,t=this._minMaxMatrix.shape[0],a=this._quantized,s=a.shape[0],n=this._quantizationMethod,i=this._chunkSize;if(this._isDynamicChunks){if(!this._variableChunkSize)throw new Error("variable chunk must exists if chunkSize isDynamic");e=this._variableChunkSize}o="norm8x"===n?(0,P.default)(new Float32Array(a.size),a.shape):(0,P.default)(new Float32Array(3*s),[s,3]);let r=0,h=i;for(let u=0;u<t;u++){let[f,p]=[this._minMaxMatrix.get(u,0),this._minMaxMatrix.get(u,1)];this._isDynamicChunks&&(h=e[u]);let c,l=u+1<t?r+h:s;c=new B(a.shape.length>1?a.hi(l,a.shape[1]).lo(r,0):a.hi(l).lo(r),n),R.assign(o.hi(l,o.shape[1]).lo(r,0),c.dequantize(f,p).denormalize()),r=l}return o}static fetchArrayBuffer(t){return(0,st.c)(function*(){return yield(yield fetch(t,{mode:"cors"})).arrayBuffer()})()}},H=T(J(),1),V=T(tt(),1),Z=T(J(),1),C=T(tt(),1),vt=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9];function Mt(t){return t<1e5?t<100?t<10?0:1:t<1e4?t<1e3?2:3:4:t<1e7?t<1e6?5:6:t<1e9?t<1e8?7:8:9}
1function xt(t,a){if(t===a)return 0;if(~~t===t&&~~a===a){if(0===t||0===a)return t<a?-1:1;if(t<0||a<0){if(a>=0)return-1;if(t>=0)return 1;t=-t,a=-a}let i=Mt(t),e=Mt(a),o=0;return i<e?(t*=vt[e-i-1],a/=10,o=-1):i>e&&(a*=vt[i-e-1],t/=10,o=1),t===a?o:t<a?-1:1}let s=String(t),n=String(a);return s===n?0:s<n?-1:1}function wt(t,a,s,n){let i=a+1;if(i===s)return 1;if(n(t[i++],t[a])<0){for(;i<s&&n(t[i],t[i-1])<0;)i++;!function la(t,a,s){for(s--;a<s;){let n=t[a];t[a++]=t[s],t[s--]=n}}(t,a,i)}else for(;i<s&&n(t[i],t[i-1])>=0;)i++;return i-a}function kt(t,a,s,n,i){for(n===a&&n++;n<s;n++){let e=t[n],o=a,r=n;for(;o<r;){let u=o+r>>>1;i(e,t[u])<0?r=u:o=u+1}let h=n-o;switch(h){case 3:t[o+3]=t[o+2];case 2:t[o+2]=t[o+1];case 1:t[o+1]=t[o];break;default:for(;h>0;)t[o+h]=t[o+h-1],h--}t[o]=e}}function ut(t,a,s,n,i,e){let o=0,r=0,h=1;if(e(t,a[s+i])>0){for(r=n-i;h<r&&e(t,a[s+i+h])>0;)o=h,h=1+(h<<1),h<=0&&(h=r);h>r&&(h=r),o+=i,h+=i}else{for(r=i+1;h<r&&e(t,a[s+i-h])<=0;)o=h,h=1+(h<<1),h<=0&&(h=r);h>r&&(h=r);let u=o;o=i-h,h=i-u}for(o++;o<h;){let u=o+(h-o>>>1);e(t,a[s+u])>0?o=u+1:h=u}return h}function lt(t,a,s,n,i,e){let o=0,r=0,h=1;if(e(t,a[s+i])<0){for(r=i+1;h<r&&e(t,a[s+i-h])<0;)o=h,h=1+(h<<1),h<=0&&(h=r);h>r&&(h=r);let u=o;o=i-h,h=i-u}else{for(r=n-i;h<r&&e(t,a[s+i+h])>=0;)o=h,h=1+(h<<1),h<=0&&(h=r);h>r&&(h=r),o+=i,h+=i}for(o++;o<h;){let u=o+(h-o>>>1);e(t,a[s+u])<0?h=u:o=u+1}return h}var ca=class{constructor(t,a){$(this,"array",null),$(this,"compare",null),$(this,"minGallop",7),$(this,"length",0),$(this,"tmpStorageLength",256),$(this,"stackLength",0),$(this,"runStart",null),$(this,"runLength",null),$(this,"stackSize",0),this.array=t,this.compare=a,this.length=t.length,this.length<512&&(this.tmpStorageLength=this.length>>>1),this.tmp=new Array(this.tmpStorageLength),this.stackLength=this.length<120?5:this.length<1542?10:this.length<119151?19:40,this.runStart=new Array(this.stackLength),this.runLength=new Array(this.stackLength)}pushRun(t,a){this.runStart[this.stackSize]=t,this.runLength[this.stackSize]=a,this.stackSize+=1}mergeRuns(){for(;this.stackSize>1;){let t=this.stackSize-2;if(t>=1&&this.runLength[t-1]<=this.runLength[t]+this.runLength[t+1]||t>=2&&this.runLength[t-2]<=this.runLength[t]+this.runLength[t-1])this.runLength[t-1]<this.runLength[t+1]&&t--;else if(this.runLength[t]>this.runLength[t+1])break;this.mergeAt(t)}}forceMergeRuns(){for(;this.stackSize>1;){let t=this.stackSize-2;t>0&&this.runLength[t-1]<this.runLength[t+1]&&t--,this.mergeAt(t)}}mergeAt(t){let a=this.compare,s=this.array,n=this.runStart[t],i=this.runLength[t],e=this.runStart[t+1],o=this.runLength[t+1];this.runLength[t]=i+o,t===this.stackSize-3&&(this.runStart[t+1]=this.runStart[t+2],this.runLength[t+1]=this.runLength[t+2]),this.stackSize--;let r=lt(s[e],s,n,i,0,a);n+=r,i-=r,0!==i&&(o=ut(s[n+i-1],s,e,o,o-1,a),0!==o&&(i<=o?this.mergeLow(n,i,e,o):this.mergeHigh(n,i,e,o)))}mergeLow(t,a,s,n){let i=this.compare,e=this.array,o=this.tmp,r=0;for(r=0;r<a;r++)o[r]=e[t+r];let h=0,u=s,f=t;if(e[f++]=e[u++],0==--n){for(r=0;r<a;r++)e[f+r]=o[h+r];return}if(1===a){for(r=0;r<n;r++)e[f+r]=e[u+r];return void(e[f+n]=o[h])}let p=this.minGallop;for(;;){let l=0,c=0,d=!1;do{if(i(e[u],o[h])<0){if(e[f++]=e[u++],c++,l=0,0==--n){d=!0;break}}else if(e[f++]=o[h++],l++,c=0,1==--a){d=!0;break}}while((l|c)<p);if(d)break;do{if(l=lt(e[u],o,h,a,0,i),0!==l){for(r=0;r<l;r++)e[f+r]=o[h+r];if(f+=l,h+=l,(a-=l)<=1){d=!0;break}}if(e[f++]=e[u++],0==--n){d=!0;break}if(c=ut(o[h],e,u,n,0,i),0!==c){for(r=0;r<c;r++)e[f+r]=e[u+r];if(f+=c,u+=c,0==(n-=c)){d=!0;break}}if(e[f++]=o[h++],1==--a){d=!0;break}p--}while(l>=7||c>=7);if(d)break;p<0&&(p=0),p+=2}if(this.minGallop=p,p<1&&(this.minGallop=1),1===a){for(r=0;r<n;r++)e[f+r]=e[u+r];e[f+n]=o[h]}else{if(0===a)throw new Error("mergeLow preconditions were not respected");for(r=0;r<a;r++)e[f+r]=o[h+r]}}mergeHigh(t,a,s,n){let i=this.compare,e=this.array,o=this.tmp,r=0;for(r=0;r<n;r++)o[r]=e[s+r];let h=t+a-1,u=n-1,f=s+n-1,p=0,l=0;if(e[f--]=e[h--],0==--a){for(p=f-(n-1),r=0;r<n;r++)e[p+r]=o[r];return}if(1===n){for(f-=a,h-=a,l=f+1,p=h+1,r=a-1;r>=0;r--)e[l+r]=e[p+r];return void(e[f]=o[u])}let c=this.minGallop;for(;;){let d=0,y=0,g=!1;
1do{if(i(o[u],e[h])<0){if(e[f--]=e[h--],d++,y=0,0==--a){g=!0;break}}else if(e[f--]=o[u--],y++,d=0,1==--n){g=!0;break}}while((d|y)<c);if(g)break;do{if(d=a-lt(o[u],e,t,a,a-1,i),0!==d){for(f-=d,h-=d,a-=d,l=f+1,p=h+1,r=d-1;r>=0;r--)e[l+r]=e[p+r];if(0===a){g=!0;break}}if(e[f--]=o[u--],1==--n){g=!0;break}if(y=n-ut(e[h],o,0,n,n-1,i),0!==y){for(f-=y,u-=y,n-=y,l=f+1,p=u+1,r=0;r<y;r++)e[l+r]=o[p+r];if(n<=1){g=!0;break}}if(e[f--]=e[h--],0==--a){g=!0;break}c--}while(d>=7||y>=7);if(g)break;c<0&&(c=0),c+=2}if(this.minGallop=c,c<1&&(this.minGallop=1),1===n){for(f-=a,h-=a,l=f+1,p=h+1,r=a-1;r>=0;r--)e[l+r]=e[p+r];e[f]=o[u]}else{if(0===n)throw new Error("mergeHigh preconditions were not respected");for(p=f-(n-1),r=0;r<n;r++)e[p+r]=o[r]}}};function ct(t){let a=(0,Z.default)(new Int32Array(t.shape[0]),[t.shape[0]]),s=(0,Z.default)(new Int32Array(t.shape[0]),[t.shape[0]]);return C.bands(a,t,1023),C.lshifts(s,a,16),C.bxoreq(a,s),C.bandseq(a,4278190335),C.lshifts(s,a,8),C.bxoreq(a,s),C.bandseq(a,50393103),C.lshifts(s,a,4),C.bxoreq(a,s),C.bandseq(a,51130563),C.lshifts(s,a,2),C.bxoreq(a,s),C.bandseq(a,153391689),a}function X(t,a){if(t.shape[0]!==a.shape[0])throw new Error("wrong length");let s=(0,Z.default)(new Float32Array(t.size),t.shape,t.stride,t.offset);for(let n=0;n<a.shape[0];n++){let i=a.get(n);if(t.shape.length>1)for(let e=0;e<t.shape[1];e++)s.set(n,e,t.get(i,e));else s.set(n,t.get(i))}return s}var W=class{constructor(t,a,s,n,i,e,o,r,h,u){this.propertyDescs=t,this.format=a,this.nsplats=s,this.xyz=n,this.colors=i,this.harmonics=e,this.opacity=o,this.scaling=r,this.rotation=h,this.maxSHDegree=u}getPlyBinary(){let t=W._generateHeaderString(this.propertyDescs,this.format,this.nsplats),a=(new TextEncoder).encode(t),s=Object.keys(this.propertyDescs).length,n=(0,H.default)(new Float32Array(this.nsplats*s),[this.nsplats,s]);if(V.assign(n.pick(null,this.propertyDescs.x.index),this.xyz.pick(null,0)),V.assign(n.pick(null,this.propertyDescs.y.index),this.xyz.pick(null,1)),V.assign(n.pick(null,this.propertyDescs.z.index),this.xyz.pick(null,2)),V.assign(n.pick(null,this.propertyDescs.f_dc_0.index),this.colors.pick(null,0)),V.assign(n.pick(null,this.propertyDescs.f_dc_1.index),this.colors.pick(null,1)),V.assign(n.pick(null,this.propertyDescs.f_dc_2.index),this.colors.pick(null,2)),V.assign(n.pick(null,this.propertyDescs.opacity.index),this.opacity.pick(null,0)),V.assign(n.pick(null,this.propertyDescs.scale_0.index),this.scaling.pick(null,0)),V.assign(n.pick(null,this.propertyDescs.scale_1.index),this.scaling.pick(null,1)),V.assign(n.pick(null,this.propertyDescs.scale_2.index),this.scaling.pick(null,2)),V.assign(n.pick(null,this.propertyDescs.rot_0.index),this.rotation.pick(null,0)),V.assign(n.pick(null,this.propertyDescs.rot_1.index),this.rotation.pick(null,1)),V.assign(n.pick(null,this.propertyDescs.rot_2.index),this.rotation.pick(null,2)),V.assign(n.pick(null,this.propertyDescs.rot_3.index),this.rotation.pick(null,3)),this.harmonics&&this.harmonics.length>0)for(let o=0;o<this.harmonics.length;o++){let r=3*o;V.assign(n.pick(null,this.propertyDescs["f_rest_".concat(r)].index),this.harmonics[o].pick(null,0)),V.assign(n.pick(null,this.propertyDescs["f_rest_".concat(r+1)].index),this.harmonics[o].pick(null,1)),V.assign(n.pick(null,this.propertyDescs["f_rest_".concat(r+2)].index),this.harmonics[o].pick(null,2))}let i=new Uint8Array(n.data.buffer),e=new Uint8Array(i.length+a.length);return e.set(a),e.set(i,a.length),e.buffer}save(t,a){let s=this.getPlyBinary(),n=new Blob([s],{type:"application/octet-stream"}),i=new File([n],t),e=new FormData;e.append("file",i),e.append("filename",t),e.append("basedir",a),fetch("".concat("http://127.0.0.1:8000","/push_file"),{method:"POST",body:e})}static loadFile(t){return(0,st.c)(function*(){return yield(yield fetch(t)).arrayBuffer()})()}mortonPositionSplatsSort(){let t=function da(t){let a=C.sup(t),s=C.inf(t),n=1e3/Math.min(1e3,a-s),i=(0,Z.default)(new Float32Array(t.data),t.shape);C.mulseq(i,n);let o=function pa(t){let a=ct(t.pick(null,0)),s=ct(t.pick(null,1));C.lshiftseq(s,1);let n=ct(t.pick(null,2));return C.lshiftseq(n,2),C.boreq(a,s),C.boreq(a,n),a}((0,Z.default)(new Int32Array(i.data),t.shape)),r=Array.from(o.data).map((u,f)=>[u,f]);!function fa(t,a,s,n){if(!Array.isArray(t))throw new TypeError("Can only sort arrays");a?"function"!=typeof a&&(n=s,s=a,a=xt):a=xt,s||(s=0),n||(n=t.length);let i=n-s;if(i<2)return;let e=0;if(i<32)return e=wt(t,s,n,a),void kt(t,s,n,s+e,a);let o=new ca(t,a),r=function ua(t){let a=0;for(;t>=32;)a|=1&t,t>>=1;return t+a}(i);do{if(e=wt(t,s,n,a),e<r){let h=i;h>r&&(h=r),kt(t,s,s+h,s+e,a),e=h}o.pushRun(s,e),o.mergeRuns(),i-=e,s+=e}while(0!==i);o.forceMergeRuns()}(r,(u,f)=>u[0]-f[0]);let h=r.map(([u,f])=>f);
1return(0,Z.default)(Uint32Array.from(h))}(this.xyz),a=X(this.xyz,t),s=X(this.colors,t),n=X(this.opacity,t),i=X(this.scaling,t),e=X(this.rotation,t),o=[];for(let r=0;r<this.harmonics.length;r++)o.push(X(this.harmonics[r],t));return new W(this.propertyDescs,this.format,this.nsplats,a,s,o,n,i,e,this.maxSHDegree)}static _generateHeaderString(t,a,s){let n="ply\nformat ".concat(a.format," ").concat(a.version,"\nelement vertex ").concat(s),i=Object.keys(t).length,e=Array(i);for(let o in t){let r=t[o];e[r.index]={name:o,dtype:r.dtype}}for(let o=0;o<e.length;o++)n="".concat(n,"\nproperty ").concat(e[o].dtype," ").concat(e[o].name);return"".concat(n,"\nend_header\n")}static fromArrayBuffer(t,a=3){let{splatCount:s,vertexData:n,propertiesDesc:i,format:e}=W.decodeHeader(t),o=n.buffer.slice(n.byteOffset),r=Object.keys(i).length,h=(0,H.default)(new Float32Array(o),[s,r]),u=0,f={},p={double:8,int:4,uint:4,float:4,short:2,ushort:2,uchar:1,char:1};for(let _ in i)if(i.hasOwnProperty(_)){let M=i[_].dtype;f[_]=u,u+=p[M]}let l=(0,H.default)(new Float32Array(3*s),[s,3]);V.assign(l.pick(null,0),h.pick(null,f.x/4)),V.assign(l.pick(null,1),h.pick(null,f.y/4)),V.assign(l.pick(null,2),h.pick(null,f.z/4));let c=(0,H.default)(new Float32Array(3*s),[s,3]);V.assign(c.pick(null,0),h.pick(null,f.scale_0/4)),V.assign(c.pick(null,1),h.pick(null,f.scale_1/4)),V.assign(c.pick(null,2),h.pick(null,f.scale_2/4));let d=(0,H.default)(new Float32Array(3*s),[s,3]);V.assign(d.pick(null,0),h.pick(null,f.f_dc_0/4)),V.assign(d.pick(null,1),h.pick(null,f.f_dc_1/4)),V.assign(d.pick(null,2),h.pick(null,f.f_dc_2/4));let y=(0,H.default)(new Float32Array(4*s),[s,4]);V.assign(y.pick(null,0),h.pick(null,f.rot_1/4)),V.assign(y.pick(null,1),h.pick(null,f.rot_2/4)),V.assign(y.pick(null,2),h.pick(null,f.rot_3/4)),V.assign(y.pick(null,3),h.pick(null,f.rot_0/4));for(let _=0;_<s;_++){let M=y.pick(_,null),x=Math.sqrt(M.get(0)**2+M.get(1)**2+M.get(2)**2+M.get(3)**2);V.divseq(M,x)}let g=(0,H.default)(new Float32Array(1*s),[s,1]);V.assign(g.pick(null,0),h.pick(null,f.opacity/4)),V.negeq(g),V.expeq(g),V.addseq(g,1),V.recipeq(g),V.mulseq(g,255);let m=(Math.min(Math.max(a,0),3)+1)**2-1,b=[];for(let _=0;_<m;_++){let M=(0,H.default)(new Float32Array(3*s),[s,3]),x=3*_;V.assign(M.pick(null,0),h.pick(null,f["f_rest_".concat(x)]/4)),V.assign(M.pick(null,1),h.pick(null,f["f_rest_".concat(x+1)]/4)),V.assign(M.pick(null,2),h.pick(null,f["f_rest_".concat(x+2)]/4)),b.push(M)}return new W(i,e,s,l,d,b,g,c,y,a)}static fromPLYFile(t,a=3){return(0,st.c)(function*(){let s=yield W.loadFile(t);return W.fromArrayBuffer(s,a)})()}static decodeHeader(t){let a=new TextDecoder,s=0,n="",i=100;for(;;){if(s+i>=t.byteLength)throw new Error("End of file reached while searching for end of header");let c=new Uint8Array(t,s,i);n+=a.decode(c),s+=i;let d=s-200,y=new Uint8Array(t,Math.max(0,d),d>0?200:i);if(a.decode(y).includes("end_header"))break}let f,e=n.split("\n"),o=0,r={},h={},u=0;for(let c=0;c<e.length;c++){let d=e[c].trim();if(d.startsWith("element vertex")){let y=d.match(/\d+/);y&&(o=parseInt(y[0]))}else if(d.startsWith("property")){let y=d.match(/(\w+)\s+(\w+)\s+(\w+)/);if(y){let g=y[2],m=y[3];r[m]=u,h[m]={dtype:g,index:u},u++}}else if(d.startsWith("format")){let y=d.match(/(\w+)\s+(\w+)\s+(\d+\.?\d*)/);y&&(f={format:y[2],version:y[3]})}else if("end_header"===d)break}let p=n.indexOf("end_header")+10+1;return{splatCount:o,vertexData:new DataView(t,p),headerOffset:s,propertiesDesc:h,format:f}}},et=class{constructor(t,a,s,n,i,e,o,r){this.config=t,this.xyz=a,this.scaling=s,this.color=n,this.opacity=i,this.harmonics=o,this.quaternion=e,this.variableChunkSize=r}get isDynamicChunks(){return this.variableChunkSize&&this.variableChunkSize.length>0}get nchunks(){return this.xyz.nchunks}get nsplats(){return this.xyz.length}get chunkSize(){return this.config.chunkSize}static compressFromGaussianData(t,a){let s=L.fromArray(t.xyz,a.xyz,a.chunkSize),n=L.fromArray(t.scaling,a.scaling,a.chunkSize),i=L.fromArray(t.colors,a.color,a.chunkSize),e=L.fromArray(t.opacity,a.opacity,a.chunkSize),o=L.fromArray(t.rotation,a.quaternion,a.chunkSize),r=t.harmonics,h=[];if(a.harmonics)for(let u=0;u<r.length;u++){let f=L.fromArray(r[u],a.harmonics,a.chunkSize);h.push(f)}return new et(a,s,n,i,e,o,h)}_countIndexesInChunks(t){let a=[],s=this.nchunks,n=this.chunkSize;
1if(s===L.getRequiredNChunks(this.nsplats,n))for(let o=0;o<t.length;o++){let r=t[o],h=Math.floor(r/this.chunkSize);h in a?a[h].push(r):a[h]=[r]}else{let o=this.variableChunkSize,r={},h=0;for(let u=0;u<s;u++)r[u]=h,h+=o[u];for(let u=0;u<t.length;u++){let f=t[u],p=Math.min(Math.floor(f/n),s-1);for(;f>=r[p]+o[p];)p++;p in a?a[p].push(f):a[p]=[f]}}return a}pruneSplats(t){let s,a=this._countIndexesInChunks(t),n=[];return a.length>0&&(s=this.variableChunkSize?[...this.variableChunkSize]:Array(this.nchunks).fill(this.chunkSize),a.forEach((i,e)=>{s[e]-=i.length,s[e]<=0&&n.push(e)}),s=s.filter(i=>i>0)),new et(this.config,this.xyz.pruneFeature(t,n,s),this.scaling.pruneFeature(t,n,s),this.color.pruneFeature(t,n,s),this.opacity.pruneFeature(t,n,s),this.quaternion.pruneFeature(t,n,s),this.harmonics?this.harmonics.map(i=>i.pruneFeature(t,n,this.variableChunkSize)):void 0,s)}static loadConfig(t){return(0,st.c)(function*(){return yield(yield fetch(t,{method:"GET",mode:"cors",headers:{Accept:"application/json"}})).json()})()}toGaussians(){var t;let s={},n=0;if(s.x={dtype:"float",index:n},n++,s.y={dtype:"float",index:n},n++,s.z={dtype:"float",index:n},n++,s.f_dc_0={dtype:"float",index:n},n++,s.f_dc_1={dtype:"float",index:n},n++,s.f_dc_2={dtype:"float",index:n},n++,this.harmonics&&this.harmonics.length>0)for(let e=0;e<this.harmonics.length;e++)s["f_rest_".concat(e)]={dtype:"float",index:n},n++,s["f_rest_".concat(e+1)]={dtype:"float",index:n},n++,s["f_rest_".concat(e+2)]={dtype:"float",index:n},n++;s.opacity={dtype:"float",index:n},n++,s.scale_0={dtype:"float",index:n},n++,s.scale_1={dtype:"float",index:n},n++,s.scale_2={dtype:"float",index:n},n++,s.rot_0={dtype:"float",index:n},n++,s.rot_1={dtype:"float",index:n},n++,s.rot_2={dtype:"float",index:n},n++,s.rot_3={dtype:"float",index:n},n++;let i=null===(t=this.harmonics)||void 0===t?void 0:t.map(e=>e.denormDequant());return new W(s,{format:"binary_little_endian",version:"1.0"},this.xyz.length,this.xyz.denormDequant(),this.color.denormDequant(),i||[],this.opacity.denormDequant(),this.scaling.denormDequant(),this.quaternion.denormDequant(),3)}},K=T(J(),1),O=T(tt(),1),D=1e-6,I=typeof Float32Array<"u"?Float32Array:Array,ft=Math.random;Math,Math.hypot||(Math.hypot=function(){for(var t=0,a=arguments.length;a--;)t+=arguments[a]*arguments[a];return Math.sqrt(t)});var Y={};function At(){var t=new I(9);return I!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function ya(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[4],t[4]=a[5],t[5]=a[6],t[6]=a[8],t[7]=a[9],t[8]=a[10],t}function ga(t){var a=new I(9);return a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3],a[4]=t[4],a[5]=t[5],a[6]=t[6],a[7]=t[7],a[8]=t[8],a}function ma(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[8]=a[8],t}function ba(t,a,s,n,i,e,o,r,h){var u=new I(9);return u[0]=t,u[1]=a,u[2]=s,u[3]=n,u[4]=i,u[5]=e,u[6]=o,u[7]=r,u[8]=h,u}function _a(t,a,s,n,i,e,o,r,h,u){return t[0]=a,t[1]=s,t[2]=n,t[3]=i,t[4]=e,t[5]=o,t[6]=r,t[7]=h,t[8]=u,t}function va(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ma(t,a){if(t===a){var s=a[1],n=a[2],i=a[5];t[1]=a[3],t[2]=a[6],t[3]=s,t[5]=a[7],t[6]=n,t[7]=i}else t[0]=a[0],t[1]=a[3],t[2]=a[6],t[3]=a[1],t[4]=a[4],t[5]=a[7],t[6]=a[2],t[7]=a[5],t[8]=a[8];return t}function xa(t,a){var s=a[0],n=a[1],i=a[2],e=a[3],o=a[4],r=a[5],h=a[6],u=a[7],f=a[8],p=f*o-r*u,l=-f*e+r*h,c=u*e-o*h,d=s*p+n*l+i*c;return d?(t[0]=p*(d=1/d),t[1]=(-f*n+i*u)*d,t[2]=(r*n-i*o)*d,t[3]=l*d,t[4]=(f*s-i*h)*d,t[5]=(-r*s+i*e)*d,t[6]=c*d,t[7]=(-u*s+n*h)*d,t[8]=(o*s-n*e)*d,t):null}function wa(t,a){var s=a[0],n=a[1],i=a[2],e=a[3],o=a[4],r=a[5],h=a[6],u=a[7],f=a[8];return t[0]=o*f-r*u,t[1]=i*u-n*f,t[2]=n*r-i*o,t[3]=r*h-e*f,t[4]=s*f-i*h,t[5]=i*e-s*r,t[6]=e*u-o*h,t[7]=n*h-s*u,t[8]=s*o-n*e,t}function ka(t){var i=t[3],e=t[4],o=t[5],r=t[6],h=t[7],u=t[8];return t[0]*(u*e-o*h)+t[1]*(-u*i+o*r)+t[2]*(h*i-e*r)}function qt(t,a,s){var n=a[0],i=a[1],e=a[2],o=a[3],r=a[4],h=a[5],u=a[6],f=a[7],p=a[8],l=s[0],c=s[1],d=s[2],y=s[3],g=s[4],m=s[5],b=s[6],_=s[7],M=s[8];return t[0]=l*n+c*o+d*u,t[1]=l*i+c*r+d*f,t[2]=l*e+c*h+d*p,t[3]=y*n+g*o+m*u,t[4]=y*i+g*r+m*f,t[5]=y*e+g*h+m*p,t[6]=b*n+_*o+M*u,t[7]=b*i+_*r+M*f,t[8]=b*e+_*h+M*p,t}function Aa(t,a,s){var n=a[0],i=a[1],e=a[2],o=a[3],r=a[4],h=a[5],u=a[6],f=a[7],p=a[8],l=s[0],c=s[1];return t[0]=n,t[1]=i,t[2]=e,t[3]=o,t[4]=r,t[5]=h,t[6]=l*n+c*o+u,t[7]=l*i+c*r+f,t[8]=l*e+c*h+p,t}function qa(t,a,s){var n=a[0],i=a[1],e=a[2],o=a[3],r=a[4],h=a[5],u=a[6],f=a[7],p=a[8],l=Math.sin(s),c=Math.cos(s);return t[0]=c*n+l*o,t[1]=c*i+l*r,t[2]=c*e+l*h,t[3]=c*o-l*n,t[4]=c*r-l*i,t[5]=c*h-l*e,t[6]=u,t[7]=f,t[8]=p,t}function za(t,a,s){var n=s[0],i=s[1];return t[0]=n*a[0],t[1]=n*a[1],t[2]=n*a[2],t[3]=i*a[3],t[4]=i*a[4],t[5]=i*a[5],t[6]=a[6],t[7]=a[7],t[8]=a[8],t}function ja(t,a){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=a[0],t[7]=a[1],t[8]=1,t}function Va(t,a){var s=Math.sin(a),n=Math.cos(a);return t[0]=n,t[1]=s,t[2]=0,t[3]=-s,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Sa(t,a){return t[0]=a[0],t[1]=0,t[2]=0,t[3]=0,t[4]=a[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Da(t,a){return t[0]=a[0],t[1]=a[1],t[2]=0,t[3]=a[2],t[4]=a[3],t[5]=0,t[6]=a[4],t[7]=a[5],t[8]=1,t}function Fa(t,a){var s=a[0],n=a[1],i=a[2],e=a[3],o=s+s,r=n+n,h=i+i,u=s*o,f=n*o,p=n*r,l=i*o,c=i*r,d=i*h,y=e*o,g=e*r,m=e*h;return t[0]=1-p-d,t[3]=f-m,t[6]=l+g,t[1]=f+m,t[4]=1-u-d,t[7]=c-y,t[2]=l-g,t[5]=c+y,t[8]=1-u-p,t}function Na(t,a){var s=a[0],n=a[1],i=a[2],e=a[3],o=a[4],r=a[5],h=a[6],u=a[7],f=a[8],p=a[9],l=a[10],c=a[11],d=a[12],y=a[13],g=
1a[14],m=a[15],b=s*r-n*o,_=s*h-i*o,M=s*u-e*o,x=n*h-i*r,w=n*u-e*r,v=i*u-e*h,A=f*y-p*d,S=f*g-l*d,z=f*m-c*d,k=p*g-l*y,F=p*m-c*y,N=l*m-c*g,q=b*N-_*F+M*k+x*z-w*S+v*A;return q?(t[0]=(r*N-h*F+u*k)*(q=1/q),t[1]=(h*z-o*N-u*S)*q,t[2]=(o*F-r*z+u*A)*q,t[3]=(i*F-n*N-e*k)*q,t[4]=(s*N-i*z+e*S)*q,t[5]=(n*z-s*F-e*A)*q,t[6]=(y*v-g*w+m*x)*q,t[7]=(g*M-d*v-m*_)*q,t[8]=(d*w-y*M+m*b)*q,t):null}function Ba(t,a,s){return t[0]=2/a,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/s,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function La(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function Ua(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Ca(t,a,s){return t[0]=a[0]+s[0],t[1]=a[1]+s[1],t[2]=a[2]+s[2],t[3]=a[3]+s[3],t[4]=a[4]+s[4],t[5]=a[5]+s[5],t[6]=a[6]+s[6],t[7]=a[7]+s[7],t[8]=a[8]+s[8],t}function zt(t,a,s){return t[0]=a[0]-s[0],t[1]=a[1]-s[1],t[2]=a[2]-s[2],t[3]=a[3]-s[3],t[4]=a[4]-s[4],t[5]=a[5]-s[5],t[6]=a[6]-s[6],t[7]=a[7]-s[7],t[8]=a[8]-s[8],t}function Ia(t,a,s){return t[0]=a[0]*s,t[1]=a[1]*s,t[2]=a[2]*s,t[3]=a[3]*s,t[4]=a[4]*s,t[5]=a[5]*s,t[6]=a[6]*s,t[7]=a[7]*s,t[8]=a[8]*s,t}function Ea(t,a,s,n){return t[0]=a[0]+s[0]*n,t[1]=a[1]+s[1]*n,t[2]=a[2]+s[2]*n,t[3]=a[3]+s[3]*n,t[4]=a[4]+s[4]*n,t[5]=a[5]+s[5]*n,t[6]=a[6]+s[6]*n,t[7]=a[7]+s[7]*n,t[8]=a[8]+s[8]*n,t}function Oa(t,a){return t[0]===a[0]&&t[1]===a[1]&&t[2]===a[2]&&t[3]===a[3]&&t[4]===a[4]&&t[5]===a[5]&&t[6]===a[
16]&&t[7]===a[7]&&t[8]===a[8]}function Ta(t,a){var s=t[0],n=t[1],i=t[2],e=t[3],o=t[4],r=t[5],h=t[6],u=t[7],f=t[8],p=a[0],l=a[1],c=a[2],d=a[3],y=a[4],g=a[5],m=a[6],b=a[7],_=a[8];return Math.abs(s-p)<=D*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(n-l)<=D*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-c)<=D*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(e-d)<=D*Math.max(1,Math.abs(e),Math.abs(d))&&Math.abs(o-y)<=D*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(r-g)<=D*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(h-m)<=D*Math.max(1,Math.abs(h),Math.abs(m))&&Math.abs(u-b)<=D*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(f-_)<=D*Math.max(1,Math.abs(f),Math.abs(_))}ht(Y,{add:()=>Ca,adjoint:()=>wa,clone:()=>ga,copy:()=>ma,create:()=>At,determinant:()=>ka,equals:()=>Ta,exactEquals:()=>Oa,frob:()=>Ua,fromMat2d:()=>Da,fromMat4:()=>ya,fromQuat:()=>Fa,fromRotation:()=>Va,fromScaling:()=>Sa,fromTranslation:()=>ja,fromValues:()=>ba,identity:()=>va,invert:()=>xa,mul:()=>Pa,multiply:()=>qt,multiplyScalar:()=>Ia,multiplyScalarAndAdd:()=>Ea,normalFromMat4:()=>Na,projection:()=>Ba,rotate:()=>qa,scale:()=>za,set:()=>_a,str:()=>La,sub:()=>$a,subtract:()=>zt,translate:()=>Aa,transpose:()=>Ma});var Pa=qt,$a=zt,pt={};function Ra(){var t=new I(16);return I!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Ga(t){var a=new I(16);return a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3],a[4]=t[4],a[5]=t[5],a[6]=t[6],a[7]=t[7],a[8]=t[8],a[9]=t[9],a[10]=t[10],a[11]=t[11],a[12]=t[12],a[13]=t[13],a[14]=t[14],a[15]=t[15],a}function Ha(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[8]=a[8],t[9]=a[9],t[10]=a[10],t[11]=a[11],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15],t}function Wa(t,a,s,n,i,e,o,r,h,u,f,p,l,c,d,y){var g=new I(16);return g[0]=t,g[1]=a,g[2]=s,g[3]=n,g[4]=i,g[5]=e,g[6]=o,g[7]=r,g[8]=h,g[9]=u,g[10]=f,g[11]=p,g[12]=l,g[13]=c,g[14]=d,g[15]=y,g}function Ya(t,a,s,n,i,e,o,r,h,u,f,p,l,c,d,y,g){return t[0]=a,t[1]=s,t[2]=n,t[3]=i,t[4]=e,t[5]=o,t[6]=r,t[7]=h,t[8]=u,t[9]=f,t[10]=p,t[11]=l,t[12]=c,t[13]=d,t[14]=y,t[15]=g,t}function jt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Qa(t,a){if(t===a){var s=a[1],n=a[2],i=a[3],e=a[6],o=a[7],r=a[11];t[1]=a[4],t[2]=a[8],t[3]=a[12],t[4]=s,t[6]=a[9],t[7]=a[13],t[8]=n,t[9]=e,t[11]=a[14],t[12]=i,t[13]=o,t[14]=r}else t[0]=a[0],t[1]=a[4],t[2]=a[8],t[3]=a[12],t[4]=a[1],t[5]=a[5],t[6]=a[9],t[7]=a[13],t[8]=a[2],t[9]=a[6],t[10]=a[10],t[11]=a[14],t[12]=a[3],t[13]=a[7],t[14]=a[11],t[15]=a[15];return t}function Za(t,a){var s=a[0],n=a[1],i=a[2],e=a[3],o=a[4],r=a[5],h=a[6],u=a[7],f=a[8],p=a[9],l=a[10],c=a[11],d=a[12],y=a[13],g=a[14],m=a[15],b=s*r-n*o,_=s*h-i*o,M=s*u-e*o,x=n*h-i*r,w=n*u-e*r,v=i*u-e*h,A=f*y-p*d,S=f*g-l*d,z=f*m-c*d,k=p*g-l*y,F=p*m-c*y,N=l*m-c*g,q=b*N-_*F+M*k+x*z-w*S+v*A;return q?(t[0]=(r*N-h*F+u*k)*(q=1/q),t[1]=(i*F-n*N-e*k)*q,t[2]=(y*v-g*w+m*x)*q,t[3]=(l*w-p*v-c*x)*q,t[4]=(h*z-o*N-u*S)*q,t[5]=(s*N-i*z+e*S)*q,t[6]=(g*M-d*v-m*_)*q,t[7]=(f*v-l*M+c*_)*q,t[8]=(o*F-r*z+u*A)*q,t[9]=(n*z-s*F-e*A)*q,t[10]=(d*w-y*M+m*b)*q,t[11]=(p*M-f*w-c*b)*q,t[12]=(r*S-o*k-h*A)*q,t[13]=(s*k-n*S+i*A)*q,t[14]=(y*_-d*x-g*b)*q,t[15]=(f*x-p*_+l*b)*q,t):null}function Xa(t,a){var s=a[0],n=a[1],i=a[2],e=a[3],o=a[4],r=a[5],h=a[6],u=a[7],f=a[8],p=a[9],l=a[10],c=a[11],d=a[12],y=a[13],g=a[14],m=a[15];return t[0]=r*(l*m-c*g)-p*(h*m-u*g)+y*(h*c-u*l),t[1]=-(n*(l*m-c*g)-p*(i*m-e*g)+y*(i*c-e*l)),t[2]=n*(h*m-u*g)-r*(i*m-e*g)+y*(i*u-e*h),t[3]=-(n*(h*c-u*l)-r*(i*c-e*l)+p*(i*u-e*h)),t[4]=-(o*(l*m-c*g)-f*(h*m-u*g)+d*(h*c-u*l)),t[5]=s*(l*m-c*g)-f*(i*m-e*g)+d*(i*c-e*l),t[6]=-(s*(h*m-u*g)-o*(i*m-e*g)+d*(i*u-e*h)),t[7]=s*(h*c-u*l)-o*(i*c-e*l)+f*(i*u-e*h),t[8]=o*(p*m-c*y)-f*(r*m-u*y)+d*(r*c-u*p),t[9]=-(s*(p*m-c*y)-f*(n*m-e*y)+d*(n*c-e*p)),t[10]=s*(r*m-u*y)-o*(n*m-e*y)+d*(n*u-e*r),t[11]=-(s*(r*c-u*p)-o*(n*c-e*p)+f*(n*u-e*r)),t[12]=-(o*(p*g-l*y)-f*(r*g-h*y)+d*(r*l-h*p)),t[13]=s*(p*g-l*y)-f*(n*g-i*y)+d*(n*l-i*p),t[14]=-(s*(r*g-h*y)-o*(n*g-i*y)+d*(n*h-i*r)),t[15]=s*(r*l-h*p)-o*(n*l-i*p)+f*(n*h-i*r),t}function Ka(t){var a=t[0],s=t[1],n=t[2],i=t[3],e=t[4],o=t[5],r=t[6],h=t[7],u=t[8],f=t[9],p=t[10],l=t[11
1],c=t[12],d=t[13],y=t[14],g=t[15];return(a*o-s*e)*(p*g-l*y)-(a*r-n*e)*(f*g-l*d)+(a*h-i*e)*(f*y-p*d)+(s*r-n*o)*(u*g-l*c)-(s*h-i*o)*(u*y-p*c)+(n*h-i*r)*(u*d-f*c)}function Vt(t,a,s){var n=a[0],i=a[1],e=a[2],o=a[3],r=a[4],h=a[5],u=a[6],f=a[7],p=a[8],l=a[9],c=a[10],d=a[11],y=a[12],g=a[13],m=a[14],b=a[15],_=s[0],M=s[1],x=s[2],w=s[3];return t[0]=_*n+M*r+x*p+w*y,t[1]=_*i+M*h+x*l+w*g,t[2]=_*e+M*u+x*c+w*m,t[3]=_*o+M*f+x*d+w*b,t[4]=(_=s[4])*n+(M=s[5])*r+(x=s[6])*p+(w=s[7])*y,t[5]=_*i+M*h+x*l+w*g,t[6]=_*e+M*u+x*c+w*m,t[7]=_*o+M*f+x*d+w*b,t[8]=(_=s[8])*n+(M=s[9])*r+(x=s[10])*p+(w=s[11])*y,t[9]=_*i+M*h+x*l+w*g,t[10]=_*e+M*u+x*c+w*m,t[11]=_*o+M*f+x*d+w*b,t[12]=(_=s[12])*n+(M=s[13])*r+(x=s[14])*p+(w=s[15])*y,t[13]=_*i+M*h+x*l+w*g,t[14]=_*e+M*u+x*c+w*m,t[15]=_*o+M*f+x*d+w*b,t}function Ja(t,a,s){var o,r,h,u,f,p,l,c,d,y,g,m,n=s[0],i=s[1],e=s[2];return a===t?(t[12]=a[0]*n+a[4]*i+a[8]*e+a[12],t[13]=a[1]*n+a[5]*i+a[9]*e+a[13],t[14]=a[2]*n+a[6]*i+a[10]*e+a[14],t[15]=a[3]*n+a[7]*i+a[11]*e+a[15]):(r=a[1],h=a[2],u=a[3],f=a[4],p=a[5],l=a[6],c=a[7],d=a[8],y=a[9],g=a[10],m=a[11],t[0]=o=a[0],t[1]=r,t[2]=h,t[3]=u,t[4]=f,t[5]=p,t[6]=l,t[7]=c,t[8]=d,t[9]=y,t[10]=g,t[11]=m,t[12]=o*n+f*i+d*e+a[12],t[13]=r*n+p*i+y*e+a[13],t[14]=h*n+l*i+g*e+a[14],t[15]=u*n+c*i+m*e+a[15]),t}function ts(t,a,s){var n=s[0],i=s[1],e=s[2];return t[0]=a[0]*n,t[1]=a[1]*n,t[2]=a[2]*n,t[3]=a[3]*n,t[4]=a[4]*i,t[5]=a[5]*i,t[6]=a[6]*i,t[7]=a[7]*i,t[8]=a[8]*e,t[9]=a[9]*e,t[10]=a[10]*e,t[11]=a[11]*e,t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15],t}function as(t,a,s,n){var h,u,f,p,l,c,d,y,g,m,b,_,M,x,w,v,A,S,z,k,F,N,q,E,i=n[0],e=n[1],o=n[2],r=Math.hypot(i,e,o);return r<D?null:(i*=r=1/r,e*=r,o*=r,h=Math.sin(s),u=Math.cos(s),l=a[1],c=a[2],d=a[3],g=a[5],m=a[6],b=a[7],M=a[9],x=a[10],w=a[11],z=i*e*(f=1-u)-o*h,k=e*e*f+u,F=o*e*f+i*h,N=i*o*f+e*h,q=e*o*f-i*h,E=o*o*f+u,t[0]=(p=a[0])*(v=i*i*f+u)+(y=a[4])*(A=e*i*f+o*h)+(_=a[8])*(S=o*i*f-e*h),t[1]=l*v+g*A+M*S,t[2]=c*v+m*A+x*S,t[3]=d*v+b*A+w*S,t[4]=p*z+y*k+_*F,t[5]=l*z+g*k+M*F,t[6]=c*z+m*k+x*F,t[7]=d*z+b*k+w*F,t[8]=p*N+y*q+_*E,t[9]=l*N+g*q+M*E,t[10]=c*N+m*q+x*E,t[11]=d*N+b*q+w*E,a!==t&&(t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t)}function ss(t,a,s){var n=Math.sin(s),i=Math.cos(s),e=a[4],o=a[5],r=a[6],h=a[7],u=a[8],f=a[9],p=a[10],l=a[11];return a!==t&&(t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t[4]=e*i+u*n,t[5]=o*i+f*n,t[6]=r*i+p*n,t[7]=h*i+l*n,t[8]=u*i-e*n,t[9]=f*i-o*n,t[10]=p*i-r*n,t[11]=l*i-h*n,t}function ns(t,a,s){var n=Math.sin(s),i=Math.cos(s),e=a[0],o=a[1],r=a[2],h=a[3],u=a[8],f=a[9],p=a[10],l=a[11];return a!==t&&(t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t[0]=e*i-u*n,t[1]=o*i-f*n,t[2]=r*i-p*n,t[3]=h*i-l*n,t[8]=e*n+u*i,t[9]=o*n+f*i,t[10]=r*n+p*i,t[11]=h*n+l*i,t}function is(t,a,s){var n=Math.sin(s),i=Math.cos(s),e=a[0],o=a[1],r=a[2],h=a[3],u=a[4],f=
1a[5],p=a[6],l=a[7];return a!==t&&(t[8]=a[8],t[9]=a[9],t[10]=a[10],t[11]=a[11],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t[0]=e*i+u*n,t[1]=o*i+f*n,t[2]=r*i+p*n,t[3]=h*i+l*n,t[4]=u*i-e*n,t[5]=f*i-o*n,t[6]=p*i-r*n,t[7]=l*i-h*n,t}function es(t,a){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],t[15]=1,t}function os(t,a){return t[0]=a[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=a[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function rs(t,a,s){var r,h,u,n=s[0],i=s[1],e=s[2],o=Math.hypot(n,i,e);return o<D?null:(n*=o=1/o,i*=o,e*=o,r=Math.sin(a),h=Math.cos(a),t[0]=n*n*(u=1-h)+h,t[1]=i*n*u+e*r,t[2]=e*n*u-i*r,t[3]=0,t[4]=n*i*u-e*r,t[5]=i*i*u+h,t[6]=e*i*u+n*r,t[7]=0,t[8]=n*e*u+i*r,t[9]=i*e*u-n*r,t[10]=e*e*u+h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function hs(t,a){var s=Math.sin(a),n=Math.cos(a);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=s,t[7]=0,t[8]=0,t[9]=-s,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function us(t,a){var s=Math.sin(a),n=Math.cos(a);return t[0]=n,t[1]=0,t[2]=-s,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=s,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ls(t,a){var s=Math.sin(a),n=Math.cos(a);return t[0]=n,t[1]=s,t[2]=0,t[3]=0,t[4]=-s,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function St(t,a,s){var n=a[0],i=a[1],e=a[2],o=a[3],r=n+n,h=i+i,u=e+e,f=n*r,p=n*h,l=n*u,c=i*h,d=i*u,y=e*u,g=o*r,m=o*h,b=o*u;return t[0]=1-(c+y),t[1]=p+b,t[2]=l-m,t[3]=0,t[4]=p-b,t[5]=1-(f+y),t[6]=d+g,t[7]=0,t[8]=l+m,t[9]=d-g,t[10]=1-(f+c),t[11]=0,t[12]=s[0],t[13]=s[1],t[14]=s[2],t[15]=1,t}function cs(t,a){var s=new I(3),n=-a[0],i=-a[1],e=-a[2],o=a[3],r=a[4],h=a[5],u=a[6],f=a[7],p=n*n+i*i+e*e+o*o;return p>0?(s[0]=2*(r*o+f*n+h*e-u*i)/p,s[1]=2*(h*o+f*i+u*n-r*e)/p,s[2]=2*(u*o+f*e+r*i-h*n)/p):(s[0]=2*(r*o+f*n+h*e-u*i),s[1]=2*(h*o+f*i+u*n-r*e),s[2]=2*(u*o+f*e+r*i-h*n)),St(t,a,s),t}function fs(t,a){return t[0]=a[12],t[1]=a[13],t[2]=a[14],t}function Dt(t,a){var e=a[4],o=a[5],r=a[6],h=a[8],u=a[9],f=a[10];return t[0]=Math.hypot(a[0],a[1],a[2]),t[1]=Math.hypot(e,o,r),t[2]=Math.hypot(h,u,f),t}function ps(t,a){var s=new I(3);Dt(s,a);var n=1/s[0],i=1/s[1],e=1/s[2],o=a[0]*n,r=a[1]*i,h=a[2]*e,u=a[4]*n,f=a[5]*i,p=a[6]*e,l=a[8]*n,c=a[9]*i,d=a[10]*e,y=o+f+d,g=0;return y>0?(g=2*Math.sqrt(y+1),t[3]=.25*g,t[0]=(p-c)/g,t[1]=(l-h)/g,t[2]=(r-u)/g):o>f&&o>d?(g=2*Math.sqrt(1+o-f-d),t[3]=(p-c)/g,t[0]=.25*g,t[1]=(r+u)/g,t[2]=(l+h)/g):f>d?(g=2*Math.sqrt(1+f-o-d),t[3]=(l-h)/g,t[0]=(r+u)/g,t[1]=.25*g,t[2]=(p+c)/g):(g=2*Math.sqrt(1+d-o-f),t[3]=(r-u)/g,t[0]=(l+h)/g,t[1]=(p+c)/g,t[2]=.25*g),t}function ds(t,a,s,n){var i=a[0],e=a[1],o=a[2],r=a[3],h=i+i,u=e+e,f=o+o,p=i*h,l=i*u,c=i*f,d=e*u,y=e*f,g=o*f,m=r*h,b=r*u,_=r*f,M=n[0],x=n[1],w=n[2];return t[0]=(1-(d+g))*M,t[1]=(l+_)*M,t[2]=(c-b)*M,t[3]=0,t[4]=(l-_)*x,t[5]=(1-(p+g))*x,t[6]=(y+m)*x,t[7]=0,t[8]=(c+b)*w,t[9]=(y-m)*w,t[10]=(1-(p+d))*w,t[11]=0,t[12]=s[0],t[13]=s[1],t[14]=s[2],t[15]=1,t}function ys(t,a,s,n,i){var e=a[0],o=a[1],r=a[2],h=a[3],u=e+e,f=o+o,p=r+r,l=e*u,c=e*f,d=e*p,y=o*f,g=o*p,m=r*p,b=h*u,_=h*f,M=h*p,x=n[0],w=n[1],v=n[2],A=i[0],S=i[1],z=i[2],k=(1-(y+m))*x,F=(c+M)*x,N=(d-_)*x,q=(c-M)*w,E=(1-(l+m))*w,Q=(g+b)*w,at=(d+_)*v,Wt=(g-b)*v,Yt=(1-(l+y))*v;return t[0]=k,t[1]=F,t[2]=N,t[3]=0,t[4]=q,t[5]=E,t[6]=Q,t[7]=0,t[8]=at,t[9]=Wt,t[10]=Yt,t[11]=0,t[12]=s[0]+A-(k*A+q*S+at*z),t[13]=s[1]+S-(F*A+E*S+Wt*z),t[14]=s[2]+z-(N*A+Q*S+Yt*z),t[15]=1,t}function gs(t,a){var s=a[0],n=a[1],i=a[2],e=a[3],o=s+s,r=n+n,h=i+i,u=s*o,f=n*o,p=n*r,l=i*o,c=i*r,d=i*h,y=e*o,g=e*r,m=e*h;return t[0]=1-p-d,t[1]=f+m,t[2]=l-g,t[3]=0,t[4]=f-m,t[5]=1-u-d,t[6]=c+y,t[7]=0,t[8]=l+g,t[9]=c-y,t[10]=1-u-p,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ms(t,a,s,n,i,e,o){var r=1/(s-a),h=1/(i-n),u=1/(e-o);return t[0]=2*e*r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*e*h,t[6]=0,t[7]=0,t[8]=(s+a)*r,t[9]=(i+n)*h,t[10]=(o+e)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*e*2*u,t[15]=0,t}function Ft(t,a,s,n,i){var o,e=1/Math.tan(a/2);return t[0]=e/s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+n)*(o=1/(n-i)),t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t}ht(pt,{add:()=>zs,adjoint:()=>Xa,clone:()=>Ga,copy:()=>Ha,create:()=>Ra,determinant:()=>Ka,equals:()=>Ds,exactEquals:()=>Ss,frob:()=>qs,fromQuat:()=>gs,fromQuat2:()=>cs,fromRotation:()=>rs,fromRotationTranslation:()=>St,fromRotationTranslationScale:()=>ds,fromRotationTranslationScaleOrigin:()=>ys,fromScaling:()=>
1os,fromTranslation:()=>es,fromValues:()=>Wa,fromXRotation:()=>hs,fromYRotation:()=>us,fromZRotation:()=>ls,frustum:()=>ms,getRotation:()=>ps,getScaling:()=>Dt,getTranslation:()=>fs,identity:()=>jt,invert:()=>Za,lookAt:()=>ws,mul:()=>Fs,multiply:()=>Vt,multiplyScalar:()=>js,multiplyScalarAndAdd:()=>Vs,ortho:()=>Ms,orthoNO:()=>Nt,orthoZO:()=>xs,perspective:()=>bs,perspectiveFromFieldOfView:()=>vs,perspectiveNO:()=>Ft,perspectiveZO:()=>_s,rotate:()=>as,rotateX:()=>ss,rotateY:()=>ns,rotateZ:()=>is,scale:()=>ts,set:()=>Ya,str:()=>As,sub:()=>Ns,subtract:()=>Bt,targetTo:()=>ks,translate:()=>Ja,transpose:()=>Qa});var bs=Ft;function _s(t,a,s,n,i){var o,e=1/Math.tan(a/2);return t[0]=e/s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(o=1/(n-i)),t[14]=i*n*o):(t[10]=-1,t[14]=-n),t}function vs(t,a,s,n){var i=Math.tan(a.upDegrees*Math.PI/180),e=Math.tan(a.downDegrees*Math.PI/180),o=Math.tan(a.leftDegrees*Math.PI/180),r=Math.tan(a.rightDegrees*Math.PI/180),h=2/(o+r),u=2/(i+e);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-r)*h*.5,t[9]=(i-e)*u*.5,t[10]=n/(s-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*s/(s-n),t[15]=0,t}function Nt(t,a,s,n,i,e,o){var r=1/(a-s),h=1/(n-i),u=1/(e-o);return t[0]=-2*r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(a+s)*r,t[13]=(i+n)*h,t[14]=(o+e)*u,t[15]=1,t}var Ms=Nt;function xs(t,a,s,n,i,e,o){var r=1/(a-s),h=1/(n-i),u=1/(e-o);return t[0]=-2*r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=u,t[11]=0,t[12]=(a+s)*r,t[13]=(i+n)*h,t[14]=e*u,t[15]=1,t}function ws(t,a,s,n){var i,e,o,r,h,u,f,p,l,c,d=a[0],y=a[1],g=a[2],m=n[0],b=n[1],_=n[2],M=s[0],x=s[1],w=s[2];return Math.abs(d-M)<D&&Math.abs(y-x)<D&&Math.abs(g-w)<D?jt(t):(f=d-M,p=y-x,l=g-w,i=b*(l*=c=1/Math.hypot(f,p,l))-_*(p*=c),e=_*(f*=c)-m*l,o=m*p-b*f,(c=Math.hypot(i,e,o))?(i*=c=1/c,e*=c,o*=c):(i=0,e=0,o=0),r=p*o-l*e,h=l*i-f*o,u=f*e-p*i,(c=Math.hypot(r,h,u))?(r*=c=1/c,h*=c,u*=c):(r=0,h=0,u=0),t[0]=i,t[1]=r,t[2]=f,t[3]=0,t[4]=e,t[5]=h,t[6]=p,t[7]=0,t[8]=o,t[9]=u,t[10]=l,t[11]=0,t[12]=-(i*d+e*y+o*g),t[13]=-(r*d+h*y+u*g),t[14]=-(f*d+p*y+l*g),t[15]=1,t)}function ks(t,a,s,n){var i=a[0],e=a[1],o=a[2],r=n[0],h=n[1],u=n[2],f=i-s[0],p=e-s[1],l=o-s[2],c=f*f+p*p+l*l;c>0&&(f*=c=1/Math.sqrt(c),p*=c,l*=c);var d=h*l-u*p,y=u*f-r*l,g=r*p-h*f;return(c=d*d+y*y+g*g)>0&&(d*=c=1/Math.sqrt(c),y*=c,g*=c),t[0]=d,t[1]=y,t[2]=g,t[3]=0,t[4]=p*g-l*y,t[5]=l*d-f*g,t[6]=f*y-p*d,t[7]=0,t[8]=f,t[9]=p,t[10]=l,t[11]=0,t[12]=i,t[13]=e,t[14]=o,t[15]=1,t}function As(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function qs(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function zs(t,a,s){return t[0]=a[0]+s[0],t[1]=a[1]+s[1],t[2]=a[2]+s[2],t[3]=a[3]+s[3],t[4]=a[4]+s[4],t[5]=a[5]+s[5],t[6]=a[6]+s[6],t[7]=a[7]+s[7],t[8]=a[8]+s[8],t[9]=a[9]+s[9],t[10]=a[10]+s[10],t[11]=a[11]+s[11],t[12]=a[12]+s[12],t[13]=a[13]+s[13],t[14]=a[14]+s[14],t[15]=a[15]+s[15],t}function Bt(t,a,s){return t[0]=a[0]-s[0],t[1]=a[1]-s[1],t[2]=a[2]-s[2],t[3]=a[3]-s[3],t[4]=a[4]-s[4],t[5]=a[5]-s[5],t[6]=a[6]-s[6],t[7]=a[7]-s[7],t[8]=a[8]-s[8],t[9]=a[9]-s[9],t[10]=a[10]-s[10],t[11]=a[11]-s[11],t[12]=a[12]-s[12],t[13]=a[13]-s[13],t[14]=a[14]-s[14],t[15]=a[15]-s[15],t}function js(t,a,s){return t[0]=a[0]*s,t[1]=a[1]*s,t[2]=a[2]*s,t[3]=a[3]*s,t[4]=a[4]*s,t[5]=a[5]*s,t[6]=a[6]*s,t[7]=a[7]*s,t[8]=a[8]*s,t[9]=a[9]*s,t[10]=a[10]*s,t[11]=a[11]*s,t[12]=a[12]*s,t[13]=a[13]*s,t[14]=a[14]*s,t[15]=a[15]*s,t}function Vs(t,a,s,n){return t[0]=a[0]+s[0]*n,t[1]=a[1]+s[1]*n,t[2]=a[2]+s[2]*n,t[3]=a[3]+s[3]*n,t[4]=a[4]+s[4]*n,t[5]=a[5]+s[5]*n,t[6]=a[6]+s[6]*n,t[7]=a[7]+s[7]*n,t[8]=a[8]+s[8]*n,t[9]=a[9]+s[9]*n,t[10]=a[10]+s[10]*n,t[11]=a[11]+s[11]*n,t[12]=a[12]+s[12]*n,t[13]=a[13]+s[13]*n,t[14]=a[14]+s[14]*n,t[15]=a[15]+s[15]*n,t}function Ss(t,a){return t[0]===a[0]&&t[1]===a[1]&&t[2]===a[2]&&t[3]===a[3]&&t[4]===a[4]&&t[5]===a[5]&&t[6]===a[
16]&&t[7]===a[7]&&t[8]===a[8]&&t[9]===a[9]&&t[10]===a[10]&&t[11]===a[11]&&t[12]===a[12]&&t[13]===a[13]&&t[14]===a[14]&&t[15]===a[15]}function Ds(t,a){var s=t[0],n=t[1],i=t[2],e=t[3],o=t[4],r=t[5],h=t[6],u=t[7],f=t[8],p=t[9],l=t[10],c=t[11],d=t[12],y=t[13],g=t[14],m=t[15],b=a[0],_=a[1],M=a[2],x=a[3],w=a[4],v=a[5],A=a[6],S=a[7],z=a[8],k=a[9],F=a[10],N=a[11],q=a[12],E=a[13],Q=a[14],at=a[15];return Math.abs(s-b)<=D*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(n-_)<=D*Math.max(1,Math.abs(n),Math.abs(_))&&Math.abs(i-M)<=D*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(e-x)<=D*Math.max(1,Math.abs(e),Math.abs(x))&&Math.abs(o-w)<=D*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(r-v)<=D*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(h-A)<=D*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(u-S)<=D*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-z)<=D*Math.max(1,Math.abs(f),Math.abs(z))&&Math.abs(p-k)<=D*Math.max(1,Math.abs(p),Math.abs(k))&&Math.abs(l-F)<=D*Math.max(1,Math.abs(l),Math.abs(F))&&Math.abs(c-N)<=D*Math.max(1,Math.abs(c),Math.abs(N))&&Math.abs(d-q)<=D*Math.max(1,Math.abs(d),Math.abs(q))&&Math.abs(y-E)<=D*Math.max(1,Math.abs(y),Math.abs(E))&&Math.abs(g-Q)<=D*Math.max(1,Math.abs(g),Math.abs(Q))&&Math.abs(m-at)<=D*Math.max(1,Math.abs(m),Math.abs(at))}var Fs=Vt,Ns=Bt,dt={};function Lt(){var t=new I(3);return I!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ut(t,a,s){var n=new I(3);return n[0]=t,n[1]=a,n[2]=s,n}function yt(t,a,s){var n=a[0],i=a[1],e=a[2],o=s[0],r=s[1],h=s[2];return t[0]=i*h-e*r,t[1]=e*o-n*h,t[2]=n*r-i*o,t}ht(dt,{add:()=>gn,calculateW:()=>en,clone:()=>fn,conjugate:()=>un,copy:()=>dn,create:()=>gt,dot:()=>$t,equals:()=>xn,exactEquals:()=>Mn,exp:()=>Et,fromEuler:()=>ln,fromMat3:()=>Tt,fromValues:()=>pn,getAngle:()=>tn,getAxisAngle:()=>Js,identity:()=>Ks,invert:()=>hn,len:()=>_n,length:()=>Rt,lerp:()=>bn,ln:()=>Ot,mul:()=>mn,multiply:()=>It,normalize:()=>mt,pow:()=>on,random:()=>rn,rotateX:()=>an,rotateY:()=>sn,rotateZ:()=>nn,rotationTo:()=>wn,scale:()=>Pt,set:()=>yn,setAxes:()=>An,setAxisAngle:()=>Ct,slerp:()=>ot,sqlerp:()=>kn,sqrLen:()=>vn,squaredLength:()=>Gt,str:()=>cn});function gt(){var t=new I(4);return I!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Ks(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ct(t,a,s){s*=.5;var n=Math.sin(s);return t[0]=n*a[0],t[1]=n*a[1],t[2]=n*a[2],t[3]=Math.cos(s),t}function Js(t,a){var s=2*Math.acos(a[3]),n=Math.sin(s/2);return n>D?(t[0]=a[0]/n,t[1]=a[1]/n,t[2]=a[2]/n):(t[0]=1,t[1]=0,t[2]=0),s}function tn(t,a){var s=$t(t,a);return Math.acos(2*s*s-1)}function It(t,a,s){var n=a[0],i=a[1],e=a[2],o=a[3],r=s[0],h=s[1],u=s[2],f=s[3];return t[0]=n*f+o*r+i*u-e*h,t[1]=i*f+o*h+e*r-n*u,t[2]=e*f+o*u+n*h-i*r,t[3]=o*f-n*r-i*h-e*u,t}function an(t,a,s){s*=.5;var n=a[0],i=a[1],e=a[2],o=a[3],r=Math.sin(s),h=Math.cos(s);return t[0]=n*h+o*r,t[1]=i*h+e*r,t[2]=e*h-i*r,t[3]=o*h-n*r,t}function sn(t,a,s){s*=.5;var n=a[0],i=a[1],e=a[2],o=a[3],r=Math.sin(s),h=Math.cos(s);return t[0]=n*h-e*r,t[1]=i*h+o*r,t[2]=e*h+n*r,t[3]=o*h-i*r,t}function nn(t,a,s){s*=.5;var n=a[0],i=a[1],e=a[2],o=a[3],r=Math.sin(s),h=Math.cos(s);return t[0]=n*h+i*r,t[1]=i*h-n*r,t[2]=e*h+o*r,t[3]=o*h-e*r,t}function en(t,a){var s=a[0],n=a[1],i=a[2];return t[0]=s,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-s*s-n*n-i*i)),t}function Et(t,a){var s=a[0],n=a[1],i=a[2],e=a[3],o=Math.sqrt(s*s+n*n+i*i),r=Math.exp(e),h=o>0?r*Math.sin(o)/o:0;return t[0]=s*h,t[1]=n*h,t[2]=i*h,t[3]=r*Math.cos(o),t}function Ot(t,a){var s=a[0],n=a[1],i=a[2],e=a[3],o=Math.sqrt(s*s+n*n+i*i),r=o>0?Math.atan2(o,e)/o:0;return t[0]=s*r,t[1]=n*r,t[2]=i*r,t[3]=.5*Math.log(s*s+n*n+i*i+e*e),t}function on(t,a,s){return Ot(t,a),Pt(t,t,s),Et(t,t),t}function ot(t,a,s,n){var l,c,d,y,g,i=a[0],e=a[1],o=a[2],r=a[3],h=s[0],u=s[1],f=s[2],p=s[3];return(c=i*h+e*u+o*f+r*p)<0&&(c=-c,h=-h,u=-u,f=-f,p=-p),1-c>D?(l=Math.acos(c),d=Math.sin(l),y=Math.sin((1-n)*l)/d,g=Math.sin(n*l)/d):(y=1-n,g=n),t[0]=y*i+g*h,t[1]=y*e+g*u,t[2]=y*o+g*f,t[3]=y*r+g*p,t}function rn(t){var a=ft(),s=ft(),n=ft(),i=Math.sqrt(1-a),e=Math.sqrt(a);return t[0]=i*Math.sin(2*Math.PI*s),t[1]=i*Math.cos(2*Math.PI*s),t[2]=e*Math.sin(2*Math.PI*n),t[3]=e*Math.cos(2*Math.PI*n),t}function hn(t,a){var s=a[0],n=a[1],i=a[2],e=a[3],o=s*s+n*n+i*i+e*e,r=o?1/o:0;return t[0]=-s*r,t[1]=-n*r,t[2]=-i*r,t[3]=e*r,t}function un(t,a){return t[0]=-a[0],t[1]=-a[1],t[2]=-a[2],t[3]=a[3],t}function Tt(t,a){var n,s=a[0]+a[4]+a[8];if(s>0)n=Math.sqrt(s+1),t[3]=.5*n,t[0]=(a[5]-a[7])*(n=.5/n),t[1]=(a[6]-a[2])*n,t[2]=(a[1]-a[3])*n;else{var i=0;a[4]>a[0]&&(i=1),a[8]>a[3*i+i]&&(i=2);var e=(i+1)%3,o=(i+2)%3;n=Math.sqrt(a[3*i+i]-a[3*e+e]-a[3*o+o]+1),t[i]=.5*n,t[3]=(a[3*e+o]-a[3*o+e])*(n=.5/n),t[e]=(a[3*e+i]+a[3*i+e])*n,t[o]=(a[3*o+i]+a[3*i+o])*n}return t}function ln(t,a,s,n){var i=.5*Math.PI/180;a*=i,s*=i,n*=i;var e=Math.sin(a),o=Math.cos(a),r=Math.sin(s),h=Math.cos(s),u=Math.sin(n),f=Math.cos(n);return t[0]=e*h*f-o*r*u,t[1]=o*r*f+e*h*u,t[2]=o*h*u-e*r*f,t[3]=o*h*f+e*r*u,t}function cn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}Lt(),function Is(){var t=new I(4);I!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var fn=function Es(t){var a=new I(4);return a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3],a},pn=function Os(t,a,s,n){var i=new I(4);return i[0]=t,i[1]=a,i[2]=s,i[3]=n,i},dn=function Ts(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t},yn=function Ps(t,a,s,n,i){return t[0]=a,t[1]=s,t[2]=n,t[3]=i,t},gn=function $s(t,a,s){return t[0]=a[0]+s[0],t[1]=a[1]+s[1],t[2]=a[2]+s[2],t[3]=a[3]+s[3],t},mn=It,Pt=function Rs(t,a,s){return t[0]=a[0]*s,t[1]=a[1]*s,t[2]=a[2]*s,t[3]=a[3]*s,t},$t=function Ys(t,a){return t[0]*a[0]+t[1]*a[1]+t[2]*a[2]+t[3]*a[3]},bn=function Qs(t,a,s,n){var i=a[0],e=a[1],o=a[2],r=a[3];return t[0]=i+n*(s[0]-i),t[1]=e+n*(s[1]-e),t[2]=o+n*(s[2]-o),t[3]=r+n*(s[3]-r),t},Rt=function Gs(t){return Math.hypot(t[0],t[1],t[2],t[3])},_n=Rt,Gt=function Hs(t){var a=t[0],s=t[1],n=t[2],i=t[3];return a*a+s*s+n*n+i*i},vn=Gt,mt=function Ws(t,a){var s=a[0],n=a[1],i=a[2],e=a[3],o=s*s+n*n+i*i+e*e;return o>0&&(o=1/Math.sqrt(o)),t[0]=s*o,t[1]=n*o,t[2]=i*o,t[3]=e*o,t},Mn=function Zs(t,a){return t[0]===a[0]&&t[1]===a[1]&&t[2]===a[2]&&t[3]===a[3]},xn=function Xs(t,a){var s=t[0],n=t[1],i=t[2],e=t[3],o=a[0],r=a[1],h=a[2],u=a[3];return Math.abs(s-o)<=D*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(n-r)<=D*M
1ath.max(1,Math.abs(n),Math.abs(r))&&Math.abs(i-h)<=D*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(e-u)<=D*Math.max(1,Math.abs(e),Math.abs(u))},wn=function(){var t=Lt(),a=Ut(1,0,0),s=Ut(0,1,0);return function(n,i,e){var o=function Us(t,a){return t[0]*a[0]+t[1]*a[1]+t[2]*a[2]}(i,e);return o<-.999999?(yt(t,a,i),function Bs(t){return Math.hypot(t[0],t[1],t[2])}(t)<1e-6&&yt(t,s,i),function Ls(t,a){var s=a[0],n=a[1],i=a[2],e=s*s+n*n+i*i;e>0&&(e=1/Math.sqrt(e)),t[0]=a[0]*e,t[1]=a[1]*e,t[2]=a[2]*e}(t,t),Ct(n,t,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(yt(t,i,e),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+o,mt(n,n))}}(),kn=function(){var t=gt(),a=gt();return function(s,n,i,e,o,r){return ot(t,n,o,r),ot(a,i,e,r),ot(s,t,a,2*r*(1-r)),s}}(),An=function(){var t=At();return function(a,s,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-s[0],t[5]=-s[1],t[8]=-s[2],mt(a,Tt(a,t))}}(),Ht={xyz:3,color:3,opacity:1,scaling:3,quaternion:4,harmonics:3},bt=class{constructor(t){this.version="",this._buffer=t}get buffer(){return this._buffer}get decoded(){return this._decoded||(this._decoded=this.decodeBuffer()),this._decoded}get colorsA(){let a=this.decoded.color.denormDequant(),s=this.decoded.opacity.denormDequant(),n=(0,K.default)(new Float32Array(4*a.shape[0]),[a.shape[0],4]);return O.mulseq(a,.28209479177387814),O.addseq(a,.5),O.mulseq(a,255),O.maxseq(a,0),O.minseq(a,255),""===this.version&&(O.negeq(s),O.expeq(s),O.addseq(s,1),O.recipeq(s),O.mulseq(s,255)),O.assign(n.hi(a.shape[0],3).lo(0,0),a),O.assign(n.hi(a.shape[0],4).lo(0,3),s),(0,K.default)(new Uint8Array(n.data),[a.shape[0],4]).data}get nsplats(){return this.decoded.nsplats}getSplatCount(){return this.decoded.nsplats}get precomputedCovarianceBufferData(){return this._precomputedCovarianceBufferData}decodeBuffer(){let{splatCount:t,chunkCount:a,chunkSize:s,typeChunks:n,vertexData:i,propertiesDesc:e,version:o}=this.decodeHeader();this.version=o;let r={xyz:e.xyz.compressionMethod,color:e.color.compressionMethod,opacity:e.opacity.compressionMethod,scaling:e.scaling.compressionMethod,quaternion:e.quaternion.compressionMethod,chunkSize:s};e.harmonics_0&&(r.harmonics=e.harmonics_0.compressionMethod);let h=i.byteOffset,u=Array(Object.keys(e).length);for(let m in e)u[e[m].index]={name:m,method:e[m].compressionMethod};let c,f=2*a*4,p=h,l="dynamic"===n?2*a:0,d=!1;if(l>0){let m=new Uint16Array(i.buffer.slice(p,p+l));p+=l,c=Array.from(m),d=!0}let y={};for(let m of u){let M,b=0,_=!0;if("norm8x"===m.method)b=1*t*Ht[m.name];else if("norm11"===m.method)b=4*t;else{if("norm565"!==m.method)throw _=!1,new Error("Not Implemented format: ".concat(m.method));b=2*t}if(!_)throw new Error("loading chunk byt hasnot minmax!");{let v=i.buffer.slice(p,p+f);M=(0,K.default)(new Float32Array(v),[a,2]),p+=f}let w,x=i.buffer.slice(p,p+b);if(p+=b,"norm8x"===m.method)w=(0,K.default)(new Uint8Array(x),[t,Ht[m.name]]);else if("norm11"===m.method)w=(0,K.default)(new Uint32Array(x));else{if("norm565"!==m.method)throw new Error("Not Implemented format: ".concat(m.method));w=(0,K.default)(new Uint16Array(x))}y[m.name]=new L(w,M,s,m.method,c,d)}let g=[];for(let m=0;m<15;m++){let b=y["harmonics_".concat(m)];b&&(g.push(b),delete y["harmonics_".concat(m)])}return g.length>0&&(y.harmonics=g),new et(r,y.xyz,y.scaling,y.color,y.opacity,y.quaternion,y.harmonics,c)}buildPreComputedBuffers(){let t=this.decoded,a=t.nsplats,s=new ArrayBuffer(24*a),n=new Float32Array(s),i=t.scaling.denormDequant(),e=t.quaternion.denormDequant(),o=dt.create(),r=Y.create(),h=Y.create(),u=Y.create(),f=pt.create();for(let p=0;p<a;p++){pt.fromScaling(f,[Math.exp(i.get(p,0)),Math.exp(i.get(p,1)),Math.exp(i.get(p,2))]),Y.fromMat4(h,f),dt.set(o,e.get(p,0),e.get(p,1),e.get(p,2),e.get(p,3)),Y.fromQuat(r,o),Y.multiply(u,r,h);let l=u;n[6*p]=l[0]*l[0]+l[3]*l[3]+l[6]*l[6],n[6*p+1]=l[0]*l[1]+l[3]*l[4]+l[6]*l[7],n[6*p+2]=l[0]*l[2]+l[3]*l[5]+l[6]*l[8],n[6*p+3]=l[1]*l[1]+l[4]*l[4]+l[7]*l[7],n[6*p+4]=l[1]*l[2]+l[4]*l[5]+l[7]*l[8],n[6*p+5]=l[2]*l[2]+l[5]*l[5]+l[8]*l[8]}this._precomputedCovarianceBufferData=s}decodeHeader(){let t=this._buffer,a=new TextDecoder,s=0,n="",i=100;for(;;){if(s+i>=t.byteLength)throw new Error("End of file reached while searching for end of header");let g=new Uint8Array(t,s,i);n+=a.decode(g),s+=i;let m=s-200,b=new Uint8Array(t,Math.max(0,m),m>=0?200:i);if(a.decode(b).includes("end_header"))break}let e=n.split("\n"),o=0,r=0,h=0,u=0,f="",p="",l={};for(let g=0;g<e.length;g++){var c;let m=e[g].trim();if(m.startsWith("version"))p=null!==(c=m.split(" ")[1])&&void 0!==c?c:"";else if(m.startsWith("element vertex")){let b=m.match(/\d+/);b&&(o=parseInt(b[0]))}else if(m.startsWith("property")){let b=m.match(/(\w+)\s+(\w+)\s+(\w+)/);b&&(l[b[2]]={compressionMethod:b[3],index:u},u++)}else if(m.startsWith("element chunks")){let b=m.match(/\d+/);b&&(r=parseInt(b[0]))}else if(m.startsWith("element chunkSize")){let b=m.match(/\d+/);b&&(h=parseInt(b[0]))}else if(m.startsWith("element typeChunks")){let b=m.match(/(\w+)\s+(\w+)\s+(\w+)/);b&&(f=b[3])}else if("end_header"===m)break}let d=n.indexOf("end_header")+10+1;return{splatCount:o,chunkCount:r,chunkSize:h,typeChunks:f,vertexData:new DataView(t,d),propertiesDesc:l,version:p}}pruneSplats(t){let a=this.decodeBuffer().pruneSplats(t);return bt.fromCompressedGaussianSplats(a,this.version)}static fromCompressedGaussianSplats(t,a){let s=t.xyz.length,n=t.xyz.nchunks,i="gspline\nversion ".concat(a,"\nelement vertex ").concat(s,"\nelement chunks ").concat(n,"\nelement chunkSize ").concat(t.chunkSize,"\nelement typeChunks ").concat(t.isDynamicChunks?"dynamic":"static","\nproperty xyz ").concat(t.xyz.method,"\nproperty color ").concat(t.color.method,"\nproperty opacity ").concat(t.opacity.method,"\nproperty scaling ").concat(t.scaling.method,"\nproperty quaternion ").concat(t.quaternion.method);if(t.harmonics&&t.harmonics.length>0)for(let A=0;A<t.harmonics.length;A++)i="".concat(i,"\nproperty harmonics_").concat(A," ").concat(t.harmonics[A].method);i="".concat(i,"\nend_header\n");let e=(new TextEncoder).encode(i),o=2*n*4,r=t.xyz.quantized.data.buffer.byteLength,h=t.xyz instanceof L?o:0,u=t.color.quantized.data.buffer.byteLength,f=t.color instanceof L?o:0,p=t.opacity.quantized.data.buffer.byteLength,l=t.opacity instanceof L?o:0,c=t.scaling.quantized.data.buffer.byteLength,d=t.scaling instanceof L?o:0,y=t.quaternion.quantized.data.buffer.byteLength,g=t.quaternion instanceof L?o:0,m=t.variableChunkSize?Uint16Array.from(t.variableChunkSize):void 0,b=m?m.byteLength:0,_=e.byteLength+b+r+h+u+f+p+l+c+d+y+g,M=0,x=0;if(t.harmonics&&t.harmonics.length>0)for(let A=0;A<t.harmonics.length;A++)M+=t.harmonics[A].quantized.data.buffer.byteLength,x+=t.harmonics[A]instanceof L?o:0;M=0,x=0,_+=M+x;let w=new Uint8Array(_),v=0;if(w.set(e,v),v+=e.byteLength,b>0&&(w.set(new Uint8Array(m.buffer),v),v+=b),t.xyz instanceof L&&(w.set(new Uint8Array(t.xyz.minmaxMatrix.data.buffer),v),v+=o),w.set(new Uint8Array(t.xyz.quantized.data.buffer),v),v+=r,t.color instanceof L&&(w.set(new Uint8Array(t.color.minmaxMatrix.data.buffer),v),v+=o),w.set(new Uint8Array(t.color.quantized.data.buffer),v),v+=u,t.opacity instanceof L&&(w.set(new Uint8Array(t.opacity.minmaxMatrix.data.buffer),v),v+=o),w.set(new Uint8Array(t.opacity.quantized.data.buffer),v),v+=p,t.scaling instanceof L&&(w.set(new Uint8Array(t.scaling.minmaxMatrix.data.buffer),v),v+=o),w.set(new Uint8Array(t.scaling.quantized.data.buffer),v),v+=c,t.quaternion instanceof L&&(w.set(new Uint8Array(t.quaternion.minmaxMatrix.data.buffer),v),v+=o),w.set(new Uint8Array(t.quaternion.quantized.data.buffer),v),v+=y,M>0&&t.harmonics&&t.harmonics.length>0)for(let A=0;A<t.harmonics.length;A++){let S=t.harmonics[A];S instanceof L&&(w.set(new Uint8Array(S.minmaxMatrix.data.buffer),v),v+=o),w.set(new Uint8Array(S.quantized.data.buffer),v),v+=S.quantized.data.byteLength}return new bt(w.buffer)}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.