All Downloads are FREE. Search and download functionalities are using the official Maven repository.

view.lib.pixi.js.map Maven / Gradle / Ivy

Go to download

Runner / Testbed to locally run Games created using the CodinGame engine toolkit.

There is a newer version: 4.5.0
Show newest version
{"version":3,"sources":["node_modules/pixify/node_modules/browserify/node_modules/browser-pack/_prelude.js","node_modules/bit-twiddle/twiddle.js","node_modules/earcut/src/earcut.js","node_modules/eventemitter3/index.js","node_modules/ismobilejs/isMobile.js","node_modules/object-assign/index.js","node_modules/pixi-gl-core/src/GLBuffer.js","node_modules/pixi-gl-core/src/GLFramebuffer.js","node_modules/pixi-gl-core/src/GLShader.js","node_modules/pixi-gl-core/src/GLTexture.js","node_modules/pixi-gl-core/src/VertexArrayObject.js","node_modules/pixi-gl-core/src/createContext.js","node_modules/pixi-gl-core/src/index.js","node_modules/pixi-gl-core/src/setVertexAttribArrays.js","node_modules/pixi-gl-core/src/shader/compileProgram.js","node_modules/pixi-gl-core/src/shader/defaultValue.js","node_modules/pixi-gl-core/src/shader/extractAttributes.js","node_modules/pixi-gl-core/src/shader/extractUniforms.js","node_modules/pixi-gl-core/src/shader/generateUniformAccessObject.js","node_modules/pixi-gl-core/src/shader/index.js","node_modules/pixi-gl-core/src/shader/mapSize.js","node_modules/pixi-gl-core/src/shader/mapType.js","node_modules/pixify/node_modules/browserify/node_modules/path-browserify/index.js","node_modules/pixify/node_modules/browserify/node_modules/process/browser.js","node_modules/pixify/node_modules/browserify/node_modules/punycode/punycode.js","node_modules/pixify/node_modules/browserify/node_modules/querystring-es3/decode.js","node_modules/pixify/node_modules/browserify/node_modules/querystring-es3/encode.js","node_modules/pixify/node_modules/browserify/node_modules/querystring-es3/index.js","node_modules/pixify/node_modules/browserify/node_modules/url/url.js","node_modules/pixify/node_modules/browserify/node_modules/url/util.js","node_modules/resource-loader/node_modules/parse-uri/index.js","node_modules/resource-loader/src/Loader.js","node_modules/resource-loader/src/Resource.js","node_modules/resource-loader/src/async.js","node_modules/resource-loader/src/b64.js","node_modules/resource-loader/src/index.js","node_modules/resource-loader/src/middlewares/caching/memory.js","node_modules/resource-loader/src/middlewares/parsing/blob.js","src/accessibility/AccessibilityManager.js","src/accessibility/accessibleTarget.js","src/accessibility/index.js","src/core/Shader.js","src/core/const.js","src/core/display/Bounds.js","src/core/display/Container.js","src/core/display/DisplayObject.js","src/core/display/Transform.js","src/core/display/TransformBase.js","src/core/display/TransformStatic.js","src/core/graphics/Graphics.js","src/core/graphics/GraphicsData.js","src/core/graphics/canvas/CanvasGraphicsRenderer.js","src/core/graphics/utils/bezierCurveTo.js","src/core/graphics/webgl/GraphicsRenderer.js","src/core/graphics/webgl/WebGLGraphicsData.js","src/core/graphics/webgl/shaders/PrimitiveShader.js","src/core/graphics/webgl/utils/buildCircle.js","src/core/graphics/webgl/utils/buildLine.js","src/core/graphics/webgl/utils/buildPoly.js","src/core/graphics/webgl/utils/buildRectangle.js","src/core/graphics/webgl/utils/buildRoundedRectangle.js","src/core/index.js","src/core/math/GroupD8.js","src/core/math/Matrix.js","src/core/math/ObservablePoint.js","src/core/math/Point.js","src/core/math/index.js","src/core/math/shapes/Circle.js","src/core/math/shapes/Ellipse.js","src/core/math/shapes/Polygon.js","src/core/math/shapes/Rectangle.js","src/core/math/shapes/RoundedRectangle.js","src/core/renderers/SystemRenderer.js","src/core/renderers/canvas/CanvasRenderer.js","src/core/renderers/canvas/utils/CanvasMaskManager.js","src/core/renderers/canvas/utils/CanvasRenderTarget.js","src/core/renderers/canvas/utils/canUseNewCanvasBlendModes.js","src/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js","src/core/renderers/webgl/TextureGarbageCollector.js","src/core/renderers/webgl/TextureManager.js","src/core/renderers/webgl/WebGLRenderer.js","src/core/renderers/webgl/WebGLState.js","src/core/renderers/webgl/filters/Filter.js","src/core/renderers/webgl/filters/extractUniformsFromSrc.js","src/core/renderers/webgl/filters/filterTransforms.js","src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js","src/core/renderers/webgl/managers/FilterManager.js","src/core/renderers/webgl/managers/MaskManager.js","src/core/renderers/webgl/managers/StencilManager.js","src/core/renderers/webgl/managers/WebGLManager.js","src/core/renderers/webgl/utils/ObjectRenderer.js","src/core/renderers/webgl/utils/Quad.js","src/core/renderers/webgl/utils/RenderTarget.js","src/core/renderers/webgl/utils/checkMaxIfStatmentsInShader.js","src/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js","src/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js","src/core/renderers/webgl/utils/validateContext.js","src/core/settings.js","src/core/sprites/Sprite.js","src/core/sprites/canvas/CanvasSpriteRenderer.js","src/core/sprites/canvas/CanvasTinter.js","src/core/sprites/webgl/BatchBuffer.js","src/core/sprites/webgl/SpriteRenderer.js","src/core/sprites/webgl/generateMultiTextureShader.js","src/core/text/Text.js","src/core/text/TextStyle.js","src/core/textures/BaseRenderTexture.js","src/core/textures/BaseTexture.js","src/core/textures/RenderTexture.js","src/core/textures/Texture.js","src/core/textures/TextureUvs.js","src/core/textures/VideoBaseTexture.js","src/core/ticker/Ticker.js","src/core/ticker/index.js","src/core/utils/canUploadSameBuffer.js","src/core/utils/createIndicesForQuads.js","src/core/utils/determineCrossOrigin.js","src/core/utils/index.js","src/core/utils/maxRecommendedTextures.js","src/core/utils/pluginTarget.js","src/deprecation.js","src/extract/canvas/CanvasExtract.js","src/extract/index.js","src/extract/webgl/WebGLExtract.js","src/extras/AnimatedSprite.js","src/extras/BitmapText.js","src/extras/TextureTransform.js","src/extras/TilingSprite.js","src/extras/cacheAsBitmap.js","src/extras/getChildByName.js","src/extras/getGlobalPosition.js","src/extras/index.js","src/extras/webgl/TilingSpriteRenderer.js","src/filters/blur/BlurFilter.js","src/filters/blur/BlurXFilter.js","src/filters/blur/BlurYFilter.js","src/filters/blur/generateBlurFragSource.js","src/filters/blur/generateBlurVertSource.js","src/filters/blur/getMaxBlurKernelSize.js","src/filters/colormatrix/ColorMatrixFilter.js","src/filters/displacement/DisplacementFilter.js","src/filters/fxaa/FXAAFilter.js","src/filters/index.js","src/filters/noise/NoiseFilter.js","src/filters/void/VoidFilter.js","src/interaction/InteractionData.js","src/interaction/InteractionEvent.js","src/interaction/InteractionManager.js","src/interaction/index.js","src/interaction/interactiveTarget.js","src/loaders/bitmapFontParser.js","src/loaders/index.js","src/loaders/loader.js","src/loaders/spritesheetParser.js","src/loaders/textureParser.js","src/mesh/Mesh.js","src/mesh/NineSlicePlane.js","src/mesh/Plane.js","src/mesh/Rope.js","src/mesh/canvas/CanvasMeshRenderer.js","src/mesh/index.js","src/mesh/webgl/MeshRenderer.js","src/particles/ParticleContainer.js","src/particles/index.js","src/particles/webgl/ParticleBuffer.js","src/particles/webgl/ParticleRenderer.js","src/particles/webgl/ParticleShader.js","src/polyfill/Math.sign.js","src/polyfill/Object.assign.js","src/polyfill/index.js","src/polyfill/requestAnimationFrame.js","src/prepare/BasePrepare.js","src/prepare/canvas/CanvasPrepare.js","src/prepare/index.js","src/prepare/limiters/CountLimiter.js","src/prepare/limiters/TimeLimiter.js","src/prepare/webgl/WebGLPrepare.js","src/index.js"],"names":[],"mappings":";;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AChOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACrhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5tBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5eA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACh5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACnEA;;IAAY;;AACZ;;;;AACA;;;;;;;;;;AAEA;AACA,OAAO,MAAP,CACI,KAAK,aAAL,CAAmB,SADvB;;AAKA,IAAM,eAAe,CAArB;;AAEA,IAAM,iBAAiB,GAAvB;AACA,IAAM,kBAAkB,CAAxB;AACA,IAAM,kBAAkB,CAAxB;AACA,IAAM,mBAAmB,CAAzB;;AAEA,IAAM,gBAAgB,CAAtB;AACA,IAAM,iBAAiB,CAAC,IAAxB;AACA,IAAM,iBAAiB,CAAC,IAAxB;AACA,IAAM,kBAAkB,CAAxB;;AAEA;;;;;;;;;;;;IAWqB;AAEjB;;;AAGA,kCAAY,QAAZ,EACA;AAAA;;AACI,YAAI,CAAC,qBAAO,MAAP,IAAiB,qBAAO,KAAzB,KAAmC,CAAC,UAAU,UAAlD,EACA;AACI,iBAAK,eAAL;AACH;;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;;;;AAvBA;;;AAJA;;AAkCA,IAAM,SAAS,WAAW,QAAQ,MAAnB,GAA4B,IAAI,QAAQ,MAAZ,EAA5B,GAAmD,IAAlE,EAAwE;;QAE/D,SAAA;;AAET;;AACA,OAAO,IAAP,GAAc,OAAd,EAAuB","file":"pixi.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o 0) - (v < 0);\n}\n\n//Computes absolute value of integer\nexports.abs = function(v) {\n  var mask = v >> (INT_BITS-1);\n  return (v ^ mask) - mask;\n}\n\n//Computes minimum of integers x and y\nexports.min = function(x, y) {\n  return y ^ ((x ^ y) & -(x < y));\n}\n\n//Computes maximum of integers x and y\nexports.max = function(x, y) {\n  return x ^ ((x ^ y) & -(x < y));\n}\n\n//Checks if a number is a power of two\nexports.isPow2 = function(v) {\n  return !(v & (v-1)) && (!!v);\n}\n\n//Computes log base 2 of v\nexports.log2 = function(v) {\n  var r, shift;\n  r =     (v > 0xFFFF) << 4; v >>>= r;\n  shift = (v > 0xFF  ) << 3; v >>>= shift; r |= shift;\n  shift = (v > 0xF   ) << 2; v >>>= shift; r |= shift;\n  shift = (v > 0x3   ) << 1; v >>>= shift; r |= shift;\n  return r | (v >> 1);\n}\n\n//Computes log base 10 of v\nexports.log10 = function(v) {\n  return  (v >= 1000000000) ? 9 : (v >= 100000000) ? 8 : (v >= 10000000) ? 7 :\n          (v >= 1000000) ? 6 : (v >= 100000) ? 5 : (v >= 10000) ? 4 :\n          (v >= 1000) ? 3 : (v >= 100) ? 2 : (v >= 10) ? 1 : 0;\n}\n\n//Counts number of bits\nexports.popCount = function(v) {\n  v = v - ((v >>> 1) & 0x55555555);\n  v = (v & 0x33333333) + ((v >>> 2) & 0x33333333);\n  return ((v + (v >>> 4) & 0xF0F0F0F) * 0x1010101) >>> 24;\n}\n\n//Counts number of trailing zeros\nfunction countTrailingZeros(v) {\n  var c = 32;\n  v &= -v;\n  if (v) c--;\n  if (v & 0x0000FFFF) c -= 16;\n  if (v & 0x00FF00FF) c -= 8;\n  if (v & 0x0F0F0F0F) c -= 4;\n  if (v & 0x33333333) c -= 2;\n  if (v & 0x55555555) c -= 1;\n  return c;\n}\nexports.countTrailingZeros = countTrailingZeros;\n\n//Rounds to next power of 2\nexports.nextPow2 = function(v) {\n  v += v === 0;\n  --v;\n  v |= v >>> 1;\n  v |= v >>> 2;\n  v |= v >>> 4;\n  v |= v >>> 8;\n  v |= v >>> 16;\n  return v + 1;\n}\n\n//Rounds down to previous power of 2\nexports.prevPow2 = function(v) {\n  v |= v >>> 1;\n  v |= v >>> 2;\n  v |= v >>> 4;\n  v |= v >>> 8;\n  v |= v >>> 16;\n  return v - (v>>>1);\n}\n\n//Computes parity of word\nexports.parity = function(v) {\n  v ^= v >>> 16;\n  v ^= v >>> 8;\n  v ^= v >>> 4;\n  v &= 0xf;\n  return (0x6996 >>> v) & 1;\n}\n\nvar REVERSE_TABLE = new Array(256);\n\n(function(tab) {\n  for(var i=0; i<256; ++i) {\n    var v = i, r = i, s = 7;\n    for (v >>>= 1; v; v >>>= 1) {\n      r <<= 1;\n      r |= v & 1;\n      --s;\n    }\n    tab[i] = (r << s) & 0xff;\n  }\n})(REVERSE_TABLE);\n\n//Reverse bits in a 32 bit word\nexports.reverse = function(v) {\n  return  (REVERSE_TABLE[ v         & 0xff] << 24) |\n          (REVERSE_TABLE[(v >>> 8)  & 0xff] << 16) |\n          (REVERSE_TABLE[(v >>> 16) & 0xff] << 8)  |\n           REVERSE_TABLE[(v >>> 24) & 0xff];\n}\n\n//Interleave bits of 2 coordinates with 16 bits.  Useful for fast quadtree codes\nexports.interleave2 = function(x, y) {\n  x &= 0xFFFF;\n  x = (x | (x << 8)) & 0x00FF00FF;\n  x = (x | (x << 4)) & 0x0F0F0F0F;\n  x = (x | (x << 2)) & 0x33333333;\n  x = (x | (x << 1)) & 0x55555555;\n\n  y &= 0xFFFF;\n  y = (y | (y << 8)) & 0x00FF00FF;\n  y = (y | (y << 4)) & 0x0F0F0F0F;\n  y = (y | (y << 2)) & 0x33333333;\n  y = (y | (y << 1)) & 0x55555555;\n\n  return x | (y << 1);\n}\n\n//Extracts the nth interleaved component\nexports.deinterleave2 = function(v, n) {\n  v = (v >>> n) & 0x55555555;\n  v = (v | (v >>> 1))  & 0x33333333;\n  v = (v | (v >>> 2))  & 0x0F0F0F0F;\n  v = (v | (v >>> 4))  & 0x00FF00FF;\n  v = (v | (v >>> 16)) & 0x000FFFF;\n  return (v << 16) >> 16;\n}\n\n\n//Interleave bits of 3 coordinates, each with 10 bits.  Useful for fast octree codes\nexports.interleave3 = function(x, y, z) {\n  x &= 0x3FF;\n  x  = (x | (x<<16)) & 4278190335;\n  x  = (x | (x<<8))  & 251719695;\n  x  = (x | (x<<4))  & 3272356035;\n  x  = (x | (x<<2))  & 1227133513;\n\n  y &= 0x3FF;\n  y  = (y | (y<<16)) & 4278190335;\n  y  = (y | (y<<8))  & 251719695;\n  y  = (y | (y<<4))  & 3272356035;\n  y  = (y | (y<<2))  & 1227133513;\n  x |= (y << 1);\n  \n  z &= 0x3FF;\n  z  = (z | (z<<16)) & 4278190335;\n  z  = (z | (z<<8))  & 251719695;\n  z  = (z | (z<<4))  & 3272356035;\n  z  = (z | (z<<2))  & 1227133513;\n  \n  return x | (z << 2);\n}\n\n//Extracts nth interleaved component of a 3-tuple\nexports.deinterleave3 = function(v, n) {\n  v = (v >>> n)       & 1227133513;\n  v = (v | (v>>>2))   & 3272356035;\n  v = (v | (v>>>4))   & 251719695;\n  v = (v | (v>>>8))   & 4278190335;\n  v = (v | (v>>>16))  & 0x3FF;\n  return (v<<22)>>22;\n}\n\n//Computes next combination in colexicographic order (this is mistakenly called nextPermutation on the bit twiddling hacks page)\nexports.nextCombination = function(v) {\n  var t = v | (v - 1);\n  return (t + 1) | (((~t & -~t) - 1) >>> (countTrailingZeros(v) + 1));\n}\n\n","'use strict';\n\nmodule.exports = earcut;\n\nfunction earcut(data, holeIndices, dim) {\n\n    dim = dim || 2;\n\n    var hasHoles = holeIndices && holeIndices.length,\n        outerLen = hasHoles ? holeIndices[0] * dim : data.length,\n        outerNode = linkedList(data, 0, outerLen, dim, true),\n        triangles = [];\n\n    if (!outerNode) return triangles;\n\n    var minX, minY, maxX, maxY, x, y, size;\n\n    if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n    // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n    if (data.length > 80 * dim) {\n        minX = maxX = data[0];\n        minY = maxY = data[1];\n\n        for (var i = dim; i < outerLen; i += dim) {\n            x = data[i];\n            y = data[i + 1];\n            if (x < minX) minX = x;\n            if (y < minY) minY = y;\n            if (x > maxX) maxX = x;\n            if (y > maxY) maxY = y;\n        }\n\n        // minX, minY and size are later used to transform coords into integers for z-order calculation\n        size = Math.max(maxX - minX, maxY - minY);\n    }\n\n    earcutLinked(outerNode, triangles, dim, minX, minY, size);\n\n    return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n    var i, last;\n\n    if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n        for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n    } else {\n        for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n    }\n\n    if (last && equals(last, last.next)) {\n        removeNode(last);\n        last = last.next;\n    }\n\n    return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n    if (!start) return start;\n    if (!end) end = start;\n\n    var p = start,\n        again;\n    do {\n        again = false;\n\n        if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n            removeNode(p);\n            p = end = p.prev;\n            if (p === p.next) return null;\n            again = true;\n\n        } else {\n            p = p.next;\n        }\n    } while (again || p !== end);\n\n    return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, size, pass) {\n    if (!ear) return;\n\n    // interlink polygon nodes in z-order\n    if (!pass && size) indexCurve(ear, minX, minY, size);\n\n    var stop = ear,\n        prev, next;\n\n    // iterate through ears, slicing them one by one\n    while (ear.prev !== ear.next) {\n        prev = ear.prev;\n        next = ear.next;\n\n        if (size ? isEarHashed(ear, minX, minY, size) : isEar(ear)) {\n            // cut off the triangle\n            triangles.push(prev.i / dim);\n            triangles.push(ear.i / dim);\n            triangles.push(next.i / dim);\n\n            removeNode(ear);\n\n            // skipping the next vertice leads to less sliver triangles\n            ear = next.next;\n            stop = next.next;\n\n            continue;\n        }\n\n        ear = next;\n\n        // if we looped through the whole remaining polygon and can't find any more ears\n        if (ear === stop) {\n            // try filtering points and slicing again\n            if (!pass) {\n                earcutLinked(filterPoints(ear), triangles, dim, minX, minY, size, 1);\n\n            // if this didn't work, try curing all small self-intersections locally\n            } else if (pass === 1) {\n                ear = cureLocalIntersections(ear, triangles, dim);\n                earcutLinked(ear, triangles, dim, minX, minY, size, 2);\n\n            // as a last resort, try splitting the remaining polygon into two\n            } else if (pass === 2) {\n                splitEarcut(ear, triangles, dim, minX, minY, size);\n            }\n\n            break;\n        }\n    }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n    var a = ear.prev,\n        b = ear,\n        c = ear.next;\n\n    if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n    // now make sure we don't have other points inside the potential ear\n    var p = ear.next.next;\n\n    while (p !== ear.prev) {\n        if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n            area(p.prev, p, p.next) >= 0) return false;\n        p = p.next;\n    }\n\n    return true;\n}\n\nfunction isEarHashed(ear, minX, minY, size) {\n    var a = ear.prev,\n        b = ear,\n        c = ear.next;\n\n    if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n    // triangle bbox; min & max are calculated like this for speed\n    var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x),\n        minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y),\n        maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x),\n        maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y);\n\n    // z-order range for the current triangle bbox;\n    var minZ = zOrder(minTX, minTY, minX, minY, size),\n        maxZ = zOrder(maxTX, maxTY, minX, minY, size);\n\n    // first look for points inside the triangle in increasing z-order\n    var p = ear.nextZ;\n\n    while (p && p.z <= maxZ) {\n        if (p !== ear.prev && p !== ear.next &&\n            pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n            area(p.prev, p, p.next) >= 0) return false;\n        p = p.nextZ;\n    }\n\n    // then look for points in decreasing z-order\n    p = ear.prevZ;\n\n    while (p && p.z >= minZ) {\n        if (p !== ear.prev && p !== ear.next &&\n            pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n            area(p.prev, p, p.next) >= 0) return false;\n        p = p.prevZ;\n    }\n\n    return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles, dim) {\n    var p = start;\n    do {\n        var a = p.prev,\n            b = p.next.next;\n\n        if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n            triangles.push(a.i / dim);\n            triangles.push(p.i / dim);\n            triangles.push(b.i / dim);\n\n            // remove two nodes involved\n            removeNode(p);\n            removeNode(p.next);\n\n            p = start = b;\n        }\n        p = p.next;\n    } while (p !== start);\n\n    return p;\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, size) {\n    // look for a valid diagonal that divides the polygon into two\n    var a = start;\n    do {\n        var b = a.next.next;\n        while (b !== a.prev) {\n            if (a.i !== b.i && isValidDiagonal(a, b)) {\n                // split the polygon in two by the diagonal\n                var c = splitPolygon(a, b);\n\n                // filter colinear points around the cuts\n                a = filterPoints(a, a.next);\n                c = filterPoints(c, c.next);\n\n                // run earcut on each half\n                earcutLinked(a, triangles, dim, minX, minY, size);\n                earcutLinked(c, triangles, dim, minX, minY, size);\n                return;\n            }\n            b = b.next;\n        }\n        a = a.next;\n    } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n    var queue = [],\n        i, len, start, end, list;\n\n    for (i = 0, len = holeIndices.length; i < len; i++) {\n        start = holeIndices[i] * dim;\n        end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n        list = linkedList(data, start, end, dim, false);\n        if (list === list.next) list.steiner = true;\n        queue.push(getLeftmost(list));\n    }\n\n    queue.sort(compareX);\n\n    // process holes from left to right\n    for (i = 0; i < queue.length; i++) {\n        eliminateHole(queue[i], outerNode);\n        outerNode = filterPoints(outerNode, outerNode.next);\n    }\n\n    return outerNode;\n}\n\nfunction compareX(a, b) {\n    return a.x - b.x;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n    outerNode = findHoleBridge(hole, outerNode);\n    if (outerNode) {\n        var b = splitPolygon(outerNode, hole);\n        filterPoints(b, b.next);\n    }\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n    var p = outerNode,\n        hx = hole.x,\n        hy = hole.y,\n        qx = -Infinity,\n        m;\n\n    // find a segment intersected by a ray from the hole's leftmost point to the left;\n    // segment's endpoint with lesser x will be potential connection point\n    do {\n        if (hy <= p.y && hy >= p.next.y) {\n            var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n            if (x <= hx && x > qx) {\n                qx = x;\n                if (x === hx) {\n                    if (hy === p.y) return p;\n                    if (hy === p.next.y) return p.next;\n                }\n                m = p.x < p.next.x ? p : p.next;\n            }\n        }\n        p = p.next;\n    } while (p !== outerNode);\n\n    if (!m) return null;\n\n    if (hx === qx) return m.prev; // hole touches outer segment; pick lower endpoint\n\n    // look for points inside the triangle of hole point, segment intersection and endpoint;\n    // if there are no points found, we have a valid connection;\n    // otherwise choose the point of the minimum angle with the ray as connection point\n\n    var stop = m,\n        mx = m.x,\n        my = m.y,\n        tanMin = Infinity,\n        tan;\n\n    p = m.next;\n\n    while (p !== stop) {\n        if (hx >= p.x && p.x >= mx &&\n                pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n            tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n            if ((tan < tanMin || (tan === tanMin && p.x > m.x)) && locallyInside(p, hole)) {\n                m = p;\n                tanMin = tan;\n            }\n        }\n\n        p = p.next;\n    }\n\n    return m;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, size) {\n    var p = start;\n    do {\n        if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, size);\n        p.prevZ = p.prev;\n        p.nextZ = p.next;\n        p = p.next;\n    } while (p !== start);\n\n    p.prevZ.nextZ = null;\n    p.prevZ = null;\n\n    sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n    var i, p, q, e, tail, numMerges, pSize, qSize,\n        inSize = 1;\n\n    do {\n        p = list;\n        list = null;\n        tail = null;\n        numMerges = 0;\n\n        while (p) {\n            numMerges++;\n            q = p;\n            pSize = 0;\n            for (i = 0; i < inSize; i++) {\n                pSize++;\n                q = q.nextZ;\n                if (!q) break;\n            }\n\n            qSize = inSize;\n\n            while (pSize > 0 || (qSize > 0 && q)) {\n\n                if (pSize === 0) {\n                    e = q;\n                    q = q.nextZ;\n                    qSize--;\n                } else if (qSize === 0 || !q) {\n                    e = p;\n                    p = p.nextZ;\n                    pSize--;\n                } else if (p.z <= q.z) {\n                    e = p;\n                    p = p.nextZ;\n                    pSize--;\n                } else {\n                    e = q;\n                    q = q.nextZ;\n                    qSize--;\n                }\n\n                if (tail) tail.nextZ = e;\n                else list = e;\n\n                e.prevZ = tail;\n                tail = e;\n            }\n\n            p = q;\n        }\n\n        tail.nextZ = null;\n        inSize *= 2;\n\n    } while (numMerges > 1);\n\n    return list;\n}\n\n// z-order of a point given coords and size of the data bounding box\nfunction zOrder(x, y, minX, minY, size) {\n    // coords are transformed into non-negative 15-bit integer range\n    x = 32767 * (x - minX) / size;\n    y = 32767 * (y - minY) / size;\n\n    x = (x | (x << 8)) & 0x00FF00FF;\n    x = (x | (x << 4)) & 0x0F0F0F0F;\n    x = (x | (x << 2)) & 0x33333333;\n    x = (x | (x << 1)) & 0x55555555;\n\n    y = (y | (y << 8)) & 0x00FF00FF;\n    y = (y | (y << 4)) & 0x0F0F0F0F;\n    y = (y | (y << 2)) & 0x33333333;\n    y = (y | (y << 1)) & 0x55555555;\n\n    return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n    var p = start,\n        leftmost = start;\n    do {\n        if (p.x < leftmost.x) leftmost = p;\n        p = p.next;\n    } while (p !== start);\n\n    return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n    return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n           (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n           (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n    return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) &&\n           locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b);\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n    return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n    return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n    if ((equals(p1, q1) && equals(p2, q2)) ||\n        (equals(p1, q2) && equals(p2, q1))) return true;\n    return area(p1, q1, p2) > 0 !== area(p1, q1, q2) > 0 &&\n           area(p2, q2, p1) > 0 !== area(p2, q2, q1) > 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n    var p = a;\n    do {\n        if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n                intersects(p, p.next, a, b)) return true;\n        p = p.next;\n    } while (p !== a);\n\n    return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n    return area(a.prev, a, a.next) < 0 ?\n        area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n        area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n    var p = a,\n        inside = false,\n        px = (a.x + b.x) / 2,\n        py = (a.y + b.y) / 2;\n    do {\n        if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n            inside = !inside;\n        p = p.next;\n    } while (p !== a);\n\n    return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n    var a2 = new Node(a.i, a.x, a.y),\n        b2 = new Node(b.i, b.x, b.y),\n        an = a.next,\n        bp = b.prev;\n\n    a.next = b;\n    b.prev = a;\n\n    a2.next = an;\n    an.prev = a2;\n\n    b2.next = a2;\n    a2.prev = b2;\n\n    bp.next = b2;\n    b2.prev = bp;\n\n    return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n    var p = new Node(i, x, y);\n\n    if (!last) {\n        p.prev = p;\n        p.next = p;\n\n    } else {\n        p.next = last.next;\n        p.prev = last;\n        last.next.prev = p;\n        last.next = p;\n    }\n    return p;\n}\n\nfunction removeNode(p) {\n    p.next.prev = p.prev;\n    p.prev.next = p.next;\n\n    if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n    if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction Node(i, x, y) {\n    // vertice index in coordinates array\n    this.i = i;\n\n    // vertex coordinates\n    this.x = x;\n    this.y = y;\n\n    // previous and next vertice nodes in a polygon ring\n    this.prev = null;\n    this.next = null;\n\n    // z-order curve value\n    this.z = null;\n\n    // previous and next nodes in z-order\n    this.prevZ = null;\n    this.nextZ = null;\n\n    // indicates whether this is a steiner point\n    this.steiner = false;\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nearcut.deviation = function (data, holeIndices, dim, triangles) {\n    var hasHoles = holeIndices && holeIndices.length;\n    var outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n    var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n    if (hasHoles) {\n        for (var i = 0, len = holeIndices.length; i < len; i++) {\n            var start = holeIndices[i] * dim;\n            var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n            polygonArea -= Math.abs(signedArea(data, start, end, dim));\n        }\n    }\n\n    var trianglesArea = 0;\n    for (i = 0; i < triangles.length; i += 3) {\n        var a = triangles[i] * dim;\n        var b = triangles[i + 1] * dim;\n        var c = triangles[i + 2] * dim;\n        trianglesArea += Math.abs(\n            (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n            (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n    }\n\n    return polygonArea === 0 && trianglesArea === 0 ? 0 :\n        Math.abs((trianglesArea - polygonArea) / polygonArea);\n};\n\nfunction signedArea(data, start, end, dim) {\n    var sum = 0;\n    for (var i = start, j = end - dim; i < end; i += dim) {\n        sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n        j = i;\n    }\n    return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nearcut.flatten = function (data) {\n    var dim = data[0][0].length,\n        result = {vertices: [], holes: [], dimensions: dim},\n        holeIndex = 0;\n\n    for (var i = 0; i < data.length; i++) {\n        for (var j = 0; j < data[i].length; j++) {\n            for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);\n        }\n        if (i > 0) {\n            holeIndex += data[i - 1].length;\n            result.holes.push(holeIndex);\n        }\n    }\n    return result;\n};\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n  , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n  Events.prototype = Object.create(null);\n\n  //\n  // This hack is needed because the `__proto__` property is still inherited in\n  // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n  //\n  if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n  this.fn = fn;\n  this.context = context;\n  this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n  this._events = new Events();\n  this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n  var names = []\n    , events\n    , name;\n\n  if (this._eventsCount === 0) return names;\n\n  for (name in (events = this._events)) {\n    if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n  }\n\n  if (Object.getOwnPropertySymbols) {\n    return names.concat(Object.getOwnPropertySymbols(events));\n  }\n\n  return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n  var evt = prefix ? prefix + event : event\n    , available = this._events[evt];\n\n  if (exists) return !!available;\n  if (!available) return [];\n  if (available.fn) return [available.fn];\n\n  for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n    ee[i] = available[i].fn;\n  }\n\n  return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n  var evt = prefix ? prefix + event : event;\n\n  if (!this._events[evt]) return false;\n\n  var listeners = this._events[evt]\n    , len = arguments.length\n    , args\n    , i;\n\n  if (listeners.fn) {\n    if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n    switch (len) {\n      case 1: return listeners.fn.call(listeners.context), true;\n      case 2: return listeners.fn.call(listeners.context, a1), true;\n      case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n      case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n      case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n      case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n    }\n\n    for (i = 1, args = new Array(len -1); i < len; i++) {\n      args[i - 1] = arguments[i];\n    }\n\n    listeners.fn.apply(listeners.context, args);\n  } else {\n    var length = listeners.length\n      , j;\n\n    for (i = 0; i < length; i++) {\n      if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n      switch (len) {\n        case 1: listeners[i].fn.call(listeners[i].context); break;\n        case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n        case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n        case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n        default:\n          if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n            args[j - 1] = arguments[j];\n          }\n\n          listeners[i].fn.apply(listeners[i].context, args);\n      }\n    }\n  }\n\n  return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n  var listener = new EE(fn, context || this)\n    , evt = prefix ? prefix + event : event;\n\n  if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n  else if (!this._events[evt].fn) this._events[evt].push(listener);\n  else this._events[evt] = [this._events[evt], listener];\n\n  return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n  var listener = new EE(fn, context || this, true)\n    , evt = prefix ? prefix + event : event;\n\n  if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n  else if (!this._events[evt].fn) this._events[evt].push(listener);\n  else this._events[evt] = [this._events[evt], listener];\n\n  return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n  var evt = prefix ? prefix + event : event;\n\n  if (!this._events[evt]) return this;\n  if (!fn) {\n    if (--this._eventsCount === 0) this._events = new Events();\n    else delete this._events[evt];\n    return this;\n  }\n\n  var listeners = this._events[evt];\n\n  if (listeners.fn) {\n    if (\n         listeners.fn === fn\n      && (!once || listeners.once)\n      && (!context || listeners.context === context)\n    ) {\n      if (--this._eventsCount === 0) this._events = new Events();\n      else delete this._events[evt];\n    }\n  } else {\n    for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n      if (\n           listeners[i].fn !== fn\n        || (once && !listeners[i].once)\n        || (context && listeners[i].context !== context)\n      ) {\n        events.push(listeners[i]);\n      }\n    }\n\n    //\n    // Reset the array, or remove it completely if we have no more listeners.\n    //\n    if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n    else if (--this._eventsCount === 0) this._events = new Events();\n    else delete this._events[evt];\n  }\n\n  return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n  var evt;\n\n  if (event) {\n    evt = prefix ? prefix + event : event;\n    if (this._events[evt]) {\n      if (--this._eventsCount === 0) this._events = new Events();\n      else delete this._events[evt];\n    }\n  } else {\n    this._events = new Events();\n    this._eventsCount = 0;\n  }\n\n  return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n  return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n  module.exports = EventEmitter;\n}\n","/**\n * isMobile.js v0.4.0\n *\n * A simple library to detect Apple phones and tablets,\n * Android phones and tablets, other mobile devices (like blackberry, mini-opera and windows phone),\n * and any kind of seven inch device, via user agent sniffing.\n *\n * @author: Kai Mallea ([email protected])\n *\n * @license: http://creativecommons.org/publicdomain/zero/1.0/\n */\n(function (global) {\n\n    var apple_phone         = /iPhone/i,\n        apple_ipod          = /iPod/i,\n        apple_tablet        = /iPad/i,\n        android_phone       = /(?=.*\\bAndroid\\b)(?=.*\\bMobile\\b)/i, // Match 'Android' AND 'Mobile'\n        android_tablet      = /Android/i,\n        amazon_phone        = /(?=.*\\bAndroid\\b)(?=.*\\bSD4930UR\\b)/i,\n        amazon_tablet       = /(?=.*\\bAndroid\\b)(?=.*\\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\\b)/i,\n        windows_phone       = /IEMobile/i,\n        windows_tablet      = /(?=.*\\bWindows\\b)(?=.*\\bARM\\b)/i, // Match 'Windows' AND 'ARM'\n        other_blackberry    = /BlackBerry/i,\n        other_blackberry_10 = /BB10/i,\n        other_opera         = /Opera Mini/i,\n        other_chrome        = /(CriOS|Chrome)(?=.*\\bMobile\\b)/i,\n        other_firefox       = /(?=.*\\bFirefox\\b)(?=.*\\bMobile\\b)/i, // Match 'Firefox' AND 'Mobile'\n        seven_inch = new RegExp(\n            '(?:' +         // Non-capturing group\n\n            'Nexus 7' +     // Nexus 7\n\n            '|' +           // OR\n\n            'BNTV250' +     // B&N Nook Tablet 7 inch\n\n            '|' +           // OR\n\n            'Kindle Fire' + // Kindle Fire\n\n            '|' +           // OR\n\n            'Silk' +        // Kindle Fire, Silk Accelerated\n\n            '|' +           // OR\n\n            'GT-P1000' +    // Galaxy Tab 7 inch\n\n            ')',            // End non-capturing group\n\n            'i');           // Case-insensitive matching\n\n    var match = function(regex, userAgent) {\n        return regex.test(userAgent);\n    };\n\n    var IsMobileClass = function(userAgent) {\n        var ua = userAgent || navigator.userAgent;\n\n        // Facebook mobile app's integrated browser adds a bunch of strings that\n        // match everything. Strip it out if it exists.\n        var tmp = ua.split('[FBAN');\n        if (typeof tmp[1] !== 'undefined') {\n            ua = tmp[0];\n        }\n\n        // Twitter mobile app's integrated browser on iPad adds a \"Twitter for\n        // iPhone\" string. Same probable happens on other tablet platforms.\n        // This will confuse detection so strip it out if it exists.\n        tmp = ua.split('Twitter');\n        if (typeof tmp[1] !== 'undefined') {\n            ua = tmp[0];\n        }\n\n        this.apple = {\n            phone:  match(apple_phone, ua),\n            ipod:   match(apple_ipod, ua),\n            tablet: !match(apple_phone, ua) && match(apple_tablet, ua),\n            device: match(apple_phone, ua) || match(apple_ipod, ua) || match(apple_tablet, ua)\n        };\n        this.amazon = {\n            phone:  match(amazon_phone, ua),\n            tablet: !match(amazon_phone, ua) && match(amazon_tablet, ua),\n            device: match(amazon_phone, ua) || match(amazon_tablet, ua)\n        };\n        this.android = {\n            phone:  match(amazon_phone, ua) || match(android_phone, ua),\n            tablet: !match(amazon_phone, ua) && !match(android_phone, ua) && (match(amazon_tablet, ua) || match(android_tablet, ua)),\n            device: match(amazon_phone, ua) || match(amazon_tablet, ua) || match(android_phone, ua) || match(android_tablet, ua)\n        };\n        this.windows = {\n            phone:  match(windows_phone, ua),\n            tablet: match(windows_tablet, ua),\n            device: match(windows_phone, ua) || match(windows_tablet, ua)\n        };\n        this.other = {\n            blackberry:   match(other_blackberry, ua),\n            blackberry10: match(other_blackberry_10, ua),\n            opera:        match(other_opera, ua),\n            firefox:      match(other_firefox, ua),\n            chrome:       match(other_chrome, ua),\n            device:       match(other_blackberry, ua) || match(other_blackberry_10, ua) || match(other_opera, ua) || match(other_firefox, ua) || match(other_chrome, ua)\n        };\n        this.seven_inch = match(seven_inch, ua);\n        this.any = this.apple.device || this.android.device || this.windows.device || this.other.device || this.seven_inch;\n\n        // excludes 'other' devices and ipods, targeting touchscreen phones\n        this.phone = this.apple.phone || this.android.phone || this.windows.phone;\n\n        // excludes 7 inch devices, classifying as phone or tablet is left to the user\n        this.tablet = this.apple.tablet || this.android.tablet || this.windows.tablet;\n\n        if (typeof window === 'undefined') {\n            return this;\n        }\n    };\n\n    var instantiate = function() {\n        var IM = new IsMobileClass();\n        IM.Class = IsMobileClass;\n        return IM;\n    };\n\n    if (typeof module !== 'undefined' && module.exports && typeof window === 'undefined') {\n        //node\n        module.exports = IsMobileClass;\n    } else if (typeof module !== 'undefined' && module.exports && typeof window !== 'undefined') {\n        //browserify\n        module.exports = instantiate();\n    } else if (typeof define === 'function' && define.amd) {\n        //AMD\n        define('isMobile', [], global.isMobile = instantiate());\n    } else {\n        global.isMobile = instantiate();\n    }\n\n})(this);\n","'use strict';\n/* eslint-disable no-unused-vars */\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc');  // eslint-disable-line\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (e) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (Object.getOwnPropertySymbols) {\n\t\t\tsymbols = Object.getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","var EMPTY_ARRAY_BUFFER = new ArrayBuffer(0);\n\n/**\n * Helper class to create a webGL buffer\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param type {gl.ARRAY_BUFFER | gl.ELEMENT_ARRAY_BUFFER} @mat\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data\n * @param drawType {gl.STATIC_DRAW|gl.DYNAMIC_DRAW|gl.STREAM_DRAW}\n */\nvar Buffer = function(gl, type, data, drawType)\n{\n\n\t/**\n     * The current WebGL rendering context\n     *\n     * @member {WebGLRenderingContext}\n     */\n\tthis.gl = gl;\n\n\t/**\n     * The WebGL buffer, created upon instantiation\n     *\n     * @member {WebGLBuffer}\n     */\n\tthis.buffer = gl.createBuffer(); \n\n\t/**\n     * The type of the buffer\n     *\n     * @member {gl.ARRAY_BUFFER|gl.ELEMENT_ARRAY_BUFFER}\n     */\n\tthis.type = type || gl.ARRAY_BUFFER;\n\n\t/**\n     * The draw type of the buffer\n     *\n     * @member {gl.STATIC_DRAW|gl.DYNAMIC_DRAW|gl.STREAM_DRAW}\n     */\n\tthis.drawType = drawType || gl.STATIC_DRAW;\n\n\t/**\n     * The data in the buffer, as a typed array\n     *\n     * @member {ArrayBuffer| SharedArrayBuffer|ArrayBufferView}\n     */\n\tthis.data = EMPTY_ARRAY_BUFFER;\n\n\tif(data)\n\t{\n\t\tthis.upload(data);\n\t}\n};\n\n/**\n * Uploads the buffer to the GPU\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data to upload\n * @param offset {Number} if only a subset of the data should be uploaded, this is the amount of data to subtract\n * @param dontBind {Boolean} whether to bind the buffer before uploading it\n */\nBuffer.prototype.upload = function(data, offset, dontBind)\n{\n\t// todo - needed?\n\tif(!dontBind) this.bind();\n\n\tvar gl = this.gl;\n\n\tdata = data || this.data;\n\toffset = offset || 0;\n\n\tif(this.data.byteLength >= data.byteLength)\n\t{\n\t\tgl.bufferSubData(this.type, offset, data);\n\t}\n\telse\n\t{\n\t\tgl.bufferData(this.type, data, this.drawType);\n\t}\n\n\tthis.data = data;\n};\n/**\n * Binds the buffer\n *\n */\nBuffer.prototype.bind = function()\n{\n\tvar gl = this.gl;\n\tgl.bindBuffer(this.type, this.buffer);\n};\n\nBuffer.createVertexBuffer = function(gl, data, drawType)\n{\n\treturn new Buffer(gl, gl.ARRAY_BUFFER, data, drawType);\n};\n\nBuffer.createIndexBuffer = function(gl, data, drawType)\n{\n\treturn new Buffer(gl, gl.ELEMENT_ARRAY_BUFFER, data, drawType);\n};\n\nBuffer.create = function(gl, type, data, drawType)\n{\n\treturn new Buffer(gl, type, data, drawType);\n};\n\n/**\n * Destroys the buffer\n *\n */\nBuffer.prototype.destroy = function(){\n\tthis.gl.deleteBuffer(this.buffer);\n};\n\nmodule.exports = Buffer;\n","\nvar Texture = require('./GLTexture');\n\n/**\n * Helper class to create a webGL Framebuffer\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param width {Number} the width of the drawing area of the frame buffer\n * @param height {Number} the height of the drawing area of the frame buffer\n */\nvar Framebuffer = function(gl, width, height)\n{\n    /**\n     * The current WebGL rendering context\n     *\n     * @member {WebGLRenderingContext}\n     */\n    this.gl = gl;\n\n    /**\n     * The frame buffer\n     *\n     * @member {WebGLFramebuffer}\n     */\n    this.framebuffer = gl.createFramebuffer();\n\n    /**\n     * The stencil buffer\n     *\n     * @member {WebGLRenderbuffer}\n     */\n    this.stencil = null;\n\n    /**\n     * The stencil buffer\n     *\n     * @member {PIXI.glCore.GLTexture}\n     */\n    this.texture = null;\n\n    /**\n     * The width of the drawing area of the buffer\n     *\n     * @member {Number}\n     */\n    this.width = width || 100;\n    /**\n     * The height of the drawing area of the buffer\n     *\n     * @member {Number}\n     */\n    this.height = height || 100;\n};\n\n/**\n * Adds a texture to the frame buffer\n * @param texture {PIXI.glCore.GLTexture}\n */\nFramebuffer.prototype.enableTexture = function(texture)\n{\n    var gl = this.gl;\n\n    this.texture = texture || new Texture(gl);\n\n    this.texture.bind();\n\n    //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA,  this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n\n    this.bind();\n\n    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture.texture, 0);\n};\n\n/**\n * Initialises the stencil buffer\n */\nFramebuffer.prototype.enableStencil = function()\n{\n    if(this.stencil)return;\n\n    var gl = this.gl;\n\n    this.stencil = gl.createRenderbuffer();\n\n    gl.bindRenderbuffer(gl.RENDERBUFFER, this.stencil);\n\n    // TODO.. this is depth AND stencil?\n    gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.stencil);\n    gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL,  this.width  , this.height );\n};\n\n/**\n * Erases the drawing area and fills it with a colour\n * @param  r {Number} the red value of the clearing colour\n * @param  g {Number} the green value of the clearing colour\n * @param  b {Number} the blue value of the clearing colour\n * @param  a {Number} the alpha value of the clearing colour\n */\nFramebuffer.prototype.clear = function( r, g, b, a )\n{\n    this.bind();\n\n    var gl = this.gl;\n\n    gl.clearColor(r, g, b, a);\n    gl.clear(gl.COLOR_BUFFER_BIT);\n};\n\n/**\n * Binds the frame buffer to the WebGL context\n */\nFramebuffer.prototype.bind = function()\n{\n    var gl = this.gl;\n    gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer );\n};\n\n/**\n * Unbinds the frame buffer to the WebGL context\n */\nFramebuffer.prototype.unbind = function()\n{\n    var gl = this.gl;\n    gl.bindFramebuffer(gl.FRAMEBUFFER, null );\n};\n/**\n * Resizes the drawing area of the buffer to the given width and height\n * @param  width  {Number} the new width\n * @param  height {Number} the new height\n */\nFramebuffer.prototype.resize = function(width, height)\n{\n    var gl = this.gl;\n\n    this.width = width;\n    this.height = height;\n\n    if ( this.texture )\n    {\n        this.texture.uploadData(null, width, height);\n    }\n\n    if ( this.stencil )\n    {\n        // update the stencil buffer width and height\n        gl.bindRenderbuffer(gl.RENDERBUFFER, this.stencil);\n        gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);\n    }\n};\n\n/**\n * Destroys this buffer\n */\nFramebuffer.prototype.destroy = function()\n{\n    var gl = this.gl;\n\n    //TODO\n    if(this.texture)\n    {\n        this.texture.destroy();\n    }\n\n    gl.deleteFramebuffer(this.framebuffer);\n\n    this.gl = null;\n\n    this.stencil = null;\n    this.texture = null;\n};\n\n/**\n * Creates a frame buffer with a texture containing the given data\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param width {Number} the width of the drawing area of the frame buffer\n * @param height {Number} the height of the drawing area of the frame buffer\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data\n */\nFramebuffer.createRGBA = function(gl, width, height, data)\n{\n    var texture = Texture.fromData(gl, null, width, height);\n    texture.enableNearestScaling();\n    texture.enableWrapClamp();\n\n    //now create the framebuffer object and attach the texture to it.\n    var fbo = new Framebuffer(gl, width, height);\n    fbo.enableTexture(texture);\n\n    fbo.unbind();\n\n    return fbo;\n};\n\n/**\n * Creates a frame buffer with a texture containing the given data\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param width {Number} the width of the drawing area of the frame buffer\n * @param height {Number} the height of the drawing area of the frame buffer\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data\n */\nFramebuffer.createFloat32 = function(gl, width, height, data)\n{\n    // create a new texture..\n    var texture = new Texture.fromData(gl, data, width, height);\n    texture.enableNearestScaling();\n    texture.enableWrapClamp();\n\n    //now create the framebuffer object and attach the texture to it.\n    var fbo = new Framebuffer(gl, width, height);\n    fbo.enableTexture(texture);\n\n    fbo.unbind();\n\n    return fbo;\n};\n\nmodule.exports = Framebuffer;\n","\nvar compileProgram = require('./shader/compileProgram'),\n\textractAttributes = require('./shader/extractAttributes'),\n\textractUniforms = require('./shader/extractUniforms'),\n\tgenerateUniformAccessObject = require('./shader/generateUniformAccessObject');\n\n/**\n * Helper class to create a webGL Shader\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext}\n * @param vertexSrc {string|string[]} The vertex shader source as an array of strings.\n * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings.\n */\nvar Shader = function(gl, vertexSrc, fragmentSrc)\n{\n\t/**\n\t * The current WebGL rendering context\n\t *\n\t * @member {WebGLRenderingContext}\n\t */\n\tthis.gl = gl;\n\n\t/**\n\t * The shader program\n\t *\n\t * @member {WebGLProgram}\n\t */\n\t// First compile the program..\n\tthis.program = compileProgram(gl, vertexSrc, fragmentSrc);\n\n\n\t/**\n\t * The attributes of the shader as an object containing the following properties\n\t * {\n\t * \ttype,\n\t * \tsize,\n\t * \tlocation,\n\t * \tpointer\n\t * }\n\t * @member {Object}\n\t */\n\t// next extract the attributes\n\tthis.attributes = extractAttributes(gl, this.program);\n\n    var uniformData = extractUniforms(gl, this.program);\n\n\t/**\n\t * The uniforms of the shader as an object containing the following properties\n\t * {\n\t * \tgl,\n\t * \tdata\n\t * }\n\t * @member {Object}\n\t */\n    this.uniforms = generateUniformAccessObject( gl, uniformData );\n};\n/**\n * Uses this shader\n */\nShader.prototype.bind = function()\n{\n\tthis.gl.useProgram(this.program);\n};\n\n/**\n * Destroys this shader\n * TODO\n */\nShader.prototype.destroy = function()\n{\n\t// var gl = this.gl;\n};\n\nmodule.exports = Shader;\n","\n/**\n * Helper class to create a WebGL Texture\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param width {number} the width of the texture\n * @param height {number} the height of the texture\n * @param format {number} the pixel format of the texture. defaults to gl.RGBA\n * @param type {number} the gl type of the texture. defaults to gl.UNSIGNED_BYTE\n */\nvar Texture = function(gl, width, height, format, type)\n{\n\t/**\n\t * The current WebGL rendering context\n\t *\n\t * @member {WebGLRenderingContext}\n\t */\n\tthis.gl = gl;\n\n\n\t/**\n\t * The WebGL texture\n\t *\n\t * @member {WebGLTexture}\n\t */\n\tthis.texture = gl.createTexture();\n\n\t/**\n\t * If mipmapping was used for this texture, enable and disable with enableMipmap()\n\t *\n\t * @member {Boolean}\n\t */\n\t// some settings..\n\tthis.mipmap = false;\n\n\n\t/**\n\t * Set to true to enable pre-multiplied alpha\n\t *\n\t * @member {Boolean}\n\t */\n\tthis.premultiplyAlpha = false;\n\n\t/**\n\t * The width of texture\n\t *\n\t * @member {Number}\n\t */\n\tthis.width = width || -1;\n\t/**\n\t * The height of texture\n\t *\n\t * @member {Number}\n\t */\n\tthis.height = height || -1;\n\n\t/**\n\t * The pixel format of the texture. defaults to gl.RGBA\n\t *\n\t * @member {Number}\n\t */\n\tthis.format = format || gl.RGBA;\n\n\t/**\n\t * The gl type of the texture. defaults to gl.UNSIGNED_BYTE\n\t *\n\t * @member {Number}\n\t */\n\tthis.type = type || gl.UNSIGNED_BYTE;\n\n\n};\n\n/**\n * Uploads this texture to the GPU\n * @param source {HTMLImageElement|ImageData|HTMLVideoElement} the source image of the texture\n */\nTexture.prototype.upload = function(source)\n{\n\tthis.bind();\n\n\tvar gl = this.gl;\n\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);\n\n\tvar newWidth = source.videoWidth || source.width;\n\tvar newHeight = source.videoHeight || source.height;\n\n\tif(newHeight !== this.height || newWidth !== this.width)\n\t{\n    \tgl.texImage2D(gl.TEXTURE_2D, 0, this.format, this.format, this.type, source);\n\t}\n\telse\n\t{\n    \tgl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, this.format, this.type, source);\n\t}\n\n\t// if the source is a video, we need to use the videoWidth / videoHeight properties as width / height will be incorrect.\n\tthis.width = newWidth;\n\tthis.height = newHeight;\n\n};\n\nvar FLOATING_POINT_AVAILABLE = false;\n\n/**\n * Use a data source and uploads this texture to the GPU\n * @param data {TypedArray} the data to upload to the texture\n * @param width {number} the new width of the texture\n * @param height {number} the new height of the texture\n */\nTexture.prototype.uploadData = function(data, width, height)\n{\n\tthis.bind();\n\n\tvar gl = this.gl;\n\n\n\tif(data instanceof Float32Array)\n\t{\n\t\tif(!FLOATING_POINT_AVAILABLE)\n\t\t{\n\t\t\tvar ext = gl.getExtension(\"OES_texture_float\");\n\n\t\t\tif(ext)\n\t\t\t{\n\t\t\t\tFLOATING_POINT_AVAILABLE = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Error('floating point textures not available');\n\t\t\t}\n\t\t}\n\n\t\tthis.type = gl.FLOAT;\n\t}\n\telse\n\t{\n\t\t// TODO support for other types\n\t\tthis.type = gl.UNSIGNED_BYTE;\n\t}\n\n\t// what type of data?\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);\n\n\n\tif(width !== this.width || height !== this.height)\n\t{\n\t\tgl.texImage2D(gl.TEXTURE_2D, 0, this.format,  width, height, 0, this.format, this.type, data || null);\n\t}\n\telse\n\t{\n\t\tgl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, this.format, this.type, data || null);\n\t}\n\n\tthis.width = width;\n\tthis.height = height;\n\n\n//\ttexSubImage2D\n};\n\n/**\n * Binds the texture\n * @param  location\n */\nTexture.prototype.bind = function(location)\n{\n\tvar gl = this.gl;\n\n\tif(location !== undefined)\n\t{\n\t\tgl.activeTexture(gl.TEXTURE0 + location);\n\t}\n\n\tgl.bindTexture(gl.TEXTURE_2D, this.texture);\n};\n\n/**\n * Unbinds the texture\n */\nTexture.prototype.unbind = function()\n{\n\tvar gl = this.gl;\n\tgl.bindTexture(gl.TEXTURE_2D, null);\n};\n\n/**\n * @param linear {Boolean} if we want to use linear filtering or nearest neighbour interpolation\n */\nTexture.prototype.minFilter = function( linear )\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tif(this.mipmap)\n\t{\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, linear ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST);\n\t}\n\telse\n\t{\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, linear ? gl.LINEAR : gl.NEAREST);\n\t}\n};\n\n/**\n * @param linear {Boolean} if we want to use linear filtering or nearest neighbour interpolation\n */\nTexture.prototype.magFilter = function( linear )\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, linear ? gl.LINEAR : gl.NEAREST);\n};\n\n/**\n * Enables mipmapping\n */\nTexture.prototype.enableMipmap = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tthis.mipmap = true;\n\n\tgl.generateMipmap(gl.TEXTURE_2D);\n};\n\n/**\n * Enables linear filtering\n */\nTexture.prototype.enableLinearScaling = function()\n{\n\tthis.minFilter(true);\n\tthis.magFilter(true);\n};\n\n/**\n * Enables nearest neighbour interpolation\n */\nTexture.prototype.enableNearestScaling = function()\n{\n\tthis.minFilter(false);\n\tthis.magFilter(false);\n};\n\n/**\n * Enables clamping on the texture so WebGL will not repeat it\n */\nTexture.prototype.enableWrapClamp = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n};\n\n/**\n * Enable tiling on the texture\n */\nTexture.prototype.enableWrapRepeat = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);\n};\n\nTexture.prototype.enableWrapMirrorRepeat = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.MIRRORED_REPEAT);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.MIRRORED_REPEAT);\n};\n\n\n/**\n * Destroys this texture\n */\nTexture.prototype.destroy = function()\n{\n\tvar gl = this.gl;\n\t//TODO\n\tgl.deleteTexture(this.texture);\n};\n\n/**\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param source {HTMLImageElement|ImageData} the source image of the texture\n * @param premultiplyAlpha {Boolean} If we want to use pre-multiplied alpha\n */\nTexture.fromSource = function(gl, source, premultiplyAlpha)\n{\n\tvar texture = new Texture(gl);\n\ttexture.premultiplyAlpha = premultiplyAlpha || false;\n\ttexture.upload(source);\n\n\treturn texture;\n};\n\n/**\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param data {TypedArray} the data to upload to the texture\n * @param width {number} the new width of the texture\n * @param height {number} the new height of the texture\n */\nTexture.fromData = function(gl, data, width, height)\n{\n\t//console.log(data, width, height);\n\tvar texture = new Texture(gl);\n\ttexture.uploadData(data, width, height);\n\n\treturn texture;\n};\n\n\nmodule.exports = Texture;\n","\n// state object//\nvar setVertexAttribArrays = require( './setVertexAttribArrays' );\n\n/**\n * Helper class to work with WebGL VertexArrayObjects (vaos)\n * Only works if WebGL extensions are enabled (they usually are)\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n */\nfunction VertexArrayObject(gl, state)\n{\n    this.nativeVaoExtension = null;\n\n    if(!VertexArrayObject.FORCE_NATIVE)\n    {\n        this.nativeVaoExtension = gl.getExtension('OES_vertex_array_object') ||\n                                  gl.getExtension('MOZ_OES_vertex_array_object') ||\n                                  gl.getExtension('WEBKIT_OES_vertex_array_object');\n    }\n\n    this.nativeState = state;\n\n    if(this.nativeVaoExtension)\n    {\n        this.nativeVao = this.nativeVaoExtension.createVertexArrayOES();\n\n        var maxAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\n\n        // VAO - overwrite the state..\n        this.nativeState = {\n            tempAttribState: new Array(maxAttribs),\n            attribState: new Array(maxAttribs)\n        };\n    }\n\n    /**\n     * The current WebGL rendering context\n     *\n     * @member {WebGLRenderingContext}\n     */\n    this.gl = gl;\n\n    /**\n     * An array of attributes\n     *\n     * @member {Array}\n     */\n    this.attributes = [];\n\n    /**\n     * @member {PIXI.glCore.GLBuffer}\n     */\n    this.indexBuffer = null;\n\n    /**\n     * A boolean flag\n     *\n     * @member {Boolean}\n     */\n    this.dirty = false;\n}\n\nVertexArrayObject.prototype.constructor = VertexArrayObject;\nmodule.exports = VertexArrayObject;\n\n/**\n* Some devices behave a bit funny when using the newer extensions (im looking at you ipad 2!)\n* If you find on older devices that things have gone a bit weird then set this to true.\n*/\n/**\n * Lets the VAO know if you should use the WebGL extension or the native methods.\n * Some devices behave a bit funny when using the newer extensions (im looking at you ipad 2!)\n * If you find on older devices that things have gone a bit weird then set this to true.\n * @static\n * @property {Boolean} FORCE_NATIVE\n */\nVertexArrayObject.FORCE_NATIVE = false;\n\n/**\n * Binds the buffer\n */\nVertexArrayObject.prototype.bind = function()\n{\n    if(this.nativeVao)\n    {\n        this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao);\n\n        if(this.dirty)\n        {\n            this.dirty = false;\n            this.activate();\n        }\n    }\n    else\n    {\n\n        this.activate();\n    }\n\n    return this;\n};\n\n/**\n * Unbinds the buffer\n */\nVertexArrayObject.prototype.unbind = function()\n{\n    if(this.nativeVao)\n    {\n        this.nativeVaoExtension.bindVertexArrayOES(null);\n    }\n\n    return this;\n};\n\n/**\n * Uses this vao\n */\nVertexArrayObject.prototype.activate = function()\n{\n\n    var gl = this.gl;\n    var lastBuffer = null;\n\n    for (var i = 0; i < this.attributes.length; i++)\n    {\n        var attrib = this.attributes[i];\n\n        if(lastBuffer !== attrib.buffer)\n        {\n            attrib.buffer.bind();\n            lastBuffer = attrib.buffer;\n        }\n\n        //attrib.attribute.pointer(attrib.type, attrib.normalized, attrib.stride, attrib.start);\n        gl.vertexAttribPointer(attrib.attribute.location,\n                               attrib.attribute.size, attrib.type || gl.FLOAT,\n                               attrib.normalized || false,\n                               attrib.stride || 0,\n                               attrib.start || 0);\n\n\n    }\n\n    setVertexAttribArrays(gl, this.attributes, this.nativeState);\n\n    this.indexBuffer.bind();\n\n    return this;\n};\n\n/**\n *\n * @param buffer     {PIXI.gl.GLBuffer}\n * @param attribute  {*}\n * @param type       {String}\n * @param normalized {Boolean}\n * @param stride     {Number}\n * @param start      {Number}\n */\nVertexArrayObject.prototype.addAttribute = function(buffer, attribute, type, normalized, stride, start)\n{\n    this.attributes.push({\n        buffer:     buffer,\n        attribute:  attribute,\n\n        location:   attribute.location,\n        type:       type || this.gl.FLOAT,\n        normalized: normalized || false,\n        stride:     stride || 0,\n        start:      start || 0\n    });\n\n    this.dirty = true;\n\n    return this;\n};\n\n/**\n *\n * @param buffer   {PIXI.gl.GLBuffer}\n */\nVertexArrayObject.prototype.addIndex = function(buffer/*, options*/)\n{\n    this.indexBuffer = buffer;\n\n    this.dirty = true;\n\n    return this;\n};\n\n/**\n * Unbinds this vao and disables it\n */\nVertexArrayObject.prototype.clear = function()\n{\n    // var gl = this.gl;\n\n    // TODO - should this function unbind after clear?\n    // for now, no but lets see what happens in the real world!\n    if(this.nativeVao)\n    {\n        this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao);\n    }\n\n    this.attributes.length = 0;\n    this.indexBuffer = null;\n\n    return this;\n};\n\n/**\n * @param type  {Number}\n * @param size  {Number}\n * @param start {Number}\n */\nVertexArrayObject.prototype.draw = function(type, size, start)\n{\n    var gl = this.gl;\n    gl.drawElements(type, size, gl.UNSIGNED_SHORT, start || 0);\n\n    return this;\n};\n\n/**\n * Destroy this vao\n */\nVertexArrayObject.prototype.destroy = function()\n{\n    // lose references\n    this.gl = null;\n    this.indexBuffer = null;\n    this.attributes = null;\n    this.nativeState = null;\n\n    if(this.nativeVao)\n    {\n        this.nativeVaoExtension.deleteVertexArrayOES(this.nativeVao);\n    }\n\n    this.nativeVaoExtension = null;\n    this.nativeVao = null;\n};\n","\n/**\n * Helper class to create a webGL Context\n *\n * @class\n * @memberof PIXI.glCore\n * @param canvas {HTMLCanvasElement} the canvas element that we will get the context from\n * @param options {Object} An options object that gets passed in to the canvas element containing the context attributes,\n *                         see https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext for the options available\n * @return {WebGLRenderingContext} the WebGL context\n */\nvar createContext = function(canvas, options)\n{\n    var gl = canvas.getContext('webgl', options) || \n         canvas.getContext('experimental-webgl', options);\n\n    if (!gl)\n    {\n        // fail, not able to get a context\n        throw new Error('This browser does not support webGL. Try using the canvas renderer');\n    }\n\n    return gl;\n};\n\nmodule.exports = createContext;\n","var gl = {\n    createContext:          require('./createContext'),\n    setVertexAttribArrays:  require('./setVertexAttribArrays'),\n    GLBuffer:               require('./GLBuffer'),\n    GLFramebuffer:          require('./GLFramebuffer'),\n    GLShader:               require('./GLShader'),\n    GLTexture:              require('./GLTexture'),\n    VertexArrayObject:      require('./VertexArrayObject'),\n    shader:                 require('./shader')\n};\n\n// Export for Node-compatible environments\nif (typeof module !== 'undefined' && module.exports)\n{\n    // Export the module\n    module.exports = gl;\n}\n\n// Add to the browser window pixi.gl\nif (typeof window !== 'undefined')\n{\n    // add the window object\n    window.PIXI = window.PIXI || {};\n    window.PIXI.glCore = gl;\n}\n","// var GL_MAP = {};\n\n/**\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param attribs {*}\n * @param state {*}\n */\nvar setVertexAttribArrays = function (gl, attribs, state)\n{\n    var i;\n    if(state)\n    {\n        var tempAttribState = state.tempAttribState,\n            attribState = state.attribState;\n\n        for (i = 0; i < tempAttribState.length; i++)\n        {\n            tempAttribState[i] = false;\n        }\n\n        // set the new attribs\n        for (i = 0; i < attribs.length; i++)\n        {\n            tempAttribState[attribs[i].attribute.location] = true;\n        }\n\n        for (i = 0; i < attribState.length; i++)\n        {\n            if (attribState[i] !== tempAttribState[i])\n            {\n                attribState[i] = tempAttribState[i];\n\n                if (state.attribState[i])\n                {\n                    gl.enableVertexAttribArray(i);\n                }\n                else\n                {\n                    gl.disableVertexAttribArray(i);\n                }\n            }\n        }\n\n    }\n    else\n    {\n        for (i = 0; i < attribs.length; i++)\n        {\n            var attrib = attribs[i];\n            gl.enableVertexAttribArray(attrib.attribute.location);\n        }\n    }\n};\n\nmodule.exports = setVertexAttribArrays;\n","\n/**\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL context {WebGLProgram}\n * @param vertexSrc {string|string[]} The vertex shader source as an array of strings.\n * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings.\n * @return {WebGLProgram} the shader program\n */\nvar compileProgram = function(gl, vertexSrc, fragmentSrc)\n{\n    var glVertShader = compileShader(gl, gl.VERTEX_SHADER, vertexSrc);\n    var glFragShader = compileShader(gl, gl.FRAGMENT_SHADER, fragmentSrc);\n\n    var program = gl.createProgram();\n\n    gl.attachShader(program, glVertShader);\n    gl.attachShader(program, glFragShader);\n    gl.linkProgram(program);\n\n    // if linking fails, then log and cleanup\n    if (!gl.getProgramParameter(program, gl.LINK_STATUS))\n    {\n        console.error('Pixi.js Error: Could not initialize shader.');\n        console.error('gl.VALIDATE_STATUS', gl.getProgramParameter(program, gl.VALIDATE_STATUS));\n        console.error('gl.getError()', gl.getError());\n\n        // if there is a program info log, log it\n        if (gl.getProgramInfoLog(program) !== '')\n        {\n            console.warn('Pixi.js Warning: gl.getProgramInfoLog()', gl.getProgramInfoLog(program));\n        }\n\n        gl.deleteProgram(program);\n        program = null;\n    }\n\n    // clean up some shaders\n    gl.deleteShader(glVertShader);\n    gl.deleteShader(glFragShader);\n\n    return program;\n};\n\n/**\n * @private\n * @param gl {WebGLRenderingContext} The current WebGL context {WebGLProgram}\n * @param type {Number} the type, can be either VERTEX_SHADER or FRAGMENT_SHADER\n * @param vertexSrc {string|string[]} The vertex shader source as an array of strings.\n * @return {WebGLShader} the shader\n */\nvar compileShader = function (gl, type, src)\n{\n    var shader = gl.createShader(type);\n\n    gl.shaderSource(shader, src);\n    gl.compileShader(shader);\n\n    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))\n    {\n        console.log(gl.getShaderInfoLog(shader));\n        return null;\n    }\n\n    return shader;\n};\n\nmodule.exports = compileProgram;\n","/**\n * @class\n * @memberof PIXI.glCore.shader\n * @param type {String} Type of value\n * @param size {Number}\n */\nvar defaultValue = function(type, size) \n{\n    switch (type)\n    {\n        case 'float':\n            return 0;\n\n        case 'vec2': \n            return new Float32Array(2 * size);\n\n        case 'vec3':\n            return new Float32Array(3 * size);\n\n        case 'vec4':     \n            return new Float32Array(4 * size);\n            \n        case 'int':\n        case 'sampler2D':\n            return 0;\n\n        case 'ivec2':   \n            return new Int32Array(2 * size);\n\n        case 'ivec3':\n            return new Int32Array(3 * size);\n\n        case 'ivec4': \n            return new Int32Array(4 * size);\n\n        case 'bool':     \n            return false;\n\n        case 'bvec2':\n\n            return booleanArray( 2 * size);\n\n        case 'bvec3':\n            return booleanArray(3 * size);\n\n        case 'bvec4':\n            return booleanArray(4 * size);\n\n        case 'mat2':\n            return new Float32Array([1, 0,\n                                     0, 1]);\n\n        case 'mat3': \n            return new Float32Array([1, 0, 0,\n                                     0, 1, 0,\n                                     0, 0, 1]);\n\n        case 'mat4':\n            return new Float32Array([1, 0, 0, 0,\n                                     0, 1, 0, 0,\n                                     0, 0, 1, 0,\n                                     0, 0, 0, 1]);\n    }\n};\n\nvar booleanArray = function(size)\n{\n    var array = new Array(size);\n\n    for (var i = 0; i < array.length; i++) \n    {\n        array[i] = false;\n    }\n\n    return array;\n};\n\nmodule.exports = defaultValue;\n","\nvar mapType = require('./mapType');\nvar mapSize = require('./mapSize');\n\n/**\n * Extracts the attributes\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param program {WebGLProgram} The shader program to get the attributes from\n * @return attributes {Object}\n */\nvar extractAttributes = function(gl, program)\n{\n    var attributes = {};\n\n    var totalAttributes = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);\n\n    for (var i = 0; i < totalAttributes; i++)\n    {\n        var attribData = gl.getActiveAttrib(program, i);\n        var type = mapType(gl, attribData.type);\n\n        attributes[attribData.name] = {\n            type:type,\n            size:mapSize(type),\n            location:gl.getAttribLocation(program, attribData.name),\n            //TODO - make an attribute object\n            pointer: pointer\n        };\n    }\n\n    return attributes;\n};\n\nvar pointer = function(type, normalized, stride, start){\n    // console.log(this.location)\n    gl.vertexAttribPointer(this.location,this.size, type || gl.FLOAT, normalized || false, stride || 0, start || 0);\n};\n\nmodule.exports = extractAttributes;\n","var mapType = require('./mapType');\nvar defaultValue = require('./defaultValue');\n\n/**\n * Extracts the uniforms\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param program {WebGLProgram} The shader program to get the uniforms from\n * @return uniforms {Object}\n */\nvar extractUniforms = function(gl, program)\n{\n\tvar uniforms = {};\n\n    var totalUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n\n    for (var i = 0; i < totalUniforms; i++)\n    {\n    \tvar uniformData = gl.getActiveUniform(program, i);\n    \tvar name = uniformData.name.replace(/\\[.*?\\]/, \"\");\n        var type = mapType(gl, uniformData.type );\n\n    \tuniforms[name] = {\n    \t\ttype:type,\n    \t\tsize:uniformData.size,\n    \t\tlocation:gl.getUniformLocation(program, name),\n    \t\tvalue:defaultValue(type, uniformData.size)\n    \t};\n    }\n\n\treturn uniforms;\n};\n\nmodule.exports = extractUniforms;\n","/**\n * Extracts the attributes\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param uniforms {Array} @mat ?\n * @return attributes {Object}\n */\nvar generateUniformAccessObject = function(gl, uniformData)\n{\n    // this is the object we will be sending back.\n    // an object hierachy will be created for structs\n    var uniforms = {data:{}};\n\n    uniforms.gl = gl;\n\n    var uniformKeys= Object.keys(uniformData);\n\n    for (var i = 0; i < uniformKeys.length; i++)\n    {\n        var fullName = uniformKeys[i];\n\n        var nameTokens = fullName.split('.');\n        var name = nameTokens[nameTokens.length - 1];\n\n        var uniformGroup = getUniformGroup(nameTokens, uniforms);\n\n        var uniform =  uniformData[fullName];\n        uniformGroup.data[name] = uniform;\n\n        uniformGroup.gl = gl;\n\n        Object.defineProperty(uniformGroup, name, {\n            get: generateGetter(name),\n            set: generateSetter(name, uniform)\n        });\n    }\n\n    return uniforms;\n};\n\nvar generateGetter = function(name)\n{\n\tvar template = getterTemplate.replace('%%', name);\n\treturn new Function(template); // jshint ignore:line\n};\n\nvar generateSetter = function(name, uniform)\n{\n    var template = setterTemplate.replace(/%%/g, name);\n    var setTemplate;\n\n    if(uniform.size === 1)\n    {\n        setTemplate = GLSL_TO_SINGLE_SETTERS[uniform.type];\n    }\n    else\n    {\n        setTemplate = GLSL_TO_ARRAY_SETTERS[uniform.type];\n    }\n\n    if(setTemplate)\n    {\n        template += \"\\nthis.gl.\" + setTemplate + \";\";\n    }\n\n  \treturn new Function('value', template); // jshint ignore:line\n};\n\nvar getUniformGroup = function(nameTokens, uniform)\n{\n    var cur = uniform;\n\n    for (var i = 0; i < nameTokens.length - 1; i++)\n    {\n        var o = cur[nameTokens[i]] || {data:{}};\n        cur[nameTokens[i]] = o;\n        cur = o;\n    }\n\n    return cur;\n};\n\nvar getterTemplate = [\n    'return this.data.%%.value;',\n].join('\\n');\n\nvar setterTemplate = [\n    'this.data.%%.value = value;',\n    'var location = this.data.%%.location;'\n].join('\\n');\n\n\nvar GLSL_TO_SINGLE_SETTERS = {\n\n    'float':    'uniform1f(location, value)',\n\n    'vec2':     'uniform2f(location, value[0], value[1])',\n    'vec3':     'uniform3f(location, value[0], value[1], value[2])',\n    'vec4':     'uniform4f(location, value[0], value[1], value[2], value[3])',\n\n    'int':      'uniform1i(location, value)',\n    'ivec2':    'uniform2i(location, value[0], value[1])',\n    'ivec3':    'uniform3i(location, value[0], value[1], value[2])',\n    'ivec4':    'uniform4i(location, value[0], value[1], value[2], value[3])',\n\n    'bool':     'uniform1i(location, value)',\n    'bvec2':    'uniform2i(location, value[0], value[1])',\n    'bvec3':    'uniform3i(location, value[0], value[1], value[2])',\n    'bvec4':    'uniform4i(location, value[0], value[1], value[2], value[3])',\n\n    'mat2':     'uniformMatrix2fv(location, false, value)',\n    'mat3':     'uniformMatrix3fv(location, false, value)',\n    'mat4':     'uniformMatrix4fv(location, false, value)',\n\n    'sampler2D':'uniform1i(location, value)'\n};\n\nvar GLSL_TO_ARRAY_SETTERS = {\n\n    'float':    'uniform1fv(location, value)',\n\n    'vec2':     'uniform2fv(location, value)',\n    'vec3':     'uniform3fv(location, value)',\n    'vec4':     'uniform4fv(location, value)',\n\n    'int':      'uniform1iv(location, value)',\n    'ivec2':    'uniform2iv(location, value)',\n    'ivec3':    'uniform3iv(location, value)',\n    'ivec4':    'uniform4iv(location, value)',\n\n    'bool':     'uniform1iv(location, value)',\n    'bvec2':    'uniform2iv(location, value)',\n    'bvec3':    'uniform3iv(location, value)',\n    'bvec4':    'uniform4iv(location, value)',\n\n    'sampler2D':'uniform1iv(location, value)'\n};\n\nmodule.exports = generateUniformAccessObject;\n","module.exports = {\n    compileProgram: require('./compileProgram'),\n    defaultValue: require('./defaultValue'),\n    extractAttributes: require('./extractAttributes'),\n    extractUniforms: require('./extractUniforms'),\n    generateUniformAccessObject: require('./generateUniformAccessObject'),\n    mapSize: require('./mapSize'),\n    mapType: require('./mapType')  \n};","/**\n * @class\n * @memberof PIXI.glCore.shader\n * @param type {String}\n * @return {Number}\n */\nvar mapSize = function(type) \n{ \n    return GLSL_TO_SIZE[type];\n};\n\n\nvar GLSL_TO_SIZE = {\n    'float':    1,\n    'vec2':     2,\n    'vec3':     3,\n    'vec4':     4,\n\n    'int':      1,\n    'ivec2':    2,\n    'ivec3':    3,\n    'ivec4':    4,\n\n    'bool':     1,\n    'bvec2':    2,\n    'bvec3':    3,\n    'bvec4':    4,\n\n    'mat2':     4,\n    'mat3':     9,\n    'mat4':     16,\n\n    'sampler2D':  1\n};\n\nmodule.exports = mapSize;\n","\n\nvar mapSize = function(gl, type) \n{\n    if(!GL_TABLE) \n    {\n        var typeNames = Object.keys(GL_TO_GLSL_TYPES);\n\n        GL_TABLE = {};\n\n        for(var i = 0; i < typeNames.length; ++i) \n        {\n            var tn = typeNames[i];\n            GL_TABLE[ gl[tn] ] = GL_TO_GLSL_TYPES[tn];\n        }\n    }\n\n  return GL_TABLE[type];\n};\n\nvar GL_TABLE = null;\n\nvar GL_TO_GLSL_TYPES = {\n  'FLOAT':       'float',\n  'FLOAT_VEC2':  'vec2',\n  'FLOAT_VEC3':  'vec3',\n  'FLOAT_VEC4':  'vec4',\n\n  'INT':         'int',\n  'INT_VEC2':    'ivec2',\n  'INT_VEC3':    'ivec3',\n  'INT_VEC4':    'ivec4',\n  \n  'BOOL':        'bool',\n  'BOOL_VEC2':   'bvec2',\n  'BOOL_VEC3':   'bvec3',\n  'BOOL_VEC4':   'bvec4',\n  \n  'FLOAT_MAT2':  'mat2',\n  'FLOAT_MAT3':  'mat3',\n  'FLOAT_MAT4':  'mat4',\n  \n  'SAMPLER_2D':  'sampler2D'  \n};\n\nmodule.exports = mapSize;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n  // if the path tries to go above the root, `up` ends up > 0\n  var up = 0;\n  for (var i = parts.length - 1; i >= 0; i--) {\n    var last = parts[i];\n    if (last === '.') {\n      parts.splice(i, 1);\n    } else if (last === '..') {\n      parts.splice(i, 1);\n      up++;\n    } else if (up) {\n      parts.splice(i, 1);\n      up--;\n    }\n  }\n\n  // if the path is allowed to go above the root, restore leading ..s\n  if (allowAboveRoot) {\n    for (; up--; up) {\n      parts.unshift('..');\n    }\n  }\n\n  return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n    /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nvar splitPath = function(filename) {\n  return splitPathRe.exec(filename).slice(1);\n};\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n  var resolvedPath = '',\n      resolvedAbsolute = false;\n\n  for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n    var path = (i >= 0) ? arguments[i] : process.cwd();\n\n    // Skip empty and invalid entries\n    if (typeof path !== 'string') {\n      throw new TypeError('Arguments to path.resolve must be strings');\n    } else if (!path) {\n      continue;\n    }\n\n    resolvedPath = path + '/' + resolvedPath;\n    resolvedAbsolute = path.charAt(0) === '/';\n  }\n\n  // At this point the path should be resolved to a full absolute path, but\n  // handle relative paths to be safe (might happen when process.cwd() fails)\n\n  // Normalize the path\n  resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n    return !!p;\n  }), !resolvedAbsolute).join('/');\n\n  return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n  var isAbsolute = exports.isAbsolute(path),\n      trailingSlash = substr(path, -1) === '/';\n\n  // Normalize the path\n  path = normalizeArray(filter(path.split('/'), function(p) {\n    return !!p;\n  }), !isAbsolute).join('/');\n\n  if (!path && !isAbsolute) {\n    path = '.';\n  }\n  if (path && trailingSlash) {\n    path += '/';\n  }\n\n  return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n  return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n  var paths = Array.prototype.slice.call(arguments, 0);\n  return exports.normalize(filter(paths, function(p, index) {\n    if (typeof p !== 'string') {\n      throw new TypeError('Arguments to path.join must be strings');\n    }\n    return p;\n  }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n  from = exports.resolve(from).substr(1);\n  to = exports.resolve(to).substr(1);\n\n  function trim(arr) {\n    var start = 0;\n    for (; start < arr.length; start++) {\n      if (arr[start] !== '') break;\n    }\n\n    var end = arr.length - 1;\n    for (; end >= 0; end--) {\n      if (arr[end] !== '') break;\n    }\n\n    if (start > end) return [];\n    return arr.slice(start, end - start + 1);\n  }\n\n  var fromParts = trim(from.split('/'));\n  var toParts = trim(to.split('/'));\n\n  var length = Math.min(fromParts.length, toParts.length);\n  var samePartsLength = length;\n  for (var i = 0; i < length; i++) {\n    if (fromParts[i] !== toParts[i]) {\n      samePartsLength = i;\n      break;\n    }\n  }\n\n  var outputParts = [];\n  for (var i = samePartsLength; i < fromParts.length; i++) {\n    outputParts.push('..');\n  }\n\n  outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n  return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function(path) {\n  var result = splitPath(path),\n      root = result[0],\n      dir = result[1];\n\n  if (!root && !dir) {\n    // No dirname whatsoever\n    return '.';\n  }\n\n  if (dir) {\n    // It has a dirname, strip trailing slash\n    dir = dir.substr(0, dir.length - 1);\n  }\n\n  return root + dir;\n};\n\n\nexports.basename = function(path, ext) {\n  var f = splitPath(path)[2];\n  // TODO: make this comparison case-insensitive on windows?\n  if (ext && f.substr(-1 * ext.length) === ext) {\n    f = f.substr(0, f.length - ext.length);\n  }\n  return f;\n};\n\n\nexports.extname = function(path) {\n  return splitPath(path)[3];\n};\n\nfunction filter (xs, f) {\n    if (xs.filter) return xs.filter(f);\n    var res = [];\n    for (var i = 0; i < xs.length; i++) {\n        if (f(xs[i], i, xs)) res.push(xs[i]);\n    }\n    return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n    ? function (str, start, len) { return str.substr(start, len) }\n    : function (str, start, len) {\n        if (start < 0) start = str.length + start;\n        return str.substr(start, len);\n    }\n;\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things.  But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals.  It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n    throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n    throw new Error('clearTimeout has not been defined');\n}\n(function () {\n    try {\n        if (typeof setTimeout === 'function') {\n            cachedSetTimeout = setTimeout;\n        } else {\n            cachedSetTimeout = defaultSetTimout;\n        }\n    } catch (e) {\n        cachedSetTimeout = defaultSetTimout;\n    }\n    try {\n        if (typeof clearTimeout === 'function') {\n            cachedClearTimeout = clearTimeout;\n        } else {\n            cachedClearTimeout = defaultClearTimeout;\n        }\n    } catch (e) {\n        cachedClearTimeout = defaultClearTimeout;\n    }\n} ())\nfunction runTimeout(fun) {\n    if (cachedSetTimeout === setTimeout) {\n        //normal enviroments in sane situations\n        return setTimeout(fun, 0);\n    }\n    // if setTimeout wasn't available but was latter defined\n    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n        cachedSetTimeout = setTimeout;\n        return setTimeout(fun, 0);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedSetTimeout(fun, 0);\n    } catch(e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n            return cachedSetTimeout.call(null, fun, 0);\n        } catch(e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n            return cachedSetTimeout.call(this, fun, 0);\n        }\n    }\n\n\n}\nfunction runClearTimeout(marker) {\n    if (cachedClearTimeout === clearTimeout) {\n        //normal enviroments in sane situations\n        return clearTimeout(marker);\n    }\n    // if clearTimeout wasn't available but was latter defined\n    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n        cachedClearTimeout = clearTimeout;\n        return clearTimeout(marker);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedClearTimeout(marker);\n    } catch (e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n            return cachedClearTimeout.call(null, marker);\n        } catch (e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n            return cachedClearTimeout.call(this, marker);\n        }\n    }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n    if (!draining || !currentQueue) {\n        return;\n    }\n    draining = false;\n    if (currentQueue.length) {\n        queue = currentQueue.concat(queue);\n    } else {\n        queueIndex = -1;\n    }\n    if (queue.length) {\n        drainQueue();\n    }\n}\n\nfunction drainQueue() {\n    if (draining) {\n        return;\n    }\n    var timeout = runTimeout(cleanUpNextTick);\n    draining = true;\n\n    var len = queue.length;\n    while(len) {\n        currentQueue = queue;\n        queue = [];\n        while (++queueIndex < len) {\n            if (currentQueue) {\n                currentQueue[queueIndex].run();\n            }\n        }\n        queueIndex = -1;\n        len = queue.length;\n    }\n    currentQueue = null;\n    draining = false;\n    runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n    var args = new Array(arguments.length - 1);\n    if (arguments.length > 1) {\n        for (var i = 1; i < arguments.length; i++) {\n            args[i - 1] = arguments[i];\n        }\n    }\n    queue.push(new Item(fun, args));\n    if (queue.length === 1 && !draining) {\n        runTimeout(drainQueue);\n    }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n    this.fun = fun;\n    this.array = array;\n}\nItem.prototype.run = function () {\n    this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n    throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n    throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/*! https://mths.be/punycode v1.4.1 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = typeof module == 'object' && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow new RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see \n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t    counter = 0,\n\t\t    length = string.length,\n\t\t    value,\n\t\t    extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t//  0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * https://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t    inputLength = input.length,\n\t\t    out,\n\t\t    i = 0,\n\t\t    n = initialN,\n\t\t    bias = initialBias,\n\t\t    basic,\n\t\t    j,\n\t\t    index,\n\t\t    oldi,\n\t\t    w,\n\t\t    k,\n\t\t    digit,\n\t\t    t,\n\t\t    /** Cached calculation results */\n\t\t    baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t    delta,\n\t\t    handledCPCount,\n\t\t    basicLength,\n\t\t    bias,\n\t\t    j,\n\t\t    m,\n\t\t    q,\n\t\t    k,\n\t\t    t,\n\t\t    currentValue,\n\t\t    output = [],\n\t\t    /** `inputLength` will hold the number of code points in `input`. */\n\t\t    inputLength,\n\t\t    /** Cached calculation results */\n\t\t    handledCPCountPlusOne,\n\t\t    baseMinusT,\n\t\t    qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's  state to ,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.4.1',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see \n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine('punycode', function() {\n\t\t\treturn punycode;\n\t\t});\n\t} else if (freeExports && freeModule) {\n\t\tif (module.exports == freeExports) {\n\t\t\t// in Node.js, io.js, or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = punycode;\n\t\t} else {\n\t\t\t// in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (key in punycode) {\n\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// in Rhino or a web browser\n\t\troot.punycode = punycode;\n\t}\n\n}(this));\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n  return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n  sep = sep || '&';\n  eq = eq || '=';\n  var obj = {};\n\n  if (typeof qs !== 'string' || qs.length === 0) {\n    return obj;\n  }\n\n  var regexp = /\\+/g;\n  qs = qs.split(sep);\n\n  var maxKeys = 1000;\n  if (options && typeof options.maxKeys === 'number') {\n    maxKeys = options.maxKeys;\n  }\n\n  var len = qs.length;\n  // maxKeys <= 0 means that we should not limit keys count\n  if (maxKeys > 0 && len > maxKeys) {\n    len = maxKeys;\n  }\n\n  for (var i = 0; i < len; ++i) {\n    var x = qs[i].replace(regexp, '%20'),\n        idx = x.indexOf(eq),\n        kstr, vstr, k, v;\n\n    if (idx >= 0) {\n      kstr = x.substr(0, idx);\n      vstr = x.substr(idx + 1);\n    } else {\n      kstr = x;\n      vstr = '';\n    }\n\n    k = decodeURIComponent(kstr);\n    v = decodeURIComponent(vstr);\n\n    if (!hasOwnProperty(obj, k)) {\n      obj[k] = v;\n    } else if (isArray(obj[k])) {\n      obj[k].push(v);\n    } else {\n      obj[k] = [obj[k], v];\n    }\n  }\n\n  return obj;\n};\n\nvar isArray = Array.isArray || function (xs) {\n  return Object.prototype.toString.call(xs) === '[object Array]';\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar stringifyPrimitive = function(v) {\n  switch (typeof v) {\n    case 'string':\n      return v;\n\n    case 'boolean':\n      return v ? 'true' : 'false';\n\n    case 'number':\n      return isFinite(v) ? v : '';\n\n    default:\n      return '';\n  }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n  sep = sep || '&';\n  eq = eq || '=';\n  if (obj === null) {\n    obj = undefined;\n  }\n\n  if (typeof obj === 'object') {\n    return map(objectKeys(obj), function(k) {\n      var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n      if (isArray(obj[k])) {\n        return map(obj[k], function(v) {\n          return ks + encodeURIComponent(stringifyPrimitive(v));\n        }).join(sep);\n      } else {\n        return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n      }\n    }).join(sep);\n\n  }\n\n  if (!name) return '';\n  return encodeURIComponent(stringifyPrimitive(name)) + eq +\n         encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n  return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map (xs, f) {\n  if (xs.map) return xs.map(f);\n  var res = [];\n  for (var i = 0; i < xs.length; i++) {\n    res.push(f(xs[i], i));\n  }\n  return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n  var res = [];\n  for (var key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n  }\n  return res;\n};\n","'use strict';\n\nexports.decode = exports.parse = require('./decode');\nexports.encode = exports.stringify = require('./encode');\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar punycode = require('punycode');\nvar util = require('./util');\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\n\nexports.Url = Url;\n\nfunction Url() {\n  this.protocol = null;\n  this.slashes = null;\n  this.auth = null;\n  this.host = null;\n  this.port = null;\n  this.hostname = null;\n  this.hash = null;\n  this.search = null;\n  this.query = null;\n  this.pathname = null;\n  this.path = null;\n  this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n    portPattern = /:[0-9]*$/,\n\n    // Special case for a simple path URL\n    simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n    // RFC 2396: characters reserved for delimiting URLs.\n    // We actually just auto-escape these.\n    delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\n    // RFC 2396: characters not allowed for various reasons.\n    unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\n    // Allowed by RFCs, but cause of XSS attacks.  Always escape these.\n    autoEscape = ['\\''].concat(unwise),\n    // Characters that are never ever allowed in a hostname.\n    // Note that any invalid chars are also handled, but these\n    // are the ones that are *expected* to be seen, so we fast-path\n    // them.\n    nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n    hostEndingChars = ['/', '?', '#'],\n    hostnameMaxLen = 255,\n    hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n    hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n    // protocols that can allow \"unsafe\" and \"unwise\" chars.\n    unsafeProtocol = {\n      'javascript': true,\n      'javascript:': true\n    },\n    // protocols that never have a hostname.\n    hostlessProtocol = {\n      'javascript': true,\n      'javascript:': true\n    },\n    // protocols that always contain a // bit.\n    slashedProtocol = {\n      'http': true,\n      'https': true,\n      'ftp': true,\n      'gopher': true,\n      'file': true,\n      'http:': true,\n      'https:': true,\n      'ftp:': true,\n      'gopher:': true,\n      'file:': true\n    },\n    querystring = require('querystring');\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n  if (url && util.isObject(url) && url instanceof Url) return url;\n\n  var u = new Url;\n  u.parse(url, parseQueryString, slashesDenoteHost);\n  return u;\n}\n\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n  if (!util.isString(url)) {\n    throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n  }\n\n  // Copy chrome, IE, opera backslash-handling behavior.\n  // Back slashes before the query string get converted to forward slashes\n  // See: https://code.google.com/p/chromium/issues/detail?id=25916\n  var queryIndex = url.indexOf('?'),\n      splitter =\n          (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n      uSplit = url.split(splitter),\n      slashRegex = /\\\\/g;\n  uSplit[0] = uSplit[0].replace(slashRegex, '/');\n  url = uSplit.join(splitter);\n\n  var rest = url;\n\n  // trim before proceeding.\n  // This is to support parse stuff like \"  http://foo.com  \\n\"\n  rest = rest.trim();\n\n  if (!slashesDenoteHost && url.split('#').length === 1) {\n    // Try fast path regexp\n    var simplePath = simplePathPattern.exec(rest);\n    if (simplePath) {\n      this.path = rest;\n      this.href = rest;\n      this.pathname = simplePath[1];\n      if (simplePath[2]) {\n        this.search = simplePath[2];\n        if (parseQueryString) {\n          this.query = querystring.parse(this.search.substr(1));\n        } else {\n          this.query = this.search.substr(1);\n        }\n      } else if (parseQueryString) {\n        this.search = '';\n        this.query = {};\n      }\n      return this;\n    }\n  }\n\n  var proto = protocolPattern.exec(rest);\n  if (proto) {\n    proto = proto[0];\n    var lowerProto = proto.toLowerCase();\n    this.protocol = lowerProto;\n    rest = rest.substr(proto.length);\n  }\n\n  // figure out if it's got a host\n  // user@server is *always* interpreted as a hostname, and url\n  // resolution will treat //foo/bar as host=foo,path=bar because that's\n  // how the browser resolves relative URLs.\n  if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n    var slashes = rest.substr(0, 2) === '//';\n    if (slashes && !(proto && hostlessProtocol[proto])) {\n      rest = rest.substr(2);\n      this.slashes = true;\n    }\n  }\n\n  if (!hostlessProtocol[proto] &&\n      (slashes || (proto && !slashedProtocol[proto]))) {\n\n    // there's a hostname.\n    // the first instance of /, ?, ;, or # ends the host.\n    //\n    // If there is an @ in the hostname, then non-host chars *are* allowed\n    // to the left of the last @ sign, unless some host-ending character\n    // comes *before* the @-sign.\n    // URLs are obnoxious.\n    //\n    // ex:\n    // http://a@b@c/ => user:a@b host:c\n    // http://a@b?@c => user:a host:c path:/?@c\n\n    // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n    // Review our test case against browsers more comprehensively.\n\n    // find the first instance of any hostEndingChars\n    var hostEnd = -1;\n    for (var i = 0; i < hostEndingChars.length; i++) {\n      var hec = rest.indexOf(hostEndingChars[i]);\n      if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n        hostEnd = hec;\n    }\n\n    // at this point, either we have an explicit point where the\n    // auth portion cannot go past, or the last @ char is the decider.\n    var auth, atSign;\n    if (hostEnd === -1) {\n      // atSign can be anywhere.\n      atSign = rest.lastIndexOf('@');\n    } else {\n      // atSign must be in auth portion.\n      // http://a@b/c@d => host:b auth:a path:/c@d\n      atSign = rest.lastIndexOf('@', hostEnd);\n    }\n\n    // Now we have a portion which is definitely the auth.\n    // Pull that off.\n    if (atSign !== -1) {\n      auth = rest.slice(0, atSign);\n      rest = rest.slice(atSign + 1);\n      this.auth = decodeURIComponent(auth);\n    }\n\n    // the host is the remaining to the left of the first non-host char\n    hostEnd = -1;\n    for (var i = 0; i < nonHostChars.length; i++) {\n      var hec = rest.indexOf(nonHostChars[i]);\n      if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n        hostEnd = hec;\n    }\n    // if we still have not hit it, then the entire thing is a host.\n    if (hostEnd === -1)\n      hostEnd = rest.length;\n\n    this.host = rest.slice(0, hostEnd);\n    rest = rest.slice(hostEnd);\n\n    // pull out port.\n    this.parseHost();\n\n    // we've indicated that there is a hostname,\n    // so even if it's empty, it has to be present.\n    this.hostname = this.hostname || '';\n\n    // if hostname begins with [ and ends with ]\n    // assume that it's an IPv6 address.\n    var ipv6Hostname = this.hostname[0] === '[' &&\n        this.hostname[this.hostname.length - 1] === ']';\n\n    // validate a little.\n    if (!ipv6Hostname) {\n      var hostparts = this.hostname.split(/\\./);\n      for (var i = 0, l = hostparts.length; i < l; i++) {\n        var part = hostparts[i];\n        if (!part) continue;\n        if (!part.match(hostnamePartPattern)) {\n          var newpart = '';\n          for (var j = 0, k = part.length; j < k; j++) {\n            if (part.charCodeAt(j) > 127) {\n              // we replace non-ASCII char with a temporary placeholder\n              // we need this to make sure size of hostname is not\n              // broken by replacing non-ASCII by nothing\n              newpart += 'x';\n            } else {\n              newpart += part[j];\n            }\n          }\n          // we test again with ASCII char only\n          if (!newpart.match(hostnamePartPattern)) {\n            var validParts = hostparts.slice(0, i);\n            var notHost = hostparts.slice(i + 1);\n            var bit = part.match(hostnamePartStart);\n            if (bit) {\n              validParts.push(bit[1]);\n              notHost.unshift(bit[2]);\n            }\n            if (notHost.length) {\n              rest = '/' + notHost.join('.') + rest;\n            }\n            this.hostname = validParts.join('.');\n            break;\n          }\n        }\n      }\n    }\n\n    if (this.hostname.length > hostnameMaxLen) {\n      this.hostname = '';\n    } else {\n      // hostnames are always lower case.\n      this.hostname = this.hostname.toLowerCase();\n    }\n\n    if (!ipv6Hostname) {\n      // IDNA Support: Returns a punycoded representation of \"domain\".\n      // It only converts parts of the domain name that\n      // have non-ASCII characters, i.e. it doesn't matter if\n      // you call it with a domain that already is ASCII-only.\n      this.hostname = punycode.toASCII(this.hostname);\n    }\n\n    var p = this.port ? ':' + this.port : '';\n    var h = this.hostname || '';\n    this.host = h + p;\n    this.href += this.host;\n\n    // strip [ and ] from the hostname\n    // the host field still retains them, though\n    if (ipv6Hostname) {\n      this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n      if (rest[0] !== '/') {\n        rest = '/' + rest;\n      }\n    }\n  }\n\n  // now rest is set to the post-host stuff.\n  // chop off any delim chars.\n  if (!unsafeProtocol[lowerProto]) {\n\n    // First, make 100% sure that any \"autoEscape\" chars get\n    // escaped, even if encodeURIComponent doesn't think they\n    // need to be.\n    for (var i = 0, l = autoEscape.length; i < l; i++) {\n      var ae = autoEscape[i];\n      if (rest.indexOf(ae) === -1)\n        continue;\n      var esc = encodeURIComponent(ae);\n      if (esc === ae) {\n        esc = escape(ae);\n      }\n      rest = rest.split(ae).join(esc);\n    }\n  }\n\n\n  // chop off from the tail first.\n  var hash = rest.indexOf('#');\n  if (hash !== -1) {\n    // got a fragment string.\n    this.hash = rest.substr(hash);\n    rest = rest.slice(0, hash);\n  }\n  var qm = rest.indexOf('?');\n  if (qm !== -1) {\n    this.search = rest.substr(qm);\n    this.query = rest.substr(qm + 1);\n    if (parseQueryString) {\n      this.query = querystring.parse(this.query);\n    }\n    rest = rest.slice(0, qm);\n  } else if (parseQueryString) {\n    // no query string, but parseQueryString still requested\n    this.search = '';\n    this.query = {};\n  }\n  if (rest) this.pathname = rest;\n  if (slashedProtocol[lowerProto] &&\n      this.hostname && !this.pathname) {\n    this.pathname = '/';\n  }\n\n  //to support http.request\n  if (this.pathname || this.search) {\n    var p = this.pathname || '';\n    var s = this.search || '';\n    this.path = p + s;\n  }\n\n  // finally, reconstruct the href based on what has been validated.\n  this.href = this.format();\n  return this;\n};\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n  // ensure it's an object, and not a string url.\n  // If it's an obj, this is a no-op.\n  // this way, you can call url_format() on strings\n  // to clean up potentially wonky urls.\n  if (util.isString(obj)) obj = urlParse(obj);\n  if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n  return obj.format();\n}\n\nUrl.prototype.format = function() {\n  var auth = this.auth || '';\n  if (auth) {\n    auth = encodeURIComponent(auth);\n    auth = auth.replace(/%3A/i, ':');\n    auth += '@';\n  }\n\n  var protocol = this.protocol || '',\n      pathname = this.pathname || '',\n      hash = this.hash || '',\n      host = false,\n      query = '';\n\n  if (this.host) {\n    host = auth + this.host;\n  } else if (this.hostname) {\n    host = auth + (this.hostname.indexOf(':') === -1 ?\n        this.hostname :\n        '[' + this.hostname + ']');\n    if (this.port) {\n      host += ':' + this.port;\n    }\n  }\n\n  if (this.query &&\n      util.isObject(this.query) &&\n      Object.keys(this.query).length) {\n    query = querystring.stringify(this.query);\n  }\n\n  var search = this.search || (query && ('?' + query)) || '';\n\n  if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\n  // only the slashedProtocols get the //.  Not mailto:, xmpp:, etc.\n  // unless they had them to begin with.\n  if (this.slashes ||\n      (!protocol || slashedProtocol[protocol]) && host !== false) {\n    host = '//' + (host || '');\n    if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n  } else if (!host) {\n    host = '';\n  }\n\n  if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n  if (search && search.charAt(0) !== '?') search = '?' + search;\n\n  pathname = pathname.replace(/[?#]/g, function(match) {\n    return encodeURIComponent(match);\n  });\n  search = search.replace('#', '%23');\n\n  return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n  return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function(relative) {\n  return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n  if (!source) return relative;\n  return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function(relative) {\n  if (util.isString(relative)) {\n    var rel = new Url();\n    rel.parse(relative, false, true);\n    relative = rel;\n  }\n\n  var result = new Url();\n  var tkeys = Object.keys(this);\n  for (var tk = 0; tk < tkeys.length; tk++) {\n    var tkey = tkeys[tk];\n    result[tkey] = this[tkey];\n  }\n\n  // hash is always overridden, no matter what.\n  // even href=\"\" will remove it.\n  result.hash = relative.hash;\n\n  // if the relative url is empty, then there's nothing left to do here.\n  if (relative.href === '') {\n    result.href = result.format();\n    return result;\n  }\n\n  // hrefs like //foo/bar always cut to the protocol.\n  if (relative.slashes && !relative.protocol) {\n    // take everything except the protocol from relative\n    var rkeys = Object.keys(relative);\n    for (var rk = 0; rk < rkeys.length; rk++) {\n      var rkey = rkeys[rk];\n      if (rkey !== 'protocol')\n        result[rkey] = relative[rkey];\n    }\n\n    //urlParse appends trailing / to urls like http://www.example.com\n    if (slashedProtocol[result.protocol] &&\n        result.hostname && !result.pathname) {\n      result.path = result.pathname = '/';\n    }\n\n    result.href = result.format();\n    return result;\n  }\n\n  if (relative.protocol && relative.protocol !== result.protocol) {\n    // if it's a known url protocol, then changing\n    // the protocol does weird things\n    // first, if it's not file:, then we MUST have a host,\n    // and if there was a path\n    // to begin with, then we MUST have a path.\n    // if it is file:, then the host is dropped,\n    // because that's known to be hostless.\n    // anything else is assumed to be absolute.\n    if (!slashedProtocol[relative.protocol]) {\n      var keys = Object.keys(relative);\n      for (var v = 0; v < keys.length; v++) {\n        var k = keys[v];\n        result[k] = relative[k];\n      }\n      result.href = result.format();\n      return result;\n    }\n\n    result.protocol = relative.protocol;\n    if (!relative.host && !hostlessProtocol[relative.protocol]) {\n      var relPath = (relative.pathname || '').split('/');\n      while (relPath.length && !(relative.host = relPath.shift()));\n      if (!relative.host) relative.host = '';\n      if (!relative.hostname) relative.hostname = '';\n      if (relPath[0] !== '') relPath.unshift('');\n      if (relPath.length < 2) relPath.unshift('');\n      result.pathname = relPath.join('/');\n    } else {\n      result.pathname = relative.pathname;\n    }\n    result.search = relative.search;\n    result.query = relative.query;\n    result.host = relative.host || '';\n    result.auth = relative.auth;\n    result.hostname = relative.hostname || relative.host;\n    result.port = relative.port;\n    // to support http.request\n    if (result.pathname || result.search) {\n      var p = result.pathname || '';\n      var s = result.search || '';\n      result.path = p + s;\n    }\n    result.slashes = result.slashes || relative.slashes;\n    result.href = result.format();\n    return result;\n  }\n\n  var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n      isRelAbs = (\n          relative.host ||\n          relative.pathname && relative.pathname.charAt(0) === '/'\n      ),\n      mustEndAbs = (isRelAbs || isSourceAbs ||\n                    (result.host && relative.pathname)),\n      removeAllDots = mustEndAbs,\n      srcPath = result.pathname && result.pathname.split('/') || [],\n      relPath = relative.pathname && relative.pathname.split('/') || [],\n      psychotic = result.protocol && !slashedProtocol[result.protocol];\n\n  // if the url is a non-slashed url, then relative\n  // links like ../.. should be able\n  // to crawl up to the hostname, as well.  This is strange.\n  // result.protocol has already been set by now.\n  // Later on, put the first path part into the host field.\n  if (psychotic) {\n    result.hostname = '';\n    result.port = null;\n    if (result.host) {\n      if (srcPath[0] === '') srcPath[0] = result.host;\n      else srcPath.unshift(result.host);\n    }\n    result.host = '';\n    if (relative.protocol) {\n      relative.hostname = null;\n      relative.port = null;\n      if (relative.host) {\n        if (relPath[0] === '') relPath[0] = relative.host;\n        else relPath.unshift(relative.host);\n      }\n      relative.host = null;\n    }\n    mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n  }\n\n  if (isRelAbs) {\n    // it's absolute.\n    result.host = (relative.host || relative.host === '') ?\n                  relative.host : result.host;\n    result.hostname = (relative.hostname || relative.hostname === '') ?\n                      relative.hostname : result.hostname;\n    result.search = relative.search;\n    result.query = relative.query;\n    srcPath = relPath;\n    // fall through to the dot-handling below.\n  } else if (relPath.length) {\n    // it's relative\n    // throw away the existing file, and take the new path instead.\n    if (!srcPath) srcPath = [];\n    srcPath.pop();\n    srcPath = srcPath.concat(relPath);\n    result.search = relative.search;\n    result.query = relative.query;\n  } else if (!util.isNullOrUndefined(relative.search)) {\n    // just pull out the search.\n    // like href='?foo'.\n    // Put this after the other two cases because it simplifies the booleans\n    if (psychotic) {\n      result.hostname = result.host = srcPath.shift();\n      //occationaly the auth can get stuck only in host\n      //this especially happens in cases like\n      //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n      var authInHost = result.host && result.host.indexOf('@') > 0 ?\n                       result.host.split('@') : false;\n      if (authInHost) {\n        result.auth = authInHost.shift();\n        result.host = result.hostname = authInHost.shift();\n      }\n    }\n    result.search = relative.search;\n    result.query = relative.query;\n    //to support http.request\n    if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n      result.path = (result.pathname ? result.pathname : '') +\n                    (result.search ? result.search : '');\n    }\n    result.href = result.format();\n    return result;\n  }\n\n  if (!srcPath.length) {\n    // no path at all.  easy.\n    // we've already handled the other stuff above.\n    result.pathname = null;\n    //to support http.request\n    if (result.search) {\n      result.path = '/' + result.search;\n    } else {\n      result.path = null;\n    }\n    result.href = result.format();\n    return result;\n  }\n\n  // if a url ENDs in . or .., then it must get a trailing slash.\n  // however, if it ends in anything else non-slashy,\n  // then it must NOT get a trailing slash.\n  var last = srcPath.slice(-1)[0];\n  var hasTrailingSlash = (\n      (result.host || relative.host || srcPath.length > 1) &&\n      (last === '.' || last === '..') || last === '');\n\n  // strip single dots, resolve double dots to parent dir\n  // if the path tries to go above the root, `up` ends up > 0\n  var up = 0;\n  for (var i = srcPath.length; i >= 0; i--) {\n    last = srcPath[i];\n    if (last === '.') {\n      srcPath.splice(i, 1);\n    } else if (last === '..') {\n      srcPath.splice(i, 1);\n      up++;\n    } else if (up) {\n      srcPath.splice(i, 1);\n      up--;\n    }\n  }\n\n  // if the path is allowed to go above the root, restore leading ..s\n  if (!mustEndAbs && !removeAllDots) {\n    for (; up--; up) {\n      srcPath.unshift('..');\n    }\n  }\n\n  if (mustEndAbs && srcPath[0] !== '' &&\n      (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n    srcPath.unshift('');\n  }\n\n  if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n    srcPath.push('');\n  }\n\n  var isAbsolute = srcPath[0] === '' ||\n      (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n  // put the host back\n  if (psychotic) {\n    result.hostname = result.host = isAbsolute ? '' :\n                                    srcPath.length ? srcPath.shift() : '';\n    //occationaly the auth can get stuck only in host\n    //this especially happens in cases like\n    //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n    var authInHost = result.host && result.host.indexOf('@') > 0 ?\n                     result.host.split('@') : false;\n    if (authInHost) {\n      result.auth = authInHost.shift();\n      result.host = result.hostname = authInHost.shift();\n    }\n  }\n\n  mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n  if (mustEndAbs && !isAbsolute) {\n    srcPath.unshift('');\n  }\n\n  if (!srcPath.length) {\n    result.pathname = null;\n    result.path = null;\n  } else {\n    result.pathname = srcPath.join('/');\n  }\n\n  //to support request.http\n  if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n    result.path = (result.pathname ? result.pathname : '') +\n                  (result.search ? result.search : '');\n  }\n  result.auth = relative.auth || result.auth;\n  result.slashes = result.slashes || relative.slashes;\n  result.href = result.format();\n  return result;\n};\n\nUrl.prototype.parseHost = function() {\n  var host = this.host;\n  var port = portPattern.exec(host);\n  if (port) {\n    port = port[0];\n    if (port !== ':') {\n      this.port = port.substr(1);\n    }\n    host = host.substr(0, host.length - port.length);\n  }\n  if (host) this.hostname = host;\n};\n","'use strict';\n\nmodule.exports = {\n  isString: function(arg) {\n    return typeof(arg) === 'string';\n  },\n  isObject: function(arg) {\n    return typeof(arg) === 'object' && arg !== null;\n  },\n  isNull: function(arg) {\n    return arg === null;\n  },\n  isNullOrUndefined: function(arg) {\n    return arg == null;\n  }\n};\n","'use strict'\n\nmodule.exports = function parseURI (str, opts) {\n  opts = opts || {}\n\n  var o = {\n    key: ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'],\n    q: {\n      name: 'queryKey',\n      parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n    },\n    parser: {\n      strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n      loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n    }\n  }\n\n  var m = o.parser[opts.strictMode ? 'strict' : 'loose'].exec(str)\n  var uri = {}\n  var i = 14\n\n  while (i--) uri[o.key[i]] = m[i] || ''\n\n  uri[o.q.name] = {}\n  uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n    if ($1) uri[o.q.name][$1] = $2\n  })\n\n  return uri\n}\n","'use strict';\n\nvar parseUri        = require('parse-uri');\nvar async           = require('./async');\nvar Resource        = require('./Resource');\nvar EventEmitter    = require('eventemitter3');\n\n// some constants\nvar DEFAULT_CONCURRENCY = 10;\nvar MAX_PROGRESS = 100;\n\n/**\n * Manages the state and loading of multiple resources to load.\n *\n * @class\n * @param {string} [baseUrl=''] - The base url for all resources loaded by this loader.\n * @param {number} [concurrency=10] - The number of resources to load concurrently.\n */\nfunction Loader(baseUrl, concurrency) {\n    EventEmitter.call(this);\n\n    concurrency = concurrency || DEFAULT_CONCURRENCY;\n\n    /**\n     * The base url for all resources loaded by this loader.\n     *\n     * @member {string}\n     */\n    this.baseUrl = baseUrl || '';\n\n    /**\n     * The progress percent of the loader going through the queue.\n     *\n     * @member {number}\n     */\n    this.progress = 0;\n\n    /**\n     * Loading state of the loader, true if it is currently loading resources.\n     *\n     * @member {boolean}\n     */\n    this.loading = false;\n\n    /**\n     * The percentage of total progress that a single resource represents.\n     *\n     * @member {number}\n     */\n    this._progressChunk = 0;\n\n    /**\n     * The middleware to run before loading each resource.\n     *\n     * @member {function[]}\n     */\n    this._beforeMiddleware = [];\n\n    /**\n     * The middleware to run after loading each resource.\n     *\n     * @member {function[]}\n     */\n    this._afterMiddleware = [];\n\n    /**\n     * The `_loadResource` function bound with this object context.\n     *\n     * @private\n     * @member {function}\n     */\n    this._boundLoadResource = this._loadResource.bind(this);\n\n    /**\n     * The resource buffer that fills until `load` is called to start loading resources.\n     *\n     * @private\n     * @member {Resource[]}\n     */\n    this._buffer = [];\n\n    /**\n     * Used to track load completion.\n     *\n     * @private\n     * @member {number}\n     */\n    this._numToLoad = 0;\n\n    /**\n     * The resources waiting to be loaded.\n     *\n     * @private\n     * @member {Resource[]}\n     */\n    this._queue = async.queue(this._boundLoadResource, concurrency);\n\n    /**\n     * All the resources for this loader keyed by name.\n     *\n     * @member {object}\n     */\n    this.resources = {};\n\n    /**\n     * Emitted once per loaded or errored resource.\n     *\n     * @event progress\n     * @memberof Loader#\n     */\n\n    /**\n     * Emitted once per errored resource.\n     *\n     * @event error\n     * @memberof Loader#\n     */\n\n    /**\n     * Emitted once per loaded resource.\n     *\n     * @event load\n     * @memberof Loader#\n     */\n\n    /**\n     * Emitted when the loader begins to process the queue.\n     *\n     * @event start\n     * @memberof Loader#\n     */\n\n    /**\n     * Emitted when the queued resources all load.\n     *\n     * @event complete\n     * @memberof Loader#\n     */\n}\n\nLoader.prototype = Object.create(EventEmitter.prototype);\nLoader.prototype.constructor = Loader;\nmodule.exports = Loader;\n\n/**\n * Adds a resource (or multiple resources) to the loader queue.\n *\n * This function can take a wide variety of different parameters. The only thing that is always\n * required the url to load. All the following will work:\n *\n * ```js\n * loader\n *     // normal param syntax\n *     .add('key', 'http://...', function () {})\n *     .add('http://...', function () {})\n *     .add('http://...')\n *\n *     // object syntax\n *     .add({\n *         name: 'key2',\n *         url: 'http://...'\n *     }, function () {})\n *     .add({\n *         url: 'http://...'\n *     }, function () {})\n *     .add({\n *         name: 'key3',\n *         url: 'http://...'\n *         onComplete: function () {}\n *     })\n *     .add({\n *         url: 'https://...',\n *         onComplete: function () {},\n *         crossOrigin: true\n *     })\n *\n *     // you can also pass an array of objects or urls or both\n *     .add([\n *         { name: 'key4', url: 'http://...', onComplete: function () {} },\n *         { url: 'http://...', onComplete: function () {} },\n *         'http://...'\n *     ])\n *\n *     // and you can use both params and options\n *     .add('key', 'http://...', { crossOrigin: true }, function () {})\n *     .add('http://...', { crossOrigin: true }, function () {});\n * ```\n *\n * @alias enqueue\n * @param {string} [name] - The name of the resource to load, if not passed the url is used.\n * @param {string} [url] - The url for this resource, relative to the baseUrl of this loader.\n * @param {object} [options] - The options for the load.\n * @param {boolean} [options.crossOrigin] - Is this request cross-origin? Default is to determine automatically.\n * @param {Resource.XHR_LOAD_TYPE} [options.loadType=Resource.LOAD_TYPE.XHR] - How should this resource be loaded?\n * @param {Resource.XHR_RESPONSE_TYPE} [options.xhrType=Resource.XHR_RESPONSE_TYPE.DEFAULT] - How should the data being\n *      loaded be interpreted when using XHR?\n * @param {function} [cb] - Function to call when this specific resource completes loading.\n * @return {Loader} Returns itself.\n */\nLoader.prototype.add = Loader.prototype.enqueue = function (name, url, options, cb) {\n    // special case of an array of objects or urls\n    if (Array.isArray(name)) {\n        for (var i = 0; i < name.length; ++i) {\n            this.add(name[i]);\n        }\n\n        return this;\n    }\n\n    // if an object is passed instead of params\n    if (typeof name === 'object') {\n        cb = url || name.callback || name.onComplete;\n        options = name;\n        url = name.url;\n        name = name.name || name.key || name.url;\n    }\n\n    // case where no name is passed shift all args over by one.\n    if (typeof url !== 'string') {\n        cb = options;\n        options = url;\n        url = name;\n    }\n\n    // now that we shifted make sure we have a proper url.\n    if (typeof url !== 'string') {\n        throw new Error('No url passed to add resource to loader.');\n    }\n\n    // options are optional so people might pass a function and no options\n    if (typeof options === 'function') {\n        cb = options;\n        options = null;\n    }\n\n    // check if resource already exists.\n    if (this.resources[name]) {\n        throw new Error('Resource with name \"' + name + '\" already exists.');\n    }\n\n    // add base url if this isn't an absolute url\n    url = this._prepareUrl(url);\n\n    // create the store the resource\n    this.resources[name] = new Resource(name, url, options);\n\n    if (typeof cb === 'function') {\n        this.resources[name].once('afterMiddleware', cb);\n    }\n\n    this._numToLoad++;\n\n    // if already loading add it to the worker queue\n    if (this._queue.started) {\n        this._queue.push(this.resources[name]);\n        this._progressChunk = (MAX_PROGRESS - this.progress) / (this._queue.length() + this._queue.running());\n    }\n    // otherwise buffer it to be added to the queue later\n    else {\n        this._buffer.push(this.resources[name]);\n        this._progressChunk = MAX_PROGRESS / this._buffer.length;\n    }\n\n    return this;\n};\n\n/**\n * Sets up a middleware function that will run *before* the\n * resource is loaded.\n *\n * @alias pre\n * @method before\n * @param {function} fn - The middleware function to register.\n * @return {Loader} Returns itself.\n */\nLoader.prototype.before = Loader.prototype.pre = function (fn) {\n    this._beforeMiddleware.push(fn);\n\n    return this;\n};\n\n/**\n * Sets up a middleware function that will run *after* the\n * resource is loaded.\n *\n * @alias use\n * @method after\n * @param {function} fn - The middleware function to register.\n * @return {Loader} Returns itself.\n */\nLoader.prototype.after = Loader.prototype.use = function (fn) {\n    this._afterMiddleware.push(fn);\n\n    return this;\n};\n\n/**\n * Resets the queue of the loader to prepare for a new load.\n *\n * @return {Loader} Returns itself.\n */\nLoader.prototype.reset = function () {\n    // this.baseUrl = baseUrl || '';\n\n    this.progress = 0;\n\n    this.loading = false;\n\n    this._progressChunk = 0;\n\n    // this._beforeMiddleware.length = 0;\n    // this._afterMiddleware.length = 0;\n\n    this._buffer.length = 0;\n\n    this._numToLoad = 0;\n\n    this._queue.kill();\n    this._queue.started = false;\n\n    // abort all resource loads\n    for (var k in this.resources) {\n        var res = this.resources[k];\n\n        res.off('complete', this._onLoad, this);\n\n        if (res.isLoading) {\n            res.abort();\n        }\n    }\n\n    this.resources = {};\n\n    return this;\n};\n\n/**\n * Starts loading the queued resources.\n *\n * @fires start\n * @param {function} [cb] - Optional callback that will be bound to the `complete` event.\n * @return {Loader} Returns itself.\n */\nLoader.prototype.load = function (cb) {\n    // register complete callback if they pass one\n    if (typeof cb === 'function') {\n        this.once('complete', cb);\n    }\n\n    // if the queue has already started we are done here\n    if (this._queue.started) {\n        return this;\n    }\n\n    // notify of start\n    this.emit('start', this);\n\n    // update loading state\n    this.loading = true;\n\n    // start the internal queue\n    for (var i = 0; i < this._buffer.length; ++i) {\n        this._queue.push(this._buffer[i]);\n    }\n\n    // empty the buffer\n    this._buffer.length = 0;\n\n    return this;\n};\n\n/**\n * Prepares a url for usage based on the configuration of this object\n *\n * @private\n * @param {string} url - The url to prepare.\n * @return {string} The prepared url.\n */\nLoader.prototype._prepareUrl = function (url) {\n    var parsedUrl = parseUri(url, { strictMode: true });\n\n    // absolute url, just use it as is.\n    if (parsedUrl.protocol || !parsedUrl.path || parsedUrl.path.indexOf('//') === 0) {\n        return url;\n    }\n\n    // if baseUrl doesn't end in slash and url doesn't start with slash, then add a slash inbetween\n    if (this.baseUrl.length\n        && this.baseUrl.lastIndexOf('/') !== this.baseUrl.length - 1\n        && url.charAt(0) !== '/'\n    ) {\n        return this.baseUrl + '/' + url;\n    }\n\n    return this.baseUrl + url;\n};\n\n/**\n * Loads a single resource.\n *\n * @private\n * @param {Resource} resource - The resource to load.\n * @param {function} dequeue - The function to call when we need to dequeue this item.\n */\nLoader.prototype._loadResource = function (resource, dequeue) {\n    var self = this;\n\n    resource._dequeue = dequeue;\n\n    // run before middleware\n    async.eachSeries(\n        this._beforeMiddleware,\n        function (fn, next) {\n            fn.call(self, resource, function () {\n                // if the before middleware marks the resource as complete,\n                // break and don't process any more before middleware\n                next(resource.isComplete ? {} : null);\n            });\n        },\n        function () {\n            // resource.on('progress', self.emit.bind(self, 'progress'));\n\n            if (resource.isComplete) {\n                self._onLoad(resource);\n            }\n            else {\n                resource.once('complete', self._onLoad, self);\n                resource.load();\n            }\n        }\n    );\n};\n\n/**\n * Called once each resource has loaded.\n *\n * @fires complete\n * @private\n */\nLoader.prototype._onComplete = function () {\n    this.loading = false;\n\n    this.emit('complete', this, this.resources);\n};\n\n/**\n * Called each time a resources is loaded.\n *\n * @fires progress\n * @fires error\n * @fires load\n * @private\n * @param {Resource} resource - The resource that was loaded\n */\nLoader.prototype._onLoad = function (resource) {\n    var self = this;\n\n    // run middleware, this *must* happen before dequeue so sub-assets get added properly\n    async.eachSeries(\n        this._afterMiddleware,\n        function (fn, next) {\n            fn.call(self, resource, next);\n        },\n        function () {\n            resource.emit('afterMiddleware', resource);\n\n            self._numToLoad--;\n\n            self.progress += self._progressChunk;\n            self.emit('progress', self, resource);\n\n            if (resource.error) {\n                self.emit('error', resource.error, self, resource);\n            }\n            else {\n                self.emit('load', self, resource);\n            }\n\n            // do completion check\n            if (self._numToLoad === 0) {\n                self.progress = 100;\n                self._onComplete();\n            }\n        }\n    );\n\n    // remove this resource from the async queue\n    resource._dequeue();\n};\n\nLoader.LOAD_TYPE = Resource.LOAD_TYPE;\nLoader.XHR_RESPONSE_TYPE = Resource.XHR_RESPONSE_TYPE;\n","'use strict';\n\nvar EventEmitter    = require('eventemitter3');\nvar parseUri        = require('parse-uri');\n\n// tests is CORS is supported in XHR, if not we need to use XDR\nvar useXdr = !!(window.XDomainRequest && !('withCredentials' in (new XMLHttpRequest())));\nvar tempAnchor = null;\n\n// some status constants\nvar STATUS_NONE = 0;\nvar STATUS_OK = 200;\nvar STATUS_EMPTY = 204;\n\n/**\n * Manages the state and loading of a single resource represented by\n * a single URL.\n *\n * @class\n * @param {string} name - The name of the resource to load.\n * @param {string|string[]} url - The url for this resource, for audio/video loads you can pass an array of sources.\n * @param {object} [options] - The options for the load.\n * @param {string|boolean} [options.crossOrigin] - Is this request cross-origin? Default is to determine automatically.\n * @param {Resource.LOAD_TYPE} [options.loadType=Resource.LOAD_TYPE.XHR] - How should this resource be loaded?\n * @param {Resource.XHR_RESPONSE_TYPE} [options.xhrType=Resource.XHR_RESPONSE_TYPE.DEFAULT] - How should the data being\n *      loaded be interpreted when using XHR?\n * @param {object} [options.metadata] - Extra info for middleware.\n */\nfunction Resource(name, url, options) {\n    EventEmitter.call(this);\n\n    options = options || {};\n\n    if (typeof name !== 'string' || typeof url !== 'string') {\n        throw new Error('Both name and url are required for constructing a resource.');\n    }\n\n    /**\n     * The name of this resource.\n     *\n     * @member {string}\n     * @readonly\n     */\n    this.name = name;\n\n    /**\n     * The url used to load this resource.\n     *\n     * @member {string}\n     * @readonly\n     */\n    this.url = url;\n\n    /**\n     * Stores whether or not this url is a data url.\n     *\n     * @member {boolean}\n     * @readonly\n     */\n    this.isDataUrl = this.url.indexOf('data:') === 0;\n\n    /**\n     * The data that was loaded by the resource.\n     *\n     * @member {any}\n     */\n    this.data = null;\n\n    /**\n     * Is this request cross-origin? If unset, determined automatically.\n     *\n     * @member {string}\n     */\n    this.crossOrigin = options.crossOrigin === true ? 'anonymous' : options.crossOrigin;\n\n    /**\n     * The method of loading to use for this resource.\n     *\n     * @member {Resource.LOAD_TYPE}\n     */\n    this.loadType = options.loadType || this._determineLoadType();\n\n    /**\n     * The type used to load the resource via XHR. If unset, determined automatically.\n     *\n     * @member {string}\n     */\n    this.xhrType = options.xhrType;\n\n    /**\n     * Extra info for middleware, and controlling specifics about how the resource loads.\n     *\n     * Note that if you pass in a `loadElement`, the Resource class takes ownership of it.\n     * Meaning it will modify it as it sees fit.\n     *\n     * @member {object}\n     * @property {HTMLImageElement|HTMLAudioElement|HTMLVideoElement} [loadElement=null] - The\n     *  element to use for loading, instead of creating one.\n     * @property {boolean} [skipSource=false] - Skips adding source(s) to the load element. This\n     *  is useful if you want to pass in a `loadElement` that you already added load sources\n     *  to.\n     */\n    this.metadata = options.metadata || {};\n\n    /**\n     * The error that occurred while loading (if any).\n     *\n     * @member {Error}\n     * @readonly\n     */\n    this.error = null;\n\n    /**\n     * The XHR object that was used to load this resource. This is only set\n     * when `loadType` is `Resource.LOAD_TYPE.XHR`.\n     *\n     * @member {XMLHttpRequest}\n     */\n    this.xhr = null;\n\n    /**\n     * Describes if this resource was loaded as json. Only valid after the resource\n     * has completely loaded.\n     *\n     * @member {boolean}\n     */\n    this.isJson = false;\n\n    /**\n     * Describes if this resource was loaded as xml. Only valid after the resource\n     * has completely loaded.\n     *\n     * @member {boolean}\n     */\n    this.isXml = false;\n\n    /**\n     * Describes if this resource was loaded as an image tag. Only valid after the resource\n     * has completely loaded.\n     *\n     * @member {boolean}\n     */\n    this.isImage = false;\n\n    /**\n     * Describes if this resource was loaded as an audio tag. Only valid after the resource\n     * has completely loaded.\n     *\n     * @member {boolean}\n     */\n    this.isAudio = false;\n\n    /**\n     * Describes if this resource was loaded as a video tag. Only valid after the resource\n     * has completely loaded.\n     *\n     * @member {boolean}\n     */\n    this.isVideo = false;\n\n    /**\n     * Describes if this resource has finished loading. Is true when the resource has completely\n     * loaded.\n     *\n     * @member {boolean}\n     */\n    this.isComplete = false;\n\n    /**\n     * Describes if this resource is currently loading. Is true when the resource starts loading,\n     * and is false again when complete.\n     *\n     * @member {boolean}\n     */\n    this.isLoading = false;\n\n    /**\n     * The `dequeue` method that will be used a storage place for the async queue dequeue method\n     * used privately by the loader.\n     *\n     * @private\n     * @member {function}\n     */\n    this._dequeue = null;\n\n    /**\n     * The `complete` function bound to this resource's context.\n     *\n     * @private\n     * @member {function}\n     */\n    this._boundComplete = this.complete.bind(this);\n\n    /**\n     * The `_onError` function bound to this resource's context.\n     *\n     * @private\n     * @member {function}\n     */\n    this._boundOnError = this._onError.bind(this);\n\n    /**\n     * The `_onProgress` function bound to this resource's context.\n     *\n     * @private\n     * @member {function}\n     */\n    this._boundOnProgress = this._onProgress.bind(this);\n\n    // xhr callbacks\n    this._boundXhrOnError = this._xhrOnError.bind(this);\n    this._boundXhrOnAbort = this._xhrOnAbort.bind(this);\n    this._boundXhrOnLoad = this._xhrOnLoad.bind(this);\n    this._boundXdrOnTimeout = this._xdrOnTimeout.bind(this);\n\n    /**\n     * Emitted when the resource beings to load.\n     *\n     * @event start\n     * @memberof Resource#\n     */\n\n    /**\n     * Emitted each time progress of this resource load updates.\n     * Not all resources types and loader systems can support this event\n     * so sometimes it may not be available. If the resource\n     * is being loaded on a modern browser, using XHR, and the remote server\n     * properly sets Content-Length headers, then this will be available.\n     *\n     * @event progress\n     * @memberof Resource#\n     */\n\n    /**\n     * Emitted once this resource has loaded, if there was an error it will\n     * be in the `error` property.\n     *\n     * @event complete\n     * @memberof Resource#\n     */\n}\n\nResource.prototype = Object.create(EventEmitter.prototype);\nResource.prototype.constructor = Resource;\nmodule.exports = Resource;\n\n/**\n * Marks the resource as complete.\n *\n * @fires complete\n */\nResource.prototype.complete = function () {\n    // TODO: Clean this up in a wrapper or something...gross....\n    if (this.data && this.data.removeEventListener) {\n        this.data.removeEventListener('error', this._boundOnError, false);\n        this.data.removeEventListener('load', this._boundComplete, false);\n        this.data.removeEventListener('progress', this._boundOnProgress, false);\n        this.data.removeEventListener('canplaythrough', this._boundComplete, false);\n    }\n\n    if (this.xhr) {\n        if (this.xhr.removeEventListener) {\n            this.xhr.removeEventListener('error', this._boundXhrOnError, false);\n            this.xhr.removeEventListener('abort', this._boundXhrOnAbort, false);\n            this.xhr.removeEventListener('progress', this._boundOnProgress, false);\n            this.xhr.removeEventListener('load', this._boundXhrOnLoad, false);\n        }\n        else {\n            this.xhr.onerror = null;\n            this.xhr.ontimeout = null;\n            this.xhr.onprogress = null;\n            this.xhr.onload = null;\n        }\n    }\n\n    if (this.isComplete) {\n        throw new Error('Complete called again for an already completed resource.');\n    }\n\n    this.isComplete = true;\n    this.isLoading = false;\n\n    this.emit('complete', this);\n};\n\n/**\n * Aborts the loading of this resource, with an optional message.\n *\n * @param {string} message - The message to use for the error\n */\nResource.prototype.abort = function (message) {\n    // abort can be called multiple times, ignore subsequent calls.\n    if (this.error) {\n        return;\n    }\n\n    // store error\n    this.error = new Error(message);\n\n    // abort the actual loading\n    if (this.xhr) {\n        this.xhr.abort();\n    }\n    else if (this.xdr) {\n        this.xdr.abort();\n    }\n    else if (this.data) {\n        // single source\n        if (typeof this.data.src !== 'undefined') {\n            this.data.src = '';\n        }\n        // multi-source\n        else {\n            while (this.data.firstChild) {\n                this.data.removeChild(this.data.firstChild);\n            }\n        }\n    }\n\n    // done now.\n    this.complete();\n};\n\n/**\n * Kicks off loading of this resource. This method is asynchronous.\n *\n * @fires start\n * @param {function} [cb] - Optional callback to call once the resource is loaded.\n */\nResource.prototype.load = function (cb) {\n    if (this.isLoading) {\n        return;\n    }\n\n    if (this.isComplete) {\n        if (cb) {\n            var self = this;\n\n            setTimeout(function () {\n                cb(self);\n            }, 1);\n        }\n\n        return;\n    }\n    else if (cb) {\n        this.once('complete', cb);\n    }\n\n    this.isLoading = true;\n\n    this.emit('start', this);\n\n    // if unset, determine the value\n    if (this.crossOrigin === false || typeof this.crossOrigin !== 'string') {\n        this.crossOrigin = this._determineCrossOrigin(this.url);\n    }\n\n    switch (this.loadType) {\n        case Resource.LOAD_TYPE.IMAGE:\n            this._loadElement('image');\n            break;\n\n        case Resource.LOAD_TYPE.AUDIO:\n            this._loadSourceElement('audio');\n            break;\n\n        case Resource.LOAD_TYPE.VIDEO:\n            this._loadSourceElement('video');\n            break;\n\n        case Resource.LOAD_TYPE.XHR:\n            /* falls through */\n        default:\n            if (useXdr && this.crossOrigin) {\n                this._loadXdr();\n            }\n            else {\n                this._loadXhr();\n            }\n            break;\n    }\n};\n\n/**\n * Loads this resources using an element that has a single source,\n * like an HTMLImageElement.\n *\n * @private\n * @param {string} type - The type of element to use.\n */\nResource.prototype._loadElement = function (type) {\n    if (this.metadata.loadElement) {\n        this.data = this.metadata.loadElement;\n    }\n    else if (type === 'image' && typeof window.Image !== 'undefined') {\n        this.data = new Image();\n    }\n    else {\n        this.data = document.createElement(type);\n    }\n\n    if (this.crossOrigin) {\n        this.data.crossOrigin = this.crossOrigin;\n    }\n\n    if (!this.metadata.skipSource) {\n        this.data.src = this.url;\n    }\n\n    var typeName = 'is' + type[0].toUpperCase() + type.substring(1);\n\n    if (this[typeName] === false) {\n        this[typeName] = true;\n    }\n\n    this.data.addEventListener('error', this._boundOnError, false);\n    this.data.addEventListener('load', this._boundComplete, false);\n    this.data.addEventListener('progress', this._boundOnProgress, false);\n};\n\n/**\n * Loads this resources using an element that has multiple sources,\n * like an HTMLAudioElement or HTMLVideoElement.\n *\n * @private\n * @param {string} type - The type of element to use.\n */\nResource.prototype._loadSourceElement = function (type) {\n    if (this.metadata.loadElement) {\n        this.data = this.metadata.loadElement;\n    }\n    else if (type === 'audio' && typeof window.Audio !== 'undefined') {\n        this.data = new Audio();\n    }\n    else {\n        this.data = document.createElement(type);\n    }\n\n    if (this.data === null) {\n        this.abort('Unsupported element ' + type);\n\n        return;\n    }\n\n    if (!this.metadata.skipSource) {\n        // support for CocoonJS Canvas+ runtime, lacks document.createElement('source')\n        if (navigator.isCocoonJS) {\n            this.data.src = Array.isArray(this.url) ? this.url[0] : this.url;\n        }\n        else if (Array.isArray(this.url)) {\n            for (var i = 0; i < this.url.length; ++i) {\n                this.data.appendChild(this._createSource(type, this.url[i]));\n            }\n        }\n        else {\n            this.data.appendChild(this._createSource(type, this.url));\n        }\n    }\n\n    this['is' + type[0].toUpperCase() + type.substring(1)] = true;\n\n    this.data.addEventListener('error', this._boundOnError, false);\n    this.data.addEventListener('load', this._boundComplete, false);\n    this.data.addEventListener('progress', this._boundOnProgress, false);\n    this.data.addEventListener('canplaythrough', this._boundComplete, false);\n\n    this.data.load();\n};\n\n/**\n * Loads this resources using an XMLHttpRequest.\n *\n * @private\n */\nResource.prototype._loadXhr = function () {\n    // if unset, determine the value\n    if (typeof this.xhrType !== 'string') {\n        this.xhrType = this._determineXhrType();\n    }\n\n    var xhr = this.xhr = new XMLHttpRequest();\n\n    // set the request type and url\n    xhr.open('GET', this.url, true);\n\n    // load json as text and parse it ourselves. We do this because some browsers\n    // *cough* safari *cough* can't deal with it.\n    if (this.xhrType === Resource.XHR_RESPONSE_TYPE.JSON || this.xhrType === Resource.XHR_RESPONSE_TYPE.DOCUMENT) {\n        xhr.responseType = Resource.XHR_RESPONSE_TYPE.TEXT;\n    }\n    else {\n        xhr.responseType = this.xhrType;\n    }\n\n    xhr.addEventListener('error', this._boundXhrOnError, false);\n    xhr.addEventListener('abort', this._boundXhrOnAbort, false);\n    xhr.addEventListener('progress', this._boundOnProgress, false);\n    xhr.addEventListener('load', this._boundXhrOnLoad, false);\n\n    xhr.send();\n};\n\n/**\n * Loads this resources using an XDomainRequest. This is here because we need to support IE9 (gross).\n *\n * @private\n */\nResource.prototype._loadXdr = function () {\n    // if unset, determine the value\n    if (typeof this.xhrType !== 'string') {\n        this.xhrType = this._determineXhrType();\n    }\n\n    var xdr = this.xhr = new XDomainRequest();\n\n    // XDomainRequest has a few quirks. Occasionally it will abort requests\n    // A way to avoid this is to make sure ALL callbacks are set even if not used\n    // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9\n    xdr.timeout = 5000;\n\n    xdr.onerror = this._boundXhrOnError;\n    xdr.ontimeout = this._boundXdrOnTimeout;\n    xdr.onprogress = this._boundOnProgress;\n    xdr.onload = this._boundXhrOnLoad;\n\n    xdr.open('GET', this.url, true);\n\n    // Note: The xdr.send() call is wrapped in a timeout to prevent an\n    // issue with the interface where some requests are lost if multiple\n    // XDomainRequests are being sent at the same time.\n    // Some info here: https://github.com/photonstorm/phaser/issues/1248\n    setTimeout(function () {\n        xdr.send();\n    }, 0);\n};\n\n/**\n * Creates a source used in loading via an element.\n *\n * @private\n * @param {string} type - The element type (video or audio).\n * @param {string} url - The source URL to load from.\n * @param {string} [mime] - The mime type of the video\n * @return {HTMLSourceElement} The source element.\n */\nResource.prototype._createSource = function (type, url, mime) {\n    if (!mime) {\n        mime = type + '/' + url.substr(url.lastIndexOf('.') + 1);\n    }\n\n    var source = document.createElement('source');\n\n    source.src = url;\n    source.type = mime;\n\n    return source;\n};\n\n/**\n * Called if a load errors out.\n *\n * @param {Event} event - The error event from the element that emits it.\n * @private\n */\nResource.prototype._onError = function (event) {\n    this.abort('Failed to load element using ' + event.target.nodeName);\n};\n\n/**\n * Called if a load progress event fires for xhr/xdr.\n *\n * @fires progress\n * @private\n * @param {XMLHttpRequestProgressEvent|Event} event - Progress event.\n */\nResource.prototype._onProgress = function (event) {\n    if (event && event.lengthComputable) {\n        this.emit('progress', this, event.loaded / event.total);\n    }\n};\n\n/**\n * Called if an error event fires for xhr/xdr.\n *\n * @private\n * @param {XMLHttpRequestErrorEvent|Event} event - Error event.\n */\nResource.prototype._xhrOnError = function () {\n    var xhr = this.xhr;\n\n    this.abort(reqType(xhr) + ' Request failed. Status: ' + xhr.status + ', text: \"' + xhr.statusText + '\"');\n};\n\n/**\n * Called if an abort event fires for xhr.\n *\n * @private\n * @param {XMLHttpRequestAbortEvent} event - Abort Event\n */\nResource.prototype._xhrOnAbort = function () {\n    this.abort(reqType(this.xhr) + ' Request was aborted by the user.');\n};\n\n/**\n * Called if a timeout event fires for xdr.\n *\n * @private\n * @param {Event} event - Timeout event.\n */\nResource.prototype._xdrOnTimeout = function () {\n    this.abort(reqType(this.xhr) + ' Request timed out.');\n};\n\n/**\n * Called when data successfully loads from an xhr/xdr request.\n *\n * @private\n * @param {XMLHttpRequestLoadEvent|Event} event - Load event\n */\nResource.prototype._xhrOnLoad = function () {\n    var xhr = this.xhr;\n    var status = typeof xhr.status === 'undefined' ? xhr.status : STATUS_OK; // XDR has no `.status`, assume 200.\n\n    // status can be 0 when using the file:// protocol, also check if a response was found\n    if (status === STATUS_OK || status === STATUS_EMPTY || (status === STATUS_NONE && xhr.responseText.length > 0)) {\n        // if text, just return it\n        if (this.xhrType === Resource.XHR_RESPONSE_TYPE.TEXT) {\n            this.data = xhr.responseText;\n        }\n        // if json, parse into json object\n        else if (this.xhrType === Resource.XHR_RESPONSE_TYPE.JSON) {\n            try {\n                this.data = JSON.parse(xhr.responseText);\n                this.isJson = true;\n            }\n            catch (e) {\n                this.abort('Error trying to parse loaded json:', e);\n\n                return;\n            }\n        }\n        // if xml, parse into an xml document or div element\n        else if (this.xhrType === Resource.XHR_RESPONSE_TYPE.DOCUMENT) {\n            try {\n                if (window.DOMParser) {\n                    var domparser = new DOMParser();\n\n                    this.data = domparser.parseFromString(xhr.responseText, 'text/xml');\n                }\n                else {\n                    var div = document.createElement('div');\n\n                    div.innerHTML = xhr.responseText;\n                    this.data = div;\n                }\n                this.isXml = true;\n            }\n            catch (e) {\n                this.abort('Error trying to parse loaded xml:', e);\n\n                return;\n            }\n        }\n        // other types just return the response\n        else {\n            this.data = xhr.response || xhr.responseText;\n        }\n    }\n    else {\n        this.abort('[' + xhr.status + ']' + xhr.statusText + ':' + xhr.responseURL);\n\n        return;\n    }\n\n    this.complete();\n};\n\n/**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n *\n * @private\n * @param {string} url - The url to test.\n * @param {object} [loc=window.location] - The location object to test against.\n * @return {string} The crossOrigin value to use (or empty string for none).\n */\nResource.prototype._determineCrossOrigin = function (url, loc) {\n    // data: and javascript: urls are considered same-origin\n    if (url.indexOf('data:') === 0) {\n        return '';\n    }\n\n    // default is window.location\n    loc = loc || window.location;\n\n    if (!tempAnchor) {\n        tempAnchor = document.createElement('a');\n    }\n\n    // let the browser determine the full href for the url of this resource and then\n    // parse with the node url lib, we can't use the properties of the anchor element\n    // because they don't work in IE9 :(\n    tempAnchor.href = url;\n    url = parseUri(tempAnchor.href, { strictMode: true });\n\n    var samePort = (!url.port && loc.port === '') || (url.port === loc.port);\n    var protocol = url.protocol ? url.protocol + ':' : '';\n\n    // if cross origin\n    if (url.host !== loc.hostname || !samePort || protocol !== loc.protocol) {\n        return 'anonymous';\n    }\n\n    return '';\n};\n\n/**\n * Determines the responseType of an XHR request based on the extension of the\n * resource being loaded.\n *\n * @private\n * @return {Resource.XHR_RESPONSE_TYPE} The responseType to use.\n */\nResource.prototype._determineXhrType = function () {\n    return Resource._xhrTypeMap[this._getExtension()] || Resource.XHR_RESPONSE_TYPE.TEXT;\n};\n\nResource.prototype._determineLoadType = function () {\n    return Resource._loadTypeMap[this._getExtension()] || Resource.LOAD_TYPE.XHR;\n};\n\nResource.prototype._getExtension = function () {\n    var url = this.url;\n    var ext = '';\n\n    if (this.isDataUrl) {\n        var slashIndex = url.indexOf('/');\n\n        ext = url.substring(slashIndex + 1, url.indexOf(';', slashIndex));\n    }\n    else {\n        var queryStart = url.indexOf('?');\n\n        if (queryStart !== -1) {\n            url = url.substring(0, queryStart);\n        }\n\n        ext = url.substring(url.lastIndexOf('.') + 1);\n    }\n\n    return ext.toLowerCase();\n};\n\n/**\n * Determines the mime type of an XHR request based on the responseType of\n * resource being loaded.\n *\n * @private\n * @param {Resource.XHR_RESPONSE_TYPE} type - The type to get a mime type for.\n * @return {string} The mime type to use.\n */\nResource.prototype._getMimeFromXhrType = function (type) {\n    switch (type) {\n        case Resource.XHR_RESPONSE_TYPE.BUFFER:\n            return 'application/octet-binary';\n\n        case Resource.XHR_RESPONSE_TYPE.BLOB:\n            return 'application/blob';\n\n        case Resource.XHR_RESPONSE_TYPE.DOCUMENT:\n            return 'application/xml';\n\n        case Resource.XHR_RESPONSE_TYPE.JSON:\n            return 'application/json';\n\n        case Resource.XHR_RESPONSE_TYPE.DEFAULT:\n        case Resource.XHR_RESPONSE_TYPE.TEXT:\n            /* falls through */\n        default:\n            return 'text/plain';\n\n    }\n};\n\n/**\n * Quick helper to get string xhr type.\n *\n * @ignore\n * @param {XMLHttpRequest|XDomainRequest} xhr - The request to check.\n * @return {string} The type.\n */\nfunction reqType(xhr) {\n    return xhr.toString().replace('object ', '');\n}\n\n/**\n * The types of loading a resource can use.\n *\n * @static\n * @readonly\n * @enum {number}\n */\nResource.LOAD_TYPE = {\n    /** Uses XMLHttpRequest to load the resource. */\n    XHR:    1,\n    /** Uses an `Image` object to load the resource. */\n    IMAGE:  2,\n    /** Uses an `Audio` object to load the resource. */\n    AUDIO:  3,\n    /** Uses a `Video` object to load the resource. */\n    VIDEO:  4\n};\n\n/**\n * The XHR ready states, used internally.\n *\n * @static\n * @readonly\n * @enum {string}\n */\nResource.XHR_RESPONSE_TYPE = {\n    /** defaults to text */\n    DEFAULT:    'text',\n    /** ArrayBuffer */\n    BUFFER:     'arraybuffer',\n    /** Blob */\n    BLOB:       'blob',\n    /** Document */\n    DOCUMENT:   'document',\n    /** Object */\n    JSON:       'json',\n    /** String */\n    TEXT:       'text'\n};\n\nResource._loadTypeMap = {\n    gif:      Resource.LOAD_TYPE.IMAGE,\n    png:      Resource.LOAD_TYPE.IMAGE,\n    bmp:      Resource.LOAD_TYPE.IMAGE,\n    jpg:      Resource.LOAD_TYPE.IMAGE,\n    jpeg:     Resource.LOAD_TYPE.IMAGE,\n    tif:      Resource.LOAD_TYPE.IMAGE,\n    tiff:     Resource.LOAD_TYPE.IMAGE,\n    webp:     Resource.LOAD_TYPE.IMAGE,\n    tga:      Resource.LOAD_TYPE.IMAGE,\n    'svg+xml':  Resource.LOAD_TYPE.IMAGE\n};\n\nResource._xhrTypeMap = {\n    // xml\n    xhtml:    Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n    html:     Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n    htm:      Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n    xml:      Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n    tmx:      Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n    tsx:      Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n    svg:      Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n\n    // images\n    gif:      Resource.XHR_RESPONSE_TYPE.BLOB,\n    png:      Resource.XHR_RESPONSE_TYPE.BLOB,\n    bmp:      Resource.XHR_RESPONSE_TYPE.BLOB,\n    jpg:      Resource.XHR_RESPONSE_TYPE.BLOB,\n    jpeg:     Resource.XHR_RESPONSE_TYPE.BLOB,\n    tif:      Resource.XHR_RESPONSE_TYPE.BLOB,\n    tiff:     Resource.XHR_RESPONSE_TYPE.BLOB,\n    webp:     Resource.XHR_RESPONSE_TYPE.BLOB,\n    tga:      Resource.XHR_RESPONSE_TYPE.BLOB,\n\n    // json\n    json:     Resource.XHR_RESPONSE_TYPE.JSON,\n\n    // text\n    text:     Resource.XHR_RESPONSE_TYPE.TEXT,\n    txt:      Resource.XHR_RESPONSE_TYPE.TEXT\n};\n\n/**\n * Sets the load type to be used for a specific extension.\n *\n * @static\n * @param {string} extname - The extension to set the type for, e.g. \"png\" or \"fnt\"\n * @param {Resource.LOAD_TYPE} loadType - The load type to set it to.\n */\nResource.setExtensionLoadType = function (extname, loadType) {\n    setExtMap(Resource._loadTypeMap, extname, loadType);\n};\n\n/**\n * Sets the load type to be used for a specific extension.\n *\n * @static\n * @param {string} extname - The extension to set the type for, e.g. \"png\" or \"fnt\"\n * @param {Resource.XHR_RESPONSE_TYPE} xhrType - The xhr type to set it to.\n */\nResource.setExtensionXhrType = function (extname, xhrType) {\n    setExtMap(Resource._xhrTypeMap, extname, xhrType);\n};\n\nfunction setExtMap(map, extname, val) {\n    if (extname && extname.indexOf('.') === 0) {\n        extname = extname.substring(1);\n    }\n\n    if (!extname) {\n        return;\n    }\n\n    map[extname] = val;\n}\n","'use strict';\n\n/**\n * Smaller version of the async library constructs.\n *\n */\n\nmodule.exports = {\n    eachSeries: asyncEachSeries,\n    queue: asyncQueue\n};\n\nfunction _noop() { /* empty */ }\n\n/**\n * Iterates an array in series.\n *\n * @param {*[]} array - Array to iterate.\n * @param {function} iterator - Function to call for each element.\n * @param {function} callback - Function to call when done, or on error.\n */\nfunction asyncEachSeries(array, iterator, callback) {\n    var i = 0;\n    var len = array.length;\n\n    (function next(err) {\n        if (err || i === len) {\n            if (callback) {\n                callback(err);\n            }\n\n            return;\n        }\n\n        iterator(array[i++], next);\n    })();\n}\n\n/**\n * Ensures a function is only called once.\n *\n * @param {function} fn - The function to wrap.\n * @return {function} The wrapping function.\n */\nfunction onlyOnce(fn) {\n    return function onceWrapper() {\n        if (fn === null) {\n            throw new Error('Callback was already called.');\n        }\n\n        var callFn = fn;\n\n        fn = null;\n        callFn.apply(this, arguments);\n    };\n}\n\n/**\n * Async queue implementation,\n *\n * @param {function} worker - The worker function to call for each task.\n * @param {number} concurrency - How many workers to run in parrallel.\n * @return {*} The async queue object.\n */\nfunction asyncQueue(worker, concurrency) {\n    if (concurrency == null) { // eslint-disable-line no-eq-null,eqeqeq\n        concurrency = 1;\n    }\n    else if (concurrency === 0) {\n        throw new Error('Concurrency must not be zero');\n    }\n\n    var workers = 0;\n    var q = {\n        _tasks: [],\n        concurrency: concurrency,\n        saturated: _noop,\n        unsaturated: _noop,\n        buffer: concurrency / 4,\n        empty: _noop,\n        drain: _noop,\n        error: _noop,\n        started: false,\n        paused: false,\n        push: function (data, callback) {\n            _insert(data, false, callback);\n        },\n        kill: function () {\n            q.drain = _noop;\n            q._tasks = [];\n        },\n        unshift: function (data, callback) {\n            _insert(data, true, callback);\n        },\n        process: function () {\n            while (!q.paused && workers < q.concurrency && q._tasks.length) {\n                var task = q._tasks.shift();\n\n                if (q._tasks.length === 0) {\n                    q.empty();\n                }\n\n                workers += 1;\n\n                if (workers === q.concurrency) {\n                    q.saturated();\n                }\n\n                worker(task.data, onlyOnce(_next(task)));\n            }\n        },\n        length: function () {\n            return q._tasks.length;\n        },\n        running: function () {\n            return workers;\n        },\n        idle: function () {\n            return q._tasks.length + workers === 0;\n        },\n        pause: function () {\n            if (q.paused === true) {\n                return;\n            }\n\n            q.paused = true;\n        },\n        resume: function () {\n            if (q.paused === false) {\n                return;\n            }\n\n            q.paused = false;\n\n            // Need to call q.process once per concurrent\n            // worker to preserve full concurrency after pause\n            for (var w = 1; w <= q.concurrency; w++) {\n                q.process();\n            }\n        }\n    };\n\n    function _insert(data, insertAtFront, callback) {\n        if (callback != null && typeof callback !== 'function') { // eslint-disable-line no-eq-null,eqeqeq\n            throw new Error('task callback must be a function');\n        }\n\n        q.started = true;\n\n        if (data == null && q.idle()) { // eslint-disable-line no-eq-null,eqeqeq\n            // call drain immediately if there are no tasks\n            setTimeout(function () {\n                q.drain();\n            }, 1);\n\n            return;\n        }\n\n        var item = {\n            data: data,\n            callback: typeof callback === 'function' ? callback : _noop\n        };\n\n        if (insertAtFront) {\n            q._tasks.unshift(item);\n        }\n        else {\n            q._tasks.push(item);\n        }\n\n        setTimeout(function () {\n            q.process();\n        }, 1);\n    }\n\n    function _next(task) {\n        return function () {\n            workers -= 1;\n\n            task.callback.apply(task, arguments);\n\n            if (arguments[0] != null) { // eslint-disable-line no-eq-null,eqeqeq\n                q.error(arguments[0], task.data);\n            }\n\n            if (workers <= (q.concurrency - q.buffer)) {\n                q.unsaturated();\n            }\n\n            if (q.idle()) {\n                q.drain();\n            }\n\n            q.process();\n        };\n    }\n\n    return q;\n}\n","/* eslint no-magic-numbers: 0 */\n'use strict';\n\nmodule.exports = {\n    // private property\n    _keyStr: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n\n    encodeBinary: function (input) {\n        var output = '';\n        var bytebuffer;\n        var encodedCharIndexes = new Array(4);\n        var inx = 0;\n        var jnx = 0;\n        var paddingBytes = 0;\n\n        while (inx < input.length) {\n            // Fill byte buffer array\n            bytebuffer = new Array(3);\n\n            for (jnx = 0; jnx < bytebuffer.length; jnx++) {\n                if (inx < input.length) {\n                    // throw away high-order byte, as documented at:\n                    // https://developer.mozilla.org/En/Using_XMLHttpRequest#Handling_binary_data\n                    bytebuffer[jnx] = input.charCodeAt(inx++) & 0xff;\n                }\n                else {\n                    bytebuffer[jnx] = 0;\n                }\n            }\n\n            // Get each encoded character, 6 bits at a time\n            // index 1: first 6 bits\n            encodedCharIndexes[0] = bytebuffer[0] >> 2;\n            // index 2: second 6 bits (2 least significant bits from input byte 1 + 4 most significant bits from byte 2)\n            encodedCharIndexes[1] = ((bytebuffer[0] & 0x3) << 4) | (bytebuffer[1] >> 4);\n            // index 3: third 6 bits (4 least significant bits from input byte 2 + 2 most significant bits from byte 3)\n            encodedCharIndexes[2] = ((bytebuffer[1] & 0x0f) << 2) | (bytebuffer[2] >> 6);\n            // index 3: forth 6 bits (6 least significant bits from input byte 3)\n            encodedCharIndexes[3] = bytebuffer[2] & 0x3f;\n\n            // Determine whether padding happened, and adjust accordingly\n            paddingBytes = inx - (input.length - 1);\n            switch (paddingBytes) {\n                case 2:\n                    // Set last 2 characters to padding char\n                    encodedCharIndexes[3] = 64;\n                    encodedCharIndexes[2] = 64;\n                    break;\n\n                case 1:\n                    // Set last character to padding char\n                    encodedCharIndexes[3] = 64;\n                    break;\n\n                default:\n                    break; // No padding - proceed\n            }\n\n            // Now we will grab each appropriate character out of our keystring\n            // based on our index array and append it to the output string\n            for (jnx = 0; jnx < encodedCharIndexes.length; jnx++) {\n                output += this._keyStr.charAt(encodedCharIndexes[jnx]);\n            }\n        }\n\n        return output;\n    }\n};\n","/* eslint global-require: 0 */\n'use strict';\n\nmodule.exports = require('./Loader');\nmodule.exports.Resource = require('./Resource');\nmodule.exports.middleware = {\n    caching: {\n        memory: require('./middlewares/caching/memory')\n    },\n    parsing: {\n        blob: require('./middlewares/parsing/blob')\n    }\n};\n\nmodule.exports.async = require('./async');\n","'use strict';\n\n// a simple in-memory cache for resources\nvar cache = {};\n\nmodule.exports = function () {\n    return function (resource, next) {\n        // if cached, then set data and complete the resource\n        if (cache[resource.url]) {\n            resource.data = cache[resource.url];\n            resource.complete(); // marks resource load complete and stops processing before middlewares\n        }\n        // if not cached, wait for complete and store it in the cache.\n        else {\n            resource.once('complete', function () {\n                cache[this.url] = this.data;\n            });\n        }\n\n        next();\n    };\n};\n","'use strict';\n\nvar Resource = require('../../Resource');\nvar b64 = require('../../b64');\n\nvar Url = window.URL || window.webkitURL;\n\n// a middleware for transforming XHR loaded Blobs into more useful objects\n\nmodule.exports = function () {\n    return function (resource, next) {\n        if (!resource.data) {\n            next();\n\n            return;\n        }\n\n        // if this was an XHR load of a blob\n        if (resource.xhr && resource.xhrType === Resource.XHR_RESPONSE_TYPE.BLOB) {\n            // if there is no blob support we probably got a binary string back\n            if (!window.Blob || typeof resource.data === 'string') {\n                var type = resource.xhr.getResponseHeader('content-type');\n\n                // this is an image, convert the binary string into a data url\n                if (type && type.indexOf('image') === 0) {\n                    resource.data = new Image();\n                    resource.data.src = 'data:' + type + ';base64,' + b64.encodeBinary(resource.xhr.responseText);\n\n                    resource.isImage = true;\n\n                    // wait until the image loads and then callback\n                    resource.data.onload = function () {\n                        resource.data.onload = null;\n\n                        next();\n                    };\n\n                    // next will be called on load\n                    return;\n                }\n            }\n            // if content type says this is an image, then we should transform the blob into an Image object\n            else if (resource.data.type.indexOf('image') === 0) {\n                var src = Url.createObjectURL(resource.data);\n\n                resource.blob = resource.data;\n                resource.data = new Image();\n                resource.data.src = src;\n\n                resource.isImage = true;\n\n                // cleanup the no longer used blob after the image loads\n                resource.data.onload = function () {\n                    Url.revokeObjectURL(src);\n                    resource.data.onload = null;\n\n                    next();\n                };\n\n                // next will be called on load.\n                return;\n            }\n        }\n\n        next();\n    };\n};\n","import * as core from '../core';\nimport Device from 'ismobilejs';\nimport accessibleTarget from './accessibleTarget';\n\n// add some extra variables to the container..\nObject.assign(\n    core.DisplayObject.prototype,\n    accessibleTarget\n);\n\nconst KEY_CODE_TAB = 9;\n\nconst DIV_TOUCH_SIZE = 100;\nconst DIV_TOUCH_POS_X = 0;\nconst DIV_TOUCH_POS_Y = 0;\nconst DIV_TOUCH_ZINDEX = 2;\n\nconst DIV_HOOK_SIZE = 1;\nconst DIV_HOOK_POS_X = -1000;\nconst DIV_HOOK_POS_Y = -1000;\nconst DIV_HOOK_ZINDEX = 2;\n\n/**\n * The Accessibility manager reacreates the ability to tab and and have content read by screen\n * readers. This is very important as it can possibly help people with disabilities access pixi\n * content.\n *\n * Much like interaction any DisplayObject can be made accessible. This manager will map the\n * events as if the mouse was being used, minimizing the efferot required to implement.\n *\n * @class\n * @memberof PIXI\n */\nexport default class AccessibilityManager\n{\n    /**\n     * @param {PIXI.CanvasRenderer|PIXI.WebGLRenderer} renderer - A reference to the current renderer\n     */\n    constructor(renderer)\n    {\n        if ((Device.tablet || Device.phone) && !navigator.isCocoonJS)\n        {\n            this.createTouchHook();\n        }\n\n        // first we create a div that will sit over the pixi element. This is where the div overlays will go.\n        const div = document.createElement('div');\n\n        div.style.width = `${DIV_TOUCH_SIZE}px`;\n        div.style.height = `${DIV_TOUCH_SIZE}px`;\n        div.style.position = 'absolute';\n        div.style.top = `${DIV_TOUCH_POS_X}px`;\n        div.style.left = `${DIV_TOUCH_POS_Y}px`;\n        div.style.zIndex = DIV_TOUCH_ZINDEX;\n\n        /**\n         * This is the dom element that will sit over the pixi element. This is where the div overlays will go.\n         *\n         * @type {HTMLElement}\n         * @private\n         */\n        this.div = div;\n\n        /**\n         * A simple pool for storing divs.\n         *\n         * @type {*}\n         * @private\n         */\n        this.pool = [];\n\n        /**\n         * This is a tick used to check if an object is no longer being rendered.\n         *\n         * @type {Number}\n         * @private\n         */\n        this.renderId = 0;\n\n        /**\n         * Setting this to true will visually show the divs\n         *\n         * @type {boolean}\n         */\n        this.debug = false;\n\n        /**\n         * The renderer this accessibility manager works for.\n         *\n         * @member {PIXI.SystemRenderer}\n         */\n        this.renderer = renderer;\n\n        /**\n         * The array of currently active accessible items.\n         *\n         * @member {Array<*>}\n         * @private\n         */\n        this.children = [];\n\n        /**\n         * pre-bind the functions\n         *\n         * @private\n         */\n        this._onKeyDown = this._onKeyDown.bind(this);\n        this._onMouseMove = this._onMouseMove.bind(this);\n\n        /**\n         * stores the state of the manager. If there are no accessible objects or the mouse is moving the will be false.\n         *\n         * @member {Array<*>}\n         * @private\n         */\n        this.isActive = false;\n        this.isMobileAccessabillity = false;\n\n        // let listen for tab.. once pressed we can fire up and show the accessibility layer\n        window.addEventListener('keydown', this._onKeyDown, false);\n    }\n\n    /**\n     * Creates the touch hooks.\n     *\n     */\n    createTouchHook()\n    {\n        const hookDiv = document.createElement('button');\n\n        hookDiv.style.width = `${DIV_HOOK_SIZE}px`;\n        hookDiv.style.height = `${DIV_HOOK_SIZE}px`;\n        hookDiv.style.position = 'absolute';\n        hookDiv.style.top = `${DIV_HOOK_POS_X}px`;\n        hookDiv.style.left = `${DIV_HOOK_POS_Y}px`;\n        hookDiv.style.zIndex = DIV_HOOK_ZINDEX;\n        hookDiv.style.backgroundColor = '#FF0000';\n        hookDiv.title = 'HOOK DIV';\n\n        hookDiv.addEventListener('focus', () =>\n        {\n            this.isMobileAccessabillity = true;\n            this.activate();\n            document.body.removeChild(hookDiv);\n        });\n\n        document.body.appendChild(hookDiv);\n    }\n\n    /**\n     * Activating will cause the Accessibility layer to be shown. This is called when a user\n     * preses the tab key\n     *\n     * @private\n     */\n    activate()\n    {\n        if (this.isActive)\n        {\n            return;\n        }\n\n        this.isActive = true;\n\n        window.document.addEventListener('mousemove', this._onMouseMove, true);\n        window.removeEventListener('keydown', this._onKeyDown, false);\n\n        this.renderer.on('postrender', this.update, this);\n\n        if (this.renderer.view.parentNode)\n        {\n            this.renderer.view.parentNode.appendChild(this.div);\n        }\n    }\n\n    /**\n     * Deactivating will cause the Accessibility layer to be hidden. This is called when a user moves\n     * the mouse\n     *\n     * @private\n     */\n    deactivate()\n    {\n        if (!this.isActive || this.isMobileAccessabillity)\n        {\n            return;\n        }\n\n        this.isActive = false;\n\n        window.document.removeEventListener('mousemove', this._onMouseMove);\n        window.addEventListener('keydown', this._onKeyDown, false);\n\n        this.renderer.off('postrender', this.update);\n\n        if (this.div.parentNode)\n        {\n            this.div.parentNode.removeChild(this.div);\n        }\n    }\n\n    /**\n     * This recursive function will run throught he scene graph and add any new accessible objects to the DOM layer.\n     *\n     * @private\n     * @param {PIXI.Container} displayObject - The DisplayObject to check.\n     */\n    updateAccessibleObjects(displayObject)\n    {\n        if (!displayObject.visible)\n        {\n            return;\n        }\n\n        if (displayObject.accessible && displayObject.interactive)\n        {\n            if (!displayObject._accessibleActive)\n            {\n                this.addChild(displayObject);\n            }\n\n            displayObject.renderId = this.renderId;\n        }\n\n        const children = displayObject.children;\n\n        for (let i = children.length - 1; i >= 0; i--)\n        {\n            this.updateAccessibleObjects(children[i]);\n        }\n    }\n\n    /**\n     * Before each render this function will ensure that all divs are mapped correctly to their DisplayObjects.\n     *\n     * @private\n     */\n    update()\n    {\n        if (!this.renderer.renderingToScreen)\n        {\n            return;\n        }\n\n        // update children...\n        this.updateAccessibleObjects(this.renderer._lastObjectRendered);\n\n        const rect = this.renderer.view.getBoundingClientRect();\n        const sx = rect.width / this.renderer.width;\n        const sy = rect.height / this.renderer.height;\n\n        let div = this.div;\n\n        div.style.left = `${rect.left}px`;\n        div.style.top = `${rect.top}px`;\n        div.style.width = `${this.renderer.width}px`;\n        div.style.height = `${this.renderer.height}px`;\n\n        for (let i = 0; i < this.children.length; i++)\n        {\n            const child = this.children[i];\n\n            if (child.renderId !== this.renderId)\n            {\n                child._accessibleActive = false;\n\n                core.utils.removeItems(this.children, i, 1);\n                this.div.removeChild(child._accessibleDiv);\n                this.pool.push(child._accessibleDiv);\n                child._accessibleDiv = null;\n\n                i--;\n\n                if (this.children.length === 0)\n                {\n                    this.deactivate();\n                }\n            }\n            else\n            {\n                // map div to display..\n                div = child._accessibleDiv;\n                let hitArea = child.hitArea;\n                const wt = child.worldTransform;\n\n                if (child.hitArea)\n                {\n                    div.style.left = `${(wt.tx + (hitArea.x * wt.a)) * sx}px`;\n                    div.style.top = `${(wt.ty + (hitArea.y * wt.d)) * sy}px`;\n\n                    div.style.width = `${hitArea.width * wt.a * sx}px`;\n                    div.style.height = `${hitArea.height * wt.d * sy}px`;\n                }\n                else\n                {\n                    hitArea = child.getBounds();\n\n                    this.capHitArea(hitArea);\n\n                    div.style.left = `${hitArea.x * sx}px`;\n                    div.style.top = `${hitArea.y * sy}px`;\n\n                    div.style.width = `${hitArea.width * sx}px`;\n                    div.style.height = `${hitArea.height * sy}px`;\n                }\n            }\n        }\n\n        // increment the render id..\n        this.renderId++;\n    }\n\n    /**\n     * TODO: docs.\n     *\n     * @param {Rectangle} hitArea - TODO docs\n     */\n    capHitArea(hitArea)\n    {\n        if (hitArea.x < 0)\n        {\n            hitArea.width += hitArea.x;\n            hitArea.x = 0;\n        }\n\n        if (hitArea.y < 0)\n        {\n            hitArea.height += hitArea.y;\n            hitArea.y = 0;\n        }\n\n        if (hitArea.x + hitArea.width > this.renderer.width)\n        {\n            hitArea.width = this.renderer.width - hitArea.x;\n        }\n\n        if (hitArea.y + hitArea.height > this.renderer.height)\n        {\n            hitArea.height = this.renderer.height - hitArea.y;\n        }\n    }\n\n    /**\n     * Adds a DisplayObject to the accessibility manager\n     *\n     * @private\n     * @param {DisplayObject} displayObject - The child to make accessible.\n     */\n    addChild(displayObject)\n    {\n        //    this.activate();\n\n        let div = this.pool.pop();\n\n        if (!div)\n        {\n            div = document.createElement('button');\n\n            div.style.width = `${DIV_TOUCH_SIZE}px`;\n            div.style.height = `${DIV_TOUCH_SIZE}px`;\n            div.style.backgroundColor = this.debug ? 'rgba(255,0,0,0.5)' : 'transparent';\n            div.style.position = 'absolute';\n            div.style.zIndex = DIV_TOUCH_ZINDEX;\n            div.style.borderStyle = 'none';\n\n            div.addEventListener('click', this._onClick.bind(this));\n            div.addEventListener('focus', this._onFocus.bind(this));\n            div.addEventListener('focusout', this._onFocusOut.bind(this));\n        }\n\n        if (displayObject.accessibleTitle)\n        {\n            div.title = displayObject.accessibleTitle;\n        }\n        else if (!displayObject.accessibleTitle && !displayObject.accessibleHint)\n        {\n            div.title = `displayObject ${this.tabIndex}`;\n        }\n\n        if (displayObject.accessibleHint)\n        {\n            div.setAttribute('aria-label', displayObject.accessibleHint);\n        }\n\n        //\n\n        displayObject._accessibleActive = true;\n        displayObject._accessibleDiv = div;\n        div.displayObject = displayObject;\n\n        this.children.push(displayObject);\n        this.div.appendChild(displayObject._accessibleDiv);\n        displayObject._accessibleDiv.tabIndex = displayObject.tabIndex;\n    }\n\n    /**\n     * Maps the div button press to pixi's InteractionManager (click)\n     *\n     * @private\n     * @param {MouseEvent} e - The click event.\n     */\n    _onClick(e)\n    {\n        const interactionManager = this.renderer.plugins.interaction;\n\n        interactionManager.dispatchEvent(e.target.displayObject, 'click', interactionManager.eventData);\n    }\n\n    /**\n     * Maps the div focus events to pixis InteractionManager (mouseover)\n     *\n     * @private\n     * @param {FocusEvent} e - The focus event.\n     */\n    _onFocus(e)\n    {\n        const interactionManager = this.renderer.plugins.interaction;\n\n        interactionManager.dispatchEvent(e.target.displayObject, 'mouseover', interactionManager.eventData);\n    }\n\n    /**\n     * Maps the div focus events to pixis InteractionManager (mouseout)\n     *\n     * @private\n     * @param {FocusEvent} e - The focusout event.\n     */\n    _onFocusOut(e)\n    {\n        const interactionManager = this.renderer.plugins.interaction;\n\n        interactionManager.dispatchEvent(e.target.displayObject, 'mouseout', interactionManager.eventData);\n    }\n\n    /**\n     * Is called when a key is pressed\n     *\n     * @private\n     * @param {KeyboardEvent} e - The keydown event.\n     */\n    _onKeyDown(e)\n    {\n        if (e.keyCode !== KEY_CODE_TAB)\n        {\n            return;\n        }\n\n        this.activate();\n    }\n\n    /**\n     * Is called when the mouse moves across the renderer element\n     *\n     * @private\n     */\n    _onMouseMove()\n    {\n        this.deactivate();\n    }\n\n    /**\n     * Destroys the accessibility manager\n     *\n     */\n    destroy()\n    {\n        this.div = null;\n\n        for (let i = 0; i < this.children.length; i++)\n        {\n            this.children[i].div = null;\n        }\n\n        window.document.removeEventListener('mousemove', this._onMouseMove);\n        window.removeEventListener('keydown', this._onKeyDown);\n\n        this.pool = null;\n        this.children = null;\n        this.renderer = null;\n    }\n}\n\ncore.WebGLRenderer.registerPlugin('accessibility', AccessibilityManager);\ncore.CanvasRenderer.registerPlugin('accessibility', AccessibilityManager);\n","/**\n * Default property values of accessible objects\n * used by {@link PIXI.accessibility.AccessibilityManager}.\n *\n * @mixin\n * @name accessibleTarget\n * @memberof PIXI\n * @example\n *      function MyObject() {}\n *\n *      Object.assign(\n *          MyObject.prototype,\n *          PIXI.accessibility.accessibleTarget\n *      );\n */\nexport default {\n    /**\n     *  Flag for if the object is accessible. If true AccessibilityManager will overlay a\n     *   shadow div with attributes set\n     *\n     * @member {boolean}\n     */\n    accessible: false,\n\n    /**\n     * Sets the title attribute of the shadow div\n     * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'\n     *\n     * @member {string}\n     */\n    accessibleTitle: null,\n\n    /**\n     * Sets the aria-label attribute of the shadow div\n     *\n     * @member {string}\n     */\n    accessibleHint: null,\n\n    /**\n     * @todo Needs docs.\n     */\n    tabIndex: 0,\n\n    /**\n     * @todo Needs docs.\n     */\n    _accessibleActive: false,\n\n    /**\n     * @todo Needs docs.\n     */\n    _accessibleDiv: false,\n};\n","/**\n * @namespace PIXI.AccessibilityManager\n */\nexport { default as accessibleTarget } from './accessibleTarget';\nexport { default as AccessibilityManager } from './AccessibilityManager';\n","import { GLShader } from 'pixi-gl-core';\nimport settings from './settings';\n\nconst { PRECISION } = settings;\n\nfunction checkPrecision(src)\n{\n    if (src instanceof Array)\n    {\n        if (src[0].substring(0, 9) !== 'precision')\n        {\n            const copy = src.slice(0);\n\n            copy.unshift(`precision ${PRECISION} float;`);\n\n            return copy;\n        }\n    }\n    else if (src.substring(0, 9) !== 'precision')\n    {\n        return `precision ${PRECISION} float;\\n${src}`;\n    }\n\n    return src;\n}\n\n/**\n * Wrapper class, webGL Shader for Pixi.\n * Adds precision string if vertexSrc or fragmentSrc have no mention of it.\n *\n * @class\n * @extends GLShader\n * @memberof PIXI\n */\nexport default class Shader extends GLShader\n{\n    /**\n     *\n     * @param {WebGLRenderingContext} gl - The current WebGL rendering context\n     * @param {string|string[]} vertexSrc - The vertex shader source as an array of strings.\n     * @param {string|string[]} fragmentSrc - The fragment shader source as an array of strings.\n     */\n    constructor(gl, vertexSrc, fragmentSrc)\n    {\n        super(gl, checkPrecision(vertexSrc), checkPrecision(fragmentSrc));\n    }\n}\n","/**\n * String of the current PIXI version.\n *\n * @static\n * @constant\n * @memberof PIXI\n * @name VERSION\n * @type {string}\n */\nexport const VERSION = __VERSION__;\n\n/**\n * Two Pi.\n *\n * @static\n * @constant\n * @memberof PIXI\n * @type {number}\n */\nexport const PI_2 = Math.PI * 2;\n\n/**\n * Conversion factor for converting radians to degrees.\n *\n * @static\n * @constant\n * @memberof PIXI\n * @type {number}\n */\nexport const RAD_TO_DEG = 180 / Math.PI;\n\n/**\n * Conversion factor for converting degrees to radians.\n *\n * @static\n * @constant\n * @memberof PIXI\n * @type {number}\n */\nexport const DEG_TO_RAD = Math.PI / 180;\n\n/**\n * Constant to identify the Renderer Type.\n *\n * @static\n * @constant\n * @memberof PIXI\n * @name RENDERER_TYPE\n * @type {object}\n * @property {number} UNKNOWN - Unknown render type.\n * @property {number} WEBGL - WebGL render type.\n * @property {number} CANVAS - Canvas render type.\n */\nexport const RENDERER_TYPE = {\n    UNKNOWN:    0,\n    WEBGL:      1,\n    CANVAS:     2,\n};\n\n/**\n * Various blend modes supported by PIXI.\n *\n * IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes.\n * Anything else will silently act like NORMAL.\n *\n * @static\n * @constant\n * @memberof PIXI\n * @name BLEND_MODES\n * @type {object}\n * @property {number} NORMAL\n * @property {number} ADD\n * @property {number} MULTIPLY\n * @property {number} SCREEN\n * @property {number} OVERLAY\n * @property {number} DARKEN\n * @property {number} LIGHTEN\n * @property {number} COLOR_DODGE\n * @property {number} COLOR_BURN\n * @property {number} HARD_LIGHT\n * @property {number} SOFT_LIGHT\n * @property {number} DIFFERENCE\n * @property {number} EXCLUSION\n * @property {number} HUE\n * @property {number} SATURATION\n * @property {number} COLOR\n * @property {number} LUMINOSITY\n */\nexport const BLEND_MODES = {\n    NORMAL:         0,\n    ADD:            1,\n    MULTIPLY:       2,\n    SCREEN:         3,\n    OVERLAY:        4,\n    DARKEN:         5,\n    LIGHTEN:        6,\n    COLOR_DODGE:    7,\n    COLOR_BURN:     8,\n    HARD_LIGHT:     9,\n    SOFT_LIGHT:     10,\n    DIFFERENCE:     11,\n    EXCLUSION:      12,\n    HUE:            13,\n    SATURATION:     14,\n    COLOR:          15,\n    LUMINOSITY:     16,\n};\n\n/**\n * Various webgl draw modes. These can be used to specify which GL drawMode to use\n * under certain situations and renderers.\n *\n * @static\n * @constant\n * @memberof PIXI\n * @name DRAW_MODES\n * @type {object}\n * @property {number} POINTS\n * @property {number} LINES\n * @property {number} LINE_LOOP\n * @property {number} LINE_STRIP\n * @property {number} TRIANGLES\n * @property {number} TRIANGLE_STRIP\n * @property {number} TRIANGLE_FAN\n */\nexport const DRAW_MODES = {\n    POINTS:         0,\n    LINES:          1,\n    LINE_LOOP:      2,\n    LINE_STRIP:     3,\n    TRIANGLES:      4,\n    TRIANGLE_STRIP: 5,\n    TRIANGLE_FAN:   6,\n};\n\n/**\n * The scale modes that are supported by pixi.\n *\n * The {@link PIXI.settings.SCALE_MODE} scale mode affects the default scaling mode of future operations.\n * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability.\n *\n * @static\n * @constant\n * @memberof PIXI\n * @name SCALE_MODES\n * @type {object}\n * @property {number} LINEAR Smooth scaling\n * @property {number} NEAREST Pixelating scaling\n */\nexport const SCALE_MODES = {\n    LINEAR:     0,\n    NEAREST:    1,\n};\n\n/**\n * The wrap modes that are supported by pixi.\n *\n * The {@link PIXI.settings.WRAP_MODE} wrap mode affects the default wraping mode of future operations.\n * It can be re-assigned to either CLAMP or REPEAT, depending upon suitability.\n * If the texture is non power of two then clamp will be used regardless as webGL can\n * only use REPEAT if the texture is po2.\n *\n * This property only affects WebGL.\n *\n * @static\n * @constant\n * @name WRAP_MODES\n * @memberof PIXI\n * @type {object}\n * @property {number} CLAMP - The textures uvs are clamped\n * @property {number} REPEAT - The texture uvs tile and repeat\n * @property {number} MIRRORED_REPEAT - The texture uvs tile and repeat with mirroring\n */\nexport const WRAP_MODES = {\n    CLAMP:          0,\n    REPEAT:         1,\n    MIRRORED_REPEAT: 2,\n};\n\n/**\n * The gc modes that are supported by pixi.\n *\n * The {@link PIXI.settings.GC_MODE} Garbage Collection mode for pixi textures is AUTO\n * If set to GC_MODE, the renderer will occasianally check textures usage. If they are not\n * used for a specified period of time they will be removed from the GPU. They will of course\n * be uploaded again when they are required. This is a silent behind the scenes process that\n * should ensure that the GPU does not  get filled up.\n *\n * Handy for mobile devices!\n * This property only affects WebGL.\n *\n * @static\n * @constant\n * @name GC_MODES\n * @memberof PIXI\n * @type {object}\n * @property {number} AUTO - Garbage collection will happen periodically automatically\n * @property {number} MANUAL - Garbage collection will need to be called manually\n */\nexport const GC_MODES = {\n    AUTO:           0,\n    MANUAL:         1,\n};\n\n/**\n * Regexp for image type by extension.\n *\n * @static\n * @constant\n * @memberof PIXI\n * @type {RegExp|string}\n * @example `image.png`\n */\nexport const URL_FILE_EXTENSION = /\\.(\\w{3,4})(?:$|\\?|#)/i;\n\n/**\n * Regexp for data URI.\n * Based on: {@link https://github.com/ragingwind/data-uri-regex}\n *\n * @static\n * @constant\n * @name DATA_URI\n * @memberof PIXI\n * @type {RegExp|string}\n * @example data:image/png;base64\n */\nexport const DATA_URI = /^\\s*data:(?:([\\w-]+)\\/([\\w+.-]+))?(?:;(charset=[\\w-]+|base64))?,(.*)/i;\n\n/**\n * Regexp for SVG size.\n *\n * @static\n * @constant\n * @name SVG_SIZE\n * @memberof PIXI\n * @type {RegExp|string}\n * @example <svg width=\"100\" height=\"100\"></svg>\n */\nexport const SVG_SIZE = /]*(?:\\s(width|height)=('|\")(\\d*(?:\\.\\d+)?)(?:px)?('|\"))[^>]*(?:\\s(width|height)=('|\")(\\d*(?:\\.\\d+)?)(?:px)?('|\"))[^>]*>/i; // eslint-disable-line max-len\n\n/**\n * Constants that identify shapes, mainly to prevent `instanceof` calls.\n *\n * @static\n * @constant\n * @name SHAPES\n * @memberof PIXI\n * @type {object}\n * @property {number} POLY Polygon\n * @property {number} RECT Rectangle\n * @property {number} CIRC Circle\n * @property {number} ELIP Ellipse\n * @property {number} RREC Rounded Rectangle\n */\nexport const SHAPES = {\n    POLY: 0,\n    RECT: 1,\n    CIRC: 2,\n    ELIP: 3,\n    RREC: 4,\n};\n\n/**\n * Constants that specify float precision in shaders.\n *\n * @static\n * @constant\n * @name PRECISION\n * @memberof PIXI\n * @type {object}\n * @property {string} LOW='lowp'\n * @property {string} MEDIUM='mediump'\n * @property {string} HIGH='highp'\n */\nexport const PRECISION = {\n    LOW: 'lowp',\n    MEDIUM: 'mediump',\n    HIGH: 'highp',\n};\n\n/**\n * Constants that specify the transform type.\n *\n * @static\n * @constant\n * @name TRANSFORM_MODE\n * @memberof PIXI\n * @type {object}\n * @property {number} STATIC\n * @property {number} DYNAMIC\n */\nexport const TRANSFORM_MODE = {\n    STATIC:     0,\n    DYNAMIC:    1,\n};\n\n/**\n * Constants that define the type of gradient on text.\n *\n * @static\n * @constant\n * @name TEXT_GRADIENT\n * @memberof PIXI\n * @type {object}\n * @property {number} LINEAR_VERTICAL Vertical gradient\n * @property {number} LINEAR_HORIZONTAL Linear gradient\n */\nexport const TEXT_GRADIENT = {\n    LINEAR_VERTICAL: 0,\n    LINEAR_HORIZONTAL: 1,\n};\n","import { Rectangle } from '../math';\n\n/**\n * 'Builder' pattern for bounds rectangles\n * Axis-Aligned Bounding Box\n * It is not a shape! Its mutable thing, no 'EMPTY' or that kind of problems\n *\n * @class\n * @memberof PIXI\n */\nexport default class Bounds\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.minX = Infinity;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.minY = Infinity;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.maxX = -Infinity;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.maxY = -Infinity;\n\n        this.rect = null;\n    }\n\n    /**\n     * Checks if bounds are empty.\n     *\n     * @return {boolean} True if empty.\n     */\n    isEmpty()\n    {\n        return this.minX > this.maxX || this.minY > this.maxY;\n    }\n\n    /**\n     * Clears the bounds and resets.\n     *\n     */\n    clear()\n    {\n        this.updateID++;\n\n        this.minX = Infinity;\n        this.minY = Infinity;\n        this.maxX = -Infinity;\n        this.maxY = -Infinity;\n    }\n\n    /**\n     * Can return Rectangle.EMPTY constant, either construct new rectangle, either use your rectangle\n     * It is not guaranteed that it will return tempRect\n     *\n     * @param {PIXI.Rectangle} rect - temporary object will be used if AABB is not empty\n     * @returns {PIXI.Rectangle} A rectangle of the bounds\n     */\n    getRectangle(rect)\n    {\n        if (this.minX > this.maxX || this.minY > this.maxY)\n        {\n            return Rectangle.EMPTY;\n        }\n\n        rect = rect || new Rectangle(0, 0, 1, 1);\n\n        rect.x = this.minX;\n        rect.y = this.minY;\n        rect.width = this.maxX - this.minX;\n        rect.height = this.maxY - this.minY;\n\n        return rect;\n    }\n\n    /**\n     * This function should be inlined when its possible.\n     *\n     * @param {PIXI.Point} point - The point to add.\n     */\n    addPoint(point)\n    {\n        this.minX = Math.min(this.minX, point.x);\n        this.maxX = Math.max(this.maxX, point.x);\n        this.minY = Math.min(this.minY, point.y);\n        this.maxY = Math.max(this.maxY, point.y);\n    }\n\n    /**\n     * Adds a quad, not transformed\n     *\n     * @param {Float32Array} vertices - The verts to add.\n     */\n    addQuad(vertices)\n    {\n        let minX = this.minX;\n        let minY = this.minY;\n        let maxX = this.maxX;\n        let maxY = this.maxY;\n\n        let x = vertices[0];\n        let y = vertices[1];\n\n        minX = x < minX ? x : minX;\n        minY = y < minY ? y : minY;\n        maxX = x > maxX ? x : maxX;\n        maxY = y > maxY ? y : maxY;\n\n        x = vertices[2];\n        y = vertices[3];\n        minX = x < minX ? x : minX;\n        minY = y < minY ? y : minY;\n        maxX = x > maxX ? x : maxX;\n        maxY = y > maxY ? y : maxY;\n\n        x = vertices[4];\n        y = vertices[5];\n        minX = x < minX ? x : minX;\n        minY = y < minY ? y : minY;\n        maxX = x > maxX ? x : maxX;\n        maxY = y > maxY ? y : maxY;\n\n        x = vertices[6];\n        y = vertices[7];\n        minX = x < minX ? x : minX;\n        minY = y < minY ? y : minY;\n        maxX = x > maxX ? x : maxX;\n        maxY = y > maxY ? y : maxY;\n\n        this.minX = minX;\n        this.minY = minY;\n        this.maxX = maxX;\n        this.maxY = maxY;\n    }\n\n    /**\n     * Adds sprite frame, transformed.\n     *\n     * @param {PIXI.TransformBase} transform - TODO\n     * @param {number} x0 - TODO\n     * @param {number} y0 - TODO\n     * @param {number} x1 - TODO\n     * @param {number} y1 - TODO\n     */\n    addFrame(transform, x0, y0, x1, y1)\n    {\n        const matrix = transform.worldTransform;\n        const a = matrix.a;\n        const b = matrix.b;\n        const c = matrix.c;\n        const d = matrix.d;\n        const tx = matrix.tx;\n        const ty = matrix.ty;\n\n        let minX = this.minX;\n        let minY = this.minY;\n        let maxX = this.maxX;\n        let maxY = this.maxY;\n\n        let x = (a * x0) + (c * y0) + tx;\n        let y = (b * x0) + (d * y0) + ty;\n\n        minX = x < minX ? x : minX;\n        minY = y < minY ? y : minY;\n        maxX = x > maxX ? x : maxX;\n        maxY = y > maxY ? y : maxY;\n\n        x = (a * x1) + (c * y0) + tx;\n        y = (b * x1) + (d * y0) + ty;\n        minX = x < minX ? x : minX;\n        minY = y < minY ? y : minY;\n        maxX = x > maxX ? x : maxX;\n        maxY = y > maxY ? y : maxY;\n\n        x = (a * x0) + (c * y1) + tx;\n        y = (b * x0) + (d * y1) + ty;\n        minX = x < minX ? x : minX;\n        minY = y < minY ? y : minY;\n        maxX = x > maxX ? x : maxX;\n        maxY = y > maxY ? y : maxY;\n\n        x = (a * x1) + (c * y1) + tx;\n        y = (b * x1) + (d * y1) + ty;\n        minX = x < minX ? x : minX;\n        minY = y < minY ? y : minY;\n        maxX = x > maxX ? x : maxX;\n        maxY = y > maxY ? y : maxY;\n\n        this.minX = minX;\n        this.minY = minY;\n        this.maxX = maxX;\n        this.maxY = maxY;\n    }\n\n    /**\n     * Add an array of vertices\n     *\n     * @param {PIXI.TransformBase} transform - TODO\n     * @param {Float32Array} vertices - TODO\n     * @param {number} beginOffset - TODO\n     * @param {number} endOffset - TODO\n     */\n    addVertices(transform, vertices, beginOffset, endOffset)\n    {\n        const matrix = transform.worldTransform;\n        const a = matrix.a;\n        const b = matrix.b;\n        const c = matrix.c;\n        const d = matrix.d;\n        const tx = matrix.tx;\n        const ty = matrix.ty;\n\n        let minX = this.minX;\n        let minY = this.minY;\n        let maxX = this.maxX;\n        let maxY = this.maxY;\n\n        for (let i = beginOffset; i < endOffset; i += 2)\n        {\n            const rawX = vertices[i];\n            const rawY = vertices[i + 1];\n            const x = (a * rawX) + (c * rawY) + tx;\n            const y = (d * rawY) + (b * rawX) + ty;\n\n            minX = x < minX ? x : minX;\n            minY = y < minY ? y : minY;\n            maxX = x > maxX ? x : maxX;\n            maxY = y > maxY ? y : maxY;\n        }\n\n        this.minX = minX;\n        this.minY = minY;\n        this.maxX = maxX;\n        this.maxY = maxY;\n    }\n\n    /**\n     * Adds other Bounds\n     *\n     * @param {PIXI.Bounds} bounds - TODO\n     */\n    addBounds(bounds)\n    {\n        const minX = this.minX;\n        const minY = this.minY;\n        const maxX = this.maxX;\n        const maxY = this.maxY;\n\n        this.minX = bounds.minX < minX ? bounds.minX : minX;\n        this.minY = bounds.minY < minY ? bounds.minY : minY;\n        this.maxX = bounds.maxX > maxX ? bounds.maxX : maxX;\n        this.maxY = bounds.maxY > maxY ? bounds.maxY : maxY;\n    }\n\n    /**\n     * Adds other Bounds, masked with Bounds\n     *\n     * @param {PIXI.Bounds} bounds - TODO\n     * @param {PIXI.Bounds} mask - TODO\n     */\n    addBoundsMask(bounds, mask)\n    {\n        const _minX = bounds.minX > mask.minX ? bounds.minX : mask.minX;\n        const _minY = bounds.minY > mask.minY ? bounds.minY : mask.minY;\n        const _maxX = bounds.maxX < mask.maxX ? bounds.maxX : mask.maxX;\n        const _maxY = bounds.maxY < mask.maxY ? bounds.maxY : mask.maxY;\n\n        if (_minX <= _maxX && _minY <= _maxY)\n        {\n            const minX = this.minX;\n            const minY = this.minY;\n            const maxX = this.maxX;\n            const maxY = this.maxY;\n\n            this.minX = _minX < minX ? _minX : minX;\n            this.minY = _minY < minY ? _minY : minY;\n            this.maxX = _maxX > maxX ? _maxX : maxX;\n            this.maxY = _maxY > maxY ? _maxY : maxY;\n        }\n    }\n\n    /**\n     * Adds other Bounds, masked with Rectangle\n     *\n     * @param {PIXI.Bounds} bounds - TODO\n     * @param {PIXI.Rectangle} area - TODO\n     */\n    addBoundsArea(bounds, area)\n    {\n        const _minX = bounds.minX > area.x ? bounds.minX : area.x;\n        const _minY = bounds.minY > area.y ? bounds.minY : area.y;\n        const _maxX = bounds.maxX < area.x + area.width ? bounds.maxX : (area.x + area.width);\n        const _maxY = bounds.maxY < area.y + area.height ? bounds.maxY : (area.y + area.height);\n\n        if (_minX <= _maxX && _minY <= _maxY)\n        {\n            const minX = this.minX;\n            const minY = this.minY;\n            const maxX = this.maxX;\n            const maxY = this.maxY;\n\n            this.minX = _minX < minX ? _minX : minX;\n            this.minY = _minY < minY ? _minY : minY;\n            this.maxX = _maxX > maxX ? _maxX : maxX;\n            this.maxY = _maxY > maxY ? _maxY : maxY;\n        }\n    }\n}\n","import { removeItems } from '../utils';\nimport DisplayObject from './DisplayObject';\n\n/**\n * A Container represents a collection of display objects.\n * It is the base class of all display objects that act as a container for other objects.\n *\n *```js\n * let container = new PIXI.Container();\n * container.addChild(sprite);\n * ```\n *\n * @class\n * @extends PIXI.DisplayObject\n * @memberof PIXI\n */\nexport default class Container extends DisplayObject\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        super();\n\n        /**\n         * The array of children of this container.\n         *\n         * @member {PIXI.DisplayObject[]}\n         * @readonly\n         */\n        this.children = [];\n    }\n\n    /**\n     * Overridable method that can be used by Container subclasses whenever the children array is modified\n     *\n     * @private\n     */\n    onChildrenChange()\n    {\n        /* empty */\n    }\n\n    /**\n     * Adds one or more children to the container.\n     *\n     * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`\n     *\n     * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container\n     * @return {PIXI.DisplayObject} The first child that was added.\n     */\n    addChild(child)\n    {\n        const argumentsLength = arguments.length;\n\n        // if there is only one argument we can bypass looping through the them\n        if (argumentsLength > 1)\n        {\n            // loop through the arguments property and add all children\n            // use it the right way (.length and [i]) so that this function can still be optimised by JS runtimes\n            for (let i = 0; i < argumentsLength; i++)\n            {\n                this.addChild(arguments[i]);\n            }\n        }\n        else\n        {\n            // if the child has a parent then lets remove it as Pixi objects can only exist in one place\n            if (child.parent)\n            {\n                child.parent.removeChild(child);\n            }\n\n            child.parent = this;\n\n            // ensure a transform will be recalculated..\n            this.transform._parentID = -1;\n            this._boundsID++;\n\n            this.children.push(child);\n\n            // TODO - lets either do all callbacks or all events.. not both!\n            this.onChildrenChange(this.children.length - 1);\n            child.emit('added', this);\n        }\n\n        return child;\n    }\n\n    /**\n     * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown\n     *\n     * @param {PIXI.DisplayObject} child - The child to add\n     * @param {number} index - The index to place the child in\n     * @return {PIXI.DisplayObject} The child that was added.\n     */\n    addChildAt(child, index)\n    {\n        if (index < 0 || index > this.children.length)\n        {\n            throw new Error(`${child}addChildAt: The index ${index} supplied is out of bounds ${this.children.length}`);\n        }\n\n        if (child.parent)\n        {\n            child.parent.removeChild(child);\n        }\n\n        child.parent = this;\n\n        this.children.splice(index, 0, child);\n\n        // TODO - lets either do all callbacks or all events.. not both!\n        this.onChildrenChange(index);\n        child.emit('added', this);\n\n        return child;\n    }\n\n    /**\n     * Swaps the position of 2 Display Objects within this container.\n     *\n     * @param {PIXI.DisplayObject} child - First display object to swap\n     * @param {PIXI.DisplayObject} child2 - Second display object to swap\n     */\n    swapChildren(child, child2)\n    {\n        if (child === child2)\n        {\n            return;\n        }\n\n        const index1 = this.getChildIndex(child);\n        const index2 = this.getChildIndex(child2);\n\n        this.children[index1] = child2;\n        this.children[index2] = child;\n        this.onChildrenChange(index1 < index2 ? index1 : index2);\n    }\n\n    /**\n     * Returns the index position of a child DisplayObject instance\n     *\n     * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify\n     * @return {number} The index position of the child display object to identify\n     */\n    getChildIndex(child)\n    {\n        const index = this.children.indexOf(child);\n\n        if (index === -1)\n        {\n            throw new Error('The supplied DisplayObject must be a child of the caller');\n        }\n\n        return index;\n    }\n\n    /**\n     * Changes the position of an existing child in the display object container\n     *\n     * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number\n     * @param {number} index - The resulting index number for the child display object\n     */\n    setChildIndex(child, index)\n    {\n        if (index < 0 || index >= this.children.length)\n        {\n            throw new Error('The supplied index is out of bounds');\n        }\n\n        const currentIndex = this.getChildIndex(child);\n\n        removeItems(this.children, currentIndex, 1); // remove from old position\n        this.children.splice(index, 0, child); // add at new position\n        this.onChildrenChange(index);\n    }\n\n    /**\n     * Returns the child at the specified index\n     *\n     * @param {number} index - The index to get the child at\n     * @return {PIXI.DisplayObject} The child at the given index, if any.\n     */\n    getChildAt(index)\n    {\n        if (index < 0 || index >= this.children.length)\n        {\n            throw new Error(`getChildAt: Index (${index}) does not exist.`);\n        }\n\n        return this.children[index];\n    }\n\n    /**\n     * Removes one or more children from the container.\n     *\n     * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove\n     * @return {PIXI.DisplayObject} The first child that was removed.\n     */\n    removeChild(child)\n    {\n        const argumentsLength = arguments.length;\n\n        // if there is only one argument we can bypass looping through the them\n        if (argumentsLength > 1)\n        {\n            // loop through the arguments property and add all children\n            // use it the right way (.length and [i]) so that this function can still be optimised by JS runtimes\n            for (let i = 0; i < argumentsLength; i++)\n            {\n                this.removeChild(arguments[i]);\n            }\n        }\n        else\n        {\n            const index = this.children.indexOf(child);\n\n            if (index === -1) return null;\n\n            child.parent = null;\n            removeItems(this.children, index, 1);\n\n            // ensure a transform will be recalculated..\n            this.transform._parentID = -1;\n            this._boundsID++;\n\n            // TODO - lets either do all callbacks or all events.. not both!\n            this.onChildrenChange(index);\n            child.emit('removed', this);\n        }\n\n        return child;\n    }\n\n    /**\n     * Removes a child from the specified index position.\n     *\n     * @param {number} index - The index to get the child from\n     * @return {PIXI.DisplayObject} The child that was removed.\n     */\n    removeChildAt(index)\n    {\n        const child = this.getChildAt(index);\n\n        child.parent = null;\n        removeItems(this.children, index, 1);\n\n        // TODO - lets either do all callbacks or all events.. not both!\n        this.onChildrenChange(index);\n        child.emit('removed', this);\n\n        return child;\n    }\n\n    /**\n     * Removes all children from this container that are within the begin and end indexes.\n     *\n     * @param {number} [beginIndex=0] - The beginning position.\n     * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.\n     * @returns {DisplayObject[]} List of removed children\n     */\n    removeChildren(beginIndex = 0, endIndex)\n    {\n        const begin = beginIndex;\n        const end = typeof endIndex === 'number' ? endIndex : this.children.length;\n        const range = end - begin;\n        let removed;\n\n        if (range > 0 && range <= end)\n        {\n            removed = this.children.splice(begin, range);\n\n            for (let i = 0; i < removed.length; ++i)\n            {\n                removed[i].parent = null;\n            }\n\n            this.onChildrenChange(beginIndex);\n\n            for (let i = 0; i < removed.length; ++i)\n            {\n                removed[i].emit('removed', this);\n            }\n\n            return removed;\n        }\n        else if (range === 0 && this.children.length === 0)\n        {\n            return [];\n        }\n\n        throw new RangeError('removeChildren: numeric values are outside the acceptable range.');\n    }\n\n    /**\n     * Updates the transform on all children of this container for rendering\n     *\n     * @private\n     */\n    updateTransform()\n    {\n        this._boundsID++;\n\n        this.transform.updateTransform(this.parent.transform);\n\n        // TODO: check render flags, how to process stuff here\n        this.worldAlpha = this.alpha * this.parent.worldAlpha;\n\n        for (let i = 0, j = this.children.length; i < j; ++i)\n        {\n            const child = this.children[i];\n\n            if (child.visible)\n            {\n                child.updateTransform();\n            }\n        }\n    }\n\n    /**\n     * Recalculates the bounds of the container.\n     *\n     */\n    calculateBounds()\n    {\n        this._bounds.clear();\n\n        this._calculateBounds();\n\n        for (let i = 0; i < this.children.length; i++)\n        {\n            const child = this.children[i];\n\n            if (!child.visible || !child.renderable)\n            {\n                continue;\n            }\n\n            child.calculateBounds();\n\n            // TODO: filter+mask, need to mask both somehow\n            if (child._mask)\n            {\n                child._mask.calculateBounds();\n                this._bounds.addBoundsMask(child._bounds, child._mask._bounds);\n            }\n            else if (child.filterArea)\n            {\n                this._bounds.addBoundsArea(child._bounds, child.filterArea);\n            }\n            else\n            {\n                this._bounds.addBounds(child._bounds);\n            }\n        }\n\n        this._lastBoundsID = this._boundsID;\n    }\n\n    /**\n     * Recalculates the bounds of the object. Override this to\n     * calculate the bounds of the specific object (not including children).\n     *\n     */\n    _calculateBounds()\n    {\n        // FILL IN//\n    }\n\n    /**\n     * Renders the object using the WebGL renderer\n     *\n     * @param {PIXI.WebGLRenderer} renderer - The renderer\n     */\n    renderWebGL(renderer)\n    {\n        // if the object is not visible or the alpha is 0 then no need to render this element\n        if (!this.visible || this.worldAlpha <= 0 || !this.renderable)\n        {\n            return;\n        }\n\n        // do a quick check to see if this element has a mask or a filter.\n        if (this._mask || this._filters)\n        {\n            this.renderAdvancedWebGL(renderer);\n        }\n        else\n        {\n            this._renderWebGL(renderer);\n\n            // simple render children!\n            for (let i = 0, j = this.children.length; i < j; ++i)\n            {\n                this.children[i].renderWebGL(renderer);\n            }\n        }\n    }\n\n    /**\n     * Render the object using the WebGL renderer and advanced features.\n     *\n     * @private\n     * @param {PIXI.WebGLRenderer} renderer - The renderer\n     */\n    renderAdvancedWebGL(renderer)\n    {\n        renderer.flush();\n\n        const filters = this._filters;\n        const mask = this._mask;\n\n        // push filter first as we need to ensure the stencil buffer is correct for any masking\n        if (filters)\n        {\n            if (!this._enabledFilters)\n            {\n                this._enabledFilters = [];\n            }\n\n            this._enabledFilters.length = 0;\n\n            for (let i = 0; i < filters.length; i++)\n            {\n                if (filters[i].enabled)\n                {\n                    this._enabledFilters.push(filters[i]);\n                }\n            }\n\n            if (this._enabledFilters.length)\n            {\n                renderer.filterManager.pushFilter(this, this._enabledFilters);\n            }\n        }\n\n        if (mask)\n        {\n            renderer.maskManager.pushMask(this, this._mask);\n        }\n\n        // add this object to the batch, only rendered if it has a texture.\n        this._renderWebGL(renderer);\n\n        // now loop through the children and make sure they get rendered\n        for (let i = 0, j = this.children.length; i < j; i++)\n        {\n            this.children[i].renderWebGL(renderer);\n        }\n\n        renderer.flush();\n\n        if (mask)\n        {\n            renderer.maskManager.popMask(this, this._mask);\n        }\n\n        if (filters && this._enabledFilters && this._enabledFilters.length)\n        {\n            renderer.filterManager.popFilter();\n        }\n    }\n\n    /**\n     * To be overridden by the subclasses.\n     *\n     * @private\n     * @param {PIXI.WebGLRenderer} renderer - The renderer\n     */\n    _renderWebGL(renderer) // eslint-disable-line no-unused-vars\n    {\n        // this is where content itself gets rendered...\n    }\n\n    /**\n     * To be overridden by the subclass\n     *\n     * @private\n     * @param {PIXI.CanvasRenderer} renderer - The renderer\n     */\n    _renderCanvas(renderer) // eslint-disable-line no-unused-vars\n    {\n        // this is where content itself gets rendered...\n    }\n\n    /**\n     * Renders the object using the Canvas renderer\n     *\n     * @param {PIXI.CanvasRenderer} renderer - The renderer\n     */\n    renderCanvas(renderer)\n    {\n        // if not visible or the alpha is 0 then no need to render this\n        if (!this.visible || this.worldAlpha <= 0 || !this.renderable)\n        {\n            return;\n        }\n\n        if (this._mask)\n        {\n            renderer.maskManager.pushMask(this._mask);\n        }\n\n        this._renderCanvas(renderer);\n        for (let i = 0, j = this.children.length; i < j; ++i)\n        {\n            this.children[i].renderCanvas(renderer);\n        }\n\n        if (this._mask)\n        {\n            renderer.maskManager.popMask(renderer);\n        }\n    }\n\n    /**\n     * Removes all internal references and listeners as well as removes children from the display list.\n     * Do not use a Container after calling `destroy`.\n     *\n     * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n     *  have been set to that value\n     * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n     *  method called as well. 'options' will be passed on to those calls.\n     */\n    destroy(options)\n    {\n        super.destroy();\n\n        const destroyChildren = typeof options === 'boolean' ? options : options && options.children;\n\n        const oldChildren = this.removeChildren(0, this.children.length);\n\n        if (destroyChildren)\n        {\n            for (let i = 0; i < oldChildren.length; ++i)\n            {\n                oldChildren[i].destroy(options);\n            }\n        }\n    }\n\n    /**\n     * The width of the Container, setting this will actually modify the scale to achieve the value set\n     *\n     * @member {number}\n     * @memberof PIXI.Container#\n     */\n    get width()\n    {\n        return this.scale.x * this.getLocalBounds().width;\n    }\n\n    /**\n     * Sets the width of the container by modifying the scale.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set width(value)\n    {\n        const width = this.getLocalBounds().width;\n\n        if (width !== 0)\n        {\n            this.scale.x = value / width;\n        }\n        else\n        {\n            this.scale.x = 1;\n        }\n\n        this._width = value;\n    }\n\n    /**\n     * The height of the Container, setting this will actually modify the scale to achieve the value set\n     *\n     * @member {number}\n     * @memberof PIXI.Container#\n     */\n    get height()\n    {\n        return this.scale.y * this.getLocalBounds().height;\n    }\n\n    /**\n     * Sets the height of the container by modifying the scale.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set height(value)\n    {\n        const height = this.getLocalBounds().height;\n\n        if (height !== 0)\n        {\n            this.scale.y = value / height;\n        }\n        else\n        {\n            this.scale.y = 1;\n        }\n\n        this._height = value;\n    }\n}\n\n// performance increase to avoid using call.. (10x faster)\nContainer.prototype.containerUpdateTransform = Container.prototype.updateTransform;\n","import EventEmitter from 'eventemitter3';\nimport { TRANSFORM_MODE } from '../const';\nimport settings from '../settings';\nimport TransformStatic from './TransformStatic';\nimport Transform from './Transform';\nimport Bounds from './Bounds';\nimport { Rectangle } from '../math';\n// _tempDisplayObjectParent = new DisplayObject();\n\n/**\n * The base class for all objects that are rendered on the screen.\n * This is an abstract class and should not be used on its own rather it should be extended.\n *\n * @class\n * @extends EventEmitter\n * @mixes PIXI.interaction.interactiveTarget\n * @memberof PIXI\n */\nexport default class DisplayObject extends EventEmitter\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        super();\n\n        const TransformClass = settings.TRANSFORM_MODE === TRANSFORM_MODE.STATIC ? TransformStatic : Transform;\n\n        this.tempDisplayObjectParent = null;\n\n        // TODO: need to create Transform from factory\n        /**\n         * World transform and local transform of this object.\n         * This will become read-only later, please do not assign anything there unless you know what are you doing\n         *\n         * @member {PIXI.TransformBase}\n         */\n        this.transform = new TransformClass();\n\n        /**\n         * The opacity of the object.\n         *\n         * @member {number}\n         */\n        this.alpha = 1;\n\n        /**\n         * The visibility of the object. If false the object will not be drawn, and\n         * the updateTransform function will not be called.\n         *\n         * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually\n         *\n         * @member {boolean}\n         */\n        this.visible = true;\n\n        /**\n         * Can this object be rendered, if false the object will not be drawn but the updateTransform\n         * methods will still be called.\n         *\n         * Only affects recursive calls from parent. You can ask for bounds manually\n         *\n         * @member {boolean}\n         */\n        this.renderable = true;\n\n        /**\n         * The display object container that contains this display object.\n         *\n         * @member {PIXI.Container}\n         * @readonly\n         */\n        this.parent = null;\n\n        /**\n         * The multiplied alpha of the displayObject\n         *\n         * @member {number}\n         * @readonly\n         */\n        this.worldAlpha = 1;\n\n        /**\n         * The area the filter is applied to. This is used as more of an optimisation\n         * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle\n         *\n         * Also works as an interaction mask\n         *\n         * @member {PIXI.Rectangle}\n         */\n        this.filterArea = null;\n\n        this._filters = null;\n        this._enabledFilters = null;\n\n        /**\n         * The bounds object, this is used to calculate and store the bounds of the displayObject\n         *\n         * @member {PIXI.Rectangle}\n         * @private\n         */\n        this._bounds = new Bounds();\n        this._boundsID = 0;\n        this._lastBoundsID = -1;\n        this._boundsRect = null;\n        this._localBoundsRect = null;\n\n        /**\n         * The original, cached mask of the object\n         *\n         * @member {PIXI.Rectangle}\n         * @private\n         */\n        this._mask = null;\n    }\n\n    /**\n     * @private\n     * @member {PIXI.DisplayObject}\n     */\n    get _tempDisplayObjectParent()\n    {\n        if (this.tempDisplayObjectParent === null)\n        {\n            this.tempDisplayObjectParent = new DisplayObject();\n        }\n\n        return this.tempDisplayObjectParent;\n    }\n\n    /**\n     * Updates the object transform for rendering\n     *\n     * TODO - Optimization pass!\n     */\n    updateTransform()\n    {\n        this.transform.updateTransform(this.parent.transform);\n        // multiply the alphas..\n        this.worldAlpha = this.alpha * this.parent.worldAlpha;\n\n        this._bounds.updateID++;\n    }\n\n    /**\n     * recursively updates transform of all objects from the root to this one\n     * internal function for toLocal()\n     */\n    _recursivePostUpdateTransform()\n    {\n        if (this.parent)\n        {\n            this.parent._recursivePostUpdateTransform();\n            this.transform.updateTransform(this.parent.transform);\n        }\n        else\n        {\n            this.transform.updateTransform(this._tempDisplayObjectParent.transform);\n        }\n    }\n\n    /**\n     * Retrieves the bounds of the displayObject as a rectangle object.\n     *\n     * @param {boolean} skipUpdate - setting to true will stop the transforms of the scene graph from\n     *  being updated. This means the calculation returned MAY be out of date BUT will give you a\n     *  nice performance boost\n     * @param {PIXI.Rectangle} rect - Optional rectangle to store the result of the bounds calculation\n     * @return {PIXI.Rectangle} the rectangular bounding area\n     */\n    getBounds(skipUpdate, rect)\n    {\n        if (!skipUpdate)\n        {\n            if (!this.parent)\n            {\n                this.parent = this._tempDisplayObjectParent;\n                this.updateTransform();\n                this.parent = null;\n            }\n            else\n            {\n                this._recursivePostUpdateTransform();\n                this.updateTransform();\n            }\n        }\n\n        if (this._boundsID !== this._lastBoundsID)\n        {\n            this.calculateBounds();\n        }\n\n        if (!rect)\n        {\n            if (!this._boundsRect)\n            {\n                this._boundsRect = new Rectangle();\n            }\n\n            rect = this._boundsRect;\n        }\n\n        return this._bounds.getRectangle(rect);\n    }\n\n    /**\n     * Retrieves the local bounds of the displayObject as a rectangle object\n     *\n     * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation\n     * @return {PIXI.Rectangle} the rectangular bounding area\n     */\n    getLocalBounds(rect)\n    {\n        const transformRef = this.transform;\n        const parentRef = this.parent;\n\n        this.parent = null;\n        this.transform = this._tempDisplayObjectParent.transform;\n\n        if (!rect)\n        {\n            if (!this._localBoundsRect)\n            {\n                this._localBoundsRect = new Rectangle();\n            }\n\n            rect = this._localBoundsRect;\n        }\n\n        const bounds = this.getBounds(false, rect);\n\n        this.parent = parentRef;\n        this.transform = transformRef;\n\n        return bounds;\n    }\n\n    /**\n     * Calculates the global position of the display object\n     *\n     * @param {PIXI.Point} position - The world origin to calculate from\n     * @param {PIXI.Point} [point] - A Point object in which to store the value, optional\n     *  (otherwise will create a new Point)\n     * @param {boolean} [skipUpdate=false] - Should we skip the update transform.\n     * @return {PIXI.Point} A point object representing the position of this object\n     */\n    toGlobal(position, point, skipUpdate = false)\n    {\n        if (!skipUpdate)\n        {\n            this._recursivePostUpdateTransform();\n\n            // this parent check is for just in case the item is a root object.\n            // If it is we need to give it a temporary parent so that displayObjectUpdateTransform works correctly\n            // this is mainly to avoid a parent check in the main loop. Every little helps for performance :)\n            if (!this.parent)\n            {\n                this.parent = this._tempDisplayObjectParent;\n                this.displayObjectUpdateTransform();\n                this.parent = null;\n            }\n            else\n            {\n                this.displayObjectUpdateTransform();\n            }\n        }\n\n        // don't need to update the lot\n        return this.worldTransform.apply(position, point);\n    }\n\n    /**\n     * Calculates the local position of the display object relative to another point\n     *\n     * @param {PIXI.Point} position - The world origin to calculate from\n     * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from\n     * @param {PIXI.Point} [point] - A Point object in which to store the value, optional\n     *  (otherwise will create a new Point)\n     * @param {boolean} [skipUpdate=false] - Should we skip the update transform\n     * @return {PIXI.Point} A point object representing the position of this object\n     */\n    toLocal(position, from, point, skipUpdate)\n    {\n        if (from)\n        {\n            position = from.toGlobal(position, point, skipUpdate);\n        }\n\n        if (!skipUpdate)\n        {\n            this._recursivePostUpdateTransform();\n\n            // this parent check is for just in case the item is a root object.\n            // If it is we need to give it a temporary parent so that displayObjectUpdateTransform works correctly\n            // this is mainly to avoid a parent check in the main loop. Every little helps for performance :)\n            if (!this.parent)\n            {\n                this.parent = this._tempDisplayObjectParent;\n                this.displayObjectUpdateTransform();\n                this.parent = null;\n            }\n            else\n            {\n                this.displayObjectUpdateTransform();\n            }\n        }\n\n        // simply apply the matrix..\n        return this.worldTransform.applyInverse(position, point);\n    }\n\n    /**\n     * Renders the object using the WebGL renderer\n     *\n     * @param {PIXI.WebGLRenderer} renderer - The renderer\n     */\n    renderWebGL(renderer) // eslint-disable-line no-unused-vars\n    {\n        // OVERWRITE;\n    }\n\n    /**\n     * Renders the object using the Canvas renderer\n     *\n     * @param {PIXI.CanvasRenderer} renderer - The renderer\n     */\n    renderCanvas(renderer) // eslint-disable-line no-unused-vars\n    {\n        // OVERWRITE;\n    }\n\n    /**\n     * Set the parent Container of this DisplayObject\n     *\n     * @param {PIXI.Container} container - The Container to add this DisplayObject to\n     * @return {PIXI.Container} The Container that this DisplayObject was added to\n     */\n    setParent(container)\n    {\n        if (!container || !container.addChild)\n        {\n            throw new Error('setParent: Argument must be a Container');\n        }\n\n        container.addChild(this);\n\n        return container;\n    }\n\n    /**\n     * Convenience function to set the position, scale, skew and pivot at once.\n     *\n     * @param {number} [x=0] - The X position\n     * @param {number} [y=0] - The Y position\n     * @param {number} [scaleX=1] - The X scale value\n     * @param {number} [scaleY=1] - The Y scale value\n     * @param {number} [rotation=0] - The rotation\n     * @param {number} [skewX=0] - The X skew value\n     * @param {number} [skewY=0] - The Y skew value\n     * @param {number} [pivotX=0] - The X pivot value\n     * @param {number} [pivotY=0] - The Y pivot value\n     * @return {PIXI.DisplayObject} The DisplayObject instance\n     */\n    setTransform(x = 0, y = 0, scaleX = 1, scaleY = 1, rotation = 0, skewX = 0, skewY = 0, pivotX = 0, pivotY = 0)\n    {\n        this.position.x = x;\n        this.position.y = y;\n        this.scale.x = !scaleX ? 1 : scaleX;\n        this.scale.y = !scaleY ? 1 : scaleY;\n        this.rotation = rotation;\n        this.skew.x = skewX;\n        this.skew.y = skewY;\n        this.pivot.x = pivotX;\n        this.pivot.y = pivotY;\n\n        return this;\n    }\n\n    /**\n     * Base destroy method for generic display objects. This will automatically\n     * remove the display object from its parent Container as well as remove\n     * all current event listeners and internal references. Do not use a DisplayObject\n     * after calling `destroy`.\n     *\n     */\n    destroy()\n    {\n        this.removeAllListeners();\n        if (this.parent)\n        {\n            this.parent.removeChild(this);\n        }\n        this.transform = null;\n\n        this.parent = null;\n\n        this._bounds = null;\n        this._currentBounds = null;\n        this._mask = null;\n\n        this.filterArea = null;\n\n        this.interactive = false;\n        this.interactiveChildren = false;\n    }\n\n    /**\n     * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n     * An alias to position.x\n     *\n     * @member {number}\n     * @memberof PIXI.DisplayObject#\n     */\n    get x()\n    {\n        return this.position.x;\n    }\n\n    /**\n     * Sets the X position of the object.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set x(value)\n    {\n        this.transform.position.x = value;\n    }\n\n    /**\n     * The position of the displayObject on the y axis relative to the local coordinates of the parent.\n     * An alias to position.y\n     *\n     * @member {number}\n     * @memberof PIXI.DisplayObject#\n     */\n    get y()\n    {\n        return this.position.y;\n    }\n\n    /**\n     * Sets the Y position of the object.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set y(value)\n    {\n        this.transform.position.y = value;\n    }\n\n    /**\n     * Current transform of the object based on world (parent) factors\n     *\n     * @member {PIXI.Matrix}\n     * @memberof PIXI.DisplayObject#\n     * @readonly\n     */\n    get worldTransform()\n    {\n        return this.transform.worldTransform;\n    }\n\n    /**\n     * Current transform of the object based on local factors: position, scale, other stuff\n     *\n     * @member {PIXI.Matrix}\n     * @memberof PIXI.DisplayObject#\n     * @readonly\n     */\n    get localTransform()\n    {\n        return this.transform.localTransform;\n    }\n\n    /**\n     * The coordinate of the object relative to the local coordinates of the parent.\n     * Assignment by value since pixi-v4.\n     *\n     * @member {PIXI.Point|PIXI.ObservablePoint}\n     * @memberof PIXI.DisplayObject#\n     */\n    get position()\n    {\n        return this.transform.position;\n    }\n\n    /**\n     * Copies the point to the position of the object.\n     *\n     * @param {PIXI.Point} value - The value to set to.\n     */\n    set position(value)\n    {\n        this.transform.position.copy(value);\n    }\n\n    /**\n     * The scale factor of the object.\n     * Assignment by value since pixi-v4.\n     *\n     * @member {PIXI.Point|PIXI.ObservablePoint}\n     * @memberof PIXI.DisplayObject#\n     */\n    get scale()\n    {\n        return this.transform.scale;\n    }\n\n    /**\n     * Copies the point to the scale of the object.\n     *\n     * @param {PIXI.Point} value - The value to set to.\n     */\n    set scale(value)\n    {\n        this.transform.scale.copy(value);\n    }\n\n    /**\n     * The pivot point of the displayObject that it rotates around\n     * Assignment by value since pixi-v4.\n     *\n     * @member {PIXI.Point|PIXI.ObservablePoint}\n     * @memberof PIXI.DisplayObject#\n     */\n    get pivot()\n    {\n        return this.transform.pivot;\n    }\n\n    /**\n     * Copies the point to the pivot of the object.\n     *\n     * @param {PIXI.Point} value - The value to set to.\n     */\n    set pivot(value)\n    {\n        this.transform.pivot.copy(value);\n    }\n\n    /**\n     * The skew factor for the object in radians.\n     * Assignment by value since pixi-v4.\n     *\n     * @member {PIXI.ObservablePoint}\n     * @memberof PIXI.DisplayObject#\n     */\n    get skew()\n    {\n        return this.transform.skew;\n    }\n\n    /**\n     * Copies the point to the skew of the object.\n     *\n     * @param {PIXI.Point} value - The value to set to.\n     */\n    set skew(value)\n    {\n        this.transform.skew.copy(value);\n    }\n\n    /**\n     * The rotation of the object in radians.\n     *\n     * @member {number}\n     * @memberof PIXI.DisplayObject#\n     */\n    get rotation()\n    {\n        return this.transform.rotation;\n    }\n\n    /**\n     * Sets the rotation of the object.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set rotation(value)\n    {\n        this.transform.rotation = value;\n    }\n\n    /**\n     * Indicates if the object is globally visible.\n     *\n     * @member {boolean}\n     * @memberof PIXI.DisplayObject#\n     * @readonly\n     */\n    get worldVisible()\n    {\n        let item = this;\n\n        do\n        {\n            if (!item.visible)\n            {\n                return false;\n            }\n\n            item = item.parent;\n        } while (item);\n\n        return true;\n    }\n\n    /**\n     * Sets a mask for the displayObject. A mask is an object that limits the visibility of an\n     * object to the shape of the mask applied to it. In PIXI a regular mask must be a\n     * PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it\n     * utilises shape clipping. To remove a mask, set this property to null.\n     *\n     * @todo For the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.\n     *\n     * @member {PIXI.Graphics|PIXI.Sprite}\n     * @memberof PIXI.DisplayObject#\n     */\n    get mask()\n    {\n        return this._mask;\n    }\n\n    /**\n     * Sets the mask.\n     *\n     * @param {PIXI.Graphics|PIXI.Sprite} value - The value to set to.\n     */\n    set mask(value)\n    {\n        if (this._mask)\n        {\n            this._mask.renderable = true;\n        }\n\n        this._mask = value;\n\n        if (this._mask)\n        {\n            this._mask.renderable = false;\n        }\n    }\n\n    /**\n     * Sets the filters for the displayObject.\n     * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.\n     * To remove filters simply set this property to 'null'\n     *\n     * @member {PIXI.Filter[]}\n     * @memberof PIXI.DisplayObject#\n     */\n    get filters()\n    {\n        return this._filters && this._filters.slice();\n    }\n\n    /**\n     * Shallow copies the array to the filters of the object.\n     *\n     * @param {PIXI.Filter[]} value - The filters to set.\n     */\n    set filters(value)\n    {\n        this._filters = value && value.slice();\n    }\n}\n\n// performance increase to avoid using call.. (10x faster)\nDisplayObject.prototype.displayObjectUpdateTransform = DisplayObject.prototype.updateTransform;\n","import { Point, ObservablePoint } from '../math';\nimport TransformBase from './TransformBase';\n\n/**\n * Generic class to deal with traditional 2D matrix transforms\n * local transformation is calculated from position,scale,skew and rotation\n *\n * @class\n * @extends PIXI.TransformBase\n * @memberof PIXI\n */\nexport default class Transform extends TransformBase\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        super();\n\n         /**\n         * The coordinate of the object relative to the local coordinates of the parent.\n         *\n         * @member {PIXI.Point}\n         */\n        this.position = new Point(0, 0);\n\n        /**\n         * The scale factor of the object.\n         *\n         * @member {PIXI.Point}\n         */\n        this.scale = new Point(1, 1);\n\n        /**\n         * The skew amount, on the x and y axis.\n         *\n         * @member {PIXI.ObservablePoint}\n         */\n        this.skew = new ObservablePoint(this.updateSkew, this, 0, 0);\n\n        /**\n         * The pivot point of the displayObject that it rotates around\n         *\n         * @member {PIXI.Point}\n         */\n        this.pivot = new Point(0, 0);\n\n        /**\n         * The rotation value of the object, in radians\n         *\n         * @member {Number}\n         * @private\n         */\n        this._rotation = 0;\n\n        this._cx = 1; // cos rotation + skewY;\n        this._sx = 0; // sin rotation + skewY;\n        this._cy = 0; // cos rotation + Math.PI/2 - skewX;\n        this._sy = 1; // sin rotation + Math.PI/2 - skewX;\n    }\n\n    /**\n     * Updates the skew values when the skew or rotation changes.\n     *\n     * @private\n     */\n    updateSkew()\n    {\n        this._cx = Math.cos(this._rotation + this.skew._y);\n        this._sx = Math.sin(this._rotation + this.skew._y);\n        this._cy = -Math.sin(this._rotation - this.skew._x); // cos, added PI/2\n        this._sy = Math.cos(this._rotation - this.skew._x); // sin, added PI/2\n    }\n\n    /**\n     * Updates only local matrix\n     */\n    updateLocalTransform()\n    {\n        const lt = this.localTransform;\n\n        lt.a = this._cx * this.scale.x;\n        lt.b = this._sx * this.scale.x;\n        lt.c = this._cy * this.scale.y;\n        lt.d = this._sy * this.scale.y;\n\n        lt.tx = this.position.x - ((this.pivot.x * lt.a) + (this.pivot.y * lt.c));\n        lt.ty = this.position.y - ((this.pivot.x * lt.b) + (this.pivot.y * lt.d));\n    }\n\n    /**\n     * Updates the values of the object and applies the parent's transform.\n     *\n     * @param {PIXI.Transform} parentTransform - The transform of the parent of this object\n     */\n    updateTransform(parentTransform)\n    {\n        const lt = this.localTransform;\n\n        lt.a = this._cx * this.scale.x;\n        lt.b = this._sx * this.scale.x;\n        lt.c = this._cy * this.scale.y;\n        lt.d = this._sy * this.scale.y;\n\n        lt.tx = this.position.x - ((this.pivot.x * lt.a) + (this.pivot.y * lt.c));\n        lt.ty = this.position.y - ((this.pivot.x * lt.b) + (this.pivot.y * lt.d));\n\n        // concat the parent matrix with the objects transform.\n        const pt = parentTransform.worldTransform;\n        const wt = this.worldTransform;\n\n        wt.a = (lt.a * pt.a) + (lt.b * pt.c);\n        wt.b = (lt.a * pt.b) + (lt.b * pt.d);\n        wt.c = (lt.c * pt.a) + (lt.d * pt.c);\n        wt.d = (lt.c * pt.b) + (lt.d * pt.d);\n        wt.tx = (lt.tx * pt.a) + (lt.ty * pt.c) + pt.tx;\n        wt.ty = (lt.tx * pt.b) + (lt.ty * pt.d) + pt.ty;\n\n        this._worldID ++;\n    }\n\n    /**\n     * Decomposes a matrix and sets the transforms properties based on it.\n     *\n     * @param {PIXI.Matrix} matrix - The matrix to decompose\n     */\n    setFromMatrix(matrix)\n    {\n        matrix.decompose(this);\n    }\n\n    /**\n     * The rotation of the object in radians.\n     *\n     * @member {number}\n     * @memberof PIXI.Transform#\n     */\n    get rotation()\n    {\n        return this._rotation;\n    }\n\n    /**\n     * Set the rotation of the transform.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set rotation(value)\n    {\n        this._rotation = value;\n        this.updateSkew();\n    }\n}\n","import { Matrix } from '../math';\n\n/**\n * Generic class to deal with traditional 2D matrix transforms\n *\n * @class\n * @memberof PIXI\n */\nexport default class TransformBase\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        /**\n         * The global matrix transform. It can be swapped temporarily by some functions like getLocalBounds()\n         *\n         * @member {PIXI.Matrix}\n         */\n        this.worldTransform = new Matrix();\n\n        /**\n         * The local matrix transform\n         *\n         * @member {PIXI.Matrix}\n         */\n        this.localTransform = new Matrix();\n\n        this._worldID = 0;\n        this._parentID = 0;\n    }\n\n    /**\n     * TransformBase does not have decomposition, so this function wont do anything\n     */\n    updateLocalTransform()\n    {\n        // empty\n    }\n\n    /**\n     * Updates the values of the object and applies the parent's transform.\n     *\n     * @param {PIXI.TransformBase} parentTransform - The transform of the parent of this object\n     */\n    updateTransform(parentTransform)\n    {\n        const pt = parentTransform.worldTransform;\n        const wt = this.worldTransform;\n        const lt = this.localTransform;\n\n        // concat the parent matrix with the objects transform.\n        wt.a = (lt.a * pt.a) + (lt.b * pt.c);\n        wt.b = (lt.a * pt.b) + (lt.b * pt.d);\n        wt.c = (lt.c * pt.a) + (lt.d * pt.c);\n        wt.d = (lt.c * pt.b) + (lt.d * pt.d);\n        wt.tx = (lt.tx * pt.a) + (lt.ty * pt.c) + pt.tx;\n        wt.ty = (lt.tx * pt.b) + (lt.ty * pt.d) + pt.ty;\n\n        this._worldID ++;\n    }\n\n}\n\n/**\n * Updates the values of the object and applies the parent's transform.\n * @param  parentTransform {PIXI.Transform} The transform of the parent of this object\n *\n */\nTransformBase.prototype.updateWorldTransform = TransformBase.prototype.updateTransform;\n\nTransformBase.IDENTITY = new TransformBase();\n","import { ObservablePoint } from '../math';\nimport TransformBase from './TransformBase';\n\n/**\n * Transform that takes care about its versions\n *\n * @class\n * @extends PIXI.TransformBase\n * @memberof PIXI\n */\nexport default class TransformStatic extends TransformBase\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        super();\n\n         /**\n         * The coordinate of the object relative to the local coordinates of the parent.\n         *\n         * @member {PIXI.ObservablePoint}\n         */\n        this.position = new ObservablePoint(this.onChange, this, 0, 0);\n\n        /**\n         * The scale factor of the object.\n         *\n         * @member {PIXI.ObservablePoint}\n         */\n        this.scale = new ObservablePoint(this.onChange, this, 1, 1);\n\n        /**\n         * The pivot point of the displayObject that it rotates around\n         *\n         * @member {PIXI.ObservablePoint}\n         */\n        this.pivot = new ObservablePoint(this.onChange, this, 0, 0);\n\n        /**\n         * The skew amount, on the x and y axis.\n         *\n         * @member {PIXI.ObservablePoint}\n         */\n        this.skew = new ObservablePoint(this.updateSkew, this, 0, 0);\n\n        this._rotation = 0;\n\n        this._cx = 1; // cos rotation + skewY;\n        this._sx = 0; // sin rotation + skewY;\n        this._cy = 0; // cos rotation + Math.PI/2 - skewX;\n        this._sy = 1; // sin rotation + Math.PI/2 - skewX;\n\n        this._localID = 0;\n        this._currentLocalID = 0;\n    }\n\n    /**\n     * Called when a value changes.\n     *\n     * @private\n     */\n    onChange()\n    {\n        this._localID ++;\n    }\n\n    /**\n     * Called when skew or rotation changes\n     *\n     * @private\n     */\n    updateSkew()\n    {\n        this._cx = Math.cos(this._rotation + this.skew._y);\n        this._sx = Math.sin(this._rotation + this.skew._y);\n        this._cy = -Math.sin(this._rotation - this.skew._x); // cos, added PI/2\n        this._sy = Math.cos(this._rotation - this.skew._x); // sin, added PI/2\n\n        this._localID ++;\n    }\n\n    /**\n     * Updates only local matrix\n     */\n    updateLocalTransform()\n    {\n        const lt = this.localTransform;\n\n        if (this._localID !== this._currentLocalID)\n        {\n            // get the matrix values of the displayobject based on its transform properties..\n            lt.a = this._cx * this.scale._x;\n            lt.b = this._sx * this.scale._x;\n            lt.c = this._cy * this.scale._y;\n            lt.d = this._sy * this.scale._y;\n\n            lt.tx = this.position._x - ((this.pivot._x * lt.a) + (this.pivot._y * lt.c));\n            lt.ty = this.position._y - ((this.pivot._x * lt.b) + (this.pivot._y * lt.d));\n            this._currentLocalID = this._localID;\n\n            // force an update..\n            this._parentID = -1;\n        }\n    }\n\n    /**\n     * Updates the values of the object and applies the parent's transform.\n     *\n     * @param {PIXI.Transform} parentTransform - The transform of the parent of this object\n     */\n    updateTransform(parentTransform)\n    {\n        const lt = this.localTransform;\n\n        if (this._localID !== this._currentLocalID)\n        {\n            // get the matrix values of the displayobject based on its transform properties..\n            lt.a = this._cx * this.scale._x;\n            lt.b = this._sx * this.scale._x;\n            lt.c = this._cy * this.scale._y;\n            lt.d = this._sy * this.scale._y;\n\n            lt.tx = this.position._x - ((this.pivot._x * lt.a) + (this.pivot._y * lt.c));\n            lt.ty = this.position._y - ((this.pivot._x * lt.b) + (this.pivot._y * lt.d));\n            this._currentLocalID = this._localID;\n\n            // force an update..\n            this._parentID = -1;\n        }\n\n        if (this._parentID !== parentTransform._worldID)\n        {\n            // concat the parent matrix with the objects transform.\n            const pt = parentTransform.worldTransform;\n            const wt = this.worldTransform;\n\n            wt.a = (lt.a * pt.a) + (lt.b * pt.c);\n            wt.b = (lt.a * pt.b) + (lt.b * pt.d);\n            wt.c = (lt.c * pt.a) + (lt.d * pt.c);\n            wt.d = (lt.c * pt.b) + (lt.d * pt.d);\n            wt.tx = (lt.tx * pt.a) + (lt.ty * pt.c) + pt.tx;\n            wt.ty = (lt.tx * pt.b) + (lt.ty * pt.d) + pt.ty;\n\n            this._parentID = parentTransform._worldID;\n\n            // update the id of the transform..\n            this._worldID ++;\n        }\n    }\n\n    /**\n     * Decomposes a matrix and sets the transforms properties based on it.\n     *\n     * @param {PIXI.Matrix} matrix - The matrix to decompose\n     */\n    setFromMatrix(matrix)\n    {\n        matrix.decompose(this);\n        this._localID ++;\n    }\n\n    /**\n     * The rotation of the object in radians.\n     *\n     * @member {number}\n     * @memberof PIXI.TransformStatic#\n     */\n    get rotation()\n    {\n        return this._rotation;\n    }\n\n    /**\n     * Sets the rotation of the transform.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set rotation(value)\n    {\n        this._rotation = value;\n        this.updateSkew();\n    }\n}\n","import Container from '../display/Container';\nimport RenderTexture from '../textures/RenderTexture';\nimport Texture from '../textures/Texture';\nimport GraphicsData from './GraphicsData';\nimport Sprite from '../sprites/Sprite';\nimport { Matrix, Point, Rectangle, RoundedRectangle, Ellipse, Polygon, Circle } from '../math';\nimport { hex2rgb, rgb2hex } from '../utils';\nimport { SHAPES, BLEND_MODES } from '../const';\nimport Bounds from '../display/Bounds';\nimport bezierCurveTo from './utils/bezierCurveTo';\nimport CanvasRenderer from '../renderers/canvas/CanvasRenderer';\n\nlet canvasRenderer;\nconst tempMatrix = new Matrix();\nconst tempPoint = new Point();\nconst tempColor1 = new Float32Array(4);\nconst tempColor2 = new Float32Array(4);\n\n/**\n * The Graphics class contains methods used to draw primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\nexport default class Graphics extends Container\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        super();\n\n        /**\n         * The alpha value used when filling the Graphics object.\n         *\n         * @member {number}\n         * @default 1\n         */\n        this.fillAlpha = 1;\n\n        /**\n         * The width (thickness) of any lines drawn.\n         *\n         * @member {number}\n         * @default 0\n         */\n        this.lineWidth = 0;\n\n        /**\n         * The color of any lines drawn.\n         *\n         * @member {string}\n         * @default 0\n         */\n        this.lineColor = 0;\n\n        /**\n         * Graphics data\n         *\n         * @member {PIXI.GraphicsData[]}\n         * @private\n         */\n        this.graphicsData = [];\n\n        /**\n         * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to\n         * reset the tint.\n         *\n         * @member {number}\n         * @default 0xFFFFFF\n         */\n        this.tint = 0xFFFFFF;\n\n        /**\n         * The previous tint applied to the graphic shape. Used to compare to the current tint and\n         * check if theres change.\n         *\n         * @member {number}\n         * @private\n         * @default 0xFFFFFF\n         */\n        this._prevTint = 0xFFFFFF;\n\n        /**\n         * The blend mode to be applied to the graphic shape. Apply a value of\n         * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n         *\n         * @member {number}\n         * @default PIXI.BLEND_MODES.NORMAL;\n         * @see PIXI.BLEND_MODES\n         */\n        this.blendMode = BLEND_MODES.NORMAL;\n\n        /**\n         * Current path\n         *\n         * @member {PIXI.GraphicsData}\n         * @private\n         */\n        this.currentPath = null;\n\n        /**\n         * Array containing some WebGL-related properties used by the WebGL renderer.\n         *\n         * @member {object}\n         * @private\n         */\n        // TODO - _webgl should use a prototype object, not a random undocumented object...\n        this._webGL = {};\n\n        /**\n         * Whether this shape is being used as a mask.\n         *\n         * @member {boolean}\n         */\n        this.isMask = false;\n\n        /**\n         * The bounds' padding used for bounds calculation.\n         *\n         * @member {number}\n         */\n        this.boundsPadding = 0;\n\n        /**\n         * A cache of the local bounds to prevent recalculation.\n         *\n         * @member {PIXI.Rectangle}\n         * @private\n         */\n        this._localBounds = new Bounds();\n\n        /**\n         * Used to detect if the graphics object has changed. If this is set to true then the graphics\n         * object will be recalculated.\n         *\n         * @member {boolean}\n         * @private\n         */\n        this.dirty = 0;\n\n        /**\n         * Used to detect if we need to do a fast rect check using the id compare method\n         * @type {Number}\n         */\n        this.fastRectDirty = -1;\n\n        /**\n         * Used to detect if we clear the graphics webGL data\n         * @type {Number}\n         */\n        this.clearDirty = 0;\n\n        /**\n         * Used to detect if we we need to recalculate local bounds\n         * @type {Number}\n         */\n        this.boundsDirty = -1;\n\n        /**\n         * Used to detect if the cached sprite object needs to be updated.\n         *\n         * @member {boolean}\n         * @private\n         */\n        this.cachedSpriteDirty = false;\n\n        this._spriteRect = null;\n        this._fastRect = false;\n\n        /**\n         * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.\n         * This is useful if your graphics element does not change often, as it will speed up the rendering\n         * of the object in exchange for taking up texture memory. It is also useful if you need the graphics\n         * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if\n         * you are constantly redrawing the graphics element.\n         *\n         * @name cacheAsBitmap\n         * @member {boolean}\n         * @memberof PIXI.Graphics#\n         * @default false\n         */\n    }\n\n    /**\n     * Creates a new Graphics object with the same values as this one.\n     * Note that the only the properties of the object are cloned, not its transform (position,scale,etc)\n     *\n     * @return {PIXI.Graphics} A clone of the graphics object\n     */\n    clone()\n    {\n        const clone = new Graphics();\n\n        clone.renderable = this.renderable;\n        clone.fillAlpha = this.fillAlpha;\n        clone.lineWidth = this.lineWidth;\n        clone.lineColor = this.lineColor;\n        clone.tint = this.tint;\n        clone.blendMode = this.blendMode;\n        clone.isMask = this.isMask;\n        clone.boundsPadding = this.boundsPadding;\n        clone.dirty = 0;\n        clone.cachedSpriteDirty = this.cachedSpriteDirty;\n\n        // copy graphics data\n        for (let i = 0; i < this.graphicsData.length; ++i)\n        {\n            clone.graphicsData.push(this.graphicsData[i].clone());\n        }\n\n        clone.currentPath = clone.graphicsData[clone.graphicsData.length - 1];\n\n        clone.updateLocalBounds();\n\n        return clone;\n    }\n\n    /**\n     * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo()\n     * method or the drawCircle() method.\n     *\n     * @param {number} [lineWidth=0] - width of the line to draw, will update the objects stored style\n     * @param {number} [color=0] - color of the line to draw, will update the objects stored style\n     * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style\n     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n     */\n    lineStyle(lineWidth = 0, color = 0, alpha = 1)\n    {\n        this.lineWidth = lineWidth;\n        this.lineColor = color;\n        this.lineAlpha = alpha;\n\n        if (this.currentPath)\n        {\n            if (this.currentPath.shape.points.length)\n            {\n                // halfway through a line? start a new one!\n                const shape = new Polygon(this.currentPath.shape.points.slice(-2));\n\n                shape.closed = false;\n\n                this.drawShape(shape);\n            }\n            else\n            {\n                // otherwise its empty so lets just set the line properties\n                this.currentPath.lineWidth = this.lineWidth;\n                this.currentPath.lineColor = this.lineColor;\n                this.currentPath.lineAlpha = this.lineAlpha;\n            }\n        }\n\n        return this;\n    }\n\n    /**\n     * Moves the current drawing position to x, y.\n     *\n     * @param {number} x - the X coordinate to move to\n     * @param {number} y - the Y coordinate to move to\n     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n     */\n    moveTo(x, y)\n    {\n        const shape = new Polygon([x, y]);\n\n        shape.closed = false;\n        this.drawShape(shape);\n\n        return this;\n    }\n\n    /**\n     * Draws a line using the current line style from the current drawing position to (x, y);\n     * The current drawing position is then set to (x, y).\n     *\n     * @param {number} x - the X coordinate to draw to\n     * @param {number} y - the Y coordinate to draw to\n     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n     */\n    lineTo(x, y)\n    {\n        this.currentPath.shape.points.push(x, y);\n        this.dirty++;\n\n        return this;\n    }\n\n    /**\n     * Calculate the points for a quadratic bezier curve and then draws it.\n     * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n     *\n     * @param {number} cpX - Control point x\n     * @param {number} cpY - Control point y\n     * @param {number} toX - Destination point x\n     * @param {number} toY - Destination point y\n     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n     */\n    quadraticCurveTo(cpX, cpY, toX, toY)\n    {\n        if (this.currentPath)\n        {\n            if (this.currentPath.shape.points.length === 0)\n            {\n                this.currentPath.shape.points = [0, 0];\n            }\n        }\n        else\n        {\n            this.moveTo(0, 0);\n        }\n\n        const n = 20;\n        const points = this.currentPath.shape.points;\n        let xa = 0;\n        let ya = 0;\n\n        if (points.length === 0)\n        {\n            this.moveTo(0, 0);\n        }\n\n        const fromX = points[points.length - 2];\n        const fromY = points[points.length - 1];\n\n        for (let i = 1; i <= n; ++i)\n        {\n            const j = i / n;\n\n            xa = fromX + ((cpX - fromX) * j);\n            ya = fromY + ((cpY - fromY) * j);\n\n            points.push(xa + (((cpX + ((toX - cpX) * j)) - xa) * j),\n                ya + (((cpY + ((toY - cpY) * j)) - ya) * j));\n        }\n\n        this.dirty++;\n\n        return this;\n    }\n\n    /**\n     * Calculate the points for a bezier curve and then draws it.\n     *\n     * @param {number} cpX - Control point x\n     * @param {number} cpY - Control point y\n     * @param {number} cpX2 - Second Control point x\n     * @param {number} cpY2 - Second Control point y\n     * @param {number} toX - Destination point x\n     * @param {number} toY - Destination point y\n     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n     */\n    bezierCurveTo(cpX, cpY, cpX2, cpY2, toX, toY)\n    {\n        if (this.currentPath)\n        {\n            if (this.currentPath.shape.points.length === 0)\n            {\n                this.currentPath.shape.points = [0, 0];\n            }\n        }\n        else\n        {\n            this.moveTo(0, 0);\n        }\n\n        const points = this.currentPath.shape.points;\n\n        const fromX = points[points.length - 2];\n        const fromY = points[points.length - 1];\n\n        points.length -= 2;\n\n        bezierCurveTo(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY, points);\n\n        this.dirty++;\n\n        return this;\n    }\n\n    /**\n     * The arcTo() method creates an arc/curve between two tangents on the canvas.\n     *\n     * \"borrowed\" from https://code.google.com/p/fxcanvas/ - thanks google!\n     *\n     * @param {number} x1 - The x-coordinate of the beginning of the arc\n     * @param {number} y1 - The y-coordinate of the beginning of the arc\n     * @param {number} x2 - The x-coordinate of the end of the arc\n     * @param {number} y2 - The y-coordinate of the end of the arc\n     * @param {number} radius - The radius of the arc\n     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n     */\n    arcTo(x1, y1, x2, y2, radius)\n    {\n        if (this.currentPath)\n        {\n            if (this.currentPath.shape.points.length === 0)\n            {\n                this.currentPath.shape.points.push(x1, y1);\n            }\n        }\n        else\n        {\n            this.moveTo(x1, y1);\n        }\n\n        const points = this.currentPath.shape.points;\n        const fromX = points[points.length - 2];\n        const fromY = points[points.length - 1];\n        const a1 = fromY - y1;\n        const b1 = fromX - x1;\n        const a2 = y2 - y1;\n        const b2 = x2 - x1;\n        const mm = Math.abs((a1 * b2) - (b1 * a2));\n\n        if (mm < 1.0e-8 || radius === 0)\n        {\n            if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1)\n            {\n                points.push(x1, y1);\n            }\n        }\n        else\n        {\n            const dd = (a1 * a1) + (b1 * b1);\n            const cc = (a2 * a2) + (b2 * b2);\n            const tt = (a1 * a2) + (b1 * b2);\n            const k1 = radius * Math.sqrt(dd) / mm;\n            const k2 = radius * Math.sqrt(cc) / mm;\n            const j1 = k1 * tt / dd;\n            const j2 = k2 * tt / cc;\n            const cx = (k1 * b2) + (k2 * b1);\n            const cy = (k1 * a2) + (k2 * a1);\n            const px = b1 * (k2 + j1);\n            const py = a1 * (k2 + j1);\n            const qx = b2 * (k1 + j2);\n            const qy = a2 * (k1 + j2);\n            const startAngle = Math.atan2(py - cy, px - cx);\n            const endAngle = Math.atan2(qy - cy, qx - cx);\n\n            this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1);\n        }\n\n        this.dirty++;\n\n        return this;\n    }\n\n    /**\n     * The arc method creates an arc/curve (used to create circles, or parts of circles).\n     *\n     * @param {number} cx - The x-coordinate of the center of the circle\n     * @param {number} cy - The y-coordinate of the center of the circle\n     * @param {number} radius - The radius of the circle\n     * @param {number} startAngle - The starting angle, in radians (0 is at the 3 o'clock position\n     *  of the arc's circle)\n     * @param {number} endAngle - The ending angle, in radians\n     * @param {boolean} [anticlockwise=false] - Specifies whether the drawing should be\n     *  counter-clockwise or clockwise. False is default, and indicates clockwise, while true\n     *  indicates counter-clockwise.\n     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n     */\n    arc(cx, cy, radius, startAngle, endAngle, anticlockwise = false)\n    {\n        if (startAngle === endAngle)\n        {\n            return this;\n        }\n\n        if (!anticlockwise && endAngle <= startAngle)\n        {\n            endAngle += Math.PI * 2;\n        }\n        else if (anticlockwise && startAngle <= endAngle)\n        {\n            startAngle += Math.PI * 2;\n        }\n\n        const sweep = endAngle - startAngle;\n        const segs = Math.ceil(Math.abs(sweep) / (Math.PI * 2)) * 40;\n\n        if (sweep === 0)\n        {\n            return this;\n        }\n\n        const startX = cx + (Math.cos(startAngle) * radius);\n        const startY = cy + (Math.sin(startAngle) * radius);\n\n        // If the currentPath exists, take its points. Otherwise call `moveTo` to start a path.\n        let points = this.currentPath ? this.currentPath.shape.points : null;\n\n        if (points)\n        {\n            if (points[points.length - 2] !== startX || points[points.length - 1] !== startY)\n            {\n                points.push(startX, startY);\n            }\n        }\n        else\n        {\n            this.moveTo(startX, startY);\n            points = this.currentPath.shape.points;\n        }\n\n        const theta = sweep / (segs * 2);\n        const theta2 = theta * 2;\n\n        const cTheta = Math.cos(theta);\n        const sTheta = Math.sin(theta);\n\n        const segMinus = segs - 1;\n\n        const remainder = (segMinus % 1) / segMinus;\n\n        for (let i = 0; i <= segMinus; ++i)\n        {\n            const real = i + (remainder * i);\n\n            const angle = ((theta) + startAngle + (theta2 * real));\n\n            const c = Math.cos(angle);\n            const s = -Math.sin(angle);\n\n            points.push(\n                (((cTheta * c) + (sTheta * s)) * radius) + cx,\n                (((cTheta * -s) + (sTheta * c)) * radius) + cy\n            );\n        }\n\n        this.dirty++;\n\n        return this;\n    }\n\n    /**\n     * Specifies a simple one-color fill that subsequent calls to other Graphics methods\n     * (such as lineTo() or drawCircle()) use when drawing.\n     *\n     * @param {number} [color=0] - the color of the fill\n     * @param {number} [alpha=1] - the alpha of the fill\n     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n     */\n    beginFill(color = 0, alpha = 1)\n    {\n        this.filling = true;\n        this.fillColor = color;\n        this.fillAlpha = alpha;\n\n        if (this.currentPath)\n        {\n            if (this.currentPath.shape.points.length <= 2)\n            {\n                this.currentPath.fill = this.filling;\n                this.currentPath.fillColor = this.fillColor;\n                this.currentPath.fillAlpha = this.fillAlpha;\n            }\n        }\n\n        return this;\n    }\n\n    /**\n     * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.\n     *\n     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n     */\n    endFill()\n    {\n        this.filling = false;\n        this.fillColor = null;\n        this.fillAlpha = 1;\n\n        return this;\n    }\n\n    /**\n     *\n     * @param {number} x - The X coord of the top-left of the rectangle\n     * @param {number} y - The Y coord of the top-left of the rectangle\n     * @param {number} width - The width of the rectangle\n     * @param {number} height - The height of the rectangle\n     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n     */\n    drawRect(x, y, width, height)\n    {\n        this.drawShape(new Rectangle(x, y, width, height));\n\n        return this;\n    }\n\n    /**\n     *\n     * @param {number} x - The X coord of the top-left of the rectangle\n     * @param {number} y - The Y coord of the top-left of the rectangle\n     * @param {number} width - The width of the rectangle\n     * @param {number} height - The height of the rectangle\n     * @param {number} radius - Radius of the rectangle corners\n     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n     */\n    drawRoundedRect(x, y, width, height, radius)\n    {\n        this.drawShape(new RoundedRectangle(x, y, width, height, radius));\n\n        return this;\n    }\n\n    /**\n     * Draws a circle.\n     *\n     * @param {number} x - The X coordinate of the center of the circle\n     * @param {number} y - The Y coordinate of the center of the circle\n     * @param {number} radius - The radius of the circle\n     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n     */\n    drawCircle(x, y, radius)\n    {\n        this.drawShape(new Circle(x, y, radius));\n\n        return this;\n    }\n\n    /**\n     * Draws an ellipse.\n     *\n     * @param {number} x - The X coordinate of the center of the ellipse\n     * @param {number} y - The Y coordinate of the center of the ellipse\n     * @param {number} width - The half width of the ellipse\n     * @param {number} height - The half height of the ellipse\n     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n     */\n    drawEllipse(x, y, width, height)\n    {\n        this.drawShape(new Ellipse(x, y, width, height));\n\n        return this;\n    }\n\n    /**\n     * Draws a polygon using the given path.\n     *\n     * @param {number[]|PIXI.Point[]} path - The path data used to construct the polygon.\n     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n     */\n    drawPolygon(path)\n    {\n        // prevents an argument assignment deopt\n        // see section 3.1: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments\n        let points = path;\n\n        let closed = true;\n\n        if (points instanceof Polygon)\n        {\n            closed = points.closed;\n            points = points.points;\n        }\n\n        if (!Array.isArray(points))\n        {\n            // prevents an argument leak deopt\n            // see section 3.2: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments\n            points = new Array(arguments.length);\n\n            for (let i = 0; i < points.length; ++i)\n            {\n                points[i] = arguments[i]; // eslint-disable-line prefer-rest-params\n            }\n        }\n\n        const shape = new Polygon(points);\n\n        shape.closed = closed;\n\n        this.drawShape(shape);\n\n        return this;\n    }\n\n    /**\n     * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.\n     *\n     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n     */\n    clear()\n    {\n        if (this.lineWidth || this.filling || this.graphicsData.length > 0)\n        {\n            this.lineWidth = 0;\n            this.filling = false;\n\n            this.boundsDirty = -1;\n            this.dirty++;\n            this.clearDirty++;\n            this.graphicsData.length = 0;\n        }\n\n        return this;\n    }\n\n    /**\n     * True if graphics consists of one rectangle, and thus, can be drawn like a Sprite and\n     * masked with gl.scissor.\n     *\n     * @returns {boolean} True if only 1 rect.\n     */\n    isFastRect()\n    {\n        return this.graphicsData.length === 1\n            && this.graphicsData[0].shape.type === SHAPES.RECT\n            && !this.graphicsData[0].lineWidth;\n    }\n\n    /**\n     * Renders the object using the WebGL renderer\n     *\n     * @private\n     * @param {PIXI.WebGLRenderer} renderer - The renderer\n     */\n    _renderWebGL(renderer)\n    {\n        // if the sprite is not visible or the alpha is 0 then no need to render this element\n        if (this.dirty !== this.fastRectDirty)\n        {\n            this.fastRectDirty = this.dirty;\n            this._fastRect = this.isFastRect();\n        }\n\n        // TODO this check can be moved to dirty?\n        if (this._fastRect)\n        {\n            this._renderSpriteRect(renderer);\n        }\n        else\n        {\n            renderer.setObjectRenderer(renderer.plugins.graphics);\n            renderer.plugins.graphics.render(this);\n        }\n    }\n\n    /**\n     * Renders a sprite rectangle.\n     *\n     * @private\n     * @param {PIXI.WebGLRenderer} renderer - The renderer\n     */\n    _renderSpriteRect(renderer)\n    {\n        const rect = this.graphicsData[0].shape;\n\n        if (!this._spriteRect)\n        {\n            if (!Graphics._SPRITE_TEXTURE)\n            {\n                Graphics._SPRITE_TEXTURE = RenderTexture.create(10, 10);\n\n                const canvas = document.createElement('canvas');\n\n                canvas.width = 10;\n                canvas.height = 10;\n\n                const context = canvas.getContext('2d');\n\n                context.fillStyle = 'white';\n                context.fillRect(0, 0, 10, 10);\n\n                Graphics._SPRITE_TEXTURE = Texture.fromCanvas(canvas);\n            }\n\n            this._spriteRect = new Sprite(Graphics._SPRITE_TEXTURE);\n        }\n        if (this.tint === 0xffffff)\n        {\n            this._spriteRect.tint = this.graphicsData[0].fillColor;\n        }\n        else\n        {\n            const t1 = tempColor1;\n            const t2 = tempColor2;\n\n            hex2rgb(this.graphicsData[0].fillColor, t1);\n            hex2rgb(this.tint, t2);\n\n            t1[0] *= t2[0];\n            t1[1] *= t2[1];\n            t1[2] *= t2[2];\n\n            this._spriteRect.tint = rgb2hex(t1);\n        }\n        this._spriteRect.alpha = this.graphicsData[0].fillAlpha;\n        this._spriteRect.worldAlpha = this.worldAlpha * this._spriteRect.alpha;\n\n        Graphics._SPRITE_TEXTURE._frame.width = rect.width;\n        Graphics._SPRITE_TEXTURE._frame.height = rect.height;\n\n        this._spriteRect.transform.worldTransform = this.transform.worldTransform;\n\n        this._spriteRect.anchor.set(-rect.x / rect.width, -rect.y / rect.height);\n        this._spriteRect._onAnchorUpdate();\n\n        this._spriteRect._renderWebGL(renderer);\n    }\n\n    /**\n     * Renders the object using the Canvas renderer\n     *\n     * @private\n     * @param {PIXI.CanvasRenderer} renderer - The renderer\n     */\n    _renderCanvas(renderer)\n    {\n        if (this.isMask === true)\n        {\n            return;\n        }\n\n        renderer.plugins.graphics.render(this);\n    }\n\n    /**\n     * Retrieves the bounds of the graphic shape as a rectangle object\n     *\n     * @private\n     */\n    _calculateBounds()\n    {\n        if (this.boundsDirty !== this.dirty)\n        {\n            this.boundsDirty = this.dirty;\n            this.updateLocalBounds();\n\n            this.dirty++;\n            this.cachedSpriteDirty = true;\n        }\n\n        const lb = this._localBounds;\n\n        this._bounds.addFrame(this.transform, lb.minX, lb.minY, lb.maxX, lb.maxY);\n    }\n\n    /**\n     * Tests if a point is inside this graphics object\n     *\n     * @param {PIXI.Point} point - the point to test\n     * @return {boolean} the result of the test\n     */\n    containsPoint(point)\n    {\n        this.worldTransform.applyInverse(point, tempPoint);\n\n        const graphicsData = this.graphicsData;\n\n        for (let i = 0; i < graphicsData.length; ++i)\n        {\n            const data = graphicsData[i];\n\n            if (!data.fill)\n            {\n                continue;\n            }\n\n            // only deal with fills..\n            if (data.shape)\n            {\n                if (data.shape.contains(tempPoint.x, tempPoint.y))\n                {\n                    return true;\n                }\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Update the bounds of the object\n     *\n     */\n    updateLocalBounds()\n    {\n        let minX = Infinity;\n        let maxX = -Infinity;\n\n        let minY = Infinity;\n        let maxY = -Infinity;\n\n        if (this.graphicsData.length)\n        {\n            let shape = 0;\n            let x = 0;\n            let y = 0;\n            let w = 0;\n            let h = 0;\n\n            for (let i = 0; i < this.graphicsData.length; i++)\n            {\n                const data = this.graphicsData[i];\n                const type = data.type;\n                const lineWidth = data.lineWidth;\n\n                shape = data.shape;\n\n                if (type === SHAPES.RECT || type === SHAPES.RREC)\n                {\n                    x = shape.x - (lineWidth / 2);\n                    y = shape.y - (lineWidth / 2);\n                    w = shape.width + lineWidth;\n                    h = shape.height + lineWidth;\n\n                    minX = x < minX ? x : minX;\n                    maxX = x + w > maxX ? x + w : maxX;\n\n                    minY = y < minY ? y : minY;\n                    maxY = y + h > maxY ? y + h : maxY;\n                }\n                else if (type === SHAPES.CIRC)\n                {\n                    x = shape.x;\n                    y = shape.y;\n                    w = shape.radius + (lineWidth / 2);\n                    h = shape.radius + (lineWidth / 2);\n\n                    minX = x - w < minX ? x - w : minX;\n                    maxX = x + w > maxX ? x + w : maxX;\n\n                    minY = y - h < minY ? y - h : minY;\n                    maxY = y + h > maxY ? y + h : maxY;\n                }\n                else if (type === SHAPES.ELIP)\n                {\n                    x = shape.x;\n                    y = shape.y;\n                    w = shape.width + (lineWidth / 2);\n                    h = shape.height + (lineWidth / 2);\n\n                    minX = x - w < minX ? x - w : minX;\n                    maxX = x + w > maxX ? x + w : maxX;\n\n                    minY = y - h < minY ? y - h : minY;\n                    maxY = y + h > maxY ? y + h : maxY;\n                }\n                else\n                {\n                    // POLY\n                    const points = shape.points;\n                    let x2 = 0;\n                    let y2 = 0;\n                    let dx = 0;\n                    let dy = 0;\n                    let rw = 0;\n                    let rh = 0;\n                    let cx = 0;\n                    let cy = 0;\n\n                    for (let j = 0; j + 2 < points.length; j += 2)\n                    {\n                        x = points[j];\n                        y = points[j + 1];\n                        x2 = points[j + 2];\n                        y2 = points[j + 3];\n                        dx = Math.abs(x2 - x);\n                        dy = Math.abs(y2 - y);\n                        h = lineWidth;\n                        w = Math.sqrt((dx * dx) + (dy * dy));\n\n                        if (w < 1e-9)\n                        {\n                            continue;\n                        }\n\n                        rw = ((h / w * dy) + dx) / 2;\n                        rh = ((h / w * dx) + dy) / 2;\n                        cx = (x2 + x) / 2;\n                        cy = (y2 + y) / 2;\n\n                        minX = cx - rw < minX ? cx - rw : minX;\n                        maxX = cx + rw > maxX ? cx + rw : maxX;\n\n                        minY = cy - rh < minY ? cy - rh : minY;\n                        maxY = cy + rh > maxY ? cy + rh : maxY;\n                    }\n                }\n            }\n        }\n        else\n        {\n            minX = 0;\n            maxX = 0;\n            minY = 0;\n            maxY = 0;\n        }\n\n        const padding = this.boundsPadding;\n\n        this._localBounds.minX = minX - padding;\n        this._localBounds.maxX = maxX + (padding * 2);\n\n        this._localBounds.minY = minY - padding;\n        this._localBounds.maxY = maxY + (padding * 2);\n    }\n\n    /**\n     * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n     *\n     * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n     * @return {PIXI.GraphicsData} The generated GraphicsData object.\n     */\n    drawShape(shape)\n    {\n        if (this.currentPath)\n        {\n            // check current path!\n            if (this.currentPath.shape.points.length <= 2)\n            {\n                this.graphicsData.pop();\n            }\n        }\n\n        this.currentPath = null;\n\n        const data = new GraphicsData(\n            this.lineWidth,\n            this.lineColor,\n            this.lineAlpha,\n            this.fillColor,\n            this.fillAlpha,\n            this.filling,\n            shape\n        );\n\n        this.graphicsData.push(data);\n\n        if (data.type === SHAPES.POLY)\n        {\n            data.shape.closed = data.shape.closed || this.filling;\n            this.currentPath = data;\n        }\n\n        this.dirty++;\n\n        return data;\n    }\n\n    /**\n     * Generates a canvas texture.\n     *\n     * @param {number} scaleMode - The scale mode of the texture.\n     * @param {number} resolution - The resolution of the texture.\n     * @return {PIXI.Texture} The new texture.\n     */\n    generateCanvasTexture(scaleMode, resolution = 1)\n    {\n        const bounds = this.getLocalBounds();\n\n        const canvasBuffer = RenderTexture.create(bounds.width, bounds.height, scaleMode, resolution);\n\n        if (!canvasRenderer)\n        {\n            canvasRenderer = new CanvasRenderer();\n        }\n\n        tempMatrix.tx = -bounds.x;\n        tempMatrix.ty = -bounds.y;\n\n        canvasRenderer.render(this, canvasBuffer, false, tempMatrix);\n\n        const texture = Texture.fromCanvas(canvasBuffer.baseTexture._canvasRenderTarget.canvas, scaleMode);\n\n        texture.baseTexture.resolution = resolution;\n        texture.baseTexture.update();\n\n        return texture;\n    }\n\n    /**\n     * Closes the current path.\n     *\n     * @return {PIXI.Graphics} Returns itself.\n     */\n    closePath()\n    {\n        // ok so close path assumes next one is a hole!\n        const currentPath = this.currentPath;\n\n        if (currentPath && currentPath.shape)\n        {\n            currentPath.shape.close();\n        }\n\n        return this;\n    }\n\n    /**\n     * Adds a hole in the current path.\n     *\n     * @return {PIXI.Graphics} Returns itself.\n     */\n    addHole()\n    {\n        // this is a hole!\n        const hole = this.graphicsData.pop();\n\n        this.currentPath = this.graphicsData[this.graphicsData.length - 1];\n\n        this.currentPath.addHole(hole.shape);\n        this.currentPath = null;\n\n        return this;\n    }\n\n    /**\n     * Destroys the Graphics object.\n     *\n     * @param {object|boolean} [options] - Options parameter. A boolean will act as if all\n     *  options have been set to that value\n     * @param {boolean} [options.children=false] - if set to true, all the children will have\n     *  their destroy method called as well. 'options' will be passed on to those calls.\n     */\n    destroy(options)\n    {\n        super.destroy(options);\n\n        // destroy each of the GraphicsData objects\n        for (let i = 0; i < this.graphicsData.length; ++i)\n        {\n            this.graphicsData[i].destroy();\n        }\n\n        // for each webgl data entry, destroy the WebGLGraphicsData\n        for (const id in this._webgl)\n        {\n            for (let j = 0; j < this._webgl[id].data.length; ++j)\n            {\n                this._webgl[id].data[j].destroy();\n            }\n        }\n\n        if (this._spriteRect)\n        {\n            this._spriteRect.destroy();\n        }\n\n        this.graphicsData = null;\n\n        this.currentPath = null;\n        this._webgl = null;\n        this._localBounds = null;\n    }\n\n}\n\nGraphics._SPRITE_TEXTURE = null;\n","/**\n * A GraphicsData object.\n *\n * @class\n * @memberof PIXI\n */\nexport default class GraphicsData\n{\n    /**\n     *\n     * @param {number} lineWidth - the width of the line to draw\n     * @param {number} lineColor - the color of the line to draw\n     * @param {number} lineAlpha - the alpha of the line to draw\n     * @param {number} fillColor - the color of the fill\n     * @param {number} fillAlpha - the alpha of the fill\n     * @param {boolean} fill - whether or not the shape is filled with a colour\n     * @param {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Polygon} shape - The shape object to draw.\n     */\n    constructor(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape)\n    {\n        /**\n         * @member {number} the width of the line to draw\n         */\n        this.lineWidth = lineWidth;\n\n        /**\n         * @member {number} the color of the line to draw\n         */\n        this.lineColor = lineColor;\n\n        /**\n         * @member {number} the alpha of the line to draw\n         */\n        this.lineAlpha = lineAlpha;\n\n        /**\n         * @member {number} cached tint of the line to draw\n         */\n        this._lineTint = lineColor;\n\n        /**\n         * @member {number} the color of the fill\n         */\n        this.fillColor = fillColor;\n\n        /**\n         * @member {number} the alpha of the fill\n         */\n        this.fillAlpha = fillAlpha;\n\n        /**\n         * @member {number} cached tint of the fill\n         */\n        this._fillTint = fillColor;\n\n        /**\n         * @member {boolean} whether or not the shape is filled with a colour\n         */\n        this.fill = fill;\n\n        this.holes = [];\n\n        /**\n         * @member {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} The shape object to draw.\n         */\n        this.shape = shape;\n\n        /**\n         * @member {number} The type of the shape, see the Const.Shapes file for all the existing types,\n         */\n        this.type = shape.type;\n    }\n\n    /**\n     * Creates a new GraphicsData object with the same values as this one.\n     *\n     * @return {PIXI.GraphicsData} Cloned GraphicsData object\n     */\n    clone()\n    {\n        return new GraphicsData(\n            this.lineWidth,\n            this.lineColor,\n            this.lineAlpha,\n            this.fillColor,\n            this.fillAlpha,\n            this.fill,\n            this.shape\n        );\n    }\n\n    /**\n     * Adds a hole to the shape.\n     *\n     * @param {PIXI.Rectangle|PIXI.Circle} shape - The shape of the hole.\n     */\n    addHole(shape)\n    {\n        this.holes.push(shape);\n    }\n\n    /**\n     * Destroys the Graphics data.\n     */\n    destroy()\n    {\n        this.shape = null;\n        this.holes = null;\n    }\n}\n","import CanvasRenderer from '../../renderers/canvas/CanvasRenderer';\nimport { SHAPES } from '../../const';\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers  https://github.com/mattdesl/\n * for creating the original pixi version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they\n * now share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's CanvasGraphicsRenderer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/CanvasGraphicsRenderer.java\n */\n\n/**\n * Renderer dedicated to drawing and batching graphics objects.\n *\n * @class\n * @private\n * @memberof PIXI\n */\nexport default class CanvasGraphicsRenderer\n{\n    /**\n     * @param {PIXI.CanvasRenderer} renderer - The current PIXI renderer.\n     */\n    constructor(renderer)\n    {\n        this.renderer = renderer;\n    }\n\n    /**\n     * Renders a Graphics object to a canvas.\n     *\n     * @param {PIXI.Graphics} graphics - the actual graphics object to render\n     */\n    render(graphics)\n    {\n        const renderer = this.renderer;\n        const context = renderer.context;\n        const worldAlpha = graphics.worldAlpha;\n        const transform = graphics.transform.worldTransform;\n        const resolution = renderer.resolution;\n\n         // if the tint has changed, set the graphics object to dirty.\n        if (this._prevTint !== this.tint)\n        {\n            this.dirty = true;\n        }\n\n        context.setTransform(\n            transform.a * resolution,\n            transform.b * resolution,\n            transform.c * resolution,\n            transform.d * resolution,\n            transform.tx * resolution,\n            transform.ty * resolution\n        );\n\n        if (graphics.dirty)\n        {\n            this.updateGraphicsTint(graphics);\n            graphics.dirty = false;\n        }\n\n        renderer.setBlendMode(graphics.blendMode);\n\n        for (let i = 0; i < graphics.graphicsData.length; i++)\n        {\n            const data = graphics.graphicsData[i];\n            const shape = data.shape;\n\n            const fillColor = data._fillTint;\n            const lineColor = data._lineTint;\n\n            context.lineWidth = data.lineWidth;\n\n            if (data.type === SHAPES.POLY)\n            {\n                context.beginPath();\n\n                this.renderPolygon(shape.points, shape.closed, context);\n\n                for (let j = 0; j < data.holes.length; j++)\n                {\n                    this.renderPolygon(data.holes[j].points, true, context);\n                }\n\n                if (data.fill)\n                {\n                    context.globalAlpha = data.fillAlpha * worldAlpha;\n                    context.fillStyle = `#${(`00000${(fillColor | 0).toString(16)}`).substr(-6)}`;\n                    context.fill();\n                }\n                if (data.lineWidth)\n                {\n                    context.globalAlpha = data.lineAlpha * worldAlpha;\n                    context.strokeStyle = `#${(`00000${(lineColor | 0).toString(16)}`).substr(-6)}`;\n                    context.stroke();\n                }\n            }\n            else if (data.type === SHAPES.RECT)\n            {\n                if (data.fillColor || data.fillColor === 0)\n                {\n                    context.globalAlpha = data.fillAlpha * worldAlpha;\n                    context.fillStyle = `#${(`00000${(fillColor | 0).toString(16)}`).substr(-6)}`;\n                    context.fillRect(shape.x, shape.y, shape.width, shape.height);\n                }\n                if (data.lineWidth)\n                {\n                    context.globalAlpha = data.lineAlpha * worldAlpha;\n                    context.strokeStyle = `#${(`00000${(lineColor | 0).toString(16)}`).substr(-6)}`;\n                    context.strokeRect(shape.x, shape.y, shape.width, shape.height);\n                }\n            }\n            else if (data.type === SHAPES.CIRC)\n            {\n                // TODO - need to be Undefined!\n                context.beginPath();\n                context.arc(shape.x, shape.y, shape.radius, 0, 2 * Math.PI);\n                context.closePath();\n\n                if (data.fill)\n                {\n                    context.globalAlpha = data.fillAlpha * worldAlpha;\n                    context.fillStyle = `#${(`00000${(fillColor | 0).toString(16)}`).substr(-6)}`;\n                    context.fill();\n                }\n                if (data.lineWidth)\n                {\n                    context.globalAlpha = data.lineAlpha * worldAlpha;\n                    context.strokeStyle = `#${(`00000${(lineColor | 0).toString(16)}`).substr(-6)}`;\n                    context.stroke();\n                }\n            }\n            else if (data.type === SHAPES.ELIP)\n            {\n                // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n\n                const w = shape.width * 2;\n                const h = shape.height * 2;\n\n                const x = shape.x - (w / 2);\n                const y = shape.y - (h / 2);\n\n                context.beginPath();\n\n                const kappa = 0.5522848;\n                const ox = (w / 2) * kappa; // control point offset horizontal\n                const oy = (h / 2) * kappa; // control point offset vertical\n                const xe = x + w;           // x-end\n                const ye = y + h;           // y-end\n                const xm = x + (w / 2);       // x-middle\n                const ym = y + (h / 2);       // y-middle\n\n                context.moveTo(x, ym);\n                context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n                context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n                context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n                context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n\n                context.closePath();\n\n                if (data.fill)\n                {\n                    context.globalAlpha = data.fillAlpha * worldAlpha;\n                    context.fillStyle = `#${(`00000${(fillColor | 0).toString(16)}`).substr(-6)}`;\n                    context.fill();\n                }\n                if (data.lineWidth)\n                {\n                    context.globalAlpha = data.lineAlpha * worldAlpha;\n                    context.strokeStyle = `#${(`00000${(lineColor | 0).toString(16)}`).substr(-6)}`;\n                    context.stroke();\n                }\n            }\n            else if (data.type === SHAPES.RREC)\n            {\n                const rx = shape.x;\n                const ry = shape.y;\n                const width = shape.width;\n                const height = shape.height;\n                let radius = shape.radius;\n\n                const maxRadius = Math.min(width, height) / 2 | 0;\n\n                radius = radius > maxRadius ? maxRadius : radius;\n\n                context.beginPath();\n                context.moveTo(rx, ry + radius);\n                context.lineTo(rx, ry + height - radius);\n                context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);\n                context.lineTo(rx + width - radius, ry + height);\n                context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);\n                context.lineTo(rx + width, ry + radius);\n                context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);\n                context.lineTo(rx + radius, ry);\n                context.quadraticCurveTo(rx, ry, rx, ry + radius);\n                context.closePath();\n\n                if (data.fillColor || data.fillColor === 0)\n                {\n                    context.globalAlpha = data.fillAlpha * worldAlpha;\n                    context.fillStyle = `#${(`00000${(fillColor | 0).toString(16)}`).substr(-6)}`;\n                    context.fill();\n                }\n\n                if (data.lineWidth)\n                {\n                    context.globalAlpha = data.lineAlpha * worldAlpha;\n                    context.strokeStyle = `#${(`00000${(lineColor | 0).toString(16)}`).substr(-6)}`;\n                    context.stroke();\n                }\n            }\n        }\n    }\n\n    /**\n     * Updates the tint of a graphics object\n     *\n     * @private\n     * @param {PIXI.Graphics} graphics - the graphics that will have its tint updated\n     */\n    updateGraphicsTint(graphics)\n    {\n        graphics._prevTint = graphics.tint;\n\n        const tintR = ((graphics.tint >> 16) & 0xFF) / 255;\n        const tintG = ((graphics.tint >> 8) & 0xFF) / 255;\n        const tintB = (graphics.tint & 0xFF) / 255;\n\n        for (let i = 0; i < graphics.graphicsData.length; ++i)\n        {\n            const data = graphics.graphicsData[i];\n\n            const fillColor = data.fillColor | 0;\n            const lineColor = data.lineColor | 0;\n\n            // super inline cos im an optimization NAZI :)\n            data._fillTint = (\n                (((fillColor >> 16) & 0xFF) / 255 * tintR * 255 << 16)\n                + (((fillColor >> 8) & 0xFF) / 255 * tintG * 255 << 8)\n                + (((fillColor & 0xFF) / 255) * tintB * 255)\n            );\n\n            data._lineTint = (\n                (((lineColor >> 16) & 0xFF) / 255 * tintR * 255 << 16)\n                + (((lineColor >> 8) & 0xFF) / 255 * tintG * 255 << 8)\n                + (((lineColor & 0xFF) / 255) * tintB * 255)\n            );\n        }\n    }\n\n    /**\n     * Renders a polygon.\n     *\n     * @param {PIXI.Point[]} points - The points to render\n     * @param {boolean} close - Should the polygon be closed\n     * @param {CanvasRenderingContext2D} context - The rendering context to use\n     */\n    renderPolygon(points, close, context)\n    {\n        context.moveTo(points[0], points[1]);\n\n        for (let j = 1; j < points.length / 2; ++j)\n        {\n            context.lineTo(points[j * 2], points[(j * 2) + 1]);\n        }\n\n        if (close)\n        {\n            context.closePath();\n        }\n    }\n\n    /**\n     * destroy graphics object\n     *\n     */\n    destroy()\n    {\n        this.renderer = null;\n    }\n}\n\nCanvasRenderer.registerPlugin('graphics', CanvasGraphicsRenderer);\n","/**\n * Calculate the points for a bezier curve and then draws it.\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @param {number} fromX - Starting point x\n * @param {number} fromY - Starting point y\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} cpX2 - Second Control point x\n * @param {number} cpY2 - Second Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} [path=[]] - Path array to push points into\n * @return {number[]} Array of points of the curve\n */\nexport default function bezierCurveTo(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY, path = [])\n{\n    const n = 20;\n    let dt = 0;\n    let dt2 = 0;\n    let dt3 = 0;\n    let t2 = 0;\n    let t3 = 0;\n\n    path.push(fromX, fromY);\n\n    for (let i = 1, j = 0; i <= n; ++i)\n    {\n        j = i / n;\n\n        dt = (1 - j);\n        dt2 = dt * dt;\n        dt3 = dt2 * dt;\n\n        t2 = j * j;\n        t3 = t2 * j;\n\n        path.push(\n            (dt3 * fromX) + (3 * dt2 * j * cpX) + (3 * dt * t2 * cpX2) + (t3 * toX),\n            (dt3 * fromY) + (3 * dt2 * j * cpY) + (3 * dt * t2 * cpY2) + (t3 * toY)\n        );\n    }\n\n    return path;\n}\n","import { hex2rgb } from '../../utils';\nimport { SHAPES } from '../../const';\nimport ObjectRenderer from '../../renderers/webgl/utils/ObjectRenderer';\nimport WebGLRenderer from '../../renderers/webgl/WebGLRenderer';\nimport WebGLGraphicsData from './WebGLGraphicsData';\nimport PrimitiveShader from './shaders/PrimitiveShader';\n\nimport buildPoly from './utils/buildPoly';\nimport buildRectangle from './utils/buildRectangle';\nimport buildRoundedRectangle from './utils/buildRoundedRectangle';\nimport buildCircle from './utils/buildCircle';\n\n/**\n * Renders the graphics object.\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\nexport default class GraphicsRenderer extends ObjectRenderer\n{\n    /**\n     * @param {PIXI.WebGLRenderer} renderer - The renderer this object renderer works for.\n     */\n    constructor(renderer)\n    {\n        super(renderer);\n\n        this.graphicsDataPool = [];\n\n        this.primitiveShader = null;\n\n        this.gl = renderer.gl;\n\n        // easy access!\n        this.CONTEXT_UID = 0;\n    }\n\n    /**\n     * Called when there is a WebGL context change\n     *\n     * @private\n     *\n     */\n    onContextChange()\n    {\n        this.gl = this.renderer.gl;\n        this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n        this.primitiveShader = new PrimitiveShader(this.gl);\n    }\n\n    /**\n     * Destroys this renderer.\n     *\n     */\n    destroy()\n    {\n        ObjectRenderer.prototype.destroy.call(this);\n\n        for (let i = 0; i < this.graphicsDataPool.length; ++i)\n        {\n            this.graphicsDataPool[i].destroy();\n        }\n\n        this.graphicsDataPool = null;\n    }\n\n    /**\n     * Renders a graphics object.\n     *\n     * @param {PIXI.Graphics} graphics - The graphics object to render.\n     */\n    render(graphics)\n    {\n        const renderer = this.renderer;\n        const gl = renderer.gl;\n\n        let webGLData;\n        let webGL = graphics._webGL[this.CONTEXT_UID];\n\n        if (!webGL || graphics.dirty !== webGL.dirty)\n        {\n            this.updateGraphics(graphics);\n\n            webGL = graphics._webGL[this.CONTEXT_UID];\n        }\n\n        // This  could be speeded up for sure!\n        const shader = this.primitiveShader;\n\n        renderer.bindShader(shader);\n        renderer.state.setBlendMode(graphics.blendMode);\n\n        for (let i = 0, n = webGL.data.length; i < n; i++)\n        {\n            webGLData = webGL.data[i];\n            const shaderTemp = webGLData.shader;\n\n            renderer.bindShader(shaderTemp);\n            shaderTemp.uniforms.translationMatrix = graphics.transform.worldTransform.toArray(true);\n            shaderTemp.uniforms.tint = hex2rgb(graphics.tint);\n            shaderTemp.uniforms.alpha = graphics.worldAlpha;\n\n            renderer.bindVao(webGLData.vao);\n            webGLData.vao.draw(gl.TRIANGLE_STRIP, webGLData.indices.length);\n        }\n    }\n\n    /**\n     * Updates the graphics object\n     *\n     * @private\n     * @param {PIXI.Graphics} graphics - The graphics object to update\n     */\n    updateGraphics(graphics)\n    {\n        const gl = this.renderer.gl;\n\n         // get the contexts graphics object\n        let webGL = graphics._webGL[this.CONTEXT_UID];\n\n        // if the graphics object does not exist in the webGL context time to create it!\n        if (!webGL)\n        {\n            webGL = graphics._webGL[this.CONTEXT_UID] = { lastIndex: 0, data: [], gl, clearDirty: -1, dirty: -1 };\n        }\n\n        // flag the graphics as not dirty as we are about to update it...\n        webGL.dirty = graphics.dirty;\n\n        // if the user cleared the graphics object we will need to clear every object\n        if (graphics.clearDirty !== webGL.clearDirty)\n        {\n            webGL.clearDirty = graphics.clearDirty;\n\n            // loop through and return all the webGLDatas to the object pool so than can be reused later on\n            for (let i = 0; i < webGL.data.length; i++)\n            {\n                this.graphicsDataPool.push(webGL.data[i]);\n            }\n\n            // clear the array and reset the index..\n            webGL.data.length = 0;\n            webGL.lastIndex = 0;\n        }\n\n        let webGLData;\n\n        // loop through the graphics datas and construct each one..\n        // if the object is a complex fill then the new stencil buffer technique will be used\n        // other wise graphics objects will be pushed into a batch..\n        for (let i = webGL.lastIndex; i < graphics.graphicsData.length; i++)\n        {\n            const data = graphics.graphicsData[i];\n\n            // TODO - this can be simplified\n            webGLData = this.getWebGLData(webGL, 0);\n\n            if (data.type === SHAPES.POLY)\n            {\n                buildPoly(data, webGLData);\n            }\n            if (data.type === SHAPES.RECT)\n            {\n                buildRectangle(data, webGLData);\n            }\n            else if (data.type === SHAPES.CIRC || data.type === SHAPES.ELIP)\n            {\n                buildCircle(data, webGLData);\n            }\n            else if (data.type === SHAPES.RREC)\n            {\n                buildRoundedRectangle(data, webGLData);\n            }\n\n            webGL.lastIndex++;\n        }\n\n        this.renderer.bindVao(null);\n\n        // upload all the dirty data...\n        for (let i = 0; i < webGL.data.length; i++)\n        {\n            webGLData = webGL.data[i];\n\n            if (webGLData.dirty)\n            {\n                webGLData.upload();\n            }\n        }\n    }\n\n    /**\n     *\n     * @private\n     * @param {WebGLRenderingContext} gl - the current WebGL drawing context\n     * @param {number} type - TODO @Alvin\n     * @return {*} TODO\n     */\n    getWebGLData(gl, type)\n    {\n        let webGLData = gl.data[gl.data.length - 1];\n\n        if (!webGLData || webGLData.points.length > 320000)\n        {\n            webGLData = this.graphicsDataPool.pop()\n                || new WebGLGraphicsData(this.renderer.gl, this.primitiveShader, this.renderer.state.attribsState);\n\n            webGLData.reset(type);\n            gl.data.push(webGLData);\n        }\n\n        webGLData.dirty = true;\n\n        return webGLData;\n    }\n}\n\nWebGLRenderer.registerPlugin('graphics', GraphicsRenderer);\n","import glCore from 'pixi-gl-core';\n\n/**\n * An object containing WebGL specific properties to be used by the WebGL renderer\n *\n * @class\n * @private\n * @memberof PIXI\n */\nexport default class WebGLGraphicsData\n{\n    /**\n     * @param {WebGLRenderingContext} gl - The current WebGL drawing context\n     * @param {PIXI.Shader} shader - The shader\n     * @param {object} attribsState - The state for the VAO\n     */\n    constructor(gl, shader, attribsState)\n    {\n        /**\n         * The current WebGL drawing context\n         *\n         * @member {WebGLRenderingContext}\n         */\n        this.gl = gl;\n\n        // TODO does this need to be split before uploading??\n        /**\n         * An array of color components (r,g,b)\n         * @member {number[]}\n         */\n        this.color = [0, 0, 0]; // color split!\n\n        /**\n         * An array of points to draw\n         * @member {PIXI.Point[]}\n         */\n        this.points = [];\n\n        /**\n         * The indices of the vertices\n         * @member {number[]}\n         */\n        this.indices = [];\n        /**\n         * The main buffer\n         * @member {WebGLBuffer}\n         */\n        this.buffer = glCore.GLBuffer.createVertexBuffer(gl);\n\n        /**\n         * The index buffer\n         * @member {WebGLBuffer}\n         */\n        this.indexBuffer = glCore.GLBuffer.createIndexBuffer(gl);\n\n        /**\n         * Whether this graphics is dirty or not\n         * @member {boolean}\n         */\n        this.dirty = true;\n\n        this.glPoints = null;\n        this.glIndices = null;\n\n        /**\n         *\n         * @member {PIXI.Shader}\n         */\n        this.shader = shader;\n\n        this.vao = new glCore.VertexArrayObject(gl, attribsState)\n        .addIndex(this.indexBuffer)\n        .addAttribute(this.buffer, shader.attributes.aVertexPosition, gl.FLOAT, false, 4 * 6, 0)\n        .addAttribute(this.buffer, shader.attributes.aColor, gl.FLOAT, false, 4 * 6, 2 * 4);\n    }\n\n    /**\n     * Resets the vertices and the indices\n     */\n    reset()\n    {\n        this.points.length = 0;\n        this.indices.length = 0;\n    }\n\n    /**\n     * Binds the buffers and uploads the data\n     */\n    upload()\n    {\n        this.glPoints = new Float32Array(this.points);\n        this.buffer.upload(this.glPoints);\n\n        this.glIndices = new Uint16Array(this.indices);\n        this.indexBuffer.upload(this.glIndices);\n\n        this.dirty = false;\n    }\n\n    /**\n     * Empties all the data\n     */\n    destroy()\n    {\n        this.color = null;\n        this.points = null;\n        this.indices = null;\n\n        this.vao.destroy();\n        this.buffer.destroy();\n        this.indexBuffer.destroy();\n\n        this.gl = null;\n\n        this.buffer = null;\n        this.indexBuffer = null;\n\n        this.glPoints = null;\n        this.glIndices = null;\n    }\n}\n","import Shader from '../../../Shader';\n\n/**\n * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}.\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.Shader\n */\nexport default class PrimitiveShader extends Shader\n{\n    /**\n     * @param {WebGLRenderingContext} gl - The webgl shader manager this shader works for.\n     */\n    constructor(gl)\n    {\n        super(gl,\n            // vertex shader\n            [\n                'attribute vec2 aVertexPosition;',\n                'attribute vec4 aColor;',\n\n                'uniform mat3 translationMatrix;',\n                'uniform mat3 projectionMatrix;',\n\n                'uniform float alpha;',\n                'uniform vec3 tint;',\n\n                'varying vec4 vColor;',\n\n                'void main(void){',\n                '   gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);',\n                '   vColor = aColor * vec4(tint * alpha, alpha);',\n                '}',\n            ].join('\\n'),\n            // fragment shader\n            [\n                'varying vec4 vColor;',\n\n                'void main(void){',\n                '   gl_FragColor = vColor;',\n                '}',\n            ].join('\\n')\n        );\n    }\n}\n","import buildLine from './buildLine';\nimport { SHAPES } from '../../../const';\nimport { hex2rgb } from '../../../utils';\n\n/**\n * Builds a circle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object to draw\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n */\nexport default function buildCircle(graphicsData, webGLData)\n{\n    // need to convert points to a nice regular data\n    const circleData = graphicsData.shape;\n    const x = circleData.x;\n    const y = circleData.y;\n    let width;\n    let height;\n\n    // TODO - bit hacky??\n    if (graphicsData.type === SHAPES.CIRC)\n    {\n        width = circleData.radius;\n        height = circleData.radius;\n    }\n    else\n    {\n        width = circleData.width;\n        height = circleData.height;\n    }\n\n    const totalSegs = Math.floor(30 * Math.sqrt(circleData.radius))\n        || Math.floor(15 * Math.sqrt(circleData.width + circleData.height));\n\n    const seg = (Math.PI * 2) / totalSegs;\n\n    if (graphicsData.fill)\n    {\n        const color = hex2rgb(graphicsData.fillColor);\n        const alpha = graphicsData.fillAlpha;\n\n        const r = color[0] * alpha;\n        const g = color[1] * alpha;\n        const b = color[2] * alpha;\n\n        const verts = webGLData.points;\n        const indices = webGLData.indices;\n\n        let vecPos = verts.length / 6;\n\n        indices.push(vecPos);\n\n        for (let i = 0; i < totalSegs + 1; i++)\n        {\n            verts.push(x, y, r, g, b, alpha);\n\n            verts.push(\n                x + (Math.sin(seg * i) * width),\n                y + (Math.cos(seg * i) * height),\n                r, g, b, alpha\n            );\n\n            indices.push(vecPos++, vecPos++);\n        }\n\n        indices.push(vecPos - 1);\n    }\n\n    if (graphicsData.lineWidth)\n    {\n        const tempPoints = graphicsData.points;\n\n        graphicsData.points = [];\n\n        for (let i = 0; i < totalSegs + 1; i++)\n        {\n            graphicsData.points.push(\n                x + (Math.sin(seg * i) * width),\n                y + (Math.cos(seg * i) * height)\n            );\n        }\n\n        buildLine(graphicsData, webGLData);\n\n        graphicsData.points = tempPoints;\n    }\n}\n","import { Point } from '../../../math';\nimport { hex2rgb } from '../../../utils';\n\n/**\n * Builds a line to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n */\nexport default function buildLine(graphicsData, webGLData)\n{\n    // TODO OPTIMISE!\n    let points = graphicsData.points;\n\n    if (points.length === 0)\n    {\n        return;\n    }\n    // if the line width is an odd number add 0.5 to align to a whole pixel\n    // commenting this out fixes #711 and #1620\n    // if (graphicsData.lineWidth%2)\n    // {\n    //     for (i = 0; i < points.length; i++)\n    //     {\n    //         points[i] += 0.5;\n    //     }\n    // }\n\n    // get first and last point.. figure out the middle!\n    const firstPoint = new Point(points[0], points[1]);\n    let lastPoint = new Point(points[points.length - 2], points[points.length - 1]);\n\n    // if the first point is the last point - gonna have issues :)\n    if (firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y)\n    {\n        // need to clone as we are going to slightly modify the shape..\n        points = points.slice();\n\n        points.pop();\n        points.pop();\n\n        lastPoint = new Point(points[points.length - 2], points[points.length - 1]);\n\n        const midPointX = lastPoint.x + ((firstPoint.x - lastPoint.x) * 0.5);\n        const midPointY = lastPoint.y + ((firstPoint.y - lastPoint.y) * 0.5);\n\n        points.unshift(midPointX, midPointY);\n        points.push(midPointX, midPointY);\n    }\n\n    const verts = webGLData.points;\n    const indices = webGLData.indices;\n    const length = points.length / 2;\n    let indexCount = points.length;\n    let indexStart = verts.length / 6;\n\n    // DRAW the Line\n    const width = graphicsData.lineWidth / 2;\n\n    // sort color\n    const color = hex2rgb(graphicsData.lineColor);\n    const alpha = graphicsData.lineAlpha;\n    const r = color[0] * alpha;\n    const g = color[1] * alpha;\n    const b = color[2] * alpha;\n\n    let p1x = points[0];\n    let p1y = points[1];\n    let p2x = points[2];\n    let p2y = points[3];\n    let p3x = 0;\n    let p3y = 0;\n\n    let perpx = -(p1y - p2y);\n    let perpy = p1x - p2x;\n    let perp2x = 0;\n    let perp2y = 0;\n    let perp3x = 0;\n    let perp3y = 0;\n\n    let dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n\n    perpx /= dist;\n    perpy /= dist;\n    perpx *= width;\n    perpy *= width;\n\n    // start\n    verts.push(\n        p1x - perpx,\n        p1y - perpy,\n        r, g, b, alpha\n    );\n\n    verts.push(\n        p1x + perpx,\n        p1y + perpy,\n        r, g, b, alpha\n    );\n\n    for (let i = 1; i < length - 1; ++i)\n    {\n        p1x = points[(i - 1) * 2];\n        p1y = points[((i - 1) * 2) + 1];\n\n        p2x = points[i * 2];\n        p2y = points[(i * 2) + 1];\n\n        p3x = points[(i + 1) * 2];\n        p3y = points[((i + 1) * 2) + 1];\n\n        perpx = -(p1y - p2y);\n        perpy = p1x - p2x;\n\n        dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n        perpx /= dist;\n        perpy /= dist;\n        perpx *= width;\n        perpy *= width;\n\n        perp2x = -(p2y - p3y);\n        perp2y = p2x - p3x;\n\n        dist = Math.sqrt((perp2x * perp2x) + (perp2y * perp2y));\n        perp2x /= dist;\n        perp2y /= dist;\n        perp2x *= width;\n        perp2y *= width;\n\n        const a1 = (-perpy + p1y) - (-perpy + p2y);\n        const b1 = (-perpx + p2x) - (-perpx + p1x);\n        const c1 = ((-perpx + p1x) * (-perpy + p2y)) - ((-perpx + p2x) * (-perpy + p1y));\n        const a2 = (-perp2y + p3y) - (-perp2y + p2y);\n        const b2 = (-perp2x + p2x) - (-perp2x + p3x);\n        const c2 = ((-perp2x + p3x) * (-perp2y + p2y)) - ((-perp2x + p2x) * (-perp2y + p3y));\n\n        let denom = (a1 * b2) - (a2 * b1);\n\n        if (Math.abs(denom) < 0.1)\n        {\n            denom += 10.1;\n            verts.push(\n                p2x - perpx,\n                p2y - perpy,\n                r, g, b, alpha\n            );\n\n            verts.push(\n                p2x + perpx,\n                p2y + perpy,\n                r, g, b, alpha\n            );\n\n            continue;\n        }\n\n        const px = ((b1 * c2) - (b2 * c1)) / denom;\n        const py = ((a2 * c1) - (a1 * c2)) / denom;\n        const pdist = ((px - p2x) * (px - p2x)) + ((py - p2y) * (py - p2y));\n\n        if (pdist > (196 * width * width))\n        {\n            perp3x = perpx - perp2x;\n            perp3y = perpy - perp2y;\n\n            dist = Math.sqrt((perp3x * perp3x) + (perp3y * perp3y));\n            perp3x /= dist;\n            perp3y /= dist;\n            perp3x *= width;\n            perp3y *= width;\n\n            verts.push(p2x - perp3x, p2y - perp3y);\n            verts.push(r, g, b, alpha);\n\n            verts.push(p2x + perp3x, p2y + perp3y);\n            verts.push(r, g, b, alpha);\n\n            verts.push(p2x - perp3x, p2y - perp3y);\n            verts.push(r, g, b, alpha);\n\n            indexCount++;\n        }\n        else\n        {\n            verts.push(px, py);\n            verts.push(r, g, b, alpha);\n\n            verts.push(p2x - (px - p2x), p2y - (py - p2y));\n            verts.push(r, g, b, alpha);\n        }\n    }\n\n    p1x = points[(length - 2) * 2];\n    p1y = points[((length - 2) * 2) + 1];\n\n    p2x = points[(length - 1) * 2];\n    p2y = points[((length - 1) * 2) + 1];\n\n    perpx = -(p1y - p2y);\n    perpy = p1x - p2x;\n\n    dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n    perpx /= dist;\n    perpy /= dist;\n    perpx *= width;\n    perpy *= width;\n\n    verts.push(p2x - perpx, p2y - perpy);\n    verts.push(r, g, b, alpha);\n\n    verts.push(p2x + perpx, p2y + perpy);\n    verts.push(r, g, b, alpha);\n\n    indices.push(indexStart);\n\n    for (let i = 0; i < indexCount; ++i)\n    {\n        indices.push(indexStart++);\n    }\n\n    indices.push(indexStart - 1);\n}\n","import buildLine from './buildLine';\nimport { hex2rgb } from '../../../utils';\nimport earcut from 'earcut';\n\n/**\n * Builds a polygon to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n */\nexport default function buildPoly(graphicsData, webGLData)\n{\n    graphicsData.points = graphicsData.shape.points.slice();\n\n    let points = graphicsData.points;\n\n    if (graphicsData.fill && points.length >= 6)\n    {\n        const holeArray = [];\n        // Process holes..\n        const holes = graphicsData.holes;\n\n        for (let i = 0; i < holes.length; i++)\n        {\n            const hole = holes[i];\n\n            holeArray.push(points.length / 2);\n\n            points = points.concat(hole.points);\n        }\n\n        // get first and last point.. figure out the middle!\n        const verts = webGLData.points;\n        const indices = webGLData.indices;\n\n        const length = points.length / 2;\n\n        // sort color\n        const color = hex2rgb(graphicsData.fillColor);\n        const alpha = graphicsData.fillAlpha;\n        const r = color[0] * alpha;\n        const g = color[1] * alpha;\n        const b = color[2] * alpha;\n\n        const triangles = earcut(points, holeArray, 2);\n\n        if (!triangles)\n        {\n            return;\n        }\n\n        const vertPos = verts.length / 6;\n\n        for (let i = 0; i < triangles.length; i += 3)\n        {\n            indices.push(triangles[i] + vertPos);\n            indices.push(triangles[i] + vertPos);\n            indices.push(triangles[i + 1] + vertPos);\n            indices.push(triangles[i + 2] + vertPos);\n            indices.push(triangles[i + 2] + vertPos);\n        }\n\n        for (let i = 0; i < length; i++)\n        {\n            verts.push(points[i * 2], points[(i * 2) + 1],\n                r, g, b, alpha);\n        }\n    }\n\n    if (graphicsData.lineWidth > 0)\n    {\n        buildLine(graphicsData, webGLData);\n    }\n}\n","import buildLine from './buildLine';\nimport { hex2rgb } from '../../../utils';\n\n/**\n * Builds a rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n */\nexport default function buildRectangle(graphicsData, webGLData)\n{\n    // --- //\n    // need to convert points to a nice regular data\n    //\n    const rectData = graphicsData.shape;\n    const x = rectData.x;\n    const y = rectData.y;\n    const width = rectData.width;\n    const height = rectData.height;\n\n    if (graphicsData.fill)\n    {\n        const color = hex2rgb(graphicsData.fillColor);\n        const alpha = graphicsData.fillAlpha;\n\n        const r = color[0] * alpha;\n        const g = color[1] * alpha;\n        const b = color[2] * alpha;\n\n        const verts = webGLData.points;\n        const indices = webGLData.indices;\n\n        const vertPos = verts.length / 6;\n\n        // start\n        verts.push(x, y);\n        verts.push(r, g, b, alpha);\n\n        verts.push(x + width, y);\n        verts.push(r, g, b, alpha);\n\n        verts.push(x, y + height);\n        verts.push(r, g, b, alpha);\n\n        verts.push(x + width, y + height);\n        verts.push(r, g, b, alpha);\n\n        // insert 2 dead triangles..\n        indices.push(vertPos, vertPos, vertPos + 1, vertPos + 2, vertPos + 3, vertPos + 3);\n    }\n\n    if (graphicsData.lineWidth)\n    {\n        const tempPoints = graphicsData.points;\n\n        graphicsData.points = [x, y,\n            x + width, y,\n            x + width, y + height,\n            x, y + height,\n            x, y];\n\n        buildLine(graphicsData, webGLData);\n\n        graphicsData.points = tempPoints;\n    }\n}\n","import earcut from 'earcut';\nimport buildLine from './buildLine';\nimport { hex2rgb } from '../../../utils';\n\n/**\n * Builds a rounded rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n */\nexport default function buildRoundedRectangle(graphicsData, webGLData)\n{\n    const rrectData = graphicsData.shape;\n    const x = rrectData.x;\n    const y = rrectData.y;\n    const width = rrectData.width;\n    const height = rrectData.height;\n\n    const radius = rrectData.radius;\n\n    const recPoints = [];\n\n    recPoints.push(x, y + radius);\n    quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height, recPoints);\n    quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius, recPoints);\n    quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y, recPoints);\n    quadraticBezierCurve(x + radius, y, x, y, x, y + radius + 0.0000000001, recPoints);\n\n    // this tiny number deals with the issue that occurs when points overlap and earcut fails to triangulate the item.\n    // TODO - fix this properly, this is not very elegant.. but it works for now.\n\n    if (graphicsData.fill)\n    {\n        const color = hex2rgb(graphicsData.fillColor);\n        const alpha = graphicsData.fillAlpha;\n\n        const r = color[0] * alpha;\n        const g = color[1] * alpha;\n        const b = color[2] * alpha;\n\n        const verts = webGLData.points;\n        const indices = webGLData.indices;\n\n        const vecPos = verts.length / 6;\n\n        const triangles = earcut(recPoints, null, 2);\n\n        for (let i = 0, j = triangles.length; i < j; i += 3)\n        {\n            indices.push(triangles[i] + vecPos);\n            indices.push(triangles[i] + vecPos);\n            indices.push(triangles[i + 1] + vecPos);\n            indices.push(triangles[i + 2] + vecPos);\n            indices.push(triangles[i + 2] + vecPos);\n        }\n\n        for (let i = 0, j = recPoints.length; i < j; i++)\n        {\n            verts.push(recPoints[i], recPoints[++i], r, g, b, alpha);\n        }\n    }\n\n    if (graphicsData.lineWidth)\n    {\n        const tempPoints = graphicsData.points;\n\n        graphicsData.points = recPoints;\n\n        buildLine(graphicsData, webGLData);\n\n        graphicsData.points = tempPoints;\n    }\n}\n\n/**\n * Calculate the points for a quadratic bezier curve. (helper function..)\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {number} fromX - Origin point x\n * @param {number} fromY - Origin point x\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} [out=[]] - The output array to add points into. If not passed, a new array is created.\n * @return {number[]} an array of points\n */\nfunction quadraticBezierCurve(fromX, fromY, cpX, cpY, toX, toY, out = [])\n{\n    const n = 20;\n    const points = out;\n\n    let xa = 0;\n    let ya = 0;\n    let xb = 0;\n    let yb = 0;\n    let x = 0;\n    let y = 0;\n\n    function getPt(n1, n2, perc)\n    {\n        const diff = n2 - n1;\n\n        return n1 + (diff * perc);\n    }\n\n    for (let i = 0, j = 0; i <= n; ++i)\n    {\n        j = i / n;\n\n        // The Green Line\n        xa = getPt(fromX, cpX, j);\n        ya = getPt(fromY, cpY, j);\n        xb = getPt(cpX, toX, j);\n        yb = getPt(cpY, toY, j);\n\n        // The Black Dot\n        x = getPt(xa, xb, j);\n        y = getPt(ya, yb, j);\n\n        points.push(x, y);\n    }\n\n    return points;\n}\n","/**\n * @namespace PIXI\n */\nexport * from './const';\nexport * from './math';\n\nimport * as utils from './utils';\nimport * as ticker from './ticker';\nimport settings from './settings';\nimport CanvasRenderer from './renderers/canvas/CanvasRenderer';\nimport WebGLRenderer from './renderers/webgl/WebGLRenderer';\n\nexport { settings, utils, ticker, CanvasRenderer, WebGLRenderer };\n\nexport { default as glCore } from 'pixi-gl-core';\n\nexport { default as Bounds } from './display/Bounds';\nexport { default as DisplayObject } from './display/DisplayObject';\nexport { default as Container } from './display/Container';\nexport { default as Transform } from './display/Transform';\nexport { default as TransformStatic } from './display/TransformStatic';\nexport { default as TransformBase } from './display/TransformBase';\nexport { default as Sprite } from './sprites/Sprite';\nexport { default as CanvasSpriteRenderer } from './sprites/canvas/CanvasSpriteRenderer';\nexport { default as CanvasTinter } from './sprites/canvas/CanvasTinter';\nexport { default as SpriteRenderer } from './sprites/webgl/SpriteRenderer';\nexport { default as Text } from './text/Text';\nexport { default as TextStyle } from './text/TextStyle';\nexport { default as Graphics } from './graphics/Graphics';\nexport { default as GraphicsData } from './graphics/GraphicsData';\nexport { default as GraphicsRenderer } from './graphics/webgl/GraphicsRenderer';\nexport { default as CanvasGraphicsRenderer } from './graphics/canvas/CanvasGraphicsRenderer';\nexport { default as Texture } from './textures/Texture';\nexport { default as BaseTexture } from './textures/BaseTexture';\nexport { default as RenderTexture } from './textures/RenderTexture';\nexport { default as BaseRenderTexture } from './textures/BaseRenderTexture';\nexport { default as VideoBaseTexture } from './textures/VideoBaseTexture';\nexport { default as TextureUvs } from './textures/TextureUvs';\nexport { default as CanvasRenderTarget } from './renderers/canvas/utils/CanvasRenderTarget';\nexport { default as Shader } from './Shader';\nexport { default as WebGLManager } from './renderers/webgl/managers/WebGLManager';\nexport { default as ObjectRenderer } from './renderers/webgl/utils/ObjectRenderer';\nexport { default as RenderTarget } from './renderers/webgl/utils/RenderTarget';\nexport { default as Quad } from './renderers/webgl/utils/Quad';\nexport { default as SpriteMaskFilter } from './renderers/webgl/filters/spriteMask/SpriteMaskFilter';\nexport { default as Filter } from './renderers/webgl/filters/Filter';\n\n/**\n * This helper function will automatically detect which renderer you should be using.\n * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by\n * the browser then this function will return a canvas renderer\n *\n * @memberof PIXI\n * @function autoDetectRenderer\n * @param {number} [width=800] - the width of the renderers view\n * @param {number} [height=600] - the height of the renderers view\n * @param {object} [options] - The optional renderer parameters\n * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n * @param {boolean} [options.transparent=false] - If the render view is transparent, default false\n * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment)\n * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you\n *      need to call toDataUrl on the webgl context\n * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2\n * @param {boolean} [noWebGL=false] - prevents selection of WebGL renderer, even if such is present\n * @return {PIXI.WebGLRenderer|PIXI.CanvasRenderer} Returns WebGL renderer if available, otherwise CanvasRenderer\n */\nexport function autoDetectRenderer(width = 800, height = 600, options, noWebGL)\n{\n    if (!noWebGL && utils.isWebGLSupported())\n    {\n        return new WebGLRenderer(width, height, options);\n    }\n\n    return new CanvasRenderer(width, height, options);\n}\n","// Your friendly neighbour https://en.wikipedia.org/wiki/Dihedral_group of order 16\nimport Matrix from './Matrix';\n\nconst ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1];\nconst uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1];\nconst vx = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1];\nconst vy = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1];\nconst tempMatrices = [];\n\nconst mul = [];\n\nfunction signum(x)\n{\n    if (x < 0)\n    {\n        return -1;\n    }\n    if (x > 0)\n    {\n        return 1;\n    }\n\n    return 0;\n}\n\nfunction init()\n{\n    for (let i = 0; i < 16; i++)\n    {\n        const row = [];\n\n        mul.push(row);\n\n        for (let j = 0; j < 16; j++)\n        {\n            const _ux = signum((ux[i] * ux[j]) + (vx[i] * uy[j]));\n            const _uy = signum((uy[i] * ux[j]) + (vy[i] * uy[j]));\n            const _vx = signum((ux[i] * vx[j]) + (vx[i] * vy[j]));\n            const _vy = signum((uy[i] * vx[j]) + (vy[i] * vy[j]));\n\n            for (let k = 0; k < 16; k++)\n            {\n                if (ux[k] === _ux && uy[k] === _uy && vx[k] === _vx && vy[k] === _vy)\n                {\n                    row.push(k);\n                    break;\n                }\n            }\n        }\n    }\n\n    for (let i = 0; i < 16; i++)\n    {\n        const mat = new Matrix();\n\n        mat.set(ux[i], uy[i], vx[i], vy[i], 0, 0);\n        tempMatrices.push(mat);\n    }\n}\n\ninit();\n\n/**\n * Implements Dihedral Group D_8, see [group D4]{@link http://mathworld.wolfram.com/DihedralGroupD4.html},\n * D8 is the same but with diagonals. Used for texture rotations.\n *\n * Vector xX(i), xY(i) is U-axis of sprite with rotation i\n * Vector yY(i), yY(i) is V-axis of sprite with rotation i\n * Rotations: 0 grad (0), 90 grad (2), 180 grad (4), 270 grad (6)\n * Mirrors: vertical (8), main diagonal (10), horizontal (12), reverse diagonal (14)\n * This is the small part of gameofbombs.com portal system. It works.\n *\n * @author Ivan @ivanpopelyshev\n *\n * @namespace PIXI.GroupD8\n */\nconst GroupD8 = {\n    E: 0,\n    SE: 1,\n    S: 2,\n    SW: 3,\n    W: 4,\n    NW: 5,\n    N: 6,\n    NE: 7,\n    MIRROR_VERTICAL: 8,\n    MIRROR_HORIZONTAL: 12,\n    uX: (ind) => ux[ind],\n    uY: (ind) => uy[ind],\n    vX: (ind) => vx[ind],\n    vY: (ind) => vy[ind],\n    inv: (rotation) =>\n    {\n        if (rotation & 8)\n        {\n            return rotation & 15;\n        }\n\n        return (-rotation) & 7;\n    },\n    add: (rotationSecond, rotationFirst) => mul[rotationSecond][rotationFirst],\n    sub: (rotationSecond, rotationFirst) => mul[rotationSecond][GroupD8.inv(rotationFirst)],\n\n    /**\n     * Adds 180 degrees to rotation. Commutative operation.\n     *\n     * @method\n     * @param {number} rotation - The number to rotate.\n     * @returns {number} rotated number\n     */\n    rotate180: (rotation) => rotation ^ 4,\n\n    /**\n     * I dont know why sometimes width and heights needs to be swapped. We'll fix it later.\n     *\n     * @param {number} rotation - The number to check.\n     * @returns {boolean} Whether or not the width/height should be swapped.\n     */\n    isSwapWidthHeight: (rotation) => (rotation & 3) === 2,\n\n    /**\n     * @param {number} dx - TODO\n     * @param {number} dy - TODO\n     *\n     * @return {number} TODO\n     */\n    byDirection: (dx, dy) =>\n    {\n        if (Math.abs(dx) * 2 <= Math.abs(dy))\n        {\n            if (dy >= 0)\n            {\n                return GroupD8.S;\n            }\n\n            return GroupD8.N;\n        }\n        else if (Math.abs(dy) * 2 <= Math.abs(dx))\n        {\n            if (dx > 0)\n            {\n                return GroupD8.E;\n            }\n\n            return GroupD8.W;\n        }\n        else if (dy > 0)\n        {\n            if (dx > 0)\n            {\n                return GroupD8.SE;\n            }\n\n            return GroupD8.SW;\n        }\n        else if (dx > 0)\n        {\n            return GroupD8.NE;\n        }\n\n        return GroupD8.NW;\n    },\n\n    /**\n     * Helps sprite to compensate texture packer rotation.\n     *\n     * @param {PIXI.Matrix} matrix - sprite world matrix\n     * @param {number} rotation - The rotation factor to use.\n     * @param {number} tx - sprite anchoring\n     * @param {number} ty - sprite anchoring\n     */\n    matrixAppendRotationInv: (matrix, rotation, tx = 0, ty = 0) =>\n    {\n        // Packer used \"rotation\", we use \"inv(rotation)\"\n        const mat = tempMatrices[GroupD8.inv(rotation)];\n\n        mat.tx = tx;\n        mat.ty = ty;\n        matrix.append(mat);\n    },\n};\n\nexport default GroupD8;\n","import Point from './Point';\n\n/**\n * The pixi Matrix class as an object, which makes it a lot faster,\n * here is a representation of it :\n * | a | b | tx|\n * | c | d | ty|\n * | 0 | 0 | 1 |\n *\n * @class\n * @memberof PIXI\n */\nexport default class Matrix\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        /**\n         * @member {number}\n         * @default 1\n         */\n        this.a = 1;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.b = 0;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.c = 0;\n\n        /**\n         * @member {number}\n         * @default 1\n         */\n        this.d = 1;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.tx = 0;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.ty = 0;\n\n        this.array = null;\n    }\n\n    /**\n     * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:\n     *\n     * a = array[0]\n     * b = array[1]\n     * c = array[3]\n     * d = array[4]\n     * tx = array[2]\n     * ty = array[5]\n     *\n     * @param {number[]} array - The array that the matrix will be populated from.\n     */\n    fromArray(array)\n    {\n        this.a = array[0];\n        this.b = array[1];\n        this.c = array[3];\n        this.d = array[4];\n        this.tx = array[2];\n        this.ty = array[5];\n    }\n\n    /**\n     * sets the matrix properties\n     *\n     * @param {number} a - Matrix component\n     * @param {number} b - Matrix component\n     * @param {number} c - Matrix component\n     * @param {number} d - Matrix component\n     * @param {number} tx - Matrix component\n     * @param {number} ty - Matrix component\n     *\n     * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n     */\n    set(a, b, c, d, tx, ty)\n    {\n        this.a = a;\n        this.b = b;\n        this.c = c;\n        this.d = d;\n        this.tx = tx;\n        this.ty = ty;\n\n        return this;\n    }\n\n    /**\n     * Creates an array from the current Matrix object.\n     *\n     * @param {boolean} transpose - Whether we need to transpose the matrix or not\n     * @param {Float32Array} [out=new Float32Array(9)] - If provided the array will be assigned to out\n     * @return {number[]} the newly created array which contains the matrix\n     */\n    toArray(transpose, out)\n    {\n        if (!this.array)\n        {\n            this.array = new Float32Array(9);\n        }\n\n        const array = out || this.array;\n\n        if (transpose)\n        {\n            array[0] = this.a;\n            array[1] = this.b;\n            array[2] = 0;\n            array[3] = this.c;\n            array[4] = this.d;\n            array[5] = 0;\n            array[6] = this.tx;\n            array[7] = this.ty;\n            array[8] = 1;\n        }\n        else\n        {\n            array[0] = this.a;\n            array[1] = this.c;\n            array[2] = this.tx;\n            array[3] = this.b;\n            array[4] = this.d;\n            array[5] = this.ty;\n            array[6] = 0;\n            array[7] = 0;\n            array[8] = 1;\n        }\n\n        return array;\n    }\n\n    /**\n     * Get a new position with the current transformation applied.\n     * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)\n     *\n     * @param {PIXI.Point} pos - The origin\n     * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)\n     * @return {PIXI.Point} The new point, transformed through this matrix\n     */\n    apply(pos, newPos)\n    {\n        newPos = newPos || new Point();\n\n        const x = pos.x;\n        const y = pos.y;\n\n        newPos.x = (this.a * x) + (this.c * y) + this.tx;\n        newPos.y = (this.b * x) + (this.d * y) + this.ty;\n\n        return newPos;\n    }\n\n    /**\n     * Get a new position with the inverse of the current transformation applied.\n     * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)\n     *\n     * @param {PIXI.Point} pos - The origin\n     * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)\n     * @return {PIXI.Point} The new point, inverse-transformed through this matrix\n     */\n    applyInverse(pos, newPos)\n    {\n        newPos = newPos || new Point();\n\n        const id = 1 / ((this.a * this.d) + (this.c * -this.b));\n\n        const x = pos.x;\n        const y = pos.y;\n\n        newPos.x = (this.d * id * x) + (-this.c * id * y) + (((this.ty * this.c) - (this.tx * this.d)) * id);\n        newPos.y = (this.a * id * y) + (-this.b * id * x) + (((-this.ty * this.a) + (this.tx * this.b)) * id);\n\n        return newPos;\n    }\n\n    /**\n     * Translates the matrix on the x and y.\n     *\n     * @param {number} x How much to translate x by\n     * @param {number} y How much to translate y by\n     * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n     */\n    translate(x, y)\n    {\n        this.tx += x;\n        this.ty += y;\n\n        return this;\n    }\n\n    /**\n     * Applies a scale transformation to the matrix.\n     *\n     * @param {number} x The amount to scale horizontally\n     * @param {number} y The amount to scale vertically\n     * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n     */\n    scale(x, y)\n    {\n        this.a *= x;\n        this.d *= y;\n        this.c *= x;\n        this.b *= y;\n        this.tx *= x;\n        this.ty *= y;\n\n        return this;\n    }\n\n    /**\n     * Applies a rotation transformation to the matrix.\n     *\n     * @param {number} angle - The angle in radians.\n     * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n     */\n    rotate(angle)\n    {\n        const cos = Math.cos(angle);\n        const sin = Math.sin(angle);\n\n        const a1 = this.a;\n        const c1 = this.c;\n        const tx1 = this.tx;\n\n        this.a = (a1 * cos) - (this.b * sin);\n        this.b = (a1 * sin) + (this.b * cos);\n        this.c = (c1 * cos) - (this.d * sin);\n        this.d = (c1 * sin) + (this.d * cos);\n        this.tx = (tx1 * cos) - (this.ty * sin);\n        this.ty = (tx1 * sin) + (this.ty * cos);\n\n        return this;\n    }\n\n    /**\n     * Appends the given Matrix to this Matrix.\n     *\n     * @param {PIXI.Matrix} matrix - The matrix to append.\n     * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n     */\n    append(matrix)\n    {\n        const a1 = this.a;\n        const b1 = this.b;\n        const c1 = this.c;\n        const d1 = this.d;\n\n        this.a = (matrix.a * a1) + (matrix.b * c1);\n        this.b = (matrix.a * b1) + (matrix.b * d1);\n        this.c = (matrix.c * a1) + (matrix.d * c1);\n        this.d = (matrix.c * b1) + (matrix.d * d1);\n\n        this.tx = (matrix.tx * a1) + (matrix.ty * c1) + this.tx;\n        this.ty = (matrix.tx * b1) + (matrix.ty * d1) + this.ty;\n\n        return this;\n    }\n\n    /**\n     * Sets the matrix based on all the available properties\n     *\n     * @param {number} x - Position on the x axis\n     * @param {number} y - Position on the y axis\n     * @param {number} pivotX - Pivot on the x axis\n     * @param {number} pivotY - Pivot on the y axis\n     * @param {number} scaleX - Scale on the x axis\n     * @param {number} scaleY - Scale on the y axis\n     * @param {number} rotation - Rotation in radians\n     * @param {number} skewX - Skew on the x axis\n     * @param {number} skewY - Skew on the y axis\n     * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n     */\n    setTransform(x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY)\n    {\n        const sr = Math.sin(rotation);\n        const cr = Math.cos(rotation);\n        const cy = Math.cos(skewY);\n        const sy = Math.sin(skewY);\n        const nsx = -Math.sin(skewX);\n        const cx = Math.cos(skewX);\n\n        const a = cr * scaleX;\n        const b = sr * scaleX;\n        const c = -sr * scaleY;\n        const d = cr * scaleY;\n\n        this.a = (cy * a) + (sy * c);\n        this.b = (cy * b) + (sy * d);\n        this.c = (nsx * a) + (cx * c);\n        this.d = (nsx * b) + (cx * d);\n\n        this.tx = x + ((pivotX * a) + (pivotY * c));\n        this.ty = y + ((pivotX * b) + (pivotY * d));\n\n        return this;\n    }\n\n    /**\n     * Prepends the given Matrix to this Matrix.\n     *\n     * @param {PIXI.Matrix} matrix - The matrix to prepend\n     * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n     */\n    prepend(matrix)\n    {\n        const tx1 = this.tx;\n\n        if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1)\n        {\n            const a1 = this.a;\n            const c1 = this.c;\n\n            this.a = (a1 * matrix.a) + (this.b * matrix.c);\n            this.b = (a1 * matrix.b) + (this.b * matrix.d);\n            this.c = (c1 * matrix.a) + (this.d * matrix.c);\n            this.d = (c1 * matrix.b) + (this.d * matrix.d);\n        }\n\n        this.tx = (tx1 * matrix.a) + (this.ty * matrix.c) + matrix.tx;\n        this.ty = (tx1 * matrix.b) + (this.ty * matrix.d) + matrix.ty;\n\n        return this;\n    }\n\n    /**\n     * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform.\n     *\n     * @param {PIXI.Transform|PIXI.TransformStatic} transform - The transform to apply the properties to.\n     * @return {PIXI.Transform|PIXI.TransformStatic} The transform with the newly applied properties\n     */\n    decompose(transform)\n    {\n        // sort out rotation / skew..\n        const a = this.a;\n        const b = this.b;\n        const c = this.c;\n        const d = this.d;\n\n        const skewX = -Math.atan2(-c, d);\n        const skewY = Math.atan2(b, a);\n\n        const delta = Math.abs(skewX + skewY);\n\n        if (delta < 0.00001)\n        {\n            transform.rotation = skewY;\n\n            if (a < 0 && d >= 0)\n            {\n                transform.rotation += (transform.rotation <= 0) ? Math.PI : -Math.PI;\n            }\n\n            transform.skew.x = transform.skew.y = 0;\n        }\n        else\n        {\n            transform.skew.x = skewX;\n            transform.skew.y = skewY;\n        }\n\n        // next set scale\n        transform.scale.x = Math.sqrt((a * a) + (b * b));\n        transform.scale.y = Math.sqrt((c * c) + (d * d));\n\n        // next set position\n        transform.position.x = this.tx;\n        transform.position.y = this.ty;\n\n        return transform;\n    }\n\n    /**\n     * Inverts this matrix\n     *\n     * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n     */\n    invert()\n    {\n        const a1 = this.a;\n        const b1 = this.b;\n        const c1 = this.c;\n        const d1 = this.d;\n        const tx1 = this.tx;\n        const n = (a1 * d1) - (b1 * c1);\n\n        this.a = d1 / n;\n        this.b = -b1 / n;\n        this.c = -c1 / n;\n        this.d = a1 / n;\n        this.tx = ((c1 * this.ty) - (d1 * tx1)) / n;\n        this.ty = -((a1 * this.ty) - (b1 * tx1)) / n;\n\n        return this;\n    }\n\n    /**\n     * Resets this Matix to an identity (default) matrix.\n     *\n     * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n     */\n    identity()\n    {\n        this.a = 1;\n        this.b = 0;\n        this.c = 0;\n        this.d = 1;\n        this.tx = 0;\n        this.ty = 0;\n\n        return this;\n    }\n\n    /**\n     * Creates a new Matrix object with the same values as this one.\n     *\n     * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls.\n     */\n    clone()\n    {\n        const matrix = new Matrix();\n\n        matrix.a = this.a;\n        matrix.b = this.b;\n        matrix.c = this.c;\n        matrix.d = this.d;\n        matrix.tx = this.tx;\n        matrix.ty = this.ty;\n\n        return matrix;\n    }\n\n    /**\n     * Changes the values of the given matrix to be the same as the ones in this matrix\n     *\n     * @param {PIXI.Matrix} matrix - The matrix to copy from.\n     * @return {PIXI.Matrix} The matrix given in parameter with its values updated.\n     */\n    copy(matrix)\n    {\n        matrix.a = this.a;\n        matrix.b = this.b;\n        matrix.c = this.c;\n        matrix.d = this.d;\n        matrix.tx = this.tx;\n        matrix.ty = this.ty;\n\n        return matrix;\n    }\n\n    /**\n     * A default (identity) matrix\n     *\n     * @static\n     * @const\n     */\n    static get IDENTITY()\n    {\n        return new Matrix();\n    }\n\n    /**\n     * A temp matrix\n     *\n     * @static\n     * @const\n     */\n    static get TEMP_MATRIX()\n    {\n        return new Matrix();\n    }\n}\n","/**\n * The Point object represents a location in a two-dimensional coordinate system, where x represents\n * the horizontal axis and y represents the vertical axis.\n * An observable point is a point that triggers a callback when the point's position is changed.\n *\n * @class\n * @memberof PIXI\n */\nexport default class ObservablePoint\n{\n    /**\n     * @param {Function} cb - callback when changed\n     * @param {object} scope - owner of callback\n     * @param {number} [x=0] - position of the point on the x axis\n     * @param {number} [y=0] - position of the point on the y axis\n     */\n    constructor(cb, scope, x = 0, y = 0)\n    {\n        this._x = x;\n        this._y = y;\n\n        this.cb = cb;\n        this.scope = scope;\n    }\n\n    /**\n     * Sets the point to a new x and y position.\n     * If y is omitted, both x and y will be set to x.\n     *\n     * @param {number} [x=0] - position of the point on the x axis\n     * @param {number} [y=0] - position of the point on the y axis\n     */\n    set(x, y)\n    {\n        const _x = x || 0;\n        const _y = y || ((y !== 0) ? _x : 0);\n\n        if (this._x !== _x || this._y !== _y)\n        {\n            this._x = _x;\n            this._y = _y;\n            this.cb.call(this.scope);\n        }\n    }\n\n    /**\n     * Copies the data from another point\n     *\n     * @param {PIXI.Point|PIXI.ObservablePoint} point - point to copy from\n     */\n    copy(point)\n    {\n        if (this._x !== point.x || this._y !== point.y)\n        {\n            this._x = point.x;\n            this._y = point.y;\n            this.cb.call(this.scope);\n        }\n    }\n\n    /**\n     * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n     *\n     * @member {number}\n     * @memberof PIXI.ObservablePoint#\n     */\n    get x()\n    {\n        return this._x;\n    }\n\n    /**\n     * Sets the X component.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set x(value)\n    {\n        if (this._x !== value)\n        {\n            this._x = value;\n            this.cb.call(this.scope);\n        }\n    }\n\n    /**\n     * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n     *\n     * @member {number}\n     * @memberof PIXI.ObservablePoint#\n     */\n    get y()\n    {\n        return this._y;\n    }\n\n    /**\n     * Sets the Y component.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set y(value)\n    {\n        if (this._y !== value)\n        {\n            this._y = value;\n            this.cb.call(this.scope);\n        }\n    }\n}\n","/**\n * The Point object represents a location in a two-dimensional coordinate system, where x represents\n * the horizontal axis and y represents the vertical axis.\n *\n * @class\n * @memberof PIXI\n */\nexport default class Point\n{\n    /**\n     * @param {number} [x=0] - position of the point on the x axis\n     * @param {number} [y=0] - position of the point on the y axis\n     */\n    constructor(x = 0, y = 0)\n    {\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.x = x;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.y = y;\n    }\n\n    /**\n     * Creates a clone of this point\n     *\n     * @return {PIXI.Point} a copy of the point\n     */\n    clone()\n    {\n        return new Point(this.x, this.y);\n    }\n\n    /**\n     * Copies x and y from the given point\n     *\n     * @param {PIXI.Point} p - The point to copy.\n     */\n    copy(p)\n    {\n        this.set(p.x, p.y);\n    }\n\n    /**\n     * Returns true if the given point is equal to this point\n     *\n     * @param {PIXI.Point} p - The point to check\n     * @returns {boolean} Whether the given point equal to this point\n     */\n    equals(p)\n    {\n        return (p.x === this.x) && (p.y === this.y);\n    }\n\n    /**\n     * Sets the point to a new x and y position.\n     * If y is omitted, both x and y will be set to x.\n     *\n     * @param {number} [x=0] - position of the point on the x axis\n     * @param {number} [y=0] - position of the point on the y axis\n     */\n    set(x, y)\n    {\n        this.x = x || 0;\n        this.y = y || ((y !== 0) ? this.x : 0);\n    }\n\n}\n","/**\n * Math classes and utilities mixed into PIXI namespace.\n *\n * @lends PIXI\n */\nexport { default as Point } from './Point';\nexport { default as ObservablePoint } from './ObservablePoint';\nexport { default as Matrix } from './Matrix';\nexport { default as GroupD8 } from './GroupD8';\n\nexport { default as Circle } from './shapes/Circle';\nexport { default as Ellipse } from './shapes/Ellipse';\nexport { default as Polygon } from './shapes/Polygon';\nexport { default as Rectangle } from './shapes/Rectangle';\nexport { default as RoundedRectangle } from './shapes/RoundedRectangle';\n","import Rectangle from './Rectangle';\nimport { SHAPES } from '../../const';\n\n/**\n * The Circle object can be used to specify a hit area for displayObjects\n *\n * @class\n * @memberof PIXI\n */\nexport default class Circle\n{\n    /**\n     * @param {number} [x=0] - The X coordinate of the center of this circle\n     * @param {number} [y=0] - The Y coordinate of the center of this circle\n     * @param {number} [radius=0] - The radius of the circle\n     */\n    constructor(x = 0, y = 0, radius = 0)\n    {\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.x = x;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.y = y;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.radius = radius;\n\n        /**\n         * The type of the object, mainly used to avoid `instanceof` checks\n         *\n         * @member {number}\n         * @readOnly\n         * @default PIXI.SHAPES.CIRC\n         * @see PIXI.SHAPES\n         */\n        this.type = SHAPES.CIRC;\n    }\n\n    /**\n     * Creates a clone of this Circle instance\n     *\n     * @return {PIXI.Circle} a copy of the Circle\n     */\n    clone()\n    {\n        return new Circle(this.x, this.y, this.radius);\n    }\n\n    /**\n     * Checks whether the x and y coordinates given are contained within this circle\n     *\n     * @param {number} x - The X coordinate of the point to test\n     * @param {number} y - The Y coordinate of the point to test\n     * @return {boolean} Whether the x/y coordinates are within this Circle\n     */\n    contains(x, y)\n    {\n        if (this.radius <= 0)\n        {\n            return false;\n        }\n\n        const r2 = this.radius * this.radius;\n        let dx = (this.x - x);\n        let dy = (this.y - y);\n\n        dx *= dx;\n        dy *= dy;\n\n        return (dx + dy <= r2);\n    }\n\n    /**\n    * Returns the framing rectangle of the circle as a Rectangle object\n    *\n    * @return {PIXI.Rectangle} the framing rectangle\n    */\n    getBounds()\n    {\n        return new Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);\n    }\n}\n","import Rectangle from './Rectangle';\nimport { SHAPES } from '../../const';\n\n/**\n * The Ellipse object can be used to specify a hit area for displayObjects\n *\n * @class\n * @memberof PIXI\n */\nexport default class Ellipse\n{\n    /**\n     * @param {number} [x=0] - The X coordinate of the center of this circle\n     * @param {number} [y=0] - The Y coordinate of the center of this circle\n     * @param {number} [width=0] - The half width of this ellipse\n     * @param {number} [height=0] - The half height of this ellipse\n     */\n    constructor(x = 0, y = 0, width = 0, height = 0)\n    {\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.x = x;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.y = y;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.width = width;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.height = height;\n\n        /**\n         * The type of the object, mainly used to avoid `instanceof` checks\n         *\n         * @member {number}\n         * @readOnly\n         * @default PIXI.SHAPES.ELIP\n         * @see PIXI.SHAPES\n         */\n        this.type = SHAPES.ELIP;\n    }\n\n    /**\n     * Creates a clone of this Ellipse instance\n     *\n     * @return {PIXI.Ellipse} a copy of the ellipse\n     */\n    clone()\n    {\n        return new Ellipse(this.x, this.y, this.width, this.height);\n    }\n\n    /**\n     * Checks whether the x and y coordinates given are contained within this ellipse\n     *\n     * @param {number} x - The X coordinate of the point to test\n     * @param {number} y - The Y coordinate of the point to test\n     * @return {boolean} Whether the x/y coords are within this ellipse\n     */\n    contains(x, y)\n    {\n        if (this.width <= 0 || this.height <= 0)\n        {\n            return false;\n        }\n\n        // normalize the coords to an ellipse with center 0,0\n        let normx = ((x - this.x) / this.width);\n        let normy = ((y - this.y) / this.height);\n\n        normx *= normx;\n        normy *= normy;\n\n        return (normx + normy <= 1);\n    }\n\n    /**\n     * Returns the framing rectangle of the ellipse as a Rectangle object\n     *\n     * @return {PIXI.Rectangle} the framing rectangle\n     */\n    getBounds()\n    {\n        return new Rectangle(this.x - this.width, this.y - this.height, this.width, this.height);\n    }\n}\n","import Point from '../Point';\nimport { SHAPES } from '../../const';\n\n/**\n * @class\n * @memberof PIXI\n */\nexport default class Polygon\n{\n    /**\n     * @param {PIXI.Point[]|number[]} points - This can be an array of Points\n     *  that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or\n     *  the arguments passed can be all the points of the polygon e.g.\n     *  `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the arguments passed can be flat\n     *  x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.\n     */\n    constructor(...points)\n    {\n        if (Array.isArray(points[0]))\n        {\n            points = points[0];\n        }\n\n        // if this is an array of points, convert it to a flat array of numbers\n        if (points[0] instanceof Point)\n        {\n            const p = [];\n\n            for (let i = 0, il = points.length; i < il; i++)\n            {\n                p.push(points[i].x, points[i].y);\n            }\n\n            points = p;\n        }\n\n        this.closed = true;\n\n        /**\n         * An array of the points of this polygon\n         *\n         * @member {number[]}\n         */\n        this.points = points;\n\n        /**\n         * The type of the object, mainly used to avoid `instanceof` checks\n         *\n         * @member {number}\n         * @readOnly\n         * @default PIXI.SHAPES.POLY\n         * @see PIXI.SHAPES\n         */\n        this.type = SHAPES.POLY;\n    }\n\n    /**\n     * Creates a clone of this polygon\n     *\n     * @return {PIXI.Polygon} a copy of the polygon\n     */\n    clone()\n    {\n        return new Polygon(this.points.slice());\n    }\n\n    /**\n     * Closes the polygon, adding points if necessary.\n     *\n     */\n    close()\n    {\n        const points = this.points;\n\n        // close the poly if the value is true!\n        if (points[0] !== points[points.length - 2] || points[1] !== points[points.length - 1])\n        {\n            points.push(points[0], points[1]);\n        }\n    }\n\n    /**\n     * Checks whether the x and y coordinates passed to this function are contained within this polygon\n     *\n     * @param {number} x - The X coordinate of the point to test\n     * @param {number} y - The Y coordinate of the point to test\n     * @return {boolean} Whether the x/y coordinates are within this polygon\n     */\n    contains(x, y)\n    {\n        let inside = false;\n\n        // use some raycasting to test hits\n        // https://github.com/substack/point-in-polygon/blob/master/index.js\n        const length = this.points.length / 2;\n\n        for (let i = 0, j = length - 1; i < length; j = i++)\n        {\n            const xi = this.points[i * 2];\n            const yi = this.points[(i * 2) + 1];\n            const xj = this.points[j * 2];\n            const yj = this.points[(j * 2) + 1];\n            const intersect = ((yi > y) !== (yj > y)) && (x < ((xj - xi) * ((y - yi) / (yj - yi))) + xi);\n\n            if (intersect)\n            {\n                inside = !inside;\n            }\n        }\n\n        return inside;\n    }\n}\n","import { SHAPES } from '../../const';\n\n/**\n * Rectangle object is an area defined by its position, as indicated by its top-left corner\n * point (x, y) and by its width and its height.\n *\n * @class\n * @memberof PIXI\n */\nexport default class Rectangle\n{\n    /**\n     * @param {number} [x=0] - The X coordinate of the upper-left corner of the rectangle\n     * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rectangle\n     * @param {number} [width=0] - The overall width of this rectangle\n     * @param {number} [height=0] - The overall height of this rectangle\n     */\n    constructor(x = 0, y = 0, width = 0, height = 0)\n    {\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.x = x;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.y = y;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.width = width;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.height = height;\n\n        /**\n         * The type of the object, mainly used to avoid `instanceof` checks\n         *\n         * @member {number}\n         * @readOnly\n         * @default PIXI.SHAPES.RECT\n         * @see PIXI.SHAPES\n         */\n        this.type = SHAPES.RECT;\n    }\n\n    /**\n     * returns the left edge of the rectangle\n     *\n     * @member {number}\n     * @memberof PIXI.Rectangle#\n     */\n    get left()\n    {\n        return this.x;\n    }\n\n    /**\n     * returns the right edge of the rectangle\n     *\n     * @member {number}\n     * @memberof PIXI.Rectangle\n     */\n    get right()\n    {\n        return this.x + this.width;\n    }\n\n    /**\n     * returns the top edge of the rectangle\n     *\n     * @member {number}\n     * @memberof PIXI.Rectangle\n     */\n    get top()\n    {\n        return this.y;\n    }\n\n    /**\n     * returns the bottom edge of the rectangle\n     *\n     * @member {number}\n     * @memberof PIXI.Rectangle\n     */\n    get bottom()\n    {\n        return this.y + this.height;\n    }\n\n    /**\n     * A constant empty rectangle.\n     *\n     * @static\n     * @constant\n     */\n    static get EMPTY()\n    {\n        return new Rectangle(0, 0, 0, 0);\n    }\n\n    /**\n     * Creates a clone of this Rectangle\n     *\n     * @return {PIXI.Rectangle} a copy of the rectangle\n     */\n    clone()\n    {\n        return new Rectangle(this.x, this.y, this.width, this.height);\n    }\n\n    /**\n     * Copies another rectangle to this one.\n     *\n     * @param {PIXI.Rectangle} rectangle - The rectangle to copy.\n     * @return {PIXI.Rectangle} Returns itself.\n     */\n    copy(rectangle)\n    {\n        this.x = rectangle.x;\n        this.y = rectangle.y;\n        this.width = rectangle.width;\n        this.height = rectangle.height;\n\n        return this;\n    }\n\n    /**\n     * Checks whether the x and y coordinates given are contained within this Rectangle\n     *\n     * @param {number} x - The X coordinate of the point to test\n     * @param {number} y - The Y coordinate of the point to test\n     * @return {boolean} Whether the x/y coordinates are within this Rectangle\n     */\n    contains(x, y)\n    {\n        if (this.width <= 0 || this.height <= 0)\n        {\n            return false;\n        }\n\n        if (x >= this.x && x < this.x + this.width)\n        {\n            if (y >= this.y && y < this.y + this.height)\n            {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Pads the rectangle making it grow in all directions.\n     *\n     * @param {number} paddingX - The horizontal padding amount.\n     * @param {number} paddingY - The vertical padding amount.\n     */\n    pad(paddingX, paddingY)\n    {\n        paddingX = paddingX || 0;\n        paddingY = paddingY || ((paddingY !== 0) ? paddingX : 0);\n\n        this.x -= paddingX;\n        this.y -= paddingY;\n\n        this.width += paddingX * 2;\n        this.height += paddingY * 2;\n    }\n\n    /**\n     * Fits this rectangle around the passed one.\n     *\n     * @param {PIXI.Rectangle} rectangle - The rectangle to fit.\n     */\n    fit(rectangle)\n    {\n        if (this.x < rectangle.x)\n        {\n            this.width += this.x;\n            if (this.width < 0)\n            {\n                this.width = 0;\n            }\n\n            this.x = rectangle.x;\n        }\n\n        if (this.y < rectangle.y)\n        {\n            this.height += this.y;\n            if (this.height < 0)\n            {\n                this.height = 0;\n            }\n            this.y = rectangle.y;\n        }\n\n        if (this.x + this.width > rectangle.x + rectangle.width)\n        {\n            this.width = rectangle.width - this.x;\n            if (this.width < 0)\n            {\n                this.width = 0;\n            }\n        }\n\n        if (this.y + this.height > rectangle.y + rectangle.height)\n        {\n            this.height = rectangle.height - this.y;\n            if (this.height < 0)\n            {\n                this.height = 0;\n            }\n        }\n    }\n\n    /**\n     * Enlarges this rectangle to include the passed rectangle.\n     *\n     * @param {PIXI.Rectangle} rect - The rectangle to include.\n     */\n    enlarge(rect)\n    {\n        if (rect === Rectangle.EMPTY)\n        {\n            return;\n        }\n\n        const x1 = Math.min(this.x, rect.x);\n        const x2 = Math.max(this.x + this.width, rect.x + rect.width);\n        const y1 = Math.min(this.y, rect.y);\n        const y2 = Math.max(this.y + this.height, rect.y + rect.height);\n\n        this.x = x1;\n        this.width = x2 - x1;\n        this.y = y1;\n        this.height = y2 - y1;\n    }\n}\n","import { SHAPES } from '../../const';\n\n/**\n * The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its\n * top-left corner point (x, y) and by its width and its height and its radius.\n *\n * @class\n * @memberof PIXI\n */\nexport default class RoundedRectangle\n{\n    /**\n     * @param {number} [x=0] - The X coordinate of the upper-left corner of the rounded rectangle\n     * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rounded rectangle\n     * @param {number} [width=0] - The overall width of this rounded rectangle\n     * @param {number} [height=0] - The overall height of this rounded rectangle\n     * @param {number} [radius=20] - Controls the radius of the rounded corners\n     */\n    constructor(x = 0, y = 0, width = 0, height = 0, radius = 20)\n    {\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.x = x;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.y = y;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.width = width;\n\n        /**\n         * @member {number}\n         * @default 0\n         */\n        this.height = height;\n\n        /**\n         * @member {number}\n         * @default 20\n         */\n        this.radius = radius;\n\n        /**\n         * The type of the object, mainly used to avoid `instanceof` checks\n         *\n         * @member {number}\n         * @readonly\n         * @default PIXI.SHAPES.RREC\n         * @see PIXI.SHAPES\n         */\n        this.type = SHAPES.RREC;\n    }\n\n    /**\n     * Creates a clone of this Rounded Rectangle\n     *\n     * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle\n     */\n    clone()\n    {\n        return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);\n    }\n\n    /**\n     * Checks whether the x and y coordinates given are contained within this Rounded Rectangle\n     *\n     * @param {number} x - The X coordinate of the point to test\n     * @param {number} y - The Y coordinate of the point to test\n     * @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle\n     */\n    contains(x, y)\n    {\n        if (this.width <= 0 || this.height <= 0)\n        {\n            return false;\n        }\n        if (x >= this.x && x <= this.x + this.width)\n        {\n            if (y >= this.y && y <= this.y + this.height)\n            {\n                if ((y >= this.y + this.radius && y <= this.y + this.height - this.radius)\n                || (x >= this.x + this.radius && x <= this.x + this.width - this.radius))\n                {\n                    return true;\n                }\n                let dx = x - (this.x + this.radius);\n                let dy = y - (this.y + this.radius);\n                const radius2 = this.radius * this.radius;\n\n                if ((dx * dx) + (dy * dy) <= radius2)\n                {\n                    return true;\n                }\n                dx = x - (this.x + this.width - this.radius);\n                if ((dx * dx) + (dy * dy) <= radius2)\n                {\n                    return true;\n                }\n                dy = y - (this.y + this.height - this.radius);\n                if ((dx * dx) + (dy * dy) <= radius2)\n                {\n                    return true;\n                }\n                dx = x - (this.x + this.radius);\n                if ((dx * dx) + (dy * dy) <= radius2)\n                {\n                    return true;\n                }\n            }\n        }\n\n        return false;\n    }\n}\n","import { sayHello, hex2string, hex2rgb } from '../utils';\nimport { Matrix } from '../math';\nimport { RENDERER_TYPE } from '../const';\nimport settings from '../settings';\nimport Container from '../display/Container';\nimport RenderTexture from '../textures/RenderTexture';\nimport EventEmitter from 'eventemitter3';\n\nconst tempMatrix = new Matrix();\n\n/**\n * The SystemRenderer is the base for a Pixi Renderer. It is extended by the {@link PIXI.CanvasRenderer}\n * and {@link PIXI.WebGLRenderer} which can be used for rendering a Pixi scene.\n *\n * @abstract\n * @class\n * @extends EventEmitter\n * @memberof PIXI\n */\nexport default class SystemRenderer extends EventEmitter\n{\n    /**\n     * @param {string} system - The name of the system this renderer is for.\n     * @param {number} [width=800] - the width of the canvas view\n     * @param {number} [height=600] - the height of the canvas view\n     * @param {object} [options] - The optional renderer parameters\n     * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n     * @param {boolean} [options.transparent=false] - If the render view is transparent, default false\n     * @param {boolean} [options.autoResize=false] - If the render view is automatically resized, default false\n     * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment)\n     * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer. The\n     *  resolution of the renderer retina would be 2.\n     * @param {boolean} [options.clearBeforeRender=true] - This sets if the CanvasRenderer will clear the canvas or\n     *      not before the new render pass.\n     * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n     *  (shown if not transparent).\n     * @param {boolean} [options.roundPixels=false] - If true Pixi will Math.floor() x/y values when rendering,\n     *  stopping pixel interpolation.\n     */\n    constructor(system, width, height, options)\n    {\n        super();\n\n        sayHello(system);\n\n        // prepare options\n        if (options)\n        {\n            for (const i in settings.RENDER_OPTIONS)\n            {\n                if (typeof options[i] === 'undefined')\n                {\n                    options[i] = settings.RENDER_OPTIONS[i];\n                }\n            }\n        }\n        else\n        {\n            options = settings.RENDER_OPTIONS;\n        }\n\n        /**\n         * The type of the renderer.\n         *\n         * @member {number}\n         * @default PIXI.RENDERER_TYPE.UNKNOWN\n         * @see PIXI.RENDERER_TYPE\n         */\n        this.type = RENDERER_TYPE.UNKNOWN;\n\n        /**\n         * The width of the canvas view\n         *\n         * @member {number}\n         * @default 800\n         */\n        this.width = width || 800;\n\n        /**\n         * The height of the canvas view\n         *\n         * @member {number}\n         * @default 600\n         */\n        this.height = height || 600;\n\n        /**\n         * The canvas element that everything is drawn to\n         *\n         * @member {HTMLCanvasElement}\n         */\n        this.view = options.view || document.createElement('canvas');\n\n        /**\n         * The resolution / device pixel ratio of the renderer\n         *\n         * @member {number}\n         * @default 1\n         */\n        this.resolution = options.resolution || settings.RESOLUTION;\n\n        /**\n         * Whether the render view is transparent\n         *\n         * @member {boolean}\n         */\n        this.transparent = options.transparent;\n\n        /**\n         * Whether the render view should be resized automatically\n         *\n         * @member {boolean}\n         */\n        this.autoResize = options.autoResize || false;\n\n        /**\n         * Tracks the blend modes useful for this renderer.\n         *\n         * @member {object}\n         */\n        this.blendModes = null;\n\n        /**\n         * The value of the preserveDrawingBuffer flag affects whether or not the contents of\n         * the stencil buffer is retained after rendering.\n         *\n         * @member {boolean}\n         */\n        this.preserveDrawingBuffer = options.preserveDrawingBuffer;\n\n        /**\n         * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n         * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every\n         * frame to set the canvas background color. If the scene is transparent Pixi will use clearRect\n         * to clear the canvas every frame. Disable this by setting this to false. For example if\n         * your game has a canvas filling background image you often don't need this set.\n         *\n         * @member {boolean}\n         * @default\n         */\n        this.clearBeforeRender = options.clearBeforeRender;\n\n        /**\n         * If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation.\n         * Handy for crisp pixel art and speed on legacy devices.\n         *\n         * @member {boolean}\n         */\n        this.roundPixels = options.roundPixels;\n\n        /**\n         * The background color as a number.\n         *\n         * @member {number}\n         * @private\n         */\n        this._backgroundColor = 0x000000;\n\n        /**\n         * The background color as an [R, G, B] array.\n         *\n         * @member {number[]}\n         * @private\n         */\n        this._backgroundColorRgba = [0, 0, 0, 0];\n\n        /**\n         * The background color as a string.\n         *\n         * @member {string}\n         * @private\n         */\n        this._backgroundColorString = '#000000';\n\n        this.backgroundColor = options.backgroundColor || this._backgroundColor; // run bg color setter\n\n        /**\n         * This temporary display object used as the parent of the currently being rendered item\n         *\n         * @member {PIXI.DisplayObject}\n         * @private\n         */\n        this._tempDisplayObjectParent = new Container();\n\n        /**\n         * The last root object that the renderer tried to render.\n         *\n         * @member {PIXI.DisplayObject}\n         * @private\n         */\n        this._lastObjectRendered = this._tempDisplayObjectParent;\n    }\n\n    /**\n     * Resizes the canvas view to the specified width and height\n     *\n     * @param {number} width - the new width of the canvas view\n     * @param {number} height - the new height of the canvas view\n     */\n    resize(width, height)\n    {\n        this.width = width * this.resolution;\n        this.height = height * this.resolution;\n\n        this.view.width = this.width;\n        this.view.height = this.height;\n\n        if (this.autoResize)\n        {\n            this.view.style.width = `${this.width / this.resolution}px`;\n            this.view.style.height = `${this.height / this.resolution}px`;\n        }\n    }\n\n    /**\n     * Useful function that returns a texture of the display object that can then be used to create sprites\n     * This can be quite useful if your displayObject is complicated and needs to be reused multiple times.\n     *\n     * @param {PIXI.DisplayObject} displayObject - The displayObject the object will be generated from\n     * @param {number} scaleMode - Should be one of the scaleMode consts\n     * @param {number} resolution - The resolution / device pixel ratio of the texture being generated\n     * @return {PIXI.Texture} a texture of the graphics object\n     */\n    generateTexture(displayObject, scaleMode, resolution)\n    {\n        const bounds = displayObject.getLocalBounds();\n\n        const renderTexture = RenderTexture.create(bounds.width | 0, bounds.height | 0, scaleMode, resolution);\n\n        tempMatrix.tx = -bounds.x;\n        tempMatrix.ty = -bounds.y;\n\n        this.render(displayObject, renderTexture, false, tempMatrix, true);\n\n        return renderTexture;\n    }\n\n    /**\n     * Removes everything from the renderer and optionally removes the Canvas DOM element.\n     *\n     * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM.\n     */\n    destroy(removeView)\n    {\n        if (removeView && this.view.parentNode)\n        {\n            this.view.parentNode.removeChild(this.view);\n        }\n\n        this.type = RENDERER_TYPE.UNKNOWN;\n\n        this.width = 0;\n        this.height = 0;\n\n        this.view = null;\n\n        this.resolution = 0;\n\n        this.transparent = false;\n\n        this.autoResize = false;\n\n        this.blendModes = null;\n\n        this.preserveDrawingBuffer = false;\n        this.clearBeforeRender = false;\n\n        this.roundPixels = false;\n\n        this._backgroundColor = 0;\n        this._backgroundColorRgba = null;\n        this._backgroundColorString = null;\n\n        this.backgroundColor = 0;\n        this._tempDisplayObjectParent = null;\n        this._lastObjectRendered = null;\n    }\n\n    /**\n     * The background color to fill if not transparent\n     *\n     * @member {number}\n     * @memberof PIXI.SystemRenderer#\n     */\n    get backgroundColor()\n    {\n        return this._backgroundColor;\n    }\n\n    /**\n     * Sets the background color.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set backgroundColor(value)\n    {\n        this._backgroundColor = value;\n        this._backgroundColorString = hex2string(value);\n        hex2rgb(value, this._backgroundColorRgba);\n    }\n}\n","import SystemRenderer from '../SystemRenderer';\nimport CanvasMaskManager from './utils/CanvasMaskManager';\nimport CanvasRenderTarget from './utils/CanvasRenderTarget';\nimport mapCanvasBlendModesToPixi from './utils/mapCanvasBlendModesToPixi';\nimport { pluginTarget } from '../../utils';\nimport { RENDERER_TYPE, SCALE_MODES, BLEND_MODES } from '../../const';\nimport settings from '../../settings';\n\n/**\n * The CanvasRenderer draws the scene and all its content onto a 2d canvas. This renderer should\n * be used for browsers that do not support WebGL. Don't forget to add the CanvasRenderer.view to\n * your DOM or you will not see anything :)\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.SystemRenderer\n */\nexport default class CanvasRenderer extends SystemRenderer\n{\n    /**\n     * @param {number} [width=800] - the width of the canvas view\n     * @param {number} [height=600] - the height of the canvas view\n     * @param {object} [options] - The optional renderer parameters\n     * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n     * @param {boolean} [options.transparent=false] - If the render view is transparent, default false\n     * @param {boolean} [options.autoResize=false] - If the render view is automatically resized, default false\n     * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment)\n     * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer. The\n     *  resolution of the renderer retina would be 2.\n     * @param {boolean} [options.clearBeforeRender=true] - This sets if the CanvasRenderer will clear the canvas or\n     *      not before the new render pass.\n     * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n     *  (shown if not transparent).\n     * @param {boolean} [options.roundPixels=false] - If true Pixi will Math.floor() x/y values when rendering,\n     *  stopping pixel interpolation.\n     */\n    constructor(width, height, options = {})\n    {\n        super('Canvas', width, height, options);\n\n        this.type = RENDERER_TYPE.CANVAS;\n\n        /**\n         * The canvas 2d context that everything is drawn with.\n         *\n         * @member {CanvasRenderingContext2D}\n         */\n        this.rootContext = this.view.getContext('2d', { alpha: this.transparent });\n\n        /**\n         * Boolean flag controlling canvas refresh.\n         *\n         * @member {boolean}\n         */\n        this.refresh = true;\n\n        /**\n         * Instance of a CanvasMaskManager, handles masking when using the canvas renderer.\n         *\n         * @member {PIXI.CanvasMaskManager}\n         */\n        this.maskManager = new CanvasMaskManager(this);\n\n        /**\n         * The canvas property used to set the canvas smoothing property.\n         *\n         * @member {string}\n         */\n        this.smoothProperty = 'imageSmoothingEnabled';\n\n        if (!this.rootContext.imageSmoothingEnabled)\n        {\n            if (this.rootContext.webkitImageSmoothingEnabled)\n            {\n                this.smoothProperty = 'webkitImageSmoothingEnabled';\n            }\n            else if (this.rootContext.mozImageSmoothingEnabled)\n            {\n                this.smoothProperty = 'mozImageSmoothingEnabled';\n            }\n            else if (this.rootContext.oImageSmoothingEnabled)\n            {\n                this.smoothProperty = 'oImageSmoothingEnabled';\n            }\n            else if (this.rootContext.msImageSmoothingEnabled)\n            {\n                this.smoothProperty = 'msImageSmoothingEnabled';\n            }\n        }\n\n        this.initPlugins();\n\n        this.blendModes = mapCanvasBlendModesToPixi();\n        this._activeBlendMode = null;\n\n        this.context = null;\n        this.renderingToScreen = false;\n\n        this.resize(width, height);\n    }\n\n    /**\n     * Renders the object to this canvas view\n     *\n     * @param {PIXI.DisplayObject} displayObject - The object to be rendered\n     * @param {PIXI.RenderTexture} [renderTexture] - A render texture to be rendered to.\n     *  If unset, it will render to the root context.\n     * @param {boolean} [clear=false] - Whether to clear the canvas before drawing\n     * @param {PIXI.Transform} [transform] - A transformation to be applied\n     * @param {boolean} [skipUpdateTransform=false] - Whether to skip the update transform\n     */\n    render(displayObject, renderTexture, clear, transform, skipUpdateTransform)\n    {\n        if (!this.view)\n        {\n            return;\n        }\n\n        // can be handy to know!\n        this.renderingToScreen = !renderTexture;\n\n        this.emit('prerender');\n\n        if (renderTexture)\n        {\n            renderTexture = renderTexture.baseTexture || renderTexture;\n\n            if (!renderTexture._canvasRenderTarget)\n            {\n                renderTexture._canvasRenderTarget = new CanvasRenderTarget(\n                    renderTexture.width,\n                    renderTexture.height,\n                    renderTexture.resolution\n                );\n                renderTexture.source = renderTexture._canvasRenderTarget.canvas;\n                renderTexture.valid = true;\n            }\n\n            this.context = renderTexture._canvasRenderTarget.context;\n            this.resolution = renderTexture._canvasRenderTarget.resolution;\n        }\n        else\n        {\n            this.context = this.rootContext;\n        }\n\n        const context = this.context;\n\n        if (!renderTexture)\n        {\n            this._lastObjectRendered = displayObject;\n        }\n\n        if (!skipUpdateTransform)\n        {\n            // update the scene graph\n            const cacheParent = displayObject.parent;\n            const tempWt = this._tempDisplayObjectParent.transform.worldTransform;\n\n            if (transform)\n            {\n                transform.copy(tempWt);\n            }\n            else\n            {\n                tempWt.identity();\n            }\n\n            displayObject.parent = this._tempDisplayObjectParent;\n            displayObject.updateTransform();\n            displayObject.parent = cacheParent;\n            // displayObject.hitArea = //TODO add a temp hit area\n        }\n\n        context.setTransform(1, 0, 0, 1, 0, 0);\n        context.globalAlpha = 1;\n        context.globalCompositeOperation = this.blendModes[BLEND_MODES.NORMAL];\n\n        if (navigator.isCocoonJS && this.view.screencanvas)\n        {\n            context.fillStyle = 'black';\n            context.clear();\n        }\n\n        if (clear !== undefined ? clear : this.clearBeforeRender)\n        {\n            if (this.renderingToScreen)\n            {\n                if (this.transparent)\n                {\n                    context.clearRect(0, 0, this.width, this.height);\n                }\n                else\n                {\n                    context.fillStyle = this._backgroundColorString;\n                    context.fillRect(0, 0, this.width, this.height);\n                }\n            } // else {\n            // TODO: implement background for CanvasRenderTarget or RenderTexture?\n            // }\n        }\n\n        // TODO RENDER TARGET STUFF HERE..\n        const tempContext = this.context;\n\n        this.context = context;\n        displayObject.renderCanvas(this);\n        this.context = tempContext;\n\n        this.emit('postrender');\n    }\n\n    /**\n     * Sets the blend mode of the renderer.\n     *\n     * @param {number} blendMode - See {@link PIXI.BLEND_MODES} for valid values.\n     */\n    setBlendMode(blendMode)\n    {\n        if (this._activeBlendMode === blendMode)\n        {\n            return;\n        }\n\n        this._activeBlendMode = blendMode;\n        this.context.globalCompositeOperation = this.blendModes[blendMode];\n    }\n\n    /**\n     * Removes everything from the renderer and optionally removes the Canvas DOM element.\n     *\n     * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM.\n     */\n    destroy(removeView)\n    {\n        this.destroyPlugins();\n\n        // call the base destroy\n        super.destroy(removeView);\n\n        this.context = null;\n\n        this.refresh = true;\n\n        this.maskManager.destroy();\n        this.maskManager = null;\n\n        this.smoothProperty = null;\n    }\n\n    /**\n     * Resizes the canvas view to the specified width and height.\n     *\n     * @extends PIXI.SystemRenderer#resize\n     *\n     * @param {number} width - The new width of the canvas view\n     * @param {number} height - The new height of the canvas view\n     */\n    resize(width, height)\n    {\n        super.resize(width, height);\n\n        // reset the scale mode.. oddly this seems to be reset when the canvas is resized.\n        // surely a browser bug?? Let pixi fix that for you..\n        if (this.smoothProperty)\n        {\n            this.rootContext[this.smoothProperty] = (settings.SCALE_MODE === SCALE_MODES.LINEAR);\n        }\n    }\n}\n\npluginTarget.mixin(CanvasRenderer);\n","import { SHAPES } from '../../../const';\n\n/**\n * A set of functions used to handle masking.\n *\n * @class\n * @memberof PIXI\n */\nexport default class CanvasMaskManager\n{\n    /**\n     * @param {PIXI.CanvasRenderer} renderer - The canvas renderer.\n     */\n    constructor(renderer)\n    {\n        this.renderer = renderer;\n    }\n\n    /**\n     * This method adds it to the current stack of masks.\n     *\n     * @param {object} maskData - the maskData that will be pushed\n     */\n    pushMask(maskData)\n    {\n        const renderer = this.renderer;\n\n        renderer.context.save();\n\n        const cacheAlpha = maskData.alpha;\n        const transform = maskData.transform.worldTransform;\n        const resolution = renderer.resolution;\n\n        renderer.context.setTransform(\n            transform.a * resolution,\n            transform.b * resolution,\n            transform.c * resolution,\n            transform.d * resolution,\n            transform.tx * resolution,\n            transform.ty * resolution\n        );\n\n        // TODO suport sprite alpha masks??\n        // lots of effort required. If demand is great enough..\n        if (!maskData._texture)\n        {\n            this.renderGraphicsShape(maskData);\n            renderer.context.clip();\n        }\n\n        maskData.worldAlpha = cacheAlpha;\n    }\n\n    /**\n     * Renders a PIXI.Graphics shape.\n     *\n     * @param {PIXI.Graphics} graphics - The object to render.\n     */\n    renderGraphicsShape(graphics)\n    {\n        const context = this.renderer.context;\n        const len = graphics.graphicsData.length;\n\n        if (len === 0)\n        {\n            return;\n        }\n\n        context.beginPath();\n\n        for (let i = 0; i < len; i++)\n        {\n            const data = graphics.graphicsData[i];\n            const shape = data.shape;\n\n            if (data.type === SHAPES.POLY)\n            {\n                const points = shape.points;\n\n                context.moveTo(points[0], points[1]);\n\n                for (let j = 1; j < points.length / 2; j++)\n                {\n                    context.lineTo(points[j * 2], points[(j * 2) + 1]);\n                }\n\n                // if the first and last point are the same close the path - much neater :)\n                if (points[0] === points[points.length - 2] && points[1] === points[points.length - 1])\n                {\n                    context.closePath();\n                }\n            }\n            else if (data.type === SHAPES.RECT)\n            {\n                context.rect(shape.x, shape.y, shape.width, shape.height);\n                context.closePath();\n            }\n            else if (data.type === SHAPES.CIRC)\n            {\n                // TODO - need to be Undefined!\n                context.arc(shape.x, shape.y, shape.radius, 0, 2 * Math.PI);\n                context.closePath();\n            }\n            else if (data.type === SHAPES.ELIP)\n            {\n                // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n\n                const w = shape.width * 2;\n                const h = shape.height * 2;\n\n                const x = shape.x - (w / 2);\n                const y = shape.y - (h / 2);\n\n                const kappa = 0.5522848;\n                const ox = (w / 2) * kappa; // control point offset horizontal\n                const oy = (h / 2) * kappa; // control point offset vertical\n                const xe = x + w;           // x-end\n                const ye = y + h;           // y-end\n                const xm = x + (w / 2);       // x-middle\n                const ym = y + (h / 2);       // y-middle\n\n                context.moveTo(x, ym);\n                context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n                context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n                context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n                context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n                context.closePath();\n            }\n            else if (data.type === SHAPES.RREC)\n            {\n                const rx = shape.x;\n                const ry = shape.y;\n                const width = shape.width;\n                const height = shape.height;\n                let radius = shape.radius;\n\n                const maxRadius = Math.min(width, height) / 2 | 0;\n\n                radius = radius > maxRadius ? maxRadius : radius;\n\n                context.moveTo(rx, ry + radius);\n                context.lineTo(rx, ry + height - radius);\n                context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);\n                context.lineTo(rx + width - radius, ry + height);\n                context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);\n                context.lineTo(rx + width, ry + radius);\n                context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);\n                context.lineTo(rx + radius, ry);\n                context.quadraticCurveTo(rx, ry, rx, ry + radius);\n                context.closePath();\n            }\n        }\n    }\n\n    /**\n     * Restores the current drawing context to the state it was before the mask was applied.\n     *\n     * @param {PIXI.CanvasRenderer} renderer - The renderer context to use.\n     */\n    popMask(renderer)\n    {\n        renderer.context.restore();\n    }\n\n    /**\n     * Destroys this canvas mask manager.\n     *\n     */\n    destroy()\n    {\n        /* empty */\n    }\n}\n","import settings from '../../../settings';\nconst { RESOLUTION } = settings;\n\n/**\n * Creates a Canvas element of the given size.\n *\n * @class\n * @memberof PIXI\n */\nexport default class CanvasRenderTarget\n{\n    /**\n     * @param {number} width - the width for the newly created canvas\n     * @param {number} height - the height for the newly created canvas\n     * @param {number} [resolution=1] - The resolution / device pixel ratio of the canvas\n     */\n    constructor(width, height, resolution)\n    {\n        /**\n         * The Canvas object that belongs to this CanvasRenderTarget.\n         *\n         * @member {HTMLCanvasElement}\n         */\n        this.canvas = document.createElement('canvas');\n\n        /**\n         * A CanvasRenderingContext2D object representing a two-dimensional rendering context.\n         *\n         * @member {CanvasRenderingContext2D}\n         */\n        this.context = this.canvas.getContext('2d');\n\n        this.resolution = resolution || RESOLUTION;\n\n        this.resize(width, height);\n    }\n\n    /**\n     * Clears the canvas that was created by the CanvasRenderTarget class.\n     *\n     * @private\n     */\n    clear()\n    {\n        this.context.setTransform(1, 0, 0, 1, 0, 0);\n        this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n    }\n\n    /**\n     * Resizes the canvas to the specified width and height.\n     *\n     * @param {number} width - the new width of the canvas\n     * @param {number} height - the new height of the canvas\n     */\n    resize(width, height)\n    {\n        this.canvas.width = width * this.resolution;\n        this.canvas.height = height * this.resolution;\n    }\n\n    /**\n     * Destroys this canvas.\n     *\n     */\n    destroy()\n    {\n        this.context = null;\n        this.canvas = null;\n    }\n\n    /**\n     * The width of the canvas buffer in pixels.\n     *\n     * @member {number}\n     * @memberof PIXI.CanvasRenderTarget#\n     */\n    get width()\n    {\n        return this.canvas.width;\n    }\n\n    /**\n     * Sets the width.\n     *\n     * @param {number} val - The value to set.\n     */\n    set width(val)\n    {\n        this.canvas.width = val;\n    }\n\n    /**\n     * The height of the canvas buffer in pixels.\n     *\n     * @member {number}\n     * @memberof PIXI.CanvasRenderTarget#\n     */\n    get height()\n    {\n        return this.canvas.height;\n    }\n\n    /**\n     * Sets the height.\n     *\n     * @param {number} val - The value to set.\n     */\n    set height(val)\n    {\n        this.canvas.height = val;\n    }\n}\n","/**\n * Creates a little colored canvas\n *\n * @ignore\n * @param {string} color - The color to make the canvas\n * @return {canvas} a small canvas element\n */\nfunction createColoredCanvas(color)\n{\n    const canvas = document.createElement('canvas');\n\n    canvas.width = 6;\n    canvas.height = 1;\n\n    const context = canvas.getContext('2d');\n\n    context.fillStyle = color;\n    context.fillRect(0, 0, 6, 1);\n\n    return canvas;\n}\n\n/**\n * Checks whether the Canvas BlendModes are supported by the current browser\n *\n * @return {boolean} whether they are supported\n */\nexport default function canUseNewCanvasBlendModes()\n{\n    if (typeof document === 'undefined')\n    {\n        return false;\n    }\n\n    const magenta = createColoredCanvas('#ff00ff');\n    const yellow = createColoredCanvas('#ffff00');\n\n    const canvas = document.createElement('canvas');\n\n    canvas.width = 6;\n    canvas.height = 1;\n\n    const context = canvas.getContext('2d');\n\n    context.globalCompositeOperation = 'multiply';\n    context.drawImage(magenta, 0, 0);\n    context.drawImage(yellow, 2, 0);\n\n    const imageData = context.getImageData(2, 0, 1, 1);\n\n    if (!imageData)\n    {\n        return false;\n    }\n\n    const data = imageData.data;\n\n    return (data[0] === 255 && data[1] === 0 && data[2] === 0);\n}\n","import { BLEND_MODES } from '../../../const';\nimport canUseNewCanvasBlendModes from './canUseNewCanvasBlendModes';\n\n/**\n * Maps blend combinations to Canvas.\n *\n * @memberof PIXI\n * @function mapCanvasBlendModesToPixi\n * @private\n * @param {string[]} [array=[]] - The array to output into.\n * @return {string[]} Mapped modes.\n */\nexport default function mapCanvasBlendModesToPixi(array = [])\n{\n    if (canUseNewCanvasBlendModes())\n    {\n        array[BLEND_MODES.NORMAL] = 'source-over';\n        array[BLEND_MODES.ADD] = 'lighter'; // IS THIS OK???\n        array[BLEND_MODES.MULTIPLY] = 'multiply';\n        array[BLEND_MODES.SCREEN] = 'screen';\n        array[BLEND_MODES.OVERLAY] = 'overlay';\n        array[BLEND_MODES.DARKEN] = 'darken';\n        array[BLEND_MODES.LIGHTEN] = 'lighten';\n        array[BLEND_MODES.COLOR_DODGE] = 'color-dodge';\n        array[BLEND_MODES.COLOR_BURN] = 'color-burn';\n        array[BLEND_MODES.HARD_LIGHT] = 'hard-light';\n        array[BLEND_MODES.SOFT_LIGHT] = 'soft-light';\n        array[BLEND_MODES.DIFFERENCE] = 'difference';\n        array[BLEND_MODES.EXCLUSION] = 'exclusion';\n        array[BLEND_MODES.HUE] = 'hue';\n        array[BLEND_MODES.SATURATION] = 'saturate';\n        array[BLEND_MODES.COLOR] = 'color';\n        array[BLEND_MODES.LUMINOSITY] = 'luminosity';\n    }\n    else\n    {\n        // this means that the browser does not support the cool new blend modes in canvas 'cough' ie 'cough'\n        array[BLEND_MODES.NORMAL] = 'source-over';\n        array[BLEND_MODES.ADD] = 'lighter'; // IS THIS OK???\n        array[BLEND_MODES.MULTIPLY] = 'source-over';\n        array[BLEND_MODES.SCREEN] = 'source-over';\n        array[BLEND_MODES.OVERLAY] = 'source-over';\n        array[BLEND_MODES.DARKEN] = 'source-over';\n        array[BLEND_MODES.LIGHTEN] = 'source-over';\n        array[BLEND_MODES.COLOR_DODGE] = 'source-over';\n        array[BLEND_MODES.COLOR_BURN] = 'source-over';\n        array[BLEND_MODES.HARD_LIGHT] = 'source-over';\n        array[BLEND_MODES.SOFT_LIGHT] = 'source-over';\n        array[BLEND_MODES.DIFFERENCE] = 'source-over';\n        array[BLEND_MODES.EXCLUSION] = 'source-over';\n        array[BLEND_MODES.HUE] = 'source-over';\n        array[BLEND_MODES.SATURATION] = 'source-over';\n        array[BLEND_MODES.COLOR] = 'source-over';\n        array[BLEND_MODES.LUMINOSITY] = 'source-over';\n    }\n\n    return array;\n}\n","import { GC_MODES } from '../../const';\nimport settings from '../../settings';\n\n/**\n * TextureGarbageCollector. This class manages the GPU and ensures that it does not get clogged\n * up with textures that are no longer being used.\n *\n * @class\n * @memberof PIXI\n */\nexport default class TextureGarbageCollector\n{\n    /**\n     * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n     */\n    constructor(renderer)\n    {\n        this.renderer = renderer;\n\n        this.count = 0;\n        this.checkCount = 0;\n        this.maxIdle = settings.GC_MAX_IDLE;\n        this.checkCountMax = settings.GC_MAX_CHECK_COUNT;\n        this.mode = settings.GC_MODE;\n    }\n\n    /**\n     * Checks to see when the last time a texture was used\n     * if the texture has not been used for a specified amount of time it will be removed from the GPU\n     */\n    update()\n    {\n        this.count++;\n\n        if (this.mode === GC_MODES.MANUAL)\n        {\n            return;\n        }\n\n        this.checkCount++;\n\n        if (this.checkCount > this.checkCountMax)\n        {\n            this.checkCount = 0;\n\n            this.run();\n        }\n    }\n\n    /**\n     * Checks to see when the last time a texture was used\n     * if the texture has not been used for a specified amount of time it will be removed from the GPU\n     */\n    run()\n    {\n        const tm = this.renderer.textureManager;\n        const managedTextures =  tm._managedTextures;\n        let wasRemoved = false;\n\n        for (let i = 0; i < managedTextures.length; i++)\n        {\n            const texture = managedTextures[i];\n\n            // only supports non generated textures at the moment!\n            if (!texture._glRenderTargets && this.count - texture.touched > this.maxIdle)\n            {\n                tm.destroyTexture(texture, true);\n                managedTextures[i] = null;\n                wasRemoved = true;\n            }\n        }\n\n        if (wasRemoved)\n        {\n            let j = 0;\n\n            for (let i = 0; i < managedTextures.length; i++)\n            {\n                if (managedTextures[i] !== null)\n                {\n                    managedTextures[j++] = managedTextures[i];\n                }\n            }\n\n            managedTextures.length = j;\n        }\n    }\n\n    /**\n     * Removes all the textures within the specified displayObject and its children from the GPU\n     *\n     * @param {PIXI.DisplayObject} displayObject - the displayObject to remove the textures from.\n     */\n    unload(displayObject)\n    {\n        const tm = this.renderer.textureManager;\n\n        if (displayObject._texture)\n        {\n            tm.destroyTexture(displayObject._texture, true);\n        }\n\n        for (let i = displayObject.children.length - 1; i >= 0; i--)\n        {\n            this.unload(displayObject.children[i]);\n        }\n    }\n}\n","import { GLTexture } from 'pixi-gl-core';\nimport { WRAP_MODES, SCALE_MODES } from '../../const';\nimport RenderTarget from './utils/RenderTarget';\nimport { removeItems } from '../../utils';\n\n/**\n * Helper class to create a webGL Texture\n *\n * @class\n * @memberof PIXI\n */\nexport default class TextureManager\n{\n    /**\n     * @param {PIXI.WebGLRenderer} renderer - A reference to the current renderer\n     */\n    constructor(renderer)\n    {\n        /**\n         * A reference to the current renderer\n         *\n         * @member {PIXI.WebGLRenderer}\n         */\n        this.renderer = renderer;\n\n        /**\n         * The current WebGL rendering context\n         *\n         * @member {WebGLRenderingContext}\n         */\n        this.gl = renderer.gl;\n\n        /**\n         * Track textures in the renderer so we can no longer listen to them on destruction.\n         *\n         * @member {Array<*>}\n         * @private\n         */\n        this._managedTextures = [];\n    }\n\n    /**\n     * Binds a texture.\n     *\n     */\n    bindTexture()\n    {\n        // empty\n    }\n\n    /**\n     * Gets a texture.\n     *\n     */\n    getTexture()\n    {\n        // empty\n    }\n\n    /**\n     * Updates and/or Creates a WebGL texture for the renderer's context.\n     *\n     * @param {PIXI.BaseTexture|PIXI.Texture} texture - the texture to update\n     * @param {Number} location - the location the texture will be bound to.\n     * @return {GLTexture} The gl texture.\n     */\n    updateTexture(texture, location)\n    {\n        // assume it good!\n        // texture = texture.baseTexture || texture;\n        location = location || 0;\n\n        const gl = this.gl;\n\n        const isRenderTexture = !!texture._glRenderTargets;\n\n        if (!texture.hasLoaded)\n        {\n            return null;\n        }\n\n        gl.activeTexture(gl.TEXTURE0 + location);\n\n        let glTexture = texture._glTextures[this.renderer.CONTEXT_UID];\n\n        if (!glTexture)\n        {\n            if (isRenderTexture)\n            {\n                const renderTarget = new RenderTarget(\n                    this.gl,\n                    texture.width,\n                    texture.height,\n                    texture.scaleMode,\n                    texture.resolution\n                );\n\n                renderTarget.resize(texture.width, texture.height);\n                texture._glRenderTargets[this.renderer.CONTEXT_UID] = renderTarget;\n                glTexture = renderTarget.texture;\n            }\n            else\n            {\n                glTexture = new GLTexture(this.gl, null, null, null, null);\n                glTexture.bind(location);\n                glTexture.premultiplyAlpha = true;\n                glTexture.upload(texture.source);\n            }\n\n            texture._glTextures[this.renderer.CONTEXT_UID] = glTexture;\n\n            texture.on('update', this.updateTexture, this);\n            texture.on('dispose', this.destroyTexture, this);\n\n            this._managedTextures.push(texture);\n\n            if (texture.isPowerOfTwo)\n            {\n                if (texture.mipmap)\n                {\n                    glTexture.enableMipmap();\n                }\n\n                if (texture.wrapMode === WRAP_MODES.CLAMP)\n                {\n                    glTexture.enableWrapClamp();\n                }\n                else if (texture.wrapMode === WRAP_MODES.REPEAT)\n                {\n                    glTexture.enableWrapRepeat();\n                }\n                else\n                {\n                    glTexture.enableWrapMirrorRepeat();\n                }\n            }\n            else\n            {\n                glTexture.enableWrapClamp();\n            }\n\n            if (texture.scaleMode === SCALE_MODES.NEAREST)\n            {\n                glTexture.enableNearestScaling();\n            }\n            else\n            {\n                glTexture.enableLinearScaling();\n            }\n        }\n        // the texture already exists so we only need to update it..\n        else if (isRenderTexture)\n        {\n            texture._glRenderTargets[this.renderer.CONTEXT_UID].resize(texture.width, texture.height);\n        }\n        else\n        {\n            glTexture.upload(texture.source);\n        }\n\n        this.renderer.boundTextures[location] = texture;\n\n        return glTexture;\n    }\n\n    /**\n     * Deletes the texture from WebGL\n     *\n     * @param {PIXI.BaseTexture|PIXI.Texture} texture - the texture to destroy\n     * @param {boolean} [skipRemove=false] - Whether to skip removing the texture from the TextureManager.\n     */\n    destroyTexture(texture, skipRemove)\n    {\n        texture = texture.baseTexture || texture;\n\n        if (!texture.hasLoaded)\n        {\n            return;\n        }\n\n        if (texture._glTextures[this.renderer.CONTEXT_UID])\n        {\n            this.renderer.unbindTexture(texture);\n\n            texture._glTextures[this.renderer.CONTEXT_UID].destroy();\n            texture.off('update', this.updateTexture, this);\n            texture.off('dispose', this.destroyTexture, this);\n\n            delete texture._glTextures[this.renderer.CONTEXT_UID];\n\n            if (!skipRemove)\n            {\n                const i = this._managedTextures.indexOf(texture);\n\n                if (i !== -1)\n                {\n                    removeItems(this._managedTextures, i, 1);\n                }\n            }\n        }\n    }\n\n    /**\n     * Deletes all the textures from WebGL\n     */\n    removeAll()\n    {\n        // empty all the old gl textures as they are useless now\n        for (let i = 0; i < this._managedTextures.length; ++i)\n        {\n            const texture = this._managedTextures[i];\n\n            if (texture._glTextures[this.renderer.CONTEXT_UID])\n            {\n                delete texture._glTextures[this.renderer.CONTEXT_UID];\n            }\n        }\n    }\n\n    /**\n     * Destroys this manager and removes all its textures\n     */\n    destroy()\n    {\n        // destroy managed textures\n        for (let i = 0; i < this._managedTextures.length; ++i)\n        {\n            const texture = this._managedTextures[i];\n\n            this.destroyTexture(texture, true);\n\n            texture.off('update', this.updateTexture, this);\n            texture.off('dispose', this.destroyTexture, this);\n        }\n\n        this._managedTextures = null;\n    }\n}\n","import SystemRenderer from '../SystemRenderer';\nimport MaskManager from './managers/MaskManager';\nimport StencilManager from './managers/StencilManager';\nimport FilterManager from './managers/FilterManager';\nimport RenderTarget from './utils/RenderTarget';\nimport ObjectRenderer from './utils/ObjectRenderer';\nimport TextureManager from './TextureManager';\nimport BaseTexture from '../../textures/BaseTexture';\nimport TextureGarbageCollector from './TextureGarbageCollector';\nimport WebGLState from './WebGLState';\nimport mapWebGLDrawModesToPixi from './utils/mapWebGLDrawModesToPixi';\nimport validateContext from './utils/validateContext';\nimport { pluginTarget } from '../../utils';\nimport glCore from 'pixi-gl-core';\nimport { RENDERER_TYPE } from '../../const';\n\nlet CONTEXT_UID = 0;\n\n/**\n * The WebGLRenderer draws the scene and all its content onto a webGL enabled canvas. This renderer\n * should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs.\n * So no need for Sprite Batches or Sprite Clouds.\n * Don't forget to add the view to your DOM or you will not see anything :)\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.SystemRenderer\n */\nexport default class WebGLRenderer extends SystemRenderer\n{\n    /**\n     *\n     * @param {number} [width=0] - the width of the canvas view\n     * @param {number} [height=0] - the height of the canvas view\n     * @param {object} [options] - The optional renderer parameters\n     * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n     * @param {boolean} [options.transparent=false] - If the render view is transparent, default false\n     * @param {boolean} [options.autoResize=false] - If the render view is automatically resized, default false\n     * @param {boolean} [options.antialias=false] - sets antialias. If not available natively then FXAA\n     *  antialiasing is used\n     * @param {boolean} [options.forceFXAA=false] - forces FXAA antialiasing to be used over native.\n     *  FXAA is faster, but may not always look as great\n     * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer.\n     *  The resolution of the renderer retina would be 2.\n     * @param {boolean} [options.clearBeforeRender=true] - This sets if the CanvasRenderer will clear\n     *  the canvas or not before the new render pass. If you wish to set this to false, you *must* set\n     *  preserveDrawingBuffer to `true`.\n     * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation,\n     *  enable this if you need to call toDataUrl on the webgl context.\n     * @param {boolean} [options.roundPixels=false] - If true Pixi will Math.floor() x/y values when\n     *  rendering, stopping pixel interpolation.\n     */\n    constructor(width, height, options = {})\n    {\n        super('WebGL', width, height, options);\n\n        /**\n         * The type of this renderer as a standardised const\n         *\n         * @member {number}\n         * @see PIXI.RENDERER_TYPE\n         */\n        this.type = RENDERER_TYPE.WEBGL;\n\n        this.handleContextLost = this.handleContextLost.bind(this);\n        this.handleContextRestored = this.handleContextRestored.bind(this);\n\n        this.view.addEventListener('webglcontextlost', this.handleContextLost, false);\n        this.view.addEventListener('webglcontextrestored', this.handleContextRestored, false);\n\n        /**\n         * The options passed in to create a new webgl context.\n         *\n         * @member {object}\n         * @private\n         */\n        this._contextOptions = {\n            alpha: this.transparent,\n            antialias: options.antialias,\n            premultipliedAlpha: this.transparent && this.transparent !== 'notMultiplied',\n            stencil: true,\n            preserveDrawingBuffer: options.preserveDrawingBuffer,\n        };\n\n        this._backgroundColorRgba[3] = this.transparent ? 0 : 1;\n\n        /**\n         * Manages the masks using the stencil buffer.\n         *\n         * @member {PIXI.MaskManager}\n         */\n        this.maskManager = new MaskManager(this);\n\n        /**\n         * Manages the stencil buffer.\n         *\n         * @member {PIXI.StencilManager}\n         */\n        this.stencilManager = new StencilManager(this);\n\n        /**\n         * An empty renderer.\n         *\n         * @member {PIXI.ObjectRenderer}\n         */\n        this.emptyRenderer = new ObjectRenderer(this);\n\n        /**\n         * The currently active ObjectRenderer.\n         *\n         * @member {PIXI.ObjectRenderer}\n         */\n        this.currentRenderer = this.emptyRenderer;\n\n        this.initPlugins();\n\n        /**\n         * The current WebGL rendering context, it is created here\n         *\n         * @member {WebGLRenderingContext}\n         */\n        // initialize the context so it is ready for the managers.\n        if (options.context)\n        {\n            // checks to see if a context is valid..\n            validateContext(options.context);\n        }\n\n        this.gl = options.context || glCore.createContext(this.view, this._contextOptions);\n\n        this.CONTEXT_UID = CONTEXT_UID++;\n\n        /**\n         * The currently active ObjectRenderer.\n         *\n         * @member {PIXI.WebGLState}\n         */\n        this.state = new WebGLState(this.gl);\n\n        this.renderingToScreen = true;\n\n        /**\n         * Holds the current state of textures bound to the GPU.\n         * @type {Array}\n         */\n        this.boundTextures = null;\n\n        this._initContext();\n        /**\n         * Manages the filters.\n         *\n         * @member {PIXI.FilterManager}\n         */\n        this.filterManager = new FilterManager(this);\n        // map some webGL blend and drawmodes..\n        this.drawModes = mapWebGLDrawModesToPixi(this.gl);\n\n        /**\n         * Holds the current shader\n         *\n         * @member {PIXI.Shader}\n         */\n        this._activeShader = null;\n\n        this._activeVao = null;\n\n        /**\n         * Holds the current render target\n         *\n         * @member {PIXI.RenderTarget}\n         */\n        this._activeRenderTarget = null;\n\n        this._nextTextureLocation = 0;\n\n        this.setBlendMode(0);\n    }\n\n    /**\n     * Creates the WebGL context\n     *\n     * @private\n     */\n    _initContext()\n    {\n        const gl = this.gl;\n\n        // restore a context if it was previously lost\n        if (gl.isContextLost() && gl.getExtension('WEBGL_lose_context'))\n        {\n            gl.getExtension('WEBGL_lose_context').restoreContext();\n        }\n\n        const maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n\n        this.boundTextures = new Array(maxTextures);\n        this.emptyTextures = new Array(maxTextures);\n\n        // create a texture manager...\n        this.textureManager = new TextureManager(this);\n        this.textureGC = new TextureGarbageCollector(this);\n\n        this.state.resetToDefault();\n\n        this.rootRenderTarget = new RenderTarget(gl, this.width, this.height, null, this.resolution, true);\n        this.rootRenderTarget.clearColor = this._backgroundColorRgba;\n\n        this.bindRenderTarget(this.rootRenderTarget);\n\n        // now lets fill up the textures with empty ones!\n        const emptyGLTexture = new glCore.GLTexture.fromData(gl, null, 1, 1);\n\n        const tempObj = { _glTextures: {} };\n\n        tempObj._glTextures[this.CONTEXT_UID] = {};\n\n        for (let i = 0; i < maxTextures; i++)\n        {\n            const empty = new BaseTexture();\n\n            empty._glTextures[this.CONTEXT_UID] = emptyGLTexture;\n\n            this.boundTextures[i] = tempObj;\n            this.emptyTextures[i] = empty;\n            this.bindTexture(null, i);\n        }\n\n        this.emit('context', gl);\n\n        // setup the width/height properties and gl viewport\n        this.resize(this.width, this.height);\n    }\n\n    /**\n     * Renders the object to its webGL view\n     *\n     * @param {PIXI.DisplayObject} displayObject - the object to be rendered\n     * @param {PIXI.RenderTexture} renderTexture - The render texture to render to.\n     * @param {boolean} [clear] - Should the canvas be cleared before the new render\n     * @param {PIXI.Transform} [transform] - A transform to apply to the render texture before rendering.\n     * @param {boolean} [skipUpdateTransform] - Should we skip the update transform pass?\n     */\n    render(displayObject, renderTexture, clear, transform, skipUpdateTransform)\n    {\n        // can be handy to know!\n        this.renderingToScreen = !renderTexture;\n\n        this.emit('prerender');\n\n        // no point rendering if our context has been blown up!\n        if (!this.gl || this.gl.isContextLost())\n        {\n            return;\n        }\n\n        this._nextTextureLocation = 0;\n\n        if (!renderTexture)\n        {\n            this._lastObjectRendered = displayObject;\n        }\n\n        if (!skipUpdateTransform)\n        {\n            // update the scene graph\n            const cacheParent = displayObject.parent;\n\n            displayObject.parent = this._tempDisplayObjectParent;\n            displayObject.updateTransform();\n            displayObject.parent = cacheParent;\n           // displayObject.hitArea = //TODO add a temp hit area\n        }\n\n        this.bindRenderTexture(renderTexture, transform);\n\n        this.currentRenderer.start();\n\n        if (clear !== undefined ? clear : this.clearBeforeRender)\n        {\n            this._activeRenderTarget.clear();\n        }\n\n        displayObject.renderWebGL(this);\n\n        // apply transform..\n        this.currentRenderer.flush();\n\n        // this.setObjectRenderer(this.emptyRenderer);\n\n        this.textureGC.update();\n\n        this.emit('postrender');\n    }\n\n    /**\n     * Changes the current renderer to the one given in parameter\n     *\n     * @param {PIXI.ObjectRenderer} objectRenderer - The object renderer to use.\n     */\n    setObjectRenderer(objectRenderer)\n    {\n        if (this.currentRenderer === objectRenderer)\n        {\n            return;\n        }\n\n        this.currentRenderer.stop();\n        this.currentRenderer = objectRenderer;\n        this.currentRenderer.start();\n    }\n\n    /**\n     * This should be called if you wish to do some custom rendering\n     * It will basically render anything that may be batched up such as sprites\n     *\n     */\n    flush()\n    {\n        this.setObjectRenderer(this.emptyRenderer);\n    }\n\n    /**\n     * Resizes the webGL view to the specified width and height.\n     *\n     * @param {number} width - the new width of the webGL view\n     * @param {number} height - the new height of the webGL view\n     */\n    resize(width, height)\n    {\n      //  if(width * this.resolution === this.width && height * this.resolution === this.height)return;\n\n        SystemRenderer.prototype.resize.call(this, width, height);\n\n        this.rootRenderTarget.resize(width, height);\n\n        if (this._activeRenderTarget === this.rootRenderTarget)\n        {\n            this.rootRenderTarget.activate();\n\n            if (this._activeShader)\n            {\n                this._activeShader.uniforms.projectionMatrix = this.rootRenderTarget.projectionMatrix.toArray(true);\n            }\n        }\n    }\n\n    /**\n     * Resizes the webGL view to the specified width and height.\n     *\n     * @param {number} blendMode - the desired blend mode\n     */\n    setBlendMode(blendMode)\n    {\n        this.state.setBlendMode(blendMode);\n    }\n\n    /**\n     * Erases the active render target and fills the drawing area with a colour\n     *\n     * @param {number} [clearColor] - The colour\n     */\n    clear(clearColor)\n    {\n        this._activeRenderTarget.clear(clearColor);\n    }\n\n    /**\n     * Sets the transform of the active render target to the given matrix\n     *\n     * @param {PIXI.Matrix} matrix - The transformation matrix\n     */\n    setTransform(matrix)\n    {\n        this._activeRenderTarget.transform = matrix;\n    }\n\n    /**\n     * Binds a render texture for rendering\n     *\n     * @param {PIXI.RenderTexture} renderTexture - The render texture to render\n     * @param {PIXI.Transform} transform - The transform to be applied to the render texture\n     * @return {PIXI.WebGLRenderer} Returns itself.\n     */\n    bindRenderTexture(renderTexture, transform)\n    {\n        let renderTarget;\n\n        if (renderTexture)\n        {\n            const baseTexture = renderTexture.baseTexture;\n\n            if (!baseTexture._glRenderTargets[this.CONTEXT_UID])\n            {\n                // bind the current texture\n                this.textureManager.updateTexture(baseTexture, 0);\n            }\n\n            this.unbindTexture(baseTexture);\n\n            renderTarget = baseTexture._glRenderTargets[this.CONTEXT_UID];\n            renderTarget.setFrame(renderTexture.frame);\n        }\n        else\n        {\n            renderTarget = this.rootRenderTarget;\n        }\n\n        renderTarget.transform = transform;\n        this.bindRenderTarget(renderTarget);\n\n        return this;\n    }\n\n    /**\n     * Changes the current render target to the one given in parameter\n     *\n     * @param {PIXI.RenderTarget} renderTarget - the new render target\n     * @return {PIXI.WebGLRenderer} Returns itself.\n     */\n    bindRenderTarget(renderTarget)\n    {\n        if (renderTarget !== this._activeRenderTarget)\n        {\n            this._activeRenderTarget = renderTarget;\n            renderTarget.activate();\n\n            if (this._activeShader)\n            {\n                this._activeShader.uniforms.projectionMatrix = renderTarget.projectionMatrix.toArray(true);\n            }\n\n            this.stencilManager.setMaskStack(renderTarget.stencilMaskStack);\n        }\n\n        return this;\n    }\n\n    /**\n     * Changes the current shader to the one given in parameter\n     *\n     * @param {PIXI.Shader} shader - the new shader\n     * @return {PIXI.WebGLRenderer} Returns itself.\n     */\n    bindShader(shader)\n    {\n        // TODO cache\n        if (this._activeShader !== shader)\n        {\n            this._activeShader = shader;\n            shader.bind();\n\n            // automatically set the projection matrix\n            shader.uniforms.projectionMatrix = this._activeRenderTarget.projectionMatrix.toArray(true);\n        }\n\n        return this;\n    }\n\n    /**\n     * Binds the texture. This will return the location of the bound texture.\n     * It may not be the same as the one you pass in. This is due to optimisation that prevents\n     * needless binding of textures. For example if the texture is already bound it will return the\n     * current location of the texture instead of the one provided. To bypass this use force location\n     *\n     * @param {PIXI.Texture} texture - the new texture\n     * @param {number} location - the suggested texture location\n     * @param {boolean} forceLocation - force the location\n     * @return {PIXI.WebGLRenderer} Returns itself.\n     */\n    bindTexture(texture, location, forceLocation)\n    {\n        texture = texture || this.emptyTextures[location];\n        texture = texture.baseTexture || texture;\n        texture.touched = this.textureGC.count;\n\n        if (!forceLocation)\n        {\n            // TODO - maybe look into adding boundIds.. save us the loop?\n            for (let i = 0; i < this.boundTextures.length; i++)\n            {\n                if (this.boundTextures[i] === texture)\n                {\n                    return i;\n                }\n            }\n\n            if (location === undefined)\n            {\n                this._nextTextureLocation++;\n                this._nextTextureLocation %= this.boundTextures.length;\n                location = this.boundTextures.length - this._nextTextureLocation - 1;\n            }\n        }\n        else\n        {\n            location = location || 0;\n        }\n\n        const gl = this.gl;\n        const glTexture = texture._glTextures[this.CONTEXT_UID];\n\n        if (!glTexture)\n        {\n            // this will also bind the texture..\n            this.textureManager.updateTexture(texture, location);\n        }\n        else\n        {\n            // bind the current texture\n            this.boundTextures[location] = texture;\n            gl.activeTexture(gl.TEXTURE0 + location);\n            gl.bindTexture(gl.TEXTURE_2D, glTexture.texture);\n        }\n\n        return location;\n    }\n\n     /**\n     * unbinds the texture ...\n     *\n     * @param {PIXI.Texture} texture - the texture to unbind\n     * @return {PIXI.WebGLRenderer} Returns itself.\n     */\n    unbindTexture(texture)\n    {\n        const gl = this.gl;\n\n        texture = texture.baseTexture || texture;\n\n        for (let i = 0; i < this.boundTextures.length; i++)\n        {\n            if (this.boundTextures[i] === texture)\n            {\n                this.boundTextures[i] = this.emptyTextures[i];\n\n                gl.activeTexture(gl.TEXTURE0 + i);\n                gl.bindTexture(gl.TEXTURE_2D, this.emptyTextures[i]._glTextures[this.CONTEXT_UID].texture);\n            }\n        }\n\n        return this;\n    }\n\n    /**\n     * Creates a new VAO from this renderer's context and state.\n     *\n     * @return {VertexArrayObject} The new VAO.\n     */\n    createVao()\n    {\n        return new glCore.VertexArrayObject(this.gl, this.state.attribState);\n    }\n\n    /**\n     * Changes the current Vao to the one given in parameter\n     *\n     * @param {PIXI.VertexArrayObject} vao - the new Vao\n     * @return {PIXI.WebGLRenderer} Returns itself.\n     */\n    bindVao(vao)\n    {\n        if (this._activeVao === vao)\n        {\n            return this;\n        }\n\n        if (vao)\n        {\n            vao.bind();\n        }\n        else if (this._activeVao)\n        {\n            // TODO this should always be true i think?\n            this._activeVao.unbind();\n        }\n\n        this._activeVao = vao;\n\n        return this;\n    }\n\n    /**\n     * Resets the WebGL state so you can render things however you fancy!\n     *\n     * @return {PIXI.WebGLRenderer} Returns itself.\n     */\n    reset()\n    {\n        this.setObjectRenderer(this.emptyRenderer);\n\n        this._activeShader = null;\n        this._activeRenderTarget = this.rootRenderTarget;\n\n        // bind the main frame buffer (the screen);\n        this.rootRenderTarget.activate();\n\n        this.state.resetToDefault();\n\n        return this;\n    }\n\n    /**\n     * Handles a lost webgl context\n     *\n     * @private\n     * @param {WebGLContextEvent} event - The context lost event.\n     */\n    handleContextLost(event)\n    {\n        event.preventDefault();\n    }\n\n    /**\n     * Handles a restored webgl context\n     *\n     * @private\n     */\n    handleContextRestored()\n    {\n        this._initContext();\n        this.textureManager.removeAll();\n    }\n\n    /**\n     * Removes everything from the renderer (event listeners, spritebatch, etc...)\n     *\n     * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM.\n     *  See: https://github.com/pixijs/pixi.js/issues/2233\n     */\n    destroy(removeView)\n    {\n        this.destroyPlugins();\n\n        // remove listeners\n        this.view.removeEventListener('webglcontextlost', this.handleContextLost);\n        this.view.removeEventListener('webglcontextrestored', this.handleContextRestored);\n\n        this.textureManager.destroy();\n\n        // call base destroy\n        super.destroy(removeView);\n\n        this.uid = 0;\n\n        // destroy the managers\n        this.maskManager.destroy();\n        this.stencilManager.destroy();\n        this.filterManager.destroy();\n\n        this.maskManager = null;\n        this.filterManager = null;\n        this.textureManager = null;\n        this.currentRenderer = null;\n\n        this.handleContextLost = null;\n        this.handleContextRestored = null;\n\n        this._contextOptions = null;\n        this.gl.useProgram(null);\n\n        if (this.gl.getExtension('WEBGL_lose_context'))\n        {\n            this.gl.getExtension('WEBGL_lose_context').loseContext();\n        }\n\n        this.gl = null;\n\n        // this = null;\n    }\n}\n\npluginTarget.mixin(WebGLRenderer);\n","import mapWebGLBlendModesToPixi from './utils/mapWebGLBlendModesToPixi';\n\nconst BLEND = 0;\nconst DEPTH_TEST = 1;\nconst FRONT_FACE = 2;\nconst CULL_FACE = 3;\nconst BLEND_FUNC = 4;\n\n/**\n * A WebGL state machines\n *\n * @memberof PIXI\n * @class\n */\nexport default class WebGLState\n{\n    /**\n     * @param {WebGLRenderingContext} gl - The current WebGL rendering context\n     */\n    constructor(gl)\n    {\n        /**\n         * The current active state\n         *\n         * @member {Uint8Array}\n         */\n        this.activeState = new Uint8Array(16);\n\n        /**\n         * The default state\n         *\n         * @member {Uint8Array}\n         */\n        this.defaultState = new Uint8Array(16);\n\n        // default blend mode..\n        this.defaultState[0] = 1;\n\n        /**\n         * The current state index in the stack\n         *\n         * @member {number}\n         * @private\n         */\n        this.stackIndex = 0;\n\n        /**\n         * The stack holding all the different states\n         *\n         * @member {Array<*>}\n         * @private\n         */\n        this.stack = [];\n\n        /**\n         * The current WebGL rendering context\n         *\n         * @member {WebGLRenderingContext}\n         */\n        this.gl = gl;\n\n        this.maxAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\n\n        this.attribState = {\n            tempAttribState: new Array(this.maxAttribs),\n            attribState: new Array(this.maxAttribs),\n        };\n\n        this.blendModes = mapWebGLBlendModesToPixi(gl);\n\n        // check we have vao..\n        this.nativeVaoExtension = (\n            gl.getExtension('OES_vertex_array_object')\n            || gl.getExtension('MOZ_OES_vertex_array_object')\n            || gl.getExtension('WEBKIT_OES_vertex_array_object')\n        );\n    }\n\n    /**\n     * Pushes a new active state\n     */\n    push()\n    {\n        // next state..\n        let state = this.stack[++this.stackIndex];\n\n        if (!state)\n        {\n            state = this.stack[this.stackIndex] = new Uint8Array(16);\n        }\n\n        // copy state..\n        // set active state so we can force overrides of gl state\n        for (let i = 0; i < this.activeState.length; i++)\n        {\n            this.activeState[i] = state[i];\n        }\n    }\n\n    /**\n     * Pops a state out\n     */\n    pop()\n    {\n        const state = this.stack[--this.stackIndex];\n\n        this.setState(state);\n    }\n\n    /**\n     * Sets the current state\n     *\n     * @param {*} state - The state to set.\n     */\n    setState(state)\n    {\n        this.setBlend(state[BLEND]);\n        this.setDepthTest(state[DEPTH_TEST]);\n        this.setFrontFace(state[FRONT_FACE]);\n        this.setCullFace(state[CULL_FACE]);\n        this.setBlendMode(state[BLEND_FUNC]);\n    }\n\n    /**\n     * Enables or disabled blending.\n     *\n     * @param {boolean} value - Turn on or off webgl blending.\n     */\n    setBlend(value)\n    {\n        value = value ? 1 : 0;\n\n        if (this.activeState[BLEND] === value)\n        {\n            return;\n        }\n\n        this.activeState[BLEND] = value;\n        this.gl[value ? 'enable' : 'disable'](this.gl.BLEND);\n    }\n\n    /**\n     * Sets the blend mode.\n     *\n     * @param {number} value - The blend mode to set to.\n     */\n    setBlendMode(value)\n    {\n        if (value === this.activeState[BLEND_FUNC])\n        {\n            return;\n        }\n\n        this.activeState[BLEND_FUNC] = value;\n\n        this.gl.blendFunc(this.blendModes[value][0], this.blendModes[value][1]);\n    }\n\n    /**\n     * Sets whether to enable or disable depth test.\n     *\n     * @param {boolean} value - Turn on or off webgl depth testing.\n     */\n    setDepthTest(value)\n    {\n        value = value ? 1 : 0;\n\n        if (this.activeState[DEPTH_TEST] === value)\n        {\n            return;\n        }\n\n        this.activeState[DEPTH_TEST] = value;\n        this.gl[value ? 'enable' : 'disable'](this.gl.DEPTH_TEST);\n    }\n\n    /**\n     * Sets whether to enable or disable cull face.\n     *\n     * @param {boolean} value - Turn on or off webgl cull face.\n     */\n    setCullFace(value)\n    {\n        value = value ? 1 : 0;\n\n        if (this.activeState[CULL_FACE] === value)\n        {\n            return;\n        }\n\n        this.activeState[CULL_FACE] = value;\n        this.gl[value ? 'enable' : 'disable'](this.gl.CULL_FACE);\n    }\n\n    /**\n     * Sets the gl front face.\n     *\n     * @param {boolean} value - true is clockwise and false is counter-clockwise\n     */\n    setFrontFace(value)\n    {\n        value = value ? 1 : 0;\n\n        if (this.activeState[FRONT_FACE] === value)\n        {\n            return;\n        }\n\n        this.activeState[FRONT_FACE] = value;\n        this.gl.frontFace(this.gl[value ? 'CW' : 'CCW']);\n    }\n\n    /**\n     * Disables all the vaos in use\n     *\n     */\n    resetAttributes()\n    {\n        for (let i = 0; i < this.attribState.tempAttribState.length; i++)\n        {\n            this.attribState.tempAttribState[i] = 0;\n        }\n\n        for (let i = 0; i < this.attribState.attribState.length; i++)\n        {\n            this.attribState.attribState[i] = 0;\n        }\n\n        // im going to assume one is always active for performance reasons.\n        for (let i = 1; i < this.maxAttribs; i++)\n        {\n            this.gl.disableVertexAttribArray(i);\n        }\n    }\n\n    // used\n    /**\n     * Resets all the logic and disables the vaos\n     */\n    resetToDefault()\n    {\n        // unbind any VAO if they exist..\n        if (this.nativeVaoExtension)\n        {\n            this.nativeVaoExtension.bindVertexArrayOES(null);\n        }\n\n        // reset all attributes..\n        this.resetAttributes();\n\n        // set active state so we can force overrides of gl state\n        for (let i = 0; i < this.activeState.length; ++i)\n        {\n            this.activeState[i] = 32;\n        }\n\n        this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, false);\n\n        this.setState(this.defaultState);\n    }\n}\n","import extractUniformsFromSrc from './extractUniformsFromSrc';\nimport { uid } from '../../../utils';\nimport { BLEND_MODES } from '../../../const';\n\nconst SOURCE_KEY_MAP = {};\n\n// let math = require('../../../math');\n/**\n * @class\n * @memberof PIXI\n * @extends PIXI.Shader\n */\nclass Filter\n{\n    /**\n     * @param {string} [vertexSrc] - The source of the vertex shader.\n     * @param {string} [fragmentSrc] - The source of the fragment shader.\n     * @param {object} [uniforms] - Custom uniforms to use to augment the built-in ones.\n     */\n    constructor(vertexSrc, fragmentSrc, uniforms)\n    {\n        /**\n         * The vertex shader.\n         *\n         * @member {string}\n         */\n        this.vertexSrc = vertexSrc || Filter.defaultVertexSrc;\n\n        /**\n         * The fragment shader.\n         *\n         * @member {string}\n         */\n        this.fragmentSrc = fragmentSrc || Filter.defaultFragmentSrc;\n\n        this.blendMode = BLEND_MODES.NORMAL;\n\n        // pull out the vertex and shader uniforms if they are not specified..\n        // currently this does not extract structs only default types\n        this.uniformData = uniforms || extractUniformsFromSrc(this.vertexSrc, this.fragmentSrc, 'projectionMatrix|uSampler');\n\n        /**\n         * An object containing the current values of custom uniforms.\n         * @example Updating the value of a custom uniform\n         * filter.uniforms.time = performance.now();\n         *\n         * @member {object}\n         */\n        this.uniforms = {};\n\n        for (const i in this.uniformData)\n        {\n            this.uniforms[i] = this.uniformData[i].value;\n        }\n\n        // this is where we store shader references..\n        // TODO we could cache this!\n        this.glShaders = {};\n\n        // used for cacheing.. sure there is a better way!\n        if (!SOURCE_KEY_MAP[this.vertexSrc + this.fragmentSrc])\n        {\n            SOURCE_KEY_MAP[this.vertexSrc + this.fragmentSrc] = uid();\n        }\n\n        this.glShaderKey = SOURCE_KEY_MAP[this.vertexSrc + this.fragmentSrc];\n\n        /**\n         * The padding of the filter. Some filters require extra space to breath such as a blur.\n         * Increasing this will add extra width and height to the bounds of the object that the\n         * filter is applied to.\n         *\n         * @member {number}\n         */\n        this.padding = 4;\n\n        /**\n         * The resolution of the filter. Setting this to be lower will lower the quality but\n         * increase the performance of the filter.\n         *\n         * @member {number}\n         */\n        this.resolution = 1;\n\n        /**\n         * If enabled is true the filter is applied, if false it will not.\n         *\n         * @member {boolean}\n         */\n        this.enabled = true;\n    }\n\n    /**\n     * Applies the filter\n     *\n     * @param {PIXI.FilterManager} filterManager - The renderer to retrieve the filter from\n     * @param {PIXI.RenderTarget} input - The input render target.\n     * @param {PIXI.RenderTarget} output - The target to output to.\n     * @param {boolean} clear - Should the output be cleared before rendering to it\n     */\n    apply(filterManager, input, output, clear)\n    {\n        // --- //\n        //  this.uniforms.filterMatrix = filterManager.calculateSpriteMatrix(tempMatrix, window.panda );\n\n        // do as you please!\n\n        filterManager.applyFilter(this, input, output, clear);\n\n        // or just do a regular render..\n    }\n\n    /**\n     * The default vertex shader source\n     *\n     * @static\n     * @constant\n     */\n    static get defaultVertexSrc()\n    {\n        return [\n            'attribute vec2 aVertexPosition;',\n            'attribute vec2 aTextureCoord;',\n\n            'uniform mat3 projectionMatrix;',\n            'uniform mat3 filterMatrix;',\n\n            'varying vec2 vTextureCoord;',\n            'varying vec2 vFilterCoord;',\n\n            'void main(void){',\n            '   gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);',\n            '   vFilterCoord = ( filterMatrix * vec3( aTextureCoord, 1.0)  ).xy;',\n            '   vTextureCoord = aTextureCoord ;',\n            '}',\n        ].join('\\n');\n    }\n\n    /**\n     * The default fragment shader source\n     *\n     * @static\n     * @constant\n     */\n    static get defaultFragmentSrc()\n    {\n        return [\n            'varying vec2 vTextureCoord;',\n            'varying vec2 vFilterCoord;',\n\n            'uniform sampler2D uSampler;',\n            'uniform sampler2D filterSampler;',\n\n            'void main(void){',\n            '   vec4 masky = texture2D(filterSampler, vFilterCoord);',\n            '   vec4 sample = texture2D(uSampler, vTextureCoord);',\n            '   vec4 color;',\n            '   if(mod(vFilterCoord.x, 1.0) > 0.5)',\n            '   {',\n            '     color = vec4(1.0, 0.0, 0.0, 1.0);',\n            '   }',\n            '   else',\n            '   {',\n            '     color = vec4(0.0, 1.0, 0.0, 1.0);',\n            '   }',\n            // '   gl_FragColor = vec4(mod(vFilterCoord.x, 1.5), vFilterCoord.y,0.0,1.0);',\n            '   gl_FragColor = mix(sample, masky, 0.5);',\n            '   gl_FragColor *= sample.a;',\n            '}',\n        ].join('\\n');\n    }\n}\n\nexport default Filter;\n","import glCore from 'pixi-gl-core';\n\nconst defaultValue = glCore.shader.defaultValue;\n\nexport default function extractUniformsFromSrc(vertexSrc, fragmentSrc, mask)\n{\n    const vertUniforms = extractUniformsFromString(vertexSrc, mask);\n    const fragUniforms = extractUniformsFromString(fragmentSrc, mask);\n\n    return Object.assign(vertUniforms, fragUniforms);\n}\n\nfunction extractUniformsFromString(string)\n{\n    const maskRegex = new RegExp('^(projectionMatrix|uSampler|filterArea)$');\n\n    const uniforms = {};\n    let nameSplit;\n\n    // clean the lines a little - remove extra spaces / tabs etc\n    // then split along ';'\n    const lines = string.replace(/\\s+/g, ' ')\n                .split(/\\s*;\\s*/);\n\n    // loop through..\n    for (let i = 0; i < lines.length; i++)\n    {\n        const line = lines[i].trim();\n\n        if (line.indexOf('uniform') > -1)\n        {\n            const splitLine = line.split(' ');\n            const type = splitLine[1];\n\n            let name = splitLine[2];\n            let size = 1;\n\n            if (name.indexOf('[') > -1)\n            {\n                // array!\n                nameSplit = name.split(/\\[|]/);\n                name = nameSplit[0];\n                size *= Number(nameSplit[1]);\n            }\n\n            if (!name.match(maskRegex))\n            {\n                uniforms[name] = {\n                    value: defaultValue(type, size),\n                    name,\n                    type,\n                };\n            }\n        }\n    }\n\n    return uniforms;\n}\n","import { Matrix } from '../../../math';\n\n/*\n * Calculates the mapped matrix\n * @param filterArea {Rectangle} The filter area\n * @param sprite {Sprite} the target sprite\n * @param outputMatrix {Matrix} @alvin\n */\n// TODO playing around here.. this is temporary - (will end up in the shader)\n// this returns a matrix that will normalise map filter cords in the filter to screen space\nexport function calculateScreenSpaceMatrix(outputMatrix, filterArea, textureSize)\n{\n     // let worldTransform = sprite.worldTransform.copy(Matrix.TEMP_MATRIX),\n    // let texture = {width:1136, height:700};//sprite._texture.baseTexture;\n\n    // TODO unwrap?\n    const mappedMatrix = outputMatrix.identity();\n\n    mappedMatrix.translate(filterArea.x / textureSize.width, filterArea.y / textureSize.height);\n\n    mappedMatrix.scale(textureSize.width, textureSize.height);\n\n    return mappedMatrix;\n}\n\nexport function calculateNormalizedScreenSpaceMatrix(outputMatrix, filterArea, textureSize)\n{\n    const mappedMatrix = outputMatrix.identity();\n\n    mappedMatrix.translate(filterArea.x / textureSize.width, filterArea.y / textureSize.height);\n\n    const translateScaleX = (textureSize.width / filterArea.width);\n    const translateScaleY = (textureSize.height / filterArea.height);\n\n    mappedMatrix.scale(translateScaleX, translateScaleY);\n\n    return mappedMatrix;\n}\n\n// this will map the filter coord so that a texture can be used based on the transform of a sprite\nexport function calculateSpriteMatrix(outputMatrix, filterArea, textureSize, sprite)\n{\n    const worldTransform = sprite.worldTransform.copy(Matrix.TEMP_MATRIX);\n    const texture = sprite._texture.baseTexture;\n\n    // TODO unwrap?\n    const mappedMatrix = outputMatrix.identity();\n\n    // scale..\n    const ratio = textureSize.height / textureSize.width;\n\n    mappedMatrix.translate(filterArea.x / textureSize.width, filterArea.y / textureSize.height);\n\n    mappedMatrix.scale(1, ratio);\n\n    const translateScaleX = (textureSize.width / texture.width);\n    const translateScaleY = (textureSize.height / texture.height);\n\n    worldTransform.tx /= texture.width * translateScaleX;\n\n    // this...?  free beer for anyone who can explain why this makes sense!\n    worldTransform.ty /= texture.width * translateScaleX;\n    // worldTransform.ty /= texture.height * translateScaleY;\n\n    worldTransform.invert();\n    mappedMatrix.prepend(worldTransform);\n\n    // apply inverse scale..\n    mappedMatrix.scale(1, 1 / ratio);\n\n    mappedMatrix.scale(translateScaleX, translateScaleY);\n\n    mappedMatrix.translate(sprite.anchor.x, sprite.anchor.y);\n\n    return mappedMatrix;\n}\n","import Filter from '../Filter';\nimport { Matrix } from '../../../../math';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\n\n/**\n * The SpriteMaskFilter class\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI\n */\nexport default class SpriteMaskFilter extends Filter\n{\n    /**\n     * @param {PIXI.Sprite} sprite - the target sprite\n     */\n    constructor(sprite)\n    {\n        const maskMatrix = new Matrix();\n\n        super(\n            readFileSync(join(__dirname, './spriteMaskFilter.vert'), 'utf8'),\n            readFileSync(join(__dirname, './spriteMaskFilter.frag'), 'utf8')\n        );\n\n        sprite.renderable = false;\n\n        this.maskSprite = sprite;\n        this.maskMatrix = maskMatrix;\n    }\n\n    /**\n     * Applies the filter\n     *\n     * @param {PIXI.FilterManager} filterManager - The renderer to retrieve the filter from\n     * @param {PIXI.RenderTarget} input - The input render target.\n     * @param {PIXI.RenderTarget} output - The target to output to.\n     */\n    apply(filterManager, input, output)\n    {\n        const maskSprite = this.maskSprite;\n\n        this.uniforms.mask = maskSprite._texture;\n        this.uniforms.otherMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, maskSprite);\n        this.uniforms.alpha = maskSprite.worldAlpha;\n\n        filterManager.applyFilter(this, input, output);\n    }\n}\n","import WebGLManager from './WebGLManager';\nimport RenderTarget from '../utils/RenderTarget';\nimport Quad from '../utils/Quad';\nimport { Rectangle } from '../../../math';\nimport Shader from '../../../Shader';\nimport * as filterTransforms from '../filters/filterTransforms';\nimport bitTwiddle from 'bit-twiddle';\n\n/**\n * @ignore\n * @class\n */\nclass FilterState\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        this.renderTarget = null;\n        this.sourceFrame = new Rectangle();\n        this.destinationFrame = new Rectangle();\n        this.filters = [];\n        this.target = null;\n        this.resolution = 1;\n    }\n}\n\n/**\n * @class\n * @memberof PIXI\n * @extends PIXI.WebGLManager\n */\nexport default class FilterManager extends WebGLManager\n{\n    /**\n     * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n     */\n    constructor(renderer)\n    {\n        super(renderer);\n\n        this.gl = this.renderer.gl;\n        // know about sprites!\n        this.quad = new Quad(this.gl, renderer.state.attribState);\n\n        this.shaderCache = {};\n        // todo add default!\n        this.pool = {};\n\n        this.filterData = null;\n    }\n\n    /**\n     * Adds a new filter to the manager.\n     *\n     * @param {PIXI.DisplayObject} target - The target of the filter to render.\n     * @param {PIXI.Filter[]} filters - The filters to apply.\n     */\n    pushFilter(target, filters)\n    {\n        const renderer = this.renderer;\n\n        let filterData = this.filterData;\n\n        if (!filterData)\n        {\n            filterData = this.renderer._activeRenderTarget.filterStack;\n\n            // add new stack\n            const filterState = new FilterState();\n\n            filterState.sourceFrame = filterState.destinationFrame = this.renderer._activeRenderTarget.size;\n            filterState.renderTarget = renderer._activeRenderTarget;\n\n            this.renderer._activeRenderTarget.filterData = filterData = {\n                index: 0,\n                stack: [filterState],\n            };\n\n            this.filterData = filterData;\n        }\n\n        // get the current filter state..\n        let currentState = filterData.stack[++filterData.index];\n\n        if (!currentState)\n        {\n            currentState = filterData.stack[filterData.index] = new FilterState();\n        }\n\n        // for now we go off the filter of the first resolution..\n        const resolution = filters[0].resolution;\n        const padding = filters[0].padding | 0;\n        const targetBounds = target.filterArea || target.getBounds(true);\n        const sourceFrame = currentState.sourceFrame;\n        const destinationFrame = currentState.destinationFrame;\n\n        sourceFrame.x = ((targetBounds.x * resolution) | 0) / resolution;\n        sourceFrame.y = ((targetBounds.y * resolution) | 0) / resolution;\n        sourceFrame.width = ((targetBounds.width * resolution) | 0) / resolution;\n        sourceFrame.height = ((targetBounds.height * resolution) | 0) / resolution;\n\n        if (filterData.stack[0].renderTarget.transform)\n        { //\n\n            // TODO we should fit the rect around the transform..\n        }\n        else\n        {\n            sourceFrame.fit(filterData.stack[0].destinationFrame);\n        }\n\n        // lets apply the padding After we fit the element to the screen.\n        // this should stop the strange side effects that can occur when cropping to the edges\n        sourceFrame.pad(padding);\n\n        destinationFrame.width = sourceFrame.width;\n        destinationFrame.height = sourceFrame.height;\n\n        // lets play the padding after we fit the element to the screen.\n        // this should stop the strange side effects that can occur when cropping to the edges\n\n        const renderTarget = this.getPotRenderTarget(renderer.gl, sourceFrame.width, sourceFrame.height, resolution);\n\n        currentState.target = target;\n        currentState.filters = filters;\n        currentState.resolution = resolution;\n        currentState.renderTarget = renderTarget;\n\n        // bind the render target to draw the shape in the top corner..\n\n        renderTarget.setFrame(destinationFrame, sourceFrame);\n        // bind the render target\n        renderer.bindRenderTarget(renderTarget);\n\n        // clear the renderTarget\n        renderer.clear();// [0.5,0.5,0.5, 1.0]);\n    }\n\n    /**\n     * Pops off the filter and applies it.\n     *\n     */\n    popFilter()\n    {\n        const filterData = this.filterData;\n\n        const lastState = filterData.stack[filterData.index - 1];\n        const currentState = filterData.stack[filterData.index];\n\n        this.quad.map(currentState.renderTarget.size, currentState.sourceFrame).upload();\n\n        const filters = currentState.filters;\n\n        if (filters.length === 1)\n        {\n            filters[0].apply(this, currentState.renderTarget, lastState.renderTarget, false);\n            this.freePotRenderTarget(currentState.renderTarget);\n        }\n        else\n        {\n            let flip = currentState.renderTarget;\n            let flop = this.getPotRenderTarget(\n                this.renderer.gl,\n                currentState.sourceFrame.width,\n                currentState.sourceFrame.height,\n                currentState.resolution\n            );\n\n            flop.setFrame(currentState.destinationFrame, currentState.sourceFrame);\n\n            let i = 0;\n\n            for (i = 0; i < filters.length - 1; ++i)\n            {\n                filters[i].apply(this, flip, flop, true);\n\n                const t = flip;\n\n                flip = flop;\n                flop = t;\n            }\n\n            filters[i].apply(this, flip, lastState.renderTarget, false);\n\n            this.freePotRenderTarget(flip);\n            this.freePotRenderTarget(flop);\n        }\n\n        filterData.index--;\n\n        if (filterData.index === 0)\n        {\n            this.filterData = null;\n        }\n    }\n\n    /**\n     * Draws a filter.\n     *\n     * @param {PIXI.Filter} filter - The filter to draw.\n     * @param {PIXI.RenderTarget} input - The input render target.\n     * @param {PIXI.RenderTarget} output - The target to output to.\n     * @param {boolean} clear - Should the output be cleared before rendering to it\n     */\n    applyFilter(filter, input, output, clear)\n    {\n        const renderer = this.renderer;\n        const gl = renderer.gl;\n\n        let shader = filter.glShaders[renderer.CONTEXT_UID];\n\n        // cacheing..\n        if (!shader)\n        {\n            if (filter.glShaderKey)\n            {\n                shader = this.shaderCache[filter.glShaderKey];\n\n                if (!shader)\n                {\n                    shader = new Shader(this.gl, filter.vertexSrc, filter.fragmentSrc);\n\n                    filter.glShaders[renderer.CONTEXT_UID] = this.shaderCache[filter.glShaderKey] = shader;\n                }\n            }\n            else\n            {\n                shader = filter.glShaders[renderer.CONTEXT_UID] = new Shader(this.gl, filter.vertexSrc, filter.fragmentSrc);\n            }\n\n            // TODO - this only needs to be done once?\n            renderer.bindVao(null);\n\n            this.quad.initVao(shader);\n        }\n\n        renderer.bindVao(this.quad.vao);\n\n        renderer.bindRenderTarget(output);\n\n        if (clear)\n        {\n            gl.disable(gl.SCISSOR_TEST);\n            renderer.clear();// [1, 1, 1, 1]);\n            gl.enable(gl.SCISSOR_TEST);\n        }\n\n        // in case the render target is being masked using a scissor rect\n        if (output === renderer.maskManager.scissorRenderTarget)\n        {\n            renderer.maskManager.pushScissorMask(null, renderer.maskManager.scissorData);\n        }\n\n        renderer.bindShader(shader);\n\n        // this syncs the pixi filters  uniforms with glsl uniforms\n        this.syncUniforms(shader, filter);\n\n        renderer.state.setBlendMode(filter.blendMode);\n\n        // temporary bypass cache..\n        const tex = this.renderer.boundTextures[0];\n\n        gl.activeTexture(gl.TEXTURE0);\n        gl.bindTexture(gl.TEXTURE_2D, input.texture.texture);\n\n        this.quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0);\n\n        // restore cache.\n        gl.bindTexture(gl.TEXTURE_2D, tex._glTextures[this.renderer.CONTEXT_UID].texture);\n    }\n\n    /**\n     * Uploads the uniforms of the filter.\n     *\n     * @param {GLShader} shader - The underlying gl shader.\n     * @param {PIXI.Filter} filter - The filter we are synchronizing.\n     */\n    syncUniforms(shader, filter)\n    {\n        const uniformData = filter.uniformData;\n        const uniforms = filter.uniforms;\n\n        // 0 is reserved for the pixi texture so we start at 1!\n        let textureCount = 1;\n        let currentState;\n\n        if (shader.uniforms.data.filterArea)\n        {\n            currentState = this.filterData.stack[this.filterData.index];\n            const filterArea = shader.uniforms.filterArea;\n\n            filterArea[0] = currentState.renderTarget.size.width;\n            filterArea[1] = currentState.renderTarget.size.height;\n            filterArea[2] = currentState.sourceFrame.x;\n            filterArea[3] = currentState.sourceFrame.y;\n\n            shader.uniforms.filterArea = filterArea;\n        }\n\n        // use this to clamp displaced texture coords so they belong to filterArea\n        // see displacementFilter fragment shader for an example\n        if (shader.uniforms.data.filterClamp)\n        {\n            currentState = this.filterData.stack[this.filterData.index];\n\n            const filterClamp = shader.uniforms.filterClamp;\n\n            filterClamp[0] = 0;\n            filterClamp[1] = 0;\n            filterClamp[2] = (currentState.sourceFrame.width - 1) / currentState.renderTarget.size.width;\n            filterClamp[3] = (currentState.sourceFrame.height - 1) / currentState.renderTarget.size.height;\n\n            shader.uniforms.filterClamp = filterClamp;\n        }\n\n        // TODO Cacheing layer..\n        for (const i in uniformData)\n        {\n            if (uniformData[i].type === 'sampler2D' && uniforms[i] !== 0)\n            {\n                if (uniforms[i].baseTexture)\n                {\n                    shader.uniforms[i] = this.renderer.bindTexture(uniforms[i].baseTexture, textureCount);\n                }\n                else\n                {\n                    shader.uniforms[i] = textureCount;\n\n                    // TODO\n                    // this is helpful as renderTargets can also be set.\n                    // Although thinking about it, we could probably\n                    // make the filter texture cache return a RenderTexture\n                    // rather than a renderTarget\n                    const gl = this.renderer.gl;\n\n                    gl.activeTexture(gl.TEXTURE0 + textureCount);\n                    uniforms[i].texture.bind();\n                }\n\n                textureCount++;\n            }\n            else if (uniformData[i].type === 'mat3')\n            {\n                // check if its pixi matrix..\n                if (uniforms[i].a !== undefined)\n                {\n                    shader.uniforms[i] = uniforms[i].toArray(true);\n                }\n                else\n                {\n                    shader.uniforms[i] = uniforms[i];\n                }\n            }\n            else if (uniformData[i].type === 'vec2')\n            {\n                // check if its a point..\n                if (uniforms[i].x !== undefined)\n               {\n                    const val = shader.uniforms[i] || new Float32Array(2);\n\n                    val[0] = uniforms[i].x;\n                    val[1] = uniforms[i].y;\n                    shader.uniforms[i] = val;\n                }\n                else\n               {\n                    shader.uniforms[i] = uniforms[i];\n                }\n            }\n            else if (uniformData[i].type === 'float')\n            {\n                if (shader.uniforms.data[i].value !== uniformData[i])\n                {\n                    shader.uniforms[i] = uniforms[i];\n                }\n            }\n            else\n            {\n                shader.uniforms[i] = uniforms[i];\n            }\n        }\n    }\n\n    /**\n     * Gets a render target from the pool, or creates a new one.\n     *\n     * @param {boolean} clear - Should we clear the render texture when we get it?\n     * @param {number} resolution - The resolution of the target.\n     * @return {PIXI.RenderTarget} The new render target\n     */\n    getRenderTarget(clear, resolution)\n    {\n        const currentState = this.filterData.stack[this.filterData.index];\n        const renderTarget = this.getPotRenderTarget(\n            this.renderer.gl,\n            currentState.sourceFrame.width,\n            currentState.sourceFrame.height,\n            resolution || currentState.resolution\n        );\n\n        renderTarget.setFrame(currentState.destinationFrame, currentState.sourceFrame);\n\n        return renderTarget;\n    }\n\n    /**\n     * Returns a render target to the pool.\n     *\n     * @param {PIXI.RenderTarget} renderTarget - The render target to return.\n     */\n    returnRenderTarget(renderTarget)\n    {\n        this.freePotRenderTarget(renderTarget);\n    }\n\n    /**\n     * Calculates the mapped matrix.\n     *\n     * TODO playing around here.. this is temporary - (will end up in the shader)\n     * this returns a matrix that will normalise map filter cords in the filter to screen space\n     *\n     * @param {PIXI.Matrix} outputMatrix - the matrix to output to.\n     * @return {PIXI.Matrix} The mapped matrix.\n     */\n    calculateScreenSpaceMatrix(outputMatrix)\n    {\n        const currentState = this.filterData.stack[this.filterData.index];\n\n        return filterTransforms.calculateScreenSpaceMatrix(\n            outputMatrix,\n            currentState.sourceFrame,\n            currentState.renderTarget.size\n        );\n    }\n\n    /**\n     * Multiply vTextureCoord to this matrix to achieve (0,0,1,1) for filterArea\n     *\n     * @param {PIXI.Matrix} outputMatrix - The matrix to output to.\n     * @return {PIXI.Matrix} The mapped matrix.\n     */\n    calculateNormalizedScreenSpaceMatrix(outputMatrix)\n    {\n        const currentState = this.filterData.stack[this.filterData.index];\n\n        return filterTransforms.calculateNormalizedScreenSpaceMatrix(\n            outputMatrix,\n            currentState.sourceFrame,\n            currentState.renderTarget.size,\n            currentState.destinationFrame\n        );\n    }\n\n    /**\n     * This will map the filter coord so that a texture can be used based on the transform of a sprite\n     *\n     * @param {PIXI.Matrix} outputMatrix - The matrix to output to.\n     * @param {PIXI.Sprite} sprite - The sprite to map to.\n     * @return {PIXI.Matrix} The mapped matrix.\n     */\n    calculateSpriteMatrix(outputMatrix, sprite)\n    {\n        const currentState = this.filterData.stack[this.filterData.index];\n\n        return filterTransforms.calculateSpriteMatrix(\n            outputMatrix,\n            currentState.sourceFrame,\n            currentState.renderTarget.size,\n            sprite\n        );\n    }\n\n    /**\n     * Destroys this Filter Manager.\n     *\n     */\n    destroy()\n    {\n        this.shaderCache = [];\n        this.emptyPool();\n    }\n\n    /**\n     * Gets a Power-of-Two render texture.\n     *\n     * TODO move to a seperate class could be on renderer?\n     * also - could cause issue with multiple contexts?\n     *\n     * @private\n     * @param {WebGLRenderingContext} gl - The webgl rendering context\n     * @param {number} minWidth - The minimum width of the render target.\n     * @param {number} minHeight - The minimum height of the render target.\n     * @param {number} resolution - The resolution of the render target.\n     * @return {PIXI.RenderTarget} The new render target.\n     */\n    getPotRenderTarget(gl, minWidth, minHeight, resolution)\n    {\n        // TODO you could return a bigger texture if there is not one in the pool?\n        minWidth = bitTwiddle.nextPow2(minWidth * resolution);\n        minHeight = bitTwiddle.nextPow2(minHeight * resolution);\n\n        const key = ((minWidth & 0xFFFF) << 16) | (minHeight & 0xFFFF);\n\n        if (!this.pool[key])\n        {\n            this.pool[key] = [];\n        }\n\n        let renderTarget = this.pool[key].pop();\n\n        // creating render target will cause texture to be bound!\n        if (!renderTarget)\n        {\n            // temporary bypass cache..\n            const tex = this.renderer.boundTextures[0];\n\n            gl.activeTexture(gl.TEXTURE0);\n\n            // internally - this will cause a texture to be bound..\n            renderTarget = new RenderTarget(gl, minWidth, minHeight, null, 1);\n\n            // set the current one back\n            gl.bindTexture(gl.TEXTURE_2D, tex._glTextures[this.renderer.CONTEXT_UID].texture);\n        }\n\n        // manually tweak the resolution...\n        // this will not modify the size of the frame buffer, just its resolution.\n        renderTarget.resolution = resolution;\n        renderTarget.defaultFrame.width = renderTarget.size.width = minWidth / resolution;\n        renderTarget.defaultFrame.height = renderTarget.size.height = minHeight / resolution;\n\n        return renderTarget;\n    }\n\n    /**\n     * Empties the texture pool.\n     *\n     */\n    emptyPool()\n    {\n        for (const i in this.pool)\n        {\n            const textures = this.pool[i];\n\n            if (textures)\n            {\n                for (let j = 0; j < textures.length; j++)\n                {\n                    textures[j].destroy(true);\n                }\n            }\n        }\n\n        this.pool = {};\n    }\n\n    /**\n     * Frees a render target back into the pool.\n     *\n     * @param {PIXI.RenderTarget} renderTarget - The renderTarget to free\n     */\n    freePotRenderTarget(renderTarget)\n    {\n        const minWidth = renderTarget.size.width * renderTarget.resolution;\n        const minHeight = renderTarget.size.height * renderTarget.resolution;\n        const key = ((minWidth & 0xFFFF) << 16) | (minHeight & 0xFFFF);\n\n        this.pool[key].push(renderTarget);\n    }\n}\n","import WebGLManager from './WebGLManager';\nimport AlphaMaskFilter from '../filters/spriteMask/SpriteMaskFilter';\n\n/**\n * @class\n * @extends PIXI.WebGLManager\n * @memberof PIXI\n */\nexport default class MaskManager extends WebGLManager\n{\n    /**\n     * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n     */\n    constructor(renderer)\n    {\n        super(renderer);\n\n        // TODO - we don't need both!\n        this.scissor = false;\n        this.scissorData = null;\n        this.scissorRenderTarget = null;\n\n        this.enableScissor = true;\n\n        this.alphaMaskPool = [];\n        this.alphaMaskIndex = 0;\n    }\n\n    /**\n     * Applies the Mask and adds it to the current filter stack.\n     *\n     * @param {PIXI.DisplayObject} target - Display Object to push the mask to\n     * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data.\n     */\n    pushMask(target, maskData)\n    {\n        if (maskData.texture)\n        {\n            this.pushSpriteMask(target, maskData);\n        }\n        else if (this.enableScissor\n            && !this.scissor\n            && !this.renderer.stencilManager.stencilMaskStack.length\n            && maskData.isFastRect())\n        {\n            const matrix = maskData.worldTransform;\n\n            let rot = Math.atan2(matrix.b, matrix.a);\n\n            // use the nearest degree!\n            rot = Math.round(rot * (180 / Math.PI));\n\n            if (rot % 90)\n            {\n                this.pushStencilMask(maskData);\n            }\n            else\n            {\n                this.pushScissorMask(target, maskData);\n            }\n        }\n        else\n        {\n            this.pushStencilMask(maskData);\n        }\n    }\n\n    /**\n     * Removes the last mask from the mask stack and doesn't return it.\n     *\n     * @param {PIXI.DisplayObject} target - Display Object to pop the mask from\n     * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data.\n     */\n    popMask(target, maskData)\n    {\n        if (maskData.texture)\n        {\n            this.popSpriteMask(target, maskData);\n        }\n        else if (this.enableScissor && !this.renderer.stencilManager.stencilMaskStack.length)\n        {\n            this.popScissorMask(target, maskData);\n        }\n        else\n        {\n            this.popStencilMask(target, maskData);\n        }\n    }\n\n    /**\n     * Applies the Mask and adds it to the current filter stack.\n     *\n     * @param {PIXI.RenderTarget} target - Display Object to push the sprite mask to\n     * @param {PIXI.Sprite} maskData - Sprite to be used as the mask\n     */\n    pushSpriteMask(target, maskData)\n    {\n        let alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex];\n\n        if (!alphaMaskFilter)\n        {\n            alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex] = [new AlphaMaskFilter(maskData)];\n        }\n\n        alphaMaskFilter[0].resolution = this.renderer.resolution;\n        alphaMaskFilter[0].maskSprite = maskData;\n\n        // TODO - may cause issues!\n        target.filterArea = maskData.getBounds(true);\n\n        this.renderer.filterManager.pushFilter(target, alphaMaskFilter);\n\n        this.alphaMaskIndex++;\n    }\n\n    /**\n     * Removes the last filter from the filter stack and doesn't return it.\n     *\n     */\n    popSpriteMask()\n    {\n        this.renderer.filterManager.popFilter();\n        this.alphaMaskIndex--;\n    }\n\n    /**\n     * Applies the Mask and adds it to the current filter stack.\n     *\n     * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data.\n     */\n    pushStencilMask(maskData)\n    {\n        this.renderer.currentRenderer.stop();\n        this.renderer.stencilManager.pushStencil(maskData);\n    }\n\n    /**\n     * Removes the last filter from the filter stack and doesn't return it.\n     *\n     */\n    popStencilMask()\n    {\n        this.renderer.currentRenderer.stop();\n        this.renderer.stencilManager.popStencil();\n    }\n\n    /**\n     *\n     * @param {PIXI.DisplayObject} target - Display Object to push the mask to\n     * @param {PIXI.Graphics} maskData - The masking data.\n     */\n    pushScissorMask(target, maskData)\n    {\n        maskData.renderable = true;\n\n        const renderTarget = this.renderer._activeRenderTarget;\n\n        const bounds = maskData.getBounds();\n\n        bounds.fit(renderTarget.size);\n        maskData.renderable = false;\n\n        this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST);\n\n        const resolution = this.renderer.resolution;\n\n        this.renderer.gl.scissor(\n            bounds.x * resolution,\n            (renderTarget.root ? renderTarget.size.height - bounds.y - bounds.height : bounds.y) * resolution,\n            bounds.width * resolution,\n            bounds.height * resolution\n        );\n\n        this.scissorRenderTarget = renderTarget;\n        this.scissorData = maskData;\n        this.scissor = true;\n    }\n\n    /**\n     *\n     *\n     */\n    popScissorMask()\n    {\n        this.scissorRenderTarget = null;\n        this.scissorData = null;\n        this.scissor = false;\n\n        // must be scissor!\n        const gl = this.renderer.gl;\n\n        gl.disable(gl.SCISSOR_TEST);\n    }\n}\n","import WebGLManager from './WebGLManager';\n\n/**\n * @class\n * @extends PIXI.WebGLManager\n * @memberof PIXI\n */\nexport default class StencilManager extends WebGLManager\n{\n    /**\n     * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n     */\n    constructor(renderer)\n    {\n        super(renderer);\n        this.stencilMaskStack = null;\n    }\n\n    /**\n     * Changes the mask stack that is used by this manager.\n     *\n     * @param {PIXI.Graphics[]} stencilMaskStack - The mask stack\n     */\n    setMaskStack(stencilMaskStack)\n    {\n        this.stencilMaskStack = stencilMaskStack;\n\n        const gl = this.renderer.gl;\n\n        if (stencilMaskStack.length === 0)\n        {\n            gl.disable(gl.STENCIL_TEST);\n        }\n        else\n        {\n            gl.enable(gl.STENCIL_TEST);\n        }\n    }\n\n    /**\n     * Applies the Mask and adds it to the current filter stack. @alvin\n     *\n     * @param {PIXI.Graphics} graphics - The mask\n     */\n    pushStencil(graphics)\n    {\n        this.renderer.setObjectRenderer(this.renderer.plugins.graphics);\n\n        this.renderer._activeRenderTarget.attachStencilBuffer();\n\n        const gl = this.renderer.gl;\n        const sms = this.stencilMaskStack;\n\n        if (sms.length === 0)\n        {\n            gl.enable(gl.STENCIL_TEST);\n            gl.clear(gl.STENCIL_BUFFER_BIT);\n            gl.stencilFunc(gl.ALWAYS, 1, 1);\n        }\n\n        sms.push(graphics);\n\n        gl.colorMask(false, false, false, false);\n        gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);\n\n        this.renderer.plugins.graphics.render(graphics);\n\n        gl.colorMask(true, true, true, true);\n        gl.stencilFunc(gl.NOTEQUAL, 0, sms.length);\n        gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n    }\n\n    /**\n     * TODO @alvin\n     */\n    popStencil()\n    {\n        this.renderer.setObjectRenderer(this.renderer.plugins.graphics);\n\n        const gl = this.renderer.gl;\n        const sms = this.stencilMaskStack;\n\n        const graphics = sms.pop();\n\n        if (sms.length === 0)\n        {\n            // the stack is empty!\n            gl.disable(gl.STENCIL_TEST);\n        }\n        else\n        {\n            gl.colorMask(false, false, false, false);\n            gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR);\n\n            this.renderer.plugins.graphics.render(graphics);\n\n            gl.colorMask(true, true, true, true);\n            gl.stencilFunc(gl.NOTEQUAL, 0, sms.length);\n            gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n        }\n    }\n\n    /**\n     * Destroys the mask stack.\n     *\n     */\n    destroy()\n    {\n        WebGLManager.prototype.destroy.call(this);\n\n        this.stencilMaskStack.stencilStack = null;\n    }\n}\n","/**\n * @class\n * @memberof PIXI\n */\nexport default class WebGLManager\n{\n    /**\n     * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n     */\n    constructor(renderer)\n    {\n        /**\n         * The renderer this manager works for.\n         *\n         * @member {PIXI.WebGLRenderer}\n         */\n        this.renderer = renderer;\n\n        this.renderer.on('context', this.onContextChange, this);\n    }\n\n    /**\n     * Generic method called when there is a WebGL context change.\n     *\n     */\n    onContextChange()\n    {\n        // do some codes init!\n    }\n\n    /**\n     * Generic destroy methods to be overridden by the subclass\n     *\n     */\n    destroy()\n    {\n        this.renderer.off('context', this.onContextChange, this);\n\n        this.renderer = null;\n    }\n}\n","import WebGLManager from '../managers/WebGLManager';\n\n/**\n * Base for a common object renderer that can be used as a system renderer plugin.\n *\n * @class\n * @extends PIXI.WebGLManager\n * @memberof PIXI\n */\nexport default class ObjectRenderer extends WebGLManager\n{\n    /**\n     * Starts the renderer and sets the shader\n     *\n     */\n    start()\n    {\n        // set the shader..\n    }\n\n    /**\n     * Stops the renderer\n     *\n     */\n    stop()\n    {\n        this.flush();\n    }\n\n    /**\n     * Stub method for rendering content and emptying the current batch.\n     *\n     */\n    flush()\n    {\n        // flush!\n    }\n\n    /**\n     * Renders an object\n     *\n     * @param {PIXI.DisplayObject} object - The object to render.\n     */\n    render(object) // eslint-disable-line no-unused-vars\n    {\n        // render the object\n    }\n}\n","import glCore from 'pixi-gl-core';\nimport createIndicesForQuads from '../../../utils/createIndicesForQuads';\n\n/**\n * Helper class to create a quad\n *\n * @class\n * @memberof PIXI\n */\nexport default class Quad\n{\n    /**\n     * @param {WebGLRenderingContext} gl - The gl context for this quad to use.\n     * @param {object} state - TODO: Description\n     */\n    constructor(gl, state)\n    {\n        /*\n         * the current WebGL drawing context\n         *\n         * @member {WebGLRenderingContext}\n         */\n        this.gl = gl;\n\n        /**\n         * An array of vertices\n         *\n         * @member {Float32Array}\n         */\n        this.vertices = new Float32Array([\n            -1, -1,\n            1, -1,\n            1, 1,\n            -1, 1,\n        ]);\n\n        /**\n         * The Uvs of the quad\n         *\n         * @member {Float32Array}\n         */\n        this.uvs = new Float32Array([\n            0, 0,\n            1, 0,\n            1, 1,\n            0, 1,\n        ]);\n\n        this.interleaved = new Float32Array(8 * 2);\n\n        for (let i = 0; i < 4; i++)\n        {\n            this.interleaved[i * 4] = this.vertices[(i * 2)];\n            this.interleaved[(i * 4) + 1] = this.vertices[(i * 2) + 1];\n            this.interleaved[(i * 4) + 2] = this.uvs[i * 2];\n            this.interleaved[(i * 4) + 3] = this.uvs[(i * 2) + 1];\n        }\n\n        /*\n         * @member {Uint16Array} An array containing the indices of the vertices\n         */\n        this.indices = createIndicesForQuads(1);\n\n        /*\n         * @member {glCore.GLBuffer} The vertex buffer\n         */\n        this.vertexBuffer = glCore.GLBuffer.createVertexBuffer(gl, this.interleaved, gl.STATIC_DRAW);\n\n        /*\n         * @member {glCore.GLBuffer} The index buffer\n         */\n        this.indexBuffer = glCore.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW);\n\n        /*\n         * @member {glCore.VertexArrayObject} The index buffer\n         */\n        this.vao = new glCore.VertexArrayObject(gl, state);\n    }\n\n    /**\n     * Initialises the vaos and uses the shader.\n     *\n     * @param {PIXI.Shader} shader - the shader to use\n     */\n    initVao(shader)\n    {\n        this.vao.clear()\n        .addIndex(this.indexBuffer)\n        .addAttribute(this.vertexBuffer, shader.attributes.aVertexPosition, this.gl.FLOAT, false, 4 * 4, 0)\n        .addAttribute(this.vertexBuffer, shader.attributes.aTextureCoord, this.gl.FLOAT, false, 4 * 4, 2 * 4);\n    }\n\n    /**\n     * Maps two Rectangle to the quad.\n     *\n     * @param {PIXI.Rectangle} targetTextureFrame - the first rectangle\n     * @param {PIXI.Rectangle} destinationFrame - the second rectangle\n     * @return {PIXI.Quad} Returns itself.\n     */\n    map(targetTextureFrame, destinationFrame)\n    {\n        let x = 0; // destinationFrame.x / targetTextureFrame.width;\n        let y = 0; // destinationFrame.y / targetTextureFrame.height;\n\n        this.uvs[0] = x;\n        this.uvs[1] = y;\n\n        this.uvs[2] = x + (destinationFrame.width / targetTextureFrame.width);\n        this.uvs[3] = y;\n\n        this.uvs[4] = x + (destinationFrame.width / targetTextureFrame.width);\n        this.uvs[5] = y + (destinationFrame.height / targetTextureFrame.height);\n\n        this.uvs[6] = x;\n        this.uvs[7] = y + (destinationFrame.height / targetTextureFrame.height);\n\n        x = destinationFrame.x;\n        y = destinationFrame.y;\n\n        this.vertices[0] = x;\n        this.vertices[1] = y;\n\n        this.vertices[2] = x + destinationFrame.width;\n        this.vertices[3] = y;\n\n        this.vertices[4] = x + destinationFrame.width;\n        this.vertices[5] = y + destinationFrame.height;\n\n        this.vertices[6] = x;\n        this.vertices[7] = y + destinationFrame.height;\n\n        return this;\n    }\n\n    /**\n     * Binds the buffer and uploads the data\n     *\n     * @return {PIXI.Quad} Returns itself.\n     */\n    upload()\n    {\n        for (let i = 0; i < 4; i++)\n        {\n            this.interleaved[i * 4] = this.vertices[(i * 2)];\n            this.interleaved[(i * 4) + 1] = this.vertices[(i * 2) + 1];\n            this.interleaved[(i * 4) + 2] = this.uvs[i * 2];\n            this.interleaved[(i * 4) + 3] = this.uvs[(i * 2) + 1];\n        }\n\n        this.vertexBuffer.upload(this.interleaved);\n\n        return this;\n    }\n\n    /**\n     * Removes this quad from WebGL\n     */\n    destroy()\n    {\n        const gl = this.gl;\n\n        gl.deleteBuffer(this.vertexBuffer);\n        gl.deleteBuffer(this.indexBuffer);\n    }\n}\n","import { Rectangle, Matrix } from '../../../math';\nimport { SCALE_MODES } from '../../../const';\nimport settings from '../../../settings';\nimport { GLFramebuffer } from 'pixi-gl-core';\n\n/**\n * @class\n * @memberof PIXI\n */\nexport default class RenderTarget\n{\n    /**\n     * @param {WebGLRenderingContext} gl - The current WebGL drawing context\n     * @param {number} [width=0] - the horizontal range of the filter\n     * @param {number} [height=0] - the vertical range of the filter\n     * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n     * @param {number} [resolution=1] - The current resolution / device pixel ratio\n     * @param {boolean} [root=false] - Whether this object is the root element or not\n     */\n    constructor(gl, width, height, scaleMode, resolution, root)\n    {\n        // TODO Resolution could go here ( eg low res blurs )\n\n        /**\n         * The current WebGL drawing context.\n         *\n         * @member {WebGLRenderingContext}\n         */\n        this.gl = gl;\n\n        // next time to create a frame buffer and texture\n\n        /**\n         * A frame buffer\n         *\n         * @member {PIXI.glCore.GLFramebuffer}\n         */\n        this.frameBuffer = null;\n\n        /**\n         * The texture\n         *\n         * @member {PIXI.glCore.GLTexture}\n         */\n        this.texture = null;\n\n        /**\n         * The background colour of this render target, as an array of [r,g,b,a] values\n         *\n         * @member {number[]}\n         */\n        this.clearColor = [0, 0, 0, 0];\n\n        /**\n         * The size of the object as a rectangle\n         *\n         * @member {PIXI.Rectangle}\n         */\n        this.size = new Rectangle(0, 0, 1, 1);\n\n        /**\n         * The current resolution / device pixel ratio\n         *\n         * @member {number}\n         * @default 1\n         */\n        this.resolution = resolution || settings.RESOLUTION;\n\n        /**\n         * The projection matrix\n         *\n         * @member {PIXI.Matrix}\n         */\n        this.projectionMatrix = new Matrix();\n\n        /**\n         * The object's transform\n         *\n         * @member {PIXI.Matrix}\n         */\n        this.transform = null;\n\n        /**\n         * The frame.\n         *\n         * @member {PIXI.Rectangle}\n         */\n        this.frame = null;\n\n        /**\n         * The stencil buffer stores masking data for the render target\n         *\n         * @member {glCore.GLBuffer}\n         */\n        this.defaultFrame = new Rectangle();\n        this.destinationFrame = null;\n        this.sourceFrame = null;\n\n        /**\n         * The stencil buffer stores masking data for the render target\n         *\n         * @member {glCore.GLBuffer}\n         */\n        this.stencilBuffer = null;\n\n        /**\n         * The data structure for the stencil masks\n         *\n         * @member {PIXI.Graphics[]}\n         */\n        this.stencilMaskStack = [];\n\n        /**\n         * Stores filter data for the render target\n         *\n         * @member {object[]}\n         */\n        this.filterData = null;\n\n        /**\n         * The scale mode.\n         *\n         * @member {number}\n         * @default PIXI.settings.SCALE_MODE\n         * @see PIXI.SCALE_MODES\n         */\n        this.scaleMode = scaleMode || settings.SCALE_MODE;\n\n        /**\n         * Whether this object is the root element or not\n         *\n         * @member {boolean}\n         */\n        this.root = root;\n\n        if (!this.root)\n        {\n            this.frameBuffer = GLFramebuffer.createRGBA(gl, 100, 100);\n\n            if (this.scaleMode === SCALE_MODES.NEAREST)\n            {\n                this.frameBuffer.texture.enableNearestScaling();\n            }\n            else\n            {\n                this.frameBuffer.texture.enableLinearScaling();\n            }\n            /*\n                A frame buffer needs a target to render to..\n                create a texture and bind it attach it to the framebuffer..\n             */\n\n            // this is used by the base texture\n            this.texture = this.frameBuffer.texture;\n        }\n        else\n        {\n            // make it a null framebuffer..\n            this.frameBuffer = new GLFramebuffer(gl, 100, 100);\n            this.frameBuffer.framebuffer = null;\n        }\n\n        this.setFrame();\n\n        this.resize(width, height);\n    }\n\n    /**\n     * Clears the filter texture.\n     *\n     * @param {number[]} [clearColor=this.clearColor] - Array of [r,g,b,a] to clear the framebuffer\n     */\n    clear(clearColor)\n    {\n        const cc = clearColor || this.clearColor;\n\n        this.frameBuffer.clear(cc[0], cc[1], cc[2], cc[3]);// r,g,b,a);\n    }\n\n    /**\n     * Binds the stencil buffer.\n     *\n     */\n    attachStencilBuffer()\n    {\n        // TODO check if stencil is done?\n        /**\n         * The stencil buffer is used for masking in pixi\n         * lets create one and then add attach it to the framebuffer..\n         */\n        if (!this.root)\n        {\n            this.frameBuffer.enableStencil();\n        }\n    }\n\n    /**\n     * Sets the frame of the render target.\n     *\n     * @param {Rectangle} destinationFrame - The destination frame.\n     * @param {Rectangle} sourceFrame - The source frame.\n     */\n    setFrame(destinationFrame, sourceFrame)\n    {\n        this.destinationFrame = destinationFrame || this.destinationFrame || this.defaultFrame;\n        this.sourceFrame = sourceFrame || this.sourceFrame || destinationFrame;\n    }\n\n    /**\n     * Binds the buffers and initialises the viewport.\n     *\n     */\n    activate()\n    {\n        // TOOD refactor usage of frame..\n        const gl = this.gl;\n\n        // make sure the texture is unbound!\n        this.frameBuffer.bind();\n\n        this.calculateProjection(this.destinationFrame, this.sourceFrame);\n\n        if (this.transform)\n        {\n            this.projectionMatrix.append(this.transform);\n        }\n\n        // TODO add a check as them may be the same!\n        if (this.destinationFrame !== this.sourceFrame)\n        {\n            gl.enable(gl.SCISSOR_TEST);\n            gl.scissor(\n                this.destinationFrame.x | 0,\n                this.destinationFrame.y | 0,\n                (this.destinationFrame.width * this.resolution) | 0,\n                (this.destinationFrame.height * this.resolution) | 0\n            );\n        }\n        else\n        {\n            gl.disable(gl.SCISSOR_TEST);\n        }\n\n        // TODO - does not need to be updated all the time??\n        gl.viewport(\n            this.destinationFrame.x | 0,\n            this.destinationFrame.y | 0,\n            (this.destinationFrame.width * this.resolution) | 0,\n            (this.destinationFrame.height * this.resolution) | 0\n        );\n    }\n\n    /**\n     * Updates the projection matrix based on a projection frame (which is a rectangle)\n     *\n     * @param {Rectangle} destinationFrame - The destination frame.\n     * @param {Rectangle} sourceFrame - The source frame.\n     */\n    calculateProjection(destinationFrame, sourceFrame)\n    {\n        const pm = this.projectionMatrix;\n\n        sourceFrame = sourceFrame || destinationFrame;\n\n        pm.identity();\n\n        // TODO: make dest scale source\n        if (!this.root)\n        {\n            pm.a = 1 / destinationFrame.width * 2;\n            pm.d = 1 / destinationFrame.height * 2;\n\n            pm.tx = -1 - (sourceFrame.x * pm.a);\n            pm.ty = -1 - (sourceFrame.y * pm.d);\n        }\n        else\n        {\n            pm.a = 1 / destinationFrame.width * 2;\n            pm.d = -1 / destinationFrame.height * 2;\n\n            pm.tx = -1 - (sourceFrame.x * pm.a);\n            pm.ty = 1 - (sourceFrame.y * pm.d);\n        }\n    }\n\n    /**\n     * Resizes the texture to the specified width and height\n     *\n     * @param {number} width - the new width of the texture\n     * @param {number} height - the new height of the texture\n     */\n    resize(width, height)\n    {\n        width = width | 0;\n        height = height | 0;\n\n        if (this.size.width === width && this.size.height === height)\n        {\n            return;\n        }\n\n        this.size.width = width;\n        this.size.height = height;\n\n        this.defaultFrame.width = width;\n        this.defaultFrame.height = height;\n\n        this.frameBuffer.resize(width * this.resolution, height * this.resolution);\n\n        const projectionFrame = this.frame || this.size;\n\n        this.calculateProjection(projectionFrame);\n    }\n\n    /**\n     * Destroys the render target.\n     *\n     */\n    destroy()\n    {\n        this.frameBuffer.destroy();\n\n        this.frameBuffer = null;\n        this.texture = null;\n    }\n}\n","import glCore from 'pixi-gl-core';\n\nconst fragTemplate = [\n    'precision mediump float;',\n    'void main(void){',\n    'float test = 0.1;',\n    '%forloop%',\n    'gl_FragColor = vec4(0.0);',\n    '}',\n].join('\\n');\n\nexport default function checkMaxIfStatmentsInShader(maxIfs, gl)\n{\n    const createTempContext = !gl;\n\n    // @if DEBUG\n    if (maxIfs === 0)\n    {\n        throw new Error('Invalid value of `0` passed to `checkMaxIfStatementsInShader`');\n    }\n    // @endif\n\n    if (createTempContext)\n    {\n        const tinyCanvas = document.createElement('canvas');\n\n        tinyCanvas.width = 1;\n        tinyCanvas.height = 1;\n\n        gl = glCore.createContext(tinyCanvas);\n    }\n\n    const shader = gl.createShader(gl.FRAGMENT_SHADER);\n\n    while (true) // eslint-disable-line no-constant-condition\n    {\n        const fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs));\n\n        gl.shaderSource(shader, fragmentSrc);\n        gl.compileShader(shader);\n\n        if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))\n        {\n            maxIfs = (maxIfs / 2) | 0;\n        }\n        else\n        {\n            // valid!\n            break;\n        }\n    }\n\n    if (createTempContext)\n    {\n        // get rid of context\n        if (gl.getExtension('WEBGL_lose_context'))\n        {\n            gl.getExtension('WEBGL_lose_context').loseContext();\n        }\n    }\n\n    return maxIfs;\n}\n\nfunction generateIfTestSrc(maxIfs)\n{\n    let src = '';\n\n    for (let i = 0; i < maxIfs; ++i)\n    {\n        if (i > 0)\n        {\n            src += '\\nelse ';\n        }\n\n        if (i < maxIfs - 1)\n        {\n            src += `if(test == ${i}.0){}`;\n        }\n    }\n\n    return src;\n}\n","import { BLEND_MODES } from '../../../const';\n\n/**\n * Maps gl blend combinations to WebGL.\n *\n * @memberof PIXI\n * @function mapWebGLBlendModesToPixi\n * @private\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @param {string[]} [array=[]] - The array to output into.\n * @return {string[]} Mapped modes.\n */\nexport default function mapWebGLBlendModesToPixi(gl, array = [])\n{\n    // TODO - premultiply alpha would be different.\n    // add a boolean for that!\n    array[BLEND_MODES.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n    array[BLEND_MODES.ADD] = [gl.ONE, gl.DST_ALPHA];\n    array[BLEND_MODES.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA];\n    array[BLEND_MODES.SCREEN] = [gl.ONE, gl.ONE_MINUS_SRC_COLOR];\n    array[BLEND_MODES.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n    array[BLEND_MODES.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n    array[BLEND_MODES.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n    array[BLEND_MODES.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n    array[BLEND_MODES.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n    array[BLEND_MODES.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n    array[BLEND_MODES.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n    array[BLEND_MODES.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n    array[BLEND_MODES.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n    array[BLEND_MODES.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n    array[BLEND_MODES.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n    array[BLEND_MODES.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n    array[BLEND_MODES.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n\n    return array;\n}\n","import { DRAW_MODES } from '../../../const';\n\n/**\n * Generic Mask Stack data structure.\n *\n * @memberof PIXI\n * @function mapWebGLDrawModesToPixi\n * @private\n * @param {WebGLRenderingContext} gl - The current WebGL drawing context\n * @param {object} [object={}] - The object to map into\n * @return {object} The mapped draw modes.\n */\nexport default function mapWebGLDrawModesToPixi(gl, object = {})\n{\n    object[DRAW_MODES.POINTS] = gl.POINTS;\n    object[DRAW_MODES.LINES] = gl.LINES;\n    object[DRAW_MODES.LINE_LOOP] = gl.LINE_LOOP;\n    object[DRAW_MODES.LINE_STRIP] = gl.LINE_STRIP;\n    object[DRAW_MODES.TRIANGLES] = gl.TRIANGLES;\n    object[DRAW_MODES.TRIANGLE_STRIP] = gl.TRIANGLE_STRIP;\n    object[DRAW_MODES.TRIANGLE_FAN] = gl.TRIANGLE_FAN;\n\n    return object;\n}\n","export default function validateContext(gl)\n{\n    const attributes = gl.getContextAttributes();\n\n    // this is going to be fairly simple for now.. but at least we have room to grow!\n    if (!attributes.stencil)\n    {\n        /* eslint-disable no-console */\n        console.warn('Provided WebGL context does not have a stencil buffer, masks may not render correctly');\n        /* eslint-enable no-console */\n    }\n}\n","import maxRecommendedTextures from './utils/maxRecommendedTextures';\nimport canUploadSameBuffer from './utils/canUploadSameBuffer';\n\n/**\n * @namespace PIXI.settings\n */\nexport default {\n\n    /**\n     * Target frames per millisecond.\n     *\n     * @static\n     * @memberof PIXI.settings\n     * @type {number}\n     * @default 0.06\n     */\n    TARGET_FPMS: 0.06,\n\n    /**\n     * If set to true WebGL will attempt make textures mimpaped by default.\n     * Mipmapping will only succeed if the base texture uploaded has power of two dimensions.\n     *\n     * @static\n     * @memberof PIXI.settings\n     * @type {boolean}\n     * @default true\n     */\n    MIPMAP_TEXTURES: true,\n\n    /**\n     * Default resolution / device pixel ratio of the renderer.\n     *\n     * @static\n     * @memberof PIXI.settings\n     * @type {number}\n     * @default 1\n     */\n    RESOLUTION: 1,\n\n    /**\n     * Default filter resolution.\n     *\n     * @static\n     * @memberof PIXI.settings\n     * @type {number}\n     * @default 1\n     */\n    FILTER_RESOLUTION: 1,\n\n    /**\n     * The maximum textures that this device supports.\n     *\n     * @static\n     * @memberof PIXI.settings\n     * @type {number}\n     * @default 32\n     */\n    SPRITE_MAX_TEXTURES: maxRecommendedTextures(32),\n\n    // TODO: maybe change to SPRITE.BATCH_SIZE: 2000\n    // TODO: maybe add PARTICLE.BATCH_SIZE: 15000\n\n    /**\n     * The default sprite batch size.\n     *\n     * The default aims to balance desktop and mobile devices.\n     *\n     * @static\n     * @memberof PIXI.settings\n     * @type {number}\n     * @default 4096\n     */\n    SPRITE_BATCH_SIZE: 4096,\n\n    /**\n     * The prefix that denotes a URL is for a retina asset.\n     *\n     * @static\n     * @memberof PIXI.settings\n     * @type {RegExp|string}\n     * @example `@2x`\n     * @default /@(.+)x/\n     */\n    RETINA_PREFIX: /@(.+)x/,\n\n    /**\n     * The default render options if none are supplied to {@link PIXI.WebGLRenderer}\n     * or {@link PIXI.CanvasRenderer}.\n     *\n     * @static\n     * @constant\n     * @memberof PIXI.settings\n     * @type {object}\n     * @property {HTMLCanvasElement} view=null\n     * @property {number} resolution=1\n     * @property {boolean} antialias=false\n     * @property {boolean} forceFXAA=false\n     * @property {boolean} autoResize=false\n     * @property {boolean} transparent=false\n     * @property {number} backgroundColor=0x000000\n     * @property {boolean} clearBeforeRender=true\n     * @property {boolean} preserveDrawingBuffer=false\n     * @property {boolean} roundPixels=false\n     */\n    RENDER_OPTIONS: {\n        view: null,\n        antialias: false,\n        forceFXAA: false,\n        autoResize: false,\n        transparent: false,\n        backgroundColor: 0x000000,\n        clearBeforeRender: true,\n        preserveDrawingBuffer: false,\n        roundPixels: false,\n    },\n\n    /**\n     * Default transform type.\n     *\n     * @static\n     * @memberof PIXI.settings\n     * @type {PIXI.TRANSFORM_MODE}\n     * @default PIXI.TRANSFORM_MODE.STATIC\n     */\n    TRANSFORM_MODE: 0,\n\n    /**\n     * Default Garbage Collection mode.\n     *\n     * @static\n     * @memberof PIXI.settings\n     * @type {PIXI.GC_MODES}\n     * @default PIXI.GC_MODES.AUTO\n     */\n    GC_MODE: 0,\n\n    /**\n     * Default Garbage Collection max idle.\n     *\n     * @static\n     * @memberof PIXI.settings\n     * @type {number}\n     * @default 3600\n     */\n    GC_MAX_IDLE: 60 * 60,\n\n    /**\n     * Default Garbage Collection maximum check count.\n     *\n     * @static\n     * @memberof PIXI.settings\n     * @type {number}\n     * @default 600\n     */\n    GC_MAX_CHECK_COUNT: 60 * 10,\n\n    /**\n     * Default wrap modes that are supported by pixi.\n     *\n     * @static\n     * @memberof PIXI.settings\n     * @type {PIXI.WRAP_MODES}\n     * @default PIXI.WRAP_MODES.CLAMP\n     */\n    WRAP_MODE: 0,\n\n    /**\n     * The scale modes that are supported by pixi.\n     *\n     * @static\n     * @memberof PIXI.settings\n     * @type {PIXI.SCALE_MODES}\n     * @default PIXI.SCALE_MODES.LINEAR\n     */\n    SCALE_MODE: 0,\n\n    /**\n     * Default specify float precision in shaders.\n     *\n     * @static\n     * @memberof PIXI.settings\n     * @type {PIXI.PRECISION}\n     * @default PIXI.PRECISION.MEDIUM\n     */\n    PRECISION: 'mediump',\n\n    /**\n     * Can we upload the same buffer in a single frame?\n     *\n     * @static\n     * @constant\n     * @memberof PIXI\n     * @type {boolean}\n     */\n    CAN_UPLOAD_SAME_BUFFER: canUploadSameBuffer(),\n\n};\n","import { Point, ObservablePoint, Rectangle } from '../math';\nimport { sign, TextureCache } from '../utils';\nimport { BLEND_MODES } from '../const';\nimport Texture from '../textures/Texture';\nimport Container from '../display/Container';\n\nconst tempPoint = new Point();\n\n/**\n * The Sprite object is the base for all textured objects that are rendered to the screen\n *\n * A sprite can be created directly from an image like this:\n *\n * ```js\n * let sprite = new PIXI.Sprite.fromImage('assets/image.png');\n * ```\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\nexport default class Sprite extends Container\n{\n    /**\n     * @param {PIXI.Texture} texture - The texture for this sprite\n     */\n    constructor(texture)\n    {\n        super();\n\n        /**\n         * The anchor sets the origin point of the texture.\n         * The default is 0,0 this means the texture's origin is the top left\n         * Setting the anchor to 0.5,0.5 means the texture's origin is centered\n         * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner\n         *\n         * @member {PIXI.ObservablePoint}\n         * @private\n         */\n        this._anchor = new ObservablePoint(this._onAnchorUpdate, this);\n\n        /**\n         * The texture that the sprite is using\n         *\n         * @private\n         * @member {PIXI.Texture}\n         */\n        this._texture = null;\n\n        /**\n         * The width of the sprite (this is initially set by the texture)\n         *\n         * @private\n         * @member {number}\n         */\n        this._width = 0;\n\n        /**\n         * The height of the sprite (this is initially set by the texture)\n         *\n         * @private\n         * @member {number}\n         */\n        this._height = 0;\n\n        /**\n         * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.\n         *\n         * @private\n         * @member {number}\n         * @default 0xFFFFFF\n         */\n        this._tint = null;\n        this._tintRGB = null;\n        this.tint = 0xFFFFFF;\n\n        /**\n         * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n         *\n         * @member {number}\n         * @default PIXI.BLEND_MODES.NORMAL\n         * @see PIXI.BLEND_MODES\n         */\n        this.blendMode = BLEND_MODES.NORMAL;\n\n        /**\n         * The shader that will be used to render the sprite. Set to null to remove a current shader.\n         *\n         * @member {PIXI.Filter|PIXI.Shader}\n         */\n        this.shader = null;\n\n        /**\n         * An internal cached value of the tint.\n         *\n         * @private\n         * @member {number}\n         * @default 0xFFFFFF\n         */\n        this.cachedTint = 0xFFFFFF;\n\n        // call texture setter\n        this.texture = texture || Texture.EMPTY;\n\n        /**\n         * this is used to store the vertex data of the sprite (basically a quad)\n         *\n         * @private\n         * @member {Float32Array}\n         */\n        this.vertexData = new Float32Array(8);\n\n        /**\n         * This is used to calculate the bounds of the object IF it is a trimmed sprite\n         *\n         * @private\n         * @member {Float32Array}\n         */\n        this.vertexTrimmedData = null;\n\n        this._transformID = -1;\n        this._textureID = -1;\n\n        /**\n         * Plugin that is responsible for rendering this element.\n         * Allows to customize the rendering process without overriding '_renderWebGL' & '_renderCanvas' methods.\n         *\n         * @member {string}\n         * @default 'sprite'\n         */\n        this.pluginName = 'sprite';\n    }\n\n    /**\n     * When the texture is updated, this event will fire to update the scale and frame\n     *\n     * @private\n     */\n    _onTextureUpdate()\n    {\n        this._textureID = -1;\n\n        // so if _width is 0 then width was not set..\n        if (this._width)\n        {\n            this.scale.x = sign(this.scale.x) * this._width / this.texture.orig.width;\n        }\n\n        if (this._height)\n        {\n            this.scale.y = sign(this.scale.y) * this._height / this.texture.orig.height;\n        }\n    }\n\n    /**\n     * Called when the anchor position updates.\n     *\n     * @private\n     */\n    _onAnchorUpdate()\n    {\n        this._transformID = -1;\n    }\n\n    /**\n     * calculates worldTransform * vertices, store it in vertexData\n     */\n    calculateVertices()\n    {\n        if (this._transformID === this.transform._worldID && this._textureID === this._texture._updateID)\n        {\n            return;\n        }\n\n        this._transformID = this.transform._worldID;\n        this._textureID = this._texture._updateID;\n\n        // set the vertex data\n\n        const texture = this._texture;\n        const wt = this.transform.worldTransform;\n        const a = wt.a;\n        const b = wt.b;\n        const c = wt.c;\n        const d = wt.d;\n        const tx = wt.tx;\n        const ty = wt.ty;\n        const vertexData = this.vertexData;\n        const trim = texture.trim;\n        const orig = texture.orig;\n        const anchor = this._anchor;\n\n        let w0 = 0;\n        let w1 = 0;\n        let h0 = 0;\n        let h1 = 0;\n\n        if (trim)\n        {\n            // if the sprite is trimmed and is not a tilingsprite then we need to add the extra\n            // space before transforming the sprite coords.\n            w1 = trim.x - (anchor._x * orig.width);\n            w0 = w1 + trim.width;\n\n            h1 = trim.y - (anchor._y * orig.height);\n            h0 = h1 + trim.height;\n        }\n        else\n        {\n            w0 = orig.width * (1 - anchor._x);\n            w1 = orig.width * -anchor._x;\n\n            h0 = orig.height * (1 - anchor._y);\n            h1 = orig.height * -anchor._y;\n        }\n\n        // xy\n        vertexData[0] = (a * w1) + (c * h1) + tx;\n        vertexData[1] = (d * h1) + (b * w1) + ty;\n\n        // xy\n        vertexData[2] = (a * w0) + (c * h1) + tx;\n        vertexData[3] = (d * h1) + (b * w0) + ty;\n\n         // xy\n        vertexData[4] = (a * w0) + (c * h0) + tx;\n        vertexData[5] = (d * h0) + (b * w0) + ty;\n\n        // xy\n        vertexData[6] = (a * w1) + (c * h0) + tx;\n        vertexData[7] = (d * h0) + (b * w1) + ty;\n    }\n\n    /**\n     * calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData\n     * This is used to ensure that the true width and height of a trimmed texture is respected\n     */\n    calculateTrimmedVertices()\n    {\n        if (!this.vertexTrimmedData)\n        {\n            this.vertexTrimmedData = new Float32Array(8);\n        }\n\n        // lets do some special trim code!\n        const texture = this._texture;\n        const vertexData = this.vertexTrimmedData;\n        const orig = texture.orig;\n        const anchor = this._anchor;\n\n        // lets calculate the new untrimmed bounds..\n        const wt = this.transform.worldTransform;\n        const a = wt.a;\n        const b = wt.b;\n        const c = wt.c;\n        const d = wt.d;\n        const tx = wt.tx;\n        const ty = wt.ty;\n\n        const w0 = (orig.width) * (1 - anchor._x);\n        const w1 = (orig.width) * -anchor._x;\n\n        const h0 = orig.height * (1 - anchor._y);\n        const h1 = orig.height * -anchor._y;\n\n        // xy\n        vertexData[0] = (a * w1) + (c * h1) + tx;\n        vertexData[1] = (d * h1) + (b * w1) + ty;\n\n        // xy\n        vertexData[2] = (a * w0) + (c * h1) + tx;\n        vertexData[3] = (d * h1) + (b * w0) + ty;\n\n        // xy\n        vertexData[4] = (a * w0) + (c * h0) + tx;\n        vertexData[5] = (d * h0) + (b * w0) + ty;\n\n        // xy\n        vertexData[6] = (a * w1) + (c * h0) + tx;\n        vertexData[7] = (d * h0) + (b * w1) + ty;\n    }\n\n    /**\n    *\n    * Renders the object using the WebGL renderer\n    *\n    * @private\n    * @param {PIXI.WebGLRenderer} renderer - The webgl renderer to use.\n    */\n    _renderWebGL(renderer)\n    {\n        this.calculateVertices();\n\n        renderer.setObjectRenderer(renderer.plugins[this.pluginName]);\n        renderer.plugins[this.pluginName].render(this);\n    }\n\n    /**\n    * Renders the object using the Canvas renderer\n    *\n    * @private\n    * @param {PIXI.CanvasRenderer} renderer - The renderer\n    */\n    _renderCanvas(renderer)\n    {\n        renderer.plugins[this.pluginName].render(this);\n    }\n\n    /**\n     * Updates the bounds of the sprite.\n     *\n     * @private\n     */\n    _calculateBounds()\n    {\n        const trim = this._texture.trim;\n        const orig = this._texture.orig;\n\n        // First lets check to see if the current texture has a trim..\n        if (!trim || (trim.width === orig.width && trim.height === orig.height))\n        {\n            // no trim! lets use the usual calculations..\n            this.calculateVertices();\n            this._bounds.addQuad(this.vertexData);\n        }\n        else\n        {\n            // lets calculate a special trimmed bounds...\n            this.calculateTrimmedVertices();\n            this._bounds.addQuad(this.vertexTrimmedData);\n        }\n    }\n\n    /**\n     * Gets the local bounds of the sprite object.\n     *\n     * @param {Rectangle} rect - The output rectangle.\n     * @return {Rectangle} The bounds.\n     */\n    getLocalBounds(rect)\n    {\n        // we can do a fast local bounds if the sprite has no children!\n        if (this.children.length === 0)\n        {\n            this._bounds.minX = this._texture.orig.width * -this._anchor._x;\n            this._bounds.minY = this._texture.orig.height * -this._anchor._y;\n            this._bounds.maxX = this._texture.orig.width * (1 - this._anchor._x);\n            this._bounds.maxY = this._texture.orig.height * (1 - this._anchor._x);\n\n            if (!rect)\n            {\n                if (!this._localBoundsRect)\n                {\n                    this._localBoundsRect = new Rectangle();\n                }\n\n                rect = this._localBoundsRect;\n            }\n\n            return this._bounds.getRectangle(rect);\n        }\n\n        return super.getLocalBounds.call(this, rect);\n    }\n\n    /**\n     * Tests if a point is inside this sprite\n     *\n     * @param {PIXI.Point} point - the point to test\n     * @return {boolean} the result of the test\n     */\n    containsPoint(point)\n    {\n        this.worldTransform.applyInverse(point, tempPoint);\n\n        const width = this._texture.orig.width;\n        const height = this._texture.orig.height;\n        const x1 = -width * this.anchor.x;\n        let y1 = 0;\n\n        if (tempPoint.x > x1 && tempPoint.x < x1 + width)\n        {\n            y1 = -height * this.anchor.y;\n\n            if (tempPoint.y > y1 && tempPoint.y < y1 + height)\n            {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Destroys this sprite and optionally its texture and children\n     *\n     * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n     *  have been set to that value\n     * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n     *      method called as well. 'options' will be passed on to those calls.\n     * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well\n     * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well\n     */\n    destroy(options)\n    {\n        super.destroy(options);\n\n        this._anchor = null;\n\n        const destroyTexture = typeof options === 'boolean' ? options : options && options.texture;\n\n        if (destroyTexture)\n        {\n            const destroyBaseTexture = typeof options === 'boolean' ? options : options && options.baseTexture;\n\n            this._texture.destroy(!!destroyBaseTexture);\n        }\n\n        this._texture = null;\n        this.shader = null;\n    }\n\n    // some helper functions..\n\n    /**\n     * Helper function that creates a new sprite based on the source you provide.\n     * The source can be - frame id, image url, video url, canvas element, video element, base texture\n     *\n     * @static\n     * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from\n     * @return {PIXI.Texture} The newly created texture\n     */\n    static from(source)\n    {\n        return new Sprite(Texture.from(source));\n    }\n\n    /**\n     * Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId\n     * The frame ids are created when a Texture packer file has been loaded\n     *\n     * @static\n     * @param {string} frameId - The frame Id of the texture in the cache\n     * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId\n     */\n    static fromFrame(frameId)\n    {\n        const texture = TextureCache[frameId];\n\n        if (!texture)\n        {\n            throw new Error(`The frameId \"${frameId}\" does not exist in the texture cache`);\n        }\n\n        return new Sprite(texture);\n    }\n\n    /**\n     * Helper function that creates a sprite that will contain a texture based on an image url\n     * If the image is not in the texture cache it will be loaded\n     *\n     * @static\n     * @param {string} imageId - The image url of the texture\n     * @param {boolean} [crossorigin=(auto)] - if you want to specify the cross-origin parameter\n     * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - if you want to specify the scale mode,\n     *  see {@link PIXI.SCALE_MODES} for possible values\n     * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id\n     */\n    static fromImage(imageId, crossorigin, scaleMode)\n    {\n        return new Sprite(Texture.fromImage(imageId, crossorigin, scaleMode));\n    }\n\n    /**\n     * The width of the sprite, setting this will actually modify the scale to achieve the value set\n     *\n     * @member {number}\n     * @memberof PIXI.Sprite#\n     */\n    get width()\n    {\n        return Math.abs(this.scale.x) * this.texture.orig.width;\n    }\n\n    /**\n     * Sets the width of the sprite by modifying the scale.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set width(value)\n    {\n        const s = sign(this.scale.x) || 1;\n\n        this.scale.x = s * value / this.texture.orig.width;\n        this._width = value;\n    }\n\n    /**\n     * The height of the sprite, setting this will actually modify the scale to achieve the value set\n     *\n     * @member {number}\n     * @memberof PIXI.Sprite#\n     */\n    get height()\n    {\n        return Math.abs(this.scale.y) * this.texture.orig.height;\n    }\n\n    /**\n     * Sets the height of the sprite by modifying the scale.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set height(value)\n    {\n        const s = sign(this.scale.y) || 1;\n\n        this.scale.y = s * value / this.texture.orig.height;\n        this._height = value;\n    }\n\n    /**\n     * The anchor sets the origin point of the texture.\n     * The default is 0,0 this means the texture's origin is the top left\n     * Setting the anchor to 0.5,0.5 means the texture's origin is centered\n     * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner\n     *\n     * @member {PIXI.ObservablePoint}\n     * @memberof PIXI.Sprite#\n     */\n    get anchor()\n    {\n        return this._anchor;\n    }\n\n    /**\n     * Copies the anchor to the sprite.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set anchor(value)\n    {\n        this._anchor.copy(value);\n    }\n\n    /**\n     * The tint applied to the sprite. This is a hex value. A value of\n     * 0xFFFFFF will remove any tint effect.\n     *\n     * @member {number}\n     * @memberof PIXI.Sprite#\n     * @default 0xFFFFFF\n     */\n    get tint()\n    {\n        return this._tint;\n    }\n\n    /**\n     * Sets the tint of the sprite.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set tint(value)\n    {\n        this._tint = value;\n        this._tintRGB = (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);\n    }\n\n    /**\n     * The texture that the sprite is using\n     *\n     * @member {PIXI.Texture}\n     * @memberof PIXI.Sprite#\n     */\n    get texture()\n    {\n        return this._texture;\n    }\n\n    /**\n     * Sets the texture of the sprite.\n     *\n     * @param {PIXI.Texture} value - The value to set to.\n     */\n    set texture(value)\n    {\n        if (this._texture === value)\n        {\n            return;\n        }\n\n        this._texture = value;\n        this.cachedTint = 0xFFFFFF;\n\n        this._textureID = -1;\n\n        if (value)\n        {\n            // wait for the texture to load\n            if (value.baseTexture.hasLoaded)\n            {\n                this._onTextureUpdate();\n            }\n            else\n            {\n                value.once('update', this._onTextureUpdate, this);\n            }\n        }\n    }\n}\n","import CanvasRenderer from '../../renderers/canvas/CanvasRenderer';\nimport { SCALE_MODES } from '../../const';\nimport { Matrix, GroupD8 } from '../../math';\nimport CanvasTinter from './CanvasTinter';\n\nconst canvasRenderWorldTransform = new Matrix();\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers  https://github.com/mattdesl/\n * for creating the original pixi version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now\n * share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's CanvasSpriteRenderer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/CanvasSpriteRenderer.java\n */\n\n/**\n * Renderer dedicated to drawing and batching sprites.\n *\n * @class\n * @private\n * @memberof PIXI\n */\nexport default class CanvasSpriteRenderer\n{\n    /**\n     * @param {PIXI.WebGLRenderer} renderer -The renderer sprite this batch works for.\n     */\n    constructor(renderer)\n    {\n        this.renderer = renderer;\n    }\n\n    /**\n     * Renders the sprite object.\n     *\n     * @param {PIXI.Sprite} sprite - the sprite to render when using this spritebatch\n     */\n    render(sprite)\n    {\n        const texture = sprite._texture;\n        const renderer = this.renderer;\n\n        const width = texture._frame.width;\n        const height = texture._frame.height;\n\n        let wt = sprite.transform.worldTransform;\n        let dx = 0;\n        let dy = 0;\n\n        if (texture.orig.width <= 0 || texture.orig.height <= 0 || !texture.baseTexture.source)\n        {\n            return;\n        }\n\n        renderer.setBlendMode(sprite.blendMode);\n\n        //  Ignore null sources\n        if (texture.valid)\n        {\n            renderer.context.globalAlpha = sprite.worldAlpha;\n\n            // If smoothingEnabled is supported and we need to change the smoothing property for sprite texture\n            const smoothingEnabled = texture.baseTexture.scaleMode === SCALE_MODES.LINEAR;\n\n            if (renderer.smoothProperty && renderer.context[renderer.smoothProperty] !== smoothingEnabled)\n            {\n                renderer.context[renderer.smoothProperty] = smoothingEnabled;\n            }\n\n            if (texture.trim)\n            {\n                dx = (texture.trim.width / 2) + texture.trim.x - (sprite.anchor.x * texture.orig.width);\n                dy = (texture.trim.height / 2) + texture.trim.y - (sprite.anchor.y * texture.orig.height);\n            }\n            else\n            {\n                dx = (0.5 - sprite.anchor.x) * texture.orig.width;\n                dy = (0.5 - sprite.anchor.y) * texture.orig.height;\n            }\n\n            if (texture.rotate)\n            {\n                wt.copy(canvasRenderWorldTransform);\n                wt = canvasRenderWorldTransform;\n                GroupD8.matrixAppendRotationInv(wt, texture.rotate, dx, dy);\n                // the anchor has already been applied above, so lets set it to zero\n                dx = 0;\n                dy = 0;\n            }\n\n            dx -= width / 2;\n            dy -= height / 2;\n\n            // Allow for pixel rounding\n            if (renderer.roundPixels)\n            {\n                renderer.context.setTransform(\n                    wt.a,\n                    wt.b,\n                    wt.c,\n                    wt.d,\n                    (wt.tx * renderer.resolution) | 0,\n                    (wt.ty * renderer.resolution) | 0\n                );\n\n                dx = dx | 0;\n                dy = dy | 0;\n            }\n            else\n            {\n                renderer.context.setTransform(\n                    wt.a,\n                    wt.b,\n                    wt.c,\n                    wt.d,\n                    wt.tx * renderer.resolution,\n                    wt.ty * renderer.resolution\n                );\n            }\n\n            const resolution = texture.baseTexture.resolution;\n\n            if (sprite.tint !== 0xFFFFFF)\n            {\n                if (sprite.cachedTint !== sprite.tint)\n                {\n                    sprite.cachedTint = sprite.tint;\n\n                    // TODO clean up caching - how to clean up the caches?\n                    sprite.tintedTexture = CanvasTinter.getTintedTexture(sprite, sprite.tint);\n                }\n\n                renderer.context.drawImage(\n                    sprite.tintedTexture,\n                    0,\n                    0,\n                    width * resolution,\n                    height * resolution,\n                    dx * renderer.resolution,\n                    dy * renderer.resolution,\n                    width * renderer.resolution,\n                    height * renderer.resolution\n                );\n            }\n            else\n            {\n                renderer.context.drawImage(\n                    texture.baseTexture.source,\n                    texture._frame.x * resolution,\n                    texture._frame.y * resolution,\n                    width * resolution,\n                    height * resolution,\n                    dx * renderer.resolution,\n                    dy * renderer.resolution,\n                    width * renderer.resolution,\n                    height * renderer.resolution\n                );\n            }\n        }\n    }\n\n    /**\n     * destroy the sprite object.\n     *\n     */\n    destroy()\n    {\n        this.renderer = null;\n    }\n}\n\nCanvasRenderer.registerPlugin('sprite', CanvasSpriteRenderer);\n","import { hex2rgb, rgb2hex } from '../../utils';\nimport canUseNewCanvasBlendModes from '../../renderers/canvas/utils/canUseNewCanvasBlendModes';\n\n/**\n * Utility methods for Sprite/Texture tinting.\n *\n * @namespace PIXI.CanvasTinter\n */\nconst CanvasTinter = {\n    /**\n     * Basically this method just needs a sprite and a color and tints the sprite with the given color.\n     *\n     * @memberof PIXI.CanvasTinter\n     * @param {PIXI.Sprite} sprite - the sprite to tint\n     * @param {number} color - the color to use to tint the sprite with\n     * @return {HTMLCanvasElement} The tinted canvas\n     */\n    getTintedTexture: (sprite, color) =>\n    {\n        const texture = sprite.texture;\n\n        color = CanvasTinter.roundColor(color);\n\n        const stringColor = `#${(`00000${(color | 0).toString(16)}`).substr(-6)}`;\n\n        texture.tintCache = texture.tintCache || {};\n\n        if (texture.tintCache[stringColor])\n        {\n            return texture.tintCache[stringColor];\n        }\n\n        // clone texture..\n        const canvas = CanvasTinter.canvas || document.createElement('canvas');\n\n        // CanvasTinter.tintWithPerPixel(texture, stringColor, canvas);\n        CanvasTinter.tintMethod(texture, color, canvas);\n\n        if (CanvasTinter.convertTintToImage)\n        {\n            // is this better?\n            const tintImage = new Image();\n\n            tintImage.src = canvas.toDataURL();\n\n            texture.tintCache[stringColor] = tintImage;\n        }\n        else\n        {\n            texture.tintCache[stringColor] = canvas;\n            // if we are not converting the texture to an image then we need to lose the reference to the canvas\n            CanvasTinter.canvas = null;\n        }\n\n        return canvas;\n    },\n\n    /**\n     * Tint a texture using the 'multiply' operation.\n     *\n     * @memberof PIXI.CanvasTinter\n     * @param {PIXI.Texture} texture - the texture to tint\n     * @param {number} color - the color to use to tint the sprite with\n     * @param {HTMLCanvasElement} canvas - the current canvas\n     */\n    tintWithMultiply: (texture, color, canvas) =>\n    {\n        const context = canvas.getContext('2d');\n        const crop = texture._frame.clone();\n        const resolution = texture.baseTexture.resolution;\n\n        crop.x *= resolution;\n        crop.y *= resolution;\n        crop.width *= resolution;\n        crop.height *= resolution;\n\n        canvas.width = crop.width;\n        canvas.height = crop.height;\n\n        context.fillStyle = `#${(`00000${(color | 0).toString(16)}`).substr(-6)}`;\n\n        context.fillRect(0, 0, crop.width, crop.height);\n\n        context.globalCompositeOperation = 'multiply';\n\n        context.drawImage(\n            texture.baseTexture.source,\n            crop.x,\n            crop.y,\n            crop.width,\n            crop.height,\n            0,\n            0,\n            crop.width,\n            crop.height\n        );\n\n        context.globalCompositeOperation = 'destination-atop';\n\n        context.drawImage(\n            texture.baseTexture.source,\n            crop.x,\n            crop.y,\n            crop.width,\n            crop.height,\n            0,\n            0,\n            crop.width,\n            crop.height\n        );\n    },\n\n    /**\n     * Tint a texture using the 'overlay' operation.\n     *\n     * @memberof PIXI.CanvasTinter\n     * @param {PIXI.Texture} texture - the texture to tint\n     * @param {number} color - the color to use to tint the sprite with\n     * @param {HTMLCanvasElement} canvas - the current canvas\n     */\n    tintWithOverlay(texture, color, canvas)\n    {\n        const context = canvas.getContext('2d');\n        const crop = texture._frame.clone();\n        const resolution = texture.baseTexture.resolution;\n\n        crop.x *= resolution;\n        crop.y *= resolution;\n        crop.width *= resolution;\n        crop.height *= resolution;\n\n        canvas.width = crop.width;\n        canvas.height = crop.height;\n\n        context.globalCompositeOperation = 'copy';\n        context.fillStyle = `#${(`00000${(color | 0).toString(16)}`).substr(-6)}`;\n        context.fillRect(0, 0, crop.width, crop.height);\n\n        context.globalCompositeOperation = 'destination-atop';\n        context.drawImage(\n            texture.baseTexture.source,\n            crop.x,\n            crop.y,\n            crop.width,\n            crop.height,\n            0,\n            0,\n            crop.width,\n            crop.height\n        );\n\n        // context.globalCompositeOperation = 'copy';\n    },\n\n    /**\n     * Tint a texture pixel per pixel.\n     *\n     * @memberof PIXI.CanvasTinter\n     * @param {PIXI.Texture} texture - the texture to tint\n     * @param {number} color - the color to use to tint the sprite with\n     * @param {HTMLCanvasElement} canvas - the current canvas\n     */\n    tintWithPerPixel: (texture, color, canvas) =>\n    {\n        const context = canvas.getContext('2d');\n        const crop = texture._frame.clone();\n        const resolution = texture.baseTexture.resolution;\n\n        crop.x *= resolution;\n        crop.y *= resolution;\n        crop.width *= resolution;\n        crop.height *= resolution;\n\n        canvas.width = crop.width;\n        canvas.height = crop.height;\n\n        context.globalCompositeOperation = 'copy';\n        context.drawImage(\n            texture.baseTexture.source,\n            crop.x,\n            crop.y,\n            crop.width,\n            crop.height,\n            0,\n            0,\n            crop.width,\n            crop.height\n        );\n\n        const rgbValues = hex2rgb(color);\n        const r = rgbValues[0];\n        const g = rgbValues[1];\n        const b = rgbValues[2];\n\n        const pixelData = context.getImageData(0, 0, crop.width, crop.height);\n\n        const pixels = pixelData.data;\n\n        for (let i = 0; i < pixels.length; i += 4)\n        {\n            pixels[i + 0] *= r;\n            pixels[i + 1] *= g;\n            pixels[i + 2] *= b;\n        }\n\n        context.putImageData(pixelData, 0, 0);\n    },\n\n    /**\n     * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel.\n     *\n     * @memberof PIXI.CanvasTinter\n     * @param {number} color - the color to round, should be a hex color\n     * @return {number} The rounded color.\n     */\n    roundColor: (color) =>\n    {\n        const step = CanvasTinter.cacheStepsPerColorChannel;\n\n        const rgbValues = hex2rgb(color);\n\n        rgbValues[0] = Math.min(255, (rgbValues[0] / step) * step);\n        rgbValues[1] = Math.min(255, (rgbValues[1] / step) * step);\n        rgbValues[2] = Math.min(255, (rgbValues[2] / step) * step);\n\n        return rgb2hex(rgbValues);\n    },\n\n    /**\n     * Number of steps which will be used as a cap when rounding colors.\n     *\n     * @memberof PIXI.CanvasTinter\n     * @type {number}\n     */\n    cacheStepsPerColorChannel: 8,\n\n    /**\n     * Tint cache boolean flag.\n     *\n     * @memberof PIXI.CanvasTinter\n     * @type {boolean}\n     */\n    convertTintToImage: false,\n\n    /**\n     * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.\n     *\n     * @memberof PIXI.CanvasTinter\n     * @type {boolean}\n     */\n    canUseMultiply: canUseNewCanvasBlendModes(),\n\n    /**\n     * The tinting method that will be used.\n     *\n     * @memberof PIXI.CanvasTinter\n     * @type {tintMethodFunctionType}\n     */\n    tintMethod: 0,\n};\n\nCanvasTinter.tintMethod = CanvasTinter.canUseMultiply ? CanvasTinter.tintWithMultiply : CanvasTinter.tintWithPerPixel;\n\n/**\n * The tintMethod type.\n *\n * @memberof PIXI.CanvasTinter\n * @callback tintMethodFunctionType\n * @param texture {PIXI.Texture} the texture to tint\n * @param color {number} the color to use to tint the sprite with\n * @param canvas {HTMLCanvasElement} the current canvas\n */\n\nexport default CanvasTinter;\n","/**\n * @class\n */\nexport default class Buffer\n{\n    /**\n     * @param {number} size - The size of the buffer in bytes.\n     */\n    constructor(size)\n    {\n        this.vertices = new ArrayBuffer(size);\n\n        /**\n         * View on the vertices as a Float32Array for positions\n         *\n         * @member {Float32Array}\n         */\n        this.float32View = new Float32Array(this.vertices);\n\n        /**\n         * View on the vertices as a Uint32Array for uvs\n         *\n         * @member {Float32Array}\n         */\n        this.uint32View = new Uint32Array(this.vertices);\n    }\n\n    /**\n     * Destroys the buffer.\n     *\n     */\n    destroy()\n    {\n        this.vertices = null;\n        this.positions = null;\n        this.uvs = null;\n        this.colors = null;\n    }\n}\n","import ObjectRenderer from '../../renderers/webgl/utils/ObjectRenderer';\nimport WebGLRenderer from '../../renderers/webgl/WebGLRenderer';\nimport createIndicesForQuads from '../../utils/createIndicesForQuads';\nimport generateMultiTextureShader from './generateMultiTextureShader';\nimport checkMaxIfStatmentsInShader from '../../renderers/webgl/utils/checkMaxIfStatmentsInShader';\nimport Buffer from './BatchBuffer';\nimport settings from '../../settings';\nimport glCore from 'pixi-gl-core';\nimport bitTwiddle from 'bit-twiddle';\n\nlet TICK = 0;\nlet TEXTURE_TICK = 0;\n\n/**\n * Renderer dedicated to drawing and batching sprites.\n *\n * @class\n * @private\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\nexport default class SpriteRenderer extends ObjectRenderer\n{\n    /**\n     * @param {PIXI.WebGLRenderer} renderer - The renderer this sprite batch works for.\n     */\n    constructor(renderer)\n    {\n        super(renderer);\n\n        /**\n         * Number of values sent in the vertex buffer.\n         * positionX, positionY, colorR, colorG, colorB = 5\n         *\n         * @member {number}\n         */\n        this.vertSize = 5;\n\n        /**\n         * The size of the vertex information in bytes.\n         *\n         * @member {number}\n         */\n        this.vertByteSize = this.vertSize * 4;\n\n        /**\n         * The number of images in the SpriteBatch before it flushes.\n         *\n         * @member {number}\n         */\n        this.size = settings.SPRITE_BATCH_SIZE; // 2000 is a nice balance between mobile / desktop\n\n        // the total number of bytes in our batch\n        // let numVerts = this.size * 4 * this.vertByteSize;\n\n        this.buffers = [];\n        for (let i = 1; i <= bitTwiddle.nextPow2(this.size); i *= 2)\n        {\n            this.buffers.push(new Buffer(i * 4 * this.vertByteSize));\n        }\n\n        /**\n         * Holds the indices of the geometry (quads) to draw\n         *\n         * @member {Uint16Array}\n         */\n        this.indices = createIndicesForQuads(this.size);\n\n        /**\n         * The default shaders that is used if a sprite doesn't have a more specific one.\n         * there is a shader for each number of textures that can be rendererd.\n         * These shaders will also be generated on the fly as required.\n         * @member {PIXI.Shader[]}\n         */\n        this.shader = null;\n\n        this.currentIndex = 0;\n        TICK = 0;\n        this.groups = [];\n\n        for (let k = 0; k < this.size; k++)\n        {\n            this.groups[k] = { textures: [], textureCount: 0, ids: [], size: 0, start: 0, blend: 0 };\n        }\n\n        this.sprites = [];\n\n        this.vertexBuffers = [];\n        this.vaos = [];\n\n        this.vaoMax = 2;\n        this.vertexCount = 0;\n\n        this.renderer.on('prerender', this.onPrerender, this);\n    }\n\n    /**\n     * Sets up the renderer context and necessary buffers.\n     *\n     * @private\n     */\n    onContextChange()\n    {\n        const gl = this.renderer.gl;\n\n        // step 1: first check max textures the GPU can handle.\n        this.MAX_TEXTURES = Math.min(gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS), settings.SPRITE_MAX_TEXTURES);\n\n        // step 2: check the maximum number of if statements the shader can have too..\n        this.MAX_TEXTURES = checkMaxIfStatmentsInShader(this.MAX_TEXTURES, gl);\n\n        const shader = this.shader = generateMultiTextureShader(gl, this.MAX_TEXTURES);\n\n        // create a couple of buffers\n        this.indexBuffer = glCore.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW);\n\n        // we use the second shader as the first one depending on your browser may omit aTextureId\n        // as it is not used by the shader so is optimized out.\n\n        this.renderer.bindVao(null);\n\n        for (let i = 0; i < this.vaoMax; i++)\n        {\n            this.vertexBuffers[i] = glCore.GLBuffer.createVertexBuffer(gl, null, gl.STREAM_DRAW);\n\n            /* eslint-disable max-len */\n\n            // build the vao object that will render..\n            this.vaos[i] = this.renderer.createVao()\n                .addIndex(this.indexBuffer)\n                .addAttribute(this.vertexBuffers[i], shader.attributes.aVertexPosition, gl.FLOAT, false, this.vertByteSize, 0)\n                .addAttribute(this.vertexBuffers[i], shader.attributes.aTextureCoord, gl.UNSIGNED_SHORT, true, this.vertByteSize, 2 * 4)\n                .addAttribute(this.vertexBuffers[i], shader.attributes.aColor, gl.UNSIGNED_BYTE, true, this.vertByteSize, 3 * 4)\n                .addAttribute(this.vertexBuffers[i], shader.attributes.aTextureId, gl.FLOAT, false, this.vertByteSize, 4 * 4);\n\n            /* eslint-disable max-len */\n        }\n\n        this.vao = this.vaos[0];\n        this.currentBlendMode = 99999;\n\n        this.boundTextures = new Array(this.MAX_TEXTURES);\n    }\n\n    /**\n     * Called before the renderer starts rendering.\n     *\n     */\n    onPrerender()\n    {\n        this.vertexCount = 0;\n    }\n\n    /**\n     * Renders the sprite object.\n     *\n     * @param {PIXI.Sprite} sprite - the sprite to render when using this spritebatch\n     */\n    render(sprite)\n    {\n        // TODO set blend modes..\n        // check texture..\n        if (this.currentIndex >= this.size)\n        {\n            this.flush();\n        }\n\n        // get the uvs for the texture\n\n        // if the uvs have not updated then no point rendering just yet!\n        if (!sprite.texture._uvs)\n        {\n            return;\n        }\n\n        // push a texture.\n        // increment the batchsize\n        this.sprites[this.currentIndex++] = sprite;\n    }\n\n    /**\n     * Renders the content and empties the current batch.\n     *\n     */\n    flush()\n    {\n        if (this.currentIndex === 0)\n        {\n            return;\n        }\n\n        const gl = this.renderer.gl;\n        const MAX_TEXTURES = this.MAX_TEXTURES;\n\n        const np2 = bitTwiddle.nextPow2(this.currentIndex);\n        const log2 = bitTwiddle.log2(np2);\n        const buffer = this.buffers[log2];\n\n        const sprites = this.sprites;\n        const groups = this.groups;\n\n        const float32View = buffer.float32View;\n        const uint32View = buffer.uint32View;\n\n        const boundTextures = this.boundTextures;\n        const rendererBoundTextures = this.renderer.boundTextures;\n        const touch = this.renderer.textureGC.count;\n\n        let index = 0;\n        let nextTexture;\n        let currentTexture;\n        let groupCount = 1;\n        let textureCount = 0;\n        let currentGroup = groups[0];\n        let vertexData;\n        let uvs;\n        let blendMode = sprites[0].blendMode;\n\n        currentGroup.textureCount = 0;\n        currentGroup.start = 0;\n        currentGroup.blend = blendMode;\n\n        TICK++;\n\n        let i;\n\n        // copy textures..\n        for (i = 0; i < MAX_TEXTURES; ++i)\n        {\n            boundTextures[i] = rendererBoundTextures[i];\n            boundTextures[i]._virtalBoundId = i;\n        }\n\n        for (i = 0; i < this.currentIndex; ++i)\n        {\n            // upload the sprite elemetns...\n            // they have all ready been calculated so we just need to push them into the buffer.\n            const sprite = sprites[i];\n\n            nextTexture = sprite._texture.baseTexture;\n\n            if (blendMode !== sprite.blendMode)\n            {\n                // finish a group..\n                blendMode = sprite.blendMode;\n\n                // force the batch to break!\n                currentTexture = null;\n                textureCount = MAX_TEXTURES;\n                TICK++;\n            }\n\n            if (currentTexture !== nextTexture)\n            {\n                currentTexture = nextTexture;\n\n                if (nextTexture._enabled !== TICK)\n                {\n                    if (textureCount === MAX_TEXTURES)\n                    {\n                        TICK++;\n\n                        currentGroup.size = i - currentGroup.start;\n\n                        textureCount = 0;\n\n                        currentGroup = groups[groupCount++];\n                        currentGroup.blend = blendMode;\n                        currentGroup.textureCount = 0;\n                        currentGroup.start = i;\n                    }\n\n                    nextTexture.touched = touch;\n\n                    if (nextTexture._virtalBoundId === -1)\n                    {\n                        for (let j = 0; j < MAX_TEXTURES; ++j)\n                        {\n                            const tIndex = (j + TEXTURE_TICK) % MAX_TEXTURES;\n\n                            const t = boundTextures[tIndex];\n\n                            if (t._enabled !== TICK)\n                            {\n                                TEXTURE_TICK++;\n\n                                t._virtalBoundId = -1;\n\n                                nextTexture._virtalBoundId = tIndex;\n\n                                boundTextures[tIndex] = nextTexture;\n                                break;\n                            }\n                        }\n                    }\n\n                    nextTexture._enabled = TICK;\n\n                    currentGroup.textureCount++;\n                    currentGroup.ids[textureCount] = nextTexture._virtalBoundId;\n                    currentGroup.textures[textureCount++] = nextTexture;\n                }\n            }\n\n            vertexData = sprite.vertexData;\n\n            // TODO this sum does not need to be set each frame..\n            uvs = sprite._texture._uvs.uvsUint32;\n\n            if (this.renderer.roundPixels)\n            {\n                const resolution = this.renderer.resolution;\n\n                // xy\n                float32View[index] = ((vertexData[0] * resolution) | 0) / resolution;\n                float32View[index + 1] = ((vertexData[1] * resolution) | 0) / resolution;\n\n                // xy\n                float32View[index + 5] = ((vertexData[2] * resolution) | 0) / resolution;\n                float32View[index + 6] = ((vertexData[3] * resolution) | 0) / resolution;\n\n                // xy\n                float32View[index + 10] = ((vertexData[4] * resolution) | 0) / resolution;\n                float32View[index + 11] = ((vertexData[5] * resolution) | 0) / resolution;\n\n                // xy\n                float32View[index + 15] = ((vertexData[6] * resolution) | 0) / resolution;\n                float32View[index + 16] = ((vertexData[7] * resolution) | 0) / resolution;\n            }\n            else\n            {\n                // xy\n                float32View[index] = vertexData[0];\n                float32View[index + 1] = vertexData[1];\n\n                // xy\n                float32View[index + 5] = vertexData[2];\n                float32View[index + 6] = vertexData[3];\n\n                // xy\n                float32View[index + 10] = vertexData[4];\n                float32View[index + 11] = vertexData[5];\n\n                // xy\n                float32View[index + 15] = vertexData[6];\n                float32View[index + 16] = vertexData[7];\n            }\n\n            uint32View[index + 2] = uvs[0];\n            uint32View[index + 7] = uvs[1];\n            uint32View[index + 12] = uvs[2];\n            uint32View[index + 17] = uvs[3];\n\n            uint32View[index + 3] = uint32View[index + 8] = uint32View[index + 13] = uint32View[index + 18] = sprite._tintRGB + (sprite.worldAlpha * 255 << 24);\n\n            float32View[index + 4] = float32View[index + 9] = float32View[index + 14] = float32View[index + 19] = nextTexture._virtalBoundId;\n\n            index += 20;\n        }\n\n        currentGroup.size = i - currentGroup.start;\n\n        if (!settings.CAN_UPLOAD_SAME_BUFFER)\n        {\n            // this is still needed for IOS performance..\n            // it really does not like uploading to  the same buffer in a single frame!\n            if (this.vaoMax <= this.vertexCount)\n            {\n                this.vaoMax++;\n                this.vertexBuffers[this.vertexCount] = glCore.GLBuffer.createVertexBuffer(gl, null, gl.STREAM_DRAW);\n\n                // build the vao object that will render..\n                this.vaos[this.vertexCount] = this.renderer.createVao()\n                    .addIndex(this.indexBuffer)\n                    .addAttribute(this.vertexBuffers[this.vertexCount], this.shader.attributes.aVertexPosition, gl.FLOAT, false, this.vertByteSize, 0)\n                    .addAttribute(this.vertexBuffers[this.vertexCount], this.shader.attributes.aTextureCoord, gl.UNSIGNED_SHORT, true, this.vertByteSize, 2 * 4)\n                    .addAttribute(this.vertexBuffers[this.vertexCount], this.shader.attributes.aColor, gl.UNSIGNED_BYTE, true, this.vertByteSize, 3 * 4)\n                    .addAttribute(this.vertexBuffers[this.vertexCount], this.shader.attributes.aTextureId, gl.FLOAT, false, this.vertByteSize, 4 * 4);\n            }\n\n            this.renderer.bindVao(this.vaos[this.vertexCount]);\n\n            this.vertexBuffers[this.vertexCount].upload(buffer.vertices, 0, false);\n\n            this.vertexCount++;\n        }\n        else\n        {\n            // lets use the faster option, always use buffer number 0\n            this.vertexBuffers[this.vertexCount].upload(buffer.vertices, 0, true);\n        }\n\n        for (i = 0; i < MAX_TEXTURES; ++i)\n        {\n            rendererBoundTextures[i]._virtalBoundId = -1;\n        }\n\n        // render the groups..\n        for (i = 0; i < groupCount; ++i)\n        {\n            const group = groups[i];\n            const groupTextureCount = group.textureCount;\n\n            for (let j = 0; j < groupTextureCount; j++)\n            {\n                currentTexture = group.textures[j];\n\n                // reset virtual ids..\n                // lets do a quick check..\n                if (rendererBoundTextures[group.ids[j]] !== currentTexture)\n                {\n                    this.renderer.bindTexture(currentTexture, group.ids[j], true);\n                }\n\n                // reset the virtualId..\n                currentTexture._virtalBoundId = -1;\n            }\n\n            // set the blend mode..\n            this.renderer.state.setBlendMode(group.blend);\n\n            gl.drawElements(gl.TRIANGLES, group.size * 6, gl.UNSIGNED_SHORT, group.start * 6 * 2);\n        }\n\n        // reset elements for the next flush\n        this.currentIndex = 0;\n    }\n\n    /**\n     * Starts a new sprite batch.\n     */\n    start()\n    {\n        this.renderer.bindShader(this.shader);\n\n        if (settings.CAN_UPLOAD_SAME_BUFFER)\n        {\n            // bind buffer #0, we don't need others\n            this.renderer.bindVao(this.vaos[this.vertexCount]);\n\n            this.vertexBuffers[this.vertexCount].bind();\n        }\n    }\n\n    /**\n     * Stops and flushes the current batch.\n     *\n     */\n    stop()\n    {\n        this.flush();\n    }\n\n    /**\n     * Destroys the SpriteBatch.\n     *\n     */\n    destroy()\n    {\n        for (let i = 0; i < this.vaoMax; i++)\n        {\n            if (this.vertexBuffers[i])\n            {\n                this.vertexBuffers[i].destroy();\n            }\n            if (this.vaos[i])\n            {\n                this.vaos[i].destroy();\n            }\n        }\n\n        if (this.indexBuffer)\n        {\n            this.indexBuffer.destroy();\n        }\n\n        this.renderer.off('prerender', this.onPrerender, this);\n\n        super.destroy();\n\n        if (this.shader)\n        {\n            this.shader.destroy();\n            this.shader = null;\n        }\n\n        this.vertexBuffers = null;\n        this.vaos = null;\n        this.indexBuffer = null;\n        this.indices = null;\n\n        this.sprites = null;\n\n        for (let i = 0; i < this.buffers.length; ++i)\n        {\n            this.buffers[i].destroy();\n        }\n    }\n}\n\nWebGLRenderer.registerPlugin('sprite', SpriteRenderer);\n","import Shader from '../../Shader';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\n\nconst fragTemplate = [\n    'varying vec2 vTextureCoord;',\n    'varying vec4 vColor;',\n    'varying float vTextureId;',\n    'uniform sampler2D uSamplers[%count%];',\n\n    'void main(void){',\n    'vec4 color;',\n    'float textureId = floor(vTextureId+0.5);',\n    '%forloop%',\n    'gl_FragColor = color * vColor;',\n    '}',\n].join('\\n');\n\nexport default function generateMultiTextureShader(gl, maxTextures)\n{\n    const vertexSrc = readFileSync(join(__dirname, './texture.vert'), 'utf8');\n    let fragmentSrc = fragTemplate;\n\n    fragmentSrc = fragmentSrc.replace(/%count%/gi, maxTextures);\n    fragmentSrc = fragmentSrc.replace(/%forloop%/gi, generateSampleSrc(maxTextures));\n\n    const shader = new Shader(gl, vertexSrc, fragmentSrc);\n\n    const sampleValues = [];\n\n    for (let i = 0; i < maxTextures; i++)\n    {\n        sampleValues[i] = i;\n    }\n\n    shader.bind();\n    shader.uniforms.uSamplers = sampleValues;\n\n    return shader;\n}\n\nfunction generateSampleSrc(maxTextures)\n{\n    let src = '';\n\n    src += '\\n';\n    src += '\\n';\n\n    for (let i = 0; i < maxTextures; i++)\n    {\n        if (i > 0)\n        {\n            src += '\\nelse ';\n        }\n\n        if (i < maxTextures - 1)\n        {\n            src += `if(textureId == ${i}.0)`;\n        }\n\n        src += '\\n{';\n        src += `\\n\\tcolor = texture2D(uSamplers[${i}], vTextureCoord);`;\n        src += '\\n}';\n    }\n\n    src += '\\n';\n    src += '\\n';\n\n    return src;\n}\n","/* eslint max-depth: [2, 8] */\nimport Sprite from '../sprites/Sprite';\nimport Texture from '../textures/Texture';\nimport { Rectangle } from '../math';\nimport { sign } from '../utils';\nimport { TEXT_GRADIENT } from '../const';\nimport settings from '../settings';\nimport TextStyle from './TextStyle';\n\nconst defaultDestroyOptions = {\n    texture: true,\n    children: false,\n    baseTexture: true,\n};\n\n/**\n * A Text Object will create a line or multiple lines of text. To split a line you can use '\\n' in your text string,\n * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.\n *\n * A Text can be created directly from a string and a style object\n *\n * ```js\n * let text = new PIXI.Text('This is a pixi text',{fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'});\n * ```\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI\n */\nexport default class Text extends Sprite\n{\n    /**\n     * @param {string} text - The string that you would like the text to display\n     * @param {object|PIXI.TextStyle} [style] - The style parameters\n     */\n    constructor(text, style)\n    {\n        const canvas = document.createElement('canvas');\n\n        canvas.width = 3;\n        canvas.height = 3;\n\n        const texture = Texture.fromCanvas(canvas);\n\n        texture.orig = new Rectangle();\n        texture.trim = new Rectangle();\n\n        super(texture);\n\n        /**\n         * The canvas element that everything is drawn to\n         *\n         * @member {HTMLCanvasElement}\n         */\n        this.canvas = canvas;\n\n        /**\n         * The canvas 2d context that everything is drawn with\n         * @member {HTMLCanvasElement}\n         */\n        this.context = this.canvas.getContext('2d');\n\n        /**\n         * The resolution / device pixel ratio of the canvas. This is set automatically by the renderer.\n         * @member {number}\n         * @default 1\n         */\n        this.resolution = settings.RESOLUTION;\n\n        /**\n         * Private tracker for the current text.\n         *\n         * @member {string}\n         * @private\n         */\n        this._text = null;\n\n        /**\n         * Private tracker for the current style.\n         *\n         * @member {object}\n         * @private\n         */\n        this._style = null;\n        /**\n         * Private listener to track style changes.\n         *\n         * @member {Function}\n         * @private\n         */\n        this._styleListener = null;\n\n        /**\n         * Private tracker for the current font.\n         *\n         * @member {string}\n         * @private\n         */\n        this._font = '';\n\n        this.text = text;\n        this.style = style;\n\n        this.localStyleID = -1;\n    }\n\n    /**\n     * Renders text and updates it when needed.\n     *\n     * @private\n     * @param {boolean} respectDirty - Whether to abort updating the text if the Text isn't dirty and the function is called.\n     */\n    updateText(respectDirty)\n    {\n        const style = this._style;\n\n        // check if style has changed..\n        if (this.localStyleID !== style.styleID)\n        {\n            this.dirty = true;\n            this.localStyleID = style.styleID;\n        }\n\n        if (!this.dirty && respectDirty)\n        {\n            return;\n        }\n\n        this._font = Text.getFontStyle(style);\n\n        this.context.font = this._font;\n\n        // word wrap\n        // preserve original text\n        const outputText = style.wordWrap ? this.wordWrap(this._text) : this._text;\n\n        // split text into lines\n        const lines = outputText.split(/(?:\\r\\n|\\r|\\n)/);\n\n        // calculate text width\n        const lineWidths = new Array(lines.length);\n        let maxLineWidth = 0;\n        const fontProperties = Text.calculateFontProperties(this._font);\n\n        for (let i = 0; i < lines.length; i++)\n        {\n            const lineWidth = this.context.measureText(lines[i]).width + ((lines[i].length - 1) * style.letterSpacing);\n\n            lineWidths[i] = lineWidth;\n            maxLineWidth = Math.max(maxLineWidth, lineWidth);\n        }\n\n        let width = maxLineWidth + style.strokeThickness;\n\n        if (style.dropShadow)\n        {\n            width += style.dropShadowDistance;\n        }\n\n        width += style.padding * 2;\n\n        this.canvas.width = Math.ceil((width + this.context.lineWidth) * this.resolution);\n\n        // calculate text height\n        const lineHeight = this.style.lineHeight || fontProperties.fontSize + style.strokeThickness;\n\n        let height = Math.max(lineHeight, fontProperties.fontSize + style.strokeThickness)\n            + ((lines.length - 1) * lineHeight);\n\n        if (style.dropShadow)\n        {\n            height += style.dropShadowDistance;\n        }\n\n        this.canvas.height = Math.ceil((height + (this._style.padding * 2)) * this.resolution);\n\n        this.context.scale(this.resolution, this.resolution);\n\n        this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n\n        this.context.font = this._font;\n        this.context.strokeStyle = style.stroke;\n        this.context.lineWidth = style.strokeThickness;\n        this.context.textBaseline = style.textBaseline;\n        this.context.lineJoin = style.lineJoin;\n        this.context.miterLimit = style.miterLimit;\n\n        let linePositionX;\n        let linePositionY;\n\n        if (style.dropShadow)\n        {\n            if (style.dropShadowBlur > 0)\n            {\n                this.context.shadowColor = style.dropShadowColor;\n                this.context.shadowBlur = style.dropShadowBlur;\n            }\n            else\n            {\n                this.context.fillStyle = style.dropShadowColor;\n            }\n\n            const xShadowOffset = Math.cos(style.dropShadowAngle) * style.dropShadowDistance;\n            const yShadowOffset = Math.sin(style.dropShadowAngle) * style.dropShadowDistance;\n\n            for (let i = 0; i < lines.length; i++)\n            {\n                linePositionX = style.strokeThickness / 2;\n                linePositionY = ((style.strokeThickness / 2) + (i * lineHeight)) + fontProperties.ascent;\n\n                if (style.align === 'right')\n                {\n                    linePositionX += maxLineWidth - lineWidths[i];\n                }\n                else if (style.align === 'center')\n                {\n                    linePositionX += (maxLineWidth - lineWidths[i]) / 2;\n                }\n\n                if (style.fill)\n                {\n                    this.drawLetterSpacing(\n                        lines[i],\n                        linePositionX + xShadowOffset + style.padding, linePositionY + yShadowOffset + style.padding\n                    );\n\n                    if (style.stroke && style.strokeThickness)\n                    {\n                        this.context.strokeStyle = style.dropShadowColor;\n                        this.drawLetterSpacing(\n                            lines[i],\n                            linePositionX + xShadowOffset + style.padding, linePositionY + yShadowOffset + style.padding,\n                            true\n                        );\n                        this.context.strokeStyle = style.stroke;\n                    }\n                }\n            }\n        }\n\n        // set canvas text styles\n        this.context.fillStyle = this._generateFillStyle(style, lines);\n\n        // draw lines line by line\n        for (let i = 0; i < lines.length; i++)\n        {\n            linePositionX = style.strokeThickness / 2;\n            linePositionY = ((style.strokeThickness / 2) + (i * lineHeight)) + fontProperties.ascent;\n\n            if (style.align === 'right')\n            {\n                linePositionX += maxLineWidth - lineWidths[i];\n            }\n            else if (style.align === 'center')\n            {\n                linePositionX += (maxLineWidth - lineWidths[i]) / 2;\n            }\n\n            if (style.stroke && style.strokeThickness)\n            {\n                this.drawLetterSpacing(lines[i], linePositionX + style.padding, linePositionY + style.padding, true);\n            }\n\n            if (style.fill)\n            {\n                this.drawLetterSpacing(lines[i], linePositionX + style.padding, linePositionY + style.padding);\n            }\n        }\n\n        this.updateTexture();\n    }\n\n    /**\n     * Render the text with letter-spacing.\n     * @param {string} text - The text to draw\n     * @param {number} x - Horizontal position to draw the text\n     * @param {number} y - Vertical position to draw the text\n     * @param {boolean} [isStroke=false] - Is this drawing for the outside stroke of the\n     *  text? If not, it's for the inside fill\n     * @private\n     */\n    drawLetterSpacing(text, x, y, isStroke = false)\n    {\n        const style = this._style;\n\n        // letterSpacing of 0 means normal\n        const letterSpacing = style.letterSpacing;\n\n        if (letterSpacing === 0)\n        {\n            if (isStroke)\n            {\n                this.context.strokeText(text, x, y);\n            }\n            else\n            {\n                this.context.fillText(text, x, y);\n            }\n\n            return;\n        }\n\n        const characters = String.prototype.split.call(text, '');\n        let currentPosition = x;\n        let index = 0;\n        let current = '';\n\n        while (index < text.length)\n        {\n            current = characters[index++];\n            if (isStroke)\n            {\n                this.context.strokeText(current, currentPosition, y);\n            }\n            else\n            {\n                this.context.fillText(current, currentPosition, y);\n            }\n            currentPosition += this.context.measureText(current).width + letterSpacing;\n        }\n    }\n\n    /**\n     * Updates texture size based on canvas size\n     *\n     * @private\n     */\n    updateTexture()\n    {\n        const texture = this._texture;\n        const style = this._style;\n\n        texture.baseTexture.hasLoaded = true;\n        texture.baseTexture.resolution = this.resolution;\n\n        texture.baseTexture.realWidth = this.canvas.width;\n        texture.baseTexture.realHeight = this.canvas.height;\n        texture.baseTexture.width = this.canvas.width / this.resolution;\n        texture.baseTexture.height = this.canvas.height / this.resolution;\n        texture.trim.width = texture._frame.width = this.canvas.width / this.resolution;\n        texture.trim.height = texture._frame.height = this.canvas.height / this.resolution;\n\n        texture.trim.x = -style.padding;\n        texture.trim.y = -style.padding;\n\n        texture.orig.width = texture._frame.width - (style.padding * 2);\n        texture.orig.height = texture._frame.height - (style.padding * 2);\n\n        // call sprite onTextureUpdate to update scale if _width or _height were set\n        this._onTextureUpdate();\n\n        texture.baseTexture.emit('update', texture.baseTexture);\n\n        this.dirty = false;\n    }\n\n    /**\n     * Renders the object using the WebGL renderer\n     *\n     * @param {PIXI.WebGLRenderer} renderer - The renderer\n     */\n    renderWebGL(renderer)\n    {\n        if (this.resolution !== renderer.resolution)\n        {\n            this.resolution = renderer.resolution;\n            this.dirty = true;\n        }\n\n        this.updateText(true);\n\n        super.renderWebGL(renderer);\n    }\n\n    /**\n     * Renders the object using the Canvas renderer\n     *\n     * @private\n     * @param {PIXI.CanvasRenderer} renderer - The renderer\n     */\n    _renderCanvas(renderer)\n    {\n        if (this.resolution !== renderer.resolution)\n        {\n            this.resolution = renderer.resolution;\n            this.dirty = true;\n        }\n\n        this.updateText(true);\n\n        super._renderCanvas(renderer);\n    }\n\n    /**\n     * Applies newlines to a string to have it optimally fit into the horizontal\n     * bounds set by the Text object's wordWrapWidth property.\n     *\n     * @private\n     * @param {string} text - String to apply word wrapping to\n     * @return {string} New string with new lines applied where required\n     */\n    wordWrap(text)\n    {\n        // Greedy wrapping algorithm that will wrap words as the line grows longer\n        // than its horizontal bounds.\n        let result = '';\n        const lines = text.split('\\n');\n        const wordWrapWidth = this._style.wordWrapWidth;\n\n        for (let i = 0; i < lines.length; i++)\n        {\n            let spaceLeft = wordWrapWidth;\n            const words = lines[i].split(' ');\n\n            for (let j = 0; j < words.length; j++)\n            {\n                const wordWidth = this.context.measureText(words[j]).width;\n\n                if (this._style.breakWords && wordWidth > wordWrapWidth)\n                {\n                    // Word should be split in the middle\n                    const characters = words[j].split('');\n\n                    for (let c = 0; c < characters.length; c++)\n                    {\n                        const characterWidth = this.context.measureText(characters[c]).width;\n\n                        if (characterWidth > spaceLeft)\n                        {\n                            result += `\\n${characters[c]}`;\n                            spaceLeft = wordWrapWidth - characterWidth;\n                        }\n                        else\n                        {\n                            if (c === 0)\n                            {\n                                result += ' ';\n                            }\n\n                            result += characters[c];\n                            spaceLeft -= characterWidth;\n                        }\n                    }\n                }\n                else\n                {\n                    const wordWidthWithSpace = wordWidth + this.context.measureText(' ').width;\n\n                    if (j === 0 || wordWidthWithSpace > spaceLeft)\n                    {\n                        // Skip printing the newline if it's the first word of the line that is\n                        // greater than the word wrap width.\n                        if (j > 0)\n                        {\n                            result += '\\n';\n                        }\n                        result += words[j];\n                        spaceLeft = wordWrapWidth - wordWidth;\n                    }\n                    else\n                    {\n                        spaceLeft -= wordWidthWithSpace;\n                        result += ` ${words[j]}`;\n                    }\n                }\n            }\n\n            if (i < lines.length - 1)\n            {\n                result += '\\n';\n            }\n        }\n\n        return result;\n    }\n\n    /**\n     * calculates the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.\n     */\n    _calculateBounds()\n    {\n        this.updateText(true);\n        this.calculateVertices();\n        // if we have already done this on THIS frame.\n        this._bounds.addQuad(this.vertexData);\n    }\n\n    /**\n     * Method to be called upon a TextStyle change.\n     * @private\n     */\n    _onStyleChange()\n    {\n        this.dirty = true;\n    }\n\n    /**\n     * Generates the fill style. Can automatically generate a gradient based on the fill style being an array\n     *\n     * @private\n     * @param {object} style - The style.\n     * @param {string[]} lines - The lines of text.\n     * @return {string|number|CanvasGradient} The fill style\n     */\n    _generateFillStyle(style, lines)\n    {\n        if (!Array.isArray(style.fill))\n        {\n            return style.fill;\n        }\n\n        // cocoon on canvas+ cannot generate textures, so use the first colour instead\n        if (navigator.isCocoonJS)\n        {\n            return style.fill[0];\n        }\n\n        // the gradient will be evenly spaced out according to how large the array is.\n        // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75\n        let gradient;\n        let totalIterations;\n        let currentIteration;\n        let stop;\n\n        const width = this.canvas.width / this.resolution;\n        const height = this.canvas.height / this.resolution;\n\n        if (style.fillGradientType === TEXT_GRADIENT.LINEAR_VERTICAL)\n        {\n            // start the gradient at the top center of the canvas, and end at the bottom middle of the canvas\n            gradient = this.context.createLinearGradient(width / 2, 0, width / 2, height);\n\n            // we need to repeat the gradient so that each individual line of text has the same vertical gradient effect\n            // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875\n            totalIterations = (style.fill.length + 1) * lines.length;\n            currentIteration = 0;\n            for (let i = 0; i < lines.length; i++)\n            {\n                currentIteration += 1;\n                for (let j = 0; j < style.fill.length; j++)\n                {\n                    stop = (currentIteration / totalIterations);\n                    gradient.addColorStop(stop, style.fill[j]);\n                    currentIteration++;\n                }\n            }\n        }\n        else\n        {\n            // start the gradient at the center left of the canvas, and end at the center right of the canvas\n            gradient = this.context.createLinearGradient(0, height / 2, width, height / 2);\n\n            // can just evenly space out the gradients in this case, as multiple lines makes no difference\n            // to an even left to right gradient\n            totalIterations = style.fill.length + 1;\n            currentIteration = 1;\n\n            for (let i = 0; i < style.fill.length; i++)\n            {\n                stop = currentIteration / totalIterations;\n                gradient.addColorStop(stop, style.fill[i]);\n                currentIteration++;\n            }\n        }\n\n        return gradient;\n    }\n\n    /**\n     * Destroys this text object.\n     * Note* Unlike a Sprite, a Text object will automatically destroy its baseTexture and texture as\n     * the majorety of the time the texture will not be shared with any other Sprites.\n     *\n     * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n     *  have been set to that value\n     * @param {boolean} [options.children=false] - if set to true, all the children will have their\n     *  destroy method called as well. 'options' will be passed on to those calls.\n     * @param {boolean} [options.texture=true] - Should it destroy the current texture of the sprite as well\n     * @param {boolean} [options.baseTexture=true] - Should it destroy the base texture of the sprite as well\n     */\n    destroy(options)\n    {\n        if (typeof options === 'boolean')\n        {\n            options = { children: options };\n        }\n\n        options = Object.assign({}, defaultDestroyOptions, options);\n\n        super.destroy(options);\n\n        // make sure to reset the the context and canvas.. dont want this hanging around in memory!\n        this.context = null;\n        this.canvas = null;\n\n        this._style = null;\n    }\n\n    /**\n     * The width of the Text, setting this will actually modify the scale to achieve the value set\n     *\n     * @member {number}\n     * @memberof PIXI.Text#\n     */\n    get width()\n    {\n        this.updateText(true);\n\n        return Math.abs(this.scale.x) * this.texture.orig.width;\n    }\n\n    /**\n     * Sets the width of the text.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set width(value)\n    {\n        this.updateText(true);\n\n        const s = sign(this.scale.x) || 1;\n\n        this.scale.x = s * value / this.texture.orig.width;\n        this._width = value;\n    }\n\n    /**\n     * The height of the Text, setting this will actually modify the scale to achieve the value set\n     *\n     * @member {number}\n     * @memberof PIXI.Text#\n     */\n    get height()\n    {\n        this.updateText(true);\n\n        return Math.abs(this.scale.y) * this._texture.orig.height;\n    }\n\n    /**\n     * Sets the height of the text.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set height(value)\n    {\n        this.updateText(true);\n\n        const s = sign(this.scale.y) || 1;\n\n        this.scale.y = s * value / this.texture.orig.height;\n        this._height = value;\n    }\n\n    /**\n     * Set the style of the text. Set up an event listener to listen for changes on the style\n     * object and mark the text as dirty.\n     *\n     * @member {object|PIXI.TextStyle}\n     * @memberof PIXI.Text#\n     */\n    get style()\n    {\n        return this._style;\n    }\n\n    /**\n     * Sets the style of the text.\n     *\n     * @param {object} style - The value to set to.\n     */\n    set style(style)\n    {\n        style = style || {};\n\n        if (style instanceof TextStyle)\n        {\n            this._style = style;\n        }\n        else\n        {\n            this._style = new TextStyle(style);\n        }\n\n        this.localStyleID = -1;\n        this.dirty = true;\n    }\n\n    /**\n     * Set the copy for the text object. To split a line you can use '\\n'.\n     *\n     * @member {string}\n     * @memberof PIXI.Text#\n     */\n    get text()\n    {\n        return this._text;\n    }\n\n    /**\n     * Sets the text.\n     *\n     * @param {string} text - The value to set to.\n     */\n    set text(text)\n    {\n        text = text || ' ';\n        text = text.toString();\n\n        if (this._text === text)\n        {\n            return;\n        }\n        this._text = text;\n        this.dirty = true;\n    }\n\n    /**\n     * Generates a font style string to use for Text.calculateFontProperties(). Takes the same parameter\n     * as Text.style.\n     *\n     * @static\n     * @param {object|TextStyle} style - String representing the style of the font\n     * @return {string} Font style string, for passing to Text.calculateFontProperties()\n     */\n    static getFontStyle(style)\n    {\n        style = style || {};\n\n        if (!(style instanceof TextStyle))\n        {\n            style = new TextStyle(style);\n        }\n\n        // build canvas api font setting from individual components. Convert a numeric style.fontSize to px\n        const fontSizeString = (typeof style.fontSize === 'number') ? `${style.fontSize}px` : style.fontSize;\n\n        return `${style.fontStyle} ${style.fontVariant} ${style.fontWeight} ${fontSizeString} \"${style.fontFamily}\"`;\n    }\n\n    /**\n     * Calculates the ascent, descent and fontSize of a given fontStyle\n     *\n     * @static\n     * @param {string} fontStyle - String representing the style of the font\n     * @return {Object} Font properties object\n     */\n    static calculateFontProperties(fontStyle)\n    {\n        // as this method is used for preparing assets, don't recalculate things if we don't need to\n        if (Text.fontPropertiesCache[fontStyle])\n        {\n            return Text.fontPropertiesCache[fontStyle];\n        }\n\n        const properties = {};\n\n        const canvas = Text.fontPropertiesCanvas;\n        const context = Text.fontPropertiesContext;\n\n        context.font = fontStyle;\n\n        const width = Math.ceil(context.measureText('|MÉq').width);\n        let baseline = Math.ceil(context.measureText('M').width);\n        const height = 2 * baseline;\n\n        baseline = baseline * 1.4 | 0;\n\n        canvas.width = width;\n        canvas.height = height;\n\n        context.fillStyle = '#f00';\n        context.fillRect(0, 0, width, height);\n\n        context.font = fontStyle;\n\n        context.textBaseline = 'alphabetic';\n        context.fillStyle = '#000';\n        context.fillText('|MÉq', 0, baseline);\n\n        const imagedata = context.getImageData(0, 0, width, height).data;\n        const pixels = imagedata.length;\n        const line = width * 4;\n\n        let i = 0;\n        let idx = 0;\n        let stop = false;\n\n        // ascent. scan from top to bottom until we find a non red pixel\n        for (i = 0; i < baseline; ++i)\n        {\n            for (let j = 0; j < line; j += 4)\n            {\n                if (imagedata[idx + j] !== 255)\n                {\n                    stop = true;\n                    break;\n                }\n            }\n            if (!stop)\n            {\n                idx += line;\n            }\n            else\n            {\n                break;\n            }\n        }\n\n        properties.ascent = baseline - i;\n\n        idx = pixels - line;\n        stop = false;\n\n        // descent. scan from bottom to top until we find a non red pixel\n        for (i = height; i > baseline; --i)\n        {\n            for (let j = 0; j < line; j += 4)\n            {\n                if (imagedata[idx + j] !== 255)\n                {\n                    stop = true;\n                    break;\n                }\n            }\n\n            if (!stop)\n            {\n                idx -= line;\n            }\n            else\n            {\n                break;\n            }\n        }\n\n        properties.descent = i - baseline;\n        properties.fontSize = properties.ascent + properties.descent;\n\n        Text.fontPropertiesCache[fontStyle] = properties;\n\n        return properties;\n    }\n}\n\nText.fontPropertiesCache = {};\nText.fontPropertiesCanvas = document.createElement('canvas');\nText.fontPropertiesContext = Text.fontPropertiesCanvas.getContext('2d');\n","// disabling eslint for now, going to rewrite this in v5\n/* eslint-disable */\n\nimport { TEXT_GRADIENT } from '../const';\nimport { hex2string } from '../utils';\n\nconst defaultStyle = {\n    align: 'left',\n    breakWords: false,\n    dropShadow: false,\n    dropShadowAngle: Math.PI / 6,\n    dropShadowBlur: 0,\n    dropShadowColor: '#000000',\n    dropShadowDistance: 5,\n    fill: 'black',\n    fillGradientType: TEXT_GRADIENT.LINEAR_VERTICAL,\n    fontFamily: 'Arial',\n    fontSize: 26,\n    fontStyle: 'normal',\n    fontVariant: 'normal',\n    fontWeight: 'normal',\n    letterSpacing: 0,\n    lineHeight: 0,\n    lineJoin: 'miter',\n    miterLimit: 10,\n    padding: 0,\n    stroke: 'black',\n    strokeThickness: 0,\n    textBaseline: 'alphabetic',\n    wordWrap: false,\n    wordWrapWidth: 100,\n};\n\n/**\n * A TextStyle Object decorates a Text Object. It can be shared between\n * multiple Text objects. Changing the style will update all text objects using it.\n *\n * @class\n * @memberof PIXI\n */\nexport default class TextStyle\n{\n    /**\n     * @param {object} [style] - The style parameters\n     * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center' or 'right'),\n     *  does not affect single line text\n     * @param {boolean} [style.breakWords=false] - Indicates if lines can be wrapped within words, it\n     *  needs wordWrap to be set to true\n     * @param {boolean} [style.dropShadow=false] - Set a drop shadow for the text\n     * @param {number} [style.dropShadowAngle=Math.PI/6] - Set a angle of the drop shadow\n     * @param {number} [style.dropShadowBlur=0] - Set a shadow blur radius\n     * @param {string} [style.dropShadowColor='#000000'] - A fill style to be used on the dropshadow e.g 'red', '#00FF00'\n     * @param {number} [style.dropShadowDistance=5] - Set a distance of the drop shadow\n     * @param {string|string[]|number|number[]|CanvasGradient|CanvasPattern} [style.fill='black'] - A canvas\n     *  fillstyle that will be used on the text e.g 'red', '#00FF00'. Can be an array to create a gradient\n     *  eg ['#000000','#FFFFFF']\n     * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n     * @param {number} [style.fillGradientType=PIXI.TEXT_GRADIENT.LINEAR_VERTICAL] - If fills styles are\n     *  supplied, this can change the type/direction of the gradient. See {@link PIXI.TEXT_GRADIENT} for possible values\n     * @param {string} [style.fontFamily='Arial'] - The font family\n     * @param {number|string} [style.fontSize=26] - The font size (as a number it converts to px, but as a string,\n     *  equivalents are '26px','20pt','160%' or '1.6em')\n     * @param {string} [style.fontStyle='normal'] - The font style ('normal', 'italic' or 'oblique')\n     * @param {string} [style.fontVariant='normal'] - The font variant ('normal' or 'small-caps')\n     * @param {string} [style.fontWeight='normal'] - The font weight ('normal', 'bold', 'bolder', 'lighter' and '100',\n     *  '200', '300', '400', '500', '600', '700', 800' or '900')\n     * @param {number} [style.letterSpacing=0] - The amount of spacing between letters, default is 0\n     * @param {number} [style.lineHeight] - The line height, a number that represents the vertical space that a letter uses\n     * @param {string} [style.lineJoin='miter'] - The lineJoin property sets the type of corner created, it can resolve\n     *      spiked text issues. Default is 'miter' (creates a sharp corner).\n     * @param {number} [style.miterLimit=10] - The miter limit to use when using the 'miter' lineJoin mode. This can reduce\n     *      or increase the spikiness of rendered text.\n     * @param {number} [style.padding=0] - Occasionally some fonts are cropped. Adding some padding will prevent this from\n     *     happening by adding padding to all sides of the text.\n     * @param {string|number} [style.stroke='black'] - A canvas fillstyle that will be used on the text stroke\n     *  e.g 'blue', '#FCFF00'\n     * @param {number} [style.strokeThickness=0] - A number that represents the thickness of the stroke.\n     *  Default is 0 (no stroke)\n     * @param {string} [style.textBaseline='alphabetic'] - The baseline of the text that is rendered.\n     * @param {boolean} [style.wordWrap=false] - Indicates if word wrap should be used\n     * @param {number} [style.wordWrapWidth=100] - The width at which text will wrap, it needs wordWrap to be set to true\n     */\n    constructor(style)\n    {\n        this.styleID = 0;\n\n        Object.assign(this, defaultStyle, style);\n    }\n\n    /**\n     * Creates a new TextStyle object with the same values as this one.\n     * Note that the only the properties of the object are cloned.\n     *\n     * @return {PIXI.TextStyle} New cloned TextStyle object\n     */\n    clone()\n    {\n        const clonedProperties = {};\n\n        for (const key in defaultStyle)\n        {\n            clonedProperties[key] = this[key];\n        }\n\n        return new TextStyle(clonedProperties);\n    }\n\n    /**\n     * Resets all properties to the defaults specified in TextStyle.prototype._default\n     */\n    reset()\n    {\n        Object.assign(this, defaultStyle);\n    }\n\n    get align()\n    {\n        return this._align;\n    }\n    set align(align)\n    {\n        if (this._align !== align)\n        {\n            this._align = align;\n            this.styleID++;\n        }\n    }\n\n    get breakWords()\n    {\n        return this._breakWords;\n    }\n    set breakWords(breakWords)\n    {\n        if (this._breakWords !== breakWords)\n        {\n            this._breakWords = breakWords;\n            this.styleID++;\n        }\n    }\n\n    get dropShadow()\n    {\n        return this._dropShadow;\n    }\n    set dropShadow(dropShadow)\n    {\n        if (this._dropShadow !== dropShadow)\n        {\n            this._dropShadow = dropShadow;\n            this.styleID++;\n        }\n    }\n\n    get dropShadowAngle()\n    {\n        return this._dropShadowAngle;\n    }\n    set dropShadowAngle(dropShadowAngle)\n    {\n        if (this._dropShadowAngle !== dropShadowAngle)\n        {\n            this._dropShadowAngle = dropShadowAngle;\n            this.styleID++;\n        }\n    }\n\n    get dropShadowBlur()\n    {\n        return this._dropShadowBlur;\n    }\n    set dropShadowBlur(dropShadowBlur)\n    {\n        if (this._dropShadowBlur !== dropShadowBlur)\n        {\n            this._dropShadowBlur = dropShadowBlur;\n            this.styleID++;\n        }\n    }\n\n    get dropShadowColor()\n    {\n        return this._dropShadowColor;\n    }\n    set dropShadowColor(dropShadowColor)\n    {\n        const outputColor = getColor(dropShadowColor);\n        if (this._dropShadowColor !== outputColor)\n        {\n            this._dropShadowColor = outputColor;\n            this.styleID++;\n        }\n    }\n\n    get dropShadowDistance()\n    {\n        return this._dropShadowDistance;\n    }\n    set dropShadowDistance(dropShadowDistance)\n    {\n        if (this._dropShadowDistance !== dropShadowDistance)\n        {\n            this._dropShadowDistance = dropShadowDistance;\n            this.styleID++;\n        }\n    }\n\n    get fill()\n    {\n        return this._fill;\n    }\n    set fill(fill)\n    {\n        const outputColor = getColor(fill);\n        if (this._fill !== outputColor)\n        {\n            this._fill = outputColor;\n            this.styleID++;\n        }\n    }\n\n    get fillGradientType()\n    {\n        return this._fillGradientType;\n    }\n    set fillGradientType(fillGradientType)\n    {\n        if (this._fillGradientType !== fillGradientType)\n        {\n            this._fillGradientType = fillGradientType;\n            this.styleID++;\n        }\n    }\n\n    get fontFamily()\n    {\n        return this._fontFamily;\n    }\n    set fontFamily(fontFamily)\n    {\n        if (this.fontFamily !== fontFamily)\n        {\n            this._fontFamily = fontFamily;\n            this.styleID++;\n        }\n    }\n\n    get fontSize()\n    {\n        return this._fontSize;\n    }\n    set fontSize(fontSize)\n    {\n        if (this._fontSize !== fontSize)\n        {\n            this._fontSize = fontSize;\n            this.styleID++;\n        }\n    }\n\n    get fontStyle()\n    {\n        return this._fontStyle;\n    }\n    set fontStyle(fontStyle)\n    {\n        if (this._fontStyle !== fontStyle)\n        {\n            this._fontStyle = fontStyle;\n            this.styleID++;\n        }\n    }\n\n    get fontVariant()\n    {\n        return this._fontVariant;\n    }\n    set fontVariant(fontVariant)\n    {\n        if (this._fontVariant !== fontVariant)\n        {\n            this._fontVariant = fontVariant;\n            this.styleID++;\n        }\n    }\n\n    get fontWeight()\n    {\n        return this._fontWeight;\n    }\n    set fontWeight(fontWeight)\n    {\n        if (this._fontWeight !== fontWeight)\n        {\n            this._fontWeight = fontWeight;\n            this.styleID++;\n        }\n    }\n\n    get letterSpacing()\n    {\n        return this._letterSpacing;\n    }\n    set letterSpacing(letterSpacing)\n    {\n        if (this._letterSpacing !== letterSpacing)\n        {\n            this._letterSpacing = letterSpacing;\n            this.styleID++;\n        }\n    }\n\n    get lineHeight()\n    {\n        return this._lineHeight;\n    }\n    set lineHeight(lineHeight)\n    {\n        if (this._lineHeight !== lineHeight)\n        {\n            this._lineHeight = lineHeight;\n            this.styleID++;\n        }\n    }\n\n    get lineJoin()\n    {\n        return this._lineJoin;\n    }\n    set lineJoin(lineJoin)\n    {\n        if (this._lineJoin !== lineJoin)\n        {\n            this._lineJoin = lineJoin;\n            this.styleID++;\n        }\n    }\n\n    get miterLimit()\n    {\n        return this._miterLimit;\n    }\n    set miterLimit(miterLimit)\n    {\n        if (this._miterLimit !== miterLimit)\n        {\n            this._miterLimit = miterLimit;\n            this.styleID++;\n        }\n    }\n\n    get padding()\n    {\n        return this._padding;\n    }\n    set padding(padding)\n    {\n        if (this._padding !== padding)\n        {\n            this._padding = padding;\n            this.styleID++;\n        }\n    }\n\n    get stroke()\n    {\n        return this._stroke;\n    }\n    set stroke(stroke)\n    {\n        const outputColor = getColor(stroke);\n        if (this._stroke !== outputColor)\n        {\n            this._stroke = outputColor;\n            this.styleID++;\n        }\n    }\n\n    get strokeThickness()\n    {\n        return this._strokeThickness;\n    }\n    set strokeThickness(strokeThickness)\n    {\n        if (this._strokeThickness !== strokeThickness)\n        {\n            this._strokeThickness = strokeThickness;\n            this.styleID++;\n        }\n    }\n\n    get textBaseline()\n    {\n        return this._textBaseline;\n    }\n    set textBaseline(textBaseline)\n    {\n        if (this._textBaseline !== textBaseline)\n        {\n            this._textBaseline = textBaseline;\n            this.styleID++;\n        }\n    }\n\n    get wordWrap()\n    {\n        return this._wordWrap;\n    }\n    set wordWrap(wordWrap)\n    {\n        if (this._wordWrap !== wordWrap)\n        {\n            this._wordWrap = wordWrap;\n            this.styleID++;\n        }\n    }\n\n    get wordWrapWidth()\n    {\n        return this._wordWrapWidth;\n    }\n    set wordWrapWidth(wordWrapWidth)\n    {\n        if (this._wordWrapWidth !== wordWrapWidth)\n        {\n            this._wordWrapWidth = wordWrapWidth;\n            this.styleID++;\n        }\n    }\n}\n\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n *\n * @param {number|number[]} color\n * @return {string} The color as a string.\n */\nfunction getSingleColor(color)\n{\n    if (typeof color === 'number')\n    {\n        return hex2string(color);\n    }\n    else if ( typeof color === 'string' )\n    {\n        if ( color.indexOf('0x') === 0 )\n        {\n            color = color.replace('0x', '#');\n        }\n    }\n\n    return color;\n}\n\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * This version can also convert array of colors\n *\n * @param {number|number[]} color\n * @return {string} The color as a string.\n */\nfunction getColor(color)\n{\n    if (!Array.isArray(color))\n    {\n        return getSingleColor(color);\n    }\n    else\n    {\n        for (let i = 0; i < color.length; ++i)\n        {\n            color[i] = getSingleColor(color[i]);\n        }\n\n        return color;\n    }\n}\n","import BaseTexture from './BaseTexture';\nimport settings from '../settings';\n\nconst { RESOLUTION, SCALE_MODE } = settings;\n\n/**\n * A BaseRenderTexture is a special texture that allows any Pixi display object to be rendered to it.\n *\n * __Hint__: All DisplayObjects (i.e. Sprites) that render to a BaseRenderTexture should be preloaded\n * otherwise black rectangles will be drawn instead.\n *\n * A BaseRenderTexture takes a snapshot of any Display Object given to its render method. The position\n * and rotation of the given Display Objects is ignored. For example:\n *\n * ```js\n * let renderer = PIXI.autoDetectRenderer(1024, 1024, { view: canvas, ratio: 1 });\n * let baseRenderTexture = new PIXI.BaseRenderTexture(renderer, 800, 600);\n * let sprite = PIXI.Sprite.fromImage(\"spinObj_01.png\");\n *\n * sprite.position.x = 800/2;\n * sprite.position.y = 600/2;\n * sprite.anchor.x = 0.5;\n * sprite.anchor.y = 0.5;\n *\n * baseRenderTexture.render(sprite);\n * ```\n *\n * The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual\n * position a Container should be used:\n *\n * ```js\n * let doc = new PIXI.Container();\n *\n * doc.addChild(sprite);\n *\n * let baseRenderTexture = new PIXI.BaseRenderTexture(100, 100);\n * let renderTexture = new PIXI.RenderTexture(baseRenderTexture);\n *\n * renderer.render(doc, renderTexture);  // Renders to center of RenderTexture\n * ```\n *\n * @class\n * @extends PIXI.BaseTexture\n * @memberof PIXI\n */\nexport default class BaseRenderTexture extends BaseTexture\n{\n    /**\n     * @param {number} [width=100] - The width of the base render texture\n     * @param {number} [height=100] - The height of the base render texture\n     * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n     * @param {number} [resolution=1] - The resolution / device pixel ratio of the texture being generated\n     */\n    constructor(width = 100, height = 100, scaleMode, resolution)\n    {\n        super(null, scaleMode);\n\n        this.resolution = resolution || RESOLUTION;\n\n        this.width = width;\n        this.height = height;\n\n        this.realWidth = this.width * this.resolution;\n        this.realHeight = this.height * this.resolution;\n\n        this.scaleMode = scaleMode || SCALE_MODE;\n        this.hasLoaded = true;\n\n        /**\n         * A map of renderer IDs to webgl renderTargets\n         *\n         * @private\n         * @member {object}\n         */\n        this._glRenderTargets = {};\n\n        /**\n         * A reference to the canvas render target (we only need one as this can be shared across renderers)\n         *\n         * @private\n         * @member {object}\n         */\n        this._canvasRenderTarget = null;\n\n        /**\n         * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.\n         *\n         * @member {boolean}\n         */\n        this.valid = false;\n    }\n\n    /**\n     * Resizes the BaseRenderTexture.\n     *\n     * @param {number} width - The width to resize to.\n     * @param {number} height - The height to resize to.\n     */\n    resize(width, height)\n    {\n        if (width === this.width && height === this.height)\n        {\n            return;\n        }\n\n        this.valid = (width > 0 && height > 0);\n\n        this.width = width;\n        this.height = height;\n\n        this.realWidth = this.width * this.resolution;\n        this.realHeight = this.height * this.resolution;\n\n        if (!this.valid)\n        {\n            return;\n        }\n\n        this.emit('update', this);\n    }\n\n    /**\n     * Destroys this texture\n     *\n     */\n    destroy()\n    {\n        super.destroy(true);\n        this.renderer = null;\n    }\n}\n","import {\n    uid, getUrlFileExtension, decomposeDataUri, getSvgSize,\n    getResolutionOfUrl, BaseTextureCache, TextureCache,\n} from '../utils';\nimport settings from '../settings';\nimport EventEmitter from 'eventemitter3';\nimport determineCrossOrigin from '../utils/determineCrossOrigin';\nimport bitTwiddle from 'bit-twiddle';\n\n/**\n * A texture stores the information that represents an image. All textures have a base texture.\n *\n * @class\n * @extends EventEmitter\n * @memberof PIXI\n */\nexport default class BaseTexture extends EventEmitter\n{\n    /**\n     * @param {HTMLImageElement|HTMLCanvasElement} [source] - the source object of the texture.\n     * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n     * @param {number} [resolution=1] - The resolution / device pixel ratio of the texture\n     */\n    constructor(source, scaleMode, resolution)\n    {\n        super();\n\n        this.uid = uid();\n\n        this.touched = 0;\n\n        /**\n         * The resolution / device pixel ratio of the texture\n         *\n         * @member {number}\n         * @default 1\n         */\n        this.resolution = resolution || settings.RESOLUTION;\n\n        /**\n         * The width of the base texture set when the image has loaded\n         *\n         * @readonly\n         * @member {number}\n         */\n        this.width = 100;\n\n        /**\n         * The height of the base texture set when the image has loaded\n         *\n         * @readonly\n         * @member {number}\n         */\n        this.height = 100;\n\n        // TODO docs\n        // used to store the actual dimensions of the source\n        /**\n         * Used to store the actual width of the source of this texture\n         *\n         * @readonly\n         * @member {number}\n         */\n        this.realWidth = 100;\n        /**\n         * Used to store the actual height of the source of this texture\n         *\n         * @readonly\n         * @member {number}\n         */\n        this.realHeight = 100;\n\n        /**\n         * The scale mode to apply when scaling this texture\n         *\n         * @member {number}\n         * @default PIXI.settings.SCALE_MODE\n         * @see PIXI.SCALE_MODES\n         */\n        this.scaleMode = scaleMode || settings.SCALE_MODE;\n\n        /**\n         * Set to true once the base texture has successfully loaded.\n         *\n         * This is never true if the underlying source fails to load or has no texture data.\n         *\n         * @readonly\n         * @member {boolean}\n         */\n        this.hasLoaded = false;\n\n        /**\n         * Set to true if the source is currently loading.\n         *\n         * If an Image source is loading the 'loaded' or 'error' event will be\n         * dispatched when the operation ends. An underyling source that is\n         * immediately-available bypasses loading entirely.\n         *\n         * @readonly\n         * @member {boolean}\n         */\n        this.isLoading = false;\n\n        /**\n         * The image source that is used to create the texture.\n         *\n         * TODO: Make this a setter that calls loadSource();\n         *\n         * @readonly\n         * @member {HTMLImageElement|HTMLCanvasElement}\n         */\n        this.source = null; // set in loadSource, if at all\n\n        /**\n         * The image source that is used to create the texture. This is used to\n         * store the original Svg source when it is replaced with a canvas element.\n         *\n         * TODO: Currently not in use but could be used when re-scaling svg.\n         *\n         * @readonly\n         * @member {Image}\n         */\n        this.origSource = null; // set in loadSvg, if at all\n\n        /**\n         * Type of image defined in source, eg. `png` or `svg`\n         *\n         * @readonly\n         * @member {string}\n         */\n        this.imageType = null; // set in updateImageType\n\n        /**\n         * Scale for source image. Used with Svg images to scale them before rasterization.\n         *\n         * @readonly\n         * @member {number}\n         */\n        this.sourceScale = 1.0;\n\n        /**\n         * Controls if RGB channels should be pre-multiplied by Alpha  (WebGL only)\n         * All blend modes, and shaders written for default value. Change it on your own risk.\n         *\n         * @member {boolean}\n         * @default true\n         */\n        this.premultipliedAlpha = true;\n\n        /**\n         * The image url of the texture\n         *\n         * @member {string}\n         */\n        this.imageUrl = null;\n\n        /**\n         * Whether or not the texture is a power of two, try to use power of two textures as much\n         * as you can\n         *\n         * @private\n         * @member {boolean}\n         */\n        this.isPowerOfTwo = false;\n\n        // used for webGL\n\n        /**\n         *\n         * Set this to true if a mipmap of this texture needs to be generated. This value needs\n         * to be set before the texture is used\n         * Also the texture must be a power of two size to work\n         *\n         * @member {boolean}\n         * @see PIXI.MIPMAP_TEXTURES\n         */\n        this.mipmap = settings.MIPMAP_TEXTURES;\n\n        /**\n         *\n         * WebGL Texture wrap mode\n         *\n         * @member {number}\n         * @see PIXI.WRAP_MODES\n         */\n        this.wrapMode = settings.WRAP_MODE;\n\n        /**\n         * A map of renderer IDs to webgl textures\n         *\n         * @private\n         * @member {object}\n         */\n        this._glTextures = {};\n\n        this._enabled = 0;\n        this._virtalBoundId = -1;\n\n        // if no source passed don't try to load\n        if (source)\n        {\n            this.loadSource(source);\n        }\n\n        /**\n         * Fired when a not-immediately-available source finishes loading.\n         *\n         * @protected\n         * @event loaded\n         * @memberof PIXI.BaseTexture#\n         */\n\n        /**\n         * Fired when a not-immediately-available source fails to load.\n         *\n         * @protected\n         * @event error\n         * @memberof PIXI.BaseTexture#\n         */\n    }\n\n    /**\n     * Updates the texture on all the webgl renderers, this also assumes the src has changed.\n     *\n     * @fires update\n     */\n    update()\n    {\n        // Svg size is handled during load\n        if (this.imageType !== 'svg')\n        {\n            this.realWidth = this.source.naturalWidth || this.source.videoWidth || this.source.width;\n            this.realHeight = this.source.naturalHeight || this.source.videoHeight || this.source.height;\n\n            this.width = this.realWidth / this.resolution;\n            this.height = this.realHeight / this.resolution;\n\n            this.isPowerOfTwo = bitTwiddle.isPow2(this.realWidth) && bitTwiddle.isPow2(this.realHeight);\n        }\n\n        this.emit('update', this);\n    }\n\n    /**\n     * Load a source.\n     *\n     * If the source is not-immediately-available, such as an image that needs to be\n     * downloaded, then the 'loaded' or 'error' event will be dispatched in the future\n     * and `hasLoaded` will remain false after this call.\n     *\n     * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is:\n     *\n     *     if (texture.hasLoaded) {\n     *        // texture ready for use\n     *     } else if (texture.isLoading) {\n     *        // listen to 'loaded' and/or 'error' events on texture\n     *     } else {\n     *        // not loading, not going to load UNLESS the source is reloaded\n     *        // (it may still make sense to listen to the events)\n     *     }\n     *\n     * @protected\n     * @param {HTMLImageElement|HTMLCanvasElement} source - the source object of the texture.\n     */\n    loadSource(source)\n    {\n        const wasLoading = this.isLoading;\n\n        this.hasLoaded = false;\n        this.isLoading = false;\n\n        if (wasLoading && this.source)\n        {\n            this.source.onload = null;\n            this.source.onerror = null;\n        }\n\n        const firstSourceLoaded = !this.source;\n\n        this.source = source;\n\n        // Apply source if loaded. Otherwise setup appropriate loading monitors.\n        if (((source.src && source.complete) || source.getContext) && source.width && source.height)\n        {\n            this._updateImageType();\n\n            if (this.imageType === 'svg')\n            {\n                this._loadSvgSource();\n            }\n            else\n            {\n                this._sourceLoaded();\n            }\n\n            if (firstSourceLoaded)\n            {\n                // send loaded event if previous source was null and we have been passed a pre-loaded IMG element\n                this.emit('loaded', this);\n            }\n        }\n        else if (!source.getContext)\n        {\n            // Image fail / not ready\n            this.isLoading = true;\n\n            const scope = this;\n\n            source.onload = () =>\n            {\n                scope._updateImageType();\n                source.onload = null;\n                source.onerror = null;\n\n                if (!scope.isLoading)\n                {\n                    return;\n                }\n\n                scope.isLoading = false;\n                scope._sourceLoaded();\n\n                if (scope.imageType === 'svg')\n                {\n                    scope._loadSvgSource();\n\n                    return;\n                }\n\n                scope.emit('loaded', scope);\n            };\n\n            source.onerror = () =>\n            {\n                source.onload = null;\n                source.onerror = null;\n\n                if (!scope.isLoading)\n                {\n                    return;\n                }\n\n                scope.isLoading = false;\n                scope.emit('error', scope);\n            };\n\n            // Per http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\n            //   \"The value of `complete` can thus change while a script is executing.\"\n            // So complete needs to be re-checked after the callbacks have been added..\n            // NOTE: complete will be true if the image has no src so best to check if the src is set.\n            if (source.complete && source.src)\n            {\n                // ..and if we're complete now, no need for callbacks\n                source.onload = null;\n                source.onerror = null;\n\n                if (scope.imageType === 'svg')\n                {\n                    scope._loadSvgSource();\n\n                    return;\n                }\n\n                this.isLoading = false;\n\n                if (source.width && source.height)\n                {\n                    this._sourceLoaded();\n\n                    // If any previous subscribers possible\n                    if (wasLoading)\n                    {\n                        this.emit('loaded', this);\n                    }\n                }\n                // If any previous subscribers possible\n                else if (wasLoading)\n                {\n                    this.emit('error', this);\n                }\n            }\n        }\n    }\n\n    /**\n     * Updates type of the source image.\n     */\n    _updateImageType()\n    {\n        if (!this.imageUrl)\n        {\n            return;\n        }\n\n        const dataUri = decomposeDataUri(this.imageUrl);\n        let imageType;\n\n        if (dataUri && dataUri.mediaType === 'image')\n        {\n            // Check for subType validity\n            const firstSubType = dataUri.subType.split('+')[0];\n\n            imageType = getUrlFileExtension(`.${firstSubType}`);\n\n            if (!imageType)\n            {\n                throw new Error('Invalid image type in data URI.');\n            }\n        }\n        else\n        {\n            imageType = getUrlFileExtension(this.imageUrl);\n\n            if (!imageType)\n            {\n                imageType = 'png';\n            }\n        }\n\n        this.imageType = imageType;\n    }\n\n    /**\n     * Checks if `source` is an SVG image and whether it's loaded via a URL or a data URI. Then calls\n     * `_loadSvgSourceUsingDataUri` or `_loadSvgSourceUsingXhr`.\n     */\n    _loadSvgSource()\n    {\n        if (this.imageType !== 'svg')\n        {\n            // Do nothing if source is not svg\n            return;\n        }\n\n        const dataUri = decomposeDataUri(this.imageUrl);\n\n        if (dataUri)\n        {\n            this._loadSvgSourceUsingDataUri(dataUri);\n        }\n        else\n        {\n            // We got an URL, so we need to do an XHR to check the svg size\n            this._loadSvgSourceUsingXhr();\n        }\n    }\n\n    /**\n     * Reads an SVG string from data URI and then calls `_loadSvgSourceUsingString`.\n     *\n     * @param {string} dataUri - The data uri to load from.\n     */\n    _loadSvgSourceUsingDataUri(dataUri)\n    {\n        let svgString;\n\n        if (dataUri.encoding === 'base64')\n        {\n            if (!atob)\n            {\n                throw new Error('Your browser doesn\\'t support base64 conversions.');\n            }\n            svgString = atob(dataUri.data);\n        }\n        else\n        {\n            svgString = dataUri.data;\n        }\n\n        this._loadSvgSourceUsingString(svgString);\n    }\n\n    /**\n     * Loads an SVG string from `imageUrl` using XHR and then calls `_loadSvgSourceUsingString`.\n     */\n    _loadSvgSourceUsingXhr()\n    {\n        const svgXhr = new XMLHttpRequest();\n\n        // This throws error on IE, so SVG Document can't be used\n        // svgXhr.responseType = 'document';\n\n        // This is not needed since we load the svg as string (breaks IE too)\n        // but overrideMimeType() can be used to force the response to be parsed as XML\n        // svgXhr.overrideMimeType('image/svg+xml');\n\n        svgXhr.onload = () =>\n        {\n            if (svgXhr.readyState !== svgXhr.DONE || svgXhr.status !== 200)\n            {\n                throw new Error('Failed to load SVG using XHR.');\n            }\n\n            this._loadSvgSourceUsingString(svgXhr.response);\n        };\n\n        svgXhr.onerror = () => this.emit('error', this);\n\n        svgXhr.open('GET', this.imageUrl, true);\n        svgXhr.send();\n    }\n\n    /**\n     * Loads texture using an SVG string. The original SVG Image is stored as `origSource` and the\n     * created canvas is the new `source`. The SVG is scaled using `sourceScale`. Called by\n     * `_loadSvgSourceUsingXhr` or `_loadSvgSourceUsingDataUri`.\n     *\n     * @param  {string} svgString SVG source as string\n     *\n     * @fires loaded\n     */\n    _loadSvgSourceUsingString(svgString)\n    {\n        const svgSize = getSvgSize(svgString);\n\n        const svgWidth = svgSize.width;\n        const svgHeight = svgSize.height;\n\n        if (!svgWidth || !svgHeight)\n        {\n            throw new Error('The SVG image must have width and height defined (in pixels), canvas API needs them.');\n        }\n\n        // Scale realWidth and realHeight\n        this.realWidth = Math.round(svgWidth * this.sourceScale);\n        this.realHeight = Math.round(svgHeight * this.sourceScale);\n\n        this.width = this.realWidth / this.resolution;\n        this.height = this.realHeight / this.resolution;\n\n        // Check pow2 after scale\n        this.isPowerOfTwo = bitTwiddle.isPow2(this.realWidth) && bitTwiddle.isPow2(this.realHeight);\n\n        // Create a canvas element\n        const canvas = document.createElement('canvas');\n\n        canvas.width = this.realWidth;\n        canvas.height = this.realHeight;\n        canvas._pixiId = `canvas_${uid()}`;\n\n        // Draw the Svg to the canvas\n        canvas\n            .getContext('2d')\n            .drawImage(this.source, 0, 0, svgWidth, svgHeight, 0, 0, this.realWidth, this.realHeight);\n\n        // Replace the original source image with the canvas\n        this.origSource = this.source;\n        this.source = canvas;\n\n        // Add also the canvas in cache (destroy clears by `imageUrl` and `source._pixiId`)\n        BaseTextureCache[canvas._pixiId] = this;\n\n        this.isLoading = false;\n        this._sourceLoaded();\n        this.emit('loaded', this);\n    }\n\n    /**\n     * Used internally to update the width, height, and some other tracking vars once\n     * a source has successfully loaded.\n     *\n     * @private\n     */\n    _sourceLoaded()\n    {\n        this.hasLoaded = true;\n        this.update();\n    }\n\n    /**\n     * Destroys this base texture\n     *\n     */\n    destroy()\n    {\n        if (this.imageUrl)\n        {\n            delete BaseTextureCache[this.imageUrl];\n            delete TextureCache[this.imageUrl];\n\n            this.imageUrl = null;\n\n            if (!navigator.isCocoonJS)\n            {\n                this.source.src = '';\n            }\n        }\n        // An svg source has both `imageUrl` and `__pixiId`, so no `else if` here\n        if (this.source && this.source._pixiId)\n        {\n            delete BaseTextureCache[this.source._pixiId];\n        }\n\n        this.source = null;\n\n        this.dispose();\n    }\n\n    /**\n     * Frees the texture from WebGL memory without destroying this texture object.\n     * This means you can still use the texture later which will upload it to GPU\n     * memory again.\n     *\n     */\n    dispose()\n    {\n        this.emit('dispose', this);\n    }\n\n    /**\n     * Changes the source image of the texture.\n     * The original source must be an Image element.\n     *\n     * @param {string} newSrc - the path of the image\n     */\n    updateSourceImage(newSrc)\n    {\n        this.source.src = newSrc;\n\n        this.loadSource(this.source);\n    }\n\n    /**\n     * Helper function that creates a base texture from the given image url.\n     * If the image is not in the base texture cache it will be created and loaded.\n     *\n     * @static\n     * @param {string} imageUrl - The image url of the texture\n     * @param {boolean} [crossorigin=(auto)] - Should use anonymous CORS? Defaults to true if the URL is not a data-URI.\n     * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n     * @param {number} [sourceScale=(auto)] - Scale for the original image, used with Svg images.\n     * @return {PIXI.BaseTexture} The new base texture.\n     */\n    static fromImage(imageUrl, crossorigin, scaleMode, sourceScale)\n    {\n        let baseTexture = BaseTextureCache[imageUrl];\n\n        if (!baseTexture)\n        {\n            // new Image() breaks tex loading in some versions of Chrome.\n            // See https://code.google.com/p/chromium/issues/detail?id=238071\n            const image = new Image();// document.createElement('img');\n\n            if (crossorigin === undefined && imageUrl.indexOf('data:') !== 0)\n            {\n                image.crossOrigin = determineCrossOrigin(imageUrl);\n            }\n\n            baseTexture = new BaseTexture(image, scaleMode);\n            baseTexture.imageUrl = imageUrl;\n\n            if (sourceScale)\n            {\n                baseTexture.sourceScale = sourceScale;\n            }\n\n            // if there is an @2x at the end of the url we are going to assume its a highres image\n            baseTexture.resolution = getResolutionOfUrl(imageUrl);\n\n            image.src = imageUrl; // Setting this triggers load\n\n            BaseTextureCache[imageUrl] = baseTexture;\n        }\n\n        return baseTexture;\n    }\n\n    /**\n     * Helper function that creates a base texture from the given canvas element.\n     *\n     * @static\n     * @param {HTMLCanvasElement} canvas - The canvas element source of the texture\n     * @param {number} scaleMode - See {@link PIXI.SCALE_MODES} for possible values\n     * @return {PIXI.BaseTexture} The new base texture.\n     */\n    static fromCanvas(canvas, scaleMode)\n    {\n        if (!canvas._pixiId)\n        {\n            canvas._pixiId = `canvas_${uid()}`;\n        }\n\n        let baseTexture = BaseTextureCache[canvas._pixiId];\n\n        if (!baseTexture)\n        {\n            baseTexture = new BaseTexture(canvas, scaleMode);\n            BaseTextureCache[canvas._pixiId] = baseTexture;\n        }\n\n        return baseTexture;\n    }\n}\n","import BaseRenderTexture from './BaseRenderTexture';\nimport Texture from './Texture';\n\n/**\n * A RenderTexture is a special texture that allows any Pixi display object to be rendered to it.\n *\n * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded\n * otherwise black rectangles will be drawn instead.\n *\n * A RenderTexture takes a snapshot of any Display Object given to its render method. The position\n * and rotation of the given Display Objects is ignored. For example:\n *\n * ```js\n * let renderer = PIXI.autoDetectRenderer(1024, 1024, { view: canvas, ratio: 1 });\n * let renderTexture = PIXI.RenderTexture.create(800, 600);\n * let sprite = PIXI.Sprite.fromImage(\"spinObj_01.png\");\n *\n * sprite.position.x = 800/2;\n * sprite.position.y = 600/2;\n * sprite.anchor.x = 0.5;\n * sprite.anchor.y = 0.5;\n *\n * renderer.render(sprite, renderTexture);\n * ```\n *\n * The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual\n * position a Container should be used:\n *\n * ```js\n * let doc = new PIXI.Container();\n *\n * doc.addChild(sprite);\n *\n * renderer.render(doc, renderTexture);  // Renders to center of renderTexture\n * ```\n *\n * @class\n * @extends PIXI.Texture\n * @memberof PIXI\n */\nexport default class RenderTexture extends Texture\n{\n    /**\n     * @param {PIXI.BaseRenderTexture} baseRenderTexture - The renderer used for this RenderTexture\n     * @param {PIXI.Rectangle} [frame] - The rectangle frame of the texture to show\n     */\n    constructor(baseRenderTexture, frame)\n    {\n        // support for legacy..\n        let _legacyRenderer = null;\n\n        if (!(baseRenderTexture instanceof BaseRenderTexture))\n        {\n            /* eslint-disable prefer-rest-params, no-console */\n            const width = arguments[1];\n            const height = arguments[2];\n            const scaleMode = arguments[3] || 0;\n            const resolution = arguments[4] || 1;\n\n            // we have an old render texture..\n            console.warn(`Please use RenderTexture.create(${width}, ${height}) instead of the ctor directly.`);\n            _legacyRenderer = arguments[0];\n            /* eslint-enable prefer-rest-params, no-console */\n\n            frame = null;\n            baseRenderTexture = new BaseRenderTexture(width, height, scaleMode, resolution);\n        }\n\n        /**\n         * The base texture object that this texture uses\n         *\n         * @member {BaseTexture}\n         */\n        super(\n            baseRenderTexture,\n            frame\n        );\n\n        this.legacyRenderer = _legacyRenderer;\n\n        /**\n         * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.\n         *\n         * @member {boolean}\n         */\n        this.valid = true;\n\n        this._updateUvs();\n    }\n\n    /**\n     * Resizes the RenderTexture.\n     *\n     * @param {number} width - The width to resize to.\n     * @param {number} height - The height to resize to.\n     * @param {boolean} doNotResizeBaseTexture - Should the baseTexture.width and height values be resized as well?\n     */\n    resize(width, height, doNotResizeBaseTexture)\n    {\n        // TODO - could be not required..\n        this.valid = (width > 0 && height > 0);\n\n        this._frame.width = this.orig.width = width;\n        this._frame.height = this.orig.height = height;\n\n        if (!doNotResizeBaseTexture)\n        {\n            this.baseTexture.resize(width, height);\n        }\n\n        this._updateUvs();\n    }\n\n    /**\n     * A short hand way of creating a render texture.\n     *\n     * @param {number} [width=100] - The width of the render texture\n     * @param {number} [height=100] - The height of the render texture\n     * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n     * @param {number} [resolution=1] - The resolution / device pixel ratio of the texture being generated\n     * @return {PIXI.RenderTexture} The new render texture\n     */\n    static create(width, height, scaleMode, resolution)\n    {\n        return new RenderTexture(new BaseRenderTexture(width, height, scaleMode, resolution));\n    }\n}\n","import BaseTexture from './BaseTexture';\nimport VideoBaseTexture from './VideoBaseTexture';\nimport TextureUvs from './TextureUvs';\nimport EventEmitter from 'eventemitter3';\nimport { Rectangle } from '../math';\nimport { TextureCache, BaseTextureCache } from '../utils';\n\n/**\n * A texture stores the information that represents an image or part of an image. It cannot be added\n * to the display list directly. Instead use it as the texture for a Sprite. If no frame is provided\n * then the whole image is used.\n *\n * You can directly create a texture from an image and then reuse it multiple times like this :\n *\n * ```js\n * let texture = PIXI.Texture.fromImage('assets/image.png');\n * let sprite1 = new PIXI.Sprite(texture);\n * let sprite2 = new PIXI.Sprite(texture);\n * ```\n *\n * Textures made from SVGs, loaded or not, cannot be used before the file finishes processing.\n * You can check for this by checking the sprite's _textureID property.\n * ```js\n * var texture = PIXI.Texture.fromImage('assets/image.svg');\n * var sprite1 = new PIXI.Sprite(texture);\n * //sprite1._textureID should not be undefined if the texture has finished processing the SVG file\n * ```\n * You can use a ticker or rAF to ensure your sprites load the finished textures after processing. See issue #3068.\n *\n * @class\n * @extends EventEmitter\n * @memberof PIXI\n */\nexport default class Texture extends EventEmitter\n{\n    /**\n     * @param {PIXI.BaseTexture} baseTexture - The base texture source to create the texture from\n     * @param {PIXI.Rectangle} [frame] - The rectangle frame of the texture to show\n     * @param {PIXI.Rectangle} [orig] - The area of original texture\n     * @param {PIXI.Rectangle} [trim] - Trimmed rectangle of original texture\n     * @param {number} [rotate] - indicates how the texture was rotated by texture packer. See {@link PIXI.GroupD8}\n     */\n    constructor(baseTexture, frame, orig, trim, rotate)\n    {\n        super();\n\n        /**\n         * Does this Texture have any frame data assigned to it?\n         *\n         * @member {boolean}\n         */\n        this.noFrame = false;\n\n        if (!frame)\n        {\n            this.noFrame = true;\n            frame = new Rectangle(0, 0, 1, 1);\n        }\n\n        if (baseTexture instanceof Texture)\n        {\n            baseTexture = baseTexture.baseTexture;\n        }\n\n        /**\n         * The base texture that this texture uses.\n         *\n         * @member {PIXI.BaseTexture}\n         */\n        this.baseTexture = baseTexture;\n\n        /**\n         * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,\n         * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)\n         *\n         * @member {PIXI.Rectangle}\n         */\n        this._frame = frame;\n\n        /**\n         * This is the trimmed area of original texture, before it was put in atlas\n         *\n         * @member {PIXI.Rectangle}\n         */\n        this.trim = trim;\n\n        /**\n         * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.\n         *\n         * @member {boolean}\n         */\n        this.valid = false;\n\n        /**\n         * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)\n         *\n         * @member {boolean}\n         */\n        this.requiresUpdate = false;\n\n        /**\n         * The WebGL UV data cache.\n         *\n         * @member {PIXI.TextureUvs}\n         * @private\n         */\n        this._uvs = null;\n\n        /**\n         * This is the area of original texture, before it was put in atlas\n         *\n         * @member {PIXI.Rectangle}\n         */\n        this.orig = orig || frame;// new Rectangle(0, 0, 1, 1);\n\n        this._rotate = Number(rotate || 0);\n\n        if (rotate === true)\n        {\n            // this is old texturepacker legacy, some games/libraries are passing \"true\" for rotated textures\n            this._rotate = 2;\n        }\n        else if (this._rotate % 2 !== 0)\n        {\n            throw new Error('attempt to use diamond-shaped UVs. If you are sure, set rotation manually');\n        }\n\n        if (baseTexture.hasLoaded)\n        {\n            if (this.noFrame)\n            {\n                frame = new Rectangle(0, 0, baseTexture.width, baseTexture.height);\n\n                // if there is no frame we should monitor for any base texture changes..\n                baseTexture.on('update', this.onBaseTextureUpdated, this);\n            }\n            this.frame = frame;\n        }\n        else\n        {\n            baseTexture.once('loaded', this.onBaseTextureLoaded, this);\n        }\n\n        /**\n         * Fired when the texture is updated. This happens if the frame or the baseTexture is updated.\n         *\n         * @event update\n         * @memberof PIXI.Texture#\n         * @protected\n         */\n\n        this._updateID = 0;\n\n        /**\n         * Extra field for extra plugins. May contain clamp settings and some matrices\n         * @type {Object}\n         */\n        this.transform = null;\n    }\n\n    /**\n     * Updates this texture on the gpu.\n     *\n     */\n    update()\n    {\n        this.baseTexture.update();\n    }\n\n    /**\n     * Called when the base texture is loaded\n     *\n     * @private\n     * @param {PIXI.BaseTexture} baseTexture - The base texture.\n     */\n    onBaseTextureLoaded(baseTexture)\n    {\n        this._updateID++;\n\n        // TODO this code looks confusing.. boo to abusing getters and setters!\n        if (this.noFrame)\n        {\n            this.frame = new Rectangle(0, 0, baseTexture.width, baseTexture.height);\n        }\n        else\n        {\n            this.frame = this._frame;\n        }\n\n        this.baseTexture.on('update', this.onBaseTextureUpdated, this);\n        this.emit('update', this);\n    }\n\n    /**\n     * Called when the base texture is updated\n     *\n     * @private\n     * @param {PIXI.BaseTexture} baseTexture - The base texture.\n     */\n    onBaseTextureUpdated(baseTexture)\n    {\n        this._updateID++;\n\n        this._frame.width = baseTexture.width;\n        this._frame.height = baseTexture.height;\n\n        this.emit('update', this);\n    }\n\n    /**\n     * Destroys this texture\n     *\n     * @param {boolean} [destroyBase=false] Whether to destroy the base texture as well\n     */\n    destroy(destroyBase)\n    {\n        if (this.baseTexture)\n        {\n            if (destroyBase)\n            {\n                // delete the texture if it exists in the texture cache..\n                // this only needs to be removed if the base texture is actually destroyed too..\n                if (TextureCache[this.baseTexture.imageUrl])\n                {\n                    delete TextureCache[this.baseTexture.imageUrl];\n                }\n\n                this.baseTexture.destroy();\n            }\n\n            this.baseTexture.off('update', this.onBaseTextureUpdated, this);\n            this.baseTexture.off('loaded', this.onBaseTextureLoaded, this);\n\n            this.baseTexture = null;\n        }\n\n        this._frame = null;\n        this._uvs = null;\n        this.trim = null;\n        this.orig = null;\n\n        this.valid = false;\n\n        this.off('dispose', this.dispose, this);\n        this.off('update', this.update, this);\n    }\n\n    /**\n     * Creates a new texture object that acts the same as this one.\n     *\n     * @return {PIXI.Texture} The new texture\n     */\n    clone()\n    {\n        return new Texture(this.baseTexture, this.frame, this.orig, this.trim, this.rotate);\n    }\n\n    /**\n     * Updates the internal WebGL UV cache.\n     *\n     * @protected\n     */\n    _updateUvs()\n    {\n        if (!this._uvs)\n        {\n            this._uvs = new TextureUvs();\n        }\n\n        this._uvs.set(this._frame, this.baseTexture, this.rotate);\n\n        this._updateID++;\n    }\n\n    /**\n     * Helper function that creates a Texture object from the given image url.\n     * If the image is not in the texture cache it will be  created and loaded.\n     *\n     * @static\n     * @param {string} imageUrl - The image url of the texture\n     * @param {boolean} [crossorigin] - Whether requests should be treated as crossorigin\n     * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n     * @param {number} [sourceScale=(auto)] - Scale for the original image, used with SVG images.\n     * @return {PIXI.Texture} The newly created texture\n     */\n    static fromImage(imageUrl, crossorigin, scaleMode, sourceScale)\n    {\n        let texture = TextureCache[imageUrl];\n\n        if (!texture)\n        {\n            texture = new Texture(BaseTexture.fromImage(imageUrl, crossorigin, scaleMode, sourceScale));\n            TextureCache[imageUrl] = texture;\n        }\n\n        return texture;\n    }\n\n    /**\n     * Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId\n     * The frame ids are created when a Texture packer file has been loaded\n     *\n     * @static\n     * @param {string} frameId - The frame Id of the texture in the cache\n     * @return {PIXI.Texture} The newly created texture\n     */\n    static fromFrame(frameId)\n    {\n        const texture = TextureCache[frameId];\n\n        if (!texture)\n        {\n            throw new Error(`The frameId \"${frameId}\" does not exist in the texture cache`);\n        }\n\n        return texture;\n    }\n\n    /**\n     * Helper function that creates a new Texture based on the given canvas element.\n     *\n     * @static\n     * @param {HTMLCanvasElement} canvas - The canvas element source of the texture\n     * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n     * @return {PIXI.Texture} The newly created texture\n     */\n    static fromCanvas(canvas, scaleMode)\n    {\n        return new Texture(BaseTexture.fromCanvas(canvas, scaleMode));\n    }\n\n    /**\n     * Helper function that creates a new Texture based on the given video element.\n     *\n     * @static\n     * @param {HTMLVideoElement|string} video - The URL or actual element of the video\n     * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n     * @return {PIXI.Texture} The newly created texture\n     */\n    static fromVideo(video, scaleMode)\n    {\n        if (typeof video === 'string')\n        {\n            return Texture.fromVideoUrl(video, scaleMode);\n        }\n\n        return new Texture(VideoBaseTexture.fromVideo(video, scaleMode));\n    }\n\n    /**\n     * Helper function that creates a new Texture based on the video url.\n     *\n     * @static\n     * @param {string} videoUrl - URL of the video\n     * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n     * @return {PIXI.Texture} The newly created texture\n     */\n    static fromVideoUrl(videoUrl, scaleMode)\n    {\n        return new Texture(VideoBaseTexture.fromUrl(videoUrl, scaleMode));\n    }\n\n    /**\n     * Helper function that creates a new Texture based on the source you provide.\n     * The source can be - frame id, image url, video url, canvas element, video element, base texture\n     *\n     * @static\n     * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from\n     * @return {PIXI.Texture} The newly created texture\n     */\n    static from(source)\n    {\n        // TODO auto detect cross origin..\n        // TODO pass in scale mode?\n        if (typeof source === 'string')\n        {\n            const texture = TextureCache[source];\n\n            if (!texture)\n            {\n                // check if its a video..\n                const isVideo = source.match(/\\.(mp4|webm|ogg|h264|avi|mov)$/) !== null;\n\n                if (isVideo)\n                {\n                    return Texture.fromVideoUrl(source);\n                }\n\n                return Texture.fromImage(source);\n            }\n\n            return texture;\n        }\n        else if (source instanceof HTMLImageElement)\n        {\n            return new Texture(new BaseTexture(source));\n        }\n        else if (source instanceof HTMLCanvasElement)\n        {\n            return Texture.fromCanvas(source);\n        }\n        else if (source instanceof HTMLVideoElement)\n        {\n            return Texture.fromVideo(source);\n        }\n        else if (source instanceof BaseTexture)\n        {\n            return new Texture(source);\n        }\n\n        // lets assume its a texture!\n        return source;\n    }\n\n    /**\n     * Adds a texture to the global TextureCache. This cache is shared across the whole PIXI object.\n     *\n     * @static\n     * @param {PIXI.Texture} texture - The Texture to add to the cache.\n     * @param {string} id - The id that the texture will be stored against.\n     */\n    static addTextureToCache(texture, id)\n    {\n        TextureCache[id] = texture;\n    }\n\n    /**\n     * Remove a texture from the global TextureCache.\n     *\n     * @static\n     * @param {string} id - The id of the texture to be removed\n     * @return {PIXI.Texture} The texture that was removed\n     */\n    static removeTextureFromCache(id)\n    {\n        const texture = TextureCache[id];\n\n        delete TextureCache[id];\n        delete BaseTextureCache[id];\n\n        return texture;\n    }\n\n    /**\n     * The frame specifies the region of the base texture that this texture uses.\n     *\n     * @member {PIXI.Rectangle}\n     * @memberof PIXI.Texture#\n     */\n    get frame()\n    {\n        return this._frame;\n    }\n\n    /**\n     * Set the frame.\n     *\n     * @param {Rectangle} frame - The new frame to set.\n     */\n    set frame(frame)\n    {\n        this._frame = frame;\n\n        this.noFrame = false;\n\n        if (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)\n        {\n            throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions ${this}`);\n        }\n\n        // this.valid = frame && frame.width && frame.height && this.baseTexture.source && this.baseTexture.hasLoaded;\n        this.valid = frame && frame.width && frame.height && this.baseTexture.hasLoaded;\n\n        if (!this.trim && !this.rotate)\n        {\n            this.orig = frame;\n        }\n\n        if (this.valid)\n        {\n            this._updateUvs();\n        }\n    }\n\n    /**\n     * Indicates whether the texture is rotated inside the atlas\n     * set to 2 to compensate for texture packer rotation\n     * set to 6 to compensate for spine packer rotation\n     * can be used to rotate or mirror sprites\n     * See {@link PIXI.GroupD8} for explanation\n     *\n     * @member {number}\n     */\n    get rotate()\n    {\n        return this._rotate;\n    }\n\n    /**\n     * Set the rotation\n     *\n     * @param {number} rotate - The new rotation to set.\n     */\n    set rotate(rotate)\n    {\n        this._rotate = rotate;\n        if (this.valid)\n        {\n            this._updateUvs();\n        }\n    }\n\n    /**\n     * The width of the Texture in pixels.\n     *\n     * @member {number}\n     */\n    get width()\n    {\n        return this.orig ? this.orig.width : 0;\n    }\n\n    /**\n     * The height of the Texture in pixels.\n     *\n     * @member {number}\n     */\n    get height()\n    {\n        return this.orig ? this.orig.height : 0;\n    }\n}\n\n/**\n * An empty texture, used often to not have to create multiple empty textures.\n * Can not be destroyed.\n *\n * @static\n * @constant\n */\nTexture.EMPTY = new Texture(new BaseTexture());\nTexture.EMPTY.destroy = function _emptyDestroy() { /* empty */ };\nTexture.EMPTY.on = function _emptyOn() { /* empty */ };\nTexture.EMPTY.once = function _emptyOnce() { /* empty */ };\nTexture.EMPTY.emit = function _emptyEmit() { /* empty */ };\n","import GroupD8 from '../math/GroupD8';\n\n/**\n * A standard object to store the Uvs of a texture\n *\n * @class\n * @private\n * @memberof PIXI\n */\nexport default class TextureUvs\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        this.x0 = 0;\n        this.y0 = 0;\n\n        this.x1 = 1;\n        this.y1 = 0;\n\n        this.x2 = 1;\n        this.y2 = 1;\n\n        this.x3 = 0;\n        this.y3 = 1;\n\n        this.uvsUint32 = new Uint32Array(4);\n    }\n\n    /**\n     * Sets the texture Uvs based on the given frame information.\n     *\n     * @private\n     * @param {PIXI.Rectangle} frame - The frame of the texture\n     * @param {PIXI.Rectangle} baseFrame - The base frame of the texture\n     * @param {number} rotate - Rotation of frame, see {@link PIXI.GroupD8}\n     */\n    set(frame, baseFrame, rotate)\n    {\n        const tw = baseFrame.width;\n        const th = baseFrame.height;\n\n        if (rotate)\n        {\n            // width and height div 2 div baseFrame size\n            const w2 = frame.width / 2 / tw;\n            const h2 = frame.height / 2 / th;\n\n            // coordinates of center\n            const cX = (frame.x / tw) + w2;\n            const cY = (frame.y / th) + h2;\n\n            rotate = GroupD8.add(rotate, GroupD8.NW); // NW is top-left corner\n            this.x0 = cX + (w2 * GroupD8.uX(rotate));\n            this.y0 = cY + (h2 * GroupD8.uY(rotate));\n\n            rotate = GroupD8.add(rotate, 2); // rotate 90 degrees clockwise\n            this.x1 = cX + (w2 * GroupD8.uX(rotate));\n            this.y1 = cY + (h2 * GroupD8.uY(rotate));\n\n            rotate = GroupD8.add(rotate, 2);\n            this.x2 = cX + (w2 * GroupD8.uX(rotate));\n            this.y2 = cY + (h2 * GroupD8.uY(rotate));\n\n            rotate = GroupD8.add(rotate, 2);\n            this.x3 = cX + (w2 * GroupD8.uX(rotate));\n            this.y3 = cY + (h2 * GroupD8.uY(rotate));\n        }\n        else\n        {\n            this.x0 = frame.x / tw;\n            this.y0 = frame.y / th;\n\n            this.x1 = (frame.x + frame.width) / tw;\n            this.y1 = frame.y / th;\n\n            this.x2 = (frame.x + frame.width) / tw;\n            this.y2 = (frame.y + frame.height) / th;\n\n            this.x3 = frame.x / tw;\n            this.y3 = (frame.y + frame.height) / th;\n        }\n\n        this.uvsUint32[0] = (((this.y0 * 65535) & 0xFFFF) << 16) | ((this.x0 * 65535) & 0xFFFF);\n        this.uvsUint32[1] = (((this.y1 * 65535) & 0xFFFF) << 16) | ((this.x1 * 65535) & 0xFFFF);\n        this.uvsUint32[2] = (((this.y2 * 65535) & 0xFFFF) << 16) | ((this.x2 * 65535) & 0xFFFF);\n        this.uvsUint32[3] = (((this.y3 * 65535) & 0xFFFF) << 16) | ((this.x3 * 65535) & 0xFFFF);\n    }\n}\n","import BaseTexture from './BaseTexture';\nimport { uid, BaseTextureCache } from '../utils';\nimport * as ticker from '../ticker';\n\n/**\n * A texture of a [playing] Video.\n *\n * Video base textures mimic Pixi BaseTexture.from.... method in their creation process.\n *\n * This can be used in several ways, such as:\n *\n * ```js\n * let texture = PIXI.VideoBaseTexture.fromUrl('http://mydomain.com/video.mp4');\n *\n * let texture = PIXI.VideoBaseTexture.fromUrl({ src: 'http://mydomain.com/video.mp4', mime: 'video/mp4' });\n *\n * let texture = PIXI.VideoBaseTexture.fromUrls(['/video.webm', '/video.mp4']);\n *\n * let texture = PIXI.VideoBaseTexture.fromUrls([\n *     { src: '/video.webm', mime: 'video/webm' },\n *     { src: '/video.mp4', mime: 'video/mp4' }\n * ]);\n * ```\n *\n * See the [\"deus\" demo](http://www.goodboydigital.com/pixijs/examples/deus/).\n *\n * @class\n * @extends PIXI.BaseTexture\n * @memberof PIXI\n */\nexport default class VideoBaseTexture extends BaseTexture\n{\n    /**\n     * @param {HTMLVideoElement} source - Video source\n     * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n     */\n    constructor(source, scaleMode)\n    {\n        if (!source)\n        {\n            throw new Error('No video source element specified.');\n        }\n\n        // hook in here to check if video is already available.\n        // BaseTexture looks for a source.complete boolean, plus width & height.\n\n        if ((source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA)\n            && source.width && source.height)\n        {\n            source.complete = true;\n        }\n\n        super(source, scaleMode);\n\n        this.width = source.videoWidth;\n        this.height = source.videoHeight;\n\n        this._autoUpdate = true;\n        this._isAutoUpdating = false;\n\n        /**\n         * When set to true will automatically play videos used by this texture once\n         * they are loaded. If false, it will not modify the playing state.\n         *\n         * @member {boolean}\n         * @default true\n         */\n        this.autoPlay = true;\n\n        this.update = this.update.bind(this);\n        this._onCanPlay = this._onCanPlay.bind(this);\n\n        source.addEventListener('play', this._onPlayStart.bind(this));\n        source.addEventListener('pause', this._onPlayStop.bind(this));\n        this.hasLoaded = false;\n        this.__loaded = false;\n\n        if (!this._isSourceReady())\n        {\n            source.addEventListener('canplay', this._onCanPlay);\n            source.addEventListener('canplaythrough', this._onCanPlay);\n        }\n        else\n        {\n            this._onCanPlay();\n        }\n    }\n\n    /**\n     * Returns true if the underlying source is playing.\n     *\n     * @private\n     * @return {boolean} True if playing.\n     */\n    _isSourcePlaying()\n    {\n        const source = this.source;\n\n        return (source.currentTime > 0 && source.paused === false && source.ended === false && source.readyState > 2);\n    }\n\n    /**\n     * Returns true if the underlying source is ready for playing.\n     *\n     * @private\n     * @return {boolean} True if ready.\n     */\n    _isSourceReady()\n    {\n        return this.source.readyState === 3 || this.source.readyState === 4;\n    }\n\n    /**\n     * Runs the update loop when the video is ready to play\n     *\n     * @private\n     */\n    _onPlayStart()\n    {\n        // Just in case the video has not received its can play even yet..\n        if (!this.hasLoaded)\n        {\n            this._onCanPlay();\n        }\n\n        if (!this._isAutoUpdating && this.autoUpdate)\n        {\n            ticker.shared.add(this.update, this);\n            this._isAutoUpdating = true;\n        }\n    }\n\n    /**\n     * Fired when a pause event is triggered, stops the update loop\n     *\n     * @private\n     */\n    _onPlayStop()\n    {\n        if (this._isAutoUpdating)\n        {\n            ticker.shared.remove(this.update, this);\n            this._isAutoUpdating = false;\n        }\n    }\n\n    /**\n     * Fired when the video is loaded and ready to play\n     *\n     * @private\n     */\n    _onCanPlay()\n    {\n        this.hasLoaded = true;\n\n        if (this.source)\n        {\n            this.source.removeEventListener('canplay', this._onCanPlay);\n            this.source.removeEventListener('canplaythrough', this._onCanPlay);\n\n            this.width = this.source.videoWidth;\n            this.height = this.source.videoHeight;\n\n            // prevent multiple loaded dispatches..\n            if (!this.__loaded)\n            {\n                this.__loaded = true;\n                this.emit('loaded', this);\n            }\n\n            if (this._isSourcePlaying())\n            {\n                this._onPlayStart();\n            }\n            else if (this.autoPlay)\n            {\n                this.source.play();\n            }\n        }\n    }\n\n    /**\n     * Destroys this texture\n     *\n     */\n    destroy()\n    {\n        if (this._isAutoUpdating)\n        {\n            ticker.shared.remove(this.update, this);\n        }\n\n        if (this.source && this.source._pixiId)\n        {\n            delete BaseTextureCache[this.source._pixiId];\n            delete this.source._pixiId;\n        }\n\n        super.destroy();\n    }\n\n    /**\n     * Mimic Pixi BaseTexture.from.... method.\n     *\n     * @static\n     * @param {HTMLVideoElement} video - Video to create texture from\n     * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n     * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture\n     */\n    static fromVideo(video, scaleMode)\n    {\n        if (!video._pixiId)\n        {\n            video._pixiId = `video_${uid()}`;\n        }\n\n        let baseTexture = BaseTextureCache[video._pixiId];\n\n        if (!baseTexture)\n        {\n            baseTexture = new VideoBaseTexture(video, scaleMode);\n            BaseTextureCache[video._pixiId] = baseTexture;\n        }\n\n        return baseTexture;\n    }\n\n    /**\n     * Helper function that creates a new BaseTexture based on the given video element.\n     * This BaseTexture can then be used to create a texture\n     *\n     * @static\n     * @param {string|object|string[]|object[]} videoSrc - The URL(s) for the video.\n     * @param {string} [videoSrc.src] - One of the source urls for the video\n     * @param {string} [videoSrc.mime] - The mimetype of the video (e.g. 'video/mp4'). If not specified\n     *  the url's extension will be used as the second part of the mime type.\n     * @param {number} scaleMode - See {@link PIXI.SCALE_MODES} for possible values\n     * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture\n     */\n    static fromUrl(videoSrc, scaleMode)\n    {\n        const video = document.createElement('video');\n\n        video.setAttribute('webkit-playsinline', '');\n        video.setAttribute('playsinline', '');\n\n        // array of objects or strings\n        if (Array.isArray(videoSrc))\n        {\n            for (let i = 0; i < videoSrc.length; ++i)\n            {\n                video.appendChild(createSource(videoSrc[i].src || videoSrc[i], videoSrc[i].mime));\n            }\n        }\n        // single object or string\n        else\n        {\n            video.appendChild(createSource(videoSrc.src || videoSrc, videoSrc.mime));\n        }\n\n        video.load();\n\n        return VideoBaseTexture.fromVideo(video, scaleMode);\n    }\n\n    /**\n     * Should the base texture automatically update itself, set to true by default\n     *\n     * @member {boolean}\n     * @memberof PIXI.VideoBaseTexture#\n     */\n    get autoUpdate()\n    {\n        return this._autoUpdate;\n    }\n\n    /**\n     * Sets autoUpdate property.\n     *\n     * @param {number} value - enable auto update or not\n     */\n    set autoUpdate(value)\n    {\n        if (value !== this._autoUpdate)\n        {\n            this._autoUpdate = value;\n\n            if (!this._autoUpdate && this._isAutoUpdating)\n            {\n                ticker.shared.remove(this.update, this);\n                this._isAutoUpdating = false;\n            }\n            else if (this._autoUpdate && !this._isAutoUpdating)\n            {\n                ticker.shared.add(this.update, this);\n                this._isAutoUpdating = true;\n            }\n        }\n    }\n}\n\nVideoBaseTexture.fromUrls = VideoBaseTexture.fromUrl;\n\nfunction createSource(path, type)\n{\n    if (!type)\n    {\n        type = `video/${path.substr(path.lastIndexOf('.') + 1)}`;\n    }\n\n    const source = document.createElement('source');\n\n    source.src = path;\n    source.type = type;\n\n    return source;\n}\n","import settings from '../settings';\nimport EventEmitter from 'eventemitter3';\n\n// Internal event used by composed emitter\nconst TICK = 'tick';\n\n/**\n * A Ticker class that runs an update loop that other objects listen to.\n * This class is composed around an EventEmitter object to add listeners\n * meant for execution on the next requested animation frame.\n * Animation frames are requested only when necessary,\n * e.g. When the ticker is started and the emitter has listeners.\n *\n * @class\n * @memberof PIXI.ticker\n */\nexport default class Ticker\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        /**\n         * Internal emitter used to fire 'tick' event\n         * @private\n         */\n        this._emitter = new EventEmitter();\n\n        /**\n         * Internal current frame request ID\n         * @private\n         */\n        this._requestId = null;\n\n        /**\n         * Internal value managed by minFPS property setter and getter.\n         * This is the maximum allowed milliseconds between updates.\n         * @private\n         */\n        this._maxElapsedMS = 100;\n\n        /**\n         * Whether or not this ticker should invoke the method\n         * {@link PIXI.ticker.Ticker#start} automatically\n         * when a listener is added.\n         *\n         * @member {boolean}\n         * @default false\n         */\n        this.autoStart = false;\n\n        /**\n         * Scalar time value from last frame to this frame.\n         * This value is capped by setting {@link PIXI.ticker.Ticker#minFPS}\n         * and is scaled with {@link PIXI.ticker.Ticker#speed}.\n         * **Note:** The cap may be exceeded by scaling.\n         *\n         * @member {number}\n         * @default 1\n         */\n        this.deltaTime = 1;\n\n        /**\n         * Time elapsed in milliseconds from last frame to this frame.\n         * Opposed to what the scalar {@link PIXI.ticker.Ticker#deltaTime}\n         * is based, this value is neither capped nor scaled.\n         * If the platform supports DOMHighResTimeStamp,\n         * this value will have a precision of 1 µs.\n         *\n         * @member {number}\n         * @default 1 / TARGET_FPMS\n         */\n        this.elapsedMS = 1 / settings.TARGET_FPMS; // default to target frame time\n\n        /**\n         * The last time {@link PIXI.ticker.Ticker#update} was invoked.\n         * This value is also reset internally outside of invoking\n         * update, but only when a new animation frame is requested.\n         * If the platform supports DOMHighResTimeStamp,\n         * this value will have a precision of 1 µs.\n         *\n         * @member {number}\n         * @default 0\n         */\n        this.lastTime = 0;\n\n        /**\n         * Factor of current {@link PIXI.ticker.Ticker#deltaTime}.\n         * @example\n         * // Scales ticker.deltaTime to what would be\n         * // the equivalent of approximately 120 FPS\n         * ticker.speed = 2;\n         *\n         * @member {number}\n         * @default 1\n         */\n        this.speed = 1;\n\n        /**\n         * Whether or not this ticker has been started.\n         * `true` if {@link PIXI.ticker.Ticker#start} has been called.\n         * `false` if {@link PIXI.ticker.Ticker#stop} has been called.\n         * While `false`, this value may change to `true` in the\n         * event of {@link PIXI.ticker.Ticker#autoStart} being `true`\n         * and a listener is added.\n         *\n         * @member {boolean}\n         * @default false\n         */\n        this.started = false;\n\n        /**\n         * Internal tick method bound to ticker instance.\n         * This is because in early 2015, Function.bind\n         * is still 60% slower in high performance scenarios.\n         * Also separating frame requests from update method\n         * so listeners may be called at any time and with\n         * any animation API, just invoke ticker.update(time).\n         *\n         * @private\n         * @param {number} time - Time since last tick.\n         */\n        this._tick = (time) =>\n        {\n            this._requestId = null;\n\n            if (this.started)\n            {\n                // Invoke listeners now\n                this.update(time);\n                // Listener side effects may have modified ticker state.\n                if (this.started && this._requestId === null && this._emitter.listeners(TICK, true))\n                {\n                    this._requestId = requestAnimationFrame(this._tick);\n                }\n            }\n        };\n    }\n\n    /**\n     * Conditionally requests a new animation frame.\n     * If a frame has not already been requested, and if the internal\n     * emitter has listeners, a new frame is requested.\n     *\n     * @private\n     */\n    _requestIfNeeded()\n    {\n        if (this._requestId === null && this._emitter.listeners(TICK, true))\n        {\n            // ensure callbacks get correct delta\n            this.lastTime = performance.now();\n            this._requestId = requestAnimationFrame(this._tick);\n        }\n    }\n\n    /**\n     * Conditionally cancels a pending animation frame.\n     *\n     * @private\n     */\n    _cancelIfNeeded()\n    {\n        if (this._requestId !== null)\n        {\n            cancelAnimationFrame(this._requestId);\n            this._requestId = null;\n        }\n    }\n\n    /**\n     * Conditionally requests a new animation frame.\n     * If the ticker has been started it checks if a frame has not already\n     * been requested, and if the internal emitter has listeners. If these\n     * conditions are met, a new frame is requested. If the ticker has not\n     * been started, but autoStart is `true`, then the ticker starts now,\n     * and continues with the previous conditions to request a new frame.\n     *\n     * @private\n     */\n    _startIfPossible()\n    {\n        if (this.started)\n        {\n            this._requestIfNeeded();\n        }\n        else if (this.autoStart)\n        {\n            this.start();\n        }\n    }\n\n    /**\n     * Calls {@link module:eventemitter3.EventEmitter#on} internally for the\n     * internal 'tick' event. It checks if the emitter has listeners,\n     * and if so it requests a new animation frame at this point.\n     *\n     * @param {Function} fn - The listener function to be added for updates\n     * @param {Function} [context] - The listener context\n     * @returns {PIXI.ticker.Ticker} This instance of a ticker\n     */\n    add(fn, context)\n    {\n        this._emitter.on(TICK, fn, context);\n\n        this._startIfPossible();\n\n        return this;\n    }\n\n    /**\n     * Calls {@link module:eventemitter3.EventEmitter#once} internally for the\n     * internal 'tick' event. It checks if the emitter has listeners,\n     * and if so it requests a new animation frame at this point.\n     *\n     * @param {Function} fn - The listener function to be added for one update\n     * @param {Function} [context] - The listener context\n     * @returns {PIXI.ticker.Ticker} This instance of a ticker\n     */\n    addOnce(fn, context)\n    {\n        this._emitter.once(TICK, fn, context);\n\n        this._startIfPossible();\n\n        return this;\n    }\n\n    /**\n     * Calls {@link module:eventemitter3.EventEmitter#off} internally for 'tick' event.\n     * It checks if the emitter has listeners for 'tick' event.\n     * If it does, then it cancels the animation frame.\n     *\n     * @param {Function} [fn] - The listener function to be removed\n     * @param {Function} [context] - The listener context to be removed\n     * @returns {PIXI.ticker.Ticker} This instance of a ticker\n     */\n    remove(fn, context)\n    {\n        this._emitter.off(TICK, fn, context);\n\n        if (!this._emitter.listeners(TICK, true))\n        {\n            this._cancelIfNeeded();\n        }\n\n        return this;\n    }\n\n    /**\n     * Starts the ticker. If the ticker has listeners\n     * a new animation frame is requested at this point.\n     */\n    start()\n    {\n        if (!this.started)\n        {\n            this.started = true;\n            this._requestIfNeeded();\n        }\n    }\n\n    /**\n     * Stops the ticker. If the ticker has requested\n     * an animation frame it is canceled at this point.\n     */\n    stop()\n    {\n        if (this.started)\n        {\n            this.started = false;\n            this._cancelIfNeeded();\n        }\n    }\n\n    /**\n     * Triggers an update. An update entails setting the\n     * current {@link PIXI.ticker.Ticker#elapsedMS},\n     * the current {@link PIXI.ticker.Ticker#deltaTime},\n     * invoking all listeners with current deltaTime,\n     * and then finally setting {@link PIXI.ticker.Ticker#lastTime}\n     * with the value of currentTime that was provided.\n     * This method will be called automatically by animation\n     * frame callbacks if the ticker instance has been started\n     * and listeners are added.\n     *\n     * @param {number} [currentTime=performance.now()] - the current time of execution\n     */\n    update(currentTime = performance.now())\n    {\n        let elapsedMS;\n\n        // If the difference in time is zero or negative, we ignore most of the work done here.\n        // If there is no valid difference, then should be no reason to let anyone know about it.\n        // A zero delta, is exactly that, nothing should update.\n        //\n        // The difference in time can be negative, and no this does not mean time traveling.\n        // This can be the result of a race condition between when an animation frame is requested\n        // on the current JavaScript engine event loop, and when the ticker's start method is invoked\n        // (which invokes the internal _requestIfNeeded method). If a frame is requested before\n        // _requestIfNeeded is invoked, then the callback for the animation frame the ticker requests,\n        // can receive a time argument that can be less than the lastTime value that was set within\n        // _requestIfNeeded. This difference is in microseconds, but this is enough to cause problems.\n        //\n        // This check covers this browser engine timing issue, as well as if consumers pass an invalid\n        // currentTime value. This may happen if consumers opt-out of the autoStart, and update themselves.\n\n        if (currentTime > this.lastTime)\n        {\n            // Save uncapped elapsedMS for measurement\n            elapsedMS = this.elapsedMS = currentTime - this.lastTime;\n\n            // cap the milliseconds elapsed used for deltaTime\n            if (elapsedMS > this._maxElapsedMS)\n            {\n                elapsedMS = this._maxElapsedMS;\n            }\n\n            this.deltaTime = elapsedMS * settings.TARGET_FPMS * this.speed;\n\n            // Invoke listeners added to internal emitter\n            this._emitter.emit(TICK, this.deltaTime);\n        }\n        else\n        {\n            this.deltaTime = this.elapsedMS = 0;\n        }\n\n        this.lastTime = currentTime;\n    }\n\n    /**\n     * The frames per second at which this ticker is running.\n     * The default is approximately 60 in most modern browsers.\n     * **Note:** This does not factor in the value of\n     * {@link PIXI.ticker.Ticker#speed}, which is specific\n     * to scaling {@link PIXI.ticker.Ticker#deltaTime}.\n     *\n     * @memberof PIXI.ticker.Ticker#\n     * @readonly\n     */\n    get FPS()\n    {\n        return 1000 / this.elapsedMS;\n    }\n\n    /**\n     * Manages the maximum amount of milliseconds allowed to\n     * elapse between invoking {@link PIXI.ticker.Ticker#update}.\n     * This value is used to cap {@link PIXI.ticker.Ticker#deltaTime},\n     * but does not effect the measured value of {@link PIXI.ticker.Ticker#FPS}.\n     * When setting this property it is clamped to a value between\n     * `0` and `PIXI.settings.TARGET_FPMS * 1000`.\n     *\n     * @memberof PIXI.ticker.Ticker#\n     * @default 10\n     */\n    get minFPS()\n    {\n        return 1000 / this._maxElapsedMS;\n    }\n\n    /**\n     * Sets the min fps.\n     *\n     * @param {number} fps - value to set.\n     */\n    set minFPS(fps)\n    {\n        // Clamp: 0 to TARGET_FPMS\n        const minFPMS = Math.min(Math.max(0, fps) / 1000, settings.TARGET_FPMS);\n\n        this._maxElapsedMS = 1 / minFPMS;\n    }\n}\n","import Ticker from './Ticker';\n\n/**\n * The shared ticker instance used by {@link PIXI.extras.AnimatedSprite}.\n * and by {@link PIXI.interaction.InteractionManager}.\n * The property {@link PIXI.ticker.Ticker#autoStart} is set to `true`\n * for this instance. Please follow the examples for usage, including\n * how to opt-out of auto-starting the shared ticker.\n *\n * @example\n * let ticker = PIXI.ticker.shared;\n * // Set this to prevent starting this ticker when listeners are added.\n * // By default this is true only for the PIXI.ticker.shared instance.\n * ticker.autoStart = false;\n * // FYI, call this to ensure the ticker is stopped. It should be stopped\n * // if you have not attempted to render anything yet.\n * ticker.stop();\n * // Call this when you are ready for a running shared ticker.\n * ticker.start();\n *\n * @example\n * // You may use the shared ticker to render...\n * let renderer = PIXI.autoDetectRenderer(800, 600);\n * let stage = new PIXI.Container();\n * let interactionManager = PIXI.interaction.InteractionManager(renderer);\n * document.body.appendChild(renderer.view);\n * ticker.add(function (time) {\n *     renderer.render(stage);\n * });\n *\n * @example\n * // Or you can just update it manually.\n * ticker.autoStart = false;\n * ticker.stop();\n * function animate(time) {\n *     ticker.update(time);\n *     renderer.render(stage);\n *     requestAnimationFrame(animate);\n * }\n * animate(performance.now());\n *\n * @type {PIXI.ticker.Ticker}\n * @memberof PIXI.ticker\n */\nconst shared = new Ticker();\n\nshared.autoStart = true;\n\n/**\n * @namespace PIXI.ticker\n */\nexport { shared, Ticker };\n","export default function canUploadSameBuffer()\n{\n\t// Uploading the same buffer multiple times in a single frame can cause perf issues.\n\t// Apparent on IOS so only check for that at the moment\n\t// this check may become more complex if this issue pops up elsewhere.\n    const ios = !!navigator.platform && (/iPad|iPhone|iPod/).test(navigator.platform);\n\n    return !ios;\n}\n","/**\n * Generic Mask Stack data structure\n *\n * @memberof PIXI\n * @function createIndicesForQuads\n * @private\n * @param {number} size - Number of quads\n * @return {Uint16Array} indices\n */\nexport default function createIndicesForQuads(size)\n{\n    // the total number of indices in our array, there are 6 points per quad.\n\n    const totalIndices = size * 6;\n\n    const indices = new Uint16Array(totalIndices);\n\n    // fill the indices with the quads to draw\n    for (let i = 0, j = 0; i < totalIndices; i += 6, j += 4)\n    {\n        indices[i + 0] = j + 0;\n        indices[i + 1] = j + 1;\n        indices[i + 2] = j + 2;\n        indices[i + 3] = j + 0;\n        indices[i + 4] = j + 2;\n        indices[i + 5] = j + 3;\n    }\n\n    return indices;\n}\n","import _url from 'url';\n\nlet tempAnchor;\n\n/**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n * Nipped from the resource loader!\n *\n * @ignore\n * @param {string} url - The url to test.\n * @param {object} [loc=window.location] - The location object to test against.\n * @return {string} The crossOrigin value to use (or empty string for none).\n */\nexport default function determineCrossOrigin(url, loc = window.location)\n{\n    // data: and javascript: urls are considered same-origin\n    if (url.indexOf('data:') === 0)\n    {\n        return '';\n    }\n\n    // default is window.location\n    loc = loc || window.location;\n\n    if (!tempAnchor)\n    {\n        tempAnchor = document.createElement('a');\n    }\n\n    // let the browser determine the full href for the url of this resource and then\n    // parse with the node url lib, we can't use the properties of the anchor element\n    // because they don't work in IE9 :(\n    tempAnchor.href = url;\n    url = _url.parse(tempAnchor.href);\n\n    const samePort = (!url.port && loc.port === '') || (url.port === loc.port);\n\n    // if cross origin\n    if (url.hostname !== loc.hostname || !samePort || url.protocol !== loc.protocol)\n    {\n        return 'anonymous';\n    }\n\n    return '';\n}\n","import { DATA_URI, URL_FILE_EXTENSION, SVG_SIZE, VERSION } from '../const';\nimport settings from '../settings';\nimport EventEmitter from 'eventemitter3';\nimport pluginTarget from './pluginTarget';\nimport * as isMobile from 'ismobilejs';\n\nlet nextUid = 0;\nlet saidHello = false;\n\n/**\n * @namespace PIXI.utils\n */\nexport {\n    /**\n     * @see {@link https://github.com/kaimallea/isMobile}\n     *\n     * @memberof PIXI.utils\n     * @function isMobile\n     * @type {Object}\n     */\n    isMobile,\n    /**\n     * @see {@link https://github.com/primus/eventemitter3}\n     *\n     * @memberof PIXI.utils\n     * @class EventEmitter\n     * @type {EventEmitter}\n     */\n    EventEmitter,\n    /**\n     * @memberof PIXI.utils\n     * @function pluginTarget\n     * @type {mixin}\n     */\n    pluginTarget,\n};\n\n/**\n * Gets the next unique identifier\n *\n * @memberof PIXI.utils\n * @function uid\n * @return {number} The next unique identifier to use.\n */\nexport function uid()\n{\n    return ++nextUid;\n}\n\n/**\n * Converts a hex color number to an [R, G, B] array\n *\n * @memberof PIXI.utils\n * @function hex2rgb\n * @param {number} hex - The number to convert\n * @param  {number[]} [out=[]] If supplied, this array will be used rather than returning a new one\n * @return {number[]} An array representing the [R, G, B] of the color.\n */\nexport function hex2rgb(hex, out)\n{\n    out = out || [];\n\n    out[0] = ((hex >> 16) & 0xFF) / 255;\n    out[1] = ((hex >> 8) & 0xFF) / 255;\n    out[2] = (hex & 0xFF) / 255;\n\n    return out;\n}\n\n/**\n * Converts a hex color number to a string.\n *\n * @memberof PIXI.utils\n * @function hex2string\n * @param {number} hex - Number in hex\n * @return {string} The string color.\n */\nexport function hex2string(hex)\n{\n    hex = hex.toString(16);\n    hex = '000000'.substr(0, 6 - hex.length) + hex;\n\n    return `#${hex}`;\n}\n\n/**\n * Converts a color as an [R, G, B] array to a hex number\n *\n * @memberof PIXI.utils\n * @function rgb2hex\n * @param {number[]} rgb - rgb array\n * @return {number} The color number\n */\nexport function rgb2hex(rgb)\n{\n    return (((rgb[0] * 255) << 16) + ((rgb[1] * 255) << 8) + (rgb[2] * 255));\n}\n\n/**\n * get the resolution / device pixel ratio of an asset by looking for the prefix\n * used by spritesheets and image urls\n *\n * @memberof PIXI.utils\n * @function getResolutionOfUrl\n * @param {string} url - the image path\n * @param {number} [defaultValue=1] - the defaultValue if no filename prefix is set.\n * @return {number} resolution / device pixel ratio of an asset\n */\nexport function getResolutionOfUrl(url, defaultValue)\n{\n    const resolution = settings.RETINA_PREFIX.exec(url);\n\n    if (resolution)\n    {\n        return parseFloat(resolution[1]);\n    }\n\n    return defaultValue !== undefined ? defaultValue : 1;\n}\n\n/**\n * Typedef for decomposeDataUri return object.\n *\n * @typedef {object} DecomposedDataUri\n * @property {mediaType} Media type, eg. `image`\n * @property {subType} Sub type, eg. `png`\n * @property {encoding} Data encoding, eg. `base64`\n * @property {data} The actual data\n */\n\n/**\n * Split a data URI into components. Returns undefined if\n * parameter `dataUri` is not a valid data URI.\n *\n * @memberof PIXI.utils\n * @function decomposeDataUri\n * @param {string} dataUri - the data URI to check\n * @return {DecomposedDataUri|undefined} The decomposed data uri or undefined\n */\nexport function decomposeDataUri(dataUri)\n{\n    const dataUriMatch = DATA_URI.exec(dataUri);\n\n    if (dataUriMatch)\n    {\n        return {\n            mediaType: dataUriMatch[1] ? dataUriMatch[1].toLowerCase() : undefined,\n            subType: dataUriMatch[2] ? dataUriMatch[2].toLowerCase() : undefined,\n            encoding: dataUriMatch[3] ? dataUriMatch[3].toLowerCase() : undefined,\n            data: dataUriMatch[4],\n        };\n    }\n\n    return undefined;\n}\n\n/**\n * Get type of the image by regexp for extension. Returns undefined for unknown extensions.\n *\n * @memberof PIXI.utils\n * @function getUrlFileExtension\n * @param {string} url - the image path\n * @return {string|undefined} image extension\n */\nexport function getUrlFileExtension(url)\n{\n    const extension = URL_FILE_EXTENSION.exec(url);\n\n    if (extension)\n    {\n        return extension[1].toLowerCase();\n    }\n\n    return undefined;\n}\n\n/**\n * Typedef for Size object.\n *\n * @typedef {object} Size\n * @property {width} Width component\n * @property {height} Height component\n */\n\n/**\n * Get size from an svg string using regexp.\n *\n * @memberof PIXI.utils\n * @function getSvgSize\n * @param {string} svgString - a serialized svg element\n * @return {Size|undefined} image extension\n */\nexport function getSvgSize(svgString)\n{\n    const sizeMatch = SVG_SIZE.exec(svgString);\n    const size = {};\n\n    if (sizeMatch)\n    {\n        size[sizeMatch[1]] = Math.round(parseFloat(sizeMatch[3]));\n        size[sizeMatch[5]] = Math.round(parseFloat(sizeMatch[7]));\n    }\n\n    return size;\n}\n\n/**\n * Skips the hello message of renderers that are created after this is run.\n *\n * @function skipHello\n * @memberof PIXI.utils\n */\nexport function skipHello()\n{\n    saidHello = true;\n}\n\n/**\n * Logs out the version and renderer information for this running instance of PIXI.\n * If you don't want to see this message you can run `PIXI.utils.skipHello()` before\n * creating your renderer. Keep in mind that doing that will forever makes you a jerk face.\n *\n * @static\n * @function sayHello\n * @memberof PIXI.utils\n * @param {string} type - The string renderer type to log.\n */\nexport function sayHello(type)\n{\n    if (saidHello)\n    {\n        return;\n    }\n\n    if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1)\n    {\n        const args = [\n            `\\n %c %c %c Pixi.js ${VERSION} - ✰ ${type} ✰  %c  %c  http://www.pixijs.com/  %c %c ♥%c♥%c♥ \\n\\n`,\n            'background: #ff66a5; padding:5px 0;',\n            'background: #ff66a5; padding:5px 0;',\n            'color: #ff66a5; background: #030307; padding:5px 0;',\n            'background: #ff66a5; padding:5px 0;',\n            'background: #ffc3dc; padding:5px 0;',\n            'background: #ff66a5; padding:5px 0;',\n            'color: #ff2424; background: #fff; padding:5px 0;',\n            'color: #ff2424; background: #fff; padding:5px 0;',\n            'color: #ff2424; background: #fff; padding:5px 0;',\n        ];\n\n        window.console.log.apply(console, args);\n    }\n    else if (window.console)\n    {\n        window.console.log(`Pixi.js ${VERSION} - ${type} - http://www.pixijs.com/`);\n    }\n\n    saidHello = true;\n}\n\n/**\n * Helper for checking for webgl support\n *\n * @memberof PIXI.utils\n * @function isWebGLSupported\n * @return {boolean} is webgl supported\n */\nexport function isWebGLSupported()\n{\n    const contextOptions = { stencil: true, failIfMajorPerformanceCaveat: true };\n\n    try\n    {\n        if (!window.WebGLRenderingContext)\n        {\n            return false;\n        }\n\n        const canvas = document.createElement('canvas');\n        let gl = canvas.getContext('webgl', contextOptions) || canvas.getContext('experimental-webgl', contextOptions);\n\n        const success = !!(gl && gl.getContextAttributes().stencil);\n\n        if (gl)\n        {\n            const loseContext = gl.getExtension('WEBGL_lose_context');\n\n            if (loseContext)\n            {\n                loseContext.loseContext();\n            }\n        }\n\n        gl = null;\n\n        return success;\n    }\n    catch (e)\n    {\n        return false;\n    }\n}\n\n/**\n * Returns sign of number\n *\n * @memberof PIXI.utils\n * @function sign\n * @param {number} n - the number to check the sign of\n * @returns {number} 0 if `n` is 0, -1 if `n` is negative, 1 if `n` is positive\n */\nexport function sign(n)\n{\n    if (n === 0) return 0;\n\n    return n < 0 ? -1 : 1;\n}\n\n/**\n * Remove a range of items from an array\n *\n * @memberof PIXI.utils\n * @function removeItems\n * @param {Array<*>} arr The target array\n * @param {number} startIdx The index to begin removing from (inclusive)\n * @param {number} removeCount How many items to remove\n */\nexport function removeItems(arr, startIdx, removeCount)\n{\n    const length = arr.length;\n\n    if (startIdx >= length || removeCount === 0)\n    {\n        return;\n    }\n\n    removeCount = (startIdx + removeCount > length ? length - startIdx : removeCount);\n\n    const len = length - removeCount;\n\n    for (let i = startIdx; i < len; ++i)\n    {\n        arr[i] = arr[i + removeCount];\n    }\n\n    arr.length = len;\n}\n\n/**\n * @todo Describe property usage\n *\n * @memberof PIXI.utils\n * @private\n */\nexport const TextureCache = {};\n\n/**\n * @todo Describe property usage\n *\n * @memberof PIXI.utils\n * @private\n */\nexport const BaseTextureCache = {};\n","import Device from 'ismobilejs';\n\nexport default function maxRecommendedTextures(max)\n{\n    if (Device.tablet || Device.phone)\n    {\n        // check if the res is iphone 6 or higher..\n        return 4;\n    }\n\n    // desktop should be ok\n    return max;\n}\n","/**\n * Mixins functionality to make an object have \"plugins\".\n *\n * @example\n *      function MyObject() {}\n *\n *      pluginTarget.mixin(MyObject);\n *\n * @mixin\n * @memberof PIXI.utils\n * @param {object} obj - The object to mix into.\n */\nfunction pluginTarget(obj)\n{\n    obj.__plugins = {};\n\n    /**\n     * Adds a plugin to an object\n     *\n     * @param {string} pluginName - The events that should be listed.\n     * @param {Function} ctor - The constructor function for the plugin.\n     */\n    obj.registerPlugin = function registerPlugin(pluginName, ctor)\n    {\n        obj.__plugins[pluginName] = ctor;\n    };\n\n    /**\n     * Instantiates all the plugins of this object\n     *\n     */\n    obj.prototype.initPlugins = function initPlugins()\n    {\n        this.plugins = this.plugins || {};\n\n        for (const o in obj.__plugins)\n        {\n            this.plugins[o] = new (obj.__plugins[o])(this);\n        }\n    };\n\n    /**\n     * Removes all the plugins of this object\n     *\n     */\n    obj.prototype.destroyPlugins = function destroyPlugins()\n    {\n        for (const o in this.plugins)\n        {\n            this.plugins[o].destroy();\n            this.plugins[o] = null;\n        }\n\n        this.plugins = null;\n    };\n}\n\nexport default {\n    /**\n     * Mixes in the properties of the pluginTarget into another object\n     *\n     * @param {object} obj - The obj to mix into\n     */\n    mixin: function mixin(obj)\n    {\n        pluginTarget(obj);\n    },\n};\n","import * as core from './core';\nimport * as mesh from './mesh';\nimport * as particles from './particles';\nimport * as extras from './extras';\nimport * as filters from './filters';\nimport * as prepare from './prepare';\n\n// provide method to give a stack track for warnings\n// useful for tracking-down where deprecated methods/properties/classes\n// are being used within the code\nfunction warn(msg)\n{\n    // @if DEBUG\n    /* eslint-disable no-console */\n    let stack = new Error().stack;\n\n    // Handle IE < 10 and Safari < 6\n    if (typeof stack === 'undefined')\n    {\n        console.warn('Deprecation Warning: ', msg);\n    }\n    else\n    {\n        // chop off the stack trace which includes pixi.js internal calls\n        stack = stack.split('\\n').splice(3).join('\\n');\n\n        if (console.groupCollapsed)\n        {\n            console.groupCollapsed(\n                '%cDeprecation Warning: %c%s',\n                'color:#614108;background:#fffbe6',\n                'font-weight:normal;color:#614108;background:#fffbe6',\n                msg\n            );\n            console.warn(stack);\n            console.groupEnd();\n        }\n        else\n        {\n            console.warn('Deprecation Warning: ', msg);\n            console.warn(stack);\n        }\n    }\n    /* eslint-enable no-console */\n    // @endif\n}\n\n/**\n * @class\n * @private\n * @name SpriteBatch\n * @memberof PIXI\n * @see PIXI.ParticleContainer\n * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead.\n * @deprecated since version 3.0.0\n */\ncore.SpriteBatch = () =>\n{\n    throw new ReferenceError('SpriteBatch does not exist any more, please use the new ParticleContainer instead.');\n};\n\n/**\n * @class\n * @private\n * @name AssetLoader\n * @memberof PIXI\n * @see PIXI.loaders.Loader\n * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.\n * @deprecated since version 3.0.0\n */\ncore.AssetLoader = () =>\n{\n    throw new ReferenceError('The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.');\n};\n\nObject.defineProperties(core, {\n\n    /**\n     * @class\n     * @private\n     * @name Stage\n     * @memberof PIXI\n     * @see PIXI.Container\n     * @deprecated since version 3.0.0\n     */\n    Stage: {\n        enumerable: true,\n        get()\n        {\n            warn('You do not need to use a PIXI Stage any more, you can simply render any container.');\n\n            return core.Container;\n        },\n    },\n\n    /**\n     * @class\n     * @private\n     * @name DisplayObjectContainer\n     * @memberof PIXI\n     * @see PIXI.Container\n     * @deprecated since version 3.0.0\n     */\n    DisplayObjectContainer: {\n        enumerable: true,\n        get()\n        {\n            warn('DisplayObjectContainer has been shortened to Container, please use Container from now on.');\n\n            return core.Container;\n        },\n    },\n\n    /**\n     * @class\n     * @private\n     * @name Strip\n     * @memberof PIXI\n     * @see PIXI.mesh.Mesh\n     * @deprecated since version 3.0.0\n     */\n    Strip: {\n        enumerable: true,\n        get()\n        {\n            warn('The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on.');\n\n            return mesh.Mesh;\n        },\n    },\n\n    /**\n     * @class\n     * @private\n     * @name Rope\n     * @memberof PIXI\n     * @see PIXI.mesh.Rope\n     * @deprecated since version 3.0.0\n     */\n    Rope: {\n        enumerable: true,\n        get()\n        {\n            warn('The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on.');\n\n            return mesh.Rope;\n        },\n    },\n\n    /**\n     * @class\n     * @private\n     * @name ParticleContainer\n     * @memberof PIXI\n     * @see PIXI.particles.ParticleContainer\n     * @deprecated since version 4.0.0\n     */\n    ParticleContainer: {\n        enumerable: true,\n        get()\n        {\n            warn('The ParticleContainer class has been moved to particles.ParticleContainer, '\n                + 'please use particles.ParticleContainer from now on.');\n\n            return particles.ParticleContainer;\n        },\n    },\n\n    /**\n     * @class\n     * @private\n     * @name MovieClip\n     * @memberof PIXI\n     * @see PIXI.extras.MovieClip\n     * @deprecated since version 3.0.0\n     */\n    MovieClip: {\n        enumerable: true,\n        get()\n        {\n            warn('The MovieClip class has been moved to extras.AnimatedSprite, please use extras.AnimatedSprite.');\n\n            return extras.AnimatedSprite;\n        },\n    },\n\n    /**\n     * @class\n     * @private\n     * @name TilingSprite\n     * @memberof PIXI\n     * @see PIXI.extras.TilingSprite\n     * @deprecated since version 3.0.0\n     */\n    TilingSprite: {\n        enumerable: true,\n        get()\n        {\n            warn('The TilingSprite class has been moved to extras.TilingSprite, '\n                + 'please use extras.TilingSprite from now on.');\n\n            return extras.TilingSprite;\n        },\n    },\n\n    /**\n     * @class\n     * @private\n     * @name BitmapText\n     * @memberof PIXI\n     * @see PIXI.extras.BitmapText\n     * @deprecated since version 3.0.0\n     */\n    BitmapText: {\n        enumerable: true,\n        get()\n        {\n            warn('The BitmapText class has been moved to extras.BitmapText, '\n                + 'please use extras.BitmapText from now on.');\n\n            return extras.BitmapText;\n        },\n    },\n\n    /**\n     * @class\n     * @private\n     * @name blendModes\n     * @memberof PIXI\n     * @see PIXI.BLEND_MODES\n     * @deprecated since version 3.0.0\n     */\n    blendModes: {\n        enumerable: true,\n        get()\n        {\n            warn('The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on.');\n\n            return core.BLEND_MODES;\n        },\n    },\n\n    /**\n     * @class\n     * @private\n     * @name scaleModes\n     * @memberof PIXI\n     * @see PIXI.SCALE_MODES\n     * @deprecated since version 3.0.0\n     */\n    scaleModes: {\n        enumerable: true,\n        get()\n        {\n            warn('The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on.');\n\n            return core.SCALE_MODES;\n        },\n    },\n\n    /**\n     * @class\n     * @private\n     * @name BaseTextureCache\n     * @memberof PIXI\n     * @see PIXI.utils.BaseTextureCache\n     * @deprecated since version 3.0.0\n     */\n    BaseTextureCache: {\n        enumerable: true,\n        get()\n        {\n            warn('The BaseTextureCache class has been moved to utils.BaseTextureCache, '\n                + 'please use utils.BaseTextureCache from now on.');\n\n            return core.utils.BaseTextureCache;\n        },\n    },\n\n    /**\n     * @class\n     * @private\n     * @name TextureCache\n     * @memberof PIXI\n     * @see PIXI.utils.TextureCache\n     * @deprecated since version 3.0.0\n     */\n    TextureCache: {\n        enumerable: true,\n        get()\n        {\n            warn('The TextureCache class has been moved to utils.TextureCache, '\n                + 'please use utils.TextureCache from now on.');\n\n            return core.utils.TextureCache;\n        },\n    },\n\n    /**\n     * @namespace\n     * @private\n     * @name math\n     * @memberof PIXI\n     * @see PIXI\n     * @deprecated since version 3.0.6\n     */\n    math: {\n        enumerable: true,\n        get()\n        {\n            warn('The math namespace is deprecated, please access members already accessible on PIXI.');\n\n            return core;\n        },\n    },\n\n    /**\n     * @class\n     * @private\n     * @name PIXI.AbstractFilter\n     * @see PIXI.Filter\n     * @deprecated since version 3.0.6\n     */\n    AbstractFilter: {\n        enumerable: true,\n        get()\n        {\n            warn('AstractFilter has been renamed to Filter, please use PIXI.Filter');\n\n            return core.Filter;\n        },\n    },\n\n    /**\n     * @class\n     * @private\n     * @name PIXI.TransformManual\n     * @see PIXI.TransformBase\n     * @deprecated since version 4.0.0\n     */\n    TransformManual: {\n        enumerable: true,\n        get()\n        {\n            warn('TransformManual has been renamed to TransformBase, please update your pixi-spine');\n\n            return core.TransformBase;\n        },\n    },\n\n    /**\n     * @static\n     * @constant\n     * @name PIXI.TARGET_FPMS\n     * @see PIXI.settings.TARGET_FPMS\n     * @deprecated since version 4.2.0\n     */\n    TARGET_FPMS: {\n        enumerable: true,\n        get()\n        {\n            warn('PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS');\n\n            return core.settings.TARGET_FPMS;\n        },\n        set(value)\n        {\n            warn('PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS');\n\n            core.settings.TARGET_FPMS = value;\n        },\n    },\n\n    /**\n     * @static\n     * @constant\n     * @name PIXI.FILTER_RESOLUTION\n     * @see PIXI.settings.FILTER_RESOLUTION\n     * @deprecated since version 4.2.0\n     */\n    FILTER_RESOLUTION: {\n        enumerable: true,\n        get()\n        {\n            warn('PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION');\n\n            return core.settings.FILTER_RESOLUTION;\n        },\n        set(value)\n        {\n            warn('PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION');\n\n            core.settings.FILTER_RESOLUTION = value;\n        },\n    },\n\n    /**\n     * @static\n     * @constant\n     * @name PIXI.RESOLUTION\n     * @see PIXI.settings.RESOLUTION\n     * @deprecated since version 4.2.0\n     */\n    RESOLUTION: {\n        enumerable: true,\n        get()\n        {\n            warn('PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION');\n\n            return core.settings.RESOLUTION;\n        },\n        set(value)\n        {\n            warn('PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION');\n\n            core.settings.RESOLUTION = value;\n        },\n    },\n\n    /**\n     * @static\n     * @constant\n     * @name PIXI.MIPMAP_TEXTURES\n     * @see PIXI.settings.MIPMAP_TEXTURES\n     * @deprecated since version 4.2.0\n     */\n    MIPMAP_TEXTURES: {\n        enumerable: true,\n        get()\n        {\n            warn('PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES');\n\n            return core.settings.MIPMAP_TEXTURES;\n        },\n        set(value)\n        {\n            warn('PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES');\n\n            core.settings.MIPMAP_TEXTURES = value;\n        },\n    },\n\n    /**\n     * @static\n     * @constant\n     * @name PIXI.SPRITE_BATCH_SIZE\n     * @see PIXI.settings.SPRITE_BATCH_SIZE\n     * @deprecated since version 4.2.0\n     */\n    SPRITE_BATCH_SIZE: {\n        enumerable: true,\n        get()\n        {\n            warn('PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE');\n\n            return core.settings.SPRITE_BATCH_SIZE;\n        },\n        set(value)\n        {\n            warn('PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE');\n\n            core.settings.SPRITE_BATCH_SIZE = value;\n        },\n    },\n\n    /**\n     * @static\n     * @constant\n     * @name PIXI.SPRITE_MAX_TEXTURES\n     * @see PIXI.settings.SPRITE_MAX_TEXTURES\n     * @deprecated since version 4.2.0\n     */\n    SPRITE_MAX_TEXTURES: {\n        enumerable: true,\n        get()\n        {\n            warn('PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES');\n\n            return core.settings.SPRITE_MAX_TEXTURES;\n        },\n        set(value)\n        {\n            warn('PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES');\n\n            core.settings.SPRITE_MAX_TEXTURES = value;\n        },\n    },\n\n    /**\n     * @static\n     * @constant\n     * @name PIXI.RETINA_PREFIX\n     * @see PIXI.settings.RETINA_PREFIX\n     * @deprecated since version 4.2.0\n     */\n    RETINA_PREFIX: {\n        enumerable: true,\n        get()\n        {\n            warn('PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX');\n\n            return core.settings.RETINA_PREFIX;\n        },\n        set(value)\n        {\n            warn('PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX');\n\n            core.settings.RETINA_PREFIX = value;\n        },\n    },\n\n    /**\n     * @static\n     * @constant\n     * @name PIXI.DEFAULT_RENDER_OPTIONS\n     * @see PIXI.settings.RENDER_OPTIONS\n     * @deprecated since version 4.2.0\n     */\n    DEFAULT_RENDER_OPTIONS: {\n        enumerable: true,\n        get()\n        {\n            warn('PIXI.DEFAULT_RENDER_OPTIONS has been deprecated, please use PIXI.settings.DEFAULT_RENDER_OPTIONS');\n\n            return core.settings.RENDER_OPTIONS;\n        },\n    },\n});\n\n// Move the default properties to settings\nconst defaults = [\n    { parent: 'TRANSFORM_MODE', target: 'TRANSFORM_MODE' },\n    { parent: 'GC_MODES', target: 'GC_MODE' },\n    { parent: 'WRAP_MODES', target: 'WRAP_MODE' },\n    { parent: 'SCALE_MODES', target: 'SCALE_MODE' },\n    { parent: 'PRECISION', target: 'PRECISION' },\n];\n\nfor (let i = 0; i < defaults.length; i++)\n{\n    const deprecation = defaults[i];\n\n    Object.defineProperty(core[deprecation.parent], 'DEFAULT', {\n        enumerable: true,\n        get()\n        {\n            warn(`PIXI.${deprecation.parent}.DEFAULT has been deprecated, please use PIXI.settings.${deprecation.target}`);\n\n            return core.settings[deprecation.target];\n        },\n        set(value)\n        {\n            warn(`PIXI.${deprecation.parent}.DEFAULT has been deprecated, please use PIXI.settings.${deprecation.target}`);\n\n            core.settings[deprecation.target] = value;\n        },\n    });\n}\n\nObject.defineProperties(extras, {\n\n    /**\n     * @class\n     * @name MovieClip\n     * @memberof PIXI.extras\n     * @see PIXI.extras.AnimatedSprite\n     * @deprecated since version 4.2.0\n     */\n    MovieClip: {\n        enumerable: true,\n        get()\n        {\n            warn('The MovieClip class has been renamed to AnimatedSprite, please use AnimatedSprite from now on.');\n\n            return extras.AnimatedSprite;\n        },\n    },\n});\n\ncore.DisplayObject.prototype.generateTexture = function generateTexture(renderer, scaleMode, resolution)\n{\n    warn('generateTexture has moved to the renderer, please use renderer.generateTexture(displayObject)');\n\n    return renderer.generateTexture(this, scaleMode, resolution);\n};\n\ncore.Graphics.prototype.generateTexture = function generateTexture(scaleMode, resolution)\n{\n    warn('graphics generate texture has moved to the renderer. '\n        + 'Or to render a graphics to a texture using canvas please use generateCanvasTexture');\n\n    return this.generateCanvasTexture(scaleMode, resolution);\n};\n\ncore.RenderTexture.prototype.render = function render(displayObject, matrix, clear, updateTransform)\n{\n    this.legacyRenderer.render(displayObject, this, clear, matrix, !updateTransform);\n    warn('RenderTexture.render is now deprecated, please use renderer.render(displayObject, renderTexture)');\n};\n\ncore.RenderTexture.prototype.getImage = function getImage(target)\n{\n    warn('RenderTexture.getImage is now deprecated, please use renderer.extract.image(target)');\n\n    return this.legacyRenderer.extract.image(target);\n};\n\ncore.RenderTexture.prototype.getBase64 = function getBase64(target)\n{\n    warn('RenderTexture.getBase64 is now deprecated, please use renderer.extract.base64(target)');\n\n    return this.legacyRenderer.extract.base64(target);\n};\n\ncore.RenderTexture.prototype.getCanvas = function getCanvas(target)\n{\n    warn('RenderTexture.getCanvas is now deprecated, please use renderer.extract.canvas(target)');\n\n    return this.legacyRenderer.extract.canvas(target);\n};\n\ncore.RenderTexture.prototype.getPixels = function getPixels(target)\n{\n    warn('RenderTexture.getPixels is now deprecated, please use renderer.extract.pixels(target)');\n\n    return this.legacyRenderer.pixels(target);\n};\n\n/**\n * @method\n * @private\n * @name PIXI.Sprite#setTexture\n * @see PIXI.Sprite#texture\n * @deprecated since version 3.0.0\n * @param {PIXI.Texture} texture - The texture to set to.\n */\ncore.Sprite.prototype.setTexture = function setTexture(texture)\n{\n    this.texture = texture;\n    warn('setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;');\n};\n\n/**\n * @method\n * @name PIXI.extras.BitmapText#setText\n * @see PIXI.extras.BitmapText#text\n * @deprecated since version 3.0.0\n * @param {string} text - The text to set to.\n */\nextras.BitmapText.prototype.setText = function setText(text)\n{\n    this.text = text;\n    warn(`setText is now deprecated, please use the text property, e.g : myBitmapText.text = 'my text';`);\n};\n\n/**\n * @method\n * @name PIXI.Text#setText\n * @see PIXI.Text#text\n * @deprecated since version 3.0.0\n * @param {string} text - The text to set to.\n */\ncore.Text.prototype.setText = function setText(text)\n{\n    this.text = text;\n    warn(`setText is now deprecated, please use the text property, e.g : myText.text = 'my text';`);\n};\n\n/**\n * @method\n * @name PIXI.Text#setStyle\n * @see PIXI.Text#style\n * @deprecated since version 3.0.0\n * @param {*} style - The style to set to.\n */\ncore.Text.prototype.setStyle = function setStyle(style)\n{\n    this.style = style;\n    warn('setStyle is now deprecated, please use the style property, e.g : myText.style = style;');\n};\n\n/**\n * @method\n * @name PIXI.Text#determineFontProperties\n * @see PIXI.Text#calculateFontProperties\n * @deprecated since version 4.2.0\n * @private\n * @param {string} fontStyle - String representing the style of the font\n * @return {Object} Font properties object\n */\ncore.Text.prototype.determineFontProperties = function determineFontProperties(fontStyle)\n{\n    warn('determineFontProperties is now deprecated, please use the static calculateFontProperties method, '\n        + 'e.g : Text.calculateFontProperties(fontStyle);');\n\n    return Text.calculateFontProperties(fontStyle);\n};\n\nObject.defineProperties(core.TextStyle.prototype, {\n    /**\n     * Set all properties of a font as a single string\n     *\n     * @name PIXI.TextStyle#font\n     * @deprecated since version 4.0.0\n     */\n    font: {\n        get()\n        {\n            warn(`text style property 'font' is now deprecated, please use the `\n                + `'fontFamily', 'fontSize', 'fontStyle', 'fontVariant' and 'fontWeight' properties from now on`);\n\n            const fontSizeString = (typeof this._fontSize === 'number') ? `${this._fontSize}px` : this._fontSize;\n\n            return `${this._fontStyle} ${this._fontVariant} ${this._fontWeight} ${fontSizeString} ${this._fontFamily}`;\n        },\n        set(font)\n        {\n            warn(`text style property 'font' is now deprecated, please use the `\n                + `'fontFamily','fontSize',fontStyle','fontVariant' and 'fontWeight' properties from now on`);\n\n            // can work out fontStyle from search of whole string\n            if (font.indexOf('italic') > 1)\n            {\n                this._fontStyle = 'italic';\n            }\n            else if (font.indexOf('oblique') > -1)\n            {\n                this._fontStyle = 'oblique';\n            }\n            else\n            {\n                this._fontStyle = 'normal';\n            }\n\n            // can work out fontVariant from search of whole string\n            if (font.indexOf('small-caps') > -1)\n            {\n                this._fontVariant = 'small-caps';\n            }\n            else\n            {\n                this._fontVariant = 'normal';\n            }\n\n            // fontWeight and fontFamily are tricker to find, but it's easier to find the fontSize due to it's units\n            const splits = font.split(' ');\n            let fontSizeIndex = -1;\n\n            this._fontSize = 26;\n            for (let i = 0; i < splits.length; ++i)\n            {\n                if (splits[i].match(/(px|pt|em|%)/))\n                {\n                    fontSizeIndex = i;\n                    this._fontSize = splits[i];\n                    break;\n                }\n            }\n\n            // we can now search for fontWeight as we know it must occur before the fontSize\n            this._fontWeight = 'normal';\n            for (let i = 0; i < fontSizeIndex; ++i)\n            {\n                if (splits[i].match(/(bold|bolder|lighter|100|200|300|400|500|600|700|800|900)/))\n                {\n                    this._fontWeight = splits[i];\n                    break;\n                }\n            }\n\n            // and finally join everything together after the fontSize in case the font family has multiple words\n            if (fontSizeIndex > -1 && fontSizeIndex < splits.length - 1)\n            {\n                this._fontFamily = '';\n                for (let i = fontSizeIndex + 1; i < splits.length; ++i)\n                {\n                    this._fontFamily += `${splits[i]} `;\n                }\n\n                this._fontFamily = this._fontFamily.slice(0, -1);\n            }\n            else\n            {\n                this._fontFamily = 'Arial';\n            }\n\n            this.styleID++;\n        },\n    },\n});\n\n/**\n * @method\n * @name PIXI.Texture#setFrame\n * @see PIXI.Texture#setFrame\n * @deprecated since version 3.0.0\n * @param {PIXI.Rectangle} frame - The frame to set.\n */\ncore.Texture.prototype.setFrame = function setFrame(frame)\n{\n    this.frame = frame;\n    warn('setFrame is now deprecated, please use the frame property, e.g: myTexture.frame = frame;');\n};\n\nObject.defineProperties(filters, {\n\n    /**\n     * @class\n     * @private\n     * @name PIXI.filters.AbstractFilter\n     * @see PIXI.AbstractFilter\n     * @deprecated since version 3.0.6\n     */\n    AbstractFilter: {\n        get()\n        {\n            warn('AstractFilter has been renamed to Filter, please use PIXI.Filter');\n\n            return core.AbstractFilter;\n        },\n    },\n\n    /**\n     * @class\n     * @private\n     * @name PIXI.filters.SpriteMaskFilter\n     * @see PIXI.SpriteMaskFilter\n     * @deprecated since version 3.0.6\n     */\n    SpriteMaskFilter: {\n        get()\n        {\n            warn('filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on.');\n\n            return core.SpriteMaskFilter;\n        },\n    },\n});\n\n/**\n * @method\n * @name PIXI.utils.uuid\n * @see PIXI.utils.uid\n * @deprecated since version 3.0.6\n * @return {number} The uid\n */\ncore.utils.uuid = () =>\n{\n    warn('utils.uuid() is deprecated, please use utils.uid() from now on.');\n\n    return core.utils.uid();\n};\n\n/**\n * @method\n * @name PIXI.utils.canUseNewCanvasBlendModes\n * @see PIXI.CanvasTinter\n * @deprecated\n * @return {boolean} Can use blend modes.\n */\ncore.utils.canUseNewCanvasBlendModes = () =>\n{\n    warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on');\n\n    return core.CanvasTinter.canUseMultiply;\n};\n\nlet saidHello = true;\n\n/**\n * @name PIXI.utils._saidHello\n * @type {boolean}\n * @see PIXI.utils.skipHello\n * @deprecated since 4.1.0\n */\nObject.defineProperty(core.utils, '_saidHello', {\n    set(bool)\n    {\n        if (bool)\n        {\n            warn('PIXI.utils._saidHello is deprecated, please use PIXI.utils.skipHello()');\n            this.skipHello();\n        }\n        saidHello = bool;\n    },\n    get()\n    {\n        return saidHello;\n    },\n});\n\n/**\n * The number of graphics or textures to upload to the GPU.\n *\n * @name PIXI.prepare.canvas.UPLOADS_PER_FRAME\n * @static\n * @type {number}\n * @see PIXI.prepare.BasePrepare.limiter\n * @deprecated since 4.2.0\n */\nObject.defineProperty(prepare.canvas, 'UPLOADS_PER_FRAME', {\n    set()\n    {\n        warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please set '\n            + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer');\n        // because we don't have a reference to the renderer, we can't actually set\n        // the uploads per frame, so we'll have to stick with the warning.\n    },\n    get()\n    {\n        warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please use '\n            + 'renderer.plugins.prepare.limiter');\n\n        return NaN;\n    },\n});\n\n/**\n * The number of graphics or textures to upload to the GPU.\n *\n * @name PIXI.prepare.webgl.UPLOADS_PER_FRAME\n * @static\n * @type {number}\n * @see PIXI.prepare.BasePrepare.limiter\n * @deprecated since 4.2.0\n */\nObject.defineProperty(prepare.webgl, 'UPLOADS_PER_FRAME', {\n    set()\n    {\n        warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please set '\n            + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer');\n        // because we don't have a reference to the renderer, we can't actually set\n        // the uploads per frame, so we'll have to stick with the warning.\n    },\n    get()\n    {\n        warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please use '\n            + 'renderer.plugins.prepare.limiter');\n\n        return NaN;\n    },\n});\n","import * as core from '../../core';\n\nconst TEMP_RECT = new core.Rectangle();\n\n/**\n * The extract manager provides functionality to export content from the renderers.\n *\n * @class\n * @memberof PIXI\n */\nexport default class CanvasExtract\n{\n    /**\n     * @param {PIXI.CanvasRenderer} renderer - A reference to the current renderer\n     */\n    constructor(renderer)\n    {\n        this.renderer = renderer;\n        /**\n         * Collection of methods for extracting data (image, pixels, etc.) from a display object or render texture\n         *\n         * @member {PIXI.CanvasExtract} extract\n         * @memberof PIXI.CanvasRenderer#\n         * @see PIXI.CanvasExtract\n         */\n        renderer.extract = this;\n    }\n\n    /**\n     * Will return a HTML Image of the target\n     *\n     * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n     *  to convert. If left empty will use use the main renderer\n     * @return {HTMLImageElement} HTML Image of the target\n     */\n    image(target)\n    {\n        const image = new Image();\n\n        image.src = this.base64(target);\n\n        return image;\n    }\n\n    /**\n     * Will return a a base64 encoded string of this target. It works by calling\n     *  `CanvasExtract.getCanvas` and then running toDataURL on that.\n     *\n     * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n     *  to convert. If left empty will use use the main renderer\n     * @return {string} A base64 encoded string of the texture.\n     */\n    base64(target)\n    {\n        return this.canvas(target).toDataURL();\n    }\n\n    /**\n     * Creates a Canvas element, renders this target to it and then returns it.\n     *\n     * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n     *  to convert. If left empty will use use the main renderer\n     * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.\n     */\n    canvas(target)\n    {\n        const renderer = this.renderer;\n        let context;\n        let resolution;\n        let frame;\n        let renderTexture;\n\n        if (target)\n        {\n            if (target instanceof core.RenderTexture)\n            {\n                renderTexture = target;\n            }\n            else\n            {\n                renderTexture = renderer.generateTexture(target);\n            }\n        }\n\n        if (renderTexture)\n        {\n            context = renderTexture.baseTexture._canvasRenderTarget.context;\n            resolution = renderTexture.baseTexture._canvasRenderTarget.resolution;\n            frame = renderTexture.frame;\n        }\n        else\n        {\n            context = renderer.rootContext;\n\n            frame = TEMP_RECT;\n            frame.width = this.renderer.width;\n            frame.height = this.renderer.height;\n        }\n\n        const width = frame.width * resolution;\n        const height = frame.height * resolution;\n\n        const canvasBuffer = new core.CanvasRenderTarget(width, height);\n        const canvasData = context.getImageData(frame.x * resolution, frame.y * resolution, width, height);\n\n        canvasBuffer.context.putImageData(canvasData, 0, 0);\n\n        // send the canvas back..\n        return canvasBuffer.canvas;\n    }\n\n    /**\n     * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA\n     * order, with integer values between 0 and 255 (included).\n     *\n     * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n     *  to convert. If left empty will use use the main renderer\n     * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture\n     */\n    pixels(target)\n    {\n        const renderer = this.renderer;\n        let context;\n        let resolution;\n        let frame;\n        let renderTexture;\n\n        if (target)\n        {\n            if (target instanceof core.RenderTexture)\n            {\n                renderTexture = target;\n            }\n            else\n            {\n                renderTexture = renderer.generateTexture(target);\n            }\n        }\n\n        if (renderTexture)\n        {\n            context = renderTexture.baseTexture._canvasRenderTarget.context;\n            resolution = renderTexture.baseTexture._canvasRenderTarget.resolution;\n            frame = renderTexture.frame;\n        }\n        else\n        {\n            context = renderer.rootContext;\n\n            frame = TEMP_RECT;\n            frame.width = renderer.width;\n            frame.height = renderer.height;\n        }\n\n        return context.getImageData(0, 0, frame.width * resolution, frame.height * resolution).data;\n    }\n\n    /**\n     * Destroys the extract\n     *\n     */\n    destroy()\n    {\n        this.renderer.extract = null;\n        this.renderer = null;\n    }\n}\n\ncore.CanvasRenderer.registerPlugin('extract', CanvasExtract);\n","export { default as webgl } from './webgl/WebGLExtract';\nexport { default as canvas } from './canvas/CanvasExtract';\n","import * as core from '../../core';\n\nconst TEMP_RECT = new core.Rectangle();\nconst BYTES_PER_PIXEL = 4;\n\n/**\n * The extract manager provides functionality to export content from the renderers.\n *\n * @class\n * @memberof PIXI\n */\nexport default class WebGLExtract\n{\n    /**\n     * @param {PIXI.WebGLRenderer} renderer - A reference to the current renderer\n     */\n    constructor(renderer)\n    {\n        this.renderer = renderer;\n        /**\n         * Collection of methods for extracting data (image, pixels, etc.) from a display object or render texture\n         *\n         * @member {PIXI.WebGLExtract} extract\n         * @memberof PIXI.WebGLRenderer#\n         * @see PIXI.WebGLExtract\n         */\n        renderer.extract = this;\n    }\n\n    /**\n     * Will return a HTML Image of the target\n     *\n     * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n     *  to convert. If left empty will use use the main renderer\n     * @return {HTMLImageElement} HTML Image of the target\n     */\n    image(target)\n    {\n        const image = new Image();\n\n        image.src = this.base64(target);\n\n        return image;\n    }\n\n    /**\n     * Will return a a base64 encoded string of this target. It works by calling\n     *  `WebGLExtract.getCanvas` and then running toDataURL on that.\n     *\n     * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n     *  to convert. If left empty will use use the main renderer\n     * @return {string} A base64 encoded string of the texture.\n     */\n    base64(target)\n    {\n        return this.canvas(target).toDataURL();\n    }\n\n    /**\n     * Creates a Canvas element, renders this target to it and then returns it.\n     *\n     * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n     *  to convert. If left empty will use use the main renderer\n     * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.\n     */\n    canvas(target)\n    {\n        const renderer = this.renderer;\n        let textureBuffer;\n        let resolution;\n        let frame;\n        let flipY = false;\n        let renderTexture;\n\n        if (target)\n        {\n            if (target instanceof core.RenderTexture)\n            {\n                renderTexture = target;\n            }\n            else\n            {\n                renderTexture = this.renderer.generateTexture(target);\n            }\n        }\n\n        if (renderTexture)\n        {\n            textureBuffer = renderTexture.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID];\n            resolution = textureBuffer.resolution;\n            frame = renderTexture.frame;\n            flipY = false;\n        }\n        else\n        {\n            textureBuffer = this.renderer.rootRenderTarget;\n            resolution = textureBuffer.resolution;\n            flipY = true;\n\n            frame = TEMP_RECT;\n            frame.width = textureBuffer.size.width;\n            frame.height = textureBuffer.size.height;\n        }\n\n        const width = frame.width * resolution;\n        const height = frame.height * resolution;\n\n        const canvasBuffer = new core.CanvasRenderTarget(width, height);\n\n        if (textureBuffer)\n        {\n            // bind the buffer\n            renderer.bindRenderTarget(textureBuffer);\n\n            // set up an array of pixels\n            const webglPixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\n\n            // read pixels to the array\n            const gl = renderer.gl;\n\n            gl.readPixels(\n                frame.x * resolution,\n                frame.y * resolution,\n                width,\n                height,\n                gl.RGBA,\n                gl.UNSIGNED_BYTE,\n                webglPixels\n            );\n\n            // add the pixels to the canvas\n            const canvasData = canvasBuffer.context.getImageData(0, 0, width, height);\n\n            canvasData.data.set(webglPixels);\n\n            canvasBuffer.context.putImageData(canvasData, 0, 0);\n\n            // pulling pixels\n            if (flipY)\n            {\n                canvasBuffer.context.scale(1, -1);\n                canvasBuffer.context.drawImage(canvasBuffer.canvas, 0, -height);\n            }\n        }\n\n         // send the canvas back..\n        return canvasBuffer.canvas;\n    }\n\n    /**\n     * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA\n     * order, with integer values between 0 and 255 (included).\n     *\n     * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n     *  to convert. If left empty will use use the main renderer\n     * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture\n     */\n    pixels(target)\n    {\n        const renderer = this.renderer;\n        let textureBuffer;\n        let resolution;\n        let frame;\n        let renderTexture;\n\n        if (target)\n        {\n            if (target instanceof core.RenderTexture)\n            {\n                renderTexture = target;\n            }\n            else\n            {\n                renderTexture = this.renderer.generateTexture(target);\n            }\n        }\n\n        if (renderTexture)\n        {\n            textureBuffer = renderTexture.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID];\n            resolution = textureBuffer.resolution;\n            frame = renderTexture.frame;\n        }\n        else\n        {\n            textureBuffer = this.renderer.rootRenderTarget;\n            resolution = textureBuffer.resolution;\n\n            frame = TEMP_RECT;\n            frame.width = textureBuffer.size.width;\n            frame.height = textureBuffer.size.height;\n        }\n\n        const width = frame.width * resolution;\n        const height = frame.height * resolution;\n\n        const webglPixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\n\n        if (textureBuffer)\n        {\n            // bind the buffer\n            renderer.bindRenderTarget(textureBuffer);\n            // read pixels to the array\n            const gl = renderer.gl;\n\n            gl.readPixels(\n                frame.x * resolution,\n                frame.y * resolution,\n                width,\n                height,\n                gl.RGBA,\n                gl.UNSIGNED_BYTE,\n                webglPixels\n            );\n        }\n\n        return webglPixels;\n    }\n\n    /**\n     * Destroys the extract\n     *\n     */\n    destroy()\n    {\n        this.renderer.extract = null;\n        this.renderer = null;\n    }\n}\n\ncore.WebGLRenderer.registerPlugin('extract', WebGLExtract);\n","import * as core from '../core';\n\n/**\n * @typedef FrameObject\n * @type {object}\n * @property {PIXI.Texture} texture - The {@link PIXI.Texture} of the frame\n * @property {number} time - the duration of the frame in ms\n */\n\n/**\n * An AnimatedSprite is a simple way to display an animation depicted by a list of textures.\n *\n * ```js\n * let alienImages = [\"image_sequence_01.png\",\"image_sequence_02.png\",\"image_sequence_03.png\",\"image_sequence_04.png\"];\n * let textureArray = [];\n *\n * for (let i=0; i < 4; i++)\n * {\n *      let texture = PIXI.Texture.fromImage(alienImages[i]);\n *      textureArray.push(texture);\n * };\n *\n * let mc = new PIXI.AnimatedSprite(textureArray);\n * ```\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI.extras\n */\nexport default class AnimatedSprite extends core.Sprite\n{\n    /**\n     * @param {PIXI.Texture[]|FrameObject[]} textures - an array of {@link PIXI.Texture} or frame\n     *  objects that make up the animation\n     */\n    constructor(textures)\n    {\n        super(textures[0] instanceof core.Texture ? textures[0] : textures[0].texture);\n\n        /**\n         * @private\n         */\n        this._textures = null;\n\n        /**\n         * @private\n         */\n        this._durations = null;\n\n        this.textures = textures;\n\n        /**\n         * The speed that the AnimatedSprite will play at. Higher is faster, lower is slower\n         *\n         * @member {number}\n         * @default 1\n         */\n        this.animationSpeed = 1;\n\n        /**\n         * Whether or not the animate sprite repeats after playing.\n         *\n         * @member {boolean}\n         * @default true\n         */\n        this.loop = true;\n\n        /**\n         * Function to call when a AnimatedSprite finishes playing\n         *\n         * @method\n         * @memberof PIXI.extras.AnimatedSprite#\n         */\n        this.onComplete = null;\n\n        /**\n         * Function to call when a AnimatedSprite changes which texture is being rendered\n         *\n         * @method\n         * @memberof PIXI.extras.AnimatedSprite#\n         */\n        this.onFrameChange = null;\n\n        /**\n         * Elapsed time since animation has been started, used internally to display current texture\n         *\n         * @member {number}\n         * @private\n         */\n        this._currentTime = 0;\n\n        /**\n         * Indicates if the AnimatedSprite is currently playing\n         *\n         * @member {boolean}\n         * @readonly\n         */\n        this.playing = false;\n    }\n\n    /**\n     * Stops the AnimatedSprite\n     *\n     */\n    stop()\n    {\n        if (!this.playing)\n        {\n            return;\n        }\n\n        this.playing = false;\n        core.ticker.shared.remove(this.update, this);\n    }\n\n    /**\n     * Plays the AnimatedSprite\n     *\n     */\n    play()\n    {\n        if (this.playing)\n        {\n            return;\n        }\n\n        this.playing = true;\n        core.ticker.shared.add(this.update, this);\n    }\n\n    /**\n     * Stops the AnimatedSprite and goes to a specific frame\n     *\n     * @param {number} frameNumber - frame index to stop at\n     */\n    gotoAndStop(frameNumber)\n    {\n        this.stop();\n\n        const previousFrame = this.currentFrame;\n\n        this._currentTime = frameNumber;\n\n        if (previousFrame !== this.currentFrame)\n        {\n            this.updateTexture();\n        }\n    }\n\n    /**\n     * Goes to a specific frame and begins playing the AnimatedSprite\n     *\n     * @param {number} frameNumber - frame index to start at\n     */\n    gotoAndPlay(frameNumber)\n    {\n        const previousFrame = this.currentFrame;\n\n        this._currentTime = frameNumber;\n\n        if (previousFrame !== this.currentFrame)\n        {\n            this.updateTexture();\n        }\n\n        this.play();\n    }\n\n    /**\n     * Updates the object transform for rendering.\n     *\n     * @private\n     * @param {number} deltaTime - Time since last tick.\n     */\n    update(deltaTime)\n    {\n        const elapsed = this.animationSpeed * deltaTime;\n        const previousFrame = this.currentFrame;\n\n        if (this._durations !== null)\n        {\n            let lag = this._currentTime % 1 * this._durations[this.currentFrame];\n\n            lag += elapsed / 60 * 1000;\n\n            while (lag < 0)\n            {\n                this._currentTime--;\n                lag += this._durations[this.currentFrame];\n            }\n\n            const sign = Math.sign(this.animationSpeed * deltaTime);\n\n            this._currentTime = Math.floor(this._currentTime);\n\n            while (lag >= this._durations[this.currentFrame])\n            {\n                lag -= this._durations[this.currentFrame] * sign;\n                this._currentTime += sign;\n            }\n\n            this._currentTime += lag / this._durations[this.currentFrame];\n        }\n        else\n        {\n            this._currentTime += elapsed;\n        }\n\n        if (this._currentTime < 0 && !this.loop)\n        {\n            this.gotoAndStop(0);\n\n            if (this.onComplete)\n            {\n                this.onComplete();\n            }\n        }\n        else if (this._currentTime >= this._textures.length && !this.loop)\n        {\n            this.gotoAndStop(this._textures.length - 1);\n\n            if (this.onComplete)\n            {\n                this.onComplete();\n            }\n        }\n        else if (previousFrame !== this.currentFrame)\n        {\n            this.updateTexture();\n        }\n    }\n\n    /**\n     * Updates the displayed texture to match the current frame index\n     *\n     * @private\n     */\n    updateTexture()\n    {\n        this._texture = this._textures[this.currentFrame];\n        this._textureID = -1;\n\n        if (this.onFrameChange)\n        {\n            this.onFrameChange(this.currentFrame);\n        }\n    }\n\n    /**\n     * Stops the AnimatedSprite and destroys it\n     *\n     */\n    destroy()\n    {\n        this.stop();\n        super.destroy();\n    }\n\n    /**\n     * A short hand way of creating a movieclip from an array of frame ids\n     *\n     * @static\n     * @param {string[]} frames - The array of frames ids the movieclip will use as its texture frames\n     * @return {AnimatedSprite} The new animated sprite with the specified frames.\n     */\n    static fromFrames(frames)\n    {\n        const textures = [];\n\n        for (let i = 0; i < frames.length; ++i)\n        {\n            textures.push(core.Texture.fromFrame(frames[i]));\n        }\n\n        return new AnimatedSprite(textures);\n    }\n\n    /**\n     * A short hand way of creating a movieclip from an array of image ids\n     *\n     * @static\n     * @param {string[]} images - the array of image urls the movieclip will use as its texture frames\n     * @return {AnimatedSprite} The new animate sprite with the specified images as frames.\n     */\n    static fromImages(images)\n    {\n        const textures = [];\n\n        for (let i = 0; i < images.length; ++i)\n        {\n            textures.push(core.Texture.fromImage(images[i]));\n        }\n\n        return new AnimatedSprite(textures);\n    }\n\n    /**\n     * totalFrames is the total number of frames in the AnimatedSprite. This is the same as number of textures\n     * assigned to the AnimatedSprite.\n     *\n     * @readonly\n     * @member {number}\n     * @memberof PIXI.extras.AnimatedSprite#\n     * @default 0\n     */\n    get totalFrames()\n    {\n        return this._textures.length;\n    }\n\n    /**\n     * The array of textures used for this AnimatedSprite\n     *\n     * @member {PIXI.Texture[]}\n     * @memberof PIXI.extras.AnimatedSprite#\n     */\n    get textures()\n    {\n        return this._textures;\n    }\n\n    /**\n     * Sets the textures.\n     *\n     * @param {PIXI.Texture[]} value - The texture to set.\n     */\n    set textures(value)\n    {\n        if (value[0] instanceof core.Texture)\n        {\n            this._textures = value;\n            this._durations = null;\n        }\n        else\n        {\n            this._textures = [];\n            this._durations = [];\n\n            for (let i = 0; i < value.length; i++)\n            {\n                this._textures.push(value[i].texture);\n                this._durations.push(value[i].time);\n            }\n        }\n    }\n\n    /**\n    * The AnimatedSprites current frame index\n    *\n    * @member {number}\n    * @memberof PIXI.extras.AnimatedSprite#\n    * @readonly\n    */\n    get currentFrame()\n    {\n        let currentFrame = Math.floor(this._currentTime) % this._textures.length;\n\n        if (currentFrame < 0)\n        {\n            currentFrame += this._textures.length;\n        }\n\n        return currentFrame;\n    }\n}\n","import * as core from '../core';\nimport ObservablePoint from '../core/math/ObservablePoint';\n\n/**\n * A BitmapText object will create a line or multiple lines of text using bitmap font. To\n * split a line you can use '\\n', '\\r' or '\\r\\n' in your string. You can generate the fnt files using:\n *\n * A BitmapText can only be created when the font is loaded\n *\n * ```js\n * // in this case the font is in a file called 'desyrel.fnt'\n * let bitmapText = new PIXI.extras.BitmapText(\"text using a fancy font!\", {font: \"35px Desyrel\", align: \"right\"});\n * ```\n *\n * http://www.angelcode.com/products/bmfont/ for windows or\n * http://www.bmglyph.com/ for mac.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI.extras\n */\nexport default class BitmapText extends core.Container\n{\n    /**\n     * @param {string} text - The copy that you would like the text to display\n     * @param {object} style - The style parameters\n     * @param {string|object} style.font - The font descriptor for the object, can be passed as a string of form\n     *      \"24px FontName\" or \"FontName\" or as an object with explicit name/size properties.\n     * @param {string} [style.font.name] - The bitmap font id\n     * @param {number} [style.font.size] - The size of the font in pixels, e.g. 24\n     * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center' or 'right'), does not affect\n     *      single line text\n     * @param {number} [style.tint=0xFFFFFF] - The tint color\n     */\n    constructor(text, style = {})\n    {\n        super();\n\n        /**\n         * The width of the overall text, different from fontSize,\n         * which is defined in the style object\n         *\n         * @member {number}\n         * @readonly\n         */\n        this.textWidth = 0;\n\n        /**\n         * The height of the overall text, different from fontSize,\n         * which is defined in the style object\n         *\n         * @member {number}\n         * @readonly\n         */\n        this.textHeight = 0;\n\n        /**\n         * Private tracker for the letter sprite pool.\n         *\n         * @member {PIXI.Sprite[]}\n         * @private\n         */\n        this._glyphs = [];\n\n        /**\n         * Private tracker for the current style.\n         *\n         * @member {object}\n         * @private\n         */\n        this._font = {\n            tint: style.tint !== undefined ? style.tint : 0xFFFFFF,\n            align: style.align || 'left',\n            name: null,\n            size: 0,\n        };\n\n        /**\n         * Private tracker for the current font.\n         *\n         * @member {object}\n         * @private\n         */\n        this.font = style.font; // run font setter\n\n        /**\n         * Private tracker for the current text.\n         *\n         * @member {string}\n         * @private\n         */\n        this._text = text;\n\n        /**\n         * The max width of this bitmap text in pixels. If the text provided is longer than the\n         * value provided, line breaks will be automatically inserted in the last whitespace.\n         * Disable by setting value to 0\n         *\n         * @member {number}\n         */\n        this.maxWidth = 0;\n\n        /**\n         * The max line height. This is useful when trying to use the total height of the Text,\n         * ie: when trying to vertically align.\n         *\n         * @member {number}\n         */\n        this.maxLineHeight = 0;\n\n        /**\n         * Text anchor. read-only\n         *\n         * @member {PIXI.ObservablePoint}\n         * @private\n         */\n        this._anchor = new ObservablePoint(() => { this.dirty = true; }, this, 0, 0);\n\n        /**\n         * The dirty state of this object.\n         *\n         * @member {boolean}\n         */\n        this.dirty = false;\n\n        this.updateText();\n    }\n\n    /**\n     * Renders text and updates it when needed\n     *\n     * @private\n     */\n    updateText()\n    {\n        const data = BitmapText.fonts[this._font.name];\n        const scale = this._font.size / data.size;\n        const pos = new core.Point();\n        const chars = [];\n        const lineWidths = [];\n\n        let prevCharCode = null;\n        let lastLineWidth = 0;\n        let maxLineWidth = 0;\n        let line = 0;\n        let lastSpace = -1;\n        let lastSpaceWidth = 0;\n        let maxLineHeight = 0;\n\n        for (let i = 0; i < this.text.length; i++)\n        {\n            const charCode = this.text.charCodeAt(i);\n\n            if (/(\\s)/.test(this.text.charAt(i)))\n            {\n                lastSpace = i;\n                lastSpaceWidth = lastLineWidth;\n            }\n\n            if (/(?:\\r\\n|\\r|\\n)/.test(this.text.charAt(i)))\n            {\n                lineWidths.push(lastLineWidth);\n                maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n                line++;\n\n                pos.x = 0;\n                pos.y += data.lineHeight;\n                prevCharCode = null;\n                continue;\n            }\n\n            if (lastSpace !== -1 && this.maxWidth > 0 && pos.x * scale > this.maxWidth)\n            {\n                core.utils.removeItems(chars, lastSpace, i - lastSpace);\n                i = lastSpace;\n                lastSpace = -1;\n\n                lineWidths.push(lastSpaceWidth);\n                maxLineWidth = Math.max(maxLineWidth, lastSpaceWidth);\n                line++;\n\n                pos.x = 0;\n                pos.y += data.lineHeight;\n                prevCharCode = null;\n                continue;\n            }\n\n            const charData = data.chars[charCode];\n\n            if (!charData)\n            {\n                continue;\n            }\n\n            if (prevCharCode && charData.kerning[prevCharCode])\n            {\n                pos.x += charData.kerning[prevCharCode];\n            }\n\n            chars.push({\n                texture: charData.texture,\n                line,\n                charCode,\n                position: new core.Point(pos.x + charData.xOffset, pos.y + charData.yOffset),\n            });\n            lastLineWidth = pos.x + (charData.texture.width + charData.xOffset);\n            pos.x += charData.xAdvance;\n            maxLineHeight = Math.max(maxLineHeight, (charData.yOffset + charData.texture.height));\n            prevCharCode = charCode;\n        }\n\n        lineWidths.push(lastLineWidth);\n        maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n\n        const lineAlignOffsets = [];\n\n        for (let i = 0; i <= line; i++)\n        {\n            let alignOffset = 0;\n\n            if (this._font.align === 'right')\n            {\n                alignOffset = maxLineWidth - lineWidths[i];\n            }\n            else if (this._font.align === 'center')\n            {\n                alignOffset = (maxLineWidth - lineWidths[i]) / 2;\n            }\n\n            lineAlignOffsets.push(alignOffset);\n        }\n\n        const lenChars = chars.length;\n        const tint = this.tint;\n\n        for (let i = 0; i < lenChars; i++)\n        {\n            let c = this._glyphs[i]; // get the next glyph sprite\n\n            if (c)\n            {\n                c.texture = chars[i].texture;\n            }\n            else\n            {\n                c = new core.Sprite(chars[i].texture);\n                this._glyphs.push(c);\n            }\n\n            c.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale;\n            c.position.y = chars[i].position.y * scale;\n            c.scale.x = c.scale.y = scale;\n            c.tint = tint;\n\n            if (!c.parent)\n            {\n                this.addChild(c);\n            }\n        }\n\n        // remove unnecessary children.\n        for (let i = lenChars; i < this._glyphs.length; ++i)\n        {\n            this.removeChild(this._glyphs[i]);\n        }\n\n        this.textWidth = maxLineWidth * scale;\n        this.textHeight = (pos.y + data.lineHeight) * scale;\n\n        // apply anchor\n        if (this.anchor.x !== 0 || this.anchor.y !== 0)\n        {\n            for (let i = 0; i < lenChars; i++)\n            {\n                this._glyphs[i].x -= this.textWidth * this.anchor.x;\n                this._glyphs[i].y -= this.textHeight * this.anchor.y;\n            }\n        }\n        this.maxLineHeight = maxLineHeight * scale;\n    }\n\n    /**\n     * Updates the transform of this object\n     *\n     * @private\n     */\n    updateTransform()\n    {\n        this.validate();\n        this.containerUpdateTransform();\n    }\n\n    /**\n     * Validates text before calling parent's getLocalBounds\n     *\n     * @return {PIXI.Rectangle} The rectangular bounding area\n     */\n    getLocalBounds()\n    {\n        this.validate();\n\n        return super.getLocalBounds();\n    }\n\n    /**\n     * Updates text when needed\n     *\n     * @private\n     */\n    validate()\n    {\n        if (this.dirty)\n        {\n            this.updateText();\n            this.dirty = false;\n        }\n    }\n\n    /**\n     * The tint of the BitmapText object\n     *\n     * @member {number}\n     * @memberof PIXI.extras.BitmapText#\n     */\n    get tint()\n    {\n        return this._font.tint;\n    }\n\n    /**\n     * Sets the tint.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set tint(value)\n    {\n        this._font.tint = (typeof value === 'number' && value >= 0) ? value : 0xFFFFFF;\n\n        this.dirty = true;\n    }\n\n    /**\n     * The alignment of the BitmapText object\n     *\n     * @member {string}\n     * @default 'left'\n     * @memberof PIXI.extras.BitmapText#\n     */\n    get align()\n    {\n        return this._font.align;\n    }\n\n    /**\n     * Sets the alignment\n     *\n     * @param {string} value - The value to set to.\n     */\n    set align(value)\n    {\n        this._font.align = value || 'left';\n\n        this.dirty = true;\n    }\n\n    /**\n     * The anchor sets the origin point of the text.\n     * The default is 0,0 this means the text's origin is the top left\n     * Setting the anchor to 0.5,0.5 means the text's origin is centered\n     * Setting the anchor to 1,1 would mean the text's origin point will be the bottom right corner\n     *\n     * @member {PIXI.Point | number}\n     * @memberof PIXI.extras.BitmapText#\n     */\n    get anchor()\n    {\n        return this._anchor;\n    }\n\n    /**\n     * Sets the anchor.\n     *\n     * @param {PIXI.Point|number} value - The value to set to.\n     */\n    set anchor(value)\n    {\n        if (typeof value === 'number')\n        {\n            this._anchor.set(value);\n        }\n        else\n        {\n            this._anchor.copy(value);\n        }\n    }\n\n    /**\n     * The font descriptor of the BitmapText object\n     *\n     * @member {string|object}\n     * @memberof PIXI.extras.BitmapText#\n     */\n    get font()\n    {\n        return this._font;\n    }\n\n    /**\n     * Sets the font.\n     *\n     * @param {string|object} value - The value to set to.\n     */\n    set font(value)\n    {\n        if (!value)\n        {\n            return;\n        }\n\n        if (typeof value === 'string')\n        {\n            value = value.split(' ');\n\n            this._font.name = value.length === 1 ? value[0] : value.slice(1).join(' ');\n            this._font.size = value.length >= 2 ? parseInt(value[0], 10) : BitmapText.fonts[this._font.name].size;\n        }\n        else\n        {\n            this._font.name = value.name;\n            this._font.size = typeof value.size === 'number' ? value.size : parseInt(value.size, 10);\n        }\n\n        this.dirty = true;\n    }\n\n    /**\n     * The text of the BitmapText object\n     *\n     * @member {string}\n     * @memberof PIXI.extras.BitmapText#\n     */\n    get text()\n    {\n        return this._text;\n    }\n\n    /**\n     * Sets the text.\n     *\n     * @param {string} value - The value to set to.\n     */\n    set text(value)\n    {\n        value = value.toString() || ' ';\n        if (this._text === value)\n        {\n            return;\n        }\n        this._text = value;\n        this.dirty = true;\n    }\n}\n\nBitmapText.fonts = {};\n","import { default as Matrix } from '../core/math/Matrix';\n\nconst tempMat = new Matrix();\n\n/**\n * class controls uv transform and frame clamp for texture\n */\nexport default class TextureTransform {\n    /**\n     *\n     * @param {PIXI.Texture} texture observed texture\n     * @param {number} [clampMargin] Changes frame clamping, 0.5 by default. Use -0.5 for extra border.\n     * @constructor\n     */\n    constructor(texture, clampMargin)\n    {\n        this._texture = texture;\n\n        this.mapCoord = new Matrix();\n\n        this.uClampFrame = new Float32Array(4);\n\n        this.uClampOffset = new Float32Array(2);\n\n        this._lastTextureID = -1;\n\n        /**\n         * Changes frame clamping\n         * Works with TilingSprite and Mesh\n         * Change to 1.5 if you tex ture has repeated right and bottom lines, that leads to smoother borders\n         *\n         * @default 0\n         * @member {number}\n         */\n        this.clampOffset = 0;\n\n        /**\n         * Changes frame clamping\n         * Works with TilingSprite and Mesh\n         * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas\n         *\n         * @default 0.5\n         * @member {number}\n         */\n        this.clampMargin = (typeof clampMargin === 'undefined') ? 0.5 : clampMargin;\n    }\n\n    /**\n     * texture property\n     * @member {PIXI.Texture}\n     * @memberof PIXI.TextureTransform\n     */\n    get texture()\n    {\n        return this._texture;\n    }\n\n    /**\n     * sets texture value\n     * @param {PIXI.Texture} value texture to be set\n     */\n    set texture(value)\n    {\n        this._texture = value;\n        this._lastTextureID = -1;\n    }\n\n    /**\n     * updates matrices if texture was changed\n     * @param {boolean} forceUpdate if true, matrices will be updated any case\n     */\n    update(forceUpdate)\n    {\n        const tex = this.texture;\n\n        if (!tex || !tex.valid)\n        {\n            return;\n        }\n\n        if (!forceUpdate\n            && this._lastTextureID === this.texture._updateID)\n        {\n            return;\n        }\n\n        this._lastTextureID = this.texture._updateID;\n\n        const uvs = this.texture._uvs;\n\n        this.mapCoord.set(uvs.x1 - uvs.x0, uvs.y1 - uvs.y0, uvs.x3 - uvs.x0, uvs.y3 - uvs.y0, uvs.x0, uvs.y0);\n\n        const orig = tex.orig;\n        const trim = tex.trim;\n\n        if (trim)\n        {\n            tempMat.set(orig.width / trim.width, 0, 0, orig.height / trim.height,\n                -trim.x / trim.width, -trim.y / trim.height);\n            this.mapCoord.append(tempMat);\n        }\n\n        const texBase = tex.baseTexture;\n        const frame = this.uClampFrame;\n        const margin = this.clampMargin / texBase.resolution;\n        const offset = this.clampOffset;\n\n        frame[0] = (tex._frame.x + margin + offset) / texBase.width;\n        frame[1] = (tex._frame.y + margin + offset) / texBase.height;\n        frame[2] = (tex._frame.x + tex._frame.width - margin + offset) / texBase.width;\n        frame[3] = (tex._frame.y + tex._frame.height - margin + offset) / texBase.height;\n        this.uClampOffset[0] = offset / texBase.realWidth;\n        this.uClampOffset[1] = offset / texBase.realHeight;\n    }\n}\n","import * as core from '../core';\nimport CanvasTinter from '../core/sprites/canvas/CanvasTinter';\nimport { default as TextureTransform } from './TextureTransform';\n\nconst tempPoint = new core.Point();\n\n/**\n * A tiling sprite is a fast way of rendering a tiling image\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI.extras\n */\nexport default class TilingSprite extends core.Sprite\n{\n    /**\n     * @param {PIXI.Texture} texture - the texture of the tiling sprite\n     * @param {number} [width=100] - the width of the tiling sprite\n     * @param {number} [height=100] - the height of the tiling sprite\n     */\n    constructor(texture, width = 100, height = 100)\n    {\n        super(texture);\n\n        /**\n         * Tile transform\n         *\n         * @member {PIXI.TransformStatic}\n         */\n        this.tileTransform = new core.TransformStatic();\n\n        // /// private\n\n        /**\n         * The with of the tiling sprite\n         *\n         * @member {number}\n         * @private\n         */\n        this._width = width;\n\n        /**\n         * The height of the tiling sprite\n         *\n         * @member {number}\n         * @private\n         */\n        this._height = height;\n\n        /**\n         * Canvas pattern\n         *\n         * @type {CanvasPattern}\n         * @private\n         */\n        this._canvasPattern = null;\n\n        /**\n         * transform that is applied to UV to get the texture coords\n         *\n         * @member {PIXI.extras.TextureTransform}\n         */\n        this.uvTransform = texture.transform || new TextureTransform(texture);\n\n        /**\n         * Plugin that is responsible for rendering this element.\n         * Allows to customize the rendering process without overriding '_renderWebGL' method.\n         *\n         * @member {string}\n         * @default 'tilingSprite'\n         */\n        this.pluginName = 'tilingSprite';\n    }\n    /**\n     * Changes frame clamping in corresponding textureTransform, shortcut\n     * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas\n     *\n     * @default 0.5\n     * @member {number}\n     * @memberof PIXI.TilingSprite\n     */\n    get clampMargin()\n    {\n        return this.uvTransform.clampMargin;\n    }\n\n    /**\n     * setter for clampMargin\n     *\n     * @param {number} value assigned value\n     */\n    set clampMargin(value)\n    {\n        this.uvTransform.clampMargin = value;\n        this.uvTransform.update(true);\n    }\n\n    /**\n     * The scaling of the image that is being tiled\n     *\n     * @member {PIXI.ObservablePoint}\n     * @memberof PIXI.DisplayObject#\n     */\n    get tileScale()\n    {\n        return this.tileTransform.scale;\n    }\n\n    /**\n     * Copies the point to the scale of the tiled image.\n     *\n     * @param {PIXI.Point|PIXI.ObservablePoint} value - The value to set to.\n     */\n    set tileScale(value)\n    {\n        this.tileTransform.scale.copy(value);\n    }\n\n    /**\n     * The offset of the image that is being tiled\n     *\n     * @member {PIXI.ObservablePoint}\n     * @memberof PIXI.TilingSprite#\n     */\n    get tilePosition()\n    {\n        return this.tileTransform.position;\n    }\n\n    /**\n     * Copies the point to the position of the tiled image.\n     *\n     * @param {PIXI.Point|PIXI.ObservablePoint} value - The value to set to.\n     */\n    set tilePosition(value)\n    {\n        this.tileTransform.position.copy(value);\n    }\n\n    /**\n     * @private\n     */\n    _onTextureUpdate()\n    {\n        if (this.uvTransform)\n        {\n            this.uvTransform.texture = this._texture;\n        }\n    }\n\n    /**\n     * Renders the object using the WebGL renderer\n     *\n     * @private\n     * @param {PIXI.WebGLRenderer} renderer - The renderer\n     */\n    _renderWebGL(renderer)\n    {\n        // tweak our texture temporarily..\n        const texture = this._texture;\n\n        if (!texture || !texture.valid)\n        {\n            return;\n        }\n\n        this.tileTransform.updateLocalTransform();\n        this.uvTransform.update();\n\n        renderer.setObjectRenderer(renderer.plugins[this.pluginName]);\n        renderer.plugins[this.pluginName].render(this);\n    }\n\n    /**\n     * Renders the object using the Canvas renderer\n     *\n     * @private\n     * @param {PIXI.CanvasRenderer} renderer - a reference to the canvas renderer\n     */\n    _renderCanvas(renderer)\n    {\n        const texture = this._texture;\n\n        if (!texture.baseTexture.hasLoaded)\n        {\n            return;\n        }\n\n        const context = renderer.context;\n        const transform = this.worldTransform;\n        const resolution = renderer.resolution;\n        const baseTexture = texture.baseTexture;\n        const baseTextureResolution = texture.baseTexture.resolution;\n        const modX = (this.tilePosition.x / this.tileScale.x) % texture._frame.width;\n        const modY = (this.tilePosition.y / this.tileScale.y) % texture._frame.height;\n\n        // create a nice shiny pattern!\n        // TODO this needs to be refreshed if texture changes..\n        if (!this._canvasPattern)\n        {\n            // cut an object from a spritesheet..\n            const tempCanvas = new core.CanvasRenderTarget(texture._frame.width,\n                                                        texture._frame.height,\n                                                        baseTextureResolution);\n\n            // Tint the tiling sprite\n            if (this.tint !== 0xFFFFFF)\n            {\n                if (this.cachedTint !== this.tint)\n                {\n                    this.cachedTint = this.tint;\n\n                    this.tintedTexture = CanvasTinter.getTintedTexture(this, this.tint);\n                }\n                tempCanvas.context.drawImage(this.tintedTexture, 0, 0);\n            }\n            else\n            {\n                tempCanvas.context.drawImage(baseTexture.source, -texture._frame.x, -texture._frame.y);\n            }\n            this._canvasPattern = tempCanvas.context.createPattern(tempCanvas.canvas, 'repeat');\n        }\n\n        // set context state..\n        context.globalAlpha = this.worldAlpha;\n        context.setTransform(transform.a * resolution,\n                           transform.b * resolution,\n                           transform.c * resolution,\n                           transform.d * resolution,\n                           transform.tx * resolution,\n                           transform.ty * resolution);\n\n        // TODO - this should be rolled into the setTransform above..\n        context.scale(this.tileScale.x / baseTextureResolution, this.tileScale.y / baseTextureResolution);\n\n        context.translate(modX + (this.anchor.x * -this._width),\n                          modY + (this.anchor.y * -this._height));\n\n        renderer.setBlendMode(this.blendMode);\n\n        // fill the pattern!\n        context.fillStyle = this._canvasPattern;\n        context.fillRect(-modX,\n                         -modY,\n                         this._width / this.tileScale.x * baseTextureResolution,\n                         this._height / this.tileScale.y * baseTextureResolution);\n    }\n\n    /**\n     * Updates the bounds of the tiling sprite.\n     *\n     * @private\n     */\n    _calculateBounds()\n    {\n        const minX = this._width * -this._anchor._x;\n        const minY = this._height * -this._anchor._y;\n        const maxX = this._width * (1 - this._anchor._x);\n        const maxY = this._height * (1 - this._anchor._y);\n\n        this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n    }\n\n    /**\n     * Gets the local bounds of the sprite object.\n     *\n     * @param {PIXI.Rectangle} rect - The output rectangle.\n     * @return {PIXI.Rectangle} The bounds.\n     */\n    getLocalBounds(rect)\n    {\n        // we can do a fast local bounds if the sprite has no children!\n        if (this.children.length === 0)\n        {\n            this._bounds.minX = this._width * -this._anchor._x;\n            this._bounds.minY = this._height * -this._anchor._y;\n            this._bounds.maxX = this._width * (1 - this._anchor._x);\n            this._bounds.maxY = this._height * (1 - this._anchor._x);\n\n            if (!rect)\n            {\n                if (!this._localBoundsRect)\n                {\n                    this._localBoundsRect = new core.Rectangle();\n                }\n\n                rect = this._localBoundsRect;\n            }\n\n            return this._bounds.getRectangle(rect);\n        }\n\n        return super.getLocalBounds.call(this, rect);\n    }\n\n    /**\n     * Checks if a point is inside this tiling sprite.\n     *\n     * @param {PIXI.Point} point - the point to check\n     * @return {boolean} Whether or not the sprite contains the point.\n     */\n    containsPoint(point)\n    {\n        this.worldTransform.applyInverse(point, tempPoint);\n\n        const width = this._width;\n        const height = this._height;\n        const x1 = -width * this.anchor._x;\n\n        if (tempPoint.x > x1 && tempPoint.x < x1 + width)\n        {\n            const y1 = -height * this.anchor._y;\n\n            if (tempPoint.y > y1 && tempPoint.y < y1 + height)\n            {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Destroys this tiling sprite\n     *\n     */\n    destroy()\n    {\n        super.destroy();\n\n        this.tileTransform = null;\n        this.uvTransform = null;\n    }\n\n    /**\n     * Helper function that creates a new tiling sprite based on the source you provide.\n     * The source can be - frame id, image url, video url, canvas element, video element, base texture\n     *\n     * @static\n     * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from\n     * @param {number} width - the width of the tiling sprite\n     * @param {number} height - the height of the tiling sprite\n     * @return {PIXI.Texture} The newly created texture\n     */\n    static from(source, width, height)\n    {\n        return new TilingSprite(core.Texture.from(source), width, height);\n    }\n\n    /**\n     * Helper function that creates a tiling sprite that will use a texture from the TextureCache based on the frameId\n     * The frame ids are created when a Texture packer file has been loaded\n     *\n     * @static\n     * @param {string} frameId - The frame Id of the texture in the cache\n     * @param {number} width - the width of the tiling sprite\n     * @param {number} height - the height of the tiling sprite\n     * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId\n     */\n    static fromFrame(frameId, width, height)\n    {\n        const texture = core.utils.TextureCache[frameId];\n\n        if (!texture)\n        {\n            throw new Error(`The frameId \"${frameId}\" does not exist in the texture cache ${this}`);\n        }\n\n        return new TilingSprite(texture, width, height);\n    }\n\n    /**\n     * Helper function that creates a sprite that will contain a texture based on an image url\n     * If the image is not in the texture cache it will be loaded\n     *\n     * @static\n     * @param {string} imageId - The image url of the texture\n     * @param {number} width - the width of the tiling sprite\n     * @param {number} height - the height of the tiling sprite\n     * @param {boolean} [crossorigin] - if you want to specify the cross-origin parameter\n     * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - if you want to specify the scale mode,\n     *  see {@link PIXI.SCALE_MODES} for possible values\n     * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id\n     */\n    static fromImage(imageId, width, height, crossorigin, scaleMode)\n    {\n        return new TilingSprite(core.Texture.fromImage(imageId, crossorigin, scaleMode), width, height);\n    }\n\n    /**\n     * The width of the sprite, setting this will actually modify the scale to achieve the value set\n     *\n     * @member {number}\n     * @memberof PIXI.extras.TilingSprite#\n     */\n    get width()\n    {\n        return this._width;\n    }\n\n    /**\n     * Sets the width.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set width(value)\n    {\n        this._width = value;\n    }\n\n    /**\n     * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set\n     *\n     * @member {number}\n     * @memberof PIXI.extras.TilingSprite#\n     */\n    get height()\n    {\n        return this._height;\n    }\n\n    /**\n     * Sets the width.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set height(value)\n    {\n        this._height = value;\n    }\n}\n","import * as core from '../core';\n\nconst DisplayObject = core.DisplayObject;\nconst _tempMatrix = new core.Matrix();\n\nDisplayObject.prototype._cacheAsBitmap = false;\nDisplayObject.prototype._cacheData = false;\n\n// figured theres no point adding ALL the extra variables to prototype.\n// this model can hold the information needed. This can also be generated on demand as\n// most objects are not cached as bitmaps.\n/**\n * @class\n * @ignore\n */\nclass CacheData\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        this.originalRenderWebGL = null;\n        this.originalRenderCanvas = null;\n        this.originalCalculateBounds = null;\n        this.originalGetLocalBounds = null;\n\n        this.originalUpdateTransform = null;\n        this.originalHitTest = null;\n        this.originalDestroy = null;\n        this.originalMask = null;\n        this.originalFilterArea = null;\n        this.sprite = null;\n    }\n}\n\nObject.defineProperties(DisplayObject.prototype, {\n    /**\n     * Set this to true if you want this display object to be cached as a bitmap.\n     * This basically takes a snap shot of the display object as it is at that moment. It can\n     * provide a performance benefit for complex static displayObjects.\n     * To remove simply set this property to 'false'\n     *\n     * @member {boolean}\n     * @memberof PIXI.DisplayObject#\n     */\n    cacheAsBitmap: {\n        get()\n        {\n            return this._cacheAsBitmap;\n        },\n        set(value)\n        {\n            if (this._cacheAsBitmap === value)\n            {\n                return;\n            }\n\n            this._cacheAsBitmap = value;\n\n            let data;\n\n            if (value)\n            {\n                if (!this._cacheData)\n                {\n                    this._cacheData = new CacheData();\n                }\n\n                data = this._cacheData;\n\n                data.originalRenderWebGL = this.renderWebGL;\n                data.originalRenderCanvas = this.renderCanvas;\n\n                data.originalUpdateTransform = this.updateTransform;\n                data.originalCalculateBounds = this._calculateBounds;\n                data.originalGetLocalBounds = this.getLocalBounds;\n\n                data.originalDestroy = this.destroy;\n\n                data.originalContainsPoint = this.containsPoint;\n\n                data.originalMask = this._mask;\n                data.originalFilterArea = this.filterArea;\n\n                this.renderWebGL = this._renderCachedWebGL;\n                this.renderCanvas = this._renderCachedCanvas;\n\n                this.destroy = this._cacheAsBitmapDestroy;\n            }\n            else\n            {\n                data = this._cacheData;\n\n                if (data.sprite)\n                {\n                    this._destroyCachedDisplayObject();\n                }\n\n                this.renderWebGL = data.originalRenderWebGL;\n                this.renderCanvas = data.originalRenderCanvas;\n                this._calculateBounds = data.originalCalculateBounds;\n                this.getLocalBounds = data.originalGetLocalBounds;\n\n                this.destroy = data.originalDestroy;\n\n                this.updateTransform = data.originalUpdateTransform;\n                this.containsPoint = data.originalContainsPoint;\n\n                this._mask = data.originalMask;\n                this.filterArea = data.originalFilterArea;\n            }\n        },\n    },\n});\n\n/**\n * Renders a cached version of the sprite with WebGL\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._renderCachedWebGL = function _renderCachedWebGL(renderer)\n{\n    if (!this.visible || this.worldAlpha <= 0 || !this.renderable)\n    {\n        return;\n    }\n\n    this._initCachedDisplayObject(renderer);\n\n    this._cacheData.sprite._transformID = -1;\n    this._cacheData.sprite.worldAlpha = this.worldAlpha;\n    this._cacheData.sprite._renderWebGL(renderer);\n};\n\n/**\n * Prepares the WebGL renderer to cache the sprite\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._initCachedDisplayObject = function _initCachedDisplayObject(renderer)\n{\n    if (this._cacheData && this._cacheData.sprite)\n    {\n        return;\n    }\n\n    // make sure alpha is set to 1 otherwise it will get rendered as invisible!\n    const cacheAlpha = this.alpha;\n\n    this.alpha = 1;\n\n    // first we flush anything left in the renderer (otherwise it would get rendered to the cached texture)\n    renderer.currentRenderer.flush();\n    // this.filters= [];\n\n    // next we find the dimensions of the untransformed object\n    // this function also calls updatetransform on all its children as part of the measuring.\n    // This means we don't need to update the transform again in this function\n    // TODO pass an object to clone too? saves having to create a new one each time!\n    const bounds = this.getLocalBounds().clone();\n\n    // add some padding!\n    if (this._filters)\n    {\n        const padding = this._filters[0].padding;\n\n        bounds.pad(padding);\n    }\n\n    // for now we cache the current renderTarget that the webGL renderer is currently using.\n    // this could be more elegent..\n    const cachedRenderTarget = renderer._activeRenderTarget;\n    // We also store the filter stack - I will definitely look to change how this works a little later down the line.\n    const stack = renderer.filterManager.filterStack;\n\n    // this renderTexture will be used to store the cached DisplayObject\n\n    const renderTexture = core.RenderTexture.create(bounds.width | 0, bounds.height | 0);\n\n    // need to set //\n    const m = _tempMatrix;\n\n    m.tx = -bounds.x;\n    m.ty = -bounds.y;\n\n    // reset\n    this.transform.worldTransform.identity();\n\n    // set all properties to there original so we can render to a texture\n    this.renderWebGL = this._cacheData.originalRenderWebGL;\n\n    renderer.render(this, renderTexture, true, m, true);\n    // now restore the state be setting the new properties\n\n    renderer.bindRenderTarget(cachedRenderTarget);\n\n    renderer.filterManager.filterStack = stack;\n\n    this.renderWebGL = this._renderCachedWebGL;\n    this.updateTransform = this.displayObjectUpdateTransform;\n\n    this._mask = null;\n    this.filterArea = null;\n\n    // create our cached sprite\n    const cachedSprite = new core.Sprite(renderTexture);\n\n    cachedSprite.transform.worldTransform = this.transform.worldTransform;\n    cachedSprite.anchor.x = -(bounds.x / bounds.width);\n    cachedSprite.anchor.y = -(bounds.y / bounds.height);\n    cachedSprite.alpha = cacheAlpha;\n    cachedSprite._bounds = this._bounds;\n\n    // easy bounds..\n    this._calculateBounds = this._calculateCachedBounds;\n    this.getLocalBounds = this._getCachedLocalBounds;\n\n    this._cacheData.sprite = cachedSprite;\n\n    this.transform._parentID = -1;\n    // restore the transform of the cached sprite to avoid the nasty flicker..\n    this.updateTransform();\n\n    // map the hit test..\n    this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n\n/**\n * Renders a cached version of the sprite with canvas\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._renderCachedCanvas = function _renderCachedCanvas(renderer)\n{\n    if (!this.visible || this.worldAlpha <= 0 || !this.renderable)\n    {\n        return;\n    }\n\n    this._initCachedDisplayObjectCanvas(renderer);\n\n    this._cacheData.sprite.worldAlpha = this.worldAlpha;\n\n    this._cacheData.sprite.renderCanvas(renderer);\n};\n\n// TODO this can be the same as the webGL verison.. will need to do a little tweaking first though..\n/**\n * Prepares the Canvas renderer to cache the sprite\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._initCachedDisplayObjectCanvas = function _initCachedDisplayObjectCanvas(renderer)\n{\n    if (this._cacheData && this._cacheData.sprite)\n    {\n        return;\n    }\n\n    // get bounds actually transforms the object for us already!\n    const bounds = this.getLocalBounds();\n\n    const cacheAlpha = this.alpha;\n\n    this.alpha = 1;\n\n    const cachedRenderTarget = renderer.context;\n\n    const renderTexture = core.RenderTexture.create(bounds.width | 0, bounds.height | 0);\n\n    // need to set //\n    const m = _tempMatrix;\n\n    this.transform.worldTransform.copy(m);\n    m.invert();\n\n    m.tx -= bounds.x;\n    m.ty -= bounds.y;\n\n    // m.append(this.transform.worldTransform.)\n     // set all properties to there original so we can render to a texture\n    this.renderCanvas = this._cacheData.originalRenderCanvas;\n\n    // renderTexture.render(this, m, true);\n    renderer.render(this, renderTexture, true, m, false);\n\n    // now restore the state be setting the new properties\n    renderer.context = cachedRenderTarget;\n\n    this.renderCanvas = this._renderCachedCanvas;\n    this._calculateBounds = this._calculateCachedBounds;\n\n    this._mask = null;\n    this.filterArea = null;\n\n    // create our cached sprite\n    const cachedSprite = new core.Sprite(renderTexture);\n\n    cachedSprite.transform.worldTransform = this.transform.worldTransform;\n    cachedSprite.anchor.x = -(bounds.x / bounds.width);\n    cachedSprite.anchor.y = -(bounds.y / bounds.height);\n    cachedSprite._bounds = this._bounds;\n    cachedSprite.alpha = cacheAlpha;\n\n    this.updateTransform();\n    this.updateTransform = this.displayObjectUpdateTransform;\n\n    this._cacheData.sprite = cachedSprite;\n\n    this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n\n/**\n * Calculates the bounds of the cached sprite\n *\n * @private\n */\nDisplayObject.prototype._calculateCachedBounds = function _calculateCachedBounds()\n{\n    this._cacheData.sprite._calculateBounds();\n};\n\n/**\n * Gets the bounds of the cached sprite.\n *\n * @private\n * @return {Rectangle} The local bounds.\n */\nDisplayObject.prototype._getCachedLocalBounds = function _getCachedLocalBounds()\n{\n    return this._cacheData.sprite.getLocalBounds();\n};\n\n/**\n * Destroys the cached sprite.\n *\n * @private\n */\nDisplayObject.prototype._destroyCachedDisplayObject = function _destroyCachedDisplayObject()\n{\n    this._cacheData.sprite._texture.destroy(true);\n    this._cacheData.sprite = null;\n};\n\n/**\n * Destroys the cached object.\n *\n * @private\n */\nDisplayObject.prototype._cacheAsBitmapDestroy = function _cacheAsBitmapDestroy()\n{\n    this.cacheAsBitmap = false;\n    this.destroy();\n};\n","import * as core from '../core';\n\n/**\n * The instance name of the object.\n *\n * @memberof PIXI.DisplayObject#\n * @member {string}\n */\ncore.DisplayObject.prototype.name = null;\n\n/**\n * Returns the display object in the container\n *\n * @memberof PIXI.Container#\n * @param {string} name - instance name\n * @return {PIXI.DisplayObject} The child with the specified name.\n */\ncore.Container.prototype.getChildByName = function getChildByName(name)\n{\n    for (let i = 0; i < this.children.length; i++)\n    {\n        if (this.children[i].name === name)\n        {\n            return this.children[i];\n        }\n    }\n\n    return null;\n};\n","import * as core from '../core';\n\n/**\n * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.\n *\n * @memberof PIXI.DisplayObject#\n * @param {Point} point - the point to write the global value to. If null a new point will be returned\n * @param {boolean} skipUpdate - setting to true will stop the transforms of the scene graph from\n *  being updated. This means the calculation returned MAY be out of date BUT will give you a\n *  nice performance boost\n * @return {Point} The updated point\n */\ncore.DisplayObject.prototype.getGlobalPosition = function getGlobalPosition(point = new core.Point(), skipUpdate = false)\n{\n    if (this.parent)\n    {\n        this.parent.toGlobal(this.position, point, skipUpdate);\n    }\n    else\n    {\n        point.x = this.position.x;\n        point.y = this.position.y;\n    }\n\n    return point;\n};\n","/**\n * @namespace PIXI.extras\n */\nexport { default as TextureTransform } from './TextureTransform';\nexport { default as AnimatedSprite } from './AnimatedSprite';\nexport { default as TilingSprite } from './TilingSprite';\nexport { default as TilingSpriteRenderer } from './webgl/TilingSpriteRenderer';\nexport { default as BitmapText } from './BitmapText';\n\n// imported for side effect of extending the prototype only, contains no exports\nimport './cacheAsBitmap';\nimport './getChildByName';\nimport './getGlobalPosition';\n","import * as core from '../../core';\nimport { WRAP_MODES } from '../../core/const';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\n\nconst tempMat = new core.Matrix();\nconst tempArray = new Float32Array(4);\n\n/**\n * WebGL renderer plugin for tiling sprites\n */\nexport default class TilingSpriteRenderer extends core.ObjectRenderer {\n\n    /**\n     * constructor for renderer\n     *\n     * @param {WebGLRenderer} renderer The renderer this tiling awesomeness works for.\n     */\n    constructor(renderer)\n    {\n        super(renderer);\n\n        this.shader = null;\n        this.simpleShader = null;\n        this.quad = null;\n    }\n\n    /**\n     * Sets up the renderer context and necessary buffers.\n     *\n     * @private\n     */\n    onContextChange()\n    {\n        const gl = this.renderer.gl;\n\n        this.shader = new core.Shader(gl,\n            readFileSync(join(__dirname, './tilingSprite.vert'), 'utf8'),\n            readFileSync(join(__dirname, './tilingSprite.frag'), 'utf8'));\n        this.simpleShader = new core.Shader(gl,\n            readFileSync(join(__dirname, './tilingSprite.vert'), 'utf8'),\n            readFileSync(join(__dirname, './tilingSprite_simple.frag'), 'utf8'));\n\n        this.renderer.bindVao(null);\n        this.quad = new core.Quad(gl, this.renderer.state.attribState);\n        this.quad.initVao(this.shader);\n    }\n\n    /**\n     *\n     * @param {PIXI.extras.TilingSprite} ts tilingSprite to be rendered\n     */\n    render(ts)\n    {\n        const renderer = this.renderer;\n        const quad = this.quad;\n\n        renderer.bindVao(quad.vao);\n\n        let vertices = quad.vertices;\n\n        vertices[0] = vertices[6] = (ts._width) * -ts.anchor.x;\n        vertices[1] = vertices[3] = ts._height * -ts.anchor.y;\n\n        vertices[2] = vertices[4] = (ts._width) * (1.0 - ts.anchor.x);\n        vertices[5] = vertices[7] = ts._height * (1.0 - ts.anchor.y);\n\n        vertices = quad.uvs;\n\n        vertices[0] = vertices[6] = -ts.anchor.x;\n        vertices[1] = vertices[3] = -ts.anchor.y;\n\n        vertices[2] = vertices[4] = 1.0 - ts.anchor.x;\n        vertices[5] = vertices[7] = 1.0 - ts.anchor.y;\n\n        quad.upload();\n\n        const tex = ts._texture;\n        const baseTex = tex.baseTexture;\n        const lt = ts.tileTransform.localTransform;\n        const uv = ts.uvTransform;\n        let isSimple = baseTex.isPowerOfTwo\n            && tex.frame.width === baseTex.width && tex.frame.height === baseTex.height;\n\n        // auto, force repeat wrapMode for big tiling textures\n        if (isSimple)\n        {\n            if (!baseTex._glTextures[renderer.CONTEXT_UID])\n            {\n                if (baseTex.wrapMode === WRAP_MODES.CLAMP)\n                {\n                    baseTex.wrapMode = WRAP_MODES.REPEAT;\n                }\n            }\n            else\n            {\n                isSimple = baseTex.wrapMode !== WRAP_MODES.CLAMP;\n            }\n        }\n\n        const shader = isSimple ? this.simpleShader : this.shader;\n\n        renderer.bindShader(shader);\n\n        const w = tex.width;\n        const h = tex.height;\n        const W = ts._width;\n        const H = ts._height;\n\n        tempMat.set(lt.a * w / W,\n            lt.b * w / H,\n            lt.c * h / W,\n            lt.d * h / H,\n            lt.tx / W,\n            lt.ty / H);\n\n        // that part is the same as above:\n        // tempMat.identity();\n        // tempMat.scale(tex.width, tex.height);\n        // tempMat.prepend(lt);\n        // tempMat.scale(1.0 / ts._width, 1.0 / ts._height);\n\n        tempMat.invert();\n        if (isSimple)\n        {\n            tempMat.append(uv.mapCoord);\n        }\n        else\n        {\n            shader.uniforms.uMapCoord = uv.mapCoord.toArray(true);\n            shader.uniforms.uClampFrame = uv.uClampFrame;\n            shader.uniforms.uClampOffset = uv.uClampOffset;\n        }\n\n        shader.uniforms.uTransform = tempMat.toArray(true);\n\n        const color = tempArray;\n\n        core.utils.hex2rgb(ts.tint, color);\n        color[3] = ts.worldAlpha;\n        shader.uniforms.uColor = color;\n        shader.uniforms.translationMatrix = ts.transform.worldTransform.toArray(true);\n\n        shader.uniforms.uSampler = renderer.bindTexture(tex);\n\n        renderer.setBlendMode(ts.blendMode);\n\n        quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0);\n    }\n}\n\ncore.WebGLRenderer.registerPlugin('tilingSprite', TilingSpriteRenderer);\n","import * as core from '../../core';\nimport BlurXFilter from './BlurXFilter';\nimport BlurYFilter from './BlurYFilter';\n\n/**\n * The BlurFilter applies a Gaussian blur to an object.\n * The strength of the blur can be set for x- and y-axis separately.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nexport default class BlurFilter extends core.Filter\n{\n    /**\n     * @param {number} strength - The strength of the blur filter.\n     * @param {number} quality - The quality of the blur filter.\n     * @param {number} resolution - The resolution of the blur filter.\n     * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n     */\n    constructor(strength, quality, resolution, kernelSize)\n    {\n        super();\n\n        this.blurXFilter = new BlurXFilter(strength, quality, resolution, kernelSize);\n        this.blurYFilter = new BlurYFilter(strength, quality, resolution, kernelSize);\n        this.resolution = 1;\n\n        this.padding = 0;\n        this.resolution = resolution || 1;\n        this.quality = quality || 4;\n        this.blur = strength || 8;\n    }\n\n    /**\n     * Applies the filter.\n     *\n     * @param {PIXI.FilterManager} filterManager - The manager.\n     * @param {PIXI.RenderTarget} input - The input target.\n     * @param {PIXI.RenderTarget} output - The output target.\n     */\n    apply(filterManager, input, output)\n    {\n        const renderTarget = filterManager.getRenderTarget(true);\n\n        this.blurXFilter.apply(filterManager, input, renderTarget, true);\n        this.blurYFilter.apply(filterManager, renderTarget, output, false);\n\n        filterManager.returnRenderTarget(renderTarget);\n    }\n\n    /**\n     * Sets the strength of both the blurX and blurY properties simultaneously\n     *\n     * @member {number}\n     * @memberOf PIXI.filters.BlurFilter#\n     * @default 2\n     */\n    get blur()\n    {\n        return this.blurXFilter.blur;\n    }\n\n    /**\n     * Sets the strength of the blur.\n     *\n     * @param {number} value - The value to set.\n     */\n    set blur(value)\n    {\n        this.blurXFilter.blur = this.blurYFilter.blur = value;\n        this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n    }\n\n    /**\n     * Sets the number of passes for blur. More passes means higher quaility bluring.\n     *\n     * @member {number}\n     * @memberof PIXI.filters.BlurYFilter#\n     * @default 1\n     */\n    get quality()\n    {\n        return this.blurXFilter.quality;\n    }\n\n    /**\n     * Sets the quality of the blur.\n     *\n     * @param {number} value - The value to set.\n     */\n    set quality(value)\n    {\n        this.blurXFilter.quality = this.blurYFilter.quality = value;\n    }\n\n    /**\n     * Sets the strength of the blurX property\n     *\n     * @member {number}\n     * @memberOf PIXI.filters.BlurFilter#\n     * @default 2\n     */\n    get blurX()\n    {\n        return this.blurXFilter.blur;\n    }\n\n    /**\n     * Sets the strength of the blurX.\n     *\n     * @param {number} value - The value to set.\n     */\n    set blurX(value)\n    {\n        this.blurXFilter.blur = value;\n        this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n    }\n\n    /**\n     * Sets the strength of the blurY property\n     *\n     * @member {number}\n     * @memberOf PIXI.filters.BlurFilter#\n     * @default 2\n     */\n    get blurY()\n    {\n        return this.blurYFilter.blur;\n    }\n\n    /**\n     * Sets the strength of the blurY.\n     *\n     * @param {number} value - The value to set.\n     */\n    set blurY(value)\n    {\n        this.blurYFilter.blur = value;\n        this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n    }\n}\n","import * as core from '../../core';\nimport generateBlurVertSource from './generateBlurVertSource';\nimport generateBlurFragSource from './generateBlurFragSource';\nimport getMaxBlurKernelSize from './getMaxBlurKernelSize';\n\n/**\n * The BlurXFilter applies a horizontal Gaussian blur to an object.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nexport default class BlurXFilter extends core.Filter\n{\n    /**\n     * @param {number} strength - The strength of the blur filter.\n     * @param {number} quality - The quality of the blur filter.\n     * @param {number} resolution - The resolution of the blur filter.\n     * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n     */\n    constructor(strength, quality, resolution, kernelSize)\n    {\n        kernelSize = kernelSize || 5;\n        const vertSrc = generateBlurVertSource(kernelSize, true);\n        const fragSrc = generateBlurFragSource(kernelSize);\n\n        super(\n            // vertex shader\n            vertSrc,\n            // fragment shader\n            fragSrc\n        );\n\n        this.resolution = resolution || 1;\n\n        this._quality = 0;\n\n        this.quality = quality || 4;\n        this.strength = strength || 8;\n\n        this.firstRun = true;\n    }\n\n    /**\n     * Applies the filter.\n     *\n     * @param {PIXI.FilterManager} filterManager - The manager.\n     * @param {PIXI.RenderTarget} input - The input target.\n     * @param {PIXI.RenderTarget} output - The output target.\n     * @param {boolean} clear - Should the output be cleared before rendering?\n     */\n    apply(filterManager, input, output, clear)\n    {\n        if (this.firstRun)\n        {\n            const gl = filterManager.renderer.gl;\n            const kernelSize = getMaxBlurKernelSize(gl);\n\n            this.vertexSrc = generateBlurVertSource(kernelSize, true);\n            this.fragmentSrc = generateBlurFragSource(kernelSize);\n\n            this.firstRun = false;\n        }\n\n        this.uniforms.strength = (1 / output.size.width) * (output.size.width / input.size.width);\n\n        // screen space!\n        this.uniforms.strength *= this.strength;\n        this.uniforms.strength /= this.passes;// / this.passes//Math.pow(1, this.passes);\n\n        if (this.passes === 1)\n        {\n            filterManager.applyFilter(this, input, output, clear);\n        }\n        else\n        {\n            const renderTarget = filterManager.getRenderTarget(true);\n            let flip = input;\n            let flop = renderTarget;\n\n            for (let i = 0; i < this.passes - 1; i++)\n            {\n                filterManager.applyFilter(this, flip, flop, true);\n\n                const temp = flop;\n\n                flop = flip;\n                flip = temp;\n            }\n\n            filterManager.applyFilter(this, flip, output, clear);\n\n            filterManager.returnRenderTarget(renderTarget);\n        }\n    }\n\n    /**\n     * Sets the strength of both the blur.\n     *\n     * @member {number}\n     * @memberof PIXI.filters.BlurXFilter#\n     * @default 16\n     */\n    get blur()\n    {\n        return this.strength;\n    }\n\n    /**\n     * Sets the strength of the blur.\n     *\n     * @param {number} value - The value to set.\n     */\n    set blur(value)\n    {\n        this.padding = Math.abs(value) * 2;\n        this.strength = value;\n    }\n\n     /**\n     * Sets the quality of the blur by modifying the number of passes. More passes means higher\n     * quaility bluring but the lower the performance.\n     *\n     * @member {number}\n     * @memberof PIXI.filters.BlurXFilter#\n     * @default 4\n     */\n    get quality()\n    {\n        return this._quality;\n    }\n\n    /**\n     * Sets the quality of the blur.\n     *\n     * @param {number} value - The value to set.\n     */\n    set quality(value)\n    {\n        this._quality = value;\n        this.passes = value;\n    }\n}\n","import * as core from '../../core';\nimport generateBlurVertSource from './generateBlurVertSource';\nimport generateBlurFragSource from './generateBlurFragSource';\nimport getMaxBlurKernelSize from './getMaxBlurKernelSize';\n\n/**\n * The BlurYFilter applies a horizontal Gaussian blur to an object.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nexport default class BlurYFilter extends core.Filter\n{\n    /**\n     * @param {number} strength - The strength of the blur filter.\n     * @param {number} quality - The quality of the blur filter.\n     * @param {number} resolution - The resolution of the blur filter.\n     * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n     */\n    constructor(strength, quality, resolution, kernelSize)\n    {\n        kernelSize = kernelSize || 5;\n        const vertSrc = generateBlurVertSource(kernelSize, false);\n        const fragSrc = generateBlurFragSource(kernelSize);\n\n        super(\n            // vertex shader\n            vertSrc,\n            // fragment shader\n            fragSrc\n        );\n\n        this.resolution = resolution || 1;\n\n        this._quality = 0;\n\n        this.quality = quality || 4;\n        this.strength = strength || 8;\n\n        this.firstRun = true;\n    }\n\n    /**\n     * Applies the filter.\n     *\n     * @param {PIXI.FilterManager} filterManager - The manager.\n     * @param {PIXI.RenderTarget} input - The input target.\n     * @param {PIXI.RenderTarget} output - The output target.\n     * @param {boolean} clear - Should the output be cleared before rendering?\n     */\n    apply(filterManager, input, output, clear)\n    {\n        if (this.firstRun)\n        {\n            const gl = filterManager.renderer.gl;\n            const kernelSize = getMaxBlurKernelSize(gl);\n\n            this.vertexSrc = generateBlurVertSource(kernelSize, false);\n            this.fragmentSrc = generateBlurFragSource(kernelSize);\n\n            this.firstRun = false;\n        }\n\n        this.uniforms.strength = (1 / output.size.height) * (output.size.height / input.size.height);\n\n        this.uniforms.strength *= this.strength;\n        this.uniforms.strength /= this.passes;\n\n        if (this.passes === 1)\n        {\n            filterManager.applyFilter(this, input, output, clear);\n        }\n        else\n        {\n            const renderTarget = filterManager.getRenderTarget(true);\n            let flip = input;\n            let flop = renderTarget;\n\n            for (let i = 0; i < this.passes - 1; i++)\n            {\n                filterManager.applyFilter(this, flip, flop, true);\n\n                const temp = flop;\n\n                flop = flip;\n                flip = temp;\n            }\n\n            filterManager.applyFilter(this, flip, output, clear);\n\n            filterManager.returnRenderTarget(renderTarget);\n        }\n    }\n\n    /**\n     * Sets the strength of both the blur.\n     *\n     * @member {number}\n     * @memberof PIXI.filters.BlurYFilter#\n     * @default 2\n     */\n    get blur()\n    {\n        return this.strength;\n    }\n\n    /**\n     * Sets the strength of the blur.\n     *\n     * @param {number} value - The value to set.\n     */\n    set blur(value)\n    {\n        this.padding = Math.abs(value) * 2;\n        this.strength = value;\n    }\n\n    /**\n     * Sets the quality of the blur by modifying the number of passes. More passes means higher\n     * quaility bluring but the lower the performance.\n     *\n     * @member {number}\n     * @memberof PIXI.filters.BlurXFilter#\n     * @default 4\n     */\n    get quality()\n    {\n        return this._quality;\n    }\n\n    /**\n     * Sets the quality of the blur.\n     *\n     * @param {number} value - The value to set.\n     */\n    set quality(value)\n    {\n        this._quality = value;\n        this.passes = value;\n    }\n}\n","const GAUSSIAN_VALUES = {\n    5: [0.153388, 0.221461, 0.250301],\n    7: [0.071303, 0.131514, 0.189879, 0.214607],\n    9: [0.028532, 0.067234, 0.124009, 0.179044, 0.20236],\n    11: [0.0093, 0.028002, 0.065984, 0.121703, 0.175713, 0.198596],\n    13: [0.002406, 0.009255, 0.027867, 0.065666, 0.121117, 0.174868, 0.197641],\n    15: [0.000489, 0.002403, 0.009246, 0.02784, 0.065602, 0.120999, 0.174697, 0.197448],\n};\n\nconst fragTemplate = [\n    'varying vec2 vBlurTexCoords[%size%];',\n    'uniform sampler2D uSampler;',\n\n    'void main(void)',\n    '{',\n    '    gl_FragColor = vec4(0.0);',\n    '    %blur%',\n    '}',\n\n].join('\\n');\n\nexport default function generateFragBlurSource(kernelSize)\n{\n    const kernel = GAUSSIAN_VALUES[kernelSize];\n    const halfLength = kernel.length;\n\n    let fragSource = fragTemplate;\n\n    let blurLoop = '';\n    const template = 'gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;';\n    let value;\n\n    for (let i = 0; i < kernelSize; i++)\n    {\n        let blur = template.replace('%index%', i);\n\n        value = i;\n\n        if (i >= halfLength)\n        {\n            value = kernelSize - i - 1;\n        }\n\n        blur = blur.replace('%value%', kernel[value]);\n\n        blurLoop += blur;\n        blurLoop += '\\n';\n    }\n\n    fragSource = fragSource.replace('%blur%', blurLoop);\n    fragSource = fragSource.replace('%size%', kernelSize);\n\n    return fragSource;\n}\n","const vertTemplate = [\n    'attribute vec2 aVertexPosition;',\n    'attribute vec2 aTextureCoord;',\n\n    'uniform float strength;',\n    'uniform mat3 projectionMatrix;',\n\n    'varying vec2 vBlurTexCoords[%size%];',\n\n    'void main(void)',\n    '{',\n    'gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);',\n    '%blur%',\n    '}',\n].join('\\n');\n\nexport default function generateVertBlurSource(kernelSize, x)\n{\n    const halfLength = Math.ceil(kernelSize / 2);\n\n    let vertSource = vertTemplate;\n\n    let blurLoop = '';\n    let template;\n    // let value;\n\n    if (x)\n    {\n        template = 'vBlurTexCoords[%index%] = aTextureCoord + vec2(%sampleIndex% * strength, 0.0);';\n    }\n    else\n    {\n        template = 'vBlurTexCoords[%index%] = aTextureCoord + vec2(0.0, %sampleIndex% * strength);';\n    }\n\n    for (let i = 0; i < kernelSize; i++)\n    {\n        let blur = template.replace('%index%', i);\n\n        // value = i;\n\n        // if(i >= halfLength)\n        // {\n        //     value = kernelSize - i - 1;\n        // }\n\n        blur = blur.replace('%sampleIndex%', `${i - (halfLength - 1)}.0`);\n\n        blurLoop += blur;\n        blurLoop += '\\n';\n    }\n\n    vertSource = vertSource.replace('%blur%', blurLoop);\n    vertSource = vertSource.replace('%size%', kernelSize);\n\n    return vertSource;\n}\n","export default function getMaxKernelSize(gl)\n{\n    const maxVaryings = (gl.getParameter(gl.MAX_VARYING_VECTORS));\n    let kernelSize = 15;\n\n    while (kernelSize > maxVaryings)\n    {\n        kernelSize -= 2;\n    }\n\n    return kernelSize;\n}\n","import * as core from '../../core';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\n\n/**\n * The ColorMatrixFilter class lets you apply a 5x4 matrix transformation on the RGBA\n * color and alpha values of every pixel on your displayObject to produce a result\n * with a new set of RGBA color and alpha values. It's pretty powerful!\n *\n * ```js\n *  let colorMatrix = new PIXI.ColorMatrixFilter();\n *  container.filters = [colorMatrix];\n *  colorMatrix.contrast(2);\n * ```\n * @author Clément Chenebault \n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nexport default class ColorMatrixFilter extends core.Filter\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        super(\n            // vertex shader\n            readFileSync(join(__dirname, '../fragments/default.vert'), 'utf8'),\n            // fragment shader\n            readFileSync(join(__dirname, './colorMatrix.frag'), 'utf8')\n        );\n\n        this.uniforms.m = [\n            1, 0, 0, 0, 0,\n            0, 1, 0, 0, 0,\n            0, 0, 1, 0, 0,\n            0, 0, 0, 1, 0];\n    }\n\n    /**\n     * Transforms current matrix and set the new one\n     *\n     * @param {number[]} matrix - 5x4 matrix\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    _loadMatrix(matrix, multiply = false)\n    {\n        let newMatrix = matrix;\n\n        if (multiply)\n        {\n            this._multiply(newMatrix, this.uniforms.m, matrix);\n            newMatrix = this._colorMatrix(newMatrix);\n        }\n\n        // set the new matrix\n        this.uniforms.m = newMatrix;\n    }\n\n    /**\n     * Multiplies two mat5's\n     *\n     * @private\n     * @param {number[]} out - 5x4 matrix the receiving matrix\n     * @param {number[]} a - 5x4 matrix the first operand\n     * @param {number[]} b - 5x4 matrix the second operand\n     * @returns {number[]} 5x4 matrix\n     */\n    _multiply(out, a, b)\n    {\n        // Red Channel\n        out[0] = (a[0] * b[0]) + (a[1] * b[5]) + (a[2] * b[10]) + (a[3] * b[15]);\n        out[1] = (a[0] * b[1]) + (a[1] * b[6]) + (a[2] * b[11]) + (a[3] * b[16]);\n        out[2] = (a[0] * b[2]) + (a[1] * b[7]) + (a[2] * b[12]) + (a[3] * b[17]);\n        out[3] = (a[0] * b[3]) + (a[1] * b[8]) + (a[2] * b[13]) + (a[3] * b[18]);\n        out[4] = (a[0] * b[4]) + (a[1] * b[9]) + (a[2] * b[14]) + (a[3] * b[19]);\n\n        // Green Channel\n        out[5] = (a[5] * b[0]) + (a[6] * b[5]) + (a[7] * b[10]) + (a[8] * b[15]);\n        out[6] = (a[5] * b[1]) + (a[6] * b[6]) + (a[7] * b[11]) + (a[8] * b[16]);\n        out[7] = (a[5] * b[2]) + (a[6] * b[7]) + (a[7] * b[12]) + (a[8] * b[17]);\n        out[8] = (a[5] * b[3]) + (a[6] * b[8]) + (a[7] * b[13]) + (a[8] * b[18]);\n        out[9] = (a[5] * b[4]) + (a[6] * b[9]) + (a[7] * b[14]) + (a[8] * b[19]);\n\n        // Blue Channel\n        out[10] = (a[10] * b[0]) + (a[11] * b[5]) + (a[12] * b[10]) + (a[13] * b[15]);\n        out[11] = (a[10] * b[1]) + (a[11] * b[6]) + (a[12] * b[11]) + (a[13] * b[16]);\n        out[12] = (a[10] * b[2]) + (a[11] * b[7]) + (a[12] * b[12]) + (a[13] * b[17]);\n        out[13] = (a[10] * b[3]) + (a[11] * b[8]) + (a[12] * b[13]) + (a[13] * b[18]);\n        out[14] = (a[10] * b[4]) + (a[11] * b[9]) + (a[12] * b[14]) + (a[13] * b[19]);\n\n        // Alpha Channel\n        out[15] = (a[15] * b[0]) + (a[16] * b[5]) + (a[17] * b[10]) + (a[18] * b[15]);\n        out[16] = (a[15] * b[1]) + (a[16] * b[6]) + (a[17] * b[11]) + (a[18] * b[16]);\n        out[17] = (a[15] * b[2]) + (a[16] * b[7]) + (a[17] * b[12]) + (a[18] * b[17]);\n        out[18] = (a[15] * b[3]) + (a[16] * b[8]) + (a[17] * b[13]) + (a[18] * b[18]);\n        out[19] = (a[15] * b[4]) + (a[16] * b[9]) + (a[17] * b[14]) + (a[18] * b[19]);\n\n        return out;\n    }\n\n    /**\n     * Create a Float32 Array and normalize the offset component to 0-1\n     *\n     * @private\n     * @param {number[]} matrix - 5x4 matrix\n     * @return {number[]} 5x4 matrix with all values between 0-1\n     */\n    _colorMatrix(matrix)\n    {\n        // Create a Float32 Array and normalize the offset component to 0-1\n        const m = new Float32Array(matrix);\n\n        m[4] /= 255;\n        m[9] /= 255;\n        m[14] /= 255;\n        m[19] /= 255;\n\n        return m;\n    }\n\n    /**\n     * Adjusts brightness\n     *\n     * @param {number} b - value of the brigthness (0-1, where 0 is black)\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    brightness(b, multiply)\n    {\n        const matrix = [\n            b, 0, 0, 0, 0,\n            0, b, 0, 0, 0,\n            0, 0, b, 0, 0,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Set the matrices in grey scales\n     *\n     * @param {number} scale - value of the grey (0-1, where 0 is black)\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    greyscale(scale, multiply)\n    {\n        const matrix = [\n            scale, scale, scale, 0, 0,\n            scale, scale, scale, 0, 0,\n            scale, scale, scale, 0, 0,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Set the black and white matrice.\n     *\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    blackAndWhite(multiply)\n    {\n        const matrix = [\n            0.3, 0.6, 0.1, 0, 0,\n            0.3, 0.6, 0.1, 0, 0,\n            0.3, 0.6, 0.1, 0, 0,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Set the hue property of the color\n     *\n     * @param {number} rotation - in degrees\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    hue(rotation, multiply)\n    {\n        rotation = (rotation || 0) / 180 * Math.PI;\n\n        const cosR = Math.cos(rotation);\n        const sinR = Math.sin(rotation);\n        const sqrt = Math.sqrt;\n\n        /* a good approximation for hue rotation\n         This matrix is far better than the versions with magic luminance constants\n         formerly used here, but also used in the starling framework (flash) and known from this\n         old part of the internet: quasimondo.com/archives/000565.php\n\n         This new matrix is based on rgb cube rotation in space. Look here for a more descriptive\n         implementation as a shader not a general matrix:\n         https://github.com/evanw/glfx.js/blob/58841c23919bd59787effc0333a4897b43835412/src/filters/adjust/huesaturation.js\n\n         This is the source for the code:\n         see http://stackoverflow.com/questions/8507885/shift-hue-of-an-rgb-color/8510751#8510751\n         */\n\n        const w = 1 / 3;\n        const sqrW = sqrt(w); // weight is\n\n        const a00 = cosR + ((1.0 - cosR) * w);\n        const a01 = (w * (1.0 - cosR)) - (sqrW * sinR);\n        const a02 = (w * (1.0 - cosR)) + (sqrW * sinR);\n\n        const a10 = (w * (1.0 - cosR)) + (sqrW * sinR);\n        const a11 = cosR + (w * (1.0 - cosR));\n        const a12 = (w * (1.0 - cosR)) - (sqrW * sinR);\n\n        const a20 = (w * (1.0 - cosR)) - (sqrW * sinR);\n        const a21 = (w * (1.0 - cosR)) + (sqrW * sinR);\n        const a22 = cosR + (w * (1.0 - cosR));\n\n        const matrix = [\n            a00, a01, a02, 0, 0,\n            a10, a11, a12, 0, 0,\n            a20, a21, a22, 0, 0,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Set the contrast matrix, increase the separation between dark and bright\n     * Increase contrast : shadows darker and highlights brighter\n     * Decrease contrast : bring the shadows up and the highlights down\n     *\n     * @param {number} amount - value of the contrast (0-1)\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    contrast(amount, multiply)\n    {\n        const v = (amount || 0) + 1;\n        const o = -128 * (v - 1);\n\n        const matrix = [\n            v, 0, 0, 0, o,\n            0, v, 0, 0, o,\n            0, 0, v, 0, o,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Set the saturation matrix, increase the separation between colors\n     * Increase saturation : increase contrast, brightness, and sharpness\n     *\n     * @param {number} amount - The saturation amount (0-1)\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    saturate(amount = 0, multiply)\n    {\n        const x = (amount * 2 / 3) + 1;\n        const y = ((x - 1) * -0.5);\n\n        const matrix = [\n            x, y, y, 0, 0,\n            y, x, y, 0, 0,\n            y, y, x, 0, 0,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Desaturate image (remove color)\n     *\n     * Call the saturate function\n     *\n     */\n    desaturate() // eslint-disable-line no-unused-vars\n    {\n        this.saturate(-1);\n    }\n\n    /**\n     * Negative image (inverse of classic rgb matrix)\n     *\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    negative(multiply)\n    {\n        const matrix = [\n            0, 1, 1, 0, 0,\n            1, 0, 1, 0, 0,\n            1, 1, 0, 0, 0,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Sepia image\n     *\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    sepia(multiply)\n    {\n        const matrix = [\n            0.393, 0.7689999, 0.18899999, 0, 0,\n            0.349, 0.6859999, 0.16799999, 0, 0,\n            0.272, 0.5339999, 0.13099999, 0, 0,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Color motion picture process invented in 1916 (thanks Dominic Szablewski)\n     *\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    technicolor(multiply)\n    {\n        const matrix = [\n            1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337,\n            -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398,\n            -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Polaroid filter\n     *\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    polaroid(multiply)\n    {\n        const matrix = [\n            1.438, -0.062, -0.062, 0, 0,\n            -0.122, 1.378, -0.122, 0, 0,\n            -0.016, -0.016, 1.483, 0, 0,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Filter who transforms : Red -> Blue and Blue -> Red\n     *\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    toBGR(multiply)\n    {\n        const matrix = [\n            0, 0, 1, 0, 0,\n            0, 1, 0, 0, 0,\n            1, 0, 0, 0, 0,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Color reversal film introduced by Eastman Kodak in 1935. (thanks Dominic Szablewski)\n     *\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    kodachrome(multiply)\n    {\n        const matrix = [\n            1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,\n            -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,\n            -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Brown delicious browni filter (thanks Dominic Szablewski)\n     *\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    browni(multiply)\n    {\n        const matrix = [\n            0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873,\n            -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127,\n            0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Vintage filter (thanks Dominic Szablewski)\n     *\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    vintage(multiply)\n    {\n        const matrix = [\n            0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123,\n            0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591,\n            0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * We don't know exactly what it does, kind of gradient map, but funny to play with!\n     *\n     * @param {number} desaturation - Tone values.\n     * @param {number} toned - Tone values.\n     * @param {string} lightColor - Tone values, example: `0xFFE580`\n     * @param {string} darkColor - Tone values, example: `0xFFE580`\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    colorTone(desaturation, toned, lightColor, darkColor, multiply)\n    {\n        desaturation = desaturation || 0.2;\n        toned = toned || 0.15;\n        lightColor = lightColor || 0xFFE580;\n        darkColor = darkColor || 0x338000;\n\n        const lR = ((lightColor >> 16) & 0xFF) / 255;\n        const lG = ((lightColor >> 8) & 0xFF) / 255;\n        const lB = (lightColor & 0xFF) / 255;\n\n        const dR = ((darkColor >> 16) & 0xFF) / 255;\n        const dG = ((darkColor >> 8) & 0xFF) / 255;\n        const dB = (darkColor & 0xFF) / 255;\n\n        const matrix = [\n            0.3, 0.59, 0.11, 0, 0,\n            lR, lG, lB, desaturation, 0,\n            dR, dG, dB, toned, 0,\n            lR - dR, lG - dG, lB - dB, 0, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Night effect\n     *\n     * @param {number} intensity - The intensity of the night effect.\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    night(intensity, multiply)\n    {\n        intensity = intensity || 0.1;\n        const matrix = [\n            intensity * (-2.0), -intensity, 0, 0, 0,\n            -intensity, 0, intensity, 0, 0,\n            0, intensity, intensity * 2.0, 0, 0,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Predator effect\n     *\n     * Erase the current matrix by setting a new indepent one\n     *\n     * @param {number} amount - how much the predator feels his future victim\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    predator(amount, multiply)\n    {\n        const matrix = [\n            // row 1\n            11.224130630493164 * amount,\n            -4.794486999511719 * amount,\n            -2.8746118545532227 * amount,\n            0 * amount,\n            0.40342438220977783 * amount,\n            // row 2\n            -3.6330697536468506 * amount,\n            9.193157196044922 * amount,\n            -2.951810836791992 * amount,\n            0 * amount,\n            -1.316135048866272 * amount,\n            // row 3\n            -3.2184197902679443 * amount,\n            -4.2375030517578125 * amount,\n            7.476448059082031 * amount,\n            0 * amount,\n            0.8044459223747253 * amount,\n            // row 4\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * LSD effect\n     *\n     * Multiply the current matrix\n     *\n     * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n     *  just set the current matrix with @param matrix\n     */\n    lsd(multiply)\n    {\n        const matrix = [\n            2, -0.4, 0.5, 0, 0,\n            -0.5, 2, -0.4, 0, 0,\n            -0.4, -0.5, 3, 0, 0,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, multiply);\n    }\n\n    /**\n     * Erase the current matrix by setting the default one\n     *\n     */\n    reset()\n    {\n        const matrix = [\n            1, 0, 0, 0, 0,\n            0, 1, 0, 0, 0,\n            0, 0, 1, 0, 0,\n            0, 0, 0, 1, 0,\n        ];\n\n        this._loadMatrix(matrix, false);\n    }\n\n    /**\n     * The matrix of the color matrix filter\n     *\n     * @member {number[]}\n     * @memberof PIXI.filters.ColorMatrixFilter#\n     * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]\n     */\n    get matrix()\n    {\n        return this.uniforms.m;\n    }\n\n    /**\n     * Sets the matrix directly.\n     *\n     * @param {number[]} value - the value to set to.\n     */\n    set matrix(value)\n    {\n        this.uniforms.m = value;\n    }\n}\n\n// Americanized alias\nColorMatrixFilter.prototype.grayscale = ColorMatrixFilter.prototype.greyscale;\n","import * as core from '../../core';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\n\n/**\n * The DisplacementFilter class uses the pixel values from the specified texture\n * (called the displacement map) to perform a displacement of an object. You can\n * use this filter to apply all manor of crazy warping effects. Currently the r\n * property of the texture is used to offset the x and the g property of the texture\n * is used to offset the y.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nexport default class DisplacementFilter extends core.Filter\n{\n    /**\n     * @param {PIXI.Sprite} sprite - The sprite used for the displacement map. (make sure its added to the scene!)\n     * @param {number} scale - The scale of the displacement\n     */\n    constructor(sprite, scale)\n    {\n        const maskMatrix = new core.Matrix();\n\n        sprite.renderable = false;\n\n        super(\n            // vertex shader\n            readFileSync(join(__dirname, '../fragments/default-filter-matrix.vert'), 'utf8'),\n            // fragment shader\n            readFileSync(join(__dirname, './displacement.frag'), 'utf8')\n        );\n\n        this.maskSprite = sprite;\n        this.maskMatrix = maskMatrix;\n\n        this.uniforms.mapSampler = sprite.texture;\n        this.uniforms.filterMatrix = maskMatrix.toArray(true);\n        this.uniforms.scale = { x: 1, y: 1 };\n\n        if (scale === null || scale === undefined)\n        {\n            scale = 20;\n        }\n\n        this.scale = new core.Point(scale, scale);\n    }\n\n    /**\n     * Applies the filter.\n     *\n     * @param {PIXI.FilterManager} filterManager - The manager.\n     * @param {PIXI.RenderTarget} input - The input target.\n     * @param {PIXI.RenderTarget} output - The output target.\n     */\n    apply(filterManager, input, output)\n    {\n        const ratio =  (1 / output.destinationFrame.width) * (output.size.width / input.size.width);\n\n        this.uniforms.filterMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, this.maskSprite);\n        this.uniforms.scale.x = this.scale.x * ratio;\n        this.uniforms.scale.y = this.scale.y * ratio;\n\n         // draw the filter...\n        filterManager.applyFilter(this, input, output);\n    }\n\n    /**\n     * The texture used for the displacement map. Must be power of 2 sized texture.\n     *\n     * @member {PIXI.Texture}\n     * @memberof PIXI.filters.DisplacementFilter#\n     */\n    get map()\n    {\n        return this.uniforms.mapSampler;\n    }\n\n    /**\n     * Sets the texture to use for the displacement.\n     *\n     * @param {PIXI.Texture} value - The texture to set to.\n     */\n    set map(value)\n    {\n        this.uniforms.mapSampler = value;\n    }\n}\n","import * as core from '../../core';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\n\n/**\n *\n * Basic FXAA implementation based on the code on geeks3d.com with the\n * modification that the texture2DLod stuff was removed since it's\n * unsupported by WebGL.\n *\n * @see https://github.com/mitsuhiko/webgl-meincraft\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n *\n */\nexport default class FXAAFilter extends core.Filter\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        // TODO - needs work\n        super(\n            // vertex shader\n            readFileSync(join(__dirname, './fxaa.vert'), 'utf8'),\n            // fragment shader\n            readFileSync(join(__dirname, './fxaa.frag'), 'utf8')\n        );\n    }\n}\n","/**\n * @namespace PIXI.filters\n */\nexport { default as FXAAFilter } from './fxaa/FXAAFilter';\nexport { default as NoiseFilter } from './noise/NoiseFilter';\nexport { default as DisplacementFilter } from './displacement/DisplacementFilter';\nexport { default as BlurFilter } from './blur/BlurFilter';\nexport { default as BlurXFilter } from './blur/BlurXFilter';\nexport { default as BlurYFilter } from './blur/BlurYFilter';\nexport { default as ColorMatrixFilter } from './colormatrix/ColorMatrixFilter';\nexport { default as VoidFilter } from './void/VoidFilter';\n","import * as core from '../../core';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\n\n/**\n * @author Vico @vicocotea\n * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js\n */\n\n/**\n * A Noise effect filter.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nexport default class NoiseFilter extends core.Filter\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        super(\n            // vertex shader\n            readFileSync(join(__dirname, '../fragments/default.vert'), 'utf8'),\n            // fragment shader\n            readFileSync(join(__dirname, './noise.frag'), 'utf8')\n        );\n\n        this.noise = 0.5;\n    }\n\n    /**\n     * The amount of noise to apply.\n     *\n     * @member {number}\n     * @memberof PIXI.filters.NoiseFilter#\n     * @default 0.5\n     */\n    get noise()\n    {\n        return this.uniforms.noise;\n    }\n\n    /**\n     * Sets the amount of noise to apply.\n     *\n     * @param {number} value - The value to set to.\n     */\n    set noise(value)\n    {\n        this.uniforms.noise = value;\n    }\n}\n","import * as core from '../../core';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\n\n/**\n * Does nothing. Very handy.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nexport default class VoidFilter extends core.Filter\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        super(\n            // vertex shader\n            readFileSync(join(__dirname, '../fragments/default.vert'), 'utf8'),\n            // fragment shader\n            readFileSync(join(__dirname, './void.frag'), 'utf8')\n        );\n\n        this.glShaderKey = 'void';\n    }\n}\n","import * as core from '../core';\n\n/**\n * Holds all information related to an Interaction event\n *\n * @class\n * @memberof PIXI.interaction\n */\nexport default class InteractionData\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        /**\n         * This point stores the global coords of where the touch/mouse event happened\n         *\n         * @member {PIXI.Point}\n         */\n        this.global = new core.Point();\n\n        /**\n         * The target Sprite that was interacted with\n         *\n         * @member {PIXI.Sprite}\n         */\n        this.target = null;\n\n        /**\n         * When passed to an event handler, this will be the original DOM Event that was captured\n         *\n         * @member {Event}\n         */\n        this.originalEvent = null;\n    }\n\n    /**\n     * This will return the local coordinates of the specified displayObject for this InteractionData\n     *\n     * @param {PIXI.DisplayObject} displayObject - The DisplayObject that you would like the local\n     *  coords off\n     * @param {PIXI.Point} [point] - A Point object in which to store the value, optional (otherwise\n     *  will create a new point)\n     * @param {PIXI.Point} [globalPos] - A Point object containing your custom global coords, optional\n     *  (otherwise will use the current global coords)\n     * @return {PIXI.Point} A point containing the coordinates of the InteractionData position relative\n     *  to the DisplayObject\n     */\n    getLocalPosition(displayObject, point, globalPos)\n    {\n        return displayObject.worldTransform.applyInverse(globalPos || this.global, point);\n    }\n}\n","/**\n * Event class that mimics native DOM events.\n *\n * @class\n * @memberof PIXI.interaction\n */\nexport default class InteractionEvent\n{\n    /**\n     *\n     */\n    constructor()\n    {\n        /**\n         * Whether this event will continue propagating in the tree\n         *\n         * @member {boolean}\n         */\n        this.stopped = false;\n\n        /**\n         * The object which caused this event to be dispatched.\n         * For listener callback see {@link PIXI.interaction.InteractionEvent.currentTarget}.\n         *\n         * @member {PIXI.DisplayObject}\n         */\n        this.target = null;\n\n        /**\n         * The object whose event listener’s callback is currently being invoked.\n         *\n         * @member {PIXI.DisplayObject}\n         */\n        this.currentTarget = null;\n\n        /*\n         * Type of the event\n         *\n         * @member {string}\n         */\n        this.type = null;\n\n        /*\n         * InteractionData related to this event\n         *\n         * @member {PIXI.interaction.InteractionData}\n         */\n        this.data = null;\n    }\n\n    /**\n     * Prevents event from reaching any objects other than the current object.\n     *\n     */\n    stopPropagation()\n    {\n        this.stopped = true;\n    }\n\n    /**\n     * Prevents event from reaching any objects other than the current object.\n     *\n     * @private\n     */\n    _reset()\n    {\n        this.stopped = false;\n        this.currentTarget = null;\n        this.target = null;\n    }\n}\n","import * as core from '../core';\nimport InteractionData from './InteractionData';\nimport InteractionEvent from './InteractionEvent';\nimport EventEmitter from 'eventemitter3';\nimport interactiveTarget from './interactiveTarget';\nimport MobileDevice from 'ismobilejs';\n\n// Mix interactiveTarget into core.DisplayObject.prototype\nObject.assign(\n    core.DisplayObject.prototype,\n    interactiveTarget\n);\n\n/**\n * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive\n * if its interactive parameter is set to true\n * This manager also supports multitouch.\n *\n * @class\n * @extends EventEmitter\n * @memberof PIXI.interaction\n */\nexport default class InteractionManager extends EventEmitter\n{\n    /**\n     * @param {PIXI.CanvasRenderer|PIXI.WebGLRenderer} renderer - A reference to the current renderer\n     * @param {object} [options] - The options for the manager.\n     * @param {boolean} [options.autoPreventDefault=true] - Should the manager automatically prevent default browser actions.\n     * @param {number} [options.interactionFrequency=10] - Frequency increases the interaction events will be checked.\n     */\n    constructor(renderer, options)\n    {\n        super();\n\n        options = options || {};\n\n        /**\n         * The renderer this interaction manager works for.\n         *\n         * @member {PIXI.SystemRenderer}\n         */\n        this.renderer = renderer;\n\n        /**\n         * Should default browser actions automatically be prevented.\n         * Does not apply to pointer events for backwards compatibility\n         * preventDefault on pointer events stops mouse events from firing\n         * Thus, for every pointer event, there will always be either a mouse of touch event alongside it.\n         *\n         * @member {boolean}\n         * @default true\n         */\n        this.autoPreventDefault = options.autoPreventDefault !== undefined ? options.autoPreventDefault : true;\n\n        /**\n         * As this frequency increases the interaction events will be checked more often.\n         *\n         * @member {number}\n         * @default 10\n         */\n        this.interactionFrequency = options.interactionFrequency || 10;\n\n        /**\n         * The mouse data\n         *\n         * @member {PIXI.interaction.InteractionData}\n         */\n        this.mouse = new InteractionData();\n\n        // setting the mouse to start off far off screen will mean that mouse over does\n        //  not get called before we even move the mouse.\n        this.mouse.global.set(-999999);\n\n        /**\n         * The pointer data\n         *\n         * @member {PIXI.interaction.InteractionData}\n         */\n        this.pointer = new InteractionData();\n\n        // setting the pointer to start off far off screen will mean that pointer over does\n        //  not get called before we even move the pointer.\n        this.pointer.global.set(-999999);\n\n        /**\n         * An event data object to handle all the event tracking/dispatching\n         *\n         * @member {object}\n         */\n        this.eventData = new InteractionEvent();\n\n        /**\n         * Tiny little interactiveData pool !\n         *\n         * @member {PIXI.interaction.InteractionData[]}\n         */\n        this.interactiveDataPool = [];\n\n        /**\n         * The DOM element to bind to.\n         *\n         * @private\n         * @member {HTMLElement}\n         */\n        this.interactionDOMElement = null;\n\n        /**\n         * This property determines if mousemove and touchmove events are fired only when the cursror\n         * is over the object.\n         * Setting to true will make things work more in line with how the DOM verison works.\n         * Setting to false can make things easier for things like dragging\n         * It is currently set to false as this is how pixi used to work. This will be set to true in\n         * future versions of pixi.\n         *\n         * @member {boolean} moveWhenInside\n         * @memberof PIXI.interaction.InteractionManager#\n         * @default false\n         */\n        this.moveWhenInside = false;\n\n        /**\n         * Have events been attached to the dom element?\n         *\n         * @private\n         * @member {boolean}\n         */\n        this.eventsAdded = false;\n\n        /**\n         * Is the mouse hovering over the renderer?\n         *\n         * @private\n         * @member {boolean}\n         */\n        this.mouseOverRenderer = false;\n\n        /**\n         * Does the device support touch events\n         * https://www.w3.org/TR/touch-events/\n         *\n         * @readonly\n         * @member {boolean}\n         */\n        this.supportsTouchEvents = 'ontouchstart' in window;\n\n        /**\n         * Does the device support pointer events\n         * https://www.w3.org/Submission/pointer-events/\n         *\n         * @readonly\n         * @member {boolean}\n         */\n        this.supportsPointerEvents = !!window.PointerEvent;\n\n        /**\n         * Are touch events being 'normalized' and converted into pointer events if pointer events are not supported\n         * For example, on a touch screen mobile device, a touchstart would also be emitted as a pointerdown\n         *\n         * @private\n         * @readonly\n         * @member {boolean}\n         */\n        this.normalizeTouchEvents = !this.supportsPointerEvents && this.supportsTouchEvents;\n\n        /**\n         * Are mouse events being 'normalized' and converted into pointer events if pointer events are not supported\n         * For example, on a desktop pc, a mousedown would also be emitted as a pointerdown\n         *\n         * @private\n         * @readonly\n         * @member {boolean}\n         */\n        this.normalizeMouseEvents = !this.supportsPointerEvents && !MobileDevice.any;\n\n        // this will make it so that you don't have to call bind all the time\n\n        /**\n         * @private\n         * @member {Function}\n         */\n        this.onMouseUp = this.onMouseUp.bind(this);\n        this.processMouseUp = this.processMouseUp.bind(this);\n\n        /**\n         * @private\n         * @member {Function}\n         */\n        this.onMouseDown = this.onMouseDown.bind(this);\n        this.processMouseDown = this.processMouseDown.bind(this);\n\n        /**\n         * @private\n         * @member {Function}\n         */\n        this.onMouseMove = this.onMouseMove.bind(this);\n        this.processMouseMove = this.processMouseMove.bind(this);\n\n        /**\n         * @private\n         * @member {Function}\n         */\n        this.onMouseOut = this.onMouseOut.bind(this);\n        this.processMouseOverOut = this.processMouseOverOut.bind(this);\n\n        /**\n        * @private\n        * @member {Function}\n        */\n        this.onMouseOver = this.onMouseOver.bind(this);\n\n        /**\n         * @private\n         * @member {Function}\n         */\n        this.onPointerUp = this.onPointerUp.bind(this);\n        this.processPointerUp = this.processPointerUp.bind(this);\n\n        /**\n         * @private\n         * @member {Function}\n         */\n        this.onPointerDown = this.onPointerDown.bind(this);\n        this.processPointerDown = this.processPointerDown.bind(this);\n\n        /**\n         * @private\n         * @member {Function}\n         */\n        this.onPointerMove = this.onPointerMove.bind(this);\n        this.processPointerMove = this.processPointerMove.bind(this);\n\n        /**\n         * @private\n         * @member {Function}\n         */\n        this.onPointerOut = this.onPointerOut.bind(this);\n        this.processPointerOverOut = this.processPointerOverOut.bind(this);\n\n        /**\n         * @private\n         * @member {Function}\n         */\n        this.onPointerOver = this.onPointerOver.bind(this);\n\n        /**\n         * @private\n         * @member {Function}\n         */\n        this.onTouchStart = this.onTouchStart.bind(this);\n        this.processTouchStart = this.processTouchStart.bind(this);\n\n        /**\n         * @private\n         * @member {Function}\n         */\n        this.onTouchEnd = this.onTouchEnd.bind(this);\n        this.processTouchEnd = this.processTouchEnd.bind(this);\n\n        /**\n         * @private\n         * @member {Function}\n         */\n        this.onTouchMove = this.onTouchMove.bind(this);\n        this.processTouchMove = this.processTouchMove.bind(this);\n\n        /**\n         * Every update cursor will be reset to this value, if some element wont override it in\n         * its hitTest.\n         *\n         * @member {string}\n         * @default 'inherit'\n         */\n        this.defaultCursorStyle = 'inherit';\n\n        /**\n         * The css style of the cursor that is being used.\n         *\n         * @member {string}\n         */\n        this.currentCursorStyle = 'inherit';\n\n        /**\n         * Internal cached let.\n         *\n         * @private\n         * @member {PIXI.Point}\n         */\n        this._tempPoint = new core.Point();\n\n        /**\n         * The current resolution / device pixel ratio.\n         *\n         * @member {number}\n         * @default 1\n         */\n        this.resolution = 1;\n\n        this.setTargetElement(this.renderer.view, this.renderer.resolution);\n\n        /**\n         * Fired when a pointer device button (usually a mouse button) is pressed on the display\n         * object.\n         *\n         * @event mousedown\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n         * on the display object.\n         *\n         * @event rightdown\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device button (usually a mouse button) is released over the display\n         * object.\n         *\n         * @event mouseup\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device secondary button (usually a mouse right-button) is released\n         * over the display object.\n         *\n         * @event rightup\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device button (usually a mouse button) is pressed and released on\n         * the display object.\n         *\n         * @event click\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n         * and released on the display object.\n         *\n         * @event rightclick\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device button (usually a mouse button) is released outside the\n         * display object that initially registered a\n         * [mousedown]{@link PIXI.interaction.InteractionManager#event:mousedown}.\n         *\n         * @event mouseupoutside\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device secondary button (usually a mouse right-button) is released\n         * outside the display object that initially registered a\n         * [rightdown]{@link PIXI.interaction.InteractionManager#event:rightdown}.\n         *\n         * @event rightupoutside\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device (usually a mouse) is moved while over the display object\n         *\n         * @event mousemove\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device (usually a mouse) is moved onto the display object\n         *\n         * @event mouseover\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device (usually a mouse) is moved off the display object\n         *\n         * @event mouseout\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device button is pressed on the display object.\n         *\n         * @event pointerdown\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device button is released over the display object.\n         *\n         * @event pointerup\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device button is pressed and released on the display object.\n         *\n         * @event pointertap\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device button is released outside the display object that initially\n         * registered a [pointerdown]{@link PIXI.interaction.InteractionManager#event:pointerdown}.\n         *\n         * @event pointerupoutside\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device is moved while over the display object\n         *\n         * @event pointermove\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device is moved onto the display object\n         *\n         * @event pointerover\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a pointer device is moved off the display object\n         *\n         * @event pointerout\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a touch point is placed on the display object.\n         *\n         * @event touchstart\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a touch point is removed from the display object.\n         *\n         * @event touchend\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a touch point is placed and removed from the display object.\n         *\n         * @event tap\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a touch point is removed outside of the display object that initially\n         * registered a [touchstart]{@link PIXI.interaction.InteractionManager#event:touchstart}.\n         *\n         * @event touchendoutside\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n\n        /**\n         * Fired when a touch point is moved along the display object.\n         *\n         * @event touchmove\n         * @memberof PIXI.interaction.InteractionManager#\n         */\n    }\n\n    /**\n     * Sets the DOM element which will receive mouse/touch events. This is useful for when you have\n     * other DOM elements on top of the renderers Canvas element. With this you'll be bale to deletegate\n     * another DOM element to receive those events.\n     *\n     * @param {HTMLCanvasElement} element - the DOM element which will receive mouse and touch events.\n     * @param {number} [resolution=1] - The resolution / device pixel ratio of the new element (relative to the canvas).\n     * @private\n     */\n    setTargetElement(element, resolution = 1)\n    {\n        this.removeEvents();\n\n        this.interactionDOMElement = element;\n\n        this.resolution = resolution;\n\n        this.addEvents();\n    }\n\n    /**\n     * Registers all the DOM events\n     *\n     * @private\n     */\n    addEvents()\n    {\n        if (!this.interactionDOMElement)\n        {\n            return;\n        }\n\n        core.ticker.shared.add(this.update, this);\n\n        if (window.navigator.msPointerEnabled)\n        {\n            this.interactionDOMElement.style['-ms-content-zooming'] = 'none';\n            this.interactionDOMElement.style['-ms-touch-action'] = 'none';\n        }\n        else if (this.supportsPointerEvents)\n        {\n            this.interactionDOMElement.style['touch-action'] = 'none';\n        }\n\n        /**\n         * These events are added first, so that if pointer events are normalised, they are fired\n         * in the same order as non-normalised events. ie. pointer event 1st, mouse / touch 2nd\n         */\n        if (this.supportsPointerEvents)\n        {\n            window.document.addEventListener('pointermove', this.onPointerMove, true);\n            this.interactionDOMElement.addEventListener('pointerdown', this.onPointerDown, true);\n            this.interactionDOMElement.addEventListener('pointerout', this.onPointerOut, true);\n            this.interactionDOMElement.addEventListener('pointerover', this.onPointerOver, true);\n            window.addEventListener('pointerup', this.onPointerUp, true);\n        }\n        else\n        {\n            /**\n             * If pointer events aren't available on a device, this will turn either the touch or\n             * mouse events into pointer events. This allows a developer to just listen for emitted\n             * pointer events on interactive sprites\n             */\n            if (this.normalizeTouchEvents)\n            {\n                this.interactionDOMElement.addEventListener('touchstart', this.onPointerDown, true);\n                this.interactionDOMElement.addEventListener('touchend', this.onPointerUp, true);\n                this.interactionDOMElement.addEventListener('touchmove', this.onPointerMove, true);\n            }\n\n            if (this.normalizeMouseEvents)\n            {\n                window.document.addEventListener('mousemove', this.onPointerMove, true);\n                this.interactionDOMElement.addEventListener('mousedown', this.onPointerDown, true);\n                this.interactionDOMElement.addEventListener('mouseout', this.onPointerOut, true);\n                this.interactionDOMElement.addEventListener('mouseover', this.onPointerOver, true);\n                window.addEventListener('mouseup', this.onPointerUp, true);\n            }\n        }\n\n        window.document.addEventListener('mousemove', this.onMouseMove, true);\n        this.interactionDOMElement.addEventListener('mousedown', this.onMouseDown, true);\n        this.interactionDOMElement.addEventListener('mouseout', this.onMouseOut, true);\n        this.interactionDOMElement.addEventListener('mouseover', this.onMouseOver, true);\n        window.addEventListener('mouseup', this.onMouseUp, true);\n\n        if (this.supportsTouchEvents)\n        {\n            this.interactionDOMElement.addEventListener('touchstart', this.onTouchStart, true);\n            this.interactionDOMElement.addEventListener('touchend', this.onTouchEnd, true);\n            this.interactionDOMElement.addEventListener('touchmove', this.onTouchMove, true);\n        }\n\n        this.eventsAdded = true;\n    }\n\n    /**\n     * Removes all the DOM events that were previously registered\n     *\n     * @private\n     */\n    removeEvents()\n    {\n        if (!this.interactionDOMElement)\n        {\n            return;\n        }\n\n        core.ticker.shared.remove(this.update, this);\n\n        if (window.navigator.msPointerEnabled)\n        {\n            this.interactionDOMElement.style['-ms-content-zooming'] = '';\n            this.interactionDOMElement.style['-ms-touch-action'] = '';\n        }\n        else if (this.supportsPointerEvents)\n        {\n            this.interactionDOMElement.style['touch-action'] = '';\n        }\n\n        if (this.supportsPointerEvents)\n        {\n            window.document.removeEventListener('pointermove', this.onPointerMove, true);\n            this.interactionDOMElement.removeEventListener('pointerdown', this.onPointerDown, true);\n            this.interactionDOMElement.removeEventListener('pointerout', this.onPointerOut, true);\n            this.interactionDOMElement.removeEventListener('pointerover', this.onPointerOver, true);\n            window.removeEventListener('pointerup', this.onPointerUp, true);\n        }\n        else\n        {\n            /**\n             * If pointer events aren't available on a device, this will turn either the touch or\n             * mouse events into pointer events. This allows a developer to just listen for emitted\n             * pointer events on interactive sprites\n             */\n            if (this.normalizeTouchEvents)\n            {\n                this.interactionDOMElement.removeEventListener('touchstart', this.onPointerDown, true);\n                this.interactionDOMElement.removeEventListener('touchend', this.onPointerUp, true);\n                this.interactionDOMElement.removeEventListener('touchmove', this.onPointerMove, true);\n            }\n\n            if (this.normalizeMouseEvents)\n            {\n                window.document.removeEventListener('mousemove', this.onPointerMove, true);\n                this.interactionDOMElement.removeEventListener('mousedown', this.onPointerDown, true);\n                this.interactionDOMElement.removeEventListener('mouseout', this.onPointerOut, true);\n                this.interactionDOMElement.removeEventListener('mouseover', this.onPointerOver, true);\n                window.removeEventListener('mouseup', this.onPointerUp, true);\n            }\n        }\n\n        window.document.removeEventListener('mousemove', this.onMouseMove, true);\n        this.interactionDOMElement.removeEventListener('mousedown', this.onMouseDown, true);\n        this.interactionDOMElement.removeEventListener('mouseout', this.onMouseOut, true);\n        this.interactionDOMElement.removeEventListener('mouseover', this.onMouseOver, true);\n        window.removeEventListener('mouseup', this.onMouseUp, true);\n\n        if (this.supportsTouchEvents)\n        {\n            this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true);\n            this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true);\n            this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true);\n        }\n\n        this.interactionDOMElement = null;\n\n        this.eventsAdded = false;\n    }\n\n    /**\n     * Updates the state of interactive objects.\n     * Invoked by a throttled ticker update from {@link PIXI.ticker.shared}.\n     *\n     * @param {number} deltaTime - time delta since last tick\n     */\n    update(deltaTime)\n    {\n        this._deltaTime += deltaTime;\n\n        if (this._deltaTime < this.interactionFrequency)\n        {\n            return;\n        }\n\n        this._deltaTime = 0;\n\n        if (!this.interactionDOMElement)\n        {\n            return;\n        }\n\n        // if the user move the mouse this check has already been dfone using the mouse move!\n        if (this.didMove)\n        {\n            this.didMove = false;\n\n            return;\n        }\n\n        this.cursor = this.defaultCursorStyle;\n\n        // Resets the flag as set by a stopPropagation call. This flag is usually reset by a user interaction of any kind,\n        // but there was a scenario of a display object moving under a static mouse cursor.\n        // In this case, mouseover and mouseevents would not pass the flag test in dispatchEvent function\n        this.eventData._reset();\n\n        this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseOverOut, true);\n\n        if (this.currentCursorStyle !== this.cursor)\n        {\n            this.currentCursorStyle = this.cursor;\n            this.interactionDOMElement.style.cursor = this.cursor;\n        }\n\n        // TODO\n    }\n\n    /**\n     * Dispatches an event on the display object that was interacted with\n     *\n     * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - the display object in question\n     * @param {string} eventString - the name of the event (e.g, mousedown)\n     * @param {object} eventData - the event data object\n     * @private\n     */\n    dispatchEvent(displayObject, eventString, eventData)\n    {\n        if (!eventData.stopped)\n        {\n            eventData.currentTarget = displayObject;\n            eventData.type = eventString;\n\n            displayObject.emit(eventString, eventData);\n\n            if (displayObject[eventString])\n            {\n                displayObject[eventString](eventData);\n            }\n        }\n    }\n\n    /**\n     * Maps x and y coords from a DOM object and maps them correctly to the pixi view. The\n     * resulting value is stored in the point. This takes into account the fact that the DOM\n     * element could be scaled and positioned anywhere on the screen.\n     *\n     * @param  {PIXI.Point} point - the point that the result will be stored in\n     * @param  {number} x - the x coord of the position to map\n     * @param  {number} y - the y coord of the position to map\n     */\n    mapPositionToPoint(point, x, y)\n    {\n        let rect;\n\n        // IE 11 fix\n        if (!this.interactionDOMElement.parentElement)\n        {\n            rect = { x: 0, y: 0, width: 0, height: 0 };\n        }\n        else\n        {\n            rect = this.interactionDOMElement.getBoundingClientRect();\n        }\n\n        const resolutionMultiplier = navigator.isCocoonJS ? this.resolution : (1.0 / this.resolution);\n\n        point.x = ((x - rect.left) * (this.interactionDOMElement.width / rect.width)) * resolutionMultiplier;\n        point.y = ((y - rect.top) * (this.interactionDOMElement.height / rect.height)) * resolutionMultiplier;\n    }\n\n    /**\n     * This function is provides a neat way of crawling through the scene graph and running a\n     * specified function on all interactive objects it finds. It will also take care of hit\n     * testing the interactive objects and passes the hit across in the function.\n     *\n     * @param {PIXI.Point} point - the point that is tested for collision\n     * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - the displayObject\n     *  that will be hit test (recursively crawls its children)\n     * @param {Function} [func] - the function that will be called on each interactive object. The\n     *  displayObject and hit will be passed to the function\n     * @param {boolean} [hitTest] - this indicates if the objects inside should be hit test against the point\n     * @param {boolean} [interactive] - Whether the displayObject is interactive\n     * @return {boolean} returns true if the displayObject hit the point\n     */\n    processInteractive(point, displayObject, func, hitTest, interactive)\n    {\n        if (!displayObject || !displayObject.visible)\n        {\n            return false;\n        }\n\n        // Took a little while to rework this function correctly! But now it is done and nice and optimised. ^_^\n        //\n        // This function will now loop through all objects and then only hit test the objects it HAS\n        // to, not all of them. MUCH faster..\n        // An object will be hit test if the following is true:\n        //\n        // 1: It is interactive.\n        // 2: It belongs to a parent that is interactive AND one of the parents children have not already been hit.\n        //\n        // As another little optimisation once an interactive object has been hit we can carry on\n        // through the scenegraph, but we know that there will be no more hits! So we can avoid extra hit tests\n        // A final optimisation is that an object is not hit test directly if a child has already been hit.\n\n        interactive = displayObject.interactive || interactive;\n\n        let hit = false;\n        let interactiveParent = interactive;\n\n        // if the displayobject has a hitArea, then it does not need to hitTest children.\n        if (displayObject.hitArea)\n        {\n            interactiveParent = false;\n        }\n\n        // it has a mask! Then lets hit test that before continuing..\n        if (hitTest && displayObject._mask)\n        {\n            if (!displayObject._mask.containsPoint(point))\n            {\n                hitTest = false;\n            }\n        }\n\n        // it has a filterArea! Same as mask but easier, its a rectangle\n        if (hitTest && displayObject.filterArea)\n        {\n            if (!displayObject.filterArea.contains(point.x, point.y))\n            {\n                hitTest = false;\n            }\n        }\n\n        // ** FREE TIP **! If an object is not interactive or has no buttons in it\n        // (such as a game scene!) set interactiveChildren to false for that displayObject.\n        // This will allow pixi to completely ignore and bypass checking the displayObjects children.\n        if (displayObject.interactiveChildren && displayObject.children)\n        {\n            const children = displayObject.children;\n\n            for (let i = children.length - 1; i >= 0; i--)\n            {\n                const child = children[i];\n\n                // time to get recursive.. if this function will return if something is hit..\n                if (this.processInteractive(point, child, func, hitTest, interactiveParent))\n                {\n                    // its a good idea to check if a child has lost its parent.\n                    // this means it has been removed whilst looping so its best\n                    if (!child.parent)\n                    {\n                        continue;\n                    }\n\n                    hit = true;\n\n                    // we no longer need to hit test any more objects in this container as we we\n                    // now know the parent has been hit\n                    interactiveParent = false;\n\n                    // If the child is interactive , that means that the object hit was actually\n                    // interactive and not just the child of an interactive object.\n                    // This means we no longer need to hit test anything else. We still need to run\n                    // through all objects, but we don't need to perform any hit tests.\n\n                    // {\n                    hitTest = false;\n                    // }\n\n                    // we can break now as we have hit an object.\n                }\n            }\n        }\n\n        // no point running this if the item is not interactive or does not have an interactive parent.\n        if (interactive)\n        {\n            // if we are hit testing (as in we have no hit any objects yet)\n            // We also don't need to worry about hit testing if once of the displayObjects children\n            // has already been hit!\n            if (hitTest && !hit)\n            {\n                if (displayObject.hitArea)\n                {\n                    displayObject.worldTransform.applyInverse(point, this._tempPoint);\n                    hit = displayObject.hitArea.contains(this._tempPoint.x, this._tempPoint.y);\n                }\n                else if (displayObject.containsPoint)\n                {\n                    hit = displayObject.containsPoint(point);\n                }\n            }\n\n            if (displayObject.interactive)\n            {\n                if (hit && !this.eventData.target)\n                {\n                    this.eventData.target = displayObject;\n                    this.mouse.target = displayObject;\n                    this.pointer.target = displayObject;\n                }\n\n                func(displayObject, hit);\n            }\n        }\n\n        return hit;\n    }\n\n    /**\n     * Is called when the mouse button is pressed down on the renderer element\n     *\n     * @private\n     * @param {MouseEvent} event - The DOM event of a mouse button being pressed down\n     */\n    onMouseDown(event)\n    {\n        this.mouse.originalEvent = event;\n        this.eventData.data = this.mouse;\n        this.eventData._reset();\n\n        // Update internal mouse reference\n        this.mapPositionToPoint(this.mouse.global, event.clientX, event.clientY);\n\n        if (this.autoPreventDefault)\n        {\n            this.mouse.originalEvent.preventDefault();\n        }\n\n        this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseDown, true);\n\n        const isRightButton = event.button === 2 || event.which === 3;\n\n        this.emit(isRightButton ? 'rightdown' : 'mousedown', this.eventData);\n    }\n\n    /**\n     * Processes the result of the mouse down check and dispatches the event if need be\n     *\n     * @private\n     * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n     * @param {boolean} hit - the result of the hit test on the display object\n     */\n    processMouseDown(displayObject, hit)\n    {\n        const e = this.mouse.originalEvent;\n\n        const isRightButton = e.button === 2 || e.which === 3;\n\n        if (hit)\n        {\n            displayObject[isRightButton ? '_isRightDown' : '_isLeftDown'] = true;\n            this.dispatchEvent(displayObject, isRightButton ? 'rightdown' : 'mousedown', this.eventData);\n        }\n    }\n\n    /**\n     * Is called when the mouse button is released on the renderer element\n     *\n     * @private\n     * @param {MouseEvent} event - The DOM event of a mouse button being released\n     */\n    onMouseUp(event)\n    {\n        this.mouse.originalEvent = event;\n        this.eventData.data = this.mouse;\n        this.eventData._reset();\n\n        // Update internal mouse reference\n        this.mapPositionToPoint(this.mouse.global, event.clientX, event.clientY);\n\n        this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseUp, true);\n\n        const isRightButton = event.button === 2 || event.which === 3;\n\n        this.emit(isRightButton ? 'rightup' : 'mouseup', this.eventData);\n    }\n\n    /**\n     * Processes the result of the mouse up check and dispatches the event if need be\n     *\n     * @private\n     * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n     * @param {boolean} hit - the result of the hit test on the display object\n     */\n    processMouseUp(displayObject, hit)\n    {\n        const e = this.mouse.originalEvent;\n\n        const isRightButton = e.button === 2 || e.which === 3;\n        const isDown = isRightButton ? '_isRightDown' : '_isLeftDown';\n\n        if (hit)\n        {\n            this.dispatchEvent(displayObject, isRightButton ? 'rightup' : 'mouseup', this.eventData);\n\n            if (displayObject[isDown])\n            {\n                displayObject[isDown] = false;\n                this.dispatchEvent(displayObject, isRightButton ? 'rightclick' : 'click', this.eventData);\n            }\n        }\n        else if (displayObject[isDown])\n        {\n            displayObject[isDown] = false;\n            this.dispatchEvent(displayObject, isRightButton ? 'rightupoutside' : 'mouseupoutside', this.eventData);\n        }\n    }\n\n    /**\n     * Is called when the mouse moves across the renderer element\n     *\n     * @private\n     * @param {MouseEvent} event - The DOM event of the mouse moving\n     */\n    onMouseMove(event)\n    {\n        this.mouse.originalEvent = event;\n        this.eventData.data = this.mouse;\n        this.eventData._reset();\n\n        this.mapPositionToPoint(this.mouse.global, event.clientX, event.clientY);\n\n        this.didMove = true;\n\n        this.cursor = this.defaultCursorStyle;\n\n        this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseMove, true);\n\n        this.emit('mousemove', this.eventData);\n\n        if (this.currentCursorStyle !== this.cursor)\n        {\n            this.currentCursorStyle = this.cursor;\n            this.interactionDOMElement.style.cursor = this.cursor;\n        }\n\n        // TODO BUG for parents interactive object (border order issue)\n    }\n\n    /**\n     * Processes the result of the mouse move check and dispatches the event if need be\n     *\n     * @private\n     * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n     * @param {boolean} hit - the result of the hit test on the display object\n     */\n    processMouseMove(displayObject, hit)\n    {\n        this.processMouseOverOut(displayObject, hit);\n\n        // only display on mouse over\n        if (!this.moveWhenInside || hit)\n        {\n            this.dispatchEvent(displayObject, 'mousemove', this.eventData);\n        }\n    }\n\n    /**\n     * Is called when the mouse is moved out of the renderer element\n     *\n     * @private\n     * @param {MouseEvent} event - The DOM event of the mouse being moved out\n     */\n    onMouseOut(event)\n    {\n        this.mouseOverRenderer = false;\n\n        this.mouse.originalEvent = event;\n        this.eventData.data = this.mouse;\n        this.eventData._reset();\n\n        // Update internal mouse reference\n        this.mapPositionToPoint(this.mouse.global, event.clientX, event.clientY);\n\n        this.interactionDOMElement.style.cursor = this.defaultCursorStyle;\n\n        // TODO optimize by not check EVERY TIME! maybe half as often? //\n        this.mapPositionToPoint(this.mouse.global, event.clientX, event.clientY);\n\n        this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseOverOut, false);\n\n        this.emit('mouseout', this.eventData);\n    }\n\n    /**\n     * Processes the result of the mouse over/out check and dispatches the event if need be\n     *\n     * @private\n     * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n     * @param {boolean} hit - the result of the hit test on the display object\n     */\n    processMouseOverOut(displayObject, hit)\n    {\n        if (hit && this.mouseOverRenderer)\n        {\n            if (!displayObject._mouseOver)\n            {\n                displayObject._mouseOver = true;\n                this.dispatchEvent(displayObject, 'mouseover', this.eventData);\n            }\n\n            if (displayObject.buttonMode)\n            {\n                this.cursor = displayObject.defaultCursor;\n            }\n        }\n        else if (displayObject._mouseOver)\n        {\n            displayObject._mouseOver = false;\n            this.dispatchEvent(displayObject, 'mouseout', this.eventData);\n        }\n    }\n\n    /**\n     * Is called when the mouse enters the renderer element area\n     *\n     * @private\n     * @param {MouseEvent} event - The DOM event of the mouse moving into the renderer view\n     */\n    onMouseOver(event)\n    {\n        this.mouseOverRenderer = true;\n\n        this.mouse.originalEvent = event;\n        this.eventData.data = this.mouse;\n        this.eventData._reset();\n\n        this.emit('mouseover', this.eventData);\n    }\n\n    /**\n     * Is called when the pointer button is pressed down on the renderer element\n     *\n     * @private\n     * @param {PointerEvent} event - The DOM event of a pointer button being pressed down\n     */\n    onPointerDown(event)\n    {\n        this.normalizeToPointerData(event);\n        this.pointer.originalEvent = event;\n        this.eventData.data = this.pointer;\n        this.eventData._reset();\n\n        // Update internal pointer reference\n        this.mapPositionToPoint(this.pointer.global, event.clientX, event.clientY);\n\n        /**\n         * No need to prevent default on natural pointer events, as there are no side effects\n         * Normalized events, however, may have the double mousedown/touchstart issue on the native android browser,\n         * so still need to be prevented.\n         */\n        if (this.autoPreventDefault && (this.normalizeMouseEvents || this.normalizeTouchEvents))\n        {\n            this.pointer.originalEvent.preventDefault();\n        }\n\n        this.processInteractive(this.pointer.global, this.renderer._lastObjectRendered, this.processPointerDown, true);\n\n        this.emit('pointerdown', this.eventData);\n    }\n\n    /**\n     * Processes the result of the pointer down check and dispatches the event if need be\n     *\n     * @private\n     * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n     * @param {boolean} hit - the result of the hit test on the display object\n     */\n    processPointerDown(displayObject, hit)\n    {\n        if (hit)\n        {\n            displayObject._pointerDown = true;\n            this.dispatchEvent(displayObject, 'pointerdown', this.eventData);\n        }\n    }\n\n    /**\n     * Is called when the pointer button is released on the renderer element\n     *\n     * @private\n     * @param {PointerEvent} event - The DOM event of a pointer button being released\n     */\n    onPointerUp(event)\n    {\n        this.normalizeToPointerData(event);\n        this.pointer.originalEvent = event;\n        this.eventData.data = this.pointer;\n        this.eventData._reset();\n\n        // Update internal pointer reference\n        this.mapPositionToPoint(this.pointer.global, event.clientX, event.clientY);\n\n        this.processInteractive(this.pointer.global, this.renderer._lastObjectRendered, this.processPointerUp, true);\n\n        this.emit('pointerup', this.eventData);\n    }\n\n    /**\n     * Processes the result of the pointer up check and dispatches the event if need be\n     *\n     * @private\n     * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n     * @param {boolean} hit - the result of the hit test on the display object\n     */\n    processPointerUp(displayObject, hit)\n    {\n        if (hit)\n        {\n            this.dispatchEvent(displayObject, 'pointerup', this.eventData);\n\n            if (displayObject._pointerDown)\n            {\n                displayObject._pointerDown = false;\n                this.dispatchEvent(displayObject, 'pointertap', this.eventData);\n            }\n        }\n        else if (displayObject._pointerDown)\n        {\n            displayObject._pointerDown = false;\n            this.dispatchEvent(displayObject, 'pointerupoutside', this.eventData);\n        }\n    }\n\n    /**\n     * Is called when the pointer moves across the renderer element\n     *\n     * @private\n     * @param {PointerEvent} event - The DOM event of a pointer moving\n     */\n    onPointerMove(event)\n    {\n        this.normalizeToPointerData(event);\n        this.pointer.originalEvent = event;\n        this.eventData.data = this.pointer;\n        this.eventData._reset();\n\n        this.mapPositionToPoint(this.pointer.global, event.clientX, event.clientY);\n\n        this.processInteractive(this.pointer.global, this.renderer._lastObjectRendered, this.processPointerMove, true);\n\n        this.emit('pointermove', this.eventData);\n    }\n\n    /**\n     * Processes the result of the pointer move check and dispatches the event if need be\n     *\n     * @private\n     * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n     * @param {boolean} hit - the result of the hit test on the display object\n     */\n    processPointerMove(displayObject, hit)\n    {\n        if (!this.pointer.originalEvent.changedTouches)\n        {\n            this.processPointerOverOut(displayObject, hit);\n        }\n\n        if (!this.moveWhenInside || hit)\n        {\n            this.dispatchEvent(displayObject, 'pointermove', this.eventData);\n        }\n    }\n\n    /**\n     * Is called when the pointer is moved out of the renderer element\n     *\n     * @private\n     * @param {PointerEvent} event - The DOM event of a pointer being moved out\n     */\n    onPointerOut(event)\n    {\n        this.normalizeToPointerData(event);\n        this.pointer.originalEvent = event;\n        this.eventData.data = this.pointer;\n        this.eventData._reset();\n\n        // Update internal pointer reference\n        this.mapPositionToPoint(this.pointer.global, event.clientX, event.clientY);\n\n        this.processInteractive(this.pointer.global, this.renderer._lastObjectRendered, this.processPointerOverOut, false);\n\n        this.emit('pointerout', this.eventData);\n    }\n\n    /**\n     * Processes the result of the pointer over/out check and dispatches the event if need be\n     *\n     * @private\n     * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n     * @param {boolean} hit - the result of the hit test on the display object\n     */\n    processPointerOverOut(displayObject, hit)\n    {\n        if (hit && this.mouseOverRenderer)\n        {\n            if (!displayObject._pointerOver)\n            {\n                displayObject._pointerOver = true;\n                this.dispatchEvent(displayObject, 'pointerover', this.eventData);\n            }\n        }\n        else if (displayObject._pointerOver)\n        {\n            displayObject._pointerOver = false;\n            this.dispatchEvent(displayObject, 'pointerout', this.eventData);\n        }\n    }\n\n    /**\n     * Is called when the pointer is moved into the renderer element\n     *\n     * @private\n     * @param {PointerEvent} event - The DOM event of a pointer button being moved into the renderer view\n     */\n    onPointerOver(event)\n    {\n        this.pointer.originalEvent = event;\n        this.eventData.data = this.pointer;\n        this.eventData._reset();\n\n        this.emit('pointerover', this.eventData);\n    }\n\n    /**\n     * Is called when a touch is started on the renderer element\n     *\n     * @private\n     * @param {TouchEvent} event - The DOM event of a touch starting on the renderer view\n     */\n    onTouchStart(event)\n    {\n        if (this.autoPreventDefault)\n        {\n            event.preventDefault();\n        }\n\n        const changedTouches = event.changedTouches;\n        const cLength = changedTouches.length;\n\n        for (let i = 0; i < cLength; i++)\n        {\n            const touch = changedTouches[i];\n            const touchData = this.getTouchData(touch);\n\n            touchData.originalEvent = event;\n\n            this.eventData.data = touchData;\n            this.eventData._reset();\n\n            this.processInteractive(touchData.global, this.renderer._lastObjectRendered, this.processTouchStart, true);\n\n            this.emit('touchstart', this.eventData);\n\n            this.returnTouchData(touchData);\n        }\n    }\n\n    /**\n     * Processes the result of a touch check and dispatches the event if need be\n     *\n     * @private\n     * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n     * @param {boolean} hit - the result of the hit test on the display object\n     */\n    processTouchStart(displayObject, hit)\n    {\n        if (hit)\n        {\n            displayObject._touchDown = true;\n            this.dispatchEvent(displayObject, 'touchstart', this.eventData);\n        }\n    }\n\n    /**\n     * Is called when a touch ends on the renderer element\n     *\n     * @private\n     * @param {TouchEvent} event - The DOM event of a touch ending on the renderer view\n     */\n    onTouchEnd(event)\n    {\n        if (this.autoPreventDefault)\n        {\n            event.preventDefault();\n        }\n\n        const changedTouches = event.changedTouches;\n        const cLength = changedTouches.length;\n\n        for (let i = 0; i < cLength; i++)\n        {\n            const touchEvent = changedTouches[i];\n\n            const touchData = this.getTouchData(touchEvent);\n\n            touchData.originalEvent = event;\n\n            // TODO this should be passed along.. no set\n            this.eventData.data = touchData;\n            this.eventData._reset();\n\n            this.processInteractive(touchData.global, this.renderer._lastObjectRendered, this.processTouchEnd, true);\n\n            this.emit('touchend', this.eventData);\n\n            this.returnTouchData(touchData);\n        }\n    }\n\n    /**\n     * Processes the result of the end of a touch and dispatches the event if need be\n     *\n     * @private\n     * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n     * @param {boolean} hit - the result of the hit test on the display object\n     */\n    processTouchEnd(displayObject, hit)\n    {\n        if (hit)\n        {\n            this.dispatchEvent(displayObject, 'touchend', this.eventData);\n\n            if (displayObject._touchDown)\n            {\n                displayObject._touchDown = false;\n                this.dispatchEvent(displayObject, 'tap', this.eventData);\n            }\n        }\n        else if (displayObject._touchDown)\n        {\n            displayObject._touchDown = false;\n            this.dispatchEvent(displayObject, 'touchendoutside', this.eventData);\n        }\n    }\n\n    /**\n     * Is called when a touch is moved across the renderer element\n     *\n     * @private\n     * @param {TouchEvent} event - The DOM event of a touch moving accross the renderer view\n     */\n    onTouchMove(event)\n    {\n        if (this.autoPreventDefault)\n        {\n            event.preventDefault();\n        }\n\n        const changedTouches = event.changedTouches;\n        const cLength = changedTouches.length;\n\n        for (let i = 0; i < cLength; i++)\n        {\n            const touchEvent = changedTouches[i];\n\n            const touchData = this.getTouchData(touchEvent);\n\n            touchData.originalEvent = event;\n\n            this.eventData.data = touchData;\n            this.eventData._reset();\n\n            this.processInteractive(\n                touchData.global,\n                this.renderer._lastObjectRendered,\n                this.processTouchMove,\n                this.moveWhenInside\n            );\n\n            this.emit('touchmove', this.eventData);\n\n            this.returnTouchData(touchData);\n        }\n    }\n\n    /**\n     * Processes the result of a touch move check and dispatches the event if need be\n     *\n     * @private\n     * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n     * @param {boolean} hit - the result of the hit test on the display object\n     */\n    processTouchMove(displayObject, hit)\n    {\n        if (!this.moveWhenInside || hit)\n        {\n            this.dispatchEvent(displayObject, 'touchmove', this.eventData);\n        }\n    }\n\n    /**\n     * Grabs an interaction data object from the internal pool\n     *\n     * @private\n     * @param {Touch} touch - The touch data we need to pair with an interactionData object\n     * @return {PIXI.interaction.InteractionData} The built data object.\n     */\n    getTouchData(touch)\n    {\n        const touchData = this.interactiveDataPool.pop() || new InteractionData();\n\n        touchData.identifier = touch.identifier;\n        this.mapPositionToPoint(touchData.global, touch.clientX, touch.clientY);\n\n        if (navigator.isCocoonJS)\n        {\n            touchData.global.x = touchData.global.x / this.resolution;\n            touchData.global.y = touchData.global.y / this.resolution;\n        }\n\n        touch.globalX = touchData.global.x;\n        touch.globalY = touchData.global.y;\n\n        return touchData;\n    }\n\n    /**\n     * Returns an interaction data object to the internal pool\n     *\n     * @private\n     * @param {PIXI.interaction.InteractionData} touchData - The touch data object we want to return to the pool\n     */\n    returnTouchData(touchData)\n    {\n        this.interactiveDataPool.push(touchData);\n    }\n\n    /**\n     * Ensures that the original event object contains all data that a regular pointer event would have\n     *\n     * @private\n     * @param {TouchEvent|MouseEvent} event - The original event data from a touch or mouse event\n     */\n    normalizeToPointerData(event)\n    {\n        if (this.normalizeTouchEvents && event.changedTouches)\n        {\n            if (typeof event.button === 'undefined') event.button = event.touches.length ? 1 : 0;\n            if (typeof event.buttons === 'undefined') event.buttons = event.touches.length ? 1 : 0;\n            if (typeof event.isPrimary === 'undefined') event.isPrimary = event.touches.length === 1;\n            if (typeof event.width === 'undefined') event.width = event.changedTouches[0].radiusX || 1;\n            if (typeof event.height === 'undefined') event.height = event.changedTouches[0].radiusY || 1;\n            if (typeof event.tiltX === 'undefined') event.tiltX = 0;\n            if (typeof event.tiltY === 'undefined') event.tiltY = 0;\n            if (typeof event.pointerType === 'undefined') event.pointerType = 'touch';\n            if (typeof event.pointerId === 'undefined') event.pointerId = event.changedTouches[0].identifier || 0;\n            if (typeof event.pressure === 'undefined') event.pressure = event.changedTouches[0].force || 0.5;\n            if (typeof event.rotation === 'undefined') event.rotation = event.changedTouches[0].rotationAngle || 0;\n\n            if (typeof event.clientX === 'undefined') event.clientX = event.changedTouches[0].clientX;\n            if (typeof event.clientY === 'undefined') event.clientY = event.changedTouches[0].clientY;\n            if (typeof event.pageX === 'undefined') event.pageX = event.changedTouches[0].pageX;\n            if (typeof event.pageY === 'undefined') event.pageY = event.changedTouches[0].pageY;\n            if (typeof event.screenX === 'undefined') event.screenX = event.changedTouches[0].screenX;\n            if (typeof event.screenY === 'undefined') event.screenY = event.changedTouches[0].screenY;\n            if (typeof event.layerX === 'undefined') event.layerX = event.offsetX = event.clientX;\n            if (typeof event.layerY === 'undefined') event.layerY = event.offsetY = event.clientY;\n        }\n        else if (this.normalizeMouseEvents)\n        {\n            if (typeof event.isPrimary === 'undefined') event.isPrimary = true;\n            if (typeof event.width === 'undefined') event.width = 1;\n            if (typeof event.height === 'undefined') event.height = 1;\n            if (typeof event.tiltX === 'undefined') event.tiltX = 0;\n            if (typeof event.tiltY === 'undefined') event.tiltY = 0;\n            if (typeof event.pointerType === 'undefined') event.pointerType = 'mouse';\n            if (typeof event.pointerId === 'undefined') event.pointerId = 1;\n            if (typeof event.pressure === 'undefined') event.pressure = 0.5;\n            if (typeof event.rotation === 'undefined') event.rotation = 0;\n        }\n    }\n\n    /**\n     * Destroys the interaction manager\n     *\n     */\n    destroy()\n    {\n        this.removeEvents();\n\n        this.removeAllListeners();\n\n        this.renderer = null;\n\n        this.mouse = null;\n\n        this.eventData = null;\n\n        this.interactiveDataPool = null;\n\n        this.interactionDOMElement = null;\n\n        this.onMouseDown = null;\n        this.processMouseDown = null;\n\n        this.onMouseUp = null;\n        this.processMouseUp = null;\n\n        this.onMouseMove = null;\n        this.processMouseMove = null;\n\n        this.onMouseOut = null;\n        this.processMouseOverOut = null;\n\n        this.onMouseOver = null;\n\n        this.onPointerDown = null;\n        this.processPointerDown = null;\n\n        this.onPointerUp = null;\n        this.processPointerUp = null;\n\n        this.onPointerMove = null;\n        this.processPointerMove = null;\n\n        this.onPointerOut = null;\n        this.processPointerOverOut = null;\n\n        this.onPointerOver = null;\n\n        this.onTouchStart = null;\n        this.processTouchStart = null;\n\n        this.onTouchEnd = null;\n        this.processTouchEnd = null;\n\n        this.onTouchMove = null;\n        this.processTouchMove = null;\n\n        this._tempPoint = null;\n    }\n}\n\ncore.WebGLRenderer.registerPlugin('interaction', InteractionManager);\ncore.CanvasRenderer.registerPlugin('interaction', InteractionManager);\n","/**\n * @namespace PIXI.interaction\n */\nexport { default as InteractionData } from './InteractionData';\nexport { default as InteractionManager } from './InteractionManager';\nexport { default as interactiveTarget } from './interactiveTarget';\n","/**\n * Default property values of interactive objects\n * Used by {@link PIXI.interaction.InteractionManager} to automatically give all DisplayObjects these properties\n *\n * @mixin\n * @name interactiveTarget\n * @memberof PIXI.interaction\n * @example\n *      function MyObject() {}\n *\n *      Object.assign(\n *          MyObject.prototype,\n *          PIXI.interaction.interactiveTarget\n *      );\n */\nexport default {\n    /**\n     * Determines if the displayObject be clicked/touched\n     *\n     * @inner {boolean}\n     */\n    interactive: false,\n\n    /**\n     * Determines if the children to the displayObject can be clicked/touched\n     * Setting this to false allows pixi to bypass a recursive hitTest function\n     *\n     * @inner {boolean}\n     */\n    interactiveChildren: true,\n\n    /**\n     * Interaction shape. Children will be hit first, then this shape will be checked.\n     * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.\n     *\n     * @inner {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle}\n     */\n    hitArea: null,\n\n    /**\n     * If enabled, the mouse cursor will change when hovered over the displayObject if it is interactive\n     *\n     * @inner {boolean}\n     */\n    buttonMode: false,\n\n    /**\n     * If buttonMode is enabled, this defines what CSS cursor property is used when the mouse cursor\n     * is hovered over the displayObject\n     *\n     * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor\n     *\n     * @inner {string}\n     */\n    defaultCursor: 'pointer',\n\n    // some internal checks..\n    /**\n     * Internal check to detect if the mouse cursor is hovered over the displayObject\n     *\n     * @inner {boolean}\n     * @private\n     */\n    _over: false,\n\n    /**\n     * Internal check to detect if the left mouse button is pressed on the displayObject\n     *\n     * @inner {boolean}\n     * @private\n     */\n    _isLeftDown: false,\n\n    /**\n     * Internal check to detect if the right mouse button is pressed on the displayObject\n     *\n     * @inner {boolean}\n     * @private\n     */\n    _isRightDown: false,\n\n    /**\n     * Internal check to detect if the pointer cursor is hovered over the displayObject\n     *\n     * @inner {boolean}\n     * @private\n     */\n    _pointerOver: false,\n\n    /**\n     * Internal check to detect if the pointer is down on the displayObject\n     *\n     * @inner {boolean}\n     * @private\n     */\n    _pointerDown: false,\n\n    /**\n     * Internal check to detect if a user has touched the displayObject\n     *\n     * @inner {boolean}\n     * @private\n     */\n    _touchDown: false,\n};\n","import * as path from 'path';\nimport { Rectangle, Texture, utils } from '../core';\nimport { Resource } from 'resource-loader';\nimport { BitmapText } from '../extras';\n\nexport function parse(resource, texture)\n{\n    const data = {};\n    const info = resource.data.getElementsByTagName('info')[0];\n    const common = resource.data.getElementsByTagName('common')[0];\n\n    data.font = info.getAttribute('face');\n    data.size = parseInt(info.getAttribute('size'), 10);\n    data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10);\n    data.chars = {};\n\n    // parse letters\n    const letters = resource.data.getElementsByTagName('char');\n\n    for (let i = 0; i < letters.length; i++)\n    {\n        const charCode = parseInt(letters[i].getAttribute('id'), 10);\n\n        const textureRect = new Rectangle(\n            parseInt(letters[i].getAttribute('x'), 10) + texture.frame.x,\n            parseInt(letters[i].getAttribute('y'), 10) + texture.frame.y,\n            parseInt(letters[i].getAttribute('width'), 10),\n            parseInt(letters[i].getAttribute('height'), 10)\n        );\n\n        data.chars[charCode] = {\n            xOffset: parseInt(letters[i].getAttribute('xoffset'), 10),\n            yOffset: parseInt(letters[i].getAttribute('yoffset'), 10),\n            xAdvance: parseInt(letters[i].getAttribute('xadvance'), 10),\n            kerning: {},\n            texture: new Texture(texture.baseTexture, textureRect),\n\n        };\n    }\n\n    // parse kernings\n    const kernings = resource.data.getElementsByTagName('kerning');\n\n    for (let i = 0; i < kernings.length; i++)\n    {\n        const first = parseInt(kernings[i].getAttribute('first'), 10);\n        const second = parseInt(kernings[i].getAttribute('second'), 10);\n        const amount = parseInt(kernings[i].getAttribute('amount'), 10);\n\n        if (data.chars[second])\n        {\n            data.chars[second].kerning[first] = amount;\n        }\n    }\n\n    resource.bitmapFont = data;\n\n    // I'm leaving this as a temporary fix so we can test the bitmap fonts in v3\n    // but it's very likely to change\n    BitmapText.fonts[data.font] = data;\n}\n\nexport default function ()\n{\n    return function bitmapFontParser(resource, next)\n    {\n        // skip if no data or not xml data\n        if (!resource.data || !resource.isXml)\n        {\n            next();\n\n            return;\n        }\n\n        // skip if not bitmap font data, using some silly duck-typing\n        if (resource.data.getElementsByTagName('page').length === 0\n            || resource.data.getElementsByTagName('info').length === 0\n            || resource.data.getElementsByTagName('info')[0].getAttribute('face') === null\n        )\n        {\n            next();\n\n            return;\n        }\n\n        let xmlUrl = !resource.isDataUrl ? path.dirname(resource.url) : '';\n\n        if (resource.isDataUrl)\n        {\n            if (xmlUrl === '.')\n            {\n                xmlUrl = '';\n            }\n\n            if (this.baseUrl && xmlUrl)\n            {\n                // if baseurl has a trailing slash then add one to xmlUrl so the replace works below\n                if (this.baseUrl.charAt(this.baseUrl.length - 1) === '/')\n                {\n                    xmlUrl += '/';\n                }\n\n                // remove baseUrl from xmlUrl\n                xmlUrl = xmlUrl.replace(this.baseUrl, '');\n            }\n        }\n\n        // if there is an xmlUrl now, it needs a trailing slash. Ensure that it does if the string isn't empty.\n        if (xmlUrl && xmlUrl.charAt(xmlUrl.length - 1) !== '/')\n        {\n            xmlUrl += '/';\n        }\n\n        const textureUrl = xmlUrl + resource.data.getElementsByTagName('page')[0].getAttribute('file');\n\n        if (utils.TextureCache[textureUrl])\n        {\n            // reuse existing texture\n            parse(resource, utils.TextureCache[textureUrl]);\n            next();\n        }\n        else\n        {\n            const loadOptions = {\n                crossOrigin: resource.crossOrigin,\n                loadType: Resource.LOAD_TYPE.IMAGE,\n                metadata: resource.metadata.imageMetadata,\n            };\n\n            // load the texture for the font\n            this.add(`${resource.name}_image`, textureUrl, loadOptions, (res) =>\n            {\n                parse(resource, res.texture);\n                next();\n            });\n        }\n    };\n}\n","/**\n * @namespace PIXI.loaders\n */\nexport { default as Loader } from './loader';\nexport { default as bitmapFontParser, parse as parseBitmapFontData } from './bitmapFontParser';\nexport { default as spritesheetParser } from './spritesheetParser';\nexport { default as textureParser } from './textureParser';\nexport { Resource } from 'resource-loader';\n","import ResourceLoader from 'resource-loader';\nimport textureParser from './textureParser';\nimport spritesheetParser from './spritesheetParser';\nimport bitmapFontParser from './bitmapFontParser';\n\n/**\n *\n * The new loader, extends Resource Loader by Chad Engler : https://github.com/englercj/resource-loader\n *\n * ```js\n * let loader = PIXI.loader; // pixi exposes a premade instance for you to use.\n * //or\n * let loader = new PIXI.loaders.Loader(); // you can also create your own if you want\n *\n * loader.add('bunny', 'data/bunny.png');\n * loader.add('spaceship', 'assets/spritesheet.json');\n * loader.add('scoreFont', 'assets/score.fnt');\n *\n * loader.once('complete',onAssetsLoaded);\n *\n * loader.load();\n * ```\n *\n * @see https://github.com/englercj/resource-loader\n *\n * @class\n * @extends module:resource-loader.ResourceLoader\n * @memberof PIXI.loaders\n */\nexport default class Loader extends ResourceLoader\n{\n    /**\n     * @param {string} [baseUrl=''] - The base url for all resources loaded by this loader.\n     * @param {number} [concurrency=10] - The number of resources to load concurrently.\n     */\n    constructor(baseUrl, concurrency)\n    {\n        super(baseUrl, concurrency);\n\n        for (let i = 0; i < Loader._pixiMiddleware.length; ++i)\n        {\n            this.use(Loader._pixiMiddleware[i]());\n        }\n    }\n\n    /**\n     * Adds a default middleware to the pixi loader.\n     *\n     * @static\n     * @param {Function} fn - The middleware to add.\n     */\n    static addPixiMiddleware(fn)\n    {\n        Loader._pixiMiddleware.push(fn);\n    }\n}\n\nLoader._pixiMiddleware = [\n    // parse any blob into more usable objects (e.g. Image)\n    ResourceLoader.middleware.parsing.blob,\n    // parse any Image objects into textures\n    textureParser,\n    // parse any spritesheet data into multiple textures\n    spritesheetParser,\n    // parse bitmap font data into multiple textures\n    bitmapFontParser,\n];\n\n// Add custom extentions\nconst Resource = ResourceLoader.Resource;\n\nResource.setExtensionXhrType('fnt', Resource.XHR_RESPONSE_TYPE.DOCUMENT);\n","import { Resource } from 'resource-loader';\nimport path from 'path';\nimport * as core from '../core';\n\nconst BATCH_SIZE = 1000;\n\nexport default function ()\n{\n    return function spritesheetParser(resource, next)\n    {\n        let resourcePath;\n        const imageResourceName = `${resource.name}_image`;\n\n        // skip if no data, its not json, it isn't spritesheet data, or the image resource already exists\n        if (!resource.data || !resource.isJson || !resource.data.frames || this.resources[imageResourceName])\n        {\n            next();\n\n            return;\n        }\n\n        const loadOptions = {\n            crossOrigin: resource.crossOrigin,\n            loadType: Resource.LOAD_TYPE.IMAGE,\n            metadata: resource.metadata.imageMetadata,\n        };\n\n        // Prepend url path unless the resource image is a data url\n        if (resource.isDataUrl)\n        {\n            resourcePath = resource.data.meta.image;\n        }\n        else\n        {\n            resourcePath = `${path.dirname(resource.url.replace(this.baseUrl, ''))}/${resource.data.meta.image}`;\n        }\n\n        // load the image for this sheet\n        this.add(imageResourceName, resourcePath, loadOptions, function onImageLoad(res)\n        {\n            resource.textures = {};\n\n            const frames = resource.data.frames;\n            const frameKeys = Object.keys(frames);\n            const baseTexture = res.texture.baseTexture;\n            const scale = resource.data.meta.scale;\n\n            // Use a defaultValue of `null` to check if a url-based resolution is set\n            let resolution = core.utils.getResolutionOfUrl(resource.url, null);\n\n            // No resolution found via URL\n            if (resolution === null)\n            {\n                // Use the scale value or default to 1\n                resolution = scale !== undefined ? scale : 1;\n            }\n\n            // For non-1 resolutions, update baseTexture\n            if (resolution !== 1)\n            {\n                baseTexture.resolution = resolution;\n                baseTexture.update();\n            }\n\n            let batchIndex = 0;\n\n            function processFrames(initialFrameIndex, maxFrames)\n            {\n                let frameIndex = initialFrameIndex;\n\n                while (frameIndex - initialFrameIndex < maxFrames && frameIndex < frameKeys.length)\n                {\n                    const i = frameKeys[frameIndex];\n                    const rect = frames[i].frame;\n\n                    if (rect)\n                    {\n                        let frame = null;\n                        let trim = null;\n                        const orig = new core.Rectangle(\n                            0,\n                            0,\n                            frames[i].sourceSize.w / resolution,\n                            frames[i].sourceSize.h / resolution\n                        );\n\n                        if (frames[i].rotated)\n                        {\n                            frame = new core.Rectangle(\n                                rect.x / resolution,\n                                rect.y / resolution,\n                                rect.h / resolution,\n                                rect.w / resolution\n                            );\n                        }\n                        else\n                        {\n                            frame = new core.Rectangle(\n                                rect.x / resolution,\n                                rect.y / resolution,\n                                rect.w / resolution,\n                                rect.h / resolution\n                            );\n                        }\n\n                        //  Check to see if the sprite is trimmed\n                        if (frames[i].trimmed)\n                        {\n                            trim = new core.Rectangle(\n                                frames[i].spriteSourceSize.x / resolution,\n                                frames[i].spriteSourceSize.y / resolution,\n                                rect.w / resolution,\n                                rect.h / resolution\n                            );\n                        }\n\n                        resource.textures[i] = new core.Texture(\n                            baseTexture,\n                            frame,\n                            orig,\n                            trim,\n                            frames[i].rotated ? 2 : 0\n                        );\n\n                        // lets also add the frame to pixi's global cache for fromFrame and fromImage functions\n                        core.utils.TextureCache[i] = resource.textures[i];\n                    }\n\n                    frameIndex++;\n                }\n            }\n\n            function shouldProcessNextBatch()\n            {\n                return batchIndex * BATCH_SIZE < frameKeys.length;\n            }\n\n            function processNextBatch(done)\n            {\n                processFrames(batchIndex * BATCH_SIZE, BATCH_SIZE);\n                batchIndex++;\n                setTimeout(done, 0);\n            }\n\n            function iteration()\n            {\n                processNextBatch(() =>\n                {\n                    if (shouldProcessNextBatch())\n                    {\n                        iteration();\n                    }\n                    else\n                    {\n                        next();\n                    }\n                });\n            }\n\n            if (frameKeys.length <= BATCH_SIZE)\n            {\n                processFrames(0, BATCH_SIZE);\n                next();\n            }\n            else\n            {\n                iteration();\n            }\n        });\n    };\n}\n","import * as core from '../core';\n\nexport default function ()\n{\n    return function textureParser(resource, next)\n    {\n        // create a new texture if the data is an Image object\n        if (resource.data && resource.isImage)\n        {\n            const baseTexture = new core.BaseTexture(resource.data, null, core.utils.getResolutionOfUrl(resource.url));\n\n            baseTexture.imageUrl = resource.url;\n            resource.texture = new core.Texture(baseTexture);\n\n            // lets also add the frame to pixi's global cache for fromFrame and fromImage fucntions\n            core.utils.BaseTextureCache[resource.name] = baseTexture;\n            core.utils.TextureCache[resource.name] = resource.texture;\n\n            // also add references by url if they are different.\n            if (resource.name !== resource.url)\n            {\n                core.utils.BaseTextureCache[resource.url] = baseTexture;\n                core.utils.TextureCache[resource.url] = resource.texture;\n            }\n        }\n\n        next();\n    };\n}\n","import * as core from '../core';\n\nconst tempPoint = new core.Point();\nconst tempPolygon = new core.Polygon();\n\n/**\n * Base mesh class\n * @class\n * @extends PIXI.Container\n * @memberof PIXI.mesh\n */\nexport default class Mesh extends core.Container\n{\n    /**\n     * @param {PIXI.Texture} texture - The texture to use\n     * @param {Float32Array} [vertices] - if you want to specify the vertices\n     * @param {Float32Array} [uvs] - if you want to specify the uvs\n     * @param {Uint16Array} [indices] - if you want to specify the indices\n     * @param {number} [drawMode] - the drawMode, can be any of the Mesh.DRAW_MODES consts\n     */\n    constructor(texture, vertices, uvs, indices, drawMode)\n    {\n        super();\n\n        /**\n         * The texture of the Mesh\n         *\n         * @member {PIXI.Texture}\n         * @private\n         */\n        this._texture = null;\n\n        /**\n         * The Uvs of the Mesh\n         *\n         * @member {Float32Array}\n         */\n        this.uvs = uvs || new Float32Array([0, 0,\n            1, 0,\n            1, 1,\n            0, 1]);\n\n        /**\n         * An array of vertices\n         *\n         * @member {Float32Array}\n         */\n        this.vertices = vertices || new Float32Array([0, 0,\n            100, 0,\n            100, 100,\n            0, 100]);\n\n        /*\n         * @member {Uint16Array} An array containing the indices of the vertices\n         */\n        //  TODO auto generate this based on draw mode!\n        this.indices = indices || new Uint16Array([0, 1, 3, 2]);\n\n        /**\n         * Version of mesh uvs are dirty or not\n         *\n         * @member {number}\n         */\n        this.dirty = 0;\n\n        /**\n         * Version of mesh indices\n         *\n         * @member {number}\n         */\n        this.indexDirty = 0;\n\n        /**\n         * The blend mode to be applied to the sprite. Set to `PIXI.BLEND_MODES.NORMAL` to remove\n         * any blend mode.\n         *\n         * @member {number}\n         * @default PIXI.BLEND_MODES.NORMAL\n         * @see PIXI.BLEND_MODES\n         */\n        this.blendMode = core.BLEND_MODES.NORMAL;\n\n        /**\n         * Triangles in canvas mode are automatically antialiased, use this value to force triangles\n         * to overlap a bit with each other.\n         *\n         * @member {number}\n         */\n        this.canvasPadding = 0;\n\n        /**\n         * The way the Mesh should be drawn, can be any of the {@link PIXI.mesh.Mesh.DRAW_MODES} consts\n         *\n         * @member {number}\n         * @see PIXI.mesh.Mesh.DRAW_MODES\n         */\n        this.drawMode = drawMode || Mesh.DRAW_MODES.TRIANGLE_MESH;\n\n        // run texture setter;\n        this.texture = texture;\n\n        /**\n         * The default shader that is used if a mesh doesn't have a more specific one.\n         *\n         * @member {PIXI.Shader}\n         */\n        this.shader = null;\n\n        /**\n         * The tint applied to the mesh. This is a [r,g,b] value. A value of [1,1,1] will remove any\n         * tint effect.\n         *\n         * @member {number}\n         * @memberof PIXI.mesh.Mesh#\n         */\n        this.tintRgb = new Float32Array([1, 1, 1]);\n\n        /**\n         * A map of renderer IDs to webgl render data\n         *\n         * @private\n         * @member {object}\n         */\n        this._glDatas = {};\n\n        /**\n         * Plugin that is responsible for rendering this element.\n         * Allows to customize the rendering process without overriding '_renderWebGL' & '_renderCanvas' methods.\n         *\n         * @member {string}\n         * @default 'mesh'\n         */\n        this.pluginName = 'mesh';\n    }\n\n    /**\n     * Renders the object using the WebGL renderer\n     *\n     * @private\n     * @param {PIXI.WebGLRenderer} renderer - a reference to the WebGL renderer\n     */\n    _renderWebGL(renderer)\n    {\n        renderer.setObjectRenderer(renderer.plugins[this.pluginName]);\n        renderer.plugins[this.pluginName].render(this);\n    }\n\n    /**\n     * Renders the object using the Canvas renderer\n     *\n     * @private\n     * @param {PIXI.CanvasRenderer} renderer - The canvas renderer.\n     */\n    _renderCanvas(renderer)\n    {\n        renderer.plugins[this.pluginName].render(this);\n    }\n\n    /**\n     * When the texture is updated, this event will fire to update the scale and frame\n     *\n     * @private\n     */\n    _onTextureUpdate()\n    {\n        /* empty */\n    }\n\n    /**\n     * Returns the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account.\n     *\n     */\n    _calculateBounds()\n    {\n        // TODO - we can cache local bounds and use them if they are dirty (like graphics)\n        this._bounds.addVertices(this.transform, this.vertices, 0, this.vertices.length);\n    }\n\n    /**\n     * Tests if a point is inside this mesh. Works only for TRIANGLE_MESH\n     *\n     * @param {PIXI.Point} point - the point to test\n     * @return {boolean} the result of the test\n     */\n    containsPoint(point)\n    {\n        if (!this.getBounds().contains(point.x, point.y))\n        {\n            return false;\n        }\n\n        this.worldTransform.applyInverse(point, tempPoint);\n\n        const vertices = this.vertices;\n        const points = tempPolygon.points;\n        const indices = this.indices;\n        const len = this.indices.length;\n        const step = this.drawMode === Mesh.DRAW_MODES.TRIANGLES ? 3 : 1;\n\n        for (let i = 0; i + 2 < len; i += step)\n        {\n            const ind0 = indices[i] * 2;\n            const ind1 = indices[i + 1] * 2;\n            const ind2 = indices[i + 2] * 2;\n\n            points[0] = vertices[ind0];\n            points[1] = vertices[ind0 + 1];\n            points[2] = vertices[ind1];\n            points[3] = vertices[ind1 + 1];\n            points[4] = vertices[ind2];\n            points[5] = vertices[ind2 + 1];\n\n            if (tempPolygon.contains(tempPoint.x, tempPoint.y))\n            {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * The texture that the mesh uses.\n     *\n     * @member {PIXI.Texture}\n     * @memberof PIXI.mesh.Mesh#\n     */\n    get texture()\n    {\n        return this._texture;\n    }\n\n    /**\n     * Sets the texture the mesh uses.\n     *\n     * @param {Texture} value - The value to set.\n     */\n    set texture(value)\n    {\n        if (this._texture === value)\n        {\n            return;\n        }\n\n        this._texture = value;\n\n        if (value)\n        {\n            // wait for the texture to load\n            if (value.baseTexture.hasLoaded)\n            {\n                this._onTextureUpdate();\n            }\n            else\n            {\n                value.once('update', this._onTextureUpdate, this);\n            }\n        }\n    }\n\n    /**\n     * The tint applied to the mesh. This is a hex value. A value of 0xFFFFFF will remove any tint effect.\n     *\n     * @member {number}\n     * @memberof PIXI.mesh.Mesh#\n     * @default 0xFFFFFF\n     */\n    get tint()\n    {\n        return core.utils.rgb2hex(this.tintRgb);\n    }\n\n    /**\n     * Sets the tint the mesh uses.\n     *\n     * @param {number} value - The value to set.\n     */\n    set tint(value)\n    {\n        this.tintRgb = core.utils.hex2rgb(value, this.tintRgb);\n    }\n}\n\n/**\n * Different drawing buffer modes supported\n *\n * @static\n * @constant\n * @type {object}\n * @property {number} TRIANGLE_MESH\n * @property {number} TRIANGLES\n */\nMesh.DRAW_MODES = {\n    TRIANGLE_MESH: 0,\n    TRIANGLES: 1,\n};\n","import Plane from './Plane';\n\nconst DEFAULT_BORDER_SIZE = 10;\n\n/**\n * The NineSlicePlane allows you to stretch a texture using 9-slice scaling. The corners will remain unscaled (useful\n * for buttons with rounded corners for example) and the other areas will be scaled horizontally and or vertically\n *\n *```js\n * let Plane9 = new PIXI.NineSlicePlane(PIXI.Texture.fromImage('BoxWithRoundedCorners.png'), 15, 15, 15, 15);\n *  ```\n * 
\n *      A                          B\n *    +---+----------------------+---+\n *  C | 1 |          2           | 3 |\n *    +---+----------------------+---+\n *    |   |                      |   |\n *    | 4 |          5           | 6 |\n *    |   |                      |   |\n *    +---+----------------------+---+\n *  D | 7 |          8           | 9 |\n *    +---+----------------------+---+\n\n *  When changing this objects width and/or height:\n *     areas 1 3 7 and 9 will remain unscaled.\n *     areas 2 and 8 will be stretched horizontally\n *     areas 4 and 6 will be stretched vertically\n *     area 5 will be stretched both horizontally and vertically\n * 
\n *\n * @class\n * @extends PIXI.mesh.Plane\n * @memberof PIXI.mesh\n *\n */\nexport default class NineSlicePlane extends Plane\n{\n /**\n * @param {PIXI.Texture} texture - The texture to use on the NineSlicePlane.\n * @param {int} [leftWidth=10] size of the left vertical bar (A)\n * @param {int} [topHeight=10] size of the top horizontal bar (C)\n * @param {int} [rightWidth=10] size of the right vertical bar (B)\n * @param {int} [bottomHeight=10] size of the bottom horizontal bar (D)\n */\n constructor(texture, leftWidth, topHeight, rightWidth, bottomHeight)\n {\n super(texture, 4, 4);\n\n const uvs = this.uvs;\n\n // right and bottom uv's are always 1\n uvs[6] = uvs[14] = uvs[22] = uvs[30] = 1;\n uvs[25] = uvs[27] = uvs[29] = uvs[31] = 1;\n\n this._origWidth = texture.width;\n this._origHeight = texture.height;\n this._uvw = 1 / this._origWidth;\n this._uvh = 1 / this._origHeight;\n\n /**\n * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n this.width = texture.width;\n\n /**\n * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n this.height = texture.height;\n\n uvs[2] = uvs[10] = uvs[18] = uvs[26] = this._uvw * leftWidth;\n uvs[4] = uvs[12] = uvs[20] = uvs[28] = 1 - (this._uvw * rightWidth);\n uvs[9] = uvs[11] = uvs[13] = uvs[15] = this._uvh * topHeight;\n uvs[17] = uvs[19] = uvs[21] = uvs[23] = 1 - (this._uvh * bottomHeight);\n\n /**\n * The width of the left column (a)\n *\n * @member {number}\n */\n this.leftWidth = typeof leftWidth !== 'undefined' ? leftWidth : DEFAULT_BORDER_SIZE;\n\n /**\n * The width of the right column (b)\n *\n * @member {number}\n */\n this.rightWidth = typeof rightWidth !== 'undefined' ? rightWidth : DEFAULT_BORDER_SIZE;\n\n /**\n * The height of the top row (c)\n *\n * @member {number}\n */\n this.topHeight = typeof topHeight !== 'undefined' ? topHeight : DEFAULT_BORDER_SIZE;\n\n /**\n * The height of the bottom row (d)\n *\n * @member {number}\n */\n this.bottomHeight = typeof bottomHeight !== 'undefined' ? bottomHeight : DEFAULT_BORDER_SIZE;\n }\n\n /**\n * Updates the horizontal vertices.\n *\n */\n updateHorizontalVertices()\n {\n const vertices = this.vertices;\n\n vertices[9] = vertices[11] = vertices[13] = vertices[15] = this._topHeight;\n vertices[17] = vertices[19] = vertices[21] = vertices[23] = this._height - this._bottomHeight;\n vertices[25] = vertices[27] = vertices[29] = vertices[31] = this._height;\n }\n\n /**\n * Updates the vertical vertices.\n *\n */\n updateVerticalVertices()\n {\n const vertices = this.vertices;\n\n vertices[2] = vertices[10] = vertices[18] = vertices[26] = this._leftWidth;\n vertices[4] = vertices[12] = vertices[20] = vertices[28] = this._width - this._rightWidth;\n vertices[6] = vertices[14] = vertices[22] = vertices[30] = this._width;\n }\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer to render with.\n */\n _renderCanvas(renderer)\n {\n const context = renderer.context;\n\n context.globalAlpha = this.worldAlpha;\n\n const transform = this.worldTransform;\n const res = renderer.resolution;\n\n if (renderer.roundPixels)\n {\n context.setTransform(\n transform.a * res,\n transform.b * res,\n transform.c * res,\n transform.d * res,\n (transform.tx * res) | 0,\n (transform.ty * res) | 0\n );\n }\n else\n {\n context.setTransform(\n transform.a * res,\n transform.b * res,\n transform.c * res,\n transform.d * res,\n transform.tx * res,\n transform.ty * res\n );\n }\n\n const base = this._texture.baseTexture;\n const textureSource = base.source;\n const w = base.width;\n const h = base.height;\n\n this.drawSegment(context, textureSource, w, h, 0, 1, 10, 11);\n this.drawSegment(context, textureSource, w, h, 2, 3, 12, 13);\n this.drawSegment(context, textureSource, w, h, 4, 5, 14, 15);\n this.drawSegment(context, textureSource, w, h, 8, 9, 18, 19);\n this.drawSegment(context, textureSource, w, h, 10, 11, 20, 21);\n this.drawSegment(context, textureSource, w, h, 12, 13, 22, 23);\n this.drawSegment(context, textureSource, w, h, 16, 17, 26, 27);\n this.drawSegment(context, textureSource, w, h, 18, 19, 28, 29);\n this.drawSegment(context, textureSource, w, h, 20, 21, 30, 31);\n }\n\n /**\n * Renders one segment of the plane.\n * to mimic the exact drawing behavior of stretching the image like WebGL does, we need to make sure\n * that the source area is at least 1 pixel in size, otherwise nothing gets drawn when a slice size of 0 is used.\n *\n * @private\n * @param {CanvasRenderingContext2D} context - The context to draw with.\n * @param {CanvasImageSource} textureSource - The source to draw.\n * @param {number} w - width of the texture\n * @param {number} h - height of the texture\n * @param {number} x1 - x index 1\n * @param {number} y1 - y index 1\n * @param {number} x2 - x index 2\n * @param {number} y2 - y index 2\n */\n drawSegment(context, textureSource, w, h, x1, y1, x2, y2)\n {\n // otherwise you get weird results when using slices of that are 0 wide or high.\n const uvs = this.uvs;\n const vertices = this.vertices;\n\n let sw = (uvs[x2] - uvs[x1]) * w;\n let sh = (uvs[y2] - uvs[y1]) * h;\n let dw = vertices[x2] - vertices[x1];\n let dh = vertices[y2] - vertices[y1];\n\n // make sure the source is at least 1 pixel wide and high, otherwise nothing will be drawn.\n if (sw < 1)\n {\n sw = 1;\n }\n\n if (sh < 1)\n {\n sh = 1;\n }\n\n // make sure destination is at least 1 pixel wide and high, otherwise you get\n // lines when rendering close to original size.\n if (dw < 1)\n {\n dw = 1;\n }\n\n if (dh < 1)\n {\n dh = 1;\n }\n\n context.drawImage(textureSource, uvs[x1] * w, uvs[y1] * h, sw, sh, vertices[x1], vertices[y1], dw, dh);\n }\n\n /**\n * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n */\n get width()\n {\n return this._width;\n }\n\n /**\n * Sets the width.\n *\n * @param {number} value - the value to set to.\n */\n set width(value)\n {\n this._width = value;\n this.updateVerticalVertices();\n }\n\n /**\n * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n */\n get height()\n {\n return this._height;\n }\n\n /**\n * Sets the height.\n *\n * @param {number} value - the value to set to.\n */\n set height(value)\n {\n this._height = value;\n this.updateHorizontalVertices();\n }\n\n /**\n * The width of the left column\n *\n * @member {number}\n */\n get leftWidth()\n {\n return this._leftWidth;\n }\n\n /**\n * Sets the width of the left column.\n *\n * @param {number} value - the value to set to.\n */\n set leftWidth(value)\n {\n this._leftWidth = value;\n\n const uvs = this.uvs;\n const vertices = this.vertices;\n\n uvs[2] = uvs[10] = uvs[18] = uvs[26] = this._uvw * value;\n vertices[2] = vertices[10] = vertices[18] = vertices[26] = value;\n\n this.dirty = true;\n }\n\n /**\n * The width of the right column\n *\n * @member {number}\n */\n get rightWidth()\n {\n return this._rightWidth;\n }\n\n /**\n * Sets the width of the right column.\n *\n * @param {number} value - the value to set to.\n */\n set rightWidth(value)\n {\n this._rightWidth = value;\n\n const uvs = this.uvs;\n const vertices = this.vertices;\n\n uvs[4] = uvs[12] = uvs[20] = uvs[28] = 1 - (this._uvw * value);\n vertices[4] = vertices[12] = vertices[20] = vertices[28] = this._width - value;\n\n this.dirty = true;\n }\n\n /**\n * The height of the top row\n *\n * @member {number}\n */\n get topHeight()\n {\n return this._topHeight;\n }\n\n /**\n * Sets the height of the top row.\n *\n * @param {number} value - the value to set to.\n */\n set topHeight(value)\n {\n this._topHeight = value;\n\n const uvs = this.uvs;\n const vertices = this.vertices;\n\n uvs[9] = uvs[11] = uvs[13] = uvs[15] = this._uvh * value;\n vertices[9] = vertices[11] = vertices[13] = vertices[15] = value;\n\n this.dirty = true;\n }\n\n /**\n * The height of the bottom row\n *\n * @member {number}\n */\n get bottomHeight()\n {\n return this._bottomHeight;\n }\n\n /**\n * Sets the height of the bottom row.\n *\n * @param {number} value - the value to set to.\n */\n set bottomHeight(value)\n {\n this._bottomHeight = value;\n\n const uvs = this.uvs;\n const vertices = this.vertices;\n\n uvs[17] = uvs[19] = uvs[21] = uvs[23] = 1 - (this._uvh * value);\n vertices[17] = vertices[19] = vertices[21] = vertices[23] = this._height - value;\n\n this.dirty = true;\n }\n}\n","import Mesh from './Mesh';\n\n/**\n * The Plane allows you to draw a texture across several points and them manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let Plane = new PIXI.Plane(PIXI.Texture.fromImage(\"snake.png\"), points);\n * ```\n *\n * @class\n * @extends PIXI.mesh.Mesh\n * @memberof PIXI.mesh\n *\n */\nexport default class Plane extends Mesh\n{\n /**\n * @param {PIXI.Texture} texture - The texture to use on the Plane.\n * @param {number} verticesX - The number of vertices in the x-axis\n * @param {number} verticesY - The number of vertices in the y-axis\n */\n constructor(texture, verticesX, verticesY)\n {\n super(texture);\n\n /**\n * Tracker for if the Plane is ready to be drawn. Needed because Mesh ctor can\n * call _onTextureUpdated which could call refresh too early.\n *\n * @member {boolean}\n * @private\n */\n this._ready = true;\n\n this.verticesX = verticesX || 10;\n this.verticesY = verticesY || 10;\n\n this.drawMode = Mesh.DRAW_MODES.TRIANGLES;\n this.refresh();\n }\n\n /**\n * Refreshes\n *\n */\n refresh()\n {\n const total = this.verticesX * this.verticesY;\n const verts = [];\n const colors = [];\n const uvs = [];\n const indices = [];\n const texture = this.texture;\n\n const segmentsX = this.verticesX - 1;\n const segmentsY = this.verticesY - 1;\n\n const sizeX = texture.width / segmentsX;\n const sizeY = texture.height / segmentsY;\n\n for (let i = 0; i < total; i++)\n {\n if (texture._uvs)\n {\n const x = (i % this.verticesX);\n const y = ((i / this.verticesX) | 0);\n\n verts.push((x * sizeX),\n (y * sizeY));\n\n // this works for rectangular textures.\n uvs.push(\n texture._uvs.x0 + ((texture._uvs.x1 - texture._uvs.x0) * (x / (this.verticesX - 1))),\n texture._uvs.y0 + ((texture._uvs.y3 - texture._uvs.y0) * (y / (this.verticesY - 1)))\n );\n }\n else\n {\n uvs.push(0);\n }\n }\n\n // cons\n\n const totalSub = segmentsX * segmentsY;\n\n for (let i = 0; i < totalSub; i++)\n {\n const xpos = i % segmentsX;\n const ypos = (i / segmentsX) | 0;\n\n const value = (ypos * this.verticesX) + xpos;\n const value2 = (ypos * this.verticesX) + xpos + 1;\n const value3 = ((ypos + 1) * this.verticesX) + xpos;\n const value4 = ((ypos + 1) * this.verticesX) + xpos + 1;\n\n indices.push(value, value2, value3);\n indices.push(value2, value4, value3);\n }\n\n // console.log(indices)\n this.vertices = new Float32Array(verts);\n this.uvs = new Float32Array(uvs);\n this.colors = new Float32Array(colors);\n this.indices = new Uint16Array(indices);\n\n this.indexDirty = true;\n }\n\n /**\n * Clear texture UVs when new texture is set\n *\n * @private\n */\n _onTextureUpdate()\n {\n Mesh.prototype._onTextureUpdate.call(this);\n\n // wait for the Plane ctor to finish before calling refresh\n if (this._ready)\n {\n this.refresh();\n }\n }\n\n}\n","import Mesh from './Mesh';\nimport * as core from '../core';\n\n/**\n * The rope allows you to draw a texture across several points and them manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let rope = new PIXI.Rope(PIXI.Texture.fromImage(\"snake.png\"), points);\n * ```\n *\n * @class\n * @extends PIXI.mesh.Mesh\n * @memberof PIXI.mesh\n *\n */\nexport default class Rope extends Mesh\n{\n /**\n * @param {PIXI.Texture} texture - The texture to use on the rope.\n * @param {PIXI.Point[]} points - An array of {@link PIXI.Point} objects to construct this rope.\n */\n constructor(texture, points)\n {\n super(texture);\n\n /*\n * @member {PIXI.Point[]} An array of points that determine the rope\n */\n this.points = points;\n\n /*\n * @member {Float32Array} An array of vertices used to construct this rope.\n */\n this.vertices = new Float32Array(points.length * 4);\n\n /*\n * @member {Float32Array} The WebGL Uvs of the rope.\n */\n this.uvs = new Float32Array(points.length * 4);\n\n /*\n * @member {Float32Array} An array containing the color components\n */\n this.colors = new Float32Array(points.length * 2);\n\n /*\n * @member {Uint16Array} An array containing the indices of the vertices\n */\n this.indices = new Uint16Array(points.length * 2);\n\n /**\n * Tracker for if the rope is ready to be drawn. Needed because Mesh ctor can\n * call _onTextureUpdated which could call refresh too early.\n *\n * @member {boolean}\n * @private\n */\n this._ready = true;\n\n this.refresh();\n }\n\n /**\n * Refreshes\n *\n */\n refresh()\n {\n const points = this.points;\n\n // if too little points, or texture hasn't got UVs set yet just move on.\n if (points.length < 1 || !this._texture._uvs)\n {\n return;\n }\n\n // if the number of points has changed we will need to recreate the arraybuffers\n if (this.vertices.length / 4 !== points.length)\n {\n this.vertices = new Float32Array(points.length * 4);\n this.uvs = new Float32Array(points.length * 4);\n this.colors = new Float32Array(points.length * 2);\n this.indices = new Uint16Array(points.length * 2);\n }\n\n const uvs = this.uvs;\n\n const indices = this.indices;\n const colors = this.colors;\n\n const textureUvs = this._texture._uvs;\n const offset = new core.Point(textureUvs.x0, textureUvs.y0);\n const factor = new core.Point(textureUvs.x2 - textureUvs.x0, textureUvs.y2 - textureUvs.y0);\n\n uvs[0] = 0 + offset.x;\n uvs[1] = 0 + offset.y;\n uvs[2] = 0 + offset.x;\n uvs[3] = Number(factor.y) + offset.y;\n\n colors[0] = 1;\n colors[1] = 1;\n\n indices[0] = 0;\n indices[1] = 1;\n\n const total = points.length;\n\n for (let i = 1; i < total; i++)\n {\n // time to do some smart drawing!\n let index = i * 4;\n const amount = i / (total - 1);\n\n uvs[index] = (amount * factor.x) + offset.x;\n uvs[index + 1] = 0 + offset.y;\n\n uvs[index + 2] = (amount * factor.x) + offset.x;\n uvs[index + 3] = Number(factor.y) + offset.y;\n\n index = i * 2;\n colors[index] = 1;\n colors[index + 1] = 1;\n\n index = i * 2;\n indices[index] = index;\n indices[index + 1] = index + 1;\n }\n\n // ensure that the changes are uploaded\n this.dirty++;\n this.indexDirty++;\n }\n\n /**\n * Clear texture UVs when new texture is set\n *\n * @private\n */\n _onTextureUpdate()\n {\n super._onTextureUpdate();\n\n // wait for the Rope ctor to finish before calling refresh\n if (this._ready)\n {\n this.refresh();\n }\n }\n\n /**\n * Updates the object transform for rendering\n *\n * @private\n */\n updateTransform()\n {\n const points = this.points;\n\n if (points.length < 1)\n {\n return;\n }\n\n let lastPoint = points[0];\n let nextPoint;\n let perpX = 0;\n let perpY = 0;\n\n // this.count -= 0.2;\n\n const vertices = this.vertices;\n const total = points.length;\n\n for (let i = 0; i < total; i++)\n {\n const point = points[i];\n const index = i * 4;\n\n if (i < points.length - 1)\n {\n nextPoint = points[i + 1];\n }\n else\n {\n nextPoint = point;\n }\n\n perpY = -(nextPoint.x - lastPoint.x);\n perpX = nextPoint.y - lastPoint.y;\n\n let ratio = (1 - (i / (total - 1))) * 10;\n\n if (ratio > 1)\n {\n ratio = 1;\n }\n\n const perpLength = Math.sqrt((perpX * perpX) + (perpY * perpY));\n const num = this._texture.height / 2; // (20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;\n\n perpX /= perpLength;\n perpY /= perpLength;\n\n perpX *= num;\n perpY *= num;\n\n vertices[index] = point.x + perpX;\n vertices[index + 1] = point.y + perpY;\n vertices[index + 2] = point.x - perpX;\n vertices[index + 3] = point.y - perpY;\n\n lastPoint = point;\n }\n\n this.containerUpdateTransform();\n }\n\n}\n","import * as core from '../../core';\nimport { default as Mesh } from '../Mesh';\n\n/**\n * Renderer dedicated to meshes.\n *\n * @class\n * @private\n * @memberof PIXI\n */\nexport default class MeshSpriteRenderer\n{\n /**\n * @param {PIXI.CanvasRenderer} renderer - The renderer this downport works for\n */\n constructor(renderer)\n {\n this.renderer = renderer;\n }\n\n /**\n * Renders the Mesh\n *\n * @param {PIXI.mesh.Mesh} mesh - the Mesh to render\n */\n render(mesh)\n {\n const renderer = this.renderer;\n const context = renderer.context;\n\n const transform = mesh.worldTransform;\n const res = renderer.resolution;\n\n if (renderer.roundPixels)\n {\n context.setTransform(\n transform.a * res,\n transform.b * res,\n transform.c * res,\n transform.d * res,\n (transform.tx * res) | 0,\n (transform.ty * res) | 0\n );\n }\n else\n {\n context.setTransform(\n transform.a * res,\n transform.b * res,\n transform.c * res,\n transform.d * res,\n transform.tx * res,\n transform.ty * res\n );\n }\n\n renderer.setBlendMode(mesh.blendMode);\n\n if (mesh.drawMode === Mesh.DRAW_MODES.TRIANGLE_MESH)\n {\n this._renderTriangleMesh(mesh);\n }\n else\n {\n this._renderTriangles(mesh);\n }\n }\n\n /**\n * Draws the object in Triangle Mesh mode\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - the Mesh to render\n */\n _renderTriangleMesh(mesh)\n {\n // draw triangles!!\n const length = mesh.vertices.length / 2;\n\n for (let i = 0; i < length - 2; i++)\n {\n // draw some triangles!\n const index = i * 2;\n\n this._renderDrawTriangle(mesh, index, (index + 2), (index + 4));\n }\n }\n\n /**\n * Draws the object in triangle mode using canvas\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - the current mesh\n */\n _renderTriangles(mesh)\n {\n // draw triangles!!\n const indices = mesh.indices;\n const length = indices.length;\n\n for (let i = 0; i < length; i += 3)\n {\n // draw some triangles!\n const index0 = indices[i] * 2;\n const index1 = indices[i + 1] * 2;\n const index2 = indices[i + 2] * 2;\n\n this._renderDrawTriangle(mesh, index0, index1, index2);\n }\n }\n\n /**\n * Draws one of the triangles that from the Mesh\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - the current mesh\n * @param {number} index0 - the index of the first vertex\n * @param {number} index1 - the index of the second vertex\n * @param {number} index2 - the index of the third vertex\n */\n _renderDrawTriangle(mesh, index0, index1, index2)\n {\n const context = this.renderer.context;\n const uvs = mesh.uvs;\n const vertices = mesh.vertices;\n const texture = mesh._texture;\n\n if (!texture.valid)\n {\n return;\n }\n\n const base = texture.baseTexture;\n const textureSource = base.source;\n const textureWidth = base.width;\n const textureHeight = base.height;\n\n const u0 = uvs[index0] * base.width;\n const u1 = uvs[index1] * base.width;\n const u2 = uvs[index2] * base.width;\n const v0 = uvs[index0 + 1] * base.height;\n const v1 = uvs[index1 + 1] * base.height;\n const v2 = uvs[index2 + 1] * base.height;\n\n let x0 = vertices[index0];\n let x1 = vertices[index1];\n let x2 = vertices[index2];\n let y0 = vertices[index0 + 1];\n let y1 = vertices[index1 + 1];\n let y2 = vertices[index2 + 1];\n\n if (mesh.canvasPadding > 0)\n {\n const paddingX = mesh.canvasPadding / mesh.worldTransform.a;\n const paddingY = mesh.canvasPadding / mesh.worldTransform.d;\n const centerX = (x0 + x1 + x2) / 3;\n const centerY = (y0 + y1 + y2) / 3;\n\n let normX = x0 - centerX;\n let normY = y0 - centerY;\n\n let dist = Math.sqrt((normX * normX) + (normY * normY));\n\n x0 = centerX + ((normX / dist) * (dist + paddingX));\n y0 = centerY + ((normY / dist) * (dist + paddingY));\n\n //\n\n normX = x1 - centerX;\n normY = y1 - centerY;\n\n dist = Math.sqrt((normX * normX) + (normY * normY));\n x1 = centerX + ((normX / dist) * (dist + paddingX));\n y1 = centerY + ((normY / dist) * (dist + paddingY));\n\n normX = x2 - centerX;\n normY = y2 - centerY;\n\n dist = Math.sqrt((normX * normX) + (normY * normY));\n x2 = centerX + ((normX / dist) * (dist + paddingX));\n y2 = centerY + ((normY / dist) * (dist + paddingY));\n }\n\n context.save();\n context.beginPath();\n\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n\n context.closePath();\n\n context.clip();\n\n // Compute matrix transform\n const delta = (u0 * v1) + (v0 * u2) + (u1 * v2) - (v1 * u2) - (v0 * u1) - (u0 * v2);\n const deltaA = (x0 * v1) + (v0 * x2) + (x1 * v2) - (v1 * x2) - (v0 * x1) - (x0 * v2);\n const deltaB = (u0 * x1) + (x0 * u2) + (u1 * x2) - (x1 * u2) - (x0 * u1) - (u0 * x2);\n const deltaC = (u0 * v1 * x2) + (v0 * x1 * u2) + (x0 * u1 * v2) - (x0 * v1 * u2) - (v0 * u1 * x2) - (u0 * x1 * v2);\n const deltaD = (y0 * v1) + (v0 * y2) + (y1 * v2) - (v1 * y2) - (v0 * y1) - (y0 * v2);\n const deltaE = (u0 * y1) + (y0 * u2) + (u1 * y2) - (y1 * u2) - (y0 * u1) - (u0 * y2);\n const deltaF = (u0 * v1 * y2) + (v0 * y1 * u2) + (y0 * u1 * v2) - (y0 * v1 * u2) - (v0 * u1 * y2) - (u0 * y1 * v2);\n\n context.transform(\n deltaA / delta,\n deltaD / delta,\n deltaB / delta,\n deltaE / delta,\n deltaC / delta,\n deltaF / delta\n );\n\n context.drawImage(\n textureSource,\n 0,\n 0,\n textureWidth * base.resolution,\n textureHeight * base.resolution,\n 0,\n 0,\n textureWidth,\n textureHeight\n );\n\n context.restore();\n }\n\n /**\n * Renders a flat Mesh\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - The Mesh to render\n */\n renderMeshFlat(mesh)\n {\n const context = this.renderer.context;\n const vertices = mesh.vertices;\n const length = vertices.length / 2;\n\n // this.count++;\n\n context.beginPath();\n\n for (let i = 1; i < length - 2; ++i)\n {\n // draw some triangles!\n const index = i * 2;\n\n const x0 = vertices[index];\n const y0 = vertices[index + 1];\n\n const x1 = vertices[index + 2];\n const y1 = vertices[index + 3];\n\n const x2 = vertices[index + 4];\n const y2 = vertices[index + 5];\n\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n }\n\n context.fillStyle = '#FF0000';\n context.fill();\n context.closePath();\n }\n\n /**\n * destroy the the renderer.\n *\n */\n destroy()\n {\n this.renderer = null;\n }\n}\n\ncore.CanvasRenderer.registerPlugin('mesh', MeshSpriteRenderer);\n","/**\n * @namespace PIXI.mesh\n */\nexport { default as Mesh } from './Mesh';\nexport { default as MeshRenderer } from './webgl/MeshRenderer';\nexport { default as CanvasMeshRenderer } from './canvas/CanvasMeshRenderer';\nexport { default as Plane } from './Plane';\nexport { default as NineSlicePlane } from './NineSlicePlane';\nexport { default as Rope } from './Rope';\n","import * as core from '../../core';\nimport glCore from 'pixi-gl-core';\nimport { default as Mesh } from '../Mesh';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\n\n/**\n * WebGL renderer plugin for tiling sprites\n */\nexport default class MeshRenderer extends core.ObjectRenderer {\n\n /**\n * constructor for renderer\n *\n * @param {WebGLRenderer} renderer The renderer this tiling awesomeness works for.\n */\n constructor(renderer)\n {\n super(renderer);\n\n this.shader = null;\n }\n\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n onContextChange()\n {\n const gl = this.renderer.gl;\n\n this.shader = new core.Shader(gl,\n readFileSync(join(__dirname, './mesh.vert'), 'utf8'),\n readFileSync(join(__dirname, './mesh.frag'), 'utf8'));\n }\n\n /**\n * renders mesh\n *\n * @param {PIXI.mesh.Mesh} mesh mesh instance\n */\n render(mesh)\n {\n const renderer = this.renderer;\n const gl = renderer.gl;\n const texture = mesh._texture;\n\n if (!texture.valid)\n {\n return;\n }\n\n let glData = mesh._glDatas[renderer.CONTEXT_UID];\n\n if (!glData)\n {\n renderer.bindVao(null);\n\n glData = {\n shader: this.shader,\n vertexBuffer: glCore.GLBuffer.createVertexBuffer(gl, mesh.vertices, gl.STREAM_DRAW),\n uvBuffer: glCore.GLBuffer.createVertexBuffer(gl, mesh.uvs, gl.STREAM_DRAW),\n indexBuffer: glCore.GLBuffer.createIndexBuffer(gl, mesh.indices, gl.STATIC_DRAW),\n // build the vao object that will render..\n vao: null,\n dirty: mesh.dirty,\n indexDirty: mesh.indexDirty,\n };\n\n // build the vao object that will render..\n glData.vao = new glCore.VertexArrayObject(gl)\n .addIndex(glData.indexBuffer)\n .addAttribute(glData.vertexBuffer, glData.shader.attributes.aVertexPosition, gl.FLOAT, false, 2 * 4, 0)\n .addAttribute(glData.uvBuffer, glData.shader.attributes.aTextureCoord, gl.FLOAT, false, 2 * 4, 0);\n\n mesh._glDatas[renderer.CONTEXT_UID] = glData;\n }\n\n if (mesh.dirty !== glData.dirty)\n {\n glData.dirty = mesh.dirty;\n glData.uvBuffer.upload(mesh.uvs);\n }\n\n if (mesh.indexDirty !== glData.indexDirty)\n {\n glData.indexDirty = mesh.indexDirty;\n glData.indexBuffer.upload(mesh.indices);\n }\n\n glData.vertexBuffer.upload(mesh.vertices);\n\n renderer.bindShader(glData.shader);\n\n glData.shader.uniforms.uSampler = renderer.bindTexture(texture);\n\n renderer.state.setBlendMode(mesh.blendMode);\n\n glData.shader.uniforms.translationMatrix = mesh.worldTransform.toArray(true);\n glData.shader.uniforms.alpha = mesh.worldAlpha;\n glData.shader.uniforms.tint = mesh.tintRgb;\n\n const drawMode = mesh.drawMode === Mesh.DRAW_MODES.TRIANGLE_MESH ? gl.TRIANGLE_STRIP : gl.TRIANGLES;\n\n renderer.bindVao(glData.vao);\n glData.vao.draw(drawMode, mesh.indices.length, 0);\n }\n}\n\ncore.WebGLRenderer.registerPlugin('mesh', MeshRenderer);\n","import * as core from '../core';\n\n/**\n * The ParticleContainer class is a really fast version of the Container built solely for speed,\n * so use when you need a lot of sprites or particles. The tradeoff of the ParticleContainer is that advanced\n * functionality will not work. ParticleContainer implements only the basic object transform (position, scale, rotation).\n * Any other functionality like tinting, masking, etc will not work on sprites in this batch.\n *\n * It's extremely easy to use :\n *\n * ```js\n * let container = new ParticleContainer();\n *\n * for (let i = 0; i < 100; ++i)\n * {\n * let sprite = new PIXI.Sprite.fromImage(\"myImage.png\");\n * container.addChild(sprite);\n * }\n * ```\n *\n * And here you have a hundred sprites that will be renderer at the speed of light.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI.particles\n */\nexport default class ParticleContainer extends core.Container\n{\n /**\n * @param {number} [maxSize=15000] - The maximum number of particles that can be renderer by the container.\n * @param {object} [properties] - The properties of children that should be uploaded to the gpu and applied.\n * @param {boolean} [properties.scale=false] - When true, scale be uploaded and applied.\n * @param {boolean} [properties.position=true] - When true, position be uploaded and applied.\n * @param {boolean} [properties.rotation=false] - When true, rotation be uploaded and applied.\n * @param {boolean} [properties.uvs=false] - When true, uvs be uploaded and applied.\n * @param {boolean} [properties.alpha=false] - When true, alpha be uploaded and applied.\n * @param {number} [batchSize=15000] - Number of particles per batch.\n */\n constructor(maxSize = 1500, properties, batchSize = 16384)\n {\n super();\n\n // Making sure the batch size is valid\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n const maxBatchSize = 16384;\n\n if (batchSize > maxBatchSize)\n {\n batchSize = maxBatchSize;\n }\n\n if (batchSize > maxSize)\n {\n batchSize = maxSize;\n }\n\n /**\n * Set properties to be dynamic (true) / static (false)\n *\n * @member {boolean[]}\n * @private\n */\n this._properties = [false, true, false, false, false];\n\n /**\n * @member {number}\n * @private\n */\n this._maxSize = maxSize;\n\n /**\n * @member {number}\n * @private\n */\n this._batchSize = batchSize;\n\n /**\n * @member {object}\n * @private\n */\n this._glBuffers = {};\n\n /**\n * @member {number}\n * @private\n */\n this._bufferToUpdate = 0;\n\n /**\n * @member {boolean}\n *\n */\n this.interactiveChildren = false;\n\n /**\n * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL`\n * to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n * @see PIXI.BLEND_MODES\n */\n this.blendMode = core.BLEND_MODES.NORMAL;\n\n /**\n * Used for canvas renderering. If true then the elements will be positioned at the\n * nearest pixel. This provides a nice speed boost.\n *\n * @member {boolean}\n * @default true;\n */\n this.roundPixels = true;\n\n /**\n * The texture used to render the children.\n *\n * @readonly\n * @member {BaseTexture}\n */\n this.baseTexture = null;\n\n this.setProperties(properties);\n }\n\n /**\n * Sets the private properties array to dynamic / static based on the passed properties object\n *\n * @param {object} properties - The properties to be uploaded\n */\n setProperties(properties)\n {\n if (properties)\n {\n this._properties[0] = 'scale' in properties ? !!properties.scale : this._properties[0];\n this._properties[1] = 'position' in properties ? !!properties.position : this._properties[1];\n this._properties[2] = 'rotation' in properties ? !!properties.rotation : this._properties[2];\n this._properties[3] = 'uvs' in properties ? !!properties.uvs : this._properties[3];\n this._properties[4] = 'alpha' in properties ? !!properties.alpha : this._properties[4];\n }\n }\n\n /**\n * Updates the object transform for rendering\n *\n * @private\n */\n updateTransform()\n {\n // TODO don't need to!\n this.displayObjectUpdateTransform();\n // PIXI.Container.prototype.updateTransform.call( this );\n }\n\n /**\n * Renders the container using the WebGL renderer\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The webgl renderer\n */\n renderWebGL(renderer)\n {\n if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable)\n {\n return;\n }\n\n if (!this.baseTexture)\n {\n this.baseTexture = this.children[0]._texture.baseTexture;\n if (!this.baseTexture.hasLoaded)\n {\n this.baseTexture.once('update', () => this.onChildrenChange(0));\n }\n }\n\n renderer.setObjectRenderer(renderer.plugins.particle);\n renderer.plugins.particle.render(this);\n }\n\n /**\n * Set the flag that static data should be updated to true\n *\n * @private\n * @param {number} smallestChildIndex - The smallest child index\n */\n onChildrenChange(smallestChildIndex)\n {\n const bufferIndex = Math.floor(smallestChildIndex / this._batchSize);\n\n if (bufferIndex < this._bufferToUpdate)\n {\n this._bufferToUpdate = bufferIndex;\n }\n }\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer\n */\n renderCanvas(renderer)\n {\n if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable)\n {\n return;\n }\n\n const context = renderer.context;\n const transform = this.worldTransform;\n let isRotated = true;\n\n let positionX = 0;\n let positionY = 0;\n\n let finalWidth = 0;\n let finalHeight = 0;\n\n const compositeOperation = renderer.blendModes[this.blendMode];\n\n if (compositeOperation !== context.globalCompositeOperation)\n {\n context.globalCompositeOperation = compositeOperation;\n }\n\n context.globalAlpha = this.worldAlpha;\n\n this.displayObjectUpdateTransform();\n\n for (let i = 0; i < this.children.length; ++i)\n {\n const child = this.children[i];\n\n if (!child.visible)\n {\n continue;\n }\n\n const frame = child.texture.frame;\n\n context.globalAlpha = this.worldAlpha * child.alpha;\n\n if (child.rotation % (Math.PI * 2) === 0)\n {\n // this is the fastest way to optimise! - if rotation is 0 then we can avoid any kind of setTransform call\n if (isRotated)\n {\n context.setTransform(\n transform.a,\n transform.b,\n transform.c,\n transform.d,\n transform.tx * renderer.resolution,\n transform.ty * renderer.resolution\n );\n\n isRotated = false;\n }\n\n positionX = ((child.anchor.x) * (-frame.width * child.scale.x)) + child.position.x + 0.5;\n positionY = ((child.anchor.y) * (-frame.height * child.scale.y)) + child.position.y + 0.5;\n\n finalWidth = frame.width * child.scale.x;\n finalHeight = frame.height * child.scale.y;\n }\n else\n {\n if (!isRotated)\n {\n isRotated = true;\n }\n\n child.displayObjectUpdateTransform();\n\n const childTransform = child.worldTransform;\n\n if (renderer.roundPixels)\n {\n context.setTransform(\n childTransform.a,\n childTransform.b,\n childTransform.c,\n childTransform.d,\n (childTransform.tx * renderer.resolution) | 0,\n (childTransform.ty * renderer.resolution) | 0\n );\n }\n else\n {\n context.setTransform(\n childTransform.a,\n childTransform.b,\n childTransform.c,\n childTransform.d,\n childTransform.tx * renderer.resolution,\n childTransform.ty * renderer.resolution\n );\n }\n\n positionX = ((child.anchor.x) * (-frame.width)) + 0.5;\n positionY = ((child.anchor.y) * (-frame.height)) + 0.5;\n\n finalWidth = frame.width;\n finalHeight = frame.height;\n }\n\n const resolution = child.texture.baseTexture.resolution;\n\n context.drawImage(\n child.texture.baseTexture.source,\n frame.x * resolution,\n frame.y * resolution,\n frame.width * resolution,\n frame.height * resolution,\n positionX * resolution,\n positionY * resolution,\n finalWidth * resolution,\n finalHeight * resolution\n );\n }\n }\n\n /**\n * Destroys the container\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n */\n destroy(options)\n {\n super.destroy(options);\n\n if (this._buffers)\n {\n for (let i = 0; i < this._buffers.length; ++i)\n {\n this._buffers[i].destroy();\n }\n }\n\n this._properties = null;\n this._buffers = null;\n }\n}\n","/**\n * @namespace PIXI.particles\n */\nexport { default as ParticleContainer } from './ParticleContainer';\nexport { default as ParticleRenderer } from './webgl/ParticleRenderer';\n","import glCore from 'pixi-gl-core';\nimport createIndicesForQuads from '../../core/utils/createIndicesForQuads';\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original pixi version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that\n * they now share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleBuffer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleBuffer.java\n */\n\n/**\n * The particle buffer manages the static and dynamic buffers for a particle container.\n *\n * @class\n * @private\n * @memberof PIXI\n */\nexport default class ParticleBuffer\n{\n /**\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @param {object} properties - The properties to upload.\n * @param {boolean[]} dynamicPropertyFlags - Flags for which properties are dynamic.\n * @param {number} size - The size of the batch.\n */\n constructor(gl, properties, dynamicPropertyFlags, size)\n {\n /**\n * The current WebGL drawing context.\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n /**\n * Size of a single vertex.\n *\n * @member {number}\n */\n this.vertSize = 2;\n\n /**\n * Size of a single vertex in bytes.\n *\n * @member {number}\n */\n this.vertByteSize = this.vertSize * 4;\n\n /**\n * The number of particles the buffer can hold\n *\n * @member {number}\n */\n this.size = size;\n\n /**\n * A list of the properties that are dynamic.\n *\n * @member {object[]}\n */\n this.dynamicProperties = [];\n\n /**\n * A list of the properties that are static.\n *\n * @member {object[]}\n */\n this.staticProperties = [];\n\n for (let i = 0; i < properties.length; ++i)\n {\n let property = properties[i];\n\n // Make copy of properties object so that when we edit the offset it doesn't\n // change all other instances of the object literal\n property = {\n attribute: property.attribute,\n size: property.size,\n uploadFunction: property.uploadFunction,\n offset: property.offset,\n };\n\n if (dynamicPropertyFlags[i])\n {\n this.dynamicProperties.push(property);\n }\n else\n {\n this.staticProperties.push(property);\n }\n }\n\n this.staticStride = 0;\n this.staticBuffer = null;\n this.staticData = null;\n\n this.dynamicStride = 0;\n this.dynamicBuffer = null;\n this.dynamicData = null;\n\n this.initBuffers();\n }\n\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n initBuffers()\n {\n const gl = this.gl;\n let dynamicOffset = 0;\n\n /**\n * Holds the indices of the geometry (quads) to draw\n *\n * @member {Uint16Array}\n */\n this.indices = createIndicesForQuads(this.size);\n this.indexBuffer = glCore.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW);\n\n this.dynamicStride = 0;\n\n for (let i = 0; i < this.dynamicProperties.length; ++i)\n {\n const property = this.dynamicProperties[i];\n\n property.offset = dynamicOffset;\n dynamicOffset += property.size;\n this.dynamicStride += property.size;\n }\n\n this.dynamicData = new Float32Array(this.size * this.dynamicStride * 4);\n this.dynamicBuffer = glCore.GLBuffer.createVertexBuffer(gl, this.dynamicData, gl.STREAM_DRAW);\n\n // static //\n let staticOffset = 0;\n\n this.staticStride = 0;\n\n for (let i = 0; i < this.staticProperties.length; ++i)\n {\n const property = this.staticProperties[i];\n\n property.offset = staticOffset;\n staticOffset += property.size;\n this.staticStride += property.size;\n }\n\n this.staticData = new Float32Array(this.size * this.staticStride * 4);\n this.staticBuffer = glCore.GLBuffer.createVertexBuffer(gl, this.staticData, gl.STATIC_DRAW);\n\n this.vao = new glCore.VertexArrayObject(gl)\n .addIndex(this.indexBuffer);\n\n for (let i = 0; i < this.dynamicProperties.length; ++i)\n {\n const property = this.dynamicProperties[i];\n\n this.vao.addAttribute(\n this.dynamicBuffer,\n property.attribute,\n gl.FLOAT,\n false,\n this.dynamicStride * 4,\n property.offset * 4\n );\n }\n\n for (let i = 0; i < this.staticProperties.length; ++i)\n {\n const property = this.staticProperties[i];\n\n this.vao.addAttribute(\n this.staticBuffer,\n property.attribute,\n gl.FLOAT,\n false,\n this.staticStride * 4,\n property.offset * 4\n );\n }\n }\n\n /**\n * Uploads the dynamic properties.\n *\n * @param {PIXI.DisplayObject[]} children - The children to upload.\n * @param {number} startIndex - The index to start at.\n * @param {number} amount - The number to upload.\n */\n uploadDynamic(children, startIndex, amount)\n {\n for (let i = 0; i < this.dynamicProperties.length; i++)\n {\n const property = this.dynamicProperties[i];\n\n property.uploadFunction(children, startIndex, amount, this.dynamicData, this.dynamicStride, property.offset);\n }\n\n this.dynamicBuffer.upload();\n }\n\n /**\n * Uploads the static properties.\n *\n * @param {PIXI.DisplayObject[]} children - The children to upload.\n * @param {number} startIndex - The index to start at.\n * @param {number} amount - The number to upload.\n */\n uploadStatic(children, startIndex, amount)\n {\n for (let i = 0; i < this.staticProperties.length; i++)\n {\n const property = this.staticProperties[i];\n\n property.uploadFunction(children, startIndex, amount, this.staticData, this.staticStride, property.offset);\n }\n\n this.staticBuffer.upload();\n }\n\n /**\n * Destroys the ParticleBuffer.\n *\n */\n destroy()\n {\n this.dynamicProperties = null;\n this.dynamicData = null;\n this.dynamicBuffer.destroy();\n\n this.staticProperties = null;\n this.staticData = null;\n this.staticBuffer.destroy();\n }\n\n}\n","import * as core from '../../core';\nimport ParticleShader from './ParticleShader';\nimport ParticleBuffer from './ParticleBuffer';\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original pixi version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now\n * share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleRenderer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleRenderer.java\n */\n\n/**\n *\n * @class\n * @private\n * @memberof PIXI\n */\nexport default class ParticleRenderer extends core.ObjectRenderer\n{\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this sprite batch works for.\n */\n constructor(renderer)\n {\n super(renderer);\n\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n // and max number of element in the index buffer is 16384 * 6 = 98304\n // Creating a full index buffer, overhead is 98304 * 2 = 196Ko\n // let numIndices = 98304;\n\n /**\n * The default shader that is used if a sprite doesn't have a more specific one.\n *\n * @member {PIXI.Shader}\n */\n this.shader = null;\n\n this.indexBuffer = null;\n\n this.properties = null;\n\n this.tempMatrix = new core.Matrix();\n\n this.CONTEXT_UID = 0;\n }\n\n /**\n * When there is a WebGL context change\n *\n * @private\n */\n onContextChange()\n {\n const gl = this.renderer.gl;\n\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n\n // setup default shader\n this.shader = new ParticleShader(gl);\n\n this.properties = [\n // verticesData\n {\n attribute: this.shader.attributes.aVertexPosition,\n size: 2,\n uploadFunction: this.uploadVertices,\n offset: 0,\n },\n // positionData\n {\n attribute: this.shader.attributes.aPositionCoord,\n size: 2,\n uploadFunction: this.uploadPosition,\n offset: 0,\n },\n // rotationData\n {\n attribute: this.shader.attributes.aRotation,\n size: 1,\n uploadFunction: this.uploadRotation,\n offset: 0,\n },\n // uvsData\n {\n attribute: this.shader.attributes.aTextureCoord,\n size: 2,\n uploadFunction: this.uploadUvs,\n offset: 0,\n },\n // alphaData\n {\n attribute: this.shader.attributes.aColor,\n size: 1,\n uploadFunction: this.uploadAlpha,\n offset: 0,\n },\n ];\n }\n\n /**\n * Starts a new particle batch.\n *\n */\n start()\n {\n this.renderer.bindShader(this.shader);\n }\n\n /**\n * Renders the particle container object.\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n */\n render(container)\n {\n const children = container.children;\n const maxSize = container._maxSize;\n const batchSize = container._batchSize;\n const renderer = this.renderer;\n let totalChildren = children.length;\n\n if (totalChildren === 0)\n {\n return;\n }\n else if (totalChildren > maxSize)\n {\n totalChildren = maxSize;\n }\n\n let buffers = container._glBuffers[renderer.CONTEXT_UID];\n\n if (!buffers)\n {\n buffers = container._glBuffers[renderer.CONTEXT_UID] = this.generateBuffers(container);\n }\n\n // if the uvs have not updated then no point rendering just yet!\n this.renderer.setBlendMode(container.blendMode);\n\n const gl = renderer.gl;\n\n const m = container.worldTransform.copy(this.tempMatrix);\n\n m.prepend(renderer._activeRenderTarget.projectionMatrix);\n\n this.shader.uniforms.projectionMatrix = m.toArray(true);\n this.shader.uniforms.uAlpha = container.worldAlpha;\n\n // make sure the texture is bound..\n const baseTexture = children[0]._texture.baseTexture;\n\n this.shader.uniforms.uSampler = renderer.bindTexture(baseTexture);\n\n // now lets upload and render the buffers..\n for (let i = 0, j = 0; i < totalChildren; i += batchSize, j += 1)\n {\n let amount = (totalChildren - i);\n\n if (amount > batchSize)\n {\n amount = batchSize;\n }\n\n const buffer = buffers[j];\n\n // we always upload the dynamic\n buffer.uploadDynamic(children, i, amount);\n\n // we only upload the static content when we have to!\n if (container._bufferToUpdate === j)\n {\n buffer.uploadStatic(children, i, amount);\n container._bufferToUpdate = j + 1;\n }\n\n // bind the buffer\n renderer.bindVao(buffer.vao);\n buffer.vao.draw(gl.TRIANGLES, amount * 6);\n }\n }\n\n /**\n * Creates one particle buffer for each child in the container we want to render and updates internal properties\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n * @return {PIXI.ParticleBuffer[]} The buffers\n */\n generateBuffers(container)\n {\n const gl = this.renderer.gl;\n const buffers = [];\n const size = container._maxSize;\n const batchSize = container._batchSize;\n const dynamicPropertyFlags = container._properties;\n\n for (let i = 0; i < size; i += batchSize)\n {\n buffers.push(new ParticleBuffer(gl, this.properties, dynamicPropertyFlags, batchSize));\n }\n\n return buffers;\n }\n\n /**\n * Uploads the verticies.\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their vertices uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n uploadVertices(children, startIndex, amount, array, stride, offset)\n {\n let w0 = 0;\n let w1 = 0;\n let h0 = 0;\n let h1 = 0;\n\n for (let i = 0; i < amount; ++i)\n {\n const sprite = children[startIndex + i];\n const texture = sprite._texture;\n const sx = sprite.scale.x;\n const sy = sprite.scale.y;\n const trim = texture.trim;\n const orig = texture.orig;\n\n if (trim)\n {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the\n // extra space before transforming the sprite coords..\n w1 = trim.x - (sprite.anchor.x * orig.width);\n w0 = w1 + trim.width;\n\n h1 = trim.y - (sprite.anchor.y * orig.height);\n h0 = h1 + trim.height;\n }\n else\n {\n w0 = (orig.width) * (1 - sprite.anchor.x);\n w1 = (orig.width) * -sprite.anchor.x;\n\n h0 = orig.height * (1 - sprite.anchor.y);\n h1 = orig.height * -sprite.anchor.y;\n }\n\n array[offset] = w1 * sx;\n array[offset + 1] = h1 * sy;\n\n array[offset + stride] = w0 * sx;\n array[offset + stride + 1] = h1 * sy;\n\n array[offset + (stride * 2)] = w0 * sx;\n array[offset + (stride * 2) + 1] = h0 * sy;\n\n array[offset + (stride * 3)] = w1 * sx;\n array[offset + (stride * 3) + 1] = h0 * sy;\n\n offset += stride * 4;\n }\n }\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their positions uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n uploadPosition(children, startIndex, amount, array, stride, offset)\n {\n for (let i = 0; i < amount; i++)\n {\n const spritePosition = children[startIndex + i].position;\n\n array[offset] = spritePosition.x;\n array[offset + 1] = spritePosition.y;\n\n array[offset + stride] = spritePosition.x;\n array[offset + stride + 1] = spritePosition.y;\n\n array[offset + (stride * 2)] = spritePosition.x;\n array[offset + (stride * 2) + 1] = spritePosition.y;\n\n array[offset + (stride * 3)] = spritePosition.x;\n array[offset + (stride * 3) + 1] = spritePosition.y;\n\n offset += stride * 4;\n }\n }\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n uploadRotation(children, startIndex, amount, array, stride, offset)\n {\n for (let i = 0; i < amount; i++)\n {\n const spriteRotation = children[startIndex + i].rotation;\n\n array[offset] = spriteRotation;\n array[offset + stride] = spriteRotation;\n array[offset + (stride * 2)] = spriteRotation;\n array[offset + (stride * 3)] = spriteRotation;\n\n offset += stride * 4;\n }\n }\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n uploadUvs(children, startIndex, amount, array, stride, offset)\n {\n for (let i = 0; i < amount; ++i)\n {\n const textureUvs = children[startIndex + i]._texture._uvs;\n\n if (textureUvs)\n {\n array[offset] = textureUvs.x0;\n array[offset + 1] = textureUvs.y0;\n\n array[offset + stride] = textureUvs.x1;\n array[offset + stride + 1] = textureUvs.y1;\n\n array[offset + (stride * 2)] = textureUvs.x2;\n array[offset + (stride * 2) + 1] = textureUvs.y2;\n\n array[offset + (stride * 3)] = textureUvs.x3;\n array[offset + (stride * 3) + 1] = textureUvs.y3;\n\n offset += stride * 4;\n }\n else\n {\n // TODO you know this can be easier!\n array[offset] = 0;\n array[offset + 1] = 0;\n\n array[offset + stride] = 0;\n array[offset + stride + 1] = 0;\n\n array[offset + (stride * 2)] = 0;\n array[offset + (stride * 2) + 1] = 0;\n\n array[offset + (stride * 3)] = 0;\n array[offset + (stride * 3) + 1] = 0;\n\n offset += stride * 4;\n }\n }\n }\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n uploadAlpha(children, startIndex, amount, array, stride, offset)\n {\n for (let i = 0; i < amount; i++)\n {\n const spriteAlpha = children[startIndex + i].alpha;\n\n array[offset] = spriteAlpha;\n array[offset + stride] = spriteAlpha;\n array[offset + (stride * 2)] = spriteAlpha;\n array[offset + (stride * 3)] = spriteAlpha;\n\n offset += stride * 4;\n }\n }\n\n /**\n * Destroys the ParticleRenderer.\n *\n */\n destroy()\n {\n if (this.renderer.gl)\n {\n this.renderer.gl.deleteBuffer(this.indexBuffer);\n }\n\n super.destroy();\n\n this.shader.destroy();\n\n this.indices = null;\n this.tempMatrix = null;\n }\n\n}\n\ncore.WebGLRenderer.registerPlugin('particle', ParticleRenderer);\n","import Shader from '../../core/Shader';\n\n/**\n * @class\n * @extends PIXI.Shader\n * @memberof PIXI\n */\nexport default class ParticleShader extends Shader\n{\n /**\n * @param {PIXI.Shader} gl - The webgl shader manager this shader works for.\n */\n constructor(gl)\n {\n super(\n gl,\n // vertex shader\n [\n 'attribute vec2 aVertexPosition;',\n 'attribute vec2 aTextureCoord;',\n 'attribute float aColor;',\n\n 'attribute vec2 aPositionCoord;',\n 'attribute vec2 aScale;',\n 'attribute float aRotation;',\n\n 'uniform mat3 projectionMatrix;',\n\n 'varying vec2 vTextureCoord;',\n 'varying float vColor;',\n\n 'void main(void){',\n ' vec2 v = aVertexPosition;',\n\n ' v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);',\n ' v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);',\n ' v = v + aPositionCoord;',\n\n ' gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);',\n\n ' vTextureCoord = aTextureCoord;',\n ' vColor = aColor;',\n '}',\n ].join('\\n'),\n // hello\n [\n 'varying vec2 vTextureCoord;',\n 'varying float vColor;',\n\n 'uniform sampler2D uSampler;',\n 'uniform float uAlpha;',\n\n 'void main(void){',\n ' vec4 color = texture2D(uSampler, vTextureCoord) * vColor * uAlpha;',\n ' if (color.a == 0.0) discard;',\n ' gl_FragColor = color;',\n '}',\n ].join('\\n')\n );\n }\n}\n","// References:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign\n\nif (!Math.sign)\n{\n Math.sign = function mathSign(x)\n {\n x = Number(x);\n\n if (x === 0 || isNaN(x))\n {\n return x;\n }\n\n return x > 0 ? 1 : -1;\n };\n}\n","// References:\n// https://github.com/sindresorhus/object-assign\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\nimport objectAssign from 'object-assign';\n\nif (!Object.assign)\n{\n Object.assign = objectAssign;\n}\n","import './Object.assign';\nimport './requestAnimationFrame';\nimport './Math.sign';\n\nif (!window.ArrayBuffer)\n{\n window.ArrayBuffer = Array;\n}\n\nif (!window.Float32Array)\n{\n window.Float32Array = Array;\n}\n\nif (!window.Uint32Array)\n{\n window.Uint32Array = Array;\n}\n\nif (!window.Uint16Array)\n{\n window.Uint16Array = Array;\n}\n","// References:\n// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n// https://gist.github.com/1579671\n// http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision\n// https://gist.github.com/timhall/4078614\n// https://github.com/Financial-Times/polyfill-service/tree/master/polyfills/requestAnimationFrame\n\n// Expected to be used with Browserfiy\n// Browserify automatically detects the use of `global` and passes the\n// correct reference of `global`, `self`, and finally `window`\n\nconst ONE_FRAME_TIME = 16;\n\n// Date.now\nif (!(Date.now && Date.prototype.getTime))\n{\n Date.now = function now()\n {\n return new Date().getTime();\n };\n}\n\n// performance.now\nif (!(global.performance && global.performance.now))\n{\n const startTime = Date.now();\n\n if (!global.performance)\n {\n global.performance = {};\n }\n\n global.performance.now = () => Date.now() - startTime;\n}\n\n// requestAnimationFrame\nlet lastTime = Date.now();\nconst vendors = ['ms', 'moz', 'webkit', 'o'];\n\nfor (let x = 0; x < vendors.length && !global.requestAnimationFrame; ++x)\n{\n const p = vendors[x];\n\n global.requestAnimationFrame = global[`${p}RequestAnimationFrame`];\n global.cancelAnimationFrame = global[`${p}CancelAnimationFrame`] || global[`${p}CancelRequestAnimationFrame`];\n}\n\nif (!global.requestAnimationFrame)\n{\n global.requestAnimationFrame = (callback) =>\n {\n if (typeof callback !== 'function')\n {\n throw new TypeError(`${callback}is not a function`);\n }\n\n const currentTime = Date.now();\n let delay = ONE_FRAME_TIME + lastTime - currentTime;\n\n if (delay < 0)\n {\n delay = 0;\n }\n\n lastTime = currentTime;\n\n return setTimeout(() =>\n {\n lastTime = Date.now();\n callback(performance.now());\n }, delay);\n };\n}\n\nif (!global.cancelAnimationFrame)\n{\n global.cancelAnimationFrame = (id) => clearTimeout(id);\n}\n","import * as core from '../core';\nimport CountLimiter from './limiters/CountLimiter';\nconst SharedTicker = core.ticker.shared;\n\n/**\n * Default number of uploads per frame using prepare plugin.\n *\n * @static\n * @memberof PIXI.settings\n * @name UPLOADS_PER_FRAME\n * @type {number}\n * @default 4\n */\ncore.settings.UPLOADS_PER_FRAME = 4;\n\n/**\n * The prepare manager provides functionality to upload content to the GPU. BasePrepare handles\n * basic queuing functionality and is extended by {@link PIXI.prepare.WebGLPrepare} and {@link PIXI.prepare.CanvasPrepare}\n * to provide preparation capabilities specific to their respective renderers.\n *\n * @abstract\n * @class\n * @memberof PIXI\n */\nexport default class BasePrepare\n{\n /**\n * @param {PIXI.SystemRenderer} renderer - A reference to the current renderer\n */\n constructor(renderer)\n {\n /**\n * The limiter to be used to control how quickly items are prepared.\n * @type {PIXI.prepare.CountLimiter|PIXI.prepare.TimeLimiter}\n */\n this.limiter = new CountLimiter(core.settings.UPLOADS_PER_FRAME);\n\n /**\n * Reference to the renderer.\n * @type {PIXI.SystemRenderer}\n * @protected\n */\n this.renderer = renderer;\n\n /**\n * The only real difference between CanvasPrepare and WebGLPrepare is what they pass\n * to upload hooks. That different parameter is stored here.\n * @type {PIXI.prepare.CanvasPrepare|PIXI.WebGLRenderer}\n * @protected\n */\n this.uploadHookHelper = null;\n\n /**\n * Collection of items to uploads at once.\n * @type {Array<*>}\n * @private\n */\n this.queue = [];\n\n /**\n * Collection of additional hooks for finding assets.\n * @type {Array}\n * @private\n */\n this.addHooks = [];\n\n /**\n * Collection of additional hooks for processing assets.\n * @type {Array}\n * @private\n */\n this.uploadHooks = [];\n\n /**\n * Callback to call after completed.\n * @type {Array}\n * @private\n */\n this.completes = [];\n\n /**\n * If prepare is ticking (running).\n * @type {boolean}\n * @private\n */\n this.ticking = false;\n\n /**\n * 'bound' call for prepareItems().\n * @type {Function}\n * @private\n */\n this.delayedTick = () =>\n {\n // unlikely, but in case we were destroyed between tick() and delayedTick()\n if (!this.queue)\n {\n return;\n }\n this.prepareItems();\n };\n\n this.register(findText, drawText);\n this.register(findTextStyle, calculateTextStyle);\n }\n\n /**\n * Upload all the textures and graphics to the GPU.\n *\n * @param {Function|PIXI.DisplayObject|PIXI.Container} item - Either\n * the container or display object to search for items to upload or\n * the callback function, if items have been added using `prepare.add`.\n * @param {Function} [done] - Optional callback when all queued uploads have completed\n */\n upload(item, done)\n {\n if (typeof item === 'function')\n {\n done = item;\n item = null;\n }\n\n // If a display object, search for items\n // that we could upload\n if (item)\n {\n this.add(item);\n }\n\n // Get the items for upload from the display\n if (this.queue.length)\n {\n if (done)\n {\n this.completes.push(done);\n }\n\n if (!this.ticking)\n {\n this.ticking = true;\n SharedTicker.addOnce(this.tick, this);\n }\n }\n else if (done)\n {\n done();\n }\n }\n\n /**\n * Handle tick update\n *\n * @private\n */\n tick()\n {\n setTimeout(this.delayedTick, 0);\n }\n\n /**\n * Actually prepare items. This is handled outside of the tick because it will take a while\n * and we do NOT want to block the current animation frame from rendering.\n *\n * @private\n */\n prepareItems()\n {\n this.limiter.beginFrame();\n // Upload the graphics\n while (this.queue.length && this.limiter.allowedToUpload())\n {\n const item = this.queue[0];\n let uploaded = false;\n\n for (let i = 0, len = this.uploadHooks.length; i < len; i++)\n {\n if (this.uploadHooks[i](this.uploadHookHelper, item))\n {\n this.queue.shift();\n uploaded = true;\n break;\n }\n }\n\n if (!uploaded)\n {\n this.queue.shift();\n }\n }\n\n // We're finished\n if (!this.queue.length)\n {\n this.ticking = false;\n\n const completes = this.completes.slice(0);\n\n this.completes.length = 0;\n\n for (let i = 0, len = completes.length; i < len; i++)\n {\n completes[i]();\n }\n }\n else\n {\n // if we are not finished, on the next rAF do this again\n SharedTicker.addOnce(this.tick, this);\n }\n }\n\n /**\n * Adds hooks for finding and uploading items.\n *\n * @param {Function} [addHook] - Function call that takes two parameters: `item:*, queue:Array`\n function must return `true` if it was able to add item to the queue.\n * @param {Function} [uploadHook] - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and\n * function must return `true` if it was able to handle upload of item.\n * @return {PIXI.CanvasPrepare} Instance of plugin for chaining.\n */\n register(addHook, uploadHook)\n {\n if (addHook)\n {\n this.addHooks.push(addHook);\n }\n\n if (uploadHook)\n {\n this.uploadHooks.push(uploadHook);\n }\n\n return this;\n }\n\n /**\n * Manually add an item to the uploading queue.\n *\n * @param {PIXI.DisplayObject|PIXI.Container|*} item - Object to add to the queue\n * @return {PIXI.CanvasPrepare} Instance of plugin for chaining.\n */\n add(item)\n {\n // Add additional hooks for finding elements on special\n // types of objects that\n for (let i = 0, len = this.addHooks.length; i < len; i++)\n {\n if (this.addHooks[i](item, this.queue))\n {\n break;\n }\n }\n\n // Get childen recursively\n if (item instanceof core.Container)\n {\n for (let i = item.children.length - 1; i >= 0; i--)\n {\n this.add(item.children[i]);\n }\n }\n\n return this;\n }\n\n /**\n * Destroys the plugin, don't use after this.\n *\n */\n destroy()\n {\n if (this.ticking)\n {\n SharedTicker.remove(this.tick, this);\n }\n this.ticking = false;\n this.addHooks = null;\n this.uploadHooks = null;\n this.renderer = null;\n this.completes = null;\n this.queue = null;\n this.limiter = null;\n this.uploadHookHelper = null;\n }\n\n}\n\n/**\n * Built-in hook to draw PIXI.Text to its texture.\n *\n * @private\n * @param {PIXI.WebGLRenderer|PIXI.CanvasPrepare} helper - Not used by this upload handler\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction drawText(helper, item)\n{\n if (item instanceof core.Text)\n {\n // updating text will return early if it is not dirty\n item.updateText(true);\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to calculate a text style for a PIXI.Text object.\n *\n * @private\n * @param {PIXI.WebGLRenderer|PIXI.CanvasPrepare} helper - Not used by this upload handler\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction calculateTextStyle(helper, item)\n{\n if (item instanceof core.TextStyle)\n {\n const font = core.Text.getFontStyle(item);\n\n if (!core.Text.fontPropertiesCache[font])\n {\n core.Text.calculateFontProperties(font);\n }\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to find Text objects.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Text object was found.\n */\nfunction findText(item, queue)\n{\n if (item instanceof core.Text)\n {\n // push the text style to prepare it - this can be really expensive\n if (queue.indexOf(item.style) === -1)\n {\n queue.push(item.style);\n }\n // also push the text object so that we can render it (to canvas/texture) if needed\n if (queue.indexOf(item) === -1)\n {\n queue.push(item);\n }\n // also push the Text's texture for upload to GPU\n const texture = item._texture.baseTexture;\n\n if (queue.indexOf(texture) === -1)\n {\n queue.push(texture);\n }\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to find TextStyle objects.\n *\n * @private\n * @param {PIXI.TextStyle} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.TextStyle object was found.\n */\nfunction findTextStyle(item, queue)\n{\n if (item instanceof core.TextStyle)\n {\n if (queue.indexOf(item) === -1)\n {\n queue.push(item);\n }\n\n return true;\n }\n\n return false;\n}\n","import * as core from '../../core';\nimport BasePrepare from '../BasePrepare';\n\nconst CANVAS_START_SIZE = 16;\n\n/**\n * The prepare manager provides functionality to upload content to the GPU\n * This cannot be done directly for Canvas like in WebGL, but the effect can be achieved by drawing\n * textures to an offline canvas.\n * This draw call will force the texture to be moved onto the GPU.\n *\n * @class\n * @memberof PIXI\n */\nexport default class CanvasPrepare extends BasePrepare\n{\n /**\n * @param {PIXI.CanvasRenderer} renderer - A reference to the current renderer\n */\n constructor(renderer)\n {\n super(renderer);\n\n this.uploadHookHelper = this;\n\n /**\n * An offline canvas to render textures to\n * @type {HTMLCanvasElement}\n * @private\n */\n this.canvas = document.createElement('canvas');\n this.canvas.width = CANVAS_START_SIZE;\n this.canvas.height = CANVAS_START_SIZE;\n\n /**\n * The context to the canvas\n * @type {CanvasRenderingContext2D}\n * @private\n */\n this.ctx = this.canvas.getContext('2d');\n\n // Add textures to upload\n this.register(findBaseTextures, uploadBaseTextures);\n }\n\n /**\n * Destroys the plugin, don't use after this.\n *\n */\n destroy()\n {\n super.destroy();\n this.ctx = null;\n this.canvas = null;\n }\n\n}\n\n/**\n * Built-in hook to upload PIXI.Texture objects to the GPU.\n *\n * @private\n * @param {*} prepare - Instance of CanvasPrepare\n * @param {*} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction uploadBaseTextures(prepare, item)\n{\n if (item instanceof core.BaseTexture)\n {\n const image = item.source;\n\n // Sometimes images (like atlas images) report a size of zero, causing errors on windows phone.\n // So if the width or height is equal to zero then use the canvas size\n // Otherwise use whatever is smaller, the image dimensions or the canvas dimensions.\n const imageWidth = image.width === 0 ? prepare.canvas.width : Math.min(prepare.canvas.width, image.width);\n const imageHeight = image.height === 0 ? prepare.canvas.height : Math.min(prepare.canvas.height, image.height);\n\n // Only a small subsections is required to be drawn to have the whole texture uploaded to the GPU\n // A smaller draw can be faster.\n prepare.ctx.drawImage(image, 0, 0, imageWidth, imageHeight, 0, 0, prepare.canvas.width, prepare.canvas.height);\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to find textures from Sprites.\n *\n * @private\n * @param {PIXI.DisplayObject} item -Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Texture object was found.\n */\nfunction findBaseTextures(item, queue)\n{\n // Objects with textures, like Sprites/Text\n if (item instanceof core.BaseTexture)\n {\n if (queue.indexOf(item) === -1)\n {\n queue.push(item);\n }\n\n return true;\n }\n else if (item._texture && item._texture instanceof core.Texture)\n {\n const texture = item._texture.baseTexture;\n\n if (queue.indexOf(texture) === -1)\n {\n queue.push(texture);\n }\n\n return true;\n }\n\n return false;\n}\n\ncore.CanvasRenderer.registerPlugin('prepare', CanvasPrepare);\n","/**\n * @namespace PIXI.prepare\n */\nexport { default as webgl } from './webgl/WebGLPrepare';\nexport { default as canvas } from './canvas/CanvasPrepare';\nexport { default as BasePrepare } from './BasePrepare';\nexport { default as CountLimiter } from './limiters/CountLimiter';\nexport { default as TimeLimiter } from './limiters/TimeLimiter';\n","/**\n * CountLimiter limits the number of items handled by a {@link PIXI.prepare.BasePrepare} to a specified\n * number of items per frame.\n *\n * @class\n * @memberof PIXI\n */\nexport default class CountLimiter {\n /**\n * @param {number} maxItemsPerFrame - The maximum number of items that can be prepared each frame.\n */\n constructor(maxItemsPerFrame)\n {\n /**\n * The maximum number of items that can be prepared each frame.\n * @private\n */\n this.maxItemsPerFrame = maxItemsPerFrame;\n /**\n * The number of items that can be prepared in the current frame.\n * @type {number}\n * @private\n */\n this.itemsLeft = 0;\n }\n\n /**\n * Resets any counting properties to start fresh on a new frame.\n */\n beginFrame()\n {\n this.itemsLeft = this.maxItemsPerFrame;\n }\n\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @return {boolean} If the item is allowed to be uploaded.\n */\n allowedToUpload()\n {\n return this.itemsLeft-- > 0;\n }\n}\n","/**\n * TimeLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of milliseconds per frame.\n *\n * @class\n * @memberof PIXI\n */\nexport default class TimeLimiter {\n /**\n * @param {number} maxMilliseconds - The maximum milliseconds that can be spent preparing items each frame.\n */\n constructor(maxMilliseconds)\n {\n /**\n * The maximum milliseconds that can be spent preparing items each frame.\n * @private\n */\n this.maxMilliseconds = maxMilliseconds;\n /**\n * The start time of the current frame.\n * @type {number}\n * @private\n */\n this.frameStart = 0;\n }\n\n /**\n * Resets any counting properties to start fresh on a new frame.\n */\n beginFrame()\n {\n this.frameStart = Date.now();\n }\n\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @return {boolean} If the item is allowed to be uploaded.\n */\n allowedToUpload()\n {\n return Date.now() - this.frameStart < this.maxMilliseconds;\n }\n}\n","import * as core from '../../core';\nimport BasePrepare from '../BasePrepare';\n\n/**\n * The prepare manager provides functionality to upload content to the GPU.\n *\n * @class\n * @memberof PIXI\n */\nexport default class WebGLPrepare extends BasePrepare\n{\n /**\n * @param {PIXI.WebGLRenderer} renderer - A reference to the current renderer\n */\n constructor(renderer)\n {\n super(renderer);\n\n this.uploadHookHelper = this.renderer;\n\n // Add textures and graphics to upload\n this.register(findBaseTextures, uploadBaseTextures)\n .register(findGraphics, uploadGraphics);\n }\n\n}\n\n/**\n * Built-in hook to upload PIXI.Texture objects to the GPU.\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - instance of the webgl renderer\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction uploadBaseTextures(renderer, item)\n{\n if (item instanceof core.BaseTexture)\n {\n // if the texture already has a GL texture, then the texture has been prepared or rendered\n // before now. If the texture changed, then the changer should be calling texture.update() which\n // reuploads the texture without need for preparing it again\n if (!item._glTextures[renderer.CONTEXT_UID])\n {\n renderer.textureManager.updateTexture(item);\n }\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to upload PIXI.Graphics to the GPU.\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - instance of the webgl renderer\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction uploadGraphics(renderer, item)\n{\n if (item instanceof core.Graphics)\n {\n // if the item is not dirty and already has webgl data, then it got prepared or rendered\n // before now and we shouldn't waste time updating it again\n if (item.dirty || item.clearDirty || !item._webGL[renderer.plugins.graphics.CONTEXT_UID])\n {\n renderer.plugins.graphics.updateGraphics(item);\n }\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to find textures from Sprites.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Texture object was found.\n */\nfunction findBaseTextures(item, queue)\n{\n // Objects with textures, like Sprites/Text\n if (item instanceof core.BaseTexture)\n {\n if (queue.indexOf(item) === -1)\n {\n queue.push(item);\n }\n\n return true;\n }\n else if (item._texture && item._texture instanceof core.Texture)\n {\n const texture = item._texture.baseTexture;\n\n if (queue.indexOf(texture) === -1)\n {\n queue.push(texture);\n }\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to find graphics.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Graphics object was found.\n */\nfunction findGraphics(item, queue)\n{\n if (item instanceof core.Graphics)\n {\n queue.push(item);\n\n return true;\n }\n\n return false;\n}\n\ncore.WebGLRenderer.registerPlugin('prepare', WebGLPrepare);\n","// import polyfills\nimport './polyfill';\n\n// export core\nexport * from './deprecation';\nexport * from './core';\n\n// export libs\nimport * as accessibility from './accessibility';\nimport * as extract from './extract';\nimport * as extras from './extras';\nimport * as filters from './filters';\nimport * as interaction from './interaction';\nimport * as loaders from './loaders';\nimport * as mesh from './mesh';\nimport * as particles from './particles';\nimport * as prepare from './prepare';\n\nexport {\n accessibility,\n extract,\n extras,\n filters,\n interaction,\n loaders,\n mesh,\n particles,\n prepare,\n};\n\n/**\n * A premade instance of the loader that can be used to load resources.\n *\n * @name loader\n * @memberof PIXI\n * @property {PIXI.loaders.Loader}\n */\nconst loader = loaders && loaders.Loader ? new loaders.Loader() : null; // check is there in case user excludes loader lib\n\nexport { loader };\n\n// Always export pixi globally.\nglobal.PIXI = exports; // eslint-disable-line\n"],"sourceRoot":"."}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy