!function(t,r){for(var s in r)t[s]=r[s]}(window,function(t){var r={};function s(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,s),n.l=!0,n.exports}return s.m=t,s.c=r,s.d=function(t,r,e){s.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:e})},s.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},s.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(r,"a",r),r},s.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},s.p="",s(s.s=3)}({3:function(t,r,s){"use strict";s.r(r);class e{get values(){return this._values}get magnitude(){const t=this._values.reduce((t,r)=>t+r*r,0);return Math.sqrt(t)}toString(){return`Vector${this._values.length}(${this._values.join(", ")})`}}class n extends e{get x(){return this._values[0]}get y(){return this._values[1]}set x(t){this._values[0]=t}set y(t){this._values[1]=t}}class i extends e{get x(){return this._values[0]}get y(){return this._values[1]}get z(){return this._values[2]}set x(t){this._values[0]=t}set y(t){this._values[1]=t}set z(t){this._values[2]=t}}class u extends e{get x(){return this._values[0]}get y(){return this._values[1]}get z(){return this._values[2]}get w(){return this._values[3]}set x(t){this._values[0]=t}set y(t){this._values[1]=t}set z(t){this._values[2]=t}set w(t){this._values[3]=t}}class a extends n{constructor(t,r){super(),this._values=new Float32Array([t,r])}add(t){return new a(this.x+t.x,this.y+t.y)}sub(t){return new a(this.x-t.x,this.y-t.y)}mulByScalar(t){return new a(this.x*t,this.y*t)}}class o extends i{constructor(t,r,s){super(),this._values=new Float32Array([t,r,s])}add(t){return new o(this.x+t.x,this.y+t.y,this.z+t.z)}sub(t){return new o(this.x-t.x,this.y-t.y,this.z-t.z)}mulByScalar(t){return new o(this.x*t,this.y*t,this.z*t)}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){const r=this.y*t.z-this.z*t.y,s=this.z*t.x-this.x*t.z,e=this.x*t.y-this.y*t.x;return new o(r,s,e)}normalize(){const t=this.magnitude;return 0===t?this:new o(this.x/t,this.y/t,this.z/t)}get xy(){return new a(this.x,this.y)}get hom2cart(){return new a(this.x/this.z,this.y/this.z)}}class h extends u{constructor(t,r,s,e){super(),this._values=new Float32Array([t,r,s,e])}add(t){return new h(this.x+t.x,this.y+t.y,this.z+t.z,this.w+t.w)}sub(t){return new h(this.x-t.x,this.y-t.y,this.z-t.z,this.w-t.w)}mulByScalar(t){return new h(this.x*t,this.y*t,this.z*t,this.w*t)}get xyz(){return new o(this.x,this.y,this.z)}get hom2cart(){return new o(this.x/this.w,this.y/this.w,this.z/this.w)}}const c=a,l=o,x=h;class y{constructor(t,r,s,e){this._values=new Float32Array([t,r,s,e])}static rotationAround(t,r){const s=Math.sin(r/2),e=Math.cos(r/2);return new y(t.x*s,t.y*s,t.z*s,e)}normalize(){const t=this.magnitude;if(0===t)return this;const r=1/t;return new y(this.x*r,this.y*r,this.z*r,this.w*r)}add(t){return new y(this.x+t.x,this.y+t.y,this.z+t.z,this.w+t.w)}mulByScalar(t){return new y(this.x*t,this.y*t,this.z*t,this.w*t)}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}slerp(t,r,s={chooseShorterAngle:!0}){let e=this.dot(t),n=t;e<0&&(e=-e,n=t.mulByScalar(-1));const i=Math.acos(e),u=Math.sin(i),a=this.mulByScalar(Math.sin((1-r)*i)/u),o=n.mulByScalar(Math.sin(r*i)/u);return a.add(o)}get magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}get norm(){return this.magnitude}get x(){return this._values[0]}get y(){return this._values[1]}get z(){return this._values[2]}get w(){return this._values[3]}set x(t){this._values[0]=t}set y(t){this._values[1]=t}set z(t){this._values[2]=t}set w(t){this._values[3]=t}get values(){return this._values}toRotationMatrix4(){const{x:t,y:r,z:s,w:e}=this;return new d(1-2*r*r-2*s*s,2*t*r+2*e*s,2*t*s-2*e*r,0,2*t*r-2*e*s,1-2*t*t-2*s*s,2*r*s+2*e*t,0,2*t*s+2*e*r,2*r*s-2*e*t,1-2*t*t-2*r*r,0,0,0,0,1)}toString(){return`Quaternion(${this.x}, ${this.y}, ${this.z}, ${this.w})`}}class w{constructor(t,r,s,e){this._values=new Float32Array([t,r,s,e])}static identity(){return new w(1,0,0,1)}get values(){return this._values}toString(){return this._values.toString()}}class v{constructor(t,r,s,e,n,i,u,a,o){this._values=new Float32Array([t,r,s,e,n,i,u,a,o])}static identity(){return new v(1,0,0,0,1,0,0,0,1)}static translation(t,r){return new v(1,0,0,0,1,0,t,r,1)}static scaling(t,r){return new v(t,0,0,0,r,0,0,0,1)}static rotation(t){const r=Math.sin(t),s=Math.cos(t);return new v(s,r,0,-r,s,0,0,0,1)}static projectiveTransform(t,r,s,e,n,i,u,a){const o=s-t,h=e-r,c=n-t,l=i-r,x=u-t,y=a-r,w=o*l-c*h,d=c*y-x*l,g=w+d-(o*y-x*h),_=d-g,z=w-g;return new v(t*_+d*o,r*_+d*h,_,t*z+w*x,r*z+w*y,z,t*g,r*g,g)}static projectiveInvTransform(t,r,s,e,n,i,u,a){const o=s-t,h=e-r,c=n-t,l=i-r,x=u-t,y=a-r,w=o*l-c*h,d=o*y-x*h,g=c*y-x*l,_=w+g-d,z=w-d,m=g-d,f=-w*_*y,M=w*_*x,p=g*_*h,B=-g*_*o,S=z*w*y+m*g*h,A=z*w*x+m*g*o;return new v(f,p,S,M,B,A,-f*t-M*r,-p*t-B*r,-S*t-A*r+-w*d*g)}mulByVector3(t){const[r,s,e,n,i,u,a,h,c]=this.values,[l,x,y]=t.values;return new o(r*l+n*x+a*y,s*l+i*x+h*y,e*l+u*x+c*y)}mulByMatrix3x3(t){const[r,s,e,n,i,u,a,o,h]=this.values,[c,l,x,y,w,d,g,_,z]=t.values;return new v(r*c+n*l+a*x,s*c+i*l+o*x,e*c+u*l+h*x,r*y+n*w+a*d,s*y+i*w+o*d,e*y+u*w+h*d,r*g+n*_+a*z,s*g+i*_+o*z,e*g+u*_+h*z)}mulByMatrix3(t){return this.mulByMatrix3x3(t)}translate(t,r){const s=v.translation(t,r);return this.mulByMatrix3x3(s)}scale(t,r){const s=v.scaling(t,r);return this.mulByMatrix3x3(s)}rotate(t){const r=v.rotation(t);return this.mulByMatrix3x3(r)}get values(){return this._values}toString(){return this._values.toString()}}class d{constructor(t,r,s,e,n,i,u,a,o,h,c,l,x,y,w,v){this._values=new Float32Array([t,r,s,e,n,i,u,a,o,h,c,l,x,y,w,v])}static identity(){return new d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}static translation(t,r,s){return new d(1,0,0,0,0,1,0,0,0,0,1,0,t,r,s,1)}static scaling(t,r,s){return new d(t,0,0,0,0,r,0,0,0,0,s,0,0,0,0,1)}static rotationX(t){const r=Math.sin(t),s=Math.cos(t);return new d(1,0,0,0,0,s,r,0,0,-r,s,0,0,0,0,1)}static rotationY(t){const r=Math.sin(t),s=Math.cos(t);return new d(s,0,-r,0,0,1,0,0,r,0,s,0,0,0,0,1)}static rotationZ(t){const r=Math.sin(t),s=Math.cos(t);return new d(s,r,0,0,-r,s,0,0,0,0,1,0,0,0,0,1)}static rotationAround(t,r){return y.rotationAround(t,r).toRotationMatrix4()}static lookAt(t,r,s){const e=t.sub(r).normalize(),n=s.cross(e).normalize(),i=e.cross(n).normalize();return new d(n.x,i.x,e.x,0,n.y,i.y,e.y,0,n.z,i.z,e.z,0,-t.dot(n),-t.dot(i),-t.dot(e),1)}static orthographic(t){const r=t.top,s=t.bottom,e=t.left,n=t.right,i=t.near,u=t.far;return new d(2/(n-e),0,0,0,0,2/(r-s),0,0,0,0,-2/(u-i),0,-(n+e)/(n-e),-(r+s)/(r-s),-(u+i)/(u-i),1)}static frustum(t){const r=t.top,s=t.bottom,e=t.left,n=t.right,i=t.near,u=t.far;return new d(2*i/(n-e),0,0,0,0,2*i/(r-s),0,0,(n+e)/(n-e),(r+s)/(r-s),-(u+i)/(u-i),-1,0,0,-2*u*i/(u-i),0)}static perspective(t){const r=t.near*Math.tan(.5*t.fovYRadian),s=2*r,e=t.aspectRatio*s,n=-.5*e,i=n+e,u=r-s;return d.frustum({top:r,bottom:u,left:n,right:i,near:t.near,far:t.far})}mulByVector4(t){const[r,s,e,n,i,u,a,o,c,l,x,y,w,v,d,g]=this.values,[_,z,m,f]=t.values;return new h(r*_+i*z+c*m+w*f,s*_+u*z+l*m+v*f,e*_+a*z+x*m+d*f,n*_+o*z+y*m+g*f)}mulByMatrix4x4(t){const[r,s,e,n,i,u,a,o,h,c,l,x,y,w,v,g]=this.values,[_,z,m,f,M,p,B,S,A,b,F,V,j,$,O,R]=t.values;return new d(r*_+i*z+h*m+y*f,s*_+u*z+c*m+w*f,e*_+a*z+l*m+v*f,n*_+o*z+x*m+g*f,r*M+i*p+h*B+y*S,s*M+u*p+c*B+w*S,e*M+a*p+l*B+v*S,n*M+o*p+x*B+g*S,r*A+i*b+h*F+y*V,s*A+u*b+c*F+w*V,e*A+a*b+l*F+v*V,n*A+o*b+x*F+g*V,r*j+i*$+h*O+y*R,s*j+u*$+c*O+w*R,e*j+a*$+l*O+v*R,n*j+o*$+x*O+g*R)}mulByMatrix4(t){return this.mulByMatrix4x4(t)}translate(t,r,s){const e=d.translation(t,r,s);return this.mulByMatrix4x4(e)}scale(t,r,s){const e=d.scaling(t,r,s);return this.mulByMatrix4x4(e)}rotateX(t){const r=d.rotationX(t);return this.mulByMatrix4x4(r)}rotateY(t){const r=d.rotationY(t);return this.mulByMatrix4x4(r)}rotateZ(t){const r=d.rotationZ(t);return this.mulByMatrix4x4(r)}rotateAround(t,r){const s=d.rotationAround(t,r);return this.mulByMatrix4x4(s)}get values(){return this._values}toString(){return this._values.toString()}}const g=w,_=v,z=d;s.d(r,"Float32Vector2",function(){return a}),s.d(r,"Float32Vector3",function(){return o}),s.d(r,"Float32Vector4",function(){return h}),s.d(r,"Vector2",function(){return c}),s.d(r,"Vector3",function(){return l}),s.d(r,"Vector4",function(){return x}),s.d(r,"Matrix2x2",function(){return w}),s.d(r,"Matrix3x3",function(){return v}),s.d(r,"Matrix4x4",function(){return d}),s.d(r,"Matrix2",function(){return g}),s.d(r,"Matrix3",function(){return _}),s.d(r,"Matrix4",function(){return z}),s.d(r,"Quaternion",function(){return y})}}));