function dataURItoBlob(t){for(var e=(0<=t.split(",")[0].indexOf("base64")?atob:unescape)(t.split(",")[1]),r=(t=t.split(",")[0].split(":")[1].split(";")[0],new Uint8Array(e.length)),o=0;o0.0){color.rgb=(color.rgb-0.5)/(1.0-contrast)+0.5;}else{color.rgb=(color.rgb-0.5)*(1.0+contrast)+0.5;}gl_FragColor=color;}"),a.call(this,N.brightnessContrast,{brightness:t(-1,e,1),contrast:t(-1,r,1)}),this}function b(e){e=new f(e);for(var r=[],o=0;o<256;o++)r.push(t(0,Math.floor(256*e.interpolate(o/255)),255));return r}function y(t,e,r){t=b(t),1==arguments.length?e=r=t:(e=b(e),r=b(r));for(var o=[],i=0;i<256;i++)o.splice(o.length,0,t[i],e[i],r[i],255);return this._.extraTexture.initFromBytes(256,1,o),this._.extraTexture.use(1),N.curves=N.curves||new j(null,"uniform sampler2D texture;uniform sampler2D map;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);color.r=texture2D(map,vec2(color.r)).r;color.g=texture2D(map,vec2(color.g)).g;color.b=texture2D(map,vec2(color.b)).b;gl_FragColor=color;}"),N.curves.textures({map:1}),a.call(this,N.curves,{}),this}function _(t,e){return N.unsharpMask=N.unsharpMask||new j(null,"uniform sampler2D blurredTexture;uniform sampler2D originalTexture;uniform float strength;uniform float threshold;varying vec2 texCoord;void main(){vec4 blurred=texture2D(blurredTexture,texCoord);vec4 original=texture2D(originalTexture,texCoord);gl_FragColor=mix(blurred,original,1.0+strength);}"),this._.extraTexture.ensureFormat(this._.texture),this._.texture.use(),this._.extraTexture.drawTo((function(){j.getDefaultShader().drawRect()})),this._.extraTexture.use(1),this.triangleBlur(t),N.unsharpMask.textures({originalTexture:1}),a.call(this,N.unsharpMask,{strength:e}),this._.extraTexture.unuse(1),this}function T(e){return N.sepia=N.sepia||new j(null,"uniform sampler2D texture;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float r=color.r;float g=color.g;float b=color.b;color.r=min(1.0,(r*(1.0-(0.607*amount)))+(g*(0.769*amount))+(b*(0.189*amount)));color.g=min(1.0,(r*0.349*amount)+(g*(1.0-(0.314*amount)))+(b*0.168*amount));color.b=min(1.0,(r*0.272*amount)+(g*0.534*amount)+(b*(1.0-(0.869*amount))));gl_FragColor=color;}"),a.call(this,N.sepia,{amount:t(0,e,1)}),this}function w(e,r){return N.hueSaturation=N.hueSaturation||new j(null,"uniform sampler2D texture;uniform float hue;uniform float saturation;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float angle=hue*3.14159265;float s=sin(angle),c=cos(angle);vec3 weights=(vec3(2.0*c,-sqrt(3.0)*s-c,sqrt(3.0)*s-c)+1.0)/3.0;float len=length(color.rgb);color.rgb=vec3(dot(color.rgb,weights.xyz),dot(color.rgb,weights.zxy),dot(color.rgb,weights.yzx));float average=(color.r+color.g+color.b)/3.0;if(saturation>0.0){color.rgb+=(average-color.rgb)*(1.0-1.0/(1.001-saturation));}else{color.rgb+=(average-color.rgb)*(-saturation);}gl_FragColor=color;}"),a.call(this,N.hueSaturation,{hue:t(-1,e,1),saturation:t(-1,r,1)}),this}function S(t,e,r){return N.zoomBlur=N.zoomBlur||new j(null,"uniform sampler2D texture;uniform vec2 center;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;"+q+"void main(){vec4 color=vec4(0.0);float total=0.0;vec2 toCenter=center-texCoord*texSize;float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=0.0;t<=40.0;t++){float percent=(t+offset)/40.0;float weight=4.0*(percent-percent*percent);vec4 sample=texture2D(texture,texCoord+toCenter*percent*strength/texSize);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}"),a.call(this,N.zoomBlur,{center:[t,e],strength:r,texSize:[this.width,this.height]}),this}function C(t,e,r,o,i,n){N.tiltShift=N.tiltShift||new j(null,"uniform sampler2D texture;uniform float blurRadius;uniform float gradientRadius;uniform vec2 start;uniform vec2 end;uniform vec2 delta;uniform vec2 texSize;varying vec2 texCoord;"+q+"void main(){vec4 color=vec4(0.0);float total=0.0;float offset=random(vec3(12.9898,78.233,151.7182),0.0);vec2 normal=normalize(vec2(start.y-end.y,end.x-start.x));float radius=smoothstep(0.0,1.0,abs(dot(texCoord*texSize-start,normal))/gradientRadius)*blurRadius;for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec4 sample=texture2D(texture,texCoord+delta/texSize*percent*radius);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}");var l=r-t,s=o-e,c=Math.sqrt(l*l+s*s);return a.call(this,N.tiltShift,{blurRadius:i,gradientRadius:n,start:[t,e],end:[r,o],delta:[l/c,s/c],texSize:[this.width,this.height]}),a.call(this,N.tiltShift,{blurRadius:i,gradientRadius:n,start:[t,e],end:[r,o],delta:[-s/c,l/c],texSize:[this.width,this.height]}),this}function E(e,r,o){N.lensBlurPrePass=N.lensBlurPrePass||new j(null,"uniform sampler2D texture;uniform float power;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);color=pow(color,vec4(power));gl_FragColor=vec4(color);}");var i="uniform sampler2D texture0;uniform sampler2D texture1;uniform vec2 delta0;uniform vec2 delta1;uniform float power;varying vec2 texCoord;"+q+"vec4 sample(vec2 delta){float offset=random(vec3(delta,151.7182),0.0);vec4 color=vec4(0.0);float total=0.0;for(float t=0.0;t<=30.0;t++){float percent=(t+offset)/30.0;color+=texture2D(texture0,texCoord+delta*percent);total+=1.0;}return color/total;}";N.lensBlur0=N.lensBlur0||new j(null,i+"void main(){gl_FragColor=sample(delta0);}"),N.lensBlur1=N.lensBlur1||new j(null,i+"void main(){gl_FragColor=(sample(delta0)+sample(delta1))*0.5;}"),N.lensBlur2=N.lensBlur2||new j(null,i+"void main(){vec4 color=(sample(delta0)+2.0*texture2D(texture1,texCoord))/3.0;gl_FragColor=pow(color,vec4(power));}").textures({texture1:1}),i=[];for(var n=0;n<3;n++){var l=o+2*n*Math.PI/3;i.push([e*Math.sin(l)/this.width,e*Math.cos(l)/this.height])}return e=Math.pow(10,t(-1,r,1)),a.call(this,N.lensBlurPrePass,{power:e}),this._.extraTexture.ensureFormat(this._.texture),a.call(this,N.lensBlur0,{delta0:i[0]},this._.texture,this._.extraTexture),a.call(this,N.lensBlur1,{delta0:i[1],delta1:i[2]},this._.extraTexture,this._.extraTexture),a.call(this,N.lensBlur0,{delta0:i[1]}),this._.extraTexture.use(1),a.call(this,N.lensBlur2,{power:1/e,delta0:i[2]}),this}function D(t){return N.triangleBlur=N.triangleBlur||new j(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+q+"void main(){vec4 color=vec4(0.0);float total=0.0;float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec4 sample=texture2D(texture,texCoord+delta*percent);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}"),a.call(this,N.triangleBlur,{delta:[t/this.width,0]}),a.call(this,N.triangleBlur,{delta:[0,t/this.height]}),this}function R(t){return N.edgeWork1=N.edgeWork1||new j(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+q+"void main(){vec2 color=vec2(0.0);vec2 total=vec2(0.0);float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec3 sample=texture2D(texture,texCoord+delta*percent).rgb;float average=(sample.r+sample.g+sample.b)/3.0;color.x+=average*weight;total.x+=weight;if(abs(t)<15.0){weight=weight*2.0-1.0;color.y+=average*weight;total.y+=weight;}}gl_FragColor=vec4(color/total,0.0,1.0);}"),N.edgeWork2=N.edgeWork2||new j(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+q+"void main(){vec2 color=vec2(0.0);vec2 total=vec2(0.0);float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec2 sample=texture2D(texture,texCoord+delta*percent).xy;color.x+=sample.x*weight;total.x+=weight;if(abs(t)<15.0){weight=weight*2.0-1.0;color.y+=sample.y*weight;total.y+=weight;}}float c=clamp(10000.0*(color.y/total.y-color.x/total.x)+0.5,0.0,1.0);gl_FragColor=vec4(c,c,c,1.0);}"),a.call(this,N.edgeWork1,{delta:[t/this.width,0]}),a.call(this,N.edgeWork2,{delta:[0,t/this.height]}),this}function F(t,e,r){return N.hexagonalPixelate=N.hexagonalPixelate||new j(null,"uniform sampler2D texture;uniform vec2 center;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;void main(){vec2 tex=(texCoord*texSize-center)/scale;tex.y/=0.866025404;tex.x-=tex.y*0.5;vec2 a;if(tex.x+tex.y-floor(tex.x)-floor(tex.y)<1.0)a=vec2(floor(tex.x),floor(tex.y));else a=vec2(ceil(tex.x),ceil(tex.y));vec2 b=vec2(ceil(tex.x),floor(tex.y));vec2 c=vec2(floor(tex.x),ceil(tex.y));vec3 TEX=vec3(tex.x,tex.y,1.0-tex.x-tex.y);vec3 A=vec3(a.x,a.y,1.0-a.x-a.y);vec3 B=vec3(b.x,b.y,1.0-b.x-b.y);vec3 C=vec3(c.x,c.y,1.0-c.x-c.y);float alen=length(TEX-A);float blen=length(TEX-B);float clen=length(TEX-C);vec2 choice;if(alen0.0){coord*=mix(1.0,smoothstep(0.0,radius/distance,percent),strength*0.75);}else{coord*=mix(1.0,pow(percent,1.0+strength*0.75)*radius/distance,1.0-percent);}}coord+=center;"),a.call(this,N.bulgePinch,{radius:o,strength:t(-1,i,1),center:[e,r],texSize:[this.width,this.height]}),this}function G(t,e){return e=u.apply(null,e),t=u.apply(null,t),e=h(e),this.matrixWarp([e[0]*t[0]+e[1]*t[3]+e[2]*t[6],e[0]*t[1]+e[1]*t[4]+e[2]*t[7],e[0]*t[2]+e[1]*t[5]+e[2]*t[8],e[3]*t[0]+e[4]*t[3]+e[5]*t[6],e[3]*t[1]+e[4]*t[4]+e[5]*t[7],e[3]*t[2]+e[4]*t[5]+e[5]*t[8],e[6]*t[0]+e[7]*t[3]+e[8]*t[6],e[6]*t[1]+e[7]*t[4]+e[8]*t[7],e[6]*t[2]+e[7]*t[5]+e[8]*t[8]])}var M,k,N,O={};function X(){}try{var z=document.createElement("canvas").getContext("experimental-webgl")}catch(O){}z&&-1===z.getSupportedExtensions().indexOf("OES_texture_float_linear")&&function(t){var e,r,o,i;if(t.getExtension("OES_texture_float"))return e=t.createFramebuffer(),r=t.createTexture(),t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null),t.bindFramebuffer(t.FRAMEBUFFER,e),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),e=t.createTexture(),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,2,2,0,t.RGBA,t.FLOAT,new Float32Array([2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),r=t.createProgram(),o=t.createShader(t.VERTEX_SHADER),i=t.createShader(t.FRAGMENT_SHADER),t.shaderSource(o,"attribute vec2 vertex;void main(){gl_Position=vec4(vertex,0.0,1.0);}"),t.shaderSource(i,"uniform sampler2D texture;void main(){gl_FragColor=texture2D(texture,vec2(0.5));}"),t.compileShader(o),t.compileShader(i),t.attachShader(r,o),t.attachShader(r,i),t.linkProgram(r),o=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,o),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0]),t.STREAM_DRAW),t.enableVertexAttribArray(0),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0),o=new Uint8Array(4),t.useProgram(r),t.viewport(0,0,1,1),t.bindTexture(t.TEXTURE_2D,e),t.drawArrays(t.POINTS,0,1),t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,o),127===o[0]||128===o[0]}(z)&&(M=WebGLRenderingContext.prototype.getExtension,k=WebGLRenderingContext.prototype.getSupportedExtensions,WebGLRenderingContext.prototype.getExtension=function(t){return"OES_texture_float_linear"===t?(void 0===this.$OES_texture_float_linear$&&Object.defineProperty(this,"$OES_texture_float_linear$",{enumerable:!1,configurable:!1,writable:!1,value:new X}),this.$OES_texture_float_linear$):M.call(this,t)},WebGLRenderingContext.prototype.getSupportedExtensions=function(){var t=k.call(this);return-1===t.indexOf("OES_texture_float_linear")&&t.push("OES_texture_float_linear"),t}),O.canvas=function(){var t=document.createElement("canvas");try{N=t.getContext("experimental-webgl",{premultipliedAlpha:!1})}catch(t){N=null}if(N)return t._={gl:N,isInitialized:!1,texture:null,spareTexture:null,flippedShader:null},t.texture=c(r),t.draw=c(o),t.update=c(i),t.replace=c(n),t.contents=c(l),t.getPixelArray=c(s),t.brightnessContrast=c(v),t.hexagonalPixelate=c(F),t.hueSaturation=c(w),t.colorHalftone=c(A),t.triangleBlur=c(D),t.unsharpMask=c(_),t.perspective=c(G),t.matrixWarp=c(L),t.bulgePinch=c(B),t.tiltShift=c(C),t.dotScreen=c(U),t.edgeWork=c(R),t.lensBlur=c(E),t.zoomBlur=c(S),t.noise=c(m),t.denoise=c(x),t.curves=c(y),t.swirl=c(I),t.ink=c(P),t.vignette=c(p),t.vibrance=c(g),t.sepia=c(T),t;throw"This browser does not support WebGL"},O.splineInterpolate=b,Y.fromElement=function(t){var e=new Y(0,0,N.RGBA,N.UNSIGNED_BYTE);return e.loadContentsOf(t),e},Y.prototype.loadContentsOf=function(t){this.width=t.width||t.videoWidth,this.height=t.height||t.videoHeight,N.bindTexture(N.TEXTURE_2D,this.id),N.texImage2D(N.TEXTURE_2D,0,this.format,this.format,this.type,t)},Y.prototype.initFromBytes=function(t,e,r){this.width=t,this.height=e,this.format=N.RGBA,this.type=N.UNSIGNED_BYTE,N.bindTexture(N.TEXTURE_2D,this.id),N.texImage2D(N.TEXTURE_2D,0,N.RGBA,t,e,0,N.RGBA,this.type,new Uint8Array(r))},Y.prototype.destroy=function(){N.deleteTexture(this.id),this.id=null},Y.prototype.use=function(t){N.activeTexture(N.TEXTURE0+(t||0)),N.bindTexture(N.TEXTURE_2D,this.id)},Y.prototype.unuse=function(t){N.activeTexture(N.TEXTURE0+(t||0)),N.bindTexture(N.TEXTURE_2D,null)},Y.prototype.ensureFormat=function(t,e,r,o){var i;1==arguments.length&&(t=(i=arguments[0]).width,e=i.height,r=i.format,o=i.type),t==this.width&&e==this.height&&r==this.format&&o==this.type||(this.width=t,this.height=e,this.format=r,this.type=o,N.bindTexture(N.TEXTURE_2D,this.id),N.texImage2D(N.TEXTURE_2D,0,this.format,t,e,0,this.format,this.type,null))},Y.prototype.drawTo=function(t){if(N.framebuffer=N.framebuffer||N.createFramebuffer(),N.bindFramebuffer(N.FRAMEBUFFER,N.framebuffer),N.framebufferTexture2D(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,N.TEXTURE_2D,this.id,0),N.checkFramebufferStatus(N.FRAMEBUFFER)!==N.FRAMEBUFFER_COMPLETE)throw Error("incomplete framebuffer");N.viewport(0,0,this.width,this.height),t(),N.bindFramebuffer(N.FRAMEBUFFER,null)},W=null,Y.prototype.fillUsingCanvas=function(t){return t(V(this)),this.format=N.RGBA,this.type=N.UNSIGNED_BYTE,N.bindTexture(N.TEXTURE_2D,this.id),N.texImage2D(N.TEXTURE_2D,0,N.RGBA,N.RGBA,N.UNSIGNED_BYTE,W),this},Y.prototype.toImage=function(t){this.use(),j.getDefaultShader().drawRect();var e=4*this.width*this.height,r=new Uint8Array(e),o=V(this),i=o.createImageData(this.width,this.height);N.readPixels(0,0,this.width,this.height,N.RGBA,N.UNSIGNED_BYTE,r);for(var a=0;a>1;this.xa[o]>t?r=o:e=o}o=this.xa[r]-this.xa[e];var i=(this.xa[r]-t)/o;return t=(t-this.xa[e])/o,i*this.ya[e]+t*this.ya[r]+((i*i*i-i)*this.y2[e]+(t*t*t-t)*this.y2[r])*o*o/6},$.prototype.destroy=function(){N.deleteProgram(this.program),this.program=null},$.prototype.uniforms=function(t){for(var e in N.useProgram(this.program),t)if(t.hasOwnProperty(e)){var r=N.getUniformLocation(this.program,e);if(null!==r){var o=t[e];if("[object Array]"==Object.prototype.toString.call(o))switch(o.length){case 1:N.uniform1fv(r,new Float32Array(o));break;case 2:N.uniform2fv(r,new Float32Array(o));break;case 3:N.uniform3fv(r,new Float32Array(o));break;case 4:N.uniform4fv(r,new Float32Array(o));break;case 9:N.uniformMatrix3fv(r,!1,new Float32Array(o));break;case 16:N.uniformMatrix4fv(r,!1,new Float32Array(o));break;default:throw"dont't know how to load uniform \""+e+'" of length '+o.length}else{if("[object Number]"!=Object.prototype.toString.call(o))throw'attempted to set uniform "'+e+'" to invalid value '+(o||"undefined").toString();N.uniform1f(r,o)}}}return this},$.prototype.textures=function(t){for(var e in N.useProgram(this.program),t)t.hasOwnProperty(e)&&N.uniform1i(N.getUniformLocation(this.program,e),t[e]);return this},$.prototype.drawRect=function(t,e,r,o){var i=N.getParameter(N.VIEWPORT);e=void 0!==e?(e-i[1])/i[3]:0,t=void 0!==t?(t-i[0])/i[2]:0,r=void 0!==r?(r-i[0])/i[2]:1,o=void 0!==o?(o-i[1])/i[3]:1,null==N.vertexBuffer&&(N.vertexBuffer=N.createBuffer()),N.bindBuffer(N.ARRAY_BUFFER,N.vertexBuffer),N.bufferData(N.ARRAY_BUFFER,new Float32Array([t,e,t,o,r,e,r,o]),N.STATIC_DRAW),null==N.texCoordBuffer&&(N.texCoordBuffer=N.createBuffer(),N.bindBuffer(N.ARRAY_BUFFER,N.texCoordBuffer),N.bufferData(N.ARRAY_BUFFER,new Float32Array([0,0,0,1,1,0,1,1]),N.STATIC_DRAW)),null==this.vertexAttribute&&(this.vertexAttribute=N.getAttribLocation(this.program,"vertex"),N.enableVertexAttribArray(this.vertexAttribute)),null==this.texCoordAttribute&&(this.texCoordAttribute=N.getAttribLocation(this.program,"_texCoord"),N.enableVertexAttribArray(this.texCoordAttribute)),N.useProgram(this.program),N.bindBuffer(N.ARRAY_BUFFER,N.vertexBuffer),N.vertexAttribPointer(this.vertexAttribute,2,N.FLOAT,!1,0,0),N.bindBuffer(N.ARRAY_BUFFER,N.texCoordBuffer),N.vertexAttribPointer(this.texCoordAttribute,2,N.FLOAT,!1,0,0),N.drawArrays(N.TRIANGLE_STRIP,0,4)},$.getDefaultShader=function(){return N.defaultShader=N.defaultShader||new $,N.defaultShader};var j=$,q="float random(vec3 scale,float seed){return fract(sin(dot(gl_FragCoord.xyz+seed,scale))*43758.5453+seed);}";function J(t,e){if(t=N.createShader(t),N.shaderSource(t,e),N.compileShader(t),N.getShaderParameter(t,N.COMPILE_STATUS))return t;throw"compile error: "+N.getShaderInfoLog(t)}function $(t,e){if(this.texCoordAttribute=this.vertexAttribute=null,this.program=N.createProgram(),e="precision highp float;"+(e=e||"uniform sampler2D texture;varying vec2 texCoord;void main(){gl_FragColor=texture2D(texture,texCoord);}"),N.attachShader(this.program,J(N.VERTEX_SHADER,t=t||"attribute vec2 vertex;attribute vec2 _texCoord;varying vec2 texCoord;void main(){texCoord=_texCoord;gl_Position=vec4(vertex*2.0-1.0,0.0,1.0);}")),N.attachShader(this.program,J(N.FRAGMENT_SHADER,e)),N.linkProgram(this.program),!N.getProgramParameter(this.program,N.LINK_STATUS))throw"link error: "+N.getProgramInfoLog(this.program)}return O}();"object"==typeof module?module.exports=fx:window.fx=fx,function(){function t(e){return e instanceof t?e:this instanceof t?void(this.EXIFwrapped=e):new t(e)}var e=("undefined"!=typeof exports?(exports="undefined"!=typeof module&&module.exports?module.exports=t:exports).EXIF=t:this.EXIF=t,t.Tags={36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubsecTime",37521:"SubsecTimeOriginal",37522:"SubsecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:"OECF",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRation",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",40965:"InteroperabilityIFDPointer",42016:"ImageUniqueID"}),r=t.TiffTags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright"},o=t.GPSTags={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential"},i=t.IFD1Tags={256:"ImageWidth",257:"ImageHeight",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",273:"StripOffsets",274:"Orientation",277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",282:"XResolution",283:"YResolution",284:"PlanarConfiguration",296:"ResolutionUnit",513:"JpegIFOffset",514:"JpegIFByteCount",529:"YCbCrCoefficients",530:"YCbCrSubSampling",531:"YCbCrPositioning",532:"ReferenceBlackWhite"},a=t.StringValues={ExposureProgram:{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},Components:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}};function l(t){return t.exifdata}function s(t){var n=new DataView(t);if(255!=n.getUint8(0)||216!=n.getUint8(1))return!1;for(var l=2,s=t.byteLength;lt.byteLength)return{};var a=u(t,e,e+r,i,o);if(a.Compression)switch(a.Compression){case 6:var n,l;a.JpegIFOffset&&a.JpegIFByteCount&&(n=e+a.JpegIFOffset,l=a.JpegIFByteCount,a.blob=new Blob([new Uint8Array(t.buffer,n,l)],{type:"image/jpeg"}));break;case 1:console.log("Thumbnail image format is TIFF, which is not implemented.");break;default:console.log("Unknown thumbnail image format '%s'",a.Compression)}else 2==a.PhotometricInterpretation&&console.log("Thumbnail image format is RGB, which is not implemented.");return a}(p,x,v,c),f}l+=2+n.getUint16(l+2)}}var c={120:"caption",110:"credit",25:"keywords",55:"dateCreated",80:"byline",85:"bylineTitle",122:"captionWriter",105:"headline",116:"copyright",15:"category"};function u(t,e,r,o,i){for(var a,n=t.getUint16(r,!i),l={},s=0;s")+8,o=(r=r.substring(r.indexOf("