@eva/fiber-eva
Version:
React EVA是一个让开发同学能够在React技术体系下,利用EVA JS的游戏研发能力,开发动画、游戏类场景的框架。它可以让开发同学用熟悉的JSX和Hooks语法编写动画、游戏场景的代码。
1 lines • 635 kB
JavaScript
!function t(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react")):"function"==typeof define&&define.amd?define(["react"],r):"object"==typeof exports?exports.dist=r(require("react")):e.dist=r(e.React)}(window,(function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function e(){return t.default}:function e(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="./dist/",r(r.s=99)}([function(t,e,r){"use strict";(function(t){e.__esModule=!0,e.loader=e.prepare=e.particles=e.mesh=e.loaders=e.interaction=e.filters=e.extras=e.extract=e.accessibility=void 0;var n=r(104);Object.keys(n).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return n[t]}})}));var i=r(2);Object.keys(i).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return i[t]}})}));var o,a=O(r(164)),s,u=S(r(165)),l,c=S(r(167)),h,f=S(r(79)),d,p=S(r(177)),v,y=S(r(184)),m,_=S(r(186)),g,b=S(r(190)),x,E=S(r(195)),T,w=S(r(200));function S(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function O(t){return t&&t.__esModule?t:{default:t}}i.utils.mixins.performMixins();var C=_.shared||null;e.accessibility=u,e.extract=c,e.extras=f,e.filters=p,e.interaction=y,e.loaders=_,e.mesh=b,e.particles=E,e.prepare=w,e.loader=C,"function"==typeof a.default&&(0,a.default)(e),t.PIXI=e}).call(this,r(21))},function(t,e,r){"use strict";e.__esModule=!0;var n=e.VERSION="4.8.9",i=e.PI_2=2*Math.PI,o=e.RAD_TO_DEG=180/Math.PI,a=e.DEG_TO_RAD=Math.PI/180,s=e.RENDERER_TYPE={UNKNOWN:0,WEBGL:1,CANVAS:2},u=e.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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19},l=e.DRAW_MODES={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},c=e.SCALE_MODES={LINEAR:0,NEAREST:1},h=e.WRAP_MODES={CLAMP:0,REPEAT:1,MIRRORED_REPEAT:2},f=e.GC_MODES={AUTO:0,MANUAL:1},d=e.URL_FILE_EXTENSION=/\.(\w{3,4})(?:$|\?|#)/i,p=e.DATA_URI=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i,v=e.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,y=e.SHAPES={POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},m=e.PRECISION={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"},_=e.TRANSFORM_MODE={STATIC:0,DYNAMIC:1},g=e.TEXT_GRADIENT={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},b=e.UPDATE_PRIORITY={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50}},function(t,e,r){"use strict";e.__esModule=!0,e.autoDetectRenderer=e.Application=e.Filter=e.SpriteMaskFilter=e.Quad=e.RenderTarget=e.ObjectRenderer=e.WebGLManager=e.Shader=e.CanvasRenderTarget=e.TextureUvs=e.VideoBaseTexture=e.BaseRenderTexture=e.RenderTexture=e.BaseTexture=e.TextureMatrix=e.Texture=e.Spritesheet=e.CanvasGraphicsRenderer=e.GraphicsRenderer=e.GraphicsData=e.Graphics=e.TextMetrics=e.TextStyle=e.Text=e.SpriteRenderer=e.CanvasTinter=e.CanvasSpriteRenderer=e.Sprite=e.TransformBase=e.TransformStatic=e.Transform=e.Container=e.DisplayObject=e.Bounds=e.glCore=e.WebGLRenderer=e.CanvasRenderer=e.ticker=e.utils=e.settings=void 0;var n=r(1);Object.keys(n).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return n[t]}})}));var i=r(6);Object.keys(i).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return i[t]}})}));var o=r(7);Object.defineProperty(e,"glCore",{enumerable:!0,get:function t(){return Z(o).default}});var a=r(32);Object.defineProperty(e,"Bounds",{enumerable:!0,get:function t(){return Z(a).default}});var s=r(58);Object.defineProperty(e,"DisplayObject",{enumerable:!0,get:function t(){return Z(s).default}});var u=r(14);Object.defineProperty(e,"Container",{enumerable:!0,get:function t(){return Z(u).default}});var l=r(60);Object.defineProperty(e,"Transform",{enumerable:!0,get:function t(){return Z(l).default}});var c=r(59);Object.defineProperty(e,"TransformStatic",{enumerable:!0,get:function t(){return Z(c).default}});var h=r(34);Object.defineProperty(e,"TransformBase",{enumerable:!0,get:function t(){return Z(h).default}});var f=r(36);Object.defineProperty(e,"Sprite",{enumerable:!0,get:function t(){return Z(f).default}});var d=r(132);Object.defineProperty(e,"CanvasSpriteRenderer",{enumerable:!0,get:function t(){return Z(d).default}});var p=r(22);Object.defineProperty(e,"CanvasTinter",{enumerable:!0,get:function t(){return Z(p).default}});var v=r(135);Object.defineProperty(e,"SpriteRenderer",{enumerable:!0,get:function t(){return Z(v).default}});var y=r(151);Object.defineProperty(e,"Text",{enumerable:!0,get:function t(){return Z(y).default}});var m=r(73);Object.defineProperty(e,"TextStyle",{enumerable:!0,get:function t(){return Z(m).default}});var _=r(74);Object.defineProperty(e,"TextMetrics",{enumerable:!0,get:function t(){return Z(_).default}});var g=r(153);Object.defineProperty(e,"Graphics",{enumerable:!0,get:function t(){return Z(g).default}});var b=r(75);Object.defineProperty(e,"GraphicsData",{enumerable:!0,get:function t(){return Z(b).default}});var x=r(155);Object.defineProperty(e,"GraphicsRenderer",{enumerable:!0,get:function t(){return Z(x).default}});var E=r(162);Object.defineProperty(e,"CanvasGraphicsRenderer",{enumerable:!0,get:function t(){return Z(E).default}});var T=r(163);Object.defineProperty(e,"Spritesheet",{enumerable:!0,get:function t(){return Z(T).default}});var w=r(9);Object.defineProperty(e,"Texture",{enumerable:!0,get:function t(){return Z(w).default}});var S=r(71);Object.defineProperty(e,"TextureMatrix",{enumerable:!0,get:function t(){return Z(S).default}});var O=r(12);Object.defineProperty(e,"BaseTexture",{enumerable:!0,get:function t(){return Z(O).default}});var C=r(39);Object.defineProperty(e,"RenderTexture",{enumerable:!0,get:function t(){return Z(C).default}});var P=r(66);Object.defineProperty(e,"BaseRenderTexture",{enumerable:!0,get:function t(){return Z(P).default}});var R=r(63);Object.defineProperty(e,"VideoBaseTexture",{enumerable:!0,get:function t(){return Z(R).default}});var M=r(64);Object.defineProperty(e,"TextureUvs",{enumerable:!0,get:function t(){return Z(M).default}});var A=r(67);Object.defineProperty(e,"CanvasRenderTarget",{enumerable:!0,get:function t(){return Z(A).default}});var D=r(17);Object.defineProperty(e,"Shader",{enumerable:!0,get:function t(){return Z(D).default}});var I=r(16);Object.defineProperty(e,"WebGLManager",{enumerable:!0,get:function t(){return Z(I).default}});var L=r(23);Object.defineProperty(e,"ObjectRenderer",{enumerable:!0,get:function t(){return Z(L).default}});var k=r(25);Object.defineProperty(e,"RenderTarget",{enumerable:!0,get:function t(){return Z(k).default}});var N=r(72);Object.defineProperty(e,"Quad",{enumerable:!0,get:function t(){return Z(N).default}});var B=r(69);Object.defineProperty(e,"SpriteMaskFilter",{enumerable:!0,get:function t(){return Z(B).default}});var j=r(70);Object.defineProperty(e,"Filter",{enumerable:!0,get:function t(){return Z(j).default}});var F=r(76);Object.defineProperty(e,"Application",{enumerable:!0,get:function t(){return Z(F).default}});var U=r(77);Object.defineProperty(e,"autoDetectRenderer",{enumerable:!0,get:function t(){return U.autoDetectRenderer}});var G,H=$(r(3)),X,z=$(r(38)),W,V=Z(r(4)),Y,q=Z(r(15)),K,Q=Z(r(24));function $(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Z(t){return t&&t.__esModule?t:{default:t}}e.settings=V.default,e.utils=H,e.ticker=z,e.CanvasRenderer=q.default,e.WebGLRenderer=Q.default},function(t,e,r){"use strict";e.__esModule=!0,e.premultiplyBlendMode=e.BaseTextureCache=e.TextureCache=e.earcut=e.mixins=e.pluginTarget=e.EventEmitter=e.removeItems=e.isMobile=void 0,e.uid=w,e.hex2rgb=S,e.hex2string=O,e.rgb2hex=C,e.getResolutionOfUrl=P,e.decomposeDataUri=R,e.getUrlFileExtension=M,e.getSvgSize=A,e.skipHello=D,e.sayHello=I,e.isWebGLSupported=L,e.sign=k,e.destroyTextureCache=j,e.clearTextureCache=F,e.correctBlendMode=G,e.premultiplyTint=H,e.premultiplyRgba=X,e.premultiplyTintToRgba=z;var n=r(1),i,o=x(r(4)),a,s=x(r(10)),u,l=x(r(121)),c,h=b(r(122)),f,d=b(r(33)),p,v=x(r(123)),y,m=x(r(124)),_,g=x(r(35));function b(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function x(t){return t&&t.__esModule?t:{default:t}}var E=0,T=!1;function w(){return++E}function S(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function O(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function C(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}function P(t,e){var r=o.default.RETINA_PREFIX.exec(t);return r?parseFloat(r[1]):void 0!==e?e:1}function R(t){var e=n.DATA_URI.exec(t);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,charset:e[3]?e[3].toLowerCase():void 0,encoding:e[4]?e[4].toLowerCase():void 0,data:e[5]}}function M(t){var e=n.URL_FILE_EXTENSION.exec(t);if(e)return e[1].toLowerCase()}function A(t){var e=n.SVG_SIZE.exec(t),r={};return e&&(r[e[1]]=Math.round(parseFloat(e[3])),r[e[5]]=Math.round(parseFloat(e[7]))),r}function D(){T=!0}function I(t){if(!T){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+n.VERSION+" - \u2730 "+t+" \u2730 %c %c http://www.pixijs.com/ %c %c \u2665%c\u2665%c\u2665 \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("PixiJS "+n.VERSION+" - "+t+" - http://www.pixijs.com/");T=!0}}function L(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),n=!(!r||!r.getContextAttributes().stencil);if(r){var i=r.getExtension("WEBGL_lose_context");i&&i.loseContext()}return r=null,n}catch(t){return!1}}function k(t){return 0===t?0:t<0?-1:1}e.isMobile=d,e.removeItems=v.default,e.EventEmitter=s.default,e.pluginTarget=l.default,e.mixins=h,e.earcut=g.default;var N=e.TextureCache=Object.create(null),B=e.BaseTextureCache=Object.create(null);function j(){var t=void 0;for(t in N)N[t].destroy();for(t in B)B[t].destroy()}function F(){var t=void 0;for(t in N)delete N[t];for(t in B)delete B[t]}var U=e.premultiplyBlendMode=(0,m.default)();function G(t,e){return U[e?1:0][t]}function H(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,n=t>>8&255,i=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((n=n*e+.5|0)<<8)+(i=i*e+.5|0)}function X(t,e,r,n){return r=r||new Float32Array(4),n||void 0===n?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function z(t,e,r,n){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(n||void 0===n)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}},function(t,e,r){"use strict";e.__esModule=!0;var n,i=s(r(119)),o,a=s(r(120));function s(t){return t&&t.__esModule?t:{default:t}}e.default={TARGET_FPMS:.06,MIPMAP_TEXTURES:!0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:(0,i.default)(32),SPRITE_BATCH_SIZE:4096,RETINA_PREFIX:/@([0-9\.]+)x/,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoResize:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,roundPixels:!1,width:800,height:600,legacy:!1},TRANSFORM_MODE:0,GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:0,SCALE_MODE:0,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:"mediump",CAN_UPLOAD_SAME_BUFFER:(0,a.default)(),MESH_CANVAS_PADDING:0}},function(t,e,r){"use strict";var n=r(27),i="object"==typeof self&&self&&self.Object===Object&&self,o=n.a||i||Function("return this")();e.a=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(28);Object.defineProperty(e,"Point",{enumerable:!0,get:function t(){return f(n).default}});var i=r(47);Object.defineProperty(e,"ObservablePoint",{enumerable:!0,get:function t(){return f(i).default}});var o=r(29);Object.defineProperty(e,"Matrix",{enumerable:!0,get:function t(){return f(o).default}});var a=r(48);Object.defineProperty(e,"GroupD8",{enumerable:!0,get:function t(){return f(a).default}});var s=r(109);Object.defineProperty(e,"Circle",{enumerable:!0,get:function t(){return f(s).default}});var u=r(110);Object.defineProperty(e,"Ellipse",{enumerable:!0,get:function t(){return f(u).default}});var l=r(111);Object.defineProperty(e,"Polygon",{enumerable:!0,get:function t(){return f(l).default}});var c=r(30);Object.defineProperty(e,"Rectangle",{enumerable:!0,get:function t(){return f(c).default}});var h=r(112);function f(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"RoundedRectangle",{enumerable:!0,get:function t(){return f(h).default}})},function(t,e,r){var n={createContext:r(113),setVertexAttribArrays:r(49),GLBuffer:r(114),GLFramebuffer:r(115),GLShader:r(116),GLTexture:r(50),VertexArrayObject:r(117),shader:r(118)};t.exports&&(t.exports=n),"undefined"!=typeof window&&(window.PIXI=window.PIXI||{},window.PIXI.glCore=n)},function(t,e,r){(function(t){function r(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t){"string"!=typeof t&&(t+="");var e=0,r=-1,n=!0,i;for(i=t.length-1;i>=0;--i)if(47===t.charCodeAt(i)){if(!n){e=i+1;break}}else-1===r&&(n=!1,r=i+1);return-1===r?"":t.slice(e,r)}function i(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n<t.length;n++)e(t[n],n,t)&&r.push(t[n]);return r}e.resolve=function(){for(var e="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){var a=o>=0?arguments[o]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(e=a+"/"+e,n="/"===a.charAt(0))}return(n?"/":"")+(e=r(i(e.split("/"),(function(t){return!!t})),!n).join("/"))||"."},e.normalize=function(t){var n=e.isAbsolute(t),a="/"===o(t,-1);return(t=r(i(t.split("/"),(function(t){return!!t})),!n).join("/"))||n||(t="."),t&&a&&(t+="/"),(n?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(i(t,(function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))},e.relative=function(t,r){function n(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=e.resolve(t).substr(1),r=e.resolve(r).substr(1);for(var i=n(t.split("/")),o=n(r.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u<a;u++)if(i[u]!==o[u]){s=u;break}for(var l=[],u=s;u<i.length;u++)l.push("..");return(l=l.concat(o.slice(s))).join("/")},e.sep="/",e.delimiter=":",e.dirname=function(t){if("string"!=typeof t&&(t+=""),0===t.length)return".";for(var e=t.charCodeAt(0),r=47===e,n=-1,i=!0,o=t.length-1;o>=1;--o)if(47===(e=t.charCodeAt(o))){if(!i){n=o;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"/":t.slice(0,n)},e.basename=function(t,e){var r=n(t);return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},e.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,r=0,n=-1,i=!0,o=0,a=t.length-1;a>=0;--a){var s=t.charCodeAt(a);if(47!==s)-1===n&&(i=!1,n=a+1),46===s?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!i){r=a+1;break}}return-1===e||-1===n||0===o||1===o&&e===n-1&&e===r+1?"":t.slice(e,n)};var o="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,r(138))},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i,o=y(r(12)),a,s=y(r(63)),u,l=y(r(64)),c,h=y(r(10)),f=r(6),d=r(3),p,v=y(r(4));function y(t){return t&&t.__esModule?t:{default:t}}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var b=function(t){function e(r,n,i,o,a,s){m(this,e);var u=_(this,t.call(this));if(u.noFrame=!1,n||(u.noFrame=!0,n=new f.Rectangle(0,0,1,1)),r instanceof e&&(r=r.baseTexture),u.baseTexture=r,u._frame=n,u.trim=o,u.valid=!1,u.requiresUpdate=!1,u._uvs=null,u.orig=i||n,u._rotate=Number(a||0),!0===a)u._rotate=2;else if(u._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return r.hasLoaded?(u.noFrame&&(n=new f.Rectangle(0,0,r.width,r.height),r.on("update",u.onBaseTextureUpdated,u)),u.frame=n):r.once("loaded",u.onBaseTextureLoaded,u),u.defaultAnchor=s?new f.Point(s.x,s.y):new f.Point(0,0),u._updateID=0,u.transform=null,u.textureCacheIds=[],u}return g(e,t),e.prototype.update=function t(){this.baseTexture.update()},e.prototype.onBaseTextureLoaded=function t(e){this._updateID++,this.noFrame?this.frame=new f.Rectangle(0,0,e.width,e.height):this.frame=this._frame,this.baseTexture.on("update",this.onBaseTextureUpdated,this),this.emit("update",this)},e.prototype.onBaseTextureUpdated=function t(e){this._updateID++,this._frame.width=e.width,this._frame.height=e.height,this.emit("update",this)},e.prototype.destroy=function t(r){this.baseTexture&&(r&&(d.TextureCache[this.baseTexture.imageUrl]&&e.removeFromCache(this.baseTexture.imageUrl),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.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function t(){return new e(this.baseTexture,this.frame,this.orig,this.trim,this.rotate,this.defaultAnchor)},e.prototype._updateUvs=function t(){this._uvs||(this._uvs=new l.default),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.fromImage=function t(r,n,i,a){var s=d.TextureCache[r];return s||(s=new e(o.default.fromImage(r,n,i,a)),e.addToCache(s,r)),s},e.fromFrame=function t(e){var r=d.TextureCache[e];if(!r)throw new Error('The frameId "'+e+'" does not exist in the texture cache');return r},e.fromCanvas=function t(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"canvas";return new e(o.default.fromCanvas(r,n,i))},e.fromVideo=function t(r,n,i,o){return"string"==typeof r?e.fromVideoUrl(r,n,i,o):new e(s.default.fromVideo(r,n,o))},e.fromVideoUrl=function t(r,n,i,o){return new e(s.default.fromUrl(r,n,i,o))},e.from=function t(r){if("string"==typeof r){var n=d.TextureCache[r],i;return n||(null!==r.match(/\.(mp4|webm|ogg|h264|avi|mov)$/)?e.fromVideoUrl(r):e.fromImage(r))}return r instanceof HTMLImageElement?new e(o.default.from(r)):r instanceof HTMLCanvasElement?e.fromCanvas(r,v.default.SCALE_MODE,"HTMLCanvasElement"):r instanceof HTMLVideoElement?e.fromVideo(r):r instanceof o.default?new e(r):r},e.fromLoader=function t(r,n,i){var a=new o.default(r,void 0,(0,d.getResolutionOfUrl)(n)),s=new e(a);return a.imageUrl=n,i||(i=n),o.default.addToCache(s.baseTexture,i),e.addToCache(s,i),i!==n&&(o.default.addToCache(s.baseTexture,n),e.addToCache(s,n)),s},e.addToCache=function t(e,r){r&&(-1===e.textureCacheIds.indexOf(r)&&e.textureCacheIds.push(r),d.TextureCache[r]&&console.warn("Texture added to the cache with an id ["+r+"] that already had an entry"),d.TextureCache[r]=e)},e.removeFromCache=function t(e){if("string"==typeof e){var r=d.TextureCache[e];if(r){var n=r.textureCacheIds.indexOf(e);return n>-1&&r.textureCacheIds.splice(n,1),delete d.TextureCache[e],r}}else if(e&&e.textureCacheIds){for(var i=0;i<e.textureCacheIds.length;++i)d.TextureCache[e.textureCacheIds[i]]===e&&delete d.TextureCache[e.textureCacheIds[i]];return e.textureCacheIds.length=0,e}return null},n(e,[{key:"frame",get:function t(){return this._frame},set:function t(e){this._frame=e,this.noFrame=!1;var r=e.x,n=e.y,i=e.width,o=e.height,a=r+i>this.baseTexture.width,s=n+o>this.baseTexture.height;if(a||s){var u=a&&s?"and":"or",l="X: "+r+" + "+i+" = "+(r+i)+" > "+this.baseTexture.width,c="Y: "+n+" + "+o+" = "+(n+o)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+l+" "+u+" "+c)}this.valid=i&&o&&this.baseTexture.hasLoaded,this.trim||this.rotate||(this.orig=e),this.valid&&this._updateUvs()}},{key:"rotate",get:function t(){return this._rotate},set:function t(e){this._rotate=e,this.valid&&this._updateUvs()}},{key:"width",get:function t(){return this.orig.width}},{key:"height",get:function t(){return this.orig.height}}]),e}(h.default);function x(){var t=document.createElement("canvas");t.width=10,t.height=10;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,10,10),new b(new o.default(t))}function E(t){t.destroy=function t(){},t.on=function t(){},t.once=function t(){},t.emit=function t(){}}e.default=b,b.EMPTY=new b(new o.default),E(b.EMPTY),E(b.EMPTY.baseTexture),b.WHITE=x(),E(b.WHITE),E(b.WHITE.baseTexture)},function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty,i="~";function o(){}function a(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function s(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),s.prototype.eventNames=function t(){var e=[],r,o;if(0===this._eventsCount)return e;for(o in r=this._events)n.call(r,o)&&e.push(i?o.slice(1):o);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e},s.prototype.listeners=function t(e,r){var n=i?i+e:e,o=this._events[n];if(r)return!!o;if(!o)return[];if(o.fn)return[o.fn];for(var a=0,s=o.length,u=new Array(s);a<s;a++)u[a]=o[a].fn;return u},s.prototype.emit=function t(e,r,n,o,a,s){var u=i?i+e:e;if(!this._events[u])return!1;var l=this._events[u],c=arguments.length,h,f;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,r),!0;case 3:return l.fn.call(l.context,r,n),!0;case 4:return l.fn.call(l.context,r,n,o),!0;case 5:return l.fn.call(l.context,r,n,o,a),!0;case 6:return l.fn.call(l.context,r,n,o,a,s),!0}for(f=1,h=new Array(c-1);f<c;f++)h[f-1]=arguments[f];l.fn.apply(l.context,h)}else{var d=l.length,p;for(f=0;f<d;f++)switch(l[f].once&&this.removeListener(e,l[f].fn,void 0,!0),c){case 1:l[f].fn.call(l[f].context);break;case 2:l[f].fn.call(l[f].context,r);break;case 3:l[f].fn.call(l[f].context,r,n);break;case 4:l[f].fn.call(l[f].context,r,n,o);break;default:if(!h)for(p=1,h=new Array(c-1);p<c;p++)h[p-1]=arguments[p];l[f].fn.apply(l[f].context,h)}}return!0},s.prototype.on=function t(e,r,n){var o=new a(r,n||this),s=i?i+e:e;return this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],o]:this._events[s].push(o):(this._events[s]=o,this._eventsCount++),this},s.prototype.once=function t(e,r,n){var o=new a(r,n||this,!0),s=i?i+e:e;return this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],o]:this._events[s].push(o):(this._events[s]=o,this._eventsCount++),this},s.prototype.removeListener=function t(e,r,n,a){var s=i?i+e:e;if(!this._events[s])return this;if(!r)return 0==--this._eventsCount?this._events=new o:delete this._events[s],this;var u=this._events[s];if(u.fn)u.fn!==r||a&&!u.once||n&&u.context!==n||(0==--this._eventsCount?this._events=new o:delete this._events[s]);else{for(var l=0,c=[],h=u.length;l<h;l++)(u[l].fn!==r||a&&!u[l].once||n&&u[l].context!==n)&&c.push(u[l]);c.length?this._events[s]=1===c.length?c[0]:c:0==--this._eventsCount?this._events=new o:delete this._events[s]}return this},s.prototype.removeAllListeners=function t(e){var r;return e?(r=i?i+e:e,this._events[r]&&(0==--this._eventsCount?this._events=new o:delete this._events[r])):(this._events=new o,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function t(){return this},s.prefixed=i,s.EventEmitter=s,t.exports=s},function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty,i="~";function o(){}function a(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function s(t,e,r,n,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new a(r,n||t,o),u=i?i+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function l(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),l.prototype.eventNames=function t(){var e=[],r,o;if(0===this._eventsCount)return e;for(o in r=this._events)n.call(r,o)&&e.push(i?o.slice(1):o);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e},l.prototype.listeners=function t(e){var r=i?i+e:e,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,a=n.length,s=new Array(a);o<a;o++)s[o]=n[o].fn;return s},l.prototype.listenerCount=function t(e){var r=i?i+e:e,n=this._events[r];return n?n.fn?1:n.length:0},l.prototype.emit=function t(e,r,n,o,a,s){var u=i?i+e:e;if(!this._events[u])return!1;var l=this._events[u],c=arguments.length,h,f;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,r),!0;case 3:return l.fn.call(l.context,r,n),!0;case 4:return l.fn.call(l.context,r,n,o),!0;case 5:return l.fn.call(l.context,r,n,o,a),!0;case 6:return l.fn.call(l.context,r,n,o,a,s),!0}for(f=1,h=new Array(c-1);f<c;f++)h[f-1]=arguments[f];l.fn.apply(l.context,h)}else{var d=l.length,p;for(f=0;f<d;f++)switch(l[f].once&&this.removeListener(e,l[f].fn,void 0,!0),c){case 1:l[f].fn.call(l[f].context);break;case 2:l[f].fn.call(l[f].context,r);break;case 3:l[f].fn.call(l[f].context,r,n);break;case 4:l[f].fn.call(l[f].context,r,n,o);break;default:if(!h)for(p=1,h=new Array(c-1);p<c;p++)h[p-1]=arguments[p];l[f].fn.apply(l[f].context,h)}}return!0},l.prototype.on=function t(e,r,n){return s(this,e,r,n,!1)},l.prototype.once=function t(e,r,n){return s(this,e,r,n,!0)},l.prototype.removeListener=function t(e,r,n,o){var a=i?i+e:e;if(!this._events[a])return this;if(!r)return u(this,a),this;var s=this._events[a];if(s.fn)s.fn!==r||o&&!s.once||n&&s.context!==n||u(this,a);else{for(var l=0,c=[],h=s.length;l<h;l++)(s[l].fn!==r||o&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[a]=1===c.length?c[0]:c:u(this,a)}return this},l.prototype.removeAllListeners=function t(e){var r;return e?(r=i?i+e:e,this._events[r]&&u(this,r)):(this._events=new o,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=i,l.EventEmitter=l,t.exports=l},function(t,e,r){"use strict";e.__esModule=!0;var n=r(3),i,o=f(r(4)),a,s=f(r(10)),u,l=f(r(61)),c,h=f(r(37));function f(t){return t&&t.__esModule?t:{default:t}}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var y=function(t){function e(r,i,a){d(this,e);var s=p(this,t.call(this));return s.uid=(0,n.uid)(),s.touched=0,s.resolution=a||o.default.RESOLUTION,s.width=100,s.height=100,s.realWidth=100,s.realHeight=100,s.scaleMode=void 0!==i?i:o.default.SCALE_MODE,s.hasLoaded=!1,s.isLoading=!1,s.source=null,s.origSource=null,s.imageType=null,s.sourceScale=1,s.premultipliedAlpha=!0,s.imageUrl=null,s.isPowerOfTwo=!1,s.mipmap=o.default.MIPMAP_TEXTURES,s.wrapMode=o.default.WRAP_MODE,s._glTextures={},s._enabled=0,s._virtalBoundId=-1,s._destroyed=!1,s.textureCacheIds=[],r&&s.loadSource(r),s}return v(e,t),e.prototype.update=function t(){"svg"!==this.imageType&&(this.realWidth=this.source.naturalWidth||this.source.videoWidth||this.source.width,this.realHeight=this.source.naturalHeight||this.source.videoHeight||this.source.height,this._updateDimensions()),this.emit("update",this)},e.prototype._updateDimensions=function t(){this.width=this.realWidth/this.resolution,this.height=this.realHeight/this.resolution,this.isPowerOfTwo=h.default.isPow2(this.realWidth)&&h.default.isPow2(this.realHeight)},e.prototype.loadSource=function t(e){var r=this.isLoading;this.hasLoaded=!1,this.isLoading=!1,r&&this.source&&(this.source.onload=null,this.source.onerror=null);var n=!this.source;if(this.source=e,(e.src&&e.complete||e.getContext)&&e.width&&e.height)this._updateImageType(),"svg"===this.imageType?this._loadSvgSource():this._sourceLoaded(),n&&this.emit("loaded",this);else if(!e.getContext){this.isLoading=!0;var i=this;if(e.onload=function(){i._updateImageType(),e.onload=null,e.onerror=null,i.isLoading&&(i.isLoading=!1,i._sourceLoaded(),"svg"!==i.imageType?i.emit("loaded",i):i._loadSvgSource())},e.onerror=function(){e.onload=null,e.onerror=null,i.isLoading&&(i.isLoading=!1,i.emit("error",i))},e.complete&&e.src){if(e.onload=null,e.onerror=null,"svg"===i.imageType)return void i._loadSvgSource();this.isLoading=!1,e.width&&e.height?(this._sourceLoaded(),r&&this.emit("loaded",this)):r&&this.emit("error",this)}}},e.prototype._updateImageType=function t(){if(this.imageUrl){var e=(0,n.decomposeDataUri)(this.imageUrl),r=void 0;if(e&&"image"===e.mediaType){var i=e.subType.split("+")[0];if(!(r=(0,n.getUrlFileExtension)("."+i)))throw new Error("Invalid image type in data URI.")}else(r=(0,n.getUrlFileExtension)(this.imageUrl))||(r="png");this.imageType=r}},e.prototype._loadSvgSource=function t(){if("svg"===this.imageType){var e=(0,n.decomposeDataUri)(this.imageUrl);e?this._loadSvgSourceUsingDataUri(e):this._loadSvgSourceUsingXhr()}},e.prototype._loadSvgSourceUsingDataUri=function t(e){var r=void 0;if("base64"===e.encoding){if(!atob)throw new Error("Your browser doesn't support base64 conversions.");r=atob(e.data)}else r=e.data;this._loadSvgSourceUsingString(r)},e.prototype._loadSvgSourceUsingXhr=function t(){var e=this,r=new XMLHttpRequest;r.onload=function(){if(r.readyState!==r.DONE||200!==r.status)throw new Error("Failed to load SVG using XHR.");e._loadSvgSourceUsingString(r.response)},r.onerror=function(){return e.emit("error",e)},r.open("GET",this.imageUrl,!0),r.send()},e.prototype._loadSvgSourceUsingString=function t(r){var i=(0,n.getSvgSize)(r),o=i.width,a=i.height;if(!o||!a)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");this.realWidth=Math.round(o*this.sourceScale),this.realHeight=Math.round(a*this.sourceScale),this._updateDimensions();var s=document.createElement("canvas");s.width=this.realWidth,s.height=this.realHeight,s._pixiId="canvas_"+(0,n.uid)(),s.getContext("2d").drawImage(this.source,0,0,o,a,0,0,this.realWidth,this.realHeight),this.origSource=this.source,this.source=s,e.addToCache(this,s._pixiId),this.isLoading=!1,this._sourceLoaded(),this.emit("loaded",this)},e.prototype._sourceLoaded=function t(){this.hasLoaded=!0,this.update()},e.prototype.destroy=function t(){this.imageUrl&&(delete n.TextureCache[this.imageUrl],this.imageUrl=null,navigator.isCocoonJS||(this.source.src="")),this.source=null,this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this._destroyed=!0},e.prototype.dispose=function t(){this.emit("dispose",this)},e.prototype.updateSourceImage=function t(e){this.source.src=e,this.loadSource(this.source)},e.fromImage=function t(r,i,o,a){var s=n.BaseTextureCache[r];if(!s){var u=new Image;void 0===i&&0!==r.indexOf("data:")?u.crossOrigin=(0,l.default)(r):i&&(u.crossOrigin="string"==typeof i?i:"anonymous"),(s=new e(u,o)).imageUrl=r,a&&(s.sourceScale=a),s.resolution=(0,n.getResolutionOfUrl)(r),u.src=r,e.addToCache(s,r)}return s},e.fromCanvas=function t(r,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"canvas";r._pixiId||(r._pixiId=o+"_"+(0,n.uid)());var a=n.BaseTextureCache[r._pixiId];return a||(a=new e(r,i),e.addToCache(a,r._pixiId)),a},e.from=function t(r,i,o){if("string"==typeof r)return e.fromImage(r,void 0,i,o);if(r instanceof HTMLImageElement){var a=r.src,s=n.BaseTextureCache[a];return s||((s=new e(r,i)).imageUrl=a,o&&(s.sourceScale=o),s.resolution=(0,n.getResolutionOfUrl)(a),e.addToCache(s,a)),s}return r instanceof HTMLCanvasElement?e.fromCanvas(r,i):r},e.addToCache=function t(e,r){r&&(-1===e.textureCacheIds.indexOf(r)&&e.textureCacheIds.push(r),n.BaseTextureCache[r]&&console.warn("BaseTexture added to the cache with an id ["+r+"] that already had an entry"),n.BaseTextureCache[r]=e)},e.removeFromCache=function t(e){if("string"==typeof e){var r=n.BaseTextureCache[e];if(r){var i=r.textureCacheIds.indexOf(e);return i>-1&&r.textureCacheIds.splice(i,1),delete n.BaseTextureCache[e],r}}else if(e&&e.textureCacheIds){for(var o=0;o<e.textureCacheIds.length;++o)delete n.BaseTextureCache[e.textureCacheIds[o]];return e.textureCacheIds.length=0,e}return null},e}(s.default);e.default=y},function(t,e,r){"use strict";function n(t,e){if(t){e=e||{};for(var r={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},n=r.parser[e.strictMode?"strict":"loose"].exec(t),i={},o=14;o--;)i[r.key[o]]=n[o]||"";return i[r.q.name]={},i[r.key[12]].replace(r.q.parser,(function(t,e,n){e&&(i[r.q.name][e]=n)})),i}}t.exports=n},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=r(3),o,a;function s(t){return t&&t.__esModule?t:{default:t}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var h=function(t){function e(){u(this,e);var r=l(this,t.call(this));return r.children=[],r}return c(e,t),e.prototype.onChildrenChange=function t(){},e.prototype.addChild=function t(e){var r=arguments.length;if(r>1)for(var n=0;n<r;n++)this.addChild(arguments[n]);else e.parent&&e.parent.removeChild(e),e.parent=this,e.transform._parentID=-1,this.children.push(e),this._boundsID++,this.onChildrenChange(this.children.length-1),e.emit("added",this);return e},e.prototype.addChildAt=function t(e,r){if(r<0||r>this.children.length)throw new Error(e+"addChildAt: The index "+r+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,e.transform._parentID=-1,this.children.splice(r,0,e),this._boundsID++,this.onChildrenChange(r),e.emit("added",this),e},e.prototype.swapChildren=function t(e,r){if(e!==r){var n=this.getChildIndex(e),i=this.getChildIndex(r);this.children[n]=r,this.children[i]=e,this.onChildrenChange(n<i?n:i)}},e.prototype.getChildIndex=function t(e){var r=this.children.indexOf(e);if(-1===r)throw new Error("The supplied DisplayObject must be a child of the caller");return r},e.prototype.setChildIndex=function t(e,r){if(r<0||r>=this.children.length)throw new Error("The index "+r+" supplied is out of bounds "+this.children.length);var n=this.getChildIndex(e);(0,i.removeItems)(this.children,n,1),this.children.splice(r,0,e),this.onChildrenChange(r)},e.prototype.getChildAt=function t(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},e.prototype.removeChild=function t(e){var r=arguments.length;if(r>1)for(var n=0;n<r;n++)this.removeChild(arguments[n]);else{var o=this.children.indexOf(e);if(-1===o)return null;e.parent=null,e.transform._parentID=-1,(0,i.removeItems)(this.children,o,1),this._boundsID++,this.onChildrenChange(o),e.emit("removed",this)}return e},e.prototype.removeChildAt=function t(e){var r=this.getChildAt(e);return r.parent=null,r.transform._parentID=-1,(0,i.removeItems)(this.children,e,1),this._boundsID++,this.onChildrenChange(e),r.emit("removed",this),r},e.prototype.removeChildren=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments[1],n=e,i="number"==typeof r?r:this.children.length,o=i-n,a=void 0;if(o>0&&o<=i){a=this.children.splice(n,o);for(var s=0;s<a.length;++s)a[s].parent=null,a[s].transform&&(a[s].transform._parentID=-1);this._boundsID++,this.onChildrenChange(e);for(var u=0;u<a.length;++u)a[u].emit("removed",this);return a}if(0===o&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.updateTransform=function t(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,r=this.children.length;e<r;++e){var n=this.children[e];n.visible&&n.updateTransform()}},e.prototype.calculateBounds=function t(){this._bounds.clear(),this._calculateBounds();for(var e=0;e<this.children.length;e++){var r=this.children[e];r.visible&&r.renderable&&(r.calculateBounds(),r._mask?(r._mask.calculateBounds(),this._bounds.addBoundsMask(r._bounds,r._mask._bounds)):r.filterArea?this._bounds.addBoundsArea(r._bounds,r.filterArea):this._bounds.addBounds(r._bounds))}this._lastBoundsID=this._boundsID},e.prototype._calculateBounds=function t(){},e.prototype.renderWebGL=function t(e){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters&&this.filters.length)this.renderAdvancedWebGL(e);else{this._renderWebGL(e);for(var r=0,n=this.children.length;r<n;++r)this.children[r].renderWebGL(e)}},e.prototype.renderAdvancedWebGL=function t(e){e.flush();var r=this._filters,n=this._mask;if(r){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var i=0;i<r.length;i++)r[i].enabled&&this._enabledFilters.push(r[i]);this._enabledFilters.length&&e.filterManager.pushFilter(this,this._enabledFilters)}n&&e.maskManager.pushMask(this,this._mask),this._renderWebGL(e);for(var o=0,a=this.children.length;o<a;o++)this.children[o].renderWebGL(e);e.flush(),n&&e.maskManager.popMask(this,this._mask),r&&this._enabledFilters&&this._enabledFilters.length&&e.filterManager.popFilter()},e.prototype._renderWebGL=function t(e){},e.prototype._renderCanvas=function t(e){},e.prototype.renderCanvas=function t(e){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){this._mask&&e.maskManager.pushMask(this._mask),this._renderCanvas(e);for(var r=0,n=this.children.length;r<n;++r)this.children[r].renderCanvas(e);this._mask&&e.maskManager.popMask(e)}},e.prototype.destroy=function e(r){t.prototype.destroy.call(this);var n="boolean"==typeof r?r:r&&r.children,i=this.removeChildren(0,this.children.length);if(n)for(var o=0;o<i.length;++o)i[o].destroy(r)},n(e,[{key:"width",get:function t(){return this.scale.x*this.getLocalBounds().width},set:function t(e){var r=this.getLocalBounds().width;this.scale.x=0!==r?e/r:1,this._width=e}},{key:"height",get:function t(){return this.scale.y*this.getLocalBounds().height},set:function t(e){var r=this.getLocalBounds().height;this.scale.y=0!==r?e/r:1,this._height=e}}]),e}(s(r(58)).default);e.default=h,h.prototype.containerUpdateTransform=h.prototype.updateTransform},function(t,e,r){"use strict";e.__esModule=!0;var n,i=v(r(65)),o,a=v(r(133)),s,u=v(r(67)),l,c=v(r(134)),h=r(3),f=r(1),d,p=v(r(4));function v(t){return t&&t.__esModule?t:{default:t}}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var g=function(t){function e(r,n,i){y(this,e);var o=m(this,t.call(this,"Canvas",r,n,i));return o.type=f.RENDERER_TYPE.CANVAS,o.rootContext=o.view.getContext("2d",{alpha:o.transparent}),o.context=o.rootContext,o.refresh=!0,o.maskManager=new a.default(o),o.smoothProperty="imageSmoothingEnabled",o.rootContext.imageSmoothingEnabled||(o.rootContext.webkitImageSmoothingEnabled?o.smoothProperty="webkitImageSmoothingEnabled":o.rootContext.mozImageSmoothingEnabled?o.smoothProperty="mozImageSmoothingEnabled":o.rootContext.oImageSmoothingEnabled?o.smoothProperty="oImageSmoothingEnabled":o.rootContext.msImageSmoothingEnabled&&(o.smoothProperty="msImageSmoothingEnabled")),o.initPlugins(),o.blendModes=(0,c.default)(),o._activeBlendMode=null,o.renderingToScreen=!1,o.resize(o.options.width,o.options.height),o}return _(e,t),e.prototype.render=function t(e,r,n,i,o){if(this.view){this.renderingToScreen=!r,this.emit("prerender");var a=this.resolution;r?((r=r.baseTexture||r)._canvasRenderTarget||(r._canvasRenderTarget=new u.default(r.width,r.height,r.resolution),r.source=r._canvasRenderTarget.canvas,r.valid=!0),this.context=r._canvasRenderTarget.context,this.resolution=r._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(r||(this._lastObjectRendered=e),!o){var l=e.parent,c=this._tempDisplayObjectParent.transform.worldTransform;i?(i.copy(c),this._tempDisplayObjectParent.transform._worldID=-1):c.identity(),e.parent=this._tempDisplayObjectParent,e.updateTransform(),e.parent=l}s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=f.BLEND_MODES.NORMAL,s.globalCompositeOperation=this.blendModes[f.BLEND_MODES.NORMAL],navigator.isCocoonJS&&this.view.screencanvas&&(s.fillStyle="black",s.clear()),(void 0!==n?n:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height)));var h=this.context;this.context=s,e.renderCanvas(this),this.context=h,s.restore(),this.resolution=a,this.emit("postrender")}},e.prototype.clear=function t(e){var r=this.context;e=e||this._backgroundColorString,!this.transparent&&e?(r.fillStyle=e,r.fillRect(0,0,this.width,this.height)):r.clearRect(0,0,this.width,this.height)},e.prototype.setBlendMode=function t(e){this._activeBlendMode!==e&&(this._activeBlendMode=e,this.context.globalCompositeOperation=this.blendModes[e])},e.prototype.destroy=function e(r){this.destroyPlugins(),t.prototype.destroy.call(this,r),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function e(r,n){t.prototype.resize.call(this,r,n),this.smoothProperty&&(this.rootContext[this.smoothProperty]=p.default.SCALE_MODE===f.SCALE_MODES.LINEAR)},e.prototype.invalidateBlendMode=function t(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e}(i.default);e.default=g,h.pluginTarget.mixin(g)},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var i=function(){function t(e){n(this,t),this.renderer=e,this.renderer.on("context",this.onContextChange,this)}return t.prototype.onContextChange=function t(){},t.prototype.destroy=function t(){this.renderer.off("context",this.onContextChange,this),this.renderer=null},t}();e.default=i},function(t,e,r){"use strict";e.__esModule=!0;var n=r(7),i,o=a(r(4));function a(t){return t&&t.__esModule?t:{default:t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function c(t,e){if(t instanceof Array){if("precision"!==t[0].substring(0,9)){var r=t.slice(0);return r.unshift("precision "+e+" float;"),r}}else if("precision"!==t.trim().substring(0,9))return"precision "+e+" float;\n"+t;return t}var h=function(t){function e(r,n,i,a,l){return s(this,e),u(this,t.call(this,r,c(n,l||o.default.PRECISION_VERTEX),c(i,l||o.default.PRECISION_FRAGMENT),void 0,a))}return l(e,t),e}(n.GLShader);e.default=h},function(t,e,r){"use strict";var n=r(187).Loader,i=r(41).Resource,o=r(91),a=r(92);n.Resource=i,n.async=o,n.encodeBinary=a,n.base64=a,t.exports=n,t.exports.Loader=n,t.exports.default=n},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i,o=l(r(2)),a,s=u(r(9));function u(t){return t&&t.__esModule?t:{default:t}}function l(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var d=new o.Point,p=new o.Polygon,v=function(t){function e(r,n,i,a,u){c(this,e);var l=h(this,t.call(this));return l._texture=r||s.default.EMPTY,l.uvs=i||new Float32Array([0,0,1,0,1,1,0,1]),l.vertices=n||new Float32Array([0,0,100,0,100,100,0,100]),l.indices=a||new Uint16Array([0,1,3,2]),l.dirty=0,l.indexDirty=0,l.vertexDirty=0,l.autoUpdate=!0,l.blendMode=o.BLEND_MODES.NORMAL,l.canvasPadding=o.settings.MESH_CANVAS_PADDING,l.drawMode=u||e.DRAW_MODES.TRIANGLE_MESH,l.shader=null,l.tintRgb=new Float32Array([1,1,1]),l._glDatas={},l._uvTransform=new o.TextureMatrix(l._texture),l.uploadUvTransform=!1,l.pluginName="mesh",l}return f(e,t),e.prototype._renderWebGL=function t(e){this.refresh(),e.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this)},e.prototype._renderCanvas=function t(e){this.refresh(),e.plugins[this.pluginName].render(this)},e.prototype._onTextureUpdate=function t(){this._uvTransform.texture=this._texture,this.refresh()},e.prototype.multiplyUvs=function t(){this.uploadUvTransform||this._uvTransform.multiplyUvs(this.uvs)},e.prototype.refresh=function t(e){this.autoUpdate&&this.vertexDirty++,this._uvTransform.update(e)&&this._refresh()},e.prototype._refresh=function t(){},e.prototype._calculateBounds=function t(){this._bounds.addVertices(this.transform,this.v