text:  /**
   * Jeeliz Face Filter - https://github.com/jeeliz/jeelizFaceFilter
   *
   * Copyright 2018 Jeeliz ( https://jeeliz.com )
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   * http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
  */
  
  function ja(b,c,f){return b*(1-f)+c*f}function za(b,c){var f=new XMLHttpRequest;f.open("GET",b,!0);f.withCredentials=!1;f.onreadystatechange=function(){4===f.readyState&&200===f.status&&c(f.responseText)};f.send()}function Ba(b,c,f){return Math.min(Math.max((f-b)/(c-b),0),1)}
  function Ea(b){switch(b){case "relu":return"gl_FragColor=max(vec4(0.,0.,0.,0.),gl_FragColor);";case "elu":return"gl_FragColor=mix(exp(-abs(gl_FragColor))-vec4(1.,1.,1.,1.),gl_FragColor,step(0.,gl_FragColor));";case "elu01":return"gl_FragColor=mix(0.1*exp(-abs(gl_FragColor))-vec4(0.1,0.1,0.1,0.1),gl_FragColor,step(0.,gl_FragColor));";case "arctan":return"gl_FragColor=atan(3.14159265359*texture2D(u0,vUV))/3.14159265359;";case "copy":return"";default:return!1}}
  function Fa(b,c){var f=c%8;return b[(c-f)/8]>>7-f&1}
  function Ha(b){var c=JSON.parse(b);b=c.ne;var f=c.nf,k=c.n,n="undefined"===typeof btoa?Buffer.from(c.data,"base64").toString("latin1"):atob(c.data),l=n.length,u;c=new Uint8Array(l);for(u=0;u<l;++u)c[u]=n.charCodeAt(u);n=new Float32Array(k);l=new Float32Array(f);u=b+f+1;var q,m;for(q=0;q<k;++q){var t=u*q;var w=0===Fa(c,t)?1:-1;var x=t+1;var G=1,L=0;for(m=x+b-1;m>=x;--m)L+=G*Fa(c,m),G*=2;m=L;x=c;G=t+1+b;L=l;var K=0,P=L.length;for(t=G;t<G+P;++t)L[K]=Fa(x,t),++K;for(t=x=0;t<f;++t)x+=l[t]*Math.pow(2,-t-
  1);w=0===x&&0===m?0:w*(1+x)*Math.pow(2,1+m-Math.pow(2,b-1));n[q]=w}return n}
  var v=function(){function b(g,B){g=a.createShader(g);a.shaderSource(g,B);a.compileShader(g);return a.getShaderParameter(g,a.COMPILE_STATUS)?g:!1}function c(g,B){g=b(a.VERTEX_SHADER,g);B=b(a.FRAGMENT_SHADER,B);var D=a.createProgram();a.attachShader(D,g);a.attachShader(D,B);a.linkProgram(D);return D}function f(g){void 0===g.Y&&(g.Y="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.sa&&(g.sa=["a0"]);void 0===g.da&&(g.da=
  [2]);if(void 0===g.precision||"highp"===g.precision)g.precision=m;g.id=u++;void 0!==g.Nc&&g.Nc.forEach(function(D,ea){g.c=g.c.replace(D,g.Da[ea])});g.ab=0;g.da.forEach(function(D){g.ab+=4*D});g.Ca=c(g.Y,"precision "+g.precision+" float;\n"+g.c);g.m={};g.f.forEach(function(D){g.m[D]=a.getUniformLocation(g.Ca,D)});g.attributes={};g.ea=[];g.sa.forEach(function(D){var ea=a.getAttribLocation(g.Ca,D);g.attributes[D]=ea;g.ea.push(ea)});if(g.h){a.useProgram(g.Ca);l=g;n=g.id;for(var B in g.h)a.uniform1i(g.m[B],
  g.h[B])}g.Hd=!0}function k(g){Ia.Uc(Q);n!==g.id&&(Q.X(),n=g.id,l=g,a.useProgram(g.Ca),g.ea.forEach(function(B){0!==B&&a.enableVertexAttribArray(B)}))}var n=-1,l=!1,u=0,q=!1,m="highp",t=["u1"],w=["u0"],x={u1:0},G={u0:0},L={u1:0,u2:1},K={u3:0},P={s0:{c:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",f:t,h:x},s1:{c:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",f:t,h:x,precision:"lowp"},s2:{c:"uniform sampler2D u1,u2;varying vec2 vv0;void main(){vec4 a=texture2D(u2,vv0),b=texture2D(u1,vv0);gl_FragColor=a*b;}",
  f:["u1","u2"],h:L},s3:{c:"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;}",f:t,h:x},s4:{c:"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;}",f:["u1","mask"],h:L},s5:{c:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(1.-vv0.x,vv0.y));}",f:t,h:x},s6:{c:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vec2(vv0.x,1.-vv0.y));}",
  f:t,h:x},s7:{c:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=a*u4;}",f:["u0","u4"],h:G},s8:{c:"uniform sampler2D u0;uniform float u4;varying vec2 vv0;const vec4 g=vec4(.25,.25,.25,.25),e=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);float b=dot(a*u4,g);gl_FragColor=b*e;}",f:["u0","u4"],h:G},s9:{c:"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;}",
  f:t,h:x},s10:{c:"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);}",f:["u1","u5","u6"],h:{u1:0,u5:1}},s11:{c:"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.)));}",f:["u1","u7"],h:x},s12:{c:"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 k(float a){if(a==0.)return vec4(0.,0.,0.,0.);float l=128.*step(a,0.);a=abs(a);float c=floor(log2(a)),m=c+127.,b=(a/exp2(c)-1.)*8388608.,d=m/2.,n=fract(d)*2.,o=floor(d),p=e(b,0.,8.),q=e(b,8.,16.),r=n*128.+e(b,16.,23.),j=l+o;return vec4(p,q,r,j)/255.;}void main(){float a=dot(texture2D(u1,vv0),u8);gl_FragColor=k(a);}",
  f:["u1","u8"],h:x},s13:{c:"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;}",f:w,h:G},s14:{c:"uniform sampler2D u0;varying vec2 vv0;const vec4 e=vec4(0.,0.,0.,0.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=max(e,a);}",f:w,h:G},s15:{c:"uniform sampler2D u0;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=mix(exp(-abs(a))-e,a,step(0.,a));}",f:w,h:G},s16:{c:"uniform sampler2D u0;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.);void main(){vec4 a=texture2D(u0,vv0),b=exp(-abs(a))-e;gl_FragColor=mix(.1*b,a,step(0.,a));}",
  f:w,h:G},s17:{c:"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));}",f:["u0","u6","u9"],h:{u0:0,u6:1,u9:2}},s18:{c:"uniform sampler2D u0;const float e=3.141593;varying vec2 vv0;void main(){gl_FragColor=atan(e*texture2D(u0,vv0))/e;}",f:w,h:G},s19:{c:"uniform sampler2D u0;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.),g=vec4(.5,.5,.5,.5);void main(){vec4 a=texture2D(u0,vv0),b=log(e+a);gl_FragColor=b;}",
  f:w,h:G},s20:{c:"uniform sampler2D u0;uniform float gain;varying vec2 vv0;void main(){vec4 a=texture2D(u0,vv0);gl_FragColor=exp(a);}",f:["u0","u10"],h:G},s21:{c:"uniform sampler2D u0,u11;uniform float u12;const vec2 f=vec2(.5,.5);const float g=1e-5;const vec4 h=vec4(1.,1.,1.,1.),i=vec4(0.,0.,0.,0.);varying vec2 vv0;void main(){vec4 a=texture2D(u11,f);float b=u12*u12;vec4 c=max(b*a,g*h);gl_FragColor=texture2D(u0,vv0)/c;}",f:["u0","u13","u12"],h:{u0:0,u13:1}},s22:{c:"uniform sampler2D u1;uniform vec2 u14;varying vec2 vv0;void main(){float a=u14.x*u14.y;vec2 b=floor(vv0*a)/a,c=fract(vv0*a),d=floor(b*u14.y),g=floor(u14.x*fract(b*u14.y)),f=(g*u14.y+d)/a;gl_FragColor=texture2D(u1,f+c/a);}",
  f:["u1","u14"],h:x},s23:{c:"uniform sampler2D u15,u16,u17;varying vec2 vv0;void main(){vec4 a=texture2D(u17,vv0);vec2 b=a.rg,c=a.ba;vec4 d=texture2D(u15,b),e=texture2D(u16,c);gl_FragColor=d*e;}",f:["u15","u16","u17"],h:{u16:0,u15:1,u17:2}},s24:{c:"uniform float u18;uniform sampler2D u15,u16;varying vec2 vv0;void main(){vec2 a=fract(vv0*u18);vec4 b=texture2D(u15,vv0),c=texture2D(u16,a);gl_FragColor=b*c;}",f:["u16","u15","u18"],h:{u16:0,u15:1}},s25:{c:"uniform float u18;uniform sampler2D u15,u16,u19,u20,u21,u22;varying vec2 vv0;const vec4 e=vec4(1.,1.,1.,1.),g=vec4(1e-3,1e-3,1e-3,1e-3);void main(){vec2 i=vv0*u18,m=floor(i),c=i-m;vec4 n=texture2D(u15,vv0),d=texture2D(u16,c),a=texture2D(u22,vv0);a=a*255.;vec4 o=texture2D(u19,c),p=texture2D(u20,c),q=texture2D(u21,c),j=step(-g,-a),b=e-j,k=b*step(-e-g,-a);b*=e-k;vec4 h=b*step(-2.*e-g,-a);b*=e-h;vec4 l=b;d=j*d+k*o+h*p+l*q,gl_FragColor=n*d;}",
  f:"u15 u16 u18 u22 u19 u20 u21".split(" "),h:{u16:0,u15:1,u22:3,u19:4,u20:5,u21:6}},s26:{c:"uniform sampler2D u15,u16,u23;uniform float u18,u24,u25,u26;varying vec2 vv0;const vec2 j=vec2(1.,1.);void main(){vec2 a=floor(u24*vv0),g=u24*vv0-a;float b=u18/u24;vec2 c=floor(g*b),d=g*b-c,h=(a+d)/u24;float l=u24*u26/u18;vec2 m=l*c,i=(m+d*u25)/u26,e=step(i,j);vec4 n=texture2D(u15,h),o=texture2D(u16,i),p=n*o*e.x*e.y,k=texture2D(u23,h);gl_FragColor=p*u25*u25+k;}",f:"u15 u16 u18 u24 u25 u26 u23".split(" "),h:{u16:0,
  u15:1,u23:2}},s27:{c:"uniform sampler2D u15,u16;varying vec2 vv0;void main(){vec4 a=texture2D(u15,vv0),b=texture2D(u16,vv0);gl_FragColor=a*b;}",f:["u15","u16"],h:{u16:0,u15:1}},s28:{c:"uniform sampler2D u1,u23;uniform float u27;varying vec2 vv0;void main(){gl_FragColor=texture2D(u23,vv0)+u27*texture2D(u1,vv0);}",f:["u1","u23","u27"],h:{u1:0,u23:1}},s29:{c:"varying vec2 vv0;uniform sampler2D u1;const vec4 g=vec4(1.,1.,1.,1.),e=vec4(.299,.587,.114,0.);void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=dot(a,e)*g;}",
  f:t,h:x,precision:"lowp"},s30:{c:"varying vec2 vv0;uniform sampler2D u1,u2;uniform float u28;const vec4 g=vec4(1.,1.,1.,1.);void main(){vec4 a=vec4(0.);a-=texture2D(u1,vec2(vv0.x-u28,vv0.y-u28))*1.,a-=texture2D(u1,vec2(vv0.x-u28,vv0.y))*2.,a-=texture2D(u1,vec2(vv0.x-u28,vv0.y+u28))*1.,a+=texture2D(u1,vec2(vv0.x+u28,vv0.y-u28))*1.,a+=texture2D(u1,vec2(vv0.x+u28,vv0.y))*2.,a+=texture2D(u1,vec2(vv0.x+u28,vv0.y+u28))*1.;vec4 b=vec4(0.);b-=texture2D(u1,vec2(vv0.x-u28,vv0.y-u28))*1.,b-=texture2D(u1,vec2(vv0.x,vv0.y-u28))*2.,b-=texture2D(u1,vec2(vv0.x+u28,vv0.y-u28))*1.,b+=texture2D(u1,vec2(vv0.x-u28,vv0.y+u28))*1.,b+=texture2D(u1,vec2(vv0.x,vv0.y+u28))*2.,b+=texture2D(u1,vec2(vv0.x+u28,vv0.y+u28))*1.;vec3 c=sqrt(a.rgb*a.rgb+b.rgb*b.rgb);vec4 e=vec4(c,texture2D(u1,vv0).a),f=texture2D(u2,vv0);gl_FragColor=f.a*e.r*g;}",
  f:["u1","u2","u28"],h:L},s31:{c:"varying vec2 vv0;uniform sampler2D u1,u2;uniform float u28;const vec4 j=vec4(1.,1.,1.,1.);const vec2 k=vec2(1.,1.);void main(){float i=0.;vec2 l=k*u28,b,c;float d,a,g=0.;for(float f=-4.;f<=4.;f+=1.)for(float e=-4.;e<=4.;e+=1.)b=vec2(f,e),d=length(b)/2.,a=exp(-d*d),c=vv0+l*b,a=1.,i+=a*texture2D(u1,c).r,g+=a;vec4 m=texture2D(u2,vv0);gl_FragColor=m.a*(texture2D(u1,c).r-i/g)*j;}",f:["u1","u2","u28"],h:L},s32:{c:"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 h=vec2(.5,.5),i=vec2(1.,0.),j=vec2(0.,1.);void main(){vec2 a=vv0-u7*h;vec4 b=texture2D(u3,a),c=texture2D(u3,a+u7*i),d=texture2D(u3,a+u7*j),k=texture2D(u3,a+u7),l=e(b,c),g=e(d,k);gl_FragColor=e(l,g);}",
  f:["u3","u7"],h:K},s33:{c:"uniform sampler2D u3;uniform vec2 u7;varying vec2 vv0;const vec2 j=vec2(1.,0.),k=vec2(0.,1.),l=vec2(2.,0.),m=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*j),d=texture2D(u3,a+u7*k),g=texture2D(u3,a+u7),i=e(b,c),h=e(d,g);return e(i,h);}void main(){vec2 a=vv0+u7*vec2(-.55,-1.05);vec4 b=f(a),c=f(a+u7*l),d=f(a+u7*2.),g=f(a+u7*m),i=e(b,c),h=e(d,g);gl_FragColor=e(i,h);}",f:["u3","u7"],h:K},s34:{c:"uniform sampler2D u1;varying vec2 vv0;void main(){vec4 a=texture2D(u1,vv0);gl_FragColor=a*a;}",
  f:["u1"],h:x,precision:"lowp"},s35:{c:"uniform sampler2D u1;uniform vec2 u7;varying vec2 vv0;const vec4 g=vec4(1.,1.,1.,1.);const float d=15444.;void main(){vec4 a=1001./d*texture2D(u1,vv0-3.*u7)+2002./d*texture2D(u1,vv0-2.*u7)+3003./d*texture2D(u1,vv0-u7)+3432./d*texture2D(u1,vv0)+3003./d*texture2D(u1,vv0+u7)+2002./d*texture2D(u1,vv0+2.*u7)+1001./d*texture2D(u1,vv0+3.*u7);gl_FragColor=a;}",f:["u7","u1"],h:x,precision:"lowp"},s36:{c:"uniform sampler2D u1,u29,u30;varying vec2 vv0;const vec4 g=vec4(1.,1.,1.,1.);const float h=.1;void main(){vec4 a=texture2D(u29,vv0),b=texture2D(u30,vv0),c=texture2D(u1,vv0),d=max(g*h,b-a*a),f=sqrt(d);gl_FragColor=(c-a)/f;}",
  f:["u1","u29","u30"],h:{u1:0,u29:1,u30:2}}},N={s37:{c:"uniform float u18,u31;uniform sampler2D u15,u16,u23;varying vec2 vv0;const vec2 ZERO2=vec2(0.,0.),ONE2=vec2(1.,1.),HALF2=vec2(.5,.5),EPS2=vec2(.01,.01);void main(){vec4 sum=texture2D(u23,vv0);float toSparsity=1.1111;vec2 uvFrom,uvWeight,xyPatch=ZERO2,eps2=EPS2/u18,xyTo=floor(vv0*u18+eps2);float weightSize=toSparsity*u18;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+u31*(xyPatch-halfFromSparsity))/u18,uvFrom+=step(uvFrom,-eps2),uvFrom-=step(ONE2-eps2,uvFrom),uvWeight=(xyTo*toSparsity+xyPatch+HALF2)/weightSize,sum+=texture2D(u15,uvWeight)*texture2D(u16,uvFrom);}gl_FragColor=sum,gl_FragColor*=2.2222;}",
  f:["u18","u15","u16","u23","u31"],Da:["1.1111","gl_FragColor\\*=2.2222;"]},s38:{c:"uniform float u18,u31,u26;uniform sampler2D u15,u16,u23;varying vec2 vv0;const vec2 ZERO2=vec2(0.,0.),ONE2=vec2(1.,1.),HALF2=vec2(.5,.5),EPS2=vec2(.01,.01);void main(){vec4 sum=texture2D(u23,vv0);float fromSparsity=1.1111,shrinkFactor=3.3333;vec2 uvFrom,uvWeight,xyFrom,xyPatchTo,xyPatch=ZERO2,xyShrink=ZERO2,eps2=EPS2/u26,xyTo=floor(vv0*u18+eps2);float weightSize=fromSparsity*u26;vec2 halfFromSparsity=ONE2*(fromSparsity-1.)/2.;float toSparsity=weightSize/u18;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*u31*(xyPatch-halfFromSparsity),uvFrom=(xyFrom+HALF2)/u26,uvFrom+=step(uvFrom,-eps2),uvFrom-=step(ONE2-eps2,uvFrom),xyPatchTo=xyPatch*shrinkFactor+xyShrink,uvWeight=(xyTo*toSparsity+xyPatchTo+HALF2)/weightSize,sum+=texture2D(u15,uvWeight)*texture2D(u16,uvFrom);}}}gl_FragColor=sum,gl_FragColor*=2.2222;}",
  f:"u18 u26 u15 u16 u23 u31".split(" "),Da:["1.1111","gl_FragColor\\*=2.2222;","3.3333"]}},Q={Ta:function(){return q},l:function(){if(!q){m="highp";for(var g in P)f(P[g],g);v.set("s0");a.enableVertexAttribArray(0);g=Ja.l();q=!0;return g}},Ub:function(g){g.forEach(function(B){Q.cb(B)})},cb:function(g){P[g.id]=g;f(g,g.id)},sb:function(g,B,D){B||(B=g);P[B]=Object.create(N[g]);N[g].Da&&N[g].Da.forEach(function(ea,xa){P[B].c=P[B].c.replace(new RegExp(ea,"g"),D[xa])});f(P[B],B)},set:function(g){k(P[g])},
  oc:function(g){return"undefined"!==typeof P[g]},td:function(){return l.qd},X:function(){-1!==n&&(n=-1,l.ea.forEach(function(g){0!==g&&a.disableVertexAttribArray(g)}))},Za:function(){var g=0;l.ea.forEach(function(B,D){D=l.da[D];a.vertexAttribPointer(B,D,a.FLOAT,!1,l.ab,g);g+=4*D})},kb:function(){a.enableVertexAttribArray(0)},na:function(){a.vertexAttribPointer(l.ea[0],2,a.FLOAT,!1,8,0)},Mb:function(g,B){a.uniform1i(l.m[g],B)},u:function(g,B){a.uniform1f(l.m[g],B)},P:function(g,B,D){a.uniform2f(l.m[g],
  B,D)},Ud:function(g,B){a.uniform2fv(l.m[g],B)},Vd:function(g,B){a.uniform3fv(l.m[g],B)},Vc:function(g,B,D,ea){a.uniform3f(l.m[g],B,D,ea)},Nb:function(g,B){a.uniform4fv(l.m[g],B)},Wd:function(g,B){a.uniformMatrix2fv(l.m[g],!1,B)},Xd:function(g,B){a.uniformMatrix3fv(l.m[g],!1,B)},Yd:function(g,B){a.uniformMatrix4fv(l.m[g],!1,B)},I:function(g,B){Q.set(g);B.forEach(function(D){switch(D.type){case "4f":a.uniform4fv(l.m[D.name],D.value);break;case "3f":a.uniform3fv(l.m[D.name],D.value);break;case "2f":a.uniform2fv(l.m[D.name],
  D.value);break;case "1f":a.uniform1f(l.m[D.name],D.value);break;case "1i":a.uniform1i(l.m[D.name],D.value);break;case "mat2":a.uniformMatrix2fv(l.m[D.name],!1,D.value);break;case "mat3":a.uniformMatrix3fv(l.m[D.name],!1,D.value);break;case "mat4":a.uniformMatrix4fv(l.m[D.name],!1,D.value)}})}};return Q}(),a=!1,La=function(){function b(m){console.log("ERROR in ContextFeedForward : ",m);return!1}var c=!1,f=!1,k=!1,n=!1,l=!0,u=!1,q={w:function(){return c.width},L:function(){return c.height},ud:function(){return c},
  sd:function(){return a},o:function(){return l},flush:function(){a.flush()},tc:function(){u||(u=new Uint8Array(c.width*c.height*4));a.readPixels(0,0,c.width,c.height,a.RGBA,a.UNSIGNED_BYTE,u);return u},wd:function(){return c.toDataURL("image/jpeg")},xd:function(){J.J();f||(f=document.createElement("canvas"),k=f.getContext("2d"));f.width=c.width;f.height=c.height;var m=q.tc(),t=k.createImageData(f.width,f.height),w,x,G=f.width,L=f.height,K=t.data;for(x=0;x<L;++x){var P=L-x-1;for(w=0;w<G;++w){var N=
  4*(x*G+w);var Q=4*(P*G+w);K[N]=m[Q];K[N+1]=m[Q+1];K[N+2]=m[Q+2];K[N+3]=m[Q+3]}}k.putImageData(t,0,0);return f.toDataURL("image/png")},vd:function(m){!f&&m&&(f=document.createElement("canvas"),k=f.getContext("2d"));var t=m?f:document.createElement("canvas");t.width=c.width;t.height=c.height;(m?k:t.getContext("2d")).drawImage(c,0,0);return t},l:function(m){m.hc&&!m.ha?c=document.getElementById(m.hc):m.ha&&(c=m.ha);c||(c=document.createElement("canvas"));c.width=m&&void 0!==m.width?m.width:512;c.height=
  m&&void 0!==m.height?m.height:512;"undefined"===typeof m&&(m={});void 0===m.premultipliedAlpha&&(m.premultipliedAlpha=!1);void 0===m.ub&&(m.ub=!0);void 0===m.antialias&&(m.antialias=!1);var t={antialias:m.antialias,alpha:!0,preserveDrawingBuffer:!0,premultipliedAlpha:m.premultipliedAlpha,stencil:!1,depth:m.ub},w;if(w=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream)w=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),w=12===parseInt(w[1],10);w||(a=c.getContext("webgl2",t));a?l=!0:
  ((a=c.getContext("webgl",t))||(a=c.getContext("experimental-webgl",t)),l=!1);if(!a)return b("WebGL is not enabled");(n=a.getExtension("WEBGL_lose_context"))&&c.addEventListener("webglcontextlost",m.Jc,!1);if(!Ka.l())return b("Not enough capabilities");if(!Ka.cc()&&l)return b("Your configuration cannot process color buffer float");a.clearColor(0,0,0,0);a.disable(a.DEPTH_TEST);a.disable(a.BLEND);a.disable(a.DITHER);a.disable(a.STENCIL_TEST);a.GENERATE_MIPMAP_HINT&&a.hint(a.GENERATE_MIPMAP_HINT,a.FASTEST);
  a.disable(a.SAMPLE_ALPHA_TO_COVERAGE);a.disable(a.SAMPLE_COVERAGE);return!0},Ac:function(){if(!v.l())return!1;a.depthFunc(a.LEQUAL);a.clearDepth(1);return!0}};return q}(),Ia=function(){var b="undefined"===typeof v?JEShaders:v;return{Uc:function(c){b!==c&&(b.X(),b=c)},Ta:function(){return b.Ta()},na:function(){b.na()},Za:function(){b.Za()},X:function(){b.X()},set:function(c){b.set(c)}}}(),M=function(){var b,c,f=0,k=-2,n=-2,l=!1,u={reset:function(){n=k=-2},l:function(){l||(b=a.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,
  b),a.bufferData(a.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),a.STATIC_DRAW),c=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,c),a.bufferData(a.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2]),a.STATIC_DRAW),u.fa(),l=!0)},a:function(q){var m=f++,t=q.T?q.T.length:0,w="undefined"===typeof q.mode?a.STATIC_DRAW:q.mode,x=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,x);a.bufferData(a.ARRAY_BUFFER,q.Qb instanceof Float32Array?q.Qb:new Float32Array(q.Qb),w);k=m;if(q.T){var G=a.createBuffer();a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,
  G);if(65536>q.T.length){var L=Uint16Array;var K=a.UNSIGNED_SHORT;var P=2}else L=Uint32Array,K=a.UNSIGNED_INT,P=4;a.bufferData(a.ELEMENT_ARRAY_BUFFER,q.T instanceof L?q.T:new L(q.T),w);n=m}var N={bc:function(Q){k!==m&&(a.bindBuffer(a.ARRAY_BUFFER,x),k=m);Q&&Ia.Za()},$b:function(){n!==m&&(a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,G),n=m)},bind:function(Q){N.bc(Q);N.$b()},od:function(){a.drawElements(a.TRIANGLES,t,K,0)},pd:function(Q,g){a.drawElements(a.TRIANGLES,Q,K,g*P)},remove:function(){a.deleteBuffer(x);
  q.T&&a.deleteBuffer(G);N=null}};return N},fa:function(){-1!==k&&(a.bindBuffer(a.ARRAY_BUFFER,b),k=-1);-1!==n&&(a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,c),n=-1)},g:function(q,m){q&&M.fa();m&&Ia.na();a.drawElements(a.TRIANGLES,3,a.UNSIGNED_SHORT,0)},sc:function(){a.deleteBuffer(b);a.deleteBuffer(c)}};return u}(),J=function(){var b,c,f,k=!1,n={v:-2,qc:1};return{l:function(){if(!k){b=a.createFramebuffer();var l=Ka.o();c=l&&a.DRAW_FRAMEBUFFER?a.DRAW_FRAMEBUFFER:a.FRAMEBUFFER;f=l&&a.READ_FRAMEBUFFER?a.READ_FRAMEBUFFER:
  a.FRAMEBUFFER;k=!0}},zd:function(){return c},Pa:function(){return f},aa:function(){return a.FRAMEBUFFER},Cd:function(){return n},rd:function(){return b},a:function(l){void 0===l.tb&&(l.tb=!1);var u=l.oa?l.oa:!1,q=l.width,m=void 0!==l.height?l.height:l.width,t=b,w=!1,x=!1,G=0;u&&(q=q?q:u.w(),m=m?m:u.L());var L={Lb:function(){x||(t=a.createFramebuffer(),x=!0,G=n.qc++)},Tb:function(){L.Lb();L.j();w=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,w);a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_COMPONENT16,
  q,m);a.framebufferRenderbuffer(c,a.DEPTH_ATTACHMENT,a.RENDERBUFFER,w);a.clearDepth(1)},bind:function(K,P){G!==n.v&&(a.bindFramebuffer(c,t),n.v=G);u&&u.j();P&&a.viewport(0,0,q,m);K&&a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT)},gd:function(){G!==n.v&&(a.bindFramebuffer(c,t),n.v=G)},clear:function(){a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT)},kd:function(){a.clear(a.COLOR_BUFFER_BIT)},ld:function(){a.clear(a.DEPTH_BUFFER_BIT)},Wc:function(){a.viewport(0,0,q,m)},j:function(){G!==n.v&&(a.bindFramebuffer(c,
  t),n.v=G)},rtt:function(K){u=K;n.v!==G&&(a.bindFramebuffer(a.FRAMEBUFFER,t),n.v=G);K.j()},J:function(){a.bindFramebuffer(c,null);n.v=-1},resize:function(K,P){q=K;m=P;w&&(a.bindRenderbuffer(a.RENDERBUFFER,w),a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_COMPONENT16,q,m))},remove:function(){a.bindFramebuffer(c,t);a.framebufferTexture2D(c,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,null,0);w&&a.framebufferRenderbuffer(c,a.DEPTH_ATTACHMENT,a.RENDERBUFFER,null);a.bindFramebuffer(c,null);a.deleteFramebuffer(t);w&&
  a.deleteRenderbuffer(w);L=null}};l.tb&&L.Tb();return L},J:function(){a.bindFramebuffer(c,null);n.v=-1},bd:function(){a.bindFramebuffer(c,null);a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);a.viewport(0,0,Ka.w(),Ka.L());n.v=-1},reset:function(){n.v=-2},R:function(){0!==n.v&&(a.bindFramebuffer(c,b),n.v=0)},clear:function(){a.viewport(0,0,Ka.w(),Ka.L());a.clear(a.COLOR_BUFFER_BIT)}}}(),X=function(){function b(d){a.bindTexture(a.TEXTURE_2D,d)}function c(d){xa[0]=d;d=Ca[0];var H=d>>16&32768,O=d>>12&2047,
  T=d>>23&255;return 103>T?H:142<T?H|31744|((255==T?0:1)&&d&8388607):113>T?(O|=2048,H|(O>>114-T)+(O>>113-T&1)):H=(H|T-112<<10|O>>1)+(O&1)}function f(d){var H=new Uint16Array(d.length);d.forEach(function(O,T){H[T]=c(O)});return H}function k(){if(null!==pa.Qa)return pa.Qa;var d=l(f([1,1,1,1]));return null===d?!0:pa.Qa=d}function n(){if(null!==pa.Ra)return pa.Ra;var d=l(new Uint8Array([255,255,255,255]));return null===d?!0:pa.Ra=d}function l(d){if(!Ia.Ta()||!K)return null;d=ca.a({isFloat:!1,H:!0,array:d,
  width:1});J.J();a.viewport(0,0,1,1);a.clearColor(0,0,0,0);a.clear(a.COLOR_BUFFER_BIT);Ia.set("s0");d.fb(0);M.g(!1,!0);var H=new Uint8Array(4);a.readPixels(0,0,1,1,a.RGBA,a.UNSIGNED_BYTE,H);H=.9<H[0];d.remove();J.R();return H}var u=0,q,m=0,t,w=!1,x,G,L,K=!1,P=!1,N,Q,g,B=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],D=!1,ea=!1,xa=new Float32Array(1),Ca=new Int32Array(xa.buffer),pa={Qa:null,Ra:null},ca={l:function(){if(!K){G=[a.RGB,!1,a.RGB,a.RGBA];L=[a.RGB,!1,a.RGB,a.RGBA];q=[a.TEXTURE0,a.TEXTURE1,a.TEXTURE2,
  a.TEXTURE3,a.TEXTURE4,a.TEXTURE5,a.TEXTURE6,a.TEXTURE7];D="undefined"!==typeof JEContext;ea="undefined"!==typeof Ka;D&&JEContext.Od()&&q.push(a.TEXTURE8,a.TEXTURE9);t=[-1,-1,-1,-1,-1,-1,-1,-1];x=[a.UNSIGNED_BYTE,a.FLOAT,a.FLOAT];if(!w){for(var d=new Float32Array(16384),H=0;16384>H;++H)d[H]=2*Math.random()-1;w={random:ca.a({isFloat:!0,isPot:!0,array:d,width:64}),Pb:ca.a({isFloat:!1,isPot:!0,width:1,array:new Uint8Array([0,0,0,0])})}}K=!0}},zc:function(){ca.cd()},Fd:function(){return w.Pb},cd:function(){x[1]=
  Ka.va()},Qc:function(){L=G=[a.RGBA,a.RGBA,a.RGBA,a.RGBA]},Qd:function(d,H){v.set("s1");J.J();var O=d.w(),T=d.L();a.viewport(0,0,O,T);d.b(0);M.g(!1,!1);a.readPixels(0,0,O,T,a.RGBA,a.UNSIGNED_BYTE,H)},rc:function(d,H,O){a.activeTexture(a.TEXTURE0);u=0;var T=a.createTexture();b(T);var aa=Ka.o()&&a.RGBA32F?a.RGBA32F:a.FLOAT;H=H instanceof Float32Array?H:new Float32Array(H);var Y=Math.log(H.length)/Math.log(2);Y!==Math.floor(Y)&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,
  a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE));a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST);a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,O);a.texImage2D(a.TEXTURE_2D,0,a.RGBA,d.w(),d.L(),0,a.RGBA,aa,H);b(null);a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1);J.R();v.set("s0");d.A();a.clearColor(0,0,0,0);a.clear(a.COLOR_BUFFER_BIT);b(T);M.g(!0,!1);a.deleteTexture(T)},a:function(d){function H(){b(Z);qa&&a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,qa);d.isPot?(a.texParameteri(a.TEXTURE_2D,
  a.TEXTURE_WRAP_S,d.xb?a.MIRRORED_REPEAT:a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,d.U?a.MIRRORED_REPEAT:a.REPEAT)):(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE));d.xa&&"undefined"!==typeof JESETTINGS&&a.texParameterf(a.TEXTURE_2D,JEContext.yd().TEXTURE_MAX_ANISOTROPY_EXT,JESETTINGS.ed);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,d.isLinear?a.LINEAR:a.NEAREST);d.isLinear?a.texParameteri(a.TEXTURE_2D,
  a.TEXTURE_MIN_FILTER,d.isMipmap&&!ta?a.NEAREST_MIPMAP_LINEAR:a.LINEAR):a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,d.isMipmap&&!ta?a.NEAREST_MIPMAP_NEAREST:a.NEAREST);fa=G[d.la-1];ba=L[d.la-1];ha=x[O];if(Ka.o()){var h=a.RGBA32F;fa===a.RGBA&&ha===a.FLOAT&&h&&(ba=h);fa===a.RGB&&ha===a.FLOAT&&h&&(ba=h,fa=a.RGBA)}if(d.H&&!d.isFloat||d.isFloat&&d.isMipmap&&Ja.Cc())(h=a.RGBA16F)&&(ba=h),ha=Ka.va();d.Ab&&"undefined"!==typeof a.texStorage2D&&(ma=d.Ab);d.yb&&4===d.la&&(fa=JEContext.Dd());if(d.D)a.texImage2D(a.TEXTURE_2D,
  0,ba,fa,ha,d.D);else if(d.url)a.texImage2D(a.TEXTURE_2D,0,ba,fa,ha,I);else if(V){try{a.texImage2D(a.TEXTURE_2D,0,ba,E,z,0,fa,ha,V),a.getError()!==a.NO_ERROR&&(a.texImage2D(a.TEXTURE_2D,0,ba,E,z,0,fa,ha,null),a.getError()!==a.NO_ERROR&&a.texImage2D(a.TEXTURE_2D,0,a.RGBA,E,z,0,a.RGBA,a.UNSIGNED_BYTE,null))}catch(r){a.texImage2D(a.TEXTURE_2D,0,ba,E,z,0,fa,ha,null)}d.isKeepArray||(V=null)}else a.texImage2D(a.TEXTURE_2D,0,ba,E,z,0,fa,ha,null);if(d.isMipmap)if(!ta&&W)W.Oa(),Aa=!0;else if(ta){h=Math.log(Math.min(E,
  z))/Math.log(2);var C;wa=Array(1+h);wa[0]=Z;for(C=1;C<=h;++C){var na=Math.pow(2,C);var ua=E/na;na=z/na;var e=a.createTexture();b(e);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST);a.texImage2D(a.TEXTURE_2D,0,ba,ua,na,0,fa,ha,null);b(null);wa[C]=e}Aa=!0}b(null);t[u]=-1;qa&&a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1);y=!0;da&&W&&(da(W),da=!1)}"undefined"===typeof d.isFloat&&(d.isFloat=!1);"undefined"===typeof d.H&&(d.H=!1);"undefined"===
  typeof d.isPot&&(d.isPot=!0);"undefined"===typeof d.isLinear&&(d.isLinear=!1);"undefined"===typeof d.isMipmap&&(d.isMipmap=!1);"undefined"===typeof d.Ga&&(d.Ga=!1);void 0===d.xa&&(d.xa=!1);void 0===d.U&&(d.U=!1);void 0===d.xb&&(d.xb=!1);void 0===d.yb&&(d.yb=!1);void 0===d.la&&(d.la=4);void 0===d.vb&&(d.vb=!1);"undefined"===typeof d.isFlipY&&(d.isFlipY=d.url||d.array?!0:!1);"undefined"===typeof d.isKeepArray&&(d.isKeepArray=!1);d.data&&(d.array="string"===typeof d.data?Ha(d.data):d.isFloat?new Float32Array(d.data):
  new Uint8Array(d.data),d.isFlipY=!1);var O=0,T=d.D?!0:!1,aa=null,Y=null,la=!1,va=null;d.isFloat&&(d.H=!0);d.H&&(O=1);d.vb||Ka.o()||!d.isFloat||!ea||Ka.hb()||(d.isFloat=!1);d.isFloat&&(O=2);d.xa&&D&&!JEContext.Jd()&&(d.xa=!1);var Z=a.createTexture(),da=d.Ga,I=null,V=!1,E=0,z=0,y=!1,F=m++,oa=!1,S,ka,Da,sa,ba,fa,ha,qa=d.isFlipY,ta=d.H&&d.isMipmap&&"undefined"!==typeof Ja&&!Ja.ec()?!0:!1,wa,ma=-1,Aa=!1;"undefined"!==typeof d.width&&d.width&&(E=d.width,z="undefined"!==typeof d.height&&d.height?d.height:
  E);var W={get:function(){return Z},w:function(){return E},L:function(){return z},Gd:function(){return d.url},Kd:function(){return d.isFloat},Md:function(){return d.H},Nd:function(){return d.isLinear},Oa:function(){a.generateMipmap(a.TEXTURE_2D)},gb:function(h,C){ta?(h||(h=W.pb()),W.Ea(C),b(wa[h]),t[C]=-1):W.b(C)},pb:function(){-1===ma&&(ma=Math.log(E)/Math.log(2));return ma},nb:function(h){if(ta){h||(h=W.pb());v.set("s11");W.Ea(0);var C,na=E,ua=z;for(C=1;C<=h;++C)na/=2,ua/=2,v.P("u7",.25/na,.25/ua),
  a.viewport(0,0,na,ua),b(wa[C-1]),a.framebufferTexture2D(J.aa(),a.COLOR_ATTACHMENT0,a.TEXTURE_2D,wa[C],0),M.g(!1,1===C);t[0]=-1}else W.Oa()},Ea:function(h){h!==u&&(a.activeTexture(q[h]),u=h)},b:function(h){if(!y)return!1;W.Ea(h);if(t[h]===F)return!1;b(Z);t[h]=F;return!0},fb:function(h){a.activeTexture(q[h]);u=h;b(Z);t[h]=F},j:function(){a.framebufferTexture2D(J.aa(),a.COLOR_ATTACHMENT0,a.TEXTURE_2D,Z,0)},A:function(){a.viewport(0,0,E,z);a.framebufferTexture2D(J.aa(),a.COLOR_ATTACHMENT0,a.TEXTURE_2D,
  Z,0)},ae:function(){a.framebufferTexture2D(J.aa(),a.COLOR_ATTACHMENT0,a.TEXTURE_2D,null,0)},resize:function(h,C){E=h;z=C;H()},clone:function(h){h=ca.a({width:E,height:z,H:d.H,isFloat:d.isFloat,isLinear:d.isLinear,U:d.U,isFlipY:h?!qa:qa,isPot:d.isPot});Ia.set("s0");J.R();h.j();a.viewport(0,0,E,z);W.b(0);M.g(!0,!0);return h},Wc:function(){a.viewport(0,0,E,z)},remove:function(){a.deleteTexture(Z);W=null},refresh:function(){W.fb(0);qa&&a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!0);T?a.texImage2D(a.TEXTURE_2D,
  0,ba,fa,a.UNSIGNED_BYTE,d.D):a.texImage2D(a.TEXTURE_2D,0,ba,E,z,0,fa,ha,V);qa&&a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1)},ib:function(){var h=E*z*4;ka=[new Uint8Array(h),new Uint8Array(h),new Uint8Array(h),new Uint8Array(h)];S=[new Float32Array(ka[0].buffer),new Float32Array(ka[1].buffer),new Float32Array(ka[2].buffer),new Float32Array(ka[3].buffer)];Da=new Uint8Array(4*h);sa=new Float32Array(Da.buffer);oa=!0},Kb:function(){oa||W.ib();a.readPixels(0,0,E,4*z,a.RGBA,a.UNSIGNED_BYTE,Da);var h,C=E*z,na=
  2*C,ua=3*C;for(h=0;h<C;++h)S[0][h]=sa[h],S[1][h]=sa[h+C],S[2][h]=sa[h+na],S[3][h]=sa[h+ua];return S},jb:function(){J.J();v.set("s12");W.b(0);for(var h=0;4>h;++h)a.viewport(0,z*h,E,z),v.Nb("u8",B[h]),M.g(!1,0===h)},be:function(h){var C=ha===x[0]&&!n();b(Z);qa&&a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,qa);C?(la||(aa=document.createElement("canvas"),aa.width=E,aa.height=z,Y=aa.getContext("2d"),va=Y.createImageData(E,z),la=!0),va.data.set(h),Y.putImageData(va,0,0),a.texImage2D(a.TEXTURE_2D,0,ba,fa,ha,aa)):
  a.texImage2D(a.TEXTURE_2D,0,ba,E,z,0,fa,ha,h);t[u]=F;qa&&a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1)},ce:function(h,C){b(Z);a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,C);a.texImage2D(a.TEXTURE_2D,0,ba,fa,ha,h);t[u]=F;C&&a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1)},Sd:function(h,C){var na=E*z,ua=4*na;h=d.H?h?"RGBE":"JSON":"RGBA";C&&(h=C);C=Ka.o()&&!1;switch(h){case "RGBE":var e="s39";break;case "JSON":e=C?"s0":"s12";break;case "RGBA":case "RGBAARRAY":e="s6"}oa||("RGBA"===h||"RGBE"===h||"RGBAARRAY"===h?(ka=new Uint8Array(ua),
  oa=!0):"JSON"!==h||C||W.ib());J.J();v.set(e);W.b(0);if("RGBA"===h||"RGBE"===h||"RGBAARRAY"===h){a.viewport(0,0,E,z);M.g(!0,!0);a.readPixels(0,0,E,z,a.RGBA,a.UNSIGNED_BYTE,ka);if("RGBAARRAY"===h)return{data:ka};P||(N=document.createElement("canvas"),Q=N.getContext("2d"),P=!0);N.width=E;N.height=z;g=Q.createImageData(E,z);g.data.set(ka);Q.putImageData(g,0,0);var r=N.toDataURL("image/png")}else if("JSON"===h)if(C)r=new Float32Array(na),a.viewport(0,0,E,z),M.g(!0,!0),a.readPixels(0,0,E,z,a.RGBA,a.FLOAT,
  r);else{for(r=0;4>r;++r)a.viewport(0,z*r,E,z),v.Nb("u8",B[r]),M.g(!r,!r);W.Kb();r=Array(na);for(e=0;e<na;++e)r[4*e]=S[0][e],r[4*e+1]=S[1][e],r[4*e+2]=S[2][e],r[4*e+3]=S[3][e]}return{format:h,data:r,width:E,height:z,isMirrorY:d.U,isFlipY:"RGBA"===h?d.isFlipY:!d.isFlipY}}};d.isMipmap&&!ta&&y&&!Aa&&(W.Oa(),Aa=!0);if(d.url)b(Z),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,1,1,0,a.RGBA,a.UNSIGNED_BYTE,null),I=new Image,I.nd="Anonymous",I.crossOrigin="Anonymous",I.src=d.url,I.onload=function(){E=I.width;z=I.height;
  H()};else if(d.D){var ya=function(){E=void 0!==d.D.videoWidth?d.D.videoWidth:d.D.width;z=void 0!==d.D.videoHeight?d.D.videoHeight:d.D.height;E?H():setTimeout(ya,1)};ya()}else d.array?(d.H&&!d.isFloat?d.array instanceof Uint16Array?(V=d.array,H()):k()?(V=f(d.array),H()):(H(),ca.rc(W,d.array,qa)):(V=d.isFloat?d.array instanceof Float32Array?d.array:new Float32Array(d.array):d.array instanceof Uint8Array?d.array:new Uint8Array(d.array),H()),d.isKeepArray||(V&&V!==d.array&&(V=null),delete d.array)):H();
  W.wc=W.w;da&&y&&(da(W),da=!1);return W},J:function(d){d!==u&&(a.activeTexture(q[d]),u=d);t[d]=-1;b(null)},hd:function(d){w.random.b(d)},reset:function(){for(var d=0;d<q.length;++d)t[d]=-1;u=-1},Rd:function(){u=-1},Zd:function(){for(var d=0;d<q.length;++d)ca.J(d)},sc:function(){w&&(w.random.remove(),w.Pb.remove())},$d:function(d,H){if("RGBA"===d.format||"RGBE"===d.format){var O=new Image;O.src=d.data;O.onload=function(){ca.a({U:d.isMirrorY,isFlipY:d.isFlipY,isFloat:!1,D:O,Ga:function(T){if("RGBA"===
  d.format)H(T);else{var aa=d.width,Y=d.height,la=ca.a({U:d.isMirrorY,isFloat:!0,width:aa,height:Y,isFlipY:d.isFlipY});J.R();a.viewport(0,0,aa,Y);v.set("s40");la.j();T.b(0);M.g(!0,!0);ca.J(0);H(la);a.flush();setTimeout(T.remove,50)}}})}}else"JSON"===d.format?H(ca.a({isFloat:!0,isFlipY:d.isFlipY,width:d.width,height:d.height,array:new Float32Array(d.data)})):H(!1)}};return ca}(),Ma={a:function(b){var c=[X.a(b),X.a(b)],f=[c[1],c[0]],k=f,n={Tc:function(l){k[1].j();k[0].b(l);n.Ob()},Td:function(l){k[1].A();
  k[0].b(l);n.Ob()},Ob:function(){k=k===c?f:c},refresh:function(){k[0].refresh();k[1].refresh()},b:function(l){k[0].b(l)},Ad:function(){return k[0]}};return n}},Ka=function(){function b(){c="undefined"===typeof La?JEContext:La;f=!0}var c,f=!1,k=!1,n=!1,l=!1,u=!1,q=!1,m=!1,t=!1,w=!1,x=!1,G=!1,L=!0,K=!0,P=!0,N=!1,Q="undefined"===typeof window?{}:window,g={l:function(){if(f)return!0;b();g.lb();g.Na();g.mc();g.nc();J.l();X.l();if(!g.ic())return!1;M.l();X.zc();return!0},w:function(){f||b();return c.w()},
  L:function(){f||b();return c.L()},o:function(){f||b();return c.o()},mc:function(){G=(x=a.getExtension("EXT_color_buffer_float")||a.getExtension("WEBGL_color_buffer_float")||a.getExtension("OES_color_buffer_float"))?!0:!1;Q.GL_EXT_COLORBUFFERFLOAT=x},nc:function(){a.getExtension("EXT_color_buffer_half_float")||a.getExtension("WEBGL_color_buffer_half_float")||a.getExtension("OES_color_buffer_half_float")},lb:function(){if(!k){this.o()||(n=a.getExtension("OES_texture_float")||a.getExtension("MOZ_OES_texture_float")||
  a.getExtension("WEBKIT_OES_texture_float"),u=(Q.GL_EXT_FLOAT=n)?!0:!1);if(u||this.o())l=a.getExtension("OES_texture_float_linear")||a.getExtension("MOZ_OES_texture_float_linear")||a.getExtension("WEBKIT_OES_texture_float_linear"),Q.GL_EXT_FLOATLINEAR=l;k=!0}},Na:function(){if(!w){if(!this.o()){if(q=a.getExtension("OES_texture_half_float")||a.getExtension("MOZ_OES_texture_half_float")||a.getExtension("WEBKIT_OES_texture_half_float"))N=q.HALF_FLOAT_OES,m=!0;!N&&a.HALF_FLOAT&&(N=a.HALF_FLOAT);!N&&a.FLOAT&&
  (N=a.FLOAT);Q.GL_EXT_HALFFLOAT=q}if(m||this.o())t=a.getExtension("OES_texture_half_float_linear")||a.getExtension("MOZ_OES_texture_half_float_linear")||a.getExtension("WEBKIT_OES_texture_half_float_linear"),Q.GL_EXT_HALFFLOATLINEAR=t;w=!0}},va:function(){if(g.o())return a.HALF_FLOAT;g.Na();return m?N:a.FLOAT},hb:function(){return L},dc:function(){return K},jd:function(){return P},cc:function(){return G},kc:function(){K=L=!0;var B=a.createFramebuffer();a.bindFramebuffer(a.FRAMEBUFFER,B);var D=a.createTexture();
  a.bindTexture(a.TEXTURE_2D,D);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST);a.texImage2D(a.TEXTURE_2D,0,g.o()&&a.RGBA32F?a.RGBA32F:a.RGBA,1,1,0,a.RGBA,a.FLOAT,null);a.framebufferTexture2D(J.aa(),a.COLOR_ATTACHMENT0,a.TEXTURE_2D,D,0);var ea=a.checkFramebufferStatus(J.Pa());ea!==a.FRAMEBUFFER_COMPLETE&&(L=!1);a.texImage2D(a.TEXTURE_2D,0,g.o()&&a.RGBA16F?a.RGBA16F:a.RGBA,1,1,0,a.RGBA,g.va(),null);a.framebufferTexture2D(J.aa(),
  a.COLOR_ATTACHMENT0,a.TEXTURE_2D,D,0);ea=a.checkFramebufferStatus(J.Pa());ea!==a.FRAMEBUFFER_COMPLETE&&(K=!1);a.bindTexture(a.TEXTURE_2D,null);a.bindFramebuffer(a.FRAMEBUFFER,null);a.deleteTexture(D);a.deleteFramebuffer(B)},jc:function(){var B=J.a({width:1});B.Lb();var D=X.a({width:1,isFloat:!0,la:3});B.j();D.j();a.flush();a.checkFramebufferStatus(J.Pa())!==a.FRAMEBUFFER_COMPLETE?(X.Qc(),P=!1):P=!0;B.remove();D.remove()},ic:function(){g.kc();if(!L&&!K)return!1;g.jc();return!0}};return g}(),Ja=function(){var b=
  !1,c=[.8,1,.8,1],f=0,k,n=new Uint8Array(4),l=c.concat(c,c,c),u=!0,q={l:function(){function m(K,P,N,Q){a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,Q?a.NEAREST_MIPMAP_NEAREST:a.LINEAR);try{var g=a.getError();g!==a.NO_ERROR&&console.log("GLERR in test_mipmapping() :",g);a.texImage2D(a.TEXTURE_2D,0,K,2,2,0,a.RGBA,P,N);g=a.getError();if(g!==a.NO_ERROR)return!1}catch(B){return!1}Q&&a.generateMipmap(a.TEXTURE_2D);M.fa();M.g(!1,!0);a.readPixels(0,0,1,1,a.RGBA,a.UNSIGNED_BYTE,n);g=a.getError();g===a.INVALID_OPERATION&&
  "undefined"!==typeof a.PIXEL_PACK_BUFFER&&(a.bindBuffer(a.PIXEL_PACK_BUFFER,null),a.readPixels(0,0,1,1,a.RGBA,a.UNSIGNED_BYTE,n),g=a.getError());return g!==a.NO_ERROR?!1:0!==n[0]}function t(K){return Ka.hb()&&m(x,a.FLOAT,new Float32Array(l),K)?(f=3,!0):!1}function w(K){return Ka.dc()?m(G,Ka.va(),new Uint16Array(l),K)||m(G,a.FLOAT,new Float32Array(l),K)?(f=2,!0):!1:!1}Ka.lb();Ka.Na();var x=a.RGBA,G=a.RGBA;if(La.o()){var L=a.RGBA32F;L&&(x=L);(L=a.RGBA16F)&&(G=L)}M.l();J.reset();J.J();a.viewport(0,0,
  1,1);v.set("s0");b=!0;k=a.createTexture();a.activeTexture(a.TEXTURE0);a.bindTexture(a.TEXTURE_2D,k);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.REPEAT);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.REPEAT);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST);if(w(!0)||t(!0))return!0;u=!1;if(w(!1)||t(!1))return!0;if(La.o()){G=x=a.RGBA;if(w(!0)||t(!0))return!0;u=!1;if(w(!1)||t(!1))return!0}return!1},ec:function(){return u},Bd:function(){return f},Ld:function(){b||q.l();return 3===f},Cc:function(){b||
  q.l();return 2===f}};return q}(),Na={a:function(b){var c=X.a(b.alpha),f=X.a(b.beta);return{lc:function(){c.b(1);f.b(2)}}}},Qa={a:function(b){var c=b.Yc;c.index=b.index;c.V=b.V;c.parent=b.parent;switch(c.type){case "input":b=Oa.a(c);break;default:b=Pa.a(c)}return b}},Oa={a:function(b){"undefined"===typeof b.sift&&(b.sift=!1);"undefined"===typeof b.DWT&&(b.DWT=!1);"undefined"===typeof b.blur&&(b.blur=!1);"undefined"===typeof b.siftOutWidth&&(b.siftOutWidth=!1);"undefined"===typeof b.density&&(b.density=
  1);var c=!1;if(b.mask){c=!0;SETTINGS&&void 0!==SETTINGS.Zb&&(b.mask=SETTINGS.Zb+b.mask);var f=X.a({isFloat:!1,url:b.mask})}var k=!1,n="undefined"!==typeof b.preprocessing?b.preprocessing:!1,l=!1;b.sift?Sift.l({yc:a,ha:!1,width:b.size,Pd:b.siftOutWidth}):b.DWT&&DWT.l({yc:a,ha:!1,width:b.size});var u=!1;b.customInputShader&&(u="s41",v.cb({name:"_",id:u,c:b.customInputShader,f:["uSource"],precision:"lowp"}),v.I(u,[{type:"1i",name:"_",value:0}]));switch(n){case "sobel":var q="s30";l=!0;break;case "meanNormalization":q=
  "s31";l=!0;break;case "grayScale":q="s29";l=!1;break;case "copy":q="s0";break;case "inputLightRegulation":q=u?u:"s29";Ra.l({width:b.size,Cb:b.nBlurPass,Bc:!1});k=!0;break;case "direct":case "none":q=!1;break;default:q="s3"}c&&(q+="Mask");if(b.blur)var m=X.a({isFloat:!1,isPot:!1,width:b.size});var t=X.a({isFloat:!1,isPot:!1,width:b.size}),w={w:function(){return b.sift?Sift.ka():b.size},ka:function(){return w.w()},vc:function(){return b.sift?Sift.wa():b.DWT?DWT.wa():k?Ra.wa():t},F:function(){J.R();
  b.blur&&(m.A(),v.set("s42"),v.P("u7",1/b.size,1/b.size),M.g(!1,!0),m.b(0));q&&(v.set(q),l&&v.u("u28",1/b.size),t.A(),c&&f.b(1),M.g(!1,!1),t.b(0),k?Ra.Wa(t):b.sift?(v.X(),Sift.Wa()):b.DWT&&(v.X(),DWT.Wa(4)))}};return w}},Pa={a:function(b){"undefined"===typeof b.disableNormalize&&(b.disableNormalize=!1);var c=[],f=[],k,n,l=!1,u,q=!0,m,t,w=b.isReorganize?b.isReorganize:!1,x=b.kernelsNumber?!0:!1,G=b.dynPelu?Na.a(b.dynPelu):!1,L=G?!0:!1,K={isEnabled:!1},P;if("softmax"===b.type){b.activation="softmax";
  b.size=Math.pow(2,Math.ceil(Math.log(Math.sqrt(b.num_classes))/Math.log(2)));b.sparsity="undefined"!==typeof b.sparsity?b.sparsity:b.V.ka();b.gain="undefined"!==typeof b.gain?b.gain:1;v.I("s20",[{type:"1f",name:"u10",value:b.gain}]);var N=X.a({isFloat:!0,isPot:!1,width:b.size}),Q=X.a({isFloat:!0,isPot:!1,width:b.size,isMipmap:!0});q=!1;var g=new Uint8Array(Math.pow(4*b.size,2)),B;for(B=0;B<b.size*b.size;++B){var D=B<b.num_classes?255:0;g[4*B]=D;g[4*B+1]=D;g[4*B+2]=D;g[4*B+3]=D}var ea=X.a({isFloat:!1,
  isPot:!1,width:b.size,array:g})}else b.cost?(b.sparsity="undefined"!==typeof b.sparsity?b.sparsity:b.V.ka(),q=!1):"full"===b.connectivityUp&&(b.sparsity=b.V.ka());var xa={elu:"s15",elu01:"s16",relu:"s14",arctan:"s18",sigmoid:"s13",copy:"s0",softplus:"s19",softmax:"s20",dynPelu:"s17"}[b.activation],Ca=b.sparsity*b.sparsity,pa=!1,ca=b.size;if(b.maxPooling){switch(b.maxPooling.size){case 2:var d="s32";break;case 4:d="s33"}pa=!0;ca/=b.maxPooling.size;var H=X.a({isFloat:!0,isPot:!1,width:ca})}var O=void 0!==
  b.Ic&&b.Ic?!0:!1,T=null,aa=null,Y=null;O&&(T="s43"+b.index.toString(),v.sb("s43",T,[((b.normalization.n-1)/2).toFixed(1)]),v.I(T,[{type:"1i",name:"u1",value:0},{type:"2f",name:"u7",value:[1/b.size,1/b.size]},{type:"1f",name:"u6",value:b.normalization.alpha},{type:"1f",name:"u9",value:b.normalization.beta},{type:"1f",name:"u32",value:b.normalization.k}]),aa=X.a({isFloat:!0,isPot:!0,width:b.size}),Y=X.a({isFloat:!0,isPot:!0,width:b.size}));var la,va,Z,da;q&&(da=X.a({isFloat:!0,isPot:!1,width:b.size}));
  var I=X.a(b.bias),V,E={w:function(){return b.size},ka:function(){return ca},qb:function(){return b.num_classes},ac:function(z){P.b(z)},Lc:function(){b.remap&&b.remap.isEnabled&&(K={isEnabled:!0,Ec:X.a({isFloat:!1,isFlipY:!1,array:new Uint8Array(b.remap.maskTexture.data),width:b.remap.maskTexture.width,isPot:!1}),layers:b.remap.layers.map(function(z){return b.parent.uc(z)}),depth:b.remap.depth})},Sc:function(){switch(b.connectivityUp){case "gaussian":V=Sa.a(b.connectivity);break;case "direct":V=Ta.a(b.connectivity);
  break;case "square":V=Ua.a(b.connectivity);break;case "squareFast":V=Va.a(b.connectivity,b.activation);break;case "full":V=Wa.a(b.connectivity);break;case "conv":t=b.kernelsNumber,V=Xa.a(b.connectivity),w&&(m=X.a({width:ca,isFloat:!0,isFlipY:!1,isPot:!1}))}if(V.W){var z=b.size*b.sparsity;va=Math.log(z/b.size)/Math.log(2);la=X.a({isMipmap:!0,isFloat:!0,isPot:!0,width:z,Ab:va});Z=X.a({isFloat:!0,isPot:!0,width:b.size})}},F:function(z,y){P=z;V.W?(la.A(),x&&I.b(2),V.F(K),la.b(0),la.nb(va),Z.A(),x?v.set("s0"):
  (v.set("s28"),v.u("u27",Ca),I.b(1)),la.gb(va,0),M.g(!1,!1),v.set(xa),O?aa.j():da.j(),Z.b(0),L&&G.lc(),M.g(!1,!1)):(da.A(),I.b(1),V.F());O&&(v.set(T),Y.j(),aa.b(0),M.g(!1,!1),v.set("s44"),v.u("u6",1),da.j(),Y.b(1),M.g(!1,!1));if(q)return pa?(H.A(),da.b(0),v.set(d),v.P("u7",1/b.size,1/b.size),M.g(!1,!1),y=H):y=da,y.b(0),w&&(m.j(),v.set("s22"),v.P("u14",t,ca/t),M.g(!1,!1),y=m,m.b(0)),y;if("softmax"===b.type){v.set("s20");da.b(0);N.j();M.g(!1,!1);b.disableNormalize?z=N:(v.set("s2"),N.b(0),ea.b(1),Q.j(),
  M.g(!1,!1),v.set("s0"),n.A(),Q.b(0),Q.nb(!1),M.g(!1,!1),v.set("s21"),k.A(),Q.gb(!1,0),v.u("u12",da.wc()),n.b(1),M.g(!1,!1),z=k);if(y){switch(l){case "cpuRGBAAvg":break;default:var F=E.Jb(z)}return F}return!1}if(b.cost){v.set("gpuRawAvg"===l?"s8":"s7");y=da;b.disableNormalize||(v.u("u4",1/b.size),k.A(),da.b(0),M.g(!1,!1),y=k);switch(l){case "cpuRGBA2Float":y.jb();F=E.Jb(y);u(F);break;case "gpuRawAvg":case "gpuRaw":y.b(0),u(y)}return!1}},gc:function(z){z&&"undefined"!==typeof z.Hb&&(l=z.Hb,u=z.Kc);
  da=X.a({isFloat:!0,isPot:!0,isMipmap:"softmax"===b.type,width:b.size});"softmax"===b.type&&(n=X.a({isFloat:!0,isPot:!0,width:1}));var y=0,F=0,oa="undefined"!==typeof b.num_classes&&b.num_classes?b.num_classes:b.size*b.size;for(z=0;z<oa;++z)c.push(y+(b.size-1-F)*b.size),f.push([-1,-1,-1,-1]),++y,y===b.size&&(y=0,++F);b.disableNormalize||(k=X.a({isFloat:!0,isPot:!0,width:b.size}))},Jb:function(z){z.jb();var y=z.Kb();c.forEach(function(F,oa){f[oa][0]=y[0][F];f[oa][1]=y[1][F];f[oa][2]=y[2][F];f[oa][3]=
  y[3][F]});return f}};b.V&&E.Sc(b.V);return E}};function Ya(){var b={Id:!1},c,f,k;b||(b={});this.uc=function(n){return c[n]};this.Oc=function(n){var l=!1;c=n.map(function(u,q){return l=u=Qa.a({index:q,parent:this,Yc:u,V:l})});f=c[0];k=c[c.length-1];c.forEach(function(u,q){0!==q&&u.Lc()})};this.F=function(n,l){var u=l;c.forEach(function(q){u=q.F(u,n)});return u};this.ob=function(){return f.w()};this.wa=function(){return k.vc()};this.Rc=function(n){k.gc(n)};this.qb=function(){return k.qb()}}
  var Ta={a:function(b){var c=X.a(b.weights);delete b.weights.data;return{W:!0,ja:function(){return 1},xc:function(){return c},F:function(){v.set("s27");c.b(1);M.g(!1,!1)}}}},Wa={a:function(b){var c=b.fromLayerSize,f=X.a(b.weights);return{W:!0,ja:function(){return c},F:function(k){if(k.isEnabled){v.set("s25");k.Ec.b(3);var n,l=Math.min(k.layers.length,k.depth);for(n=0;n<l;++n)k.layers[n].ac(4+n)}else v.set("s24");v.u("u18",b.toLayerSize);f.b(1);M.g(!1,!1)}}}},Sa={a:function(b){var c=b.toSparsity*b.toLayerSize,
  f=c/b.fromLayerSize,k=X.a(b.weights);X.a({width:c,isFloat:!0,array:new Float32Array(b.fromBindings),isPot:!0});var n=X.a({width:c,isFloat:!0,array:new Float32Array(b.toBindings),isPot:!0});return{W:!0,ja:function(){return f},F:function(){v.set("s23");k.b(1);n.b(2);M.g(!1,!0)}}}},Ua={a:function(b){var c=b.fromLayerSize,f=b.toLayerSize,k=b.toSparsity,n=k*f,l=n/c,u=c/f,q,m,t,w,x=0,G=0,L=0,K=Array(k*f*k*f*4),P=Array(k*f*k*f*4),N=Array(c*c);for(q=0;q<N.length;++q)N[q]=0;var Q=Math.floor(k/2),g=.5/f,B=
  .5/c,D=.5/n;for(q=0;q<f;++q)for(m=0;m<f;++m){var ea=Math.round(q*u);var xa=Math.round(m*u);var Ca=q/f;var pa=m/f;Ca+=g;pa+=g;for(t=0;t<k;++t)for(w=0;w<k;++w){var ca=x/n;var d=G/n;var H=ea+t-Q;var O=xa+w-Q;0>H&&(H+=c);0>O&&(O+=c);H>=c&&(H-=c);O>=c&&(O-=c);var T=H/c;var aa=O/c;d=1-d-1/n;T+=B;aa+=B;ca+=D;d+=D;var Y=q*k+t,la=m*k+w;la=f*k-la-1;Y=la*f*k+Y;K[4*Y]=ca;K[4*Y+1]=d;K[4*Y+2]=T;K[4*Y+3]=aa;T=N[O*c+H]++;aa=T%l;H=H*l+aa;O=O*l+(T-aa)/l;O=c*l-1-O;O=O*c*l+H;P[4*O]=ca;P[4*O+1]=d;P[4*O+2]=Ca;P[4*O+3]=
  pa;++x>=n&&(x=0,++G);++L}}var va=X.a(b.weights);X.a({width:n,isFloat:!0,array:new Float32Array(P),isPot:!0});P=null;var Z=X.a({width:n,isFloat:!0,array:new Float32Array(K),isPot:!0});K=null;return{W:!0,ja:function(){return l},F:function(){v.set("s23");va.b(1);Z.b(2);M.g(!1,!1)}}}},Xa={a:function(b){var c=b.kernelsNumber,f=b.toSparsity,k=f*b.toLayerSize/b.fromLayerSize,n=X.a(b.weights);return{W:!0,ja:function(){return k},Ed:function(){return f},xc:function(){return n},F:function(){v.set("s26");v.u("u24",
  c);v.u("u25",f);v.u("u18",b.toLayerSize);v.u("u26",b.fromLayerSize);n.b(1);M.g(!1,!1)}}}},Va={a:function(b,c){var f=b.fromLayerSize,k=b.toLayerSize,n=b.toSparsity,l=b.stride?b.stride:1,u=n*k/f,q=k<f,m=f/k,t=X.a(b.weights),w="s45"+[f.toString(),k.toString(),n.toString(),l.toString(),c].join("_");v.oc(w)||(b=Ea(c),k=[{type:"1f",name:"u18",value:k},{type:"1f",name:"u31",value:l}],q&&k.push({type:"1f",name:"u26",value:f}),f=[(q?u:n).toFixed(1),b],q&&f.push(m.toFixed(1)),v.sb(q?"s38":"s37",w,f),v.I(w,
  k.concat([{type:"1i",name:"u16",value:0},{type:"1i",name:"u23",value:1},{type:"1i",name:"u15",value:3}])));return{W:!1,ja:function(){return u},F:function(){v.set(w);t.b(3);M.g(!1,!1)}}}},Ra=function(){var b,c,f,k,n,l,u,q,m;return{l:function(t){b=t.Cb?t.Cb:3;c=t.width?t.width:64;k=t.Bc?!0:!1;t={isFloat:!1,width:c,isPot:!1,isFlipY:!1};n=X.a(t);l=X.a(t);u=X.a(t);q=X.a(t);m=X.a({isFloat:!0,width:c,isPot:!1,isFlipY:!1});f=1/c},Wa:function(t){v.set("s35");for(var w=0;w<b;++w)n.j(),v.P("u7",f,0),M.g(k,!1),
  l.j(),n.b(0),v.P("u7",0,f),M.g(k,!1),l.b(0);v.set("s34");q.j();t.b(0);M.g(k);v.set("s35");for(w=0;w<b;++w)u.j(),q.b(0),v.P("u7",f,0),M.g(k,!1),q.j(),u.b(0),v.P("u7",0,f),M.g(k,!1);v.set("s36");m.j();t.b(0);l.b(1);q.b(2);M.g(k,!1);m.b(0)},wa:function(){return m}}}();function Za(b,c){b[c]=!0;b.setAttribute(c,"true")}function $a(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}
  function ab(){var b=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3]||0,10)]}function bb(){var b=navigator.userAgent.toLowerCase();return-1!==b.indexOf("safari")&&-1===b.indexOf("chrome")?!0:!1}function cb(){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?!0:!1}
  function db(b){if(!b)return b;var c=!1;if(b.video){var f=function(k){var n={};"undefined"!==typeof k.min&&(n.min=k.min);"undefined"!==typeof k.max&&(n.max=k.max);"undefined"!==typeof k.ideal&&(n.ideal=k.ideal);return n};c={};"undefined"!==typeof b.video.width&&(c.width=f(b.video.width));"undefined"!==typeof b.video.height&&(c.height=f(b.video.height));"undefined"!==typeof b.video.facingMode&&(c.facingMode=b.video.facingMode)}c={audio:b.audio,video:c};"undefined"!==typeof b.deviceId&&(c.deviceId=b.deviceId);
  return c}function eb(b){var c=b.video.width;b.video.width=b.video.height;b.video.height=c;return b}
  function fb(b){function c(x){return[480,576,640,648,720,768,800,960,1080,1152,1280,1366,1920].sort(function(G,L){return Math.abs(G-x)-Math.abs(L-x)})}function f(x){k.push(x(db(b)))}var k=[];if(!b||!b.video)return k;if(b.video.width&&b.video.height){if(b.video.width.ideal&&b.video.height.ideal)for(var n=c(b.video.width.ideal).slice(0,3),l=c(b.video.height.ideal).slice(0,3),u=0,q;u<n.length;++u){q=n[u];for(var m=0,t;m<l.length;++m)if(t=l[m],q!==b.video.width.ideal||t!==b.video.height.ideal){var w=Math.max(q,
  t)/Math.min(q,t);w<4/3-.1||w>16/9+.1||f(function(x){x.video.width.ideal=q;x.video.height.ideal=t;return x})}}f(function(x){return eb(x)})}b.video.width&&b.video.height&&(b.video.width.ideal&&b.video.height.ideal&&f(function(x){delete x.video.width.ideal;delete x.video.height.ideal;return x}),f(function(x){delete x.video.width;delete x.video.height;return x}));b.video.facingMode&&(f(function(x){delete x.video.facingMode;return x}),b.video.width&&b.video.height&&f(function(x){eb(x);delete x.video.facingMode;
  return x}));k.push({audio:b.audio,video:!0});return k}function gb(b){try{var c=window.matchMedia("(orientation: portrait)").matches?!0:!1}catch(k){c=window.innerHeight>window.innerWidth}if(c&&b&&b.video){c=b.video.width;var f=b.video.height;c&&f&&c.ideal&&f.ideal&&c.ideal>f.ideal&&(b.video.height=c,b.video.width=f)}}
  function hb(b){b.volume=0;Za(b,"muted");if(bb()){if(1===b.volume){var c=function(){b.volume=0;window.removeEventListener("mousemove",c,!1);window.removeEventListener("touchstart",c,!1)};window.addEventListener("mousemove",c,!1);window.addEventListener("touchstart",c,!1)}setTimeout(function(){b.volume=0;Za(b,"muted")},5)}}
  function ib(b,c,f,k){function n(u){l||(l=!0,f(u))}var l=!1;navigator.mediaDevices.getUserMedia(k).then(function(u){function q(){setTimeout(function(){if(b.currentTime){var m=b.videoWidth,t=b.videoHeight;if(0===m||0===t)n("VIDEO_NULLSIZE");else{m&&(b.style.width=m.toString()+"px");t&&(b.style.height=t.toString()+"px");m={fc:null,Xc:null,Fc:null};try{var w=u.getVideoTracks()[0];w&&(m.Fc=w,m.fc=w.getCapabilities(),m.Xc=w.getSettings())}catch(x){}bb()||$a()?b.parentNode&&null!==b.parentNode?(l||c(b,u,
  m),setTimeout(function(){b.play()},100)):(document.body.appendChild(b),hb(b),l||c(b,u,m),setTimeout(function(){b.style.transform="scale(0.0001,0.0001)";b.style.position="fixed";b.style.bottom="0px";b.style.right="0px";hb(b);setTimeout(function(){b.play()},100)},80)):l||c(b,u,m)}}else n("VIDEO_NOTSTARTED")},700)}"undefined"!==typeof b.srcObject?b.srcObject=u:(b.src=window.URL.createObjectURL(u),b.videoStream=u);hb(b);b.addEventListener("loadeddata",function(){var m=b.play();hb(b);"undefined"===typeof m?
  q():m.then(function(){q()}).catch(function(){n("VIDEO_PLAYPROMISEREJECTED")})},!1)}).catch(function(u){n(u)})}
  function jb(b,c,f){var k=cb()?document.createElement("video"):!1;if(k)if(cb()){if(f&&f.video){if($a()){var n=ab();(12>n[0]||12===n[0]&&2>n[1])&&gb(f)}f.video.width&&f.video.width.ideal&&(k.style.width=f.video.width.ideal+"px");f.video.height&&f.video.height.ideal&&(k.style.height=f.video.height.ideal+"px")}Za(k,"autoplay");Za(k,"playsinline");f&&f.audio?k.volume=0:Za(k,"muted");ib(k,b,function(){function l(q){if(0===q.length)c("INVALID_FALLBACKCONSTRAINS");else{var m=q.shift();ib(k,b,function(){l(q)},
  m)}}var u=fb(f);l(u)},f)}else c&&c("MEDIASTREAMAPI_NOTFOUND");else c&&c("VIDEO_NOTPROVIDED")}function kb(b){if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return b(!1,"NOTSUPPORTED"),!1;navigator.mediaDevices.enumerateDevices().then(function(c){(c=c.filter(function(f){return f.kind&&-1!==f.kind.toLowerCase().indexOf("video")&&f.label&&f.deviceId}))&&c.length&&0<c.length?b(c,!1):b(!1,"NODEVICESFOUND")}).catch(function(){b(!1,"PROMISEREJECTED")})}
  window.JEEFACEFILTERAPI=function(){var b,c,f,k,n,l,u,q,m,t,w,x,G,L;function K(e){if(z!==E.pause){var r=z===E.play?F.ra:I.Yb;Aa=setTimeout(g.bind(null,e),r)}}function P(){if(z===E.play)return!1;z=E.play;C.timestamp=Date.now();W&&window.cancelAnimationFrame(W);g(0)}function N(e,r,A,U,R){e=4*(3*r+e)+A;return U+(ta[e]/255+ta[e+12]/65025)*(R-U)}function Q(){J.R();M.reset();X.reset();v.X();v.kb();a.disable(a.DEPTH_TEST);a.disable(a.BLEND);M.fa();v.na()}function g(){if(z!==E.pause){v.kb();M.reset();M.fa();
  a.disable(a.DEPTH_TEST);J.R();v.na();if(!y.Sa){var e=y.element.currentTime-y.Ba;0>e&&(y.Ba=y.element.currentTime);1E3*e<I.dd||(y.oa.refresh(),y.Ba+=e,v.set("s48"),y.pa.A(),y.oa.b(0),M.g(!1,!1))}if(h.K.length>C.G)h.K.splice(0,h.K.length-C.G);else for(;h.K.length<C.G;)h.K.push(0);if(1!==h.i)if(ma.every(pa)){for(var r=0,A=e=0;A<ma.length;++A)ma[A].detected>r&&(r=ma[A].detected,e=0);for(r=0;r<C.G;++r)h.K[r]=e}else{r=0;e=!1;for(A=h.zb;r<C.G;++r){if(pa(ma[A]))if(e){do++A===h.i&&(A=0);while(pa(ma[A]))}else e=
  !0;h.K[r]=A++;A>=h.i&&(A=0)}h.zb=A}for(e=0;e<C.G;++e)h.S=h.K[e],h.Va=(.5+h.S)/h.i,h.wb=h.K.lastIndexOf(h.S)===e,v.set("s49"),F.$&&v.u("u37",ma[h.S].rz),1!==h.i&&v.u("u36",h.Va),ha.A(),y.pa.b(0),qa.b(1),M.g(!1,!1),ha.b(0),oa.F(!1,ha);e=Date.now();C.ia=e-C.timestamp;C.timestamp=e;-1!==S.nDetectsPerLoop?C.G=S.nDetectsPerLoop:(e=I.Fa,C.Eb=C.Db/C.ia,C.Fb=C.Eb*e+C.Fb*(1-e),C.Gb=1E3/C.ia,C.ba=C.Gb*I.Fa+C.ba*(1-I.Fa),C.ba>I.Z[1]?(e=I.qa[1],1<h.i&&(e+=1,r=ma.filter(ca).length,e*=Math.max(1,r)),C.G=Math.min(C.G+
  1,e),C.ba=(I.Z[0]+I.Z[1])/2):C.ba<I.Z[0]&&(C.G=Math.max(C.G-1,I.qa[0]),C.ba=(I.Z[0]+I.Z[1])/2));J.J();a.viewport(0,0,3,2*h.i);v.set("s47");qa.b(0);M.g(!1,!1);a.readPixels(0,0,3,2*h.i,a.RGBA,a.UNSIGNED_BYTE,ta);for(e=0;e<h.i;++e)if(-1!==h.K.indexOf(e)){var U=e;r=wa[U];var R=[U];A=ma[U];var ia=na[U],ra=2*U;r.ua=N(1,ra,3,0,1);A.detected=ja(A.detected,r.ua,I.Vb);if(r.ua<I.Ua)F.$&&(A.rz=0);else{r.x=N(0,ra,1,-1,1);r.y=N(0,ra,2,-1,1);r.M=N(0,ra,3,0,1);r.Xa=N(1,ra,0,-ya[0],ya[0]);r.Ya=N(1,ra,1,-ya[1],ya[1]);
  r.ma=N(1,ra,2,-ya[2],ya[2]);for(var Ga=0;Ga<I.Aa;++Ga)r.mb[Ga]=I.pc[Ga](N(2,ra,Ga,0,1));R.La=r.x-A.x;R.Ma=r.y-A.y;R.Ka=r.M-A.s;R.Ha=r.Xa-A.rx;R.Ia=r.Ya-A.ry;R.Ja=F.$?r.ma:r.ma-A.rz;ra=Math.sqrt(R.La*R.La+R.Ma*R.Ma+R.Ka*R.Ka)/C.ia;R=Math.sqrt(R.Ha*R.Ha+R.Ia*R.Ia+R.Ja*R.Ja)/C.ia;ra=1-Ba(ka.translationFactorRange[0],ka.translationFactorRange[1],ra);R=1-Ba(ka.rotationFactorRange[0],ka.rotationFactorRange[1],R);R=ra*R*Ba(ka.qualityFactorRange[0],ka.qualityFactorRange[1],r.ua);U=ia[++ua[U]%ia.length]=R;
  for(ra=0;ra<ia.length;++ra)U=Math.min(U,ia[ra]);U=Math.max(.5,U);R=Math.min(U,R);ia=ja(ka.alphaRange[1],ka.alphaRange[0],Math.pow(R,I.Xb));A.x=ja(A.x,r.x,ia);A.y=ja(A.y,r.y,ia);A.s=ja(A.s,r.M,ia);A.rx=ja(A.rx,r.Xa,ia);A.ry=ja(A.ry,r.Ya,ia);A.rz=F.$?A.rz+ia*r.ma:ja(A.rz,r.ma,ia);ia=Math.max(ia,I.Wb);for(U=0;U<I.Aa;++U)A.expressions[U]=ja(A.expressions[U],r.mb[U],ia);++r.za}}J.bd();J.reset();X.reset();a.enable(a.DEPTH_TEST);F.ta&&(1===h.i?F.ta(ma[0]):F.ta(ma));a.disable(a.BLEND);z===E.play&&(W=window.requestAnimationFrame(K))}}
  function B(){function e(A){for(var U=[],R=0;R<h.i;++R)U.push(Object.assign({},A));return U}y.pa=X.a({isPot:!1,isLinear:!0,isFloat:!1,width:sa,height:ba});ha=X.a({isPot:!0,isFloat:!1,width:oa.ob()});var r={width:3,height:h.i,isFloat:!0,isPot:!1,array:function(A){for(var U=new Float32Array(A.length*h.i),R=0,ia;R<h.i;++R)for(ia=0;ia<A.length;++ia)U[R*A.length+ia]=A[ia];return U}(new Float32Array([0,S.borderWidth,S.borderHeight,0,0,0,0,0,0,0,0,0]))};qa=Ma.a(r);ta=new Uint8Array(8*r.width*h.i);wa=e({ua:0,
  x:0,y:0,M:1,Xa:0,Ya:0,ma:0,mb:new Float32Array(I.Aa),za:0});ma=e({detected:0,x:0,y:0,s:1,rx:0,ry:0,rz:0,expressions:new Float32Array(I.Aa)});e({La:0,Ma:0,Ka:0,Ha:0,Ia:0,Ja:0})}function D(){v.I("s49",[{type:"1i",name:"u1",value:0},{type:"1i",name:"u34",value:1},{type:"2f",name:"u35",value:fa},{type:"1f",name:"u36",value:.5},{type:"1f",name:"u37",value:0}]);v.I("s50",[{type:"1i",name:"u38",value:0},{type:"1i",name:"u34",value:1},{type:"1f",name:"u41",value:I.ad},{type:"1f",name:"u42",value:I.Sb},{type:"1f",
  name:"u43",value:I.Rb},{type:"3f",name:"u40",value:[I.$a[0]*fa[0],I.$a[1]*fa[1],I.$a[2]]},{type:"1f",name:"u36",value:.5},{type:"1f",name:"u44",value:1},{type:"1f",name:"u37",value:0}]);var e=[{type:"1i",name:"u38",value:0}];v.I("s51",e);v.I("s52",e);v.I("s47",[{type:"1i",name:"u34",value:0},{type:"1f",name:"u47",value:fa[0]},{type:"2f",name:"u46",value:[0,.5/h.i]}])}function ea(){var e=oa.ob(),r=sa/e;l=S.minScale*r;u=S.maxScale*r;q=(1-2*S.borderWidth)/S.nStepsX;m=(1-2*S.borderHeight)/S.nStepsY;t=
  (u-l)/S.nStepsScale;w=S.borderWidth;x=S.borderHeight;G=1-S.borderWidth;L=1-S.borderHeight;fa=[e/sa,e/ba];b=S.borderWidth;c=S.borderHeight;f=l;k=S.borderWidth;n=S.borderHeight;Da=l}function xa(e){if(F.ca)load_NNC("string"===typeof F.ca?JSON.parse(F.ca):F.ca,e);else{var r=F.bb;"JSON"!==r.toUpperCase().split(".").pop()&&(r+=I.save);za(r,function(A){A=JSON.parse(A);A.exportData&&A.exportData.thetaXYZfactor&&(ya=A.exportData.thetaXYZfactor);e(A)})}}function Ca(){if(La.l({ha:F.N,width:sa,height:ba,debug:!1,
  Jc:function(){Z("GLCONTEXT_LOST")},antialias:!0,premultipliedAlpha:!0})){if(La.Ac())return!0;Z("GL_INCOMPATIBLE");return!1}Z("GL_INCOMPATIBLE");return!1}function pa(e){return e.detected<I.Ua}function ca(e){return e.detected>I.Ua}function d(e,r,A,U){return A>e?Math.max(0,e+r/2-(A-U/2)):Math.max(0,A+U/2-(e-r/2))}function H(){return wa.some(function(e,r){if(r===h.S)return!1;r=wa[h.S];if(r.za>e.za||3>e.za||d(r.x/2,r.M,e.x/2,e.M)<I.Bb*r.M)return!1;var A=sa/ba;return d(r.y/2,r.M*A,e.y/2,e.M*A)>I.Bb*r.M*
  A})}function O(){var e=h.S;qa.Tc(1);1!==h.i&&(a.viewport(0,0,3,h.i),v.set("s0"),v.Mb("u1",1),M.g(!1,!1),v.Mb("u1",0));a.viewport(0,e,1,1);v.set("s50");F.$&&v.u("u37",ma[e].rz);1!==h.i&&v.u("u36",h.Va);if(1<h.i){var r=H()?0:1;v.u("u44",r)}v.Vc("u39",k,n,Da);M.g(!1,!1);h.wb&&(a.viewport(1,e,1,1),v.set("s51"),M.g(!1,!1),a.viewport(2,e,1,1),v.set("s52"),M.g(!1,!1));f+=t;f>u&&(b+=q,f=l,b>G&&(b=w,c+=m,c>L&&(c=x)));k=b+.8*(Math.random()-.5)*q;n=c+.8*(Math.random()-.5)*m;Da=f+.8*(Math.random()-.5)*t}function T(){y.oa=
  X.a({D:y.element,isPot:!1,isFloat:!1,isFlipY:!0})}function aa(){v.I("s48",[{type:"1i",name:"u1",value:0},{type:"mat2",name:"u33",value:y.C}])}function Y(){y.B[0]=.5;y.B[1]=.5;var e=y.O[1]/y.O[0],r=La.L()/La.w();90===Math.abs(V.rotate)&&(e=1/e);e>r?y.B[1]*=r/e:y.B[0]*=e/r;v.I("s50",[{name:"u45",type:"1f",value:r}]);y.C[0]=0;y.C[1]=0;y.C[2]=0;y.C[3]=0;switch(V.rotate){case 0:y.C[0]=y.B[0];y.C[3]=y.B[1];break;case 180:y.C[0]=-y.B[0];y.C[3]=-y.B[1];break;case 90:y.C[1]=y.B[0];y.C[2]=-y.B[1];break;case -90:y.C[1]=
  -y.B[0],y.C[2]=y.B[1]}}function la(e,r){if(z===E.error)return!1;var A=e.videoHeight;y.O[0]=e.videoWidth;y.O[1]=A;y.element=e;r&&r();return!0}function va(e,r,A){e&&e();e={video:{facingMode:{ideal:V.facingMode},width:{min:V.minWidth,max:V.maxWidth,ideal:V.idealWidth},height:{min:V.minHeight,max:V.maxHeight,ideal:V.idealHeight}},audio:!1};V.deviceId&&(e.deviceId=V.deviceId);jb(function(U){r&&r(U);A(U)},function(){Z("WEBCAM_UNAVAILABLE")},e)}function Z(e){z!==E.error&&(z=E.error,F.ga_&&F.ga_(e))}function da(e,
  r){for(var A in e)"undefined"!==typeof r[A]&&(e[A]=r[A]);r===S&&S.nDetectsPerLoop&&(C.G=S.nDetectsPerLoop,C.Db=S.nDetectsPerLoop)}var I={save:"NNC.json",eb:0,Yb:25,Fa:.2,Z:[45,55],fd:1/3.5,qa:[2,6],Mc:{minScale:.15,maxScale:.6,borderWidth:.2,borderHeight:.2,nStepsX:6,nStepsY:5,nStepsScale:3,nDetectsPerLoop:-1},$a:[.092,.092,.3],ad:50,Bb:.12,Ua:.6,Gc:8,Sb:.75,Rb:1,Zc:{translationFactorRange:[.0015,.005],rotationFactorRange:[.003,.02],qualityFactorRange:[.9,.98],
  alphaRange:[.05,1]},$c:[.65,1,.262],Vb:.2,Xb:2,Wb:.1,Hc:8,Aa:1,pc:[Ba.bind(null,.3,.75)],dd:20},V={facingMode:"user",idealWidth:800,idealHeight:600,minWidth:480,maxWidth:1280,minHeight:480,maxHeight:1280,rotate:0},E={Dc:-1,error:-2,rb:0,play:1,pause:2},z=E.rb,y={Sa:!1,element:!1,oa:!1,pa:!1,O:[0,0],B:[.5,.5],C:[.5,0,0,.5],Ba:0},F={ga_:!1,ta:!1,bb:"./",ca:!1,N:!1,ra:I.eb,Ib:I.eb,ya:!1,$:!1},oa,S=Object.create(I.Mc),ka=Object.create(I.Zc);var Da=f=n=k=c=b=u=l=L=G=x=w=t=m=q=0;var sa,ba,fa,ha,qa,ta,wa,
  ma,Aa=!1,W=!1,ya=I.$c,h={i:1,S:0,K:[0],wb:!1,zb:0,Va:0},C={ia:0,timestamp:0,Eb:0,Fb:0,G:I.qa[0],Db:I.qa[0],Gb:0,ba:0,md:1},na=[],ua=[];return{init:function(e){function r(){z!==E.error&&2===++U&&(Y(),T(),aa(),F.ga_&&(F.ga_(!1,{GL:a,canvasElement:F.N,videoTexture:y.pa.get(),maxFacesDetected:h.i}),Q()),P())}if(z!==E.rb)return e.callbackReady&&e.callbackReady("ALREADY_INITIALIZED"),!1;z=E.Dc;e.callbackReady&&(F.ga_=e.callbackReady);e.callbackTrack&&(F.ta=e.callbackTrack);"undefined"!==typeof e.animateDelay&&
  (F.ra=e.animateDelay);"undefined"!==typeof e.NNCpath&&(F.bb=e.NNCpath);"undefined"!==typeof e.NNC&&(F.ca=e.NNC);"undefined"!==typeof e.maxFacesDetected&&(h.i=Math.max(1,e.maxFacesDetected));"undefined"!==typeof e.followZRot&&(F.$=e.followZRot?!0:!1);if(h.i>I.Gc)return Z("MAXFACES_TOOHIGH"),!1;if(!e.canvasId&&!e.canvas)return Z("NO_CANVASID"),!1;F.N=e.canvas?e.canvas:document.getElementById(e.canvasId);if(!F.N)return Z("INVALID_CANVASID"),!1;sa=F.N.width;ba=F.N.height;if(!sa||!ba)return Z("INVALID_CANVASDIMENSIONS"),
  !1;for(var A=0;A<h.i;++A)na.push(new Float32Array(I.Hc)),ua.push(0);e.scanSettings&&da(S,e.scanSettings);e.stabilizationSettings&&da(ka,e.stabilizationSettings);var U=0;e.videoSettings&&e.videoSettings.videoElement?la(e.videoSettings.videoElement,r):(e.videoSettings&&da(V,e.videoSettings),va(e.onWebcamAsk,e.onWebcamGet,function(R){la(R,r)}));xa(function(R){if(!Ca())return!1;oa=new Ya;oa.Oc(R.layers);oa.Rc({Hb:"gpuRawAvg",Kc:O});v.Ub([{id:"s48",name:"_",Y:"attribute vec2 a0;uniform mat2 u33;varying vec2 vv0;void main(){gl_Position=vec4(a0,0.,1.),vv0=vec2(.5,.5)+u33*a0;}",
  sa:["a0"],da:[2],c:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",f:["u1","u33"],precision:"lowp"},{id:"s49",name:"_",c:"uniform sampler2D u1;varying vec2 vv0;void main(){gl_FragColor=texture2D(u1,vv0);}",Y:"attribute vec2 a0;uniform sampler2D u34;uniform vec2 u35;uniform float u36,u37;varying vec2 vv0;void main(){vec4 a=texture2D(u34,vec2(.17,u36));vec2 d=a.gb,e=a.a*u35;float b=cos(u37),c=sin(u37);vec2 g=mat2(b,c,-c,b)*a0;vv0=d+g*.5*e,gl_Position=vec4(a0,0.,1.);}",
  sa:["a0"],da:[2],f:["u1","u34","u35","u36","u37"],precision:"lowp"},{id:"s50",name:"_",c:"uniform sampler2D u38,u34;uniform vec3 u39,u40;uniform float u41,u42,u43,u36,u44,u37,u45;const vec4 n=vec4(1.,1.,1.,1.),o=vec4(0.,0.,0.,0.),e=vec4(.25,.25,.25,.25);void main(){vec4 g=texture2D(u38,vec2(.625,.625)),h=texture2D(u38,vec2(.875,.625)),a=texture2D(u34,vec2(.17,u36));float b=dot(g,e),i=dot(h,e);bool j=b>u42&&b>i+u43;j?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 k=dot(e,texture2D(u38,vec2(.875,.875))),l=dot(e,texture2D(u38,vec2(.125,.625))),m=dot(e,texture2D(u38,vec2(.375,.625))),c=cos(u37),d=sin(u37);vec2 f=mat2(c,d*u45,-d/u45,c)*vec2(k,l);a.gba+=vec3(f,m)*u40*a.a;}gl_FragColor=a;}",
  Y:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",f:"u38 u34 u39 u41 u40 u44 u37 u45 u42 u43 u36".split(" ")},{id:"s51",name:"_",Y:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",c:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);const vec3 g=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 f=vec3(a,b,c)*.5+g;gl_FragColor=vec4(f,d);}",
  f:["u38"]},{id:"s52",name:"_",Y:"attribute vec2 a0;void main(){gl_Position=vec4(a0,0.,1.);}",c:"uniform sampler2D u38;const vec4 e=vec4(.25,.25,.25,.25);void main(){float a=dot(e,texture2D(u38,vec2(.25,.25)));gl_FragColor=vec4(a,0.,0.,0.);}",f:["u38"]},{id:"s47",name:"_",c:"uniform sampler2D u34;uniform vec2 u46;uniform float u47;varying vec2 vv0;void main(){float g=step(.5,mod(gl_FragCoord.y+1.5,2.)),c=step(.33,vv0.x);vec4 a=texture2D(u34,vv0+u46);a.a=mix(a.a*u47,a.a,c);vec4 d=floor(255.*a),f=255.*(255.*a-d),b=mix(d,f,g)/255.;b.x=mix(step(a.x,1.5),b.x,c),gl_FragColor=b;}",
  f:["u34","u47","u46"]}]);B();ea();D();r()});return!0},toggle_pause:function(e){if(-1!==[E.play,E.pause].indexOf(z))return e?z!==E.play?e=!1:(Aa&&(clearTimeout(Aa),Aa=!1),W&&(window.cancelAnimationFrame(W),W=!1),z=E.pause,e=!0):e=P(),e},toggle_slow:function(e){-1!==[E.play,E.pause].indexOf(z)&&z===E.play&&(e&&!F.ya?(F.Ib=F.ra,S.nDetectsPerLoop=1,this.Pc(100),F.ya=!0):!e&&F.ya&&(S.nDetectsPerLoop=-1,this.Pc(F.Ib),F.ya=!1))},set_animateDelay:function(e){F.ra=e},resize:function(){var e=F.N.width,r=F.N.height;
  if(e===sa&&r===ba)return!1;sa=e;ba=r;ea();D();Y();aa();return!0},set_inputTexture:function(e,r,A){y.O[0]=r;y.O[1]=A;y.Sa=!0;Y();Q();aa();v.set("s48");y.pa.A();a.activeTexture(a.TEXTURE0);a.bindTexture(a.TEXTURE_2D,e);M.g(!0,!0)},reset_inputTexture:function(){y.O[0]=y.element.videoWidth;y.O[1]=y.element.videoHeight;y.Sa=!1;Y();aa()},get_videoDevices:function(e){return kb(e)},set_scanSettings:function(e){da(S,e);ea();D()},set_stabilizationSettings:function(e){da(ka,e)},update_videoElement:function(e,
  r){la(e,function(){T();Y();r&&r()})}}}();
  ;if(typeof(module)!=='undefined'){module.exports=JEEFACEFILTERAPI;}