From 4973bd379828387655e9fca1e73415678a1c067b Mon Sep 17 00:00:00 2001 From: Xavier Bourry Date: Thu, 20 Aug 2020 16:36:43 -0400 Subject: [PATCH] [FIX] Major bug in the helpers + use WebGL2 on IOS + fix proposal for https://github.com/jeeliz/jeelizFaceFilter/issues/186 --- dist/jeelizFaceFilter.js | 275 ++++++++++++++------------- dist/jeelizFaceFilter.module.js | 275 ++++++++++++++------------- dist/jeelizFaceFilter.moduleNoDOM.js | 275 ++++++++++++++------------- helpers/JeelizResizer.js | 6 +- helpers/JeelizThreejsHelper.js | 6 +- 5 files changed, 426 insertions(+), 411 deletions(-) diff --git a/dist/jeelizFaceFilter.js b/dist/jeelizFaceFilter.js index dd585cb1..8e34a5be 100644 --- a/dist/jeelizFaceFilter.js +++ b/dist/jeelizFaceFilter.js @@ -16,142 +16,147 @@ * limitations under the License. */ -var JEEFACEFILTERAPI=(function(){window.JEEFACEFILTERAPIGEN=function(){function Bb(){var a=null,c=null,d=null,e=0;this.od=function(f){return a[f]};this.Nd=function(f){var k=null;e=f.length;a=f.map(function(l,n){l=Object.assign({},l,{index:n,parent:this,Ra:k,xd:n===e-1});return k=n=0===n?Nb.instance(l):Ob.instance(l)});c=a[0];d=a[e-1];a.forEach(function(l,n){0!==n&&l.Id()})};this.J=function(f,k){var l=k;a.forEach(function(n){l=n.J(l,f)});return l};this.Xb=function(){return c.B()};this.Zb=function(){return d.pd()};this.Pd=function(f){d.Zc(f)}; -this.Wb=function(){return d.Wb()};this.h=function(){a&&(a.forEach(function(f){f.h()}),d=c=a=null,e=0)}}var Ma,Na,Oa,Ya,Za,Pa,$a,ab,bb,jb,kb,lb,mb;function nb(a,c){var d=c%8;return a[(c-d)/8]>>7-d&1}function Pb(a){var c=JSON.parse(a);a=c.ne;var d=c.nf,e=c.n;var f="undefined"===typeof btoa?Buffer.from(c.data,"base64").toString("latin1"):atob(c.data);var k=f.length;c=new Uint8Array(k);for(var l=0;l=m;--z)y+=p*nb(c,z),p*=2;m=y;q=q+1+a;p=k.length;y=0;for(z=q;zc&&(t.Sa=a);if(1E3*cQ.G)E.L.splice(0,E.L.length-Q.G);else for(;E.L.lengthc&&(c=ma[d].detected,a=0);for(c=0;c=E.i&&(a=0)}E.ic=a}for(a=0;aH.ga[1]?(a=H.Ca[1],1H.pb}function Hb(a,c,d,e){return d>a?Math.max(0,a+c/2- -(d-e/2)):Math.max(0,d+e/2-(a-c/2))}function Wb(){return Va.some(function(a,c){if(c===E.ba)return!1;c=Va[E.ba];if(c.Pa>a.Pa||3>a.Pa||Hb(c.x,c.U,a.x,a.U)H.jc*c.U*d})}function Xb(){var a=E.ba;U.Aa.Rd(1);1!==E.i&&(b.viewport(0,0,3,E.i),u.set("s0"),u.vc("u1",1),R.g(!1,!1),u.vc("u1",0));b.viewport(0,a,1,1);u.set("s50");I.ia&&u.A("u36",ma[a].rz);1!==E.i&&u.A("u35",E.sb);if(1wb&&(Ma+=$a,Oa=Pa,Ma>lb&&(Ma=jb,Na+=ab,Na>mb&&(Na=kb)));Ya=Ma+.5*(Math.random()-.5)*$a;Za=Na+.5*(Math.random()-.5)*ab;xb=Oa+.5*(Math.random()-.5)*bb}function Ib(){t.X&&t.X.remove();t.mb=t.element.isFakeVideo?!0:!1;t.X=S.instance(Object.assign({isPot:!1,isFloat:!1},t.mb?{isFlipY:!1,array:t.element.arrayBuffer,width:t.element.videoWidth,height:t.element.videoHeight,isKeepArray:!0}:{D:t.element}))}function Ga(){u.K("s48", -[{type:"1i",name:"u1",value:0},{type:"mat2",name:"u32",value:t.m}])}function Ha(){t.C[0]=.5;t.C[1]=.5;var a=t.u[1]/t.u[0];Sa=Aa.O()/Aa.B();90===Math.abs(ha.rotate)&&(a=1/a);a>Sa?t.C[1]*=Sa/a:t.C[0]*=a/Sa;u.K("s50",[{name:"u45",type:"1f",value:Sa}]);t.m[0]=0;t.m[1]=0;t.m[2]=0;t.m[3]=0;switch(ha.rotate){case 0:t.m[0]=t.C[0];t.m[3]=t.C[1];break;case 180:t.m[0]=-t.C[0];t.m[3]=-t.C[1];break;case 90:t.m[1]=t.C[0];t.m[2]=-t.C[1];break;case -90:t.m[1]=-t.C[0],t.m[2]=t.C[1]}ha.flipX&&(t.m[0]*=-1,t.m[2]*=-1)} -function yb(){var a=t.element.videoWidth,c=t.element.videoHeight,d=t.u[0]!==a||t.u[1]!==c;d&&(t.u[0]=a,t.u[1]=c);return d}function eb(a,c){if(ea===ba.error)return!1;t.element=a;yb();c&&c();return!0}function Jb(a,c,d){a&&a();t.ra={video:{facingMode:{ideal:ha.facingMode},width:{min:ha.minWidth,max:ha.maxWidth,ideal:ha.idealWidth},height:{min:ha.minHeight,max:ha.maxHeight,ideal:ha.idealHeight}},audio:!1};ha.deviceId&&(t.ra.deviceId=ha.deviceId);T.get(t.element?t.element:T.rd(),function(e){c&&c(e);d(e)}, -function(){Ea("WEBCAM_UNAVAILABLE")},t.ra)}function Ea(a){ea!==ba.error&&(ea=ba.error,I.qa&&I.qa(a))}var pa={Xe:function(a){return Math.ceil(Math.log2(a))},Ad:function(a){return Math.log2(a)},kf:function(a){return 0===Math.log2(a)%1},le:function(a){var c=[0,0,0,0];a.forEach(function(d){c[0]+=d[0];c[1]+=d[1];c[2]+=d[2];c[3]+=d[3]});return c},me:function(a,c,d){return Math.min(Math.max(a,c),d)},re:function(a){return a*Math.PI/180},sf:function(a,c){c=Math.pow(10,c);return Math.round(a*c)/c},tf:function(a){return Math.round(1E6* -a)/1E6},Ye:function(a,c){return(100*a/c).toFixed(3)},R:function(a,c,d){return a*(1-d)+c*d},dd:function(a,c){return pa.Vc(a-c)},Vc:function(a){for(;a>Math.PI;)a-=2*Math.PI;for(;a<=-Math.PI;)a+=2*Math.PI;return a},te:function(a,c){return Math.abs(pa.dd(a,c))},de:function(a,c){return Math.atan2(Math.sin(a)+Math.sin(c),Math.cos(a)+Math.cos(c))}},Gb={get:function(a,c,d){var e=new XMLHttpRequest;e.open("GET",a,!0);e.withCredentials=!1;e.onreadystatechange=function(){4===e.readyState&&(200===e.status||0=== -e.status?c(e.responseText):"undefined"!==typeof d&&d(e.status))};e.send()},Te:function(a,c){Gb.get(a,function(d){c(JSON.parse(d))})},qf:function(a,c,d){var e=new XMLHttpRequest;e.open("POST",a,!0);e.setRequestHeader("Content-type","application/x-www-form-urlencoded");e.onreadystatechange=function(){4!==e.readyState||200!==e.status&&0!==e.status||d(e.responseText)};e.send(c)},Ke:function(a,c){var d=new XMLHttpRequest;d.open("POST",a,!0);d.responseType="arraybuffer";d.onload=function(){c(d.response)}; -d.send()}},db={Ef:function(a,c,d){a=Math.min(Math.max((d-a)/(c-a),0),1);return a*a*(3-2*a)},Ma:function(a,c,d){return Math.min(Math.max((d-a)/(c-a),0),1)},Ee:function(a,c,d,e){return Math.pow(Math.min(Math.max((e-a)/(c-a),0),1),d)},If:function(){return 0},pf:function(){return 1},mf:function(a){return a},Be:function(a){return a*a},Ge:function(a){return a*(2-a)},ye:function(a){return.5>a?2*a*a:-1+(4-2*a)*a},we:function(a){return a*a*a},Fe:function(a){return--a*a*a+1},xe:function(a){return.5>a?4*a*a* -a:(a-1)*(2*a-2)*(2*a-2)+1},Ce:function(a){return a*a*a*a},He:function(a){return 1- --a*a*a*a},ze:function(a){return.5>a?8*a*a*a*a:1-8*--a*a*a*a},De:function(a){return a*a*a*a*a},Ie:function(a){return 1+--a*a*a*a*a},Ae:function(a){return.5>a?16*a*a*a*a*a:1+16*--a*a*a*a*a}},Yb={ld:function(a,c,d){switch(a){case "relu":return d+"=max(vec4(0.,0.,0.,0.),"+c+");";case "elu":return d+"=mix(exp(-abs("+c+"))-vec4(1.,1.,1.,1.),"+c+",step(0.,"+c+"));";case "elu01":return d+"=mix(0.1*exp(-abs("+c+"))-vec4(0.1,0.1,0.1,0.1),"+ -c+",step(0.,"+c+"));";case "arctan":return d+"=atan(3.14159265359*texture2D(u0,vUV))/3.14159265359;";case "copy":return"";default:return!1}}},u=function(){function a(g,w){g=b.createShader(g);b.shaderSource(g,w);b.compileShader(g);return b.getShaderParameter(g,b.COMPILE_STATUS)?g:!1}function c(g,w){g=a(b.VERTEX_SHADER,g);w=a(b.FRAGMENT_SHADER,w);f.push(g,w);var A=b.createProgram();b.attachShader(A,g);b.attachShader(A,w);b.linkProgram(A);return A}function d(g){void 0===g.fa&&(g.fa="precision lowp float;attribute vec2 a0;varying vec2 vv0;void main(){gl_Position=vec4(a0,0.,1.),vv0=a0*.5+vec2(.5,.5);}"); -void 0===g.Fa&&(g.Fa=["a0"]);void 0===g.na&&(g.na=[2]);if(void 0===g.precision||"highp"===g.precision)g.precision=x;g.id=n++;void 0!==g.Md&&g.Md.forEach(function(A,Z){g.a=g.a.replace(A,g.Ta[Z])});g.Bb=0;g.na.forEach(function(A){g.Bb+=4*A});g.wa=c(g.fa,"precision "+g.precision+" float;\n"+g.a);g.j={};g.c.forEach(function(A){g.j[A]=b.getUniformLocation(g.wa,A)});g.attributes={};g.oa=[];g.Fa.forEach(function(A){var Z=b.getAttribLocation(g.wa,A);g.attributes[A]=Z;g.oa.push(Z)});if(g.f){b.useProgram(g.wa); -l=g;k=g.id;for(var w in g.f)b.uniform1i(g.j[w],g.f[w])}g.kb=!0}function e(g){Ia.Sd(G);k!==g.id&&(G.la(),k=g.id,l=g,b.useProgram(g.wa),g.oa.forEach(function(w){0!==w&&b.enableVertexAttribArray(w)}))}var f=[],k=-1,l=null,n=0,q=!1,x="highp",m=["u1"],p=["u0"],y={u1:0},z={u0:0},O={u1:0,u2:1},N={u3:0},F={s0:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",c:m,f:y},s1:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",c:m,f:y,precision:"lowp"}, -s2:{a:"uniform sampler2D u1,u2;varying vec2 vv0;void main(){vec4 a=texture2D(u2,vv0),b=texture2D(u1,vv0);gl_FragColor=a*b;}",c:["u1","u2"],f:O},s3:{a:"uniform sampler2D u1;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=a.r*f;}",c:m,f:y},s4:{a:"uniform sampler2D u1,u2;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u2,vv0),b=texture2D(u1,vv0);gl_FragColor=a.a*b.r*f;}",c:["u1","u2"],f:O},s5:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(1.-vv0.x,vv0.y));}", -c:m,f:y},s6:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(vv0.x,1.-vv0.y));}",c:m,f:y},s7:{a:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=a*u4;}",c:["u0","u4"],f:z},s8:{a:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;const vec4 f=vec4(.25,.25,.25,.25),g=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);float b=dot(a*u4,f);gl_FragColor=b*g;}",c:["u0","u4"],f:z},s9:{a:"uniform sampler2D u1;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){float a=.25*dot(e,texture2D(u1,vv0));gl_FragColor=a*e;}", -c:m,f:y},s10:{a:"uniform sampler2D u1,u5;uniform float u6;const vec4 f=vec4(1.,1.,1.,1.);varying vec2 vv0;void main(){vec4 a=texture2D(u1,vv0),b=texture2D(u5,vv0);gl_FragColor=mix(b,a,u6*f);}",c:["u1","u5","u6"],f:{u1:0,u5:1}},s11:{a:"uniform sampler2D u1;uniform vec2 u7;varying vec2 vv0;void main(){gl_FragColor=.25*(texture2D(u1,vv0+u7)+texture2D(u1,vv0+u7*vec2(1.,-1.))+texture2D(u1,vv0+u7*vec2(-1.,-1.))+texture2D(u1,vv0+u7*vec2(-1.,1.)));}",c:["u1","u7"],f:y},s12:{a:"uniform sampler2D u1;uniform vec4 u8;varying vec2 vv0;float g(float a,float b){a=floor(a)+.5;return floor(a/exp2(b));}float h(float a,float b){return floor(a*exp2(b)+.5);}float i(float a,float b){return mod(a,h(1.,b));}float e(float c,float a,float b){a=floor(a+.5),b=floor(b+.5);return i(g(c,a),b-a);}vec4 j(float a){if(a==0.)return vec4(0.,0.,0.,0.);float k=128.*step(a,0.);a=abs(a);float c=floor(log2(a)),l=c+127.,b=(a/exp2(c)-1.)*8388608.,d=l/2.,m=fract(d)*2.,n=floor(d),o=e(b,0.,8.),p=e(b,8.,16.),q=m*128.+e(b,16.,23.),r=k+n;return vec4(o,p,q,r)/255.;}void main(){float a=dot(texture2D(u1,vv0),u8);gl_FragColor=j(a);}", -c:["u1","u8"],f:y},s13:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=e/(e+exp(-a));gl_FragColor=b;}",c:p,f:z},s14:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(0.,0.,0.,0.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=max(f,a);}",c:p,f:z},s15:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=mix(exp(-abs(a))-f,a,step(0.,a));}",c:p,f:z},s16:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=exp(-abs(a))-f;gl_FragColor=mix(.1*b,a,step(0.,a));}", -c:p,f:z},s17:{a:"uniform sampler2D u0,u6,u9;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),c=texture2D(u6,vv0),d=texture2D(u9,vv0),b=a/d;gl_FragColor=c*mix(exp(-abs(b))-f,b,step(0.,a));}",c:["u0","u6","u9"],f:{u0:0,u6:1,u9:2}},s18:{a:"uniform sampler2D u0;const float e=3.141593;varying vec2 vv0;void main(){gl_FragColor=atan(e*texture2D(u0,vv0))/e;}",c:p,f:z},s19:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=log(f+a);gl_FragColor=b;}", -c:p,f:z},s20:{a:"uniform sampler2D u0,u10;uniform float u11;const vec2 e=vec2(.5,.5);const float f=1e-5;const vec4 g=vec4(1.,1.,1.,1.),i=vec4(0.,0.,0.,0.);varying vec2 vv0;void main(){vec4 a=texture2D(u10,e);float b=u11*u11;vec4 c=max(b*a,f*g);gl_FragColor=texture2D(u0,vv0)/c;}",c:["u0","u10","u11"],f:{u0:0,u10:1}},s21:{a:"uniform sampler2D u1;uniform vec2 u12;varying vec2 vv0;void main(){float a=u12.x*u12.y;vec2 b=floor(vv0*a)/a,c=fract(vv0*a),d=floor(b*u12.y),f=floor(u12.x*fract(b*u12.y)),g=(f*u12.y+d)/a;gl_FragColor=texture2D(u1,g+c/a);}", -c:["u1","u12"],f:y},s22:{a:"uniform sampler2D u13,u14,u15;varying vec2 vv0;void main(){vec4 a=texture2D(u15,vv0);vec2 b=a.rg,c=a.ba;vec4 d=texture2D(u13,b),f=texture2D(u14,c);gl_FragColor=d*f;}",c:["u13","u14","u15"],f:{u14:0,u13:1,u15:2}},s23:{a:"uniform float u16;uniform sampler2D u13,u14;varying vec2 vv0;void main(){vec2 a=fract(vv0*u16);vec4 b=texture2D(u13,vv0),c=texture2D(u14,a);gl_FragColor=b*c;}",c:["u14","u13","u16"],f:{u14:0,u13:1}},s24:{a:"uniform float u16;uniform sampler2D u13,u14,u17,u18,u19,u20;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.),g=vec4(1e-3,1e-3,1e-3,1e-3);void main(){vec2 h=vv0*u16,l=floor(h),c=h-l;vec4 m=texture2D(u13,vv0),d=texture2D(u14,c),a=texture2D(u20,vv0);a=a*255.;vec4 n=texture2D(u17,c),o=texture2D(u18,c),p=texture2D(u19,c),i=step(-g,-a),b=e-i,j=b*step(-e-g,-a);b*=e-j;vec4 k=b*step(-2.*e-g,-a);b*=e-k;vec4 q=b;d=i*d+j*n+k*o+q*p,gl_FragColor=m*d;}", +var JEEFACEFILTERAPI=(function(){window.JEEFACEFILTERAPIGEN=function(){function Cb(){var a=null,c=null,d=null,e=0;this.Bd=function(f){return a[f]};this.$d=function(f){var n=null;e=f.length;a=f.map(function(t,q){t=Object.assign({},t,{index:q,parent:this,Wa:n,Kd:q===e-1});return n=q=0===q?Ob.instance(t):Pb.instance(t)});c=a[0];d=a[e-1];a.forEach(function(t,q){0!==q&&t.Vd()})};this.J=function(f,n){var t=n;a.forEach(function(q){t=q.J(t,f)});return t};this.nc=function(){return c.A()};this.pc=function(){return d.Cd()};this.be=function(f){d.nd(f)}; +this.mc=function(){return d.mc()};this.h=function(){a&&(a.forEach(function(f){f.h()}),d=c=a=null,e=0)}}var Na,Oa,Pa,Ya,Za,Qa,$a,ab,bb,jb,kb,lb,mb;function nb(a,c){var d=c%8;return a[(c-d)/8]>>7-d&1}function Qb(a){var c=JSON.parse(a);a=c.ne;var d=c.nf,e=c.n;var f="undefined"===typeof btoa?Buffer.from(c.data,"base64").toString("latin1"):atob(c.data);var n=f.length;c=new Uint8Array(n);for(var t=0;t=B;--k)A+=h*nb(c,k),h*=2;B=A;g=g+1+a;h=n.length;A=0;for(k=g;kc&&(x.Xa=a);if(1E3*cT.F)G.L.splice(0,G.L.length-T.F);else for(;G.L.lengthc&&(c=oa[d].detected,a=0);for(c=0;c=G.i&&(a=0)}G.yc=a}for(a=0;aK.ka[1]?(a=K.Ea[1],1K.xb}function Ib(a,c,d,e){return d>a?Math.max(0,a+c/2-(d-e/2)):Math.max(0,d+e/2-(a-c/2))}function Xb(){return Wa.some(function(a, +c){if(c===G.ea)return!1;c=Wa[G.ea];if(c.Ua>a.Ua||3>a.Ua||Ib(c.x,c.V,a.x,a.V)K.zc*c.V*d})}function Yb(){var a=G.ea;X.Ca.de(1);1!==G.i&&(b.viewport(0,0,3,G.i),y.set("s0"),y.Mc("u1",1),U.g(!1,!1),y.Mc("u1",0));b.viewport(0,a,1,1);y.set("s52");N.ma&&y.v("u36",oa[a].rz);1!==G.i&&y.v("u35",G.Ab);if(1wb&&(Na+=$a,Pa=Qa,Na>lb&&(Na=jb,Oa+=ab,Oa>mb&&(Oa=kb)));Ya=Na+.5*(Math.random()-.5)*$a;Za=Oa+.5*(Math.random()-.5)*ab;xb=Pa+.5*(Math.random()-.5)*bb}function Jb(){x.$&&x.$.remove();x.ub=x.element.isFakeVideo?!0:!1;x.$=V.instance(Object.assign({isPot:!1,isFloat:!1},x.ub?{isFlipY:!1,array:x.element.arrayBuffer,width:x.element.videoWidth,height:x.element.videoHeight,isKeepArray:!0}:{D:x.element}))}function Ia(){y.K("s50",[{type:"1i",name:"u1",value:0},{type:"mat2",name:"u32",value:x.m}])} +function Ja(){x.C[0]=.5;x.C[1]=.5;var a=x.o[1]/x.o[0];Ta=Ua.P()/Ua.A();90===Math.abs(na.rotate)&&(a=1/a);a>Ta?x.C[1]*=Ta/a:x.C[0]*=a/Ta;y.K("s52",[{name:"u45",type:"1f",value:Ta}]);x.m[0]=0;x.m[1]=0;x.m[2]=0;x.m[3]=0;switch(na.rotate){case 0:x.m[0]=x.C[0];x.m[3]=x.C[1];break;case 180:x.m[0]=-x.C[0];x.m[3]=-x.C[1];break;case 90:x.m[1]=x.C[0];x.m[2]=-x.C[1];break;case -90:x.m[1]=-x.C[0],x.m[2]=x.C[1]}na.flipX&&(x.m[0]*=-1,x.m[2]*=-1)}function yb(){var a=x.element.videoWidth,c=x.element.videoHeight, +d=x.o[0]!==a||x.o[1]!==c;d&&(x.o[0]=a,x.o[1]=c);return d}function eb(a,c){if(ka===da.error)return!1;x.element=a;yb();c&&c();return!0}function Kb(a,c,d){a&&a();x.ua={video:{facingMode:{ideal:na.facingMode},width:{min:na.minWidth,max:na.maxWidth,ideal:na.idealWidth},height:{min:na.minHeight,max:na.maxHeight,ideal:na.idealHeight}},audio:!1};na.deviceId&&(x.ua.deviceId=na.deviceId);W.get(x.element?x.element:W.Ed(),function(e){c&&c(e);d(e)},function(){Ha("WEBCAM_UNAVAILABLE")},x.ua)}function Ha(a){ka!== +da.error&&(ka=da.error,N.ta&&N.ta(a))}var qa={lf:function(a){return Math.ceil(Math.log2(a))},Nd:function(a){return Math.log2(a)},Af:function(a){return 0===Math.log2(a)%1},Ae:function(a){var c=[0,0,0,0];a.forEach(function(d){c[0]+=d[0];c[1]+=d[1];c[2]+=d[2];c[3]+=d[3]});return c},Be:function(a,c,d){return Math.min(Math.max(a,c),d)},Fe:function(a){return a*Math.PI/180},Gf:function(a,c){c=Math.pow(10,c);return Math.round(a*c)/c},Hf:function(a){return Math.round(1E6*a)/1E6},mf:function(a,c){return(100* +a/c).toFixed(3)},S:function(a,c,d){return a*(1-d)+c*d},rd:function(a,c){return qa.jd(a-c)},jd:function(a){for(;a>Math.PI;)a-=2*Math.PI;for(;a<=-Math.PI;)a+=2*Math.PI;return a},He:function(a,c){return Math.abs(qa.rd(a,c))},re:function(a,c){return Math.atan2(Math.sin(a)+Math.sin(c),Math.cos(a)+Math.cos(c))}},Hb={get:function(a,c,d){var e=new XMLHttpRequest;e.open("GET",a,!0);e.withCredentials=!1;e.onreadystatechange=function(){4===e.readyState&&(200===e.status||0===e.status?c(e.responseText):"undefined"!== +typeof d&&d(e.status))};e.send()},hf:function(a,c){Hb.get(a,function(d){c(JSON.parse(d))})},Ef:function(a,c,d){var e=new XMLHttpRequest;e.open("POST",a,!0);e.setRequestHeader("Content-type","application/x-www-form-urlencoded");e.onreadystatechange=function(){4!==e.readyState||200!==e.status&&0!==e.status||d(e.responseText)};e.send(c)},Ye:function(a,c){var d=new XMLHttpRequest;d.open("POST",a,!0);d.responseType="arraybuffer";d.onload=function(){c(d.response)};d.send()}},db={Sf:function(a,c,d){a=Math.min(Math.max((d- +a)/(c-a),0),1);return a*a*(3-2*a)},Ra:function(a,c,d){return Math.min(Math.max((d-a)/(c-a),0),1)},Se:function(a,c,d,e){return Math.pow(Math.min(Math.max((e-a)/(c-a),0),1),d)},Wf:function(){return 0},Df:function(){return 1},Cf:function(a){return a},Pe:function(a){return a*a},Ue:function(a){return a*(2-a)},Me:function(a){return.5>a?2*a*a:-1+(4-2*a)*a},Ke:function(a){return a*a*a},Te:function(a){return--a*a*a+1},Le:function(a){return.5>a?4*a*a*a:(a-1)*(2*a-2)*(2*a-2)+1},Qe:function(a){return a*a*a*a}, +Ve:function(a){return 1- --a*a*a*a},Ne:function(a){return.5>a?8*a*a*a*a:1-8*--a*a*a*a},Re:function(a){return a*a*a*a*a},We:function(a){return 1+--a*a*a*a*a},Oe:function(a){return.5>a?16*a*a*a*a*a:1+16*--a*a*a*a*a}},Zb={wd:function(a,c,d){switch(a){case "relu":return d+"=max(vec4(0.,0.,0.,0.),"+c+");";case "elu":return d+"=mix(exp(-abs("+c+"))-vec4(1.,1.,1.,1.),"+c+",step(0.,"+c+"));";case "elu01":return d+"=mix(0.1*exp(-abs("+c+"))-vec4(0.1,0.1,0.1,0.1),"+c+",step(0.,"+c+"));";case "arctan":return d+ +"=atan(3.14159265359*texture2D(u0,vUV))/3.14159265359;";case "copy":return"";default:return!1}}},y=function(){function a(u,p,D){p=u.createShader(p);u.shaderSource(p,D);u.compileShader(p);return u.getShaderParameter(p,u.COMPILE_STATUS)?p:!1}function c(u,p,D){p=a(u,u.VERTEX_SHADER,p);D=a(u,u.FRAGMENT_SHADER,D);u===b&&t.push(p,D);var O=u.createProgram();u.attachShader(O,p);u.attachShader(O,D);u.linkProgram(O);return O}function d(u,p){void 0===p.ja&&(p.ja="precision lowp float;attribute vec2 a0;varying vec2 vv0;void main(){gl_Position=vec4(a0,0.,1.),vv0=a0*.5+vec2(.5,.5);}"); +void 0===p.Ga&&(p.Ga=["a0"]);void 0===p.ra&&(p.ra=[2]);if(void 0===p.precision||"highp"===p.precision)p.precision=h;p.id=w++;void 0!==p.Zd&&p.Zd.forEach(function(O,ba){p.a=p.a.replace(O,p.Ya[ba])});p.Kb=0;p.ra.forEach(function(O){p.Kb+=4*O});p.ha=c(u,p.ja,"precision "+p.precision+" float;\n"+p.a);p.j={};p.c.forEach(function(O){p.j[O]=u.getUniformLocation(p.ha,O)});p.attributes={};p.sa=[];p.Ga.forEach(function(O){var ba=u.getAttribLocation(p.ha,O);p.attributes[O]=ba;p.sa.push(ba)});if(p.f){u.useProgram(p.ha); +g=p;q=p.id;for(var D in p.f)u.uniform1i(p.j[D],p.f[D])}p.sb=!0}function e(u){wa.ee(L);q!==u.id&&(L.M(),q=u.id,g=u,b.useProgram(u.ha),u.sa.forEach(function(p){0!==p&&b.enableVertexAttribArray(p)}))}function f(u,p,D){d(u,p,D);u.useProgram(p.ha);u.enableVertexAttribArray(0);q=-1;return g=p}function n(){return{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",c:["u1"],f:{u1:0}}}var t=[],q=-1,g=null,w=0,B=!1,h="highp",A=["u1"],k=["u0"],I={u1:0},H={u0:0},C={u1:0,u2:1}, +r={u3:0},v={s0:n(),s1:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",c:A,f:I,precision:"lowp"},s2:{a:"uniform sampler2D u1,u2;varying vec2 vv0;void main(){vec4 a=texture2D(u2,vv0),b=texture2D(u1,vv0);gl_FragColor=a*b;}",c:["u1","u2"],f:C},s3:{a:"uniform sampler2D u1;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=a.r*f;}",c:A,f:I},s4:{a:"uniform sampler2D u1,u2;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u2,vv0),b=texture2D(u1,vv0);gl_FragColor=a.a*b.r*f;}", +c:["u1","u2"],f:C},s5:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(1.-vv0.x,vv0.y));}",c:A,f:I},s6:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(vv0.x,1.-vv0.y));}",c:A,f:I},s7:{a:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=a*u4;}",c:["u0","u4"],f:H},s8:{a:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;const vec4 f=vec4(.25,.25,.25,.25),g=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);float b=dot(a*u4,f);gl_FragColor=b*g;}", +c:["u0","u4"],f:H},s9:{a:"uniform sampler2D u1;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){float a=.25*dot(e,texture2D(u1,vv0));gl_FragColor=a*e;}",c:A,f:I},s10:{a:"uniform sampler2D u1,u5;uniform float u6;const vec4 f=vec4(1.,1.,1.,1.);varying vec2 vv0;void main(){vec4 a=texture2D(u1,vv0),b=texture2D(u5,vv0);gl_FragColor=mix(b,a,u6*f);}",c:["u1","u5","u6"],f:{u1:0,u5:1}},s11:{a:"uniform sampler2D u1;uniform vec2 u7;varying vec2 vv0;void main(){gl_FragColor=.25*(texture2D(u1,vv0+u7)+texture2D(u1,vv0+u7*vec2(1.,-1.))+texture2D(u1,vv0+u7*vec2(-1.,-1.))+texture2D(u1,vv0+u7*vec2(-1.,1.)));}", +c:["u1","u7"],f:I},s12:{a:"uniform sampler2D u1;uniform vec4 u8;varying vec2 vv0;float g(float a,float b){a=floor(a)+.5;return floor(a/exp2(b));}float h(float a,float b){return floor(a*exp2(b)+.5);}float i(float a,float b){return mod(a,h(1.,b));}float e(float c,float a,float b){a=floor(a+.5),b=floor(b+.5);return i(g(c,a),b-a);}vec4 j(float a){if(a==0.)return vec4(0.,0.,0.,0.);float k=128.*step(a,0.);a=abs(a);float c=floor(log2(a)),l=c+127.,b=(a/exp2(c)-1.)*8388608.,d=l/2.,m=fract(d)*2.,n=floor(d),o=e(b,0.,8.),p=e(b,8.,16.),q=m*128.+e(b,16.,23.),r=k+n;return vec4(o,p,q,r)/255.;}void main(){float a=dot(texture2D(u1,vv0),u8);gl_FragColor=j(a);}", +c:["u1","u8"],f:I},s13:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=e/(e+exp(-a));gl_FragColor=b;}",c:k,f:H},s14:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(0.,0.,0.,0.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=max(f,a);}",c:k,f:H},s15:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=mix(exp(-abs(a))-f,a,step(0.,a));}",c:k,f:H},s16:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=exp(-abs(a))-f;gl_FragColor=mix(.1*b,a,step(0.,a));}", +c:k,f:H},s17:{a:"uniform sampler2D u0,u6,u9;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),c=texture2D(u6,vv0),d=texture2D(u9,vv0),b=a/d;gl_FragColor=c*mix(exp(-abs(b))-f,b,step(0.,a));}",c:["u0","u6","u9"],f:{u0:0,u6:1,u9:2}},s18:{a:"uniform sampler2D u0;const float e=3.141593;varying vec2 vv0;void main(){gl_FragColor=atan(e*texture2D(u0,vv0))/e;}",c:k,f:H},s19:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=log(f+a);gl_FragColor=b;}", +c:k,f:H},s20:{a:"uniform sampler2D u0,u10;uniform float u11;const vec2 e=vec2(.5,.5);const float f=1e-5;const vec4 g=vec4(1.,1.,1.,1.),i=vec4(0.,0.,0.,0.);varying vec2 vv0;void main(){vec4 a=texture2D(u10,e);float b=u11*u11;vec4 c=max(b*a,f*g);gl_FragColor=texture2D(u0,vv0)/c;}",c:["u0","u10","u11"],f:{u0:0,u10:1}},s21:{a:"uniform sampler2D u1;uniform vec2 u12;varying vec2 vv0;void main(){float a=u12.x*u12.y;vec2 b=floor(vv0*a)/a,c=fract(vv0*a),d=floor(b*u12.y),f=floor(u12.x*fract(b*u12.y)),g=(f*u12.y+d)/a;gl_FragColor=texture2D(u1,g+c/a);}", +c:["u1","u12"],f:I},s22:{a:"uniform sampler2D u13,u14,u15;varying vec2 vv0;void main(){vec4 a=texture2D(u15,vv0);vec2 b=a.rg,c=a.ba;vec4 d=texture2D(u13,b),f=texture2D(u14,c);gl_FragColor=d*f;}",c:["u13","u14","u15"],f:{u14:0,u13:1,u15:2}},s23:{a:"uniform float u16;uniform sampler2D u13,u14;varying vec2 vv0;void main(){vec2 a=fract(vv0*u16);vec4 b=texture2D(u13,vv0),c=texture2D(u14,a);gl_FragColor=b*c;}",c:["u14","u13","u16"],f:{u14:0,u13:1}},s24:{a:"uniform float u16;uniform sampler2D u13,u14,u17,u18,u19,u20;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.),g=vec4(1e-3,1e-3,1e-3,1e-3);void main(){vec2 h=vv0*u16,l=floor(h),c=h-l;vec4 m=texture2D(u13,vv0),d=texture2D(u14,c),a=texture2D(u20,vv0);a=a*255.;vec4 n=texture2D(u17,c),o=texture2D(u18,c),p=texture2D(u19,c),i=step(-g,-a),b=e-i,j=b*step(-e-g,-a);b*=e-j;vec4 k=b*step(-2.*e-g,-a);b*=e-k;vec4 q=b;d=i*d+j*n+k*o+q*p,gl_FragColor=m*d;}", c:"u13 u14 u16 u20 u17 u18 u19".split(" "),f:{u14:0,u13:1,u20:3,u17:4,u18:5,u19:6}},s25:{a:"uniform sampler2D u13,u14,u21;uniform float u16,u22,u23,u24;varying vec2 vv0;const vec2 j=vec2(1.,1.);void main(){vec2 a=floor(u22*vv0),b=u22*vv0-a;float c=u16/u22;vec2 d=floor(b*c),f=b*c-d,g=(a+f)/u22;float k=u22*u24/u16;vec2 l=k*d,h=(l+f*u23)/u24,i=step(h,j);vec4 m=texture2D(u13,g),n=texture2D(u14,h),o=m*n*i.x*i.y,p=texture2D(u21,g);gl_FragColor=o*u23*u23+p;}",c:"u13 u14 u16 u22 u23 u24 u21".split(" "),f:{u14:0, u13:1,u21:2}},s26:{a:"uniform sampler2D u13,u14;varying vec2 vv0;void main(){vec4 a=texture2D(u13,vv0),b=texture2D(u14,vv0);gl_FragColor=a*b;}",c:["u13","u14"],f:{u14:0,u13:1}},s27:{a:"uniform sampler2D u1,u21;uniform float u25;varying vec2 vv0;void main(){gl_FragColor=texture2D(u21,vv0)+u25*texture2D(u1,vv0);}",c:["u1","u21","u25"],f:{u1:0,u21:1}},s28:{a:"varying vec2 vv0;uniform sampler2D u1;const vec4 f=vec4(1.,1.,1.,1.),g=vec4(.299,.587,.114,0.);void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=dot(a,g)*f;}", -c:m,f:y,precision:"lowp"},s29:{a:"varying vec2 vv0;uniform sampler2D u1;uniform float u26;const vec3 f=vec3(.299,.587,.114);void main(){vec3 a=texture2D(u1,vv0).rgb,b=texture2D(u1,vv0+vec2(0.,u26)).rgb,c=texture2D(u1,vv0+vec2(u26,u26)).rgb,d=texture2D(u1,vv0+vec2(u26,0.)).rgb;gl_FragColor=vec4(dot(a,f),dot(b,f),dot(c,f),dot(d,f));}",c:["u1","u26"],f:y,precision:"lowp"},s30:{a:"varying vec2 vv0;uniform sampler2D u1;uniform float u26;const vec3 f=vec3(.299,.587,.114);void main(){vec3 a=texture2D(u1,vv0).rgb,b=texture2D(u1,vv0+vec2(0.,u26)).rgb,c=texture2D(u1,vv0+vec2(u26,u26)).rgb,d=texture2D(u1,vv0+vec2(u26,0.)).rgb;gl_FragColor=vec4(a.r,b.g,c.b,dot(d,f));}", -c:["u1","u26"],f:y,precision:"lowp"},s31:{a:"varying vec2 vv0;uniform sampler2D u1,u2;uniform float u27;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=vec4(0.);a-=texture2D(u1,vec2(vv0.x-u27,vv0.y-u27))*1.,a-=texture2D(u1,vec2(vv0.x-u27,vv0.y))*2.,a-=texture2D(u1,vec2(vv0.x-u27,vv0.y+u27))*1.,a+=texture2D(u1,vec2(vv0.x+u27,vv0.y-u27))*1.,a+=texture2D(u1,vec2(vv0.x+u27,vv0.y))*2.,a+=texture2D(u1,vec2(vv0.x+u27,vv0.y+u27))*1.;vec4 b=vec4(0.);b-=texture2D(u1,vec2(vv0.x-u27,vv0.y-u27))*1.,b-=texture2D(u1,vec2(vv0.x,vv0.y-u27))*2.,b-=texture2D(u1,vec2(vv0.x+u27,vv0.y-u27))*1.,b+=texture2D(u1,vec2(vv0.x-u27,vv0.y+u27))*1.,b+=texture2D(u1,vec2(vv0.x,vv0.y+u27))*2.,b+=texture2D(u1,vec2(vv0.x+u27,vv0.y+u27))*1.;vec3 c=sqrt(a.rgb*a.rgb+b.rgb*b.rgb);vec4 e=vec4(c,texture2D(u1,vv0).a),g=texture2D(u2,vv0);gl_FragColor=g.a*e.r*f;}", -c:["u1","u2","u27"],f:O},s32:{a:"varying vec2 vv0;uniform sampler2D u1,u2;uniform float u27;const vec4 j=vec4(1.,1.,1.,1.);const vec2 k=vec2(1.,1.);void main(){float h=0.;vec2 l=k*u27,a,b;float c,d,i=0.;for(float e=-4.;e<=4.;e+=1.)for(float f=-4.;f<=4.;f+=1.)a=vec2(e,f),c=length(a)/2.,d=exp(-c*c),b=vv0+l*a,h+=d*texture2D(u1,b).r,i+=d;vec4 m=texture2D(u2,vv0);gl_FragColor=m.a*(texture2D(u1,b).r-h/i)*j;}",c:["u1","u2","u27"],f:O},s33:{a:"uniform sampler2D u3;uniform vec2 u7;varying vec2 vv0;vec4 e(vec4 a,vec4 b){vec4 c=step(a,b);return mix(a,b,c);}const vec2 g=vec2(.5,.5),h=vec2(1.,0.),i=vec2(0.,1.);void main(){vec2 a=vv0-u7*g;vec4 b=texture2D(u3,a),c=texture2D(u3,a+u7*h),d=texture2D(u3,a+u7*i),j=texture2D(u3,a+u7),k=e(b,c),l=e(d,j);gl_FragColor=e(k,l);}", -c:["u3","u7"],f:N},s34:{a:"uniform sampler2D u3;uniform vec2 u7;varying vec2 vv0;const vec2 k=vec2(1.,0.),l=vec2(0.,1.),m=vec2(2.,0.),n=vec2(0.,2.);vec4 e(vec4 a,vec4 b){vec4 c=step(a,b);return mix(a,b,c);}vec4 f(vec2 a){vec4 b=texture2D(u3,a),c=texture2D(u3,a+u7*k),d=texture2D(u3,a+u7*l),g=texture2D(u3,a+u7),h=e(b,c),i=e(d,g);return e(h,i);}void main(){vec2 a=vv0+u7*vec2(-.55,-1.05);vec4 b=f(a),c=f(a+u7*m),d=f(a+u7*2.),g=f(a+u7*n),h=e(b,c),i=e(d,g);gl_FragColor=e(h,i);}",c:["u3","u7"],f:N},s35:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=a*a;}", -c:["u1"],f:y,precision:"lowp"},s36:{a:"uniform sampler2D u1;uniform vec2 u7;varying vec2 vv0;const float e=15444.;void main(){vec4 a=1001./e*texture2D(u1,vv0-3.*u7)+2002./e*texture2D(u1,vv0-2.*u7)+3003./e*texture2D(u1,vv0-u7)+3432./e*texture2D(u1,vv0)+3003./e*texture2D(u1,vv0+u7)+2002./e*texture2D(u1,vv0+2.*u7)+1001./e*texture2D(u1,vv0+3.*u7);gl_FragColor=a;}",c:["u7","u1"],f:y,precision:"lowp"},s37:{a:"uniform sampler2D u1,u28,u29;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);const float g=.1;void main(){vec4 a=texture2D(u28,vv0),b=texture2D(u29,vv0),c=texture2D(u1,vv0),d=max(f*g,b-a*a),h=sqrt(d);gl_FragColor=(c-a)/h;}", -c:["u1","u28","u29"],f:{u1:0,u28:1,u29:2}}},C={s38:{a:"uniform float u16,u30;uniform sampler2D u13,u14,u21;varying vec2 vv0;const vec2 ZERO2=vec2(0.,0.),ONE2=vec2(1.,1.),HALF2=vec2(.5,.5),EPS2=vec2(1e-5,1e-5);void main(){vec4 sum=texture2D(u21,vv0);float toSparsity=1.1111;vec2 uvFrom,uvWeight,xyPatch=ZERO2,eps2=EPS2/u16,xyTo=floor(vv0*u16+eps2);float weightSize=toSparsity*u16;vec2 halfFromSparsity=ONE2*(toSparsity-1.)/2.;for(float patch_x=0.;patch_x<1.1111;patch_x+=1.){xyPatch.x=patch_x;for(float patch_y=0.;patch_y<1.1111;patch_y+=1.)xyPatch.y=patch_y,uvFrom=(xyTo+HALF2+u30*(xyPatch-halfFromSparsity))/u16,uvFrom+=step(uvFrom,-eps2),uvFrom-=step(ONE2-eps2,uvFrom),uvWeight=(xyTo*toSparsity+xyPatch+HALF2)/weightSize,sum+=texture2D(u13,uvWeight)*texture2D(u14,uvFrom);}gl_FragColor=sum,gl_FragColor*=2.2222;}", -c:["u16","u13","u14","u21","u30"],Ta:["1.1111","gl_FragColor\\*=2.2222;"]},s39:{a:"uniform float u16,u30,u24;uniform sampler2D u13,u14,u21;varying vec2 vv0;const vec2 ZERO2=vec2(0.,0.),ONE2=vec2(1.,1.),HALF2=vec2(.5,.5),EPS2=vec2(1e-4,1e-4);void main(){vec4 sum=texture2D(u21,vv0);float fromSparsity=1.1111,shrinkFactor=3.3333;vec2 uvFrom,uvWeight,xyFrom,xyPatchTo,xyPatch=ZERO2,xyShrink=ZERO2,eps2=EPS2/u24,xyTo=floor(vv0*u16+eps2);float weightSize=fromSparsity*u24;vec2 halfFromSparsity=ONE2*(fromSparsity-1.)/2.;float toSparsity=weightSize/u16;vec2 xyFrom0=xyTo*shrinkFactor;for(float patch_x=0.;patch_x<1.1111;patch_x+=1.){xyPatch.x=patch_x;for(float patch_y=0.;patch_y<1.1111;patch_y+=1.){xyPatch.y=patch_y;for(float shrink_x=0.;shrink_x<3.3333;shrink_x+=1.){xyShrink.x=shrink_x;for(float shrink_y=0.;shrink_y<3.3333;shrink_y+=1.)xyShrink.y=shrink_y,xyFrom=xyFrom0+xyShrink+shrinkFactor*u30*(xyPatch-halfFromSparsity),uvFrom=(xyFrom+HALF2)/u24,uvFrom+=step(uvFrom,-eps2),uvFrom-=step(ONE2-eps2,uvFrom),xyPatchTo=xyPatch*shrinkFactor+xyShrink,uvWeight=(xyTo*toSparsity+xyPatchTo+HALF2)/weightSize,sum+=texture2D(u13,uvWeight)*texture2D(u14,uvFrom);}}}gl_FragColor=sum,gl_FragColor*=2.2222;}", -c:"u16 u24 u13 u14 u21 u30".split(" "),Ta:["1.1111","gl_FragColor\\*=2.2222;","3.3333"]}},G={La:function(){return q},o:function(){if(!q){x="highp";for(var g in F)d(F[g],g);u.set("s0");b.enableVertexAttribArray(0);q=!0;return Wa.o()}},Fc:function(g){g.forEach(function(w){G.Eb(w)})},Eb:function(g){F[g.id]=g;d(g,g.id)},ac:function(g,w,A){w||(w=g);F[w]=Object.create(C[g]);F[w].wd=!0;C[g].Ta&&C[g].Ta.forEach(function(Z,na){F[w].a=F[w].a.replace(new RegExp(Z,"g"),A[na])});d(F[w],w)},set:function(g){e(F[g])}, -hd:function(g){return"undefined"===typeof F[g]?!1:F[g].kb},la:function(){-1!==k&&(k=-1,l.oa.forEach(function(g){0!==g&&b.disableVertexAttribArray(g)}))},zb:function(){var g=0;l.oa.forEach(function(w,A){A=l.na[A];b.vertexAttribPointer(w,A,b.FLOAT,!1,l.Bb,g);g+=4*A})},Pb:function(){b.enableVertexAttribArray(0)},za:function(){b.vertexAttribPointer(l.oa[0],2,b.FLOAT,!1,8,0)},vc:function(g,w){b.uniform1i(l.j[g],w)},A:function(g,w){b.uniform1f(l.j[g],w)},ya:function(g,w,A){b.uniform2f(l.j[g],w,A)},yf:function(g, -w){b.uniform2fv(l.j[g],w)},zf:function(g,w){b.uniform3fv(l.j[g],w)},Td:function(g,w,A,Z){b.uniform3f(l.j[g],w,A,Z)},Af:function(g,w,A,Z,na){b.uniform4f(l.j[g],w,A,Z,na)},yb:function(g,w){b.uniform4fv(l.j[g],w)},Bf:function(g,w){b.uniformMatrix2fv(l.j[g],!1,w)},Cf:function(g,w){b.uniformMatrix3fv(l.j[g],!1,w)},Df:function(g,w){b.uniformMatrix4fv(l.j[g],!1,w)},K:function(g,w){G.set(g);w.forEach(function(A){switch(A.type){case "4f":b.uniform4fv(l.j[A.name],A.value);break;case "3f":b.uniform3fv(l.j[A.name], -A.value);break;case "2f":b.uniform2fv(l.j[A.name],A.value);break;case "1f":b.uniform1f(l.j[A.name],A.value);break;case "1i":b.uniform1i(l.j[A.name],A.value);break;case "mat2":b.uniformMatrix2fv(l.j[A.name],!1,A.value);break;case "mat3":b.uniformMatrix3fv(l.j[A.name],!1,A.value);break;case "mat4":b.uniformMatrix4fv(l.j[A.name],!1,A.value)}})},We:function(){return"lowp"},h:function(){b.disableVertexAttribArray(0);G.la();for(var g in F){var w=F[g];w.kb&&(w.kb=!1,b.deleteProgram(w.wa));w.wd&&delete F[g]}f.forEach(function(A){b.deleteShader(A)}); -f.splice(0);n=0;q=!1}};return G}(),b=null,Aa=function(){function a(m){console.log("ERROR in ContextFeedForward: ",m);return!1}function c(){if(navigator.userAgent&&-1!==navigator.userAgent.indexOf("forceWebGL1")||/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream)return!0;if(/(Mac)/i.test(navigator.platform)){var m;(m=navigator.userAgent)?(m=m.match(/Mac OS X (\d+)_(\d+)/)||m.match(/Mac OS X (\d+).(\d+)/),m=!m||3>m.length?!1:[parseInt(m[1],10),parseInt(m[2],10)]):m=!1;if(m&&10===m[0]&& -15===m[1])return!0}return!1}var d=null,e=null,f=null,k=null,l=!0,n=null,q=null,x={B:function(){return d.width},O:function(){return d.height},Ne:function(){return d},Me:function(){return b},F:function(){return l},flush:function(){b.flush()},nd:function(){n||(n=new Uint8Array(d.width*d.height*4));b.readPixels(0,0,d.width,d.height,b.RGBA,b.UNSIGNED_BYTE,n);return n},Pe:function(){return d.toDataURL("image/jpeg")},Qe:function(){ta.H();e||(e=document.createElement("canvas"),f=e.getContext("2d"));e.width= -d.width;e.height=d.height;for(var m=x.nd(),p=f.createImageData(e.width,e.height),y=e.width,z=e.height,O=p.data,N=0;Nq.da.length?(F=Uint16Array,O=b.UNSIGNED_SHORT,N=2):(F=Uint32Array,O=b.UNSIGNED_INT,N=4);b.bufferData(b.ELEMENT_ARRAY_BUFFER,q.da instanceof F?q.da:new F(q.da),p);f=x}var C={Oc:function(G){e!== -x&&(b.bindBuffer(b.ARRAY_BUFFER,y),e=x);G&&Ia.zb()},Lc:function(){f!==x&&(b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,z),f=x)},bind:function(G){C.Oc(G);C.Lc()},ue:function(){b.drawElements(b.TRIANGLES,m,O,0)},ve:function(G,g){b.drawElements(b.TRIANGLES,G,O,g*N)},remove:function(){b.deleteBuffer(y);q.da&&b.deleteBuffer(z);C=null}};l.push(C);return C},pa:function(){-1!==e&&(b.bindBuffer(b.ARRAY_BUFFER,a),e=-1);-1!==f&&(b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,c),f=-1)},g:function(q,x){q&&ka.pa();x&&Ia.za();b.drawElements(b.TRIANGLES, -3,b.UNSIGNED_SHORT,0)},Vb:function(){b.deleteBuffer(a);b.deleteBuffer(c)},h:function(){n.Vb();l.forEach(function(q){q.remove()});b.bindBuffer(b.ARRAY_BUFFER,null);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,null);n.reset();k=!1;l.splice(0);d=0}};return n}(),Y=function(){var a=null,c=null,d=null,e=!1,f=[],k={v:-2,Sb:1},l={La:function(){return e},o:function(){if(!e){a=b.createFramebuffer();var n=aa.F();c=n&&b.DRAW_FRAMEBUFFER?b.DRAW_FRAMEBUFFER:b.FRAMEBUFFER;d=n&&b.READ_FRAMEBUFFER?b.READ_FRAMEBUFFER:b.FRAMEBUFFER; -e=!0}},Se:function(){return c},gb:function(){return d},ca:function(){return b.FRAMEBUFFER},Ze:function(){return k},Le:function(){return a},instance:function(n){void 0===n.cc&&(n.cc=!1);var q=n.X?n.X:null,x=n.width,m=void 0!==n.height?n.height:n.width,p=a,y=null,z=!1,O=!1,N=0;q&&(x=x?x:q.B(),m=m?m:q.O());var F={uc:function(){z||(p=b.createFramebuffer(),z=!0,N=k.Sb++)},Ec:function(){F.uc();F.l();y=b.createRenderbuffer();b.bindRenderbuffer(b.RENDERBUFFER,y);b.renderbufferStorage(b.RENDERBUFFER,b.DEPTH_COMPONENT16, -x,m);b.framebufferRenderbuffer(c,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,y);b.clearDepth(1)},bind:function(C,G){N!==k.v&&(b.bindFramebuffer(c,p),k.v=N);q&&q.l();G&&b.viewport(0,0,x,m);C&&b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)},ge:function(){N!==k.v&&(b.bindFramebuffer(c,p),k.v=N)},clear:function(){b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)},oe:function(){b.clear(b.COLOR_BUFFER_BIT)},pe:function(){b.clear(b.DEPTH_BUFFER_BIT)},Ud:function(){b.viewport(0,0,x,m)},l:function(){N!==k.v&&(b.bindFramebuffer(c, -p),k.v=N)},rtt:function(C){q=C;k.v!==N&&(b.bindFramebuffer(b.FRAMEBUFFER,p),k.v=N);C.l()},H:function(){b.bindFramebuffer(c,null);k.v=-1},resize:function(C,G){x=C;m=G;y&&(b.bindRenderbuffer(b.RENDERBUFFER,y),b.renderbufferStorage(b.RENDERBUFFER,b.DEPTH_COMPONENT16,x,m))},remove:function(){p===a||O||(b.bindFramebuffer(c,p),b.framebufferTexture2D(c,b.COLOR_ATTACHMENT0,b.TEXTURE_2D,null,0),y&&b.framebufferRenderbuffer(c,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,null),b.bindFramebuffer(c,null),b.deleteFramebuffer(p), -y&&b.deleteRenderbuffer(y));O=!0}};n.cc&&F.Ec();f.push(F);return F},H:function(){b.bindFramebuffer(c,null);k.v=-1},$d:function(){b.bindFramebuffer(c,null);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);b.viewport(0,0,aa.B(),aa.O());k.v=-1},reset:function(){k.v=-2},V:function(){0!==k.v&&(b.bindFramebuffer(c,a),k.v=0)},clear:function(){b.viewport(0,0,aa.B(),aa.O());b.clear(b.COLOR_BUFFER_BIT)},h:function(){l.H();f.forEach(function(n){n.remove()});b.deleteFramebuffer(a);l.reset();e=!1;f.splice(0);k.v= --2;k.Sb=1}};return l}(),Ca=function(){function a(r){b.bindTexture(b.TEXTURE_2D,r)}function c(r){la[0]=r;r=ca[0];var D=r>>16&32768,h=r>>12&2047,J=r>>23&255;return 103>J?D:142J?(h|=2048,D|(h>>114-J)+(h>>113-J&1)):D=(D|J-112<<10|h>>1)+(h&1)}function d(r){var D=new Uint16Array(r.length);r.forEach(function(h,J){D[J]=c(h)});return D}function e(){if(null!==oa.ib)return oa.ib;var r=k(d([1,1,1,1]));return null===r?!0:oa.ib=r}function f(){if(null!==oa.jb)return oa.jb; -var r=k(new Uint8Array([255,255,255,255]));return null===r?!0:oa.jb=r}function k(r){if(!Ia.La()||!N)return null;var D=null;try{var h=b.getError();D=B.instance({isFloat:!1,I:!0,array:r,width:1});h=b.getError();if(h!==b.NO_ERROR)return!1}catch(J){return!1}Y.H();b.viewport(0,0,1,1);b.clearColor(0,0,0,0);b.clear(b.COLOR_BUFFER_BIT);Ia.set("s0");D.Gb(0);ka.g(!1,!0);r=new Uint8Array(4);b.readPixels(0,0,1,1,b.RGBA,b.UNSIGNED_BYTE,r);r=.9D;++D)r[D]=2*Math.random()-1;m={random:B.instance({isFloat:!0,isPot:!0,array:r,width:64}),Ac:B.instance({isFloat:!1,isPot:!0,width:1,array:new Uint8Array([0,0,0,0])})}}N=!0}},td:function(){B.be()},cf:function(){return m.Ac}, -be:function(){y[1]=aa.Ja()},Od:function(){O=z=[b.RGBA,b.RGBA,b.RGBA,b.RGBA]},rf:function(r,D){u.set("s1");Y.H();var h=r.B(),J=r.O();b.viewport(0,0,h,J);r.b(0);ka.g(!1,!1);b.readPixels(0,0,h,J,b.RGBA,b.UNSIGNED_BYTE,D)},Tb:function(r,D,h,J,qa){b.activeTexture(b.TEXTURE0);var va=b.createTexture();a(va);var ra=aa.F()&&b.RGBA32F?b.RGBA32F:b.FLOAT;J=J instanceof Float32Array?J:new Float32Array(J);0!==pa.Ad(J.length)%1&&(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D, -b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE));b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,qa);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,D,h,0,b.RGBA,ra,J);a(null);b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1);Y.V();u.set("s0");b.viewport(0,0,D,h);b.framebufferTexture2D(Y.ca(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,r,0);b.clearColor(0,0,0,0);b.clear(b.COLOR_BUFFER_BIT);a(va);ka.g(!0,!1);b.deleteTexture(va);x[0]=-1; -p=null;l=0},instance:function(r){function D(){a(sa);wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,wa);h.isPot?(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,h.isMirrorX?b.MIRRORED_REPEAT:b.REPEAT),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,h.isMirrorY?b.MIRRORED_REPEAT:b.REPEAT)):(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE));h.isAnisotropicFiltering&&"undefined"!==typeof JESETTINGS&&b.texParameterf(b.TEXTURE_2D,JEContext.Re().TEXTURE_MAX_ANISOTROPY_EXT, -JESETTINGS.ee);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,h.isLinear?b.LINEAR:b.NEAREST);h.isLinear?b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,h.isMipmap&&!Ja?b.NEAREST_MIPMAP_LINEAR:b.LINEAR):b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,h.isMipmap&&!Ja?b.NEAREST_MIPMAP_NEAREST:b.NEAREST);fa=z[h.Oa-1];ia=O[h.Oa-1];ja=y[qa];if(aa.F()){var v=b.RGBA32F;fa===b.RGBA&&ja===b.FLOAT&&v&&(ia=v);fa===b.RGB&&ja===b.FLOAT&&v&&(ia=v,fa=b.RGBA)}if(h.I&&!h.isFloat||h.isFloat&&h.isMipmap&&Wa.zd())(v= -b.RGBA16F)&&(ia=v),ja=aa.Ja();h.ob&&(fb=h.ob);h.isSrgb&&4===h.Oa&&(fa=JEContext.af());if(h.D)b.texImage2D(b.TEXTURE_2D,0,ia,fa,ja,h.D);else if(h.url)b.texImage2D(b.TEXTURE_2D,0,ia,fa,ja,Fa);else if(xa){try{b.getError(),b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,xa),b.getError()!==b.NO_ERROR&&(b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,null),b.getError()!==b.NO_ERROR&&b.texImage2D(b.TEXTURE_2D,0,b.RGBA,K,L,0,b.RGBA,b.UNSIGNED_BYTE,null))}catch(ic){b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,null)}h.isKeepArray|| -(xa=null)}else b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,null);if(h.isMipmap)if(!Ja&&X)X.fb(),gb=!0;else if(Ja){v=Math.log(Math.min(K,L))/Math.log(2);Ta=Array(1+v);Ta[0]=sa;for(var M=1;M<=v;++M){var da=Math.pow(2,M),P=K/da;da=L/da;var Ka=b.createTexture();a(Ka);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texImage2D(b.TEXTURE_2D,0,ia,P,da,0,fa,ja,null);a(null);Ta[M]=Ka}gb=!0}a(null);x[l]=-1;wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL, -!1);hb=!0;h.aa&&X&&(h.aa(X),h.aa=null)}var h=Object.assign({},C,r),J=q++;null===h.isFlipY&&(h.isFlipY=h.url||h.array?!0:!1);h.data&&(h.array="string"===typeof h.data?Pb(h.data):h.isFloat?new Float32Array(h.data):new Uint8Array(h.data),h.isFlipY=!1);var qa=0,va=h.D?!0:!1,ra=null,Ua=null,Kb=!1,zb=null;h.I=h.I||h.isFloat;h.I&&(qa=1);h.vd||aa.F()||!h.isFloat||!na||aa.Ib()||(h.isFloat=!1);h.isFloat&&(qa=2);h.isAnisotropicFiltering&&Z&&!JEContext.ef()&&(h.isAnisotropicFiltering=!1);var sa=b.createTexture(), -Fa=null,xa=!1,K=0,L=0,hb=!1,ib=!1,ya=null,Ba=null,Ab=null,Xa=null,ia=null,fa=null,ja=null,wa=h.isFlipY,Ja=h.I&&h.isMipmap&&"undefined"!==typeof Wa&&!Wa.Rc()?!0:!1,Ta=null,fb=-1,gb=!1,La={fc:!1,Hb:null,Ub:null};h.width&&(K=h.width,L=h.height?h.height:K);var X={get:function(){return sa},B:function(){return K},O:function(){return L},df:function(){return h.url},ff:function(){return h.isFloat},hf:function(){return h.I},jf:function(){return h.isLinear},fb:function(){b.generateMipmap(b.TEXTURE_2D)},Nc:function(v, -M){Ja?(v||(v=X.Yb()),X.Ua(M),a(Ta[v]),x[M]=-1):X.b(M)},Yb:function(){-1===fb&&(fb=Math.log(K)/Math.log(2));return fb},kd:function(v){if(Ja){v||(v=X.Yb());u.set("s11");X.Ua(0);for(var M=K,da=L,P=1;P<=v;++P)M/=2,da/=2,u.ya("u7",.25/M,.25/da),b.viewport(0,0,M,da),a(Ta[P-1]),b.framebufferTexture2D(Y.ca(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,Ta[P],0),ka.g(!1,1===P);x[0]=-1}else X.fb()},Ua:function(v){v!==l&&(b.activeTexture(n[v]),l=v)},b:function(v){if(!hb)return!1;X.Ua(v);if(x[v]===J)return!1;a(sa);x[v]= -J;return!0},Gb:function(v){b.activeTexture(n[v]);l=v;a(sa);x[v]=J},l:function(){p=X;b.framebufferTexture2D(Y.ca(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,sa,0)},M:function(){p=X;b.viewport(0,0,K,L);b.framebufferTexture2D(Y.ca(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,sa,0)},Ab:B.Ab,resize:function(v,M){K=v;L=M;D()},clone:function(v){v=B.instance({width:K,height:L,I:h.I,isFloat:h.isFloat,isLinear:h.isLinear,isMirrorY:h.isMirrorY,isFlipY:v?!wa:wa,isPot:h.isPot});Ia.set("s0");Y.V();v.l();b.viewport(0,0,K,L);X.b(0); -ka.g(!0,!0);return v},Ud:function(){b.viewport(0,0,K,L)},remove:function(){b.deleteTexture(sa);F.splice(F.indexOf(X),1);X=null},refresh:function(){X.Gb(0);wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);va?b.texImage2D(b.TEXTURE_2D,0,ia,fa,b.UNSIGNED_BYTE,h.D):b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,xa);wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},Mb:function(){var v=K*L*4;Ba=[new Uint8Array(v),new Uint8Array(v),new Uint8Array(v),new Uint8Array(v)];ya=[new Float32Array(Ba[0].buffer),new Float32Array(Ba[1].buffer), -new Float32Array(Ba[2].buffer),new Float32Array(Ba[3].buffer)];Ab=new Uint8Array(4*v);Xa=new Float32Array(Ab.buffer);ib=!0},tc:function(){ib||X.Mb();b.readPixels(0,0,K,4*L,b.RGBA,b.UNSIGNED_BYTE,Ab);for(var v=K*L,M=2*v,da=3*v,P=0;Pv;++v)b.viewport(0,L*v,K,L),u.yb("u8",A[v]),ka.g(!1,0===v)},ae:function(v){var M=ja===y[0]&&!f();a(sa);wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);M?(Kb||(ra=document.createElement("canvas"),ra.width=K,ra.height=L,Ua=ra.getContext("2d"),zb=Ua.createImageData(K,L),Kb=!0),zb.data.set(v),Ua.putImageData(zb,0,0),b.texImage2D(b.TEXTURE_2D,0,ia,fa,ja,ra)):b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,v);x[l]=J;wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL, -!1)},Gf:function(v,M){a(sa);M&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);b.texImage2D(b.TEXTURE_2D,0,ia,fa,ja,v);x[l]=J;M&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},wf:function(v,M){var da=K*L,P=4*da;v=h.I?v?"RGBE":"JSON":"RGBA";M&&(v=M);M=aa.F()&&!1;var Ka=null;switch(v){case "RGBE":Ka="s40";break;case "JSON":Ka=M?"s0":"s12";break;case "RGBA":case "RGBAARRAY":Ka="s6"}ib||("RGBA"===v||"RGBE"===v||"RGBAARRAY"===v?(Ba=new Uint8Array(P),ib=!0):"JSON"!==v||M||X.Mb());Y.H();u.set(Ka);X.b(0);P=null;if("RGBA"=== -v||"RGBE"===v||"RGBAARRAY"===v){b.viewport(0,0,K,L);ka.g(!0,!0);b.readPixels(0,0,K,L,b.RGBA,b.UNSIGNED_BYTE,Ba);if("RGBAARRAY"===v)return{data:Ba};G||(g=document.createElement("canvas"),w=g.getContext("2d"),G=!0);g.width=K;g.height=L;da=w.createImageData(K,L);da.data.set(Ba);w.putImageData(da,0,0);P=g.toDataURL("image/png")}else if("JSON"===v)if(M)P=new Float32Array(da),b.viewport(0,0,K,L),ka.g(!0,!0),b.readPixels(0,0,K,L,b.RGBA,b.FLOAT,P);else{for(P=0;4>P;++P)b.viewport(0,L*P,K,L),u.yb("u8",A[P]), -ka.g(!P,!P);X.tc();P=Array(da);for(M=0;Mla&&(la+=c);la>=c&&(la-=c);for(var ca=0;car&&(r+=c);r>=c&&(r-=c);var D=la/c,h=r/c;B=1-B-1/f;D+=N;h+=N;oa+=F;B+=F;var J=C*e+na,qa= -g*e+ca;qa=d*e-qa-1;J=qa*d*e+J;m[4*J]=oa;m[4*J+1]=B;m[4*J+2]=D;m[4*J+3]=h;h=y[r*c+la]++;J=h%k;D=la*k+J;r=r*k+(h-J)/k;r=c*k-1-r;r=r*c*k+D;p[4*r]=oa;p[4*r+1]=B;p[4*r+2]=A;p[4*r+3]=Z;++n>=f&&(n=0,++q);++x}}}y=null;var va=S.instance(a.weights);delete a.weights.data;var ra=S.instance({width:f,isFloat:!0,array:new Float32Array(p),isPot:!0});p=null;var Ua=S.instance({width:f,isFloat:!0,array:new Float32Array(m),isPot:!0});m=null;return{ka:!0,Ia:function(){return k},h:function(){ra.remove();Ua.remove();va.remove()}, -J:function(){u.set("s22");va.b(1);Ua.b(2);R.g(!1,!1)}}}}}(),ec=function(){return{instance:function(a){var c=a.kernelsNumber,d=a.toSparsity,e=d*a.toLayerSize/a.fromLayerSize,f=S.instance(a.weights);delete a.weights.data;return{ka:!0,Ia:function(){return e},bf:function(){return d},sd:function(){return f},h:function(){f.remove()},J:function(){u.set("s25");u.A("u22",c);u.A("u23",d);u.A("u16",a.toLayerSize);u.A("u24",a.fromLayerSize);f.b(1);R.g(!1,!1)}}}}}(),cc=function(){return{instance:function(a,c){var d= -a.fromLayerSize,e=a.toLayerSize,f=a.toSparsity,k=a.stride?a.stride:1,l=f*e/d,n=e>16&32768,J=l>>12&2047,m=l>>23&255;return 103>m?M:142m?(J|=2048,M|(J>>114-m)+(J>>113-m&1)):M=(M|m-112<<10|J>>1)+(J&1)}function d(l){var M=new Uint16Array(l.length);l.forEach(function(J,m){M[m]=c(J)});return M}function e(){if(null!==pa.qb)return pa.qb;var l=n(d([1,1,1,1]));return null===l?!0:pa.qb=l}function f(){if(null!==pa.rb)return pa.rb;var l=n(new Uint8Array([255,255,255,255]));return null===l?!0:pa.rb=l}function n(l){if(!wa.Qa()|| +!H)return null;var M=null;try{var J=b.getError();if("FUCKING_BIG_ERROR"===J)return!1;M=E.instance({isFloat:!1,H:!0,array:l,width:1});J=b.getError();if(J!==b.NO_ERROR)return!1}catch(m){return!1}la.I();b.viewport(0,0,1,1);b.clearColor(0,0,0,0);b.clear(b.COLOR_BUFFER_BIT);wa.set("s0");M.Pb(0);ma.g(!0,!0);l=new Uint8Array(4);b.readPixels(0,0,1,1,b.RGBA,b.UNSIGNED_BYTE,l);l=.9M;++M)l[M]=2*Math.random()-1;B={random:E.instance({isFloat:!0,isPot:!0,array:l,width:64}),Rc:E.instance({isFloat:!1,isPot:!0,width:1,array:new Uint8Array([0,0,0,0])})}}H=!0}},Gd:function(){E.pe()},tf:function(){return B.Rc},pe:function(){A[1]=ea.ob(b)},ae:function(){I=k=[b.RGBA, +b.RGBA,b.RGBA,b.RGBA]},Ff:function(l,M){y.set("s1");la.I();var J=l.A(),m=l.P();b.viewport(0,0,J,m);l.b(0);ma.g(!1,!1);b.readPixels(0,0,J,m,b.RGBA,b.UNSIGNED_BYTE,M)},jc:function(l,M,J,m,fa,ua,Ca){l.activeTexture(l.TEXTURE0);var ra=l.createTexture();l.bindTexture(l.TEXTURE_2D,ra);fa=fa instanceof Float32Array?fa:new Float32Array(fa);0!==qa.Nd(fa.length)%1&&(l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE));l.texParameteri(l.TEXTURE_2D, +l.TEXTURE_MAG_FILTER,l.NEAREST);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,ua);l.texImage2D(l.TEXTURE_2D,0,l.RGBA,J,m,0,l.RGBA,l.FLOAT,fa);l.bindTexture(l.TEXTURE_2D,null);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,!1);Ca&&(la.X(),y.set("s0"));l.viewport(0,0,J,m);l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,M,0);l.bindTexture(l.TEXTURE_2D,ra);Ca?ma.g(!0,!0):U.Ma(l);l.deleteTexture(ra);H&&(w[0]=-1,h=null,t=0)},instance:function(l){function M(z){if("FUCKING_BIG_ERROR"=== +b.getError())return!1;b.texImage2D(b.TEXTURE_2D,0,ha,ca,ia,z);b.getError()!==b.NO_ERROR&&ca!==b.RGBA&&(ca=b.RGBA,b.texImage2D(b.TEXTURE_2D,0,ha,ca,ia,z));return!0}function J(){a(sa);xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,xa);m.isPot?(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,m.isMirrorX?b.MIRRORED_REPEAT:b.REPEAT),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,m.isMirrorY?b.MIRRORED_REPEAT:b.REPEAT)):(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D, +b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE));m.isAnisotropicFiltering&&"undefined"!==typeof JESETTINGS&&b.texParameterf(b.TEXTURE_2D,JEContext.ef().TEXTURE_MAX_ANISOTROPY_EXT,JESETTINGS.se);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,m.isLinear?b.LINEAR:b.NEAREST);m.isLinear?b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,m.isMipmap&&!Ka?b.NEAREST_MIPMAP_LINEAR:b.LINEAR):b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,m.isMipmap&&!Ka?b.NEAREST_MIPMAP_NEAREST:b.NEAREST);ca=k[m.Ta-1];ha=I[m.Ta-1];ia= +A[ua];if(ea.Z()){var z=b.RGBA32F;ca===b.RGBA&&ia===b.FLOAT?m.isMipmap||m.isLinear?ha=Ba.zd(b):ea.Sb()?z&&(ha=z):ha=b.RGBA16F||b.RGBA:ca===b.RGB&&ia===b.FLOAT&&z&&(ha=z,ca=b.RGBA)}if(m.H&&!m.isFloat||m.isFloat&&m.isMipmap&&Ba.Md())(z=b.RGBA16F)&&(ha=z),ia=ea.ob(b);m.wb&&(fb=m.wb);m.isSrgb&&4===m.Ta&&(ca=JEContext.rf());if(m.D)M(m.D);else if(m.url)M(Ga);else if(ya){z=ya;try{"FUCKING_BIG_ERROR"!==b.getError()&&(b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,z),b.getError()!==b.NO_ERROR&&(b.texImage2D(b.TEXTURE_2D, +0,ha,P,Q,0,ca,ia,null),b.getError()!==b.NO_ERROR&&b.texImage2D(b.TEXTURE_2D,0,b.RGBA,P,Q,0,b.RGBA,b.UNSIGNED_BYTE,null)))}catch(jc){b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,null)}m.isKeepArray||(ya=null)}else"FUCKING_BIG_ERROR"!==b.getError()&&(b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,null),b.getError()!==b.NO_ERROR&&(ca=b.RGBA,m.H&&ia!==b.FLOAT&&(ia=b.FLOAT,b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,null))));if(m.isMipmap)if(!Ka&&aa)aa.nb(),gb=!0;else if(Ka){z=Math.log2(Math.min(P,Q));Va=Array(1+ +z);Va[0]=sa;for(var R=1;R<=z;++R){var ja=Math.pow(2,R),S=P/ja;ja=Q/ja;var La=b.createTexture();a(La);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texImage2D(b.TEXTURE_2D,0,ha,S,ja,0,ca,ia,null);a(null);Va[R]=La}gb=!0}a(null);w[t]=-1;xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1);hb=!0;m.da&&aa&&(m.da(aa),m.da=null)}var m=Object.assign({},r,l),fa=g++;null===m.isFlipY&&(m.isFlipY=m.url||m.array?!0:!1);m.data&&(m.array="string"=== +typeof m.data?Qb(m.data):m.isFloat?new Float32Array(m.data):new Uint8Array(m.data),m.isFlipY=!1);var ua=0,Ca=m.D?!0:!1,ra=null,zb=null,Lb=!1,Ab=null;m.H=m.H||m.isFloat;m.H&&(ua=1);m.Id||ea.Z()||!m.isFloat||!D||ea.Sb()||(m.isFloat=!1);m.isFloat&&(ua=2);m.isAnisotropicFiltering&&p&&!JEContext.vf()&&(m.isAnisotropicFiltering=!1);var sa=b.createTexture(),Ga=null,ya=!1,P=0,Q=0,hb=!1,ib=!1,za=null,Da=null,Bb=null,Xa=null,ha=null,ca=null,ia=null,xa=m.isFlipY;l="undefined"!==typeof Ba&&Ba.ed();var Ka=m.H&& +m.isMipmap&&l?!0:!1,Va=null,fb=-1,gb=!1,Ma={wc:!1,Qb:null,kc:null};m.width&&(P=m.width,Q=m.height?m.height:P);var aa={get:function(){return sa},A:function(){return P},P:function(){return Q},uf:function(){return m.url},wf:function(){return m.isFloat},yf:function(){return m.H},zf:function(){return m.isLinear},nb:function(){b.generateMipmap(b.TEXTURE_2D)},cd:function(z,R){Ka?(z||(z=aa.oc()),aa.bb(R),a(Va[z]),w[R]=-1):aa.b(R)},oc:function(){-1===fb&&(fb=Math.log(P)/Math.log(2));return fb},vd:function(z){if(Ka){z|| +(z=aa.oc());y.set("s11");aa.bb(0);for(var R=P,ja=Q,S=1;S<=z;++S)R/=2,ja/=2,y.Aa("u7",.25/R,.25/ja),b.viewport(0,0,R,ja),a(Va[S-1]),b.framebufferTexture2D(la.Oa(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,Va[S],0),ma.g(!1,1===S);w[0]=-1}else aa.nb()},bb:function(z){z!==t&&(b.activeTexture(q[z]),t=z)},b:function(z){if(!hb)return!1;aa.bb(z);if(w[z]===fa)return!1;a(sa);w[z]=fa;return!0},Pb:function(z){b.activeTexture(q[z]);t=z;a(sa);w[z]=fa},l:function(){h=aa;b.framebufferTexture2D(la.Oa(),b.COLOR_ATTACHMENT0, +b.TEXTURE_2D,sa,0)},N:function(){h=aa;b.viewport(0,0,P,Q);b.framebufferTexture2D(la.Oa(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,sa,0)},Jb:E.Jb,resize:function(z,R){P=z;Q=R;J()},clone:function(z){z=E.instance({width:P,height:Q,H:m.H,isFloat:m.isFloat,isLinear:m.isLinear,isMirrorY:m.isMirrorY,isFlipY:z?!xa:xa,isPot:m.isPot});wa.set("s0");la.X();z.l();b.viewport(0,0,P,Q);aa.b(0);ma.g(!0,!0);return z},ge:function(){b.viewport(0,0,P,Q)},remove:function(){b.deleteTexture(sa);C.splice(C.indexOf(aa),1);aa=null}, +refresh:function(){aa.Pb(0);xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);Ca?b.texImage2D(b.TEXTURE_2D,0,ha,ca,b.UNSIGNED_BYTE,m.D):b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,ya);xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},Wb:function(){var z=P*Q*4;Da=[new Uint8Array(z),new Uint8Array(z),new Uint8Array(z),new Uint8Array(z)];za=[new Float32Array(Da[0].buffer),new Float32Array(Da[1].buffer),new Float32Array(Da[2].buffer),new Float32Array(Da[3].buffer)];Bb=new Uint8Array(4*z);Xa=new Float32Array(Bb.buffer); +ib=!0},Kc:function(){ib||aa.Wb();b.readPixels(0,0,P,4*Q,b.RGBA,b.UNSIGNED_BYTE,Bb);for(var z=P*Q,R=2*z,ja=3*z,S=0;Sz;++z)b.viewport(0,Q* +z,P,Q),y.Hb("u8",u[z]),ma.g(!1,0===z)},oe:function(z){var R=ia===A[0]&&!f();a(sa);xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);R?(Lb||(ra=document.createElement("canvas"),ra.width=P,ra.height=Q,zb=ra.getContext("2d"),Ab=zb.createImageData(P,Q),Lb=!0),Ab.data.set(z),zb.putImageData(Ab,0,0),b.texImage2D(b.TEXTURE_2D,0,ha,ca,ia,ra)):b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,z);w[t]=fa;xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},Uf:function(z,R){a(sa);R&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);b.texImage2D(b.TEXTURE_2D, +0,ha,ca,ia,z);w[t]=fa;R&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},Kf:function(z,R){var ja=P*Q,S=4*ja;z=m.H?z?"RGBE":"JSON":"RGBA";R&&(z=R);R=ea.Z()&&!1;var La=null;switch(z){case "RGBE":La="s42";break;case "JSON":La=R?"s0":"s12";break;case "RGBA":case "RGBAARRAY":La="s6"}ib||("RGBA"===z||"RGBE"===z||"RGBAARRAY"===z?(Da=new Uint8Array(S),ib=!0):"JSON"!==z||R||aa.Wb());la.I();y.set(La);aa.b(0);S=null;if("RGBA"===z||"RGBE"===z||"RGBAARRAY"===z){b.viewport(0,0,P,Q);ma.g(!0,!0);b.readPixels(0,0,P,Q,b.RGBA, +b.UNSIGNED_BYTE,Da);if("RGBAARRAY"===z)return{data:Da};v||(F=document.createElement("canvas"),L=F.getContext("2d"),v=!0);F.width=P;F.height=Q;ja=L.createImageData(P,Q);ja.data.set(Da);L.putImageData(ja,0,0);S=F.toDataURL("image/png")}else if("JSON"===z)if(R)S=new Float32Array(ja),b.viewport(0,0,P,Q),ma.g(!0,!0),b.readPixels(0,0,P,Q,b.RGBA,b.FLOAT,S);else{for(S=0;4>S;++S)b.viewport(0,Q*S,P,Q),y.Hb("u8",u[S]),ma.g(!S,!S);aa.Kc();S=Array(ja);for(R=0;Rg.B.length?(C=Uint16Array,I=b.UNSIGNED_SHORT,H=2):(C=Uint32Array,I=b.UNSIGNED_INT,H=4);C=g.B instanceof C?g.B:new C(g.B);b.bufferData(b.ELEMENT_ARRAY_BUFFER,C,h);t=w}var r={dd:function(v){n!==w&&(b.bindBuffer(b.ARRAY_BUFFER,A),n=w);v&&wa.Ib()},ad:function(){t!==w&&(b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, +k),t=w)},bind:function(v){r.dd(v);r.ad()},Ie:function(){b.drawElements(b.TRIANGLES,B,I,0)},Je:function(v,F){b.drawElements(b.TRIANGLES,v,I,F*H)},remove:function(){b.deleteBuffer(A);g.B&&b.deleteBuffer(k);r=null}};f.push(r);return r},Ha:function(){-1!==n&&(b.bindBuffer(b.ARRAY_BUFFER,c.W),n=-1);-1!==t&&(b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,c.B),t=-1)},g:function(g,w){g&&ma.Ha();w&&wa.Ba();b.drawElements(b.TRIANGLES,3,b.UNSIGNED_SHORT,0)},Ma:function(g){g=g||b;var w=a(g);g.bindBuffer(g.ARRAY_BUFFER, +w.W);g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,w.B);wa.$a(g);g.drawElements(g.TRIANGLES,3,g.UNSIGNED_SHORT,0);g.deleteBuffer(w.W);g.deleteBuffer(w.B);q.reset()},lc:function(){var g=b,w=c;g.deleteBuffer(w.W);g.deleteBuffer(w.B)},h:function(){q.lc();f.forEach(function(g){g.remove()});b.bindBuffer(b.ARRAY_BUFFER,null);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,null);q.reset();e=!1;f.splice(0);d=0}};return q}(),la=function(){var a=null,c=null,d=null,e=!1,f=[],n={u:-2,ic:1},t={Qa:function(){return e},G:function(){if(!e){a= +b.createFramebuffer();var q=ea.Z();c=q&&b.DRAW_FRAMEBUFFER?b.DRAW_FRAMEBUFFER:b.FRAMEBUFFER;d=q&&b.READ_FRAMEBUFFER?b.READ_FRAMEBUFFER:b.FRAMEBUFFER;e=!0}},ff:function(){return c},Ad:function(){return d},Oa:function(){return b.FRAMEBUFFER},pf:function(){return n},Ze:function(){return a},instance:function(q){void 0===q.tc&&(q.tc=!1);var g=q.$?q.$:null,w=q.width,B=void 0!==q.height?q.height:q.width,h=a,A=null,k=!1,I=!1,H=0;g&&(w=w?w:g.A(),B=B?B:g.P());var C={Lc:function(){k||(h=b.createFramebuffer(), +k=!0,H=n.ic++)},Uc:function(){C.Lc();C.l();A=b.createRenderbuffer();b.bindRenderbuffer(b.RENDERBUFFER,A);b.renderbufferStorage(b.RENDERBUFFER,b.DEPTH_COMPONENT16,w,B);b.framebufferRenderbuffer(c,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,A);b.clearDepth(1)},bind:function(r,v){H!==n.u&&(b.bindFramebuffer(c,h),n.u=H);g&&g.l();v&&b.viewport(0,0,w,B);r&&b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)},ue:function(){H!==n.u&&(b.bindFramebuffer(c,h),n.u=H)},clear:function(){b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)}, +Ce:function(){b.clear(b.COLOR_BUFFER_BIT)},De:function(){b.clear(b.DEPTH_BUFFER_BIT)},ge:function(){b.viewport(0,0,w,B)},l:function(){H!==n.u&&(b.bindFramebuffer(c,h),n.u=H)},rtt:function(r){g=r;n.u!==H&&(b.bindFramebuffer(b.FRAMEBUFFER,h),n.u=H);r.l()},I:function(){b.bindFramebuffer(c,null);n.u=-1},resize:function(r,v){w=r;B=v;A&&(b.bindRenderbuffer(b.RENDERBUFFER,A),b.renderbufferStorage(b.RENDERBUFFER,b.DEPTH_COMPONENT16,w,B))},remove:function(){h===a||I||(b.bindFramebuffer(c,h),b.framebufferTexture2D(c, +b.COLOR_ATTACHMENT0,b.TEXTURE_2D,null,0),A&&b.framebufferRenderbuffer(c,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,null),b.bindFramebuffer(c,null),b.deleteFramebuffer(h),A&&b.deleteRenderbuffer(A));I=!0}};q.tc&&C.Uc();f.push(C);return C},I:function(){b.bindFramebuffer(c,null);n.u=-1},me:function(){b.bindFramebuffer(c,null);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);b.viewport(0,0,ea.A(),ea.P());n.u=-1},reset:function(){n.u=-2},X:function(){0!==n.u&&(b.bindFramebuffer(c,a),n.u=0)},clear:function(){b.viewport(0, +0,ea.A(),ea.P());b.clear(b.COLOR_BUFFER_BIT)},h:function(){t.I();f.forEach(function(q){q.remove()});b.deleteFramebuffer(a);t.reset();e=!1;f.splice(0);n.u=-2;n.ic=1}};return t}(),ea=function(){function a(){d="undefined"===typeof Ua?JEContext:Ua;e=!0}function c(r,v){for(var F=0;FO&&(O+=c);O>=c&&(O-=c);for(var ba=0;bal&&(l+=c);l>=c&&(l-=c);var M=O/c,J=l/c;E=1-E-1/f;M+=H;J+=H;pa+=C;E+=C;var m=r*e+D,fa=F*e+ba;fa=d*e-fa-1;m=fa*d*e+m;B[4*m]=pa;B[4*m+1]=E;B[4*m+2]=M;B[4* +m+3]=J;J=A[l*c+O]++;m=J%n;M=O*n+m;l=l*n+(J-m)/n;l=c*n-1-l;l=l*c*n+M;h[4*l]=pa;h[4*l+1]=E;h[4*l+2]=u;h[4*l+3]=p;++q>=f&&(q=0,++g);++w}}}A=null;var ua=V.instance(a.weights);delete a.weights.data;var Ca=V.instance({width:f,isFloat:!0,array:new Float32Array(h),isPot:!0});h=null;var ra=V.instance({width:f,isFloat:!0,array:new Float32Array(B),isPot:!0});B=null;return{oa:!0,Na:function(){return n},h:function(){Ca.remove();ra.remove();ua.remove()},J:function(){y.set("s22");ua.b(1);ra.b(2);U.g(!1,!1)}}}}}(), +fc=function(){return{instance:function(a){var c=a.kernelsNumber,d=a.toSparsity,e=d*a.toLayerSize/a.fromLayerSize,f=V.instance(a.weights);delete a.weights.data;return{oa:!0,Na:function(){return e},sf:function(){return d},Fd:function(){return f},h:function(){f.remove()},J:function(){y.set("s25");y.v("u22",c);y.v("u23",d);y.v("u16",a.toLayerSize);y.v("u24",a.fromLayerSize);f.b(1);U.g(!1,!1)}}}}}(),dc=function(){return{instance:function(a,c){var d=a.fromLayerSize,e=a.toLayerSize,f=a.toSparsity,n=a.stride? +a.stride:1,t=f*e/d,q=ewindow.innerWidth}},Tc:function(){return T.Kb()||T.Jb()},Kb:function(){var a=navigator.userAgent.toLowerCase();return-1!== -a.indexOf("safari")&&-1===a.indexOf("chrome")?!0:!1},Je:function(){return T.Uc()?T.hc()?window.innerHeight/window.innerWidth*45:45:45},Lb:function(){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?!0:!1},pause:function(a){a.pause()},vf:function(a){a.play()},release:function(a){a.pause();a.videoStream&&a.videoStream.stop();a.videoStream=null},Wc:function(a){if(!a)return a;var c=!1;if(a.video){var d=function(e){var f={};"undefined"!==typeof e.min&&(f.min=e.min);"undefined"!==typeof e.max&& -(f.max=e.max);"undefined"!==typeof e.ideal&&(f.ideal=e.ideal);return f};c={};"undefined"!==typeof a.video.width&&(c.width=d(a.video.width));"undefined"!==typeof a.video.height&&(c.height=d(a.video.height));"undefined"!==typeof a.video.facingMode&&(c.facingMode=a.video.facingMode)}c={audio:a.audio,video:c};"undefined"!==typeof a.deviceId&&(c.deviceId=a.deviceId);return c},yc:function(a){var c=a.video.width;a.video.width=a.video.height;a.video.height=c;return a},Yc:function(a){function c(p){return[480, -576,640,648,720,768,800,960,1080,1152,1280,1366,1920].sort(function(y,z){return Math.abs(y-p)-Math.abs(z-p)})}function d(p){var y=T.Wc(a);e.push(p(y))}var e=[];if(!a||!a.video)return e;if(a.video.width&&a.video.height){if(a.video.width.ideal&&a.video.height.ideal){var f=c(a.video.width.ideal).slice(0,3),k=c(a.video.height.ideal).slice(0,3),l={},n=0;for(l.$=void 0;n16/9+.1||d(function(p,y){return function(z){z.video.width.ideal=p.$;z.video.height.ideal=y.Z;return z}}(l,q))}}}d(function(p){return T.yc(p)})}a.video.width&&a.video.height&&(a.video.width.ideal&&a.video.height.ideal&&d(function(p){delete p.video.width.ideal;delete p.video.height.ideal;return p}),d(function(p){delete p.video.width;delete p.video.height;return p}));a.video.facingMode&&(d(function(p){delete p.video.facingMode;return p}),a.video.width&& -a.video.height&&d(function(p){T.yc(p);delete p.video.facingMode;return p}));e.push({audio:a.audio,video:!0});return e},Xd:function(a){if(T.hc()){if(!a||!a.video)return!1;var c=a.video.width,d=a.video.height;if(!c||!d)return!1;if(c.ideal&&d.ideal&&c.ideal>d.ideal)return a.video.height=c,a.video.width=d,!0}return!1},Na:function(a){a.volume=0;T.ta(a,"muted");if(T.Kb()){if(1===a.volume){var c=function(){a.volume=0;window.removeEventListener("mousemove",c,!1);window.removeEventListener("touchstart",c, -!1)};window.addEventListener("mousemove",c,!1);window.addEventListener("touchstart",c,!1)}setTimeout(function(){a.volume=0;T.ta(a,"muted")},5)}},zc:function(a,c,d){return new Promise(function(e,f){if(a.srcObject&&a.srcObject.getVideoTracks){var k=a.srcObject.getVideoTracks();1!==k.length?f("INVALID_TRACKNUMBER"):(k=k[0],c?T.get(a,e,f,d):(k.stop(),e()))}else f("BAD_IMPLEMENTATION")})},$b:function(a,c,d,e){function f(l){k||(k=!0,d(l))}var k=!1;return navigator.mediaDevices.getUserMedia(e).then(function(l){function n(){setTimeout(function(){if(a.currentTime){var q= -a.videoWidth,x=a.videoHeight;if(0===q||0===x)f("VIDEO_NULLSIZE");else{q&&(a.style.width=q.toString()+"px");x&&(a.style.height=x.toString()+"px");q={Sc:null,Vd:null,Dd:null};try{var m=l.getVideoTracks()[0];m&&(q.Dd=m,q.Sc=m.getCapabilities(),q.Vd=m.getSettings())}catch(p){}T.Tc()?a.parentNode&&null!==a.parentNode?(k||c(a,l,q),setTimeout(function(){a.play()},100)):(document.body.appendChild(a),T.Na(a),k||c(a,l,q),setTimeout(function(){a.style.transform="scale(0.0001,0.0001)";a.style.position="fixed"; -a.style.bottom="0px";a.style.right="0px";T.Na(a);setTimeout(function(){a.play()},100)},80)):k||c(a,l,q)}}else f("VIDEO_NOTSTARTED")},700)}"undefined"!==typeof a.srcObject?a.srcObject=l:(a.src=window.URL.createObjectURL(l),a.videoStream=l);T.Na(a);a.addEventListener("loadeddata",function(){var q=a.play();T.Na(a);"undefined"===typeof q?n():q.then(function(){n()}).catch(function(){f("VIDEO_PLAYPROMISEREJECTED")})},!1)}).catch(function(l){f(l)})},get:function(a,c,d,e){if(!a)return d&&d("VIDEO_NOTPROVIDED"), -!1;if(!T.Lb())return d&&d("MEDIASTREAMAPI_NOTFOUND"),!1;if(e&&e.video){if(T.Jb()){var f=T.md();(12>f[0]||12===f[0]&&2>f[1])&&T.Xd(e)}e.video.width&&e.video.width.ideal&&(a.style.width=e.video.width.ideal+"px");e.video.height&&e.video.height.ideal&&(a.style.height=e.video.height.ideal+"px")}T.ta(a,"autoplay");T.ta(a,"playsinline");e&&e.audio?a.volume=0:T.ta(a,"muted");T.$b(a,c,function(){function k(n){if(0===n.length)d("INVALID_FALLBACKCONSTRAINTS");else{var q=n.shift();T.$b(a,c,function(){k(n)},q)}} -var l=T.Yc(e);k(l)},e)},qd:function(a){if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return a(!1,"NOTSUPPORTED"),!1;navigator.mediaDevices.enumerateDevices().then(function(c){(c=c.filter(function(d){return d.kind&&-1!==d.kind.toLowerCase().indexOf("video")&&d.label&&d.deviceId}))&&c.length&&0H.Ed)return Ea("MAXFACES_TOOHIGH"),!1;if(!a.canvasId&&!a.canvas)return Ea("NO_CANVASID"),!1;I.W=a.canvas?a.canvas:document.getElementById(a.canvasId);if(!I.W)return Ea("INVALID_CANVASID"),!1;V.N=I.W.width;V.P=I.W.height;if(!V.N||!V.P)return Ea("INVALID_CANVASDIMENSIONS"),!1;for(var d=0;du42&&b>h+u43;i?a.r=2.:a.r>u41?a.r=0.:a.r>1.9?a.r+=1.:0.,a.r*=u44;if(a.r<.9)a=vec4(1.,u39);else{a.r*=step(1.9,a.r);float j=dot(e,texture2D(u38,vec2(.875,.875))),k=dot(e,texture2D(u38,vec2(.125,.625))),l=dot(e,texture2D(u38,vec2(.375,.625))),c=cos(u36),d=sin(u36);vec2 m=mat2(c,d*u45,-d/u45,c)*vec2(j,k);a.gba+=vec3(m,l)*u40*a.a;}gl_FragColor=a;}", -fa:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",c:"u38 u33 u39 u41 u40 u44 u36 u45 u42 u43 u35".split(" ")},{id:"s51",name:"_",fa:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",a:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);const vec3 f=vec3(.5,.5,.5);void main(){float a=dot(e,texture2D(u38,vec2(.125,.875))),b=dot(e,texture2D(u38,vec2(.375,.875))),c=dot(e,texture2D(u38,vec2(.625,.875))),d=dot(e,texture2D(u38,vec2(.625,.625)));vec3 g=vec3(a,b,c)*.5+f;gl_FragColor=vec4(g,d);}", -c:["u38"]},{id:"s52",name:"_",fa:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",a:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);void main(){float a=dot(e,texture2D(u38,vec2(.375,.375))),b=dot(e,texture2D(u38,vec2(.625,.375))),c=dot(e,texture2D(u38,vec2(.875,.375))),d=dot(e,texture2D(u38,vec2(.125,.125)));gl_FragColor=vec4(a,b,c,d);}",c:["u38"]},{id:"s47",name:"_",a:"uniform sampler2D u33;uniform vec2 u46;uniform float u47;varying vec2 vv0;void main(){float f=step(.5,mod(gl_FragCoord.y+1.5,2.)),c=step(.33,vv0.x);vec4 a=texture2D(u33,vv0+u46);a.a=mix(a.a*u47,a.a,c);vec4 d=floor(255.*a),g=255.*(255.*a-d),b=mix(d,g,f)/255.;b.x=mix(step(a.x,1.5),b.x,c),gl_FragColor=b;}", -c:["u33","u47","u46"]}]);Eb();Tb();vb();ub();c()});return!0},destroy:function(){return new Promise(function(a,c){Mb.toggle_pause(!0,!0).catch(function(){c()}).then(function(){za&&za.h();Aa.h();za=ma=Va=null;sb.splice(0);tb.splice(0);ea=ba.rb;a()})})},toggle_pause:function(a,c){if(!ob())return Promise.reject();var d=null;d=c?T.zc(t.element,!a,t.ra):Promise.resolve();a?Db():d.then(function(){pb()});return d},update_videoSettings:function(a){Db();return new Promise(function(c){T.zc(t.element,!1,t.ra).then(function(){Object.assign(ha, -a);Jb(null,null,function(d){eb(d,function(){Ha();Ga();pb();c()})})})})},toggle_slow:function(a){ob()&&ea===ba.play&&(a&&!I.Ka?(I.sc=I.Ea,W.nDetectsPerLoop=1,this.set_animateDelay(100),I.Ka=!0):!a&&I.Ka&&(W.nDetectsPerLoop=-1,this.set_animateDelay(I.sc),I.Ka=!1))},set_animateDelay:function(a){I.Ea=a},resize:function(){var a=I.W.width,c=I.W.height;if(!yb()&&a===V.N&&c===V.P)return!1;V.N=a;V.P=c;vb();ub();Ha();Ga();t.Y&&t.Y.resize(V.N,V.P);return!0},set_inputTexture:function(a,c,d){t.u[0]=c;t.u[1]=d; -t.nb=!0;Ha();qb();Ga();u.set("s48");t.Y.M();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,a);R.g(!0,!0)},reset_GLState:function(){qb();V.va.remove();U.Aa.remove();Eb()},reset_inputTexture:function(){yb();t.nb=!1;Ha();Ga()},get_videoDevices:function(a){return T.qd(a)},set_scanSettings:function(a){Object.assign(W,a);-1!==W.nDetectsPerLoop&&(Q.G=W.nDetectsPerLoop,Q.qb=W.nDetectsPerLoop);vb();ub()},set_stabilizationSettings:function(a){Object.assign(ua,a)},set_videoOrientation:function(a,c){ob()&& -(ha.flipX=c,ha.rotate=a,Ha(),Ga())},update_videoElement:function(a,c){eb(a?a:t.element,function(){Ib();Ha();Ga();c&&c()})}};return Mb};window.JEEFACEFILTERAPI=window.JEEFACEFILTERAPIGEN(); +4)))a=!0;return a},Tb:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream},xd:function(){var a=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return 2window.innerWidth}},gd:function(){return W.Ub()||W.Tb()},Ub:function(){var a=navigator.userAgent.toLowerCase();return-1!== +a.indexOf("safari")&&-1===a.indexOf("chrome")?!0:!1},Xe:function(){return W.hd()?W.xc()?window.innerHeight/window.innerWidth*45:45:45},Vb:function(){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?!0:!1},pause:function(a){a.pause()},Jf:function(a){a.play()},release:function(a){a.pause();a.videoStream&&a.videoStream.stop();a.videoStream=null},kd:function(a){if(!a)return a;var c=!1;if(a.video){var d=function(e){var f={};"undefined"!==typeof e.min&&(f.min=e.min);"undefined"!==typeof e.max&& +(f.max=e.max);"undefined"!==typeof e.ideal&&(f.ideal=e.ideal);return f};c={};"undefined"!==typeof a.video.width&&(c.width=d(a.video.width));"undefined"!==typeof a.video.height&&(c.height=d(a.video.height));"undefined"!==typeof a.video.facingMode&&(c.facingMode=a.video.facingMode)}c={audio:a.audio,video:c};"undefined"!==typeof a.deviceId&&(c.deviceId=a.deviceId);return c},Pc:function(a){var c=a.video.width;a.video.width=a.video.height;a.video.height=c;return a},md:function(a){function c(h){return[480, +576,640,648,720,768,800,960,1080,1152,1280,1366,1920].sort(function(A,k){return Math.abs(A-h)-Math.abs(k-h)})}function d(h){var A=W.kd(a);e.push(h(A))}var e=[];if(!a||!a.video)return e;if(a.video.width&&a.video.height){if(a.video.width.ideal&&a.video.height.ideal){var f=c(a.video.width.ideal).slice(0,3),n=c(a.video.height.ideal).slice(0,3),t={},q=0;for(t.ca=void 0;q16/9+.1||d(function(h,A){return function(k){k.video.width.ideal=h.ca;k.video.height.ideal=A.ba;return k}}(t,g))}}}d(function(h){return W.Pc(h)})}a.video.width&&a.video.height&&(a.video.width.ideal&&a.video.height.ideal&&d(function(h){delete h.video.width.ideal;delete h.video.height.ideal;return h}),d(function(h){delete h.video.width;delete h.video.height;return h}));a.video.facingMode&&(d(function(h){delete h.video.facingMode; +return h}),a.video.width&&a.video.height&&d(function(h){W.Pc(h);delete h.video.facingMode;return h}));e.push({audio:a.audio,video:!0});return e},je:function(a){if(W.xc()){if(!a||!a.video)return!1;var c=a.video.width,d=a.video.height;if(!c||!d)return!1;if(c.ideal&&d.ideal&&c.ideal>d.ideal)return a.video.height=c,a.video.width=d,!0}return!1},Sa:function(a){a.volume=0;W.wa(a,"muted");if(W.Ub()){if(1===a.volume){var c=function(){a.volume=0;window.removeEventListener("mousemove",c,!1);window.removeEventListener("touchstart", +c,!1)};window.addEventListener("mousemove",c,!1);window.addEventListener("touchstart",c,!1)}setTimeout(function(){a.volume=0;W.wa(a,"muted")},5)}},Qc:function(a,c,d){return new Promise(function(e,f){if(a.srcObject&&a.srcObject.getVideoTracks){var n=a.srcObject.getVideoTracks();1!==n.length?f("INVALID_TRACKNUMBER"):(n=n[0],c?W.get(a,e,f,d):(n.stop(),e()))}else f("BAD_IMPLEMENTATION")})},qc:function(a,c,d,e){function f(t){n||(n=!0,d(t))}var n=!1;return navigator.mediaDevices.getUserMedia(e).then(function(t){function q(){setTimeout(function(){if(a.currentTime){var g= +a.videoWidth,w=a.videoHeight;if(0===g||0===w)f("VIDEO_NULLSIZE");else{g&&(a.style.width=g.toString()+"px");w&&(a.style.height=w.toString()+"px");g={fd:null,he:null,Qd:null};try{var B=t.getVideoTracks()[0];B&&(g.Qd=B,g.fd=B.getCapabilities(),g.he=B.getSettings())}catch(h){}W.gd()?a.parentNode&&null!==a.parentNode?(n||c(a,t,g),setTimeout(function(){a.play()},100)):(document.body.appendChild(a),W.Sa(a),n||c(a,t,g),setTimeout(function(){a.style.transform="scale(0.0001,0.0001)";a.style.position="fixed"; +a.style.bottom="0px";a.style.right="0px";W.Sa(a);setTimeout(function(){a.play()},100)},80)):n||c(a,t,g)}}else f("VIDEO_NOTSTARTED")},700)}"undefined"!==typeof a.srcObject?a.srcObject=t:(a.src=window.URL.createObjectURL(t),a.videoStream=t);W.Sa(a);a.addEventListener("loadeddata",function(){var g=a.play();W.Sa(a);"undefined"===typeof g?q():g.then(function(){q()}).catch(function(){f("VIDEO_PLAYPROMISEREJECTED")})},!1)}).catch(function(t){f(t)})},get:function(a,c,d,e){if(!a)return d&&d("VIDEO_NOTPROVIDED"), +!1;if(!W.Vb())return d&&d("MEDIASTREAMAPI_NOTFOUND"),!1;if(e&&e.video){if(W.Tb()){var f=W.xd();(12>f[0]||12===f[0]&&2>f[1])&&W.je(e)}e.video.width&&e.video.width.ideal&&(a.style.width=e.video.width.ideal+"px");e.video.height&&e.video.height.ideal&&(a.style.height=e.video.height.ideal+"px")}W.wa(a,"autoplay");W.wa(a,"playsinline");e&&e.audio?a.volume=0:W.wa(a,"muted");W.qc(a,c,function(){function n(q){if(0===q.length)d("INVALID_FALLBACKCONSTRAINTS");else{var g=q.shift();W.qc(a,c,function(){n(q)},g)}} +var t=W.md(e);n(t)},e)},Dd:function(a){if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return a(!1,"NOTSUPPORTED"),!1;navigator.mediaDevices.enumerateDevices().then(function(c){(c=c.filter(function(d){return d.kind&&-1!==d.kind.toLowerCase().indexOf("video")&&d.label&&d.deviceId}))&&c.length&&0K.Rd)return Ha("MAXFACES_TOOHIGH"),!1;if(!a.canvasId&&!a.canvas)return Ha("NO_CANVASID"),!1;N.Y=a.canvas?a.canvas:document.getElementById(a.canvasId);if(!N.Y)return Ha("INVALID_CANVASID"),!1;Y.O=N.Y.width;Y.R=N.Y.height;if(!Y.O||!Y.R)return Ha("INVALID_CANVASDIMENSIONS"),!1;for(var d=0;du42&&b>h+u43;i?a.r=2.:a.r>u41?a.r=0.:a.r>1.9?a.r+=1.:0.,a.r*=u44;if(a.r<.9)a=vec4(1.,u39);else{a.r*=step(1.9,a.r);float j=dot(e,texture2D(u38,vec2(.875,.875))),k=dot(e,texture2D(u38,vec2(.125,.625))),l=dot(e,texture2D(u38,vec2(.375,.625))),c=cos(u36),d=sin(u36);vec2 m=mat2(c,d*u45,-d/u45,c)*vec2(j,k);a.gba+=vec3(m,l)*u40*a.a;}gl_FragColor=a;}", +ja:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",c:"u38 u33 u39 u41 u40 u44 u36 u45 u42 u43 u35".split(" ")},{id:"s53",name:"_",ja:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",a:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);const vec3 f=vec3(.5,.5,.5);void main(){float a=dot(e,texture2D(u38,vec2(.125,.875))),b=dot(e,texture2D(u38,vec2(.375,.875))),c=dot(e,texture2D(u38,vec2(.625,.875))),d=dot(e,texture2D(u38,vec2(.625,.625)));vec3 g=vec3(a,b,c)*.5+f;gl_FragColor=vec4(g,d);}", +c:["u38"]},{id:"s54",name:"_",ja:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",a:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);void main(){float a=dot(e,texture2D(u38,vec2(.375,.375))),b=dot(e,texture2D(u38,vec2(.625,.375))),c=dot(e,texture2D(u38,vec2(.875,.375))),d=dot(e,texture2D(u38,vec2(.125,.125)));gl_FragColor=vec4(a,b,c,d);}",c:["u38"]},{id:"s49",name:"_",a:"uniform sampler2D u33;uniform vec2 u46;uniform float u47;varying vec2 vv0;void main(){float f=step(.5,mod(gl_FragCoord.y+1.5,2.)),c=step(.33,vv0.x);vec4 a=texture2D(u33,vv0+u46);a.a=mix(a.a*u47,a.a,c);vec4 d=floor(255.*a),g=255.*(255.*a-d),b=mix(d,g,f)/255.;b.x=mix(step(a.x,1.5),b.x,c),gl_FragColor=b;}", +c:["u33","u47","u46"]}]);Fb();Ub();vb();ub();c()});return!0},destroy:function(){return new Promise(function(a,c){Nb.toggle_pause(!0,!0).catch(function(){c()}).then(function(){Aa&&Aa.h();Ua.h();Aa=oa=Wa=null;sb.splice(0);tb.splice(0);ka=da.zb;a()})})},toggle_pause:function(a,c){if(!ob())return Promise.reject();var d=null;d=c?W.Qc(x.element,!a,x.ua):Promise.resolve();a?Eb():d.then(function(){pb()});return d},update_videoSettings:function(a){Eb();return new Promise(function(c){W.Qc(x.element,!1,x.ua).then(function(){Object.assign(na, +a);Kb(null,null,function(d){eb(d,function(){Ja();Ia();pb();c()})})})})},toggle_slow:function(a){ob()&&ka===da.play&&(a&&!N.Pa?(N.Jc=N.Fa,Z.nDetectsPerLoop=1,this.set_animateDelay(100),N.Pa=!0):!a&&N.Pa&&(Z.nDetectsPerLoop=-1,this.set_animateDelay(N.Jc),N.Pa=!1))},set_animateDelay:function(a){N.Fa=a},resize:function(){var a=N.Y.width,c=N.Y.height;if(!yb()&&a===Y.O&&c===Y.R)return!1;Y.O=a;Y.R=c;vb();ub();Ja();Ia();x.aa&&x.aa.resize(Y.O,Y.R);return!0},set_inputTexture:function(a,c,d){x.o[0]=c;x.o[1]= +d;x.vb=!0;Ja();qb();Ia();y.set("s50");x.aa.N();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,a);U.g(!0,!0)},reset_GLState:function(){qb();Y.ya.remove();X.Ca.remove();Fb()},reset_inputTexture:function(){yb();x.vb=!1;Ja();Ia()},get_videoDevices:function(a){return W.Dd(a)},set_scanSettings:function(a){Object.assign(Z,a);-1!==Z.nDetectsPerLoop&&(T.F=Z.nDetectsPerLoop,T.yb=Z.nDetectsPerLoop);vb();ub()},set_stabilizationSettings:function(a){Object.assign(ta,a)},set_videoOrientation:function(a, +c){ob()&&(na.flipX=c,na.rotate=a,Ja(),Ia())},update_videoElement:function(a,c){eb(a?a:x.element,function(){Jb();Ja();Ia();c&&c()})}};return Nb};window.JEEFACEFILTERAPI=window.JEEFACEFILTERAPIGEN(); ;return JEEFACEFILTERAPI||window.JEEFACEFILTERAPI;})(); \ No newline at end of file diff --git a/dist/jeelizFaceFilter.module.js b/dist/jeelizFaceFilter.module.js index adbabe2e..c8588e22 100644 --- a/dist/jeelizFaceFilter.module.js +++ b/dist/jeelizFaceFilter.module.js @@ -16,142 +16,147 @@ * limitations under the License. */ -window.JEEFACEFILTERAPIGEN=function(){function Bb(){var a=null,c=null,d=null,e=0;this.od=function(f){return a[f]};this.Nd=function(f){var k=null;e=f.length;a=f.map(function(l,n){l=Object.assign({},l,{index:n,parent:this,Ra:k,xd:n===e-1});return k=n=0===n?Nb.instance(l):Ob.instance(l)});c=a[0];d=a[e-1];a.forEach(function(l,n){0!==n&&l.Id()})};this.J=function(f,k){var l=k;a.forEach(function(n){l=n.J(l,f)});return l};this.Xb=function(){return c.B()};this.Zb=function(){return d.pd()};this.Pd=function(f){d.Zc(f)}; -this.Wb=function(){return d.Wb()};this.h=function(){a&&(a.forEach(function(f){f.h()}),d=c=a=null,e=0)}}var Ma,Na,Oa,Ya,Za,Pa,$a,ab,bb,jb,kb,lb,mb;function nb(a,c){var d=c%8;return a[(c-d)/8]>>7-d&1}function Pb(a){var c=JSON.parse(a);a=c.ne;var d=c.nf,e=c.n;var f="undefined"===typeof btoa?Buffer.from(c.data,"base64").toString("latin1"):atob(c.data);var k=f.length;c=new Uint8Array(k);for(var l=0;l=m;--z)y+=p*nb(c,z),p*=2;m=y;q=q+1+a;p=k.length;y=0;for(z=q;zc&&(t.Sa=a);if(1E3*cQ.G)E.L.splice(0,E.L.length-Q.G);else for(;E.L.lengthc&&(c=ma[d].detected,a=0);for(c=0;c=E.i&&(a=0)}E.ic=a}for(a=0;aH.ga[1]?(a=H.Ca[1],1H.pb}function Hb(a,c,d,e){return d>a?Math.max(0,a+c/2- -(d-e/2)):Math.max(0,d+e/2-(a-c/2))}function Wb(){return Va.some(function(a,c){if(c===E.ba)return!1;c=Va[E.ba];if(c.Pa>a.Pa||3>a.Pa||Hb(c.x,c.U,a.x,a.U)H.jc*c.U*d})}function Xb(){var a=E.ba;U.Aa.Rd(1);1!==E.i&&(b.viewport(0,0,3,E.i),u.set("s0"),u.vc("u1",1),R.g(!1,!1),u.vc("u1",0));b.viewport(0,a,1,1);u.set("s50");I.ia&&u.A("u36",ma[a].rz);1!==E.i&&u.A("u35",E.sb);if(1wb&&(Ma+=$a,Oa=Pa,Ma>lb&&(Ma=jb,Na+=ab,Na>mb&&(Na=kb)));Ya=Ma+.5*(Math.random()-.5)*$a;Za=Na+.5*(Math.random()-.5)*ab;xb=Oa+.5*(Math.random()-.5)*bb}function Ib(){t.X&&t.X.remove();t.mb=t.element.isFakeVideo?!0:!1;t.X=S.instance(Object.assign({isPot:!1,isFloat:!1},t.mb?{isFlipY:!1,array:t.element.arrayBuffer,width:t.element.videoWidth,height:t.element.videoHeight,isKeepArray:!0}:{D:t.element}))}function Ga(){u.K("s48", -[{type:"1i",name:"u1",value:0},{type:"mat2",name:"u32",value:t.m}])}function Ha(){t.C[0]=.5;t.C[1]=.5;var a=t.u[1]/t.u[0];Sa=Aa.O()/Aa.B();90===Math.abs(ha.rotate)&&(a=1/a);a>Sa?t.C[1]*=Sa/a:t.C[0]*=a/Sa;u.K("s50",[{name:"u45",type:"1f",value:Sa}]);t.m[0]=0;t.m[1]=0;t.m[2]=0;t.m[3]=0;switch(ha.rotate){case 0:t.m[0]=t.C[0];t.m[3]=t.C[1];break;case 180:t.m[0]=-t.C[0];t.m[3]=-t.C[1];break;case 90:t.m[1]=t.C[0];t.m[2]=-t.C[1];break;case -90:t.m[1]=-t.C[0],t.m[2]=t.C[1]}ha.flipX&&(t.m[0]*=-1,t.m[2]*=-1)} -function yb(){var a=t.element.videoWidth,c=t.element.videoHeight,d=t.u[0]!==a||t.u[1]!==c;d&&(t.u[0]=a,t.u[1]=c);return d}function eb(a,c){if(ea===ba.error)return!1;t.element=a;yb();c&&c();return!0}function Jb(a,c,d){a&&a();t.ra={video:{facingMode:{ideal:ha.facingMode},width:{min:ha.minWidth,max:ha.maxWidth,ideal:ha.idealWidth},height:{min:ha.minHeight,max:ha.maxHeight,ideal:ha.idealHeight}},audio:!1};ha.deviceId&&(t.ra.deviceId=ha.deviceId);T.get(t.element?t.element:T.rd(),function(e){c&&c(e);d(e)}, -function(){Ea("WEBCAM_UNAVAILABLE")},t.ra)}function Ea(a){ea!==ba.error&&(ea=ba.error,I.qa&&I.qa(a))}var pa={Xe:function(a){return Math.ceil(Math.log2(a))},Ad:function(a){return Math.log2(a)},kf:function(a){return 0===Math.log2(a)%1},le:function(a){var c=[0,0,0,0];a.forEach(function(d){c[0]+=d[0];c[1]+=d[1];c[2]+=d[2];c[3]+=d[3]});return c},me:function(a,c,d){return Math.min(Math.max(a,c),d)},re:function(a){return a*Math.PI/180},sf:function(a,c){c=Math.pow(10,c);return Math.round(a*c)/c},tf:function(a){return Math.round(1E6* -a)/1E6},Ye:function(a,c){return(100*a/c).toFixed(3)},R:function(a,c,d){return a*(1-d)+c*d},dd:function(a,c){return pa.Vc(a-c)},Vc:function(a){for(;a>Math.PI;)a-=2*Math.PI;for(;a<=-Math.PI;)a+=2*Math.PI;return a},te:function(a,c){return Math.abs(pa.dd(a,c))},de:function(a,c){return Math.atan2(Math.sin(a)+Math.sin(c),Math.cos(a)+Math.cos(c))}},Gb={get:function(a,c,d){var e=new XMLHttpRequest;e.open("GET",a,!0);e.withCredentials=!1;e.onreadystatechange=function(){4===e.readyState&&(200===e.status||0=== -e.status?c(e.responseText):"undefined"!==typeof d&&d(e.status))};e.send()},Te:function(a,c){Gb.get(a,function(d){c(JSON.parse(d))})},qf:function(a,c,d){var e=new XMLHttpRequest;e.open("POST",a,!0);e.setRequestHeader("Content-type","application/x-www-form-urlencoded");e.onreadystatechange=function(){4!==e.readyState||200!==e.status&&0!==e.status||d(e.responseText)};e.send(c)},Ke:function(a,c){var d=new XMLHttpRequest;d.open("POST",a,!0);d.responseType="arraybuffer";d.onload=function(){c(d.response)}; -d.send()}},db={Ef:function(a,c,d){a=Math.min(Math.max((d-a)/(c-a),0),1);return a*a*(3-2*a)},Ma:function(a,c,d){return Math.min(Math.max((d-a)/(c-a),0),1)},Ee:function(a,c,d,e){return Math.pow(Math.min(Math.max((e-a)/(c-a),0),1),d)},If:function(){return 0},pf:function(){return 1},mf:function(a){return a},Be:function(a){return a*a},Ge:function(a){return a*(2-a)},ye:function(a){return.5>a?2*a*a:-1+(4-2*a)*a},we:function(a){return a*a*a},Fe:function(a){return--a*a*a+1},xe:function(a){return.5>a?4*a*a* -a:(a-1)*(2*a-2)*(2*a-2)+1},Ce:function(a){return a*a*a*a},He:function(a){return 1- --a*a*a*a},ze:function(a){return.5>a?8*a*a*a*a:1-8*--a*a*a*a},De:function(a){return a*a*a*a*a},Ie:function(a){return 1+--a*a*a*a*a},Ae:function(a){return.5>a?16*a*a*a*a*a:1+16*--a*a*a*a*a}},Yb={ld:function(a,c,d){switch(a){case "relu":return d+"=max(vec4(0.,0.,0.,0.),"+c+");";case "elu":return d+"=mix(exp(-abs("+c+"))-vec4(1.,1.,1.,1.),"+c+",step(0.,"+c+"));";case "elu01":return d+"=mix(0.1*exp(-abs("+c+"))-vec4(0.1,0.1,0.1,0.1),"+ -c+",step(0.,"+c+"));";case "arctan":return d+"=atan(3.14159265359*texture2D(u0,vUV))/3.14159265359;";case "copy":return"";default:return!1}}},u=function(){function a(g,w){g=b.createShader(g);b.shaderSource(g,w);b.compileShader(g);return b.getShaderParameter(g,b.COMPILE_STATUS)?g:!1}function c(g,w){g=a(b.VERTEX_SHADER,g);w=a(b.FRAGMENT_SHADER,w);f.push(g,w);var A=b.createProgram();b.attachShader(A,g);b.attachShader(A,w);b.linkProgram(A);return A}function d(g){void 0===g.fa&&(g.fa="precision lowp float;attribute vec2 a0;varying vec2 vv0;void main(){gl_Position=vec4(a0,0.,1.),vv0=a0*.5+vec2(.5,.5);}"); -void 0===g.Fa&&(g.Fa=["a0"]);void 0===g.na&&(g.na=[2]);if(void 0===g.precision||"highp"===g.precision)g.precision=x;g.id=n++;void 0!==g.Md&&g.Md.forEach(function(A,Z){g.a=g.a.replace(A,g.Ta[Z])});g.Bb=0;g.na.forEach(function(A){g.Bb+=4*A});g.wa=c(g.fa,"precision "+g.precision+" float;\n"+g.a);g.j={};g.c.forEach(function(A){g.j[A]=b.getUniformLocation(g.wa,A)});g.attributes={};g.oa=[];g.Fa.forEach(function(A){var Z=b.getAttribLocation(g.wa,A);g.attributes[A]=Z;g.oa.push(Z)});if(g.f){b.useProgram(g.wa); -l=g;k=g.id;for(var w in g.f)b.uniform1i(g.j[w],g.f[w])}g.kb=!0}function e(g){Ia.Sd(G);k!==g.id&&(G.la(),k=g.id,l=g,b.useProgram(g.wa),g.oa.forEach(function(w){0!==w&&b.enableVertexAttribArray(w)}))}var f=[],k=-1,l=null,n=0,q=!1,x="highp",m=["u1"],p=["u0"],y={u1:0},z={u0:0},O={u1:0,u2:1},N={u3:0},F={s0:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",c:m,f:y},s1:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",c:m,f:y,precision:"lowp"}, -s2:{a:"uniform sampler2D u1,u2;varying vec2 vv0;void main(){vec4 a=texture2D(u2,vv0),b=texture2D(u1,vv0);gl_FragColor=a*b;}",c:["u1","u2"],f:O},s3:{a:"uniform sampler2D u1;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=a.r*f;}",c:m,f:y},s4:{a:"uniform sampler2D u1,u2;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u2,vv0),b=texture2D(u1,vv0);gl_FragColor=a.a*b.r*f;}",c:["u1","u2"],f:O},s5:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(1.-vv0.x,vv0.y));}", -c:m,f:y},s6:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(vv0.x,1.-vv0.y));}",c:m,f:y},s7:{a:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=a*u4;}",c:["u0","u4"],f:z},s8:{a:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;const vec4 f=vec4(.25,.25,.25,.25),g=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);float b=dot(a*u4,f);gl_FragColor=b*g;}",c:["u0","u4"],f:z},s9:{a:"uniform sampler2D u1;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){float a=.25*dot(e,texture2D(u1,vv0));gl_FragColor=a*e;}", -c:m,f:y},s10:{a:"uniform sampler2D u1,u5;uniform float u6;const vec4 f=vec4(1.,1.,1.,1.);varying vec2 vv0;void main(){vec4 a=texture2D(u1,vv0),b=texture2D(u5,vv0);gl_FragColor=mix(b,a,u6*f);}",c:["u1","u5","u6"],f:{u1:0,u5:1}},s11:{a:"uniform sampler2D u1;uniform vec2 u7;varying vec2 vv0;void main(){gl_FragColor=.25*(texture2D(u1,vv0+u7)+texture2D(u1,vv0+u7*vec2(1.,-1.))+texture2D(u1,vv0+u7*vec2(-1.,-1.))+texture2D(u1,vv0+u7*vec2(-1.,1.)));}",c:["u1","u7"],f:y},s12:{a:"uniform sampler2D u1;uniform vec4 u8;varying vec2 vv0;float g(float a,float b){a=floor(a)+.5;return floor(a/exp2(b));}float h(float a,float b){return floor(a*exp2(b)+.5);}float i(float a,float b){return mod(a,h(1.,b));}float e(float c,float a,float b){a=floor(a+.5),b=floor(b+.5);return i(g(c,a),b-a);}vec4 j(float a){if(a==0.)return vec4(0.,0.,0.,0.);float k=128.*step(a,0.);a=abs(a);float c=floor(log2(a)),l=c+127.,b=(a/exp2(c)-1.)*8388608.,d=l/2.,m=fract(d)*2.,n=floor(d),o=e(b,0.,8.),p=e(b,8.,16.),q=m*128.+e(b,16.,23.),r=k+n;return vec4(o,p,q,r)/255.;}void main(){float a=dot(texture2D(u1,vv0),u8);gl_FragColor=j(a);}", -c:["u1","u8"],f:y},s13:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=e/(e+exp(-a));gl_FragColor=b;}",c:p,f:z},s14:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(0.,0.,0.,0.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=max(f,a);}",c:p,f:z},s15:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=mix(exp(-abs(a))-f,a,step(0.,a));}",c:p,f:z},s16:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=exp(-abs(a))-f;gl_FragColor=mix(.1*b,a,step(0.,a));}", -c:p,f:z},s17:{a:"uniform sampler2D u0,u6,u9;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),c=texture2D(u6,vv0),d=texture2D(u9,vv0),b=a/d;gl_FragColor=c*mix(exp(-abs(b))-f,b,step(0.,a));}",c:["u0","u6","u9"],f:{u0:0,u6:1,u9:2}},s18:{a:"uniform sampler2D u0;const float e=3.141593;varying vec2 vv0;void main(){gl_FragColor=atan(e*texture2D(u0,vv0))/e;}",c:p,f:z},s19:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=log(f+a);gl_FragColor=b;}", -c:p,f:z},s20:{a:"uniform sampler2D u0,u10;uniform float u11;const vec2 e=vec2(.5,.5);const float f=1e-5;const vec4 g=vec4(1.,1.,1.,1.),i=vec4(0.,0.,0.,0.);varying vec2 vv0;void main(){vec4 a=texture2D(u10,e);float b=u11*u11;vec4 c=max(b*a,f*g);gl_FragColor=texture2D(u0,vv0)/c;}",c:["u0","u10","u11"],f:{u0:0,u10:1}},s21:{a:"uniform sampler2D u1;uniform vec2 u12;varying vec2 vv0;void main(){float a=u12.x*u12.y;vec2 b=floor(vv0*a)/a,c=fract(vv0*a),d=floor(b*u12.y),f=floor(u12.x*fract(b*u12.y)),g=(f*u12.y+d)/a;gl_FragColor=texture2D(u1,g+c/a);}", -c:["u1","u12"],f:y},s22:{a:"uniform sampler2D u13,u14,u15;varying vec2 vv0;void main(){vec4 a=texture2D(u15,vv0);vec2 b=a.rg,c=a.ba;vec4 d=texture2D(u13,b),f=texture2D(u14,c);gl_FragColor=d*f;}",c:["u13","u14","u15"],f:{u14:0,u13:1,u15:2}},s23:{a:"uniform float u16;uniform sampler2D u13,u14;varying vec2 vv0;void main(){vec2 a=fract(vv0*u16);vec4 b=texture2D(u13,vv0),c=texture2D(u14,a);gl_FragColor=b*c;}",c:["u14","u13","u16"],f:{u14:0,u13:1}},s24:{a:"uniform float u16;uniform sampler2D u13,u14,u17,u18,u19,u20;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.),g=vec4(1e-3,1e-3,1e-3,1e-3);void main(){vec2 h=vv0*u16,l=floor(h),c=h-l;vec4 m=texture2D(u13,vv0),d=texture2D(u14,c),a=texture2D(u20,vv0);a=a*255.;vec4 n=texture2D(u17,c),o=texture2D(u18,c),p=texture2D(u19,c),i=step(-g,-a),b=e-i,j=b*step(-e-g,-a);b*=e-j;vec4 k=b*step(-2.*e-g,-a);b*=e-k;vec4 q=b;d=i*d+j*n+k*o+q*p,gl_FragColor=m*d;}", +window.JEEFACEFILTERAPIGEN=function(){function Cb(){var a=null,c=null,d=null,e=0;this.Bd=function(f){return a[f]};this.$d=function(f){var n=null;e=f.length;a=f.map(function(t,q){t=Object.assign({},t,{index:q,parent:this,Wa:n,Kd:q===e-1});return n=q=0===q?Ob.instance(t):Pb.instance(t)});c=a[0];d=a[e-1];a.forEach(function(t,q){0!==q&&t.Vd()})};this.J=function(f,n){var t=n;a.forEach(function(q){t=q.J(t,f)});return t};this.nc=function(){return c.A()};this.pc=function(){return d.Cd()};this.be=function(f){d.nd(f)}; +this.mc=function(){return d.mc()};this.h=function(){a&&(a.forEach(function(f){f.h()}),d=c=a=null,e=0)}}var Na,Oa,Pa,Ya,Za,Qa,$a,ab,bb,jb,kb,lb,mb;function nb(a,c){var d=c%8;return a[(c-d)/8]>>7-d&1}function Qb(a){var c=JSON.parse(a);a=c.ne;var d=c.nf,e=c.n;var f="undefined"===typeof btoa?Buffer.from(c.data,"base64").toString("latin1"):atob(c.data);var n=f.length;c=new Uint8Array(n);for(var t=0;t=B;--k)A+=h*nb(c,k),h*=2;B=A;g=g+1+a;h=n.length;A=0;for(k=g;kc&&(x.Xa=a);if(1E3*cT.F)G.L.splice(0,G.L.length-T.F);else for(;G.L.lengthc&&(c=oa[d].detected,a=0);for(c=0;c=G.i&&(a=0)}G.yc=a}for(a=0;aK.ka[1]?(a=K.Ea[1],1K.xb}function Ib(a,c,d,e){return d>a?Math.max(0,a+c/2-(d-e/2)):Math.max(0,d+e/2-(a-c/2))}function Xb(){return Wa.some(function(a, +c){if(c===G.ea)return!1;c=Wa[G.ea];if(c.Ua>a.Ua||3>a.Ua||Ib(c.x,c.V,a.x,a.V)K.zc*c.V*d})}function Yb(){var a=G.ea;X.Ca.de(1);1!==G.i&&(b.viewport(0,0,3,G.i),y.set("s0"),y.Mc("u1",1),U.g(!1,!1),y.Mc("u1",0));b.viewport(0,a,1,1);y.set("s52");N.ma&&y.v("u36",oa[a].rz);1!==G.i&&y.v("u35",G.Ab);if(1wb&&(Na+=$a,Pa=Qa,Na>lb&&(Na=jb,Oa+=ab,Oa>mb&&(Oa=kb)));Ya=Na+.5*(Math.random()-.5)*$a;Za=Oa+.5*(Math.random()-.5)*ab;xb=Pa+.5*(Math.random()-.5)*bb}function Jb(){x.$&&x.$.remove();x.ub=x.element.isFakeVideo?!0:!1;x.$=V.instance(Object.assign({isPot:!1,isFloat:!1},x.ub?{isFlipY:!1,array:x.element.arrayBuffer,width:x.element.videoWidth,height:x.element.videoHeight,isKeepArray:!0}:{D:x.element}))}function Ia(){y.K("s50",[{type:"1i",name:"u1",value:0},{type:"mat2",name:"u32",value:x.m}])} +function Ja(){x.C[0]=.5;x.C[1]=.5;var a=x.o[1]/x.o[0];Ta=Ua.P()/Ua.A();90===Math.abs(na.rotate)&&(a=1/a);a>Ta?x.C[1]*=Ta/a:x.C[0]*=a/Ta;y.K("s52",[{name:"u45",type:"1f",value:Ta}]);x.m[0]=0;x.m[1]=0;x.m[2]=0;x.m[3]=0;switch(na.rotate){case 0:x.m[0]=x.C[0];x.m[3]=x.C[1];break;case 180:x.m[0]=-x.C[0];x.m[3]=-x.C[1];break;case 90:x.m[1]=x.C[0];x.m[2]=-x.C[1];break;case -90:x.m[1]=-x.C[0],x.m[2]=x.C[1]}na.flipX&&(x.m[0]*=-1,x.m[2]*=-1)}function yb(){var a=x.element.videoWidth,c=x.element.videoHeight, +d=x.o[0]!==a||x.o[1]!==c;d&&(x.o[0]=a,x.o[1]=c);return d}function eb(a,c){if(ka===da.error)return!1;x.element=a;yb();c&&c();return!0}function Kb(a,c,d){a&&a();x.ua={video:{facingMode:{ideal:na.facingMode},width:{min:na.minWidth,max:na.maxWidth,ideal:na.idealWidth},height:{min:na.minHeight,max:na.maxHeight,ideal:na.idealHeight}},audio:!1};na.deviceId&&(x.ua.deviceId=na.deviceId);W.get(x.element?x.element:W.Ed(),function(e){c&&c(e);d(e)},function(){Ha("WEBCAM_UNAVAILABLE")},x.ua)}function Ha(a){ka!== +da.error&&(ka=da.error,N.ta&&N.ta(a))}var qa={lf:function(a){return Math.ceil(Math.log2(a))},Nd:function(a){return Math.log2(a)},Af:function(a){return 0===Math.log2(a)%1},Ae:function(a){var c=[0,0,0,0];a.forEach(function(d){c[0]+=d[0];c[1]+=d[1];c[2]+=d[2];c[3]+=d[3]});return c},Be:function(a,c,d){return Math.min(Math.max(a,c),d)},Fe:function(a){return a*Math.PI/180},Gf:function(a,c){c=Math.pow(10,c);return Math.round(a*c)/c},Hf:function(a){return Math.round(1E6*a)/1E6},mf:function(a,c){return(100* +a/c).toFixed(3)},S:function(a,c,d){return a*(1-d)+c*d},rd:function(a,c){return qa.jd(a-c)},jd:function(a){for(;a>Math.PI;)a-=2*Math.PI;for(;a<=-Math.PI;)a+=2*Math.PI;return a},He:function(a,c){return Math.abs(qa.rd(a,c))},re:function(a,c){return Math.atan2(Math.sin(a)+Math.sin(c),Math.cos(a)+Math.cos(c))}},Hb={get:function(a,c,d){var e=new XMLHttpRequest;e.open("GET",a,!0);e.withCredentials=!1;e.onreadystatechange=function(){4===e.readyState&&(200===e.status||0===e.status?c(e.responseText):"undefined"!== +typeof d&&d(e.status))};e.send()},hf:function(a,c){Hb.get(a,function(d){c(JSON.parse(d))})},Ef:function(a,c,d){var e=new XMLHttpRequest;e.open("POST",a,!0);e.setRequestHeader("Content-type","application/x-www-form-urlencoded");e.onreadystatechange=function(){4!==e.readyState||200!==e.status&&0!==e.status||d(e.responseText)};e.send(c)},Ye:function(a,c){var d=new XMLHttpRequest;d.open("POST",a,!0);d.responseType="arraybuffer";d.onload=function(){c(d.response)};d.send()}},db={Sf:function(a,c,d){a=Math.min(Math.max((d- +a)/(c-a),0),1);return a*a*(3-2*a)},Ra:function(a,c,d){return Math.min(Math.max((d-a)/(c-a),0),1)},Se:function(a,c,d,e){return Math.pow(Math.min(Math.max((e-a)/(c-a),0),1),d)},Wf:function(){return 0},Df:function(){return 1},Cf:function(a){return a},Pe:function(a){return a*a},Ue:function(a){return a*(2-a)},Me:function(a){return.5>a?2*a*a:-1+(4-2*a)*a},Ke:function(a){return a*a*a},Te:function(a){return--a*a*a+1},Le:function(a){return.5>a?4*a*a*a:(a-1)*(2*a-2)*(2*a-2)+1},Qe:function(a){return a*a*a*a}, +Ve:function(a){return 1- --a*a*a*a},Ne:function(a){return.5>a?8*a*a*a*a:1-8*--a*a*a*a},Re:function(a){return a*a*a*a*a},We:function(a){return 1+--a*a*a*a*a},Oe:function(a){return.5>a?16*a*a*a*a*a:1+16*--a*a*a*a*a}},Zb={wd:function(a,c,d){switch(a){case "relu":return d+"=max(vec4(0.,0.,0.,0.),"+c+");";case "elu":return d+"=mix(exp(-abs("+c+"))-vec4(1.,1.,1.,1.),"+c+",step(0.,"+c+"));";case "elu01":return d+"=mix(0.1*exp(-abs("+c+"))-vec4(0.1,0.1,0.1,0.1),"+c+",step(0.,"+c+"));";case "arctan":return d+ +"=atan(3.14159265359*texture2D(u0,vUV))/3.14159265359;";case "copy":return"";default:return!1}}},y=function(){function a(u,p,D){p=u.createShader(p);u.shaderSource(p,D);u.compileShader(p);return u.getShaderParameter(p,u.COMPILE_STATUS)?p:!1}function c(u,p,D){p=a(u,u.VERTEX_SHADER,p);D=a(u,u.FRAGMENT_SHADER,D);u===b&&t.push(p,D);var O=u.createProgram();u.attachShader(O,p);u.attachShader(O,D);u.linkProgram(O);return O}function d(u,p){void 0===p.ja&&(p.ja="precision lowp float;attribute vec2 a0;varying vec2 vv0;void main(){gl_Position=vec4(a0,0.,1.),vv0=a0*.5+vec2(.5,.5);}"); +void 0===p.Ga&&(p.Ga=["a0"]);void 0===p.ra&&(p.ra=[2]);if(void 0===p.precision||"highp"===p.precision)p.precision=h;p.id=w++;void 0!==p.Zd&&p.Zd.forEach(function(O,ba){p.a=p.a.replace(O,p.Ya[ba])});p.Kb=0;p.ra.forEach(function(O){p.Kb+=4*O});p.ha=c(u,p.ja,"precision "+p.precision+" float;\n"+p.a);p.j={};p.c.forEach(function(O){p.j[O]=u.getUniformLocation(p.ha,O)});p.attributes={};p.sa=[];p.Ga.forEach(function(O){var ba=u.getAttribLocation(p.ha,O);p.attributes[O]=ba;p.sa.push(ba)});if(p.f){u.useProgram(p.ha); +g=p;q=p.id;for(var D in p.f)u.uniform1i(p.j[D],p.f[D])}p.sb=!0}function e(u){wa.ee(L);q!==u.id&&(L.M(),q=u.id,g=u,b.useProgram(u.ha),u.sa.forEach(function(p){0!==p&&b.enableVertexAttribArray(p)}))}function f(u,p,D){d(u,p,D);u.useProgram(p.ha);u.enableVertexAttribArray(0);q=-1;return g=p}function n(){return{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",c:["u1"],f:{u1:0}}}var t=[],q=-1,g=null,w=0,B=!1,h="highp",A=["u1"],k=["u0"],I={u1:0},H={u0:0},C={u1:0,u2:1}, +r={u3:0},v={s0:n(),s1:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",c:A,f:I,precision:"lowp"},s2:{a:"uniform sampler2D u1,u2;varying vec2 vv0;void main(){vec4 a=texture2D(u2,vv0),b=texture2D(u1,vv0);gl_FragColor=a*b;}",c:["u1","u2"],f:C},s3:{a:"uniform sampler2D u1;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=a.r*f;}",c:A,f:I},s4:{a:"uniform sampler2D u1,u2;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u2,vv0),b=texture2D(u1,vv0);gl_FragColor=a.a*b.r*f;}", +c:["u1","u2"],f:C},s5:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(1.-vv0.x,vv0.y));}",c:A,f:I},s6:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(vv0.x,1.-vv0.y));}",c:A,f:I},s7:{a:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=a*u4;}",c:["u0","u4"],f:H},s8:{a:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;const vec4 f=vec4(.25,.25,.25,.25),g=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);float b=dot(a*u4,f);gl_FragColor=b*g;}", +c:["u0","u4"],f:H},s9:{a:"uniform sampler2D u1;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){float a=.25*dot(e,texture2D(u1,vv0));gl_FragColor=a*e;}",c:A,f:I},s10:{a:"uniform sampler2D u1,u5;uniform float u6;const vec4 f=vec4(1.,1.,1.,1.);varying vec2 vv0;void main(){vec4 a=texture2D(u1,vv0),b=texture2D(u5,vv0);gl_FragColor=mix(b,a,u6*f);}",c:["u1","u5","u6"],f:{u1:0,u5:1}},s11:{a:"uniform sampler2D u1;uniform vec2 u7;varying vec2 vv0;void main(){gl_FragColor=.25*(texture2D(u1,vv0+u7)+texture2D(u1,vv0+u7*vec2(1.,-1.))+texture2D(u1,vv0+u7*vec2(-1.,-1.))+texture2D(u1,vv0+u7*vec2(-1.,1.)));}", +c:["u1","u7"],f:I},s12:{a:"uniform sampler2D u1;uniform vec4 u8;varying vec2 vv0;float g(float a,float b){a=floor(a)+.5;return floor(a/exp2(b));}float h(float a,float b){return floor(a*exp2(b)+.5);}float i(float a,float b){return mod(a,h(1.,b));}float e(float c,float a,float b){a=floor(a+.5),b=floor(b+.5);return i(g(c,a),b-a);}vec4 j(float a){if(a==0.)return vec4(0.,0.,0.,0.);float k=128.*step(a,0.);a=abs(a);float c=floor(log2(a)),l=c+127.,b=(a/exp2(c)-1.)*8388608.,d=l/2.,m=fract(d)*2.,n=floor(d),o=e(b,0.,8.),p=e(b,8.,16.),q=m*128.+e(b,16.,23.),r=k+n;return vec4(o,p,q,r)/255.;}void main(){float a=dot(texture2D(u1,vv0),u8);gl_FragColor=j(a);}", +c:["u1","u8"],f:I},s13:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=e/(e+exp(-a));gl_FragColor=b;}",c:k,f:H},s14:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(0.,0.,0.,0.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=max(f,a);}",c:k,f:H},s15:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=mix(exp(-abs(a))-f,a,step(0.,a));}",c:k,f:H},s16:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=exp(-abs(a))-f;gl_FragColor=mix(.1*b,a,step(0.,a));}", +c:k,f:H},s17:{a:"uniform sampler2D u0,u6,u9;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),c=texture2D(u6,vv0),d=texture2D(u9,vv0),b=a/d;gl_FragColor=c*mix(exp(-abs(b))-f,b,step(0.,a));}",c:["u0","u6","u9"],f:{u0:0,u6:1,u9:2}},s18:{a:"uniform sampler2D u0;const float e=3.141593;varying vec2 vv0;void main(){gl_FragColor=atan(e*texture2D(u0,vv0))/e;}",c:k,f:H},s19:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=log(f+a);gl_FragColor=b;}", +c:k,f:H},s20:{a:"uniform sampler2D u0,u10;uniform float u11;const vec2 e=vec2(.5,.5);const float f=1e-5;const vec4 g=vec4(1.,1.,1.,1.),i=vec4(0.,0.,0.,0.);varying vec2 vv0;void main(){vec4 a=texture2D(u10,e);float b=u11*u11;vec4 c=max(b*a,f*g);gl_FragColor=texture2D(u0,vv0)/c;}",c:["u0","u10","u11"],f:{u0:0,u10:1}},s21:{a:"uniform sampler2D u1;uniform vec2 u12;varying vec2 vv0;void main(){float a=u12.x*u12.y;vec2 b=floor(vv0*a)/a,c=fract(vv0*a),d=floor(b*u12.y),f=floor(u12.x*fract(b*u12.y)),g=(f*u12.y+d)/a;gl_FragColor=texture2D(u1,g+c/a);}", +c:["u1","u12"],f:I},s22:{a:"uniform sampler2D u13,u14,u15;varying vec2 vv0;void main(){vec4 a=texture2D(u15,vv0);vec2 b=a.rg,c=a.ba;vec4 d=texture2D(u13,b),f=texture2D(u14,c);gl_FragColor=d*f;}",c:["u13","u14","u15"],f:{u14:0,u13:1,u15:2}},s23:{a:"uniform float u16;uniform sampler2D u13,u14;varying vec2 vv0;void main(){vec2 a=fract(vv0*u16);vec4 b=texture2D(u13,vv0),c=texture2D(u14,a);gl_FragColor=b*c;}",c:["u14","u13","u16"],f:{u14:0,u13:1}},s24:{a:"uniform float u16;uniform sampler2D u13,u14,u17,u18,u19,u20;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.),g=vec4(1e-3,1e-3,1e-3,1e-3);void main(){vec2 h=vv0*u16,l=floor(h),c=h-l;vec4 m=texture2D(u13,vv0),d=texture2D(u14,c),a=texture2D(u20,vv0);a=a*255.;vec4 n=texture2D(u17,c),o=texture2D(u18,c),p=texture2D(u19,c),i=step(-g,-a),b=e-i,j=b*step(-e-g,-a);b*=e-j;vec4 k=b*step(-2.*e-g,-a);b*=e-k;vec4 q=b;d=i*d+j*n+k*o+q*p,gl_FragColor=m*d;}", c:"u13 u14 u16 u20 u17 u18 u19".split(" "),f:{u14:0,u13:1,u20:3,u17:4,u18:5,u19:6}},s25:{a:"uniform sampler2D u13,u14,u21;uniform float u16,u22,u23,u24;varying vec2 vv0;const vec2 j=vec2(1.,1.);void main(){vec2 a=floor(u22*vv0),b=u22*vv0-a;float c=u16/u22;vec2 d=floor(b*c),f=b*c-d,g=(a+f)/u22;float k=u22*u24/u16;vec2 l=k*d,h=(l+f*u23)/u24,i=step(h,j);vec4 m=texture2D(u13,g),n=texture2D(u14,h),o=m*n*i.x*i.y,p=texture2D(u21,g);gl_FragColor=o*u23*u23+p;}",c:"u13 u14 u16 u22 u23 u24 u21".split(" "),f:{u14:0, u13:1,u21:2}},s26:{a:"uniform sampler2D u13,u14;varying vec2 vv0;void main(){vec4 a=texture2D(u13,vv0),b=texture2D(u14,vv0);gl_FragColor=a*b;}",c:["u13","u14"],f:{u14:0,u13:1}},s27:{a:"uniform sampler2D u1,u21;uniform float u25;varying vec2 vv0;void main(){gl_FragColor=texture2D(u21,vv0)+u25*texture2D(u1,vv0);}",c:["u1","u21","u25"],f:{u1:0,u21:1}},s28:{a:"varying vec2 vv0;uniform sampler2D u1;const vec4 f=vec4(1.,1.,1.,1.),g=vec4(.299,.587,.114,0.);void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=dot(a,g)*f;}", -c:m,f:y,precision:"lowp"},s29:{a:"varying vec2 vv0;uniform sampler2D u1;uniform float u26;const vec3 f=vec3(.299,.587,.114);void main(){vec3 a=texture2D(u1,vv0).rgb,b=texture2D(u1,vv0+vec2(0.,u26)).rgb,c=texture2D(u1,vv0+vec2(u26,u26)).rgb,d=texture2D(u1,vv0+vec2(u26,0.)).rgb;gl_FragColor=vec4(dot(a,f),dot(b,f),dot(c,f),dot(d,f));}",c:["u1","u26"],f:y,precision:"lowp"},s30:{a:"varying vec2 vv0;uniform sampler2D u1;uniform float u26;const vec3 f=vec3(.299,.587,.114);void main(){vec3 a=texture2D(u1,vv0).rgb,b=texture2D(u1,vv0+vec2(0.,u26)).rgb,c=texture2D(u1,vv0+vec2(u26,u26)).rgb,d=texture2D(u1,vv0+vec2(u26,0.)).rgb;gl_FragColor=vec4(a.r,b.g,c.b,dot(d,f));}", -c:["u1","u26"],f:y,precision:"lowp"},s31:{a:"varying vec2 vv0;uniform sampler2D u1,u2;uniform float u27;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=vec4(0.);a-=texture2D(u1,vec2(vv0.x-u27,vv0.y-u27))*1.,a-=texture2D(u1,vec2(vv0.x-u27,vv0.y))*2.,a-=texture2D(u1,vec2(vv0.x-u27,vv0.y+u27))*1.,a+=texture2D(u1,vec2(vv0.x+u27,vv0.y-u27))*1.,a+=texture2D(u1,vec2(vv0.x+u27,vv0.y))*2.,a+=texture2D(u1,vec2(vv0.x+u27,vv0.y+u27))*1.;vec4 b=vec4(0.);b-=texture2D(u1,vec2(vv0.x-u27,vv0.y-u27))*1.,b-=texture2D(u1,vec2(vv0.x,vv0.y-u27))*2.,b-=texture2D(u1,vec2(vv0.x+u27,vv0.y-u27))*1.,b+=texture2D(u1,vec2(vv0.x-u27,vv0.y+u27))*1.,b+=texture2D(u1,vec2(vv0.x,vv0.y+u27))*2.,b+=texture2D(u1,vec2(vv0.x+u27,vv0.y+u27))*1.;vec3 c=sqrt(a.rgb*a.rgb+b.rgb*b.rgb);vec4 e=vec4(c,texture2D(u1,vv0).a),g=texture2D(u2,vv0);gl_FragColor=g.a*e.r*f;}", -c:["u1","u2","u27"],f:O},s32:{a:"varying vec2 vv0;uniform sampler2D u1,u2;uniform float u27;const vec4 j=vec4(1.,1.,1.,1.);const vec2 k=vec2(1.,1.);void main(){float h=0.;vec2 l=k*u27,a,b;float c,d,i=0.;for(float e=-4.;e<=4.;e+=1.)for(float f=-4.;f<=4.;f+=1.)a=vec2(e,f),c=length(a)/2.,d=exp(-c*c),b=vv0+l*a,h+=d*texture2D(u1,b).r,i+=d;vec4 m=texture2D(u2,vv0);gl_FragColor=m.a*(texture2D(u1,b).r-h/i)*j;}",c:["u1","u2","u27"],f:O},s33:{a:"uniform sampler2D u3;uniform vec2 u7;varying vec2 vv0;vec4 e(vec4 a,vec4 b){vec4 c=step(a,b);return mix(a,b,c);}const vec2 g=vec2(.5,.5),h=vec2(1.,0.),i=vec2(0.,1.);void main(){vec2 a=vv0-u7*g;vec4 b=texture2D(u3,a),c=texture2D(u3,a+u7*h),d=texture2D(u3,a+u7*i),j=texture2D(u3,a+u7),k=e(b,c),l=e(d,j);gl_FragColor=e(k,l);}", -c:["u3","u7"],f:N},s34:{a:"uniform sampler2D u3;uniform vec2 u7;varying vec2 vv0;const vec2 k=vec2(1.,0.),l=vec2(0.,1.),m=vec2(2.,0.),n=vec2(0.,2.);vec4 e(vec4 a,vec4 b){vec4 c=step(a,b);return mix(a,b,c);}vec4 f(vec2 a){vec4 b=texture2D(u3,a),c=texture2D(u3,a+u7*k),d=texture2D(u3,a+u7*l),g=texture2D(u3,a+u7),h=e(b,c),i=e(d,g);return e(h,i);}void main(){vec2 a=vv0+u7*vec2(-.55,-1.05);vec4 b=f(a),c=f(a+u7*m),d=f(a+u7*2.),g=f(a+u7*n),h=e(b,c),i=e(d,g);gl_FragColor=e(h,i);}",c:["u3","u7"],f:N},s35:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=a*a;}", -c:["u1"],f:y,precision:"lowp"},s36:{a:"uniform sampler2D u1;uniform vec2 u7;varying vec2 vv0;const float e=15444.;void main(){vec4 a=1001./e*texture2D(u1,vv0-3.*u7)+2002./e*texture2D(u1,vv0-2.*u7)+3003./e*texture2D(u1,vv0-u7)+3432./e*texture2D(u1,vv0)+3003./e*texture2D(u1,vv0+u7)+2002./e*texture2D(u1,vv0+2.*u7)+1001./e*texture2D(u1,vv0+3.*u7);gl_FragColor=a;}",c:["u7","u1"],f:y,precision:"lowp"},s37:{a:"uniform sampler2D u1,u28,u29;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);const float g=.1;void main(){vec4 a=texture2D(u28,vv0),b=texture2D(u29,vv0),c=texture2D(u1,vv0),d=max(f*g,b-a*a),h=sqrt(d);gl_FragColor=(c-a)/h;}", -c:["u1","u28","u29"],f:{u1:0,u28:1,u29:2}}},C={s38:{a:"uniform float u16,u30;uniform sampler2D u13,u14,u21;varying vec2 vv0;const vec2 ZERO2=vec2(0.,0.),ONE2=vec2(1.,1.),HALF2=vec2(.5,.5),EPS2=vec2(1e-5,1e-5);void main(){vec4 sum=texture2D(u21,vv0);float toSparsity=1.1111;vec2 uvFrom,uvWeight,xyPatch=ZERO2,eps2=EPS2/u16,xyTo=floor(vv0*u16+eps2);float weightSize=toSparsity*u16;vec2 halfFromSparsity=ONE2*(toSparsity-1.)/2.;for(float patch_x=0.;patch_x<1.1111;patch_x+=1.){xyPatch.x=patch_x;for(float patch_y=0.;patch_y<1.1111;patch_y+=1.)xyPatch.y=patch_y,uvFrom=(xyTo+HALF2+u30*(xyPatch-halfFromSparsity))/u16,uvFrom+=step(uvFrom,-eps2),uvFrom-=step(ONE2-eps2,uvFrom),uvWeight=(xyTo*toSparsity+xyPatch+HALF2)/weightSize,sum+=texture2D(u13,uvWeight)*texture2D(u14,uvFrom);}gl_FragColor=sum,gl_FragColor*=2.2222;}", -c:["u16","u13","u14","u21","u30"],Ta:["1.1111","gl_FragColor\\*=2.2222;"]},s39:{a:"uniform float u16,u30,u24;uniform sampler2D u13,u14,u21;varying vec2 vv0;const vec2 ZERO2=vec2(0.,0.),ONE2=vec2(1.,1.),HALF2=vec2(.5,.5),EPS2=vec2(1e-4,1e-4);void main(){vec4 sum=texture2D(u21,vv0);float fromSparsity=1.1111,shrinkFactor=3.3333;vec2 uvFrom,uvWeight,xyFrom,xyPatchTo,xyPatch=ZERO2,xyShrink=ZERO2,eps2=EPS2/u24,xyTo=floor(vv0*u16+eps2);float weightSize=fromSparsity*u24;vec2 halfFromSparsity=ONE2*(fromSparsity-1.)/2.;float toSparsity=weightSize/u16;vec2 xyFrom0=xyTo*shrinkFactor;for(float patch_x=0.;patch_x<1.1111;patch_x+=1.){xyPatch.x=patch_x;for(float patch_y=0.;patch_y<1.1111;patch_y+=1.){xyPatch.y=patch_y;for(float shrink_x=0.;shrink_x<3.3333;shrink_x+=1.){xyShrink.x=shrink_x;for(float shrink_y=0.;shrink_y<3.3333;shrink_y+=1.)xyShrink.y=shrink_y,xyFrom=xyFrom0+xyShrink+shrinkFactor*u30*(xyPatch-halfFromSparsity),uvFrom=(xyFrom+HALF2)/u24,uvFrom+=step(uvFrom,-eps2),uvFrom-=step(ONE2-eps2,uvFrom),xyPatchTo=xyPatch*shrinkFactor+xyShrink,uvWeight=(xyTo*toSparsity+xyPatchTo+HALF2)/weightSize,sum+=texture2D(u13,uvWeight)*texture2D(u14,uvFrom);}}}gl_FragColor=sum,gl_FragColor*=2.2222;}", -c:"u16 u24 u13 u14 u21 u30".split(" "),Ta:["1.1111","gl_FragColor\\*=2.2222;","3.3333"]}},G={La:function(){return q},o:function(){if(!q){x="highp";for(var g in F)d(F[g],g);u.set("s0");b.enableVertexAttribArray(0);q=!0;return Wa.o()}},Fc:function(g){g.forEach(function(w){G.Eb(w)})},Eb:function(g){F[g.id]=g;d(g,g.id)},ac:function(g,w,A){w||(w=g);F[w]=Object.create(C[g]);F[w].wd=!0;C[g].Ta&&C[g].Ta.forEach(function(Z,na){F[w].a=F[w].a.replace(new RegExp(Z,"g"),A[na])});d(F[w],w)},set:function(g){e(F[g])}, -hd:function(g){return"undefined"===typeof F[g]?!1:F[g].kb},la:function(){-1!==k&&(k=-1,l.oa.forEach(function(g){0!==g&&b.disableVertexAttribArray(g)}))},zb:function(){var g=0;l.oa.forEach(function(w,A){A=l.na[A];b.vertexAttribPointer(w,A,b.FLOAT,!1,l.Bb,g);g+=4*A})},Pb:function(){b.enableVertexAttribArray(0)},za:function(){b.vertexAttribPointer(l.oa[0],2,b.FLOAT,!1,8,0)},vc:function(g,w){b.uniform1i(l.j[g],w)},A:function(g,w){b.uniform1f(l.j[g],w)},ya:function(g,w,A){b.uniform2f(l.j[g],w,A)},yf:function(g, -w){b.uniform2fv(l.j[g],w)},zf:function(g,w){b.uniform3fv(l.j[g],w)},Td:function(g,w,A,Z){b.uniform3f(l.j[g],w,A,Z)},Af:function(g,w,A,Z,na){b.uniform4f(l.j[g],w,A,Z,na)},yb:function(g,w){b.uniform4fv(l.j[g],w)},Bf:function(g,w){b.uniformMatrix2fv(l.j[g],!1,w)},Cf:function(g,w){b.uniformMatrix3fv(l.j[g],!1,w)},Df:function(g,w){b.uniformMatrix4fv(l.j[g],!1,w)},K:function(g,w){G.set(g);w.forEach(function(A){switch(A.type){case "4f":b.uniform4fv(l.j[A.name],A.value);break;case "3f":b.uniform3fv(l.j[A.name], -A.value);break;case "2f":b.uniform2fv(l.j[A.name],A.value);break;case "1f":b.uniform1f(l.j[A.name],A.value);break;case "1i":b.uniform1i(l.j[A.name],A.value);break;case "mat2":b.uniformMatrix2fv(l.j[A.name],!1,A.value);break;case "mat3":b.uniformMatrix3fv(l.j[A.name],!1,A.value);break;case "mat4":b.uniformMatrix4fv(l.j[A.name],!1,A.value)}})},We:function(){return"lowp"},h:function(){b.disableVertexAttribArray(0);G.la();for(var g in F){var w=F[g];w.kb&&(w.kb=!1,b.deleteProgram(w.wa));w.wd&&delete F[g]}f.forEach(function(A){b.deleteShader(A)}); -f.splice(0);n=0;q=!1}};return G}(),b=null,Aa=function(){function a(m){console.log("ERROR in ContextFeedForward: ",m);return!1}function c(){if(navigator.userAgent&&-1!==navigator.userAgent.indexOf("forceWebGL1")||/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream)return!0;if(/(Mac)/i.test(navigator.platform)){var m;(m=navigator.userAgent)?(m=m.match(/Mac OS X (\d+)_(\d+)/)||m.match(/Mac OS X (\d+).(\d+)/),m=!m||3>m.length?!1:[parseInt(m[1],10),parseInt(m[2],10)]):m=!1;if(m&&10===m[0]&& -15===m[1])return!0}return!1}var d=null,e=null,f=null,k=null,l=!0,n=null,q=null,x={B:function(){return d.width},O:function(){return d.height},Ne:function(){return d},Me:function(){return b},F:function(){return l},flush:function(){b.flush()},nd:function(){n||(n=new Uint8Array(d.width*d.height*4));b.readPixels(0,0,d.width,d.height,b.RGBA,b.UNSIGNED_BYTE,n);return n},Pe:function(){return d.toDataURL("image/jpeg")},Qe:function(){ta.H();e||(e=document.createElement("canvas"),f=e.getContext("2d"));e.width= -d.width;e.height=d.height;for(var m=x.nd(),p=f.createImageData(e.width,e.height),y=e.width,z=e.height,O=p.data,N=0;Nq.da.length?(F=Uint16Array,O=b.UNSIGNED_SHORT,N=2):(F=Uint32Array,O=b.UNSIGNED_INT,N=4);b.bufferData(b.ELEMENT_ARRAY_BUFFER,q.da instanceof F?q.da:new F(q.da),p);f=x}var C={Oc:function(G){e!== -x&&(b.bindBuffer(b.ARRAY_BUFFER,y),e=x);G&&Ia.zb()},Lc:function(){f!==x&&(b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,z),f=x)},bind:function(G){C.Oc(G);C.Lc()},ue:function(){b.drawElements(b.TRIANGLES,m,O,0)},ve:function(G,g){b.drawElements(b.TRIANGLES,G,O,g*N)},remove:function(){b.deleteBuffer(y);q.da&&b.deleteBuffer(z);C=null}};l.push(C);return C},pa:function(){-1!==e&&(b.bindBuffer(b.ARRAY_BUFFER,a),e=-1);-1!==f&&(b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,c),f=-1)},g:function(q,x){q&&ka.pa();x&&Ia.za();b.drawElements(b.TRIANGLES, -3,b.UNSIGNED_SHORT,0)},Vb:function(){b.deleteBuffer(a);b.deleteBuffer(c)},h:function(){n.Vb();l.forEach(function(q){q.remove()});b.bindBuffer(b.ARRAY_BUFFER,null);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,null);n.reset();k=!1;l.splice(0);d=0}};return n}(),Y=function(){var a=null,c=null,d=null,e=!1,f=[],k={v:-2,Sb:1},l={La:function(){return e},o:function(){if(!e){a=b.createFramebuffer();var n=aa.F();c=n&&b.DRAW_FRAMEBUFFER?b.DRAW_FRAMEBUFFER:b.FRAMEBUFFER;d=n&&b.READ_FRAMEBUFFER?b.READ_FRAMEBUFFER:b.FRAMEBUFFER; -e=!0}},Se:function(){return c},gb:function(){return d},ca:function(){return b.FRAMEBUFFER},Ze:function(){return k},Le:function(){return a},instance:function(n){void 0===n.cc&&(n.cc=!1);var q=n.X?n.X:null,x=n.width,m=void 0!==n.height?n.height:n.width,p=a,y=null,z=!1,O=!1,N=0;q&&(x=x?x:q.B(),m=m?m:q.O());var F={uc:function(){z||(p=b.createFramebuffer(),z=!0,N=k.Sb++)},Ec:function(){F.uc();F.l();y=b.createRenderbuffer();b.bindRenderbuffer(b.RENDERBUFFER,y);b.renderbufferStorage(b.RENDERBUFFER,b.DEPTH_COMPONENT16, -x,m);b.framebufferRenderbuffer(c,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,y);b.clearDepth(1)},bind:function(C,G){N!==k.v&&(b.bindFramebuffer(c,p),k.v=N);q&&q.l();G&&b.viewport(0,0,x,m);C&&b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)},ge:function(){N!==k.v&&(b.bindFramebuffer(c,p),k.v=N)},clear:function(){b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)},oe:function(){b.clear(b.COLOR_BUFFER_BIT)},pe:function(){b.clear(b.DEPTH_BUFFER_BIT)},Ud:function(){b.viewport(0,0,x,m)},l:function(){N!==k.v&&(b.bindFramebuffer(c, -p),k.v=N)},rtt:function(C){q=C;k.v!==N&&(b.bindFramebuffer(b.FRAMEBUFFER,p),k.v=N);C.l()},H:function(){b.bindFramebuffer(c,null);k.v=-1},resize:function(C,G){x=C;m=G;y&&(b.bindRenderbuffer(b.RENDERBUFFER,y),b.renderbufferStorage(b.RENDERBUFFER,b.DEPTH_COMPONENT16,x,m))},remove:function(){p===a||O||(b.bindFramebuffer(c,p),b.framebufferTexture2D(c,b.COLOR_ATTACHMENT0,b.TEXTURE_2D,null,0),y&&b.framebufferRenderbuffer(c,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,null),b.bindFramebuffer(c,null),b.deleteFramebuffer(p), -y&&b.deleteRenderbuffer(y));O=!0}};n.cc&&F.Ec();f.push(F);return F},H:function(){b.bindFramebuffer(c,null);k.v=-1},$d:function(){b.bindFramebuffer(c,null);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);b.viewport(0,0,aa.B(),aa.O());k.v=-1},reset:function(){k.v=-2},V:function(){0!==k.v&&(b.bindFramebuffer(c,a),k.v=0)},clear:function(){b.viewport(0,0,aa.B(),aa.O());b.clear(b.COLOR_BUFFER_BIT)},h:function(){l.H();f.forEach(function(n){n.remove()});b.deleteFramebuffer(a);l.reset();e=!1;f.splice(0);k.v= --2;k.Sb=1}};return l}(),Ca=function(){function a(r){b.bindTexture(b.TEXTURE_2D,r)}function c(r){la[0]=r;r=ca[0];var D=r>>16&32768,h=r>>12&2047,J=r>>23&255;return 103>J?D:142J?(h|=2048,D|(h>>114-J)+(h>>113-J&1)):D=(D|J-112<<10|h>>1)+(h&1)}function d(r){var D=new Uint16Array(r.length);r.forEach(function(h,J){D[J]=c(h)});return D}function e(){if(null!==oa.ib)return oa.ib;var r=k(d([1,1,1,1]));return null===r?!0:oa.ib=r}function f(){if(null!==oa.jb)return oa.jb; -var r=k(new Uint8Array([255,255,255,255]));return null===r?!0:oa.jb=r}function k(r){if(!Ia.La()||!N)return null;var D=null;try{var h=b.getError();D=B.instance({isFloat:!1,I:!0,array:r,width:1});h=b.getError();if(h!==b.NO_ERROR)return!1}catch(J){return!1}Y.H();b.viewport(0,0,1,1);b.clearColor(0,0,0,0);b.clear(b.COLOR_BUFFER_BIT);Ia.set("s0");D.Gb(0);ka.g(!1,!0);r=new Uint8Array(4);b.readPixels(0,0,1,1,b.RGBA,b.UNSIGNED_BYTE,r);r=.9D;++D)r[D]=2*Math.random()-1;m={random:B.instance({isFloat:!0,isPot:!0,array:r,width:64}),Ac:B.instance({isFloat:!1,isPot:!0,width:1,array:new Uint8Array([0,0,0,0])})}}N=!0}},td:function(){B.be()},cf:function(){return m.Ac}, -be:function(){y[1]=aa.Ja()},Od:function(){O=z=[b.RGBA,b.RGBA,b.RGBA,b.RGBA]},rf:function(r,D){u.set("s1");Y.H();var h=r.B(),J=r.O();b.viewport(0,0,h,J);r.b(0);ka.g(!1,!1);b.readPixels(0,0,h,J,b.RGBA,b.UNSIGNED_BYTE,D)},Tb:function(r,D,h,J,qa){b.activeTexture(b.TEXTURE0);var va=b.createTexture();a(va);var ra=aa.F()&&b.RGBA32F?b.RGBA32F:b.FLOAT;J=J instanceof Float32Array?J:new Float32Array(J);0!==pa.Ad(J.length)%1&&(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D, -b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE));b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,qa);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,D,h,0,b.RGBA,ra,J);a(null);b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1);Y.V();u.set("s0");b.viewport(0,0,D,h);b.framebufferTexture2D(Y.ca(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,r,0);b.clearColor(0,0,0,0);b.clear(b.COLOR_BUFFER_BIT);a(va);ka.g(!0,!1);b.deleteTexture(va);x[0]=-1; -p=null;l=0},instance:function(r){function D(){a(sa);wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,wa);h.isPot?(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,h.isMirrorX?b.MIRRORED_REPEAT:b.REPEAT),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,h.isMirrorY?b.MIRRORED_REPEAT:b.REPEAT)):(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE));h.isAnisotropicFiltering&&"undefined"!==typeof JESETTINGS&&b.texParameterf(b.TEXTURE_2D,JEContext.Re().TEXTURE_MAX_ANISOTROPY_EXT, -JESETTINGS.ee);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,h.isLinear?b.LINEAR:b.NEAREST);h.isLinear?b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,h.isMipmap&&!Ja?b.NEAREST_MIPMAP_LINEAR:b.LINEAR):b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,h.isMipmap&&!Ja?b.NEAREST_MIPMAP_NEAREST:b.NEAREST);fa=z[h.Oa-1];ia=O[h.Oa-1];ja=y[qa];if(aa.F()){var v=b.RGBA32F;fa===b.RGBA&&ja===b.FLOAT&&v&&(ia=v);fa===b.RGB&&ja===b.FLOAT&&v&&(ia=v,fa=b.RGBA)}if(h.I&&!h.isFloat||h.isFloat&&h.isMipmap&&Wa.zd())(v= -b.RGBA16F)&&(ia=v),ja=aa.Ja();h.ob&&(fb=h.ob);h.isSrgb&&4===h.Oa&&(fa=JEContext.af());if(h.D)b.texImage2D(b.TEXTURE_2D,0,ia,fa,ja,h.D);else if(h.url)b.texImage2D(b.TEXTURE_2D,0,ia,fa,ja,Fa);else if(xa){try{b.getError(),b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,xa),b.getError()!==b.NO_ERROR&&(b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,null),b.getError()!==b.NO_ERROR&&b.texImage2D(b.TEXTURE_2D,0,b.RGBA,K,L,0,b.RGBA,b.UNSIGNED_BYTE,null))}catch(ic){b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,null)}h.isKeepArray|| -(xa=null)}else b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,null);if(h.isMipmap)if(!Ja&&X)X.fb(),gb=!0;else if(Ja){v=Math.log(Math.min(K,L))/Math.log(2);Ta=Array(1+v);Ta[0]=sa;for(var M=1;M<=v;++M){var da=Math.pow(2,M),P=K/da;da=L/da;var Ka=b.createTexture();a(Ka);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texImage2D(b.TEXTURE_2D,0,ia,P,da,0,fa,ja,null);a(null);Ta[M]=Ka}gb=!0}a(null);x[l]=-1;wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL, -!1);hb=!0;h.aa&&X&&(h.aa(X),h.aa=null)}var h=Object.assign({},C,r),J=q++;null===h.isFlipY&&(h.isFlipY=h.url||h.array?!0:!1);h.data&&(h.array="string"===typeof h.data?Pb(h.data):h.isFloat?new Float32Array(h.data):new Uint8Array(h.data),h.isFlipY=!1);var qa=0,va=h.D?!0:!1,ra=null,Ua=null,Kb=!1,zb=null;h.I=h.I||h.isFloat;h.I&&(qa=1);h.vd||aa.F()||!h.isFloat||!na||aa.Ib()||(h.isFloat=!1);h.isFloat&&(qa=2);h.isAnisotropicFiltering&&Z&&!JEContext.ef()&&(h.isAnisotropicFiltering=!1);var sa=b.createTexture(), -Fa=null,xa=!1,K=0,L=0,hb=!1,ib=!1,ya=null,Ba=null,Ab=null,Xa=null,ia=null,fa=null,ja=null,wa=h.isFlipY,Ja=h.I&&h.isMipmap&&"undefined"!==typeof Wa&&!Wa.Rc()?!0:!1,Ta=null,fb=-1,gb=!1,La={fc:!1,Hb:null,Ub:null};h.width&&(K=h.width,L=h.height?h.height:K);var X={get:function(){return sa},B:function(){return K},O:function(){return L},df:function(){return h.url},ff:function(){return h.isFloat},hf:function(){return h.I},jf:function(){return h.isLinear},fb:function(){b.generateMipmap(b.TEXTURE_2D)},Nc:function(v, -M){Ja?(v||(v=X.Yb()),X.Ua(M),a(Ta[v]),x[M]=-1):X.b(M)},Yb:function(){-1===fb&&(fb=Math.log(K)/Math.log(2));return fb},kd:function(v){if(Ja){v||(v=X.Yb());u.set("s11");X.Ua(0);for(var M=K,da=L,P=1;P<=v;++P)M/=2,da/=2,u.ya("u7",.25/M,.25/da),b.viewport(0,0,M,da),a(Ta[P-1]),b.framebufferTexture2D(Y.ca(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,Ta[P],0),ka.g(!1,1===P);x[0]=-1}else X.fb()},Ua:function(v){v!==l&&(b.activeTexture(n[v]),l=v)},b:function(v){if(!hb)return!1;X.Ua(v);if(x[v]===J)return!1;a(sa);x[v]= -J;return!0},Gb:function(v){b.activeTexture(n[v]);l=v;a(sa);x[v]=J},l:function(){p=X;b.framebufferTexture2D(Y.ca(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,sa,0)},M:function(){p=X;b.viewport(0,0,K,L);b.framebufferTexture2D(Y.ca(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,sa,0)},Ab:B.Ab,resize:function(v,M){K=v;L=M;D()},clone:function(v){v=B.instance({width:K,height:L,I:h.I,isFloat:h.isFloat,isLinear:h.isLinear,isMirrorY:h.isMirrorY,isFlipY:v?!wa:wa,isPot:h.isPot});Ia.set("s0");Y.V();v.l();b.viewport(0,0,K,L);X.b(0); -ka.g(!0,!0);return v},Ud:function(){b.viewport(0,0,K,L)},remove:function(){b.deleteTexture(sa);F.splice(F.indexOf(X),1);X=null},refresh:function(){X.Gb(0);wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);va?b.texImage2D(b.TEXTURE_2D,0,ia,fa,b.UNSIGNED_BYTE,h.D):b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,xa);wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},Mb:function(){var v=K*L*4;Ba=[new Uint8Array(v),new Uint8Array(v),new Uint8Array(v),new Uint8Array(v)];ya=[new Float32Array(Ba[0].buffer),new Float32Array(Ba[1].buffer), -new Float32Array(Ba[2].buffer),new Float32Array(Ba[3].buffer)];Ab=new Uint8Array(4*v);Xa=new Float32Array(Ab.buffer);ib=!0},tc:function(){ib||X.Mb();b.readPixels(0,0,K,4*L,b.RGBA,b.UNSIGNED_BYTE,Ab);for(var v=K*L,M=2*v,da=3*v,P=0;Pv;++v)b.viewport(0,L*v,K,L),u.yb("u8",A[v]),ka.g(!1,0===v)},ae:function(v){var M=ja===y[0]&&!f();a(sa);wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);M?(Kb||(ra=document.createElement("canvas"),ra.width=K,ra.height=L,Ua=ra.getContext("2d"),zb=Ua.createImageData(K,L),Kb=!0),zb.data.set(v),Ua.putImageData(zb,0,0),b.texImage2D(b.TEXTURE_2D,0,ia,fa,ja,ra)):b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,v);x[l]=J;wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL, -!1)},Gf:function(v,M){a(sa);M&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);b.texImage2D(b.TEXTURE_2D,0,ia,fa,ja,v);x[l]=J;M&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},wf:function(v,M){var da=K*L,P=4*da;v=h.I?v?"RGBE":"JSON":"RGBA";M&&(v=M);M=aa.F()&&!1;var Ka=null;switch(v){case "RGBE":Ka="s40";break;case "JSON":Ka=M?"s0":"s12";break;case "RGBA":case "RGBAARRAY":Ka="s6"}ib||("RGBA"===v||"RGBE"===v||"RGBAARRAY"===v?(Ba=new Uint8Array(P),ib=!0):"JSON"!==v||M||X.Mb());Y.H();u.set(Ka);X.b(0);P=null;if("RGBA"=== -v||"RGBE"===v||"RGBAARRAY"===v){b.viewport(0,0,K,L);ka.g(!0,!0);b.readPixels(0,0,K,L,b.RGBA,b.UNSIGNED_BYTE,Ba);if("RGBAARRAY"===v)return{data:Ba};G||(g=document.createElement("canvas"),w=g.getContext("2d"),G=!0);g.width=K;g.height=L;da=w.createImageData(K,L);da.data.set(Ba);w.putImageData(da,0,0);P=g.toDataURL("image/png")}else if("JSON"===v)if(M)P=new Float32Array(da),b.viewport(0,0,K,L),ka.g(!0,!0),b.readPixels(0,0,K,L,b.RGBA,b.FLOAT,P);else{for(P=0;4>P;++P)b.viewport(0,L*P,K,L),u.yb("u8",A[P]), -ka.g(!P,!P);X.tc();P=Array(da);for(M=0;Mla&&(la+=c);la>=c&&(la-=c);for(var ca=0;car&&(r+=c);r>=c&&(r-=c);var D=la/c,h=r/c;B=1-B-1/f;D+=N;h+=N;oa+=F;B+=F;var J=C*e+na,qa= -g*e+ca;qa=d*e-qa-1;J=qa*d*e+J;m[4*J]=oa;m[4*J+1]=B;m[4*J+2]=D;m[4*J+3]=h;h=y[r*c+la]++;J=h%k;D=la*k+J;r=r*k+(h-J)/k;r=c*k-1-r;r=r*c*k+D;p[4*r]=oa;p[4*r+1]=B;p[4*r+2]=A;p[4*r+3]=Z;++n>=f&&(n=0,++q);++x}}}y=null;var va=S.instance(a.weights);delete a.weights.data;var ra=S.instance({width:f,isFloat:!0,array:new Float32Array(p),isPot:!0});p=null;var Ua=S.instance({width:f,isFloat:!0,array:new Float32Array(m),isPot:!0});m=null;return{ka:!0,Ia:function(){return k},h:function(){ra.remove();Ua.remove();va.remove()}, -J:function(){u.set("s22");va.b(1);Ua.b(2);R.g(!1,!1)}}}}}(),ec=function(){return{instance:function(a){var c=a.kernelsNumber,d=a.toSparsity,e=d*a.toLayerSize/a.fromLayerSize,f=S.instance(a.weights);delete a.weights.data;return{ka:!0,Ia:function(){return e},bf:function(){return d},sd:function(){return f},h:function(){f.remove()},J:function(){u.set("s25");u.A("u22",c);u.A("u23",d);u.A("u16",a.toLayerSize);u.A("u24",a.fromLayerSize);f.b(1);R.g(!1,!1)}}}}}(),cc=function(){return{instance:function(a,c){var d= -a.fromLayerSize,e=a.toLayerSize,f=a.toSparsity,k=a.stride?a.stride:1,l=f*e/d,n=e>16&32768,J=l>>12&2047,m=l>>23&255;return 103>m?M:142m?(J|=2048,M|(J>>114-m)+(J>>113-m&1)):M=(M|m-112<<10|J>>1)+(J&1)}function d(l){var M=new Uint16Array(l.length);l.forEach(function(J,m){M[m]=c(J)});return M}function e(){if(null!==pa.qb)return pa.qb;var l=n(d([1,1,1,1]));return null===l?!0:pa.qb=l}function f(){if(null!==pa.rb)return pa.rb;var l=n(new Uint8Array([255,255,255,255]));return null===l?!0:pa.rb=l}function n(l){if(!wa.Qa()|| +!H)return null;var M=null;try{var J=b.getError();if("FUCKING_BIG_ERROR"===J)return!1;M=E.instance({isFloat:!1,H:!0,array:l,width:1});J=b.getError();if(J!==b.NO_ERROR)return!1}catch(m){return!1}la.I();b.viewport(0,0,1,1);b.clearColor(0,0,0,0);b.clear(b.COLOR_BUFFER_BIT);wa.set("s0");M.Pb(0);ma.g(!0,!0);l=new Uint8Array(4);b.readPixels(0,0,1,1,b.RGBA,b.UNSIGNED_BYTE,l);l=.9M;++M)l[M]=2*Math.random()-1;B={random:E.instance({isFloat:!0,isPot:!0,array:l,width:64}),Rc:E.instance({isFloat:!1,isPot:!0,width:1,array:new Uint8Array([0,0,0,0])})}}H=!0}},Gd:function(){E.pe()},tf:function(){return B.Rc},pe:function(){A[1]=ea.ob(b)},ae:function(){I=k=[b.RGBA, +b.RGBA,b.RGBA,b.RGBA]},Ff:function(l,M){y.set("s1");la.I();var J=l.A(),m=l.P();b.viewport(0,0,J,m);l.b(0);ma.g(!1,!1);b.readPixels(0,0,J,m,b.RGBA,b.UNSIGNED_BYTE,M)},jc:function(l,M,J,m,fa,ua,Ca){l.activeTexture(l.TEXTURE0);var ra=l.createTexture();l.bindTexture(l.TEXTURE_2D,ra);fa=fa instanceof Float32Array?fa:new Float32Array(fa);0!==qa.Nd(fa.length)%1&&(l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE));l.texParameteri(l.TEXTURE_2D, +l.TEXTURE_MAG_FILTER,l.NEAREST);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,ua);l.texImage2D(l.TEXTURE_2D,0,l.RGBA,J,m,0,l.RGBA,l.FLOAT,fa);l.bindTexture(l.TEXTURE_2D,null);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,!1);Ca&&(la.X(),y.set("s0"));l.viewport(0,0,J,m);l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,M,0);l.bindTexture(l.TEXTURE_2D,ra);Ca?ma.g(!0,!0):U.Ma(l);l.deleteTexture(ra);H&&(w[0]=-1,h=null,t=0)},instance:function(l){function M(z){if("FUCKING_BIG_ERROR"=== +b.getError())return!1;b.texImage2D(b.TEXTURE_2D,0,ha,ca,ia,z);b.getError()!==b.NO_ERROR&&ca!==b.RGBA&&(ca=b.RGBA,b.texImage2D(b.TEXTURE_2D,0,ha,ca,ia,z));return!0}function J(){a(sa);xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,xa);m.isPot?(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,m.isMirrorX?b.MIRRORED_REPEAT:b.REPEAT),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,m.isMirrorY?b.MIRRORED_REPEAT:b.REPEAT)):(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D, +b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE));m.isAnisotropicFiltering&&"undefined"!==typeof JESETTINGS&&b.texParameterf(b.TEXTURE_2D,JEContext.ef().TEXTURE_MAX_ANISOTROPY_EXT,JESETTINGS.se);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,m.isLinear?b.LINEAR:b.NEAREST);m.isLinear?b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,m.isMipmap&&!Ka?b.NEAREST_MIPMAP_LINEAR:b.LINEAR):b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,m.isMipmap&&!Ka?b.NEAREST_MIPMAP_NEAREST:b.NEAREST);ca=k[m.Ta-1];ha=I[m.Ta-1];ia= +A[ua];if(ea.Z()){var z=b.RGBA32F;ca===b.RGBA&&ia===b.FLOAT?m.isMipmap||m.isLinear?ha=Ba.zd(b):ea.Sb()?z&&(ha=z):ha=b.RGBA16F||b.RGBA:ca===b.RGB&&ia===b.FLOAT&&z&&(ha=z,ca=b.RGBA)}if(m.H&&!m.isFloat||m.isFloat&&m.isMipmap&&Ba.Md())(z=b.RGBA16F)&&(ha=z),ia=ea.ob(b);m.wb&&(fb=m.wb);m.isSrgb&&4===m.Ta&&(ca=JEContext.rf());if(m.D)M(m.D);else if(m.url)M(Ga);else if(ya){z=ya;try{"FUCKING_BIG_ERROR"!==b.getError()&&(b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,z),b.getError()!==b.NO_ERROR&&(b.texImage2D(b.TEXTURE_2D, +0,ha,P,Q,0,ca,ia,null),b.getError()!==b.NO_ERROR&&b.texImage2D(b.TEXTURE_2D,0,b.RGBA,P,Q,0,b.RGBA,b.UNSIGNED_BYTE,null)))}catch(jc){b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,null)}m.isKeepArray||(ya=null)}else"FUCKING_BIG_ERROR"!==b.getError()&&(b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,null),b.getError()!==b.NO_ERROR&&(ca=b.RGBA,m.H&&ia!==b.FLOAT&&(ia=b.FLOAT,b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,null))));if(m.isMipmap)if(!Ka&&aa)aa.nb(),gb=!0;else if(Ka){z=Math.log2(Math.min(P,Q));Va=Array(1+ +z);Va[0]=sa;for(var R=1;R<=z;++R){var ja=Math.pow(2,R),S=P/ja;ja=Q/ja;var La=b.createTexture();a(La);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texImage2D(b.TEXTURE_2D,0,ha,S,ja,0,ca,ia,null);a(null);Va[R]=La}gb=!0}a(null);w[t]=-1;xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1);hb=!0;m.da&&aa&&(m.da(aa),m.da=null)}var m=Object.assign({},r,l),fa=g++;null===m.isFlipY&&(m.isFlipY=m.url||m.array?!0:!1);m.data&&(m.array="string"=== +typeof m.data?Qb(m.data):m.isFloat?new Float32Array(m.data):new Uint8Array(m.data),m.isFlipY=!1);var ua=0,Ca=m.D?!0:!1,ra=null,zb=null,Lb=!1,Ab=null;m.H=m.H||m.isFloat;m.H&&(ua=1);m.Id||ea.Z()||!m.isFloat||!D||ea.Sb()||(m.isFloat=!1);m.isFloat&&(ua=2);m.isAnisotropicFiltering&&p&&!JEContext.vf()&&(m.isAnisotropicFiltering=!1);var sa=b.createTexture(),Ga=null,ya=!1,P=0,Q=0,hb=!1,ib=!1,za=null,Da=null,Bb=null,Xa=null,ha=null,ca=null,ia=null,xa=m.isFlipY;l="undefined"!==typeof Ba&&Ba.ed();var Ka=m.H&& +m.isMipmap&&l?!0:!1,Va=null,fb=-1,gb=!1,Ma={wc:!1,Qb:null,kc:null};m.width&&(P=m.width,Q=m.height?m.height:P);var aa={get:function(){return sa},A:function(){return P},P:function(){return Q},uf:function(){return m.url},wf:function(){return m.isFloat},yf:function(){return m.H},zf:function(){return m.isLinear},nb:function(){b.generateMipmap(b.TEXTURE_2D)},cd:function(z,R){Ka?(z||(z=aa.oc()),aa.bb(R),a(Va[z]),w[R]=-1):aa.b(R)},oc:function(){-1===fb&&(fb=Math.log(P)/Math.log(2));return fb},vd:function(z){if(Ka){z|| +(z=aa.oc());y.set("s11");aa.bb(0);for(var R=P,ja=Q,S=1;S<=z;++S)R/=2,ja/=2,y.Aa("u7",.25/R,.25/ja),b.viewport(0,0,R,ja),a(Va[S-1]),b.framebufferTexture2D(la.Oa(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,Va[S],0),ma.g(!1,1===S);w[0]=-1}else aa.nb()},bb:function(z){z!==t&&(b.activeTexture(q[z]),t=z)},b:function(z){if(!hb)return!1;aa.bb(z);if(w[z]===fa)return!1;a(sa);w[z]=fa;return!0},Pb:function(z){b.activeTexture(q[z]);t=z;a(sa);w[z]=fa},l:function(){h=aa;b.framebufferTexture2D(la.Oa(),b.COLOR_ATTACHMENT0, +b.TEXTURE_2D,sa,0)},N:function(){h=aa;b.viewport(0,0,P,Q);b.framebufferTexture2D(la.Oa(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,sa,0)},Jb:E.Jb,resize:function(z,R){P=z;Q=R;J()},clone:function(z){z=E.instance({width:P,height:Q,H:m.H,isFloat:m.isFloat,isLinear:m.isLinear,isMirrorY:m.isMirrorY,isFlipY:z?!xa:xa,isPot:m.isPot});wa.set("s0");la.X();z.l();b.viewport(0,0,P,Q);aa.b(0);ma.g(!0,!0);return z},ge:function(){b.viewport(0,0,P,Q)},remove:function(){b.deleteTexture(sa);C.splice(C.indexOf(aa),1);aa=null}, +refresh:function(){aa.Pb(0);xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);Ca?b.texImage2D(b.TEXTURE_2D,0,ha,ca,b.UNSIGNED_BYTE,m.D):b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,ya);xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},Wb:function(){var z=P*Q*4;Da=[new Uint8Array(z),new Uint8Array(z),new Uint8Array(z),new Uint8Array(z)];za=[new Float32Array(Da[0].buffer),new Float32Array(Da[1].buffer),new Float32Array(Da[2].buffer),new Float32Array(Da[3].buffer)];Bb=new Uint8Array(4*z);Xa=new Float32Array(Bb.buffer); +ib=!0},Kc:function(){ib||aa.Wb();b.readPixels(0,0,P,4*Q,b.RGBA,b.UNSIGNED_BYTE,Bb);for(var z=P*Q,R=2*z,ja=3*z,S=0;Sz;++z)b.viewport(0,Q* +z,P,Q),y.Hb("u8",u[z]),ma.g(!1,0===z)},oe:function(z){var R=ia===A[0]&&!f();a(sa);xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);R?(Lb||(ra=document.createElement("canvas"),ra.width=P,ra.height=Q,zb=ra.getContext("2d"),Ab=zb.createImageData(P,Q),Lb=!0),Ab.data.set(z),zb.putImageData(Ab,0,0),b.texImage2D(b.TEXTURE_2D,0,ha,ca,ia,ra)):b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,z);w[t]=fa;xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},Uf:function(z,R){a(sa);R&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);b.texImage2D(b.TEXTURE_2D, +0,ha,ca,ia,z);w[t]=fa;R&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},Kf:function(z,R){var ja=P*Q,S=4*ja;z=m.H?z?"RGBE":"JSON":"RGBA";R&&(z=R);R=ea.Z()&&!1;var La=null;switch(z){case "RGBE":La="s42";break;case "JSON":La=R?"s0":"s12";break;case "RGBA":case "RGBAARRAY":La="s6"}ib||("RGBA"===z||"RGBE"===z||"RGBAARRAY"===z?(Da=new Uint8Array(S),ib=!0):"JSON"!==z||R||aa.Wb());la.I();y.set(La);aa.b(0);S=null;if("RGBA"===z||"RGBE"===z||"RGBAARRAY"===z){b.viewport(0,0,P,Q);ma.g(!0,!0);b.readPixels(0,0,P,Q,b.RGBA, +b.UNSIGNED_BYTE,Da);if("RGBAARRAY"===z)return{data:Da};v||(F=document.createElement("canvas"),L=F.getContext("2d"),v=!0);F.width=P;F.height=Q;ja=L.createImageData(P,Q);ja.data.set(Da);L.putImageData(ja,0,0);S=F.toDataURL("image/png")}else if("JSON"===z)if(R)S=new Float32Array(ja),b.viewport(0,0,P,Q),ma.g(!0,!0),b.readPixels(0,0,P,Q,b.RGBA,b.FLOAT,S);else{for(S=0;4>S;++S)b.viewport(0,Q*S,P,Q),y.Hb("u8",u[S]),ma.g(!S,!S);aa.Kc();S=Array(ja);for(R=0;Rg.B.length?(C=Uint16Array,I=b.UNSIGNED_SHORT,H=2):(C=Uint32Array,I=b.UNSIGNED_INT,H=4);C=g.B instanceof C?g.B:new C(g.B);b.bufferData(b.ELEMENT_ARRAY_BUFFER,C,h);t=w}var r={dd:function(v){n!==w&&(b.bindBuffer(b.ARRAY_BUFFER,A),n=w);v&&wa.Ib()},ad:function(){t!==w&&(b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, +k),t=w)},bind:function(v){r.dd(v);r.ad()},Ie:function(){b.drawElements(b.TRIANGLES,B,I,0)},Je:function(v,F){b.drawElements(b.TRIANGLES,v,I,F*H)},remove:function(){b.deleteBuffer(A);g.B&&b.deleteBuffer(k);r=null}};f.push(r);return r},Ha:function(){-1!==n&&(b.bindBuffer(b.ARRAY_BUFFER,c.W),n=-1);-1!==t&&(b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,c.B),t=-1)},g:function(g,w){g&&ma.Ha();w&&wa.Ba();b.drawElements(b.TRIANGLES,3,b.UNSIGNED_SHORT,0)},Ma:function(g){g=g||b;var w=a(g);g.bindBuffer(g.ARRAY_BUFFER, +w.W);g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,w.B);wa.$a(g);g.drawElements(g.TRIANGLES,3,g.UNSIGNED_SHORT,0);g.deleteBuffer(w.W);g.deleteBuffer(w.B);q.reset()},lc:function(){var g=b,w=c;g.deleteBuffer(w.W);g.deleteBuffer(w.B)},h:function(){q.lc();f.forEach(function(g){g.remove()});b.bindBuffer(b.ARRAY_BUFFER,null);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,null);q.reset();e=!1;f.splice(0);d=0}};return q}(),la=function(){var a=null,c=null,d=null,e=!1,f=[],n={u:-2,ic:1},t={Qa:function(){return e},G:function(){if(!e){a= +b.createFramebuffer();var q=ea.Z();c=q&&b.DRAW_FRAMEBUFFER?b.DRAW_FRAMEBUFFER:b.FRAMEBUFFER;d=q&&b.READ_FRAMEBUFFER?b.READ_FRAMEBUFFER:b.FRAMEBUFFER;e=!0}},ff:function(){return c},Ad:function(){return d},Oa:function(){return b.FRAMEBUFFER},pf:function(){return n},Ze:function(){return a},instance:function(q){void 0===q.tc&&(q.tc=!1);var g=q.$?q.$:null,w=q.width,B=void 0!==q.height?q.height:q.width,h=a,A=null,k=!1,I=!1,H=0;g&&(w=w?w:g.A(),B=B?B:g.P());var C={Lc:function(){k||(h=b.createFramebuffer(), +k=!0,H=n.ic++)},Uc:function(){C.Lc();C.l();A=b.createRenderbuffer();b.bindRenderbuffer(b.RENDERBUFFER,A);b.renderbufferStorage(b.RENDERBUFFER,b.DEPTH_COMPONENT16,w,B);b.framebufferRenderbuffer(c,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,A);b.clearDepth(1)},bind:function(r,v){H!==n.u&&(b.bindFramebuffer(c,h),n.u=H);g&&g.l();v&&b.viewport(0,0,w,B);r&&b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)},ue:function(){H!==n.u&&(b.bindFramebuffer(c,h),n.u=H)},clear:function(){b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)}, +Ce:function(){b.clear(b.COLOR_BUFFER_BIT)},De:function(){b.clear(b.DEPTH_BUFFER_BIT)},ge:function(){b.viewport(0,0,w,B)},l:function(){H!==n.u&&(b.bindFramebuffer(c,h),n.u=H)},rtt:function(r){g=r;n.u!==H&&(b.bindFramebuffer(b.FRAMEBUFFER,h),n.u=H);r.l()},I:function(){b.bindFramebuffer(c,null);n.u=-1},resize:function(r,v){w=r;B=v;A&&(b.bindRenderbuffer(b.RENDERBUFFER,A),b.renderbufferStorage(b.RENDERBUFFER,b.DEPTH_COMPONENT16,w,B))},remove:function(){h===a||I||(b.bindFramebuffer(c,h),b.framebufferTexture2D(c, +b.COLOR_ATTACHMENT0,b.TEXTURE_2D,null,0),A&&b.framebufferRenderbuffer(c,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,null),b.bindFramebuffer(c,null),b.deleteFramebuffer(h),A&&b.deleteRenderbuffer(A));I=!0}};q.tc&&C.Uc();f.push(C);return C},I:function(){b.bindFramebuffer(c,null);n.u=-1},me:function(){b.bindFramebuffer(c,null);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);b.viewport(0,0,ea.A(),ea.P());n.u=-1},reset:function(){n.u=-2},X:function(){0!==n.u&&(b.bindFramebuffer(c,a),n.u=0)},clear:function(){b.viewport(0, +0,ea.A(),ea.P());b.clear(b.COLOR_BUFFER_BIT)},h:function(){t.I();f.forEach(function(q){q.remove()});b.deleteFramebuffer(a);t.reset();e=!1;f.splice(0);n.u=-2;n.ic=1}};return t}(),ea=function(){function a(){d="undefined"===typeof Ua?JEContext:Ua;e=!0}function c(r,v){for(var F=0;FO&&(O+=c);O>=c&&(O-=c);for(var ba=0;bal&&(l+=c);l>=c&&(l-=c);var M=O/c,J=l/c;E=1-E-1/f;M+=H;J+=H;pa+=C;E+=C;var m=r*e+D,fa=F*e+ba;fa=d*e-fa-1;m=fa*d*e+m;B[4*m]=pa;B[4*m+1]=E;B[4*m+2]=M;B[4* +m+3]=J;J=A[l*c+O]++;m=J%n;M=O*n+m;l=l*n+(J-m)/n;l=c*n-1-l;l=l*c*n+M;h[4*l]=pa;h[4*l+1]=E;h[4*l+2]=u;h[4*l+3]=p;++q>=f&&(q=0,++g);++w}}}A=null;var ua=V.instance(a.weights);delete a.weights.data;var Ca=V.instance({width:f,isFloat:!0,array:new Float32Array(h),isPot:!0});h=null;var ra=V.instance({width:f,isFloat:!0,array:new Float32Array(B),isPot:!0});B=null;return{oa:!0,Na:function(){return n},h:function(){Ca.remove();ra.remove();ua.remove()},J:function(){y.set("s22");ua.b(1);ra.b(2);U.g(!1,!1)}}}}}(), +fc=function(){return{instance:function(a){var c=a.kernelsNumber,d=a.toSparsity,e=d*a.toLayerSize/a.fromLayerSize,f=V.instance(a.weights);delete a.weights.data;return{oa:!0,Na:function(){return e},sf:function(){return d},Fd:function(){return f},h:function(){f.remove()},J:function(){y.set("s25");y.v("u22",c);y.v("u23",d);y.v("u16",a.toLayerSize);y.v("u24",a.fromLayerSize);f.b(1);U.g(!1,!1)}}}}}(),dc=function(){return{instance:function(a,c){var d=a.fromLayerSize,e=a.toLayerSize,f=a.toSparsity,n=a.stride? +a.stride:1,t=f*e/d,q=ewindow.innerWidth}},Tc:function(){return T.Kb()||T.Jb()},Kb:function(){var a=navigator.userAgent.toLowerCase();return-1!== -a.indexOf("safari")&&-1===a.indexOf("chrome")?!0:!1},Je:function(){return T.Uc()?T.hc()?window.innerHeight/window.innerWidth*45:45:45},Lb:function(){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?!0:!1},pause:function(a){a.pause()},vf:function(a){a.play()},release:function(a){a.pause();a.videoStream&&a.videoStream.stop();a.videoStream=null},Wc:function(a){if(!a)return a;var c=!1;if(a.video){var d=function(e){var f={};"undefined"!==typeof e.min&&(f.min=e.min);"undefined"!==typeof e.max&& -(f.max=e.max);"undefined"!==typeof e.ideal&&(f.ideal=e.ideal);return f};c={};"undefined"!==typeof a.video.width&&(c.width=d(a.video.width));"undefined"!==typeof a.video.height&&(c.height=d(a.video.height));"undefined"!==typeof a.video.facingMode&&(c.facingMode=a.video.facingMode)}c={audio:a.audio,video:c};"undefined"!==typeof a.deviceId&&(c.deviceId=a.deviceId);return c},yc:function(a){var c=a.video.width;a.video.width=a.video.height;a.video.height=c;return a},Yc:function(a){function c(p){return[480, -576,640,648,720,768,800,960,1080,1152,1280,1366,1920].sort(function(y,z){return Math.abs(y-p)-Math.abs(z-p)})}function d(p){var y=T.Wc(a);e.push(p(y))}var e=[];if(!a||!a.video)return e;if(a.video.width&&a.video.height){if(a.video.width.ideal&&a.video.height.ideal){var f=c(a.video.width.ideal).slice(0,3),k=c(a.video.height.ideal).slice(0,3),l={},n=0;for(l.$=void 0;n16/9+.1||d(function(p,y){return function(z){z.video.width.ideal=p.$;z.video.height.ideal=y.Z;return z}}(l,q))}}}d(function(p){return T.yc(p)})}a.video.width&&a.video.height&&(a.video.width.ideal&&a.video.height.ideal&&d(function(p){delete p.video.width.ideal;delete p.video.height.ideal;return p}),d(function(p){delete p.video.width;delete p.video.height;return p}));a.video.facingMode&&(d(function(p){delete p.video.facingMode;return p}),a.video.width&& -a.video.height&&d(function(p){T.yc(p);delete p.video.facingMode;return p}));e.push({audio:a.audio,video:!0});return e},Xd:function(a){if(T.hc()){if(!a||!a.video)return!1;var c=a.video.width,d=a.video.height;if(!c||!d)return!1;if(c.ideal&&d.ideal&&c.ideal>d.ideal)return a.video.height=c,a.video.width=d,!0}return!1},Na:function(a){a.volume=0;T.ta(a,"muted");if(T.Kb()){if(1===a.volume){var c=function(){a.volume=0;window.removeEventListener("mousemove",c,!1);window.removeEventListener("touchstart",c, -!1)};window.addEventListener("mousemove",c,!1);window.addEventListener("touchstart",c,!1)}setTimeout(function(){a.volume=0;T.ta(a,"muted")},5)}},zc:function(a,c,d){return new Promise(function(e,f){if(a.srcObject&&a.srcObject.getVideoTracks){var k=a.srcObject.getVideoTracks();1!==k.length?f("INVALID_TRACKNUMBER"):(k=k[0],c?T.get(a,e,f,d):(k.stop(),e()))}else f("BAD_IMPLEMENTATION")})},$b:function(a,c,d,e){function f(l){k||(k=!0,d(l))}var k=!1;return navigator.mediaDevices.getUserMedia(e).then(function(l){function n(){setTimeout(function(){if(a.currentTime){var q= -a.videoWidth,x=a.videoHeight;if(0===q||0===x)f("VIDEO_NULLSIZE");else{q&&(a.style.width=q.toString()+"px");x&&(a.style.height=x.toString()+"px");q={Sc:null,Vd:null,Dd:null};try{var m=l.getVideoTracks()[0];m&&(q.Dd=m,q.Sc=m.getCapabilities(),q.Vd=m.getSettings())}catch(p){}T.Tc()?a.parentNode&&null!==a.parentNode?(k||c(a,l,q),setTimeout(function(){a.play()},100)):(document.body.appendChild(a),T.Na(a),k||c(a,l,q),setTimeout(function(){a.style.transform="scale(0.0001,0.0001)";a.style.position="fixed"; -a.style.bottom="0px";a.style.right="0px";T.Na(a);setTimeout(function(){a.play()},100)},80)):k||c(a,l,q)}}else f("VIDEO_NOTSTARTED")},700)}"undefined"!==typeof a.srcObject?a.srcObject=l:(a.src=window.URL.createObjectURL(l),a.videoStream=l);T.Na(a);a.addEventListener("loadeddata",function(){var q=a.play();T.Na(a);"undefined"===typeof q?n():q.then(function(){n()}).catch(function(){f("VIDEO_PLAYPROMISEREJECTED")})},!1)}).catch(function(l){f(l)})},get:function(a,c,d,e){if(!a)return d&&d("VIDEO_NOTPROVIDED"), -!1;if(!T.Lb())return d&&d("MEDIASTREAMAPI_NOTFOUND"),!1;if(e&&e.video){if(T.Jb()){var f=T.md();(12>f[0]||12===f[0]&&2>f[1])&&T.Xd(e)}e.video.width&&e.video.width.ideal&&(a.style.width=e.video.width.ideal+"px");e.video.height&&e.video.height.ideal&&(a.style.height=e.video.height.ideal+"px")}T.ta(a,"autoplay");T.ta(a,"playsinline");e&&e.audio?a.volume=0:T.ta(a,"muted");T.$b(a,c,function(){function k(n){if(0===n.length)d("INVALID_FALLBACKCONSTRAINTS");else{var q=n.shift();T.$b(a,c,function(){k(n)},q)}} -var l=T.Yc(e);k(l)},e)},qd:function(a){if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return a(!1,"NOTSUPPORTED"),!1;navigator.mediaDevices.enumerateDevices().then(function(c){(c=c.filter(function(d){return d.kind&&-1!==d.kind.toLowerCase().indexOf("video")&&d.label&&d.deviceId}))&&c.length&&0H.Ed)return Ea("MAXFACES_TOOHIGH"),!1;if(!a.canvasId&&!a.canvas)return Ea("NO_CANVASID"),!1;I.W=a.canvas?a.canvas:document.getElementById(a.canvasId);if(!I.W)return Ea("INVALID_CANVASID"),!1;V.N=I.W.width;V.P=I.W.height;if(!V.N||!V.P)return Ea("INVALID_CANVASDIMENSIONS"),!1;for(var d=0;du42&&b>h+u43;i?a.r=2.:a.r>u41?a.r=0.:a.r>1.9?a.r+=1.:0.,a.r*=u44;if(a.r<.9)a=vec4(1.,u39);else{a.r*=step(1.9,a.r);float j=dot(e,texture2D(u38,vec2(.875,.875))),k=dot(e,texture2D(u38,vec2(.125,.625))),l=dot(e,texture2D(u38,vec2(.375,.625))),c=cos(u36),d=sin(u36);vec2 m=mat2(c,d*u45,-d/u45,c)*vec2(j,k);a.gba+=vec3(m,l)*u40*a.a;}gl_FragColor=a;}", -fa:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",c:"u38 u33 u39 u41 u40 u44 u36 u45 u42 u43 u35".split(" ")},{id:"s51",name:"_",fa:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",a:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);const vec3 f=vec3(.5,.5,.5);void main(){float a=dot(e,texture2D(u38,vec2(.125,.875))),b=dot(e,texture2D(u38,vec2(.375,.875))),c=dot(e,texture2D(u38,vec2(.625,.875))),d=dot(e,texture2D(u38,vec2(.625,.625)));vec3 g=vec3(a,b,c)*.5+f;gl_FragColor=vec4(g,d);}", -c:["u38"]},{id:"s52",name:"_",fa:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",a:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);void main(){float a=dot(e,texture2D(u38,vec2(.375,.375))),b=dot(e,texture2D(u38,vec2(.625,.375))),c=dot(e,texture2D(u38,vec2(.875,.375))),d=dot(e,texture2D(u38,vec2(.125,.125)));gl_FragColor=vec4(a,b,c,d);}",c:["u38"]},{id:"s47",name:"_",a:"uniform sampler2D u33;uniform vec2 u46;uniform float u47;varying vec2 vv0;void main(){float f=step(.5,mod(gl_FragCoord.y+1.5,2.)),c=step(.33,vv0.x);vec4 a=texture2D(u33,vv0+u46);a.a=mix(a.a*u47,a.a,c);vec4 d=floor(255.*a),g=255.*(255.*a-d),b=mix(d,g,f)/255.;b.x=mix(step(a.x,1.5),b.x,c),gl_FragColor=b;}", -c:["u33","u47","u46"]}]);Eb();Tb();vb();ub();c()});return!0},destroy:function(){return new Promise(function(a,c){Mb.toggle_pause(!0,!0).catch(function(){c()}).then(function(){za&&za.h();Aa.h();za=ma=Va=null;sb.splice(0);tb.splice(0);ea=ba.rb;a()})})},toggle_pause:function(a,c){if(!ob())return Promise.reject();var d=null;d=c?T.zc(t.element,!a,t.ra):Promise.resolve();a?Db():d.then(function(){pb()});return d},update_videoSettings:function(a){Db();return new Promise(function(c){T.zc(t.element,!1,t.ra).then(function(){Object.assign(ha, -a);Jb(null,null,function(d){eb(d,function(){Ha();Ga();pb();c()})})})})},toggle_slow:function(a){ob()&&ea===ba.play&&(a&&!I.Ka?(I.sc=I.Ea,W.nDetectsPerLoop=1,this.set_animateDelay(100),I.Ka=!0):!a&&I.Ka&&(W.nDetectsPerLoop=-1,this.set_animateDelay(I.sc),I.Ka=!1))},set_animateDelay:function(a){I.Ea=a},resize:function(){var a=I.W.width,c=I.W.height;if(!yb()&&a===V.N&&c===V.P)return!1;V.N=a;V.P=c;vb();ub();Ha();Ga();t.Y&&t.Y.resize(V.N,V.P);return!0},set_inputTexture:function(a,c,d){t.u[0]=c;t.u[1]=d; -t.nb=!0;Ha();qb();Ga();u.set("s48");t.Y.M();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,a);R.g(!0,!0)},reset_GLState:function(){qb();V.va.remove();U.Aa.remove();Eb()},reset_inputTexture:function(){yb();t.nb=!1;Ha();Ga()},get_videoDevices:function(a){return T.qd(a)},set_scanSettings:function(a){Object.assign(W,a);-1!==W.nDetectsPerLoop&&(Q.G=W.nDetectsPerLoop,Q.qb=W.nDetectsPerLoop);vb();ub()},set_stabilizationSettings:function(a){Object.assign(ua,a)},set_videoOrientation:function(a,c){ob()&& -(ha.flipX=c,ha.rotate=a,Ha(),Ga())},update_videoElement:function(a,c){eb(a?a:t.element,function(){Ib();Ha();Ga();c&&c()})}};return Mb};window.JEEFACEFILTERAPI=window.JEEFACEFILTERAPIGEN(); +4)))a=!0;return a},Tb:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream},xd:function(){var a=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return 2window.innerWidth}},gd:function(){return W.Ub()||W.Tb()},Ub:function(){var a=navigator.userAgent.toLowerCase();return-1!== +a.indexOf("safari")&&-1===a.indexOf("chrome")?!0:!1},Xe:function(){return W.hd()?W.xc()?window.innerHeight/window.innerWidth*45:45:45},Vb:function(){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?!0:!1},pause:function(a){a.pause()},Jf:function(a){a.play()},release:function(a){a.pause();a.videoStream&&a.videoStream.stop();a.videoStream=null},kd:function(a){if(!a)return a;var c=!1;if(a.video){var d=function(e){var f={};"undefined"!==typeof e.min&&(f.min=e.min);"undefined"!==typeof e.max&& +(f.max=e.max);"undefined"!==typeof e.ideal&&(f.ideal=e.ideal);return f};c={};"undefined"!==typeof a.video.width&&(c.width=d(a.video.width));"undefined"!==typeof a.video.height&&(c.height=d(a.video.height));"undefined"!==typeof a.video.facingMode&&(c.facingMode=a.video.facingMode)}c={audio:a.audio,video:c};"undefined"!==typeof a.deviceId&&(c.deviceId=a.deviceId);return c},Pc:function(a){var c=a.video.width;a.video.width=a.video.height;a.video.height=c;return a},md:function(a){function c(h){return[480, +576,640,648,720,768,800,960,1080,1152,1280,1366,1920].sort(function(A,k){return Math.abs(A-h)-Math.abs(k-h)})}function d(h){var A=W.kd(a);e.push(h(A))}var e=[];if(!a||!a.video)return e;if(a.video.width&&a.video.height){if(a.video.width.ideal&&a.video.height.ideal){var f=c(a.video.width.ideal).slice(0,3),n=c(a.video.height.ideal).slice(0,3),t={},q=0;for(t.ca=void 0;q16/9+.1||d(function(h,A){return function(k){k.video.width.ideal=h.ca;k.video.height.ideal=A.ba;return k}}(t,g))}}}d(function(h){return W.Pc(h)})}a.video.width&&a.video.height&&(a.video.width.ideal&&a.video.height.ideal&&d(function(h){delete h.video.width.ideal;delete h.video.height.ideal;return h}),d(function(h){delete h.video.width;delete h.video.height;return h}));a.video.facingMode&&(d(function(h){delete h.video.facingMode; +return h}),a.video.width&&a.video.height&&d(function(h){W.Pc(h);delete h.video.facingMode;return h}));e.push({audio:a.audio,video:!0});return e},je:function(a){if(W.xc()){if(!a||!a.video)return!1;var c=a.video.width,d=a.video.height;if(!c||!d)return!1;if(c.ideal&&d.ideal&&c.ideal>d.ideal)return a.video.height=c,a.video.width=d,!0}return!1},Sa:function(a){a.volume=0;W.wa(a,"muted");if(W.Ub()){if(1===a.volume){var c=function(){a.volume=0;window.removeEventListener("mousemove",c,!1);window.removeEventListener("touchstart", +c,!1)};window.addEventListener("mousemove",c,!1);window.addEventListener("touchstart",c,!1)}setTimeout(function(){a.volume=0;W.wa(a,"muted")},5)}},Qc:function(a,c,d){return new Promise(function(e,f){if(a.srcObject&&a.srcObject.getVideoTracks){var n=a.srcObject.getVideoTracks();1!==n.length?f("INVALID_TRACKNUMBER"):(n=n[0],c?W.get(a,e,f,d):(n.stop(),e()))}else f("BAD_IMPLEMENTATION")})},qc:function(a,c,d,e){function f(t){n||(n=!0,d(t))}var n=!1;return navigator.mediaDevices.getUserMedia(e).then(function(t){function q(){setTimeout(function(){if(a.currentTime){var g= +a.videoWidth,w=a.videoHeight;if(0===g||0===w)f("VIDEO_NULLSIZE");else{g&&(a.style.width=g.toString()+"px");w&&(a.style.height=w.toString()+"px");g={fd:null,he:null,Qd:null};try{var B=t.getVideoTracks()[0];B&&(g.Qd=B,g.fd=B.getCapabilities(),g.he=B.getSettings())}catch(h){}W.gd()?a.parentNode&&null!==a.parentNode?(n||c(a,t,g),setTimeout(function(){a.play()},100)):(document.body.appendChild(a),W.Sa(a),n||c(a,t,g),setTimeout(function(){a.style.transform="scale(0.0001,0.0001)";a.style.position="fixed"; +a.style.bottom="0px";a.style.right="0px";W.Sa(a);setTimeout(function(){a.play()},100)},80)):n||c(a,t,g)}}else f("VIDEO_NOTSTARTED")},700)}"undefined"!==typeof a.srcObject?a.srcObject=t:(a.src=window.URL.createObjectURL(t),a.videoStream=t);W.Sa(a);a.addEventListener("loadeddata",function(){var g=a.play();W.Sa(a);"undefined"===typeof g?q():g.then(function(){q()}).catch(function(){f("VIDEO_PLAYPROMISEREJECTED")})},!1)}).catch(function(t){f(t)})},get:function(a,c,d,e){if(!a)return d&&d("VIDEO_NOTPROVIDED"), +!1;if(!W.Vb())return d&&d("MEDIASTREAMAPI_NOTFOUND"),!1;if(e&&e.video){if(W.Tb()){var f=W.xd();(12>f[0]||12===f[0]&&2>f[1])&&W.je(e)}e.video.width&&e.video.width.ideal&&(a.style.width=e.video.width.ideal+"px");e.video.height&&e.video.height.ideal&&(a.style.height=e.video.height.ideal+"px")}W.wa(a,"autoplay");W.wa(a,"playsinline");e&&e.audio?a.volume=0:W.wa(a,"muted");W.qc(a,c,function(){function n(q){if(0===q.length)d("INVALID_FALLBACKCONSTRAINTS");else{var g=q.shift();W.qc(a,c,function(){n(q)},g)}} +var t=W.md(e);n(t)},e)},Dd:function(a){if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return a(!1,"NOTSUPPORTED"),!1;navigator.mediaDevices.enumerateDevices().then(function(c){(c=c.filter(function(d){return d.kind&&-1!==d.kind.toLowerCase().indexOf("video")&&d.label&&d.deviceId}))&&c.length&&0K.Rd)return Ha("MAXFACES_TOOHIGH"),!1;if(!a.canvasId&&!a.canvas)return Ha("NO_CANVASID"),!1;N.Y=a.canvas?a.canvas:document.getElementById(a.canvasId);if(!N.Y)return Ha("INVALID_CANVASID"),!1;Y.O=N.Y.width;Y.R=N.Y.height;if(!Y.O||!Y.R)return Ha("INVALID_CANVASDIMENSIONS"),!1;for(var d=0;du42&&b>h+u43;i?a.r=2.:a.r>u41?a.r=0.:a.r>1.9?a.r+=1.:0.,a.r*=u44;if(a.r<.9)a=vec4(1.,u39);else{a.r*=step(1.9,a.r);float j=dot(e,texture2D(u38,vec2(.875,.875))),k=dot(e,texture2D(u38,vec2(.125,.625))),l=dot(e,texture2D(u38,vec2(.375,.625))),c=cos(u36),d=sin(u36);vec2 m=mat2(c,d*u45,-d/u45,c)*vec2(j,k);a.gba+=vec3(m,l)*u40*a.a;}gl_FragColor=a;}", +ja:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",c:"u38 u33 u39 u41 u40 u44 u36 u45 u42 u43 u35".split(" ")},{id:"s53",name:"_",ja:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",a:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);const vec3 f=vec3(.5,.5,.5);void main(){float a=dot(e,texture2D(u38,vec2(.125,.875))),b=dot(e,texture2D(u38,vec2(.375,.875))),c=dot(e,texture2D(u38,vec2(.625,.875))),d=dot(e,texture2D(u38,vec2(.625,.625)));vec3 g=vec3(a,b,c)*.5+f;gl_FragColor=vec4(g,d);}", +c:["u38"]},{id:"s54",name:"_",ja:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",a:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);void main(){float a=dot(e,texture2D(u38,vec2(.375,.375))),b=dot(e,texture2D(u38,vec2(.625,.375))),c=dot(e,texture2D(u38,vec2(.875,.375))),d=dot(e,texture2D(u38,vec2(.125,.125)));gl_FragColor=vec4(a,b,c,d);}",c:["u38"]},{id:"s49",name:"_",a:"uniform sampler2D u33;uniform vec2 u46;uniform float u47;varying vec2 vv0;void main(){float f=step(.5,mod(gl_FragCoord.y+1.5,2.)),c=step(.33,vv0.x);vec4 a=texture2D(u33,vv0+u46);a.a=mix(a.a*u47,a.a,c);vec4 d=floor(255.*a),g=255.*(255.*a-d),b=mix(d,g,f)/255.;b.x=mix(step(a.x,1.5),b.x,c),gl_FragColor=b;}", +c:["u33","u47","u46"]}]);Fb();Ub();vb();ub();c()});return!0},destroy:function(){return new Promise(function(a,c){Nb.toggle_pause(!0,!0).catch(function(){c()}).then(function(){Aa&&Aa.h();Ua.h();Aa=oa=Wa=null;sb.splice(0);tb.splice(0);ka=da.zb;a()})})},toggle_pause:function(a,c){if(!ob())return Promise.reject();var d=null;d=c?W.Qc(x.element,!a,x.ua):Promise.resolve();a?Eb():d.then(function(){pb()});return d},update_videoSettings:function(a){Eb();return new Promise(function(c){W.Qc(x.element,!1,x.ua).then(function(){Object.assign(na, +a);Kb(null,null,function(d){eb(d,function(){Ja();Ia();pb();c()})})})})},toggle_slow:function(a){ob()&&ka===da.play&&(a&&!N.Pa?(N.Jc=N.Fa,Z.nDetectsPerLoop=1,this.set_animateDelay(100),N.Pa=!0):!a&&N.Pa&&(Z.nDetectsPerLoop=-1,this.set_animateDelay(N.Jc),N.Pa=!1))},set_animateDelay:function(a){N.Fa=a},resize:function(){var a=N.Y.width,c=N.Y.height;if(!yb()&&a===Y.O&&c===Y.R)return!1;Y.O=a;Y.R=c;vb();ub();Ja();Ia();x.aa&&x.aa.resize(Y.O,Y.R);return!0},set_inputTexture:function(a,c,d){x.o[0]=c;x.o[1]= +d;x.vb=!0;Ja();qb();Ia();y.set("s50");x.aa.N();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,a);U.g(!0,!0)},reset_GLState:function(){qb();Y.ya.remove();X.Ca.remove();Fb()},reset_inputTexture:function(){yb();x.vb=!1;Ja();Ia()},get_videoDevices:function(a){return W.Dd(a)},set_scanSettings:function(a){Object.assign(Z,a);-1!==Z.nDetectsPerLoop&&(T.F=Z.nDetectsPerLoop,T.yb=Z.nDetectsPerLoop);vb();ub()},set_stabilizationSettings:function(a){Object.assign(ta,a)},set_videoOrientation:function(a, +c){ob()&&(na.flipX=c,na.rotate=a,Ja(),Ia())},update_videoElement:function(a,c){eb(a?a:x.element,function(){Jb();Ja();Ia();c&&c()})}};return Nb};window.JEEFACEFILTERAPI=window.JEEFACEFILTERAPIGEN(); ;if(typeof(module)!=='undefined'){module.exports=window.JEEFACEFILTERAPI;} \ No newline at end of file diff --git a/dist/jeelizFaceFilter.moduleNoDOM.js b/dist/jeelizFaceFilter.moduleNoDOM.js index 2dec7984..bf7abcbc 100644 --- a/dist/jeelizFaceFilter.moduleNoDOM.js +++ b/dist/jeelizFaceFilter.moduleNoDOM.js @@ -87,143 +87,148 @@ const FAKEDOM = { // END EMULATE DOM -window.JEEFACEFILTERAPIGEN=function(){function Bb(){var a=null,c=null,d=null,e=0;this.od=function(f){return a[f]};this.Nd=function(f){var k=null;e=f.length;a=f.map(function(l,n){l=Object.assign({},l,{index:n,parent:this,Ra:k,xd:n===e-1});return k=n=0===n?Nb.instance(l):Ob.instance(l)});c=a[0];d=a[e-1];a.forEach(function(l,n){0!==n&&l.Id()})};this.J=function(f,k){var l=k;a.forEach(function(n){l=n.J(l,f)});return l};this.Xb=function(){return c.B()};this.Zb=function(){return d.pd()};this.Pd=function(f){d.Zc(f)}; -this.Wb=function(){return d.Wb()};this.h=function(){a&&(a.forEach(function(f){f.h()}),d=c=a=null,e=0)}}var Ma,Na,Oa,Ya,Za,Pa,$a,ab,bb,jb,kb,lb,mb;function nb(a,c){var d=c%8;return a[(c-d)/8]>>7-d&1}function Pb(a){var c=JSON.parse(a);a=c.ne;var d=c.nf,e=c.n;var f="undefined"===typeof btoa?Buffer.from(c.data,"base64").toString("latin1"):atob(c.data);var k=f.length;c=new Uint8Array(k);for(var l=0;l=m;--z)y+=p*nb(c,z),p*=2;m=y;q=q+1+a;p=k.length;y=0;for(z=q;zc&&(t.Sa=a);if(1E3*cQ.G)E.L.splice(0,E.L.length-Q.G);else for(;E.L.lengthc&&(c=ma[d].detected,a=0);for(c=0;c=E.i&&(a=0)}E.ic=a}for(a=0;aH.ga[1]?(a=H.Ca[1],1H.pb}function Hb(a,c,d,e){return d>a?Math.max(0,a+c/2- -(d-e/2)):Math.max(0,d+e/2-(a-c/2))}function Wb(){return Va.some(function(a,c){if(c===E.ba)return!1;c=Va[E.ba];if(c.Pa>a.Pa||3>a.Pa||Hb(c.x,c.U,a.x,a.U)H.jc*c.U*d})}function Xb(){var a=E.ba;U.Aa.Rd(1);1!==E.i&&(b.viewport(0,0,3,E.i),u.set("s0"),u.vc("u1",1),R.g(!1,!1),u.vc("u1",0));b.viewport(0,a,1,1);u.set("s50");I.ia&&u.A("u36",ma[a].rz);1!==E.i&&u.A("u35",E.sb);if(1wb&&(Ma+=$a,Oa=Pa,Ma>lb&&(Ma=jb,Na+=ab,Na>mb&&(Na=kb)));Ya=Ma+.5*(Math.random()-.5)*$a;Za=Na+.5*(Math.random()-.5)*ab;xb=Oa+.5*(Math.random()-.5)*bb}function Ib(){t.X&&t.X.remove();t.mb=t.element.isFakeVideo?!0:!1;t.X=S.instance(Object.assign({isPot:!1,isFloat:!1},t.mb?{isFlipY:!1,array:t.element.arrayBuffer,width:t.element.videoWidth,height:t.element.videoHeight,isKeepArray:!0}:{D:t.element}))}function Ga(){u.K("s48", -[{type:"1i",name:"u1",value:0},{type:"mat2",name:"u32",value:t.m}])}function Ha(){t.C[0]=.5;t.C[1]=.5;var a=t.u[1]/t.u[0];Sa=Aa.O()/Aa.B();90===Math.abs(ha.rotate)&&(a=1/a);a>Sa?t.C[1]*=Sa/a:t.C[0]*=a/Sa;u.K("s50",[{name:"u45",type:"1f",value:Sa}]);t.m[0]=0;t.m[1]=0;t.m[2]=0;t.m[3]=0;switch(ha.rotate){case 0:t.m[0]=t.C[0];t.m[3]=t.C[1];break;case 180:t.m[0]=-t.C[0];t.m[3]=-t.C[1];break;case 90:t.m[1]=t.C[0];t.m[2]=-t.C[1];break;case -90:t.m[1]=-t.C[0],t.m[2]=t.C[1]}ha.flipX&&(t.m[0]*=-1,t.m[2]*=-1)} -function yb(){var a=t.element.videoWidth,c=t.element.videoHeight,d=t.u[0]!==a||t.u[1]!==c;d&&(t.u[0]=a,t.u[1]=c);return d}function eb(a,c){if(ea===ba.error)return!1;t.element=a;yb();c&&c();return!0}function Jb(a,c,d){a&&a();t.ra={video:{facingMode:{ideal:ha.facingMode},width:{min:ha.minWidth,max:ha.maxWidth,ideal:ha.idealWidth},height:{min:ha.minHeight,max:ha.maxHeight,ideal:ha.idealHeight}},audio:!1};ha.deviceId&&(t.ra.deviceId=ha.deviceId);T.get(t.element?t.element:T.rd(),function(e){c&&c(e);d(e)}, -function(){Ea("WEBCAM_UNAVAILABLE")},t.ra)}function Ea(a){ea!==ba.error&&(ea=ba.error,I.qa&&I.qa(a))}var pa={Xe:function(a){return Math.ceil(Math.log2(a))},Ad:function(a){return Math.log2(a)},kf:function(a){return 0===Math.log2(a)%1},le:function(a){var c=[0,0,0,0];a.forEach(function(d){c[0]+=d[0];c[1]+=d[1];c[2]+=d[2];c[3]+=d[3]});return c},me:function(a,c,d){return Math.min(Math.max(a,c),d)},re:function(a){return a*Math.PI/180},sf:function(a,c){c=Math.pow(10,c);return Math.round(a*c)/c},tf:function(a){return Math.round(1E6* -a)/1E6},Ye:function(a,c){return(100*a/c).toFixed(3)},R:function(a,c,d){return a*(1-d)+c*d},dd:function(a,c){return pa.Vc(a-c)},Vc:function(a){for(;a>Math.PI;)a-=2*Math.PI;for(;a<=-Math.PI;)a+=2*Math.PI;return a},te:function(a,c){return Math.abs(pa.dd(a,c))},de:function(a,c){return Math.atan2(Math.sin(a)+Math.sin(c),Math.cos(a)+Math.cos(c))}},Gb={get:function(a,c,d){var e=new XMLHttpRequest;e.open("GET",a,!0);e.withCredentials=!1;e.onreadystatechange=function(){4===e.readyState&&(200===e.status||0=== -e.status?c(e.responseText):"undefined"!==typeof d&&d(e.status))};e.send()},Te:function(a,c){Gb.get(a,function(d){c(JSON.parse(d))})},qf:function(a,c,d){var e=new XMLHttpRequest;e.open("POST",a,!0);e.setRequestHeader("Content-type","application/x-www-form-urlencoded");e.onreadystatechange=function(){4!==e.readyState||200!==e.status&&0!==e.status||d(e.responseText)};e.send(c)},Ke:function(a,c){var d=new XMLHttpRequest;d.open("POST",a,!0);d.responseType="arraybuffer";d.onload=function(){c(d.response)}; -d.send()}},db={Ef:function(a,c,d){a=Math.min(Math.max((d-a)/(c-a),0),1);return a*a*(3-2*a)},Ma:function(a,c,d){return Math.min(Math.max((d-a)/(c-a),0),1)},Ee:function(a,c,d,e){return Math.pow(Math.min(Math.max((e-a)/(c-a),0),1),d)},If:function(){return 0},pf:function(){return 1},mf:function(a){return a},Be:function(a){return a*a},Ge:function(a){return a*(2-a)},ye:function(a){return.5>a?2*a*a:-1+(4-2*a)*a},we:function(a){return a*a*a},Fe:function(a){return--a*a*a+1},xe:function(a){return.5>a?4*a*a* -a:(a-1)*(2*a-2)*(2*a-2)+1},Ce:function(a){return a*a*a*a},He:function(a){return 1- --a*a*a*a},ze:function(a){return.5>a?8*a*a*a*a:1-8*--a*a*a*a},De:function(a){return a*a*a*a*a},Ie:function(a){return 1+--a*a*a*a*a},Ae:function(a){return.5>a?16*a*a*a*a*a:1+16*--a*a*a*a*a}},Yb={ld:function(a,c,d){switch(a){case "relu":return d+"=max(vec4(0.,0.,0.,0.),"+c+");";case "elu":return d+"=mix(exp(-abs("+c+"))-vec4(1.,1.,1.,1.),"+c+",step(0.,"+c+"));";case "elu01":return d+"=mix(0.1*exp(-abs("+c+"))-vec4(0.1,0.1,0.1,0.1),"+ -c+",step(0.,"+c+"));";case "arctan":return d+"=atan(3.14159265359*texture2D(u0,vUV))/3.14159265359;";case "copy":return"";default:return!1}}},u=function(){function a(g,w){g=b.createShader(g);b.shaderSource(g,w);b.compileShader(g);return b.getShaderParameter(g,b.COMPILE_STATUS)?g:!1}function c(g,w){g=a(b.VERTEX_SHADER,g);w=a(b.FRAGMENT_SHADER,w);f.push(g,w);var A=b.createProgram();b.attachShader(A,g);b.attachShader(A,w);b.linkProgram(A);return A}function d(g){void 0===g.fa&&(g.fa="precision lowp float;attribute vec2 a0;varying vec2 vv0;void main(){gl_Position=vec4(a0,0.,1.),vv0=a0*.5+vec2(.5,.5);}"); -void 0===g.Fa&&(g.Fa=["a0"]);void 0===g.na&&(g.na=[2]);if(void 0===g.precision||"highp"===g.precision)g.precision=x;g.id=n++;void 0!==g.Md&&g.Md.forEach(function(A,Z){g.a=g.a.replace(A,g.Ta[Z])});g.Bb=0;g.na.forEach(function(A){g.Bb+=4*A});g.wa=c(g.fa,"precision "+g.precision+" float;\n"+g.a);g.j={};g.c.forEach(function(A){g.j[A]=b.getUniformLocation(g.wa,A)});g.attributes={};g.oa=[];g.Fa.forEach(function(A){var Z=b.getAttribLocation(g.wa,A);g.attributes[A]=Z;g.oa.push(Z)});if(g.f){b.useProgram(g.wa); -l=g;k=g.id;for(var w in g.f)b.uniform1i(g.j[w],g.f[w])}g.kb=!0}function e(g){Ia.Sd(G);k!==g.id&&(G.la(),k=g.id,l=g,b.useProgram(g.wa),g.oa.forEach(function(w){0!==w&&b.enableVertexAttribArray(w)}))}var f=[],k=-1,l=null,n=0,q=!1,x="highp",m=["u1"],p=["u0"],y={u1:0},z={u0:0},O={u1:0,u2:1},N={u3:0},F={s0:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",c:m,f:y},s1:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",c:m,f:y,precision:"lowp"}, -s2:{a:"uniform sampler2D u1,u2;varying vec2 vv0;void main(){vec4 a=texture2D(u2,vv0),b=texture2D(u1,vv0);gl_FragColor=a*b;}",c:["u1","u2"],f:O},s3:{a:"uniform sampler2D u1;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=a.r*f;}",c:m,f:y},s4:{a:"uniform sampler2D u1,u2;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u2,vv0),b=texture2D(u1,vv0);gl_FragColor=a.a*b.r*f;}",c:["u1","u2"],f:O},s5:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(1.-vv0.x,vv0.y));}", -c:m,f:y},s6:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(vv0.x,1.-vv0.y));}",c:m,f:y},s7:{a:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=a*u4;}",c:["u0","u4"],f:z},s8:{a:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;const vec4 f=vec4(.25,.25,.25,.25),g=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);float b=dot(a*u4,f);gl_FragColor=b*g;}",c:["u0","u4"],f:z},s9:{a:"uniform sampler2D u1;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){float a=.25*dot(e,texture2D(u1,vv0));gl_FragColor=a*e;}", -c:m,f:y},s10:{a:"uniform sampler2D u1,u5;uniform float u6;const vec4 f=vec4(1.,1.,1.,1.);varying vec2 vv0;void main(){vec4 a=texture2D(u1,vv0),b=texture2D(u5,vv0);gl_FragColor=mix(b,a,u6*f);}",c:["u1","u5","u6"],f:{u1:0,u5:1}},s11:{a:"uniform sampler2D u1;uniform vec2 u7;varying vec2 vv0;void main(){gl_FragColor=.25*(texture2D(u1,vv0+u7)+texture2D(u1,vv0+u7*vec2(1.,-1.))+texture2D(u1,vv0+u7*vec2(-1.,-1.))+texture2D(u1,vv0+u7*vec2(-1.,1.)));}",c:["u1","u7"],f:y},s12:{a:"uniform sampler2D u1;uniform vec4 u8;varying vec2 vv0;float g(float a,float b){a=floor(a)+.5;return floor(a/exp2(b));}float h(float a,float b){return floor(a*exp2(b)+.5);}float i(float a,float b){return mod(a,h(1.,b));}float e(float c,float a,float b){a=floor(a+.5),b=floor(b+.5);return i(g(c,a),b-a);}vec4 j(float a){if(a==0.)return vec4(0.,0.,0.,0.);float k=128.*step(a,0.);a=abs(a);float c=floor(log2(a)),l=c+127.,b=(a/exp2(c)-1.)*8388608.,d=l/2.,m=fract(d)*2.,n=floor(d),o=e(b,0.,8.),p=e(b,8.,16.),q=m*128.+e(b,16.,23.),r=k+n;return vec4(o,p,q,r)/255.;}void main(){float a=dot(texture2D(u1,vv0),u8);gl_FragColor=j(a);}", -c:["u1","u8"],f:y},s13:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=e/(e+exp(-a));gl_FragColor=b;}",c:p,f:z},s14:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(0.,0.,0.,0.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=max(f,a);}",c:p,f:z},s15:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=mix(exp(-abs(a))-f,a,step(0.,a));}",c:p,f:z},s16:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=exp(-abs(a))-f;gl_FragColor=mix(.1*b,a,step(0.,a));}", -c:p,f:z},s17:{a:"uniform sampler2D u0,u6,u9;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),c=texture2D(u6,vv0),d=texture2D(u9,vv0),b=a/d;gl_FragColor=c*mix(exp(-abs(b))-f,b,step(0.,a));}",c:["u0","u6","u9"],f:{u0:0,u6:1,u9:2}},s18:{a:"uniform sampler2D u0;const float e=3.141593;varying vec2 vv0;void main(){gl_FragColor=atan(e*texture2D(u0,vv0))/e;}",c:p,f:z},s19:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=log(f+a);gl_FragColor=b;}", -c:p,f:z},s20:{a:"uniform sampler2D u0,u10;uniform float u11;const vec2 e=vec2(.5,.5);const float f=1e-5;const vec4 g=vec4(1.,1.,1.,1.),i=vec4(0.,0.,0.,0.);varying vec2 vv0;void main(){vec4 a=texture2D(u10,e);float b=u11*u11;vec4 c=max(b*a,f*g);gl_FragColor=texture2D(u0,vv0)/c;}",c:["u0","u10","u11"],f:{u0:0,u10:1}},s21:{a:"uniform sampler2D u1;uniform vec2 u12;varying vec2 vv0;void main(){float a=u12.x*u12.y;vec2 b=floor(vv0*a)/a,c=fract(vv0*a),d=floor(b*u12.y),f=floor(u12.x*fract(b*u12.y)),g=(f*u12.y+d)/a;gl_FragColor=texture2D(u1,g+c/a);}", -c:["u1","u12"],f:y},s22:{a:"uniform sampler2D u13,u14,u15;varying vec2 vv0;void main(){vec4 a=texture2D(u15,vv0);vec2 b=a.rg,c=a.ba;vec4 d=texture2D(u13,b),f=texture2D(u14,c);gl_FragColor=d*f;}",c:["u13","u14","u15"],f:{u14:0,u13:1,u15:2}},s23:{a:"uniform float u16;uniform sampler2D u13,u14;varying vec2 vv0;void main(){vec2 a=fract(vv0*u16);vec4 b=texture2D(u13,vv0),c=texture2D(u14,a);gl_FragColor=b*c;}",c:["u14","u13","u16"],f:{u14:0,u13:1}},s24:{a:"uniform float u16;uniform sampler2D u13,u14,u17,u18,u19,u20;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.),g=vec4(1e-3,1e-3,1e-3,1e-3);void main(){vec2 h=vv0*u16,l=floor(h),c=h-l;vec4 m=texture2D(u13,vv0),d=texture2D(u14,c),a=texture2D(u20,vv0);a=a*255.;vec4 n=texture2D(u17,c),o=texture2D(u18,c),p=texture2D(u19,c),i=step(-g,-a),b=e-i,j=b*step(-e-g,-a);b*=e-j;vec4 k=b*step(-2.*e-g,-a);b*=e-k;vec4 q=b;d=i*d+j*n+k*o+q*p,gl_FragColor=m*d;}", +window.JEEFACEFILTERAPIGEN=function(){function Cb(){var a=null,c=null,d=null,e=0;this.Bd=function(f){return a[f]};this.$d=function(f){var n=null;e=f.length;a=f.map(function(t,q){t=Object.assign({},t,{index:q,parent:this,Wa:n,Kd:q===e-1});return n=q=0===q?Ob.instance(t):Pb.instance(t)});c=a[0];d=a[e-1];a.forEach(function(t,q){0!==q&&t.Vd()})};this.J=function(f,n){var t=n;a.forEach(function(q){t=q.J(t,f)});return t};this.nc=function(){return c.A()};this.pc=function(){return d.Cd()};this.be=function(f){d.nd(f)}; +this.mc=function(){return d.mc()};this.h=function(){a&&(a.forEach(function(f){f.h()}),d=c=a=null,e=0)}}var Na,Oa,Pa,Ya,Za,Qa,$a,ab,bb,jb,kb,lb,mb;function nb(a,c){var d=c%8;return a[(c-d)/8]>>7-d&1}function Qb(a){var c=JSON.parse(a);a=c.ne;var d=c.nf,e=c.n;var f="undefined"===typeof btoa?Buffer.from(c.data,"base64").toString("latin1"):atob(c.data);var n=f.length;c=new Uint8Array(n);for(var t=0;t=B;--k)A+=h*nb(c,k),h*=2;B=A;g=g+1+a;h=n.length;A=0;for(k=g;kc&&(x.Xa=a);if(1E3*cT.F)G.L.splice(0,G.L.length-T.F);else for(;G.L.lengthc&&(c=oa[d].detected,a=0);for(c=0;c=G.i&&(a=0)}G.yc=a}for(a=0;aK.ka[1]?(a=K.Ea[1],1K.xb}function Ib(a,c,d,e){return d>a?Math.max(0,a+c/2-(d-e/2)):Math.max(0,d+e/2-(a-c/2))}function Xb(){return Wa.some(function(a, +c){if(c===G.ea)return!1;c=Wa[G.ea];if(c.Ua>a.Ua||3>a.Ua||Ib(c.x,c.V,a.x,a.V)K.zc*c.V*d})}function Yb(){var a=G.ea;X.Ca.de(1);1!==G.i&&(b.viewport(0,0,3,G.i),y.set("s0"),y.Mc("u1",1),U.g(!1,!1),y.Mc("u1",0));b.viewport(0,a,1,1);y.set("s52");N.ma&&y.v("u36",oa[a].rz);1!==G.i&&y.v("u35",G.Ab);if(1wb&&(Na+=$a,Pa=Qa,Na>lb&&(Na=jb,Oa+=ab,Oa>mb&&(Oa=kb)));Ya=Na+.5*(Math.random()-.5)*$a;Za=Oa+.5*(Math.random()-.5)*ab;xb=Pa+.5*(Math.random()-.5)*bb}function Jb(){x.$&&x.$.remove();x.ub=x.element.isFakeVideo?!0:!1;x.$=V.instance(Object.assign({isPot:!1,isFloat:!1},x.ub?{isFlipY:!1,array:x.element.arrayBuffer,width:x.element.videoWidth,height:x.element.videoHeight,isKeepArray:!0}:{D:x.element}))}function Ia(){y.K("s50",[{type:"1i",name:"u1",value:0},{type:"mat2",name:"u32",value:x.m}])} +function Ja(){x.C[0]=.5;x.C[1]=.5;var a=x.o[1]/x.o[0];Ta=Ua.P()/Ua.A();90===Math.abs(na.rotate)&&(a=1/a);a>Ta?x.C[1]*=Ta/a:x.C[0]*=a/Ta;y.K("s52",[{name:"u45",type:"1f",value:Ta}]);x.m[0]=0;x.m[1]=0;x.m[2]=0;x.m[3]=0;switch(na.rotate){case 0:x.m[0]=x.C[0];x.m[3]=x.C[1];break;case 180:x.m[0]=-x.C[0];x.m[3]=-x.C[1];break;case 90:x.m[1]=x.C[0];x.m[2]=-x.C[1];break;case -90:x.m[1]=-x.C[0],x.m[2]=x.C[1]}na.flipX&&(x.m[0]*=-1,x.m[2]*=-1)}function yb(){var a=x.element.videoWidth,c=x.element.videoHeight, +d=x.o[0]!==a||x.o[1]!==c;d&&(x.o[0]=a,x.o[1]=c);return d}function eb(a,c){if(ka===da.error)return!1;x.element=a;yb();c&&c();return!0}function Kb(a,c,d){a&&a();x.ua={video:{facingMode:{ideal:na.facingMode},width:{min:na.minWidth,max:na.maxWidth,ideal:na.idealWidth},height:{min:na.minHeight,max:na.maxHeight,ideal:na.idealHeight}},audio:!1};na.deviceId&&(x.ua.deviceId=na.deviceId);W.get(x.element?x.element:W.Ed(),function(e){c&&c(e);d(e)},function(){Ha("WEBCAM_UNAVAILABLE")},x.ua)}function Ha(a){ka!== +da.error&&(ka=da.error,N.ta&&N.ta(a))}var qa={lf:function(a){return Math.ceil(Math.log2(a))},Nd:function(a){return Math.log2(a)},Af:function(a){return 0===Math.log2(a)%1},Ae:function(a){var c=[0,0,0,0];a.forEach(function(d){c[0]+=d[0];c[1]+=d[1];c[2]+=d[2];c[3]+=d[3]});return c},Be:function(a,c,d){return Math.min(Math.max(a,c),d)},Fe:function(a){return a*Math.PI/180},Gf:function(a,c){c=Math.pow(10,c);return Math.round(a*c)/c},Hf:function(a){return Math.round(1E6*a)/1E6},mf:function(a,c){return(100* +a/c).toFixed(3)},S:function(a,c,d){return a*(1-d)+c*d},rd:function(a,c){return qa.jd(a-c)},jd:function(a){for(;a>Math.PI;)a-=2*Math.PI;for(;a<=-Math.PI;)a+=2*Math.PI;return a},He:function(a,c){return Math.abs(qa.rd(a,c))},re:function(a,c){return Math.atan2(Math.sin(a)+Math.sin(c),Math.cos(a)+Math.cos(c))}},Hb={get:function(a,c,d){var e=new XMLHttpRequest;e.open("GET",a,!0);e.withCredentials=!1;e.onreadystatechange=function(){4===e.readyState&&(200===e.status||0===e.status?c(e.responseText):"undefined"!== +typeof d&&d(e.status))};e.send()},hf:function(a,c){Hb.get(a,function(d){c(JSON.parse(d))})},Ef:function(a,c,d){var e=new XMLHttpRequest;e.open("POST",a,!0);e.setRequestHeader("Content-type","application/x-www-form-urlencoded");e.onreadystatechange=function(){4!==e.readyState||200!==e.status&&0!==e.status||d(e.responseText)};e.send(c)},Ye:function(a,c){var d=new XMLHttpRequest;d.open("POST",a,!0);d.responseType="arraybuffer";d.onload=function(){c(d.response)};d.send()}},db={Sf:function(a,c,d){a=Math.min(Math.max((d- +a)/(c-a),0),1);return a*a*(3-2*a)},Ra:function(a,c,d){return Math.min(Math.max((d-a)/(c-a),0),1)},Se:function(a,c,d,e){return Math.pow(Math.min(Math.max((e-a)/(c-a),0),1),d)},Wf:function(){return 0},Df:function(){return 1},Cf:function(a){return a},Pe:function(a){return a*a},Ue:function(a){return a*(2-a)},Me:function(a){return.5>a?2*a*a:-1+(4-2*a)*a},Ke:function(a){return a*a*a},Te:function(a){return--a*a*a+1},Le:function(a){return.5>a?4*a*a*a:(a-1)*(2*a-2)*(2*a-2)+1},Qe:function(a){return a*a*a*a}, +Ve:function(a){return 1- --a*a*a*a},Ne:function(a){return.5>a?8*a*a*a*a:1-8*--a*a*a*a},Re:function(a){return a*a*a*a*a},We:function(a){return 1+--a*a*a*a*a},Oe:function(a){return.5>a?16*a*a*a*a*a:1+16*--a*a*a*a*a}},Zb={wd:function(a,c,d){switch(a){case "relu":return d+"=max(vec4(0.,0.,0.,0.),"+c+");";case "elu":return d+"=mix(exp(-abs("+c+"))-vec4(1.,1.,1.,1.),"+c+",step(0.,"+c+"));";case "elu01":return d+"=mix(0.1*exp(-abs("+c+"))-vec4(0.1,0.1,0.1,0.1),"+c+",step(0.,"+c+"));";case "arctan":return d+ +"=atan(3.14159265359*texture2D(u0,vUV))/3.14159265359;";case "copy":return"";default:return!1}}},y=function(){function a(u,p,D){p=u.createShader(p);u.shaderSource(p,D);u.compileShader(p);return u.getShaderParameter(p,u.COMPILE_STATUS)?p:!1}function c(u,p,D){p=a(u,u.VERTEX_SHADER,p);D=a(u,u.FRAGMENT_SHADER,D);u===b&&t.push(p,D);var O=u.createProgram();u.attachShader(O,p);u.attachShader(O,D);u.linkProgram(O);return O}function d(u,p){void 0===p.ja&&(p.ja="precision lowp float;attribute vec2 a0;varying vec2 vv0;void main(){gl_Position=vec4(a0,0.,1.),vv0=a0*.5+vec2(.5,.5);}"); +void 0===p.Ga&&(p.Ga=["a0"]);void 0===p.ra&&(p.ra=[2]);if(void 0===p.precision||"highp"===p.precision)p.precision=h;p.id=w++;void 0!==p.Zd&&p.Zd.forEach(function(O,ba){p.a=p.a.replace(O,p.Ya[ba])});p.Kb=0;p.ra.forEach(function(O){p.Kb+=4*O});p.ha=c(u,p.ja,"precision "+p.precision+" float;\n"+p.a);p.j={};p.c.forEach(function(O){p.j[O]=u.getUniformLocation(p.ha,O)});p.attributes={};p.sa=[];p.Ga.forEach(function(O){var ba=u.getAttribLocation(p.ha,O);p.attributes[O]=ba;p.sa.push(ba)});if(p.f){u.useProgram(p.ha); +g=p;q=p.id;for(var D in p.f)u.uniform1i(p.j[D],p.f[D])}p.sb=!0}function e(u){wa.ee(L);q!==u.id&&(L.M(),q=u.id,g=u,b.useProgram(u.ha),u.sa.forEach(function(p){0!==p&&b.enableVertexAttribArray(p)}))}function f(u,p,D){d(u,p,D);u.useProgram(p.ha);u.enableVertexAttribArray(0);q=-1;return g=p}function n(){return{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",c:["u1"],f:{u1:0}}}var t=[],q=-1,g=null,w=0,B=!1,h="highp",A=["u1"],k=["u0"],I={u1:0},H={u0:0},C={u1:0,u2:1}, +r={u3:0},v={s0:n(),s1:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",c:A,f:I,precision:"lowp"},s2:{a:"uniform sampler2D u1,u2;varying vec2 vv0;void main(){vec4 a=texture2D(u2,vv0),b=texture2D(u1,vv0);gl_FragColor=a*b;}",c:["u1","u2"],f:C},s3:{a:"uniform sampler2D u1;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=a.r*f;}",c:A,f:I},s4:{a:"uniform sampler2D u1,u2;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u2,vv0),b=texture2D(u1,vv0);gl_FragColor=a.a*b.r*f;}", +c:["u1","u2"],f:C},s5:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(1.-vv0.x,vv0.y));}",c:A,f:I},s6:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(vv0.x,1.-vv0.y));}",c:A,f:I},s7:{a:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=a*u4;}",c:["u0","u4"],f:H},s8:{a:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;const vec4 f=vec4(.25,.25,.25,.25),g=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);float b=dot(a*u4,f);gl_FragColor=b*g;}", +c:["u0","u4"],f:H},s9:{a:"uniform sampler2D u1;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){float a=.25*dot(e,texture2D(u1,vv0));gl_FragColor=a*e;}",c:A,f:I},s10:{a:"uniform sampler2D u1,u5;uniform float u6;const vec4 f=vec4(1.,1.,1.,1.);varying vec2 vv0;void main(){vec4 a=texture2D(u1,vv0),b=texture2D(u5,vv0);gl_FragColor=mix(b,a,u6*f);}",c:["u1","u5","u6"],f:{u1:0,u5:1}},s11:{a:"uniform sampler2D u1;uniform vec2 u7;varying vec2 vv0;void main(){gl_FragColor=.25*(texture2D(u1,vv0+u7)+texture2D(u1,vv0+u7*vec2(1.,-1.))+texture2D(u1,vv0+u7*vec2(-1.,-1.))+texture2D(u1,vv0+u7*vec2(-1.,1.)));}", +c:["u1","u7"],f:I},s12:{a:"uniform sampler2D u1;uniform vec4 u8;varying vec2 vv0;float g(float a,float b){a=floor(a)+.5;return floor(a/exp2(b));}float h(float a,float b){return floor(a*exp2(b)+.5);}float i(float a,float b){return mod(a,h(1.,b));}float e(float c,float a,float b){a=floor(a+.5),b=floor(b+.5);return i(g(c,a),b-a);}vec4 j(float a){if(a==0.)return vec4(0.,0.,0.,0.);float k=128.*step(a,0.);a=abs(a);float c=floor(log2(a)),l=c+127.,b=(a/exp2(c)-1.)*8388608.,d=l/2.,m=fract(d)*2.,n=floor(d),o=e(b,0.,8.),p=e(b,8.,16.),q=m*128.+e(b,16.,23.),r=k+n;return vec4(o,p,q,r)/255.;}void main(){float a=dot(texture2D(u1,vv0),u8);gl_FragColor=j(a);}", +c:["u1","u8"],f:I},s13:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=e/(e+exp(-a));gl_FragColor=b;}",c:k,f:H},s14:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(0.,0.,0.,0.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=max(f,a);}",c:k,f:H},s15:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=mix(exp(-abs(a))-f,a,step(0.,a));}",c:k,f:H},s16:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=exp(-abs(a))-f;gl_FragColor=mix(.1*b,a,step(0.,a));}", +c:k,f:H},s17:{a:"uniform sampler2D u0,u6,u9;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),c=texture2D(u6,vv0),d=texture2D(u9,vv0),b=a/d;gl_FragColor=c*mix(exp(-abs(b))-f,b,step(0.,a));}",c:["u0","u6","u9"],f:{u0:0,u6:1,u9:2}},s18:{a:"uniform sampler2D u0;const float e=3.141593;varying vec2 vv0;void main(){gl_FragColor=atan(e*texture2D(u0,vv0))/e;}",c:k,f:H},s19:{a:"uniform sampler2D u0;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=log(f+a);gl_FragColor=b;}", +c:k,f:H},s20:{a:"uniform sampler2D u0,u10;uniform float u11;const vec2 e=vec2(.5,.5);const float f=1e-5;const vec4 g=vec4(1.,1.,1.,1.),i=vec4(0.,0.,0.,0.);varying vec2 vv0;void main(){vec4 a=texture2D(u10,e);float b=u11*u11;vec4 c=max(b*a,f*g);gl_FragColor=texture2D(u0,vv0)/c;}",c:["u0","u10","u11"],f:{u0:0,u10:1}},s21:{a:"uniform sampler2D u1;uniform vec2 u12;varying vec2 vv0;void main(){float a=u12.x*u12.y;vec2 b=floor(vv0*a)/a,c=fract(vv0*a),d=floor(b*u12.y),f=floor(u12.x*fract(b*u12.y)),g=(f*u12.y+d)/a;gl_FragColor=texture2D(u1,g+c/a);}", +c:["u1","u12"],f:I},s22:{a:"uniform sampler2D u13,u14,u15;varying vec2 vv0;void main(){vec4 a=texture2D(u15,vv0);vec2 b=a.rg,c=a.ba;vec4 d=texture2D(u13,b),f=texture2D(u14,c);gl_FragColor=d*f;}",c:["u13","u14","u15"],f:{u14:0,u13:1,u15:2}},s23:{a:"uniform float u16;uniform sampler2D u13,u14;varying vec2 vv0;void main(){vec2 a=fract(vv0*u16);vec4 b=texture2D(u13,vv0),c=texture2D(u14,a);gl_FragColor=b*c;}",c:["u14","u13","u16"],f:{u14:0,u13:1}},s24:{a:"uniform float u16;uniform sampler2D u13,u14,u17,u18,u19,u20;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.),g=vec4(1e-3,1e-3,1e-3,1e-3);void main(){vec2 h=vv0*u16,l=floor(h),c=h-l;vec4 m=texture2D(u13,vv0),d=texture2D(u14,c),a=texture2D(u20,vv0);a=a*255.;vec4 n=texture2D(u17,c),o=texture2D(u18,c),p=texture2D(u19,c),i=step(-g,-a),b=e-i,j=b*step(-e-g,-a);b*=e-j;vec4 k=b*step(-2.*e-g,-a);b*=e-k;vec4 q=b;d=i*d+j*n+k*o+q*p,gl_FragColor=m*d;}", c:"u13 u14 u16 u20 u17 u18 u19".split(" "),f:{u14:0,u13:1,u20:3,u17:4,u18:5,u19:6}},s25:{a:"uniform sampler2D u13,u14,u21;uniform float u16,u22,u23,u24;varying vec2 vv0;const vec2 j=vec2(1.,1.);void main(){vec2 a=floor(u22*vv0),b=u22*vv0-a;float c=u16/u22;vec2 d=floor(b*c),f=b*c-d,g=(a+f)/u22;float k=u22*u24/u16;vec2 l=k*d,h=(l+f*u23)/u24,i=step(h,j);vec4 m=texture2D(u13,g),n=texture2D(u14,h),o=m*n*i.x*i.y,p=texture2D(u21,g);gl_FragColor=o*u23*u23+p;}",c:"u13 u14 u16 u22 u23 u24 u21".split(" "),f:{u14:0, u13:1,u21:2}},s26:{a:"uniform sampler2D u13,u14;varying vec2 vv0;void main(){vec4 a=texture2D(u13,vv0),b=texture2D(u14,vv0);gl_FragColor=a*b;}",c:["u13","u14"],f:{u14:0,u13:1}},s27:{a:"uniform sampler2D u1,u21;uniform float u25;varying vec2 vv0;void main(){gl_FragColor=texture2D(u21,vv0)+u25*texture2D(u1,vv0);}",c:["u1","u21","u25"],f:{u1:0,u21:1}},s28:{a:"varying vec2 vv0;uniform sampler2D u1;const vec4 f=vec4(1.,1.,1.,1.),g=vec4(.299,.587,.114,0.);void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=dot(a,g)*f;}", -c:m,f:y,precision:"lowp"},s29:{a:"varying vec2 vv0;uniform sampler2D u1;uniform float u26;const vec3 f=vec3(.299,.587,.114);void main(){vec3 a=texture2D(u1,vv0).rgb,b=texture2D(u1,vv0+vec2(0.,u26)).rgb,c=texture2D(u1,vv0+vec2(u26,u26)).rgb,d=texture2D(u1,vv0+vec2(u26,0.)).rgb;gl_FragColor=vec4(dot(a,f),dot(b,f),dot(c,f),dot(d,f));}",c:["u1","u26"],f:y,precision:"lowp"},s30:{a:"varying vec2 vv0;uniform sampler2D u1;uniform float u26;const vec3 f=vec3(.299,.587,.114);void main(){vec3 a=texture2D(u1,vv0).rgb,b=texture2D(u1,vv0+vec2(0.,u26)).rgb,c=texture2D(u1,vv0+vec2(u26,u26)).rgb,d=texture2D(u1,vv0+vec2(u26,0.)).rgb;gl_FragColor=vec4(a.r,b.g,c.b,dot(d,f));}", -c:["u1","u26"],f:y,precision:"lowp"},s31:{a:"varying vec2 vv0;uniform sampler2D u1,u2;uniform float u27;const vec4 f=vec4(1.,1.,1.,1.);void main(){vec4 a=vec4(0.);a-=texture2D(u1,vec2(vv0.x-u27,vv0.y-u27))*1.,a-=texture2D(u1,vec2(vv0.x-u27,vv0.y))*2.,a-=texture2D(u1,vec2(vv0.x-u27,vv0.y+u27))*1.,a+=texture2D(u1,vec2(vv0.x+u27,vv0.y-u27))*1.,a+=texture2D(u1,vec2(vv0.x+u27,vv0.y))*2.,a+=texture2D(u1,vec2(vv0.x+u27,vv0.y+u27))*1.;vec4 b=vec4(0.);b-=texture2D(u1,vec2(vv0.x-u27,vv0.y-u27))*1.,b-=texture2D(u1,vec2(vv0.x,vv0.y-u27))*2.,b-=texture2D(u1,vec2(vv0.x+u27,vv0.y-u27))*1.,b+=texture2D(u1,vec2(vv0.x-u27,vv0.y+u27))*1.,b+=texture2D(u1,vec2(vv0.x,vv0.y+u27))*2.,b+=texture2D(u1,vec2(vv0.x+u27,vv0.y+u27))*1.;vec3 c=sqrt(a.rgb*a.rgb+b.rgb*b.rgb);vec4 e=vec4(c,texture2D(u1,vv0).a),g=texture2D(u2,vv0);gl_FragColor=g.a*e.r*f;}", -c:["u1","u2","u27"],f:O},s32:{a:"varying vec2 vv0;uniform sampler2D u1,u2;uniform float u27;const vec4 j=vec4(1.,1.,1.,1.);const vec2 k=vec2(1.,1.);void main(){float h=0.;vec2 l=k*u27,a,b;float c,d,i=0.;for(float e=-4.;e<=4.;e+=1.)for(float f=-4.;f<=4.;f+=1.)a=vec2(e,f),c=length(a)/2.,d=exp(-c*c),b=vv0+l*a,h+=d*texture2D(u1,b).r,i+=d;vec4 m=texture2D(u2,vv0);gl_FragColor=m.a*(texture2D(u1,b).r-h/i)*j;}",c:["u1","u2","u27"],f:O},s33:{a:"uniform sampler2D u3;uniform vec2 u7;varying vec2 vv0;vec4 e(vec4 a,vec4 b){vec4 c=step(a,b);return mix(a,b,c);}const vec2 g=vec2(.5,.5),h=vec2(1.,0.),i=vec2(0.,1.);void main(){vec2 a=vv0-u7*g;vec4 b=texture2D(u3,a),c=texture2D(u3,a+u7*h),d=texture2D(u3,a+u7*i),j=texture2D(u3,a+u7),k=e(b,c),l=e(d,j);gl_FragColor=e(k,l);}", -c:["u3","u7"],f:N},s34:{a:"uniform sampler2D u3;uniform vec2 u7;varying vec2 vv0;const vec2 k=vec2(1.,0.),l=vec2(0.,1.),m=vec2(2.,0.),n=vec2(0.,2.);vec4 e(vec4 a,vec4 b){vec4 c=step(a,b);return mix(a,b,c);}vec4 f(vec2 a){vec4 b=texture2D(u3,a),c=texture2D(u3,a+u7*k),d=texture2D(u3,a+u7*l),g=texture2D(u3,a+u7),h=e(b,c),i=e(d,g);return e(h,i);}void main(){vec2 a=vv0+u7*vec2(-.55,-1.05);vec4 b=f(a),c=f(a+u7*m),d=f(a+u7*2.),g=f(a+u7*n),h=e(b,c),i=e(d,g);gl_FragColor=e(h,i);}",c:["u3","u7"],f:N},s35:{a:"uniform sampler2D u1;varying vec2 vv0;void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=a*a;}", -c:["u1"],f:y,precision:"lowp"},s36:{a:"uniform sampler2D u1;uniform vec2 u7;varying vec2 vv0;const float e=15444.;void main(){vec4 a=1001./e*texture2D(u1,vv0-3.*u7)+2002./e*texture2D(u1,vv0-2.*u7)+3003./e*texture2D(u1,vv0-u7)+3432./e*texture2D(u1,vv0)+3003./e*texture2D(u1,vv0+u7)+2002./e*texture2D(u1,vv0+2.*u7)+1001./e*texture2D(u1,vv0+3.*u7);gl_FragColor=a;}",c:["u7","u1"],f:y,precision:"lowp"},s37:{a:"uniform sampler2D u1,u28,u29;varying vec2 vv0;const vec4 f=vec4(1.,1.,1.,1.);const float g=.1;void main(){vec4 a=texture2D(u28,vv0),b=texture2D(u29,vv0),c=texture2D(u1,vv0),d=max(f*g,b-a*a),h=sqrt(d);gl_FragColor=(c-a)/h;}", -c:["u1","u28","u29"],f:{u1:0,u28:1,u29:2}}},C={s38:{a:"uniform float u16,u30;uniform sampler2D u13,u14,u21;varying vec2 vv0;const vec2 ZERO2=vec2(0.,0.),ONE2=vec2(1.,1.),HALF2=vec2(.5,.5),EPS2=vec2(1e-5,1e-5);void main(){vec4 sum=texture2D(u21,vv0);float toSparsity=1.1111;vec2 uvFrom,uvWeight,xyPatch=ZERO2,eps2=EPS2/u16,xyTo=floor(vv0*u16+eps2);float weightSize=toSparsity*u16;vec2 halfFromSparsity=ONE2*(toSparsity-1.)/2.;for(float patch_x=0.;patch_x<1.1111;patch_x+=1.){xyPatch.x=patch_x;for(float patch_y=0.;patch_y<1.1111;patch_y+=1.)xyPatch.y=patch_y,uvFrom=(xyTo+HALF2+u30*(xyPatch-halfFromSparsity))/u16,uvFrom+=step(uvFrom,-eps2),uvFrom-=step(ONE2-eps2,uvFrom),uvWeight=(xyTo*toSparsity+xyPatch+HALF2)/weightSize,sum+=texture2D(u13,uvWeight)*texture2D(u14,uvFrom);}gl_FragColor=sum,gl_FragColor*=2.2222;}", -c:["u16","u13","u14","u21","u30"],Ta:["1.1111","gl_FragColor\\*=2.2222;"]},s39:{a:"uniform float u16,u30,u24;uniform sampler2D u13,u14,u21;varying vec2 vv0;const vec2 ZERO2=vec2(0.,0.),ONE2=vec2(1.,1.),HALF2=vec2(.5,.5),EPS2=vec2(1e-4,1e-4);void main(){vec4 sum=texture2D(u21,vv0);float fromSparsity=1.1111,shrinkFactor=3.3333;vec2 uvFrom,uvWeight,xyFrom,xyPatchTo,xyPatch=ZERO2,xyShrink=ZERO2,eps2=EPS2/u24,xyTo=floor(vv0*u16+eps2);float weightSize=fromSparsity*u24;vec2 halfFromSparsity=ONE2*(fromSparsity-1.)/2.;float toSparsity=weightSize/u16;vec2 xyFrom0=xyTo*shrinkFactor;for(float patch_x=0.;patch_x<1.1111;patch_x+=1.){xyPatch.x=patch_x;for(float patch_y=0.;patch_y<1.1111;patch_y+=1.){xyPatch.y=patch_y;for(float shrink_x=0.;shrink_x<3.3333;shrink_x+=1.){xyShrink.x=shrink_x;for(float shrink_y=0.;shrink_y<3.3333;shrink_y+=1.)xyShrink.y=shrink_y,xyFrom=xyFrom0+xyShrink+shrinkFactor*u30*(xyPatch-halfFromSparsity),uvFrom=(xyFrom+HALF2)/u24,uvFrom+=step(uvFrom,-eps2),uvFrom-=step(ONE2-eps2,uvFrom),xyPatchTo=xyPatch*shrinkFactor+xyShrink,uvWeight=(xyTo*toSparsity+xyPatchTo+HALF2)/weightSize,sum+=texture2D(u13,uvWeight)*texture2D(u14,uvFrom);}}}gl_FragColor=sum,gl_FragColor*=2.2222;}", -c:"u16 u24 u13 u14 u21 u30".split(" "),Ta:["1.1111","gl_FragColor\\*=2.2222;","3.3333"]}},G={La:function(){return q},o:function(){if(!q){x="highp";for(var g in F)d(F[g],g);u.set("s0");b.enableVertexAttribArray(0);q=!0;return Wa.o()}},Fc:function(g){g.forEach(function(w){G.Eb(w)})},Eb:function(g){F[g.id]=g;d(g,g.id)},ac:function(g,w,A){w||(w=g);F[w]=Object.create(C[g]);F[w].wd=!0;C[g].Ta&&C[g].Ta.forEach(function(Z,na){F[w].a=F[w].a.replace(new RegExp(Z,"g"),A[na])});d(F[w],w)},set:function(g){e(F[g])}, -hd:function(g){return"undefined"===typeof F[g]?!1:F[g].kb},la:function(){-1!==k&&(k=-1,l.oa.forEach(function(g){0!==g&&b.disableVertexAttribArray(g)}))},zb:function(){var g=0;l.oa.forEach(function(w,A){A=l.na[A];b.vertexAttribPointer(w,A,b.FLOAT,!1,l.Bb,g);g+=4*A})},Pb:function(){b.enableVertexAttribArray(0)},za:function(){b.vertexAttribPointer(l.oa[0],2,b.FLOAT,!1,8,0)},vc:function(g,w){b.uniform1i(l.j[g],w)},A:function(g,w){b.uniform1f(l.j[g],w)},ya:function(g,w,A){b.uniform2f(l.j[g],w,A)},yf:function(g, -w){b.uniform2fv(l.j[g],w)},zf:function(g,w){b.uniform3fv(l.j[g],w)},Td:function(g,w,A,Z){b.uniform3f(l.j[g],w,A,Z)},Af:function(g,w,A,Z,na){b.uniform4f(l.j[g],w,A,Z,na)},yb:function(g,w){b.uniform4fv(l.j[g],w)},Bf:function(g,w){b.uniformMatrix2fv(l.j[g],!1,w)},Cf:function(g,w){b.uniformMatrix3fv(l.j[g],!1,w)},Df:function(g,w){b.uniformMatrix4fv(l.j[g],!1,w)},K:function(g,w){G.set(g);w.forEach(function(A){switch(A.type){case "4f":b.uniform4fv(l.j[A.name],A.value);break;case "3f":b.uniform3fv(l.j[A.name], -A.value);break;case "2f":b.uniform2fv(l.j[A.name],A.value);break;case "1f":b.uniform1f(l.j[A.name],A.value);break;case "1i":b.uniform1i(l.j[A.name],A.value);break;case "mat2":b.uniformMatrix2fv(l.j[A.name],!1,A.value);break;case "mat3":b.uniformMatrix3fv(l.j[A.name],!1,A.value);break;case "mat4":b.uniformMatrix4fv(l.j[A.name],!1,A.value)}})},We:function(){return"lowp"},h:function(){b.disableVertexAttribArray(0);G.la();for(var g in F){var w=F[g];w.kb&&(w.kb=!1,b.deleteProgram(w.wa));w.wd&&delete F[g]}f.forEach(function(A){b.deleteShader(A)}); -f.splice(0);n=0;q=!1}};return G}(),b=null,Aa=function(){function a(m){console.log("ERROR in ContextFeedForward: ",m);return!1}function c(){if(navigator.userAgent&&-1!==navigator.userAgent.indexOf("forceWebGL1")||/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream)return!0;if(/(Mac)/i.test(navigator.platform)){var m;(m=navigator.userAgent)?(m=m.match(/Mac OS X (\d+)_(\d+)/)||m.match(/Mac OS X (\d+).(\d+)/),m=!m||3>m.length?!1:[parseInt(m[1],10),parseInt(m[2],10)]):m=!1;if(m&&10===m[0]&& -15===m[1])return!0}return!1}var d=null,e=null,f=null,k=null,l=!0,n=null,q=null,x={B:function(){return d.width},O:function(){return d.height},Ne:function(){return d},Me:function(){return b},F:function(){return l},flush:function(){b.flush()},nd:function(){n||(n=new Uint8Array(d.width*d.height*4));b.readPixels(0,0,d.width,d.height,b.RGBA,b.UNSIGNED_BYTE,n);return n},Pe:function(){return d.toDataURL("image/jpeg")},Qe:function(){ta.H();e||(e=document.createElement("canvas"),f=e.getContext("2d"));e.width= -d.width;e.height=d.height;for(var m=x.nd(),p=f.createImageData(e.width,e.height),y=e.width,z=e.height,O=p.data,N=0;Nq.da.length?(F=Uint16Array,O=b.UNSIGNED_SHORT,N=2):(F=Uint32Array,O=b.UNSIGNED_INT,N=4);b.bufferData(b.ELEMENT_ARRAY_BUFFER,q.da instanceof F?q.da:new F(q.da),p);f=x}var C={Oc:function(G){e!== -x&&(b.bindBuffer(b.ARRAY_BUFFER,y),e=x);G&&Ia.zb()},Lc:function(){f!==x&&(b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,z),f=x)},bind:function(G){C.Oc(G);C.Lc()},ue:function(){b.drawElements(b.TRIANGLES,m,O,0)},ve:function(G,g){b.drawElements(b.TRIANGLES,G,O,g*N)},remove:function(){b.deleteBuffer(y);q.da&&b.deleteBuffer(z);C=null}};l.push(C);return C},pa:function(){-1!==e&&(b.bindBuffer(b.ARRAY_BUFFER,a),e=-1);-1!==f&&(b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,c),f=-1)},g:function(q,x){q&&ka.pa();x&&Ia.za();b.drawElements(b.TRIANGLES, -3,b.UNSIGNED_SHORT,0)},Vb:function(){b.deleteBuffer(a);b.deleteBuffer(c)},h:function(){n.Vb();l.forEach(function(q){q.remove()});b.bindBuffer(b.ARRAY_BUFFER,null);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,null);n.reset();k=!1;l.splice(0);d=0}};return n}(),Y=function(){var a=null,c=null,d=null,e=!1,f=[],k={v:-2,Sb:1},l={La:function(){return e},o:function(){if(!e){a=b.createFramebuffer();var n=aa.F();c=n&&b.DRAW_FRAMEBUFFER?b.DRAW_FRAMEBUFFER:b.FRAMEBUFFER;d=n&&b.READ_FRAMEBUFFER?b.READ_FRAMEBUFFER:b.FRAMEBUFFER; -e=!0}},Se:function(){return c},gb:function(){return d},ca:function(){return b.FRAMEBUFFER},Ze:function(){return k},Le:function(){return a},instance:function(n){void 0===n.cc&&(n.cc=!1);var q=n.X?n.X:null,x=n.width,m=void 0!==n.height?n.height:n.width,p=a,y=null,z=!1,O=!1,N=0;q&&(x=x?x:q.B(),m=m?m:q.O());var F={uc:function(){z||(p=b.createFramebuffer(),z=!0,N=k.Sb++)},Ec:function(){F.uc();F.l();y=b.createRenderbuffer();b.bindRenderbuffer(b.RENDERBUFFER,y);b.renderbufferStorage(b.RENDERBUFFER,b.DEPTH_COMPONENT16, -x,m);b.framebufferRenderbuffer(c,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,y);b.clearDepth(1)},bind:function(C,G){N!==k.v&&(b.bindFramebuffer(c,p),k.v=N);q&&q.l();G&&b.viewport(0,0,x,m);C&&b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)},ge:function(){N!==k.v&&(b.bindFramebuffer(c,p),k.v=N)},clear:function(){b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)},oe:function(){b.clear(b.COLOR_BUFFER_BIT)},pe:function(){b.clear(b.DEPTH_BUFFER_BIT)},Ud:function(){b.viewport(0,0,x,m)},l:function(){N!==k.v&&(b.bindFramebuffer(c, -p),k.v=N)},rtt:function(C){q=C;k.v!==N&&(b.bindFramebuffer(b.FRAMEBUFFER,p),k.v=N);C.l()},H:function(){b.bindFramebuffer(c,null);k.v=-1},resize:function(C,G){x=C;m=G;y&&(b.bindRenderbuffer(b.RENDERBUFFER,y),b.renderbufferStorage(b.RENDERBUFFER,b.DEPTH_COMPONENT16,x,m))},remove:function(){p===a||O||(b.bindFramebuffer(c,p),b.framebufferTexture2D(c,b.COLOR_ATTACHMENT0,b.TEXTURE_2D,null,0),y&&b.framebufferRenderbuffer(c,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,null),b.bindFramebuffer(c,null),b.deleteFramebuffer(p), -y&&b.deleteRenderbuffer(y));O=!0}};n.cc&&F.Ec();f.push(F);return F},H:function(){b.bindFramebuffer(c,null);k.v=-1},$d:function(){b.bindFramebuffer(c,null);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);b.viewport(0,0,aa.B(),aa.O());k.v=-1},reset:function(){k.v=-2},V:function(){0!==k.v&&(b.bindFramebuffer(c,a),k.v=0)},clear:function(){b.viewport(0,0,aa.B(),aa.O());b.clear(b.COLOR_BUFFER_BIT)},h:function(){l.H();f.forEach(function(n){n.remove()});b.deleteFramebuffer(a);l.reset();e=!1;f.splice(0);k.v= --2;k.Sb=1}};return l}(),Ca=function(){function a(r){b.bindTexture(b.TEXTURE_2D,r)}function c(r){la[0]=r;r=ca[0];var D=r>>16&32768,h=r>>12&2047,J=r>>23&255;return 103>J?D:142J?(h|=2048,D|(h>>114-J)+(h>>113-J&1)):D=(D|J-112<<10|h>>1)+(h&1)}function d(r){var D=new Uint16Array(r.length);r.forEach(function(h,J){D[J]=c(h)});return D}function e(){if(null!==oa.ib)return oa.ib;var r=k(d([1,1,1,1]));return null===r?!0:oa.ib=r}function f(){if(null!==oa.jb)return oa.jb; -var r=k(new Uint8Array([255,255,255,255]));return null===r?!0:oa.jb=r}function k(r){if(!Ia.La()||!N)return null;var D=null;try{var h=b.getError();D=B.instance({isFloat:!1,I:!0,array:r,width:1});h=b.getError();if(h!==b.NO_ERROR)return!1}catch(J){return!1}Y.H();b.viewport(0,0,1,1);b.clearColor(0,0,0,0);b.clear(b.COLOR_BUFFER_BIT);Ia.set("s0");D.Gb(0);ka.g(!1,!0);r=new Uint8Array(4);b.readPixels(0,0,1,1,b.RGBA,b.UNSIGNED_BYTE,r);r=.9D;++D)r[D]=2*Math.random()-1;m={random:B.instance({isFloat:!0,isPot:!0,array:r,width:64}),Ac:B.instance({isFloat:!1,isPot:!0,width:1,array:new Uint8Array([0,0,0,0])})}}N=!0}},td:function(){B.be()},cf:function(){return m.Ac}, -be:function(){y[1]=aa.Ja()},Od:function(){O=z=[b.RGBA,b.RGBA,b.RGBA,b.RGBA]},rf:function(r,D){u.set("s1");Y.H();var h=r.B(),J=r.O();b.viewport(0,0,h,J);r.b(0);ka.g(!1,!1);b.readPixels(0,0,h,J,b.RGBA,b.UNSIGNED_BYTE,D)},Tb:function(r,D,h,J,qa){b.activeTexture(b.TEXTURE0);var va=b.createTexture();a(va);var ra=aa.F()&&b.RGBA32F?b.RGBA32F:b.FLOAT;J=J instanceof Float32Array?J:new Float32Array(J);0!==pa.Ad(J.length)%1&&(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D, -b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE));b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,qa);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,D,h,0,b.RGBA,ra,J);a(null);b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1);Y.V();u.set("s0");b.viewport(0,0,D,h);b.framebufferTexture2D(Y.ca(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,r,0);b.clearColor(0,0,0,0);b.clear(b.COLOR_BUFFER_BIT);a(va);ka.g(!0,!1);b.deleteTexture(va);x[0]=-1; -p=null;l=0},instance:function(r){function D(){a(sa);wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,wa);h.isPot?(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,h.isMirrorX?b.MIRRORED_REPEAT:b.REPEAT),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,h.isMirrorY?b.MIRRORED_REPEAT:b.REPEAT)):(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE));h.isAnisotropicFiltering&&"undefined"!==typeof JESETTINGS&&b.texParameterf(b.TEXTURE_2D,JEContext.Re().TEXTURE_MAX_ANISOTROPY_EXT, -JESETTINGS.ee);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,h.isLinear?b.LINEAR:b.NEAREST);h.isLinear?b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,h.isMipmap&&!Ja?b.NEAREST_MIPMAP_LINEAR:b.LINEAR):b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,h.isMipmap&&!Ja?b.NEAREST_MIPMAP_NEAREST:b.NEAREST);fa=z[h.Oa-1];ia=O[h.Oa-1];ja=y[qa];if(aa.F()){var v=b.RGBA32F;fa===b.RGBA&&ja===b.FLOAT&&v&&(ia=v);fa===b.RGB&&ja===b.FLOAT&&v&&(ia=v,fa=b.RGBA)}if(h.I&&!h.isFloat||h.isFloat&&h.isMipmap&&Wa.zd())(v= -b.RGBA16F)&&(ia=v),ja=aa.Ja();h.ob&&(fb=h.ob);h.isSrgb&&4===h.Oa&&(fa=JEContext.af());if(h.D)b.texImage2D(b.TEXTURE_2D,0,ia,fa,ja,h.D);else if(h.url)b.texImage2D(b.TEXTURE_2D,0,ia,fa,ja,Fa);else if(xa){try{b.getError(),b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,xa),b.getError()!==b.NO_ERROR&&(b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,null),b.getError()!==b.NO_ERROR&&b.texImage2D(b.TEXTURE_2D,0,b.RGBA,K,L,0,b.RGBA,b.UNSIGNED_BYTE,null))}catch(ic){b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,null)}h.isKeepArray|| -(xa=null)}else b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,null);if(h.isMipmap)if(!Ja&&X)X.fb(),gb=!0;else if(Ja){v=Math.log(Math.min(K,L))/Math.log(2);Ta=Array(1+v);Ta[0]=sa;for(var M=1;M<=v;++M){var da=Math.pow(2,M),P=K/da;da=L/da;var Ka=b.createTexture();a(Ka);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texImage2D(b.TEXTURE_2D,0,ia,P,da,0,fa,ja,null);a(null);Ta[M]=Ka}gb=!0}a(null);x[l]=-1;wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL, -!1);hb=!0;h.aa&&X&&(h.aa(X),h.aa=null)}var h=Object.assign({},C,r),J=q++;null===h.isFlipY&&(h.isFlipY=h.url||h.array?!0:!1);h.data&&(h.array="string"===typeof h.data?Pb(h.data):h.isFloat?new Float32Array(h.data):new Uint8Array(h.data),h.isFlipY=!1);var qa=0,va=h.D?!0:!1,ra=null,Ua=null,Kb=!1,zb=null;h.I=h.I||h.isFloat;h.I&&(qa=1);h.vd||aa.F()||!h.isFloat||!na||aa.Ib()||(h.isFloat=!1);h.isFloat&&(qa=2);h.isAnisotropicFiltering&&Z&&!JEContext.ef()&&(h.isAnisotropicFiltering=!1);var sa=b.createTexture(), -Fa=null,xa=!1,K=0,L=0,hb=!1,ib=!1,ya=null,Ba=null,Ab=null,Xa=null,ia=null,fa=null,ja=null,wa=h.isFlipY,Ja=h.I&&h.isMipmap&&"undefined"!==typeof Wa&&!Wa.Rc()?!0:!1,Ta=null,fb=-1,gb=!1,La={fc:!1,Hb:null,Ub:null};h.width&&(K=h.width,L=h.height?h.height:K);var X={get:function(){return sa},B:function(){return K},O:function(){return L},df:function(){return h.url},ff:function(){return h.isFloat},hf:function(){return h.I},jf:function(){return h.isLinear},fb:function(){b.generateMipmap(b.TEXTURE_2D)},Nc:function(v, -M){Ja?(v||(v=X.Yb()),X.Ua(M),a(Ta[v]),x[M]=-1):X.b(M)},Yb:function(){-1===fb&&(fb=Math.log(K)/Math.log(2));return fb},kd:function(v){if(Ja){v||(v=X.Yb());u.set("s11");X.Ua(0);for(var M=K,da=L,P=1;P<=v;++P)M/=2,da/=2,u.ya("u7",.25/M,.25/da),b.viewport(0,0,M,da),a(Ta[P-1]),b.framebufferTexture2D(Y.ca(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,Ta[P],0),ka.g(!1,1===P);x[0]=-1}else X.fb()},Ua:function(v){v!==l&&(b.activeTexture(n[v]),l=v)},b:function(v){if(!hb)return!1;X.Ua(v);if(x[v]===J)return!1;a(sa);x[v]= -J;return!0},Gb:function(v){b.activeTexture(n[v]);l=v;a(sa);x[v]=J},l:function(){p=X;b.framebufferTexture2D(Y.ca(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,sa,0)},M:function(){p=X;b.viewport(0,0,K,L);b.framebufferTexture2D(Y.ca(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,sa,0)},Ab:B.Ab,resize:function(v,M){K=v;L=M;D()},clone:function(v){v=B.instance({width:K,height:L,I:h.I,isFloat:h.isFloat,isLinear:h.isLinear,isMirrorY:h.isMirrorY,isFlipY:v?!wa:wa,isPot:h.isPot});Ia.set("s0");Y.V();v.l();b.viewport(0,0,K,L);X.b(0); -ka.g(!0,!0);return v},Ud:function(){b.viewport(0,0,K,L)},remove:function(){b.deleteTexture(sa);F.splice(F.indexOf(X),1);X=null},refresh:function(){X.Gb(0);wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);va?b.texImage2D(b.TEXTURE_2D,0,ia,fa,b.UNSIGNED_BYTE,h.D):b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,xa);wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},Mb:function(){var v=K*L*4;Ba=[new Uint8Array(v),new Uint8Array(v),new Uint8Array(v),new Uint8Array(v)];ya=[new Float32Array(Ba[0].buffer),new Float32Array(Ba[1].buffer), -new Float32Array(Ba[2].buffer),new Float32Array(Ba[3].buffer)];Ab=new Uint8Array(4*v);Xa=new Float32Array(Ab.buffer);ib=!0},tc:function(){ib||X.Mb();b.readPixels(0,0,K,4*L,b.RGBA,b.UNSIGNED_BYTE,Ab);for(var v=K*L,M=2*v,da=3*v,P=0;Pv;++v)b.viewport(0,L*v,K,L),u.yb("u8",A[v]),ka.g(!1,0===v)},ae:function(v){var M=ja===y[0]&&!f();a(sa);wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);M?(Kb||(ra=document.createElement("canvas"),ra.width=K,ra.height=L,Ua=ra.getContext("2d"),zb=Ua.createImageData(K,L),Kb=!0),zb.data.set(v),Ua.putImageData(zb,0,0),b.texImage2D(b.TEXTURE_2D,0,ia,fa,ja,ra)):b.texImage2D(b.TEXTURE_2D,0,ia,K,L,0,fa,ja,v);x[l]=J;wa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL, -!1)},Gf:function(v,M){a(sa);M&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);b.texImage2D(b.TEXTURE_2D,0,ia,fa,ja,v);x[l]=J;M&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},wf:function(v,M){var da=K*L,P=4*da;v=h.I?v?"RGBE":"JSON":"RGBA";M&&(v=M);M=aa.F()&&!1;var Ka=null;switch(v){case "RGBE":Ka="s40";break;case "JSON":Ka=M?"s0":"s12";break;case "RGBA":case "RGBAARRAY":Ka="s6"}ib||("RGBA"===v||"RGBE"===v||"RGBAARRAY"===v?(Ba=new Uint8Array(P),ib=!0):"JSON"!==v||M||X.Mb());Y.H();u.set(Ka);X.b(0);P=null;if("RGBA"=== -v||"RGBE"===v||"RGBAARRAY"===v){b.viewport(0,0,K,L);ka.g(!0,!0);b.readPixels(0,0,K,L,b.RGBA,b.UNSIGNED_BYTE,Ba);if("RGBAARRAY"===v)return{data:Ba};G||(g=document.createElement("canvas"),w=g.getContext("2d"),G=!0);g.width=K;g.height=L;da=w.createImageData(K,L);da.data.set(Ba);w.putImageData(da,0,0);P=g.toDataURL("image/png")}else if("JSON"===v)if(M)P=new Float32Array(da),b.viewport(0,0,K,L),ka.g(!0,!0),b.readPixels(0,0,K,L,b.RGBA,b.FLOAT,P);else{for(P=0;4>P;++P)b.viewport(0,L*P,K,L),u.yb("u8",A[P]), -ka.g(!P,!P);X.tc();P=Array(da);for(M=0;Mla&&(la+=c);la>=c&&(la-=c);for(var ca=0;car&&(r+=c);r>=c&&(r-=c);var D=la/c,h=r/c;B=1-B-1/f;D+=N;h+=N;oa+=F;B+=F;var J=C*e+na,qa= -g*e+ca;qa=d*e-qa-1;J=qa*d*e+J;m[4*J]=oa;m[4*J+1]=B;m[4*J+2]=D;m[4*J+3]=h;h=y[r*c+la]++;J=h%k;D=la*k+J;r=r*k+(h-J)/k;r=c*k-1-r;r=r*c*k+D;p[4*r]=oa;p[4*r+1]=B;p[4*r+2]=A;p[4*r+3]=Z;++n>=f&&(n=0,++q);++x}}}y=null;var va=S.instance(a.weights);delete a.weights.data;var ra=S.instance({width:f,isFloat:!0,array:new Float32Array(p),isPot:!0});p=null;var Ua=S.instance({width:f,isFloat:!0,array:new Float32Array(m),isPot:!0});m=null;return{ka:!0,Ia:function(){return k},h:function(){ra.remove();Ua.remove();va.remove()}, -J:function(){u.set("s22");va.b(1);Ua.b(2);R.g(!1,!1)}}}}}(),ec=function(){return{instance:function(a){var c=a.kernelsNumber,d=a.toSparsity,e=d*a.toLayerSize/a.fromLayerSize,f=S.instance(a.weights);delete a.weights.data;return{ka:!0,Ia:function(){return e},bf:function(){return d},sd:function(){return f},h:function(){f.remove()},J:function(){u.set("s25");u.A("u22",c);u.A("u23",d);u.A("u16",a.toLayerSize);u.A("u24",a.fromLayerSize);f.b(1);R.g(!1,!1)}}}}}(),cc=function(){return{instance:function(a,c){var d= -a.fromLayerSize,e=a.toLayerSize,f=a.toSparsity,k=a.stride?a.stride:1,l=f*e/d,n=e>16&32768,J=l>>12&2047,m=l>>23&255;return 103>m?M:142m?(J|=2048,M|(J>>114-m)+(J>>113-m&1)):M=(M|m-112<<10|J>>1)+(J&1)}function d(l){var M=new Uint16Array(l.length);l.forEach(function(J,m){M[m]=c(J)});return M}function e(){if(null!==pa.qb)return pa.qb;var l=n(d([1,1,1,1]));return null===l?!0:pa.qb=l}function f(){if(null!==pa.rb)return pa.rb;var l=n(new Uint8Array([255,255,255,255]));return null===l?!0:pa.rb=l}function n(l){if(!wa.Qa()|| +!H)return null;var M=null;try{var J=b.getError();if("FUCKING_BIG_ERROR"===J)return!1;M=E.instance({isFloat:!1,H:!0,array:l,width:1});J=b.getError();if(J!==b.NO_ERROR)return!1}catch(m){return!1}la.I();b.viewport(0,0,1,1);b.clearColor(0,0,0,0);b.clear(b.COLOR_BUFFER_BIT);wa.set("s0");M.Pb(0);ma.g(!0,!0);l=new Uint8Array(4);b.readPixels(0,0,1,1,b.RGBA,b.UNSIGNED_BYTE,l);l=.9M;++M)l[M]=2*Math.random()-1;B={random:E.instance({isFloat:!0,isPot:!0,array:l,width:64}),Rc:E.instance({isFloat:!1,isPot:!0,width:1,array:new Uint8Array([0,0,0,0])})}}H=!0}},Gd:function(){E.pe()},tf:function(){return B.Rc},pe:function(){A[1]=ea.ob(b)},ae:function(){I=k=[b.RGBA, +b.RGBA,b.RGBA,b.RGBA]},Ff:function(l,M){y.set("s1");la.I();var J=l.A(),m=l.P();b.viewport(0,0,J,m);l.b(0);ma.g(!1,!1);b.readPixels(0,0,J,m,b.RGBA,b.UNSIGNED_BYTE,M)},jc:function(l,M,J,m,fa,ua,Ca){l.activeTexture(l.TEXTURE0);var ra=l.createTexture();l.bindTexture(l.TEXTURE_2D,ra);fa=fa instanceof Float32Array?fa:new Float32Array(fa);0!==qa.Nd(fa.length)%1&&(l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE));l.texParameteri(l.TEXTURE_2D, +l.TEXTURE_MAG_FILTER,l.NEAREST);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,ua);l.texImage2D(l.TEXTURE_2D,0,l.RGBA,J,m,0,l.RGBA,l.FLOAT,fa);l.bindTexture(l.TEXTURE_2D,null);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,!1);Ca&&(la.X(),y.set("s0"));l.viewport(0,0,J,m);l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,M,0);l.bindTexture(l.TEXTURE_2D,ra);Ca?ma.g(!0,!0):U.Ma(l);l.deleteTexture(ra);H&&(w[0]=-1,h=null,t=0)},instance:function(l){function M(z){if("FUCKING_BIG_ERROR"=== +b.getError())return!1;b.texImage2D(b.TEXTURE_2D,0,ha,ca,ia,z);b.getError()!==b.NO_ERROR&&ca!==b.RGBA&&(ca=b.RGBA,b.texImage2D(b.TEXTURE_2D,0,ha,ca,ia,z));return!0}function J(){a(sa);xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,xa);m.isPot?(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,m.isMirrorX?b.MIRRORED_REPEAT:b.REPEAT),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,m.isMirrorY?b.MIRRORED_REPEAT:b.REPEAT)):(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D, +b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE));m.isAnisotropicFiltering&&"undefined"!==typeof JESETTINGS&&b.texParameterf(b.TEXTURE_2D,JEContext.ef().TEXTURE_MAX_ANISOTROPY_EXT,JESETTINGS.se);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,m.isLinear?b.LINEAR:b.NEAREST);m.isLinear?b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,m.isMipmap&&!Ka?b.NEAREST_MIPMAP_LINEAR:b.LINEAR):b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,m.isMipmap&&!Ka?b.NEAREST_MIPMAP_NEAREST:b.NEAREST);ca=k[m.Ta-1];ha=I[m.Ta-1];ia= +A[ua];if(ea.Z()){var z=b.RGBA32F;ca===b.RGBA&&ia===b.FLOAT?m.isMipmap||m.isLinear?ha=Ba.zd(b):ea.Sb()?z&&(ha=z):ha=b.RGBA16F||b.RGBA:ca===b.RGB&&ia===b.FLOAT&&z&&(ha=z,ca=b.RGBA)}if(m.H&&!m.isFloat||m.isFloat&&m.isMipmap&&Ba.Md())(z=b.RGBA16F)&&(ha=z),ia=ea.ob(b);m.wb&&(fb=m.wb);m.isSrgb&&4===m.Ta&&(ca=JEContext.rf());if(m.D)M(m.D);else if(m.url)M(Ga);else if(ya){z=ya;try{"FUCKING_BIG_ERROR"!==b.getError()&&(b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,z),b.getError()!==b.NO_ERROR&&(b.texImage2D(b.TEXTURE_2D, +0,ha,P,Q,0,ca,ia,null),b.getError()!==b.NO_ERROR&&b.texImage2D(b.TEXTURE_2D,0,b.RGBA,P,Q,0,b.RGBA,b.UNSIGNED_BYTE,null)))}catch(jc){b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,null)}m.isKeepArray||(ya=null)}else"FUCKING_BIG_ERROR"!==b.getError()&&(b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,null),b.getError()!==b.NO_ERROR&&(ca=b.RGBA,m.H&&ia!==b.FLOAT&&(ia=b.FLOAT,b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,null))));if(m.isMipmap)if(!Ka&&aa)aa.nb(),gb=!0;else if(Ka){z=Math.log2(Math.min(P,Q));Va=Array(1+ +z);Va[0]=sa;for(var R=1;R<=z;++R){var ja=Math.pow(2,R),S=P/ja;ja=Q/ja;var La=b.createTexture();a(La);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texImage2D(b.TEXTURE_2D,0,ha,S,ja,0,ca,ia,null);a(null);Va[R]=La}gb=!0}a(null);w[t]=-1;xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1);hb=!0;m.da&&aa&&(m.da(aa),m.da=null)}var m=Object.assign({},r,l),fa=g++;null===m.isFlipY&&(m.isFlipY=m.url||m.array?!0:!1);m.data&&(m.array="string"=== +typeof m.data?Qb(m.data):m.isFloat?new Float32Array(m.data):new Uint8Array(m.data),m.isFlipY=!1);var ua=0,Ca=m.D?!0:!1,ra=null,zb=null,Lb=!1,Ab=null;m.H=m.H||m.isFloat;m.H&&(ua=1);m.Id||ea.Z()||!m.isFloat||!D||ea.Sb()||(m.isFloat=!1);m.isFloat&&(ua=2);m.isAnisotropicFiltering&&p&&!JEContext.vf()&&(m.isAnisotropicFiltering=!1);var sa=b.createTexture(),Ga=null,ya=!1,P=0,Q=0,hb=!1,ib=!1,za=null,Da=null,Bb=null,Xa=null,ha=null,ca=null,ia=null,xa=m.isFlipY;l="undefined"!==typeof Ba&&Ba.ed();var Ka=m.H&& +m.isMipmap&&l?!0:!1,Va=null,fb=-1,gb=!1,Ma={wc:!1,Qb:null,kc:null};m.width&&(P=m.width,Q=m.height?m.height:P);var aa={get:function(){return sa},A:function(){return P},P:function(){return Q},uf:function(){return m.url},wf:function(){return m.isFloat},yf:function(){return m.H},zf:function(){return m.isLinear},nb:function(){b.generateMipmap(b.TEXTURE_2D)},cd:function(z,R){Ka?(z||(z=aa.oc()),aa.bb(R),a(Va[z]),w[R]=-1):aa.b(R)},oc:function(){-1===fb&&(fb=Math.log(P)/Math.log(2));return fb},vd:function(z){if(Ka){z|| +(z=aa.oc());y.set("s11");aa.bb(0);for(var R=P,ja=Q,S=1;S<=z;++S)R/=2,ja/=2,y.Aa("u7",.25/R,.25/ja),b.viewport(0,0,R,ja),a(Va[S-1]),b.framebufferTexture2D(la.Oa(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,Va[S],0),ma.g(!1,1===S);w[0]=-1}else aa.nb()},bb:function(z){z!==t&&(b.activeTexture(q[z]),t=z)},b:function(z){if(!hb)return!1;aa.bb(z);if(w[z]===fa)return!1;a(sa);w[z]=fa;return!0},Pb:function(z){b.activeTexture(q[z]);t=z;a(sa);w[z]=fa},l:function(){h=aa;b.framebufferTexture2D(la.Oa(),b.COLOR_ATTACHMENT0, +b.TEXTURE_2D,sa,0)},N:function(){h=aa;b.viewport(0,0,P,Q);b.framebufferTexture2D(la.Oa(),b.COLOR_ATTACHMENT0,b.TEXTURE_2D,sa,0)},Jb:E.Jb,resize:function(z,R){P=z;Q=R;J()},clone:function(z){z=E.instance({width:P,height:Q,H:m.H,isFloat:m.isFloat,isLinear:m.isLinear,isMirrorY:m.isMirrorY,isFlipY:z?!xa:xa,isPot:m.isPot});wa.set("s0");la.X();z.l();b.viewport(0,0,P,Q);aa.b(0);ma.g(!0,!0);return z},ge:function(){b.viewport(0,0,P,Q)},remove:function(){b.deleteTexture(sa);C.splice(C.indexOf(aa),1);aa=null}, +refresh:function(){aa.Pb(0);xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);Ca?b.texImage2D(b.TEXTURE_2D,0,ha,ca,b.UNSIGNED_BYTE,m.D):b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,ya);xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},Wb:function(){var z=P*Q*4;Da=[new Uint8Array(z),new Uint8Array(z),new Uint8Array(z),new Uint8Array(z)];za=[new Float32Array(Da[0].buffer),new Float32Array(Da[1].buffer),new Float32Array(Da[2].buffer),new Float32Array(Da[3].buffer)];Bb=new Uint8Array(4*z);Xa=new Float32Array(Bb.buffer); +ib=!0},Kc:function(){ib||aa.Wb();b.readPixels(0,0,P,4*Q,b.RGBA,b.UNSIGNED_BYTE,Bb);for(var z=P*Q,R=2*z,ja=3*z,S=0;Sz;++z)b.viewport(0,Q* +z,P,Q),y.Hb("u8",u[z]),ma.g(!1,0===z)},oe:function(z){var R=ia===A[0]&&!f();a(sa);xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);R?(Lb||(ra=document.createElement("canvas"),ra.width=P,ra.height=Q,zb=ra.getContext("2d"),Ab=zb.createImageData(P,Q),Lb=!0),Ab.data.set(z),zb.putImageData(Ab,0,0),b.texImage2D(b.TEXTURE_2D,0,ha,ca,ia,ra)):b.texImage2D(b.TEXTURE_2D,0,ha,P,Q,0,ca,ia,z);w[t]=fa;xa&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},Uf:function(z,R){a(sa);R&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!0);b.texImage2D(b.TEXTURE_2D, +0,ha,ca,ia,z);w[t]=fa;R&&b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1)},Kf:function(z,R){var ja=P*Q,S=4*ja;z=m.H?z?"RGBE":"JSON":"RGBA";R&&(z=R);R=ea.Z()&&!1;var La=null;switch(z){case "RGBE":La="s42";break;case "JSON":La=R?"s0":"s12";break;case "RGBA":case "RGBAARRAY":La="s6"}ib||("RGBA"===z||"RGBE"===z||"RGBAARRAY"===z?(Da=new Uint8Array(S),ib=!0):"JSON"!==z||R||aa.Wb());la.I();y.set(La);aa.b(0);S=null;if("RGBA"===z||"RGBE"===z||"RGBAARRAY"===z){b.viewport(0,0,P,Q);ma.g(!0,!0);b.readPixels(0,0,P,Q,b.RGBA, +b.UNSIGNED_BYTE,Da);if("RGBAARRAY"===z)return{data:Da};v||(F=document.createElement("canvas"),L=F.getContext("2d"),v=!0);F.width=P;F.height=Q;ja=L.createImageData(P,Q);ja.data.set(Da);L.putImageData(ja,0,0);S=F.toDataURL("image/png")}else if("JSON"===z)if(R)S=new Float32Array(ja),b.viewport(0,0,P,Q),ma.g(!0,!0),b.readPixels(0,0,P,Q,b.RGBA,b.FLOAT,S);else{for(S=0;4>S;++S)b.viewport(0,Q*S,P,Q),y.Hb("u8",u[S]),ma.g(!S,!S);aa.Kc();S=Array(ja);for(R=0;Rg.B.length?(C=Uint16Array,I=b.UNSIGNED_SHORT,H=2):(C=Uint32Array,I=b.UNSIGNED_INT,H=4);C=g.B instanceof C?g.B:new C(g.B);b.bufferData(b.ELEMENT_ARRAY_BUFFER,C,h);t=w}var r={dd:function(v){n!==w&&(b.bindBuffer(b.ARRAY_BUFFER,A),n=w);v&&wa.Ib()},ad:function(){t!==w&&(b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, +k),t=w)},bind:function(v){r.dd(v);r.ad()},Ie:function(){b.drawElements(b.TRIANGLES,B,I,0)},Je:function(v,F){b.drawElements(b.TRIANGLES,v,I,F*H)},remove:function(){b.deleteBuffer(A);g.B&&b.deleteBuffer(k);r=null}};f.push(r);return r},Ha:function(){-1!==n&&(b.bindBuffer(b.ARRAY_BUFFER,c.W),n=-1);-1!==t&&(b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,c.B),t=-1)},g:function(g,w){g&&ma.Ha();w&&wa.Ba();b.drawElements(b.TRIANGLES,3,b.UNSIGNED_SHORT,0)},Ma:function(g){g=g||b;var w=a(g);g.bindBuffer(g.ARRAY_BUFFER, +w.W);g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,w.B);wa.$a(g);g.drawElements(g.TRIANGLES,3,g.UNSIGNED_SHORT,0);g.deleteBuffer(w.W);g.deleteBuffer(w.B);q.reset()},lc:function(){var g=b,w=c;g.deleteBuffer(w.W);g.deleteBuffer(w.B)},h:function(){q.lc();f.forEach(function(g){g.remove()});b.bindBuffer(b.ARRAY_BUFFER,null);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,null);q.reset();e=!1;f.splice(0);d=0}};return q}(),la=function(){var a=null,c=null,d=null,e=!1,f=[],n={u:-2,ic:1},t={Qa:function(){return e},G:function(){if(!e){a= +b.createFramebuffer();var q=ea.Z();c=q&&b.DRAW_FRAMEBUFFER?b.DRAW_FRAMEBUFFER:b.FRAMEBUFFER;d=q&&b.READ_FRAMEBUFFER?b.READ_FRAMEBUFFER:b.FRAMEBUFFER;e=!0}},ff:function(){return c},Ad:function(){return d},Oa:function(){return b.FRAMEBUFFER},pf:function(){return n},Ze:function(){return a},instance:function(q){void 0===q.tc&&(q.tc=!1);var g=q.$?q.$:null,w=q.width,B=void 0!==q.height?q.height:q.width,h=a,A=null,k=!1,I=!1,H=0;g&&(w=w?w:g.A(),B=B?B:g.P());var C={Lc:function(){k||(h=b.createFramebuffer(), +k=!0,H=n.ic++)},Uc:function(){C.Lc();C.l();A=b.createRenderbuffer();b.bindRenderbuffer(b.RENDERBUFFER,A);b.renderbufferStorage(b.RENDERBUFFER,b.DEPTH_COMPONENT16,w,B);b.framebufferRenderbuffer(c,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,A);b.clearDepth(1)},bind:function(r,v){H!==n.u&&(b.bindFramebuffer(c,h),n.u=H);g&&g.l();v&&b.viewport(0,0,w,B);r&&b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)},ue:function(){H!==n.u&&(b.bindFramebuffer(c,h),n.u=H)},clear:function(){b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)}, +Ce:function(){b.clear(b.COLOR_BUFFER_BIT)},De:function(){b.clear(b.DEPTH_BUFFER_BIT)},ge:function(){b.viewport(0,0,w,B)},l:function(){H!==n.u&&(b.bindFramebuffer(c,h),n.u=H)},rtt:function(r){g=r;n.u!==H&&(b.bindFramebuffer(b.FRAMEBUFFER,h),n.u=H);r.l()},I:function(){b.bindFramebuffer(c,null);n.u=-1},resize:function(r,v){w=r;B=v;A&&(b.bindRenderbuffer(b.RENDERBUFFER,A),b.renderbufferStorage(b.RENDERBUFFER,b.DEPTH_COMPONENT16,w,B))},remove:function(){h===a||I||(b.bindFramebuffer(c,h),b.framebufferTexture2D(c, +b.COLOR_ATTACHMENT0,b.TEXTURE_2D,null,0),A&&b.framebufferRenderbuffer(c,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,null),b.bindFramebuffer(c,null),b.deleteFramebuffer(h),A&&b.deleteRenderbuffer(A));I=!0}};q.tc&&C.Uc();f.push(C);return C},I:function(){b.bindFramebuffer(c,null);n.u=-1},me:function(){b.bindFramebuffer(c,null);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);b.viewport(0,0,ea.A(),ea.P());n.u=-1},reset:function(){n.u=-2},X:function(){0!==n.u&&(b.bindFramebuffer(c,a),n.u=0)},clear:function(){b.viewport(0, +0,ea.A(),ea.P());b.clear(b.COLOR_BUFFER_BIT)},h:function(){t.I();f.forEach(function(q){q.remove()});b.deleteFramebuffer(a);t.reset();e=!1;f.splice(0);n.u=-2;n.ic=1}};return t}(),ea=function(){function a(){d="undefined"===typeof Ua?JEContext:Ua;e=!0}function c(r,v){for(var F=0;FO&&(O+=c);O>=c&&(O-=c);for(var ba=0;bal&&(l+=c);l>=c&&(l-=c);var M=O/c,J=l/c;E=1-E-1/f;M+=H;J+=H;pa+=C;E+=C;var m=r*e+D,fa=F*e+ba;fa=d*e-fa-1;m=fa*d*e+m;B[4*m]=pa;B[4*m+1]=E;B[4*m+2]=M;B[4* +m+3]=J;J=A[l*c+O]++;m=J%n;M=O*n+m;l=l*n+(J-m)/n;l=c*n-1-l;l=l*c*n+M;h[4*l]=pa;h[4*l+1]=E;h[4*l+2]=u;h[4*l+3]=p;++q>=f&&(q=0,++g);++w}}}A=null;var ua=V.instance(a.weights);delete a.weights.data;var Ca=V.instance({width:f,isFloat:!0,array:new Float32Array(h),isPot:!0});h=null;var ra=V.instance({width:f,isFloat:!0,array:new Float32Array(B),isPot:!0});B=null;return{oa:!0,Na:function(){return n},h:function(){Ca.remove();ra.remove();ua.remove()},J:function(){y.set("s22");ua.b(1);ra.b(2);U.g(!1,!1)}}}}}(), +fc=function(){return{instance:function(a){var c=a.kernelsNumber,d=a.toSparsity,e=d*a.toLayerSize/a.fromLayerSize,f=V.instance(a.weights);delete a.weights.data;return{oa:!0,Na:function(){return e},sf:function(){return d},Fd:function(){return f},h:function(){f.remove()},J:function(){y.set("s25");y.v("u22",c);y.v("u23",d);y.v("u16",a.toLayerSize);y.v("u24",a.fromLayerSize);f.b(1);U.g(!1,!1)}}}}}(),dc=function(){return{instance:function(a,c){var d=a.fromLayerSize,e=a.toLayerSize,f=a.toSparsity,n=a.stride? +a.stride:1,t=f*e/d,q=ewindow.innerWidth}},Tc:function(){return T.Kb()||T.Jb()},Kb:function(){var a=navigator.userAgent.toLowerCase();return-1!== -a.indexOf("safari")&&-1===a.indexOf("chrome")?!0:!1},Je:function(){return T.Uc()?T.hc()?window.innerHeight/window.innerWidth*45:45:45},Lb:function(){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?!0:!1},pause:function(a){a.pause()},vf:function(a){a.play()},release:function(a){a.pause();a.videoStream&&a.videoStream.stop();a.videoStream=null},Wc:function(a){if(!a)return a;var c=!1;if(a.video){var d=function(e){var f={};"undefined"!==typeof e.min&&(f.min=e.min);"undefined"!==typeof e.max&& -(f.max=e.max);"undefined"!==typeof e.ideal&&(f.ideal=e.ideal);return f};c={};"undefined"!==typeof a.video.width&&(c.width=d(a.video.width));"undefined"!==typeof a.video.height&&(c.height=d(a.video.height));"undefined"!==typeof a.video.facingMode&&(c.facingMode=a.video.facingMode)}c={audio:a.audio,video:c};"undefined"!==typeof a.deviceId&&(c.deviceId=a.deviceId);return c},yc:function(a){var c=a.video.width;a.video.width=a.video.height;a.video.height=c;return a},Yc:function(a){function c(p){return[480, -576,640,648,720,768,800,960,1080,1152,1280,1366,1920].sort(function(y,z){return Math.abs(y-p)-Math.abs(z-p)})}function d(p){var y=T.Wc(a);e.push(p(y))}var e=[];if(!a||!a.video)return e;if(a.video.width&&a.video.height){if(a.video.width.ideal&&a.video.height.ideal){var f=c(a.video.width.ideal).slice(0,3),k=c(a.video.height.ideal).slice(0,3),l={},n=0;for(l.$=void 0;n16/9+.1||d(function(p,y){return function(z){z.video.width.ideal=p.$;z.video.height.ideal=y.Z;return z}}(l,q))}}}d(function(p){return T.yc(p)})}a.video.width&&a.video.height&&(a.video.width.ideal&&a.video.height.ideal&&d(function(p){delete p.video.width.ideal;delete p.video.height.ideal;return p}),d(function(p){delete p.video.width;delete p.video.height;return p}));a.video.facingMode&&(d(function(p){delete p.video.facingMode;return p}),a.video.width&& -a.video.height&&d(function(p){T.yc(p);delete p.video.facingMode;return p}));e.push({audio:a.audio,video:!0});return e},Xd:function(a){if(T.hc()){if(!a||!a.video)return!1;var c=a.video.width,d=a.video.height;if(!c||!d)return!1;if(c.ideal&&d.ideal&&c.ideal>d.ideal)return a.video.height=c,a.video.width=d,!0}return!1},Na:function(a){a.volume=0;T.ta(a,"muted");if(T.Kb()){if(1===a.volume){var c=function(){a.volume=0;window.removeEventListener("mousemove",c,!1);window.removeEventListener("touchstart",c, -!1)};window.addEventListener("mousemove",c,!1);window.addEventListener("touchstart",c,!1)}setTimeout(function(){a.volume=0;T.ta(a,"muted")},5)}},zc:function(a,c,d){return new Promise(function(e,f){if(a.srcObject&&a.srcObject.getVideoTracks){var k=a.srcObject.getVideoTracks();1!==k.length?f("INVALID_TRACKNUMBER"):(k=k[0],c?T.get(a,e,f,d):(k.stop(),e()))}else f("BAD_IMPLEMENTATION")})},$b:function(a,c,d,e){function f(l){k||(k=!0,d(l))}var k=!1;return navigator.mediaDevices.getUserMedia(e).then(function(l){function n(){setTimeout(function(){if(a.currentTime){var q= -a.videoWidth,x=a.videoHeight;if(0===q||0===x)f("VIDEO_NULLSIZE");else{q&&(a.style.width=q.toString()+"px");x&&(a.style.height=x.toString()+"px");q={Sc:null,Vd:null,Dd:null};try{var m=l.getVideoTracks()[0];m&&(q.Dd=m,q.Sc=m.getCapabilities(),q.Vd=m.getSettings())}catch(p){}T.Tc()?a.parentNode&&null!==a.parentNode?(k||c(a,l,q),setTimeout(function(){a.play()},100)):(document.body.appendChild(a),T.Na(a),k||c(a,l,q),setTimeout(function(){a.style.transform="scale(0.0001,0.0001)";a.style.position="fixed"; -a.style.bottom="0px";a.style.right="0px";T.Na(a);setTimeout(function(){a.play()},100)},80)):k||c(a,l,q)}}else f("VIDEO_NOTSTARTED")},700)}"undefined"!==typeof a.srcObject?a.srcObject=l:(a.src=window.URL.createObjectURL(l),a.videoStream=l);T.Na(a);a.addEventListener("loadeddata",function(){var q=a.play();T.Na(a);"undefined"===typeof q?n():q.then(function(){n()}).catch(function(){f("VIDEO_PLAYPROMISEREJECTED")})},!1)}).catch(function(l){f(l)})},get:function(a,c,d,e){if(!a)return d&&d("VIDEO_NOTPROVIDED"), -!1;if(!T.Lb())return d&&d("MEDIASTREAMAPI_NOTFOUND"),!1;if(e&&e.video){if(T.Jb()){var f=T.md();(12>f[0]||12===f[0]&&2>f[1])&&T.Xd(e)}e.video.width&&e.video.width.ideal&&(a.style.width=e.video.width.ideal+"px");e.video.height&&e.video.height.ideal&&(a.style.height=e.video.height.ideal+"px")}T.ta(a,"autoplay");T.ta(a,"playsinline");e&&e.audio?a.volume=0:T.ta(a,"muted");T.$b(a,c,function(){function k(n){if(0===n.length)d("INVALID_FALLBACKCONSTRAINTS");else{var q=n.shift();T.$b(a,c,function(){k(n)},q)}} -var l=T.Yc(e);k(l)},e)},qd:function(a){if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return a(!1,"NOTSUPPORTED"),!1;navigator.mediaDevices.enumerateDevices().then(function(c){(c=c.filter(function(d){return d.kind&&-1!==d.kind.toLowerCase().indexOf("video")&&d.label&&d.deviceId}))&&c.length&&0H.Ed)return Ea("MAXFACES_TOOHIGH"),!1;if(!a.canvasId&&!a.canvas)return Ea("NO_CANVASID"),!1;I.W=a.canvas?a.canvas:document.getElementById(a.canvasId);if(!I.W)return Ea("INVALID_CANVASID"),!1;V.N=I.W.width;V.P=I.W.height;if(!V.N||!V.P)return Ea("INVALID_CANVASDIMENSIONS"),!1;for(var d=0;du42&&b>h+u43;i?a.r=2.:a.r>u41?a.r=0.:a.r>1.9?a.r+=1.:0.,a.r*=u44;if(a.r<.9)a=vec4(1.,u39);else{a.r*=step(1.9,a.r);float j=dot(e,texture2D(u38,vec2(.875,.875))),k=dot(e,texture2D(u38,vec2(.125,.625))),l=dot(e,texture2D(u38,vec2(.375,.625))),c=cos(u36),d=sin(u36);vec2 m=mat2(c,d*u45,-d/u45,c)*vec2(j,k);a.gba+=vec3(m,l)*u40*a.a;}gl_FragColor=a;}", -fa:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",c:"u38 u33 u39 u41 u40 u44 u36 u45 u42 u43 u35".split(" ")},{id:"s51",name:"_",fa:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",a:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);const vec3 f=vec3(.5,.5,.5);void main(){float a=dot(e,texture2D(u38,vec2(.125,.875))),b=dot(e,texture2D(u38,vec2(.375,.875))),c=dot(e,texture2D(u38,vec2(.625,.875))),d=dot(e,texture2D(u38,vec2(.625,.625)));vec3 g=vec3(a,b,c)*.5+f;gl_FragColor=vec4(g,d);}", -c:["u38"]},{id:"s52",name:"_",fa:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",a:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);void main(){float a=dot(e,texture2D(u38,vec2(.375,.375))),b=dot(e,texture2D(u38,vec2(.625,.375))),c=dot(e,texture2D(u38,vec2(.875,.375))),d=dot(e,texture2D(u38,vec2(.125,.125)));gl_FragColor=vec4(a,b,c,d);}",c:["u38"]},{id:"s47",name:"_",a:"uniform sampler2D u33;uniform vec2 u46;uniform float u47;varying vec2 vv0;void main(){float f=step(.5,mod(gl_FragCoord.y+1.5,2.)),c=step(.33,vv0.x);vec4 a=texture2D(u33,vv0+u46);a.a=mix(a.a*u47,a.a,c);vec4 d=floor(255.*a),g=255.*(255.*a-d),b=mix(d,g,f)/255.;b.x=mix(step(a.x,1.5),b.x,c),gl_FragColor=b;}", -c:["u33","u47","u46"]}]);Eb();Tb();vb();ub();c()});return!0},destroy:function(){return new Promise(function(a,c){Mb.toggle_pause(!0,!0).catch(function(){c()}).then(function(){za&&za.h();Aa.h();za=ma=Va=null;sb.splice(0);tb.splice(0);ea=ba.rb;a()})})},toggle_pause:function(a,c){if(!ob())return Promise.reject();var d=null;d=c?T.zc(t.element,!a,t.ra):Promise.resolve();a?Db():d.then(function(){pb()});return d},update_videoSettings:function(a){Db();return new Promise(function(c){T.zc(t.element,!1,t.ra).then(function(){Object.assign(ha, -a);Jb(null,null,function(d){eb(d,function(){Ha();Ga();pb();c()})})})})},toggle_slow:function(a){ob()&&ea===ba.play&&(a&&!I.Ka?(I.sc=I.Ea,W.nDetectsPerLoop=1,this.set_animateDelay(100),I.Ka=!0):!a&&I.Ka&&(W.nDetectsPerLoop=-1,this.set_animateDelay(I.sc),I.Ka=!1))},set_animateDelay:function(a){I.Ea=a},resize:function(){var a=I.W.width,c=I.W.height;if(!yb()&&a===V.N&&c===V.P)return!1;V.N=a;V.P=c;vb();ub();Ha();Ga();t.Y&&t.Y.resize(V.N,V.P);return!0},set_inputTexture:function(a,c,d){t.u[0]=c;t.u[1]=d; -t.nb=!0;Ha();qb();Ga();u.set("s48");t.Y.M();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,a);R.g(!0,!0)},reset_GLState:function(){qb();V.va.remove();U.Aa.remove();Eb()},reset_inputTexture:function(){yb();t.nb=!1;Ha();Ga()},get_videoDevices:function(a){return T.qd(a)},set_scanSettings:function(a){Object.assign(W,a);-1!==W.nDetectsPerLoop&&(Q.G=W.nDetectsPerLoop,Q.qb=W.nDetectsPerLoop);vb();ub()},set_stabilizationSettings:function(a){Object.assign(ua,a)},set_videoOrientation:function(a,c){ob()&& -(ha.flipX=c,ha.rotate=a,Ha(),Ga())},update_videoElement:function(a,c){eb(a?a:t.element,function(){Ib();Ha();Ga();c&&c()})}};return Mb};window.JEEFACEFILTERAPI=window.JEEFACEFILTERAPIGEN(); +4)))a=!0;return a},Tb:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream},xd:function(){var a=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return 2window.innerWidth}},gd:function(){return W.Ub()||W.Tb()},Ub:function(){var a=navigator.userAgent.toLowerCase();return-1!== +a.indexOf("safari")&&-1===a.indexOf("chrome")?!0:!1},Xe:function(){return W.hd()?W.xc()?window.innerHeight/window.innerWidth*45:45:45},Vb:function(){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?!0:!1},pause:function(a){a.pause()},Jf:function(a){a.play()},release:function(a){a.pause();a.videoStream&&a.videoStream.stop();a.videoStream=null},kd:function(a){if(!a)return a;var c=!1;if(a.video){var d=function(e){var f={};"undefined"!==typeof e.min&&(f.min=e.min);"undefined"!==typeof e.max&& +(f.max=e.max);"undefined"!==typeof e.ideal&&(f.ideal=e.ideal);return f};c={};"undefined"!==typeof a.video.width&&(c.width=d(a.video.width));"undefined"!==typeof a.video.height&&(c.height=d(a.video.height));"undefined"!==typeof a.video.facingMode&&(c.facingMode=a.video.facingMode)}c={audio:a.audio,video:c};"undefined"!==typeof a.deviceId&&(c.deviceId=a.deviceId);return c},Pc:function(a){var c=a.video.width;a.video.width=a.video.height;a.video.height=c;return a},md:function(a){function c(h){return[480, +576,640,648,720,768,800,960,1080,1152,1280,1366,1920].sort(function(A,k){return Math.abs(A-h)-Math.abs(k-h)})}function d(h){var A=W.kd(a);e.push(h(A))}var e=[];if(!a||!a.video)return e;if(a.video.width&&a.video.height){if(a.video.width.ideal&&a.video.height.ideal){var f=c(a.video.width.ideal).slice(0,3),n=c(a.video.height.ideal).slice(0,3),t={},q=0;for(t.ca=void 0;q16/9+.1||d(function(h,A){return function(k){k.video.width.ideal=h.ca;k.video.height.ideal=A.ba;return k}}(t,g))}}}d(function(h){return W.Pc(h)})}a.video.width&&a.video.height&&(a.video.width.ideal&&a.video.height.ideal&&d(function(h){delete h.video.width.ideal;delete h.video.height.ideal;return h}),d(function(h){delete h.video.width;delete h.video.height;return h}));a.video.facingMode&&(d(function(h){delete h.video.facingMode; +return h}),a.video.width&&a.video.height&&d(function(h){W.Pc(h);delete h.video.facingMode;return h}));e.push({audio:a.audio,video:!0});return e},je:function(a){if(W.xc()){if(!a||!a.video)return!1;var c=a.video.width,d=a.video.height;if(!c||!d)return!1;if(c.ideal&&d.ideal&&c.ideal>d.ideal)return a.video.height=c,a.video.width=d,!0}return!1},Sa:function(a){a.volume=0;W.wa(a,"muted");if(W.Ub()){if(1===a.volume){var c=function(){a.volume=0;window.removeEventListener("mousemove",c,!1);window.removeEventListener("touchstart", +c,!1)};window.addEventListener("mousemove",c,!1);window.addEventListener("touchstart",c,!1)}setTimeout(function(){a.volume=0;W.wa(a,"muted")},5)}},Qc:function(a,c,d){return new Promise(function(e,f){if(a.srcObject&&a.srcObject.getVideoTracks){var n=a.srcObject.getVideoTracks();1!==n.length?f("INVALID_TRACKNUMBER"):(n=n[0],c?W.get(a,e,f,d):(n.stop(),e()))}else f("BAD_IMPLEMENTATION")})},qc:function(a,c,d,e){function f(t){n||(n=!0,d(t))}var n=!1;return navigator.mediaDevices.getUserMedia(e).then(function(t){function q(){setTimeout(function(){if(a.currentTime){var g= +a.videoWidth,w=a.videoHeight;if(0===g||0===w)f("VIDEO_NULLSIZE");else{g&&(a.style.width=g.toString()+"px");w&&(a.style.height=w.toString()+"px");g={fd:null,he:null,Qd:null};try{var B=t.getVideoTracks()[0];B&&(g.Qd=B,g.fd=B.getCapabilities(),g.he=B.getSettings())}catch(h){}W.gd()?a.parentNode&&null!==a.parentNode?(n||c(a,t,g),setTimeout(function(){a.play()},100)):(document.body.appendChild(a),W.Sa(a),n||c(a,t,g),setTimeout(function(){a.style.transform="scale(0.0001,0.0001)";a.style.position="fixed"; +a.style.bottom="0px";a.style.right="0px";W.Sa(a);setTimeout(function(){a.play()},100)},80)):n||c(a,t,g)}}else f("VIDEO_NOTSTARTED")},700)}"undefined"!==typeof a.srcObject?a.srcObject=t:(a.src=window.URL.createObjectURL(t),a.videoStream=t);W.Sa(a);a.addEventListener("loadeddata",function(){var g=a.play();W.Sa(a);"undefined"===typeof g?q():g.then(function(){q()}).catch(function(){f("VIDEO_PLAYPROMISEREJECTED")})},!1)}).catch(function(t){f(t)})},get:function(a,c,d,e){if(!a)return d&&d("VIDEO_NOTPROVIDED"), +!1;if(!W.Vb())return d&&d("MEDIASTREAMAPI_NOTFOUND"),!1;if(e&&e.video){if(W.Tb()){var f=W.xd();(12>f[0]||12===f[0]&&2>f[1])&&W.je(e)}e.video.width&&e.video.width.ideal&&(a.style.width=e.video.width.ideal+"px");e.video.height&&e.video.height.ideal&&(a.style.height=e.video.height.ideal+"px")}W.wa(a,"autoplay");W.wa(a,"playsinline");e&&e.audio?a.volume=0:W.wa(a,"muted");W.qc(a,c,function(){function n(q){if(0===q.length)d("INVALID_FALLBACKCONSTRAINTS");else{var g=q.shift();W.qc(a,c,function(){n(q)},g)}} +var t=W.md(e);n(t)},e)},Dd:function(a){if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return a(!1,"NOTSUPPORTED"),!1;navigator.mediaDevices.enumerateDevices().then(function(c){(c=c.filter(function(d){return d.kind&&-1!==d.kind.toLowerCase().indexOf("video")&&d.label&&d.deviceId}))&&c.length&&0K.Rd)return Ha("MAXFACES_TOOHIGH"),!1;if(!a.canvasId&&!a.canvas)return Ha("NO_CANVASID"),!1;N.Y=a.canvas?a.canvas:document.getElementById(a.canvasId);if(!N.Y)return Ha("INVALID_CANVASID"),!1;Y.O=N.Y.width;Y.R=N.Y.height;if(!Y.O||!Y.R)return Ha("INVALID_CANVASDIMENSIONS"),!1;for(var d=0;du42&&b>h+u43;i?a.r=2.:a.r>u41?a.r=0.:a.r>1.9?a.r+=1.:0.,a.r*=u44;if(a.r<.9)a=vec4(1.,u39);else{a.r*=step(1.9,a.r);float j=dot(e,texture2D(u38,vec2(.875,.875))),k=dot(e,texture2D(u38,vec2(.125,.625))),l=dot(e,texture2D(u38,vec2(.375,.625))),c=cos(u36),d=sin(u36);vec2 m=mat2(c,d*u45,-d/u45,c)*vec2(j,k);a.gba+=vec3(m,l)*u40*a.a;}gl_FragColor=a;}", +ja:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",c:"u38 u33 u39 u41 u40 u44 u36 u45 u42 u43 u35".split(" ")},{id:"s53",name:"_",ja:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",a:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);const vec3 f=vec3(.5,.5,.5);void main(){float a=dot(e,texture2D(u38,vec2(.125,.875))),b=dot(e,texture2D(u38,vec2(.375,.875))),c=dot(e,texture2D(u38,vec2(.625,.875))),d=dot(e,texture2D(u38,vec2(.625,.625)));vec3 g=vec3(a,b,c)*.5+f;gl_FragColor=vec4(g,d);}", +c:["u38"]},{id:"s54",name:"_",ja:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",a:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);void main(){float a=dot(e,texture2D(u38,vec2(.375,.375))),b=dot(e,texture2D(u38,vec2(.625,.375))),c=dot(e,texture2D(u38,vec2(.875,.375))),d=dot(e,texture2D(u38,vec2(.125,.125)));gl_FragColor=vec4(a,b,c,d);}",c:["u38"]},{id:"s49",name:"_",a:"uniform sampler2D u33;uniform vec2 u46;uniform float u47;varying vec2 vv0;void main(){float f=step(.5,mod(gl_FragCoord.y+1.5,2.)),c=step(.33,vv0.x);vec4 a=texture2D(u33,vv0+u46);a.a=mix(a.a*u47,a.a,c);vec4 d=floor(255.*a),g=255.*(255.*a-d),b=mix(d,g,f)/255.;b.x=mix(step(a.x,1.5),b.x,c),gl_FragColor=b;}", +c:["u33","u47","u46"]}]);Fb();Ub();vb();ub();c()});return!0},destroy:function(){return new Promise(function(a,c){Nb.toggle_pause(!0,!0).catch(function(){c()}).then(function(){Aa&&Aa.h();Ua.h();Aa=oa=Wa=null;sb.splice(0);tb.splice(0);ka=da.zb;a()})})},toggle_pause:function(a,c){if(!ob())return Promise.reject();var d=null;d=c?W.Qc(x.element,!a,x.ua):Promise.resolve();a?Eb():d.then(function(){pb()});return d},update_videoSettings:function(a){Eb();return new Promise(function(c){W.Qc(x.element,!1,x.ua).then(function(){Object.assign(na, +a);Kb(null,null,function(d){eb(d,function(){Ja();Ia();pb();c()})})})})},toggle_slow:function(a){ob()&&ka===da.play&&(a&&!N.Pa?(N.Jc=N.Fa,Z.nDetectsPerLoop=1,this.set_animateDelay(100),N.Pa=!0):!a&&N.Pa&&(Z.nDetectsPerLoop=-1,this.set_animateDelay(N.Jc),N.Pa=!1))},set_animateDelay:function(a){N.Fa=a},resize:function(){var a=N.Y.width,c=N.Y.height;if(!yb()&&a===Y.O&&c===Y.R)return!1;Y.O=a;Y.R=c;vb();ub();Ja();Ia();x.aa&&x.aa.resize(Y.O,Y.R);return!0},set_inputTexture:function(a,c,d){x.o[0]=c;x.o[1]= +d;x.vb=!0;Ja();qb();Ia();y.set("s50");x.aa.N();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,a);U.g(!0,!0)},reset_GLState:function(){qb();Y.ya.remove();X.Ca.remove();Fb()},reset_inputTexture:function(){yb();x.vb=!1;Ja();Ia()},get_videoDevices:function(a){return W.Dd(a)},set_scanSettings:function(a){Object.assign(Z,a);-1!==Z.nDetectsPerLoop&&(T.F=Z.nDetectsPerLoop,T.yb=Z.nDetectsPerLoop);vb();ub()},set_stabilizationSettings:function(a){Object.assign(ta,a)},set_videoOrientation:function(a, +c){ob()&&(na.flipX=c,na.rotate=a,Ja(),Ia())},update_videoElement:function(a,c){eb(a?a:x.element,function(){Jb();Ja();Ia();c&&c()})}};return Nb};window.JEEFACEFILTERAPI=window.JEEFACEFILTERAPIGEN(); ;if(typeof(module)!=='undefined'){module.exports=window.JEEFACEFILTERAPI;} window.JEEFACEFILTERAPI.FAKEDOM=FAKEDOM; \ No newline at end of file diff --git a/helpers/JeelizResizer.js b/helpers/JeelizResizer.js index 1cb2a708..41d39ff9 100644 --- a/helpers/JeelizResizer.js +++ b/helpers/JeelizResizer.js @@ -12,7 +12,7 @@ to balance between performance and quality */ "use strict"; -const superThat = (function(){ +const JeelizResizer = (function(){ // private vars: let _domCanvas = null, _whCanvasPx = null, @@ -321,8 +321,8 @@ const superThat = (function(){ // Export ES6 module: try { - module.exports = superThat; + module.exports = JeelizResizer; } catch(e){ console.log('JeelizResizer ES6 Module not exported'); - window.JeelizResizer = superThat; + window.JeelizResizer = JeelizResizer; } \ No newline at end of file diff --git a/helpers/JeelizThreejsHelper.js b/helpers/JeelizThreejsHelper.js index df0df97d..1f677921 100644 --- a/helpers/JeelizThreejsHelper.js +++ b/helpers/JeelizThreejsHelper.js @@ -2,7 +2,7 @@ Helper for Three.js */ -const superThat = (function(){ +const JeelizThreeHelper = (function(){ // internal settings: const _settings = { rotationOffsetX: 0.0, // negative -> look upper. in radians @@ -442,8 +442,8 @@ const superThat = (function(){ // Export ES6 module: try { - module.exports = superThat; + module.exports = JeelizThreeHelper; } catch(e){ console.log('JeelizThreeHelper ES6 Module not exported'); - window.JeelizThreeHelper = superThat; + window.JeelizThreeHelper = JeelizThreeHelper; }