react-vr-player
Version:
A 360° HTML5 video player as a React Component
2 lines • 61 kB
JavaScript
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("react"));else if("function"==typeof define&&define.amd)define(["react"],e);else{var n=e("object"==typeof exports?require("react"):t.react);for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(24),a=r(o);e["default"]=a["default"],t.exports=e["default"]},function(t,e){var n={};n.EPSILON=1e-6,n.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,n.RANDOM=Math.random,n.setMatrixArrayType=function(t){GLMAT_ARRAY_TYPE=t};var r=Math.PI/180;n.toRadian=function(t){return t*r},t.exports=n},function(t,e,n){e.glMatrix=n(1),e.mat2=n(17),e.mat2d=n(18),e.mat3=n(4),e.mat4=n(19),e.quat=n(20),e.vec2=n(21),e.vec3=n(5),e.vec4=n(6)},function(e,n){e.exports=t},function(t,e,n){var r=n(1),o={};o.create=function(){var t=new r.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},o.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},o.clone=function(t){var e=new r.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},o.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},o.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},o.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],o=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=o}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},o.invert=function(t,e){var n=e[0],r=e[1],o=e[2],a=e[3],i=e[4],u=e[5],s=e[6],c=e[7],l=e[8],f=l*i-u*c,d=-l*a+u*s,p=c*a-i*s,h=n*f+r*d+o*p;return h?(h=1/h,t[0]=f*h,t[1]=(-l*r+o*c)*h,t[2]=(u*r-o*i)*h,t[3]=d*h,t[4]=(l*n-o*s)*h,t[5]=(-u*n+o*a)*h,t[6]=p*h,t[7]=(-c*n+r*s)*h,t[8]=(i*n-r*a)*h,t):null},o.adjoint=function(t,e){var n=e[0],r=e[1],o=e[2],a=e[3],i=e[4],u=e[5],s=e[6],c=e[7],l=e[8];return t[0]=i*l-u*c,t[1]=o*c-r*l,t[2]=r*u-o*i,t[3]=u*s-a*l,t[4]=n*l-o*s,t[5]=o*a-n*u,t[6]=a*c-i*s,t[7]=r*s-n*c,t[8]=n*i-r*a,t},o.determinant=function(t){var e=t[0],n=t[1],r=t[2],o=t[3],a=t[4],i=t[5],u=t[6],s=t[7],c=t[8];return e*(c*a-i*s)+n*(-c*o+i*u)+r*(s*o-a*u)},o.multiply=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=n[0],p=n[1],h=n[2],v=n[3],m=n[4],y=n[5],g=n[6],M=n[7],b=n[8];return t[0]=d*r+p*i+h*c,t[1]=d*o+p*u+h*l,t[2]=d*a+p*s+h*f,t[3]=v*r+m*i+y*c,t[4]=v*o+m*u+y*l,t[5]=v*a+m*s+y*f,t[6]=g*r+M*i+b*c,t[7]=g*o+M*u+b*l,t[8]=g*a+M*s+b*f,t},o.mul=o.multiply,o.translate=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=n[0],p=n[1];return t[0]=r,t[1]=o,t[2]=a,t[3]=i,t[4]=u,t[5]=s,t[6]=d*r+p*i+c,t[7]=d*o+p*u+l,t[8]=d*a+p*s+f,t},o.rotate=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=Math.sin(n),p=Math.cos(n);return t[0]=p*r+d*i,t[1]=p*o+d*u,t[2]=p*a+d*s,t[3]=p*i-d*r,t[4]=p*u-d*o,t[5]=p*s-d*a,t[6]=c,t[7]=l,t[8]=f,t},o.scale=function(t,e,n){var r=n[0],o=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=o*e[3],t[4]=o*e[4],t[5]=o*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},o.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},o.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},o.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},o.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},o.fromQuat=function(t,e){var n=e[0],r=e[1],o=e[2],a=e[3],i=n+n,u=r+r,s=o+o,c=n*i,l=r*i,f=r*u,d=o*i,p=o*u,h=o*s,v=a*i,m=a*u,y=a*s;return t[0]=1-f-h,t[3]=l-y,t[6]=d+m,t[1]=l+y,t[4]=1-c-h,t[7]=p-v,t[2]=d-m,t[5]=p+v,t[8]=1-c-f,t},o.normalFromMat4=function(t,e){var n=e[0],r=e[1],o=e[2],a=e[3],i=e[4],u=e[5],s=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],h=e[12],v=e[13],m=e[14],y=e[15],g=n*u-r*i,M=n*s-o*i,b=n*c-a*i,P=r*s-o*u,w=r*c-a*u,x=o*c-a*s,R=l*v-f*h,E=l*m-d*h,T=l*y-p*h,A=f*m-d*v,S=f*y-p*v,_=d*y-p*m,k=g*_-M*S+b*A+P*T-w*E+x*R;return k?(k=1/k,t[0]=(u*_-s*S+c*A)*k,t[1]=(s*T-i*_-c*E)*k,t[2]=(i*S-u*T+c*R)*k,t[3]=(o*S-r*_-a*A)*k,t[4]=(n*_-o*T+a*E)*k,t[5]=(r*T-n*S-a*R)*k,t[6]=(v*x-m*w+y*P)*k,t[7]=(m*b-h*x-y*M)*k,t[8]=(h*w-v*b+y*g)*k,t):null},o.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},o.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},t.exports=o},function(t,e,n){var r=n(1),o={};o.create=function(){var t=new r.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t},o.clone=function(t){var e=new r.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},o.fromValues=function(t,e,n){var o=new r.ARRAY_TYPE(3);return o[0]=t,o[1]=e,o[2]=n,o},o.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},o.set=function(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t},o.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t},o.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t},o.sub=o.subtract,o.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t},o.mul=o.multiply,o.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t},o.div=o.divide,o.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},o.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},o.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t},o.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t},o.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],o=e[2]-t[2];return Math.sqrt(n*n+r*r+o*o)},o.dist=o.distance,o.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],o=e[2]-t[2];return n*n+r*r+o*o},o.sqrDist=o.squaredDistance,o.length=function(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)},o.len=o.length,o.squaredLength=function(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r},o.sqrLen=o.squaredLength,o.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},o.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},o.normalize=function(t,e){var n=e[0],r=e[1],o=e[2],a=n*n+r*r+o*o;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},o.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},o.cross=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=n[0],u=n[1],s=n[2];return t[0]=o*s-a*u,t[1]=a*i-r*s,t[2]=r*u-o*i,t},o.lerp=function(t,e,n,r){var o=e[0],a=e[1],i=e[2];return t[0]=o+r*(n[0]-o),t[1]=a+r*(n[1]-a),t[2]=i+r*(n[2]-i),t},o.hermite=function(t,e,n,r,o,a){var i=a*a,u=i*(2*a-3)+1,s=i*(a-2)+a,c=i*(a-1),l=i*(3-2*a);return t[0]=e[0]*u+n[0]*s+r[0]*c+o[0]*l,t[1]=e[1]*u+n[1]*s+r[1]*c+o[1]*l,t[2]=e[2]*u+n[2]*s+r[2]*c+o[2]*l,t},o.bezier=function(t,e,n,r,o,a){var i=1-a,u=i*i,s=a*a,c=u*i,l=3*a*u,f=3*s*i,d=s*a;return t[0]=e[0]*c+n[0]*l+r[0]*f+o[0]*d,t[1]=e[1]*c+n[1]*l+r[1]*f+o[1]*d,t[2]=e[2]*c+n[2]*l+r[2]*f+o[2]*d,t},o.random=function(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI,o=2*r.RANDOM()-1,a=Math.sqrt(1-o*o)*e;return t[0]=Math.cos(n)*a,t[1]=Math.sin(n)*a,t[2]=o*e,t},o.transformMat4=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=n[3]*r+n[7]*o+n[11]*a+n[15];return i=i||1,t[0]=(n[0]*r+n[4]*o+n[8]*a+n[12])/i,t[1]=(n[1]*r+n[5]*o+n[9]*a+n[13])/i,t[2]=(n[2]*r+n[6]*o+n[10]*a+n[14])/i,t},o.transformMat3=function(t,e,n){var r=e[0],o=e[1],a=e[2];return t[0]=r*n[0]+o*n[3]+a*n[6],t[1]=r*n[1]+o*n[4]+a*n[7],t[2]=r*n[2]+o*n[5]+a*n[8],t},o.transformQuat=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=n[0],u=n[1],s=n[2],c=n[3],l=c*r+u*a-s*o,f=c*o+s*r-i*a,d=c*a+i*o-u*r,p=-i*r-u*o-s*a;return t[0]=l*c+p*-i+f*-s-d*-u,t[1]=f*c+p*-u+d*-i-l*-s,t[2]=d*c+p*-s+l*-u-f*-i,t},o.rotateX=function(t,e,n,r){var o=[],a=[];return o[0]=e[0]-n[0],o[1]=e[1]-n[1],o[2]=e[2]-n[2],a[0]=o[0],a[1]=o[1]*Math.cos(r)-o[2]*Math.sin(r),a[2]=o[1]*Math.sin(r)+o[2]*Math.cos(r),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t},o.rotateY=function(t,e,n,r){var o=[],a=[];return o[0]=e[0]-n[0],o[1]=e[1]-n[1],o[2]=e[2]-n[2],a[0]=o[2]*Math.sin(r)+o[0]*Math.cos(r),a[1]=o[1],a[2]=o[2]*Math.cos(r)-o[0]*Math.sin(r),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t},o.rotateZ=function(t,e,n,r){var o=[],a=[];return o[0]=e[0]-n[0],o[1]=e[1]-n[1],o[2]=e[2]-n[2],a[0]=o[0]*Math.cos(r)-o[1]*Math.sin(r),a[1]=o[0]*Math.sin(r)+o[1]*Math.cos(r),a[2]=o[2],t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t},o.forEach=function(){var t=o.create();return function(e,n,r,o,a,i){var u,s;for(n||(n=3),r||(r=0),s=o?Math.min(o*n+r,e.length):e.length,u=r;s>u;u+=n)t[0]=e[u],t[1]=e[u+1],t[2]=e[u+2],a(t,t,i),e[u]=t[0],e[u+1]=t[1],e[u+2]=t[2];return e}}(),o.angle=function(t,e){var n=o.fromValues(t[0],t[1],t[2]),r=o.fromValues(e[0],e[1],e[2]);o.normalize(n,n),o.normalize(r,r);var a=o.dot(n,r);return a>1?0:Math.acos(a)},o.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},t.exports=o},function(t,e,n){var r=n(1),o={};o.create=function(){var t=new r.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},o.clone=function(t){var e=new r.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},o.fromValues=function(t,e,n,o){var a=new r.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=n,a[3]=o,a},o.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},o.set=function(t,e,n,r,o){return t[0]=e,t[1]=n,t[2]=r,t[3]=o,t},o.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},o.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t},o.sub=o.subtract,o.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t},o.mul=o.multiply,o.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t},o.div=o.divide,o.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t},o.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t},o.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},o.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t},o.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],o=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(n*n+r*r+o*o+a*a)},o.dist=o.distance,o.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],o=e[2]-t[2],a=e[3]-t[3];return n*n+r*r+o*o+a*a},o.sqrDist=o.squaredDistance,o.length=function(t){var e=t[0],n=t[1],r=t[2],o=t[3];return Math.sqrt(e*e+n*n+r*r+o*o)},o.len=o.length,o.squaredLength=function(t){var e=t[0],n=t[1],r=t[2],o=t[3];return e*e+n*n+r*r+o*o},o.sqrLen=o.squaredLength,o.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},o.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},o.normalize=function(t,e){var n=e[0],r=e[1],o=e[2],a=e[3],i=n*n+r*r+o*o+a*a;return i>0&&(i=1/Math.sqrt(i),t[0]=n*i,t[1]=r*i,t[2]=o*i,t[3]=a*i),t},o.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},o.lerp=function(t,e,n,r){var o=e[0],a=e[1],i=e[2],u=e[3];return t[0]=o+r*(n[0]-o),t[1]=a+r*(n[1]-a),t[2]=i+r*(n[2]-i),t[3]=u+r*(n[3]-u),t},o.random=function(t,e){return e=e||1,t[0]=r.RANDOM(),t[1]=r.RANDOM(),t[2]=r.RANDOM(),t[3]=r.RANDOM(),o.normalize(t,t),o.scale(t,t,e),t},o.transformMat4=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=e[3];return t[0]=n[0]*r+n[4]*o+n[8]*a+n[12]*i,t[1]=n[1]*r+n[5]*o+n[9]*a+n[13]*i,t[2]=n[2]*r+n[6]*o+n[10]*a+n[14]*i,t[3]=n[3]*r+n[7]*o+n[11]*a+n[15]*i,t},o.transformQuat=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=n[0],u=n[1],s=n[2],c=n[3],l=c*r+u*a-s*o,f=c*o+s*r-i*a,d=c*a+i*o-u*r,p=-i*r-u*o-s*a;return t[0]=l*c+p*-i+f*-s-d*-u,t[1]=f*c+p*-u+d*-i-l*-s,t[2]=d*c+p*-s+l*-u-f*-i,t[3]=e[3],t},o.forEach=function(){var t=o.create();return function(e,n,r,o,a,i){var u,s;for(n||(n=4),r||(r=0),s=o?Math.min(o*n+r,e.length):e.length,u=r;s>u;u+=n)t[0]=e[u],t[1]=e[u+1],t[2]=e[u+2],t[3]=e[u+3],a(t,t,i),e[u]=t[0],e[u+1]=t[1],e[u+2]=t[2],e[u+3]=t[3];return e}}(),o.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},t.exports=o},function(t,e){"use strict";function n(){return navigator.getVRDevices?navigator.getVRDevices().then(r):Promise.resolve({hmd:null,sensor:null})}function r(t){for(var e=null,n=null,r=0;r<t.length;++r)if(t[r]instanceof HMDVRDevice){e=t[r];break}if(!e)return Promise.resolve({hmd:null,sensor:null});for(r=0;r<t.length;++r)if(t[r]instanceof PositionSensorVRDevice&&t[r].hardwareUnitId===e.hardwareUnitId){n=t[r];break}return n?{hmd:e,sensor:n}:Promise.reject("Found an HMD, but didn't find its orientation sensor?")}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n,t.exports=e["default"]},function(t,e){"use strict";function n(t,e,n){n&&(t.mozRequestFullScreen?t.mozRequestFullScreen({vrDisplay:e.hmd}):t.webkitRequestFullscreen?t.webkitRequestFullscreen({vrDisplay:e.hmd}):t.requestFullScreen&&t.requestFullscreen())}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n,t.exports=e["default"]},function(t,e){"use strict";function n(t,e){function n(){function t(t,n){var o=r[String.fromCharCode(t.keyCode).toLowerCase()];o&&(1===n&&o.active||-1===n&&!o.active||(o.active=1===n,e(o.index,n*o.sign)))}document.addEventListener("keydown",function(e){t(e,1)},!1),document.addEventListener("keyup",function(e){t(e,-1)},!1)}var r={};r[t.left.toLowerCase()]={index:1,sign:1,active:0},r[t.right.toLowerCase()]={index:1,sign:-1,active:0},r[t.up.toLowerCase()]={index:0,sign:1,active:0},r[t.down.toLowerCase()]={index:0,sign:-1,active:0},r[t.rotateLeft.toLowerCase()]={index:2,sign:1,active:0},r[t.rotateRight.toLowerCase()]={index:2,sign:-1,active:0},n()}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n,t.exports=e["default"]},function(t,e,n){"use strict";function r(){this.deviceAlpha=null,this.deviceGamma=null,this.deviceBeta=null,window&&window.addEventListener("deviceorientation",function(t){this.deviceAlpha=t.alpha,this.deviceGamma=t.gamma,this.deviceBeta=t.beta}.bind(this))}function o(){if(!window)return 0;switch(window.screen.orientation||window.screen.mozOrientation){case"landscape-primary":return 90;case"landscape-secondary":return-90;case"portrait-secondary":return 180;case"portrait-primary":return 0}return void 0!==window.orientation?window.orientation:void 0}var a=n(2);t.exports=r,r.prototype.orientationIsAvailable=function(){return null!==this.deviceAlpha},r.prototype.rotationQuat=function(){if(!this.orientationIsAvailable())return a.quat.create(1,0,0,0);var t=Math.PI/180,e=this.deviceAlpha*t/2,n=this.deviceBeta*t/2,r=this.deviceGamma*t/2,i=Math.cos(n),u=Math.cos(r),s=Math.cos(e),c=Math.sin(n),l=Math.sin(r),f=Math.sin(e),d=i*u*s-c*l*f;n=c*u*s-i*l*f,r=i*l*s+c*u*f,e=i*u*f+c*l*s;var p=a.quat.fromValues(n,r,e,d),h=o()*t/2,v=[0,0,-Math.sin(h),Math.cos(h)],m=a.quat.create();a.quat.multiply(m,p,v);var y=Math.sqrt(.5);return a.quat.multiply(m,a.quat.fromValues(-y,0,0,y),m),m}},function(t,e){"use strict";function n(){return new Promise(function(t,e){if(!document)return e("This is not a web browser");var n=document.createElement("input");n.type="file",n.accept="video/*",n.addEventListener("change",function(){var r=n.files;if(!r.length)return console.log("no selection"),e("File selection canceled");var o=r[0].name.split(".").pop(),a=URL.createObjectURL(r[0]);console.log("Loading local file ",r[0].name," at URL ",a," with extension ",o),t({url:a,type:"video/"+o})}),n.click()})}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n,t.exports=e["default"]},function(t,e,n){"use strict";var r,o=n(2),a=n(13),i=n(14);t.exports=function(t,e,n,u,s){function c(){r&&(E=new r,E.setMode(0),E.domElement.style.position="absolute",E.domElement.style.right="50px",E.domElement.style.bottom="50px",u.ownerDocument.body.appendChild(E.domElement))}function l(){var t=null;try{t=u.getContext("webgl")||u.getContext("experimental-webgl")}catch(e){}return t?(x=new i({fragmentShaderName:"shader-fs",vertexShaderName:"shader-vs",attributes:["aVertexPosition"],uniforms:["uSampler","eye","projection","proj_inv"]},t),t):null}function f(){b=R.createBuffer(),R.bindBuffer(R.ARRAY_BUFFER,b);var t=[-1,-1,1,-1,1,1,-1,1];R.bufferData(R.ARRAY_BUFFER,new Float32Array(t),R.STATIC_DRAW),P=R.createBuffer(),R.bindBuffer(R.ELEMENT_ARRAY_BUFFER,P);var e=[0,1,2,0,2,3];R.bufferData(R.ELEMENT_ARRAY_BUFFER,new Uint16Array(e),R.STATIC_DRAW)}function d(){w=R.createTexture(),R.bindTexture(R.TEXTURE_2D,w),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_MAG_FILTER,R.LINEAR),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_MIN_FILTER,R.LINEAR),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),R.bindTexture(R.TEXTURE_2D,null)}function p(){R.bindTexture(R.TEXTURE_2D,w),R.pixelStorei(R.UNPACK_FLIP_Y_WEBGL,!0),R.texImage2D(R.TEXTURE_2D,0,R.RGB,R.RGB,R.UNSIGNED_BYTE,n),R.bindTexture(R.TEXTURE_2D,null)}function h(n,r){R.useProgram(x.program),R.bindBuffer(R.ARRAY_BUFFER,b),R.vertexAttribPointer(x.attributes.aVertexPosition,2,R.FLOAT,!1,0,0),R.activeTexture(R.TEXTURE0),R.bindTexture(R.TEXTURE_2D,w),R.uniform1i(x.uniforms.uSampler,0),R.uniform1f(x.uniforms.eye,n),R.uniform1f(x.uniforms.projection,a.projection);var i=o.mat4.create(),s=o.quat.create();if(null!==t.sensor){var c=t.sensor.getState();if(null!==c&&null!==c.orientation&&"undefined"!=typeof c.orientation&&0!==c.orientation.x&&0!==c.orientation.y&&0!==c.orientation.z&&0!==c.orientation.w){var l=new Float32Array([c.orientation.x,c.orientation.y,c.orientation.z,c.orientation.w]);o.quat.multiply(s,a.manualRotation,l)}else s=a.manualRotation;o.mat4.fromQuat(i,s)}else o.quat.multiply(s,a.manualRotation,e.rotationQuat()),o.mat4.fromQuat(i,s);var f=o.mat4.create();o.mat4.invert(f,r);var d=o.mat4.create();o.mat4.multiply(d,i,f),R.uniformMatrix4fv(x.uniforms.proj_inv,!1,d),0===n?R.viewport(0,0,u.width/2,u.height):R.viewport(u.width/2,0,u.width/2,u.height),R.bindBuffer(R.ELEMENT_ARRAY_BUFFER,P),R.drawElements(R.TRIANGLES,6,R.UNSIGNED_SHORT,0)}function v(){return function e(r){if(E&&E.begin(),A=r,m(R,t,u,s),p(R,n),S){var i=.001*(A-S),c=o.quat.fromValues(_[0]*i,_[1]*i,_[2]*i,1);o.quat.normalize(c,c),o.quat.multiply(a.manualRotation,a.manualRotation,c)}var l=o.mat4.create();if(t.hmd){var f=t.hmd.getEyeParameters("left"),d=t.hmd.getEyeParameters("right");l=g(f.recommendedFieldOfView,.1,10),h(0,l),l=g(d.recommendedFieldOfView,.1,10),h(1,l)}else{var v=u.width/2/u.height;o.mat4.perspective(l,Math.PI/2,v,.1,10),h(0,l),h(1,l)}E&&E.end(),T=requestAnimationFrame(e),S=A}}function m(){if(window){var t=window.innerWidth,e=window.innerHeight;s&&(t=s,e=s/(1980/1024)),y(t,e)}}function y(e,n){if("undefined"!=typeof t.hmd&&null!==t.hmd&&"undefined"!=typeof M()&&M()){var r=t.hmd.getEyeParameters("right").renderRect;u.width=2*r.width,u.height=r.height,u.style.width=e+"px",u.style.height=n+"px"}else{var o=window.devicePixelRatio||1,a=R.webkitBackingStorePixelRatio||R.mozBackingStorePixelRatio||R.msBackingStorePixelRatio||R.oBackingStorePixelRatio||R.backingStorePixelRatio||1,i=o/a;(u.width!==e*i||u.height!==n*i)&&(u.width=e*i,u.height=n*i,u.style.width=e+"px",u.style.height=n+"px")}}function g(t,e,n){var r=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),i=Math.tan(t.rightDegrees*Math.PI/180),u=2/(a+i),s=2/(r+o),c=new Float32Array(16);return c[0]=u,c[4]=0,c[8]=-((a-i)*u*.5),c[12]=0,c[1]=0,c[5]=s,c[9]=(r-o)*s*.5,c[13]=0,c[2]=0,c[6]=0,c[10]=n/(e-n),c[14]=n*e/(e-n),c[3]=0,c[7]=0,c[11]=-1,c[15]=0,c}function M(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.webkitCurrentFullScreenElement}var b,P,w,x,R,E,T,A,S,_=new Float32Array([0,0,0]);return new Promise(function(t,e){R=l(u),R?(R.clearColor(0,0,0,0),R.clearDepth(1),R.disable(R.DEPTH_TEST),c(),f(R),d(R),t({draw:function(){return T&&cancelAnimationFrame(T),T=requestAnimationFrame(v(n,u,R,s))},stop:function(){T&&(cancelAnimationFrame(T),T=null)},rotate:function(t,e){_[t]+=e}})):e("Unable to initialize WebGL. Your browser may not support it.")})}},function(t,e,n){"use strict";var r=n(2);t.exports={projection:0,manualRotation:r.quat.create(),videoObjectURL:null}},function(t,e,n){"use strict";function r(t,e,n){var r;if("fragment"===e)r=n.createShader(n.FRAGMENT_SHADER);else{if("vertex"!==e)return null;r=n.createShader(n.VERTEX_SHADER)}return n.shaderSource(r,t),n.compileShader(r),n.getShaderParameter(r,n.COMPILE_STATUS)?r:(alert("An error occurred compiling the shaders: "+n.getShaderInfoLog(r)),null)}var o=n(27),a=n(28);t.exports=function(t,e){this.params=t,this.fragmentShader=r(o,"fragment",e),this.vertexShader=r(a,"vertex",e),this.program=e.createProgram(),e.attachShader(this.program,this.vertexShader),e.attachShader(this.program,this.fragmentShader),e.linkProgram(this.program),e.getProgramParameter(this.program,e.LINK_STATUS)||alert("Unable to initialize the shader program: "+e.getProgramInfoLog(this.program)),e.useProgram(this.program),this.attributes={};for(var n=0;n<this.params.attributes.length;n++){var i=this.params.attributes[n];this.attributes[i]=e.getAttribLocation(this.program,i),e.enableVertexAttribArray(this.attributes[i])}for(this.uniforms={},n=0;n<this.params.uniforms.length;n++){var u=this.params.uniforms[n];this.uniforms[u]=e.getUniformLocation(this.program,u),e.enableVertexAttribArray(this.attributes[u])}}},function(t,e,n){e=t.exports=n(16)(),e.push([t.id,"div.VrPlayer{background-color:#000;font-family:HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-weight:300;color:#fff;margin:0;padding:0;overflow:hidden;height:100%;width:100%;position:fixed;top:0;left:0}div.VrPlayer select{border:none;background:rgba(0,0,0,.6);color:hsla(0,0%,100%,.8);padding:2px;border-radius:3px}div.VrPlayer video{display:none}div.VrPlayer a{cursor:pointer;color:hsla(0,0%,100%,.8)}div.VrPlayer a:hover{color:hsla(0,0%,100%,.65);text-decoration:none}div.VrPlayer a:active{color:hsla(0,0%,100%,.8);text-shadow:2px 2px 3px hsla(0,0%,78%,.9)}div.VrPlayer{background-color:#000}div.VrPlayer .left{float:left;left:2%}div.VrPlayer .left,div.VrPlayer .right{width:50%;position:relative;top:43%;z-index:1}div.VrPlayer .right{float:right;right:2%}div.VrPlayer .glcanvas{position:absolute;top:0;bottom:0;right:0;left:0}div.VrPlayer .video-controls{color:#fff;position:fixed;bottom:0;left:0;right:0;padding:0 10px;opacity:.8;height:25px;background:#499bea;background:-webkit-gradient(left top,left bottom,color-stop(0,#499bea),color-stop(100%,#207ce5));background:-webkit-linear-gradient(top,#499bea 0,#207ce5 100%);background:linear-gradient(to bottom,#499bea 0,#207ce5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#499bea',endColorstr='#207ce5',GradientType=0)}div.VrPlayer input.seek-bar{width:35%;float:left;height:25px;margin-top:0;border:none}div.VrPlayer input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;border:1px solid #000;height:16px;width:16px;border-radius:8px;background:#fff;cursor:pointer;margin-top:-7px;box-shadow:1px 1px 1px #000,0 0 1px #0d0d0d}div.VrPlayer input[type=range]::-moz-range-thumb{box-shadow:1px 1px 1px #000,0 0 1px #0d0d0d;border:1px solid #000;height:16px;width:16px;border-radius:8px;background:#fff;cursor:pointer}div.VrPlayer input[type=range]::-ms-thumb{box-shadow:1px 1px 1px #000,0 0 1px #0d0d0d;border:1px solid #000;height:16px;width:16px;border-radius:8px;background:#fff;cursor:pointer}div.VrPlayer select{width:12%;max-width:300px;margin-right:5px}div.VrPlayer .icon{margin:5px 5px 0;width:20px;float:left}div.VrPlayer .rfloat{float:right;margin-top:5px}.large-play,.message,div.VrPlayer .title{text-align:center;margin:0 auto;display:block;color:hsla(0,0%,100%,.5)}div.VrPlayer span.brand{float:left;margin-left:20px;color:#000;font-variant:small-caps;font-size:16px;font-weight:700;margin-top:0}div.VrPlayer span.info{float:left;margin-left:20px;color:#000;font-size:13px;margin-top:3px}",""])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e];n[2]?t.push("@media "+n[2]+"{"+n[1]+"}"):t.push(n[1])}return t.join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var a=this[o][0];"number"==typeof a&&(r[a]=!0)}for(o=0;o<e.length;o++){var i=e[o];"number"==typeof i[0]&&r[i[0]]||(n&&!i[2]?i[2]=n:n&&(i[2]="("+i[2]+") and ("+n+")"),t.push(i))}},t}},function(t,e,n){var r=n(1),o={};o.create=function(){var t=new r.ARRAY_TYPE(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},o.clone=function(t){var e=new r.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},o.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},o.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},o.transpose=function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},o.invert=function(t,e){var n=e[0],r=e[1],o=e[2],a=e[3],i=n*a-o*r;return i?(i=1/i,t[0]=a*i,t[1]=-r*i,t[2]=-o*i,t[3]=n*i,t):null},o.adjoint=function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},o.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},o.multiply=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=e[3],u=n[0],s=n[1],c=n[2],l=n[3];return t[0]=r*u+a*s,t[1]=o*u+i*s,t[2]=r*c+a*l,t[3]=o*c+i*l,t},o.mul=o.multiply,o.rotate=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=e[3],u=Math.sin(n),s=Math.cos(n);return t[0]=r*s+a*u,t[1]=o*s+i*u,t[2]=r*-u+a*s,t[3]=o*-u+i*s,t},o.scale=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=e[3],u=n[0],s=n[1];return t[0]=r*u,t[1]=o*u,t[2]=a*s,t[3]=i*s,t},o.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t},o.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},o.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},o.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},o.LDU=function(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]},t.exports=o},function(t,e,n){var r=n(1),o={};o.create=function(){var t=new r.ARRAY_TYPE(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},o.clone=function(t){var e=new r.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},o.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},o.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},o.invert=function(t,e){var n=e[0],r=e[1],o=e[2],a=e[3],i=e[4],u=e[5],s=n*a-r*o;return s?(s=1/s,t[0]=a*s,t[1]=-r*s,t[2]=-o*s,t[3]=n*s,t[4]=(o*u-a*i)*s,t[5]=(r*i-n*u)*s,t):null},o.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},o.multiply=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=e[3],u=e[4],s=e[5],c=n[0],l=n[1],f=n[2],d=n[3],p=n[4],h=n[5];return t[0]=r*c+a*l,t[1]=o*c+i*l,t[2]=r*f+a*d,t[3]=o*f+i*d,t[4]=r*p+a*h+u,t[5]=o*p+i*h+s,t},o.mul=o.multiply,o.rotate=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=e[3],u=e[4],s=e[5],c=Math.sin(n),l=Math.cos(n);return t[0]=r*l+a*c,t[1]=o*l+i*c,t[2]=r*-c+a*l,t[3]=o*-c+i*l,t[4]=u,t[5]=s,t},o.scale=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=e[3],u=e[4],s=e[5],c=n[0],l=n[1];return t[0]=r*c,t[1]=o*c,t[2]=a*l,t[3]=i*l,t[4]=u,t[5]=s,t},o.translate=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=e[3],u=e[4],s=e[5],c=n[0],l=n[1];return t[0]=r,t[1]=o,t[2]=a,t[3]=i,t[4]=r*c+a*l+u,t[5]=o*c+i*l+s,t},o.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t[4]=0,t[5]=0,t},o.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},o.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},o.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},o.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},t.exports=o},function(t,e,n){var r=n(1),o={};o.create=function(){var t=new r.ARRAY_TYPE(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.clone=function(t){var e=new r.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},o.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},o.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],o=e[3],a=e[6],i=e[7],u=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=o,t[13]=i,t[14]=u}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},o.invert=function(t,e){var n=e[0],r=e[1],o=e[2],a=e[3],i=e[4],u=e[5],s=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],h=e[12],v=e[13],m=e[14],y=e[15],g=n*u-r*i,M=n*s-o*i,b=n*c-a*i,P=r*s-o*u,w=r*c-a*u,x=o*c-a*s,R=l*v-f*h,E=l*m-d*h,T=l*y-p*h,A=f*m-d*v,S=f*y-p*v,_=d*y-p*m,k=g*_-M*S+b*A+P*T-w*E+x*R;return k?(k=1/k,t[0]=(u*_-s*S+c*A)*k,t[1]=(o*S-r*_-a*A)*k,t[2]=(v*x-m*w+y*P)*k,t[3]=(d*w-f*x-p*P)*k,t[4]=(s*T-i*_-c*E)*k,t[5]=(n*_-o*T+a*E)*k,t[6]=(m*b-h*x-y*M)*k,t[7]=(l*x-d*b+p*M)*k,t[8]=(i*S-u*T+c*R)*k,t[9]=(r*T-n*S-a*R)*k,t[10]=(h*w-v*b+y*g)*k,t[11]=(f*b-l*w-p*g)*k,t[12]=(u*E-i*A-s*R)*k,t[13]=(n*A-r*E+o*R)*k,t[14]=(v*M-h*P-m*g)*k,t[15]=(l*P-f*M+d*g)*k,t):null},o.adjoint=function(t,e){var n=e[0],r=e[1],o=e[2],a=e[3],i=e[4],u=e[5],s=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],h=e[12],v=e[13],m=e[14],y=e[15];return t[0]=u*(d*y-p*m)-f*(s*y-c*m)+v*(s*p-c*d),t[1]=-(r*(d*y-p*m)-f*(o*y-a*m)+v*(o*p-a*d)),t[2]=r*(s*y-c*m)-u*(o*y-a*m)+v*(o*c-a*s),t[3]=-(r*(s*p-c*d)-u*(o*p-a*d)+f*(o*c-a*s)),t[4]=-(i*(d*y-p*m)-l*(s*y-c*m)+h*(s*p-c*d)),t[5]=n*(d*y-p*m)-l*(o*y-a*m)+h*(o*p-a*d),t[6]=-(n*(s*y-c*m)-i*(o*y-a*m)+h*(o*c-a*s)),t[7]=n*(s*p-c*d)-i*(o*p-a*d)+l*(o*c-a*s),t[8]=i*(f*y-p*v)-l*(u*y-c*v)+h*(u*p-c*f),t[9]=-(n*(f*y-p*v)-l*(r*y-a*v)+h*(r*p-a*f)),t[10]=n*(u*y-c*v)-i*(r*y-a*v)+h*(r*c-a*u),t[11]=-(n*(u*p-c*f)-i*(r*p-a*f)+l*(r*c-a*u)),t[12]=-(i*(f*m-d*v)-l*(u*m-s*v)+h*(u*d-s*f)),t[13]=n*(f*m-d*v)-l*(r*m-o*v)+h*(r*d-o*f),t[14]=-(n*(u*m-s*v)-i*(r*m-o*v)+h*(r*s-o*u)),t[15]=n*(u*d-s*f)-i*(r*d-o*f)+l*(r*s-o*u),t},o.determinant=function(t){var e=t[0],n=t[1],r=t[2],o=t[3],a=t[4],i=t[5],u=t[6],s=t[7],c=t[8],l=t[9],f=t[10],d=t[11],p=t[12],h=t[13],v=t[14],m=t[15],y=e*i-n*a,g=e*u-r*a,M=e*s-o*a,b=n*u-r*i,P=n*s-o*i,w=r*s-o*u,x=c*h-l*p,R=c*v-f*p,E=c*m-d*p,T=l*v-f*h,A=l*m-d*h,S=f*m-d*v;return y*S-g*A+M*T+b*E-P*R+w*x},o.multiply=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],p=e[10],h=e[11],v=e[12],m=e[13],y=e[14],g=e[15],M=n[0],b=n[1],P=n[2],w=n[3];return t[0]=M*r+b*u+P*f+w*v,t[1]=M*o+b*s+P*d+w*m,t[2]=M*a+b*c+P*p+w*y,t[3]=M*i+b*l+P*h+w*g,M=n[4],b=n[5],P=n[6],w=n[7],t[4]=M*r+b*u+P*f+w*v,t[5]=M*o+b*s+P*d+w*m,t[6]=M*a+b*c+P*p+w*y,t[7]=M*i+b*l+P*h+w*g,M=n[8],b=n[9],P=n[10],w=n[11],t[8]=M*r+b*u+P*f+w*v,
t[9]=M*o+b*s+P*d+w*m,t[10]=M*a+b*c+P*p+w*y,t[11]=M*i+b*l+P*h+w*g,M=n[12],b=n[13],P=n[14],w=n[15],t[12]=M*r+b*u+P*f+w*v,t[13]=M*o+b*s+P*d+w*m,t[14]=M*a+b*c+P*p+w*y,t[15]=M*i+b*l+P*h+w*g,t},o.mul=o.multiply,o.translate=function(t,e,n){var r,o,a,i,u,s,c,l,f,d,p,h,v=n[0],m=n[1],y=n[2];return e===t?(t[12]=e[0]*v+e[4]*m+e[8]*y+e[12],t[13]=e[1]*v+e[5]*m+e[9]*y+e[13],t[14]=e[2]*v+e[6]*m+e[10]*y+e[14],t[15]=e[3]*v+e[7]*m+e[11]*y+e[15]):(r=e[0],o=e[1],a=e[2],i=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],p=e[10],h=e[11],t[0]=r,t[1]=o,t[2]=a,t[3]=i,t[4]=u,t[5]=s,t[6]=c,t[7]=l,t[8]=f,t[9]=d,t[10]=p,t[11]=h,t[12]=r*v+u*m+f*y+e[12],t[13]=o*v+s*m+d*y+e[13],t[14]=a*v+c*m+p*y+e[14],t[15]=i*v+l*m+h*y+e[15]),t},o.scale=function(t,e,n){var r=n[0],o=n[1],a=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*o,t[5]=e[5]*o,t[6]=e[6]*o,t[7]=e[7]*o,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},o.rotate=function(t,e,n,o){var a,i,u,s,c,l,f,d,p,h,v,m,y,g,M,b,P,w,x,R,E,T,A,S,_=o[0],k=o[1],L=o[2],O=Math.sqrt(_*_+k*k+L*L);return Math.abs(O)<r.EPSILON?null:(O=1/O,_*=O,k*=O,L*=O,a=Math.sin(n),i=Math.cos(n),u=1-i,s=e[0],c=e[1],l=e[2],f=e[3],d=e[4],p=e[5],h=e[6],v=e[7],m=e[8],y=e[9],g=e[10],M=e[11],b=_*_*u+i,P=k*_*u+L*a,w=L*_*u-k*a,x=_*k*u-L*a,R=k*k*u+i,E=L*k*u+_*a,T=_*L*u+k*a,A=k*L*u-_*a,S=L*L*u+i,t[0]=s*b+d*P+m*w,t[1]=c*b+p*P+y*w,t[2]=l*b+h*P+g*w,t[3]=f*b+v*P+M*w,t[4]=s*x+d*R+m*E,t[5]=c*x+p*R+y*E,t[6]=l*x+h*R+g*E,t[7]=f*x+v*R+M*E,t[8]=s*T+d*A+m*S,t[9]=c*T+p*A+y*S,t[10]=l*T+h*A+g*S,t[11]=f*T+v*A+M*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},o.rotateX=function(t,e,n){var r=Math.sin(n),o=Math.cos(n),a=e[4],i=e[5],u=e[6],s=e[7],c=e[8],l=e[9],f=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*o+c*r,t[5]=i*o+l*r,t[6]=u*o+f*r,t[7]=s*o+d*r,t[8]=c*o-a*r,t[9]=l*o-i*r,t[10]=f*o-u*r,t[11]=d*o-s*r,t},o.rotateY=function(t,e,n){var r=Math.sin(n),o=Math.cos(n),a=e[0],i=e[1],u=e[2],s=e[3],c=e[8],l=e[9],f=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*o-c*r,t[1]=i*o-l*r,t[2]=u*o-f*r,t[3]=s*o-d*r,t[8]=a*r+c*o,t[9]=i*r+l*o,t[10]=u*r+f*o,t[11]=s*r+d*o,t},o.rotateZ=function(t,e,n){var r=Math.sin(n),o=Math.cos(n),a=e[0],i=e[1],u=e[2],s=e[3],c=e[4],l=e[5],f=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*o+c*r,t[1]=i*o+l*r,t[2]=u*o+f*r,t[3]=s*o+d*r,t[4]=c*o-a*r,t[5]=l*o-i*r,t[6]=f*o-u*r,t[7]=d*o-s*r,t},o.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},o.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.fromRotation=function(t,e,n){var o,a,i,u=n[0],s=n[1],c=n[2],l=Math.sqrt(u*u+s*s+c*c);return Math.abs(l)<r.EPSILON?null:(l=1/l,u*=l,s*=l,c*=l,o=Math.sin(e),a=Math.cos(e),i=1-a,t[0]=u*u*i+a,t[1]=s*u*i+c*o,t[2]=c*u*i-s*o,t[3]=0,t[4]=u*s*i-c*o,t[5]=s*s*i+a,t[6]=c*s*i+u*o,t[7]=0,t[8]=u*c*i+s*o,t[9]=s*c*i-u*o,t[10]=c*c*i+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},o.fromXRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.fromYRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.fromZRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.fromRotationTranslation=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=e[3],u=r+r,s=o+o,c=a+a,l=r*u,f=r*s,d=r*c,p=o*s,h=o*c,v=a*c,m=i*u,y=i*s,g=i*c;return t[0]=1-(p+v),t[1]=f+g,t[2]=d-y,t[3]=0,t[4]=f-g,t[5]=1-(l+v),t[6]=h+m,t[7]=0,t[8]=d+y,t[9]=h-m,t[10]=1-(l+p),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},o.fromRotationTranslationScale=function(t,e,n,r){var o=e[0],a=e[1],i=e[2],u=e[3],s=o+o,c=a+a,l=i+i,f=o*s,d=o*c,p=o*l,h=a*c,v=a*l,m=i*l,y=u*s,g=u*c,M=u*l,b=r[0],P=r[1],w=r[2];return t[0]=(1-(h+m))*b,t[1]=(d+M)*b,t[2]=(p-g)*b,t[3]=0,t[4]=(d-M)*P,t[5]=(1-(f+m))*P,t[6]=(v+y)*P,t[7]=0,t[8]=(p+g)*w,t[9]=(v-y)*w,t[10]=(1-(f+h))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},o.fromRotationTranslationScaleOrigin=function(t,e,n,r,o){var a=e[0],i=e[1],u=e[2],s=e[3],c=a+a,l=i+i,f=u+u,d=a*c,p=a*l,h=a*f,v=i*l,m=i*f,y=u*f,g=s*c,M=s*l,b=s*f,P=r[0],w=r[1],x=r[2],R=o[0],E=o[1],T=o[2];return t[0]=(1-(v+y))*P,t[1]=(p+b)*P,t[2]=(h-M)*P,t[3]=0,t[4]=(p-b)*w,t[5]=(1-(d+y))*w,t[6]=(m+g)*w,t[7]=0,t[8]=(h+M)*x,t[9]=(m-g)*x,t[10]=(1-(d+v))*x,t[11]=0,t[12]=n[0]+R-(t[0]*R+t[4]*E+t[8]*T),t[13]=n[1]+E-(t[1]*R+t[5]*E+t[9]*T),t[14]=n[2]+T-(t[2]*R+t[6]*E+t[10]*T),t[15]=1,t},o.fromQuat=function(t,e){var n=e[0],r=e[1],o=e[2],a=e[3],i=n+n,u=r+r,s=o+o,c=n*i,l=r*i,f=r*u,d=o*i,p=o*u,h=o*s,v=a*i,m=a*u,y=a*s;return t[0]=1-f-h,t[1]=l+y,t[2]=d-m,t[3]=0,t[4]=l-y,t[5]=1-c-h,t[6]=p+v,t[7]=0,t[8]=d+m,t[9]=p-v,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.frustum=function(t,e,n,r,o,a,i){var u=1/(n-e),s=1/(o-r),c=1/(a-i);return t[0]=2*a*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*s,t[6]=0,t[7]=0,t[8]=(n+e)*u,t[9]=(o+r)*s,t[10]=(i+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=i*a*2*c,t[15]=0,t},o.perspective=function(t,e,n,r,o){var a=1/Math.tan(e/2),i=1/(r-o);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(o+r)*i,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*o*r*i,t[15]=0,t},o.perspectiveFromFieldOfView=function(t,e,n,r){var o=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),i=Math.tan(e.leftDegrees*Math.PI/180),u=Math.tan(e.rightDegrees*Math.PI/180),s=2/(i+u),c=2/(o+a);return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-((i-u)*s*.5),t[9]=(o-a)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},o.ortho=function(t,e,n,r,o,a,i){var u=1/(e-n),s=1/(r-o),c=1/(a-i);return t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*u,t[13]=(o+r)*s,t[14]=(i+a)*c,t[15]=1,t},o.lookAt=function(t,e,n,a){var i,u,s,c,l,f,d,p,h,v,m=e[0],y=e[1],g=e[2],M=a[0],b=a[1],P=a[2],w=n[0],x=n[1],R=n[2];return Math.abs(m-w)<r.EPSILON&&Math.abs(y-x)<r.EPSILON&&Math.abs(g-R)<r.EPSILON?o.identity(t):(d=m-w,p=y-x,h=g-R,v=1/Math.sqrt(d*d+p*p+h*h),d*=v,p*=v,h*=v,i=b*h-P*p,u=P*d-M*h,s=M*p-b*d,v=Math.sqrt(i*i+u*u+s*s),v?(v=1/v,i*=v,u*=v,s*=v):(i=0,u=0,s=0),c=p*s-h*u,l=h*i-d*s,f=d*u-p*i,v=Math.sqrt(c*c+l*l+f*f),v?(v=1/v,c*=v,l*=v,f*=v):(c=0,l=0,f=0),t[0]=i,t[1]=c,t[2]=d,t[3]=0,t[4]=u,t[5]=l,t[6]=p,t[7]=0,t[8]=s,t[9]=f,t[10]=h,t[11]=0,t[12]=-(i*m+u*y+s*g),t[13]=-(c*m+l*y+f*g),t[14]=-(d*m+p*y+h*g),t[15]=1,t)},o.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},o.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},t.exports=o},function(t,e,n){var r=n(1),o=n(4),a=n(5),i=n(6),u={};u.create=function(){var t=new r.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},u.rotationTo=function(){var t=a.create(),e=a.fromValues(1,0,0),n=a.fromValues(0,1,0);return function(r,o,i){var s=a.dot(o,i);return-.999999>s?(a.cross(t,e,o),a.length(t)<1e-6&&a.cross(t,n,o),a.normalize(t,t),u.setAxisAngle(r,t,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(a.cross(t,o,i),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+s,u.normalize(r,r))}}(),u.setAxes=function(){var t=o.create();return function(e,n,r,o){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=o[0],t[4]=o[1],t[7]=o[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],u.normalize(e,u.fromMat3(e,t))}}(),u.clone=i.clone,u.fromValues=i.fromValues,u.copy=i.copy,u.set=i.set,u.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},u.setAxisAngle=function(t,e,n){n=.5*n;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t},u.add=i.add,u.multiply=function(t,e,n){var r=e[0],o=e[1],a=e[2],i=e[3],u=n[0],s=n[1],c=n[2],l=n[3];return t[0]=r*l+i*u+o*c-a*s,t[1]=o*l+i*s+a*u-r*c,t[2]=a*l+i*c+r*s-o*u,t[3]=i*l-r*u-o*s-a*c,t},u.mul=u.multiply,u.scale=i.scale,u.rotateX=function(t,e,n){n*=.5;var r=e[0],o=e[1],a=e[2],i=e[3],u=Math.sin(n),s=Math.cos(n);return t[0]=r*s+i*u,t[1]=o*s+a*u,t[2]=a*s-o*u,t[3]=i*s-r*u,t},u.rotateY=function(t,e,n){n*=.5;var r=e[0],o=e[1],a=e[2],i=e[3],u=Math.sin(n),s=Math.cos(n);return t[0]=r*s-a*u,t[1]=o*s+i*u,t[2]=a*s+r*u,t[3]=i*s-o*u,t},u.rotateZ=function(t,e,n){n*=.5;var r=e[0],o=e[1],a=e[2],i=e[3],u=Math.sin(n),s=Math.cos(n);return t[0]=r*s+o*u,t[1]=o*s-r*u,t[2]=a*s+i*u,t[3]=i*s-a*u,t},u.calculateW=function(t,e){var n=e[0],r=e[1],o=e[2];return t[0]=n,t[1]=r,t[2]=o,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-o*o)),t},u.dot=i.dot,u.lerp=i.lerp,u.slerp=function(t,e,n,r){var o,a,i,u,s,c=e[0],l=e[1],f=e[2],d=e[3],p=n[0],h=n[1],v=n[2],m=n[3];return a=c*p+l*h+f*v+d*m,0>a&&(a=-a,p=-p,h=-h,v=-v,m=-m),1-a>1e-6?(o=Math.acos(a),i=Math.sin(o),u=Math.sin((1-r)*o)/i,s=Math.sin(r*o)/i):(u=1-r,s=r),t[0]=u*c+s*p,t[1]=u*l+s*h,t[2]=u*f+s*v,t[3]=u*d+s*m,t},u.sqlerp=function(){var t=u.create(),e=u.create();return function(n,r,o,a,i,s){return u.slerp(t,r,i,s),u.slerp(e,o,a,s),u.slerp(n,t,e,2*s*(1-s)),n}}(),u.invert=function(t,e){var n=e[0],r=e[1],o=e[2],a=e[3],i=n*n+r*r+o*o+a*a,u=i?1/i:0;return t[0]=-n*u,t[1]=-r*u,t[2]=-o*u,t[3]=a*u,t},u.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},u.length=i.length,u.len=u.length,u.squaredLength=i.squaredLength,u.sqrLen=u.squaredLength,u.normalize=i.normalize,u.fromMat3=function(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var o=0;e[4]>e[0]&&(o=1),e[8]>e[3*o+o]&&(o=2);var a=(o+1)%3,i=(o+2)%3;n=Math.sqrt(e[3*o+o]-e[3*a+a]-e[3*i+i]+1),t[o]=.5*n,n=.5/n,t[3]=(e[3*a+i]-e[3*i+a])*n,t[a]=(e[3*a+o]+e[3*o+a])*n,t[i]=(e[3*i+o]+e[3*o+i])*n}return t},u.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},t.exports=u},function(t,e,n){var r=n(1),o={};o.create=function(){var t=new r.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},o.clone=function(t){var e=new r.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},o.fromValues=function(t,e){var n=new r.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},o.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},o.set=function(t,e,n){return t[0]=e,t[1]=n,t},o.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},o.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t},o.sub=o.subtract,o.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t},o.mul=o.multiply,o.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t},o.div=o.divide,o.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},o.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},o.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},o.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},o.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)},o.dist=o.distance,o.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r},o.sqrDist=o.squaredDistance,o.length=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)},o.len=o.length,o.squaredLength=function(t){var e=t[0],n=t[1];return e*e+n*n},o.sqrLen=o.squaredLength,o.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},o.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},o.normalize=function(t,e){var n=e[0],r=e[1],o=n*n+r*r;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o),t},o.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},o.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},o.lerp=function(t,e,n,r){var o=e[0],a=e[1];return t[0]=o+r*(n[0]-o),t[1]=a+r*(n[1]-a),t},o.random=function(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},o.transformMat2=function(t,e,n){var r=e[0],o=e[1];return t[0]=n[0]*r+n[2]*o,t[1]=n[1]*r+n[3]*o,t},o.transformMat2d=function(t,e,n){var r=e[0],o=e[1];return t[0]=n[0]*r+n[2]*o+n[4],t[1]=n[1]*r+n[3]*o+n[5],t},o.transformMat3=function(t,e,n){var r=e[0],o=e[1];return t[0]=n[0]*r+n[3]*o+n[6],t[1]=n[1]*r+n[4]*o+n[7],t},o.transformMat4=function(t,e,n){var r=e[0],o=e[1];return t[0]=n[0]*r+n[4]*o+n[12],t[1]=n[1]*r+n[5]*o+n[13],t},o.forEach=function(){var t=o.create();return function(e,n,r,o,a,i){var u,s;for(n||(n=2),r||(r=0),s=o?Math.min(o*n+r,e.length):e.length,u=r;s>u;u+=n)t[0]=e[u],t[1]=e[u+1],a(t,t,i),e[u]=t[0],e[u+1]=t[1];return e}}(),o.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},t.exports=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=function(t,e,n){for(var r=!0;r;){var o=t,a=e,i=n;u=c=s=void 0,r=!1,null===o&&(o=Function.prototype);var u=Object.getOwnPropertyDescriptor(o,a);if(void 0!==u){if("value"in u)return u.value;var s=u.get;return void 0===s?void 0:s.call(i)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;t=c,e=a,n=i,r=!0}},s=n(3),c=r(s),l=n(11),f=r(l),d=function(){},p=function(t){function e(){o(this,e),u(Object.getPrototypeOf(e.prototype),"constructor",this).apply(this,arguments)}return a(e,t),i(e,[{key:"render",value:function(){var t=this.props.isPlaying?"fa fa-pause icon":"fa fa-play icon",e=this.props.isMute?"fa fa-volume-off icon":"fa fa-volume-up icon";return c["default"].createElement("div",{className:"video-controls"},c["default"].createElement("a",{className:t,title:"Play",onClick:this.playPause.bind(this)}),c["default"].createElement("input",{type:"range",className:"seek-bar",value:this.props.position,onChange:this.positionChange.bind(this),ref:"seekBar"}),c["default"].createElement("a",{className:e,title:"Mute",onClick:this.mute.bind(this)}),c["default"].createElement("span",{className:"brand"},this.props.brand),c["default"].createElement("span",{className:"info"},this.props.title),c["default"].createElement("span",{className:"timingInfo"}),c["default"].createElement("a",{className:"full-screen fa fa-expand icon rfloat",title:"Full Screen",onClick:this.fullScreen.bind(this)}),c["default"].createElement("a",{className:"select-local-file fa fa-folder-open icon rfloat",title:"Select File",onClick:this.selectLocalFile.bind(this)}))}},{key:"playPause",value:function(){this.props.onPlayPause()}},{key:"mute",value:function(){this.props.onMute()}},{key:"fullScreen",value:function(){this.props.onFullScreen()}},{key:"positionChange",value:function(){this.props.onPositionChange(+this.refs.seekBar.value)}},{key:"selectLocalFile",value:function(){var t=this;f["default"]().then(function(e){t.props.onLocalVideoSelected(e)})["catch"](function(t){console.error(t)})}}]),e}(c["default"].Component);p.propTypes={isPlaying:s.PropTypes.bool,onPlayPause:s.PropTypes.func,isMute:s.PropTypes.bool,onMute:s.PropTypes.func,isFullscreen:s.PropTypes.bool,onFullScreen:s.PropTypes.func,position:s.PropTypes.number,onPositionChange:s.PropTypes.func,onLocalVideoSelected:s.PropTypes.func,brand:s.PropTypes.string,title:s.PropTypes.string},p.defaultProps={isPlaying:!1,onPlayPause:d,isMute:!1,onMute:d,isFullscreen:!1,onFullScreen:d,position:0,onPositionChange:d,onLocalVideoSelected:d,brand:"",title:""},e["default"]=p,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=function(t,e,n){for(var r=!0;r;){var o=t,a=e,i=n;u=c=s=void 0,r=!1,null===o&&(o=Function.prototype);var u=Object.getOwnPropertyDescriptor(o,a);if(void 0!==u){if("value"in u)return u.value;var s=u.get;return void 0===s?void 0:s.call(i)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;t=c,e=a,n=i,r=!0}},s=n(3),c=r(s),l=n(7),f=r(l),d=n(10),p=r(d),h=n(12),v=r(h),m=n(9),y=r(m),g=n(8),M=r(g),b=function(){},P=function(t){function e(t){o(this,e),u(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,t),this.state={webGl:null,devices:null,needReload:!1}}return a(e,t),i(e,[{key:"render",value:function(){return c["default"].createElement("div",null,c["default"].createElement("canvas",{className:"glcanvas",ref:"canvas"