tummie-engine
Version:
JavaScript HTML5 game engine
14 lines • 251 kB
JavaScript
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var i in r)("object"==typeof exports?exports:t)[i]=r[i]}}(this,function(){return webpackJsonp([1],[function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t["default"]:t}Object.defineProperty(e,"__esModule",{value:!0});var n=r(54);e.renderer=i(n)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(55),s=i(n),o=r(1),a=i(o),h=a["default"].plugin({init:function(){var t=this,e=s["default"].autoDetectRenderer(this.width,this.height,{transparent:!0});this.container.appendChild(e.view),this.update=function(r){r.scale.x=r.scale.y=t.scale,e.render(r)},this.dispose=function(){window.removeEventListener("resize",t.rescale),e.destroy(!0),e=null,t.scale=null,t.container=null,t.width=t.height=null},this.rescale=function(){var r=t.height/t.width;t.container.clientHeight/t.container.clientWidth<r?(e.view.style.height="100%",e.view.style.width="auto"):(e.view.style.width="100%",e.view.style.height="auto"),t.scale=Math.min(e.view.width/t.width,e.view.height/t.height),e.resize(Math.ceil(t.width*t.scale),Math.ceil(t.height*t.scale))},window.addEventListener("resize",this.rescale,!1),this.rescale()},props:{container:document.body,name:"renderer",width:1600,height:900,scale:null}});e["default"]=h,t.exports=e["default"]},function(t,e,r){(function(e){r(56);var i=t.exports=r(61);i.extras=r(124),i.filters=r(131),i.interaction=r(159),i.loaders=r(163),i.mesh=r(182),i.loader=new i.loaders.Loader,Object.assign(i,r(187)),e.PIXI=i}).call(e,function(){return this}())},function(t,e,r){r(57),r(59),r(60)},function(t,e,r){Object.assign||(Object.assign=r(58))},function(t,e){"use strict";function r(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var i=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(t,e){for(var s,o,a=r(t),h=1;h<arguments.length;h++){s=Object(arguments[h]);for(var u in s)i.call(s,u)&&(a[u]=s[u]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(s);for(var l=0;l<o.length;l++)n.call(s,o[l])&&(a[o[l]]=s[o[l]])}}return a}},function(t,e){(function(t){if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var r=Date.now(),i=["ms","moz","webkit","o"],n=0;n<i.length&&!t.requestAnimationFrame;++n)t.requestAnimationFrame=t[i[n]+"RequestAnimationFrame"],t.cancelAnimationFrame=t[i[n]+"CancelAnimationFrame"]||t[i[n]+"CancelRequestAnimationFrame"];t.requestAnimationFrame||(t.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),i=16+r-e;return 0>i&&(i=0),r=e,setTimeout(function(){r=Date.now(),t(performance.now())},i)}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}).call(e,function(){return this}())},function(t,e){Math.sign||(Math.sign=function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1})},function(t,e,r){/**
* @file Main export of the PIXI core library
* @author Mat Groves <mat@goodboydigital.com>
* @copyright 2013-2015 GoodBoyDigital
* @license {@link https://github.com/pixijs/pixi.js/blob/master/LICENSE|MIT License}
*/
var i=t.exports=Object.assign(r(62),r(64),{utils:r(72),ticker:r(78),DisplayObject:r(80),Container:r(92),Sprite:r(93),ParticleContainer:r(95),SpriteRenderer:r(96),ParticleRenderer:r(112),Text:r(115),Graphics:r(116),GraphicsData:r(118),GraphicsRenderer:r(119),Texture:r(83),BaseTexture:r(82),RenderTexture:r(81),VideoBaseTexture:r(84),TextureUvs:r(85),CanvasRenderer:r(122),CanvasGraphics:r(117),CanvasBuffer:r(91),WebGLRenderer:r(98),ShaderManager:r(100),Shader:r(102),ObjectRenderer:r(97),RenderTarget:r(86),AbstractFilter:r(107),FXAAFilter:r(111),SpriteMaskFilter:r(106),autoDetectRenderer:function(t,e,r,n){return t=t||800,e=e||600,!n&&i.utils.isWebGLSupported()?new i.WebGLRenderer(t,e,r):new i.CanvasRenderer(t,e,r)}})},function(t,e,r){var i={VERSION:r(63).version,PI_2:2*Math.PI,RAD_TO_DEG:180/Math.PI,DEG_TO_RAD:Math.PI/180,TARGET_FPMS:.06,RENDERER_TYPE:{UNKNOWN:0,WEBGL:1,CANVAS:2},BLEND_MODES:{NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},DRAW_MODES:{POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},SCALE_MODES:{DEFAULT:0,LINEAR:0,NEAREST:1},RETINA_PREFIX:/@(.+)x/,RESOLUTION:1,FILTER_RESOLUTION:1,DEFAULT_RENDER_OPTIONS:{view:null,resolution:1,antialias:!1,forceFXAA:!1,autoResize:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,roundPixels:!1},SHAPES:{POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},SPRITE_BATCH_SIZE:2e3};t.exports=i},function(t,e){t.exports={_args:[["pixi.js@^3.0.8","C:\\Users\\Hans\\Desktop\\Tummie Games\\Code\\tummie-engine"]],_from:"pixi.js@>=3.0.8 <4.0.0",_id:"pixi.js@3.0.8",_inCache:!0,_location:"/pixi.js",_nodeVersion:"0.12.4",_npmUser:{email:"englercj@live.com",name:"englercj"},_npmVersion:"2.7.1",_phantomChildren:{},_requested:{name:"pixi.js",raw:"pixi.js@^3.0.8",rawSpec:"^3.0.8",scope:null,spec:">=3.0.8 <4.0.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/pixi.js/-/pixi.js-3.0.8.tgz",_shasum:"259dbe9739957587f160417dce7df9e1c5e47521",_shrinkwrap:null,_spec:"pixi.js@^3.0.8",_where:"C:\\Users\\Hans\\Desktop\\Tummie Games\\Code\\tummie-engine",author:{name:"Mat Groves"},browserify:{transform:["brfs"]},bugs:{url:"https://github.com/pixijs/pixi.js/issues"},contributors:[{name:"Chad Engler",email:"chad@pantherdev.com"},{name:"Richard Davey",email:"rdavey@gmail.com"}],dependencies:{async:"^1.4.2",brfs:"^1.4.1",earcut:"^2.0.2",eventemitter3:"^1.1.1","gulp-header":"^1.7.1","object-assign":"^4.0.1","resource-loader":"^1.6.2"},description:"Pixi.js is a fast lightweight 2D library that works across all devices.",devDependencies:{browserify:"^11.1.0",chai:"^3.2.0",del:"^2.0.2",gulp:"^3.9.0","gulp-cached":"^1.1.0","gulp-concat":"^2.6.0","gulp-debug":"^2.1.0","gulp-jshint":"^1.11.2","gulp-mirror":"^0.4.0","gulp-plumber":"^1.0.1","gulp-rename":"^1.2.2","gulp-sourcemaps":"^1.5.2","gulp-uglify":"^1.4.1","gulp-util":"^3.0.6","jaguarjs-jsdoc":"git+https://github.com/davidshimjs/jaguarjs-jsdoc.git",jsdoc:"^3.3.2","jshint-summary":"^0.4.0",minimist:"^1.2.0",mocha:"^2.3.2","require-dir":"^0.3.0","run-sequence":"^1.1.2",testem:"^0.9.4","vinyl-buffer":"^1.0.0","vinyl-source-stream":"^1.1.0",watchify:"^3.4.0"},directories:{},dist:{shasum:"259dbe9739957587f160417dce7df9e1c5e47521",tarball:"http://registry.npmjs.org/pixi.js/-/pixi.js-3.0.8.tgz"},files:["CONTRIBUTING.md","LICENSE","README.md","bin/","package.json","src/"],gitHead:"5d385885324e97369fd29b686e9e90eb4cefd14a",homepage:"http://goodboydigital.com/",installable:!0,license:"MIT",main:"./src/index.js",maintainers:[{name:"englercj",email:"englercj@live.com"}],name:"pixi.js",optionalDependencies:{},repository:{type:"git",url:"https://github.com/pixijs/pixi.js.git"},scripts:{build:"gulp",docs:"jsdoc -c ./gulp/util/jsdoc.conf.json -R README.md",start:"gulp && gulp watch",test:"gulp && testem ci"},version:"3.0.8"}},function(t,e,r){t.exports={Point:r(65),Matrix:r(66),Circle:r(67),Ellipse:r(69),Polygon:r(70),Rectangle:r(68),RoundedRectangle:r(71)}},function(t,e){function r(t,e){this.x=t||0,this.y=e||0}r.prototype.constructor=r,t.exports=r,r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.copy=function(t){this.set(t.x,t.y)},r.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},r.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)}},function(t,e,r){function i(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0}var n=r(65);i.prototype.constructor=i,t.exports=i,i.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},i.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},i.prototype.apply=function(t,e){e=e||new n;var r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e},i.prototype.applyInverse=function(t,e){e=e||new n;var r=1/(this.a*this.d+this.c*-this.b),i=t.x,s=t.y;return e.x=this.d*r*i+-this.c*r*s+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*s+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e},i.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},i.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},i.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),i=this.a,n=this.c,s=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=s*e-this.ty*r,this.ty=s*r+this.ty*e,this},i.prototype.append=function(t){var e=this.a,r=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this},i.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,i=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},i.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,i=this.d,n=this.tx,s=t*i-e*r;return this.a=i/s,this.b=-e/s,this.c=-r/s,this.d=t/s,this.tx=(r*this.ty-i*n)/s,this.ty=-(t*this.ty-e*n)/s,this},i.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},i.prototype.clone=function(){var t=new i;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},i.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},i.IDENTITY=new i,i.TEMP_MATRIX=new i},function(t,e,r){function i(t,e,r){this.x=t||0,this.y=e||0,this.radius=r||0,this.type=s.SHAPES.CIRC}var n=r(68),s=r(62);i.prototype.constructor=i,t.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.radius)},i.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.x-t,i=this.y-e,n=this.radius*this.radius;return r*=r,i*=i,n>=r+i},i.prototype.getBounds=function(){return new n(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}},function(t,e,r){function i(t,e,r,i){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.type=n.SHAPES.RECT}var n=r(62);i.prototype.constructor=i,t.exports=i,i.EMPTY=new i(0,0,0,0),i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height?!0:!1}},function(t,e,r){function i(t,e,r,i){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.type=s.SHAPES.ELIP}var n=r(68),s=r(62);i.prototype.constructor=i,t.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,i=(e-this.y)/this.height;return r*=r,i*=i,1>=r+i},i.prototype.getBounds=function(){return new n(this.x-this.width,this.y-this.height,this.width,this.height)}},function(t,e,r){function i(t){var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;r<e.length;++r)e[r]=arguments[r]}if(e[0]instanceof n){for(var i=[],o=0,a=e.length;a>o;o++)i.push(e[o].x,e[o].y);e=i}this.closed=!0,this.points=e,this.type=s.SHAPES.POLY}var n=r(65),s=r(62);i.prototype.constructor=i,t.exports=i,i.prototype.clone=function(){return new i(this.points.slice())},i.prototype.contains=function(t,e){for(var r=!1,i=this.points.length/2,n=0,s=i-1;i>n;s=n++){var o=this.points[2*n],a=this.points[2*n+1],h=this.points[2*s],u=this.points[2*s+1],l=a>e!=u>e&&(h-o)*(e-a)/(u-a)+o>t;l&&(r=!r)}return r}},function(t,e,r){function i(t,e,r,i,s){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.radius=s||20,this.type=n.SHAPES.RREC}var n=r(62);i.prototype.constructor=i,t.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.radius)},i.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height?!0:!1}},function(t,e,r){var i=r(62),n=t.exports={_uid:0,_saidHello:!1,EventEmitter:r(73),pluginTarget:r(74),async:r(75),uid:function(){return++n._uid},hex2rgb:function(t,e){return e=e||[],e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},hex2string:function(t){return t=t.toString(16),t="000000".substr(0,6-t.length)+t,"#"+t},rgb2hex:function(t){return(255*t[0]<<16)+(255*t[1]<<8)+255*t[2]},canUseNewCanvasBlendModes:function(){if("undefined"==typeof document)return!1;var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",e="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",r=new Image;r.src=t+"AP804Oa6"+e;var i=new Image;i.src=t+"/wCKxvRF"+e;var n=document.createElement("canvas");n.width=6,n.height=1;var s=n.getContext("2d");s.globalCompositeOperation="multiply",s.drawImage(r,0,0),s.drawImage(i,2,0);var o=s.getImageData(2,0,1,1).data;return 255===o[0]&&0===o[1]&&0===o[2]},getNextPowerOfTwo:function(t){if(t>0&&0===(t&t-1))return t;for(var e=1;t>e;)e<<=1;return e},isPowerOfTwo:function(t,e){return t>0&&0===(t&t-1)&&e>0&&0===(e&e-1)},getResolutionOfUrl:function(t){var e=i.RETINA_PREFIX.exec(t);return e?parseFloat(e[1]):1},sayHello:function(t){if(!n._saidHello){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c Pixi.js "+i.VERSION+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("Pixi.js "+i.VERSION+" - "+t+" - http://www.pixijs.com/");n._saidHello=!0}},isWebGLSupported:function(){var t={stencil:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);return!(!r||!r.getContextAttributes().stencil)}catch(i){return!1}},sign:function(t){return t?0>t?-1:1:0},TextureCache:{},BaseTextureCache:{}}},function(t,e,r){"use strict";function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function n(){}var s="function"!=typeof Object.create?"~":!1;n.prototype._events=void 0,n.prototype.listeners=function(t,e){var r=s?s+t:t,i=this._events&&this._events[r];if(e)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,a=new Array(o);o>n;n++)a[n]=i[n].fn;return a},n.prototype.emit=function(t,e,r,i,n,o){var a=s?s+t:t;if(!this._events||!this._events[a])return!1;var h,u,l=this._events[a],c=arguments.length;if("function"==typeof l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,n),!0;case 6:return l.fn.call(l.context,e,r,i,n,o),!0}for(u=1,h=new Array(c-1);c>u;u++)h[u-1]=arguments[u];l.fn.apply(l.context,h)}else{var p,f=l.length;for(u=0;f>u;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,r);break;default:if(!h)for(p=1,h=new Array(c-1);c>p;p++)h[p-1]=arguments[p];l[u].fn.apply(l[u].context,h)}}return!0},n.prototype.on=function(t,e,r){var n=new i(e,r||this),o=s?s+t:t;return this._events||(this._events=s?{}:Object.create(null)),this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],n]:this._events[o].push(n):this._events[o]=n,this},n.prototype.once=function(t,e,r){var n=new i(e,r||this,!0),o=s?s+t:t;return this._events||(this._events=s?{}:Object.create(null)),this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],n]:this._events[o].push(n):this._events[o]=n,this},n.prototype.removeListener=function(t,e,r,i){var n=s?s+t:t;if(!this._events||!this._events[n])return this;var o=this._events[n],a=[];if(e)if(o.fn)(o.fn!==e||i&&!o.once||r&&o.context!==r)&&a.push(o);else for(var h=0,u=o.length;u>h;h++)(o[h].fn!==e||i&&!o[h].once||r&&o[h].context!==r)&&a.push(o[h]);return a.length?this._events[n]=1===a.length?a[0]:a:delete this._events[n],this},n.prototype.removeAllListeners=function(t){return this._events?(t?delete this._events[s?s+t:t]:this._events=s?{}:Object.create(null),this):this},n.prototype.off=n.prototype.removeListener,n.prototype.addListener=n.prototype.on,n.prototype.setMaxListeners=function(){return this},n.prefixed=s,t.exports=n},function(t,e){function r(t){t.__plugins={},t.registerPlugin=function(e,r){t.__plugins[e]=r},t.prototype.initPlugins=function(){this.plugins=this.plugins||{};for(var e in t.__plugins)this.plugins[e]=new t.__plugins[e](this)},t.prototype.destroyPlugins=function(){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;this.plugins=null}}t.exports={mixin:function(t){r(t)}}},function(t,e,r){var i,n;(function(r,s,o){/*!
* async
* https://github.com/caolan/async
*
* Copyright 2010-2014 Caolan McMahon
* Released under the MIT license
*/
!function(){function a(){}function h(t){return t}function u(t){return!!t}function l(t){return!t}function c(t){return function(){if(null===t)throw new Error("Callback was already called.");t.apply(this,arguments),t=null}}function p(t){return function(){null!==t&&(t.apply(this,arguments),t=null)}}function f(t){return z(t)||"number"==typeof t.length&&t.length>=0&&t.length%1===0}function d(t,e){for(var r=-1,i=t.length;++r<i;)e(t[r],r,t)}function y(t,e){for(var r=-1,i=t.length,n=Array(i);++r<i;)n[r]=e(t[r],r,t);return n}function g(t){return y(Array(t),function(t,e){return e})}function v(t,e,r){return d(t,function(t,i,n){r=e(r,t,i,n)}),r}function m(t,e){d(H(t),function(r){e(t[r],r)})}function x(t,e){for(var r=0;r<t.length;r++)if(t[r]===e)return r;return-1}function _(t){var e,r,i=-1;return f(t)?(e=t.length,function(){return i++,e>i?i:null}):(r=H(t),e=r.length,function(){return i++,e>i?r[i]:null})}function b(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),i=Array(r),n=0;r>n;n++)i[n]=arguments[n+e];switch(e){case 0:return t.call(this,i);case 1:return t.call(this,arguments[0],i)}}}function E(t){return function(e,r,i){return t(e,i)}}function T(t){return function(e,r,i){i=p(i||a),e=e||[];var n=_(e);if(0>=t)return i(null);var s=!1,o=0,h=!1;!function u(){if(s&&0>=o)return i(null);for(;t>o&&!h;){var a=n();if(null===a)return s=!0,void(0>=o&&i(null));o+=1,r(e[a],a,c(function(t){o-=1,t?(i(t),h=!0):u()}))}}()}}function w(t){return function(e,r,i){return t(j.eachOf,e,r,i)}}function S(t){return function(e,r,i,n){return t(T(r),e,i,n)}}function A(t){return function(e,r,i){return t(j.eachOfSeries,e,r,i)}}function R(t,e,r,i){i=p(i||a),e=e||[];var n=f(e)?[]:{};t(e,function(t,e,i){r(t,function(t,r){n[e]=r,i(t)})},function(t){i(t,n)})}function M(t,e,r,i){var n=[];t(e,function(t,e,i){r(t,function(r){r&&n.push({index:e,value:t}),i()})},function(){i(y(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})}function O(t,e,r,i){M(t,e,function(t,e){r(t,function(t){e(!t)})},i)}function P(t,e,r){return function(i,n,s,o){function a(){o&&o(r(!1,void 0))}function h(t,i,n){return o?void s(t,function(i){o&&e(i)&&(o(r(!0,t)),o=s=!1),n()}):n()}arguments.length>3?t(i,n,h,a):(o=s,s=n,t(i,h,a))}}function C(t,e){return e}function D(t,e,r){r=r||a;var i=f(e)?[]:{};t(e,function(t,e,r){t(b(function(t,n){n.length<=1&&(n=n[0]),i[e]=n,r(t)}))},function(t){r(t,i)})}function F(t,e,r,i){var n=[];t(e,function(t,e,i){r(t,function(t,e){n=n.concat(e||[]),i(t)})},function(t){i(t,n)})}function L(t,e,r){function i(t,e,r,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");return t.started=!0,z(e)||(e=[e]),0===e.length&&t.idle()?j.setImmediate(function(){t.drain()}):(d(e,function(e){var n={data:e,callback:i||a};r?t.tasks.unshift(n):t.tasks.push(n),t.tasks.length===t.concurrency&&t.saturated()}),void j.setImmediate(t.process))}function n(t,e){return function(){s-=1;var r=!1,i=arguments;d(e,function(t){d(o,function(e,i){e!==t||r||(o.splice(i,1),r=!0)}),t.callback.apply(t,i)}),t.tasks.length+s===0&&t.drain(),t.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var s=0,o=[],h={tasks:[],concurrency:e,payload:r,saturated:a,empty:a,drain:a,started:!1,paused:!1,push:function(t,e){i(h,t,!1,e)},kill:function(){h.drain=a,h.tasks=[]},unshift:function(t,e){i(h,t,!0,e)},process:function(){if(!h.paused&&s<h.concurrency&&h.tasks.length)for(;s<h.concurrency&&h.tasks.length;){var e=h.payload?h.tasks.splice(0,h.payload):h.tasks.splice(0,h.tasks.length),r=y(e,function(t){return t.data});0===h.tasks.length&&h.empty(),s+=1,o.push(e[0]);var i=c(n(h,e));t(r,i)}},length:function(){return h.tasks.length},running:function(){return s},workersList:function(){return o},idle:function(){return h.tasks.length+s===0},pause:function(){h.paused=!0},resume:function(){if(h.paused!==!1){h.paused=!1;for(var t=Math.min(h.concurrency,h.tasks.length),e=1;t>=e;e++)j.setImmediate(h.process)}}};return h}function B(t){return b(function(e,r){e.apply(null,r.concat([b(function(e,r){"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&d(r,function(e){console[t](e)}))})]))})}function I(t){return function(e,r,i){t(g(e),r,i)}}function N(t){return b(function(e,r){var i=b(function(r){var i=this,n=r.pop();return t(e,function(t,e,n){t.apply(i,r.concat([n]))},n)});return r.length?i.apply(this,r):i})}function U(t){return b(function(e){var r=e.pop();e.push(function(){var t=arguments;i?j.setImmediate(function(){r.apply(null,t)}):r.apply(null,t)});var i=!0;t.apply(this,e),i=!1})}var k,j={},Y="object"==typeof self&&self.self===self&&self||"object"==typeof r&&r.global===r&&r||this;null!=Y&&(k=Y.async),j.noConflict=function(){return Y.async=k,j};var X=Object.prototype.toString,z=Array.isArray||function(t){return"[object Array]"===X.call(t)},G=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},H=Object.keys||function(t){var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e},W="function"==typeof s&&s,q=W?function(t){W(t)}:function(t){setTimeout(t,0)};"object"==typeof o&&"function"==typeof o.nextTick?j.nextTick=o.nextTick:j.nextTick=q,j.setImmediate=W?q:j.nextTick,j.forEach=j.each=function(t,e,r){return j.eachOf(t,E(e),r)},j.forEachSeries=j.eachSeries=function(t,e,r){return j.eachOfSeries(t,E(e),r)},j.forEachLimit=j.eachLimit=function(t,e,r,i){return T(e)(t,E(r),i)},j.forEachOf=j.eachOf=function(t,e,r){function i(t){o--,t?r(t):null===n&&0>=o&&r(null)}r=p(r||a),t=t||[];for(var n,s=_(t),o=0;null!=(n=s());)o+=1,e(t[n],n,c(i));0===o&&r(null)},j.forEachOfSeries=j.eachOfSeries=function(t,e,r){function i(){var o=!0;return null===s?r(null):(e(t[s],s,c(function(t){if(t)r(t);else{if(s=n(),null===s)return r(null);o?j.setImmediate(i):i()}})),void(o=!1))}r=p(r||a),t=t||[];var n=_(t),s=n();i()},j.forEachOfLimit=j.eachOfLimit=function(t,e,r,i){T(e)(t,r,i)},j.map=w(R),j.mapSeries=A(R),j.mapLimit=S(R),j.inject=j.foldl=j.reduce=function(t,e,r,i){j.eachOfSeries(t,function(t,i,n){r(e,t,function(t,r){e=r,n(t)})},function(t){i(t,e)})},j.foldr=j.reduceRight=function(t,e,r,i){var n=y(t,h).reverse();j.reduce(n,e,r,i)},j.transform=function(t,e,r,i){3===arguments.length&&(i=r,r=e,e=z(t)?[]:{}),j.eachOf(t,function(t,i,n){r(e,t,i,n)},function(t){i(t,e)})},j.select=j.filter=w(M),j.selectLimit=j.filterLimit=S(M),j.selectSeries=j.filterSeries=A(M),j.reject=w(O),j.rejectLimit=S(O),j.rejectSeries=A(O),j.any=j.some=P(j.eachOf,u,h),j.someLimit=P(j.eachOfLimit,u,h),j.all=j.every=P(j.eachOf,l,l),j.everyLimit=P(j.eachOfLimit,l,l),j.detect=P(j.eachOf,h,C),j.detectSeries=P(j.eachOfSeries,h,C),j.detectLimit=P(j.eachOfLimit,h,C),j.sortBy=function(t,e,r){function i(t,e){var r=t.criteria,i=e.criteria;return i>r?-1:r>i?1:0}j.map(t,function(t,r){e(t,function(e,i){e?r(e):r(null,{value:t,criteria:i})})},function(t,e){return t?r(t):void r(null,y(e.sort(i),function(t){return t.value}))})},j.auto=function(t,e,r){function i(t){c.unshift(t)}function n(t){var e=x(c,t);e>=0&&c.splice(e,1)}function s(){h--,d(c.slice(0),function(t){t()})}r||(r=e,e=null),r=p(r||a);var o=H(t),h=o.length;if(!h)return r(null);e||(e=h);var u={},l=0,c=[];i(function(){h||r(null,u)}),d(o,function(o){function a(){return e>l&&v(d,function(t,e){return t&&u.hasOwnProperty(e)},!0)&&!u.hasOwnProperty(o)}function h(){a()&&(l++,n(h),p[p.length-1](f,u))}for(var c,p=z(t[o])?t[o]:[t[o]],f=b(function(t,e){if(l--,e.length<=1&&(e=e[0]),t){var i={};m(u,function(t,e){i[e]=t}),i[o]=e,r(t,i)}else u[o]=e,j.setImmediate(s)}),d=p.slice(0,p.length-1),y=d.length;y--;){if(!(c=t[d[y]]))throw new Error("Has inexistant dependency");if(z(c)&&x(c,o)>=0)throw new Error("Has cyclic dependencies")}a()?(l++,p[p.length-1](f,u)):i(h)})},j.retry=function(t,e,r){function i(t,e){if("number"==typeof e)t.times=parseInt(e,10)||s;else{if("object"!=typeof e)throw new Error("Unsupported argument type for 'times': "+typeof e);t.times=parseInt(e.times,10)||s,t.interval=parseInt(e.interval,10)||o}}function n(t,e){function r(t,r){return function(i){t(function(t,e){i(!t||r,{err:t,result:e})},e)}}function i(t){return function(e){setTimeout(function(){e(null)},t)}}for(;h.times;){var n=!(h.times-=1);a.push(r(h.task,n)),!n&&h.interval>0&&a.push(i(h.interval))}j.series(a,function(e,r){r=r[r.length-1],(t||h.callback)(r.err,r.result)})}var s=5,o=0,a=[],h={times:s,interval:o},u=arguments.length;if(1>u||u>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=u&&"function"==typeof t&&(r=e,e=t),"function"!=typeof t&&i(h,t),h.callback=r,h.task=e,h.callback?n():n},j.waterfall=function(t,e){function r(t){return b(function(i,n){if(i)e.apply(null,[i].concat(n));else{var s=t.next();s?n.push(r(s)):n.push(e),U(t).apply(null,n)}})}if(e=p(e||a),!z(t)){var i=new Error("First argument to waterfall must be an array of functions");return e(i)}return t.length?void r(j.iterator(t))():e()},j.parallel=function(t,e){D(j.eachOf,t,e)},j.parallelLimit=function(t,e,r){D(T(e),t,r)},j.series=function(t,e){D(j.eachOfSeries,t,e)},j.iterator=function(t){function e(r){function i(){return t.length&&t[r].apply(null,arguments),i.next()}return i.next=function(){return r<t.length-1?e(r+1):null},i}return e(0)},j.apply=b(function(t,e){return b(function(r){return t.apply(null,e.concat(r))})}),j.concat=w(F),j.concatSeries=A(F),j.whilst=function(t,e,r){if(r=r||a,t()){var i=b(function(n,s){n?r(n):t.apply(this,s)?e(i):r(null)});e(i)}else r(null)},j.doWhilst=function(t,e,r){var i=0;return j.whilst(function(){return++i<=1||e.apply(this,arguments)},t,r)},j.until=function(t,e,r){return j.whilst(function(){return!t.apply(this,arguments)},e,r)},j.doUntil=function(t,e,r){return j.doWhilst(t,function(){return!e.apply(this,arguments)},r)},j.during=function(t,e,r){r=r||a;var i=b(function(e,i){e?r(e):(i.push(n),t.apply(this,i))}),n=function(t,n){t?r(t):n?e(i):r(null)};t(n)},j.doDuring=function(t,e,r){var i=0;j.during(function(t){i++<1?t(null,!0):e.apply(this,arguments)},t,r)},j.queue=function(t,e){var r=L(function(e,r){t(e[0],r)},e,1);return r},j.priorityQueue=function(t,e){function r(t,e){return t.priority-e.priority}function i(t,e,r){for(var i=-1,n=t.length-1;n>i;){var s=i+(n-i+1>>>1);r(e,t[s])>=0?i=s:n=s-1}return i}function n(t,e,n,s){if(null!=s&&"function"!=typeof s)throw new Error("task callback must be a function");return t.started=!0,z(e)||(e=[e]),0===e.length?j.setImmediate(function(){t.drain()}):void d(e,function(e){var o={data:e,priority:n,callback:"function"==typeof s?s:a};t.tasks.splice(i(t.tasks,o,r)+1,0,o),t.tasks.length===t.concurrency&&t.saturated(),j.setImmediate(t.process)})}var s=j.queue(t,e);return s.push=function(t,e,r){n(s,t,e,r)},delete s.unshift,s},j.cargo=function(t,e){return L(t,1,e)},j.log=B("log"),j.dir=B("dir"),j.memoize=function(t,e){var r={},i={};e=e||h;var n=b(function(n){var s=n.pop(),o=e.apply(null,n);o in r?j.setImmediate(function(){s.apply(null,r[o])}):o in i?i[o].push(s):(i[o]=[s],t.apply(null,n.concat([b(function(t){r[o]=t;var e=i[o];delete i[o];for(var n=0,s=e.length;s>n;n++)e[n].apply(null,t)})])))});return n.memo=r,n.unmemoized=t,n},j.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},j.times=I(j.map),j.timesSeries=I(j.mapSeries),j.timesLimit=function(t,e,r,i){return j.mapLimit(g(t),e,r,i)},j.seq=function(){var t=arguments;return b(function(e){var r=this,i=e[e.length-1];"function"==typeof i?e.pop():i=a,j.reduce(t,e,function(t,e,i){e.apply(r,t.concat([b(function(t,e){i(t,e)})]))},function(t,e){i.apply(r,[t].concat(e))})})},j.compose=function(){return j.seq.apply(null,Array.prototype.reverse.call(arguments))},j.applyEach=N(j.eachOf),j.applyEachSeries=N(j.eachOfSeries),j.forever=function(t,e){function r(t){return t?i(t):void n(r)}var i=c(e||a),n=U(t);r()},j.ensureAsync=U,j.constant=b(function(t){var e=[null].concat(t);return function(t){return t.apply(this,e)}}),j.wrapSync=j.asyncify=function(t){return b(function(e){var r,i=e.pop();try{r=t.apply(this,e)}catch(n){return i(n)}G(r)&&"function"==typeof r.then?r.then(function(t){i(null,t)})["catch"](function(t){i(t.message?t:new Error(t))}):i(null,r)})},"object"==typeof t&&t.exports?t.exports=j:(i=[],n=function(){return j}.apply(e,i),!(void 0!==n&&(t.exports=n)))}()}).call(e,function(){return this}(),r(76).setImmediate,r(77))},function(t,e,r){(function(t,i){function n(t,e){this._id=t,this._clearFn=e}var s=r(77).nextTick,o=Function.prototype.apply,a=Array.prototype.slice,h={},u=0;e.setTimeout=function(){return new n(o.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new n(o.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t.close()},n.prototype.unref=n.prototype.ref=function(){},n.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},e.setImmediate="function"==typeof t?t:function(t){var r=u++,i=arguments.length<2?!1:a.call(arguments,1);return h[r]=!0,s(function(){h[r]&&(i?t.apply(null,i):t.call(null),e.clearImmediate(r))}),r},e.clearImmediate="function"==typeof i?i:function(t){delete h[t]}}).call(e,r(76).setImmediate,r(76).clearImmediate)},function(t,e){function r(){u=!1,o.length?h=o.concat(h):l=-1,h.length&&i()}function i(){if(!u){var t=setTimeout(r);u=!0;for(var e=h.length;e;){for(o=h,h=[];++l<e;)o&&o[l].run();l=-1,e=h.length}o=null,u=!1,clearTimeout(t)}}function n(t,e){this.fun=t,this.array=e}function s(){}var o,a=t.exports={},h=[],u=!1,l=-1;a.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];h.push(new n(t,e)),1!==h.length||u||setTimeout(i,0)},n.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=s,a.addListener=s,a.once=s,a.off=s,a.removeListener=s,a.removeAllListeners=s,a.emit=s,a.binding=function(t){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(t){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(t,e,r){var i=r(79),n=new i;n.autoStart=!0,t.exports={shared:n,Ticker:i}},function(t,e,r){function i(){var t=this;this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._emitter.listeners(o,!0)&&(t._requestId=requestAnimationFrame(t._tick)))},this._emitter=new s,this._requestId=null,this._maxElapsedMS=100,this.autoStart=!1,this.deltaTime=1,this.elapsedMS=1/n.TARGET_FPMS,this.lastTime=0,this.speed=1,this.started=!1}var n=r(62),s=r(73),o="tick";Object.defineProperties(i.prototype,{FPS:{get:function(){return 1e3/this.elapsedMS}},minFPS:{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(Math.max(0,t)/1e3,n.TARGET_FPMS);this._maxElapsedMS=1/e}}}),i.prototype._requestIfNeeded=function(){null===this._requestId&&this._emitter.listeners(o,!0)&&(this.lastTime=performance.now(),this._requestId=requestAnimationFrame(this._tick))},i.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},i.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},i.prototype.add=function(t,e){return this._emitter.on(o,t,e),this._startIfPossible(),this},i.prototype.addOnce=function(t,e){return this._emitter.once(o,t,e),this._startIfPossible(),this},i.prototype.remove=function(t,e){return this._emitter.off(o,t,e),this._emitter.listeners(o,!0)||this._cancelIfNeeded(),this},i.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},i.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},i.prototype.update=function(t){var e;t=t||performance.now(),e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),this.deltaTime=e*n.TARGET_FPMS*this.speed,this._emitter.emit(o,this.deltaTime),this.lastTime=t},t.exports=i},function(t,e,r){function i(){o.call(this),this.position=new n.Point,this.scale=new n.Point(1,1),this.pivot=new n.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this.worldTransform=new n.Matrix,this.filterArea=null,this._sr=0,this._cr=1,this._bounds=new n.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null}var n=r(64),s=r(81),o=r(73),a=r(62),h=new n.Matrix,u={worldTransform:new n.Matrix,worldAlpha:1,children:[]};i.prototype=Object.create(o.prototype),i.prototype.constructor=i,t.exports=i,Object.defineProperties(i.prototype,{x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},worldVisible:{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},mask:{get:function(){return this._mask},set:function(t){this._mask&&(this._mask.renderable=!0),this._mask=t,this._mask&&(this._mask.renderable=!1)}},filters:{get:function(){return this._filters&&this._filters.slice()},set:function(t){this._filters=t&&t.slice()}}}),i.prototype.updateTransform=function(){var t,e,r,i,n,s,o=this.parent.worldTransform,h=this.worldTransform;this.rotation%a.PI_2?(this.rotation!==this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation)),t=this._cr*this.scale.x,e=this._sr*this.scale.x,r=-this._sr*this.scale.y,i=this._cr*this.scale.y,n=this.position.x,s=this.position.y,(this.pivot.x||this.pivot.y)&&(n-=this.pivot.x*t+this.pivot.y*r,s-=this.pivot.x*e+this.pivot.y*i),h.a=t*o.a+e*o.c,h.b=t*o.b+e*o.d,h.c=r*o.a+i*o.c,h.d=r*o.b+i*o.d,h.tx=n*o.a+s*o.c+o.tx,h.ty=n*o.b+s*o.d+o.ty):(t=this.scale.x,i=this.scale.y,n=this.position.x-this.pivot.x*t,s=this.position.y-this.pivot.y*i,h.a=t*o.a,h.b=t*o.b,h.c=i*o.c,h.d=i*o.d,h.tx=n*o.a+s*o.c+o.tx,h.ty=n*o.b+s*o.d+o.ty),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._currentBounds=null},i.prototype.displayObjectUpdateTransform=i.prototype.updateTransform,i.prototype.getBounds=function(t){return n.Rectangle.EMPTY},i.prototype.getLocalBounds=function(){return this.getBounds(n.Matrix.IDENTITY)},i.prototype.toGlobal=function(t){return this.parent?this.displayObjectUpdateTransform():(this.parent=u,this.displayObjectUpdateTransform(),this.parent=null),this.worldTransform.apply(t)},i.prototype.toLocal=function(t,e){return e&&(t=e.toGlobal(t)),this.parent?this.displayObjectUpdateTransform():(this.parent=u,this.displayObjectUpdateTransform(),this.parent=null),this.worldTransform.applyInverse(t)},i.prototype.renderWebGL=function(t){},i.prototype.renderCanvas=function(t){},i.prototype.generateTexture=function(t,e,r){var i=this.getLocalBounds(),n=new s(t,0|i.width,0|i.height,e,r);return h.tx=-i.x,h.ty=-i.y,n.render(this,h),n},i.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},i.prototype.destroy=function(){this.position=null,this.scale=null,this.pivot=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.worldTransform=null,this.filterArea=null}},function(t,e,r){function i(t,e,r,i,c){if(!t)throw new Error("Unable to create RenderTexture, you must pass a renderer into the constructor.");e=e||100,r=r||100,c=c||l.RESOLUTION;var p=new n;if(p.width=e,p.height=r,p.resolution=c,p.scaleMode=i||l.SCALE_MODES.DEFAULT,p.hasLoaded=!0,s.call(this,p,new u.Rectangle(0,0,e,r)),this.width=e,this.height=r,this.resolution=c,this.render=null,this.renderer=t,this.renderer.type===l.RENDERER_TYPE.WEBGL){var f=this.renderer.gl;this.textureBuffer=new o(f,this.width,this.height,p.scaleMode,this.resolution),this.baseTexture._glTextures[f.id]=this.textureBuffer.texture,this.filterManager=new a(this.renderer),this.filterManager.onContextChange(),this.filterManager.resize(e,r),this.render=this.renderWebGL,this.renderer.currentRenderer.start(),this.renderer.currentRenderTarget.activate()}else this.render=this.renderCanvas,this.textureBuffer=new h(this.width*this.resolution,this.height*this.resolution),this.baseTexture.source=this.textureBuffer.canvas;this.valid=!0,this._updateUvs()}var n=r(82),s=r(83),o=r(86),a=r(88),h=r(91),u=r(64),l=r(62),c=new u.Matrix;i.prototype=Object.create(s.prototype),i.prototype.constructor=i,t.exports=i,i.prototype.resize=function(t,e,r){(t!==this.width||e!==this.height)&&(this.valid=t>0&&e>0,this.width=this._frame.width=this.crop.width=t,this.height=this._frame.height=this.crop.height=e,r&&(this.baseTexture.width=this.width,this.baseTexture.height=this.height),this.valid&&(this.textureBuffer.resize(this.width,this.height),this.filterManager&&this.filterManager.resize(this.width,this.height)))},i.prototype.clear=function(){this.valid&&(this.renderer.type===l.RENDERER_TYPE.WEBGL&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear())},i.prototype.renderWebGL=function(t,e,r,i){if(this.valid){if(i=void 0!==i?i:!0,this.textureBuffer.transform=e,this.textureBuffer.activate(),t.worldAlpha=1,i){t.worldTransform.identity(),t.currentBounds=null;var n,s,o=t.children;for(n=0,s=o.length;s>n;++n)o[n].updateTransform()}var a=this.renderer.filterManager;this.renderer.filterManager=this.filterManager,this.renderer.renderDisplayObject(t,this.textureBuffer,r),this.renderer.filterManager=a}},i.prototype.renderCanvas=function(t,e,r,i){if(this.valid){i=!!i;var n=c;n.identity(),e&&n.append(e),t.worldTransform=n;var s=t.worldTransform;t.worldAlpha=1;var o,a,h=t.children;for(o=0,a=h.length;a>o;++o)h[o].updateTransform();r&&this.textureBuffer.clear();var u=this.textureBuffer.context,l=this.renderer.resolution;this.renderer.resolution=this.resolution,this.renderer.renderDisplayObject(t,u),this.renderer.resolution=l,t.worldTransform=s}},i.prototype.destroy=function(){s.prototype.destroy.call(this,!0),this.textureBuffer.destroy(),this.filterManager&&this.filterManager.destroy(),this.renderer=null},i.prototype.getImage=function(){var t=new Image;return t.src=this.getBase64(),t},i.prototype.getBase64=function(){return this.getCanvas().toDataURL()},i.prototype.getCanvas=function(){if(this.renderer.type===l.RENDERER_TYPE.WEBGL){var t=this.renderer.gl,e=this.textureBuffer.size.width,r=this.textureBuffer.size.height,i=new Uint8Array(4*e*r);t.bindFramebuffer(t.FRAMEBUFFER,this.textureBuffer.frameBuffer),t.readPixels(0,0,e,r,t.RGBA,t.UNSIGNED_BYTE,i),t.bindFramebuffer(t.FRAMEBUFFER,null);var n=new h(e,r),s=n.context.getImageData(0,0,e,r);return s.data.set(i),n.context.putImageData(s,0,0),n.canvas}return this.textureBuffer.canvas},i.prototype.getPixels=function(){var t,e;if(this.renderer.type===l.RENDERER_TYPE.WEBGL){var r=this.renderer.gl;t=this.textureBuffer.size.width,e=this.textureBuffer.size.height;var i=new Uint8Array(4*t*e);return r.bindFramebuffer(r.FRAMEBUFFER,this.textureBuffer.frameBuffer),r.readPixels(0,0,t,e,r.RGBA,r.UNSIGNED_BYTE,i),r.bindFramebuffer(r.FRAMEBUFFER,null),i}return t=this.textureBuffer.canvas.width,e=this.textureBuffer.canvas.height,this.textureBuffer.canvas.getContext("2d").getImageData(0,0,t,e).data},i.prototype.getPixel=function(t,e){if(this.renderer.type===l.RENDERER_TYPE.WEBGL){var r=this.renderer.gl,i=new Uint8Array(4);return r.bindFramebuffer(r.FRAMEBUFFER,this.textureBuffer.frameBuffer),r.readPixels(t,e,1,1,r.RGBA,r.UNSIGNED_BYTE,i),r.bindFramebuffer(r.FRAMEBUFFER,null),i}return this.textureBuffer.canvas.getContext("2d").getImageData(t,e,1,1).data}},function(t,e,r){function i(t,e,r){o.call(this),this.uid=n.uid(),this.resolution=r||1,this.width=100,this.height=100,this.realWidth=100,this.realHeight=100,this.scaleMode=e||s.SCALE_MODES.DEFAULT,this.hasLoaded=!1,this.isLoading=!1,this.source=null,this.premultipliedAlpha=!0,this.imageUrl=null,this.isPowerOfTwo=!1,this.mipmap=!1,this._glTextures=[],t&&this.loadSource(t)}var n=r(72),s=r(62),o=r(73);i.prototype=Object.create(o.prototype),i.prototype.constructor=i,t.exports=i,i.prototype.update=function(){this.realWidth=this.source.naturalWidth||this.source.width,this.realHeight=this.source.naturalHeight||this.source.height,this.width=this.realWidth/this.resolution,this.height=this.realHeight/this.resolution,this.isPowerOfTwo=n.isPowerOfTwo(this.realWidth,this.realHeight),this.emit("update",this)},i.prototype.loadSource=function(t){var e=this.isLoading;if(this.hasLoaded=!1,this.isLoading=!1,e&&this.source&&(this.source.onload=null,this.source.onerror=null),this.source=t,(this.source.complete||this.source.getContext)&&this.source.width&&this.source.height)this._sourceLoaded();else if(!t.getContext){this.isLoading=!0;var r=this;t.onload=function(){t.onload=null,t.onerror=null,r.isLoading&&(r.isLoading=!1,r._sourceLoaded(),r.emit("loaded",r))},t.onerror=function(){t.onload=null,t.onerror=null,r.isLoading&&(r.isLoading=!1,r.emit("error",r))},t.complete&&t.src&&(this.isLoading=!1,t.onload=null,t.onerror=null,t.width&&t.height?(this._sourceLoaded(),e&&this.emit("loaded",this)):e&&this.emit("error",this))}},i.prototype._sourceLoaded=function(){this.hasLoaded=!0,this.update()},i.prototype.destroy=function(){this.imageUrl?(delete n.BaseTextureCache[this.imageUrl],delete n.TextureCache[this.imageUrl],this.imageUrl=null,navigator.isCocoonJS||(this.source.src="")):this.source&&this.source._pixiId&&delete n.BaseTextureCache[this.source._pixiId],this.source=null,this.dispose()},i.prototype.dispose=function(){this.emit("dispose",this),this._glTextures.length=0},i.prototype.updateSourceImage=function(t){this.source.src=t,this.loadSource(this.source)},i.fromImage=function(t,e,r){var s=n.BaseTextureCache[t];if(void 0===e&&0!==t.indexOf("data:")&&(e=!0),!s){var o=new Image;e&&(o.crossOrigin=""),s=new i(o,r),s.imageUrl=t,o.src=t,n.BaseTextureCache[t]=s,s.resolution=n.getResolutionOfUrl(t)}return s},i.fromCanvas=function(t,e){t._pixiId||(t._pixiId="canvas_"+n.uid());var r=n.BaseTextureCache[t._pixiId];return r||(r=new i(t,e),n.BaseTextureCache[t._pixiId]=r),r}},function(t,e,r){function i(t,e,r,n,s){a.call(this),this.noFrame=!1,e||(this.noFrame=!0,e=new h.Rectangle(0,0,1,1)),t instanceof i&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=n,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.width=0,this.height=0,this.crop=r||e,this.rotate=!!s,t.hasLoaded?(this.noFrame&&(e=new h.Rectangle(0,0,t.width,t.height),t.on("update",this.onBaseTextureUpdated,this)),this.frame=e):t.once("loaded",this.onBaseTextureLoaded,this)}var n=r(82),s=r(84),o=r(85),a=r(73),h=r(64),u=r(72);i.prototype=Object.create(a.prototype),i.prototype.constructor=i,t.exports=i,Object.defineProperties(i.prototype,{frame:{get:function(){return this._frame},set:function(t){if(this._frame=t,this.noFrame=!1,this.width=t.width,this.height=t.height,!this.trim&&!this.rotate&&(t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height))throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=t&&t.width&&t.height&&this.baseTexture.hasLoaded,this.trim?(this.width=this.trim.width,this.height=this.trim.height,this._frame.width=this.trim.width,this._frame.height=this.trim.height):this.crop=t,this.valid&&this._updateUvs()}}}),i.prototype.update=function(){this.baseTexture.update()},i.prototype.onBaseTextureLoaded=function(t){this.noFrame?this.frame=new h.Rectangle(0,0,t.width,t.height):this.frame=this._frame,this.emit("update",this)},i.prototype.onBaseTextureUpdated=function(t){this._frame.width=t.width,this._frame.height=t.height,this.emit("update",this)},i.prototype.destroy=function(t){this.baseTexture&&(t&&this.baseTexture.destroy(),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture.off("loaded",this.onBaseTextureLoaded,this),this.baseTexture=null),this._frame=null,this._uvs=null,this.trim=null,this.crop=null,this.valid=!1,this.off("dispose",this.dispose,this),this.off("update",this.update,this)},i.prototype.clone=function(){return new i(this.baseTexture,this.frame,this.crop,this.trim,this.rotate)},i.prototype._updateUvs=function(){this._uvs||(this._uvs=new o),this._uvs.set(this.crop,this.baseTexture,this.rotate)},i.fromImage=function(t,e,r){var s=u.TextureCache[t];return s||(s=new i(n.fromImage(t,e,r)),u.TextureCache[t]=s),s},i.fromFrame=function(t){var e=u.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return e},i.fromCanvas=function(t,e){return new i(n.fromCanvas(t,e))},i.fromVideo=function(t,e){return"string"==typeof t?i.fromVideoUrl(t,e):new i(s.fromVideo(t,e))},i.fromVideoUrl=function(t,e){return new i(s.fromUrl(t,e))},i.addTextureToCache=function(t,e){u.TextureCache[e]=t},i.removeTextureFromCache=function(t){var e=u.TextureCache[t];return delete u.TextureCache[t],delete u.BaseTextureCache[t],e},i.EMPTY=new i(new n)},function(t,e,r){function i(t,e){if(!t)throw new Error("No video source element specified.");(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),s.call(this,t,e),this.autoUpdate=!1,this._onUpdate=this._onUpdate.bind(this),this._onCanPlay=this._onCanPlay.bind(this),t.complete||(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this))),this.__loaded=!1}function n(t,e){e||(e="video/"+t.substr(t.lastIndexOf(".")+1));var r=document.createElement("source");return r.src=t,r.type=e,r}var s=r(82),o=r(72);i.prototype=Object.create(s.prototype),i.prototype.constructor=i,t.exports=i,i.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this._onUpdate),this.update())},i.prototype._onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this._onUpdate),this.autoUpdate=!0)},i.prototype._onPlayStop=function(){this.autoUpdate=!1},i.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.source.play(),this.__loaded||(this.__loaded=!0,this.emit("loaded",this)))},i.prototype.destroy=function(){this.source&&this.source._pixiId&&(delete o.BaseTextureCache[this.source._pixiId],delete this.source._pixiId),s.prototype.destroy.call(this)},i.fromVideo=function(t,e){t._pixiId||(t._pixiId="video_"+o.uid());var r=o.BaseTextureCache[t._pixiId];return r||(r=new i(t,e),o.BaseTextureCache[t._pixiId]=r),r},i.fromUrl=function(t,e){var r=document.createElement("video");if(Array.isArray(t))for(var s=0;s<t.length;++s)r.appendChild(n(t[s].src||t[s],t[s].mime));else r.appendChild(n(t.src||t,t.mime));return r.load(),r.play(),i.fromVideo(r,e)},i.fromUrls=i.fromUrl},function(t,e){function r(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1}t.exports=r,r.prototype.set=function(t,e,r){var i=e.width,n=e.height;r?(this.x0=(t.x+t.height)/i,this.y0=t.y/n,this.x1=(t.x+t.height)/i,this.y1=(t.y+t.width)/n,this.x2=t.x/i,this.y2=(t.y+t.width)/n,this.x3=t.x/i,this.y3=t.y/n):(this.x0=t.x/i,this.y0=t.y/n,this.x1=(t.x+t.width)/i,this.y1=t.y/n,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/n,this.x3=t.x/i,this.y3=(t.y+t.height)/n)}},function(t,e,r){var i=r(64),n=r(72),s=r(62),o=r(87),a=function(t,e,r,a,h,u){if(this.gl=t,this.frameBuffer=null,this.texture=null,this.size=new i.Rectangle(0,0,1,1),this.resolution=h||s.RESOLUTION,this.projectionMatrix=new i.Matrix,this.transform=null,this.frame=null,this.stencil