text: !function(){return function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var u=r[s]={exports:{}};e[s][0].call(u.exports,function(t){return i(e[s][1][t]||t)},u,u.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}}()({1:[function(t,e,r){"use strict";var n=t("./internal/create_program"),i=t("./internal/create_shader");function o(t,e){var r=i(t.vert,e.VERTEX_SHADER,e),o=i(t.frag,e.FRAGMENT_SHADER,e);this._program=n(r,o,e),this._gl=e,this._attributes={},this._uniforms={},this._attributeIndex=e.getProgramParameter(this._program,e.ACTIVE_ATTRIBUTES),this._uniformIndex=e.getProgramParameter(this._program,e.ACTIVE_UNIFORMS)}o.prototype={getAttribute:function(t){var e,r=this._attributes[t];if(r)return r;for(;--this._attributeIndex>=0;)if(e=this._gl.getActiveAttrib(this._program,this._attributeIndex),r={location:this._gl.getAttribLocation(this._program,t),name:e.name,size:e.size,type:e.type},this._attributes[r.name]=r,r.name===t)return r;throw ReferenceError('No "'+t+'" attribute found')},getUniform:function(t){var e,r,n=this._uniforms[t];if(n)return n;for(;--this._uniformIndex>=0;)if(r=this._gl.getActiveUniform(this._program,this._uniformIndex),n={location:this._gl.getUniformLocation(this._program,r.name),size:r.size,type:r.type},r.size>1&&~(e=r.name.indexOf("["))?n.name=r.name.slice(0,e):n.name=r.name,this._uniforms[n.name]=n,n.name===t)return n;throw ReferenceError('No "'+t+'" uniform found')},setAttribute:function(t,e,r,n,i,o){var s=this.getAttribute(t).location;return this._gl.enableVertexAttribArray(s),this._gl.vertexAttribPointer(s,e,r,n,i,o),this},setUniform:function(t,e){var r=this.getUniform(t),n=this._gl;switch(r.type){case n.BOOL:case n.INT:r.size>1?n.uniform1iv(r.location,e):n.uniform1i(r.location,e);break;case n.FLOAT:r.size>1?n.uniform1fv(r.location,e):n.uniform1f(r.location,e);break;case n.FLOAT_MAT2:n.uniformMatrix2fv(r.location,!1,e);break;case n.FLOAT_MAT3:n.uniformMatrix3fv(r.location,!1,e);break;case n.FLOAT_MAT4:n.uniformMatrix4fv(r.location,!1,e);break;case n.FLOAT_VEC2:r.size>1?n.uniform2fv(r.location,e):n.uniform2f(r.location,e[0],e[1]);break;case n.FLOAT_VEC3:r.size>1?n.uniform3fv(r.location,e):n.uniform3f(r.location,e[0],e[1],e[2]);break;case n.FLOAT_VEC4:r.size>1?n.uniform4fv(r.location,e):n.uniform4f(r.location,e[0],e[1],e[2],e[3]);break;default:throw TypeError('The uniform type is not supported ("'+t+'")')}return this},use:function(){return this._gl.useProgram(this._program),this},constructor:o},e.exports=o},{"./internal/create_program":17,"./internal/create_shader":18}],2:[function(t,e,r){"use strict";var n=t("light_emitter"),i=t("peako/timestamp"),o=t("peako/timer");function s(){var t=this;n.call(this),this.lastRequestAnimationFrameID=0,this.lastRequestTime=0,this.skippedTime=0,this.totalTime=0,this.running=!1,this.settings={},this.start=function e(r){var n,s;if(!t.running)return r||(t.lastRequestAnimationFrameID=o.request(e),t.lastRequestTime=i(),t.running=!0),this;if(!r)return this;for(n=Math.min(1,.001*(r-t.lastRequestTime)),t.skippedTime+=n,t.totalTime+=n,s=t.settings["frame time"];t.skippedTime>=s&&t.running;)t.skippedTime-=s,t.emit("update",s,r);return t.emit("render",n,r),t.lastRequestTime=r,t.lastRequestAnimationFrameID=o.request(e),this},this.set("FPS",60)}function a(t){return"frame time"!==t&&"FPS"!==t}s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.set=function(t,e){if(a(t))throw Error("Got unknown setting key: "+t);"FPS"===t?this.settings["frame time"]=1/e:"frame time"===t&&(this.settings.FPS=1/e),this.settings[t]=e},s.prototype.get=function(t){if(a(t))throw Error("Got unknown setting key: "+t);return this.settings[t]},s.prototype.clear=function(){return this.skippedTime=0,this},s.prototype.stop=function(){return this.running=!1,this},e.exports=s},{light_emitter:43,"peako/timer":65,"peako/timestamp":66}],3:[function(t,e,r){"use strict";var n=t("./math/mat3");function i(){this.matrix=n.identity(),this._index=-1,this._stack=[]}i.prototype={save:function(){++this._index<this._stack.length?n.copy(this._stack[this._index],this.matrix):this._stack.push(n.clone(this.matrix))},restore:function(){this._index>=0?n.copy(this.matrix,this._stack[this._index--]):n.setIdentity(this.matrix)},setTransform:function(t,e,r,i,o,s){n.setTransform(this.matrix,t,e,r,i,o,s)},translate:function(t,e){n.translate(this.matrix,t,e)},rotate:function(t){n.rotate(this.matrix,t)},scale:function(t,e){n.scale(this.matrix,t,e)},transform:function(t,e,r,i,o,s){n.transform(this.matrix,t,e,r,i,o,s)},constructor:i},e.exports=i},{"./math/mat3":24}],4:[function(t,e,r){"use strict";var n=t("peako/defaults"),i=t("./settings");function o(t){var e,r;t=n(i,t),this.settings=t.settings,t.renderer&&(this.renderer=t.renderer),this.settings.offset||(this.renderer?(e=.5*this.renderer.w,r=.5*this.renderer.h):(e=0,r=0),this.settings.offset={x:e,y:r}),this._destination=null,this._destinationKey=null,this._currentPosition={x:0,y:0}}function s(t,e,r){return t.settings.offset[r]/t.settings.zoom.value-e[r]}function a(t,e,r){var n=s(t,e,r),i=s(t,t._currentPosition,r);t._currentPosition[r]+=(i-n)*t.settings.speed[r]}o.prototype={_getDestination:function(){var t=this._destinationKey;return null===t?this._destination:this._destination[t]},set:function(t,e){for(var r=this.get(t),n=Object.keys(e),i=0,o=n.length;i<o;++i)r[n[i]]=e[n[i]]},get:function(t){return function(t){switch(t){case"zoom-out speed":case"zoom-in speed":case"offset":case"speed":case"zoom":return}throw Error("Got unknown setting key: "+t)}(t),this.settings[t]},lookAt:function(t,e){this._destination=t,this._destinationKey=void 0===e?null:e},shouldLookAt:function(){var t,e,r=this._getDestination();return null===r?(t=0,e=0):(t=r.x,e=r.y),{x:t,y:e}},update:function(){var t=this._getDestination();null!==t&&(a(this,t,"x"),a(this,t,"y"))},looksAt:function(){return{x:this._currentPosition.x,y:this._currentPosition.y}},apply:function(t){var e=this.settings.zoom.value,r=s(this,this._currentPosition,"x"),n=s(this,this._currentPosition,"y");(t||this.renderer).setTransform(e,0,0,e,e*r,e*n)},sees:function(t,e,r,n,i){var o=this.settings.zoom.value,s=this.settings.offset,a=this._currentPosition;if(i||(i=this.renderer),!i)throw Error("No renderer (camera.sees)");return t+r>a.x-s.x/o&&t<a.x+(i.w-s.x)/o&&e+n>a.y-s.y/o&&e<a.y+(i.h-s.y)/o},zoomOut:function(){var t,e=this.settings["zoom-out speed"],r=this.settings.zoom;r.value!==r.min&&(t=e.linear?e.value*r.value:e.value,r.value=Math.max(r.value-t,r.min))},zoomIn:function(){var t,e=this.settings["zoom-in speed"],r=this.settings.zoom;r.value!==r.max&&(t=e.linear?e.value*r.value:e.value,r.value=Math.min(r.value+t,r.max))},constructor:o},e.exports=o},{"./settings":5,"peako/defaults":49}],5:[function(t,e,r){"use strict";r.settings={"zoom-out speed":{value:1,linear:!0},"zoom-in speed":{value:1,linear:!0},zoom:{value:1,min:1,max:1},speed:{x:1,y:1}}},{}],6:[function(t,e,r){"use strict";e.exports=s;var n=t("peako/clamp"),i=t("./internal/parse"),o=t("./RGBA");function s(t,e,r,n){this.set(t,e,r,n)}function a(t,e,r){return t<1/6?Math.round(255*(e+6*(r-e)*t)):t<.5?Math.round(255*r):t<2/3?Math.round(255*(e+(r-e)*(2/3-t)*6)):Math.round(255*e)}s.prototype={perceivedBrightness:function(){return this.rgba().perceivedBrightness()},luminance:function(){return this.rgba().luminance()},brightness:function(){return this.rgba().brightness()},toString:function(){return"hsla("+this[0]+", "+this[1]+"%, "+this[2]+"%, "+this[3]+")"},set:function(t,e,r,n){switch(!0){case"string"==typeof t:t=i(t);case"object"==typeof t&&null!==t:t.type!==this.type&&(t=t[this.type]()),this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3];break;default:switch(void 0){case t:n=1,r=e=t=0;break;case e:n=1,r=Math.floor(t),e=t=0;break;case r:n=e,r=Math.floor(t),e=t=0;break;case n:n=1;default:t=Math.floor(t),e=Math.floor(e),r=Math.floor(r)}this[0]=t,this[1]=e,this[2]=r,this[3]=n}return this},rgba:function(){var t,e=new o,r=this[0]%360/360,n=.01*this[1],i=.01*this[2],s=r+1/3,c=r,f=r-1/3,u=2*i-(t=i<.5?i*(1+n):i+n-i*n);return s<0&&++s,c<0&&++c,f<0&&++f,s>1&&--s,c>1&&--c,f>1&&--f,e[0]=a(s,u,t),e[1]=a(c,u,t),e[2]=a(f,u,t),e[3]=this[3],e},lerp:function(t,e,r,n){var i=new s;return i[0]=t,i[1]=e,i[2]=r,this.lerpColor(i,n)},lerpColor:function(t,e){return this.rgba().lerpColor(t,e).hsla()},shade:function(t){var e=new s;return e[0]=this[0],e[1]=this[1],e[2]=n(this[2]+t,0,100),e[3]=this[3],e},constructor:s},s.prototype.type="hsla"},{"./RGBA":7,"./internal/parse":9,"peako/clamp":45}],7:[function(t,e,r){"use strict";e.exports=o;var n=t("./internal/parse"),i=t("./HSLA");function o(t,e,r,n){this.set(t,e,r,n)}o.prototype={perceivedBrightness:function(){var t=this[0],e=this[1],r=this[2];return Math.sqrt(.299*t*t+.587*e*e+.114*r*r)},luminance:function(){return.2126*this[0]+.7152*this[1]+.0722*this[2]},brightness:function(){return.299*this[0]+.587*this[1]+.114*this[2]},toString:function(){return"rgba("+this[0]+", "+this[1]+", "+this[2]+", "+this[3]+")"},set:function(t,e,r,i){switch(!0){case"string"==typeof t:t=n(t);case"object"==typeof t&&null!==t:t.type!==this.type&&(t=t[this.type]()),this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3];break;default:switch(void 0){case t:i=1,r=e=t=0;break;case e:i=1,r=e=t=Math.floor(t);break;case r:i=e,r=e=t=Math.floor(t);break;case i:i=1;default:t=Math.floor(t),e=Math.floor(e),r=Math.floor(r)}this[0]=t,this[1]=e,this[2]=r,this[3]=i}return this},hsla:function(){var t,e,r=new i,n=this[0]/255,o=this[1]/255,s=this[2]/255,a=Math.max(n,o,s),c=Math.min(n,o,s),f=50*(a+c),u=a-c;if(u){switch(e=f>50?u/(2-a-c):u/(a+c),a){case n:t=o<s?1.0472*(o-s)/u+6.2832:1.0472*(o-s)/u;break;case o:t=1.0472*(s-n)/u+2.0944;break;default:t=1.0472*(n-o)/u+4.1888}t=Math.round(360*t/6.2832),e=Math.round(100*e)}else t=e=0;return r[0]=t,r[1]=e,r[2]=Math.round(f),r[3]=this[3],r},rgba:function(){return this},lerp:function(t,e,r,n){return new o(t=this[0]+(t-this[0])*n,e=this[1]+(e-this[1])*n,r=this[2]+(r-this[2])*n,this[3])},lerpColor:function(t,e){var r,i,o;return"object"!=typeof t&&(t=n(t)),"rgba"!==t.type&&(t=t.rgba()),r=t[0],i=t[1],o=t[2],this.lerp(r,i,o,e)},shade:function(t){return this.hsla().shade(t).rgba()},constructor:o},o.prototype.type="rgba"},{"./HSLA":6,"./internal/parse":9}],8:[function(t,e,r){"use strict";e.exports={aliceblue:"f0f8ffff",antiquewhite:"faebd7ff",aqua:"00ffffff",aquamarine:"7fffd4ff",azure:"f0ffffff",beige:"f5f5dcff",bisque:"ffe4c4ff",black:"000000ff",blanchedalmond:"ffebcdff",blue:"0000ffff",blueviolet:"8a2be2ff",brown:"a52a2aff",burlywood:"deb887ff",cadetblue:"5f9ea0ff",chartreuse:"7fff00ff",chocolate:"d2691eff",coral:"ff7f50ff",cornflowerblue:"6495edff",cornsilk:"fff8dcff",crimson:"dc143cff",cyan:"00ffffff",darkblue:"00008bff",darkcyan:"008b8bff",darkgoldenrod:"b8860bff",darkgray:"a9a9a9ff",darkgreen:"006400ff",darkkhaki:"bdb76bff",darkmagenta:"8b008bff",darkolivegreen:"556b2fff",darkorange:"ff8c00ff",darkorchid:"9932ccff",darkred:"8b0000ff",darksalmon:"e9967aff",darkseagreen:"8fbc8fff",darkslateblue:"483d8bff",darkslategray:"2f4f4fff",darkturquoise:"00ced1ff",darkviolet:"9400d3ff",deeppink:"ff1493ff",deepskyblue:"00bfffff",dimgray:"696969ff",dodgerblue:"1e90ffff",feldspar:"d19275ff",firebrick:"b22222ff",floralwhite:"fffaf0ff",forestgreen:"228b22ff",fuchsia:"ff00ffff",gainsboro:"dcdcdcff",ghostwhite:"f8f8ffff",gold:"ffd700ff",goldenrod:"daa520ff",gray:"808080ff",green:"008000ff",greenyellow:"adff2fff",honeydew:"f0fff0ff",hotpink:"ff69b4ff",indianred:"cd5c5cff",indigo:"4b0082ff",ivory:"fffff0ff",khaki:"f0e68cff",lavender:"e6e6faff",lavenderblush:"fff0f5ff",lawngreen:"7cfc00ff",lemonchiffon:"fffacdff",lightblue:"add8e6ff",lightcoral:"f08080ff",lightcyan:"e0ffffff",lightgoldenrodyellow:"fafad2ff",lightgrey:"d3d3d3ff",lightgreen:"90ee90ff",lightpink:"ffb6c1ff",lightsalmon:"ffa07aff",lightseagreen:"20b2aaff",lightskyblue:"87cefaff",lightslateblue:"8470ffff",lightslategray:"778899ff",lightsteelblue:"b0c4deff",lightyellow:"ffffe0ff",lime:"00ff00ff",limegreen:"32cd32ff",linen:"faf0e6ff",magenta:"ff00ffff",maroon:"800000ff",mediumaquamarine:"66cdaaff",mediumblue:"0000cdff",mediumorchid:"ba55d3ff",mediumpurple:"9370d8ff",mediumseagreen:"3cb371ff",mediumslateblue:"7b68eeff",mediumspringgreen:"00fa9aff",mediumturquoise:"48d1ccff",mediumvioletred:"c71585ff",midnightblue:"191970ff",mintcream:"f5fffaff",mistyrose:"ffe4e1ff",moccasin:"ffe4b5ff",navajowhite:"ffdeadff",navy:"000080ff",oldlace:"fdf5e6ff",olive:"808000ff",olivedrab:"6b8e23ff",orange:"ffa500ff",orangered:"ff4500ff",orchid:"da70d6ff",palegoldenrod:"eee8aaff",palegreen:"98fb98ff",paleturquoise:"afeeeeff",palevioletred:"d87093ff",papayawhip:"ffefd5ff",peachpuff:"ffdab9ff",peru:"cd853fff",pink:"ffc0cbff",plum:"dda0ddff",powderblue:"b0e0e6ff",purple:"800080ff",red:"ff0000ff",rosybrown:"bc8f8fff",royalblue:"4169e1ff",saddlebrown:"8b4513ff",salmon:"fa8072ff",sandybrown:"f4a460ff",seagreen:"2e8b57ff",seashell:"fff5eeff",sienna:"a0522dff",silver:"c0c0c0ff",skyblue:"87ceebff",slateblue:"6a5acdff",slategray:"708090ff",snow:"fffafaff",springgreen:"00ff7fff",steelblue:"4682b4ff",tan:"d2b48cff",teal:"008080ff",thistle:"d8bfd8ff",tomato:"ff6347ff",turquoise:"40e0d0ff",violet:"ee82eeff",violetred:"d02090ff",wheat:"f5deb3ff",white:"ffffffff",whitesmoke:"f5f5f5ff",yellow:"ffff00ff",yellowgreen:"9acd32ff",transparent:"00000000"}},{}],9:[function(t,e,r){"use strict";e.exports=function(t){var e=s[t]||s[t=t.trim().toLowerCase()];if(!e){if(e=o[t])e=new h(f(e),n);else if((e=c.hex.exec(t))||(e=c.hex3.exec(t)))e=new h(f(function(t){var e,r,n,i;if(3===t.length)return t[1]+(t[2]||"ff");return e=t[1],r=t[2],n=t[3],i=t[4]||"f",e+e+r+r+n+n+i+i}(e)),n);else if(e=c.rgb.exec(t))e=new h(u(e),n);else{if(!(e=c.hsl.exec(t)))throw SyntaxError(t+" is not a valid syntax");e=new h(u(e),i)}s[t]=e}return new e.color(e[0],e[1],e[2],e[3])};var n=t("../RGBA"),i=t("../HSLA"),o=t("./colors"),s=Object.create(null),a=[0,0,0,0],c={hex3:/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/,hex:/^#([0-9a-f]{6})([0-9a-f]{2})?$/,rgb:/^rgb\s*\(\s*(\d+|\d*\.\d+)\s*,\s*(\d+|\d*\.\d+)\s*,\s*(\d+|\d*\.\d+)\s*\)$|^\s*rgba\s*\(\s*(\d+|\d*\.\d+)\s*,\s*(\d+|\d*\.\d+)\s*,\s*(\d+|\d*\.\d+)\s*,\s*(\d+|\d*\.\d+)\s*\)$/,hsl:/^hsl\s*\(\s*(\d+|\d*\.\d+)\s*,\s*(\d+|\d*\.\d+)\u0025\s*,\s*(\d+|\d*\.\d+)\u0025\s*\)$|^\s*hsla\s*\(\s*(\d+|\d*\.\d+)\s*,\s*(\d+|\d*\.\d+)\u0025\s*,\s*(\d+|\d*\.\d+)\u0025\s*,\s*(\d+|\d*\.\d+)\s*\)$/};function f(t){return 0==t?a:[(t=parseInt(t,16))>>24&255,t>>16&255,t>>8&255,(255&t)/255]}function u(t){return t[7]?[Number(t[4]),Number(t[5]),Number(t[6]),Number(t[7])]:[Number(t[1]),Number(t[2]),Number(t[3])]}function h(t,e){this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.color=e}},{"../HSLA":6,"../RGBA":7,"./colors":8}],10:[function(t,e,r){"use strict";var n={},i=0;function o(t){if(void 0!==n[t])throw Error("Cannot re-set (add) existing constant: "+t);n[t]=++i}["AUTO","GL","2D","LEFT","TOP","CENTER","MIDDLE","RIGHT","BOTTOM","PERCENT"].forEach(o),r.add=o,r.get=function(t){if(void 0===n[t])throw ReferenceError("Cannot get unknown constant: "+t);return n[t]}},{}],11:[function(t,e,r){"use strict";var n=t("light_emitter");function i(){throw Error("Cannot create an instance of the abstract class (new v6.AbstractImage)")}i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},{light_emitter:43}],12:[function(t,e,r){"use strict";var n=t("./AbstractImage");function i(t,e,r,n,i,o,s){this.image=t,this.sx=e,this.sy=r,this.sw=n,this.sh=i,this.dw=o,this.dh=s}i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.prototype.get=function(){return this.image.get()},e.exports=i},{"./AbstractImage":11}],13:[function(t,e,r){"use strict";var n=t("./CompoundedImage"),i=t("./AbstractImage");function o(t){var e=this;if(!t.src)throw Error('Cannot create v6.Image from HTMLImageElement with no "src" attribute (new v6.Image)');this.image=t,this.image.complete?this._init():this.image.addEventListener("load",function t(){e.image.removeEventListener("load",t),e._init()},!1)}o.prototype=Object.create(i.prototype),o.prototype.constructor=o,o.prototype._init=function(){this.sx=0,this.sy=0,this.sw=this.dw=this.image.width,this.sh=this.dh=this.image.height,this.emit("complete")},o.prototype.get=function(){return this},o.prototype.complete=function(){return Boolean(this.image.src)&&this.image.complete},o.prototype.src=function(){return this.image.src},o.fromURL=function(t){var e=document.createElement("img");return e.src=t,new o(e)},o.stretch=function(t,e,r){var i=r/t.dh*t.dw;return i<e?r=e/t.dw*t.dh:e=i,new n(t.get(),t.sx,t.sy,t.sw,t.sh,e,r)},o.cut=function(t,e,r,i,o){var s=t.sw/t.dw*i,a=t.sh/t.dh*o;if((e+=t.sx)+s>t.sx+t.sw)throw Error("Cannot cut the image because the new image X or W is out of bounds (v6.Image.cut)");if((r+=t.sy)+a>t.sy+t.sh)throw Error("Cannot cut the image because the new image Y or H is out of bounds (v6.Image.cut)");return new n(t.get(),e,r,s,a,i,o)},e.exports=o},{"./AbstractImage":11,"./CompoundedImage":12}],14:[function(t,e,r){"use strict";"function"==typeof Float32Array?e.exports=Float32Array:e.exports=Array},{}],15:[function(t,e,r){"use strict";"function"==typeof Float32Array?e.exports=function(t){return new Float32Array(t)}:e.exports=function(t){return t}},{}],16:[function(t,e,r){"use strict";var n=t("./_Float32Array");e.exports=function(t){for(var e=Math.floor(t),r=2*Math.PI/t,i=new n(2*e+2);e>=0;--e)i[2*e]=Math.cos(r*e),i[1+2*e]=Math.sin(r*e);return i}},{"./_Float32Array":14}],17:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=r.createProgram();if(r.attachShader(n,t),r.attachShader(n,e),r.linkProgram(n),!r.getProgramParameter(n,r.LINK_STATUS))throw Error("Unable to initialize the shader program: "+r.getProgramInfoLog(n));if(r.validateProgram(n),!r.getProgramParameter(n,r.VALIDATE_STATUS))throw Error("Unable to validate the shader program: "+r.getProgramInfoLog(n));return n}},{}],18:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=r.createShader(e);if(r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw SyntaxError("An error occurred compiling the shaders: "+r.getShaderInfoLog(n));return n}},{}],19:[function(t,e,r){"use strict"},{}],20:[function(t,e,r){"use strict";var n,i,o=t("peako/noop");"undefined"!=typeof console&&console.warn?(n={},i=function(t){n[t]||(console.warn(t),n[t]=!0)}):i=o,e.exports=i},{"peako/noop":62}],21:[function(t,e,r){"use strict";var n=t("../settings");function i(){throw Error("Cannot create an instance of the abstract class (new v6.AbstractVector)")}i.prototype={normalize:function(){var t=this.mag();return t&&1!==t&&this.div(t),this},setAngle:function(t){var e=this.mag();return n.degrees&&(t*=Math.PI/180),this.x=e*Math.cos(t),this.y=e*Math.sin(t),this},setMag:function(t){return this.normalize().mul(t)},rotate:function(t){var e,r,i=this.x,o=this.y;return n.degrees&&(t*=Math.PI/180),e=Math.cos(t),r=Math.sin(t),this.x=i*e-o*r,this.y=i*r+o*e,this},getAngle:function(){return n.degrees?180*Math.atan2(this.y,this.x)/Math.PI:Math.atan2(this.y,this.x)},limit:function(t){var e=this.magSq();return e>t*t&&this.div(Math.sqrt(e)).mul(t),this},mag:function(){return Math.sqrt(this.magSq())},constructor:i},i._fromAngle=function(t,e){return n.degrees&&(e*=Math.PI/180),new t(Math.cos(e),Math.sin(e))},e.exports=i},{"../settings":40}],22:[function(t,e,r){"use strict";var n=t("../settings"),i=t("./AbstractVector");function o(t,e){this.set(t,e)}o.prototype=Object.create(i.prototype),o.prototype.constructor=o,o.prototype.set=function(t,e){return this.x=t||0,this.y=e||0,this},o.prototype.add=function(t,e){return this.x+=t||0,this.y+=e||0,this},o.prototype.sub=function(t,e){return this.x-=t||0,this.y-=e||0,this},o.prototype.mul=function(t){return this.x*=t,this.y*=t,this},o.prototype.div=function(t){return this.x/=t,this.y/=t,this},o.prototype.dot=function(t,e){return this.x*(t||0)+this.y*(e||0)},o.prototype.lerp=function(t,e,r){return this.x+=(t-this.x)*r||0,this.y+=(e-this.y)*r||0,this},o.prototype.setVector=function(t){return this.set(t.x,t.y)},o.prototype.addVector=function(t){return this.add(t.x,t.y)},o.prototype.subVector=function(t){return this.sub(t.x,t.y)},o.prototype.mulVector=function(t){return this.x*=t.x,this.y*=t.y,this},o.prototype.divVector=function(t){return this.x/=t.x,this.y/=t.y,this},o.prototype.dotVector=function(t){return this.dot(t.x,t.y)},o.prototype.lerpVector=function(t,e){return this.lerp(t.x,t.y,e)},o.prototype.magSq=function(){return this.x*this.x+this.y*this.y},o.prototype.clone=function(){return new o(this.x,this.y)},o.prototype.dist=function(t){var e=t.x-this.x,r=t.y-this.y;return Math.sqrt(e*e+r*r)},o.prototype.toString=function(){return"v6.Vector2D { x: "+this.x.toFixed(2)+", y: "+this.y.toFixed(2)+" }"},o.random=function(){var t;return t=n.degrees?360:2*Math.PI,o.fromAngle(Math.random()*t)},o.fromAngle=function(t){return i._fromAngle(o,t)},e.exports=o},{"../settings":40,"./AbstractVector":21}],23:[function(t,e,r){"use strict";var n=t("./AbstractVector");function i(t,e,r){this.set(t,e,r)}i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.prototype.set=function(t,e,r){return this.x=t||0,this.y=e||0,this.z=r||0,this},i.prototype.add=function(t,e,r){return this.x+=t||0,this.y+=e||0,this.z+=r||0,this},i.prototype.sub=function(t,e,r){return this.x-=t||0,this.y-=e||0,this.z-=r||0,this},i.prototype.mul=function(t){return this.x*=t,this.y*=t,this.z*=t,this},i.prototype.div=function(t){return this.x/=t,this.y/=t,this.z/=t,this},i.prototype.dot=function(t,e,r){return this.x*(t||0)+this.y*(e||0)+this.z*(r||0)},i.prototype.lerp=function(t,e,r,n){return this.x+=(t-this.x)*n||0,this.y+=(e-this.y)*n||0,this.z+=(r-this.z)*n||0,this},i.prototype.setVector=function(t){return this.set(t.x,t.y,t.z)},i.prototype.addVector=function(t){return this.add(t.x,t.y,t.z)},i.prototype.subVector=function(t){return this.sub(t.x,t.y,t.z)},i.prototype.mulVector=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this},i.prototype.divVector=function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},i.prototype.dotVector=function(t){return this.dot(t.x,t.y,t.z)},i.prototype.lerpVector=function(t,e){return this.lerp(t.x,t.y,t.z,e)},i.prototype.magSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z},i.prototype.clone=function(){return new i(this.x,this.y,this.z)},i.prototype.dist=function(t){var e=t.x-this.x,r=t.y-this.y,n=t.z-this.z;return Math.sqrt(e*e+r*r+n*n)},i.prototype.toString=function(){return"v6.Vector3D { x: "+this.x.toFixed(2)+", y: "+this.y.toFixed(2)+", z: "+this.z.toFixed(2)+" }"},i.random=function(){var t=Math.random()*Math.PI*2,e=2*Math.random()-1,r=Math.sqrt(1-e*e);return new i(r*Math.cos(t),r*Math.sin(t),e)},i.fromAngle=function(t){return n._fromAngle(i,t)},e.exports=i},{"./AbstractVector":21}],24:[function(t,e,r){"use strict";r.identity=function(){return[1,0,0,0,1,0,0,0,1]},r.setIdentity=function(t){t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1},r.copy=function(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]},r.clone=function(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},r.translate=function(t,e,r){t[6]=e*t[0]+r*t[3]+t[6],t[7]=e*t[1]+r*t[4]+t[7],t[8]=e*t[2]+r*t[5]+t[8]},r.rotate=function(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],c=Math.cos(e),f=Math.sin(e);t[0]=c*r+f*o,t[1]=c*n+f*s,t[2]=c*i+f*a,t[3]=c*o-f*r,t[4]=c*s-f*n,t[5]=c*a-f*i},r.scale=function(t,e,r){t[0]*=e,t[1]*=e,t[2]*=e,t[3]*=r,t[4]*=r,t[5]*=r},r.transform=function(t,e,r,n,i,o,s){t[0]*=e,t[1]*=n,t[2]*=o,t[3]*=r,t[4]*=i,t[5]*=s,t[6]=0,t[7]=0},r.setTransform=function(t,e,r,n,i,o,s){t[0]=e,t[1]=r,t[3]=n,t[4]=i,t[6]=o,t[7]=s}},{}],25:[function(t,e,r){"use strict";var n=t("peako/get-element-w"),i=t("peako/get-element-h"),o=t("../constants"),s=t("../internal/create_polygon"),a=t("../internal/polygons"),c=t("./internal/set_default_drawing_settings"),f=t("./internal/get_webgl"),u=t("./internal/copy_drawing_settings"),h=t("./internal/process_rect_align").processRectAlignX,l=t("./internal/process_rect_align").processRectAlignY,d=t("./internal/process_shape"),p=t("./internal/close_shape"),g=t("./settings");function m(){throw Error("Cannot create an instance of the abstract class (new v6.AbstractRenderer)")}m.prototype={appendTo:function(t){return t.appendChild(this.canvas),this},destroy:function(){return this.canvas.parentNode.removeChild(this.canvas),this},push:function(){return this._stack[++this._stackIndex]?u(this._stack[this._stackIndex],this):this._stack.push(c({},this)),this},pop:function(){return this._stackIndex>=0?u(this,this._stack[this._stackIndex--]):c(this,this),this},resize:function(t,e){var r=this.canvas,n=this.settings.scale;return r.style.width=t+"px",r.style.height=e+"px",r.width=this.w=Math.floor(t*n),r.height=this.h=Math.floor(e*n),this},resizeTo:function(t){return this.resize(n(t),i(t))},drawPolygon:function(t,e,r,n,i,o,c){var f=a[r];return f||(f=a[r]=s(r)),c&&(o*=Math.PI/180),this.matrix.save(),this.matrix.translate(t,e),this.matrix.rotate(o),this.drawArrays(f,.5*f.length,void 0,n,i),this.matrix.restore(),this},polygon:function(t,e,r,n,i){return r%1&&(r=.01*Math.floor(100*r)),void 0===i?this.drawPolygon(t,e,r,n,n,.5*-Math.PI):this.drawPolygon(t,e,r,n,n,i,g.degrees),this},image:function(t,e,r,n,i){return t.get().loaded&&(void 0===n&&(n=t.dw),void 0===i&&(i=t.dh),e=h(this,e,n),e=l(this,r,i),this.drawImage(t,e,r,n,i)),this},beginShape:function(t){return t||(t={}),this._vertices.length=0,this._closedShape=null,void 0===t.drawFunction?this._drawFunction=null:this._drawFunction=t.drawFunction,this},vertex:function(t,e){return this._vertices.push(Math.floor(t),Math.floor(e)),this._closedShape=null,this},endShape:function(t){var e,r;if(t||(t={}),!(e=t.drawFunction||this._drawFunction))throw Error('No "drawFunction" specified for "renderer.endShape"');return t.close?(p(this),r=this._closedShape):r=this._vertices,e(this,d(this,r)),this},save:function(){return this.matrix.save(),this},restore:function(){return this.matrix.restore(),this},setTransform:function(t,e,r,n,i,o){return this.matrix.setTransform(t,e,r,n,i,o),this},translate:function(t,e){return this.matrix.translate(t,e),this},rotate:function(t){return this.settings.degrees&&(t*=Math.PI/180),this.matrix.rotate(t),this},scale:function(t,e){return this.matrix.scale(t,e),this},transform:function(t,e,r,n,i,o){return this.matrix.transform(t,e,r,n,i,o),this},lineWidth:function(t){return this._lineWidth=t,this},backgroundPositionX:function(t,e){if(void 0!==e&&e!==o.get("VALUE")){if(e===o.get("CONSTANT"))if(e=o.get("PERCENT"),t===o.get("LEFT"))t=0;else if(t===o.get("CENTER"))t=.5;else{if(t!==o.get("RIGHT"))throw Error("Got unknown value. The known are: LEFT, CENTER, RIGHT");t=1}if(e!==o.get("PERCENT"))throw Error("Got unknown `value` type. The known are: VALUE, PERCENT, CONSTANT");t*=this.w}return this._backgroundPositionX=t,this},backgroundPositionY:function(t,e){if(void 0!==e&&e!==o.get("VALUE")){if(e===o.get("CONSTANT"))if(e=o.get("PERCENT"),t===o.get("TOP"))t=0;else if(t===o.get("MIDDLE"))t=.5;else{if(t!==o.get("BOTTOM"))throw Error("Got unknown value. The known are: TOP, MIDDLE, BOTTOM");t=1}if(e!==o.get("PERCENT"))throw Error("Got unknown `value` type. The known are: VALUE, PERCENT, CONSTANT");t*=this.h}return this._backgroundPositionY=t,this},rectAlignX:function(t){if(t!==o.get("LEFT")&&t!==o.get("CENTER")&&t!==o.get("RIGHT"))throw Error("Got unknown `rectAlign` constant. The known are: LEFT, CENTER, RIGHT");return this._rectAlignX=t,this},rectAlignY:function(t){if(t!==o.get("LEFT")&&t!==o.get("CENTER")&&t!==o.get("RIGHT"))throw Error("Got unknown `rectAlign` constant. The known are: TOP, MIDDLE, BOTTOM");return this._rectAlignY=t,this},stroke:function(t,e,r,n){return"boolean"==typeof t?this._doStroke=t:("string"==typeof t||this._strokeColor.type!==this.settings.color.type?this._strokeColor=new this.settings.color(t,e,r,n):this._strokeColor.set(t,e,r,n),this._doStroke=!0),this},fill:function(t,e,r,n){return"boolean"==typeof t?this._doFill=t:("string"==typeof t||this._fillColor.type!==this.settings.color.type?this._fillColor=new this.settings.color(t,e,r,n):this._fillColor.set(t,e,r,n),this._doFill=!0),this},noStroke:function(){return this._doStroke=!1,this},noFill:function(){return this._doFill=!1,this},constructor:m},m.create=function(t,e,r){var n;if(e.canvas?t.canvas=e.canvas:(t.canvas=document.createElement("canvas"),t.canvas.innerHTML="Unable to run this application."),r===o.get("2D"))n="2d";else{if(r!==o.get("GL"))throw Error("Got unknown renderer type. The known are: 2D and GL");if(!(n=f()))throw Error("Cannot get WebGL context. Try to use 2D as the renderer type or v6.Renderer2D instead of v6.RendererGL")}t.context=t.canvas.getContext(n,{alpha:e.alpha}),t.settings=e.settings,t.type=r,t._stack=[],t._stackIndex=-1,t._vertices=[],t._closedShape=null,t._drawFunction=null,void 0===e.appendTo?t.appendTo(document.body):null!==e.appendTo&&t.appendTo(e.appendTo),"w"in e||"h"in e?t.resize(e.w||0,e.h||0):null!==e.appendTo?t.resizeTo(e.appendTo||document.body):t.resize(600,400),c(t,t)},e.exports=m},{"../constants":10,"../internal/create_polygon":16,"../internal/polygons":19,"./internal/close_shape":29,"./internal/copy_drawing_settings":30,"./internal/get_webgl":33,"./internal/process_rect_align":34,"./internal/process_shape":35,"./internal/set_default_drawing_settings":36,"./settings":37,"peako/get-element-h":50,"peako/get-element-w":51}],26:[function(t,e,r){"use strict";var n=t("peako/defaults"),i=t("../constants"),o=t("./internal/process_rect_align").processRectAlignX,s=t("./internal/process_rect_align").processRectAlignY,a=t("./AbstractRenderer"),c=t("./settings");function f(t){a.create(this,t=n(c,t),i.get("2D")),this.matrix=this.context}f.prototype=Object.create(a.prototype),f.prototype.constructor=f,f.prototype.backgroundColor=function(t,e,r,n){var i=this.settings,o=this.context;return o.save(),o.fillStyle=new i.color(t,e,r,n),o.setTransform(1,0,0,1,0,0),o.fillRect(0,0,this.w,this.h),o.restore(),this},f.prototype.backgroundImage=function(t){var e=this._rectAlignX,r=this._rectAlignY;return this._rectAlignX=i.get("CENTER"),this._rectAlignY=i.get("MIDDLE"),this.image(t,.5*this.w,.5*this.h),this._rectAlignX=e,this._rectAlignY=r,this},f.prototype.clear=function(){return this.context.clearRect(0,0,this.w,this.h),this},f.prototype.drawArrays=function(t,e,r,n,i){var o,s=this.context;if(e<2)return this;for(void 0===n&&(n=i=1),s.beginPath(),s.moveTo(t[0]*n,t[1]*i),o=2,e*=2;o<e;o+=2)s.lineTo(t[o]*n,t[o+1]*i);return this._doFill&&this._fill(),this._doStroke&&this._lineWidth>0&&this._stroke(),this},f.prototype.drawImage=function(t,e,r,n,i){return this.context.drawImage(t.get().image,t.sx,t.sy,t.sw,t.sh,e,r,n,i),this},f.prototype.rect=function(t,e,r,n){return t=o(this,t,r),e=s(this,e,n),this.context.beginPath(),this.context.rect(t,e,r,n),this._doFill&&this._fill(),this._doStroke&&this._lineWidth>0&&this._stroke(),this},f.prototype.arc=function(t,e,r){return this.context.beginPath(),this.context.arc(t,e,r,0,2*Math.PI),this._doFill&&this._fill(),this._doStroke&&this._lineWidth>0&&this._stroke(),this},f.prototype.line=function(t,e,r,n){return this._doStroke&&this._lineWidth>0&&(this.context.moveTo(t,e),this.context.lineTo(r,n),this._stroke()),this},f.prototype.point=function(t,e){var r=this._lineWidth;return this._doStroke&&r>0&&(this.context.beginPath(),this.context.rect(t-.5*r,e-.5*r,r,r),this.context.fillStyle=this._strokeColor,this.context.fill()),this},f.prototype._fill=function(){this.context.fillStyle=this._fillColor,this.context.fill()},f.prototype._stroke=function(){var t=this.context;t.strokeStyle=this._strokeColor,(t.lineWidth=this._lineWidth)<=1&&t.stroke(),t.stroke()},e.exports=f},{"../constants":10,"./AbstractRenderer":25,"./internal/process_rect_align":34,"./settings":37,"peako/defaults":49}],27:[function(t,e,r){"use strict";var n=t("peako/defaults"),i=t("../internal/create_array"),o=t("../ShaderProgram"),s=t("../Transform"),a=t("../constants"),c=t("../shaders"),f=t("./internal/process_rect_align").processRectAlignX,u=t("./internal/process_rect_align").processRectAlignY,h=t("./AbstractRenderer"),l=t("./settings"),d=i([0,0,1,0,1,1,0,1]);function p(t){h.create(this,t=n(l,t),a.get("GL")),this.matrix=new s,this.buffers={default:this.context.createBuffer(),rect:this.context.createBuffer()},this.context.bindBuffer(this.context.ARRAY_BUFFER,this.buffers.rect),this.context.bufferData(this.context.ARRAY_BUFFER,d,this.context.STATIC_DRAW),this.programs={default:new o(c.basic,this.context)},this.blending(t.blending)}p.prototype=Object.create(h.prototype),p.prototype.constructor=p,p.prototype.resize=function(t,e){return h.prototype.resize.call(this,t,e),this.context.viewport(0,0,this.w,this.h),this},p.prototype.blending=function(t){var e=this.context;return t?(e.enable(e.BLEND),e.disable(e.DEPTH_TEST),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.blendEquation(e.FUNC_ADD)):(e.disable(e.BLEND),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL)),this},p.prototype._clear=function(t,e,r,n){var i=this.context;i.clearColor(t,e,r,n),i.clear(i.COLOR_BUFFER_BIT|i.DEPTH_BUFFER_BIT)},p.prototype.backgroundColor=function(t,e,r,n){var i=new this.settings.color(t,e,r,n).rgba();return this._clear(i[0]/255,i[1]/255,i[2]/255,i[3]),this},p.prototype.clear=function(){return this._clear(0,0,0,0),this},p.prototype.drawArrays=function(t,e,r,n,i){var o=this.programs.default,s=this.context;return e<2?this:(t&&(void 0===r&&(r=s.STATIC_DRAW),s.bindBuffer(s.ARRAY_BUFFER,this.buffers.default),s.bufferData(s.ARRAY_BUFFER,t,r)),void 0!==n&&this.matrix.scale(n,i),o.use().setUniform("utransform",this.matrix.matrix).setUniform("ures",[this.w,this.h]).setAttribute("apos",2,s.FLOAT,!1,0,0),this._fill(e),this._stroke(e),this)},p.prototype._fill=function(t){this._doFill&&(this.programs.default.setUniform("ucolor",this._fillColor.rgba()),this.context.drawArrays(this.context.TRIANGLE_FAN,0,t))},p.prototype._stroke=function(t){this._doStroke&&this._lineWidth>0&&(this.programs.default.setUniform("ucolor",this._strokeColor.rgba()),this.context.lineWidth(this._lineWidth),this.context.drawArrays(this.context.LINE_LOOP,0,t))},p.prototype.arc=function(t,e,r){return this.drawPolygon(t,e,r,r,24,0)},p.prototype.line=function(t,e,r,n){return this.drawArrays(i([t,e,r,n]),2),this},p.prototype.point=function(t,e){var r=.5*this._lineWidth,n=this._fillColor,o=this._doFill,s=this._doStroke;return this._fillColor=this._strokeColor,this._doFill=!0,this._doStroke=!1,this.drawArrays(i([t-r,e-r,t+r,e-r,t+r,e+r,t-r,e+r]),4),this._fillColor=n,this._doFill=o,this._doStroke=s,this},p.prototype.rect=function(t,e,r,n){return t=f(this,t,r),e=u(this,e,n),this.matrix.save(),this.matrix.translate(t,e),this.matrix.scale(r,n),this.context.bindBuffer(this.context.ARRAY_BUFFER,this.buffers.rect),this.drawArrays(null,4),this.matrix.restore(),this},e.exports=p},{"../ShaderProgram":1,"../Transform":3,"../constants":10,"../internal/create_array":15,"../shaders":41,"./AbstractRenderer":25,"./internal/process_rect_align":34,"./settings":37,"peako/defaults":49}],28:[function(t,e,r){"use strict";var n=t("../constants"),i=t("../internal/report"),o=t("./internal/get_renderer_type"),s=t("./internal/get_webgl"),a=t("./RendererGL"),c=t("./Renderer2D"),f=t("./settings").type;e.exports=function(t){var e=t&&t.type||f;if(e===n.get("AUTO")&&(e=o()),e===n.get("GL")){if(s())return new a(t);i("Cannot create WebGL context. Falling back to 2D.")}if(e===n.get("2D")||e===n.get("GL"))return new c(t);throw Error("Got unknown renderer type. The known are: 2D and GL")}},{"../constants":10,"../internal/report":20,"./Renderer2D":26,"./RendererGL":27,"./internal/get_renderer_type":32,"./internal/get_webgl":33,"./settings":37}],29:[function(t,e,r){"use strict";e.exports=function(t){t._closedShape||(t._closedShape=t._vertices.slice(),t._closedShape.push(t._closedShape[0]))}},{}],30:[function(t,e,r){"use strict";e.exports=function(t,e,r){return r&&(t._fillColor[0]=e._fillColor[0],t._fillColor[1]=e._fillColor[1],t._fillColor[2]=e._fillColor[2],t._fillColor[3]=e._fillColor[3],t._strokeColor[0]=e._strokeColor[0],t._strokeColor[1]=e._strokeColor[1],t._strokeColor[2]=e._strokeColor[2],t._strokeColor[3]=e._strokeColor[3]),t._backgroundPositionX=e._backgroundPositionX,t._backgroundPositionY=e._backgroundPositionY,t._rectAlignX=e._rectAlignX,t._rectAlignY=e._rectAlignY,t._lineWidth=e._lineWidth,t._doStroke=e._doStroke,t._doFill=e._doFill,t}},{}],31:[function(t,e,r){"use strict";var n=t("../../constants"),i={_backgroundPositionX:n.get("LEFT"),_backgroundPositionY:n.get("TOP"),_rectAlignX:n.get("LEFT"),_rectAlignY:n.get("TOP"),_lineWidth:2,_doStroke:!0,_doFill:!0};e.exports=i},{"../../constants":10}],32:[function(t,e,r){"use strict";var n,i=t("peako/once"),o=t("../../constants");if(void 0===n)try{n=t("platform")}catch(t){}e.exports=i(function(){var t,e;return n&&(e=n.os&&"iOS"===n.os.family&&"Safari"===n.name),"undefined"!=typeof window&&(t="ontouchend"in window),t&&!e?o.get("GL"):o.get("2D")})},{"../../constants":10,"peako/once":63,platform:"platform"}],33:[function(t,e,r){"use strict";var n=t("peako/once");e.exports=n(function(){var t=document.createElement("canvas"),e=null;return t.getContext("webgl")?e="webgl":t.getContext("experimental-webgl")&&(e="experimental-webgl"),t=null,e})},{"peako/once":63}],34:[function(t,e,r){"use strict";var n=t("../../constants");r.processRectAlignX=function(t,e,r){if(t._rectAlignX===n.get("CENTER"))e-=.5*r;else if(t._rectAlignX===n.get("RIGHT"))e-=r;else if(t._rectAlignX!==n.get("LEFT"))throw Error('Unknown " +rectAlignX": '+t._rectAlignX);return Math.floor(e)},r.processRectAlignY=function(t,e,r){if(t._rectAlignY===n.get("MIDDLE"))e-=.5*r;else if(t._rectAlignY===n.get("BOTTOM"))e-=r;else if(t._rectAlignY!==n.get("TOP"))throw Error('Unknown " +rectAlignY": '+t._rectAlignY);return Math.floor(e)}},{"../../constants":10}],35:[function(t,e,r){"use strict";var n=t("../../constants").get("GL");e.exports=function(t,e){return t.type!==n||"function"!=typeof Float32Array||e instanceof Float32Array||(e=new Float32Array(e)),e}},{"../../constants":10}],36:[function(t,e,r){"use strict";var n=t("./default_drawing_settings"),i=t("./copy_drawing_settings");e.exports=function(t,e){return i(t,n),t._strokeColor=new e.settings.color,t._fillColor=new e.settings.color,t}},{"./copy_drawing_settings":30,"./default_drawing_settings":31}],37:[function(t,e,r){"use strict";var n=t("../color/RGBA"),i=t("../constants").get("2D");r.settings={color:n,scale:1},r.antialias=!0,r.blending=!0,r.degrees=!1,r.alpha=!0,r.type=i},{"../color/RGBA":7,"../constants":10}],38:[function(t,e,r){"use strict";e.exports=function(){throw Error("Not implemented")}},{}],39:[function(t,e,r){"use strict";e.exports=function(){throw Error("Not implemented")}},{}],40:[function(t,e,r){"use strict";r.degress=!1},{}],41:[function(t,e,r){"use strict";e.exports={basic:{vert:"precision mediump float;attribute vec2 apos;uniform vec2 ures;uniform mat3 utransform;void main(){gl_Position=vec4(((utransform*vec3(apos,1.0)).xy/ures*2.0-1.0)*vec2(1,-1),0,1);}",frag:"precision mediump float;uniform vec4 ucolor;void main(){gl_FragColor=vec4(ucolor.rgb/255.0,ucolor.a);}"},background:{vert:"precision mediump float;attribute vec2 apos;void main(){gl_Position = vec4(apos,0,1);}",frag:"precision mediump float;uniform vec4 ucolor;void main(){gl_FragColor=ucolor;}"}}},{}],42:[function(t,e,r){"use strict";r.AbstractImage=t("./core/image/AbstractImage"),r.AbstractRenderer=t("./core/renderer/AbstractRenderer"),r.AbstractVector=t("./core/math/AbstractVector"),r.Camera=t("./core/camera/Camera"),r.CompoundedImage=t("./core/image/CompoundedImage"),r.HSLA=t("./core/color/HSLA"),r.Image=t("./core/image/Image"),r.RGBA=t("./core/color/RGBA"),r.Renderer2D=t("./core/renderer/Renderer2D"),r.RendererGL=t("./core/renderer/RendererGL"),r.ShaderProgram=t("./core/ShaderProgram"),r.Ticker=t("./core/Ticker"),r.Transform=t("./core/Transform"),r.Vector2D=t("./core/math/Vector2D"),r.Vector3D=t("./core/math/Vector3D"),r.constants=t("./core/constants"),r.createRenderer=t("./core/renderer/create_renderer"),r.shaders=t("./core/shaders"),r.mat3=t("./core/math/mat3"),r.shapes={drawPoints:t("./core/renderer/shapes/draw_points"),drawLines:t("./core/renderer/shapes/draw_lines")},r.settings={renderer:t("./core/renderer/settings"),camera:t("./core/camera/settings"),core:t("./core/settings")},"undefined"!=typeof self&&(self.v6=r)},{"./core/ShaderProgram":1,"./core/Ticker":2,"./core/Transform":3,"./core/camera/Camera":4,"./core/camera/settings":5,"./core/color/HSLA":6,"./core/color/RGBA":7,"./core/constants":10,"./core/image/AbstractImage":11,"./core/image/CompoundedImage":12,"./core/image/Image":13,"./core/math/AbstractVector":21,"./core/math/Vector2D":22,"./core/math/Vector3D":23,"./core/math/mat3":24,"./core/renderer/AbstractRenderer":25,"./core/renderer/Renderer2D":26,"./core/renderer/RendererGL":27,"./core/renderer/create_renderer":28,"./core/renderer/settings":37,"./core/renderer/shapes/draw_lines":38,"./core/renderer/shapes/draw_points":39,"./core/settings":40,"./core/shaders":41}],43:[function(t,e,r){"use strict";function n(){}function i(t,e,r,n){var i={listener:r,active:!0,type:e,once:n};t._events||(t._events=Object.create(null)),t._events[e]||(t._events[e]=[]),t._events[e].push(i)}function o(t,e){return t._events&&t._events[e]}n.prototype={emit:function(t){var e,r,n,i=o(this,t);if(!i)return this;for(arguments.length>1&&(e=[].slice.call(arguments,1)),r=0,n=i.length;r<n;++r)if(i[r].active&&(i[r].once&&(i[r].active=!1),!1===(e?i[r].listener.apply(this,e):i[r].listener.call(this))))return!1},off:function(t,e){var r,n;if(t){if(r=o(this,t))if(e)for(n=r.length-1;n>=0;--n)r[n].listener===e&&r[n].active&&(r[n].active=!1);else r.length=0}else this._events=null;return this},on:function(t,e){return i(this,t,e),this},once:function(t,e){return i(this,t,e,!0),this},constructor:n},e.exports=n},{}],44:[function(t,e,r){"use strict";var n=t("./internal/ArgumentException"),i=t("./default-to");e.exports=function(t,e){var r;if("function"!=typeof e)throw n(e,"a function");return t=i(t,1),function(){return--t>=0&&(r=e.apply(this,arguments)),r}}},{"./default-to":48,"./internal/ArgumentException":53}],45:[function(t,e,r){"use strict";e.exports=function(t,e,r){return t>=r?r:t<=e?e:t}},{}],46:[function(t,e,r){"use strict";e.exports={ERR:{INVALID_ARGS:"Invalid arguments",FUNCTION_EXPECTED:"Expected a function",STRING_EXPECTED:"Expected a string",UNDEFINED_OR_NULL:"Cannot convert undefined or null to object",REDUCE_OF_EMPTY_ARRAY:"Reduce of empty array with no initial value",NO_PATH:"No path was given"},MAX_ARRAY_LENGTH:4294967295,MAX_SAFE_INT:9007199254740991,MIN_SAFE_INT:-9007199254740991,DEEP:1,DEEP_KEEP_FN:2}},{}],47:[function(t,e,r){"use strict";e.exports=function(t){return function(e){var r,n,i;return e.window===e?r=Math.max(e["inner"+t]||0,e.document.documentElement["client"+t]):9===e.nodeType?(n=e.body,i=e.documentElement,r=Math.max(n["scroll"+t],i["scroll"+t],n["offset"+t],i["offset"+t],n["client"+t],i["client"+t])):r=e["client"+t],r}}},{}],48:[function(t,e,r){"use strict";e.exports=function(t,e){return null!==t&&void 0!==t&&t==t?t:e}},{}],49:[function(t,e,r){"use strict";var n=t("./mixin");e.exports=function(t,e){return e?n({},t,e):n({},t)}},{"./mixin":61}],50:[function(t,e,r){"use strict";e.exports=t("./create/create-get-element-dimension")("Height")},{"./create/create-get-element-dimension":47}],51:[function(t,e,r){"use strict";e.exports=t("./create/create-get-element-dimension")("Width")},{"./create/create-get-element-dimension":47}],52:[function(t,e,r){"use strict";var n=t("./constants").ERR;e.exports=Object.getPrototypeOf||function(t){var e;if(null===t||void 0===t)throw TypeError(n.UNDEFINED_OR_NULL);return void 0!==(e=t.__proto__)?e:"[object Function]"===Object.prototype.toString.call(t.constructor)?t.constructor.prototype:t}},{"./constants":46}],53:[function(t,e,r){"use strict";var n=Object.prototype.toString;e.exports=function(t,e){return Error('"'+n.call(t)+'" is not '+e)}},{}],54:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n=!1;return function(i){switch(!1){case n:n=!0;case i===r:return e=t(r=i)}return e}}},{}],55:[function(t,e,r){"use strict";var n=t("./is-object-like"),i=t("./is-length");e.exports=Array.isArray||function(t){return n(t)&&i(t.length)&&"[object Array]"===Object.prototype.toString.call(t)}},{"./is-length":56,"./is-object-like":57}],56:[function(t,e,r){"use strict";var n=t("./constants").MAX_ARRAY_LENGTH;e.exports=function(t){return"number"==typeof t&&t>=0&&t<=n&&t%1==0}},{"./constants":46}],57:[function(t,e,r){"use strict";e.exports=function(t){return"object"==typeof t&&null!==t}},{}],58:[function(t,e,r){"use strict";var n=t("./is-object-like"),i={}.toString;e.exports=function(t){return n(t)&&"[object Object]"===i.call(t)}},{"./is-object-like":57}],59:[function(t,e,r){"use strict";var n=t("./get-prototype-of"),i=t("./is-object"),o=Object.prototype.hasOwnProperty,s=Function.prototype.toString,a=s.call(Object);e.exports=function(t){var e,r;return!!i(t)&&(null===(e=n(t))||!!o.call(e,"constructor")&&("function"==typeof(r=e.constructor)&&s.call(r)===a))}},{"./get-prototype-of":52,"./is-object":58}],60:[function(t,e,r){"use strict";var n=t("./support/support-keys"),i=t("./to-object");e.exports="es2015"!==n?function(t){return Object.keys(i(t))}:Object.keys},{"./support/support-keys":64,"./to-object":67}],61:[function(t,e,r){"use strict";var n=t("./internal/memoize"),i=t("./is-plain-object"),o=t("./to-object"),s=t("./keys"),a=n(t("./is-array"));e.exports=function t(e,r){var n,c,f,u,h,l,d=arguments.length,p=2;for("boolean"!=typeof e&&(r=e,e=!0,p=1),r=o(r);p<d;++p)if(n=arguments[p])for(u=0,h=(l=s(n)).length;u<h;++u)f=n[l[u]],e&&i(f)||a(f)?(c=r[l[u]],a(f)?a(c)||(c=[]):i(c)||(c={}),r[l[u]]=t(!0,c,f)):r[l[u]]=f;return r}},{"./internal/memoize":54,"./is-array":55,"./is-plain-object":59,"./keys":60,"./to-object":67}],62:[function(t,e,r){"use strict";e.exports=function(){}},{}],63:[function(t,e,r){"use strict";var n=t("./before");e.exports=function(t){return n(1,t)}},{"./before":44}],64:[function(t,e,r){"use strict";try{e.exports=Object.keys("")}catch(t){e.exports="es5"}},{}],65:[function(t,e,r){"use strict";var n,i,o=t("./timestamp");if("undefined"!=typeof self&&(i=self.cancelAnimationFrame||self.webkitCancelAnimationFrame||self.webkitCancelRequestAnimationFrame||self.mozCancelAnimationFrame||self.mozCancelRequestAnimationFrame,n=self.requestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame),!n||!i||"undefined"!=typeof navigator&&/iP(ad|hone|od).*OS\s6/.test(navigator.userAgent)){var s=0;r.request=function(t){var e=o(),r=Math.max(s+1e3/60,e);return setTimeout(function(){s=r,t(e)},r-e)},r.cancel=clearTimeout}else r.request=function(t){return n(t)},r.cancel=function(t){return i(t)}},{"./timestamp":66}],66:[function(t,e,r){"use strict";var n;"undefined"!=typeof performance&&performance.now?e.exports=function(){return performance.now()}:(n=Date.now(),e.exports=function(){return Date.now()-n})},{}],67:[function(t,e,r){"use strict";var n=t("./constants").ERR;e.exports=function(t){if(null===t||void 0===t)throw TypeError(n.UNDEFINED_OR_NULL);return Object(t)}},{"./constants":46}]},{},[42]);