lingo3d-vanilla
Version:
Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor
1 lines • 70.6 kB
JavaScript
"use strict";(self.webpackChunklingo3d_vanilla=self.webpackChunklingo3d_vanilla||[]).push([[938],{7938:(t,e,n)=>{n.r(e),n.d(e,{default:()=>on});var r={};n.r(r),n.d(r,{AsyncCompress:()=>Ot,AsyncDecompress:()=>Yt,AsyncDeflate:()=>At,AsyncGunzip:()=>Ut,AsyncGzip:()=>Ot,AsyncInflate:()=>Lt,AsyncUnzipInflate:()=>xe,AsyncUnzlib:()=>_t,AsyncZipDeflate:()=>me,AsyncZlib:()=>jt,Compress:()=>St,DecodeUTF8:()=>re,Decompress:()=>$t,Deflate:()=>Tt,EncodeUTF8:()=>oe,Gunzip:()=>Rt,Gzip:()=>St,Inflate:()=>Ct,Unzip:()=>ke,UnzipInflate:()=>Ie,UnzipPassThrough:()=>be,Unzlib:()=>Wt,Zip:()=>ve,ZipDeflate:()=>ge,ZipPassThrough:()=>de,Zlib:()=>Gt,compress:()=>Ft,compressSync:()=>Et,decompress:()=>Ht,decompressSync:()=>qt,deflate:()=>Dt,deflateSync:()=>Pt,gunzip:()=>zt,gunzipSync:()=>Bt,gzip:()=>Ft,gzipSync:()=>Et,inflate:()=>Mt,inflateSync:()=>Nt,strFromU8:()=>ae,strToU8:()=>ie,unzip:()=>Te,unzipSync:()=>Ae,unzlib:()=>Zt,unzlibSync:()=>Kt,zip:()=>ye,zipSync:()=>we,zlib:()=>Vt,zlibSync:()=>Xt});n(650),n(5488),n(2731);var o=n(7002),i={},a=function(t){return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))},s=function(t){return new Worker(t)};try{URL.revokeObjectURL(a(""))}catch(an){a=function(t){return"data:application/javascript;charset=UTF-8,"+encodeURI(t)},s=function(t){return new Worker(t,{type:"module"})}}var l=Uint8Array,c=Uint16Array,u=Uint32Array,h=new l([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),f=new l([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),p=new l([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=function(t,e){for(var n=new c(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var o=new u(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return[n,o]},g=d(h,2),m=g[0],v=g[1];m[28]=258,v[258]=28;for(var y=d(f,0),w=y[0],b=y[1],I=new c(32768),x=0;x<32768;++x){var k=(43690&x)>>>1|(21845&x)<<1;k=(61680&(k=(52428&k)>>>2|(13107&k)<<2))>>>4|(3855&k)<<4,I[x]=((65280&k)>>>8|(255&k)<<8)>>>1}var T=function(t,e,n){for(var r=t.length,o=0,i=new c(e);o<r;++o)++i[t[o]-1];var a,s=new c(e);for(o=0;o<e;++o)s[o]=s[o-1]+i[o-1]<<1;if(n){a=new c(1<<e);var l=15-e;for(o=0;o<r;++o)if(t[o])for(var u=o<<4|t[o],h=e-t[o],f=s[t[o]-1]++<<h,p=f|(1<<h)-1;f<=p;++f)a[I[f]>>>l]=u}else for(a=new c(r),o=0;o<r;++o)t[o]&&(a[o]=I[s[t[o]-1]++]>>>15-t[o]);return a},A=new l(288);for(x=0;x<144;++x)A[x]=8;for(x=144;x<256;++x)A[x]=9;for(x=256;x<280;++x)A[x]=7;for(x=280;x<288;++x)A[x]=8;var D=new l(32);for(x=0;x<32;++x)D[x]=5;var P=T(A,9,0),C=T(A,9,1),L=T(D,5,0),M=T(D,5,1),N=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},S=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n},O=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},F=function(t){return(t/8|0)+(7&t&&1)},E=function(t,e,n){(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length);var r=new(t instanceof c?c:t instanceof u?u:l)(n-e);return r.set(t.subarray(e,n)),r},R=function(t,e,n){var r=t.length;if(!r||n&&!n.l&&r<5)return e||new l(0);var o=!e||n,i=!n||n.i;n||(n={}),e||(e=new l(3*r));var a=function(t){var n=e.length;if(t>n){var r=new l(Math.max(2*n,t));r.set(e),e=r}},s=n.f||0,c=n.p||0,u=n.b||0,d=n.l,g=n.d,v=n.m,y=n.n,b=8*r;do{if(!d){n.f=s=S(t,c,1);var I=S(t,c+1,3);if(c+=3,!I){var x=t[(j=F(c)+4)-4]|t[j-3]<<8,k=j+x;if(k>r){if(i)throw"unexpected EOF";break}o&&a(u+x),e.set(t.subarray(j,k),u),n.b=u+=x,n.p=c=8*k;continue}if(1==I)d=C,g=M,v=9,y=5;else{if(2!=I)throw"invalid block type";var A=S(t,c,31)+257,D=S(t,c+10,15)+4,P=A+S(t,c+5,31)+1;c+=14;for(var L=new l(P),R=new l(19),U=0;U<D;++U)R[p[U]]=S(t,c+3*U,7);c+=3*D;var z=N(R),B=(1<<z)-1,G=T(R,z,1);for(U=0;U<P;){var j,V=G[S(t,c,B)];if(c+=15&V,(j=V>>>4)<16)L[U++]=j;else{var X=0,W=0;for(16==j?(W=3+S(t,c,3),c+=2,X=L[U-1]):17==j?(W=3+S(t,c,7),c+=3):18==j&&(W=11+S(t,c,127),c+=7);W--;)L[U++]=X}}var _=L.subarray(0,A),Z=L.subarray(A);v=N(_),y=N(Z),d=T(_,v,1),g=T(Z,y,1)}if(c>b){if(i)throw"unexpected EOF";break}}o&&a(u+131072);for(var K=(1<<v)-1,$=(1<<y)-1,Y=c;;Y=c){var H=(X=d[O(t,c)&K])>>>4;if((c+=15&X)>b){if(i)throw"unexpected EOF";break}if(!X)throw"invalid length/literal";if(H<256)e[u++]=H;else{if(256==H){Y=c,d=null;break}var q=H-254;if(H>264){var Q=h[U=H-257];q=S(t,c,(1<<Q)-1)+m[U],c+=Q}var J=g[O(t,c)&$],tt=J>>>4;if(!J)throw"invalid distance";c+=15&J;Z=w[tt];if(tt>3){Q=f[tt];Z+=O(t,c)&(1<<Q)-1,c+=Q}if(c>b){if(i)throw"unexpected EOF";break}o&&a(u+131072);for(var et=u+q;u<et;u+=4)e[u]=e[u-Z],e[u+1]=e[u+1-Z],e[u+2]=e[u+2-Z],e[u+3]=e[u+3-Z];u=et}}n.l=d,n.p=Y,n.b=u,d&&(s=1,n.m=v,n.d=g,n.n=y)}while(!s);return u==e.length?e:E(e,0,u)},U=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>>8},z=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16},B=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var o=n.length,i=n.slice();if(!o)return[Z,0];if(1==o){var a=new l(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(t,e){return t.f-e.f})),n.push({s:-1,f:25001});var s=n[0],u=n[1],h=0,f=1,p=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};f!=o-1;)s=n[n[h].f<n[p].f?h++:p++],u=n[h!=f&&n[h].f<n[p].f?h++:p++],n[f++]={s:-1,f:s.f+u.f,l:s,r:u};var d=i[0].s;for(r=1;r<o;++r)i[r].s>d&&(d=i[r].s);var g=new c(d+1),m=G(n[f-1],g,0);if(m>e){r=0;var v=0,y=m-e,w=1<<y;for(i.sort((function(t,e){return g[e.s]-g[t.s]||t.f-e.f}));r<o;++r){var b=i[r].s;if(!(g[b]>e))break;v+=w-(1<<m-g[b]),g[b]=e}for(v>>>=y;v>0;){var I=i[r].s;g[I]<e?v-=1<<e-g[I]++-1:++r}for(;r>=0&&v;--r){var x=i[r].s;g[x]==e&&(--g[x],++v)}m=e}return[new l(g),m]},G=function(t,e,n){return-1==t.s?Math.max(G(t.l,e,n+1),G(t.r,e,n+1)):e[t.s]=n},j=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new c(++e),r=0,o=t[0],i=1,a=function(t){n[r++]=t},s=1;s<=e;++s)if(t[s]==o&&s!=e)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=t[s]}return[n.subarray(0,r),e]},V=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},X=function(t,e,n){var r=n.length,o=F(e+2);t[o]=255&r,t[o+1]=r>>>8,t[o+2]=255^t[o],t[o+3]=255^t[o+1];for(var i=0;i<r;++i)t[o+i+4]=n[i];return 8*(o+4+r)},W=function(t,e,n,r,o,i,a,s,l,u,d){U(e,d++,n),++o[256];for(var g=B(o,15),m=g[0],v=g[1],y=B(i,15),w=y[0],b=y[1],I=j(m),x=I[0],k=I[1],C=j(w),M=C[0],N=C[1],S=new c(19),O=0;O<x.length;++O)S[31&x[O]]++;for(O=0;O<M.length;++O)S[31&M[O]]++;for(var F=B(S,7),E=F[0],R=F[1],G=19;G>4&&!E[p[G-1]];--G);var W,_,Z,K,$=u+5<<3,Y=V(o,A)+V(i,D)+a,H=V(o,m)+V(i,w)+a+14+3*G+V(S,E)+(2*S[16]+3*S[17]+7*S[18]);if($<=Y&&$<=H)return X(e,d,t.subarray(l,l+u));if(U(e,d,1+(H<Y)),d+=2,H<Y){W=T(m,v,0),_=m,Z=T(w,b,0),K=w;var q=T(E,R,0);U(e,d,k-257),U(e,d+5,N-1),U(e,d+10,G-4),d+=14;for(O=0;O<G;++O)U(e,d+3*O,E[p[O]]);d+=3*G;for(var Q=[x,M],J=0;J<2;++J){var tt=Q[J];for(O=0;O<tt.length;++O){var et=31&tt[O];U(e,d,q[et]),d+=E[et],et>15&&(U(e,d,tt[O]>>>5&127),d+=tt[O]>>>12)}}}else W=P,_=A,Z=L,K=D;for(O=0;O<s;++O)if(r[O]>255){et=r[O]>>>18&31;z(e,d,W[et+257]),d+=_[et+257],et>7&&(U(e,d,r[O]>>>23&31),d+=h[et]);var nt=31&r[O];z(e,d,Z[nt]),d+=K[nt],nt>3&&(z(e,d,r[O]>>>5&8191),d+=f[nt])}else z(e,d,W[r[O]]),d+=_[r[O]];return z(e,d,W[256]),d+_[256]},_=new u([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Z=new l(0),K=function(t,e,n,r,o,i){var a=t.length,s=new l(r+a+5*(1+Math.ceil(a/7e3))+o),p=s.subarray(r,s.length-o),d=0;if(!e||a<8)for(var g=0;g<=a;g+=65535){var m=g+65535;m<a?d=X(p,d,t.subarray(g,m)):(p[g]=i,d=X(p,d,t.subarray(g,a)))}else{for(var y=_[e-1],w=y>>>13,I=8191&y,x=(1<<n)-1,k=new c(32768),T=new c(x+1),A=Math.ceil(n/3),D=2*A,P=function(e){return(t[e]^t[e+1]<<A^t[e+2]<<D)&x},C=new u(25e3),L=new c(288),M=new c(32),N=0,S=0,O=(g=0,0),R=0,U=0;g<a;++g){var z=P(g),B=32767&g,G=T[z];if(k[B]=G,T[z]=B,R<=g){var j=a-g;if((N>7e3||O>24576)&&j>423){d=W(t,p,0,C,L,M,S,O,U,g-U,d),O=N=S=0,U=g;for(var V=0;V<286;++V)L[V]=0;for(V=0;V<30;++V)M[V]=0}var K=2,$=0,Y=I,H=B-G&32767;if(j>2&&z==P(g-H))for(var q=Math.min(w,j)-1,Q=Math.min(32767,g),J=Math.min(258,j);H<=Q&&--Y&&B!=G;){if(t[g+K]==t[g+K-H]){for(var tt=0;tt<J&&t[g+tt]==t[g+tt-H];++tt);if(tt>K){if(K=tt,$=H,tt>q)break;var et=Math.min(H,tt-2),nt=0;for(V=0;V<et;++V){var rt=g-H+V+32768&32767,ot=rt-k[rt]+32768&32767;ot>nt&&(nt=ot,G=rt)}}}H+=(B=G)-(G=k[B])+32768&32767}if($){C[O++]=268435456|v[K]<<18|b[$];var it=31&v[K],at=31&b[$];S+=h[it]+f[at],++L[257+it],++M[at],R=g+K,++N}else C[O++]=t[g],++L[t[g]]}}d=W(t,p,i,C,L,M,S,O,U,g-U,d),!i&&7&d&&(d=X(p,d+1,Z))}return E(s,0,r+F(d)+o)},$=function(){for(var t=new u(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),Y=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=$[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}},H=function(){var t=1,e=0;return{p:function(n){for(var r=t,o=e,i=n.length,a=0;a!=i;){for(var s=Math.min(a+2655,i);a<s;++a)o+=r+=n[a];r=(65535&r)+15*(r>>16),o=(65535&o)+15*(o>>16)}t=r,e=o},d:function(){return(255&(t%=65521))<<24|t>>>8<<16|(255&(e%=65521))<<8|e>>>8}}},q=function(t,e,n,r,o){return K(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,r,!o)},Q=function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n},J=function(t,e,n){for(var r=t(),o=t.toString(),i=o.slice(o.indexOf("[")+1,o.lastIndexOf("]")).replace(/ /g,"").split(","),a=0;a<r.length;++a){var s=r[a],l=i[a];if("function"==typeof s){e+=";"+l+"=";var c=s.toString();if(s.prototype)if(-1!=c.indexOf("[native code]")){var u=c.indexOf(" ",8)+1;e+=c.slice(u,c.indexOf("(",u))}else for(var h in e+=c,s.prototype)e+=";"+l+".prototype."+h+"="+s.prototype[h].toString();else e+=c}else n[l]=s}return[e,n]},tt=[],et=function(t,e,n,r){var o;if(!tt[n]){for(var h="",f={},p=t.length-1,d=0;d<p;++d)h=(o=J(t[d],h,f))[0],f=o[1];tt[n]=J(t[p],h,f)}var g=Q({},tt[n][1]);return function(t,e,n,r,o){var l=s(i[e]||(i[e]=a(t)));return l.onerror=function(t){return o(t.error,null)},l.onmessage=function(t){return o(null,t.data)},l.postMessage(n,r),l}(tt[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,g,function(t){var e=[];for(var n in t)(t[n]instanceof l||t[n]instanceof c||t[n]instanceof u)&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e}(g),r)},nt=function(){return[l,c,u,h,f,p,m,w,C,M,I,T,N,S,O,F,E,R,Nt,lt,ct]},rt=function(){return[l,c,u,h,f,p,v,b,P,A,L,D,I,_,Z,T,U,z,B,G,j,V,X,W,F,E,K,q,Pt,lt]},ot=function(){return[vt,bt,mt,Y,$]},it=function(){return[yt,wt]},at=function(){return[It,mt,H]},st=function(){return[xt]},lt=function(t){return postMessage(t,[t.buffer])},ct=function(t){return t&&t.size&&new l(t.size)},ut=function(t,e,n,r,o,i){var a=et(n,r,o,(function(t,e){a.terminate(),i(t,e)}));return a.postMessage([t,e],e.consume?[t.buffer]:[]),function(){a.terminate()}},ht=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){return t.push(e.data[0],e.data[1])}},ft=function(t,e,n,r,o){var i,a=et(t,r,o,(function(t,n){t?(a.terminate(),e.ondata.call(e,t)):(n[1]&&a.terminate(),e.ondata.call(e,t,n[0],n[1]))}));a.postMessage(n),e.push=function(t,n){if(i)throw"stream finished";if(!e.ondata)throw"no stream handler";a.postMessage([t,i=n],[t.buffer])},e.terminate=function(){a.terminate()}},pt=function(t,e){return t[e]|t[e+1]<<8},dt=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},gt=function(t,e){return dt(t,e)+4294967296*dt(t,e+4)},mt=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},vt=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&mt(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}},yt=function(t){if(31!=t[0]||139!=t[1]||8!=t[2])throw"invalid gzip data";var e=t[3],n=10;4&e&&(n+=t[10]|2+(t[11]<<8));for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(2&e)},wt=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},bt=function(t){return 10+(t.filename&&t.filename.length+1||0)},It=function(t,e){var n=e.level,r=0==n?0:n<6?1:9==n?3:2;t[0]=120,t[1]=r<<6|(r?32-2*r:1)},xt=function(t){if(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(32&t[1])throw"invalid zlib data: preset dictionaries not supported"};function kt(t,e){return e||"function"!=typeof t||(e=t,t={}),this.ondata=e,t}var Tt=function(){function t(t,e){e||"function"!=typeof t||(e=t,t={}),this.ondata=e,this.o=t||{}}return t.prototype.p=function(t,e){this.ondata(q(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";this.d=e,this.p(t,e||!1)},t}(),At=function(){return function(t,e){ft([rt,function(){return[ht,Tt]}],this,kt.call(this,t,e),(function(t){var e=new Tt(t.data);onmessage=ht(e)}),6)}}();function Dt(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";return ut(t,e,[rt],(function(t){return lt(Pt(t.data[0],t.data[1]))}),0,n)}function Pt(t,e){return q(t,e||{},0,0)}var Ct=function(){function t(t){this.s={},this.p=new l(0),this.ondata=t}return t.prototype.e=function(t){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var e=this.p.length,n=new l(e+t.length);n.set(this.p),n.set(t,e),this.p=n},t.prototype.c=function(t){this.d=this.s.i=t||!1;var e=this.s.b,n=R(this.p,this.o,this.s);this.ondata(E(n,e,this.s.b),this.d),this.o=E(n,this.s.b-32768),this.s.b=this.o.length,this.p=E(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),Lt=function(){return function(t){this.ondata=t,ft([nt,function(){return[ht,Ct]}],this,0,(function(){var t=new Ct;onmessage=ht(t)}),7)}}();function Mt(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";return ut(t,e,[nt],(function(t){return lt(Nt(t.data[0],ct(t.data[1])))}),1,n)}function Nt(t,e){return R(t,e)}var St=function(){function t(t,e){this.c=Y(),this.l=0,this.v=1,Tt.call(this,t,e)}return t.prototype.push=function(t,e){Tt.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var n=q(t,this.o,this.v&&bt(this.o),e&&8,!e);this.v&&(vt(n,this.o),this.v=0),e&&(mt(n,n.length-8,this.c.d()),mt(n,n.length-4,this.l)),this.ondata(n,e)},t}(),Ot=function(){return function(t,e){ft([rt,ot,function(){return[ht,Tt,St]}],this,kt.call(this,t,e),(function(t){var e=new St(t.data);onmessage=ht(e)}),8)}}();function Ft(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";return ut(t,e,[rt,ot,function(){return[Et]}],(function(t){return lt(Et(t.data[0],t.data[1]))}),2,n)}function Et(t,e){e||(e={});var n=Y(),r=t.length;n.p(t);var o=q(t,e,bt(e),8),i=o.length;return vt(o,e),mt(o,i-8,n.d()),mt(o,i-4,r),o}var Rt=function(){function t(t){this.v=1,Ct.call(this,t)}return t.prototype.push=function(t,e){if(Ct.prototype.e.call(this,t),this.v){var n=this.p.length>3?yt(this.p):4;if(n>=this.p.length&&!e)return;this.p=this.p.subarray(n),this.v=0}if(e){if(this.p.length<8)throw"invalid gzip stream";this.p=this.p.subarray(0,-8)}Ct.prototype.c.call(this,e)},t}(),Ut=function(){return function(t){this.ondata=t,ft([nt,it,function(){return[ht,Ct,Rt]}],this,0,(function(){var t=new Rt;onmessage=ht(t)}),9)}}();function zt(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";return ut(t,e,[nt,it,function(){return[Bt]}],(function(t){return lt(Bt(t.data[0]))}),3,n)}function Bt(t,e){return R(t.subarray(yt(t),-8),e||new l(wt(t)))}var Gt=function(){function t(t,e){this.c=H(),this.v=1,Tt.call(this,t,e)}return t.prototype.push=function(t,e){Tt.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var n=q(t,this.o,this.v&&2,e&&4,!e);this.v&&(It(n,this.o),this.v=0),e&&mt(n,n.length-4,this.c.d()),this.ondata(n,e)},t}(),jt=function(){return function(t,e){ft([rt,at,function(){return[ht,Tt,Gt]}],this,kt.call(this,t,e),(function(t){var e=new Gt(t.data);onmessage=ht(e)}),10)}}();function Vt(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";return ut(t,e,[rt,at,function(){return[Xt]}],(function(t){return lt(Xt(t.data[0],t.data[1]))}),4,n)}function Xt(t,e){e||(e={});var n=H();n.p(t);var r=q(t,e,2,4);return It(r,e),mt(r,r.length-4,n.d()),r}var Wt=function(){function t(t){this.v=1,Ct.call(this,t)}return t.prototype.push=function(t,e){if(Ct.prototype.e.call(this,t),this.v){if(this.p.length<2&&!e)return;this.p=this.p.subarray(2),this.v=0}if(e){if(this.p.length<4)throw"invalid zlib stream";this.p=this.p.subarray(0,-4)}Ct.prototype.c.call(this,e)},t}(),_t=function(){return function(t){this.ondata=t,ft([nt,st,function(){return[ht,Ct,Wt]}],this,0,(function(){var t=new Wt;onmessage=ht(t)}),11)}}();function Zt(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";return ut(t,e,[nt,st,function(){return[Kt]}],(function(t){return lt(Kt(t.data[0],ct(t.data[1])))}),5,n)}function Kt(t,e){return R((xt(t),t.subarray(2,-4)),e)}var $t=function(){function t(t){this.G=Rt,this.I=Ct,this.Z=Wt,this.ondata=t}return t.prototype.push=function(t,e){if(!this.ondata)throw"no stream handler";if(this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new l(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length)}else this.p=t;if(this.p.length>2){var r=this,o=function(){r.ondata.apply(r,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(o):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(o):new this.Z(o),this.s.push(this.p,e),this.p=null}}},t}(),Yt=function(){function t(t){this.G=Ut,this.I=Lt,this.Z=_t,this.ondata=t}return t.prototype.push=function(t,e){$t.prototype.push.call(this,t,e)},t}();function Ht(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";return 31==t[0]&&139==t[1]&&8==t[2]?zt(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Mt(t,e,n):Zt(t,e,n)}function qt(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?Bt(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Nt(t,e):Kt(t,e)}var Qt=function(t,e,n,r){for(var o in t){var i=t[o],a=e+o;i instanceof l?n[a]=[i,r]:Array.isArray(i)?n[a]=[i[0],Q(r,i[1])]:Qt(i,a+"/",n,r)}},Jt="undefined"!=typeof TextEncoder&&new TextEncoder,te="undefined"!=typeof TextDecoder&&new TextDecoder,ee=0;try{te.decode(Z,{stream:!0}),ee=1}catch(an){}var ne=function(t){for(var e="",n=0;;){var r=t[n++],o=(r>127)+(r>223)+(r>239);if(n+o>t.length)return[e,E(t,n-1)];o?3==o?(r=((15&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r)):e+=1&o?String.fromCharCode((31&r)<<6|63&t[n++]):String.fromCharCode((15&r)<<12|(63&t[n++])<<6|63&t[n++]):e+=String.fromCharCode(r)}},re=function(){function t(t){this.ondata=t,ee?this.t=new TextDecoder:this.p=Z}return t.prototype.push=function(t,e){if(!this.ondata)throw"no callback";if(e=!!e,this.t){if(this.ondata(this.t.decode(t,{stream:!0}),e),e){if(this.t.decode().length)throw"invalid utf-8 data";this.t=null}}else{if(!this.p)throw"stream finished";var n=new l(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var r=ne(n),o=r[0],i=r[1];if(e){if(i.length)throw"invalid utf-8 data";this.p=null}else this.p=i;this.ondata(o,e)}},t}(),oe=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){if(!this.ondata)throw"no callback";if(this.d)throw"stream finished";this.ondata(ie(t),this.d=e||!1)},t}();function ie(t,e){if(e){for(var n=new l(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(Jt)return Jt.encode(t);var o=t.length,i=new l(t.length+(t.length>>1)),a=0,s=function(t){i[a++]=t};for(r=0;r<o;++r){if(a+5>i.length){var c=new l(a+8+(o-r<<1));c.set(i),i=c}var u=t.charCodeAt(r);u<128||e?s(u):u<2048?(s(192|u>>6),s(128|63&u)):u>55295&&u<57344?(s(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++r))>>18),s(128|u>>12&63),s(128|u>>6&63),s(128|63&u)):(s(224|u>>12),s(128|u>>6&63),s(128|63&u))}return E(i,0,a)}function ae(t,e){if(e){for(var n="",r=0;r<t.length;r+=16384)n+=String.fromCharCode.apply(null,t.subarray(r,r+16384));return n}if(te)return te.decode(t);var o=ne(t),i=o[0];if(o[1].length)throw"invalid utf-8 data";return i}var se=function(t){return 1==t?3:t<6?2:9==t?1:0},le=function(t,e){return e+30+pt(t,e+26)+pt(t,e+28)},ce=function(t,e,n){var r=pt(t,e+28),o=ae(t.subarray(e+46,e+46+r),!(2048&pt(t,e+8))),i=e+46+r,a=dt(t,e+20),s=n&&4294967295==a?ue(t,i):[a,dt(t,e+24),dt(t,e+42)],l=s[0],c=s[1],u=s[2];return[pt(t,e+10),l,c,o,i+pt(t,e+30)+pt(t,e+32),u]},ue=function(t,e){for(;1!=pt(t,e);e+=4+pt(t,e+2));return[gt(t,e+12),gt(t,e+4),gt(t,e+20)]},he=function(t){var e=0;if(t)for(var n in t){var r=t[n].length;if(r>65535)throw"extra field too long";e+=r+4}return e},fe=function(t,e,n,r,o,i,a,s){var l=r.length,c=n.extra,u=s&&s.length,h=he(c);mt(t,e,null!=a?33639248:67324752),e+=4,null!=a&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(null==i&&8),t[e++]=o&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var f=new Date(null==n.mtime?Date.now():n.mtime),p=f.getFullYear()-1980;if(p<0||p>119)throw"date not in range 1980-2099";if(mt(t,e,p<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>>1),e+=4,null!=i&&(mt(t,e,n.crc),mt(t,e+4,i),mt(t,e+8,n.size)),mt(t,e+12,l),mt(t,e+14,h),e+=16,null!=a&&(mt(t,e,u),mt(t,e+6,n.attrs),mt(t,e+10,a),e+=14),t.set(r,e),e+=l,h)for(var d in c){var g=c[d],m=g.length;mt(t,e,+d),mt(t,e+2,m),t.set(g,e+4),e+=4+m}return u&&(t.set(s,e),e+=u),e},pe=function(t,e,n,r,o){mt(t,e,101010256),mt(t,e+8,n),mt(t,e+10,n),mt(t,e+12,r),mt(t,e+16,o)},de=function(){function t(t){this.filename=t,this.c=Y(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){if(!this.ondata)throw"no callback - add to ZIP archive before pushing";this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}(),ge=function(){function t(t,e){var n=this;e||(e={}),de.call(this,t),this.d=new Tt(e,(function(t,e){n.ondata(null,t,e)})),this.compression=8,this.flag=se(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(an){this.ondata(an,null,e)}},t.prototype.push=function(t,e){de.prototype.push.call(this,t,e)},t}(),me=function(){function t(t,e){var n=this;e||(e={}),de.call(this,t),this.d=new At(e,(function(t,e,r){n.ondata(t,e,r)})),this.compression=8,this.flag=se(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){de.prototype.push.call(this,t,e)},t}(),ve=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(2&this.d)throw"stream finished";var n=ie(t.filename),r=n.length,o=t.comment,i=o&&ie(o),a=r!=t.filename.length||i&&o.length!=i.length,s=r+he(t.extra)+30;if(r>65535)throw"filename too long";var c=new l(s);fe(c,0,t,n,a);var u=[c],h=function(){for(var t=0,n=u;t<n.length;t++){var r=n[t];e.ondata(null,r,!1)}u=[]},f=this.d;this.d=0;var p=this.u.length,d=Q(t,{f:n,u:a,o:i,t:function(){t.terminate&&t.terminate()},r:function(){if(h(),f){var t=e.u[p+1];t?t.r():e.d=1}f=1}}),g=0;t.ondata=function(n,r,o){if(n)e.ondata(n,r,o),e.terminate();else if(g+=r.length,u.push(r),o){var i=new l(16);mt(i,0,134695760),mt(i,4,t.crc),mt(i,8,g),mt(i,12,t.size),u.push(i),d.c=g,d.b=s+g+16,d.crc=t.crc,d.size=t.size,f&&d.r(),f=1}else f&&h()},this.u.push(d)},t.prototype.end=function(){var t=this;if(2&this.d){if(1&this.d)throw"stream finishing";throw"stream finished"}this.d?this.e():this.u.push({r:function(){1&t.d&&(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3},t.prototype.e=function(){for(var t=0,e=0,n=0,r=0,o=this.u;r<o.length;r++){n+=46+(c=o[r]).f.length+he(c.extra)+(c.o?c.o.length:0)}for(var i=new l(n+22),a=0,s=this.u;a<s.length;a++){var c=s[a];fe(i,t,c,c.f,c.u,c.c,e,c.o),t+=46+c.f.length+he(c.extra)+(c.o?c.o.length:0),e+=c.b}pe(i,t,this.u.length,n,e),this.ondata(null,i,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++){e[t].t()}this.d=2},t}();function ye(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";var r={};Qt(t,"",r,e);var o=Object.keys(r),i=o.length,a=0,s=0,c=i,u=new Array(i),h=[],f=function(){for(var t=0;t<h.length;++t)h[t]()},p=function(){var t=new l(s+22),e=a,r=s-a;s=0;for(var o=0;o<c;++o){var i=u[o];try{var h=i.c.length;fe(t,s,i,i.f,i.u,h);var f=30+i.f.length+he(i.extra),p=s+f;t.set(i.c,p),fe(t,a,i,i.f,i.u,h,s,i.m),a+=16+f+(i.m?i.m.length:0),s=p+h}catch(an){return n(an,null)}}pe(t,a,u.length,r,e),n(null,t)};i||p();for(var d=function(t){var e=o[t],l=r[e],c=l[0],d=l[1],g=Y(),m=c.length;g.p(c);var v=ie(e),y=v.length,w=d.comment,b=w&&ie(w),I=b&&b.length,x=he(d.extra),k=0==d.level?0:8,T=function(r,o){if(r)f(),n(r,null);else{var l=o.length;u[t]=Q(d,{size:m,crc:g.d(),c:o,f:v,m:b,u:y!=e.length||b&&w.length!=I,compression:k}),a+=30+y+x+l,s+=76+2*(y+x)+(I||0)+l,--i||p()}};if(y>65535&&T("filename too long",null),k)if(m<16e4)try{T(null,Pt(c,d))}catch(an){T(an,null)}else h.push(Dt(c,d,T));else T(null,c)},g=0;g<c;++g)d(g);return f}function we(t,e){e||(e={});var n={},r=[];Qt(t,"",n,e);var o=0,i=0;for(var a in n){var s=n[a],c=s[0],u=s[1],h=0==u.level?0:8,f=(T=ie(a)).length,p=u.comment,d=p&&ie(p),g=d&&d.length,m=he(u.extra);if(f>65535)throw"filename too long";var v=h?Pt(c,u):c,y=v.length,w=Y();w.p(c),r.push(Q(u,{size:c.length,crc:w.d(),c:v,f:T,m:d,u:f!=a.length||d&&p.length!=g,o,compression:h})),o+=30+f+m+y,i+=76+2*(f+m)+(g||0)+y}for(var b=new l(i+22),I=o,x=i-o,k=0;k<r.length;++k){var T=r[k];fe(b,T.o,T,T.f,T.u,T.c.length);var A=30+T.f.length+he(T.extra);b.set(T.c,T.o+A),fe(b,o,T,T.f,T.u,T.c.length,T.o,T.m),o+=16+A+(T.m?T.m.length:0)}return pe(b,o,r.length,x,I),b}var be=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}(),Ie=function(){function t(){var t=this;this.i=new Ct((function(e,n){t.ondata(null,e,n)}))}return t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(an){this.ondata(an,t,e)}},t.compression=8,t}(),xe=function(){function t(t,e){var n=this;e<32e4?this.i=new Ct((function(t,e){n.ondata(null,t,e)})):(this.i=new Lt((function(t,e,r){n.ondata(t,e,r)})),this.terminate=this.i.terminate)}return t.prototype.push=function(t,e){this.i.terminate&&(t=E(t,0)),this.i.push(t,e)},t.compression=8,t}(),ke=function(){function t(t){this.onfile=t,this.k=[],this.o={0:be},this.p=Z}return t.prototype.push=function(t,e){var n=this;if(!this.onfile)throw"no callback";if(!this.p)throw"stream finished";if(this.c>0){var r=Math.min(this.c,t.length),o=t.subarray(0,r);if(this.c-=r,this.d?this.d.push(o,!this.c):this.k[0].push(o),(t=t.subarray(r)).length)return this.push(t,e)}else{var i=0,a=0,s=void 0,c=void 0;this.p.length?t.length?((c=new l(this.p.length+t.length)).set(this.p),c.set(t,this.p.length)):c=this.p:c=t;for(var u=c.length,h=this.c,f=h&&this.d,p=function(){var t,e=dt(c,a);if(67324752==e){i=1,s=a,d.d=null,d.c=0;var r=pt(c,a+6),o=pt(c,a+8),l=2048&r,f=8&r,p=pt(c,a+26),g=pt(c,a+28);if(u>a+30+p+g){var m=[];d.k.unshift(m),i=2;var v,y=dt(c,a+18),w=dt(c,a+22),b=ae(c.subarray(a+30,a+=30+p),!l);4294967295==y?(t=f?[-2]:ue(c,a),y=t[0],w=t[1]):f&&(y=-1),a+=g,d.c=y;var I={name:b,compression:o,start:function(){if(!I.ondata)throw"no callback";if(y){var t=n.o[o];if(!t)throw"unknown compression type "+o;(v=y<0?new t(b):new t(b,y,w)).ondata=function(t,e,n){I.ondata(t,e,n)};for(var e=0,r=m;e<r.length;e++){var i=r[e];v.push(i,!1)}n.k[0]==m&&n.c?n.d=v:v.push(Z,!0)}else I.ondata(null,Z,!0)},terminate:function(){v&&v.terminate&&v.terminate()}};y>=0&&(I.size=y,I.originalSize=w),d.onfile(I)}return"break"}if(h){if(134695760==e)return s=a+=12+(-2==h&&8),i=3,d.c=0,"break";if(33639248==e)return s=a-=4,i=3,d.c=0,"break"}},d=this;a<u-4;++a){if("break"===p())break}if(this.p=Z,h<0){var g=i?c.subarray(0,s-12-(-2==h&&8)-(134695760==dt(c,s-16)&&4)):c.subarray(0,a);f?f.push(g,!!i):this.k[+(2==i)].push(g)}if(2&i)return this.push(c.subarray(a),e);this.p=c.subarray(a)}if(e){if(this.c)throw"invalid zip file";this.p=null}},t.prototype.register=function(t){this.o[t.compression]=t},t}();function Te(t,e){if("function"!=typeof e)throw"no callback";for(var n=[],r=function(){for(var t=0;t<n.length;++t)n[t]()},o={},i=t.length-22;101010256!=dt(t,i);--i)if(!i||t.length-i>65558)return void e("invalid zip file",null);var a=pt(t,i+8);a||e(null,{});var s=a,c=dt(t,i+16),u=4294967295==c;if(u){if(i=dt(t,i-12),101075792!=dt(t,i))return void e("invalid zip file",null);s=a=dt(t,i+32),c=dt(t,i+48)}for(var h=function(s){var h=ce(t,c,u),f=h[0],p=h[1],d=h[2],g=h[3],m=h[4],v=h[5],y=le(t,v);c=m;var w=function(t,n){t?(r(),e(t,null)):(o[g]=n,--a||e(null,o))};if(f)if(8==f){var b=t.subarray(y,y+p);if(p<32e4)try{w(null,Nt(b,new l(d)))}catch(i){w(i,null)}else n.push(Mt(b,{size:d},w))}else w("unknown compression type "+f,null);else w(null,E(t,y,y+p))},f=0;f<s;++f)h();return r}function Ae(t){for(var e={},n=t.length-22;101010256!=dt(t,n);--n)if(!n||t.length-n>65558)throw"invalid zip file";var r=pt(t,n+8);if(!r)return{};var o=dt(t,n+16),i=4294967295==o;if(i){if(n=dt(t,n-12),101075792!=dt(t,n))throw"invalid zip file";r=dt(t,n+32),o=dt(t,n+48)}for(var a=0;a<r;++a){var s=ce(t,o,i),c=s[0],u=s[1],h=s[2],f=s[3],p=s[4],d=s[5],g=le(t,d);if(o=p,c){if(8!=c)throw"unknown compression type "+c;e[f]=Nt(t.subarray(g,g+u),new l(h))}else e[f]=E(t,g,g+u)}return e}function De(t,e,n){const r=n.length-t-1;if(e>=n[r])return r-1;if(e<=n[t])return t;let o=t,i=r,a=Math.floor((o+i)/2);for(;e<n[a]||e>=n[a+1];)e<n[a]?i=a:o=a,a=Math.floor((o+i)/2);return a}function Pe(t,e,n,r){const o=[],i=[],a=[];o[0]=1;for(let s=1;s<=n;++s){i[s]=e-r[t+1-s],a[s]=r[t+s]-e;let n=0;for(let t=0;t<s;++t){const e=a[t+1],r=i[s-t],l=o[t]/(e+r);o[t]=n+e*l,n=r*l}o[s]=n}return o}function Ce(t,e){let n=1;for(let o=2;o<=t;++o)n*=o;let r=1;for(let o=2;o<=e;++o)r*=o;for(let o=2;o<=t-e;++o)r*=o;return n/r}function Le(t,e,n,r,i){const a=function(t,e,n,r,i){const a=i<t?i:t,s=[],l=De(t,r,e),c=function(t,e,n,r,o){const i=[];for(let h=0;h<=n;++h)i[h]=0;const a=[];for(let h=0;h<=r;++h)a[h]=i.slice(0);const s=[];for(let h=0;h<=n;++h)s[h]=i.slice(0);s[0][0]=1;const l=i.slice(0),c=i.slice(0);for(let h=1;h<=n;++h){l[h]=e-o[t+1-h],c[h]=o[t+h]-e;let n=0;for(let t=0;t<h;++t){const e=c[t+1],r=l[h-t];s[h][t]=e+r;const o=s[t][h-1]/s[h][t];s[t][h]=n+e*o,n=r*o}s[h][h]=n}for(let h=0;h<=n;++h)a[0][h]=s[h][n];for(let h=0;h<=n;++h){let t=0,e=1;const o=[];for(let r=0;r<=n;++r)o[r]=i.slice(0);o[0][0]=1;for(let i=1;i<=r;++i){let r=0;const l=h-i,c=n-i;h>=i&&(o[e][0]=o[t][0]/s[c+1][l],r=o[e][0]*s[l][c]);const u=h-1<=c?i-1:n-h;for(let n=l>=-1?1:-l;n<=u;++n)o[e][n]=(o[t][n]-o[t][n-1])/s[c+1][l+n],r+=o[e][n]*s[l+n][c];h<=c&&(o[e][i]=-o[t][i-1]/s[c+1][h],r+=o[e][i]*s[h][c]),a[i][h]=r;const f=t;t=e,e=f}}let u=n;for(let h=1;h<=r;++h){for(let t=0;t<=n;++t)a[h][t]*=u;u*=n-h}return a}(l,r,t,a,e),u=[];for(let o=0;o<n.length;++o){const t=n[o].clone(),e=t.w;t.x*=e,t.y*=e,t.z*=e,u[o]=t}for(let o=0;o<=a;++o){const e=u[l-t].clone().multiplyScalar(c[o][0]);for(let n=1;n<=t;++n)e.add(u[l-t+n].clone().multiplyScalar(c[o][n]));s[o]=e}for(let h=a+1;h<=i+1;++h)s[h]=new o.Ltg(0,0,0);return s}(t,e,n,r,i);return function(t){const e=t.length,n=[],r=[];for(let a=0;a<e;++a){const e=t[a];n[a]=new o.Pa4(e.x,e.y,e.z),r[a]=e.w}const i=[];for(let o=0;o<e;++o){const t=n[o].clone();for(let e=1;e<=o;++e)t.sub(i[o-e].clone().multiplyScalar(Ce(o,e)*r[e]));i[o]=t.divideScalar(r[0])}return i}(a)}class Me extends o.Hyl{constructor(t,e,n,r,i){super(),this.degree=t,this.knots=e,this.controlPoints=[],this.startKnot=r||0,this.endKnot=i||this.knots.length-1;for(let a=0;a<n.length;++a){const t=n[a];this.controlPoints[a]=new o.Ltg(t.x,t.y,t.z,t.w)}}getPoint(t,e=new o.Pa4){const n=e,r=this.knots[this.startKnot]+t*(this.knots[this.endKnot]-this.knots[this.startKnot]),i=function(t,e,n,r){const i=De(t,r,e),a=Pe(i,r,t,e),s=new o.Ltg(0,0,0,0);for(let o=0;o<=t;++o){const e=n[i-t+o],r=a[o],l=e.w*r;s.x+=e.x*l,s.y+=e.y*l,s.z+=e.z*l,s.w+=e.w*r}return s}(this.degree,this.knots,this.controlPoints,r);return 1!==i.w&&i.divideScalar(i.w),n.set(i.x,i.y,i.z)}getTangent(t,e=new o.Pa4){const n=e,r=this.knots[0]+t*(this.knots[this.knots.length-1]-this.knots[0]),i=Le(this.degree,this.knots,this.controlPoints,r,1);return n.copy(i[1]).normalize(),n}}let Ne,Se,Oe;class Fe extends o.aNw{constructor(t){super(t)}load(t,e,n,r){const i=this,a=""===i.path?o.Zp0.extractUrlBase(t):i.path,s=new o.hH6(this.manager);s.setPath(i.path),s.setResponseType("arraybuffer"),s.setRequestHeader(i.requestHeader),s.setWithCredentials(i.withCredentials),s.load(t,(function(n){try{e(i.parse(n,a))}catch(an){r?r(an):console.error(an),i.manager.itemError(t)}}),n,r)}parse(t,e){if(function(t){const e="Kaydara FBX Binary \0";return t.byteLength>=e.length&&e===qe(t,0,e.length)}(t))Ne=(new Be).parse(t);else{const e=qe(t);if(!function(t){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let n=0;function r(e){const r=t[e-1];return t=t.slice(n+e),n++,r}for(let o=0;o<e.length;++o){if(r(1)===e[o])return!1}return!0}(e))throw new Error("FBXLoader: Unknown format.");if(Ve(e)<7e3)throw new Error("FBXLoader: FBX version not supported, FileVersion: "+Ve(e));Ne=(new ze).parse(e)}const n=new o.dpR(this.manager).setPath(this.resourcePath||e).setCrossOrigin(this.crossOrigin);return new Ee(n,this.manager).parse(Ne)}}class Ee{constructor(t,e){this.textureLoader=t,this.manager=e}parse(){Se=this.parseConnections();const t=this.parseImages(),e=this.parseTextures(t),n=this.parseMaterials(e),r=this.parseDeformers(),o=(new Re).parse(r);return this.parseScene(r,o,n),Oe}parseConnections(){const t=new Map;if("Connections"in Ne){Ne.Connections.connections.forEach((function(e){const n=e[0],r=e[1],o=e[2];t.has(n)||t.set(n,{parents:[],children:[]});const i={ID:r,relationship:o};t.get(n).parents.push(i),t.has(r)||t.set(r,{parents:[],children:[]});const a={ID:n,relationship:o};t.get(r).children.push(a)}))}return t}parseImages(){const t={},e={};if("Video"in Ne.Objects){const n=Ne.Objects.Video;for(const r in n){const o=n[r];if(t[parseInt(r)]=o.RelativeFilename||o.Filename,"Content"in o){const t=o.Content instanceof ArrayBuffer&&o.Content.byteLength>0,i="string"==typeof o.Content&&""!==o.Content;if(t||i){const t=this.parseImage(n[r]);e[o.RelativeFilename||o.Filename]=t}}}}for(const n in t){const r=t[n];void 0!==e[r]?t[n]=e[r]:t[n]=t[n].split("\\").pop()}return t}parseImage(t){const e=t.Content,n=t.RelativeFilename||t.Filename,r=n.slice(n.lastIndexOf(".")+1).toLowerCase();let o;switch(r){case"bmp":o="image/bmp";break;case"jpg":case"jpeg":o="image/jpeg";break;case"png":o="image/png";break;case"tif":o="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",n),o="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+r+'" is not supported.')}if("string"==typeof e)return"data:"+o+";base64,"+e;{const t=new Uint8Array(e);return window.URL.createObjectURL(new Blob([t],{type:o}))}}parseTextures(t){const e=new Map;if("Texture"in Ne.Objects){const n=Ne.Objects.Texture;for(const r in n){const o=this.parseTexture(n[r],t);e.set(parseInt(r),o)}}return e}parseTexture(t,e){const n=this.loadTexture(t,e);n.ID=t.id,n.name=t.attrName;const r=t.WrapModeU,i=t.WrapModeV,a=void 0!==r?r.value:0,s=void 0!==i?i.value:0;if(n.wrapS=0===a?o.rpg:o.uWy,n.wrapT=0===s?o.rpg:o.uWy,"Scaling"in t){const e=t.Scaling.value;n.repeat.x=e[0],n.repeat.y=e[1]}if("Translation"in t){const e=t.Translation.value;n.offset.x=e[0],n.offset.y=e[1]}return n}loadTexture(t,e){let n;const r=this.textureLoader.path,i=Se.get(t.id).children;let a;void 0!==i&&i.length>0&&void 0!==e[i[0].ID]&&(n=e[i[0].ID],0!==n.indexOf("blob:")&&0!==n.indexOf("data:")||this.textureLoader.setPath(void 0));const s=t.FileName.slice(-3).toLowerCase();if("tga"===s){const e=this.manager.getHandler(".tga");null===e?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",t.RelativeFilename),a=new o.xEZ):(e.setPath(this.textureLoader.path),a=e.load(n))}else"psd"===s?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",t.RelativeFilename),a=new o.xEZ):a=this.textureLoader.load(n);return this.textureLoader.setPath(r),a}parseMaterials(t){const e=new Map;if("Material"in Ne.Objects){const n=Ne.Objects.Material;for(const r in n){const o=this.parseMaterial(n[r],t);null!==o&&e.set(parseInt(r),o)}}return e}parseMaterial(t,e){const n=t.id,r=t.attrName;let i=t.ShadingModel;if("object"==typeof i&&(i=i.value),!Se.has(n))return null;const a=this.parseParameters(t,e,n),s=new o.Wid;return s.setValues(a),s.name=r,s}parseParameters(t,e,n){const r={};t.BumpFactor&&(r.bumpScale=t.BumpFactor.value),t.Diffuse?r.color=(new o.Ilk).fromArray(t.Diffuse.value):!t.DiffuseColor||"Color"!==t.DiffuseColor.type&&"ColorRGB"!==t.DiffuseColor.type||(r.color=(new o.Ilk).fromArray(t.DiffuseColor.value)),t.DisplacementFactor&&(r.displacementScale=t.DisplacementFactor.value),t.Emissive?r.emissive=(new o.Ilk).fromArray(t.Emissive.value):!t.EmissiveColor||"Color"!==t.EmissiveColor.type&&"ColorRGB"!==t.EmissiveColor.type||(r.emissive=(new o.Ilk).fromArray(t.EmissiveColor.value)),t.EmissiveFactor&&(r.emissiveIntensity=parseFloat(t.EmissiveFactor.value)),t.Opacity&&(r.opacity=parseFloat(t.Opacity.value)),r.opacity<1&&(r.transparent=!0);const i=this;return Se.get(n).children.forEach((function(t){const n=t.relationship;switch(n){case"Bump":r.bumpMap=i.getTexture(e,t.ID);break;case"Maya|TEX_ao_map":r.aoMap=i.getTexture(e,t.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":r.map=i.getTexture(e,t.ID);break;case"DisplacementColor":r.displacementMap=i.getTexture(e,t.ID);break;case"EmissiveColor":r.emissiveMap=i.getTexture(e,t.ID);break;case"NormalMap":case"Maya|TEX_normal_map":r.normalMap=i.getTexture(e,t.ID);break;case"ReflectionColor":r.envMap=i.getTexture(e,t.ID),void 0!==r.envMap&&(r.envMap.mapping=o.dSO);break;case"TransparentColor":case"TransparencyFactor":r.alphaMap=i.getTexture(e,t.ID),r.transparent=!0;break;default:console.warn("FBXLoader: %s map is not supported, skipping texture.",n)}})),r}getTexture(t,e){return"LayeredTexture"in Ne.Objects&&e in Ne.Objects.LayeredTexture&&(console.warn("FBXLoader: layered textures are not supported. Discarding all but first layer."),e=Se.get(e).children[0].ID),t.get(e)}parseDeformers(){const t={},e={};if("Deformer"in Ne.Objects){const n=Ne.Objects.Deformer;for(const r in n){const o=n[r],i=Se.get(parseInt(r));if("Skin"===o.attrType){const e=this.parseSkeleton(i,n);e.ID=r,i.parents.length>1&&console.warn("FBXLoader: skeleton attached to more than one geometry is not supported."),e.geometryID=i.parents[0].ID,t[r]=e}else if("BlendShape"===o.attrType){const t={id:r};t.rawTargets=this.parseMorphTargets(i,n),t.id=r,i.parents.length>1&&console.warn("FBXLoader: morph target attached to more than one geometry is not supported."),e[r]=t}}}return{skeletons:t,morphTargets:e}}parseSkeleton(t,e){const n=[];return t.children.forEach((function(t){const r=e[t.ID];if("Cluster"!==r.attrType)return;const i={ID:t.ID,indices:[],weights:[],transformLink:(new o.yGw).fromArray(r.TransformLink.a)};"Indexes"in r&&(i.indices=r.Indexes.a,i.weights=r.Weights.a),n.push(i)})),{rawBones:n,bones:[]}}parseMorphTargets(t,e){const n=[];for(let r=0;r<t.children.length;r++){const o=t.children[r],i=e[o.ID],a={name:i.attrName,initialWeight:i.DeformPercent,id:i.id,fullWeights:i.FullWeights.a};if("BlendShapeChannel"!==i.attrType)return;a.geoID=Se.get(parseInt(o.ID)).children.filter((function(t){return void 0===t.relationship}))[0].ID,n.push(a)}return n}parseScene(t,e,n){Oe=new o.ZAu;const r=this.parseModels(t.skeletons,e,n),i=Ne.Objects.Model,a=this;r.forEach((function(t){const e=i[t.ID];a.setLookAtProperties(t,e);Se.get(t.ID).parents.forEach((function(e){const n=r.get(e.ID);void 0!==n&&n.add(t)})),null===t.parent&&Oe.add(t)})),this.bindSkeleton(t.skeletons,e,r),this.createAmbientLight(),Oe.traverse((function(t){if(t.userData.transformData){t.parent&&(t.userData.transformData.parentMatrix=t.parent.matrix,t.userData.transformData.parentMatrixWorld=t.parent.matrixWorld);const e=$e(t.userData.transformData);t.applyMatrix4(e),t.updateWorldMatrix()}}));const s=(new Ue).parse();1===Oe.children.length&&Oe.children[0].isGroup&&(Oe.children[0].animations=s,Oe=Oe.children[0]),Oe.animations=s}parseModels(t,e,n){const r=new Map,i=Ne.Objects.Model;for(const a in i){const s=parseInt(a),l=i[a],c=Se.get(s);let u=this.buildSkeleton(c,t,s,l.attrName);if(!u){switch(l.attrType){case"Camera":u=this.createCamera(c);break;case"Light":u=this.createLight(c);break;case"Mesh":u=this.createMesh(c,e,n);break;case"NurbsCurve":u=this.createCurve(c,e);break;case"LimbNode":case"Root":u=new o.N$j;break;default:u=new o.ZAu}u.name=l.attrName?o.iUV.sanitizeNodeName(l.attrName):"",u.ID=s}this.getTransformData(u,l),r.set(s,u)}return r}buildSkeleton(t,e,n,r){let i=null;return t.parents.forEach((function(t){for(const a in e){const s=e[a];s.rawBones.forEach((function(e,a){if(e.ID===t.ID){const t=i;i=new o.N$j,i.matrixWorld.copy(e.transformLink),i.name=r?o.iUV.sanitizeNodeName(r):"",i.ID=n,s.bones[a]=i,null!==t&&i.add(t)}}))}})),i}createCamera(t){let e,n;if(t.children.forEach((function(t){const e=Ne.Objects.NodeAttribute[t.ID];void 0!==e&&(n=e)})),void 0===n)e=new o.Tme;else{let t=0;void 0!==n.CameraProjectionType&&1===n.CameraProjectionType.value&&(t=1);let r=1;void 0!==n.NearPlane&&(r=n.NearPlane.value/1e3);let i=1e3;void 0!==n.FarPlane&&(i=n.FarPlane.value/1e3);let a=window.innerWidth,s=window.innerHeight;void 0!==n.AspectWidth&&void 0!==n.AspectHeight&&(a=n.AspectWidth.value,s=n.AspectHeight.value);const l=a/s;let c=45;void 0!==n.FieldOfView&&(c=n.FieldOfView.value);const u=n.FocalLength?n.FocalLength.value:null;switch(t){case 0:e=new o.cPb(c,l,r,i),null!==u&&e.setFocalLength(u);break;case 1:e=new o.iKG(-a/2,a/2,s/2,-s/2,r,i);break;default:console.warn("FBXLoader: Unknown camera type "+t+"."),e=new o.Tme}}return e}createLight(t){let e,n;if(t.children.forEach((function(t){const e=Ne.Objects.NodeAttribute[t.ID];void 0!==e&&(n=e)})),void 0===n)e=new o.Tme;else{let t;t=void 0===n.LightType?0:n.LightType.value;let r=16777215;void 0!==n.Color&&(r=(new o.Ilk).fromArray(n.Color.value));let i=void 0===n.Intensity?1:n.Intensity.value/100;void 0!==n.CastLightOnObject&&0===n.CastLightOnObject.value&&(i=0);let a=0;void 0!==n.FarAttenuationEnd&&(a=void 0!==n.EnableFarAttenuation&&0===n.EnableFarAttenuation.value?0:n.FarAttenuationEnd.value);const s=1;switch(t){case 0:e=new o.cek(r,i,a,s);break;case 1:e=new o.Ox3(r,i);break;case 2:let t=Math.PI/3;void 0!==n.InnerAngle&&(t=o.M8C.degToRad(n.InnerAngle.value));let l=0;void 0!==n.OuterAngle&&(l=o.M8C.degToRad(n.OuterAngle.value),l=Math.max(l,1)),e=new o.PMe(r,i,a,t,l,s);break;default:console.warn("FBXLoader: Unknown light type "+n.LightType.value+", defaulting to a PointLight."),e=new o.cek(r,i)}void 0!==n.CastShadows&&1===n.CastShadows.value&&(e.castShadow=!0)}return e}createMesh(t,e,n){let r,i=null,a=null;const s=[];return t.children.forEach((function(t){e.has(t.ID)&&(i=e.get(t.ID)),n.has(t.ID)&&s.push(n.get(t.ID))})),s.length>1?a=s:s.length>0?a=s[0]:(a=new o.Wid({color:13421772}),s.push(a)),"color"in i.attributes&&s.forEach((function(t){t.vertexColors=!0})),i.FBX_Deformer?(r=new o.TUv(i,a),r.normalizeSkinWeights()):r=new o.Kj0(i,a),r}createCurve(t,e){const n=t.children.reduce((function(t,n){return e.has(n.ID)&&(t=e.get(n.ID)),t}),null),r=new o.nls({color:3342591,linewidth:1});return new o.x12(n,r)}getTransformData(t,e){const n={};"InheritType"in e&&(n.inheritType=parseInt(e.InheritType.value)),n.eulerOrder="RotationOrder"in e?Ye(e.RotationOrder.value):"ZYX","Lcl_Translation"in e&&(n.translation=e.Lcl_Translation.value),"PreRotation"in e&&(n.preRotation=e.PreRotation.value),"Lcl_Rotation"in e&&(n.rotation=e.Lcl_Rotation.value),"PostRotation"in e&&(n.postRotation=e.PostRotation.value),"Lcl_Scaling"in e&&(n.scale=e.Lcl_Scaling.value),"ScalingOffset"in e&&(n.scalingOffset=e.ScalingOffset.value),"ScalingPivot"in e&&(n.scalingPivot=e.ScalingPivot.value),"RotationOffset"in e&&(n.rotationOffset=e.RotationOffset.value),"RotationPivot"in e&&(n.rotationPivot=e.RotationPivot.value),t.userData.transformData=n}setLookAtProperties(t,e){if("LookAtProperty"in e){Se.get(t.ID).children.forEach((function(e){if("LookAtProperty"===e.relationship){const n=Ne.Objects.Model[e.ID];if("Lcl_Translation"in n){const e=n.Lcl_Translation.value;void 0!==t.target?(t.target.position.fromArray(e),Oe.add(t.target)):t.lookAt((new o.Pa4).fromArray(e))}}}))}}bindSkeleton(t,e,n){const r=this.parsePoseNodes();for(const i in t){const a=t[i];Se.get(parseInt(a.ID)).parents.forEach((function(t){if(e.has(t.ID)){const e=t.ID;Se.get(e).parents.forEach((function(t){if(n.has(t.ID)){n.get(t.ID).bind(new o.OdW(a.bones),r[t.ID])}}))}}))}}parsePoseNodes(){const t={};if("Pose"in Ne.Objects){const e=Ne.Objects.Pose;for(const n in e)if("BindPose"===e[n].attrType&&e[n].NbPoseNodes>0){const r=e[n].PoseNode;Array.isArray(r)?r.forEach((function(e){t[e.Node]=(new o.yGw).fromArray(e.Matrix.a)})):t[r.Node]=(new o.yGw).fromArray(r.Matrix.a)}}return t}createAmbientLight(){if("GlobalSettings"in Ne&&"AmbientColor"in Ne.GlobalSettings){const t=Ne.GlobalSettings.AmbientColor.value,e=t[0],n=t[1],r=t[2];if(0!==e||0!==n||0!==r){const t=new o.Ilk(e,n,r);Oe.add(new o.Mig(t,1))}}}}class Re{parse(t){const e=new Map;if("Geometry"in Ne.Objects){const n=Ne.Objects.Geometry;for(const r in n){const o=Se.get(parseInt(r)),i=this.parseGeometry(o,n[r],t);e.set(parseInt(r),i)}}return e}parseGeometry(t,e,n){switch(e.attrType){case"Mesh":return this.parseMeshGeometry(t,e,n);case"NurbsCurve":return this.parseNurbsGeometry(e)}}parseMeshGeometry(t,e,n){const r=n.skeletons,o=[],i=t.parents.map((function(t){return Ne.Objects.Model[t.ID]}));if(0===i.length)return;const a=t.children.reduce((function(t,e){return void 0!==r[e.ID]&&(t=r[e.ID]),t}),null);t.children.forEach((function(t){void 0!==n.morphTargets[t.ID]&&o.push(n.morphTargets[t.ID])}));const s=i[0],l={};"RotationOrder"in s&&(l.eulerOrder=Ye(s.RotationOrder.value)),"InheritType"in s&&(l.inheritType=parseInt(s.InheritType.value)),"GeometricTranslation"in s&&(l.translation=s.GeometricTranslation.value),"GeometricRotation"in s&&(l.rotation=s.GeometricRotation.value),"GeometricScaling"in s&&(l.scale=s.GeometricScaling.value);const c=$e(l);return this.genGeometry(e,a,o,c)}genGeometry(t,e,n,r){const i=new o.u9r;t.attrName&&(i.name=t.attrName);const a=this.parseGeoNode(t,e),s=this.genBuffers(a),l=new o.a$l(s.vertex,3);if(l.applyMatrix4(r),i.setAttribute("position",l),s.colors.length>0&&i.setAttribute("color",new o.a$l(s.colors,3)),e&&(i.setAttribute("skinIndex",new o.qlB(s.weightsIndices,4)),i.setAttribute("skinWeight",new o.a$l(s.vertexWeights,4)),i.FBX_Deformer=e),s.normal.length>0){const t=(new o.Vkp).getNormalMatrix(r),e=new o.a$l(s.normal,3);e.applyNormalMatrix(t),i.setAttribute("normal",e)}if(s.uvs.forEach((function(t,e){let n="uv"+(e+1).toString();0===e&&(n="uv"),i.setAttribute(n,new o.a$l(s.uvs[e],2))})),a.material&&"AllSame"!==a.material.mappingType){let t=s.materialIndex[0],e=0;if(s.materialIndex.forEach((function(n,r){n!==t&&(i.addGroup(e,r-e,t),t=n,e=r)})),i.groups.length>0){const e=i.groups[i.groups.length-1],n=e.start+e.count;n!==s.materialIndex.length&&i.addGroup(n,s.materialIndex.length-n,t)}0===i.groups.length&&i.addGroup(0,s.materialIndex.length,s.materialIndex[0])}return this.addMorphTargets(i,t,n,r),i}parseGeoNode(t,e){const n={};if(n.vertexPositions=void 0!==t.Vertices?t.Vertices.a:[],n.vertexIndices=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],t.LayerElementColor&&(n.color=this.parseVertexColors(t.LayerElementColor[0])),t.LayerElementMaterial&&(n.material=this.parseMaterialIndices(t.LayerElementMaterial[0])),t.LayerElementNormal&&(n.normal=this.parseNormals(t.LayerElementNormal[0])),t.LayerElementUV){n.uv=[];let e=0;for(;t.LayerElementUV[e];)t.LayerElementUV[e].UV&&n.uv.push(this.parseUVs(t.LayerElementUV[e])),e++}return n.weightTable={},null!==e&&(n.skeleton=e,e.rawBones.forEach((function(t,e){t.indices.forEach((function(r,o){void 0===n.weightTable[r]&&(n.weightTable[r]=[]),n.weightTable[r].push({id:e,weight:t.weights[o]})}))}))),n}genBuffers(t){const e={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let n=0,r=0,o=!1,i=[],a=[],s=[],l=[],c=[],u=[];const h=this;return t.vertexIndices.forEach((function(f,p){let d,g=!1;f<0&&(f^=-1,g=!0);let m=[],v=[];if(i.push(3*f,3*f+1,3*f+2),t.color){const e=_e(p,n,f,t.color);s.push(e[0],e[1],e[2])}if(t.skeleton){if(void 0!==t.weightTable[f]&&t.weightTable[f].forEach((function(t){v.push(t.weight),m.push(t.id)})),v.length>4){o||(console.warn("FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),o=!0);const t=[0,0,0,0],e=[0,0,0,0];v.forEach((function(n,r){let o=n,i=m[r];e.forEach((function(e,n,r){if(o>e){r[n]=o,o=e;const a=t[n];t[n]=i,i=a}}))})),m=t,v=e}for(;v.length<4;)v.push(0),m.push(0);for(let t=0;t<4;++t)c.push(v[t]),u.push(m[t])}if(t.normal){const e=_e(p,n,f,t.normal);a.push(e[0],e[1],e[2])}t.material&&"AllSame"!==t.material.mappingType&&(d=_e(p,n,f,t.material)[0],d<0&&(console.warn("FBXLoader: Invalid material index:",d),d=0)),t.uv&&t.uv.forEach((function(t,e){const r=_e(p,n,f,t);void 0===l[e]&&(l[e]=[]),l[e].push(r[0]),l[e].push(r[1])})),r++,g&&(h.genFace(e,t,i,d,a,s,l,c,u,r),n++,r=0,i=[],a=[],s=[],l=[],c=[],u=[])})),e}genFace(t,e,n,r,o,i,a,s,l,c){for(let u=2;u<c;u++)t.vertex.push(e.vertexPositions[n[0]]),t.vertex.push(e.vertexPositions[n[1]]),t.vertex.push(e.vertexPositions[n[2]]),t.vertex.push(e.vertexPositions[n[3*(u-1)]]),t.vertex.push(e.vertexPositions[n[3*(u-1)+1]]),t.vertex.push(e.vertexPositions[n[3*(u-1)+2]]),t.vertex.push(e.vertexPositions[n[3*u]]),t.vertex.push(e.vertexPositions[n[3*u+1]]),t.vertex.push(e.vertexPositions[n[3*u+2]]),e.skeleton&&(t.vertexWeights.push(s[0]),t.vertexWeights.push(s[1]),t.vertexWeights.push(s[2]),t.vertexWeights.push(s[3]),t.vertexWeights.push(s[4*(u-1)]),t.vertexWeights.push(s[4*(u-1)+1]),t.vertexWeights.push(s[4*(u-1)+2]),t.vertexWeights.push(s[4*(u-1)+3]),t.vertexWeights.push(s[4*u]),t.vertexWeights.push(s[4*u+1]),t.vertexWeights.push(s[4*u+2]),t.vertexWeights.push(s[4*u+3]),t.weightsIndices.