import{y as Vn,a1 as Gn,a2 as jn,a3 as Te,a4 as Xn,a5 as bn,a6 as Ue,a7 as Ve,a8 as Ge,a9 as se,aa as Hn,ab as ct,ac as Ht,ad as Zn,a as U,G as je,ae as fe,af as Jt,O as le,ag as Kn,ah as Wn,ai as Xe,aj as it,ak as Yn,al as $n,am as qn,M as Qn,b as Jn,K as Nn,V as ft,an as _n,ao as tr,g as Zt,I as yt,ap as er,aq as nr,ar as ae,as as rr,X as Ft,at as ir,Q as Kt,au as ar,av as or,aw as sr,ax as be,ay as lr,az as cr,aA as ur}from"./model.vue.8f6f7b03.js";import"./entry.a42f0781.js";/*! fflate - fast JavaScript compression/decompression Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE version 0.6.9 */var He={},pe=function(r){return URL.createObjectURL(new Blob([r],{type:"text/javascript"}))},Ne=function(r){return new Worker(r)};try{URL.revokeObjectURL(pe(""))}catch{pe=function(t){return"data:application/javascript;charset=UTF-8,"+encodeURI(t)},Ne=function(t){return new Worker(t,{type:"module"})}}var hr=function(r,t,e,n,i){var a=Ne(He[t]||(He[t]=pe(r)));return a.onerror=function(o){return i(o.error,null)},a.onmessage=function(o){return i(null,o.data)},a.postMessage(e,n),a},C=Uint8Array,j=Uint16Array,st=Uint32Array,xt=new C([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]),Pt=new C([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]),zt=new C([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_e=function(r,t){for(var e=new j(31),n=0;n<31;++n)e[n]=t+=1<>>1|(R&21845)<<1;ut=(ut&52428)>>>2|(ut&13107)<<2,ut=(ut&61680)>>>4|(ut&3855)<<4,Ot[R]=((ut&65280)>>>8|(ut&255)<<8)>>>1}var N=function(r,t,e){for(var n=r.length,i=0,a=new j(t);i>>l]=c}else for(s=new j(n),i=0;i>>15-r[i]);return s},lt=new C(288);for(var R=0;R<144;++R)lt[R]=8;for(var R=144;R<256;++R)lt[R]=9;for(var R=256;R<280;++R)lt[R]=7;for(var R=280;R<288;++R)lt[R]=8;var It=new C(32);for(var R=0;R<32;++R)It[R]=5;var rn=N(lt,9,0),an=N(lt,9,1),on=N(It,5,0),sn=N(It,5,1),$t=function(r){for(var t=r[0],e=1;et&&(t=r[e]);return t},J=function(r,t,e){var n=t/8|0;return(r[n]|r[n+1]<<8)>>(t&7)&e},qt=function(r,t){var e=t/8|0;return(r[e]|r[e+1]<<8|r[e+2]<<16)>>(t&7)},Vt=function(r){return(r/8|0)+(r&7&&1)},_=function(r,t,e){(t==null||t<0)&&(t=0),(e==null||e>r.length)&&(e=r.length);var n=new(r instanceof j?j:r instanceof st?st:C)(e-t);return n.set(r.subarray(t,e)),n},Gt=function(r,t,e){var n=r.length;if(!n||e&&!e.l&&n<5)return t||new C(0);var i=!t||e,a=!e||e.i;e||(e={}),t||(t=new C(n*3));var o=function(bt){var kt=t.length;if(bt>kt){var mt=new C(Math.max(kt*2,bt));mt.set(t),t=mt}},s=e.f||0,l=e.p||0,c=e.b||0,h=e.l,u=e.d,f=e.m,p=e.n,v=n*8;do{if(!h){e.f=s=J(r,l,1);var g=J(r,l+1,3);if(l+=3,g)if(g==1)h=an,u=sn,f=9,p=5;else if(g==2){var m=J(r,l,31)+257,I=J(r,l+10,15)+4,D=m+J(r,l+5,31)+1;l+=14;for(var x=new C(D),A=new C(19),w=0;w>>4;if(y<16)x[w++]=y;else{var E=0,L=0;for(y==16?(L=3+J(r,l,3),l+=2,E=x[w-1]):y==17?(L=3+J(r,l,7),l+=3):y==18&&(L=11+J(r,l,127),l+=7);L--;)x[w++]=E}}var B=x.subarray(0,m),F=x.subarray(m);f=$t(B),p=$t(F),h=N(B,f,1),u=N(F,p,1)}else throw"invalid block type";else{var y=Vt(l)+4,T=r[y-4]|r[y-3]<<8,d=y+T;if(d>n){if(a)throw"unexpected EOF";break}i&&o(c+T),t.set(r.subarray(y,d),c),e.b=c+=T,e.p=l=d*8;continue}if(l>v){if(a)throw"unexpected EOF";break}}i&&o(c+131072);for(var O=(1<>>4;if(l+=E&15,l>v){if(a)throw"unexpected EOF";break}if(!E)throw"invalid length/literal";if(Q<256)t[c++]=Q;else if(Q==256){W=l,h=null;break}else{var Z=Q-254;if(Q>264){var w=Q-257,et=xt[w];Z=J(r,l,(1<>>4;if(!nt)throw"invalid distance";l+=nt&15;var F=nn[Y];if(Y>3){var et=Pt[Y];F+=qt(r,l)&(1<v){if(a)throw"unexpected EOF";break}i&&o(c+131072);for(var b=c+Z;c>>8},dt=function(r,t,e){e<<=t&7;var n=t/8|0;r[n]|=e,r[n+1]|=e>>>8,r[n+2]|=e>>>16},Qt=function(r,t){for(var e=[],n=0;nf&&(f=a[n].s);var p=new j(f+1),v=_t(e[h-1],p,0);if(v>t){var n=0,g=0,y=v-t,T=1<t)g+=T-(1<>>=y;g>0;){var m=a[n].s;p[m]=0&&g;--n){var I=a[n].s;p[I]==t&&(--p[I],++g)}v=t}return[new C(p),v]},_t=function(r,t,e){return r.s==-1?Math.max(_t(r.l,t,e+1),_t(r.r,t,e+1)):t[r.s]=e},ge=function(r){for(var t=r.length;t&&!r[--t];);for(var e=new j(++t),n=0,i=r[0],a=1,o=function(l){e[n++]=l},s=1;s<=t;++s)if(r[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=r[s]}return[e.subarray(0,n),t]},Tt=function(r,t){for(var e=0,n=0;n>>8,r[i+2]=r[i]^255,r[i+3]=r[i+1]^255;for(var a=0;a4&&!P[zt[k-1]];--k);var E=c+5<<3,L=Tt(i,lt)+Tt(a,It)+o,B=Tt(i,f)+Tt(a,g)+o+14+3*k+Tt(A,P)+(2*A[16]+3*A[17]+7*A[18]);if(E<=L&&E<=B)return Rt(t,h,r.subarray(l,l+c));var F,O,H,W;if(rt(t,h,1+(B15&&(rt(t,h,nt[w]>>>5&127),h+=nt[w]>>>12)}}else F=rn,O=lt,H=on,W=It;for(var w=0;w255){var Y=n[w]>>>18&31;dt(t,h,F[Y+257]),h+=O[Y+257],Y>7&&(rt(t,h,n[w]>>>23&31),h+=xt[Y]);var b=n[w]&31;dt(t,h,H[b]),h+=W[b],b>3&&(dt(t,h,n[w]>>>5&8191),h+=Pt[b])}else dt(t,h,F[n[w]]),h+=O[n[w]];return dt(t,h,F[256]),h+O[256]},ln=new st([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ot=new C(0),cn=function(r,t,e,n,i,a){var o=r.length,s=new C(n+o+5*(1+Math.ceil(o/7e3))+i),l=s.subarray(n,s.length-i),c=0;if(!t||o<8)for(var h=0;h<=o;h+=65535){var u=h+65535;u>>13,v=f&8191,g=(1<7e3||P>24576)&&F>423){c=me(r,l,0,D,x,A,z,P,k,h-k,c),P=w=z=0,k=h;for(var O=0;O<286;++O)x[O]=0;for(var O=0;O<30;++O)A[O]=0}var H=2,W=0,Q=v,Z=L-B&32767;if(F>2&&E==I(h-Z))for(var et=Math.min(p,F)-1,nt=Math.min(32767,h),Y=Math.min(258,F);Z<=nt&&--Q&&L!=B;){if(r[h+H]==r[h+H-Z]){for(var b=0;bH){if(H=b,W=Z,b>et)break;for(var bt=Math.min(Z,b-2),kt=0,O=0;Okt&&(kt=ze,B=mt)}}}L=B,B=y[L],Z+=L-B+32768&32767}if(W){D[P++]=268435456|Nt[H]<<18|ve[W];var Oe=Nt[H]&31,Be=ve[W]&31;z+=xt[Oe]+Pt[Be],++x[257+Oe],++A[Be],X=h+H,++w}else D[P++]=r[h],++x[r[h]]}}c=me(r,l,a,D,x,A,z,P,k,h-k,c),!a&&c&7&&(c=Rt(l,c+1,ot))}return _(s,0,n+Vt(c)+i)},un=function(){for(var r=new st(256),t=0;t<256;++t){for(var e=t,n=9;--n;)e=(e&1&&3988292384)^e>>>1;r[t]=e}return r}(),Dt=function(){var r=-1;return{p:function(t){for(var e=r,n=0;n>>8;r=e},d:function(){return~r}}},Ae=function(){var r=1,t=0;return{p:function(e){for(var n=r,i=t,a=e.length,o=0;o!=a;){for(var s=Math.min(o+2655,a);o>16),i=(i&65535)+15*(i>>16)}r=n,t=i},d:function(){return r%=65521,t%=65521,(r&255)<<24|r>>>8<<16|(t&255)<<8|t>>>8}}},gt=function(r,t,e,n,i){return cn(r,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):12+t.mem,e,n,!i)},jt=function(r,t){var e={};for(var n in r)e[n]=r[n];for(var n in t)e[n]=t[n];return e},Ze=function(r,t,e){for(var n=r(),i=r.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/ /g,"").split(","),o=0;o>>0},ce=function(r,t){return G(r,t)+G(r,t+4)*4294967296},S=function(r,t,e){for(;e;++t)r[t]=e,e>>>=8},Pe=function(r,t){var e=t.filename;if(r[0]=31,r[1]=139,r[2]=8,r[8]=t.level<2?4:t.level==9?2:0,r[9]=3,t.mtime!=0&&S(r,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),e){r[3]=8;for(var n=0;n<=e.length;++n)r[n+10]=e.charCodeAt(n)}},De=function(r){if(r[0]!=31||r[1]!=139||r[2]!=8)throw"invalid gzip data";var t=r[3],e=10;t&4&&(e+=r[10]|(r[11]<<8)+2);for(var n=(t>>3&1)+(t>>4&1);n>0;n-=!r[e++]);return e+(t&2)},mn=function(r){var t=r.length;return(r[t-4]|r[t-3]<<8|r[t-2]<<16|r[t-1]<<24)>>>0},Me=function(r){return 10+(r.filename&&r.filename.length+1||0)},Ce=function(r,t){var e=t.level,n=e==0?0:e<6?1:e==9?3:2;r[0]=120,r[1]=n<<6|(n?32-2*n:1)},yn=function(r){if((r[0]&15)!=8||r[0]>>>4>7||(r[0]<<8|r[1])%31)throw"invalid zlib data";if(r[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Se(r,t){return!t&&typeof r=="function"&&(t=r,r={}),this.ondata=t,r}var at=function(){function r(t,e){!e&&typeof t=="function"&&(e=t,t={}),this.ondata=e,this.o=t||{}}return r.prototype.p=function(t,e){this.ondata(gt(t,this.o,0,0,!e),e)},r.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)},r}(),wn=function(){function r(t,e){Et([Ct,function(){return[tt,at]}],this,Se.call(this,t,e),function(n){var i=new at(n.data);onmessage=tt(i)},6)}return r}();function dn(r,t,e){if(e||(e=t,t={}),typeof e!="function")throw"no callback";return St(r,t,[Ct],function(n){return vt(Xt(n.data[0],n.data[1]))},0,e)}function Xt(r,t){return gt(r,t||{},0,0)}var q=function(){function r(t){this.s={},this.p=new C(0),this.ondata=t}return r.prototype.e=function(t){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var e=this.p.length,n=new C(e+t.length);n.set(this.p),n.set(t,e),this.p=n},r.prototype.c=function(t){this.d=this.s.i=t||!1;var e=this.s.b,n=Gt(this.p,this.o,this.s);this.ondata(_(n,e,this.s.b),this.d),this.o=_(n,this.s.b-32768),this.s.b=this.o.length,this.p=_(this.p,this.s.p/8|0),this.s.p&=7},r.prototype.push=function(t,e){this.e(t),this.c(e)},r}(),Ee=function(){function r(t){this.ondata=t,Et([Mt,function(){return[tt,q]}],this,0,function(){var e=new q;onmessage=tt(e)},7)}return r}();function Le(r,t,e){if(e||(e=t,t={}),typeof e!="function")throw"no callback";return St(r,t,[Mt],function(n){return vt(Lt(n.data[0],xe(n.data[1])))},1,e)}function Lt(r,t){return Gt(r,t)}var te=function(){function r(t,e){this.c=Dt(),this.l=0,this.v=1,at.call(this,t,e)}return r.prototype.push=function(t,e){at.prototype.push.call(this,t,e)},r.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var n=gt(t,this.o,this.v&&Me(this.o),e&&8,!e);this.v&&(Pe(n,this.o),this.v=0),e&&(S(n,n.length-8,this.c.d()),S(n,n.length-4,this.l)),this.ondata(n,e)},r}(),Ke=function(){function r(t,e){Et([Ct,fn,function(){return[tt,at,te]}],this,Se.call(this,t,e),function(n){var i=new te(n.data);onmessage=tt(i)},8)}return r}();function We(r,t,e){if(e||(e=t,t={}),typeof e!="function")throw"no callback";return St(r,t,[Ct,fn,function(){return[ee]}],function(n){return vt(ee(n.data[0],n.data[1]))},2,e)}function ee(r,t){t||(t={});var e=Dt(),n=r.length;e.p(r);var i=gt(r,t,Me(t),8),a=i.length;return Pe(i,t),S(i,a-8,e.d()),S(i,a-4,n),i}var ne=function(){function r(t){this.v=1,q.call(this,t)}return r.prototype.push=function(t,e){if(q.prototype.e.call(this,t),this.v){var n=this.p.length>3?De(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)}q.prototype.c.call(this,e)},r}(),Tn=function(){function r(t){this.ondata=t,Et([Mt,pn,function(){return[tt,q,ne]}],this,0,function(){var e=new ne;onmessage=tt(e)},9)}return r}();function In(r,t,e){if(e||(e=t,t={}),typeof e!="function")throw"no callback";return St(r,t,[Mt,pn,function(){return[re]}],function(n){return vt(re(n.data[0]))},3,e)}function re(r,t){return Gt(r.subarray(De(r),-8),t||new C(mn(r)))}var ye=function(){function r(t,e){this.c=Ae(),this.v=1,at.call(this,t,e)}return r.prototype.push=function(t,e){at.prototype.push.call(this,t,e)},r.prototype.p=function(t,e){this.c.p(t);var n=gt(t,this.o,this.v&&2,e&&4,!e);this.v&&(Ce(n,this.o),this.v=0),e&&S(n,n.length-4,this.c.d()),this.ondata(n,e)},r}(),pr=function(){function r(t,e){Et([Ct,vn,function(){return[tt,at,ye]}],this,Se.call(this,t,e),function(n){var i=new ye(n.data);onmessage=tt(i)},10)}return r}();function vr(r,t,e){if(e||(e=t,t={}),typeof e!="function")throw"no callback";return St(r,t,[Ct,vn,function(){return[we]}],function(n){return vt(we(n.data[0],n.data[1]))},4,e)}function we(r,t){t||(t={});var e=Ae();e.p(r);var n=gt(r,t,2,4);return Ce(n,t),S(n,n.length-4,e.d()),n}var ie=function(){function r(t){this.v=1,q.call(this,t)}return r.prototype.push=function(t,e){if(q.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)}q.prototype.c.call(this,e)},r}(),An=function(){function r(t){this.ondata=t,Et([Mt,gn,function(){return[tt,q,ie]}],this,0,function(){var e=new ie;onmessage=tt(e)},11)}return r}();function xn(r,t,e){if(e||(e=t,t={}),typeof e!="function")throw"no callback";return St(r,t,[Mt,gn,function(){return[Bt]}],function(n){return vt(Bt(n.data[0],xe(n.data[1])))},5,e)}function Bt(r,t){return Gt((yn(r),r.subarray(2,-4)),t)}var Pn=function(){function r(t){this.G=ne,this.I=q,this.Z=ie,this.ondata=t}return r.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 C(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 i=this,a=function(){i.ondata.apply(i,arguments)};this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(a):(this.p[0]&15)!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(a):new this.Z(a),this.s.push(this.p,e),this.p=null}}},r}(),gr=function(){function r(t){this.G=Tn,this.I=Ee,this.Z=An,this.ondata=t}return r.prototype.push=function(t,e){Pn.prototype.push.call(this,t,e)},r}();function mr(r,t,e){if(e||(e=t,t={}),typeof e!="function")throw"no callback";return r[0]==31&&r[1]==139&&r[2]==8?In(r,t,e):(r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31?Le(r,t,e):xn(r,t,e)}function yr(r,t){return r[0]==31&&r[1]==139&&r[2]==8?re(r,t):(r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31?Lt(r,t):Bt(r,t)}var ke=function(r,t,e,n){for(var i in r){var a=r[i],o=t+i;a instanceof C?e[o]=[a,n]:Array.isArray(a)?e[o]=[a[0],jt(n,a[1])]:ke(a,o+"/",e,n)}},Ye=typeof TextEncoder<"u"&&new TextEncoder,de=typeof TextDecoder<"u"&&new TextDecoder,Dn=0;try{de.decode(ot,{stream:!0}),Dn=1}catch{}var Mn=function(r){for(var t="",e=0;;){var n=r[e++],i=(n>127)+(n>223)+(n>239);if(e+i>r.length)return[t,_(r,e-1)];i?i==3?(n=((n&15)<<18|(r[e++]&63)<<12|(r[e++]&63)<<6|r[e++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):i&1?t+=String.fromCharCode((n&31)<<6|r[e++]&63):t+=String.fromCharCode((n&15)<<12|(r[e++]&63)<<6|r[e++]&63):t+=String.fromCharCode(n)}},wr=function(){function r(t){this.ondata=t,Dn?this.t=new TextDecoder:this.p=ot}return r.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}return}if(!this.p)throw"stream finished";var n=new C(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var i=Mn(n),a=i[0],o=i[1];if(e){if(o.length)throw"invalid utf-8 data";this.p=null}else this.p=o;this.ondata(a,e)},r}(),dr=function(){function r(t){this.ondata=t}return r.prototype.push=function(t,e){if(!this.ondata)throw"no callback";if(this.d)throw"stream finished";this.ondata(pt(t),this.d=e||!1)},r}();function pt(r,t){if(t){for(var e=new C(r.length),n=0;n>1)),o=0,s=function(h){a[o++]=h},n=0;na.length){var l=new C(o+8+(i-n<<1));l.set(a),a=l}var c=r.charCodeAt(n);c<128||t?s(c):c<2048?(s(192|c>>6),s(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|r.charCodeAt(++n)&1023,s(240|c>>18),s(128|c>>12&63),s(128|c>>6&63),s(128|c&63)):(s(224|c>>12),s(128|c>>6&63),s(128|c&63))}return _(a,0,o)}function Fe(r,t){if(t){for(var e="",n=0;n65535)throw"extra field too long";t+=n+4}return t},At=function(r,t,e,n,i,a,o,s){var l=n.length,c=e.extra,h=s&&s.length,u=ht(c);S(r,t,o!=null?33639248:67324752),t+=4,o!=null&&(r[t++]=20,r[t++]=e.os),r[t]=20,t+=2,r[t++]=e.flag<<1|(a==null&&8),r[t++]=i&&8,r[t++]=e.compression&255,r[t++]=e.compression>>8;var f=new Date(e.mtime==null?Date.now():e.mtime),p=f.getFullYear()-1980;if(p<0||p>119)throw"date not in range 1980-2099";if(S(r,t,p<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>>1),t+=4,a!=null&&(S(r,t,e.crc),S(r,t+4,a),S(r,t+8,e.size)),S(r,t+12,l),S(r,t+14,u),t+=16,o!=null&&(S(r,t,h),S(r,t+6,e.attrs),S(r,t+10,o),t+=14),r.set(n,t),t+=l,u)for(var v in c){var g=c[v],y=g.length;S(r,t,+v),S(r,t+2,y),r.set(g,t+4),t+=4+y}return h&&(r.set(s,t),t+=h),t},Re=function(r,t,e,n,i){S(r,t,101010256),S(r,t+8,e),S(r,t+10,e),S(r,t+12,n),S(r,t+16,i)},Ut=function(){function r(t){this.filename=t,this.c=Dt(),this.size=0,this.compression=0}return r.prototype.process=function(t,e){this.ondata(null,t,e)},r.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)},r}(),Tr=function(){function r(t,e){var n=this;e||(e={}),Ut.call(this,t),this.d=new at(e,function(i,a){n.ondata(null,i,a)}),this.compression=8,this.flag=Cn(e.level)}return r.prototype.process=function(t,e){try{this.d.push(t,e)}catch(n){this.ondata(n,null,e)}},r.prototype.push=function(t,e){Ut.prototype.push.call(this,t,e)},r}(),Ir=function(){function r(t,e){var n=this;e||(e={}),Ut.call(this,t),this.d=new wn(e,function(i,a,o){n.ondata(i,a,o)}),this.compression=8,this.flag=Cn(e.level),this.terminate=this.d.terminate}return r.prototype.process=function(t,e){this.d.push(t,e)},r.prototype.push=function(t,e){Ut.prototype.push.call(this,t,e)},r}(),Ar=function(){function r(t){this.ondata=t,this.u=[],this.d=1}return r.prototype.add=function(t){var e=this;if(this.d&2)throw"stream finished";var n=pt(t.filename),i=n.length,a=t.comment,o=a&&pt(a),s=i!=t.filename.length||o&&a.length!=o.length,l=i+ht(t.extra)+30;if(i>65535)throw"filename too long";var c=new C(l);At(c,0,t,n,s);var h=[c],u=function(){for(var y=0,T=h;y65535&&E("filename too long",null),!k)E(null,d);else if(D<16e4)try{E(null,Xt(d,m))}catch(L){E(L,null)}else h.push(dn(d,m,E))},v=0;v65535)throw"filename too long";var T=h?Xt(l,c):l,d=T.length,m=Dt();m.p(l),n.push(jt(c,{size:l.length,crc:m.d(),c:T,f:u,m:v,u:f!=o.length||v&&p.length!=g,o:i,compression:h})),i+=30+f+y+d,a+=76+2*(f+y)+(g||0)+d}for(var I=new C(a+22),D=i,x=a-i,A=0;A0){var i=Math.min(this.c,t.length),a=t.subarray(0,i);if(this.c-=i,this.d?this.d.push(a,!this.c):this.k[0].push(a),t=t.subarray(i),t.length)return this.push(t,e)}else{var o=0,s=0,l=void 0,c=void 0;this.p.length?t.length?(c=new C(this.p.length+t.length),c.set(this.p),c.set(t,this.p.length)):c=this.p:c=t;for(var h=c.length,u=this.c,f=u&&this.d,p=function(){var T,d=G(c,s);if(d==67324752){o=1,l=s,v.d=null,v.c=0;var m=K(c,s+6),I=K(c,s+8),D=m&2048,x=m&8,A=K(c,s+26),w=K(c,s+28);if(h>s+30+A+w){var z=[];v.k.unshift(z),o=2;var P=G(c,s+18),X=G(c,s+22),k=Fe(c.subarray(s+30,s+=30+A),!D);P==4294967295?(T=x?[-2]:Ln(c,s),P=T[0],X=T[1]):x&&(P=-1),s+=w,v.c=P;var E,L={name:k,compression:I,start:function(){if(!L.ondata)throw"no callback";if(!P)L.ondata(null,ot,!0);else{var B=n.o[I];if(!B)throw"unknown compression type "+I;E=P<0?new B(k):new B(k,P,X),E.ondata=function(W,Q,Z){L.ondata(W,Q,Z)};for(var F=0,O=z;F=0&&(L.size=P,L.originalSize=X),v.onfile(L)}return"break"}else if(u){if(d==134695760)return l=s+=12+(u==-2&&8),o=3,v.c=0,"break";if(d==33639248)return l=s-=4,o=3,v.c=0,"break"}},v=this;s65558){t("invalid zip file",null);return}var o=K(r,a+8);o||t(null,{});var s=o,l=G(r,a+16),c=l==4294967295;if(c){if(a=G(r,a-12),G(r,a)!=101075792){t("invalid zip file",null);return}s=o=G(r,a+32),l=G(r,a+48)}for(var h=function(f){var p=En(r,l,c),v=p[0],g=p[1],y=p[2],T=p[3],d=p[4],m=p[5],I=Sn(r,m);l=d;var D=function(A,w){A?(n(),t(A,null)):(i[T]=w,--o||t(null,i))};if(!v)D(null,_(r,I,I+g));else if(v==8){var x=r.subarray(I,I+g);if(g<32e4)try{D(null,Lt(x,new C(y)))}catch(A){D(A,null)}else e.push(Le(x,{size:y},D))}else D("unknown compression type "+v,null)},u=0;u65558)throw"invalid zip file";var n=K(r,e+8);if(!n)return{};var i=G(r,e+16),a=i==4294967295;if(a){if(e=G(r,e-12),G(r,e)!=101075792)throw"invalid zip file";n=G(r,e+32),i=G(r,e+48)}for(var o=0;o=e[n])return n-1;if(t<=e[r])return r;let i=r,a=n,o=Math.floor((i+a)/2);for(;t=e[o+1];)t=g&&(v[p][0]=v[f][0]/s[d+1][T],y=v[p][0]*s[T][d]);const m=T>=-1?1:-T,I=u-1<=d?g-1:e-u;for(let x=m;x<=I;++x)v[p][x]=(v[f][x]-v[f][x-1])/s[d+1][T+x],y+=v[p][x]*s[T+x][d];u<=d&&(v[p][g]=-v[f][g-1]/s[d+1][u],y+=v[p][g]*s[u][d]),o[g][u]=y;const D=f;f=p,p=D}}let h=e;for(let u=1;u<=n;++u){for(let f=0;f<=e;++f)o[u][f]*=h;h*=e-u}return o}function zr(r,t,e,n,i){const a=i0,l=typeof a.Content=="string"&&a.Content!=="";if(s||l){const c=this.parseImage(n[i]);e[a.RelativeFilename||a.Filename]=c}}}}for(const n in t){const i=t[n];e[i]!==void 0?t[n]=e[i]:t[n]=t[n].split("\\").pop()}return t}parseImage(t){const e=t.Content,n=t.RelativeFilename||t.Filename,i=n.slice(n.lastIndexOf(".")+1).toLowerCase();let a;switch(i){case"bmp":a="image/bmp";break;case"jpg":case"jpeg":a="image/jpeg";break;case"png":a="image/png";break;case"tif":a="image/tiff";break;case"tga":this.manager.getHandler(".tga")===null&&console.warn("FBXLoader: TGA loader not found, skipping ",n),a="image/tga";break;default:console.warn('FBXLoader: Image type "'+i+'" is not supported.');return}if(typeof e=="string")return"data:"+a+";base64,"+e;{const o=new Uint8Array(e);return window.URL.createObjectURL(new Blob([o],{type:a}))}}parseTextures(t){const e=new Map;if("Texture"in M.Objects){const n=M.Objects.Texture;for(const i in n){const a=this.parseTexture(n[i],t);e.set(parseInt(i),a)}}return e}parseTexture(t,e){const n=this.loadTexture(t,e);n.ID=t.id,n.name=t.attrName;const i=t.WrapModeU,a=t.WrapModeV,o=i!==void 0?i.value:0,s=a!==void 0?a.value:0;if(n.wrapS=o===0?Ue:Ve,n.wrapT=s===0?Ue:Ve,"Scaling"in t){const l=t.Scaling.value;n.repeat.x=l[0],n.repeat.y=l[1]}if("Translation"in t){const l=t.Translation.value;n.offset.x=l[0],n.offset.y=l[1]}return n}loadTexture(t,e){let n;const i=this.textureLoader.path,a=V.get(t.id).children;a!==void 0&&a.length>0&&e[a[0].ID]!==void 0&&(n=e[a[0].ID],(n.indexOf("blob:")===0||n.indexOf("data:")===0)&&this.textureLoader.setPath(void 0));let o;const s=t.FileName.slice(-3).toLowerCase();if(s==="tga"){const l=this.manager.getHandler(".tga");l===null?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",t.RelativeFilename),o=new Ge):(l.setPath(this.textureLoader.path),o=l.load(n))}else s==="psd"?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",t.RelativeFilename),o=new Ge):o=this.textureLoader.load(n);return this.textureLoader.setPath(i),o}parseMaterials(t){const e=new Map;if("Material"in M.Objects){const n=M.Objects.Material;for(const i in n){const a=this.parseMaterial(n[i],t);a!==null&&e.set(parseInt(i),a)}}return e}parseMaterial(t,e){const n=t.id,i=t.attrName;let a=t.ShadingModel;if(typeof a=="object"&&(a=a.value),!V.has(n))return null;const o=this.parseParameters(t,e,n);let s;switch(a.toLowerCase()){case"phong":s=new se;break;case"lambert":s=new Hn;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',a),s=new se;break}return s.setValues(o),s.name=i,s}parseParameters(t,e,n){const i={};t.BumpFactor&&(i.bumpScale=t.BumpFactor.value),t.Diffuse?i.color=new ct().fromArray(t.Diffuse.value):t.DiffuseColor&&(t.DiffuseColor.type==="Color"||t.DiffuseColor.type==="ColorRGB")&&(i.color=new ct().fromArray(t.DiffuseColor.value)),t.DisplacementFactor&&(i.displacementScale=t.DisplacementFactor.value),t.Emissive?i.emissive=new ct().fromArray(t.Emissive.value):t.EmissiveColor&&(t.EmissiveColor.type==="Color"||t.EmissiveColor.type==="ColorRGB")&&(i.emissive=new ct().fromArray(t.EmissiveColor.value)),t.EmissiveFactor&&(i.emissiveIntensity=parseFloat(t.EmissiveFactor.value)),t.Opacity&&(i.opacity=parseFloat(t.Opacity.value)),i.opacity<1&&(i.transparent=!0),t.ReflectionFactor&&(i.reflectivity=t.ReflectionFactor.value),t.Shininess&&(i.shininess=t.Shininess.value),t.Specular?i.specular=new ct().fromArray(t.Specular.value):t.SpecularColor&&t.SpecularColor.type==="Color"&&(i.specular=new ct().fromArray(t.SpecularColor.value));const a=this;return V.get(n).children.forEach(function(o){const s=o.relationship;switch(s){case"Bump":i.bumpMap=a.getTexture(e,o.ID);break;case"Maya|TEX_ao_map":i.aoMap=a.getTexture(e,o.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":i.map=a.getTexture(e,o.ID),i.map!==void 0&&(i.map.encoding=Ht);break;case"DisplacementColor":i.displacementMap=a.getTexture(e,o.ID);break;case"EmissiveColor":i.emissiveMap=a.getTexture(e,o.ID),i.emissiveMap!==void 0&&(i.emissiveMap.encoding=Ht);break;case"NormalMap":case"Maya|TEX_normal_map":i.normalMap=a.getTexture(e,o.ID);break;case"ReflectionColor":i.envMap=a.getTexture(e,o.ID),i.envMap!==void 0&&(i.envMap.mapping=Zn,i.envMap.encoding=Ht);break;case"SpecularColor":i.specularMap=a.getTexture(e,o.ID),i.specularMap!==void 0&&(i.specularMap.encoding=Ht);break;case"TransparentColor":case"TransparencyFactor":i.alphaMap=a.getTexture(e,o.ID),i.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",s);break}}),i}getTexture(t,e){return"LayeredTexture"in M.Objects&&e in M.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),e=V.get(e).children[0].ID),t.get(e)}parseDeformers(){const t={},e={};if("Deformer"in M.Objects){const n=M.Objects.Deformer;for(const i in n){const a=n[i],o=V.get(parseInt(i));if(a.attrType==="Skin"){const s=this.parseSkeleton(o,n);s.ID=i,o.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),s.geometryID=o.parents[0].ID,t[i]=s}else if(a.attrType==="BlendShape"){const s={id:i};s.rawTargets=this.parseMorphTargets(o,n),s.id=i,o.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),e[i]=s}}}return{skeletons:t,morphTargets:e}}parseSkeleton(t,e){const n=[];return t.children.forEach(function(i){const a=e[i.ID];if(a.attrType!=="Cluster")return;const o={ID:i.ID,indices:[],weights:[],transformLink:new U().fromArray(a.TransformLink.a)};"Indexes"in a&&(o.indices=a.Indexes.a,o.weights=a.Weights.a),n.push(o)}),{rawBones:n,bones:[]}}parseMorphTargets(t,e){const n=[];for(let i=0;i1?o=s:s.length>0?o=s[0]:(o=new se({color:13421772}),s.push(o)),"color"in a.attributes&&s.forEach(function(l){l.vertexColors=!0}),a.FBX_Deformer?(i=new qn(a,o),i.normalizeSkinWeights()):i=new Qn(a,o),i}createCurve(t,e){const n=t.children.reduce(function(a,o){return e.has(o.ID)&&(a=e.get(o.ID)),a},null),i=new Jn({color:3342591,linewidth:1});return new Nn(n,i)}getTransformData(t,e){const n={};"InheritType"in e&&(n.inheritType=parseInt(e.InheritType.value)),"RotationOrder"in e?n.eulerOrder=On(e.RotationOrder.value):n.eulerOrder="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){"LookAtProperty"in e&&V.get(t.ID).children.forEach(function(i){if(i.relationship==="LookAtProperty"){const a=M.Objects.Model[i.ID];if("Lcl_Translation"in a){const o=a.Lcl_Translation.value;t.target!==void 0?(t.target.position.fromArray(o),$.add(t.target)):t.lookAt(new ft().fromArray(o))}}})}bindSkeleton(t,e,n){const i=this.parsePoseNodes();for(const a in t){const o=t[a];V.get(parseInt(o.ID)).parents.forEach(function(l){if(e.has(l.ID)){const c=l.ID;V.get(c).parents.forEach(function(u){n.has(u.ID)&&n.get(u.ID).bind(new _n(o.bones),i[u.ID])})}})}}parsePoseNodes(){const t={};if("Pose"in M.Objects){const e=M.Objects.Pose;for(const n in e)if(e[n].attrType==="BindPose"&&e[n].NbPoseNodes>0){const i=e[n].PoseNode;Array.isArray(i)?i.forEach(function(a){t[a.Node]=new U().fromArray(a.Matrix.a)}):t[i.Node]=new U().fromArray(i.Matrix.a)}}return t}createAmbientLight(){if("GlobalSettings"in M&&"AmbientColor"in M.GlobalSettings){const t=M.GlobalSettings.AmbientColor.value,e=t[0],n=t[1],i=t[2];if(e!==0||n!==0||i!==0){const a=new ct(e,n,i);$.add(new tr(a,1))}}}}class jr{parse(t){const e=new Map;if("Geometry"in M.Objects){const n=M.Objects.Geometry;for(const i in n){const a=V.get(parseInt(i)),o=this.parseGeometry(a,n[i],t);e.set(parseInt(i),o)}}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 i=n.skeletons,a=[],o=t.parents.map(function(u){return M.Objects.Model[u.ID]});if(o.length===0)return;const s=t.children.reduce(function(u,f){return i[f.ID]!==void 0&&(u=i[f.ID]),u},null);t.children.forEach(function(u){n.morphTargets[u.ID]!==void 0&&a.push(n.morphTargets[u.ID])});const l=o[0],c={};"RotationOrder"in l&&(c.eulerOrder=On(l.RotationOrder.value)),"InheritType"in l&&(c.inheritType=parseInt(l.InheritType.value)),"GeometricTranslation"in l&&(c.translation=l.GeometricTranslation.value),"GeometricRotation"in l&&(c.rotation=l.GeometricRotation.value),"GeometricScaling"in l&&(c.scale=l.GeometricScaling.value);const h=zn(c);return this.genGeometry(e,s,a,h)}genGeometry(t,e,n,i){const a=new Zt;t.attrName&&(a.name=t.attrName);const o=this.parseGeoNode(t,e),s=this.genBuffers(o),l=new yt(s.vertex,3);if(l.applyMatrix4(i),a.setAttribute("position",l),s.colors.length>0&&a.setAttribute("color",new yt(s.colors,3)),e&&(a.setAttribute("skinIndex",new er(s.weightsIndices,4)),a.setAttribute("skinWeight",new yt(s.vertexWeights,4)),a.FBX_Deformer=e),s.normal.length>0){const c=new nr().getNormalMatrix(i),h=new yt(s.normal,3);h.applyNormalMatrix(c),a.setAttribute("normal",h)}if(s.uvs.forEach(function(c,h){let u="uv"+(h+1).toString();h===0&&(u="uv"),a.setAttribute(u,new yt(s.uvs[h],2))}),o.material&&o.material.mappingType!=="AllSame"){let c=s.materialIndex[0],h=0;if(s.materialIndex.forEach(function(u,f){u!==c&&(a.addGroup(h,f-h,c),c=u,h=f)}),a.groups.length>0){const u=a.groups[a.groups.length-1],f=u.start+u.count;f!==s.materialIndex.length&&a.addGroup(f,s.materialIndex.length-f,c)}a.groups.length===0&&a.addGroup(0,s.materialIndex.length,s.materialIndex[0])}return this.addMorphTargets(a,t,n,i),a}parseGeoNode(t,e){const n={};if(n.vertexPositions=t.Vertices!==void 0?t.Vertices.a:[],n.vertexIndices=t.PolygonVertexIndex!==void 0?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 i=0;for(;t.LayerElementUV[i];)t.LayerElementUV[i].UV&&n.uv.push(this.parseUVs(t.LayerElementUV[i])),i++}return n.weightTable={},e!==null&&(n.skeleton=e,e.rawBones.forEach(function(i,a){i.indices.forEach(function(o,s){n.weightTable[o]===void 0&&(n.weightTable[o]=[]),n.weightTable[o].push({id:a,weight:i.weights[s]})})})),n}genBuffers(t){const e={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let n=0,i=0,a=!1,o=[],s=[],l=[],c=[],h=[],u=[];const f=this;return t.vertexIndices.forEach(function(p,v){let g,y=!1;p<0&&(p=p^-1,y=!0);let T=[],d=[];if(o.push(p*3,p*3+1,p*3+2),t.color){const m=Yt(v,n,p,t.color);l.push(m[0],m[1],m[2])}if(t.skeleton){if(t.weightTable[p]!==void 0&&t.weightTable[p].forEach(function(m){d.push(m.weight),T.push(m.id)}),d.length>4){a||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),a=!0);const m=[0,0,0,0],I=[0,0,0,0];d.forEach(function(D,x){let A=D,w=T[x];I.forEach(function(z,P,X){if(A>z){X[P]=A,A=z;const k=m[P];m[P]=w,w=k}})}),T=m,d=I}for(;d.length<4;)d.push(0),T.push(0);for(let m=0;m<4;++m)h.push(d[m]),u.push(T[m])}if(t.normal){const m=Yt(v,n,p,t.normal);s.push(m[0],m[1],m[2])}t.material&&t.material.mappingType!=="AllSame"&&(g=Yt(v,n,p,t.material)[0]),t.uv&&t.uv.forEach(function(m,I){const D=Yt(v,n,p,m);c[I]===void 0&&(c[I]=[]),c[I].push(D[0]),c[I].push(D[1])}),i++,y&&(f.genFace(e,t,o,g,s,l,c,h,u,i),n++,i=0,o=[],s=[],l=[],c=[],h=[],u=[])}),e}genFace(t,e,n,i,a,o,s,l,c,h){for(let u=2;u1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const o=t.get(a[0].ID);n[i]={name:e[i].attrName,layer:o}}return n}addClip(t){let e=[];const n=this;return t.layer.forEach(function(i){e=e.concat(n.generateTracks(i))}),new rr(t.name,-1,e)}generateTracks(t){const e=[];let n=new ft,i=new Kt,a=new ft;if(t.transform&&t.transform.decompose(n,i,a),n=n.toArray(),i=new Ft().setFromQuaternion(i,t.eulerOrder).toArray(),a=a.toArray(),t.T!==void 0&&Object.keys(t.T.curves).length>0){const o=this.generateVectorTrack(t.modelName,t.T.curves,n,"position");o!==void 0&&e.push(o)}if(t.R!==void 0&&Object.keys(t.R.curves).length>0){const o=this.generateRotationTrack(t.modelName,t.R.curves,i,t.preRotation,t.postRotation,t.eulerOrder);o!==void 0&&e.push(o)}if(t.S!==void 0&&Object.keys(t.S.curves).length>0){const o=this.generateVectorTrack(t.modelName,t.S.curves,a,"scale");o!==void 0&&e.push(o)}if(t.DeformPercent!==void 0){const o=this.generateMorphTrack(t);o!==void 0&&e.push(o)}return e}generateVectorTrack(t,e,n,i){const a=this.getTimesForAllAxes(e),o=this.getKeyframeTrackValues(a,e,n);return new ir(t+"."+i,a,o)}generateRotationTrack(t,e,n,i,a,o){e.x!==void 0&&(this.interpolateRotations(e.x),e.x.values=e.x.values.map(it.degToRad)),e.y!==void 0&&(this.interpolateRotations(e.y),e.y.values=e.y.values.map(it.degToRad)),e.z!==void 0&&(this.interpolateRotations(e.z),e.z.values=e.z.values.map(it.degToRad));const s=this.getTimesForAllAxes(e),l=this.getKeyframeTrackValues(s,e,n);i!==void 0&&(i=i.map(it.degToRad),i.push(o),i=new Ft().fromArray(i),i=new Kt().setFromEuler(i)),a!==void 0&&(a=a.map(it.degToRad),a.push(o),a=new Ft().fromArray(a),a=new Kt().setFromEuler(a).invert());const c=new Kt,h=new Ft,u=[];for(let f=0;f1){let n=1,i=e[0];for(let a=1;a=180){const o=a/180,s=i/o;let l=n+s;const c=t.times[e-1],u=(t.times[e]-c)/o;let f=c+u;const p=[],v=[];for(;f1&&(n=t[1].replace(/^(\w+)::/,""),i=t[2]),{id:e,name:n,type:i}}parseNodeProperty(t,e,n){let i=e[1].replace(/^"/,"").replace(/"$/,"").trim(),a=e[2].replace(/^"/,"").replace(/"$/,"").trim();i==="Content"&&a===","&&(a=n.replace(/"/g,"").replace(/,$/,"").trim());const o=this.getCurrentNode();if(o.name==="Properties70"){this.parseNodeSpecialProperty(t,i,a);return}if(i==="C"){const l=a.split(",").slice(1),c=parseInt(l[0]),h=parseInt(l[1]);let u=a.split(",").slice(3);u=u.map(function(f){return f.trim().replace(/^"/,"")}),i="connections",a=[c,h],$r(a,u),o[i]===void 0&&(o[i]=[])}i==="Node"&&(o.id=a),i in o&&Array.isArray(o[i])?o[i].push(a):i!=="a"?o[i]=a:o.a=a,this.setCurrentProp(o,i),i==="a"&&a.slice(-1)!==","&&(o.a=he(a))}parseNodePropertyContinued(t){const e=this.getCurrentNode();e.a+=t,t.slice(-1)!==","&&(e.a=he(e.a))}parseNodeSpecialProperty(t,e,n){const i=n.split('",').map(function(h){return h.trim().replace(/^\"/,"").replace(/\s/,"_")}),a=i[0],o=i[1],s=i[2],l=i[3];let c=i[4];switch(o){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":c=parseFloat(c);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":c=he(c);break}this.getPrevNode()[a]={type:o,type2:s,flag:l,value:c},this.setCurrentProp(this.getPrevNode(),a)}}class Hr{parse(t){const e=new qe(t);e.skip(23);const n=e.getUint32();if(n<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+n);const i=new Rn;for(;!this.endOfContent(e);){const a=this.parseNode(e,n);a!==null&&i.add(a.name,a)}return i}endOfContent(t){return t.size()%16===0?(t.getOffset()+160+16&-16)>=t.size():t.getOffset()+160+16>=t.size()}parseNode(t,e){const n={},i=e>=7500?t.getUint64():t.getUint32(),a=e>=7500?t.getUint64():t.getUint32();e>=7500?t.getUint64():t.getUint32();const o=t.getUint8(),s=t.getString(o);if(i===0)return null;const l=[];for(let f=0;f0?l[0]:"",h=l.length>1?l[1]:"",u=l.length>2?l[2]:"";for(n.singleProperty=a===1&&t.getOffset()===i;i>t.getOffset();){const f=this.parseNode(t,e);f!==null&&this.parseSubNode(s,n,f)}return n.propertyList=l,typeof c=="number"&&(n.id=c),h!==""&&(n.attrName=h),u!==""&&(n.attrType=u),s!==""&&(n.name=s),n}parseSubNode(t,e,n){if(n.singleProperty===!0){const i=n.propertyList[0];Array.isArray(i)?(e[n.name]=n,n.a=i):e[n.name]=i}else if(t==="Connections"&&n.name==="C"){const i=[];n.propertyList.forEach(function(a,o){o!==0&&i.push(a)}),e.connections===void 0&&(e.connections=[]),e.connections.push(i)}else if(n.name==="Properties70")Object.keys(n).forEach(function(a){e[a]=n[a]});else if(t==="Properties70"&&n.name==="P"){let i=n.propertyList[0],a=n.propertyList[1];const o=n.propertyList[2],s=n.propertyList[3];let l;i.indexOf("Lcl ")===0&&(i=i.replace("Lcl ","Lcl_")),a.indexOf("Lcl ")===0&&(a=a.replace("Lcl ","Lcl_")),a==="Color"||a==="ColorRGB"||a==="Vector"||a==="Vector3D"||a.indexOf("Lcl_")===0?l=[n.propertyList[4],n.propertyList[5],n.propertyList[6]]:l=n.propertyList[4],e[i]={type:a,type2:o,flag:s,value:l}}else e[n.name]===void 0?typeof n.id=="number"?(e[n.name]={},e[n.name][n.id]=n):e[n.name]=n:n.name==="PoseNode"?(Array.isArray(e[n.name])||(e[n.name]=[e[n.name]]),e[n.name].push(n)):e[n.name][n.id]===void 0&&(e[n.name][n.id]=n)}parseProperty(t){const e=t.getString(1);let n;switch(e){case"C":return t.getBoolean();case"D":return t.getFloat64();case"F":return t.getFloat32();case"I":return t.getInt32();case"L":return t.getInt64();case"R":return n=t.getUint32(),t.getArrayBuffer(n);case"S":return n=t.getUint32(),t.getString(n);case"Y":return t.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const i=t.getUint32(),a=t.getUint32(),o=t.getUint32();if(a===0)switch(e){case"b":case"c":return t.getBooleanArray(i);case"d":return t.getFloat64Array(i);case"f":return t.getFloat32Array(i);case"i":return t.getInt32Array(i);case"l":return t.getInt64Array(i)}typeof Lr>"u"&&console.error("THREE.FBXLoader: External library fflate.min.js required.");const s=Bt(new Uint8Array(t.getArrayBuffer(o))),l=new qe(s.buffer);switch(e){case"b":case"c":return l.getBooleanArray(i);case"d":return l.getFloat64Array(i);case"f":return l.getFloat32Array(i);case"i":return l.getInt32Array(i);case"l":return l.getInt64Array(i)}default:throw new Error("THREE.FBXLoader: Unknown property type "+e)}}}class qe{constructor(t,e){this.dv=new DataView(t),this.offset=0,this.littleEndian=e!==void 0?e:!0}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(t){this.offset+=t}getBoolean(){return(this.getUint8()&1)===1}getBooleanArray(t){const e=[];for(let n=0;n=0&&(e=e.slice(0,n)),Te.decodeText(new Uint8Array(e))}}class Rn{add(t,e){this[t]=e}}function Zr(r){const t="Kaydara FBX Binary \0";return r.byteLength>=t.length&&t===Bn(r,0,t.length)}function Kr(r){const t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let e=0;function n(i){const a=r[i-1];return r=r.slice(e+i),e++,a}for(let i=0;i{const[e,n]=await Vn(Qr,r,()=>new Promise((i,a)=>{sr(),Jr.load(r,o=>{be();let s=!0;o.traverse(l=>{var c;s&&l instanceof fe&&(s=!1),!((c=l.material)===null||c===void 0)&&c.map&&(l.material.map.encoding=lr)}),i([o,s])},cr,()=>{be(),a()})}));return t?Gn(e,n):e};export{ti as default};