From 38e84ab9fe6395e0ed831429028047946814dd4e Mon Sep 17 00:00:00 2001 From: Sebastian Kupke Date: Wed, 13 Nov 2019 14:36:48 +0100 Subject: [PATCH] Updated dependencies. --- dist/iwmlib.3rdparty.js | 10375 +++++++++++++++++++--------------- dist/iwmlib.3rdparty.min.js | 2 +- dist/iwmlib.js | 53 - dist/iwmlib.pixi.js | 1201 +--- package-lock.json | 2158 +++++-- package.json | 6 +- 6 files changed, 7643 insertions(+), 6152 deletions(-) diff --git a/dist/iwmlib.3rdparty.js b/dist/iwmlib.3rdparty.js index 4f197ed..61ca3c6 100644 --- a/dist/iwmlib.3rdparty.js +++ b/dist/iwmlib.3rdparty.js @@ -4355,8 +4355,8 @@ if (typeof define === 'function' && define.amd) { })); /*! - * pixi.js - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * pixi.js - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * pixi.js is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -4827,8 +4827,8 @@ var PIXI = (function (exports) { }; /*! - * @pixi/polyfill - v5.1.0 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/polyfill - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/polyfill is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -4991,8 +4991,8 @@ var PIXI = (function (exports) { var isMobile_min_1 = isMobile_min.isMobile; /*! - * @pixi/settings - v5.1.3 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/settings - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/settings is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -7773,8 +7773,8 @@ var PIXI = (function (exports) { }; /*! - * @pixi/constants - v5.1.0 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/constants - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/constants is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -7791,12 +7791,12 @@ var PIXI = (function (exports) { * @property {number} WEBGL - Version 1 of WebGL * @property {number} WEBGL2 - Version 2 of WebGL */ - var ENV = { - WEBGL_LEGACY: 0, - WEBGL: 1, - WEBGL2: 2, - }; + (function (ENV) { + ENV[ENV["WEBGL_LEGACY"] = 0] = "WEBGL_LEGACY"; + ENV[ENV["WEBGL"] = 1] = "WEBGL"; + ENV[ENV["WEBGL2"] = 2] = "WEBGL2"; + })(exports.ENV || (exports.ENV = {})); /** * Constant to identify the Renderer Type. * @@ -7808,12 +7808,12 @@ var PIXI = (function (exports) { * @property {number} WEBGL - WebGL render type. * @property {number} CANVAS - Canvas render type. */ - var RENDERER_TYPE = { - UNKNOWN: 0, - WEBGL: 1, - CANVAS: 2, - }; + (function (RENDERER_TYPE) { + RENDERER_TYPE[RENDERER_TYPE["UNKNOWN"] = 0] = "UNKNOWN"; + RENDERER_TYPE[RENDERER_TYPE["WEBGL"] = 1] = "WEBGL"; + RENDERER_TYPE[RENDERER_TYPE["CANVAS"] = 2] = "CANVAS"; + })(exports.RENDERER_TYPE || (exports.RENDERER_TYPE = {})); /** * Various blend modes supported by PIXI. * @@ -7854,42 +7854,43 @@ var PIXI = (function (exports) { * @property {number} SUBTRACT * @property {number} SRC_OVER * @property {number} ERASE + * @property {number} XOR */ - var BLEND_MODES = { - NORMAL: 0, - ADD: 1, - MULTIPLY: 2, - SCREEN: 3, - OVERLAY: 4, - DARKEN: 5, - LIGHTEN: 6, - COLOR_DODGE: 7, - COLOR_BURN: 8, - HARD_LIGHT: 9, - SOFT_LIGHT: 10, - DIFFERENCE: 11, - EXCLUSION: 12, - HUE: 13, - SATURATION: 14, - COLOR: 15, - LUMINOSITY: 16, - NORMAL_NPM: 17, - ADD_NPM: 18, - SCREEN_NPM: 19, - NONE: 20, - - SRC_OVER: 0, - SRC_IN: 21, - SRC_OUT: 22, - SRC_ATOP: 23, - DST_OVER: 24, - DST_IN: 25, - DST_OUT: 26, - DST_ATOP: 27, - ERASE: 26, - SUBTRACT: 28, - }; + (function (BLEND_MODES) { + BLEND_MODES[BLEND_MODES["NORMAL"] = 0] = "NORMAL"; + BLEND_MODES[BLEND_MODES["ADD"] = 1] = "ADD"; + BLEND_MODES[BLEND_MODES["MULTIPLY"] = 2] = "MULTIPLY"; + BLEND_MODES[BLEND_MODES["SCREEN"] = 3] = "SCREEN"; + BLEND_MODES[BLEND_MODES["OVERLAY"] = 4] = "OVERLAY"; + BLEND_MODES[BLEND_MODES["DARKEN"] = 5] = "DARKEN"; + BLEND_MODES[BLEND_MODES["LIGHTEN"] = 6] = "LIGHTEN"; + BLEND_MODES[BLEND_MODES["COLOR_DODGE"] = 7] = "COLOR_DODGE"; + BLEND_MODES[BLEND_MODES["COLOR_BURN"] = 8] = "COLOR_BURN"; + BLEND_MODES[BLEND_MODES["HARD_LIGHT"] = 9] = "HARD_LIGHT"; + BLEND_MODES[BLEND_MODES["SOFT_LIGHT"] = 10] = "SOFT_LIGHT"; + BLEND_MODES[BLEND_MODES["DIFFERENCE"] = 11] = "DIFFERENCE"; + BLEND_MODES[BLEND_MODES["EXCLUSION"] = 12] = "EXCLUSION"; + BLEND_MODES[BLEND_MODES["HUE"] = 13] = "HUE"; + BLEND_MODES[BLEND_MODES["SATURATION"] = 14] = "SATURATION"; + BLEND_MODES[BLEND_MODES["COLOR"] = 15] = "COLOR"; + BLEND_MODES[BLEND_MODES["LUMINOSITY"] = 16] = "LUMINOSITY"; + BLEND_MODES[BLEND_MODES["NORMAL_NPM"] = 17] = "NORMAL_NPM"; + BLEND_MODES[BLEND_MODES["ADD_NPM"] = 18] = "ADD_NPM"; + BLEND_MODES[BLEND_MODES["SCREEN_NPM"] = 19] = "SCREEN_NPM"; + BLEND_MODES[BLEND_MODES["NONE"] = 20] = "NONE"; + BLEND_MODES[BLEND_MODES["SRC_OVER"] = 0] = "SRC_OVER"; + BLEND_MODES[BLEND_MODES["SRC_IN"] = 21] = "SRC_IN"; + BLEND_MODES[BLEND_MODES["SRC_OUT"] = 22] = "SRC_OUT"; + BLEND_MODES[BLEND_MODES["SRC_ATOP"] = 23] = "SRC_ATOP"; + BLEND_MODES[BLEND_MODES["DST_OVER"] = 24] = "DST_OVER"; + BLEND_MODES[BLEND_MODES["DST_IN"] = 25] = "DST_IN"; + BLEND_MODES[BLEND_MODES["DST_OUT"] = 26] = "DST_OUT"; + BLEND_MODES[BLEND_MODES["DST_ATOP"] = 27] = "DST_ATOP"; + BLEND_MODES[BLEND_MODES["ERASE"] = 26] = "ERASE"; + BLEND_MODES[BLEND_MODES["SUBTRACT"] = 28] = "SUBTRACT"; + BLEND_MODES[BLEND_MODES["XOR"] = 29] = "XOR"; + })(exports.BLEND_MODES || (exports.BLEND_MODES = {})); /** * Various webgl draw modes. These can be used to specify which GL drawMode to use * under certain situations and renderers. @@ -7906,16 +7907,16 @@ var PIXI = (function (exports) { * @property {number} TRIANGLE_STRIP * @property {number} TRIANGLE_FAN */ - var DRAW_MODES = { - POINTS: 0, - LINES: 1, - LINE_LOOP: 2, - LINE_STRIP: 3, - TRIANGLES: 4, - TRIANGLE_STRIP: 5, - TRIANGLE_FAN: 6, - }; + (function (DRAW_MODES) { + DRAW_MODES[DRAW_MODES["POINTS"] = 0] = "POINTS"; + DRAW_MODES[DRAW_MODES["LINES"] = 1] = "LINES"; + DRAW_MODES[DRAW_MODES["LINE_LOOP"] = 2] = "LINE_LOOP"; + DRAW_MODES[DRAW_MODES["LINE_STRIP"] = 3] = "LINE_STRIP"; + DRAW_MODES[DRAW_MODES["TRIANGLES"] = 4] = "TRIANGLES"; + DRAW_MODES[DRAW_MODES["TRIANGLE_STRIP"] = 5] = "TRIANGLE_STRIP"; + DRAW_MODES[DRAW_MODES["TRIANGLE_FAN"] = 6] = "TRIANGLE_FAN"; + })(exports.DRAW_MODES || (exports.DRAW_MODES = {})); /** * Various GL texture/resources formats. * @@ -7931,16 +7932,16 @@ var PIXI = (function (exports) { * @property {number} DEPTH_COMPONENT=6402 * @property {number} DEPTH_STENCIL=34041 */ - var FORMATS = { - RGBA: 6408, - RGB: 6407, - ALPHA: 6406, - LUMINANCE: 6409, - LUMINANCE_ALPHA: 6410, - DEPTH_COMPONENT: 6402, - DEPTH_STENCIL: 34041, - }; + (function (FORMATS) { + FORMATS[FORMATS["RGBA"] = 6408] = "RGBA"; + FORMATS[FORMATS["RGB"] = 6407] = "RGB"; + FORMATS[FORMATS["ALPHA"] = 6406] = "ALPHA"; + FORMATS[FORMATS["LUMINANCE"] = 6409] = "LUMINANCE"; + FORMATS[FORMATS["LUMINANCE_ALPHA"] = 6410] = "LUMINANCE_ALPHA"; + FORMATS[FORMATS["DEPTH_COMPONENT"] = 6402] = "DEPTH_COMPONENT"; + FORMATS[FORMATS["DEPTH_STENCIL"] = 34041] = "DEPTH_STENCIL"; + })(exports.FORMATS || (exports.FORMATS = {})); /** * Various GL target types. * @@ -7958,18 +7959,18 @@ var PIXI = (function (exports) { * @property {number} TEXTURE_CUBE_MAP_POSITIVE_Z=34073 * @property {number} TEXTURE_CUBE_MAP_NEGATIVE_Z=34074 */ - var TARGETS = { - TEXTURE_2D: 3553, - TEXTURE_CUBE_MAP: 34067, - TEXTURE_2D_ARRAY: 35866, - TEXTURE_CUBE_MAP_POSITIVE_X: 34069, - TEXTURE_CUBE_MAP_NEGATIVE_X: 34070, - TEXTURE_CUBE_MAP_POSITIVE_Y: 34071, - TEXTURE_CUBE_MAP_NEGATIVE_Y: 34072, - TEXTURE_CUBE_MAP_POSITIVE_Z: 34073, - TEXTURE_CUBE_MAP_NEGATIVE_Z: 34074, - }; + (function (TARGETS) { + TARGETS[TARGETS["TEXTURE_2D"] = 3553] = "TEXTURE_2D"; + TARGETS[TARGETS["TEXTURE_CUBE_MAP"] = 34067] = "TEXTURE_CUBE_MAP"; + TARGETS[TARGETS["TEXTURE_2D_ARRAY"] = 35866] = "TEXTURE_2D_ARRAY"; + TARGETS[TARGETS["TEXTURE_CUBE_MAP_POSITIVE_X"] = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X"; + TARGETS[TARGETS["TEXTURE_CUBE_MAP_NEGATIVE_X"] = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X"; + TARGETS[TARGETS["TEXTURE_CUBE_MAP_POSITIVE_Y"] = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y"; + TARGETS[TARGETS["TEXTURE_CUBE_MAP_NEGATIVE_Y"] = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y"; + TARGETS[TARGETS["TEXTURE_CUBE_MAP_POSITIVE_Z"] = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z"; + TARGETS[TARGETS["TEXTURE_CUBE_MAP_NEGATIVE_Z"] = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z"; + })(exports.TARGETS || (exports.TARGETS = {})); /** * Various GL data format types. * @@ -7985,16 +7986,16 @@ var PIXI = (function (exports) { * @property {number} FLOAT=5126 * @property {number} HALF_FLOAT=36193 */ - var TYPES = { - UNSIGNED_BYTE: 5121, - UNSIGNED_SHORT: 5123, - UNSIGNED_SHORT_5_6_5: 33635, - UNSIGNED_SHORT_4_4_4_4: 32819, - UNSIGNED_SHORT_5_5_5_1: 32820, - FLOAT: 5126, - HALF_FLOAT: 36193, - }; + (function (TYPES) { + TYPES[TYPES["UNSIGNED_BYTE"] = 5121] = "UNSIGNED_BYTE"; + TYPES[TYPES["UNSIGNED_SHORT"] = 5123] = "UNSIGNED_SHORT"; + TYPES[TYPES["UNSIGNED_SHORT_5_6_5"] = 33635] = "UNSIGNED_SHORT_5_6_5"; + TYPES[TYPES["UNSIGNED_SHORT_4_4_4_4"] = 32819] = "UNSIGNED_SHORT_4_4_4_4"; + TYPES[TYPES["UNSIGNED_SHORT_5_5_5_1"] = 32820] = "UNSIGNED_SHORT_5_5_5_1"; + TYPES[TYPES["FLOAT"] = 5126] = "FLOAT"; + TYPES[TYPES["HALF_FLOAT"] = 36193] = "HALF_FLOAT"; + })(exports.TYPES || (exports.TYPES = {})); /** * The scale modes that are supported by pixi. * @@ -8008,11 +8009,11 @@ var PIXI = (function (exports) { * @property {number} LINEAR Smooth scaling * @property {number} NEAREST Pixelating scaling */ - var SCALE_MODES = { - LINEAR: 1, - NEAREST: 0, - }; + (function (SCALE_MODES) { + SCALE_MODES[SCALE_MODES["NEAREST"] = 0] = "NEAREST"; + SCALE_MODES[SCALE_MODES["LINEAR"] = 1] = "LINEAR"; + })(exports.SCALE_MODES || (exports.SCALE_MODES = {})); /** * The wrap modes that are supported by pixi. * @@ -8031,12 +8032,12 @@ var PIXI = (function (exports) { * @property {number} REPEAT - The texture uvs tile and repeat * @property {number} MIRRORED_REPEAT - The texture uvs tile and repeat with mirroring */ - var WRAP_MODES = { - CLAMP: 33071, - REPEAT: 10497, - MIRRORED_REPEAT: 33648, - }; + (function (WRAP_MODES) { + WRAP_MODES[WRAP_MODES["CLAMP"] = 33071] = "CLAMP"; + WRAP_MODES[WRAP_MODES["REPEAT"] = 10497] = "REPEAT"; + WRAP_MODES[WRAP_MODES["MIRRORED_REPEAT"] = 33648] = "MIRRORED_REPEAT"; + })(exports.WRAP_MODES || (exports.WRAP_MODES = {})); /** * Mipmap filtering modes that are supported by pixi. * @@ -8055,12 +8056,38 @@ var PIXI = (function (exports) { * @property {number} POW2 - Generate mipmaps if texture dimensions are pow2 * @property {number} ON - Always generate mipmaps */ - var MIPMAP_MODES = { - OFF: 0, - POW2: 1, - ON: 2, - }; + (function (MIPMAP_MODES) { + MIPMAP_MODES[MIPMAP_MODES["OFF"] = 0] = "OFF"; + MIPMAP_MODES[MIPMAP_MODES["POW2"] = 1] = "POW2"; + MIPMAP_MODES[MIPMAP_MODES["ON"] = 2] = "ON"; + })(exports.MIPMAP_MODES || (exports.MIPMAP_MODES = {})); + /** + * How to treat textures with premultiplied alpha + * + * @name ALPHA_MODES + * @memberof PIXI + * @static + * @enum {number} + * @property {number} NO_PREMULTIPLIED_ALPHA - Source is not premultiplied, leave it like that. + * Option for compressed and data textures that are created from typed arrays. + * @property {number} PREMULTIPLY_ON_UPLOAD - Source is not premultiplied, premultiply on upload. + * Default option, used for all loaded images. + * @property {number} PREMULTIPLIED_ALPHA - Source is already premultiplied + * Example: spine atlases with `_pma` suffix. + * @property {number} NPM - Alias for NO_PREMULTIPLIED_ALPHA. + * @property {number} UNPACK - Default option, alias for PREMULTIPLY_ON_UPLOAD. + * @property {number} PMA - Alias for PREMULTIPLIED_ALPHA. + */ + + (function (ALPHA_MODES) { + ALPHA_MODES[ALPHA_MODES["NPM"] = 0] = "NPM"; + ALPHA_MODES[ALPHA_MODES["UNPACK"] = 1] = "UNPACK"; + ALPHA_MODES[ALPHA_MODES["PMA"] = 2] = "PMA"; + ALPHA_MODES[ALPHA_MODES["NO_PREMULTIPLIED_ALPHA"] = 0] = "NO_PREMULTIPLIED_ALPHA"; + ALPHA_MODES[ALPHA_MODES["PREMULTIPLY_ON_UPLOAD"] = 1] = "PREMULTIPLY_ON_UPLOAD"; + ALPHA_MODES[ALPHA_MODES["PREMULTIPLY_ALPHA"] = 2] = "PREMULTIPLY_ALPHA"; + })(exports.ALPHA_MODES || (exports.ALPHA_MODES = {})); /** * The gc modes that are supported by pixi. * @@ -8080,11 +8107,11 @@ var PIXI = (function (exports) { * @property {number} AUTO - Garbage collection will happen periodically automatically * @property {number} MANUAL - Garbage collection will need to be called manually */ - var GC_MODES = { - AUTO: 0, - MANUAL: 1, - }; + (function (GC_MODES) { + GC_MODES[GC_MODES["AUTO"] = 0] = "AUTO"; + GC_MODES[GC_MODES["MANUAL"] = 1] = "MANUAL"; + })(exports.GC_MODES || (exports.GC_MODES = {})); /** * Constants that specify float precision in shaders. * @@ -8097,15 +8124,36 @@ var PIXI = (function (exports) { * @property {string} MEDIUM='mediump' * @property {string} HIGH='highp' */ - var PRECISION = { - LOW: 'lowp', - MEDIUM: 'mediump', - HIGH: 'highp', - }; + + (function (PRECISION) { + PRECISION["LOW"] = "lowp"; + PRECISION["MEDIUM"] = "mediump"; + PRECISION["HIGH"] = "highp"; + })(exports.PRECISION || (exports.PRECISION = {})); + /** + * Constants for mask implementations. + * We use `type` suffix because it leads to very different behaviours + * + * @name MASK_TYPES + * @memberof PIXI + * @static + * @enum {number} + * @property {number} NONE - Mask is ignored + * @property {number} SCISSOR - Scissor mask, rectangle on screen, cheap + * @property {number} STENCIL - Stencil mask, 1-bit, medium, works only if renderer supports stencil + * @property {number} SPRITE - Mask that uses SpriteMaskFilter, uses temporary RenderTexture + */ + + (function (MASK_TYPES) { + MASK_TYPES[MASK_TYPES["NONE"] = 0] = "NONE"; + MASK_TYPES[MASK_TYPES["SCISSOR"] = 1] = "SCISSOR"; + MASK_TYPES[MASK_TYPES["STENCIL"] = 2] = "STENCIL"; + MASK_TYPES[MASK_TYPES["SPRITE"] = 3] = "SPRITE"; + })(exports.MASK_TYPES || (exports.MASK_TYPES = {})); /*! - * @pixi/utils - v5.1.3 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/utils - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/utils is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -8137,7 +8185,7 @@ var PIXI = (function (exports) { settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = true; var saidHello = false; - var VERSION = '5.1.5'; + var VERSION = '5.2.0'; /** * Skips the hello message of renderers that are created after this is run. @@ -8343,13 +8391,13 @@ var PIXI = (function (exports) { npm[i] = i; } - pm[BLEND_MODES.NORMAL_NPM] = BLEND_MODES.NORMAL; - pm[BLEND_MODES.ADD_NPM] = BLEND_MODES.ADD; - pm[BLEND_MODES.SCREEN_NPM] = BLEND_MODES.SCREEN; + pm[exports.BLEND_MODES.NORMAL_NPM] = exports.BLEND_MODES.NORMAL; + pm[exports.BLEND_MODES.ADD_NPM] = exports.BLEND_MODES.ADD; + pm[exports.BLEND_MODES.SCREEN_NPM] = exports.BLEND_MODES.SCREEN; - npm[BLEND_MODES.NORMAL] = BLEND_MODES.NORMAL_NPM; - npm[BLEND_MODES.ADD] = BLEND_MODES.ADD_NPM; - npm[BLEND_MODES.SCREEN] = BLEND_MODES.SCREEN_NPM; + npm[exports.BLEND_MODES.NORMAL] = exports.BLEND_MODES.NORMAL_NPM; + npm[exports.BLEND_MODES.ADD] = exports.BLEND_MODES.ADD_NPM; + npm[exports.BLEND_MODES.SCREEN] = exports.BLEND_MODES.SCREEN_NPM; var array = []; @@ -9096,96 +9144,138 @@ var PIXI = (function (exports) { }); /*! - * @pixi/math - v5.1.0 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/math - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/math is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ + /** + * Common interface for points. Both Point and ObservablePoint implement it + * @memberof PIXI + * @interface IPoint + */ + /** + * X coord + * @memberof PIXI.IPoint# + * @member {number} x + */ + /** + * Y coord + * @memberof PIXI.IPoint# + * @member {number} y + */ + /** + * Sets the point to a new x and y position. + * If y is omitted, both x and y will be set to x. + * + * @method set + * @memberof PIXI.IPoint# + * @param {number} [x=0] - position of the point on the x axis + * @param {number} [y=x] - position of the point on the y axis + */ + /** + * Copies x and y from the given point + * @method copyFrom + * @memberof PIXI.IPoint# + * @param {PIXI.IPoint} p - The point to copy from + * @returns {this} Returns itself. + */ + /** + * Copies x and y into the given point + * @method copyTo + * @memberof PIXI.IPoint# + * @param {PIXI.IPoint} p - The point to copy. + * @returns {PIXI.IPoint} Given point with values updated + */ + /** + * Returns true if the given point is equal to this point + * + * @method equals + * @memberof PIXI.IPoint# + * @param {PIXI.IPoint} p - The point to check + * @returns {boolean} Whether the given point equal to this point + */ + /** * The Point object represents a location in a two-dimensional coordinate system, where x represents * the horizontal axis and y represents the vertical axis. * * @class * @memberof PIXI + * @implements IPoint */ - var Point = function Point(x, y) - { - if ( x === void 0 ) { x = 0; } - if ( y === void 0 ) { y = 0; } - + var Point = /** @class */ (function () { /** - * @member {number} - * @default 0 + * @param {number} [x=0] - position of the point on the x axis + * @param {number} [y=0] - position of the point on the y axis */ - this.x = x; - + function Point(x, y) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + /** + * @member {number} + * @default 0 + */ + this.x = x; + /** + * @member {number} + * @default 0 + */ + this.y = y; + } /** - * @member {number} - * @default 0 + * Creates a clone of this point + * + * @return {PIXI.Point} a copy of the point */ - this.y = y; - }; - - /** - * Creates a clone of this point - * - * @return {PIXI.Point} a copy of the point - */ - Point.prototype.clone = function clone () - { - return new Point(this.x, this.y); - }; - - /** - * Copies x and y from the given point - * - * @param {PIXI.IPoint} p - The point to copy from - * @returns {PIXI.IPoint} Returns itself. - */ - Point.prototype.copyFrom = function copyFrom (p) - { - this.set(p.x, p.y); - - return this; - }; - - /** - * Copies x and y into the given point - * - * @param {PIXI.IPoint} p - The point to copy. - * @returns {PIXI.IPoint} Given point with values updated - */ - Point.prototype.copyTo = function copyTo (p) - { - p.set(this.x, this.y); - - return p; - }; - - /** - * Returns true if the given point is equal to this point - * - * @param {PIXI.IPoint} p - The point to check - * @returns {boolean} Whether the given point equal to this point - */ - Point.prototype.equals = function equals (p) - { - return (p.x === this.x) && (p.y === this.y); - }; - - /** - * Sets the point to a new x and y position. - * If y is omitted, both x and y will be set to x. - * - * @param {number} [x=0] - position of the point on the x axis - * @param {number} [y=0] - position of the point on the y axis - */ - Point.prototype.set = function set (x, y) - { - this.x = x || 0; - this.y = y || ((y !== 0) ? this.x : 0); - }; + Point.prototype.clone = function () { + return new Point(this.x, this.y); + }; + /** + * Copies x and y from the given point + * + * @param {PIXI.IPoint} p - The point to copy from + * @returns {this} Returns itself. + */ + Point.prototype.copyFrom = function (p) { + this.set(p.x, p.y); + return this; + }; + /** + * Copies x and y into the given point + * + * @param {PIXI.IPoint} p - The point to copy. + * @returns {PIXI.IPoint} Given point with values updated + */ + Point.prototype.copyTo = function (p) { + p.set(this.x, this.y); + return p; + }; + /** + * Returns true if the given point is equal to this point + * + * @param {PIXI.IPoint} p - The point to check + * @returns {boolean} Whether the given point equal to this point + */ + Point.prototype.equals = function (p) { + return (p.x === this.x) && (p.y === this.y); + }; + /** + * Sets the point to a new x and y position. + * If y is omitted, both x and y will be set to x. + * + * @param {number} [x=0] - position of the point on the x axis + * @param {number} [y=x] - position of the point on the y axis + */ + Point.prototype.set = function (x, y) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = x; } + this.x = x; + this.y = y; + }; + return Point; + }()); /** * The Point object represents a location in a two-dimensional coordinate system, where x represents @@ -9195,149 +9285,125 @@ var PIXI = (function (exports) { * * @class * @memberof PIXI + * @implements IPoint */ - var ObservablePoint = function ObservablePoint(cb, scope, x, y) - { - if ( x === void 0 ) { x = 0; } - if ( y === void 0 ) { y = 0; } - - this._x = x; - this._y = y; - - this.cb = cb; - this.scope = scope; - }; - - var prototypeAccessors$1 = { x: { configurable: true },y: { configurable: true } }; - - /** - * Creates a clone of this point. - * The callback and scope params can be overidden otherwise they will default - * to the clone object's values. - * - * @override - * @param {Function} [cb=null] - callback when changed - * @param {object} [scope=null] - owner of callback - * @return {PIXI.ObservablePoint} a copy of the point - */ - ObservablePoint.prototype.clone = function clone (cb, scope) - { - if ( cb === void 0 ) { cb = null; } - if ( scope === void 0 ) { scope = null; } - - var _cb = cb || this.cb; - var _scope = scope || this.scope; - - return new ObservablePoint(_cb, _scope, this._x, this._y); - }; - - /** - * Sets the point to a new x and y position. - * If y is omitted, both x and y will be set to x. - * - * @param {number} [x=0] - position of the point on the x axis - * @param {number} [y=0] - position of the point on the y axis - */ - ObservablePoint.prototype.set = function set (x, y) - { - var _x = x || 0; - var _y = y || ((y !== 0) ? _x : 0); - - if (this._x !== _x || this._y !== _y) - { - this._x = _x; - this._y = _y; - this.cb.call(this.scope); + var ObservablePoint = /** @class */ (function () { + /** + * @param {Function} cb - callback when changed + * @param {object} scope - owner of callback + * @param {number} [x=0] - position of the point on the x axis + * @param {number} [y=0] - position of the point on the y axis + */ + function ObservablePoint(cb, scope, x, y) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + this._x = x; + this._y = y; + this.cb = cb; + this.scope = scope; } - }; - - /** - * Copies x and y from the given point - * - * @param {PIXI.IPoint} p - The point to copy from. - * @returns {PIXI.IPoint} Returns itself. - */ - ObservablePoint.prototype.copyFrom = function copyFrom (p) - { - if (this._x !== p.x || this._y !== p.y) - { - this._x = p.x; - this._y = p.y; - this.cb.call(this.scope); - } - - return this; - }; - - /** - * Copies x and y into the given point - * - * @param {PIXI.IPoint} p - The point to copy. - * @returns {PIXI.IPoint} Given point with values updated - */ - ObservablePoint.prototype.copyTo = function copyTo (p) - { - p.set(this._x, this._y); - - return p; - }; - - /** - * Returns true if the given point is equal to this point - * - * @param {PIXI.IPoint} p - The point to check - * @returns {boolean} Whether the given point equal to this point - */ - ObservablePoint.prototype.equals = function equals (p) - { - return (p.x === this._x) && (p.y === this._y); - }; - - /** - * The position of the displayObject on the x axis relative to the local coordinates of the parent. - * - * @member {number} - */ - prototypeAccessors$1.x.get = function () - { - return this._x; - }; - - prototypeAccessors$1.x.set = function (value) // eslint-disable-line require-jsdoc - { - if (this._x !== value) - { - this._x = value; - this.cb.call(this.scope); - } - }; - - /** - * The position of the displayObject on the x axis relative to the local coordinates of the parent. - * - * @member {number} - */ - prototypeAccessors$1.y.get = function () - { - return this._y; - }; - - prototypeAccessors$1.y.set = function (value) // eslint-disable-line require-jsdoc - { - if (this._y !== value) - { - this._y = value; - this.cb.call(this.scope); - } - }; - - Object.defineProperties( ObservablePoint.prototype, prototypeAccessors$1 ); - - /** - * A number, or a string containing a number. - * @memberof PIXI - * @typedef {(PIXI.Point|PIXI.ObservablePoint)} IPoint - */ + /** + * Creates a clone of this point. + * The callback and scope params can be overidden otherwise they will default + * to the clone object's values. + * + * @override + * @param {Function} [cb=null] - callback when changed + * @param {object} [scope=null] - owner of callback + * @return {PIXI.ObservablePoint} a copy of the point + */ + ObservablePoint.prototype.clone = function (cb, scope) { + if (cb === void 0) { cb = this.cb; } + if (scope === void 0) { scope = this.scope; } + return new ObservablePoint(cb, scope, this._x, this._y); + }; + /** + * Sets the point to a new x and y position. + * If y is omitted, both x and y will be set to x. + * + * @param {number} [x=0] - position of the point on the x axis + * @param {number} [y=x] - position of the point on the y axis + */ + ObservablePoint.prototype.set = function (x, y) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = x; } + if (this._x !== x || this._y !== y) { + this._x = x; + this._y = y; + this.cb.call(this.scope); + } + }; + /** + * Copies x and y from the given point + * + * @param {PIXI.IPoint} p - The point to copy from. + * @returns {this} Returns itself. + */ + ObservablePoint.prototype.copyFrom = function (p) { + if (this._x !== p.x || this._y !== p.y) { + this._x = p.x; + this._y = p.y; + this.cb.call(this.scope); + } + return this; + }; + /** + * Copies x and y into the given point + * + * @param {PIXI.IPoint} p - The point to copy. + * @returns {PIXI.IPoint} Given point with values updated + */ + ObservablePoint.prototype.copyTo = function (p) { + p.set(this._x, this._y); + return p; + }; + /** + * Returns true if the given point is equal to this point + * + * @param {PIXI.IPoint} p - The point to check + * @returns {boolean} Whether the given point equal to this point + */ + ObservablePoint.prototype.equals = function (p) { + return (p.x === this._x) && (p.y === this._y); + }; + Object.defineProperty(ObservablePoint.prototype, "x", { + /** + * The position of the displayObject on the x axis relative to the local coordinates of the parent. + * + * @member {number} + */ + get: function () { + return this._x; + }, + set: function (value) { + if (this._x !== value) { + this._x = value; + this.cb.call(this.scope); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ObservablePoint.prototype, "y", { + /** + * The position of the displayObject on the x axis relative to the local coordinates of the parent. + * + * @member {number} + */ + get: function () { + return this._y; + }, + set: function (value) { + if (this._y !== value) { + this._y = value; + this.cb.call(this.scope); + } + }, + enumerable: true, + configurable: true + }); + return ObservablePoint; + }()); /** * Two Pi. @@ -9347,7 +9413,6 @@ var PIXI = (function (exports) { * @memberof PIXI */ var PI_2 = Math.PI * 2; - /** * Conversion factor for converting radians to degrees. * @@ -9356,7 +9421,6 @@ var PIXI = (function (exports) { * @memberof PIXI */ var RAD_TO_DEG = 180 / Math.PI; - /** * Conversion factor for converting degrees to radians. * @@ -9366,6 +9430,13 @@ var PIXI = (function (exports) { */ var DEG_TO_RAD = Math.PI / 180; + (function (SHAPES) { + SHAPES[SHAPES["POLY"] = 0] = "POLY"; + SHAPES[SHAPES["RECT"] = 1] = "RECT"; + SHAPES[SHAPES["CIRC"] = 2] = "CIRC"; + SHAPES[SHAPES["ELIP"] = 3] = "ELIP"; + SHAPES[SHAPES["RREC"] = 4] = "RREC"; + })(exports.SHAPES || (exports.SHAPES = {})); /** * Constants that identify shapes, mainly to prevent `instanceof` calls. * @@ -9373,20 +9444,14 @@ var PIXI = (function (exports) { * @constant * @name SHAPES * @memberof PIXI - * @type {object} + * @type {enum} * @property {number} POLY Polygon * @property {number} RECT Rectangle * @property {number} CIRC Circle * @property {number} ELIP Ellipse * @property {number} RREC Rounded Rectangle + * @enum {number} */ - var SHAPES = { - POLY: 0, - RECT: 1, - CIRC: 2, - ELIP: 3, - RREC: 4, - }; /** * The PixiJS Matrix as a class makes it a lot faster. @@ -9400,504 +9465,426 @@ var PIXI = (function (exports) { * @class * @memberof PIXI */ - var Matrix = function Matrix(a, b, c, d, tx, ty) - { - if ( a === void 0 ) { a = 1; } - if ( b === void 0 ) { b = 0; } - if ( c === void 0 ) { c = 0; } - if ( d === void 0 ) { d = 1; } - if ( tx === void 0 ) { tx = 0; } - if ( ty === void 0 ) { ty = 0; } - + var Matrix = /** @class */ (function () { /** - * @member {number} - * @default 1 + * @param {number} [a=1] - x scale + * @param {number} [b=0] - x skew + * @param {number} [c=0] - y skew + * @param {number} [d=1] - y scale + * @param {number} [tx=0] - x translation + * @param {number} [ty=0] - y translation */ - this.a = a; - - /** - * @member {number} - * @default 0 - */ - this.b = b; - - /** - * @member {number} - * @default 0 - */ - this.c = c; - - /** - * @member {number} - * @default 1 - */ - this.d = d; - - /** - * @member {number} - * @default 0 - */ - this.tx = tx; - - /** - * @member {number} - * @default 0 - */ - this.ty = ty; - - this.array = null; - }; - - var staticAccessors = { IDENTITY: { configurable: true },TEMP_MATRIX: { configurable: true } }; - - /** - * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows: - * - * a = array[0] - * b = array[1] - * c = array[3] - * d = array[4] - * tx = array[2] - * ty = array[5] - * - * @param {number[]} array - The array that the matrix will be populated from. - */ - Matrix.prototype.fromArray = function fromArray (array) - { - this.a = array[0]; - this.b = array[1]; - this.c = array[3]; - this.d = array[4]; - this.tx = array[2]; - this.ty = array[5]; - }; - - /** - * sets the matrix properties - * - * @param {number} a - Matrix component - * @param {number} b - Matrix component - * @param {number} c - Matrix component - * @param {number} d - Matrix component - * @param {number} tx - Matrix component - * @param {number} ty - Matrix component - * - * @return {PIXI.Matrix} This matrix. Good for chaining method calls. - */ - Matrix.prototype.set = function set (a, b, c, d, tx, ty) - { - this.a = a; - this.b = b; - this.c = c; - this.d = d; - this.tx = tx; - this.ty = ty; - - return this; - }; - - /** - * Creates an array from the current Matrix object. - * - * @param {boolean} transpose - Whether we need to transpose the matrix or not - * @param {Float32Array} [out=new Float32Array(9)] - If provided the array will be assigned to out - * @return {number[]} the newly created array which contains the matrix - */ - Matrix.prototype.toArray = function toArray (transpose, out) - { - if (!this.array) - { - this.array = new Float32Array(9); + function Matrix(a, b, c, d, tx, ty) { + if (a === void 0) { a = 1; } + if (b === void 0) { b = 0; } + if (c === void 0) { c = 0; } + if (d === void 0) { d = 1; } + if (tx === void 0) { tx = 0; } + if (ty === void 0) { ty = 0; } + this.array = null; + /** + * @member {number} + * @default 1 + */ + this.a = a; + /** + * @member {number} + * @default 0 + */ + this.b = b; + /** + * @member {number} + * @default 0 + */ + this.c = c; + /** + * @member {number} + * @default 1 + */ + this.d = d; + /** + * @member {number} + * @default 0 + */ + this.tx = tx; + /** + * @member {number} + * @default 0 + */ + this.ty = ty; } - - var array = out || this.array; - - if (transpose) - { - array[0] = this.a; - array[1] = this.b; - array[2] = 0; - array[3] = this.c; - array[4] = this.d; - array[5] = 0; - array[6] = this.tx; - array[7] = this.ty; - array[8] = 1; - } - else - { - array[0] = this.a; - array[1] = this.c; - array[2] = this.tx; - array[3] = this.b; - array[4] = this.d; - array[5] = this.ty; - array[6] = 0; - array[7] = 0; - array[8] = 1; - } - - return array; - }; - - /** - * Get a new position with the current transformation applied. - * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) - * - * @param {PIXI.Point} pos - The origin - * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input) - * @return {PIXI.Point} The new point, transformed through this matrix - */ - Matrix.prototype.apply = function apply (pos, newPos) - { - newPos = newPos || new Point(); - - var x = pos.x; - var y = pos.y; - - newPos.x = (this.a * x) + (this.c * y) + this.tx; - newPos.y = (this.b * x) + (this.d * y) + this.ty; - - return newPos; - }; - - /** - * Get a new position with the inverse of the current transformation applied. - * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) - * - * @param {PIXI.Point} pos - The origin - * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input) - * @return {PIXI.Point} The new point, inverse-transformed through this matrix - */ - Matrix.prototype.applyInverse = function applyInverse (pos, newPos) - { - newPos = newPos || new Point(); - - var id = 1 / ((this.a * this.d) + (this.c * -this.b)); - - var x = pos.x; - var y = pos.y; - - newPos.x = (this.d * id * x) + (-this.c * id * y) + (((this.ty * this.c) - (this.tx * this.d)) * id); - newPos.y = (this.a * id * y) + (-this.b * id * x) + (((-this.ty * this.a) + (this.tx * this.b)) * id); - - return newPos; - }; - - /** - * Translates the matrix on the x and y. - * - * @param {number} x How much to translate x by - * @param {number} y How much to translate y by - * @return {PIXI.Matrix} This matrix. Good for chaining method calls. - */ - Matrix.prototype.translate = function translate (x, y) - { - this.tx += x; - this.ty += y; - - return this; - }; - - /** - * Applies a scale transformation to the matrix. - * - * @param {number} x The amount to scale horizontally - * @param {number} y The amount to scale vertically - * @return {PIXI.Matrix} This matrix. Good for chaining method calls. - */ - Matrix.prototype.scale = function scale (x, y) - { - this.a *= x; - this.d *= y; - this.c *= x; - this.b *= y; - this.tx *= x; - this.ty *= y; - - return this; - }; - - /** - * Applies a rotation transformation to the matrix. - * - * @param {number} angle - The angle in radians. - * @return {PIXI.Matrix} This matrix. Good for chaining method calls. - */ - Matrix.prototype.rotate = function rotate (angle) - { - var cos = Math.cos(angle); - var sin = Math.sin(angle); - - var a1 = this.a; - var c1 = this.c; - var tx1 = this.tx; - - this.a = (a1 * cos) - (this.b * sin); - this.b = (a1 * sin) + (this.b * cos); - this.c = (c1 * cos) - (this.d * sin); - this.d = (c1 * sin) + (this.d * cos); - this.tx = (tx1 * cos) - (this.ty * sin); - this.ty = (tx1 * sin) + (this.ty * cos); - - return this; - }; - - /** - * Appends the given Matrix to this Matrix. - * - * @param {PIXI.Matrix} matrix - The matrix to append. - * @return {PIXI.Matrix} This matrix. Good for chaining method calls. - */ - Matrix.prototype.append = function append (matrix) - { - var a1 = this.a; - var b1 = this.b; - var c1 = this.c; - var d1 = this.d; - - this.a = (matrix.a * a1) + (matrix.b * c1); - this.b = (matrix.a * b1) + (matrix.b * d1); - this.c = (matrix.c * a1) + (matrix.d * c1); - this.d = (matrix.c * b1) + (matrix.d * d1); - - this.tx = (matrix.tx * a1) + (matrix.ty * c1) + this.tx; - this.ty = (matrix.tx * b1) + (matrix.ty * d1) + this.ty; - - return this; - }; - - /** - * Sets the matrix based on all the available properties - * - * @param {number} x - Position on the x axis - * @param {number} y - Position on the y axis - * @param {number} pivotX - Pivot on the x axis - * @param {number} pivotY - Pivot on the y axis - * @param {number} scaleX - Scale on the x axis - * @param {number} scaleY - Scale on the y axis - * @param {number} rotation - Rotation in radians - * @param {number} skewX - Skew on the x axis - * @param {number} skewY - Skew on the y axis - * @return {PIXI.Matrix} This matrix. Good for chaining method calls. - */ - Matrix.prototype.setTransform = function setTransform (x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) - { - this.a = Math.cos(rotation + skewY) * scaleX; - this.b = Math.sin(rotation + skewY) * scaleX; - this.c = -Math.sin(rotation - skewX) * scaleY; - this.d = Math.cos(rotation - skewX) * scaleY; - - this.tx = x - ((pivotX * this.a) + (pivotY * this.c)); - this.ty = y - ((pivotX * this.b) + (pivotY * this.d)); - - return this; - }; - - /** - * Prepends the given Matrix to this Matrix. - * - * @param {PIXI.Matrix} matrix - The matrix to prepend - * @return {PIXI.Matrix} This matrix. Good for chaining method calls. - */ - Matrix.prototype.prepend = function prepend (matrix) - { - var tx1 = this.tx; - - if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1) - { + /** + * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows: + * + * a = array[0] + * b = array[1] + * c = array[3] + * d = array[4] + * tx = array[2] + * ty = array[5] + * + * @param {number[]} array - The array that the matrix will be populated from. + */ + Matrix.prototype.fromArray = function (array) { + this.a = array[0]; + this.b = array[1]; + this.c = array[3]; + this.d = array[4]; + this.tx = array[2]; + this.ty = array[5]; + }; + /** + * sets the matrix properties + * + * @param {number} a - Matrix component + * @param {number} b - Matrix component + * @param {number} c - Matrix component + * @param {number} d - Matrix component + * @param {number} tx - Matrix component + * @param {number} ty - Matrix component + * + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + Matrix.prototype.set = function (a, b, c, d, tx, ty) { + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.tx = tx; + this.ty = ty; + return this; + }; + /** + * Creates an array from the current Matrix object. + * + * @param {boolean} transpose - Whether we need to transpose the matrix or not + * @param {Float32Array} [out=new Float32Array(9)] - If provided the array will be assigned to out + * @return {number[]} the newly created array which contains the matrix + */ + Matrix.prototype.toArray = function (transpose, out) { + if (!this.array) { + this.array = new Float32Array(9); + } + var array = out || this.array; + if (transpose) { + array[0] = this.a; + array[1] = this.b; + array[2] = 0; + array[3] = this.c; + array[4] = this.d; + array[5] = 0; + array[6] = this.tx; + array[7] = this.ty; + array[8] = 1; + } + else { + array[0] = this.a; + array[1] = this.c; + array[2] = this.tx; + array[3] = this.b; + array[4] = this.d; + array[5] = this.ty; + array[6] = 0; + array[7] = 0; + array[8] = 1; + } + return array; + }; + /** + * Get a new position with the current transformation applied. + * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) + * + * @param {PIXI.Point} pos - The origin + * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix + */ + Matrix.prototype.apply = function (pos, newPos) { + newPos = newPos || new Point(); + var x = pos.x; + var y = pos.y; + newPos.x = (this.a * x) + (this.c * y) + this.tx; + newPos.y = (this.b * x) + (this.d * y) + this.ty; + return newPos; + }; + /** + * Get a new position with the inverse of the current transformation applied. + * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) + * + * @param {PIXI.Point} pos - The origin + * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix + */ + Matrix.prototype.applyInverse = function (pos, newPos) { + newPos = newPos || new Point(); + var id = 1 / ((this.a * this.d) + (this.c * -this.b)); + var x = pos.x; + var y = pos.y; + newPos.x = (this.d * id * x) + (-this.c * id * y) + (((this.ty * this.c) - (this.tx * this.d)) * id); + newPos.y = (this.a * id * y) + (-this.b * id * x) + (((-this.ty * this.a) + (this.tx * this.b)) * id); + return newPos; + }; + /** + * Translates the matrix on the x and y. + * + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + Matrix.prototype.translate = function (x, y) { + this.tx += x; + this.ty += y; + return this; + }; + /** + * Applies a scale transformation to the matrix. + * + * @param {number} x The amount to scale horizontally + * @param {number} y The amount to scale vertically + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + Matrix.prototype.scale = function (x, y) { + this.a *= x; + this.d *= y; + this.c *= x; + this.b *= y; + this.tx *= x; + this.ty *= y; + return this; + }; + /** + * Applies a rotation transformation to the matrix. + * + * @param {number} angle - The angle in radians. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + Matrix.prototype.rotate = function (angle) { + var cos = Math.cos(angle); + var sin = Math.sin(angle); var a1 = this.a; var c1 = this.c; - - this.a = (a1 * matrix.a) + (this.b * matrix.c); - this.b = (a1 * matrix.b) + (this.b * matrix.d); - this.c = (c1 * matrix.a) + (this.d * matrix.c); - this.d = (c1 * matrix.b) + (this.d * matrix.d); - } - - this.tx = (tx1 * matrix.a) + (this.ty * matrix.c) + matrix.tx; - this.ty = (tx1 * matrix.b) + (this.ty * matrix.d) + matrix.ty; - - return this; - }; - - /** - * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. - * - * @param {PIXI.Transform} transform - The transform to apply the properties to. - * @return {PIXI.Transform} The transform with the newly applied properties - */ - Matrix.prototype.decompose = function decompose (transform) - { - // sort out rotation / skew.. - var a = this.a; - var b = this.b; - var c = this.c; - var d = this.d; - - var skewX = -Math.atan2(-c, d); - var skewY = Math.atan2(b, a); - - var delta = Math.abs(skewX + skewY); - - if (delta < 0.00001 || Math.abs(PI_2 - delta) < 0.00001) - { - transform.rotation = skewY; - transform.skew.x = transform.skew.y = 0; - } - else - { - transform.rotation = 0; - transform.skew.x = skewX; - transform.skew.y = skewY; - } - - // next set scale - transform.scale.x = Math.sqrt((a * a) + (b * b)); - transform.scale.y = Math.sqrt((c * c) + (d * d)); - - // next set position - transform.position.x = this.tx; - transform.position.y = this.ty; - - return transform; - }; - - /** - * Inverts this matrix - * - * @return {PIXI.Matrix} This matrix. Good for chaining method calls. - */ - Matrix.prototype.invert = function invert () - { - var a1 = this.a; - var b1 = this.b; - var c1 = this.c; - var d1 = this.d; - var tx1 = this.tx; - var n = (a1 * d1) - (b1 * c1); - - this.a = d1 / n; - this.b = -b1 / n; - this.c = -c1 / n; - this.d = a1 / n; - this.tx = ((c1 * this.ty) - (d1 * tx1)) / n; - this.ty = -((a1 * this.ty) - (b1 * tx1)) / n; - - return this; - }; - - /** - * Resets this Matrix to an identity (default) matrix. - * - * @return {PIXI.Matrix} This matrix. Good for chaining method calls. - */ - Matrix.prototype.identity = function identity () - { - this.a = 1; - this.b = 0; - this.c = 0; - this.d = 1; - this.tx = 0; - this.ty = 0; - - return this; - }; - - /** - * Creates a new Matrix object with the same values as this one. - * - * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. - */ - Matrix.prototype.clone = function clone () - { - var matrix = new Matrix(); - - matrix.a = this.a; - matrix.b = this.b; - matrix.c = this.c; - matrix.d = this.d; - matrix.tx = this.tx; - matrix.ty = this.ty; - - return matrix; - }; - - /** - * Changes the values of the given matrix to be the same as the ones in this matrix - * - * @param {PIXI.Matrix} matrix - The matrix to copy to. - * @return {PIXI.Matrix} The matrix given in parameter with its values updated. - */ - Matrix.prototype.copyTo = function copyTo (matrix) - { - matrix.a = this.a; - matrix.b = this.b; - matrix.c = this.c; - matrix.d = this.d; - matrix.tx = this.tx; - matrix.ty = this.ty; - - return matrix; - }; - - /** - * Changes the values of the matrix to be the same as the ones in given matrix - * - * @param {PIXI.Matrix} matrix - The matrix to copy from. - * @return {PIXI.Matrix} this - */ - Matrix.prototype.copyFrom = function copyFrom (matrix) - { - this.a = matrix.a; - this.b = matrix.b; - this.c = matrix.c; - this.d = matrix.d; - this.tx = matrix.tx; - this.ty = matrix.ty; - - return this; - }; - - /** - * A default (identity) matrix - * - * @static - * @const - * @member {PIXI.Matrix} - */ - staticAccessors.IDENTITY.get = function () - { - return new Matrix(); - }; - - /** - * A temp matrix - * - * @static - * @const - * @member {PIXI.Matrix} - */ - staticAccessors.TEMP_MATRIX.get = function () - { - return new Matrix(); - }; - - Object.defineProperties( Matrix, staticAccessors ); + var tx1 = this.tx; + this.a = (a1 * cos) - (this.b * sin); + this.b = (a1 * sin) + (this.b * cos); + this.c = (c1 * cos) - (this.d * sin); + this.d = (c1 * sin) + (this.d * cos); + this.tx = (tx1 * cos) - (this.ty * sin); + this.ty = (tx1 * sin) + (this.ty * cos); + return this; + }; + /** + * Appends the given Matrix to this Matrix. + * + * @param {PIXI.Matrix} matrix - The matrix to append. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + Matrix.prototype.append = function (matrix) { + var a1 = this.a; + var b1 = this.b; + var c1 = this.c; + var d1 = this.d; + this.a = (matrix.a * a1) + (matrix.b * c1); + this.b = (matrix.a * b1) + (matrix.b * d1); + this.c = (matrix.c * a1) + (matrix.d * c1); + this.d = (matrix.c * b1) + (matrix.d * d1); + this.tx = (matrix.tx * a1) + (matrix.ty * c1) + this.tx; + this.ty = (matrix.tx * b1) + (matrix.ty * d1) + this.ty; + return this; + }; + /** + * Sets the matrix based on all the available properties + * + * @param {number} x - Position on the x axis + * @param {number} y - Position on the y axis + * @param {number} pivotX - Pivot on the x axis + * @param {number} pivotY - Pivot on the y axis + * @param {number} scaleX - Scale on the x axis + * @param {number} scaleY - Scale on the y axis + * @param {number} rotation - Rotation in radians + * @param {number} skewX - Skew on the x axis + * @param {number} skewY - Skew on the y axis + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + Matrix.prototype.setTransform = function (x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) { + this.a = Math.cos(rotation + skewY) * scaleX; + this.b = Math.sin(rotation + skewY) * scaleX; + this.c = -Math.sin(rotation - skewX) * scaleY; + this.d = Math.cos(rotation - skewX) * scaleY; + this.tx = x - ((pivotX * this.a) + (pivotY * this.c)); + this.ty = y - ((pivotX * this.b) + (pivotY * this.d)); + return this; + }; + /** + * Prepends the given Matrix to this Matrix. + * + * @param {PIXI.Matrix} matrix - The matrix to prepend + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + Matrix.prototype.prepend = function (matrix) { + var tx1 = this.tx; + if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1) { + var a1 = this.a; + var c1 = this.c; + this.a = (a1 * matrix.a) + (this.b * matrix.c); + this.b = (a1 * matrix.b) + (this.b * matrix.d); + this.c = (c1 * matrix.a) + (this.d * matrix.c); + this.d = (c1 * matrix.b) + (this.d * matrix.d); + } + this.tx = (tx1 * matrix.a) + (this.ty * matrix.c) + matrix.tx; + this.ty = (tx1 * matrix.b) + (this.ty * matrix.d) + matrix.ty; + return this; + }; + /** + * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. + * + * @param {PIXI.Transform} transform - The transform to apply the properties to. + * @return {PIXI.Transform} The transform with the newly applied properties + */ + Matrix.prototype.decompose = function (transform) { + // sort out rotation / skew.. + var a = this.a; + var b = this.b; + var c = this.c; + var d = this.d; + var skewX = -Math.atan2(-c, d); + var skewY = Math.atan2(b, a); + var delta = Math.abs(skewX + skewY); + if (delta < 0.00001 || Math.abs(PI_2 - delta) < 0.00001) { + transform.rotation = skewY; + transform.skew.x = transform.skew.y = 0; + } + else { + transform.rotation = 0; + transform.skew.x = skewX; + transform.skew.y = skewY; + } + // next set scale + transform.scale.x = Math.sqrt((a * a) + (b * b)); + transform.scale.y = Math.sqrt((c * c) + (d * d)); + // next set position + transform.position.x = this.tx; + transform.position.y = this.ty; + return transform; + }; + /** + * Inverts this matrix + * + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + Matrix.prototype.invert = function () { + var a1 = this.a; + var b1 = this.b; + var c1 = this.c; + var d1 = this.d; + var tx1 = this.tx; + var n = (a1 * d1) - (b1 * c1); + this.a = d1 / n; + this.b = -b1 / n; + this.c = -c1 / n; + this.d = a1 / n; + this.tx = ((c1 * this.ty) - (d1 * tx1)) / n; + this.ty = -((a1 * this.ty) - (b1 * tx1)) / n; + return this; + }; + /** + * Resets this Matrix to an identity (default) matrix. + * + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + Matrix.prototype.identity = function () { + this.a = 1; + this.b = 0; + this.c = 0; + this.d = 1; + this.tx = 0; + this.ty = 0; + return this; + }; + /** + * Creates a new Matrix object with the same values as this one. + * + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. + */ + Matrix.prototype.clone = function () { + var matrix = new Matrix(); + matrix.a = this.a; + matrix.b = this.b; + matrix.c = this.c; + matrix.d = this.d; + matrix.tx = this.tx; + matrix.ty = this.ty; + return matrix; + }; + /** + * Changes the values of the given matrix to be the same as the ones in this matrix + * + * @param {PIXI.Matrix} matrix - The matrix to copy to. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. + */ + Matrix.prototype.copyTo = function (matrix) { + matrix.a = this.a; + matrix.b = this.b; + matrix.c = this.c; + matrix.d = this.d; + matrix.tx = this.tx; + matrix.ty = this.ty; + return matrix; + }; + /** + * Changes the values of the matrix to be the same as the ones in given matrix + * + * @param {PIXI.Matrix} matrix - The matrix to copy from. + * @return {PIXI.Matrix} this + */ + Matrix.prototype.copyFrom = function (matrix) { + this.a = matrix.a; + this.b = matrix.b; + this.c = matrix.c; + this.d = matrix.d; + this.tx = matrix.tx; + this.ty = matrix.ty; + return this; + }; + Object.defineProperty(Matrix, "IDENTITY", { + /** + * A default (identity) matrix + * + * @static + * @const + * @member {PIXI.Matrix} + */ + get: function () { + return new Matrix(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Matrix, "TEMP_MATRIX", { + /** + * A temp matrix + * + * @static + * @const + * @member {PIXI.Matrix} + */ + get: function () { + return new Matrix(); + }, + enumerable: true, + configurable: true + }); + return Matrix; + }()); // Your friendly neighbour https://en.wikipedia.org/wiki/Dihedral_group - /* * Transform matrix for operation n is: * | ux | vx | * | uy | vy | */ - var ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1]; var uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1]; var vx = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1]; var vy = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1]; - /** * [Cayley Table]{@link https://en.wikipedia.org/wiki/Cayley_table} * for the composition of each rotation in the dihederal group D8. @@ -9906,7 +9893,6 @@ var PIXI = (function (exports) { * @private */ var rotationCayley = []; - /** * Matrices for each `GD8Symmetry` rotation. * @@ -9914,62 +9900,46 @@ var PIXI = (function (exports) { * @private */ var rotationMatrices = []; - /* * Alias for {@code Math.sign}. */ var signum = Math.sign; - /* * Initializes `rotationCayley` and `rotationMatrices`. It is called * only once below. */ - function init() - { - for (var i = 0; i < 16; i++) - { + function init() { + for (var i = 0; i < 16; i++) { var row = []; - rotationCayley.push(row); - - for (var j = 0; j < 16; j++) - { + for (var j = 0; j < 16; j++) { /* Multiplies rotation matrices i and j. */ var _ux = signum((ux[i] * ux[j]) + (vx[i] * uy[j])); var _uy = signum((uy[i] * ux[j]) + (vy[i] * uy[j])); var _vx = signum((ux[i] * vx[j]) + (vx[i] * vy[j])); var _vy = signum((uy[i] * vx[j]) + (vy[i] * vy[j])); - /* Finds rotation matrix matching the product and pushes it. */ - for (var k = 0; k < 16; k++) - { + for (var k = 0; k < 16; k++) { if (ux[k] === _ux && uy[k] === _uy - && vx[k] === _vx && vy[k] === _vy) - { + && vx[k] === _vx && vy[k] === _vy) { row.push(k); break; } } } } - - for (var i$1 = 0; i$1 < 16; i$1++) - { + for (var i = 0; i < 16; i++) { var mat = new Matrix(); - - mat.set(ux[i$1], uy[i$1], vx[i$1], vy[i$1], 0, 0); + mat.set(ux[i], uy[i], vx[i], vy[i], 0, 0); rotationMatrices.push(mat); } } - init(); - /** * @memberof PIXI * @typedef {number} GD8Symmetry - * @see PIXI.GroupD8 + * @see PIXI.groupD8 */ - /** * Implements the dihedral group D8, which is similar to * [group D4]{@link http://mathworld.wolfram.com/DihedralGroupD4.html}; @@ -9983,167 +9953,161 @@ var PIXI = (function (exports) { * **Origin:**
* This is the small part of gameofbombs.com portal system. It works. * - * @see PIXI.GroupD8.E - * @see PIXI.GroupD8.SE - * @see PIXI.GroupD8.S - * @see PIXI.GroupD8.SW - * @see PIXI.GroupD8.W - * @see PIXI.GroupD8.NW - * @see PIXI.GroupD8.N - * @see PIXI.GroupD8.NE + * @see PIXI.groupD8.E + * @see PIXI.groupD8.SE + * @see PIXI.groupD8.S + * @see PIXI.groupD8.SW + * @see PIXI.groupD8.W + * @see PIXI.groupD8.NW + * @see PIXI.groupD8.N + * @see PIXI.groupD8.NE * @author Ivan @ivanpopelyshev - * @class + * @namespace PIXI.groupD8 * @memberof PIXI */ - var GroupD8 = { + var groupD8 = { /** * | Rotation | Direction | * |----------|-----------| * | 0° | East | * + * @memberof PIXI.groupD8 * @constant {PIXI.GD8Symmetry} */ E: 0, - /** * | Rotation | Direction | * |----------|-----------| * | 45°↻ | Southeast | * + * @memberof PIXI.groupD8 * @constant {PIXI.GD8Symmetry} */ SE: 1, - /** * | Rotation | Direction | * |----------|-----------| * | 90°↻ | South | * + * @memberof PIXI.groupD8 * @constant {PIXI.GD8Symmetry} */ S: 2, - /** * | Rotation | Direction | * |----------|-----------| * | 135°↻ | Southwest | * + * @memberof PIXI.groupD8 * @constant {PIXI.GD8Symmetry} */ SW: 3, - /** * | Rotation | Direction | * |----------|-----------| * | 180° | West | * + * @memberof PIXI.groupD8 * @constant {PIXI.GD8Symmetry} */ W: 4, - /** * | Rotation | Direction | * |-------------|--------------| * | -135°/225°↻ | Northwest | * + * @memberof PIXI.groupD8 * @constant {PIXI.GD8Symmetry} */ NW: 5, - /** * | Rotation | Direction | * |-------------|--------------| * | -90°/270°↻ | North | * + * @memberof PIXI.groupD8 * @constant {PIXI.GD8Symmetry} */ N: 6, - /** * | Rotation | Direction | * |-------------|--------------| * | -45°/315°↻ | Northeast | * + * @memberof PIXI.groupD8 * @constant {PIXI.GD8Symmetry} */ NE: 7, - /** * Reflection about Y-axis. * + * @memberof PIXI.groupD8 * @constant {PIXI.GD8Symmetry} */ MIRROR_VERTICAL: 8, - /** * Reflection about the main diagonal. * + * @memberof PIXI.groupD8 * @constant {PIXI.GD8Symmetry} */ MAIN_DIAGONAL: 10, - /** * Reflection about X-axis. * + * @memberof PIXI.groupD8 * @constant {PIXI.GD8Symmetry} */ MIRROR_HORIZONTAL: 12, - /** * Reflection about reverse diagonal. * + * @memberof PIXI.groupD8 * @constant {PIXI.GD8Symmetry} */ REVERSE_DIAGONAL: 14, - /** - * @memberof PIXI.GroupD8 + * @memberof PIXI.groupD8 * @param {PIXI.GD8Symmetry} ind - sprite rotation angle. * @return {PIXI.GD8Symmetry} The X-component of the U-axis * after rotating the axes. */ uX: function (ind) { return ux[ind]; }, - /** - * @memberof PIXI.GroupD8 + * @memberof PIXI.groupD8 * @param {PIXI.GD8Symmetry} ind - sprite rotation angle. * @return {PIXI.GD8Symmetry} The Y-component of the U-axis * after rotating the axes. */ uY: function (ind) { return uy[ind]; }, - /** - * @memberof PIXI.GroupD8 + * @memberof PIXI.groupD8 * @param {PIXI.GD8Symmetry} ind - sprite rotation angle. * @return {PIXI.GD8Symmetry} The X-component of the V-axis * after rotating the axes. */ vX: function (ind) { return vx[ind]; }, - /** - * @memberof PIXI.GroupD8 + * @memberof PIXI.groupD8 * @param {PIXI.GD8Symmetry} ind - sprite rotation angle. * @return {PIXI.GD8Symmetry} The Y-component of the V-axis * after rotating the axes. */ vY: function (ind) { return vy[ind]; }, - /** - * @memberof PIXI.GroupD8 + * @memberof PIXI.groupD8 * @param {PIXI.GD8Symmetry} rotation - symmetry whose opposite * is needed. Only rotations have opposite symmetries while * reflections don't. * @return {PIXI.GD8Symmetry} The opposite symmetry of `rotation` */ inv: function (rotation) { - if (rotation & 8)// true only if between 8 & 15 (reflections) - { - return rotation & 15;// or rotation % 16 + if (rotation & 8) // true only if between 8 & 15 (reflections) + { + return rotation & 15; // or rotation % 16 } - - return (-rotation) & 7;// or (8 - rotation) % 8 + return (-rotation) & 7; // or (8 - rotation) % 8 }, - /** * Composes the two D8 operations. * @@ -10161,111 +10125,89 @@ var PIXI = (function (exports) { * | N^=14 | N^ | W^ | S^ | E^ | N | W | S | E | * * [This is a Cayley table]{@link https://en.wikipedia.org/wiki/Cayley_table} - * @memberof PIXI.GroupD8 + * @memberof PIXI.groupD8 * @param {PIXI.GD8Symmetry} rotationSecond - Second operation, which * is the row in the above cayley table. * @param {PIXI.GD8Symmetry} rotationFirst - First operation, which * is the column in the above cayley table. * @return {PIXI.GD8Symmetry} Composed operation */ - add: function (rotationSecond, rotationFirst) { return ( - rotationCayley[rotationSecond][rotationFirst] - ); }, - + add: function (rotationSecond, rotationFirst) { return (rotationCayley[rotationSecond][rotationFirst]); }, /** * Reverse of `add`. * - * @memberof PIXI.GroupD8 + * @memberof PIXI.groupD8 * @param {PIXI.GD8Symmetry} rotationSecond - Second operation * @param {PIXI.GD8Symmetry} rotationFirst - First operation * @return {PIXI.GD8Symmetry} Result */ - sub: function (rotationSecond, rotationFirst) { return ( - rotationCayley[rotationSecond][GroupD8.inv(rotationFirst)] - ); }, - + sub: function (rotationSecond, rotationFirst) { return (rotationCayley[rotationSecond][groupD8.inv(rotationFirst)]); }, /** * Adds 180 degrees to rotation, which is a commutative * operation. * - * @memberof PIXI.GroupD8 + * @memberof PIXI.groupD8 * @param {number} rotation - The number to rotate. * @returns {number} Rotated number */ rotate180: function (rotation) { return rotation ^ 4; }, - /** * Checks if the rotation angle is vertical, i.e. south * or north. It doesn't work for reflections. * - * @memberof PIXI.GroupD8 + * @memberof PIXI.groupD8 * @param {PIXI.GD8Symmetry} rotation - The number to check. * @returns {boolean} Whether or not the direction is vertical */ - isVertical: function (rotation) { return (rotation & 3) === 2; }, // rotation % 4 === 2 - + isVertical: function (rotation) { return (rotation & 3) === 2; }, /** * Approximates the vector `V(dx,dy)` into one of the - * eight directions provided by `GroupD8`. + * eight directions provided by `groupD8`. * - * @memberof PIXI.GroupD8 + * @memberof PIXI.groupD8 * @param {number} dx - X-component of the vector * @param {number} dy - Y-component of the vector * @return {PIXI.GD8Symmetry} Approximation of the vector into * one of the eight symmetries. */ byDirection: function (dx, dy) { - if (Math.abs(dx) * 2 <= Math.abs(dy)) - { - if (dy >= 0) - { - return GroupD8.S; + if (Math.abs(dx) * 2 <= Math.abs(dy)) { + if (dy >= 0) { + return groupD8.S; } - - return GroupD8.N; + return groupD8.N; } - else if (Math.abs(dy) * 2 <= Math.abs(dx)) - { - if (dx > 0) - { - return GroupD8.E; + else if (Math.abs(dy) * 2 <= Math.abs(dx)) { + if (dx > 0) { + return groupD8.E; } - - return GroupD8.W; + return groupD8.W; } - else if (dy > 0) - { - if (dx > 0) - { - return GroupD8.SE; + else if (dy > 0) { + if (dx > 0) { + return groupD8.SE; } - - return GroupD8.SW; + return groupD8.SW; } - else if (dx > 0) - { - return GroupD8.NE; + else if (dx > 0) { + return groupD8.NE; } - - return GroupD8.NW; + return groupD8.NW; }, - /** * Helps sprite to compensate texture packer rotation. * - * @memberof PIXI.GroupD8 + * @memberof PIXI.groupD8 * @param {PIXI.Matrix} matrix - sprite world matrix * @param {PIXI.GD8Symmetry} rotation - The rotation factor to use. * @param {number} tx - sprite anchoring * @param {number} ty - sprite anchoring */ matrixAppendRotationInv: function (matrix, rotation, tx, ty) { - if ( tx === void 0 ) { tx = 0; } - if ( ty === void 0 ) { ty = 0; } - + if (tx === void 0) { tx = 0; } + if (ty === void 0) { ty = 0; } // Packer used "rotation", we use "inv(rotation)" - var mat = rotationMatrices[GroupD8.inv(rotation)]; - + var mat = rotationMatrices[groupD8.inv(rotation)]; mat.tx = tx; mat.ty = ty; matrix.append(mat); @@ -10278,265 +10220,223 @@ var PIXI = (function (exports) { * @class * @memberof PIXI */ - var Transform = function Transform() - { - /** - * The world transformation matrix. - * - * @member {PIXI.Matrix} - */ - this.worldTransform = new Matrix(); - - /** - * The local transformation matrix. - * - * @member {PIXI.Matrix} - */ - this.localTransform = new Matrix(); - - /** - * The coordinate of the object relative to the local coordinates of the parent. - * - * @member {PIXI.ObservablePoint} - */ - this.position = new ObservablePoint(this.onChange, this, 0, 0); - - /** - * The scale factor of the object. - * - * @member {PIXI.ObservablePoint} - */ - this.scale = new ObservablePoint(this.onChange, this, 1, 1); - - /** - * The pivot point of the displayObject that it rotates around. - * - * @member {PIXI.ObservablePoint} - */ - this.pivot = new ObservablePoint(this.onChange, this, 0, 0); - - /** - * The skew amount, on the x and y axis. - * - * @member {PIXI.ObservablePoint} - */ - this.skew = new ObservablePoint(this.updateSkew, this, 0, 0); - - /** - * The rotation amount. - * - * @protected - * @member {number} - */ - this._rotation = 0; - - /** - * The X-coordinate value of the normalized local X axis, - * the first column of the local transformation matrix without a scale. - * - * @protected - * @member {number} - */ - this._cx = 1; - - /** - * The Y-coordinate value of the normalized local X axis, - * the first column of the local transformation matrix without a scale. - * - * @protected - * @member {number} - */ - this._sx = 0; - - /** - * The X-coordinate value of the normalized local Y axis, - * the second column of the local transformation matrix without a scale. - * - * @protected - * @member {number} - */ - this._cy = 0; - - /** - * The Y-coordinate value of the normalized local Y axis, - * the second column of the local transformation matrix without a scale. - * - * @protected - * @member {number} - */ - this._sy = 1; - - /** - * The locally unique ID of the local transform. - * - * @protected - * @member {number} - */ - this._localID = 0; - - /** - * The locally unique ID of the local transform - * used to calculate the current local transformation matrix. - * - * @protected - * @member {number} - */ - this._currentLocalID = 0; - - /** - * The locally unique ID of the world transform. - * - * @protected - * @member {number} - */ - this._worldID = 0; - - /** - * The locally unique ID of the parent's world transform - * used to calculate the current world transformation matrix. - * - * @protected - * @member {number} - */ - this._parentID = 0; - }; - - var prototypeAccessors$1$1 = { rotation: { configurable: true } }; - - /** - * Called when a value changes. - * - * @protected - */ - Transform.prototype.onChange = function onChange () - { - this._localID++; - }; - - /** - * Called when the skew or the rotation changes. - * - * @protected - */ - Transform.prototype.updateSkew = function updateSkew () - { - this._cx = Math.cos(this._rotation + this.skew._y); - this._sx = Math.sin(this._rotation + this.skew._y); - this._cy = -Math.sin(this._rotation - this.skew._x); // cos, added PI/2 - this._sy = Math.cos(this._rotation - this.skew._x); // sin, added PI/2 - - this._localID++; - }; - - /** - * Updates the local transformation matrix. - */ - Transform.prototype.updateLocalTransform = function updateLocalTransform () - { - var lt = this.localTransform; - - if (this._localID !== this._currentLocalID) - { - // get the matrix values of the displayobject based on its transform properties.. - lt.a = this._cx * this.scale._x; - lt.b = this._sx * this.scale._x; - lt.c = this._cy * this.scale._y; - lt.d = this._sy * this.scale._y; - - lt.tx = this.position._x - ((this.pivot._x * lt.a) + (this.pivot._y * lt.c)); - lt.ty = this.position._y - ((this.pivot._x * lt.b) + (this.pivot._y * lt.d)); - this._currentLocalID = this._localID; - - // force an update.. - this._parentID = -1; + var Transform = /** @class */ (function () { + function Transform() { + /** + * The world transformation matrix. + * + * @member {PIXI.Matrix} + */ + this.worldTransform = new Matrix(); + /** + * The local transformation matrix. + * + * @member {PIXI.Matrix} + */ + this.localTransform = new Matrix(); + /** + * The coordinate of the object relative to the local coordinates of the parent. + * + * @member {PIXI.ObservablePoint} + */ + this.position = new ObservablePoint(this.onChange, this, 0, 0); + /** + * The scale factor of the object. + * + * @member {PIXI.ObservablePoint} + */ + this.scale = new ObservablePoint(this.onChange, this, 1, 1); + /** + * The pivot point of the displayObject that it rotates around. + * + * @member {PIXI.ObservablePoint} + */ + this.pivot = new ObservablePoint(this.onChange, this, 0, 0); + /** + * The skew amount, on the x and y axis. + * + * @member {PIXI.ObservablePoint} + */ + this.skew = new ObservablePoint(this.updateSkew, this, 0, 0); + /** + * The rotation amount. + * + * @protected + * @member {number} + */ + this._rotation = 0; + /** + * The X-coordinate value of the normalized local X axis, + * the first column of the local transformation matrix without a scale. + * + * @protected + * @member {number} + */ + this._cx = 1; + /** + * The Y-coordinate value of the normalized local X axis, + * the first column of the local transformation matrix without a scale. + * + * @protected + * @member {number} + */ + this._sx = 0; + /** + * The X-coordinate value of the normalized local Y axis, + * the second column of the local transformation matrix without a scale. + * + * @protected + * @member {number} + */ + this._cy = 0; + /** + * The Y-coordinate value of the normalized local Y axis, + * the second column of the local transformation matrix without a scale. + * + * @protected + * @member {number} + */ + this._sy = 1; + /** + * The locally unique ID of the local transform. + * + * @protected + * @member {number} + */ + this._localID = 0; + /** + * The locally unique ID of the local transform + * used to calculate the current local transformation matrix. + * + * @protected + * @member {number} + */ + this._currentLocalID = 0; + /** + * The locally unique ID of the world transform. + * + * @protected + * @member {number} + */ + this._worldID = 0; + /** + * The locally unique ID of the parent's world transform + * used to calculate the current world transformation matrix. + * + * @protected + * @member {number} + */ + this._parentID = 0; } - }; - - /** - * Updates the local and the world transformation matrices. - * - * @param {PIXI.Transform} parentTransform - The parent transform - */ - Transform.prototype.updateTransform = function updateTransform (parentTransform) - { - var lt = this.localTransform; - - if (this._localID !== this._currentLocalID) - { - // get the matrix values of the displayobject based on its transform properties.. - lt.a = this._cx * this.scale._x; - lt.b = this._sx * this.scale._x; - lt.c = this._cy * this.scale._y; - lt.d = this._sy * this.scale._y; - - lt.tx = this.position._x - ((this.pivot._x * lt.a) + (this.pivot._y * lt.c)); - lt.ty = this.position._y - ((this.pivot._x * lt.b) + (this.pivot._y * lt.d)); - this._currentLocalID = this._localID; - - // force an update.. - this._parentID = -1; - } - - if (this._parentID !== parentTransform._worldID) - { - // concat the parent matrix with the objects transform. - var pt = parentTransform.worldTransform; - var wt = this.worldTransform; - - wt.a = (lt.a * pt.a) + (lt.b * pt.c); - wt.b = (lt.a * pt.b) + (lt.b * pt.d); - wt.c = (lt.c * pt.a) + (lt.d * pt.c); - wt.d = (lt.c * pt.b) + (lt.d * pt.d); - wt.tx = (lt.tx * pt.a) + (lt.ty * pt.c) + pt.tx; - wt.ty = (lt.tx * pt.b) + (lt.ty * pt.d) + pt.ty; - - this._parentID = parentTransform._worldID; - - // update the id of the transform.. - this._worldID++; - } - }; - - /** - * Decomposes a matrix and sets the transforms properties based on it. - * - * @param {PIXI.Matrix} matrix - The matrix to decompose - */ - Transform.prototype.setFromMatrix = function setFromMatrix (matrix) - { - matrix.decompose(this); - this._localID++; - }; - - /** - * The rotation of the object in radians. - * - * @member {number} - */ - prototypeAccessors$1$1.rotation.get = function () - { - return this._rotation; - }; - - prototypeAccessors$1$1.rotation.set = function (value) // eslint-disable-line require-jsdoc - { - if (this._rotation !== value) - { - this._rotation = value; - this.updateSkew(); - } - }; - - Object.defineProperties( Transform.prototype, prototypeAccessors$1$1 ); - - /** - * A default (identity) transform - * - * @static - * @constant - * @member {PIXI.Transform} - */ - Transform.IDENTITY = new Transform(); + /** + * Called when a value changes. + * + * @protected + */ + Transform.prototype.onChange = function () { + this._localID++; + }; + /** + * Called when the skew or the rotation changes. + * + * @protected + */ + Transform.prototype.updateSkew = function () { + this._cx = Math.cos(this._rotation + this.skew.y); + this._sx = Math.sin(this._rotation + this.skew.y); + this._cy = -Math.sin(this._rotation - this.skew.x); // cos, added PI/2 + this._sy = Math.cos(this._rotation - this.skew.x); // sin, added PI/2 + this._localID++; + }; + /** + * Updates the local transformation matrix. + */ + Transform.prototype.updateLocalTransform = function () { + var lt = this.localTransform; + if (this._localID !== this._currentLocalID) { + // get the matrix values of the displayobject based on its transform properties.. + lt.a = this._cx * this.scale.x; + lt.b = this._sx * this.scale.x; + lt.c = this._cy * this.scale.y; + lt.d = this._sy * this.scale.y; + lt.tx = this.position.x - ((this.pivot.x * lt.a) + (this.pivot.y * lt.c)); + lt.ty = this.position.y - ((this.pivot.x * lt.b) + (this.pivot.y * lt.d)); + this._currentLocalID = this._localID; + // force an update.. + this._parentID = -1; + } + }; + /** + * Updates the local and the world transformation matrices. + * + * @param {PIXI.Transform} parentTransform - The parent transform + */ + Transform.prototype.updateTransform = function (parentTransform) { + var lt = this.localTransform; + if (this._localID !== this._currentLocalID) { + // get the matrix values of the displayobject based on its transform properties.. + lt.a = this._cx * this.scale.x; + lt.b = this._sx * this.scale.x; + lt.c = this._cy * this.scale.y; + lt.d = this._sy * this.scale.y; + lt.tx = this.position.x - ((this.pivot.x * lt.a) + (this.pivot.y * lt.c)); + lt.ty = this.position.y - ((this.pivot.x * lt.b) + (this.pivot.y * lt.d)); + this._currentLocalID = this._localID; + // force an update.. + this._parentID = -1; + } + if (this._parentID !== parentTransform._worldID) { + // concat the parent matrix with the objects transform. + var pt = parentTransform.worldTransform; + var wt = this.worldTransform; + wt.a = (lt.a * pt.a) + (lt.b * pt.c); + wt.b = (lt.a * pt.b) + (lt.b * pt.d); + wt.c = (lt.c * pt.a) + (lt.d * pt.c); + wt.d = (lt.c * pt.b) + (lt.d * pt.d); + wt.tx = (lt.tx * pt.a) + (lt.ty * pt.c) + pt.tx; + wt.ty = (lt.tx * pt.b) + (lt.ty * pt.d) + pt.ty; + this._parentID = parentTransform._worldID; + // update the id of the transform.. + this._worldID++; + } + }; + /** + * Decomposes a matrix and sets the transforms properties based on it. + * + * @param {PIXI.Matrix} matrix - The matrix to decompose + */ + Transform.prototype.setFromMatrix = function (matrix) { + matrix.decompose(this); + this._localID++; + }; + Object.defineProperty(Transform.prototype, "rotation", { + /** + * The rotation of the object in radians. + * + * @member {number} + */ + get: function () { + return this._rotation; + }, + set: function (value) { + if (this._rotation !== value) { + this._rotation = value; + this.updateSkew(); + } + }, + enumerable: true, + configurable: true + }); + /** + * A default (identity) transform + * + * @static + * @constant + * @member {PIXI.Transform} + */ + Transform.IDENTITY = new Transform(); + return Transform; + }()); /** * Size object, contains width and height @@ -10546,7 +10446,6 @@ var PIXI = (function (exports) { * @property {number} width - Width component * @property {number} height - Height component */ - /** * Rectangle object is an area defined by its position, as indicated by its top-left corner * point (x, y) and by its width and its height. @@ -10554,247 +10453,234 @@ var PIXI = (function (exports) { * @class * @memberof PIXI */ - var Rectangle = function Rectangle(x, y, width, height) - { - if ( x === void 0 ) { x = 0; } - if ( y === void 0 ) { y = 0; } - if ( width === void 0 ) { width = 0; } - if ( height === void 0 ) { height = 0; } - + var Rectangle = /** @class */ (function () { /** - * @member {number} - * @default 0 + * @param {number} [x=0] - The X coordinate of the upper-left corner of the rectangle + * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rectangle + * @param {number} [width=0] - The overall width of this rectangle + * @param {number} [height=0] - The overall height of this rectangle */ - this.x = Number(x); - + function Rectangle(x, y, width, height) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + if (width === void 0) { width = 0; } + if (height === void 0) { height = 0; } + /** + * @member {number} + * @default 0 + */ + this.x = Number(x); + /** + * @member {number} + * @default 0 + */ + this.y = Number(y); + /** + * @member {number} + * @default 0 + */ + this.width = Number(width); + /** + * @member {number} + * @default 0 + */ + this.height = Number(height); + /** + * The type of the object, mainly used to avoid `instanceof` checks + * + * @member {number} + * @readOnly + * @default PIXI.SHAPES.RECT + * @see PIXI.SHAPES + */ + this.type = exports.SHAPES.RECT; + } + Object.defineProperty(Rectangle.prototype, "left", { + /** + * returns the left edge of the rectangle + * + * @member {number} + */ + get: function () { + return this.x; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Rectangle.prototype, "right", { + /** + * returns the right edge of the rectangle + * + * @member {number} + */ + get: function () { + return this.x + this.width; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Rectangle.prototype, "top", { + /** + * returns the top edge of the rectangle + * + * @member {number} + */ + get: function () { + return this.y; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Rectangle.prototype, "bottom", { + /** + * returns the bottom edge of the rectangle + * + * @member {number} + */ + get: function () { + return this.y + this.height; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Rectangle, "EMPTY", { + /** + * A constant empty rectangle. + * + * @static + * @constant + * @member {PIXI.Rectangle} + * @return {PIXI.Rectangle} An empty rectangle + */ + get: function () { + return new Rectangle(0, 0, 0, 0); + }, + enumerable: true, + configurable: true + }); /** - * @member {number} - * @default 0 - */ - this.y = Number(y); - - /** - * @member {number} - * @default 0 - */ - this.width = Number(width); - - /** - * @member {number} - * @default 0 - */ - this.height = Number(height); - - /** - * The type of the object, mainly used to avoid `instanceof` checks + * Creates a clone of this Rectangle * - * @member {number} - * @readOnly - * @default PIXI.SHAPES.RECT - * @see PIXI.SHAPES + * @return {PIXI.Rectangle} a copy of the rectangle */ - this.type = SHAPES.RECT; - }; - - var prototypeAccessors$2 = { left: { configurable: true },right: { configurable: true },top: { configurable: true },bottom: { configurable: true } }; - var staticAccessors$1 = { EMPTY: { configurable: true } }; - - /** - * returns the left edge of the rectangle - * - * @member {number} - */ - prototypeAccessors$2.left.get = function () - { - return this.x; - }; - - /** - * returns the right edge of the rectangle - * - * @member {number} - */ - prototypeAccessors$2.right.get = function () - { - return this.x + this.width; - }; - - /** - * returns the top edge of the rectangle - * - * @member {number} - */ - prototypeAccessors$2.top.get = function () - { - return this.y; - }; - - /** - * returns the bottom edge of the rectangle - * - * @member {number} - */ - prototypeAccessors$2.bottom.get = function () - { - return this.y + this.height; - }; - - /** - * A constant empty rectangle. - * - * @static - * @constant - * @member {PIXI.Rectangle} - */ - staticAccessors$1.EMPTY.get = function () - { - return new Rectangle(0, 0, 0, 0); - }; - - /** - * Creates a clone of this Rectangle - * - * @return {PIXI.Rectangle} a copy of the rectangle - */ - Rectangle.prototype.clone = function clone () - { - return new Rectangle(this.x, this.y, this.width, this.height); - }; - - /** - * Copies another rectangle to this one. - * - * @param {PIXI.Rectangle} rectangle - The rectangle to copy from. - * @return {PIXI.Rectangle} Returns itself. - */ - Rectangle.prototype.copyFrom = function copyFrom (rectangle) - { - this.x = rectangle.x; - this.y = rectangle.y; - this.width = rectangle.width; - this.height = rectangle.height; - - return this; - }; - - /** - * Copies this rectangle to another one. - * - * @param {PIXI.Rectangle} rectangle - The rectangle to copy to. - * @return {PIXI.Rectangle} Returns given parameter. - */ - Rectangle.prototype.copyTo = function copyTo (rectangle) - { - rectangle.x = this.x; - rectangle.y = this.y; - rectangle.width = this.width; - rectangle.height = this.height; - - return rectangle; - }; - - /** - * Checks whether the x and y coordinates given are contained within this Rectangle - * - * @param {number} x - The X coordinate of the point to test - * @param {number} y - The Y coordinate of the point to test - * @return {boolean} Whether the x/y coordinates are within this Rectangle - */ - Rectangle.prototype.contains = function contains (x, y) - { - if (this.width <= 0 || this.height <= 0) - { - return false; - } - - if (x >= this.x && x < this.x + this.width) - { - if (y >= this.y && y < this.y + this.height) - { - return true; + Rectangle.prototype.clone = function () { + return new Rectangle(this.x, this.y, this.width, this.height); + }; + /** + * Copies another rectangle to this one. + * + * @param {PIXI.Rectangle} rectangle - The rectangle to copy from. + * @return {PIXI.Rectangle} Returns itself. + */ + Rectangle.prototype.copyFrom = function (rectangle) { + this.x = rectangle.x; + this.y = rectangle.y; + this.width = rectangle.width; + this.height = rectangle.height; + return this; + }; + /** + * Copies this rectangle to another one. + * + * @param {PIXI.Rectangle} rectangle - The rectangle to copy to. + * @return {PIXI.Rectangle} Returns given parameter. + */ + Rectangle.prototype.copyTo = function (rectangle) { + rectangle.x = this.x; + rectangle.y = this.y; + rectangle.width = this.width; + rectangle.height = this.height; + return rectangle; + }; + /** + * Checks whether the x and y coordinates given are contained within this Rectangle + * + * @param {number} x - The X coordinate of the point to test + * @param {number} y - The Y coordinate of the point to test + * @return {boolean} Whether the x/y coordinates are within this Rectangle + */ + Rectangle.prototype.contains = function (x, y) { + if (this.width <= 0 || this.height <= 0) { + return false; } - } - - return false; - }; - - /** - * Pads the rectangle making it grow in all directions. - * - * @param {number} paddingX - The horizontal padding amount. - * @param {number} paddingY - The vertical padding amount. - */ - Rectangle.prototype.pad = function pad (paddingX, paddingY) - { - paddingX = paddingX || 0; - paddingY = paddingY || ((paddingY !== 0) ? paddingX : 0); - - this.x -= paddingX; - this.y -= paddingY; - - this.width += paddingX * 2; - this.height += paddingY * 2; - }; - - /** - * Fits this rectangle around the passed one. - * - * @param {PIXI.Rectangle} rectangle - The rectangle to fit. - */ - Rectangle.prototype.fit = function fit (rectangle) - { - var x1 = Math.max(this.x, rectangle.x); - var x2 = Math.min(this.x + this.width, rectangle.x + rectangle.width); - var y1 = Math.max(this.y, rectangle.y); - var y2 = Math.min(this.y + this.height, rectangle.y + rectangle.height); - - this.x = x1; - this.width = Math.max(x2 - x1, 0); - this.y = y1; - this.height = Math.max(y2 - y1, 0); - }; - - /** - * Enlarges rectangle that way its corners lie on grid - * - * @param {number} [resolution=1] resolution - * @param {number} [eps=0.001] precision - */ - Rectangle.prototype.ceil = function ceil (resolution, eps) - { - if ( resolution === void 0 ) { resolution = 1; } - if ( eps === void 0 ) { eps = 0.001; } - - var x2 = Math.ceil((this.x + this.width - eps) * resolution) / resolution; - var y2 = Math.ceil((this.y + this.height - eps) * resolution) / resolution; - - this.x = Math.floor((this.x + eps) * resolution) / resolution; - this.y = Math.floor((this.y + eps) * resolution) / resolution; - - this.width = x2 - this.x; - this.height = y2 - this.y; - }; - - /** - * Enlarges this rectangle to include the passed rectangle. - * - * @param {PIXI.Rectangle} rectangle - The rectangle to include. - */ - Rectangle.prototype.enlarge = function enlarge (rectangle) - { - var x1 = Math.min(this.x, rectangle.x); - var x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width); - var y1 = Math.min(this.y, rectangle.y); - var y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height); - - this.x = x1; - this.width = x2 - x1; - this.y = y1; - this.height = y2 - y1; - }; - - Object.defineProperties( Rectangle.prototype, prototypeAccessors$2 ); - Object.defineProperties( Rectangle, staticAccessors$1 ); + if (x >= this.x && x < this.x + this.width) { + if (y >= this.y && y < this.y + this.height) { + return true; + } + } + return false; + }; + /** + * Pads the rectangle making it grow in all directions. + * If paddingY is omitted, both paddingX and paddingY will be set to paddingX. + * + * @param {number} [paddingX=0] - The horizontal padding amount. + * @param {number} [paddingY=0] - The vertical padding amount. + * @return {PIXI.Rectangle} Returns itself. + */ + Rectangle.prototype.pad = function (paddingX, paddingY) { + if (paddingX === void 0) { paddingX = 0; } + if (paddingY === void 0) { paddingY = paddingX; } + this.x -= paddingX; + this.y -= paddingY; + this.width += paddingX * 2; + this.height += paddingY * 2; + return this; + }; + /** + * Fits this rectangle around the passed one. + * + * @param {PIXI.Rectangle} rectangle - The rectangle to fit. + * @return {PIXI.Rectangle} Returns itself. + */ + Rectangle.prototype.fit = function (rectangle) { + var x1 = Math.max(this.x, rectangle.x); + var x2 = Math.min(this.x + this.width, rectangle.x + rectangle.width); + var y1 = Math.max(this.y, rectangle.y); + var y2 = Math.min(this.y + this.height, rectangle.y + rectangle.height); + this.x = x1; + this.width = Math.max(x2 - x1, 0); + this.y = y1; + this.height = Math.max(y2 - y1, 0); + return this; + }; + /** + * Enlarges rectangle that way its corners lie on grid + * + * @param {number} [resolution=1] resolution + * @param {number} [eps=0.001] precision + * @return {PIXI.Rectangle} Returns itself. + */ + Rectangle.prototype.ceil = function (resolution, eps) { + if (resolution === void 0) { resolution = 1; } + if (eps === void 0) { eps = 0.001; } + var x2 = Math.ceil((this.x + this.width - eps) * resolution) / resolution; + var y2 = Math.ceil((this.y + this.height - eps) * resolution) / resolution; + this.x = Math.floor((this.x + eps) * resolution) / resolution; + this.y = Math.floor((this.y + eps) * resolution) / resolution; + this.width = x2 - this.x; + this.height = y2 - this.y; + return this; + }; + /** + * Enlarges this rectangle to include the passed rectangle. + * + * @param {PIXI.Rectangle} rectangle - The rectangle to include. + * @return {PIXI.Rectangle} Returns itself. + */ + Rectangle.prototype.enlarge = function (rectangle) { + var x1 = Math.min(this.x, rectangle.x); + var x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width); + var y1 = Math.min(this.y, rectangle.y); + var y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height); + this.x = x1; + this.width = x2 - x1; + this.y = y1; + this.height = y2 - y1; + return this; + }; + return Rectangle; + }()); /** * The Circle object is used to help draw graphics and can also be used to specify a hit area for displayObjects. @@ -10802,84 +10688,77 @@ var PIXI = (function (exports) { * @class * @memberof PIXI */ - var Circle = function Circle(x, y, radius) - { - if ( x === void 0 ) { x = 0; } - if ( y === void 0 ) { y = 0; } - if ( radius === void 0 ) { radius = 0; } - + var Circle = /** @class */ (function () { /** - * @member {number} - * @default 0 + * @param {number} [x=0] - The X coordinate of the center of this circle + * @param {number} [y=0] - The Y coordinate of the center of this circle + * @param {number} [radius=0] - The radius of the circle */ - this.x = x; - - /** - * @member {number} - * @default 0 - */ - this.y = y; - - /** - * @member {number} - * @default 0 - */ - this.radius = radius; - - /** - * The type of the object, mainly used to avoid `instanceof` checks - * - * @member {number} - * @readOnly - * @default PIXI.SHAPES.CIRC - * @see PIXI.SHAPES - */ - this.type = SHAPES.CIRC; - }; - - /** - * Creates a clone of this Circle instance - * - * @return {PIXI.Circle} a copy of the Circle - */ - Circle.prototype.clone = function clone () - { - return new Circle(this.x, this.y, this.radius); - }; - - /** - * Checks whether the x and y coordinates given are contained within this circle - * - * @param {number} x - The X coordinate of the point to test - * @param {number} y - The Y coordinate of the point to test - * @return {boolean} Whether the x/y coordinates are within this Circle - */ - Circle.prototype.contains = function contains (x, y) - { - if (this.radius <= 0) - { - return false; + function Circle(x, y, radius) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + if (radius === void 0) { radius = 0; } + /** + * @member {number} + * @default 0 + */ + this.x = x; + /** + * @member {number} + * @default 0 + */ + this.y = y; + /** + * @member {number} + * @default 0 + */ + this.radius = radius; + /** + * The type of the object, mainly used to avoid `instanceof` checks + * + * @member {number} + * @readOnly + * @default PIXI.SHAPES.CIRC + * @see PIXI.SHAPES + */ + this.type = exports.SHAPES.CIRC; } - - var r2 = this.radius * this.radius; - var dx = (this.x - x); - var dy = (this.y - y); - - dx *= dx; - dy *= dy; - - return (dx + dy <= r2); - }; - - /** - * Returns the framing rectangle of the circle as a Rectangle object - * - * @return {PIXI.Rectangle} the framing rectangle - */ - Circle.prototype.getBounds = function getBounds () - { - return new Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2); - }; + /** + * Creates a clone of this Circle instance + * + * @return {PIXI.Circle} a copy of the Circle + */ + Circle.prototype.clone = function () { + return new Circle(this.x, this.y, this.radius); + }; + /** + * Checks whether the x and y coordinates given are contained within this circle + * + * @param {number} x - The X coordinate of the point to test + * @param {number} y - The Y coordinate of the point to test + * @return {boolean} Whether the x/y coordinates are within this Circle + */ + Circle.prototype.contains = function (x, y) { + if (this.radius <= 0) { + return false; + } + var r2 = this.radius * this.radius; + var dx = (this.x - x); + var dy = (this.y - y); + dx *= dx; + dy *= dy; + return (dx + dy <= r2); + }; + /** + * Returns the framing rectangle of the circle as a Rectangle object + * + * @return {PIXI.Rectangle} the framing rectangle + */ + Circle.prototype.getBounds = function () { + return new Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2); + }; + return Circle; + }()); /** * The Ellipse object is used to help draw graphics and can also be used to specify a hit area for displayObjects. @@ -10887,91 +10766,84 @@ var PIXI = (function (exports) { * @class * @memberof PIXI */ - var Ellipse = function Ellipse(x, y, halfWidth, halfHeight) - { - if ( x === void 0 ) { x = 0; } - if ( y === void 0 ) { y = 0; } - if ( halfWidth === void 0 ) { halfWidth = 0; } - if ( halfHeight === void 0 ) { halfHeight = 0; } - + var Ellipse = /** @class */ (function () { /** - * @member {number} - * @default 0 + * @param {number} [x=0] - The X coordinate of the center of this ellipse + * @param {number} [y=0] - The Y coordinate of the center of this ellipse + * @param {number} [halfWidth=0] - The half width of this ellipse + * @param {number} [halfHeight=0] - The half height of this ellipse */ - this.x = x; - - /** - * @member {number} - * @default 0 - */ - this.y = y; - - /** - * @member {number} - * @default 0 - */ - this.width = halfWidth; - - /** - * @member {number} - * @default 0 - */ - this.height = halfHeight; - - /** - * The type of the object, mainly used to avoid `instanceof` checks - * - * @member {number} - * @readOnly - * @default PIXI.SHAPES.ELIP - * @see PIXI.SHAPES - */ - this.type = SHAPES.ELIP; - }; - - /** - * Creates a clone of this Ellipse instance - * - * @return {PIXI.Ellipse} a copy of the ellipse - */ - Ellipse.prototype.clone = function clone () - { - return new Ellipse(this.x, this.y, this.width, this.height); - }; - - /** - * Checks whether the x and y coordinates given are contained within this ellipse - * - * @param {number} x - The X coordinate of the point to test - * @param {number} y - The Y coordinate of the point to test - * @return {boolean} Whether the x/y coords are within this ellipse - */ - Ellipse.prototype.contains = function contains (x, y) - { - if (this.width <= 0 || this.height <= 0) - { - return false; + function Ellipse(x, y, halfWidth, halfHeight) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + if (halfWidth === void 0) { halfWidth = 0; } + if (halfHeight === void 0) { halfHeight = 0; } + /** + * @member {number} + * @default 0 + */ + this.x = x; + /** + * @member {number} + * @default 0 + */ + this.y = y; + /** + * @member {number} + * @default 0 + */ + this.width = halfWidth; + /** + * @member {number} + * @default 0 + */ + this.height = halfHeight; + /** + * The type of the object, mainly used to avoid `instanceof` checks + * + * @member {number} + * @readOnly + * @default PIXI.SHAPES.ELIP + * @see PIXI.SHAPES + */ + this.type = exports.SHAPES.ELIP; } - - // normalize the coords to an ellipse with center 0,0 - var normx = ((x - this.x) / this.width); - var normy = ((y - this.y) / this.height); - - normx *= normx; - normy *= normy; - - return (normx + normy <= 1); - }; - - /** - * Returns the framing rectangle of the ellipse as a Rectangle object - * - * @return {PIXI.Rectangle} the framing rectangle - */ - Ellipse.prototype.getBounds = function getBounds () - { - return new Rectangle(this.x - this.width, this.y - this.height, this.width, this.height); - }; + /** + * Creates a clone of this Ellipse instance + * + * @return {PIXI.Ellipse} a copy of the ellipse + */ + Ellipse.prototype.clone = function () { + return new Ellipse(this.x, this.y, this.width, this.height); + }; + /** + * Checks whether the x and y coordinates given are contained within this ellipse + * + * @param {number} x - The X coordinate of the point to test + * @param {number} y - The Y coordinate of the point to test + * @return {boolean} Whether the x/y coords are within this ellipse + */ + Ellipse.prototype.contains = function (x, y) { + if (this.width <= 0 || this.height <= 0) { + return false; + } + // normalize the coords to an ellipse with center 0,0 + var normx = ((x - this.x) / this.width); + var normy = ((y - this.y) / this.height); + normx *= normx; + normy *= normy; + return (normx + normy <= 1); + }; + /** + * Returns the framing rectangle of the ellipse as a Rectangle object + * + * @return {PIXI.Rectangle} the framing rectangle + */ + Ellipse.prototype.getBounds = function () { + return new Rectangle(this.x - this.width, this.y - this.height, this.width, this.height); + }; + return Ellipse; + }()); /** * A class to define a shape via user defined co-orinates. @@ -10979,101 +10851,92 @@ var PIXI = (function (exports) { * @class * @memberof PIXI */ - var Polygon = function Polygon() - { - var arguments$1 = arguments; + var Polygon = /** @class */ (function () { + /** + * @param {PIXI.Point[]|number[]|number[][]} points - This can be an array of Points + * that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or + * the arguments passed can be all the points of the polygon e.g. + * `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the arguments passed can be flat + * x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers. + */ + function Polygon() { + var arguments$1 = arguments; - var points = [], len = arguments.length; - while ( len-- ) { points[ len ] = arguments$1[ len ]; } - - if (Array.isArray(points[0])) - { - points = points[0]; - } - - // if this is an array of points, convert it to a flat array of numbers - if (points[0] instanceof Point) - { - var p = []; - - for (var i = 0, il = points.length; i < il; i++) - { - p.push(points[i].x, points[i].y); + var points = []; + for (var _i = 0; _i < arguments.length; _i++) { + points[_i] = arguments$1[_i]; } - - points = p; - } - - /** - * An array of the points of this polygon - * - * @member {number[]} - */ - this.points = points; - - /** - * The type of the object, mainly used to avoid `instanceof` checks - * - * @member {number} - * @readOnly - * @default PIXI.SHAPES.POLY - * @see PIXI.SHAPES - */ - this.type = SHAPES.POLY; - - /** - * `false` after moveTo, `true` after `closePath`. In all other cases it is `true`. - * @member {boolean} - * @default true - */ - this.closeStroke = true; - }; - - /** - * Creates a clone of this polygon - * - * @return {PIXI.Polygon} a copy of the polygon - */ - Polygon.prototype.clone = function clone () - { - var polygon = new Polygon(this.points.slice()); - - polygon.closeStroke = this.closeStroke; - - return polygon; - }; - - /** - * Checks whether the x and y coordinates passed to this function are contained within this polygon - * - * @param {number} x - The X coordinate of the point to test - * @param {number} y - The Y coordinate of the point to test - * @return {boolean} Whether the x/y coordinates are within this polygon - */ - Polygon.prototype.contains = function contains (x, y) - { - var inside = false; - - // use some raycasting to test hits - // https://github.com/substack/point-in-polygon/blob/master/index.js - var length = this.points.length / 2; - - for (var i = 0, j = length - 1; i < length; j = i++) - { - var xi = this.points[i * 2]; - var yi = this.points[(i * 2) + 1]; - var xj = this.points[j * 2]; - var yj = this.points[(j * 2) + 1]; - var intersect = ((yi > y) !== (yj > y)) && (x < ((xj - xi) * ((y - yi) / (yj - yi))) + xi); - - if (intersect) - { - inside = !inside; + if (Array.isArray(points[0])) { + points = points[0]; } + // if this is an array of points, convert it to a flat array of numbers + if (points[0] instanceof Point) { + points = points; + var p = []; + for (var i = 0, il = points.length; i < il; i++) { + p.push(points[i].x, points[i].y); + } + points = p; + } + /** + * An array of the points of this polygon + * + * @member {number[]} + */ + this.points = points; + /** + * The type of the object, mainly used to avoid `instanceof` checks + * + * @member {number} + * @readOnly + * @default PIXI.SHAPES.POLY + * @see PIXI.SHAPES + */ + this.type = exports.SHAPES.POLY; + /** + * `false` after moveTo, `true` after `closePath`. In all other cases it is `true`. + * @member {boolean} + * @default true + */ + this.closeStroke = true; } - - return inside; - }; + /** + * Creates a clone of this polygon + * + * @return {PIXI.Polygon} a copy of the polygon + */ + Polygon.prototype.clone = function () { + var points = this.points.slice(); + var polygon = new Polygon(points); + polygon.closeStroke = this.closeStroke; + return polygon; + }; + /** + * Checks whether the x and y coordinates passed to this function are contained within this polygon + * + * @param {number} x - The X coordinate of the point to test + * @param {number} y - The Y coordinate of the point to test + * @return {boolean} Whether the x/y coordinates are within this polygon + */ + Polygon.prototype.contains = function (x, y) { + var inside = false; + // use some raycasting to test hits + // https://github.com/substack/point-in-polygon/blob/master/index.js + var length = this.points.length / 2; + for (var i = 0, j = length - 1; i < length; j = i++) { + var xi = this.points[i * 2]; + var yi = this.points[(i * 2) + 1]; + var xj = this.points[j * 2]; + var yj = this.points[(j * 2) + 1]; + var intersect = ((yi > y) !== (yj > y)) && (x < ((xj - xi) * ((y - yi) / (yj - yi))) + xi); + if (intersect) { + inside = !inside; + } + } + return inside; + }; + return Polygon; + }()); /** * The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its @@ -11082,119 +10945,108 @@ var PIXI = (function (exports) { * @class * @memberof PIXI */ - var RoundedRectangle = function RoundedRectangle(x, y, width, height, radius) - { - if ( x === void 0 ) { x = 0; } - if ( y === void 0 ) { y = 0; } - if ( width === void 0 ) { width = 0; } - if ( height === void 0 ) { height = 0; } - if ( radius === void 0 ) { radius = 20; } - + var RoundedRectangle = /** @class */ (function () { /** - * @member {number} - * @default 0 + * @param {number} [x=0] - The X coordinate of the upper-left corner of the rounded rectangle + * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rounded rectangle + * @param {number} [width=0] - The overall width of this rounded rectangle + * @param {number} [height=0] - The overall height of this rounded rectangle + * @param {number} [radius=20] - Controls the radius of the rounded corners */ - this.x = x; - - /** - * @member {number} - * @default 0 - */ - this.y = y; - - /** - * @member {number} - * @default 0 - */ - this.width = width; - - /** - * @member {number} - * @default 0 - */ - this.height = height; - - /** - * @member {number} - * @default 20 - */ - this.radius = radius; - - /** - * The type of the object, mainly used to avoid `instanceof` checks - * - * @member {number} - * @readonly - * @default PIXI.SHAPES.RREC - * @see PIXI.SHAPES - */ - this.type = SHAPES.RREC; - }; - - /** - * Creates a clone of this Rounded Rectangle - * - * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle - */ - RoundedRectangle.prototype.clone = function clone () - { - return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius); - }; - - /** - * Checks whether the x and y coordinates given are contained within this Rounded Rectangle - * - * @param {number} x - The X coordinate of the point to test - * @param {number} y - The Y coordinate of the point to test - * @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle - */ - RoundedRectangle.prototype.contains = function contains (x, y) - { - if (this.width <= 0 || this.height <= 0) - { - return false; + function RoundedRectangle(x, y, width, height, radius) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + if (width === void 0) { width = 0; } + if (height === void 0) { height = 0; } + if (radius === void 0) { radius = 20; } + /** + * @member {number} + * @default 0 + */ + this.x = x; + /** + * @member {number} + * @default 0 + */ + this.y = y; + /** + * @member {number} + * @default 0 + */ + this.width = width; + /** + * @member {number} + * @default 0 + */ + this.height = height; + /** + * @member {number} + * @default 20 + */ + this.radius = radius; + /** + * The type of the object, mainly used to avoid `instanceof` checks + * + * @member {number} + * @readonly + * @default PIXI.SHAPES.RREC + * @see PIXI.SHAPES + */ + this.type = exports.SHAPES.RREC; } - if (x >= this.x && x <= this.x + this.width) - { - if (y >= this.y && y <= this.y + this.height) - { - if ((y >= this.y + this.radius && y <= this.y + this.height - this.radius) - || (x >= this.x + this.radius && x <= this.x + this.width - this.radius)) - { - return true; - } - var dx = x - (this.x + this.radius); - var dy = y - (this.y + this.radius); - var radius2 = this.radius * this.radius; - - if ((dx * dx) + (dy * dy) <= radius2) - { - return true; - } - dx = x - (this.x + this.width - this.radius); - if ((dx * dx) + (dy * dy) <= radius2) - { - return true; - } - dy = y - (this.y + this.height - this.radius); - if ((dx * dx) + (dy * dy) <= radius2) - { - return true; - } - dx = x - (this.x + this.radius); - if ((dx * dx) + (dy * dy) <= radius2) - { - return true; + /** + * Creates a clone of this Rounded Rectangle + * + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle + */ + RoundedRectangle.prototype.clone = function () { + return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius); + }; + /** + * Checks whether the x and y coordinates given are contained within this Rounded Rectangle + * + * @param {number} x - The X coordinate of the point to test + * @param {number} y - The Y coordinate of the point to test + * @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle + */ + RoundedRectangle.prototype.contains = function (x, y) { + if (this.width <= 0 || this.height <= 0) { + return false; + } + if (x >= this.x && x <= this.x + this.width) { + if (y >= this.y && y <= this.y + this.height) { + if ((y >= this.y + this.radius && y <= this.y + this.height - this.radius) + || (x >= this.x + this.radius && x <= this.x + this.width - this.radius)) { + return true; + } + var dx = x - (this.x + this.radius); + var dy = y - (this.y + this.radius); + var radius2 = this.radius * this.radius; + if ((dx * dx) + (dy * dy) <= radius2) { + return true; + } + dx = x - (this.x + this.width - this.radius); + if ((dx * dx) + (dy * dy) <= radius2) { + return true; + } + dy = y - (this.y + this.height - this.radius); + if ((dx * dx) + (dy * dy) <= radius2) { + return true; + } + dx = x - (this.x + this.radius); + if ((dx * dx) + (dy * dy) <= radius2) { + return true; + } } } - } - - return false; - }; + return false; + }; + return RoundedRectangle; + }()); /*! - * @pixi/display - v5.1.3 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/display - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/display is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -11370,15 +11222,28 @@ var PIXI = (function (exports) { /** * Adds sprite frame, transformed. * - * @param {PIXI.Transform} transform - TODO - * @param {number} x0 - TODO - * @param {number} y0 - TODO - * @param {number} x1 - TODO - * @param {number} y1 - TODO + * @param {PIXI.Transform} transform - transform to apply + * @param {number} x0 - left X of frame + * @param {number} y0 - top Y of frame + * @param {number} x1 - right X of frame + * @param {number} y1 - bottom Y of frame */ Bounds.prototype.addFrame = function addFrame (transform, x0, y0, x1, y1) { - var matrix = transform.worldTransform; + this.addFrameMatrix(transform.worldTransform, x0, y0, x1, y1); + }; + + /** + * Adds sprite frame, multiplied by matrix + * + * @param {PIXI.Matrix} matrix - matrix to apply + * @param {number} x0 - left X of frame + * @param {number} y0 - top Y of frame + * @param {number} x1 - right X of frame + * @param {number} y1 - bottom Y of frame + */ + Bounds.prototype.addFrameMatrix = function addFrameMatrix (matrix, x0, y0, x1, y1) + { var a = matrix.a; var b = matrix.b; var c = matrix.c; @@ -11467,7 +11332,21 @@ var PIXI = (function (exports) { */ Bounds.prototype.addVertices = function addVertices (transform, vertices, beginOffset, endOffset) { - var matrix = transform.worldTransform; + this.addVerticesMatrix(transform.worldTransform, vertices, beginOffset, endOffset); + }; + + /** + * Add an array of mesh vertices + * + * @param {PIXI.Matrix} matrix - mesh matrix + * @param {Float32Array} vertices - mesh coordinates in array + * @param {number} beginOffset - begin offset + * @param {number} endOffset - end offset, excluded + * @param {number} [padX] - x padding + * @param {number} [padY] - y padding + */ + Bounds.prototype.addVerticesMatrix = function addVerticesMatrix (matrix, vertices, beginOffset, endOffset, padX, padY) + { var a = matrix.a; var b = matrix.b; var c = matrix.c; @@ -11475,6 +11354,9 @@ var PIXI = (function (exports) { var tx = matrix.tx; var ty = matrix.ty; + padX = padX || 0; + padY = padY || 0; + var minX = this.minX; var minY = this.minY; var maxX = this.maxX; @@ -11487,10 +11369,10 @@ var PIXI = (function (exports) { var x = (a * rawX) + (c * rawY) + tx; var y = (d * rawY) + (b * rawX) + ty; - minX = x < minX ? x : minX; - minY = y < minY ? y : minY; - maxX = x > maxX ? x : maxX; - maxY = y > maxY ? y : maxY; + minX = Math.min(minX, x - padX); + maxX = Math.max(maxX, x + padX); + minY = Math.min(minY, y - padY); + maxY = Math.max(maxY, y + padY); } this.minX = minX; @@ -11544,6 +11426,17 @@ var PIXI = (function (exports) { } }; + /** + * Adds other Bounds, multiplied by matrix. Bounds shouldn't be empty + * + * @param {PIXI.Bounds} bounds other bounds + * @param {PIXI.Matrix} matrix multiplicator + */ + Bounds.prototype.addBoundsMatrix = function addBoundsMatrix (bounds, matrix) + { + this.addFrameMatrix(matrix, bounds.minX, bounds.minY, bounds.maxX, bounds.maxY); + }; + /** * Adds other Bounds, masked with Rectangle * @@ -11571,6 +11464,50 @@ var PIXI = (function (exports) { } }; + /** + * Pads bounds object, making it grow in all directions. + * If paddingY is omitted, both paddingX and paddingY will be set to paddingX. + * + * @param {number} [paddingX=0] - The horizontal padding amount. + * @param {number} [paddingY=0] - The vertical padding amount. + */ + Bounds.prototype.pad = function pad (paddingX, paddingY) + { + paddingX = paddingX || 0; + paddingY = paddingY || ((paddingY !== 0) ? paddingX : 0); + + if (!this.isEmpty()) + { + this.minX -= paddingX; + this.maxX += paddingX; + this.minY -= paddingY; + this.maxY += paddingY; + } + }; + + /** + * Adds padded frame. (x0, y0) should be strictly less than (x1, y1) + * + * @param {number} x0 - left X of frame + * @param {number} y0 - top Y of frame + * @param {number} x1 - right X of frame + * @param {number} y1 - bottom Y of frame + * @param {number} padX - padding X + * @param {number} padY - padding Y + */ + Bounds.prototype.addFramePad = function addFramePad (x0, y0, x1, y1, padX, padY) + { + x0 -= padX; + y0 -= padY; + x1 += padX; + y1 += padY; + + this.minX = this.minX < x0 ? this.minX : x0; + this.maxX = this.maxX > x1 ? this.maxX : x1; + this.minY = this.minY < y0 ? this.minY : y0; + this.maxY = this.maxY > y1 ? this.maxY : y1; + }; + // _tempDisplayObjectParent = new DisplayObject(); /** @@ -11726,6 +11663,12 @@ var PIXI = (function (exports) { * @member {boolean} */ this.isSprite = false; + + /** + * Does any other displayObject use this object as a mask? + * @member {boolean} + */ + this.isMask = false; } if ( EventEmitter ) { DisplayObject.__proto__ = EventEmitter; } @@ -12038,12 +11981,13 @@ var PIXI = (function (exports) { this.transform = null; this.parent = null; - this._bounds = null; this._currentBounds = null; this._mask = null; + this.filters = null; this.filterArea = null; + this.hitArea = null; this.interactive = false; this.interactiveChildren = false; @@ -12274,16 +12218,20 @@ var PIXI = (function (exports) { { if (this._mask) { - this._mask.renderable = true; - this._mask.isMask = false; + var maskObject = this._mask.maskObject || this._mask; + + maskObject.renderable = true; + maskObject.isMask = false; } this._mask = value; if (this._mask) { - this._mask.renderable = false; - this._mask.isMask = true; + var maskObject$1 = this._mask.maskObject || this._mask; + + maskObject$1.renderable = false; + maskObject$1.isMask = true; } }; @@ -12763,8 +12711,10 @@ var PIXI = (function (exports) { // TODO: filter+mask, need to mask both somehow if (child._mask) { - child._mask.calculateBounds(); - this._bounds.addBoundsMask(child._bounds, child._mask._bounds); + var maskObject = child._mask.maskObject || child._mask; + + maskObject.calculateBounds(); + this._bounds.addBoundsMask(child._bounds, maskObject._bounds); } else if (child.filterArea) { @@ -12988,8 +12938,8 @@ var PIXI = (function (exports) { Container.prototype.containerUpdateTransform = Container.prototype.updateTransform; /*! - * @pixi/accessibility - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/accessibility - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/accessibility is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -13059,6 +13009,36 @@ var PIXI = (function (exports) { * @todo Needs docs. */ _accessibleDiv: false, + + /** + * Specify the type of div the accessible layer is. Screen readers treat the element differently + * depending on this type. Defaults to button. + * + * @member {string} + * @memberof PIXI.DisplayObject# + * @default 'button' + */ + accessibleType: 'button', + + /** + * Specify the pointer-events the accessible div will use + * Defaults to auto. + * + * @member {string} + * @memberof PIXI.DisplayObject# + * @default 'auto' + */ + accessiblePointerEvents: 'auto', + + /** + * Setting to false will prevent any children inside this container to + * be accessible. Defaults to true. + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @default true + */ + accessibleChildren: true, }; // add some extra variables to the container.. @@ -13295,7 +13275,7 @@ var PIXI = (function (exports) { */ AccessibilityManager.prototype.updateAccessibleObjects = function updateAccessibleObjects (displayObject) { - if (!displayObject.visible) + if (!displayObject.visible || !displayObject.accessibleChildren) { return; } @@ -13402,6 +13382,14 @@ var PIXI = (function (exports) { div.setAttribute('aria-label', child.accessibleHint); } } + + // the title or index may have changed, if so lets update it! + if (child.accessibleTitle !== div.title || child.tabIndex !== div.tabIndex) + { + div.title = child.accessibleTitle; + div.tabIndex = child.tabIndex; + if (this.debug) { this.updateDebugHTML(div); } + } } } @@ -13409,6 +13397,17 @@ var PIXI = (function (exports) { this.renderId++; }; + /** + * private function that will visually add the information to the + * accessability div + * + * @param {HTMLDivElement} div + */ + AccessibilityManager.prototype.updateDebugHTML = function updateDebugHTML (div) + { + div.innerHTML = "type: " + (div.type) + "
title : " + (div.title) + "
tabIndex: " + (div.tabIndex); + }; + /** * Adjust the hit area based on the bounds of a display object * @@ -13457,7 +13456,7 @@ var PIXI = (function (exports) { div.style.width = DIV_TOUCH_SIZE + "px"; div.style.height = DIV_TOUCH_SIZE + "px"; - div.style.backgroundColor = this.debug ? 'rgba(255,0,0,0.5)' : 'transparent'; + div.style.backgroundColor = this.debug ? 'rgba(255,255,255,0.5)' : 'transparent'; div.style.position = 'absolute'; div.style.zIndex = DIV_TOUCH_ZINDEX; div.style.borderStyle = 'none'; @@ -13489,6 +13488,11 @@ var PIXI = (function (exports) { div.addEventListener('focusout', this._onFocusOut.bind(this)); } + // set pointer events + div.style.pointerEvents = displayObject.accessiblePointerEvents; + // set the type, this defaults to button! + div.type = displayObject.accessibleType; + if (displayObject.accessibleTitle && displayObject.accessibleTitle !== null) { div.title = displayObject.accessibleTitle; @@ -13505,7 +13509,7 @@ var PIXI = (function (exports) { div.setAttribute('aria-label', displayObject.accessibleHint); } - // + if (this.debug) { this.updateDebugHTML(div); } displayObject._accessibleActive = true; displayObject._accessibleDiv = div; @@ -13625,8 +13629,8 @@ var PIXI = (function (exports) { }); /*! - * @pixi/runner - v5.1.1 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/runner - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/runner is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -13638,8 +13642,10 @@ var PIXI = (function (exports) { * * like a signal.. * ``` + * import { Runner } from '@pixi/runner'; + * * const myObject = { - * loaded: new PIXI.Runner('loaded') + * loaded: new Runner('loaded') * } * * const listener = { @@ -13655,8 +13661,10 @@ var PIXI = (function (exports) { * * Or for handling calling the same function on many items * ``` + * import { Runner } from '@pixi/runner'; + * * const myGame = { - * update: new PIXI.Runner('update') + * update: new Runner('update') * } * * const gameObject = { @@ -13672,173 +13680,153 @@ var PIXI = (function (exports) { * @class * @memberof PIXI */ - var Runner = function Runner(name) - { - this.items = []; - this._name = name; - this._aliasCount = 0; - }; - - var prototypeAccessors$3 = { empty: { configurable: true },name: { configurable: true } }; - - /** - * Dispatch/Broadcast Runner to all listeners added to the queue. - * @param {...any} params - optional parameters to pass to each listener - */ - Runner.prototype.emit = function emit (a0, a1, a2, a3, a4, a5, a6, a7) - { - if (arguments.length > 8) - { - throw new Error('max arguments reached'); - } - - var ref = this; - var name = ref.name; - var items = ref.items; - - this._aliasCount++; - - for (var i = 0, len = items.length; i < len; i++) - { - items[i][name](a0, a1, a2, a3, a4, a5, a6, a7); - } - - if (items === this.items) - { - this._aliasCount--; - } - - return this; - }; - - Runner.prototype.ensureNonAliasedItems = function ensureNonAliasedItems () - { - if (this._aliasCount > 0 && this.items.length > 1) - { + var Runner = /** @class */ (function () { + /** + * @param {string} name the function name that will be executed on the listeners added to this Runner. + */ + function Runner(name) { + this.items = []; + this._name = name; this._aliasCount = 0; - this.items = this.items.slice(0); } - }; - - /** - * Add a listener to the Runner - * - * Runners do not need to have scope or functions passed to them. - * All that is required is to pass the listening object and ensure that it has contains a function that has the same name - * as the name provided to the Runner when it was created. - * - * Eg A listener passed to this Runner will require a 'complete' function. - * - * ``` - * const complete = new PIXI.Runner('complete'); - * ``` - * - * The scope used will be the object itself. - * - * @param {any} item - The object that will be listening. - */ - Runner.prototype.add = function add (item) - { - if (item[this._name]) - { + /** + * Dispatch/Broadcast Runner to all listeners added to the queue. + * @param {...any} params - optional parameters to pass to each listener + * @return {PIXI.Runner} + */ + Runner.prototype.emit = function (a0, a1, a2, a3, a4, a5, a6, a7) { + if (arguments.length > 8) { + throw new Error('max arguments reached'); + } + var _a = this, name = _a.name, items = _a.items; + this._aliasCount++; + for (var i = 0, len = items.length; i < len; i++) { + items[i][name](a0, a1, a2, a3, a4, a5, a6, a7); + } + if (items === this.items) { + this._aliasCount--; + } + return this; + }; + Runner.prototype.ensureNonAliasedItems = function () { + if (this._aliasCount > 0 && this.items.length > 1) { + this._aliasCount = 0; + this.items = this.items.slice(0); + } + }; + /** + * Add a listener to the Runner + * + * Runners do not need to have scope or functions passed to them. + * All that is required is to pass the listening object and ensure that it has contains a function that has the same name + * as the name provided to the Runner when it was created. + * + * Eg A listener passed to this Runner will require a 'complete' function. + * + * ``` + * import { Runner } from '@pixi/runner'; + * + * const complete = new Runner('complete'); + * ``` + * + * The scope used will be the object itself. + * + * @param {any} item - The object that will be listening. + * @return {PIXI.Runner} + */ + Runner.prototype.add = function (item) { + if (item[this._name]) { + this.ensureNonAliasedItems(); + this.remove(item); + this.items.push(item); + } + return this; + }; + /** + * Remove a single listener from the dispatch queue. + * @param {any} item - The listenr that you would like to remove. + * @return {PIXI.Runner} + */ + Runner.prototype.remove = function (item) { + var index = this.items.indexOf(item); + if (index !== -1) { + this.ensureNonAliasedItems(); + this.items.splice(index, 1); + } + return this; + }; + /** + * Check to see if the listener is already in the Runner + * @param {any} item - The listener that you would like to check. + */ + Runner.prototype.contains = function (item) { + return this.items.indexOf(item) !== -1; + }; + /** + * Remove all listeners from the Runner + * @return {PIXI.Runner} + */ + Runner.prototype.removeAll = function () { this.ensureNonAliasedItems(); - this.remove(item); - this.items.push(item); - } - - return this; - }; - - /** - * Remove a single listener from the dispatch queue. - * @param {any} item - The listenr that you would like to remove. - */ - Runner.prototype.remove = function remove (item) - { - var index = this.items.indexOf(item); - - if (index !== -1) - { - this.ensureNonAliasedItems(); - this.items.splice(index, 1); - } - - return this; - }; - - /** - * Check to see if the listener is already in the Runner - * @param {any} item - The listener that you would like to check. - */ - Runner.prototype.contains = function contains (item) - { - return this.items.indexOf(item) !== -1; - }; - - /** - * Remove all listeners from the Runner - */ - Runner.prototype.removeAll = function removeAll () - { - this.ensureNonAliasedItems(); - this.items.length = 0; - - return this; - }; - - /** - * Remove all references, don't use after this. - */ - Runner.prototype.destroy = function destroy () - { - this.removeAll(); - this.items = null; - this._name = null; - }; - - /** - * `true` if there are no this Runner contains no listeners - * - * @member {boolean} - * @readonly - */ - prototypeAccessors$3.empty.get = function () - { - return this.items.length === 0; - }; - - /** - * The name of the runner. - * - * @member {string} - * @readonly - */ - prototypeAccessors$3.name.get = function () - { - return this._name; - }; - - Object.defineProperties( Runner.prototype, prototypeAccessors$3 ); - - /** - * Alias for `emit` - * @memberof PIXI.Runner# - * @method dispatch - * @see PIXI.Runner#emit - */ - Runner.prototype.dispatch = Runner.prototype.emit; - - /** - * Alias for `emit` - * @memberof PIXI.Runner# - * @method run - * @see PIXI.Runner#emit - */ - Runner.prototype.run = Runner.prototype.emit; + this.items.length = 0; + return this; + }; + /** + * Remove all references, don't use after this. + */ + Runner.prototype.destroy = function () { + this.removeAll(); + this.items = null; + this._name = null; + }; + Object.defineProperty(Runner.prototype, "empty", { + /** + * `true` if there are no this Runner contains no listeners + * + * @member {boolean} + * @readonly + */ + get: function () { + return this.items.length === 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Runner.prototype, "name", { + /** + * The name of the runner. + * + * @member {string} + * @readonly + */ + get: function () { + return this._name; + }, + enumerable: true, + configurable: true + }); + return Runner; + }()); + Object.defineProperties(Runner.prototype, { + /** + * Alias for `emit` + * @memberof PIXI.Runner# + * @method dispatch + * @see PIXI.Runner#emit + */ + dispatch: { value: Runner.prototype.emit }, + /** + * Alias for `emit` + * @memberof PIXI.Runner# + * @method run + * @see PIXI.Runner#emit + */ + run: { value: Runner.prototype.emit }, + }); /*! - * @pixi/ticker - v5.1.3 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/ticker - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/ticker is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -13864,20 +13852,21 @@ var PIXI = (function (exports) { * @constant * @name UPDATE_PRIORITY * @memberof PIXI - * @type {object} + * @enum {number} * @property {number} INTERACTION=50 Highest priority, used for {@link PIXI.interaction.InteractionManager} * @property {number} HIGH=25 High priority updating, {@link PIXI.VideoBaseTexture} and {@link PIXI.AnimatedSprite} * @property {number} NORMAL=0 Default priority for ticker events, see {@link PIXI.Ticker#add}. * @property {number} LOW=-25 Low priority used for {@link PIXI.Application} rendering. * @property {number} UTILITY=-50 Lowest priority used for {@link PIXI.prepare.BasePrepare} utility. */ - var UPDATE_PRIORITY = { - INTERACTION: 50, - HIGH: 25, - NORMAL: 0, - LOW: -25, - UTILITY: -50, - }; + + (function (UPDATE_PRIORITY) { + UPDATE_PRIORITY[UPDATE_PRIORITY["INTERACTION"] = 50] = "INTERACTION"; + UPDATE_PRIORITY[UPDATE_PRIORITY["HIGH"] = 25] = "HIGH"; + UPDATE_PRIORITY[UPDATE_PRIORITY["NORMAL"] = 0] = "NORMAL"; + UPDATE_PRIORITY[UPDATE_PRIORITY["LOW"] = -25] = "LOW"; + UPDATE_PRIORITY[UPDATE_PRIORITY["UTILITY"] = -50] = "UTILITY"; + })(exports.UPDATE_PRIORITY || (exports.UPDATE_PRIORITY = {})); /** * Internal class for handling the priority sorting of ticker handlers. @@ -13886,164 +13875,140 @@ var PIXI = (function (exports) { * @class * @memberof PIXI */ - var TickerListener = function TickerListener(fn, context, priority, once) - { - if ( context === void 0 ) { context = null; } - if ( priority === void 0 ) { priority = 0; } - if ( once === void 0 ) { once = false; } - + var TickerListener = /** @class */ (function () { /** - * The handler function to execute. + * Constructor * @private - * @member {Function} + * @param {Function} fn - The listener function to be added for one update + * @param {*} [context=null] - The listener context + * @param {number} [priority=0] - The priority for emitting + * @param {boolean} [once=false] - If the handler should fire once */ - this.fn = fn; - - /** - * The calling to execute. - * @private - * @member {*} - */ - this.context = context; - - /** - * The current priority. - * @private - * @member {number} - */ - this.priority = priority; - - /** - * If this should only execute once. - * @private - * @member {boolean} - */ - this.once = once; - - /** - * The next item in chain. - * @private - * @member {TickerListener} - */ - this.next = null; - - /** - * The previous item in chain. - * @private - * @member {TickerListener} - */ - this.previous = null; - - /** - * `true` if this listener has been destroyed already. - * @member {boolean} - * @private - */ - this._destroyed = false; - }; - - /** - * Simple compare function to figure out if a function and context match. - * @private - * @param {Function} fn - The listener function to be added for one update - * @param {Function} context - The listener context - * @return {boolean} `true` if the listener match the arguments - */ - TickerListener.prototype.match = function match (fn, context) - { - context = context || null; - - return this.fn === fn && this.context === context; - }; - - /** - * Emit by calling the current function. - * @private - * @param {number} deltaTime - time since the last emit. - * @return {TickerListener} Next ticker - */ - TickerListener.prototype.emit = function emit (deltaTime) - { - if (this.fn) - { - if (this.context) - { - this.fn.call(this.context, deltaTime); - } - else - { - this.fn(deltaTime); - } - } - - var redirect = this.next; - - if (this.once) - { - this.destroy(true); - } - - // Soft-destroying should remove - // the next reference - if (this._destroyed) - { + function TickerListener(fn, context, priority, once) { + if (context === void 0) { context = null; } + if (priority === void 0) { priority = 0; } + if (once === void 0) { once = false; } + /** + * The handler function to execute. + * @private + * @member {Function} + */ + this.fn = fn; + /** + * The calling to execute. + * @private + * @member {*} + */ + this.context = context; + /** + * The current priority. + * @private + * @member {number} + */ + this.priority = priority; + /** + * If this should only execute once. + * @private + * @member {boolean} + */ + this.once = once; + /** + * The next item in chain. + * @private + * @member {TickerListener} + */ this.next = null; + /** + * The previous item in chain. + * @private + * @member {TickerListener} + */ + this.previous = null; + /** + * `true` if this listener has been destroyed already. + * @member {boolean} + * @private + */ + this._destroyed = false; } - - return redirect; - }; - - /** - * Connect to the list. - * @private - * @param {TickerListener} previous - Input node, previous listener - */ - TickerListener.prototype.connect = function connect (previous) - { - this.previous = previous; - if (previous.next) - { - previous.next.previous = this; - } - this.next = previous.next; - previous.next = this; - }; - - /** - * Destroy and don't use after this. - * @private - * @param {boolean} [hard = false] `true` to remove the `next` reference, this - * is considered a hard destroy. Soft destroy maintains the next reference. - * @return {TickerListener} The listener to redirect while emitting or removing. - */ - TickerListener.prototype.destroy = function destroy (hard) - { - if ( hard === void 0 ) { hard = false; } - - this._destroyed = true; - this.fn = null; - this.context = null; - - // Disconnect, hook up next and previous - if (this.previous) - { - this.previous.next = this.next; - } - - if (this.next) - { - this.next.previous = this.previous; - } - - // Redirect to the next item - var redirect = this.next; - - // Remove references - this.next = hard ? null : redirect; - this.previous = null; - - return redirect; - }; + /** + * Simple compare function to figure out if a function and context match. + * @private + * @param {Function} fn - The listener function to be added for one update + * @param {any} [context] - The listener context + * @return {boolean} `true` if the listener match the arguments + */ + TickerListener.prototype.match = function (fn, context) { + if (context === void 0) { context = null; } + return this.fn === fn && this.context === context; + }; + /** + * Emit by calling the current function. + * @private + * @param {number} deltaTime - time since the last emit. + * @return {TickerListener} Next ticker + */ + TickerListener.prototype.emit = function (deltaTime) { + if (this.fn) { + if (this.context) { + this.fn.call(this.context, deltaTime); + } + else { + this.fn(deltaTime); + } + } + var redirect = this.next; + if (this.once) { + this.destroy(true); + } + // Soft-destroying should remove + // the next reference + if (this._destroyed) { + this.next = null; + } + return redirect; + }; + /** + * Connect to the list. + * @private + * @param {TickerListener} previous - Input node, previous listener + */ + TickerListener.prototype.connect = function (previous) { + this.previous = previous; + if (previous.next) { + previous.next.previous = this; + } + this.next = previous.next; + previous.next = this; + }; + /** + * Destroy and don't use after this. + * @private + * @param {boolean} [hard = false] `true` to remove the `next` reference, this + * is considered a hard destroy. Soft destroy maintains the next reference. + * @return {TickerListener} The listener to redirect while emitting or removing. + */ + TickerListener.prototype.destroy = function (hard) { + if (hard === void 0) { hard = false; } + this._destroyed = true; + this.fn = null; + this.context = null; + // Disconnect, hook up next and previous + if (this.previous) { + this.previous.next = this.next; + } + if (this.next) { + this.next.previous = this.previous; + } + // Redirect to the next item + var redirect = this.next; + // Remove references + this.next = hard ? null : redirect; + this.previous = null; + return redirect; + }; + return TickerListener; + }()); /** * A Ticker class that runs an update loop that other objects listen to. @@ -14054,633 +14019,534 @@ var PIXI = (function (exports) { * @class * @memberof PIXI */ - var Ticker = function Ticker() - { - var this$1 = this; - - /** - * The first listener. All new listeners added are chained on this. - * @private - * @type {TickerListener} - */ - this._head = new TickerListener(null, null, Infinity); - - /** - * Internal current frame request ID - * @type {?number} - * @private - */ - this._requestId = null; - - /** - * Internal value managed by minFPS property setter and getter. - * This is the maximum allowed milliseconds between updates. - * @type {number} - * @private - */ - this._maxElapsedMS = 100; - - /** - * Internal value managed by maxFPS property setter and getter. - * This is the minimum allowed milliseconds between updates. - * @private - */ - this._minElapsedMS = 0; - - /** - * Whether or not this ticker should invoke the method - * {@link PIXI.Ticker#start} automatically - * when a listener is added. - * - * @member {boolean} - * @default false - */ - this.autoStart = false; - - /** - * Scalar time value from last frame to this frame. - * This value is capped by setting {@link PIXI.Ticker#minFPS} - * and is scaled with {@link PIXI.Ticker#speed}. - * **Note:** The cap may be exceeded by scaling. - * - * @member {number} - * @default 1 - */ - this.deltaTime = 1; - - /** - * Scaler time elapsed in milliseconds from last frame to this frame. - * This value is capped by setting {@link PIXI.Ticker#minFPS} - * and is scaled with {@link PIXI.Ticker#speed}. - * **Note:** The cap may be exceeded by scaling. - * If the platform supports DOMHighResTimeStamp, - * this value will have a precision of 1 µs. - * Defaults to target frame time - * - * @member {number} - * @default 16.66 - */ - this.deltaMS = 1 / settings.TARGET_FPMS; - - /** - * Time elapsed in milliseconds from last frame to this frame. - * Opposed to what the scalar {@link PIXI.Ticker#deltaTime} - * is based, this value is neither capped nor scaled. - * If the platform supports DOMHighResTimeStamp, - * this value will have a precision of 1 µs. - * Defaults to target frame time - * - * @member {number} - * @default 16.66 - */ - this.elapsedMS = 1 / settings.TARGET_FPMS; - - /** - * The last time {@link PIXI.Ticker#update} was invoked. - * This value is also reset internally outside of invoking - * update, but only when a new animation frame is requested. - * If the platform supports DOMHighResTimeStamp, - * this value will have a precision of 1 µs. - * - * @member {number} - * @default -1 - */ - this.lastTime = -1; - - /** - * Factor of current {@link PIXI.Ticker#deltaTime}. - * @example - * // Scales ticker.deltaTime to what would be - * // the equivalent of approximately 120 FPS - * ticker.speed = 2; - * - * @member {number} - * @default 1 - */ - this.speed = 1; - - /** - * Whether or not this ticker has been started. - * `true` if {@link PIXI.Ticker#start} has been called. - * `false` if {@link PIXI.Ticker#stop} has been called. - * While `false`, this value may change to `true` in the - * event of {@link PIXI.Ticker#autoStart} being `true` - * and a listener is added. - * - * @member {boolean} - * @default false - */ - this.started = false; - - /** - * If enabled, deleting is disabled. - * @member {boolean} - * @default false - * @private - */ - this._protected = false; - - /** - * The last time keyframe was executed. - * Maintains a relatively fixed interval with the previous value. - * @member {number} - * @default -1 - * @private - */ - this._lastFrame = -1; - - /** - * Internal tick method bound to ticker instance. - * This is because in early 2015, Function.bind - * is still 60% slower in high performance scenarios. - * Also separating frame requests from update method - * so listeners may be called at any time and with - * any animation API, just invoke ticker.update(time). - * - * @private - * @param {number} time - Time since last tick. - */ - this._tick = function (time) { - this$1._requestId = null; - - if (this$1.started) - { - // Invoke listeners now - this$1.update(time); - // Listener side effects may have modified ticker state. - if (this$1.started && this$1._requestId === null && this$1._head.next) - { - this$1._requestId = requestAnimationFrame(this$1._tick); + var Ticker = /** @class */ (function () { + function Ticker() { + var _this = this; + /** + * The first listener. All new listeners added are chained on this. + * @private + * @type {TickerListener} + */ + this._head = new TickerListener(null, null, Infinity); + /** + * Internal current frame request ID + * @type {?number} + * @private + */ + this._requestId = null; + /** + * Internal value managed by minFPS property setter and getter. + * This is the maximum allowed milliseconds between updates. + * @type {number} + * @private + */ + this._maxElapsedMS = 100; + /** + * Internal value managed by maxFPS property setter and getter. + * This is the minimum allowed milliseconds between updates. + * @type {number} + * @private + */ + this._minElapsedMS = 0; + /** + * Whether or not this ticker should invoke the method + * {@link PIXI.Ticker#start} automatically + * when a listener is added. + * + * @member {boolean} + * @default false + */ + this.autoStart = false; + /** + * Scalar time value from last frame to this frame. + * This value is capped by setting {@link PIXI.Ticker#minFPS} + * and is scaled with {@link PIXI.Ticker#speed}. + * **Note:** The cap may be exceeded by scaling. + * + * @member {number} + * @default 1 + */ + this.deltaTime = 1; + /** + * Scaler time elapsed in milliseconds from last frame to this frame. + * This value is capped by setting {@link PIXI.Ticker#minFPS} + * and is scaled with {@link PIXI.Ticker#speed}. + * **Note:** The cap may be exceeded by scaling. + * If the platform supports DOMHighResTimeStamp, + * this value will have a precision of 1 µs. + * Defaults to target frame time + * + * @member {number} + * @default 16.66 + */ + this.deltaMS = 1 / settings.TARGET_FPMS; + /** + * Time elapsed in milliseconds from last frame to this frame. + * Opposed to what the scalar {@link PIXI.Ticker#deltaTime} + * is based, this value is neither capped nor scaled. + * If the platform supports DOMHighResTimeStamp, + * this value will have a precision of 1 µs. + * Defaults to target frame time + * + * @member {number} + * @default 16.66 + */ + this.elapsedMS = 1 / settings.TARGET_FPMS; + /** + * The last time {@link PIXI.Ticker#update} was invoked. + * This value is also reset internally outside of invoking + * update, but only when a new animation frame is requested. + * If the platform supports DOMHighResTimeStamp, + * this value will have a precision of 1 µs. + * + * @member {number} + * @default -1 + */ + this.lastTime = -1; + /** + * Factor of current {@link PIXI.Ticker#deltaTime}. + * @example + * // Scales ticker.deltaTime to what would be + * // the equivalent of approximately 120 FPS + * ticker.speed = 2; + * + * @member {number} + * @default 1 + */ + this.speed = 1; + /** + * Whether or not this ticker has been started. + * `true` if {@link PIXI.Ticker#start} has been called. + * `false` if {@link PIXI.Ticker#stop} has been called. + * While `false`, this value may change to `true` in the + * event of {@link PIXI.Ticker#autoStart} being `true` + * and a listener is added. + * + * @member {boolean} + * @default false + */ + this.started = false; + /** + * If enabled, deleting is disabled. + * @member {boolean} + * @default false + * @private + */ + this._protected = false; + /** + * The last time keyframe was executed. + * Maintains a relatively fixed interval with the previous value. + * @member {number} + * @default -1 + * @private + */ + this._lastFrame = -1; + /** + * Internal tick method bound to ticker instance. + * This is because in early 2015, Function.bind + * is still 60% slower in high performance scenarios. + * Also separating frame requests from update method + * so listeners may be called at any time and with + * any animation API, just invoke ticker.update(time). + * + * @private + * @param {number} time - Time since last tick. + */ + this._tick = function (time) { + _this._requestId = null; + if (_this.started) { + // Invoke listeners now + _this.update(time); + // Listener side effects may have modified ticker state. + if (_this.started && _this._requestId === null && _this._head.next) { + _this._requestId = requestAnimationFrame(_this._tick); + } } + }; + } + /** + * Conditionally requests a new animation frame. + * If a frame has not already been requested, and if the internal + * emitter has listeners, a new frame is requested. + * + * @private + */ + Ticker.prototype._requestIfNeeded = function () { + if (this._requestId === null && this._head.next) { + // ensure callbacks get correct delta + this.lastTime = performance.now(); + this._lastFrame = this.lastTime; + this._requestId = requestAnimationFrame(this._tick); } }; - }; - - var prototypeAccessors$4 = { FPS: { configurable: true },minFPS: { configurable: true },maxFPS: { configurable: true } }; - var staticAccessors$2 = { shared: { configurable: true },system: { configurable: true } }; - - /** - * Conditionally requests a new animation frame. - * If a frame has not already been requested, and if the internal - * emitter has listeners, a new frame is requested. - * - * @private - */ - Ticker.prototype._requestIfNeeded = function _requestIfNeeded () - { - if (this._requestId === null && this._head.next) - { - // ensure callbacks get correct delta - this.lastTime = performance.now(); - this._lastFrame = this.lastTime; - this._requestId = requestAnimationFrame(this._tick); - } - }; - - /** - * Conditionally cancels a pending animation frame. - * - * @private - */ - Ticker.prototype._cancelIfNeeded = function _cancelIfNeeded () - { - if (this._requestId !== null) - { - cancelAnimationFrame(this._requestId); - this._requestId = null; - } - }; - - /** - * Conditionally requests a new animation frame. - * If the ticker has been started it checks if a frame has not already - * been requested, and if the internal emitter has listeners. If these - * conditions are met, a new frame is requested. If the ticker has not - * been started, but autoStart is `true`, then the ticker starts now, - * and continues with the previous conditions to request a new frame. - * - * @private - */ - Ticker.prototype._startIfPossible = function _startIfPossible () - { - if (this.started) - { - this._requestIfNeeded(); - } - else if (this.autoStart) - { - this.start(); - } - }; - - /** - * Register a handler for tick events. Calls continuously unless - * it is removed or the ticker is stopped. - * - * @param {Function} fn - The listener function to be added for updates - * @param {*} [context] - The listener context - * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting - * @returns {PIXI.Ticker} This instance of a ticker - */ - Ticker.prototype.add = function add (fn, context, priority) - { - if ( priority === void 0 ) { priority = UPDATE_PRIORITY.NORMAL; } - - return this._addListener(new TickerListener(fn, context, priority)); - }; - - /** - * Add a handler for the tick event which is only execute once. - * - * @param {Function} fn - The listener function to be added for one update - * @param {*} [context] - The listener context - * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting - * @returns {PIXI.Ticker} This instance of a ticker - */ - Ticker.prototype.addOnce = function addOnce (fn, context, priority) - { - if ( priority === void 0 ) { priority = UPDATE_PRIORITY.NORMAL; } - - return this._addListener(new TickerListener(fn, context, priority, true)); - }; - - /** - * Internally adds the event handler so that it can be sorted by priority. - * Priority allows certain handler (user, AnimatedSprite, Interaction) to be run - * before the rendering. - * - * @private - * @param {TickerListener} listener - Current listener being added. - * @returns {PIXI.Ticker} This instance of a ticker - */ - Ticker.prototype._addListener = function _addListener (listener) - { - // For attaching to head - var current = this._head.next; - var previous = this._head; - - // Add the first item - if (!current) - { - listener.connect(previous); - } - else - { - // Go from highest to lowest priority - while (current) - { - if (listener.priority > current.priority) - { - listener.connect(previous); - break; - } - previous = current; - current = current.next; + /** + * Conditionally cancels a pending animation frame. + * + * @private + */ + Ticker.prototype._cancelIfNeeded = function () { + if (this._requestId !== null) { + cancelAnimationFrame(this._requestId); + this._requestId = null; } - - // Not yet connected - if (!listener.previous) - { + }; + /** + * Conditionally requests a new animation frame. + * If the ticker has been started it checks if a frame has not already + * been requested, and if the internal emitter has listeners. If these + * conditions are met, a new frame is requested. If the ticker has not + * been started, but autoStart is `true`, then the ticker starts now, + * and continues with the previous conditions to request a new frame. + * + * @private + */ + Ticker.prototype._startIfPossible = function () { + if (this.started) { + this._requestIfNeeded(); + } + else if (this.autoStart) { + this.start(); + } + }; + /** + * Register a handler for tick events. Calls continuously unless + * it is removed or the ticker is stopped. + * + * @param {Function} fn - The listener function to be added for updates + * @param {*} [context] - The listener context + * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting + * @returns {PIXI.Ticker} This instance of a ticker + */ + Ticker.prototype.add = function (fn, context, priority) { + if (priority === void 0) { priority = exports.UPDATE_PRIORITY.NORMAL; } + return this._addListener(new TickerListener(fn, context, priority)); + }; + /** + * Add a handler for the tick event which is only execute once. + * + * @param {Function} fn - The listener function to be added for one update + * @param {*} [context] - The listener context + * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting + * @returns {PIXI.Ticker} This instance of a ticker + */ + Ticker.prototype.addOnce = function (fn, context, priority) { + if (priority === void 0) { priority = exports.UPDATE_PRIORITY.NORMAL; } + return this._addListener(new TickerListener(fn, context, priority, true)); + }; + /** + * Internally adds the event handler so that it can be sorted by priority. + * Priority allows certain handler (user, AnimatedSprite, Interaction) to be run + * before the rendering. + * + * @private + * @param {TickerListener} listener - Current listener being added. + * @returns {PIXI.Ticker} This instance of a ticker + */ + Ticker.prototype._addListener = function (listener) { + // For attaching to head + var current = this._head.next; + var previous = this._head; + // Add the first item + if (!current) { listener.connect(previous); } - } - - this._startIfPossible(); - - return this; - }; - - /** - * Removes any handlers matching the function and context parameters. - * If no handlers are left after removing, then it cancels the animation frame. - * - * @param {Function} fn - The listener function to be removed - * @param {*} [context] - The listener context to be removed - * @returns {PIXI.Ticker} This instance of a ticker - */ - Ticker.prototype.remove = function remove (fn, context) - { - var listener = this._head.next; - - while (listener) - { - // We found a match, lets remove it - // no break to delete all possible matches - // incase a listener was added 2+ times - if (listener.match(fn, context)) - { - listener = listener.destroy(); - } - else - { - listener = listener.next; - } - } - - if (!this._head.next) - { - this._cancelIfNeeded(); - } - - return this; - }; - - /** - * Starts the ticker. If the ticker has listeners - * a new animation frame is requested at this point. - */ - Ticker.prototype.start = function start () - { - if (!this.started) - { - this.started = true; - this._requestIfNeeded(); - } - }; - - /** - * Stops the ticker. If the ticker has requested - * an animation frame it is canceled at this point. - */ - Ticker.prototype.stop = function stop () - { - if (this.started) - { - this.started = false; - this._cancelIfNeeded(); - } - }; - - /** - * Destroy the ticker and don't use after this. Calling - * this method removes all references to internal events. - */ - Ticker.prototype.destroy = function destroy () - { - if (!this._protected) - { - this.stop(); - - var listener = this._head.next; - - while (listener) - { - listener = listener.destroy(true); - } - - this._head.destroy(); - this._head = null; - } - }; - - /** - * Triggers an update. An update entails setting the - * current {@link PIXI.Ticker#elapsedMS}, - * the current {@link PIXI.Ticker#deltaTime}, - * invoking all listeners with current deltaTime, - * and then finally setting {@link PIXI.Ticker#lastTime} - * with the value of currentTime that was provided. - * This method will be called automatically by animation - * frame callbacks if the ticker instance has been started - * and listeners are added. - * - * @param {number} [currentTime=performance.now()] - the current time of execution - */ - Ticker.prototype.update = function update (currentTime) - { - if ( currentTime === void 0 ) { currentTime = performance.now(); } - - var elapsedMS; - - // If the difference in time is zero or negative, we ignore most of the work done here. - // If there is no valid difference, then should be no reason to let anyone know about it. - // A zero delta, is exactly that, nothing should update. - // - // The difference in time can be negative, and no this does not mean time traveling. - // This can be the result of a race condition between when an animation frame is requested - // on the current JavaScript engine event loop, and when the ticker's start method is invoked - // (which invokes the internal _requestIfNeeded method). If a frame is requested before - // _requestIfNeeded is invoked, then the callback for the animation frame the ticker requests, - // can receive a time argument that can be less than the lastTime value that was set within - // _requestIfNeeded. This difference is in microseconds, but this is enough to cause problems. - // - // This check covers this browser engine timing issue, as well as if consumers pass an invalid - // currentTime value. This may happen if consumers opt-out of the autoStart, and update themselves. - - if (currentTime > this.lastTime) - { - // Save uncapped elapsedMS for measurement - elapsedMS = this.elapsedMS = currentTime - this.lastTime; - - // cap the milliseconds elapsed used for deltaTime - if (elapsedMS > this._maxElapsedMS) - { - elapsedMS = this._maxElapsedMS; - } - - elapsedMS *= this.speed; - - // If not enough time has passed, exit the function. - // Get ready for next frame by setting _lastFrame, but based on _minElapsedMS - // adjustment to ensure a relatively stable interval. - if (this._minElapsedMS) - { - var delta = currentTime - this._lastFrame | 0; - - if (delta < this._minElapsedMS) - { - return; + else { + // Go from highest to lowest priority + while (current) { + if (listener.priority > current.priority) { + listener.connect(previous); + break; + } + previous = current; + current = current.next; + } + // Not yet connected + if (!listener.previous) { + listener.connect(previous); } - - this._lastFrame = currentTime - (delta % this._minElapsedMS); } - - this.deltaMS = elapsedMS; - this.deltaTime = this.deltaMS * settings.TARGET_FPMS; - - // Cache a local reference, in-case ticker is destroyed - // during the emit, we can still check for head.next - var head = this._head; - - // Invoke listeners added to internal emitter - var listener = head.next; - - while (listener) - { - listener = listener.emit(this.deltaTime); + this._startIfPossible(); + return this; + }; + /** + * Removes any handlers matching the function and context parameters. + * If no handlers are left after removing, then it cancels the animation frame. + * + * @param {Function} fn - The listener function to be removed + * @param {*} [context] - The listener context to be removed + * @returns {PIXI.Ticker} This instance of a ticker + */ + Ticker.prototype.remove = function (fn, context) { + var listener = this._head.next; + while (listener) { + // We found a match, lets remove it + // no break to delete all possible matches + // incase a listener was added 2+ times + if (listener.match(fn, context)) { + listener = listener.destroy(); + } + else { + listener = listener.next; + } } - - if (!head.next) - { + if (!this._head.next) { this._cancelIfNeeded(); } - } - else - { - this.deltaTime = this.deltaMS = this.elapsedMS = 0; - } - - this.lastTime = currentTime; - }; - - /** - * The frames per second at which this ticker is running. - * The default is approximately 60 in most modern browsers. - * **Note:** This does not factor in the value of - * {@link PIXI.Ticker#speed}, which is specific - * to scaling {@link PIXI.Ticker#deltaTime}. - * - * @member {number} - * @readonly - */ - prototypeAccessors$4.FPS.get = function () - { - return 1000 / this.elapsedMS; - }; - - /** - * Manages the maximum amount of milliseconds allowed to - * elapse between invoking {@link PIXI.Ticker#update}. - * This value is used to cap {@link PIXI.Ticker#deltaTime}, - * but does not effect the measured value of {@link PIXI.Ticker#FPS}. - * When setting this property it is clamped to a value between - * `0` and `PIXI.settings.TARGET_FPMS * 1000`. - * - * @member {number} - * @default 10 - */ - prototypeAccessors$4.minFPS.get = function () - { - return 1000 / this._maxElapsedMS; - }; - - prototypeAccessors$4.minFPS.set = function (fps) // eslint-disable-line require-jsdoc - { - // Minimum must be below the maxFPS - var minFPS = Math.min(this.maxFPS, fps); - - // Must be at least 0, but below 1 / settings.TARGET_FPMS - var minFPMS = Math.min(Math.max(0, minFPS) / 1000, settings.TARGET_FPMS); - - this._maxElapsedMS = 1 / minFPMS; - }; - - /** - * Manages the minimum amount of milliseconds required to - * elapse between invoking {@link PIXI.Ticker#update}. - * This will effect the measured value of {@link PIXI.Ticker#FPS}. - * If it is set to `0`, then there is no limit; PixiJS will render as many frames as it can. - * Otherwise it will be at least `minFPS` - * - * @member {number} - * @default 0 - */ - prototypeAccessors$4.maxFPS.get = function () - { - if (this._minElapsedMS) - { - return Math.round(1000 / this._minElapsedMS); - } - - return 0; - }; - - prototypeAccessors$4.maxFPS.set = function (fps) - { - if (fps === 0) - { - this._minElapsedMS = 0; - } - else - { - // Max must be at least the minFPS - var maxFPS = Math.max(this.minFPS, fps); - - this._minElapsedMS = 1 / (maxFPS / 1000); - } - }; - - /** - * The shared ticker instance used by {@link PIXI.AnimatedSprite} and by - * {@link PIXI.VideoResource} to update animation frames / video textures. - * - * It may also be used by {@link PIXI.Application} if created with the `sharedTicker` option property set to true. - * - * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance. - * Please follow the examples for usage, including how to opt-out of auto-starting the shared ticker. - * - * @example - * let ticker = PIXI.Ticker.shared; - * // Set this to prevent starting this ticker when listeners are added. - * // By default this is true only for the PIXI.Ticker.shared instance. - * ticker.autoStart = false; - * // FYI, call this to ensure the ticker is stopped. It should be stopped - * // if you have not attempted to render anything yet. - * ticker.stop(); - * // Call this when you are ready for a running shared ticker. - * ticker.start(); - * - * @example - * // You may use the shared ticker to render... - * let renderer = PIXI.autoDetectRenderer(); - * let stage = new PIXI.Container(); - * document.body.appendChild(renderer.view); - * ticker.add(function (time) { - * renderer.render(stage); - * }); - * - * @example - * // Or you can just update it manually. - * ticker.autoStart = false; - * ticker.stop(); - * function animate(time) { - * ticker.update(time); - * renderer.render(stage); - * requestAnimationFrame(animate); - * } - * animate(performance.now()); - * - * @member {PIXI.Ticker} - * @static - */ - staticAccessors$2.shared.get = function () - { - if (!Ticker._shared) - { - var shared = Ticker._shared = new Ticker(); - - shared.autoStart = true; - shared._protected = true; - } - - return Ticker._shared; - }; - - /** - * The system ticker instance used by {@link PIXI.interaction.InteractionManager} and by - * {@link PIXI.BasePrepare} for core timing functionality that shouldn't usually need to be paused, - * unlike the `shared` ticker which drives visual animations and rendering which may want to be paused. - * - * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance. - * - * @member {PIXI.Ticker} - * @static - */ - staticAccessors$2.system.get = function () - { - if (!Ticker._system) - { - var system = Ticker._system = new Ticker(); - - system.autoStart = true; - system._protected = true; - } - - return Ticker._system; - }; - - Object.defineProperties( Ticker.prototype, prototypeAccessors$4 ); - Object.defineProperties( Ticker, staticAccessors$2 ); + return this; + }; + /** + * Starts the ticker. If the ticker has listeners + * a new animation frame is requested at this point. + */ + Ticker.prototype.start = function () { + if (!this.started) { + this.started = true; + this._requestIfNeeded(); + } + }; + /** + * Stops the ticker. If the ticker has requested + * an animation frame it is canceled at this point. + */ + Ticker.prototype.stop = function () { + if (this.started) { + this.started = false; + this._cancelIfNeeded(); + } + }; + /** + * Destroy the ticker and don't use after this. Calling + * this method removes all references to internal events. + */ + Ticker.prototype.destroy = function () { + if (!this._protected) { + this.stop(); + var listener = this._head.next; + while (listener) { + listener = listener.destroy(true); + } + this._head.destroy(); + this._head = null; + } + }; + /** + * Triggers an update. An update entails setting the + * current {@link PIXI.Ticker#elapsedMS}, + * the current {@link PIXI.Ticker#deltaTime}, + * invoking all listeners with current deltaTime, + * and then finally setting {@link PIXI.Ticker#lastTime} + * with the value of currentTime that was provided. + * This method will be called automatically by animation + * frame callbacks if the ticker instance has been started + * and listeners are added. + * + * @param {number} [currentTime=performance.now()] - the current time of execution + */ + Ticker.prototype.update = function (currentTime) { + if (currentTime === void 0) { currentTime = performance.now(); } + var elapsedMS; + // If the difference in time is zero or negative, we ignore most of the work done here. + // If there is no valid difference, then should be no reason to let anyone know about it. + // A zero delta, is exactly that, nothing should update. + // + // The difference in time can be negative, and no this does not mean time traveling. + // This can be the result of a race condition between when an animation frame is requested + // on the current JavaScript engine event loop, and when the ticker's start method is invoked + // (which invokes the internal _requestIfNeeded method). If a frame is requested before + // _requestIfNeeded is invoked, then the callback for the animation frame the ticker requests, + // can receive a time argument that can be less than the lastTime value that was set within + // _requestIfNeeded. This difference is in microseconds, but this is enough to cause problems. + // + // This check covers this browser engine timing issue, as well as if consumers pass an invalid + // currentTime value. This may happen if consumers opt-out of the autoStart, and update themselves. + if (currentTime > this.lastTime) { + // Save uncapped elapsedMS for measurement + elapsedMS = this.elapsedMS = currentTime - this.lastTime; + // cap the milliseconds elapsed used for deltaTime + if (elapsedMS > this._maxElapsedMS) { + elapsedMS = this._maxElapsedMS; + } + elapsedMS *= this.speed; + // If not enough time has passed, exit the function. + // Get ready for next frame by setting _lastFrame, but based on _minElapsedMS + // adjustment to ensure a relatively stable interval. + if (this._minElapsedMS) { + var delta = currentTime - this._lastFrame | 0; + if (delta < this._minElapsedMS) { + return; + } + this._lastFrame = currentTime - (delta % this._minElapsedMS); + } + this.deltaMS = elapsedMS; + this.deltaTime = this.deltaMS * settings.TARGET_FPMS; + // Cache a local reference, in-case ticker is destroyed + // during the emit, we can still check for head.next + var head = this._head; + // Invoke listeners added to internal emitter + var listener = head.next; + while (listener) { + listener = listener.emit(this.deltaTime); + } + if (!head.next) { + this._cancelIfNeeded(); + } + } + else { + this.deltaTime = this.deltaMS = this.elapsedMS = 0; + } + this.lastTime = currentTime; + }; + Object.defineProperty(Ticker.prototype, "FPS", { + /** + * The frames per second at which this ticker is running. + * The default is approximately 60 in most modern browsers. + * **Note:** This does not factor in the value of + * {@link PIXI.Ticker#speed}, which is specific + * to scaling {@link PIXI.Ticker#deltaTime}. + * + * @member {number} + * @readonly + */ + get: function () { + return 1000 / this.elapsedMS; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Ticker.prototype, "minFPS", { + /** + * Manages the maximum amount of milliseconds allowed to + * elapse between invoking {@link PIXI.Ticker#update}. + * This value is used to cap {@link PIXI.Ticker#deltaTime}, + * but does not effect the measured value of {@link PIXI.Ticker#FPS}. + * When setting this property it is clamped to a value between + * `0` and `PIXI.settings.TARGET_FPMS * 1000`. + * + * @member {number} + * @default 10 + */ + get: function () { + return 1000 / this._maxElapsedMS; + }, + set: function (fps) { + // Minimum must be below the maxFPS + var minFPS = Math.min(this.maxFPS, fps); + // Must be at least 0, but below 1 / settings.TARGET_FPMS + var minFPMS = Math.min(Math.max(0, minFPS) / 1000, settings.TARGET_FPMS); + this._maxElapsedMS = 1 / minFPMS; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Ticker.prototype, "maxFPS", { + /** + * Manages the minimum amount of milliseconds required to + * elapse between invoking {@link PIXI.Ticker#update}. + * This will effect the measured value of {@link PIXI.Ticker#FPS}. + * If it is set to `0`, then there is no limit; PixiJS will render as many frames as it can. + * Otherwise it will be at least `minFPS` + * + * @member {number} + * @default 0 + */ + get: function () { + if (this._minElapsedMS) { + return Math.round(1000 / this._minElapsedMS); + } + return 0; + }, + set: function (fps) { + if (fps === 0) { + this._minElapsedMS = 0; + } + else { + // Max must be at least the minFPS + var maxFPS = Math.max(this.minFPS, fps); + this._minElapsedMS = 1 / (maxFPS / 1000); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Ticker, "shared", { + /** + * The shared ticker instance used by {@link PIXI.AnimatedSprite} and by + * {@link PIXI.VideoResource} to update animation frames / video textures. + * + * It may also be used by {@link PIXI.Application} if created with the `sharedTicker` option property set to true. + * + * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance. + * Please follow the examples for usage, including how to opt-out of auto-starting the shared ticker. + * + * @example + * let ticker = PIXI.Ticker.shared; + * // Set this to prevent starting this ticker when listeners are added. + * // By default this is true only for the PIXI.Ticker.shared instance. + * ticker.autoStart = false; + * // FYI, call this to ensure the ticker is stopped. It should be stopped + * // if you have not attempted to render anything yet. + * ticker.stop(); + * // Call this when you are ready for a running shared ticker. + * ticker.start(); + * + * @example + * // You may use the shared ticker to render... + * let renderer = PIXI.autoDetectRenderer(); + * let stage = new PIXI.Container(); + * document.body.appendChild(renderer.view); + * ticker.add(function (time) { + * renderer.render(stage); + * }); + * + * @example + * // Or you can just update it manually. + * ticker.autoStart = false; + * ticker.stop(); + * function animate(time) { + * ticker.update(time); + * renderer.render(stage); + * requestAnimationFrame(animate); + * } + * animate(performance.now()); + * + * @member {PIXI.Ticker} + * @static + */ + get: function () { + if (!Ticker._shared) { + var shared = Ticker._shared = new Ticker(); + shared.autoStart = true; + shared._protected = true; + } + return Ticker._shared; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Ticker, "system", { + /** + * The system ticker instance used by {@link PIXI.interaction.InteractionManager} and by + * {@link PIXI.BasePrepare} for core timing functionality that shouldn't usually need to be paused, + * unlike the `shared` ticker which drives visual animations and rendering which may want to be paused. + * + * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance. + * + * @member {PIXI.Ticker} + * @static + */ + get: function () { + if (!Ticker._system) { + var system = Ticker._system = new Ticker(); + system.autoStart = true; + system._protected = true; + } + return Ticker._system; + }, + enumerable: true, + configurable: true + }); + return Ticker; + }()); /** * Middleware for for Application Ticker. @@ -14693,104 +14559,96 @@ var PIXI = (function (exports) { * @class * @memberof PIXI */ - var TickerPlugin = function TickerPlugin () {}; - - TickerPlugin.init = function init (options) - { - var this$1 = this; - - // Set default - options = Object.assign({ - autoStart: true, - sharedTicker: false, - }, options); - - // Create ticker setter - Object.defineProperty(this, 'ticker', - { - set: function set(ticker) - { - if (this._ticker) - { + var TickerPlugin = /** @class */ (function () { + function TickerPlugin() { + } + /** + * Initialize the plugin with scope of application instance + * + * @static + * @private + * @param {object} [options] - See application options + */ + TickerPlugin.init = function (options) { + var _this = this; + // Set default + options = Object.assign({ + autoStart: true, + sharedTicker: false, + }, options); + // Create ticker setter + Object.defineProperty(this, 'ticker', { + set: function (ticker) { + if (this._ticker) { this._ticker.remove(this.render, this); } this._ticker = ticker; - if (ticker) - { - ticker.add(this.render, this, UPDATE_PRIORITY.LOW); + if (ticker) { + ticker.add(this.render, this, exports.UPDATE_PRIORITY.LOW); } }, - get: function get() - { + get: function () { return this._ticker; }, }); - - /** - * Convenience method for stopping the render. - * - * @method PIXI.Application#stop - */ - this.stop = function () { - this$1._ticker.stop(); + /** + * Convenience method for stopping the render. + * + * @method PIXI.Application#stop + */ + this.stop = function () { + _this._ticker.stop(); + }; + /** + * Convenience method for starting the render. + * + * @method PIXI.Application#start + */ + this.start = function () { + _this._ticker.start(); + }; + /** + * Internal reference to the ticker. + * + * @type {PIXI.Ticker} + * @name _ticker + * @memberof PIXI.Application# + * @private + */ + this._ticker = null; + /** + * Ticker for doing render updates. + * + * @type {PIXI.Ticker} + * @name ticker + * @memberof PIXI.Application# + * @default PIXI.Ticker.shared + */ + this.ticker = options.sharedTicker ? Ticker.shared : new Ticker(); + // Start the rendering + if (options.autoStart) { + this.start(); + } }; - /** - * Convenience method for starting the render. + * Clean up the ticker, scoped to application. * - * @method PIXI.Application#start - */ - this.start = function () { - this$1._ticker.start(); - }; - - /** - * Internal reference to the ticker. - * - * @type {PIXI.Ticker} - * @name _ticker - * @memberof PIXI.Application# + * @static * @private */ - this._ticker = null; - - /** - * Ticker for doing render updates. - * - * @type {PIXI.Ticker} - * @name ticker - * @memberof PIXI.Application# - * @default PIXI.Ticker.shared - */ - this.ticker = options.sharedTicker ? Ticker.shared : new Ticker(); - - // Start the rendering - if (options.autoStart) - { - this.start(); - } - }; - - /** - * Clean up the ticker, scoped to application. - * - * @static - * @private - */ - TickerPlugin.destroy = function destroy () - { - if (this._ticker) - { - var oldTicker = this._ticker; - - this.ticker = null; - oldTicker.destroy(); - } - }; + TickerPlugin.destroy = function () { + if (this._ticker) { + var oldTicker = this._ticker; + this.ticker = null; + oldTicker.destroy(); + } + }; + return TickerPlugin; + }()); /*! - * @pixi/core - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/core - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/core is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -14866,7 +14724,7 @@ var PIXI = (function (exports) { this.onError = new Runner('onError', 1); }; - var prototypeAccessors$5 = { valid: { configurable: true },width: { configurable: true },height: { configurable: true } }; + var prototypeAccessors$1 = { valid: { configurable: true },width: { configurable: true },height: { configurable: true } }; /** * Bind to a parent BaseTexture @@ -14919,7 +14777,7 @@ var PIXI = (function (exports) { * @readonly * @member {boolean} */ - prototypeAccessors$5.valid.get = function () + prototypeAccessors$1.valid.get = function () { return !!this._width && !!this._height; }; @@ -14952,7 +14810,7 @@ var PIXI = (function (exports) { * @member {number} * @readonly */ - prototypeAccessors$5.width.get = function () + prototypeAccessors$1.width.get = function () { return this._width; }; @@ -14963,7 +14821,7 @@ var PIXI = (function (exports) { * @member {number} * @readonly */ - prototypeAccessors$5.height.get = function () + prototypeAccessors$1.height.get = function () { return this._height; }; @@ -15024,7 +14882,7 @@ var PIXI = (function (exports) { } }; - Object.defineProperties( Resource.prototype, prototypeAccessors$5 ); + Object.defineProperties( Resource.prototype, prototypeAccessors$1 ); /** * Base for all the image/canvas resources @@ -15096,7 +14954,7 @@ var PIXI = (function (exports) { source = source || this.source; - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, baseTexture.premultiplyAlpha); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, baseTexture.alphaMode === exports.ALPHA_MODES.UNPACK); if (!this.noSubImage && baseTexture.target === gl.TEXTURE_2D @@ -15211,12 +15069,20 @@ var PIXI = (function (exports) { ? options.createBitmap : settings.CREATE_IMAGE_BITMAP) && !!window.createImageBitmap; /** - * Controls texture premultiplyAlpha field + * Controls texture alphaMode field * Copies from options - * @member {boolean|null} + * Default is `null`, copies option from baseTexture + * + * @member {PIXI.ALPHA_MODES|null} * @readonly */ - this.premultiplyAlpha = options.premultiplyAlpha !== false; + this.alphaMode = typeof options.alphaMode === 'number' ? options.alphaMode : null; + + if (options.premultiplyAlpha !== undefined) + { + // triggers deprecation + this.premultiplyAlpha = options.premultiplyAlpha; + } /** * The ImageBitmap element created for HTMLImageElement @@ -15325,7 +15191,7 @@ var PIXI = (function (exports) { this._process = window.createImageBitmap(this.source, 0, 0, this.source.width, this.source.height, { - premultiplyAlpha: this.premultiplyAlpha ? 'premultiply' : 'none', + premultiplyAlpha: this.premultiplyAlpha === exports.ALPHA_MODES.UNPACK ? 'premultiply' : 'none', }) .then(function (bitmap) { if (this$1.destroyed) @@ -15352,7 +15218,12 @@ var PIXI = (function (exports) { */ ImageResource.prototype.upload = function upload (renderer, baseTexture, glTexture) { - baseTexture.premultiplyAlpha = this.premultiplyAlpha; + if (typeof this.alphaMode === 'number') + { + // bitmap stores unpack premultiply flag, we dont have to notify texImage2D about it + + baseTexture.alphaMode = this.alphaMode; + } if (!this.createBitmap) { @@ -15564,7 +15435,7 @@ var PIXI = (function (exports) { { var gl = renderer.gl; - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, baseTexture.premultiplyAlpha); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, baseTexture.alphaMode === exports.ALPHA_MODES.UNPACK); if (glTexture.width === baseTexture.width && glTexture.height === baseTexture.height) { @@ -15628,9 +15499,9 @@ var PIXI = (function (exports) { }(Resource)); var defaultBufferOptions = { - scaleMode: SCALE_MODES.NEAREST, - format: FORMATS.RGBA, - premultiplyAlpha: false, + scaleMode: exports.SCALE_MODES.NEAREST, + format: exports.FORMATS.RGBA, + alphaMode: exports.ALPHA_MODES.NPM, }; /** @@ -15652,7 +15523,7 @@ var PIXI = (function (exports) { * @param {PIXI.FORMATS} [options.format=PIXI.FORMATS.RGBA] - GL format type * @param {PIXI.TYPES} [options.type=PIXI.TYPES.UNSIGNED_BYTE] - GL data type * @param {PIXI.TARGETS} [options.target=PIXI.TARGETS.TEXTURE_2D] - GL texture target - * @param {boolean} [options.premultiplyAlpha=true] - Pre multiply the image alpha + * @param {PIXI.ALPHA_MODES} [options.alphaMode=PIXI.ALPHA_MODES.UNPACK] - Pre multiply the image alpha * @param {number} [options.width=0] - Width of the texture * @param {number} [options.height=0] - Height of the texture * @param {number} [options.resolution] - Resolution of the base texture @@ -15669,7 +15540,7 @@ var PIXI = (function (exports) { options = options || {}; - var premultiplyAlpha = options.premultiplyAlpha; + var alphaMode = options.alphaMode; var mipmap = options.mipmap; var anisotropicLevel = options.anisotropicLevel; var scaleMode = options.scaleMode; @@ -15749,7 +15620,7 @@ var PIXI = (function (exports) { * @member {PIXI.FORMATS} * @default PIXI.FORMATS.RGBA */ - this.format = format || FORMATS.RGBA; + this.format = format || exports.FORMATS.RGBA; /** * The type of resource data @@ -15757,7 +15628,7 @@ var PIXI = (function (exports) { * @member {PIXI.TYPES} * @default PIXI.TYPES.UNSIGNED_BYTE */ - this.type = type || TYPES.UNSIGNED_BYTE; + this.type = type || exports.TYPES.UNSIGNED_BYTE; /** * The target type @@ -15765,15 +15636,21 @@ var PIXI = (function (exports) { * @member {PIXI.TARGETS} * @default PIXI.TARGETS.TEXTURE_2D */ - this.target = target || TARGETS.TEXTURE_2D; + this.target = target || exports.TARGETS.TEXTURE_2D; /** - * Set to true to enable pre-multiplied alpha + * How to treat premultiplied alpha, see {@link PIXI.ALPHA_MODES}. * - * @member {boolean} - * @default true + * @member {PIXI.ALPHA_MODES} + * @default PIXI.ALPHA_MODES.UNPACK */ - this.premultiplyAlpha = premultiplyAlpha !== false; + this.alphaMode = alphaMode !== undefined ? alphaMode : exports.ALPHA_MODES.UNPACK; + + if (options.premultiplyAlpha !== undefined) + { + // triggers deprecation + this.premultiplyAlpha = options.premultiplyAlpha; + } /** * Global unique identifier for this BaseTexture @@ -15875,6 +15752,13 @@ var PIXI = (function (exports) { */ this._batchEnabled = 0; + /** + * Location inside texture batch, used by multi-texture renderers + * + * @member {number} + */ + this._batchLocation = 0; + /** * Fired when a not-immediately-available source finishes loading. * @@ -16171,13 +16055,17 @@ var PIXI = (function (exports) { * @param {string|HTMLImageElement|HTMLCanvasElement|SVGElement|HTMLVideoElement} source - The * source to create base texture from. * @param {object} [options] See {@link PIXI.BaseTexture}'s constructor for options. + * @param {boolean} [strict] Enforce strict-mode, see {@link PIXI.settings.STRICT_TEXTURE_CACHE}. * @returns {PIXI.BaseTexture} The new base texture. */ - BaseTexture.from = function from (source, options) + BaseTexture.from = function from (source, options, strict) { + if ( strict === void 0 ) { strict = settings.STRICT_TEXTURE_CACHE; } + + var isFrame = typeof source === 'string'; var cacheId = null; - if (typeof source === 'string') + if (isFrame) { cacheId = source; } @@ -16193,6 +16081,12 @@ var PIXI = (function (exports) { var baseTexture = BaseTextureCache[cacheId]; + // Strict-mode rejects invalid cacheIds + if (isFrame && strict && !baseTexture) + { + throw new Error(("The cacheId \"" + cacheId + "\" does not exist in BaseTextureCache.")); + } + if (!baseTexture) { baseTexture = new BaseTexture(source, options); @@ -16219,7 +16113,7 @@ var PIXI = (function (exports) { buffer = buffer || new Float32Array(width * height * 4); var resource = new BufferResource(buffer, { width: width, height: height }); - var type = buffer instanceof Float32Array ? TYPES.FLOAT : TYPES.UNSIGNED_BYTE; + var type = buffer instanceof Float32Array ? exports.TYPES.FLOAT : exports.TYPES.UNSIGNED_BYTE; return new BaseTexture(resource, Object.assign(defaultBufferOptions, options || { width: width, height: height, type: type })); }; @@ -16435,7 +16329,7 @@ var PIXI = (function (exports) { { Resource.prototype.bind.call(this, baseTexture); - baseTexture.target = TARGETS.TEXTURE_2D_ARRAY; + baseTexture.target = exports.TARGETS.TEXTURE_2D_ARRAY; for (var i = 0; i < this.length; i++) { @@ -16617,7 +16511,7 @@ var PIXI = (function (exports) { for (var i = 0; i < CubeResource.SIDES; i++) { - this.items[i].target = TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X + i; + this.items[i].target = exports.TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X + i; } if (options.autoLoad !== false) @@ -16640,7 +16534,7 @@ var PIXI = (function (exports) { { ArrayResource.prototype.bind.call(this, baseTexture); - baseTexture.target = TARGETS.TEXTURE_CUBE_MAP; + baseTexture.target = exports.TARGETS.TEXTURE_CUBE_MAP; }; /** @@ -17392,7 +17286,7 @@ var PIXI = (function (exports) { { var gl = renderer.gl; - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, baseTexture.premultiplyAlpha); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, baseTexture.alphaMode === exports.ALPHA_MODES.UNPACK); if (glTexture.width === baseTexture.width && glTexture.height === baseTexture.height) { @@ -17458,7 +17352,7 @@ var PIXI = (function (exports) { this.disposeRunner = new Runner('disposeFramebuffer', 2); }; - var prototypeAccessors$1$2 = { colorTexture: { configurable: true } }; + var prototypeAccessors$1$1 = { colorTexture: { configurable: true } }; /** * Reference to the colorTexture. @@ -17466,7 +17360,7 @@ var PIXI = (function (exports) { * @member {PIXI.Texture[]} * @readonly */ - prototypeAccessors$1$2.colorTexture.get = function () + prototypeAccessors$1$1.colorTexture.get = function () { return this.colorTextures[0]; }; @@ -17486,7 +17380,7 @@ var PIXI = (function (exports) { resolution: 1, mipmap: false, width: this.width, - height: this.height });// || new Texture(); + height: this.height }); this.dirtyId++; this.dirtyFormat++; @@ -17507,8 +17401,8 @@ var PIXI = (function (exports) { width: this.width, height: this.height, mipmap: false, - format: FORMATS.DEPTH_COMPONENT, - type: TYPES.UNSIGNED_SHORT });// UNSIGNED_SHORT; + format: exports.FORMATS.DEPTH_COMPONENT, + type: exports.TYPES.UNSIGNED_SHORT }); /* eslint-disable max-len */ this.dirtyId++; this.dirtyFormat++; @@ -17586,7 +17480,7 @@ var PIXI = (function (exports) { this.disposeRunner.run(this, false); }; - Object.defineProperties( Framebuffer.prototype, prototypeAccessors$1$2 ); + Object.defineProperties( Framebuffer.prototype, prototypeAccessors$1$1 ); /** * A BaseRenderTexture is a special texture that allows any PixiJS display object to be rendered to it. @@ -17674,14 +17568,14 @@ var PIXI = (function (exports) { /** * The data structure for the stencil masks. * - * @member {PIXI.Graphics[]} + * @member {PIXI.MaskData[]} */ - this.stencilMaskStack = []; + this.maskStack = []; /** * The data structure for the filters. * - * @member {PIXI.Graphics[]} + * @member {Object[]} */ this.filterStack = [{}]; } @@ -17814,7 +17708,7 @@ var PIXI = (function (exports) { * @protected * @param {PIXI.Rectangle} frame - The frame of the texture * @param {PIXI.Rectangle} baseFrame - The base frame of the texture - * @param {number} rotate - Rotation of frame, see {@link PIXI.GroupD8} + * @param {number} rotate - Rotation of frame, see {@link PIXI.groupD8} */ TextureUvs.prototype.set = function set (frame, baseFrame, rotate) { @@ -17831,21 +17725,21 @@ var PIXI = (function (exports) { var cX = (frame.x / tw) + w2; var cY = (frame.y / th) + h2; - rotate = GroupD8.add(rotate, GroupD8.NW); // NW is top-left corner - this.x0 = cX + (w2 * GroupD8.uX(rotate)); - this.y0 = cY + (h2 * GroupD8.uY(rotate)); + rotate = groupD8.add(rotate, groupD8.NW); // NW is top-left corner + this.x0 = cX + (w2 * groupD8.uX(rotate)); + this.y0 = cY + (h2 * groupD8.uY(rotate)); - rotate = GroupD8.add(rotate, 2); // rotate 90 degrees clockwise - this.x1 = cX + (w2 * GroupD8.uX(rotate)); - this.y1 = cY + (h2 * GroupD8.uY(rotate)); + rotate = groupD8.add(rotate, 2); // rotate 90 degrees clockwise + this.x1 = cX + (w2 * groupD8.uX(rotate)); + this.y1 = cY + (h2 * groupD8.uY(rotate)); - rotate = GroupD8.add(rotate, 2); - this.x2 = cX + (w2 * GroupD8.uX(rotate)); - this.y2 = cY + (h2 * GroupD8.uY(rotate)); + rotate = groupD8.add(rotate, 2); + this.x2 = cX + (w2 * groupD8.uX(rotate)); + this.y2 = cY + (h2 * groupD8.uY(rotate)); - rotate = GroupD8.add(rotate, 2); - this.x3 = cX + (w2 * GroupD8.uX(rotate)); - this.y3 = cY + (h2 * GroupD8.uY(rotate)); + rotate = groupD8.add(rotate, 2); + this.x3 = cX + (w2 * groupD8.uX(rotate)); + this.y3 = cY + (h2 * groupD8.uY(rotate)); } else { @@ -18185,18 +18079,21 @@ var PIXI = (function (exports) { * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param {number|string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|PIXI.BaseTexture} source + * @param {string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|PIXI.BaseTexture} source * Source to create texture from * @param {object} [options] See {@link PIXI.BaseTexture}'s constructor for options. + * @param {boolean} [strict] Enforce strict-mode, see {@link PIXI.settings.STRICT_TEXTURE_CACHE}. * @return {PIXI.Texture} The newly created texture */ - Texture.from = function from (source, options) + Texture.from = function from (source, options, strict) { if ( options === void 0 ) { options = {}; } + if ( strict === void 0 ) { strict = settings.STRICT_TEXTURE_CACHE; } + var isFrame = typeof source === 'string'; var cacheId = null; - if (typeof source === 'string') + if (isFrame) { cacheId = source; } @@ -18212,6 +18109,12 @@ var PIXI = (function (exports) { var texture = TextureCache[cacheId]; + // Strict-mode rejects invalid cacheIds + if (isFrame && strict && !texture) + { + throw new Error(("The cacheId \"" + cacheId + "\" does not exist in TextureCache.")); + } + if (!texture) { if (!options.resolution) @@ -18424,7 +18327,7 @@ var PIXI = (function (exports) { * set to 2 to compensate for texture packer rotation * set to 6 to compensate for spine packer rotation * can be used to rotate or mirror sprites - * See {@link PIXI.GroupD8} for explanation + * See {@link PIXI.groupD8} for explanation * * @member {number} */ @@ -18937,10 +18840,11 @@ var PIXI = (function (exports) { * * @static * @param {string} buffer the id of the buffer that this attribute will look for - * @param {Number} [size=2] the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2 - * @param {Number} [stride=0] How far apart (in floats) the start of each value is. (used for interleaving data) - * @param {Number} [start=0] How far into the array to start reading values (used for interleaving data) + * @param {Number} [size=0] the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2 * @param {Boolean} [normalized=false] should the data be normalized. + * @param {Number} [start=0] How far into the array to start reading values (used for interleaving data) + * @param {Number} [type=PIXI.TYPES.FLOAT] what type of number is the attribute. Check {@link PIXI.TYPES} to see the ones available + * @param {Number} [stride=0] How far apart (in floats) the start of each value is. (used for interleaving data) * * @returns {PIXI.Attribute} A new {@link PIXI.Attribute} based on the information provided */ @@ -19401,8 +19305,7 @@ var PIXI = (function (exports) { this.dispose(); this.buffers = null; - this.indexBuffer.destroy(); - + this.indexBuffer = null; this.attributes = null; }; @@ -20097,12 +20000,12 @@ var PIXI = (function (exports) { this.quadUv.map(input._frame, input.filterFrame); renderer.geometry.bind(this.quadUv); - renderer.geometry.draw(DRAW_MODES.TRIANGLES); + renderer.geometry.draw(exports.DRAW_MODES.TRIANGLES); } else { renderer.geometry.bind(this.quad); - renderer.geometry.draw(DRAW_MODES.TRIANGLE_STRIP); + renderer.geometry.draw(exports.DRAW_MODES.TRIANGLE_STRIP); } }; @@ -20348,6 +20251,76 @@ var PIXI = (function (exports) { this.setObjectRenderer(this.emptyRenderer); }; + /** + * Handy function for batch renderers: copies bound textures in first maxTextures locations to array + * sets actual _batchLocation for them + * + * @param arr + * @param maxTextures + */ + BatchSystem.prototype.copyBoundTextures = function copyBoundTextures (arr, maxTextures) + { + var ref = this.renderer.texture; + var boundTextures = ref.boundTextures; + + for (var i = maxTextures - 1; i >= 0; --i) + { + arr[i] = boundTextures[i] || null; + if (arr[i]) + { + arr[i]._batchLocation = i; + } + } + }; + + /** + * Assigns batch locations to textures in array based on boundTextures state. + * All textures in texArray should have `_batchEnabled = _batchId`, + * and their count should be less than `maxTextures`. + * + * @param {PIXI.BatchTextureArray} texArray textures to bound + * @param {PIXI.BaseTexture[]} boundTextures current state of bound textures + * @param {number} batchId marker for _batchEnabled param of textures in texArray + * @param {number} maxTextures number of texture locations to manipulate + */ + BatchSystem.prototype.boundArray = function boundArray (texArray, boundTextures, batchId, maxTextures) + { + var elements = texArray.elements; + var ids = texArray.ids; + var count = texArray.count; + var j = 0; + + for (var i = 0; i < count; i++) + { + var tex = elements[i]; + var loc = tex._batchLocation; + + if (loc >= 0 && loc < maxTextures + && boundTextures[loc] === tex) + { + ids[i] = loc; + continue; + } + + while (j < maxTextures) + { + var bound = boundTextures[j]; + + if (bound && bound._batchEnabled === batchId + && bound._batchLocation === j) + { + j++; + continue; + } + + ids[i] = j; + tex._batchLocation = j; + boundTextures[j] = tex; + break; + } + } + }; + return BatchSystem; }(System)); @@ -20367,7 +20340,25 @@ var PIXI = (function (exports) { * @type {number} * @default PIXI.ENV.WEBGL2 */ - settings.PREFER_ENV = isMobile_min.any ? ENV.WEBGL : ENV.WEBGL2; + settings.PREFER_ENV = isMobile_min.any ? exports.ENV.WEBGL : exports.ENV.WEBGL2; + + /** + * If set to `true`, Textures and BaseTexture objects stored + * in the caches ({@link PIXI.utils.TextureCache TextureCache} and + * {@link PIXI.utils.BaseTextureCache BaseTextureCache}) can *only* be + * used when calling {@link PIXI.Texture.from Texture.from} or + * {@link PIXI.BaseTexture.from BaseTexture.from}. + * Otherwise, these `from` calls throw an exception. Using this property + * can be useful if you want to enforce preloading all assets with + * {@link PIXI.Loader Loader}. + * + * @static + * @name STRICT_TEXTURE_CACHE + * @memberof PIXI.settings + * @type {boolean} + * @default false + */ + settings.STRICT_TEXTURE_CACHE = false; var CONTEXT_UID = 0; @@ -20485,7 +20476,7 @@ var PIXI = (function (exports) { { var gl; - if (settings.PREFER_ENV >= ENV.WEBGL2) + if (settings.PREFER_ENV >= exports.ENV.WEBGL2) { gl = canvas.getContext('webgl2', options); } @@ -20599,7 +20590,10 @@ var PIXI = (function (exports) { */ ContextSystem.prototype.postrender = function postrender () { - this.gl.flush(); + if (this.renderer.renderingToScreen) + { + this.gl.flush(); + } }; /** @@ -20685,7 +20679,7 @@ var PIXI = (function (exports) { var nativeDrawBuffersExtension = this.renderer.context.extensions.drawBuffers; var nativeDepthTextureExtension = this.renderer.context.extensions.depthTexture; - if (settings.PREFER_ENV === ENV.WEBGL_LEGACY) + if (settings.PREFER_ENV === exports.ENV.WEBGL_LEGACY) { nativeDrawBuffersExtension = null; nativeDepthTextureExtension = null; @@ -21201,7 +21195,7 @@ var PIXI = (function (exports) { // webgl 1! var nativeVaoExtension = this.renderer.context.extensions.vertexArrayObject; - if (settings.PREFER_ENV === ENV.WEBGL_LEGACY) + if (settings.PREFER_ENV === exports.ENV.WEBGL_LEGACY) { nativeVaoExtension = null; } @@ -21762,6 +21756,112 @@ var PIXI = (function (exports) { return GeometrySystem; }(System)); + /** + * Component for masked elements + * + * Holds mask mode and temporary data about current mask + * + * @class + * @memberof PIXI + */ + var MaskData = function MaskData(maskObject) + { + /** + * Mask type + * @member {PIXI.MASK_TYPES} + */ + this.type = exports.MASK_TYPES.NONE; + + /** + * Whether we know the mask type beforehand + * @member {boolean} + * @default true + */ + this.autoDetect = true; + + /** + * Which element we use to mask + * @member {PIXI.DisplayObject} + */ + this.maskObject = maskObject || null; + + /** + * Whether it belongs to MaskSystem pool + * @member {boolean} + */ + this.pooled = false; + + /** + * Indicator of the type + * @member {boolean} + */ + this.isMaskData = true; + + /** + * Stencil counter above the mask in stack + * @member {number} + * @private + */ + this._stencilCounter = 0; + /** + * Scissor counter above the mask in stack + * @member {number} + * @private + */ + this._scissorCounter = 0; + + /** + * Scissor operation above the mask in stack. + * Null if _scissorCounter is zero, rectangle instance if positive. + * @member {PIXI.Rectangle} + */ + this._scissorRect = null; + + /** + * Targeted element. Temporary variable set by MaskSystem + * @member {PIXI.DisplayObject} + * @private + */ + this._target = null; + }; + + /** + * resets the mask data after popMask() + */ + MaskData.prototype.reset = function reset () + { + if (this.pooled) + { + this.maskObject = null; + + this.type = exports.MASK_TYPES.NONE; + + this.autoDetect = true; + } + + this._target = null; + }; + + /** + * copies counters from maskData above, called from pushMask() + * @param {PIXI.MaskData|null} maskAbove + */ + MaskData.prototype.copyCountersOrReset = function copyCountersOrReset (maskAbove) + { + if (maskAbove) + { + this._stencilCounter = maskAbove._stencilCounter; + this._scissorCounter = maskAbove._scissorCounter; + this._scissorRect = maskAbove._scissorRect; + } + else + { + this._stencilCounter = 0; + this._scissorCounter = 0; + this._scissorRect = null; + } + }; + /** * @method compileProgram * @private @@ -21931,17 +22031,17 @@ var PIXI = (function (exports) { * * @static * @private - * @returns {webGL-context} a gl context to test with + * @returns {WebGLRenderingContext} a gl context to test with */ function getTestContext() { - if (context === unknownContext || context.isContextLost()) + if (context === unknownContext || (context && context.isContextLost())) { var canvas = document.createElement('canvas'); var gl; - if (settings.PREFER_ENV >= ENV.WEBGL2) + if (settings.PREFER_ENV >= exports.ENV.WEBGL2) { gl = canvas.getContext('webgl2', {}); } @@ -21975,7 +22075,7 @@ var PIXI = (function (exports) { { if (!maxFragmentPrecision) { - maxFragmentPrecision = PRECISION.MEDIUM; + maxFragmentPrecision = exports.PRECISION.MEDIUM; var gl = getTestContext(); if (gl) @@ -21984,7 +22084,7 @@ var PIXI = (function (exports) { { var shaderFragment = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT); - maxFragmentPrecision = shaderFragment.precision ? PRECISION.HIGH : PRECISION.MEDIUM; + maxFragmentPrecision = shaderFragment.precision ? exports.PRECISION.HIGH : exports.PRECISION.MEDIUM; } } } @@ -22011,14 +22111,14 @@ var PIXI = (function (exports) { var precision = requestedPrecision; // If highp is requested but not supported, downgrade precision to a level all devices support. - if (requestedPrecision === PRECISION.HIGH && maxSupportedPrecision !== PRECISION.HIGH) + if (requestedPrecision === exports.PRECISION.HIGH && maxSupportedPrecision !== exports.PRECISION.HIGH) { - precision = PRECISION.MEDIUM; + precision = exports.PRECISION.MEDIUM; } return ("precision " + precision + " float;\n" + src); } - else if (maxSupportedPrecision !== PRECISION.HIGH && src.substring(0, 15) === 'precision highp') + else if (maxSupportedPrecision !== exports.PRECISION.HIGH && src.substring(0, 15) === 'precision highp') { // precision was supplied, but at a level this device does not support, so downgrading to mediump. return src.replace('precision highp', 'precision mediump'); @@ -22399,7 +22499,7 @@ var PIXI = (function (exports) { this.vertexSrc = "#define SHADER_NAME " + name + "\n" + (this.vertexSrc); this.fragmentSrc = "#define SHADER_NAME " + name + "\n" + (this.fragmentSrc); - this.vertexSrc = setPrecision(this.vertexSrc, settings.PRECISION_VERTEX, PRECISION.HIGH); + this.vertexSrc = setPrecision(this.vertexSrc, settings.PRECISION_VERTEX, exports.PRECISION.HIGH); this.fragmentSrc = setPrecision(this.fragmentSrc, settings.PRECISION_FRAGMENT, getMaxFragmentPrecision()); } @@ -22412,7 +22512,7 @@ var PIXI = (function (exports) { this.syncUniforms = null; }; - var staticAccessors$3 = { defaultVertexSrc: { configurable: true },defaultFragmentSrc: { configurable: true } }; + var staticAccessors = { defaultVertexSrc: { configurable: true },defaultFragmentSrc: { configurable: true } }; /** * Extracts the data for a buy creating a small test program @@ -22533,7 +22633,7 @@ var PIXI = (function (exports) { * @constant * @member {string} */ - staticAccessors$3.defaultVertexSrc.get = function () + staticAccessors.defaultVertexSrc.get = function () { return defaultVertex; }; @@ -22545,7 +22645,7 @@ var PIXI = (function (exports) { * @constant * @member {string} */ - staticAccessors$3.defaultFragmentSrc.get = function () + staticAccessors.defaultFragmentSrc.get = function () { return defaultFragment; }; @@ -22556,7 +22656,7 @@ var PIXI = (function (exports) { * * @param {string} [vertexSrc] - The source of the vertex shader. * @param {string} [fragmentSrc] - The source of the fragment shader. - * @param {object} [uniforms] - Custom uniforms to use to augment the built-in ones. + * @param {string} [name=pixi-shader] - Name for shader * * @returns {PIXI.Program} an shiny new Pixi shader! */ @@ -22574,7 +22674,7 @@ var PIXI = (function (exports) { return program; }; - Object.defineProperties( Program, staticAccessors$3 ); + Object.defineProperties( Program, staticAccessors ); /** * A helper class for shaders @@ -22621,7 +22721,7 @@ var PIXI = (function (exports) { } }; - var prototypeAccessors$2$1 = { uniforms: { configurable: true } }; + var prototypeAccessors$2 = { uniforms: { configurable: true } }; // TODO move to shader system.. Shader.prototype.checkUniformExists = function checkUniformExists (name, group) @@ -22659,7 +22759,7 @@ var PIXI = (function (exports) { * @readonly * @member {object} */ - prototypeAccessors$2$1.uniforms.get = function () + prototypeAccessors$2.uniforms.get = function () { return this.uniformGroup.uniforms; }; @@ -22680,7 +22780,7 @@ var PIXI = (function (exports) { return new Shader(program, uniforms); }; - Object.defineProperties( Shader.prototype, prototypeAccessors$2$1 ); + Object.defineProperties( Shader.prototype, prototypeAccessors$2 ); /* eslint-disable max-len */ @@ -22703,26 +22803,26 @@ var PIXI = (function (exports) { { this.data = 0; - this.blendMode = BLEND_MODES.NORMAL; + this.blendMode = exports.BLEND_MODES.NORMAL; this.polygonOffset = 0; this.blend = true; // this.depthTest = true; }; - var prototypeAccessors$3$1 = { blend: { configurable: true },offsets: { configurable: true },culling: { configurable: true },depthTest: { configurable: true },clockwiseFrontFace: { configurable: true },blendMode: { configurable: true },polygonOffset: { configurable: true } }; + var prototypeAccessors$3 = { blend: { configurable: true },offsets: { configurable: true },culling: { configurable: true },depthTest: { configurable: true },clockwiseFrontFace: { configurable: true },blendMode: { configurable: true },polygonOffset: { configurable: true } }; /** * Activates blending of the computed fragment color values * * @member {boolean} */ - prototypeAccessors$3$1.blend.get = function () + prototypeAccessors$3.blend.get = function () { return !!(this.data & (1 << BLEND)); }; - prototypeAccessors$3$1.blend.set = function (value) // eslint-disable-line require-jsdoc + prototypeAccessors$3.blend.set = function (value) // eslint-disable-line require-jsdoc { if (!!(this.data & (1 << BLEND)) !== value) { @@ -22736,12 +22836,12 @@ var PIXI = (function (exports) { * @member {boolean} * @default false */ - prototypeAccessors$3$1.offsets.get = function () + prototypeAccessors$3.offsets.get = function () { return !!(this.data & (1 << OFFSET)); }; - prototypeAccessors$3$1.offsets.set = function (value) // eslint-disable-line require-jsdoc + prototypeAccessors$3.offsets.set = function (value) // eslint-disable-line require-jsdoc { if (!!(this.data & (1 << OFFSET)) !== value) { @@ -22755,12 +22855,12 @@ var PIXI = (function (exports) { * @member {boolean} * @default false */ - prototypeAccessors$3$1.culling.get = function () + prototypeAccessors$3.culling.get = function () { return !!(this.data & (1 << CULLING)); }; - prototypeAccessors$3$1.culling.set = function (value) // eslint-disable-line require-jsdoc + prototypeAccessors$3.culling.set = function (value) // eslint-disable-line require-jsdoc { if (!!(this.data & (1 << CULLING)) !== value) { @@ -22774,12 +22874,12 @@ var PIXI = (function (exports) { * @member {boolean} * @default false */ - prototypeAccessors$3$1.depthTest.get = function () + prototypeAccessors$3.depthTest.get = function () { return !!(this.data & (1 << DEPTH_TEST)); }; - prototypeAccessors$3$1.depthTest.set = function (value) // eslint-disable-line require-jsdoc + prototypeAccessors$3.depthTest.set = function (value) // eslint-disable-line require-jsdoc { if (!!(this.data & (1 << DEPTH_TEST)) !== value) { @@ -22792,12 +22892,12 @@ var PIXI = (function (exports) { * @member {boolean} * @default false */ - prototypeAccessors$3$1.clockwiseFrontFace.get = function () + prototypeAccessors$3.clockwiseFrontFace.get = function () { return !!(this.data & (1 << WINDING)); }; - prototypeAccessors$3$1.clockwiseFrontFace.set = function (value) // eslint-disable-line require-jsdoc + prototypeAccessors$3.clockwiseFrontFace.set = function (value) // eslint-disable-line require-jsdoc { if (!!(this.data & (1 << WINDING)) !== value) { @@ -22813,14 +22913,14 @@ var PIXI = (function (exports) { * @default PIXI.BLEND_MODES.NORMAL * @see PIXI.BLEND_MODES */ - prototypeAccessors$3$1.blendMode.get = function () + prototypeAccessors$3.blendMode.get = function () { return this._blendMode; }; - prototypeAccessors$3$1.blendMode.set = function (value) // eslint-disable-line require-jsdoc + prototypeAccessors$3.blendMode.set = function (value) // eslint-disable-line require-jsdoc { - this.blend = (value !== BLEND_MODES.NONE); + this.blend = (value !== exports.BLEND_MODES.NONE); this._blendMode = value; }; @@ -22830,12 +22930,12 @@ var PIXI = (function (exports) { * @member {number} * @default 0 */ - prototypeAccessors$3$1.polygonOffset.get = function () + prototypeAccessors$3.polygonOffset.get = function () { return this._polygonOffset; }; - prototypeAccessors$3$1.polygonOffset.set = function (value) // eslint-disable-line require-jsdoc + prototypeAccessors$3.polygonOffset.set = function (value) // eslint-disable-line require-jsdoc { this.offsets = !!value; this._polygonOffset = value; @@ -22851,7 +22951,7 @@ var PIXI = (function (exports) { return state; }; - Object.defineProperties( State.prototype, prototypeAccessors$3$1 ); + Object.defineProperties( State.prototype, prototypeAccessors$3 ); var defaultVertex$1 = "attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"; @@ -23215,18 +23315,18 @@ var PIXI = (function (exports) { this.isSimple = false; }; - var prototypeAccessors$4$1 = { texture: { configurable: true } }; + var prototypeAccessors$4 = { texture: { configurable: true } }; /** * texture property * @member {PIXI.Texture} */ - prototypeAccessors$4$1.texture.get = function () + prototypeAccessors$4.texture.get = function () { return this._texture; }; - prototypeAccessors$4$1.texture.set = function (value) // eslint-disable-line require-jsdoc + prototypeAccessors$4.texture.set = function (value) // eslint-disable-line require-jsdoc { this._texture = value; this._updateID = -1; @@ -23314,7 +23414,7 @@ var PIXI = (function (exports) { return true; }; - Object.defineProperties( TextureMatrix.prototype, prototypeAccessors$4$1 ); + Object.defineProperties( TextureMatrix.prototype, prototypeAccessors$4 ); /** * This handles a Sprite acting as a mask, as opposed to a Graphic. @@ -23376,7 +23476,7 @@ var PIXI = (function (exports) { } tex.transform.update(); - this.uniforms.npmAlpha = tex.baseTexture.premultiplyAlpha ? 0.0 : 1.0; + this.uniforms.npmAlpha = tex.baseTexture.alphaMode ? 0.0 : 1.0; this.uniforms.mask = tex; // get _normalized sprite texture coords_ and convert them to _normalized atlas texture coords_ with `prepend` this.uniforms.otherMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, maskSprite) @@ -23402,21 +23502,6 @@ var PIXI = (function (exports) { { System.call(this, renderer); - // TODO - we don't need both! - /** - * `true` if current pushed masked is scissor - * @member {boolean} - * @readonly - */ - this.scissor = false; - - /** - * Mask data - * @member {PIXI.Graphics} - * @readonly - */ - this.scissorData = null; - /** * Target to mask * @member {PIXI.DisplayObject} @@ -23438,6 +23523,15 @@ var PIXI = (function (exports) { */ this.alphaMaskPool = []; + /** + * Pool of mask data + * @member {PIXI.MaskData[]} + * @readonly + */ + this.maskDataPool = []; + + this.maskStack = []; + /** * Current index of alpha mask pool * @member {number} @@ -23451,93 +23545,168 @@ var PIXI = (function (exports) { MaskSystem.prototype = Object.create( System && System.prototype ); MaskSystem.prototype.constructor = MaskSystem; + /** + * Changes the mask stack that is used by this System. + * + * @param {PIXI.MaskData[]} maskStack - The mask stack + */ + MaskSystem.prototype.setMaskStack = function setMaskStack (maskStack) + { + this.maskStack = maskStack; + this.renderer.scissor.setMaskStack(maskStack); + this.renderer.stencil.setMaskStack(maskStack); + }; + /** * Applies the Mask and adds it to the current filter stack. + * Renderer batch must be flushed beforehand. * * @param {PIXI.DisplayObject} target - Display Object to push the mask to - * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data. + * @param {PIXI.MaskData|PIXI.Sprite|PIXI.Graphics|PIXI.DisplayObject} maskData - The masking data. */ MaskSystem.prototype.push = function push (target, maskData) { - // TODO the root check means scissor rect will not - // be used on render textures more info here: - // https://github.com/pixijs/pixi.js/pull/3545 - - if (maskData.isSprite) + if (!maskData.isMaskData) { - this.pushSpriteMask(target, maskData); + var d = this.maskDataPool.pop() || new MaskData(); + + d.pooled = true; + d.maskObject = maskData; + maskData = d; } - else if (this.enableScissor - && !this.scissor - && this.renderer._activeRenderTarget.root - && !this.renderer.stencil.stencilMaskStack.length - && maskData.isFastRect()) + + if (maskData.autoDetect) { - var matrix = maskData.worldTransform; - - var rot = Math.atan2(matrix.b, matrix.a); - - // use the nearest degree! - rot = Math.round(rot * (180 / Math.PI)); - - if (rot % 90) - { - this.pushStencilMask(maskData); - } - else - { - this.pushScissorMask(target, maskData); - } + this.detect(maskData); } - else + + maskData.copyCountersOrReset(this.maskStack[this.maskStack.length - 1]); + maskData._target = target; + + switch (maskData.type) { - this.pushStencilMask(maskData); + case exports.MASK_TYPES.SCISSOR: + this.maskStack.push(maskData); + this.renderer.scissor.push(maskData); + break; + case exports.MASK_TYPES.STENCIL: + this.maskStack.push(maskData); + this.renderer.stencil.push(maskData); + break; + case exports.MASK_TYPES.SPRITE: + maskData.copyCountersOrReset(null); + this.pushSpriteMask(maskData); + this.maskStack.push(maskData); + break; + default: + break; } }; /** * Removes the last mask from the mask stack and doesn't return it. + * Renderer batch must be flushed beforehand. * * @param {PIXI.DisplayObject} target - Display Object to pop the mask from - * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data. */ - MaskSystem.prototype.pop = function pop (target, maskData) + MaskSystem.prototype.pop = function pop (target) { - if (maskData.isSprite) + var maskData = this.maskStack.pop(); + + if (!maskData || maskData._target !== target) { - this.popSpriteMask(target, maskData); + // TODO: add an assert when we have it + + return; } - else if (this.enableScissor && !this.renderer.stencil.stencilMaskStack.length) + + switch (maskData.type) { - this.popScissorMask(target, maskData); + case exports.MASK_TYPES.SCISSOR: + this.renderer.scissor.pop(); + break; + case exports.MASK_TYPES.STENCIL: + this.renderer.stencil.pop(maskData.maskObject); + break; + case exports.MASK_TYPES.SPRITE: + this.popSpriteMask(); + break; + default: + break; } - else + + maskData.reset(); + + if (maskData.pooled) { - this.popStencilMask(target, maskData); + this.maskDataPool.push(maskData); + } + }; + + /** + * Sets type of MaskData based on its maskObject + * @param {PIXI.MaskData} maskData + */ + MaskSystem.prototype.detect = function detect (maskData) + { + var maskObject = maskData.maskObject; + + if (maskObject.isSprite) + { + maskData.type = exports.MASK_TYPES.SPRITE; + + return; + } + maskData.type = exports.MASK_TYPES.STENCIL; + // detect scissor in graphics + if (this.enableScissor + && maskObject.isFastRect + && maskObject.isFastRect()) + { + var matrix = maskObject.worldTransform; + + // TODO: move the check to the matrix itself + // we are checking that its orthogonal and x rotation is 0 90 180 or 270 + + var rotX = Math.atan2(matrix.b, matrix.a); + var rotXY = Math.atan2(matrix.d, matrix.c); + + // use the nearest degree to 0.01 + rotX = Math.round(rotX * (180 / Math.PI) * 100); + rotXY = Math.round(rotXY * (180 / Math.PI) * 100) - rotX; + + rotX = ((rotX % 9000) + 9000) % 9000; + rotXY = ((rotXY % 18000) + 18000) % 18000; + + if (rotX === 0 && rotXY === 9000) + { + maskData.type = exports.MASK_TYPES.SCISSOR; + } } }; /** * Applies the Mask and adds it to the current filter stack. * - * @param {PIXI.RenderTexture} target - Display Object to push the sprite mask to - * @param {PIXI.Sprite} maskData - Sprite to be used as the mask + * @param {PIXI.MaskData} maskData - Sprite to be used as the mask */ - MaskSystem.prototype.pushSpriteMask = function pushSpriteMask (target, maskData) + MaskSystem.prototype.pushSpriteMask = function pushSpriteMask (maskData) { + var maskObject = maskData.maskObject; + var target = maskData._target; var alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex]; if (!alphaMaskFilter) { - alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex] = [new SpriteMaskFilter(maskData)]; + alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex] = [new SpriteMaskFilter(maskObject)]; } alphaMaskFilter[0].resolution = this.renderer.resolution; - alphaMaskFilter[0].maskSprite = maskData; + alphaMaskFilter[0].maskSprite = maskObject; var stashFilterArea = target.filterArea; - target.filterArea = maskData.getBounds(true); + target.filterArea = maskObject.getBounds(true); this.renderer.filter.push(target, alphaMaskFilter); target.filterArea = stashFilterArea; @@ -23546,7 +23715,6 @@ var PIXI = (function (exports) { /** * Removes the last filter from the filter stack and doesn't return it. - * */ MaskSystem.prototype.popSpriteMask = function popSpriteMask () { @@ -23554,78 +23722,215 @@ var PIXI = (function (exports) { this.alphaMaskIndex--; }; - /** - * Applies the Mask and adds it to the current filter stack. - * - * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data. - */ - MaskSystem.prototype.pushStencilMask = function pushStencilMask (maskData) + return MaskSystem; + }(System)); + + /** + * System plugin to the renderer to manage masks of certain type + * + * @class + * @extends PIXI.System + * @memberof PIXI.systems + */ + var AbstractMaskSystem = /*@__PURE__*/(function (System) { + function AbstractMaskSystem(renderer) { - this.renderer.batch.flush(); - this.renderer.stencil.pushStencil(maskData); + System.call(this, renderer); + + /** + * The mask stack + * @member {PIXI.MaskData[]} + */ + this.maskStack = []; + + /** + * Constant for gl.enable + * @member {number} + * @private + */ + this.glConst = 0; + } + + if ( System ) { AbstractMaskSystem.__proto__ = System; } + AbstractMaskSystem.prototype = Object.create( System && System.prototype ); + AbstractMaskSystem.prototype.constructor = AbstractMaskSystem; + + /** + * gets count of masks of certain type + * @returns {number} + */ + AbstractMaskSystem.prototype.getStackLength = function getStackLength () + { + return this.maskStack.length; }; /** - * Removes the last filter from the filter stack and doesn't return it. + * Changes the mask stack that is used by this System. * + * @param {PIXI.MaskData[]} maskStack - The mask stack */ - MaskSystem.prototype.popStencilMask = function popStencilMask () + AbstractMaskSystem.prototype.setMaskStack = function setMaskStack (maskStack) { - // this.renderer.currentRenderer.stop(); - this.renderer.stencil.popStencil(); + var ref = this.renderer; + var gl = ref.gl; + var curStackLen = this.getStackLength(); + + this.maskStack = maskStack; + + var newStackLen = this.getStackLength(); + + if (newStackLen !== curStackLen) + { + if (newStackLen === 0) + { + gl.disable(this.glConst); + } + else + { + gl.enable(this.glConst); + this._useCurrent(); + } + } }; /** - * - * @param {PIXI.DisplayObject} target - Display Object to push the mask to - * @param {PIXI.Graphics} maskData - The masking data. + * Setup renderer to use the current mask data. + * @private */ - MaskSystem.prototype.pushScissorMask = function pushScissorMask (target, maskData) + AbstractMaskSystem.prototype._useCurrent = function _useCurrent () { - maskData.renderable = true; - - var renderTarget = this.renderer._activeRenderTarget; - - var bounds = maskData.getBounds(); - - bounds.fit(renderTarget.size); - maskData.renderable = false; - - this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST); - - var resolution = this.renderer.resolution; - - this.renderer.gl.scissor( - bounds.x * resolution, - (renderTarget.root ? renderTarget.size.height - bounds.y - bounds.height : bounds.y) * resolution, - bounds.width * resolution, - bounds.height * resolution - ); - - this.scissorRenderTarget = renderTarget; - this.scissorData = maskData; - this.scissor = true; + // OVERWRITE; }; /** - * Pop scissor mask + * Destroys the mask stack. * */ - MaskSystem.prototype.popScissorMask = function popScissorMask () + AbstractMaskSystem.prototype.destroy = function destroy () { - this.scissorRenderTarget = null; - this.scissorData = null; - this.scissor = false; + System.prototype.destroy.call(this, this); - // must be scissor! + this.maskStack = null; + }; + + return AbstractMaskSystem; + }(System)); + + /** + * System plugin to the renderer to manage scissor rects (used for masks). + * + * @class + * @extends PIXI.System + * @memberof PIXI.systems + */ + var ScissorSystem = /*@__PURE__*/(function (AbstractMaskSystem) { + function ScissorSystem(renderer) + { + AbstractMaskSystem.call(this, renderer); + + this.glConst = WebGLRenderingContext.SCISSOR_TEST; + } + + if ( AbstractMaskSystem ) { ScissorSystem.__proto__ = AbstractMaskSystem; } + ScissorSystem.prototype = Object.create( AbstractMaskSystem && AbstractMaskSystem.prototype ); + ScissorSystem.prototype.constructor = ScissorSystem; + + ScissorSystem.prototype.getStackLength = function getStackLength () + { + var maskData = this.maskStack[this.maskStack.length - 1]; + + if (maskData) + { + return maskData._scissorCounter; + } + + return 0; + }; + + /** + * Applies the Mask and adds it to the current stencil stack. @alvin + * + * @param {PIXI.MaskData} maskData - The mask data + */ + ScissorSystem.prototype.push = function push (maskData) + { + var maskObject = maskData.maskObject; + + maskObject.renderable = true; + + var prevData = maskData._scissorRect; + var bounds = maskObject.getBounds(true); var ref = this.renderer; var gl = ref.gl; - gl.disable(gl.SCISSOR_TEST); + maskObject.renderable = false; + + if (prevData) + { + bounds.fit(prevData); + } + else + { + gl.enable(gl.SCISSOR_TEST); + } + + maskData._scissorCounter++; + maskData._scissorRect = bounds; + this._useCurrent(); }; - return MaskSystem; - }(System)); + /** + * Pops scissor mask. MaskData is already removed from stack + */ + ScissorSystem.prototype.pop = function pop () + { + var ref = this.renderer; + var gl = ref.gl; + + if (this.getStackLength() > 0) + { + this._useCurrent(); + } + else + { + gl.disable(gl.SCISSOR_TEST); + } + }; + + /** + * Setup renderer to use the current scissor data. + * @private + */ + ScissorSystem.prototype._useCurrent = function _useCurrent () + { + var rect = this.maskStack[this.maskStack.length - 1]._scissorRect; + var rt = this.renderer.renderTexture.current; + var ref = this.renderer.projection; + var transform = ref.transform; + var sourceFrame = ref.sourceFrame; + var destinationFrame = ref.destinationFrame; + var resolution = rt ? rt.resolution : this.renderer.resolution; + var x = ((rect.x - sourceFrame.x) * resolution) + destinationFrame.x; + var y = ((rect.y - sourceFrame.y) * resolution) + destinationFrame.y; + var width = rect.width * resolution; + var height = rect.height * resolution; + + if (transform) + { + x += transform.tx * resolution; + y += transform.ty * resolution; + } + if (!rt) + { + // flipY. In future we'll have it over renderTextures as an option + y = this.renderer.height - height - y; + } + + this.renderer.gl.scissor(x, y, width, height); + }; + + return ScissorSystem; + }(AbstractMaskSystem)); /** * System plugin to the renderer to manage stencils (used for masks). @@ -23634,56 +23939,41 @@ var PIXI = (function (exports) { * @extends PIXI.System * @memberof PIXI.systems */ - var StencilSystem = /*@__PURE__*/(function (System) { + var StencilSystem = /*@__PURE__*/(function (AbstractMaskSystem) { function StencilSystem(renderer) { - System.call(this, renderer); + AbstractMaskSystem.call(this, renderer); - /** - * The mask stack - * @member {PIXI.Graphics[]} - */ - this.stencilMaskStack = []; + this.glConst = WebGLRenderingContext.STENCIL_TEST; } - if ( System ) { StencilSystem.__proto__ = System; } - StencilSystem.prototype = Object.create( System && System.prototype ); + if ( AbstractMaskSystem ) { StencilSystem.__proto__ = AbstractMaskSystem; } + StencilSystem.prototype = Object.create( AbstractMaskSystem && AbstractMaskSystem.prototype ); StencilSystem.prototype.constructor = StencilSystem; - /** - * Changes the mask stack that is used by this System. - * - * @param {PIXI.Graphics[]} stencilMaskStack - The mask stack - */ - StencilSystem.prototype.setMaskStack = function setMaskStack (stencilMaskStack) + StencilSystem.prototype.getStackLength = function getStackLength () { - var gl = this.renderer.gl; - var curStackLen = this.stencilMaskStack.length; + var maskData = this.maskStack[this.maskStack.length - 1]; - this.stencilMaskStack = stencilMaskStack; - if (stencilMaskStack.length !== curStackLen) + if (maskData) { - if (stencilMaskStack.length === 0) - { - gl.disable(gl.STENCIL_TEST); - } - else - { - gl.enable(gl.STENCIL_TEST); - this._useCurrent(); - } + return maskData._stencilCounter; } + + return 0; }; /** - * Applies the Mask and adds it to the current stencil stack. @alvin + * Applies the Mask and adds it to the current stencil stack. * - * @param {PIXI.Graphics} graphics - The mask + * @param {PIXI.MaskData} maskData - The mask data */ - StencilSystem.prototype.pushStencil = function pushStencil (graphics) + StencilSystem.prototype.push = function push (maskData) { - var gl = this.renderer.gl; - var prevMaskCount = this.stencilMaskStack.length; + var maskObject = maskData.maskObject; + var ref = this.renderer; + var gl = ref.gl; + var prevMaskCount = maskData._stencilCounter; if (prevMaskCount === 0) { @@ -23692,30 +23982,31 @@ var PIXI = (function (exports) { gl.enable(gl.STENCIL_TEST); } - this.stencilMaskStack.push(graphics); + maskData._stencilCounter++; // Increment the reference stencil value where the new mask overlaps with the old ones. gl.colorMask(false, false, false, false); gl.stencilFunc(gl.EQUAL, prevMaskCount, this._getBitwiseMask()); gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR); - graphics.renderable = true; - graphics.render(this.renderer); + maskObject.renderable = true; + maskObject.render(this.renderer); this.renderer.batch.flush(); - graphics.renderable = false; + maskObject.renderable = false; this._useCurrent(); }; /** - * Removes the last mask from the stencil stack. @alvin + * Pops stencil mask. MaskData is already removed from stack + * + * @param {PIXI.DisplayObject} maskObject - object of popped mask data */ - StencilSystem.prototype.popStencil = function popStencil () + StencilSystem.prototype.pop = function pop (maskObject) { var gl = this.renderer.gl; - var graphics = this.stencilMaskStack.pop(); - if (this.stencilMaskStack.length === 0) + if (this.getStackLength() === 0) { // the stack is empty! gl.disable(gl.STENCIL_TEST); @@ -23728,10 +24019,10 @@ var PIXI = (function (exports) { gl.colorMask(false, false, false, false); gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR); - graphics.renderable = true; - graphics.render(this.renderer); + maskObject.renderable = true; + maskObject.render(this.renderer); this.renderer.batch.flush(); - graphics.renderable = false; + maskObject.renderable = false; this._useCurrent(); } @@ -23746,7 +24037,7 @@ var PIXI = (function (exports) { var gl = this.renderer.gl; gl.colorMask(true, true, true, true); - gl.stencilFunc(gl.EQUAL, this.stencilMaskStack.length, this._getBitwiseMask()); + gl.stencilFunc(gl.EQUAL, this.getStackLength(), this._getBitwiseMask()); gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); }; @@ -23757,22 +24048,11 @@ var PIXI = (function (exports) { */ StencilSystem.prototype._getBitwiseMask = function _getBitwiseMask () { - return (1 << this.stencilMaskStack.length) - 1; - }; - - /** - * Destroys the mask stack. - * - */ - StencilSystem.prototype.destroy = function destroy () - { - System.prototype.destroy.call(this, this); - - this.stencilMaskStack = null; + return (1 << this.getStackLength()) - 1; }; return StencilSystem; - }(System)); + }(AbstractMaskSystem)); /** * System plugin to the renderer to manage the projection matrix. @@ -24002,7 +24282,7 @@ var PIXI = (function (exports) { this.renderer.framebuffer.bind(baseTexture.framebuffer, destinationFrame); this.renderer.projection.update(destinationFrame, sourceFrame, resolution, false); - this.renderer.stencil.setMaskStack(baseTexture.stencilMaskStack); + this.renderer.mask.setMaskStack(baseTexture.maskStack); } else { @@ -24027,7 +24307,7 @@ var PIXI = (function (exports) { // TODO store this.. this.renderer.projection.update(destinationFrame, sourceFrame, resolution, true); - this.renderer.stencil.setMaskStack(this.defaultMaskStack); + this.renderer.mask.setMaskStack(this.defaultMaskStack); } this.sourceFrame.copyFrom(sourceFrame); @@ -24386,41 +24666,42 @@ var PIXI = (function (exports) { // TODO - premultiply alpha would be different. // add a boolean for that! - array[BLEND_MODES.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.ADD] = [gl.ONE, gl.ONE]; - array[BLEND_MODES.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.SCREEN] = [gl.ONE, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.NONE] = [0, 0]; + array[exports.BLEND_MODES.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.ADD] = [gl.ONE, gl.ONE]; + array[exports.BLEND_MODES.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.SCREEN] = [gl.ONE, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.NONE] = [0, 0]; // not-premultiplied blend modes - array[BLEND_MODES.NORMAL_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.ADD_NPM] = [gl.SRC_ALPHA, gl.ONE, gl.ONE, gl.ONE]; - array[BLEND_MODES.SCREEN_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.NORMAL_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.ADD_NPM] = [gl.SRC_ALPHA, gl.ONE, gl.ONE, gl.ONE]; + array[exports.BLEND_MODES.SCREEN_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; // composite operations - array[BLEND_MODES.SRC_IN] = [gl.DST_ALPHA, gl.ZERO]; - array[BLEND_MODES.SRC_OUT] = [gl.ONE_MINUS_DST_ALPHA, gl.ZERO]; - array[BLEND_MODES.SRC_ATOP] = [gl.DST_ALPHA, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.DST_OVER] = [gl.ONE_MINUS_DST_ALPHA, gl.ONE]; - array[BLEND_MODES.DST_IN] = [gl.ZERO, gl.SRC_ALPHA]; - array[BLEND_MODES.DST_OUT] = [gl.ZERO, gl.ONE_MINUS_SRC_ALPHA]; - array[BLEND_MODES.DST_ATOP] = [gl.ONE_MINUS_DST_ALPHA, gl.SRC_ALPHA]; + array[exports.BLEND_MODES.SRC_IN] = [gl.DST_ALPHA, gl.ZERO]; + array[exports.BLEND_MODES.SRC_OUT] = [gl.ONE_MINUS_DST_ALPHA, gl.ZERO]; + array[exports.BLEND_MODES.SRC_ATOP] = [gl.DST_ALPHA, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.DST_OVER] = [gl.ONE_MINUS_DST_ALPHA, gl.ONE]; + array[exports.BLEND_MODES.DST_IN] = [gl.ZERO, gl.SRC_ALPHA]; + array[exports.BLEND_MODES.DST_OUT] = [gl.ZERO, gl.ONE_MINUS_SRC_ALPHA]; + array[exports.BLEND_MODES.DST_ATOP] = [gl.ONE_MINUS_DST_ALPHA, gl.SRC_ALPHA]; + array[exports.BLEND_MODES.XOR] = [gl.ONE_MINUS_DST_ALPHA, gl.ONE_MINUS_SRC_ALPHA]; // SUBTRACT from flash - array[BLEND_MODES.SUBTRACT] = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, gl.FUNC_REVERSE_SUBTRACT, gl.FUNC_ADD]; + array[exports.BLEND_MODES.SUBTRACT] = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, gl.FUNC_REVERSE_SUBTRACT, gl.FUNC_ADD]; return array; } @@ -24470,7 +24751,7 @@ var PIXI = (function (exports) { * @default PIXI.BLEND_MODES.NONE * @readonly */ - this.blendMode = BLEND_MODES.NONE; + this.blendMode = exports.BLEND_MODES.NONE; /** * Whether current blend equation is different @@ -24813,9 +25094,14 @@ var PIXI = (function (exports) { */ TextureGCSystem.prototype.postrender = function postrender () { + if (!this.renderer.renderingToScreen) + { + return; + } + this.count++; - if (this.mode === GC_MODES.MANUAL) + if (this.mode === exports.GC_MODES.MANUAL) { return; } @@ -25079,19 +25365,23 @@ var PIXI = (function (exports) { var glTexture = texture._glTextures[this.CONTEXT_UID] || this.initTexture(texture); - if (this.currentLocation !== location) - { - this.currentLocation = location; - gl.activeTexture(gl.TEXTURE0 + location); - } - if (this.boundTextures[location] !== texture) { + if (this.currentLocation !== location) + { + this.currentLocation = location; + gl.activeTexture(gl.TEXTURE0 + location); + } gl.bindTexture(texture.target, glTexture.texture); } if (glTexture.dirtyId !== texture.dirtyId) { + if (this.currentLocation !== location) + { + this.currentLocation = location; + gl.activeTexture(gl.TEXTURE0 + location); + } this.updateTexture(texture); } @@ -25205,7 +25495,7 @@ var PIXI = (function (exports) { } // that's WebGL1 HALF_FLOAT_OES // we have to convert it to WebGL HALF_FLOAT - if (texture.type === TYPES.HALF_FLOAT) + if (texture.type === exports.TYPES.HALF_FLOAT) { glTexture.type = gl.HALF_FLOAT; } @@ -25320,14 +25610,21 @@ var PIXI = (function (exports) { return; } - if ((texture.mipmap === MIPMAP_MODES.POW2 || this.webGLVersion !== 2) && !texture.isPowerOfTwo) + if ((texture.mipmap === exports.MIPMAP_MODES.POW2 || this.webGLVersion !== 2) && !texture.isPowerOfTwo) { glTexture.mipmap = 0; - glTexture.wrapMode = WRAP_MODES.CLAMP; } else { glTexture.mipmap = texture.mipmap >= 1; + } + + if (this.webGLVersion !== 2 && !texture.isPowerOfTwo) + { + glTexture.wrapMode = exports.WRAP_MODES.CLAMP; + } + else + { glTexture.wrapMode = texture.wrapMode; } @@ -25368,7 +25665,7 @@ var PIXI = (function (exports) { var anisotropicExt = this.renderer.context.extensions.anisotropicFiltering; - if (anisotropicExt && texture.anisotropicLevel > 0 && texture.scaleMode === SCALE_MODES.LINEAR) + if (anisotropicExt && texture.anisotropicLevel > 0 && texture.scaleMode === exports.SCALE_MODES.LINEAR) { var level = Math.min(texture.anisotropicLevel, gl.getParameter(anisotropicExt.MAX_TEXTURE_MAX_ANISOTROPY_EXT)); @@ -25398,6 +25695,7 @@ var PIXI = (function (exports) { FramebufferSystem: FramebufferSystem, GeometrySystem: GeometrySystem, MaskSystem: MaskSystem, + ScissorSystem: ScissorSystem, StencilSystem: StencilSystem, ProjectionSystem: ProjectionSystem, RenderTextureSystem: RenderTextureSystem, @@ -25448,7 +25746,7 @@ var PIXI = (function (exports) { * @default PIXI.RENDERER_TYPE.UNKNOWN * @see PIXI.RENDERER_TYPE */ - this.type = RENDERER_TYPE.UNKNOWN; + this.type = exports.RENDERER_TYPE.UNKNOWN; /** * Measurements of the screen. (0, 0, screenWidth, screenHeight). @@ -25674,7 +25972,7 @@ var PIXI = (function (exports) { this.plugins = null; - this.type = RENDERER_TYPE.UNKNOWN; + this.type = exports.RENDERER_TYPE.UNKNOWN; this.view = null; @@ -25751,7 +26049,7 @@ var PIXI = (function (exports) { * @member {number} * @see PIXI.RENDERER_TYPE */ - this.type = RENDERER_TYPE.WEBGL; + this.type = exports.RENDERER_TYPE.WEBGL; /** * WebGL context, set by the contextSystem (this.context) @@ -25848,6 +26146,13 @@ var PIXI = (function (exports) { * @readonly */ .addSystem(FramebufferSystem, 'framebuffer') + /** + * Scissor system instance + * @member {PIXI.systems.ScissorSystem} scissor + * @memberof PIXI.Renderer# + * @readonly + */ + .addSystem(ScissorSystem, 'scissor') /** * Stencil system instance * @member {PIXI.systems.StencilSystem} stencil @@ -26218,13 +26523,53 @@ var PIXI = (function (exports) { */ var BatchDrawCall = function BatchDrawCall() { - this.textures = []; - this.ids = []; + this.texArray = null; this.blend = 0; - this.textureCount = 0; + this.type = exports.DRAW_MODES.TRIANGLES; + this.start = 0; this.size = 0; - this.type = 4; + + /** + * data for uniforms or custom webgl state + * @member {object} + */ + this.data = null; + }; + + /** + * Used by the batcher to build texture batches. + * Holds list of textures and their respective locations. + * + * @class + * @memberof PIXI + */ + var BatchTextureArray = function BatchTextureArray() + { + /** + * inside textures array + * @member {PIXI.BaseTexture[]} + */ + this.elements = []; + /** + * Respective locations for textures + * @member {number[]} + */ + this.ids = []; + /** + * number of filled elements + * @member {number} + */ + this.count = 0; + }; + + BatchTextureArray.prototype.clear = function clear () + { + for (var i = 0; i < this.count; i++) + { + this.elements[i] = null; + } + this.count = 0; }; /** @@ -26259,14 +26604,14 @@ var PIXI = (function (exports) { this.float32View = new Float32Array(this.rawBinaryData); }; - var prototypeAccessors$5$1 = { int8View: { configurable: true },uint8View: { configurable: true },int16View: { configurable: true },uint16View: { configurable: true },int32View: { configurable: true } }; + var prototypeAccessors$5 = { int8View: { configurable: true },uint8View: { configurable: true },int16View: { configurable: true },uint16View: { configurable: true },int32View: { configurable: true } }; /** * View on the raw binary data as a `Int8Array`. * * @member {Int8Array} */ - prototypeAccessors$5$1.int8View.get = function () + prototypeAccessors$5.int8View.get = function () { if (!this._int8View) { @@ -26281,7 +26626,7 @@ var PIXI = (function (exports) { * * @member {Uint8Array} */ - prototypeAccessors$5$1.uint8View.get = function () + prototypeAccessors$5.uint8View.get = function () { if (!this._uint8View) { @@ -26296,7 +26641,7 @@ var PIXI = (function (exports) { * * @member {Int16Array} */ - prototypeAccessors$5$1.int16View.get = function () + prototypeAccessors$5.int16View.get = function () { if (!this._int16View) { @@ -26311,7 +26656,7 @@ var PIXI = (function (exports) { * * @member {Uint16Array} */ - prototypeAccessors$5$1.uint16View.get = function () + prototypeAccessors$5.uint16View.get = function () { if (!this._uint16View) { @@ -26326,7 +26671,7 @@ var PIXI = (function (exports) { * * @member {Int32Array} */ - prototypeAccessors$5$1.int32View.get = function () + prototypeAccessors$5.int32View.get = function () { if (!this._int32View) { @@ -26383,7 +26728,7 @@ var PIXI = (function (exports) { } }; - Object.defineProperties( ViewableBuffer.prototype, prototypeAccessors$5$1 ); + Object.defineProperties( ViewableBuffer.prototype, prototypeAccessors$5 ); /** * Renderer dedicated to drawing and batching sprites. @@ -26458,9 +26803,9 @@ var PIXI = (function (exports) { * occurs automatically. * * @member {number} - * @default settings.SPRITE_MAX_TEXTURES + * @default settings.SPRITE_BATCH_SIZE * 4 */ - this.size = 2000 * 4;// settings.SPRITE_BATCH_SIZE, 2000 is a nice balance between mobile/desktop + this.size = settings.SPRITE_BATCH_SIZE * 4; /** * Total count of all vertices used by the currently @@ -26488,6 +26833,13 @@ var PIXI = (function (exports) { */ this._bufferedElements = []; + /** + * Data for texture batch builder, helps to save a bit of CPU on a pass + * @type {PIXI.BaseTexture[]} + * @private + */ + this._bufferedTextures = []; + /** * Number of elements that are buffered and are * waiting to be flushed. @@ -26548,22 +26900,6 @@ var PIXI = (function (exports) { */ this._flushId = 0; - /** - * Pool of `BatchDrawCall` objects that `flush` used - * to create "batches" of the objects being rendered. - * - * These are never re-allocated again. - * - * @member BatchDrawCall[] - * @private - */ - this._drawCalls = []; - - for (var k = 0; k < this.size / 4; k++) - { // initialize the draw-calls pool to max size. - this._drawCalls[k] = new BatchDrawCall(); - } - /** * Pool of `ViewableBuffer` objects that are sorted in * order of increasing size. The flush method uses @@ -26573,7 +26909,7 @@ var PIXI = (function (exports) { * The first buffer has a size of 8; each subsequent * buffer has double capacity of its previous. * - * @member {PIXI.ViewableBuffer} + * @member {PIXI.ViewableBuffer[]} * @private * @see PIXI.AbstractBatchRenderer#getAttributeBuffer */ @@ -26607,6 +26943,13 @@ var PIXI = (function (exports) { this.renderer.on('prerender', this.onPrerender, this); renderer.runners.contextChange.add(this); + + this._dcIndex = 0; + this._aIndex = 0; + this._iIndex = 0; + this._attributeBuffer = null; + this._indexBuffer = null; + this._tempBoundTextures = []; } if ( ObjectRenderer ) { AbstractBatchRenderer.__proto__ = ObjectRenderer; } @@ -26623,7 +26966,7 @@ var PIXI = (function (exports) { { var gl = this.renderer.gl; - if (settings.PREFER_ENV === ENV.WEBGL_LEGACY) + if (settings.PREFER_ENV === exports.ENV.WEBGL_LEGACY) { this.MAX_TEXTURES = 1; } @@ -26648,6 +26991,34 @@ var PIXI = (function (exports) { /* eslint-disable max-len */ this._packedGeometries[i] = new (this.geometryClass)(); } + + this.initFlushBuffers(); + }; + + /** + * Makes sure that static and dynamic flush pooled objects have correct dimensions + */ + AbstractBatchRenderer.prototype.initFlushBuffers = function initFlushBuffers () + { + var _drawCallPool = AbstractBatchRenderer._drawCallPool; + var _textureArrayPool = AbstractBatchRenderer._textureArrayPool; + // max draw calls + var MAX_SPRITES = this.size / 4; + // max texture arrays + var MAX_TA = Math.floor(MAX_SPRITES / this.MAX_TEXTURES) + 1; + + while (_drawCallPool.length < MAX_SPRITES) + { + _drawCallPool.push(new BatchDrawCall()); + } + while (_textureArrayPool.length < MAX_TA) + { + _textureArrayPool.push(new BatchTextureArray()); + } + for (var i = 0; i < this.MAX_TEXTURES; i++) + { + this._tempBoundTextures[i] = null; + } }; /** @@ -26665,8 +27036,8 @@ var PIXI = (function (exports) { * Buffers the "batchable" object. It need not be rendered * immediately. * - * @param {PIXI.Sprite} sprite - the sprite to render when - * using this spritebatch + * @param {PIXI.DisplayObject} element - the element to render when + * using this renderer */ AbstractBatchRenderer.prototype.render = function render (element) { @@ -26682,9 +27053,210 @@ var PIXI = (function (exports) { this._vertexCount += element.vertexData.length / 2; this._indexCount += element.indices.length; + this._bufferedTextures[this._bufferSize] = element._texture.baseTexture; this._bufferedElements[this._bufferSize++] = element; }; + AbstractBatchRenderer.prototype.buildTexturesAndDrawCalls = function buildTexturesAndDrawCalls () + { + var ref = this; + var textures = ref._bufferedTextures; + var MAX_TEXTURES = ref.MAX_TEXTURES; + var textureArrays = AbstractBatchRenderer._textureArrayPool; + var batch = this.renderer.batch; + var boundTextures = this._tempBoundTextures; + var touch = this.renderer.textureGC.count; + + var TICK = ++BaseTexture._globalBatch; + var countTexArrays = 0; + var texArray = textureArrays[0]; + var start = 0; + + batch.copyBoundTextures(boundTextures, MAX_TEXTURES); + + for (var i = 0; i < this._bufferSize; ++i) + { + var tex = textures[i]; + + textures[i] = null; + if (tex._batchEnabled === TICK) + { + continue; + } + + if (texArray.count >= MAX_TEXTURES) + { + batch.boundArray(texArray, boundTextures, TICK, MAX_TEXTURES); + this.buildDrawCalls(texArray, start, i); + start = i; + texArray = textureArrays[++countTexArrays]; + ++TICK; + } + + tex._batchEnabled = TICK; + tex.touched = touch; + texArray.elements[texArray.count++] = tex; + } + + if (texArray.count > 0) + { + batch.boundArray(texArray, boundTextures, TICK, MAX_TEXTURES); + this.buildDrawCalls(texArray, start, this._bufferSize); + ++countTexArrays; + ++TICK; + } + + // Clean-up + + for (var i$1 = 0; i$1 < boundTextures.length; i$1++) + { + boundTextures[i$1] = null; + } + BaseTexture._globalBatch = TICK; + }; + + /** + * Populating drawcalls for rendering + * + * @param {PIXI.BatchTextureArray} texArray + * @param {number} start + * @param {number} finish + */ + AbstractBatchRenderer.prototype.buildDrawCalls = function buildDrawCalls (texArray, start, finish) + { + var ref = this; + var elements = ref._bufferedElements; + var _attributeBuffer = ref._attributeBuffer; + var _indexBuffer = ref._indexBuffer; + var vertexSize = ref.vertexSize; + var drawCalls = AbstractBatchRenderer._drawCallPool; + + var dcIndex = this._dcIndex; + var aIndex = this._aIndex; + var iIndex = this._iIndex; + + var drawCall = drawCalls[dcIndex]; + + drawCall.start = this._iIndex; + drawCall.texArray = texArray; + + for (var i = start; i < finish; ++i) + { + var sprite = elements[i]; + var tex = sprite._texture.baseTexture; + var spriteBlendMode = premultiplyBlendMode[ + tex.alphaMode ? 1 : 0][sprite.blendMode]; + + elements[i] = null; + + if (start < i && drawCall.blend !== spriteBlendMode) + { + drawCall.size = iIndex - drawCall.start; + start = i; + drawCall = drawCalls[++dcIndex]; + drawCall.texArray = texArray; + drawCall.start = iIndex; + } + + this.packInterleavedGeometry(sprite, _attributeBuffer, _indexBuffer, aIndex, iIndex); + aIndex += sprite.vertexData.length / 2 * vertexSize; + iIndex += sprite.indices.length; + + drawCall.blend = spriteBlendMode; + } + + if (start < finish) + { + drawCall.size = iIndex - drawCall.start; + ++dcIndex; + } + + this._dcIndex = dcIndex; + this._aIndex = aIndex; + this._iIndex = iIndex; + }; + + /** + * Bind textures for current rendering + * + * @param {PIXI.BatchTextureArray} texArray + */ + AbstractBatchRenderer.prototype.bindAndClearTexArray = function bindAndClearTexArray (texArray) + { + var textureSystem = this.renderer.texture; + + for (var j = 0; j < texArray.count; j++) + { + textureSystem.bind(texArray.elements[j], texArray.ids[j]); + texArray.elements[j] = null; + } + texArray.count = 0; + }; + + AbstractBatchRenderer.prototype.updateGeometry = function updateGeometry () + { + var ref = this; + var packedGeometries = ref._packedGeometries; + var attributeBuffer = ref._attributeBuffer; + var indexBuffer = ref._indexBuffer; + + if (!settings.CAN_UPLOAD_SAME_BUFFER) + { /* Usually on iOS devices, where the browser doesn't + like uploads to the same buffer in a single frame. */ + if (this._packedGeometryPoolSize <= this._flushId) + { + this._packedGeometryPoolSize++; + packedGeometries[this._flushId] = new (this.geometryClass)(); + } + + packedGeometries[this._flushId]._buffer.update(attributeBuffer.rawBinaryData); + packedGeometries[this._flushId]._indexBuffer.update(indexBuffer); + + this.renderer.geometry.bind(packedGeometries[this._flushId]); + this.renderer.geometry.updateBuffers(); + this._flushId++; + } + else + { + // lets use the faster option, always use buffer number 0 + packedGeometries[this._flushId]._buffer.update(attributeBuffer.rawBinaryData); + packedGeometries[this._flushId]._indexBuffer.update(indexBuffer); + + this.renderer.geometry.updateBuffers(); + } + }; + + AbstractBatchRenderer.prototype.drawBatches = function drawBatches () + { + var dcCount = this._dcIndex; + var ref = this.renderer; + var gl = ref.gl; + var stateSystem = ref.state; + var drawCalls = AbstractBatchRenderer._drawCallPool; + + var curTexArray = null; + + // Upload textures and do the draw calls + for (var i = 0; i < dcCount; i++) + { + var ref$1 = drawCalls[i]; + var texArray = ref$1.texArray; + var type = ref$1.type; + var size = ref$1.size; + var start = ref$1.start; + var blend = ref$1.blend; + + if (curTexArray !== texArray) + { + curTexArray = texArray; + this.bindAndClearTexArray(texArray); + } + + stateSystem.setBlendMode(blend); + gl.drawElements(type, size, gl.UNSIGNED_SHORT, start * 2); + } + }; + /** * Renders the content _now_ and empties the current batch. */ @@ -26695,143 +27267,17 @@ var PIXI = (function (exports) { return; } - var attributeBuffer = this.getAttributeBuffer(this._vertexCount); - var indexBuffer = this.getIndexBuffer(this._indexCount); - var gl = this.renderer.gl; + this._attributeBuffer = this.getAttributeBuffer(this._vertexCount); + this._indexBuffer = this.getIndexBuffer(this._indexCount); + this._aIndex = 0; + this._iIndex = 0; + this._dcIndex = 0; - var ref = this; - var elements = ref._bufferedElements; - var drawCalls = ref._drawCalls; - var MAX_TEXTURES = ref.MAX_TEXTURES; - var packedGeometries = ref._packedGeometries; - var vertexSize = ref.vertexSize; + this.buildTexturesAndDrawCalls(); + this.updateGeometry(); + this.drawBatches(); - var touch = this.renderer.textureGC.count; - - var index = 0; - var _indexCount = 0; - - var nextTexture; - var currentTexture; - var textureCount = 0; - - var currentGroup = drawCalls[0]; - var groupCount = 0; - - var blendMode = -1;// blend-mode of previous element/sprite/object! - - currentGroup.textureCount = 0; - currentGroup.start = 0; - currentGroup.blend = blendMode; - - var TICK = ++BaseTexture._globalBatch; - var i; - - for (i = 0; i < this._bufferSize; ++i) - { - var sprite = elements[i]; - - elements[i] = null; - nextTexture = sprite._texture.baseTexture; - - var spriteBlendMode = premultiplyBlendMode[ - nextTexture.premultiplyAlpha ? 1 : 0][sprite.blendMode]; - - if (blendMode !== spriteBlendMode) - { - blendMode = spriteBlendMode; - - // force the batch to break! - currentTexture = null; - textureCount = MAX_TEXTURES; - TICK++; - } - - if (currentTexture !== nextTexture) - { - currentTexture = nextTexture; - - if (nextTexture._batchEnabled !== TICK) - { - if (textureCount === MAX_TEXTURES) - { - TICK++; - - textureCount = 0; - - currentGroup.size = _indexCount - currentGroup.start; - - currentGroup = drawCalls[groupCount++]; - currentGroup.textureCount = 0; - currentGroup.blend = blendMode; - currentGroup.start = _indexCount; - } - - nextTexture.touched = touch; - nextTexture._batchEnabled = TICK; - nextTexture._id = textureCount; - - currentGroup.textures[currentGroup.textureCount++] = nextTexture; - textureCount++; - } - } - - this.packInterleavedGeometry(sprite, attributeBuffer, - indexBuffer, index, _indexCount); - - // push a graphics.. - index += (sprite.vertexData.length / 2) * vertexSize; - _indexCount += sprite.indices.length; - } - - BaseTexture._globalBatch = TICK; - currentGroup.size = _indexCount - currentGroup.start; - - if (!settings.CAN_UPLOAD_SAME_BUFFER) - { /* Usually on iOS devices, where the browser doesn't - like uploads to the same buffer in a single frame. */ - if (this._packedGeometryPoolSize <= this._flushId) - { - this._packedGeometryPoolSize++; - packedGeometries[this._flushId] = new (this.geometryClass)(); - } - - packedGeometries[this._flushId]._buffer.update(attributeBuffer.rawBinaryData, 0); - packedGeometries[this._flushId]._indexBuffer.update(indexBuffer, 0); - - this.renderer.geometry.bind(packedGeometries[this._flushId]); - this.renderer.geometry.updateBuffers(); - this._flushId++; - } - else - { - // lets use the faster option, always use buffer number 0 - packedGeometries[this._flushId]._buffer.update(attributeBuffer.rawBinaryData, 0); - packedGeometries[this._flushId]._indexBuffer.update(indexBuffer, 0); - - this.renderer.geometry.updateBuffers(); - } - - var textureSystem = this.renderer.texture; - var stateSystem = this.renderer.state; - - // Upload textures and do the draw calls - for (i = 0; i < groupCount; i++) - { - var group = drawCalls[i]; - var groupTextureCount = group.textureCount; - - for (var j = 0; j < groupTextureCount; j++) - { - textureSystem.bind(group.textures[j], j); - group.textures[j] = null; - } - - stateSystem.setBlendMode(group.blend); - gl.drawElements(group.type, group.size, gl.UNSIGNED_SHORT, group.start * 2); - } - - // reset elements for the next flush + // reset elements buffer for the next flush this._bufferSize = 0; this._vertexCount = 0; this._indexCount = 0; @@ -26879,7 +27325,8 @@ var PIXI = (function (exports) { this._aBuffers = null; this._iBuffers = null; this._packedGeometries = null; - this._drawCalls = null; + this._attributeBuffer = null; + this._indexBuffer = null; if (this._shader) { @@ -26974,11 +27421,11 @@ var PIXI = (function (exports) { var uvs = element.uvs; var indicies = element.indices; var vertexData = element.vertexData; - var textureId = element._texture.baseTexture._id; + var textureId = element._texture.baseTexture._batchLocation; var alpha = Math.min(element.worldAlpha, 1.0); var argb = (alpha < 1.0 - && element._texture.baseTexture.premultiplyAlpha) + && element._texture.baseTexture.alphaMode) ? premultiplyTint(element._tintRGB, alpha) : element._tintRGB + (alpha * 255 << 24); @@ -27002,6 +27449,30 @@ var PIXI = (function (exports) { return AbstractBatchRenderer; }(ObjectRenderer)); + /** + * Pool of `BatchDrawCall` objects that `flush` used + * to create "batches" of the objects being rendered. + * + * These are never re-allocated again. + * Shared between all batch renderers because it can be only one "flush" working at the moment. + * + * @static + * @member {PIXI.BatchDrawCall[]} + */ + AbstractBatchRenderer._drawCallPool = []; + + /** + * Pool of `BatchDrawCall` objects that `flush` used + * to create "batches" of the objects being rendered. + * + * These are never re-allocated again. + * Shared between all batch renderers because it can be only one "flush" working at the moment. + * + * @static + * @member {PIXI.BatchTextureArray[]} + */ + AbstractBatchRenderer._textureArrayPool = []; + /** * Helper that generates batching multi-texture shader. Use it with your new BatchRenderer * @@ -27127,10 +27598,10 @@ var PIXI = (function (exports) { */ this._indexBuffer = new Buffer(null, _static, true); - this.addAttribute('aVertexPosition', this._buffer, 2, false, TYPES.FLOAT) - .addAttribute('aTextureCoord', this._buffer, 2, false, TYPES.FLOAT) - .addAttribute('aColor', this._buffer, 4, true, TYPES.UNSIGNED_BYTE) - .addAttribute('aTextureId', this._buffer, 1, true, TYPES.FLOAT) + this.addAttribute('aVertexPosition', this._buffer, 2, false, exports.TYPES.FLOAT) + .addAttribute('aTextureCoord', this._buffer, 2, false, exports.TYPES.FLOAT) + .addAttribute('aColor', this._buffer, 4, true, exports.TYPES.UNSIGNED_BYTE) + .addAttribute('aTextureId', this._buffer, 1, true, exports.TYPES.FLOAT) .addIndex(this._indexBuffer); } @@ -27152,7 +27623,7 @@ var PIXI = (function (exports) { */ var BatchPluginFactory = function BatchPluginFactory () {}; - var staticAccessors$1$1 = { defaultVertexSrc: { configurable: true },defaultFragmentTemplate: { configurable: true } }; + var staticAccessors$1 = { defaultVertexSrc: { configurable: true },defaultFragmentTemplate: { configurable: true } }; BatchPluginFactory.create = function create (options) { @@ -27192,7 +27663,7 @@ var PIXI = (function (exports) { * @type {string} * @constant */ - staticAccessors$1$1.defaultVertexSrc.get = function () + staticAccessors$1.defaultVertexSrc.get = function () { return defaultVertex$2; }; @@ -27204,20 +27675,20 @@ var PIXI = (function (exports) { * @type {string} * @constant */ - staticAccessors$1$1.defaultFragmentTemplate.get = function () + staticAccessors$1.defaultFragmentTemplate.get = function () { return defaultFragment$2; }; - Object.defineProperties( BatchPluginFactory, staticAccessors$1$1 ); + Object.defineProperties( BatchPluginFactory, staticAccessors$1 ); // Setup the default BatchRenderer plugin, this is what // we'll actually export at the root level var BatchRenderer = BatchPluginFactory.create(); /*! - * @pixi/extract - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/extract - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/extract is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -27329,8 +27800,8 @@ var PIXI = (function (exports) { renderer.renderTexture.bind(null); } - var width = Math.floor(frame.width * resolution); - var height = Math.floor(frame.height * resolution); + var width = Math.floor((frame.width * resolution) + 1e-4); + var height = Math.floor((frame.height * resolution) + 1e-4); var canvasBuffer = new CanvasRenderTarget(width, height, 1); @@ -27491,8 +27962,8 @@ var PIXI = (function (exports) { }); /*! - * @pixi/interaction - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/interaction - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/interaction is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -27798,7 +28269,7 @@ var PIXI = (function (exports) { this._flags = InteractionTrackingData.FLAGS.NONE; }; - var prototypeAccessors$1$3 = { pointerId: { configurable: true },flags: { configurable: true },none: { configurable: true },over: { configurable: true },rightDown: { configurable: true },leftDown: { configurable: true } }; + var prototypeAccessors$1$2 = { pointerId: { configurable: true },flags: { configurable: true },none: { configurable: true },over: { configurable: true },rightDown: { configurable: true },leftDown: { configurable: true } }; /** * @@ -27825,7 +28296,7 @@ var PIXI = (function (exports) { * @private * @member {number} */ - prototypeAccessors$1$3.pointerId.get = function () + prototypeAccessors$1$2.pointerId.get = function () { return this._pointerId; }; @@ -27836,12 +28307,12 @@ var PIXI = (function (exports) { * @private * @member {number} */ - prototypeAccessors$1$3.flags.get = function () + prototypeAccessors$1$2.flags.get = function () { return this._flags; }; - prototypeAccessors$1$3.flags.set = function (flags) // eslint-disable-line require-jsdoc + prototypeAccessors$1$2.flags.set = function (flags) // eslint-disable-line require-jsdoc { this._flags = flags; }; @@ -27852,7 +28323,7 @@ var PIXI = (function (exports) { * @private * @member {number} */ - prototypeAccessors$1$3.none.get = function () + prototypeAccessors$1$2.none.get = function () { return this._flags === this.constructor.FLAGS.NONE; }; @@ -27863,12 +28334,12 @@ var PIXI = (function (exports) { * @private * @member {boolean} */ - prototypeAccessors$1$3.over.get = function () + prototypeAccessors$1$2.over.get = function () { return (this._flags & this.constructor.FLAGS.OVER) !== 0; }; - prototypeAccessors$1$3.over.set = function (yn) // eslint-disable-line require-jsdoc + prototypeAccessors$1$2.over.set = function (yn) // eslint-disable-line require-jsdoc { this._doSet(this.constructor.FLAGS.OVER, yn); }; @@ -27879,12 +28350,12 @@ var PIXI = (function (exports) { * @private * @member {boolean} */ - prototypeAccessors$1$3.rightDown.get = function () + prototypeAccessors$1$2.rightDown.get = function () { return (this._flags & this.constructor.FLAGS.RIGHT_DOWN) !== 0; }; - prototypeAccessors$1$3.rightDown.set = function (yn) // eslint-disable-line require-jsdoc + prototypeAccessors$1$2.rightDown.set = function (yn) // eslint-disable-line require-jsdoc { this._doSet(this.constructor.FLAGS.RIGHT_DOWN, yn); }; @@ -27895,17 +28366,17 @@ var PIXI = (function (exports) { * @private * @member {boolean} */ - prototypeAccessors$1$3.leftDown.get = function () + prototypeAccessors$1$2.leftDown.get = function () { return (this._flags & this.constructor.FLAGS.LEFT_DOWN) !== 0; }; - prototypeAccessors$1$3.leftDown.set = function (yn) // eslint-disable-line require-jsdoc + prototypeAccessors$1$2.leftDown.set = function (yn) // eslint-disable-line require-jsdoc { this._doSet(this.constructor.FLAGS.LEFT_DOWN, yn); }; - Object.defineProperties( InteractionTrackingData.prototype, prototypeAccessors$1$3 ); + Object.defineProperties( InteractionTrackingData.prototype, prototypeAccessors$1$2 ); InteractionTrackingData.FLAGS = Object.freeze({ NONE: 0, @@ -27914,6 +28385,195 @@ var PIXI = (function (exports) { RIGHT_DOWN: 1 << 2, }); + /** + * Strategy how to search through stage tree for interactive objects + * + * @private + * @class + * @memberof PIXI.interaction + */ + var TreeSearch = function TreeSearch() + { + this._tempPoint = new Point(); + }; + + /** + * Recursive implementation for findHit + * + * @private + * @param {PIXI.interaction.InteractionEvent} interactionEvent - event containing the point that + * is tested for collision + * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - the displayObject + * that will be hit test (recursively crawls its children) + * @param {Function} [func] - the function that will be called on each interactive object. The + * interactionEvent, displayObject and hit will be passed to the function + * @param {boolean} [hitTest] - this indicates if the objects inside should be hit test against the point + * @param {boolean} [interactive] - Whether the displayObject is interactive + * @return {boolean} returns true if the displayObject hit the point + */ + TreeSearch.prototype.recursiveFindHit = function recursiveFindHit (interactionEvent, displayObject, func, hitTest, interactive) + { + if (!displayObject || !displayObject.visible) + { + return false; + } + + var point = interactionEvent.data.global; + + // Took a little while to rework this function correctly! But now it is done and nice and optimized! ^_^ + // + // This function will now loop through all objects and then only hit test the objects it HAS + // to, not all of them. MUCH faster.. + // An object will be hit test if the following is true: + // + // 1: It is interactive. + // 2: It belongs to a parent that is interactive AND one of the parents children have not already been hit. + // + // As another little optimization once an interactive object has been hit we can carry on + // through the scenegraph, but we know that there will be no more hits! So we can avoid extra hit tests + // A final optimization is that an object is not hit test directly if a child has already been hit. + + interactive = displayObject.interactive || interactive; + + var hit = false; + var interactiveParent = interactive; + + // Flag here can set to false if the event is outside the parents hitArea or mask + var hitTestChildren = true; + + // If there is a hitArea, no need to test against anything else if the pointer is not within the hitArea + // There is also no longer a need to hitTest children. + if (displayObject.hitArea) + { + if (hitTest) + { + displayObject.worldTransform.applyInverse(point, this._tempPoint); + if (!displayObject.hitArea.contains(this._tempPoint.x, this._tempPoint.y)) + { + hitTest = false; + hitTestChildren = false; + } + else + { + hit = true; + } + } + interactiveParent = false; + } + // If there is a mask, no need to hitTest against anything else if the pointer is not within the mask. + // We still want to hitTestChildren, however, to ensure a mouseout can still be generated. + // https://github.com/pixijs/pixi.js/issues/5135 + else if (displayObject._mask) + { + if (hitTest) + { + if (!(displayObject._mask.containsPoint && displayObject._mask.containsPoint(point))) + { + hitTest = false; + } + } + } + + // ** FREE TIP **! If an object is not interactive or has no buttons in it + // (such as a game scene!) set interactiveChildren to false for that displayObject. + // This will allow PixiJS to completely ignore and bypass checking the displayObjects children. + if (hitTestChildren && displayObject.interactiveChildren && displayObject.children) + { + var children = displayObject.children; + + for (var i = children.length - 1; i >= 0; i--) + { + var child = children[i]; + + // time to get recursive.. if this function will return if something is hit.. + var childHit = this.recursiveFindHit(interactionEvent, child, func, hitTest, interactiveParent); + + if (childHit) + { + // its a good idea to check if a child has lost its parent. + // this means it has been removed whilst looping so its best + if (!child.parent) + { + continue; + } + + // we no longer need to hit test any more objects in this container as we we + // now know the parent has been hit + interactiveParent = false; + + // If the child is interactive , that means that the object hit was actually + // interactive and not just the child of an interactive object. + // This means we no longer need to hit test anything else. We still need to run + // through all objects, but we don't need to perform any hit tests. + + if (childHit) + { + if (interactionEvent.target) + { + hitTest = false; + } + hit = true; + } + } + } + } + + // no point running this if the item is not interactive or does not have an interactive parent. + if (interactive) + { + // if we are hit testing (as in we have no hit any objects yet) + // We also don't need to worry about hit testing if once of the displayObjects children + // has already been hit - but only if it was interactive, otherwise we need to keep + // looking for an interactive child, just in case we hit one + if (hitTest && !interactionEvent.target) + { + // already tested against hitArea if it is defined + if (!displayObject.hitArea && displayObject.containsPoint) + { + if (displayObject.containsPoint(point)) + { + hit = true; + } + } + } + + if (displayObject.interactive) + { + if (hit && !interactionEvent.target) + { + interactionEvent.target = displayObject; + } + + if (func) + { + func(interactionEvent, displayObject, !!hit); + } + } + } + + return hit; + }; + + /** + * This function is provides a neat way of crawling through the scene graph and running a + * specified function on all interactive objects it finds. It will also take care of hit + * testing the interactive objects and passes the hit across in the function. + * + * @private + * @param {PIXI.interaction.InteractionEvent} interactionEvent - event containing the point that + * is tested for collision + * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - the displayObject + * that will be hit test (recursively crawls its children) + * @param {Function} [func] - the function that will be called on each interactive object. The + * interactionEvent, displayObject and hit will be passed to the function + * @param {boolean} [hitTest] - this indicates if the objects inside should be hit test against the point + * @return {boolean} returns true if the displayObject hit the point + */ + TreeSearch.prototype.findHit = function findHit (interactionEvent, displayObject, func, hitTest) + { + this.recursiveFindHit(interactionEvent, displayObject, func, hitTest, false); + }; + /** * Interface for classes that represent a hit area. * @@ -28280,14 +28940,6 @@ var PIXI = (function (exports) { */ this.cursor = null; - /** - * Internal cached let. - * - * @private - * @member {PIXI.Point} - */ - this._tempPoint = new Point(); - /** * The current resolution / device pixel ratio. * @@ -28304,6 +28956,14 @@ var PIXI = (function (exports) { */ this.delayedEvents = []; + /** + * TreeSearch component that is used to hitTest stage tree + * + * @private + * @member {PIXI.interaction.TreeSearch} + */ + this.search = new TreeSearch(); + /** * Fired when a pointer device button (usually a mouse left-button) is pressed on the display * object. @@ -28766,7 +29426,7 @@ var PIXI = (function (exports) { return; } - Ticker.system.add(this.update, this, UPDATE_PRIORITY.INTERACTION); + Ticker.system.add(this.update, this, exports.UPDATE_PRIORITY.INTERACTION); if (window.navigator.msPointerEnabled) { @@ -29060,179 +29720,41 @@ var PIXI = (function (exports) { * that will be hit test (recursively crawls its children) * @param {Function} [func] - the function that will be called on each interactive object. The * interactionEvent, displayObject and hit will be passed to the function - * @param {boolean} [hitTest] - this indicates if the objects inside should be hit test against the point - * @param {boolean} [interactive] - Whether the displayObject is interactive - * @param {boolean} [skipDelayed] - Whether to process delayed events before returning. This is - * used to avoid processing them too early during recursive calls. - * @return {boolean} returns true if the displayObject hit the point + * @param {boolean} [hitTest] - indicates whether we want to calculate hits + * or just iterate through all interactive objects */ - InteractionManager.prototype.processInteractive = function processInteractive (interactionEvent, displayObject, func, hitTest, interactive, skipDelayed) + InteractionManager.prototype.processInteractive = function processInteractive (interactionEvent, displayObject, func, hitTest) { - if (!displayObject || !displayObject.visible) - { - return false; - } - - var point = interactionEvent.data.global; - - // Took a little while to rework this function correctly! But now it is done and nice and optimized! ^_^ - // - // This function will now loop through all objects and then only hit test the objects it HAS - // to, not all of them. MUCH faster.. - // An object will be hit test if the following is true: - // - // 1: It is interactive. - // 2: It belongs to a parent that is interactive AND one of the parents children have not already been hit. - // - // As another little optimization once an interactive object has been hit we can carry on - // through the scenegraph, but we know that there will be no more hits! So we can avoid extra hit tests - // A final optimization is that an object is not hit test directly if a child has already been hit. - - interactive = displayObject.interactive || interactive; - - var hit = false; - var interactiveParent = interactive; - - // Flag here can set to false if the event is outside the parents hitArea or mask - var hitTestChildren = true; - - // If there is a hitArea, no need to test against anything else if the pointer is not within the hitArea - // There is also no longer a need to hitTest children. - if (displayObject.hitArea) - { - if (hitTest) - { - displayObject.worldTransform.applyInverse(point, this._tempPoint); - if (!displayObject.hitArea.contains(this._tempPoint.x, this._tempPoint.y)) - { - hitTest = false; - hitTestChildren = false; - } - else - { - hit = true; - } - } - interactiveParent = false; - } - // If there is a mask, no need to hitTest against anything else if the pointer is not within the mask. - // We still want to hitTestChildren, however, to ensure a mouseout can still be generated. - // https://github.com/pixijs/pixi.js/issues/5135 - else if (displayObject._mask) - { - if (hitTest) - { - if (!(displayObject._mask.containsPoint && displayObject._mask.containsPoint(point))) - { - hitTest = false; - } - } - } - - // ** FREE TIP **! If an object is not interactive or has no buttons in it - // (such as a game scene!) set interactiveChildren to false for that displayObject. - // This will allow PixiJS to completely ignore and bypass checking the displayObjects children. - if (hitTestChildren && displayObject.interactiveChildren && displayObject.children) - { - var children = displayObject.children; - - for (var i = children.length - 1; i >= 0; i--) - { - var child = children[i]; - - // time to get recursive.. if this function will return if something is hit.. - var childHit = this.processInteractive(interactionEvent, child, func, hitTest, interactiveParent, true); - - if (childHit) - { - // its a good idea to check if a child has lost its parent. - // this means it has been removed whilst looping so its best - if (!child.parent) - { - continue; - } - - // we no longer need to hit test any more objects in this container as we we - // now know the parent has been hit - interactiveParent = false; - - // If the child is interactive , that means that the object hit was actually - // interactive and not just the child of an interactive object. - // This means we no longer need to hit test anything else. We still need to run - // through all objects, but we don't need to perform any hit tests. - - if (childHit) - { - if (interactionEvent.target) - { - hitTest = false; - } - hit = true; - } - } - } - } - - // no point running this if the item is not interactive or does not have an interactive parent. - if (interactive) - { - // if we are hit testing (as in we have no hit any objects yet) - // We also don't need to worry about hit testing if once of the displayObjects children - // has already been hit - but only if it was interactive, otherwise we need to keep - // looking for an interactive child, just in case we hit one - if (hitTest && !interactionEvent.target) - { - // already tested against hitArea if it is defined - if (!displayObject.hitArea && displayObject.containsPoint) - { - if (displayObject.containsPoint(point)) - { - hit = true; - } - } - } - - if (displayObject.interactive) - { - if (hit && !interactionEvent.target) - { - interactionEvent.target = displayObject; - } - - if (func) - { - func(interactionEvent, displayObject, !!hit); - } - } - } + var hit = this.search.findHit(interactionEvent, displayObject, func, hitTest); var delayedEvents = this.delayedEvents; - if (delayedEvents.length && !skipDelayed) + if (!delayedEvents.length) { - // Reset the propagation hint, because we start deeper in the tree again. - interactionEvent.stopPropagationHint = false; + return hit; + } + // Reset the propagation hint, because we start deeper in the tree again. + interactionEvent.stopPropagationHint = false; - var delayedLen = delayedEvents.length; + var delayedLen = delayedEvents.length; - this.delayedEvents = []; + this.delayedEvents = []; - for (var i$1 = 0; i$1 < delayedLen; i$1++) + for (var i = 0; i < delayedLen; i++) + { + var ref = delayedEvents[i]; + var displayObject$1 = ref.displayObject; + var eventString = ref.eventString; + var eventData = ref.eventData; + + // When we reach the object we wanted to stop propagating at, + // set the propagation hint. + if (eventData.stopsPropagatingAt === displayObject$1) { - var ref = delayedEvents[i$1]; - var displayObject$1 = ref.displayObject; - var eventString = ref.eventString; - var eventData = ref.eventData; - - // When we reach the object we wanted to stop propagating at, - // set the propagation hint. - if (eventData.stopsPropagatingAt === displayObject$1) - { - eventData.stopPropagationHint = true; - } - - this.dispatchEvent(displayObject$1, eventString, eventData); + eventData.stopPropagationHint = true; } + + this.dispatchEvent(displayObject$1, eventString, eventData); } return hit; @@ -29938,7 +30460,7 @@ var PIXI = (function (exports) { this.onPointerOver = null; - this._tempPoint = null; + this.search = null; }; return InteractionManager; @@ -29953,8 +30475,8 @@ var PIXI = (function (exports) { }); /*! - * @pixi/graphics - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/graphics - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/graphics is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -30088,455 +30610,6 @@ var PIXI = (function (exports) { this.matrix = null; }; - /** - * A class to contain data useful for Graphics objects - * - * @class - * @memberof PIXI - */ - var GraphicsData = function GraphicsData(shape, fillStyle, lineStyle, matrix) - { - if ( fillStyle === void 0 ) { fillStyle = null; } - if ( lineStyle === void 0 ) { lineStyle = null; } - if ( matrix === void 0 ) { matrix = null; } - - /** - * The shape object to draw. - * @member {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} - */ - this.shape = shape; - - /** - * The style of the line. - * @member {PIXI.LineStyle} - */ - this.lineStyle = lineStyle; - - /** - * The style of the fill. - * @member {PIXI.FillStyle} - */ - this.fillStyle = fillStyle; - - /** - * The transform matrix. - * @member {PIXI.Matrix} - */ - this.matrix = matrix; - - /** - * The type of the shape, see the Const.Shapes file for all the existing types, - * @member {number} - */ - this.type = shape.type; - - /** - * The collection of points. - * @member {number[]} - */ - this.points = []; - - /** - * The collection of holes. - * @member {PIXI.GraphicsData[]} - */ - this.holes = []; - }; - - /** - * Creates a new GraphicsData object with the same values as this one. - * - * @return {PIXI.GraphicsData} Cloned GraphicsData object - */ - GraphicsData.prototype.clone = function clone () - { - return new GraphicsData( - this.shape, - this.fillStyle, - this.lineStyle, - this.matrix - ); - }; - - /** - * Destroys the Graphics data. - */ - GraphicsData.prototype.destroy = function destroy () - { - this.shape = null; - this.holes.length = 0; - this.holes = null; - this.points.length = 0; - this.points = null; - this.lineStyle = null; - this.fillStyle = null; - }; - - /** - * Builds a circle to draw - * - * Ignored from docs since it is not directly exposed. - * - * @ignore - * @private - * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object to draw - * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape - * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines - */ - var buildCircle = { - - build: function build(graphicsData) - { - // need to convert points to a nice regular data - var circleData = graphicsData.shape; - var points = graphicsData.points; - var x = circleData.x; - var y = circleData.y; - var width; - var height; - - points.length = 0; - - // TODO - bit hacky?? - if (graphicsData.type === SHAPES.CIRC) - { - width = circleData.radius; - height = circleData.radius; - } - else - { - width = circleData.width; - height = circleData.height; - } - - if (width === 0 || height === 0) - { - return; - } - - var totalSegs = Math.floor(30 * Math.sqrt(circleData.radius)) - || Math.floor(15 * Math.sqrt(circleData.width + circleData.height)); - - totalSegs /= 2.3; - - var seg = (Math.PI * 2) / totalSegs; - - for (var i = 0; i < totalSegs; i++) - { - points.push( - x + (Math.sin(-seg * i) * width), - y + (Math.cos(-seg * i) * height) - ); - } - - points.push( - points[0], - points[1] - ); - }, - - triangulate: function triangulate(graphicsData, graphicsGeometry) - { - var points = graphicsData.points; - var verts = graphicsGeometry.points; - var indices = graphicsGeometry.indices; - - var vertPos = verts.length / 2; - var center = vertPos; - - verts.push(graphicsData.shape.x, graphicsData.shape.y); - - for (var i = 0; i < points.length; i += 2) - { - verts.push(points[i], points[i + 1]); - - // add some uvs - indices.push(vertPos++, center, vertPos); - } - }, - }; - - /** - * Builds a line to draw - * - * Ignored from docs since it is not directly exposed. - * - * @ignore - * @private - * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties - * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output - */ - function buildLine (graphicsData, graphicsGeometry) - { - if (graphicsData.lineStyle.native) - { - buildNativeLine(graphicsData, graphicsGeometry); - } - else - { - buildLine$1(graphicsData, graphicsGeometry); - } - } - - /** - * Builds a line to draw using the polygon method. - * - * Ignored from docs since it is not directly exposed. - * - * @ignore - * @private - * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties - * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output - */ - function buildLine$1(graphicsData, graphicsGeometry) - { - var shape = graphicsData.shape; - var points = graphicsData.points || shape.points.slice(); - var eps = graphicsGeometry.closePointEps; - - if (points.length === 0) - { - return; - } - // if the line width is an odd number add 0.5 to align to a whole pixel - // commenting this out fixes #711 and #1620 - // if (graphicsData.lineWidth%2) - // { - // for (i = 0; i < points.length; i++) - // { - // points[i] += 0.5; - // } - // } - - var style = graphicsData.lineStyle; - - // get first and last point.. figure out the middle! - var firstPoint = new Point(points[0], points[1]); - var lastPoint = new Point(points[points.length - 2], points[points.length - 1]); - var closedShape = shape.type !== SHAPES.POLY || shape.closeStroke; - var closedPath = Math.abs(firstPoint.x - lastPoint.x) < eps - && Math.abs(firstPoint.y - lastPoint.y) < eps; - - // if the first point is the last point - gonna have issues :) - if (closedShape) - { - // need to clone as we are going to slightly modify the shape.. - points = points.slice(); - - if (closedPath) - { - points.pop(); - points.pop(); - lastPoint.set(points[points.length - 2], points[points.length - 1]); - } - - var midPointX = lastPoint.x + ((firstPoint.x - lastPoint.x) * 0.5); - var midPointY = lastPoint.y + ((firstPoint.y - lastPoint.y) * 0.5); - - points.unshift(midPointX, midPointY); - points.push(midPointX, midPointY); - } - - var verts = graphicsGeometry.points; - var length = points.length / 2; - var indexCount = points.length; - var indexStart = verts.length / 2; - - // DRAW the Line - var width = style.width / 2; - - // sort color - var p1x = points[0]; - var p1y = points[1]; - var p2x = points[2]; - var p2y = points[3]; - var p3x = 0; - var p3y = 0; - - var perpx = -(p1y - p2y); - var perpy = p1x - p2x; - var perp2x = 0; - var perp2y = 0; - var perp3x = 0; - var perp3y = 0; - - var dist = Math.sqrt((perpx * perpx) + (perpy * perpy)); - - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - var ratio = style.alignment;// 0.5; - var r1 = (1 - ratio) * 2; - var r2 = ratio * 2; - - // start - verts.push( - p1x - (perpx * r1), - p1y - (perpy * r1)); - - verts.push( - p1x + (perpx * r2), - p1y + (perpy * r2)); - - for (var i = 1; i < length - 1; ++i) - { - p1x = points[(i - 1) * 2]; - p1y = points[((i - 1) * 2) + 1]; - - p2x = points[i * 2]; - p2y = points[(i * 2) + 1]; - - p3x = points[(i + 1) * 2]; - p3y = points[((i + 1) * 2) + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt((perpx * perpx) + (perpy * perpy)); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - perp2x = -(p2y - p3y); - perp2y = p2x - p3x; - - dist = Math.sqrt((perp2x * perp2x) + (perp2y * perp2y)); - perp2x /= dist; - perp2y /= dist; - perp2x *= width; - perp2y *= width; - - var a1 = (-perpy + p1y) - (-perpy + p2y); - var b1 = (-perpx + p2x) - (-perpx + p1x); - var c1 = ((-perpx + p1x) * (-perpy + p2y)) - ((-perpx + p2x) * (-perpy + p1y)); - var a2 = (-perp2y + p3y) - (-perp2y + p2y); - var b2 = (-perp2x + p2x) - (-perp2x + p3x); - var c2 = ((-perp2x + p3x) * (-perp2y + p2y)) - ((-perp2x + p2x) * (-perp2y + p3y)); - - var denom = (a1 * b2) - (a2 * b1); - - if (Math.abs(denom) < 0.1) - { - denom += 10.1; - verts.push( - p2x - (perpx * r1), - p2y - (perpy * r1)); - - verts.push( - p2x + (perpx * r2), - p2y + (perpy * r2)); - - continue; - } - - var px = ((b1 * c2) - (b2 * c1)) / denom; - var py = ((a2 * c1) - (a1 * c2)) / denom; - var pdist = ((px - p2x) * (px - p2x)) + ((py - p2y) * (py - p2y)); - - if (pdist > (196 * width * width)) - { - perp3x = perpx - perp2x; - perp3y = perpy - perp2y; - - dist = Math.sqrt((perp3x * perp3x) + (perp3y * perp3y)); - perp3x /= dist; - perp3y /= dist; - perp3x *= width; - perp3y *= width; - - verts.push(p2x - (perp3x * r1), p2y - (perp3y * r1)); - - verts.push(p2x + (perp3x * r2), p2y + (perp3y * r2)); - - verts.push(p2x - (perp3x * r2 * r1), p2y - (perp3y * r1)); - - indexCount++; - } - else - { - verts.push(p2x + ((px - p2x) * r1), p2y + ((py - p2y) * r1)); - - verts.push(p2x - ((px - p2x) * r2), p2y - ((py - p2y) * r2)); - } - } - - p1x = points[(length - 2) * 2]; - p1y = points[((length - 2) * 2) + 1]; - - p2x = points[(length - 1) * 2]; - p2y = points[((length - 1) * 2) + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt((perpx * perpx) + (perpy * perpy)); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - verts.push(p2x - (perpx * r1), p2y - (perpy * r1)); - - verts.push(p2x + (perpx * r2), p2y + (perpy * r2)); - - var indices = graphicsGeometry.indices; - - // indices.push(indexStart); - - for (var i$1 = 0; i$1 < indexCount - 2; ++i$1) - { - indices.push(indexStart, indexStart + 1, indexStart + 2); - - indexStart++; - } - } - - /** - * Builds a line to draw using the gl.drawArrays(gl.LINES) method - * - * Ignored from docs since it is not directly exposed. - * - * @ignore - * @private - * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties - * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output - */ - function buildNativeLine(graphicsData, graphicsGeometry) - { - var i = 0; - - var shape = graphicsData.shape; - var points = graphicsData.points || shape.points; - var closedShape = shape.type !== SHAPES.POLY || shape.closeStroke; - - if (points.length === 0) { return; } - - var verts = graphicsGeometry.points; - var indices = graphicsGeometry.indices; - var length = points.length / 2; - - var startIndex = verts.length / 2; - var currentIndex = startIndex; - - verts.push(points[0], points[1]); - - for (i = 1; i < length; i++) - { - verts.push(points[i * 2], points[(i * 2) + 1]); - indices.push(currentIndex, currentIndex + 1); - - currentIndex++; - } - - if (closedShape) - { - indices.push(currentIndex, startIndex); - } - } - /** * Builds a polygon to draw * @@ -30600,6 +30673,90 @@ var PIXI = (function (exports) { }, }; + /** + * Builds a circle to draw + * + * Ignored from docs since it is not directly exposed. + * + * @ignore + * @private + * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object to draw + * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape + * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines + */ + var buildCircle = { + + build: function build(graphicsData) + { + // need to convert points to a nice regular data + var circleData = graphicsData.shape; + var points = graphicsData.points; + var x = circleData.x; + var y = circleData.y; + var width; + var height; + + points.length = 0; + + // TODO - bit hacky?? + if (graphicsData.type === exports.SHAPES.CIRC) + { + width = circleData.radius; + height = circleData.radius; + } + else + { + width = circleData.width; + height = circleData.height; + } + + if (width === 0 || height === 0) + { + return; + } + + var totalSegs = Math.floor(30 * Math.sqrt(circleData.radius)) + || Math.floor(15 * Math.sqrt(circleData.width + circleData.height)); + + totalSegs /= 2.3; + + var seg = (Math.PI * 2) / totalSegs; + + for (var i = 0; i < totalSegs; i++) + { + points.push( + x + (Math.sin(-seg * i) * width), + y + (Math.cos(-seg * i) * height) + ); + } + + points.push( + points[0], + points[1] + ); + }, + + triangulate: function triangulate(graphicsData, graphicsGeometry) + { + var points = graphicsData.points; + var verts = graphicsGeometry.points; + var indices = graphicsGeometry.indices; + + var vertPos = verts.length / 2; + var center = vertPos; + + verts.push(graphicsData.shape.x, graphicsData.shape.y); + + for (var i = 0; i < points.length; i += 2) + { + verts.push(points[i], points[i + 1]); + + // add some uvs + indices.push(vertPos++, center, vertPos); + } + }, + }; + /** * Builds a rectangle to draw * @@ -30796,30 +30953,752 @@ var PIXI = (function (exports) { return points; } - var BATCH_POOL = []; - var DRAW_CALL_POOL = []; - var tmpPoint = new Point(); + /** + * Builds a line to draw + * + * Ignored from docs since it is not directly exposed. + * + * @ignore + * @private + * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties + * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output + */ + function buildLine(graphicsData, graphicsGeometry) + { + if (graphicsData.lineStyle.native) + { + buildNativeLine(graphicsData, graphicsGeometry); + } + else + { + buildNonNativeLine(graphicsData, graphicsGeometry); + } + } /** - * Map of fill commands for each shape type. + * Builds a line to draw using the polygon method. * - * @member {Object} + * Ignored from docs since it is not directly exposed. + * + * @ignore + * @private + * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties + * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output + */ + function buildNonNativeLine(graphicsData, graphicsGeometry) + { + var shape = graphicsData.shape; + var points = graphicsData.points || shape.points.slice(); + var eps = graphicsGeometry.closePointEps; + + if (points.length === 0) + { + return; + } + // if the line width is an odd number add 0.5 to align to a whole pixel + // commenting this out fixes #711 and #1620 + // if (graphicsData.lineWidth%2) + // { + // for (i = 0; i < points.length; i++) + // { + // points[i] += 0.5; + // } + // } + + var style = graphicsData.lineStyle; + + // get first and last point.. figure out the middle! + var firstPoint = new Point(points[0], points[1]); + var lastPoint = new Point(points[points.length - 2], points[points.length - 1]); + var closedShape = shape.type !== exports.SHAPES.POLY || shape.closeStroke; + var closedPath = Math.abs(firstPoint.x - lastPoint.x) < eps + && Math.abs(firstPoint.y - lastPoint.y) < eps; + + // if the first point is the last point - gonna have issues :) + if (closedShape) + { + // need to clone as we are going to slightly modify the shape.. + points = points.slice(); + + if (closedPath) + { + points.pop(); + points.pop(); + lastPoint.set(points[points.length - 2], points[points.length - 1]); + } + + var midPointX = lastPoint.x + ((firstPoint.x - lastPoint.x) * 0.5); + var midPointY = lastPoint.y + ((firstPoint.y - lastPoint.y) * 0.5); + + points.unshift(midPointX, midPointY); + points.push(midPointX, midPointY); + } + + var verts = graphicsGeometry.points; + var length = points.length / 2; + var indexCount = points.length; + var indexStart = verts.length / 2; + + // DRAW the Line + var width = style.width / 2; + + // sort color + var p1x = points[0]; + var p1y = points[1]; + var p2x = points[2]; + var p2y = points[3]; + var p3x = 0; + var p3y = 0; + + var perpx = -(p1y - p2y); + var perpy = p1x - p2x; + var perp2x = 0; + var perp2y = 0; + var perp3x = 0; + var perp3y = 0; + + var dist = Math.sqrt((perpx * perpx) + (perpy * perpy)); + + perpx /= dist; + perpy /= dist; + perpx *= width; + perpy *= width; + + var ratio = style.alignment;// 0.5; + var r1 = (1 - ratio) * 2; + var r2 = ratio * 2; + + // start + verts.push( + p1x - (perpx * r1), + p1y - (perpy * r1)); + + verts.push( + p1x + (perpx * r2), + p1y + (perpy * r2)); + + for (var i = 1; i < length - 1; ++i) + { + p1x = points[(i - 1) * 2]; + p1y = points[((i - 1) * 2) + 1]; + + p2x = points[i * 2]; + p2y = points[(i * 2) + 1]; + + p3x = points[(i + 1) * 2]; + p3y = points[((i + 1) * 2) + 1]; + + perpx = -(p1y - p2y); + perpy = p1x - p2x; + + dist = Math.sqrt((perpx * perpx) + (perpy * perpy)); + perpx /= dist; + perpy /= dist; + perpx *= width; + perpy *= width; + + perp2x = -(p2y - p3y); + perp2y = p2x - p3x; + + dist = Math.sqrt((perp2x * perp2x) + (perp2y * perp2y)); + perp2x /= dist; + perp2y /= dist; + perp2x *= width; + perp2y *= width; + + var a1 = (-perpy + p1y) - (-perpy + p2y); + var b1 = (-perpx + p2x) - (-perpx + p1x); + var c1 = ((-perpx + p1x) * (-perpy + p2y)) - ((-perpx + p2x) * (-perpy + p1y)); + var a2 = (-perp2y + p3y) - (-perp2y + p2y); + var b2 = (-perp2x + p2x) - (-perp2x + p3x); + var c2 = ((-perp2x + p3x) * (-perp2y + p2y)) - ((-perp2x + p2x) * (-perp2y + p3y)); + + var denom = (a1 * b2) - (a2 * b1); + + if (Math.abs(denom) < 0.1) + { + denom += 10.1; + verts.push( + p2x - (perpx * r1), + p2y - (perpy * r1)); + + verts.push( + p2x + (perpx * r2), + p2y + (perpy * r2)); + + continue; + } + + var px = ((b1 * c2) - (b2 * c1)) / denom; + var py = ((a2 * c1) - (a1 * c2)) / denom; + var pdist = ((px - p2x) * (px - p2x)) + ((py - p2y) * (py - p2y)); + + if (pdist > (196 * width * width)) + { + perp3x = perpx - perp2x; + perp3y = perpy - perp2y; + + dist = Math.sqrt((perp3x * perp3x) + (perp3y * perp3y)); + perp3x /= dist; + perp3y /= dist; + perp3x *= width; + perp3y *= width; + + verts.push(p2x - (perp3x * r1), p2y - (perp3y * r1)); + + verts.push(p2x + (perp3x * r2), p2y + (perp3y * r2)); + + verts.push(p2x - (perp3x * r2 * r1), p2y - (perp3y * r1)); + + indexCount++; + } + else + { + verts.push(p2x + ((px - p2x) * r1), p2y + ((py - p2y) * r1)); + + verts.push(p2x - ((px - p2x) * r2), p2y - ((py - p2y) * r2)); + } + } + + p1x = points[(length - 2) * 2]; + p1y = points[((length - 2) * 2) + 1]; + + p2x = points[(length - 1) * 2]; + p2y = points[((length - 1) * 2) + 1]; + + perpx = -(p1y - p2y); + perpy = p1x - p2x; + + dist = Math.sqrt((perpx * perpx) + (perpy * perpy)); + perpx /= dist; + perpy /= dist; + perpx *= width; + perpy *= width; + + verts.push(p2x - (perpx * r1), p2y - (perpy * r1)); + + verts.push(p2x + (perpx * r2), p2y + (perpy * r2)); + + var indices = graphicsGeometry.indices; + + // indices.push(indexStart); + + for (var i$1 = 0; i$1 < indexCount - 2; ++i$1) + { + indices.push(indexStart, indexStart + 1, indexStart + 2); + + indexStart++; + } + } + + /** + * Builds a line to draw using the gl.drawArrays(gl.LINES) method + * + * Ignored from docs since it is not directly exposed. + * + * @ignore + * @private + * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties + * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output + */ + function buildNativeLine(graphicsData, graphicsGeometry) + { + var i = 0; + + var shape = graphicsData.shape; + var points = graphicsData.points || shape.points; + var closedShape = shape.type !== exports.SHAPES.POLY || shape.closeStroke; + + if (points.length === 0) { return; } + + var verts = graphicsGeometry.points; + var indices = graphicsGeometry.indices; + var length = points.length / 2; + + var startIndex = verts.length / 2; + var currentIndex = startIndex; + + verts.push(points[0], points[1]); + + for (i = 1; i < length; i++) + { + verts.push(points[i * 2], points[(i * 2) + 1]); + indices.push(currentIndex, currentIndex + 1); + + currentIndex++; + } + + if (closedShape) + { + indices.push(currentIndex, startIndex); + } + } + + /** + * Builds a complex polygon to draw + * + * Ignored from docs since it is not directly exposed. + * + * @ignore + * @private + * @param {PIXI.Graphics} graphicsData - The graphics object containing all the necessary properties + * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape + */ + function buildComplexPoly(graphicsData, webGLData) + { + // TODO - no need to copy this as it gets turned into a Float32Array anyways.. + var points = graphicsData.points.slice(); + + if (points.length < 6) + { + return; + } + + // get first and last point.. figure out the middle! + var indices = webGLData.indices; + + webGLData.points = points; + webGLData.alpha = graphicsData.fillAlpha; + webGLData.color = hex2rgb(graphicsData.fillColor); + + // calculate the bounds.. + var minX = Infinity; + var maxX = -Infinity; + + var minY = Infinity; + var maxY = -Infinity; + + var x = 0; + var y = 0; + + // get size.. + for (var i = 0; i < points.length; i += 2) + { + x = points[i]; + y = points[i + 1]; + + minX = x < minX ? x : minX; + maxX = x > maxX ? x : maxX; + + minY = y < minY ? y : minY; + maxY = y > maxY ? y : maxY; + } + + // add a quad to the end cos there is no point making another buffer! + points.push(minX, minY, + maxX, minY, + maxX, maxY, + minX, maxY); + + // push a quad onto the end.. + + // TODO - this ain't needed! + var length = points.length / 2; + + for (var i$1 = 0; i$1 < length; i$1++) + { + indices.push(i$1); + } + } + + /** + * Calculate the points for a bezier curve and then draws it. + * + * Ignored from docs since it is not directly exposed. + * + * @ignore + * @param {number} fromX - Starting point x + * @param {number} fromY - Starting point y + * @param {number} cpX - Control point x + * @param {number} cpY - Control point y + * @param {number} cpX2 - Second Control point x + * @param {number} cpY2 - Second Control point y + * @param {number} toX - Destination point x + * @param {number} toY - Destination point y + * @param {number} n - Number of segments approximating the bezier curve + * @param {number[]} [path=[]] - Path array to push points into + * @return {number[]} Array of points of the curve + */ + function bezierCurveTo(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY, n, path) + { + if ( path === void 0 ) { path = []; } + + var dt = 0; + var dt2 = 0; + var dt3 = 0; + var t2 = 0; + var t3 = 0; + + path.push(fromX, fromY); + + for (var i = 1, j = 0; i <= n; ++i) + { + j = i / n; + + dt = (1 - j); + dt2 = dt * dt; + dt3 = dt2 * dt; + + t2 = j * j; + t3 = t2 * j; + + path.push( + (dt3 * fromX) + (3 * dt2 * j * cpX) + (3 * dt * t2 * cpX2) + (t3 * toX), + (dt3 * fromY) + (3 * dt2 * j * cpY) + (3 * dt * t2 * cpY2) + (t3 * toY) + ); + } + + return path; + } + + /** + * Draw a star shape with an arbitrary number of points. + * + * @class + * @extends PIXI.Polygon + * @memberof PIXI + * @param {number} x - Center X position of the star + * @param {number} y - Center Y position of the star + * @param {number} points - The number of points of the star, must be > 1 + * @param {number} radius - The outer radius of the star + * @param {number} [innerRadius] - The inner radius between points, default half `radius` + * @param {number} [rotation=0] - The rotation of the star in radians, where 0 is vertical + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ + var Star = /*@__PURE__*/(function (Polygon) { + function Star(x, y, points, radius, innerRadius, rotation) + { + innerRadius = innerRadius || radius / 2; + + var startAngle = (-1 * Math.PI / 2) + rotation; + var len = points * 2; + var delta = PI_2 / len; + var polygon = []; + + for (var i = 0; i < len; i++) + { + var r = i % 2 ? innerRadius : radius; + var angle = (i * delta) + startAngle; + + polygon.push( + x + (r * Math.cos(angle)), + y + (r * Math.sin(angle)) + ); + } + + Polygon.call(this, polygon); + } + + if ( Polygon ) { Star.__proto__ = Polygon; } + Star.prototype = Object.create( Polygon && Polygon.prototype ); + Star.prototype.constructor = Star; + + return Star; + }(Polygon)); + + /** + * Utilities for arc curves + * @class * @private */ - var fillCommands = {}; + var ArcUtils = function ArcUtils () {}; - fillCommands[SHAPES.POLY] = buildPoly; - fillCommands[SHAPES.CIRC] = buildCircle; - fillCommands[SHAPES.ELIP] = buildCircle; - fillCommands[SHAPES.RECT] = buildRectangle; - fillCommands[SHAPES.RREC] = buildRoundedRectangle; + ArcUtils.curveTo = function curveTo (x1, y1, x2, y2, radius, points) + { + var fromX = points[points.length - 2]; + var fromY = points[points.length - 1]; + + var a1 = fromY - y1; + var b1 = fromX - x1; + var a2 = y2 - y1; + var b2 = x2 - x1; + var mm = Math.abs((a1 * b2) - (b1 * a2)); + + if (mm < 1.0e-8 || radius === 0) + { + if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) + { + points.push(x1, y1); + } + + return null; + } + + var dd = (a1 * a1) + (b1 * b1); + var cc = (a2 * a2) + (b2 * b2); + var tt = (a1 * a2) + (b1 * b2); + var k1 = radius * Math.sqrt(dd) / mm; + var k2 = radius * Math.sqrt(cc) / mm; + var j1 = k1 * tt / dd; + var j2 = k2 * tt / cc; + var cx = (k1 * b2) + (k2 * b1); + var cy = (k1 * a2) + (k2 * a1); + var px = b1 * (k2 + j1); + var py = a1 * (k2 + j1); + var qx = b2 * (k1 + j2); + var qy = a2 * (k1 + j2); + var startAngle = Math.atan2(py - cy, px - cx); + var endAngle = Math.atan2(qy - cy, qx - cx); + + return { + cx: (cx + x1), + cy: (cy + y1), + radius: radius, + startAngle: startAngle, + endAngle: endAngle, + anticlockwise: (b1 * a2 > b2 * a1), + }; + }; /** - * A little internal structure to hold interim batch objects. + * The arc method creates an arc/curve (used to create circles, or parts of circles). * * @private + * @param {number} startX - Start x location of arc + * @param {number} startY - Start y location of arc + * @param {number} cx - The x-coordinate of the center of the circle + * @param {number} cy - The y-coordinate of the center of the circle + * @param {number} radius - The radius of the circle + * @param {number} startAngle - The starting angle, in radians (0 is at the 3 o'clock position + * of the arc's circle) + * @param {number} endAngle - The ending angle, in radians + * @param {boolean} anticlockwise - Specifies whether the drawing should be + * counter-clockwise or clockwise. False is default, and indicates clockwise, while true + * indicates counter-clockwise. + * @param {number} n - Number of segments + * @param {number[]} points - Collection of points to add to + */ + ArcUtils.arc = function arc (startX, startY, cx, cy, radius, startAngle, endAngle, anticlockwise, points) + { + var sweep = endAngle - startAngle; + var n = GRAPHICS_CURVES._segmentsCount( + Math.abs(sweep) * radius, + Math.ceil(Math.abs(sweep) / PI_2) * 40 + ); + + var theta = (sweep) / (n * 2); + var theta2 = theta * 2; + var cTheta = Math.cos(theta); + var sTheta = Math.sin(theta); + var segMinus = n - 1; + var remainder = (segMinus % 1) / segMinus; + + for (var i = 0; i <= segMinus; ++i) + { + var real = i + (remainder * i); + var angle = ((theta) + startAngle + (theta2 * real)); + var c = Math.cos(angle); + var s = -Math.sin(angle); + + points.push( + (((cTheta * c) + (sTheta * s)) * radius) + cx, + (((cTheta * -s) + (sTheta * c)) * radius) + cy + ); + } + }; + + /** + * Utilities for bezier curves + * @class + * @private + */ + var BezierUtils = function BezierUtils () {}; + + BezierUtils.curveLength = function curveLength (fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY) + { + var n = 10; + var result = 0.0; + var t = 0.0; + var t2 = 0.0; + var t3 = 0.0; + var nt = 0.0; + var nt2 = 0.0; + var nt3 = 0.0; + var x = 0.0; + var y = 0.0; + var dx = 0.0; + var dy = 0.0; + var prevX = fromX; + var prevY = fromY; + + for (var i = 1; i <= n; ++i) + { + t = i / n; + t2 = t * t; + t3 = t2 * t; + nt = (1.0 - t); + nt2 = nt * nt; + nt3 = nt2 * nt; + + x = (nt3 * fromX) + (3.0 * nt2 * t * cpX) + (3.0 * nt * t2 * cpX2) + (t3 * toX); + y = (nt3 * fromY) + (3.0 * nt2 * t * cpY) + (3 * nt * t2 * cpY2) + (t3 * toY); + dx = prevX - x; + dy = prevY - y; + prevX = x; + prevY = y; + + result += Math.sqrt((dx * dx) + (dy * dy)); + } + + return result; + }; + + /** + * Calculate the points for a bezier curve and then draws it. + * + * Ignored from docs since it is not directly exposed. + * + * @ignore + * @param {number} cpX - Control point x + * @param {number} cpY - Control point y + * @param {number} cpX2 - Second Control point x + * @param {number} cpY2 - Second Control point y + * @param {number} toX - Destination point x + * @param {number} toY - Destination point y + * @param {number[]} points - Path array to push points into + */ + BezierUtils.curveTo = function curveTo (cpX, cpY, cpX2, cpY2, toX, toY, points) + { + var fromX = points[points.length - 2]; + var fromY = points[points.length - 1]; + + points.length -= 2; + + var n = GRAPHICS_CURVES._segmentsCount( + BezierUtils.curveLength(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY) + ); + + var dt = 0; + var dt2 = 0; + var dt3 = 0; + var t2 = 0; + var t3 = 0; + + points.push(fromX, fromY); + + for (var i = 1, j = 0; i <= n; ++i) + { + j = i / n; + + dt = (1 - j); + dt2 = dt * dt; + dt3 = dt2 * dt; + + t2 = j * j; + t3 = t2 * j; + + points.push( + (dt3 * fromX) + (3 * dt2 * j * cpX) + (3 * dt * t2 * cpX2) + (t3 * toX), + (dt3 * fromY) + (3 * dt2 * j * cpY) + (3 * dt * t2 * cpY2) + (t3 * toY) + ); + } + }; + + /** + * Utilities for quadratic curves + * @class + * @private + */ + var QuadraticUtils = function QuadraticUtils () {}; + + QuadraticUtils.curveLength = function curveLength (fromX, fromY, cpX, cpY, toX, toY) + { + var ax = fromX - (2.0 * cpX) + toX; + var ay = fromY - (2.0 * cpY) + toY; + var bx = (2.0 * cpX) - (2.0 * fromX); + var by = (2.0 * cpY) - (2.0 * fromY); + var a = 4.0 * ((ax * ax) + (ay * ay)); + var b = 4.0 * ((ax * bx) + (ay * by)); + var c = (bx * bx) + (by * by); + + var s = 2.0 * Math.sqrt(a + b + c); + var a2 = Math.sqrt(a); + var a32 = 2.0 * a * a2; + var c2 = 2.0 * Math.sqrt(c); + var ba = b / a2; + + return ( + (a32 * s) + + (a2 * b * (s - c2)) + + ( + ((4.0 * c * a) - (b * b)) + * Math.log(((2.0 * a2) + ba + s) / (ba + c2)) + ) + ) / (4.0 * a32); + }; + + /** + * Calculate the points for a quadratic bezier curve and then draws it. + * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c + * + * @private + * @param {number} cpX - Control point x + * @param {number} cpY - Control point y + * @param {number} toX - Destination point x + * @param {number} toY - Destination point y + * @param {number[]} points - Points to add segments to. + */ + QuadraticUtils.curveTo = function curveTo (cpX, cpY, toX, toY, points) + { + var fromX = points[points.length - 2]; + var fromY = points[points.length - 1]; + + var n = GRAPHICS_CURVES._segmentsCount( + QuadraticUtils.curveLength(fromX, fromY, cpX, cpY, toX, toY) + ); + + var xa = 0; + var ya = 0; + + for (var i = 1; i <= n; ++i) + { + var j = i / n; + + xa = fromX + ((cpX - fromX) * j); + ya = fromY + ((cpY - fromY) * j); + + points.push(xa + (((cpX + ((toX - cpX) * j)) - xa) * j), + ya + (((cpY + ((toY - cpY) * j)) - ya) * j)); + } + }; + + /** + * A structure to hold interim batch objects. + * */ var BatchPart = function BatchPart() + { + this.reset(); + }; + + /** + * Begin batch part + * + * @param {PIXI.FillStyle | PIXI.LineStyle} style + * @param {number} startIndex + * @param {number} attribStart + */ + BatchPart.prototype.begin = function begin (style, startIndex, attribStart) + { + this.reset(); + this.style = style; + this.start = startIndex; + this.attribStart = attribStart; + }; + + /** + * End batch part + * + * @param {number} endIndex + * @param {number} endAttrib + */ + BatchPart.prototype.end = function end (endIndex, endAttrib) + { + this.attribSize = endAttrib - this.attribStart; + this.size = endIndex - this.start; + }; + + BatchPart.prototype.reset = function reset () { this.style = null; this.size = 0; @@ -30828,6 +31707,143 @@ var PIXI = (function (exports) { this.attribSize = 0; }; + /** + * Generalized convenience utilities for Graphics. + * + * @namespace PIXI.graphicsUtils + */ + + /** + * Map of fill commands for each shape type. + * + * @member {Object} + */ + var FILL_COMMANDS = {}; + FILL_COMMANDS[exports.SHAPES.POLY] = buildPoly; + FILL_COMMANDS[exports.SHAPES.CIRC] = buildCircle; + FILL_COMMANDS[exports.SHAPES.ELIP] = buildCircle; + FILL_COMMANDS[exports.SHAPES.RECT] = buildRectangle; + FILL_COMMANDS[exports.SHAPES.RREC] = buildRoundedRectangle; + + /** + * Batch pool, stores unused batches for preventing allocations. + * + * @type {Array} + */ + var BATCH_POOL = []; + + /** + * Draw call pool, stores unused draw calls for preventing allocations. + * + * @type {Array} + */ + var DRAW_CALL_POOL = []; + + var index$1 = ({ + buildPoly: buildPoly, + buildCircle: buildCircle, + buildRectangle: buildRectangle, + buildRoundedRectangle: buildRoundedRectangle, + FILL_COMMANDS: FILL_COMMANDS, + BATCH_POOL: BATCH_POOL, + DRAW_CALL_POOL: DRAW_CALL_POOL, + buildLine: buildLine, + buildComplexPoly: buildComplexPoly, + bezierCurveTo: bezierCurveTo, + Star: Star, + ArcUtils: ArcUtils, + BezierUtils: BezierUtils, + QuadraticUtils: QuadraticUtils, + BatchPart: BatchPart + }); + + /** + * A class to contain data useful for Graphics objects + * + * @class + * @memberof PIXI + */ + var GraphicsData = function GraphicsData(shape, fillStyle, lineStyle, matrix) + { + if ( fillStyle === void 0 ) { fillStyle = null; } + if ( lineStyle === void 0 ) { lineStyle = null; } + if ( matrix === void 0 ) { matrix = null; } + + /** + * The shape object to draw. + * @member {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} + */ + this.shape = shape; + + /** + * The style of the line. + * @member {PIXI.LineStyle} + */ + this.lineStyle = lineStyle; + + /** + * The style of the fill. + * @member {PIXI.FillStyle} + */ + this.fillStyle = fillStyle; + + /** + * The transform matrix. + * @member {PIXI.Matrix} + */ + this.matrix = matrix; + + /** + * The type of the shape, see the Const.Shapes file for all the existing types, + * @member {number} + */ + this.type = shape.type; + + /** + * The collection of points. + * @member {number[]} + */ + this.points = []; + + /** + * The collection of holes. + * @member {PIXI.GraphicsData[]} + */ + this.holes = []; + }; + + /** + * Creates a new GraphicsData object with the same values as this one. + * + * @return {PIXI.GraphicsData} Cloned GraphicsData object + */ + GraphicsData.prototype.clone = function clone () + { + return new GraphicsData( + this.shape, + this.fillStyle, + this.lineStyle, + this.matrix + ); + }; + + /** + * Destroys the Graphics data. + */ + GraphicsData.prototype.destroy = function destroy () + { + this.shape = null; + this.holes.length = 0; + this.holes = null; + this.points.length = 0; + this.points = null; + this.lineStyle = null; + this.fillStyle = null; + }; + + var tmpPoint = new Point(); + var tmpBounds = new Bounds(); + /** * The Graphics class contains methods used to draw primitive shapes such as lines, circles and * rectangles to the display, and to color and fill them. @@ -30937,7 +31953,7 @@ var PIXI = (function (exports) { * Intermediate abstract format sent to batch system. * Can be converted to drawCalls or to batchable objects. * - * @member {object[]} + * @member {BatchPart[]} * @protected */ this.batches = []; @@ -31187,6 +32203,8 @@ var PIXI = (function (exports) { if (data.shape.contains(tmpPoint.x, tmpPoint.y)) { + var hitHole = false; + if (data.holes) { for (var i$1 = 0; i$1 < data.holes.length; i$1++) @@ -31195,12 +32213,16 @@ var PIXI = (function (exports) { if (hole.shape.contains(tmpPoint.x, tmpPoint.y)) { - return false; + hitHole = true; + break; } } } - return true; + if (!hitHole) + { + return true; + } } } } @@ -31214,82 +32236,66 @@ var PIXI = (function (exports) { */ GraphicsGeometry.prototype.updateBatches = function updateBatches () { - if (this.dirty === this.cacheDirty) { return; } - if (this.graphicsData.length === 0) + if (!this.graphicsData.length) { this.batchable = true; return; } - if (this.dirty !== this.cacheDirty) + if (!this.validateBatching()) { - for (var i = 0; i < this.graphicsData.length; i++) - { - var data = this.graphicsData[i]; - - if (data.fillStyle && !data.fillStyle.texture.baseTexture.valid) { return; } - if (data.lineStyle && !data.lineStyle.texture.baseTexture.valid) { return; } - } + return; } this.cacheDirty = this.dirty; var uvs = this.uvs; + var graphicsData = this.graphicsData; var batchPart = null; - var currentTexture = null; - var currentColor = 0; - var currentNative = false; + + var currentStyle = null; if (this.batches.length > 0) { batchPart = this.batches[this.batches.length - 1]; - - var style = batchPart.style; - - currentTexture = style.texture.baseTexture; - currentColor = style.color + style.alpha; - currentNative = !!style.native; + currentStyle = batchPart.style; } - for (var i$1 = this.shapeIndex; i$1 < this.graphicsData.length; i$1++) + for (var i = this.shapeIndex; i < graphicsData.length; i++) { this.shapeIndex++; - var data$1 = this.graphicsData[i$1]; - var command = fillCommands[data$1.type]; - - var fillStyle = data$1.fillStyle; - var lineStyle = data$1.lineStyle; + var data = graphicsData[i]; + var fillStyle = data.fillStyle; + var lineStyle = data.lineStyle; + var command = FILL_COMMANDS[data.type]; // build out the shapes points.. - command.build(data$1); + command.build(data); - if (data$1.matrix) + if (data.matrix) { - this.transformPoints(data$1.points, data$1.matrix); + this.transformPoints(data.points, data.matrix); } for (var j = 0; j < 2; j++) { - var style$1 = (j === 0) ? fillStyle : lineStyle; + var style = (j === 0) ? fillStyle : lineStyle; - if (!style$1.visible) { continue; } - - var nextTexture = style$1.texture.baseTexture; + if (!style.visible) { continue; } + var nextTexture = style.texture.baseTexture; var index$1 = this.indices.length; var attribIndex = this.points.length / 2; + nextTexture.wrapMode = exports.WRAP_MODES.REPEAT; + // close batch if style is different - if (batchPart - && (currentTexture !== nextTexture - || currentColor !== (style$1.color + style$1.alpha) - || currentNative !== !!style$1.native)) + if (batchPart && !this._compareStyles(currentStyle, style)) { - batchPart.size = index$1 - batchPart.start; - batchPart.attribSize = attribIndex - batchPart.attribStart; + batchPart.end(index$1, attribIndex); if (batchPart.size > 0) { @@ -31300,51 +32306,29 @@ var PIXI = (function (exports) { if (!batchPart) { batchPart = BATCH_POOL.pop() || new BatchPart(); + batchPart.begin(style, index$1, attribIndex); this.batches.push(batchPart); - nextTexture.wrapMode = WRAP_MODES.REPEAT; - currentTexture = nextTexture; - currentColor = style$1.color + style$1.alpha; - currentNative = style$1.native; - batchPart.style = style$1; - batchPart.start = index$1; - batchPart.attribStart = attribIndex; + currentStyle = style; } var start = this.points.length / 2; if (j === 0) { - if (data$1.holes.length) - { - this.processHoles(data$1.holes); - - buildPoly.triangulate(data$1, this); - } - else - { - command.triangulate(data$1, this); - } + this.processFill(data); } else { - buildLine(data$1, this); - - for (var i$2 = 0; i$2 < data$1.holes.length; i$2++) - { - buildLine(data$1.holes[i$2], this); - } + this.processLine(data); } var size = (this.points.length / 2) - start; - this.addUvs(this.points, uvs, style$1.texture, start, size, style$1.matrix); + this.addUvs(this.points, uvs, style.texture, start, size, style.matrix); } } - var index = this.indices.length; - var attrib = this.points.length / 2; - if (!batchPart) { // there are no visible styles in GraphicsData @@ -31354,8 +32338,11 @@ var PIXI = (function (exports) { return; } - batchPart.size = index - batchPart.start; - batchPart.attribSize = attrib - batchPart.attribStart; + var index = this.indices.length; + var attrib = this.points.length / 2; + + batchPart.end(index, attrib); + this.indicesUint16 = new Uint16Array(this.indices); // TODO make this a const.. @@ -31363,22 +32350,7 @@ var PIXI = (function (exports) { if (this.batchable) { - this.batchDirty++; - - this.uvsFloat32 = new Float32Array(this.uvs); - - // offset the indices so that it works with the batcher... - for (var i$3 = 0; i$3 < this.batches.length; i$3++) - { - var batch = this.batches[i$3]; - - for (var j$1 = 0; j$1 < batch.size; j$1++) - { - var index$2 = batch.start + j$1; - - this.indicesUint16[index$2] = this.indicesUint16[index$2] - batch.attribStart; - } - } + this.packBatches(); } else { @@ -31386,9 +32358,91 @@ var PIXI = (function (exports) { } }; + /** + * Affinity check + * + * @param {PIXI.FillStyle | PIXI.LineStyle} styleA + * @param {PIXI.FillStyle | PIXI.LineStyle} styleB + */ + GraphicsGeometry.prototype._compareStyles = function _compareStyles (styleA, styleB) + { + if (!styleA || !styleB) + { + return false; + } + + if (styleA.texture.baseTexture !== styleB.texture.baseTexture) + { + return false; + } + + if (styleA.color + styleA.alpha !== styleB.color + styleB.alpha) + { + return false; + } + + if (!!styleA.native !== !!styleB.native) + { + return false; + } + + return true; + }; + + /** + * Test geometry for batching process. + * + * @protected + */ + GraphicsGeometry.prototype.validateBatching = function validateBatching () + { + if (this.dirty === this.cacheDirty || !this.graphicsData.length) + { + return false; + } + + for (var i = 0, l = this.graphicsData.length; i < l; i++) + { + var data = this.graphicsData[i]; + var fill = data.fillStyle; + var line = data.lineStyle; + + if (fill && !fill.texture.baseTexture.valid) { return false; } + if (line && !line.texture.baseTexture.valid) { return false; } + } + + return true; + }; + + /** + * Offset the indices so that it works with the batcher. + * + * @protected + */ + GraphicsGeometry.prototype.packBatches = function packBatches () + { + this.batchDirty++; + this.uvsFloat32 = new Float32Array(this.uvs); + + var batches = this.batches; + + for (var i = 0, l = batches.length; i < l; i++) + { + var batch = batches[i]; + + for (var j = 0; j < batch.size; j++) + { + var index = batch.start + j; + + this.indicesUint16[index] = this.indicesUint16[index] - batch.attribStart; + } + } + }; + /** * Checks to see if this graphics geometry can be batched. * Currently it needs to be small enough and not contain any native lines. + * * @protected */ GraphicsGeometry.prototype.isBatchable = function isBatchable () @@ -31408,6 +32462,7 @@ var PIXI = (function (exports) { /** * Converts intermediate batches data to drawCalls. + * * @protected */ GraphicsGeometry.prototype.buildDrawCalls = function buildDrawCalls () @@ -31422,22 +32477,26 @@ var PIXI = (function (exports) { this.drawCalls.length = 0; - var uvs = this.uvs; var colors = this.colors; var textureIds = this.textureIds; - var currentGroup = DRAW_CALL_POOL.pop() || new BatchDrawCall(); + var currentGroup = DRAW_CALL_POOL.pop(); - currentGroup.textureCount = 0; + if (!currentGroup) + { + currentGroup = new BatchDrawCall(); + currentGroup.textures = new BatchTextureArray(); + } + currentGroup.textures.count = 0; currentGroup.start = 0; currentGroup.size = 0; - currentGroup.type = DRAW_MODES.TRIANGLES; + currentGroup.type = exports.DRAW_MODES.TRIANGLES; var textureCount = 0; var currentTexture = null; var textureId = 0; var native = false; - var drawMode = DRAW_MODES.TRIANGLES; + var drawMode = exports.DRAW_MODES.TRIANGLES; var index = 0; @@ -31457,8 +32516,8 @@ var PIXI = (function (exports) { if (native !== !!style.native) { - native = style.native; - drawMode = native ? DRAW_MODES.LINES : DRAW_MODES.TRIANGLES; + native = !!style.native; + drawMode = native ? exports.DRAW_MODES.LINES : exports.DRAW_MODES.TRIANGLES; // force the batch to break! currentTexture = null; @@ -31480,23 +32539,28 @@ var PIXI = (function (exports) { if (currentGroup.size > 0) { - currentGroup = DRAW_CALL_POOL.pop() || new BatchDrawCall(); + currentGroup = DRAW_CALL_POOL.pop(); + if (!currentGroup) + { + currentGroup = new BatchDrawCall(); + currentGroup.textures = new BatchTextureArray(); + } this.drawCalls.push(currentGroup); } currentGroup.start = index; currentGroup.size = 0; - currentGroup.textureCount = 0; + currentGroup.textures.count = 0; currentGroup.type = drawMode; } // TODO add this to the render part.. nextTexture.touched = 1;// touch; nextTexture._batchEnabled = TICK; - nextTexture._id = textureCount; + nextTexture._batchLocation = textureCount; nextTexture.wrapMode = 10497; - currentGroup.textures[currentGroup.textureCount++] = nextTexture; + currentGroup.textures.elements[currentGroup.textures.count++] = nextTexture; textureCount++; } } @@ -31504,7 +32568,7 @@ var PIXI = (function (exports) { currentGroup.size += data.size; index += data.size; - textureId = nextTexture._id; + textureId = nextTexture._batchLocation; this.addColors(colors, style.color, style.alpha, data.attribSize); this.addTextureIds(textureIds, textureId, data.attribSize); @@ -31514,7 +32578,20 @@ var PIXI = (function (exports) { // upload.. // merge for now! + this.packAttributes(); + }; + + /** + * Packs attributes to single buffer. + * + * @protected + */ + GraphicsGeometry.prototype.packAttributes = function packAttributes () + { var verts = this.points; + var uvs = this.uvs; + var colors = this.colors; + var textureIds = this.textureIds; // verts are 2 positions.. so we * by 3 as there are 6 properties.. then 4 cos its bytes var glPoints = new ArrayBuffer(verts.length * 3 * 4); @@ -31523,23 +32600,61 @@ var PIXI = (function (exports) { var p = 0; - for (var i$2 = 0; i$2 < verts.length / 2; i$2++) + for (var i = 0; i < verts.length / 2; i++) { - f32[p++] = verts[i$2 * 2]; - f32[p++] = verts[(i$2 * 2) + 1]; + f32[p++] = verts[i * 2]; + f32[p++] = verts[(i * 2) + 1]; - f32[p++] = uvs[i$2 * 2]; - f32[p++] = uvs[(i$2 * 2) + 1]; + f32[p++] = uvs[i * 2]; + f32[p++] = uvs[(i * 2) + 1]; - u32[p++] = colors[i$2]; + u32[p++] = colors[i]; - f32[p++] = textureIds[i$2]; + f32[p++] = textureIds[i]; } this._buffer.update(glPoints); this._indexBuffer.update(this.indicesUint16); }; + /** + * Process fill part of Graphics. + * + * @param {PIXI.GraphicsData} data + * @protected + */ + GraphicsGeometry.prototype.processFill = function processFill (data) + { + if (data.holes.length) + { + this.processHoles(data.holes); + + buildPoly.triangulate(data, this); + } + else + { + var command = FILL_COMMANDS[data.type]; + + command.triangulate(data, this); + } + }; + + /** + * Process line part of Graphics. + * + * @param {PIXI.GraphicsData} data + * @protected + */ + GraphicsGeometry.prototype.processLine = function processLine (data) + { + buildLine(data, this); + + for (var i = 0; i < data.holes.length; i++) + { + buildLine(data.holes[i], this); + } + }; + /** * Process the holes data. * @@ -31551,8 +32666,7 @@ var PIXI = (function (exports) { for (var i = 0; i < holes.length; i++) { var hole = holes[i]; - - var command = fillCommands[hole.type]; + var command = FILL_COMMANDS[hole.type]; command.build(hole); @@ -31565,130 +32679,81 @@ var PIXI = (function (exports) { /** * Update the local bounds of the object. Expensive to use performance-wise. + * * @protected */ GraphicsGeometry.prototype.calculateBounds = function calculateBounds () { - var minX = Infinity; - var maxX = -Infinity; + var bounds = this._bounds; + var sequenceBounds = tmpBounds; + var curMatrix = Matrix.IDENTITY; - var minY = Infinity; - var maxY = -Infinity; + this._bounds.clear(); + sequenceBounds.clear(); - if (this.graphicsData.length) + for (var i = 0; i < this.graphicsData.length; i++) { - var shape = null; - var x = 0; - var y = 0; - var w = 0; - var h = 0; + var data = this.graphicsData[i]; + var shape = data.shape; + var type = data.type; + var lineStyle = data.lineStyle; + var nextMatrix = data.matrix || Matrix.IDENTITY; + var lineWidth = 0.0; - for (var i = 0; i < this.graphicsData.length; i++) + if (lineStyle && lineStyle.visible) { - var data = this.graphicsData[i]; + var alignment = lineStyle.alignment; - var type = data.type; - var lineWidth = data.lineStyle ? data.lineStyle.width : 0; + lineWidth = lineStyle.width; - shape = data.shape; - - if (type === SHAPES.RECT || type === SHAPES.RREC) + if (type === exports.SHAPES.POLY) { - x = shape.x - (lineWidth / 2); - y = shape.y - (lineWidth / 2); - w = shape.width + lineWidth; - h = shape.height + lineWidth; - - minX = x < minX ? x : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y < minY ? y : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if (type === SHAPES.CIRC) - { - x = shape.x; - y = shape.y; - w = shape.radius + (lineWidth / 2); - h = shape.radius + (lineWidth / 2); - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if (type === SHAPES.ELIP) - { - x = shape.x; - y = shape.y; - w = shape.width + (lineWidth / 2); - h = shape.height + (lineWidth / 2); - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; + lineWidth = lineWidth * (0.5 + Math.abs(0.5 - alignment)); } else { - // POLY - var points = shape.points; - var x2 = 0; - var y2 = 0; - var dx = 0; - var dy = 0; - var rw = 0; - var rh = 0; - var cx = 0; - var cy = 0; - - for (var j = 0; j + 2 < points.length; j += 2) - { - x = points[j]; - y = points[j + 1]; - x2 = points[j + 2]; - y2 = points[j + 3]; - dx = Math.abs(x2 - x); - dy = Math.abs(y2 - y); - h = lineWidth; - w = Math.sqrt((dx * dx) + (dy * dy)); - - if (w < 1e-9) - { - continue; - } - - rw = ((h / w * dy) + dx) / 2; - rh = ((h / w * dx) + dy) / 2; - cx = (x2 + x) / 2; - cy = (y2 + y) / 2; - - minX = cx - rw < minX ? cx - rw : minX; - maxX = cx + rw > maxX ? cx + rw : maxX; - - minY = cy - rh < minY ? cy - rh : minY; - maxY = cy + rh > maxY ? cy + rh : maxY; - } + lineWidth = lineWidth * Math.max(0, alignment); } } + + if (curMatrix !== nextMatrix) + { + if (!sequenceBounds.isEmpty()) + { + bounds.addBoundsMatrix(sequenceBounds, curMatrix); + sequenceBounds.clear(); + } + curMatrix = nextMatrix; + } + + if (type === exports.SHAPES.RECT || type === exports.SHAPES.RREC) + { + sequenceBounds.addFramePad(shape.x, shape.y, shape.x + shape.width, shape.y + shape.height, + lineWidth, lineWidth); + } + else if (type === exports.SHAPES.CIRC) + { + sequenceBounds.addFramePad(shape.x, shape.y, shape.x, shape.y, + shape.radius + lineWidth, shape.radius + lineWidth); + } + else if (type === exports.SHAPES.ELIP) + { + sequenceBounds.addFramePad(shape.x, shape.y, shape.x, shape.y, + shape.width + lineWidth, shape.height + lineWidth); + } + else + { + // adding directly to the bounds + bounds.addVerticesMatrix(curMatrix, shape.points, 0, shape.points.length, lineWidth, lineWidth); + } } - else + + if (!sequenceBounds.isEmpty()) { - minX = 0; - maxX = 0; - minY = 0; - maxY = 0; + bounds.addBoundsMatrix(sequenceBounds, curMatrix); } - var padding = this.boundsPadding; - - this._bounds.minX = minX - padding; - this._bounds.maxX = maxX + padding; - - this._bounds.minY = minY - padding; - this._bounds.maxY = maxY + padding; + bounds.pad(this.boundsPadding, this.boundsPadding); }; /** @@ -31795,6 +32860,7 @@ var PIXI = (function (exports) { /** * Modify uvs array according to position of texture region * Does not work with rotated or trimmed textures + * * @param {number[]} uvs array * @param {PIXI.Texture} texture region * @param {number} start starting index for uvs @@ -31911,317 +32977,6 @@ var PIXI = (function (exports) { return LineStyle; }(FillStyle)); - /** - * Utilities for bezier curves - * @class - * @private - */ - var BezierUtils = function BezierUtils () {}; - - BezierUtils.curveLength = function curveLength (fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY) - { - var n = 10; - var result = 0.0; - var t = 0.0; - var t2 = 0.0; - var t3 = 0.0; - var nt = 0.0; - var nt2 = 0.0; - var nt3 = 0.0; - var x = 0.0; - var y = 0.0; - var dx = 0.0; - var dy = 0.0; - var prevX = fromX; - var prevY = fromY; - - for (var i = 1; i <= n; ++i) - { - t = i / n; - t2 = t * t; - t3 = t2 * t; - nt = (1.0 - t); - nt2 = nt * nt; - nt3 = nt2 * nt; - - x = (nt3 * fromX) + (3.0 * nt2 * t * cpX) + (3.0 * nt * t2 * cpX2) + (t3 * toX); - y = (nt3 * fromY) + (3.0 * nt2 * t * cpY) + (3 * nt * t2 * cpY2) + (t3 * toY); - dx = prevX - x; - dy = prevY - y; - prevX = x; - prevY = y; - - result += Math.sqrt((dx * dx) + (dy * dy)); - } - - return result; - }; - - /** - * Calculate the points for a bezier curve and then draws it. - * - * Ignored from docs since it is not directly exposed. - * - * @ignore - * @param {number} cpX - Control point x - * @param {number} cpY - Control point y - * @param {number} cpX2 - Second Control point x - * @param {number} cpY2 - Second Control point y - * @param {number} toX - Destination point x - * @param {number} toY - Destination point y - * @param {number[]} points - Path array to push points into - */ - BezierUtils.curveTo = function curveTo (cpX, cpY, cpX2, cpY2, toX, toY, points) - { - var fromX = points[points.length - 2]; - var fromY = points[points.length - 1]; - - points.length -= 2; - - var n = GRAPHICS_CURVES._segmentsCount( - BezierUtils.curveLength(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY) - ); - - var dt = 0; - var dt2 = 0; - var dt3 = 0; - var t2 = 0; - var t3 = 0; - - points.push(fromX, fromY); - - for (var i = 1, j = 0; i <= n; ++i) - { - j = i / n; - - dt = (1 - j); - dt2 = dt * dt; - dt3 = dt2 * dt; - - t2 = j * j; - t3 = t2 * j; - - points.push( - (dt3 * fromX) + (3 * dt2 * j * cpX) + (3 * dt * t2 * cpX2) + (t3 * toX), - (dt3 * fromY) + (3 * dt2 * j * cpY) + (3 * dt * t2 * cpY2) + (t3 * toY) - ); - } - }; - - /** - * Utilities for quadratic curves - * @class - * @private - */ - var QuadraticUtils = function QuadraticUtils () {}; - - QuadraticUtils.curveLength = function curveLength (fromX, fromY, cpX, cpY, toX, toY) - { - var ax = fromX - (2.0 * cpX) + toX; - var ay = fromY - (2.0 * cpY) + toY; - var bx = (2.0 * cpX) - (2.0 * fromX); - var by = (2.0 * cpY) - (2.0 * fromY); - var a = 4.0 * ((ax * ax) + (ay * ay)); - var b = 4.0 * ((ax * bx) + (ay * by)); - var c = (bx * bx) + (by * by); - - var s = 2.0 * Math.sqrt(a + b + c); - var a2 = Math.sqrt(a); - var a32 = 2.0 * a * a2; - var c2 = 2.0 * Math.sqrt(c); - var ba = b / a2; - - return ( - (a32 * s) - + (a2 * b * (s - c2)) - + ( - ((4.0 * c * a) - (b * b)) - * Math.log(((2.0 * a2) + ba + s) / (ba + c2)) - ) - ) / (4.0 * a32); - }; - - /** - * Calculate the points for a quadratic bezier curve and then draws it. - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @private - * @param {number} cpX - Control point x - * @param {number} cpY - Control point y - * @param {number} toX - Destination point x - * @param {number} toY - Destination point y - * @param {number[]} points - Points to add segments to. - */ - QuadraticUtils.curveTo = function curveTo (cpX, cpY, toX, toY, points) - { - var fromX = points[points.length - 2]; - var fromY = points[points.length - 1]; - - var n = GRAPHICS_CURVES._segmentsCount( - QuadraticUtils.curveLength(fromX, fromY, cpX, cpY, toX, toY) - ); - - var xa = 0; - var ya = 0; - - for (var i = 1; i <= n; ++i) - { - var j = i / n; - - xa = fromX + ((cpX - fromX) * j); - ya = fromY + ((cpY - fromY) * j); - - points.push(xa + (((cpX + ((toX - cpX) * j)) - xa) * j), - ya + (((cpY + ((toY - cpY) * j)) - ya) * j)); - } - }; - - /** - * Utilities for arc curves - * @class - * @private - */ - var ArcUtils = function ArcUtils () {}; - - ArcUtils.curveTo = function curveTo (x1, y1, x2, y2, radius, points) - { - var fromX = points[points.length - 2]; - var fromY = points[points.length - 1]; - - var a1 = fromY - y1; - var b1 = fromX - x1; - var a2 = y2 - y1; - var b2 = x2 - x1; - var mm = Math.abs((a1 * b2) - (b1 * a2)); - - if (mm < 1.0e-8 || radius === 0) - { - if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) - { - points.push(x1, y1); - } - - return null; - } - - var dd = (a1 * a1) + (b1 * b1); - var cc = (a2 * a2) + (b2 * b2); - var tt = (a1 * a2) + (b1 * b2); - var k1 = radius * Math.sqrt(dd) / mm; - var k2 = radius * Math.sqrt(cc) / mm; - var j1 = k1 * tt / dd; - var j2 = k2 * tt / cc; - var cx = (k1 * b2) + (k2 * b1); - var cy = (k1 * a2) + (k2 * a1); - var px = b1 * (k2 + j1); - var py = a1 * (k2 + j1); - var qx = b2 * (k1 + j2); - var qy = a2 * (k1 + j2); - var startAngle = Math.atan2(py - cy, px - cx); - var endAngle = Math.atan2(qy - cy, qx - cx); - - return { - cx: (cx + x1), - cy: (cy + y1), - radius: radius, - startAngle: startAngle, - endAngle: endAngle, - anticlockwise: (b1 * a2 > b2 * a1), - }; - }; - - /** - * The arc method creates an arc/curve (used to create circles, or parts of circles). - * - * @private - * @param {number} startX - Start x location of arc - * @param {number} startY - Start y location of arc - * @param {number} cx - The x-coordinate of the center of the circle - * @param {number} cy - The y-coordinate of the center of the circle - * @param {number} radius - The radius of the circle - * @param {number} startAngle - The starting angle, in radians (0 is at the 3 o'clock position - * of the arc's circle) - * @param {number} endAngle - The ending angle, in radians - * @param {boolean} anticlockwise - Specifies whether the drawing should be - * counter-clockwise or clockwise. False is default, and indicates clockwise, while true - * indicates counter-clockwise. - * @param {number} n - Number of segments - * @param {number[]} points - Collection of points to add to - */ - ArcUtils.arc = function arc (startX, startY, cx, cy, radius, startAngle, endAngle, anticlockwise, points) - { - var sweep = endAngle - startAngle; - var n = GRAPHICS_CURVES._segmentsCount( - Math.abs(sweep) * radius, - Math.ceil(Math.abs(sweep) / PI_2) * 40 - ); - - var theta = (sweep) / (n * 2); - var theta2 = theta * 2; - var cTheta = Math.cos(theta); - var sTheta = Math.sin(theta); - var segMinus = n - 1; - var remainder = (segMinus % 1) / segMinus; - - for (var i = 0; i <= segMinus; ++i) - { - var real = i + (remainder * i); - var angle = ((theta) + startAngle + (theta2 * real)); - var c = Math.cos(angle); - var s = -Math.sin(angle); - - points.push( - (((cTheta * c) + (sTheta * s)) * radius) + cx, - (((cTheta * -s) + (sTheta * c)) * radius) + cy - ); - } - }; - - /** - * Draw a star shape with an arbitrary number of points. - * - * @class - * @extends PIXI.Polygon - * @memberof PIXI - * @param {number} x - Center X position of the star - * @param {number} y - Center Y position of the star - * @param {number} points - The number of points of the star, must be > 1 - * @param {number} radius - The outer radius of the star - * @param {number} [innerRadius] - The inner radius between points, default half `radius` - * @param {number} [rotation=0] - The rotation of the star in radians, where 0 is vertical - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls - */ - var Star = /*@__PURE__*/(function (Polygon) { - function Star(x, y, points, radius, innerRadius, rotation) - { - innerRadius = innerRadius || radius / 2; - - var startAngle = (-1 * Math.PI / 2) + rotation; - var len = points * 2; - var delta = PI_2 / len; - var polygon = []; - - for (var i = 0; i < len; i++) - { - var r = i % 2 ? innerRadius : radius; - var angle = (i * delta) + startAngle; - - polygon.push( - x + (r * Math.cos(angle)), - y + (r * Math.sin(angle)) - ); - } - - Polygon.call(this, polygon); - } - - if ( Polygon ) { Star.__proto__ = Polygon; } - Star.prototype = Object.create( Polygon && Polygon.prototype ); - Star.prototype.constructor = Star; - - return Star; - }(Polygon)); - var temp = new Float32Array(3); // a default shaders map used by graphics.. @@ -32363,7 +33118,7 @@ var PIXI = (function (exports) { // Set default this.tint = 0xFFFFFF; - this.blendMode = BLEND_MODES.NORMAL; + this.blendMode = exports.BLEND_MODES.NORMAL; } if ( Container ) { Graphics.__proto__ = Container; } @@ -32445,55 +33200,98 @@ var PIXI = (function (exports) { * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() * method or the drawCircle() method. * + * @method PIXI.Graphics#lineStyle * @param {number} [width=0] - width of the line to draw, will update the objects stored style - * @param {number} [color=0] - color of the line to draw, will update the objects stored style + * @param {number} [color=0x0] - color of the line to draw, will update the objects stored style * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style * @param {number} [alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter) * @param {boolean} [native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ - Graphics.prototype.lineStyle = function lineStyle (width, color, alpha, alignment, native) + /** + * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() + * method or the drawCircle() method. + * + * @param {object} [options] - Line style options + * @param {number} [options.width=0] - width of the line to draw, will update the objects stored style + * @param {number} [options.color=0x0] - color of the line to draw, will update the objects stored style + * @param {number} [options.alpha=1] - alpha of the line to draw, will update the objects stored style + * @param {number} [options.alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter) + * @param {boolean} [options.native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ + Graphics.prototype.lineStyle = function lineStyle (options) { - if ( width === void 0 ) { width = 0; } - if ( color === void 0 ) { color = 0; } - if ( alpha === void 0 ) { alpha = 1; } - if ( alignment === void 0 ) { alignment = 0.5; } - if ( native === void 0 ) { native = false; } + // Support non-object params: (width, color, alpha, alignment, native) + if (typeof options === 'number') + { + var args = arguments; - this.lineTextureStyle(width, Texture.WHITE, color, alpha, null, alignment, native); + options = { + width: args[0] || 0, + color: args[1] || 0x0, + alpha: args[2] !== undefined ? args[2] : 1, + alignment: args[3] !== undefined ? args[3] : 0.5, + native: !!args[4], + }; + } - return this; + return this.lineTextureStyle(options); }; /** * Like line style but support texture for line fill. * - * @param {number} [width=0] - width of the line to draw, will update the objects stored style - * @param {PIXI.Texture} [texture=PIXI.Texture.WHITE] - Texture to use - * @param {number} [color=0] - color of the line to draw, will update the objects stored style - * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style - * @param {PIXI.Matrix} [matrix=null] Texture matrix to transform texture - * @param {number} [alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter) - * @param {boolean} [native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP + * @param {object} [options] - Collection of options for setting line style. + * @param {number} [options.width=0] - width of the line to draw, will update the objects stored style + * @param {PIXI.Texture} [options.texture=PIXI.Texture.WHITE] - Texture to use + * @param {number} [options.color=0x0] - color of the line to draw, will update the objects stored style. + * Default 0xFFFFFF if texture present. + * @param {number} [options.alpha=1] - alpha of the line to draw, will update the objects stored style + * @param {PIXI.Matrix} [options.matrix=null] Texture matrix to transform texture + * @param {number} [options.alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter) + * @param {boolean} [options.native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ - Graphics.prototype.lineTextureStyle = function lineTextureStyle (width, texture, color, alpha, - matrix, alignment, native) + Graphics.prototype.lineTextureStyle = function lineTextureStyle (options) { - if ( width === void 0 ) { width = 0; } - if ( texture === void 0 ) { texture = Texture.WHITE; } - if ( color === void 0 ) { color = 0xFFFFFF; } - if ( alpha === void 0 ) { alpha = 1; } - if ( matrix === void 0 ) { matrix = null; } - if ( alignment === void 0 ) { alignment = 0.5; } - if ( native === void 0 ) { native = false; } + // backward compatibility with params: (width, texture, + // color, alpha, matrix, alignment, native) + if (typeof options === 'number') + { + deprecation('v5.2.0', 'Please use object-based options for Graphics#lineTextureStyle'); + + var width = arguments[0]; + var texture = arguments[1]; + var color = arguments[2]; + var alpha = arguments[3]; + var matrix = arguments[4]; + var alignment = arguments[5]; + var native = arguments[6]; + + options = { width: width, texture: texture, color: color, alpha: alpha, matrix: matrix, alignment: alignment, native: native }; + + // Remove undefined keys + Object.keys(options).forEach(function (key) { return options[key] === undefined && delete options[key]; }); + } + + // Apply defaults + options = Object.assign({ + width: 0, + texture: Texture.WHITE, + color: (options && options.texture) ? 0xFFFFFF : 0x0, + alpha: 1, + matrix: null, + alignment: 0.5, + native: false, + }, options); if (this.currentPath) { this.startPoly(); } - var visible = width > 0 && alpha > 0; + var visible = options.width > 0 && options.alpha > 0; if (!visible) { @@ -32501,22 +33299,13 @@ var PIXI = (function (exports) { } else { - if (matrix) + if (options.matrix) { - matrix = matrix.clone(); - matrix.invert(); + options.matrix = options.matrix.clone(); + options.matrix.invert(); } - Object.assign(this._lineStyle, { - color: color, - width: width, - alpha: alpha, - matrix: matrix, - texture: texture, - alignment: alignment, - native: native, - visible: visible, - }); + Object.assign(this._lineStyle, { visible: visible }, options); } return this; @@ -32803,31 +33592,51 @@ var PIXI = (function (exports) { if ( color === void 0 ) { color = 0; } if ( alpha === void 0 ) { alpha = 1; } - return this.beginTextureFill(Texture.WHITE, color, alpha); + return this.beginTextureFill({ texture: Texture.WHITE, color: color, alpha: alpha }); }; /** * Begin the texture fill * - * @param {PIXI.Texture} [texture=PIXI.Texture.WHITE] - Texture to fill - * @param {number} [color=0xffffff] - Background to fill behind texture - * @param {number} [alpha=1] - Alpha of fill - * @param {PIXI.Matrix} [matrix=null] - Transform matrix + * @param {object} [options] - Object object. + * @param {PIXI.Texture} [options.texture=PIXI.Texture.WHITE] - Texture to fill + * @param {number} [options.color=0xffffff] - Background to fill behind texture + * @param {number} [options.alpha=1] - Alpha of fill + * @param {PIXI.Matrix} [options.matrix=null] - Transform matrix * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ - Graphics.prototype.beginTextureFill = function beginTextureFill (texture, color, alpha, matrix) + Graphics.prototype.beginTextureFill = function beginTextureFill (options) { - if ( texture === void 0 ) { texture = Texture.WHITE; } - if ( color === void 0 ) { color = 0xFFFFFF; } - if ( alpha === void 0 ) { alpha = 1; } - if ( matrix === void 0 ) { matrix = null; } + // backward compatibility with params: (texture, color, alpha, matrix) + if (options instanceof Texture) + { + deprecation('v5.2.0', 'Please use object-based options for Graphics#beginTextureFill'); + + var texture = arguments[0]; + var color = arguments[1]; + var alpha = arguments[2]; + var matrix = arguments[3]; + + options = { texture: texture, color: color, alpha: alpha, matrix: matrix }; + + // Remove undefined keys + Object.keys(options).forEach(function (key) { return options[key] === undefined && delete options[key]; }); + } + + // Apply defaults + options = Object.assign({ + texture: Texture.WHITE, + color: 0xFFFFFF, + alpha: 1, + matrix: null, + }, options); if (this.currentPath) { this.startPoly(); } - var visible = alpha > 0; + var visible = options.alpha > 0; if (!visible) { @@ -32835,19 +33644,13 @@ var PIXI = (function (exports) { } else { - if (matrix) + if (options.matrix) { - matrix = matrix.clone(); - matrix.invert(); + options.matrix = options.matrix.clone(); + options.matrix.invert(); } - Object.assign(this._fillStyle, { - color: color, - alpha: alpha, - texture: texture, - matrix: matrix, - visible: visible, - }); + Object.assign(this._fillStyle, { visible: visible }, options); } return this; @@ -33036,11 +33839,9 @@ var PIXI = (function (exports) { */ Graphics.prototype.isFastRect = function isFastRect () { - // will fix this! - return false; - // this.graphicsData.length === 1 - // && this.graphicsData[0].shape.type === SHAPES.RECT - // && !this.graphicsData[0].lineWidth; + return this.geometry.graphicsData.length === 1 + && this.geometry.graphicsData[0].shape.type === exports.SHAPES.RECT + && !this.geometry.graphicsData[0].lineWidth; }; /** @@ -33204,14 +34005,18 @@ var PIXI = (function (exports) { */ Graphics.prototype._renderDrawCallDirect = function _renderDrawCallDirect (renderer, drawCall) { - var groupTextureCount = drawCall.textureCount; + var textures = drawCall.textures; + var type = drawCall.type; + var size = drawCall.size; + var start = drawCall.start; + var groupTextureCount = textures.count; for (var j = 0; j < groupTextureCount; j++) { - renderer.texture.bind(drawCall.textures[j], j); + renderer.texture.bind(textures.elements[j], j); } - renderer.geometry.draw(drawCall.type, drawCall.size, drawCall.start); + renderer.geometry.draw(type, size, start); }; /** @@ -33265,9 +34070,22 @@ var PIXI = (function (exports) { Graphics.prototype._calculateBounds = function _calculateBounds () { this.finishPoly(); - var lb = this.geometry.bounds; - this._bounds.addFrame(this.transform, lb.minX, lb.minY, lb.maxX, lb.maxY); + var geometry = this.geometry; + + // skipping when graphics is empty, like a container + if (!geometry.graphicsData.length) + { + return; + } + + var ref = geometry.bounds; + var minX = ref.minX; + var minY = ref.minY; + var maxX = ref.maxX; + var maxY = ref.maxY; + + this._bounds.addFrame(this.transform, minX, minY, maxX, maxY); }; /** @@ -33463,8 +34281,8 @@ var PIXI = (function (exports) { Graphics._TEMP_POINT = new Point(); /*! - * @pixi/sprite - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/sprite - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/sprite is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -33571,7 +34389,7 @@ var PIXI = (function (exports) { * @default PIXI.BLEND_MODES.NORMAL * @see PIXI.BLEND_MODES */ - this.blendMode = BLEND_MODES.NORMAL; + this.blendMode = exports.BLEND_MODES.NORMAL; /** * The shader that will be used to render the sprite. Set to null to remove a current shader. @@ -34107,6 +34925,11 @@ var PIXI = (function (exports) { return; } + if (this._texture) + { + this._texture.off('update', this._onTextureUpdate, this); + } + this._texture = value || Texture.EMPTY; this._cachedTint = 0xFFFFFF; @@ -34133,8 +34956,8 @@ var PIXI = (function (exports) { }(Container)); /*! - * @pixi/text - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/text - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/text is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -36404,8 +37227,8 @@ var PIXI = (function (exports) { }(Sprite)); /*! - * @pixi/prepare - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/prepare - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/prepare is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -36605,7 +37428,7 @@ var PIXI = (function (exports) { if (!this.ticking) { this.ticking = true; - Ticker.system.addOnce(this.tick, this, UPDATE_PRIORITY.UTILITY); + Ticker.system.addOnce(this.tick, this, exports.UPDATE_PRIORITY.UTILITY); } } else if (done) @@ -36675,7 +37498,7 @@ var PIXI = (function (exports) { else { // if we are not finished, on the next rAF do this again - Ticker.system.addOnce(this.tick, this, UPDATE_PRIORITY.UTILITY); + Ticker.system.addOnce(this.tick, this, exports.UPDATE_PRIORITY.UTILITY); } }; @@ -36798,21 +37621,22 @@ var PIXI = (function (exports) { } /** - * Built-in hook to find BaseTextures from Sprites. + * Built-in hook to find BaseTextures from Texture. * * @private - * @param {PIXI.DisplayObject} item - Display object to check + * @param {PIXI.Texture} item - Display object to check * @param {Array<*>} queue - Collection of items to upload * @return {boolean} if a PIXI.Texture object was found. */ function findBaseTexture(item, queue) { - // Objects with textures, like Sprites/Text - if (item instanceof BaseTexture) + if (item.baseTexture instanceof BaseTexture) { - if (queue.indexOf(item) === -1) + var texture = item.baseTexture; + + if (queue.indexOf(texture) === -1) { - queue.push(item); + queue.push(texture); } return true; @@ -36981,7 +37805,7 @@ var PIXI = (function (exports) { * * @private * @param {PIXI.Renderer} renderer - instance of the webgl renderer - * @param {PIXI.DisplayObject} item - Item to check + * @param {PIXI.BaseTexture} item - Item to check * @return {boolean} If item was uploaded. */ function uploadBaseTextures(renderer, item) @@ -37012,19 +37836,38 @@ var PIXI = (function (exports) { */ function uploadGraphics(renderer, item) { - if (item instanceof Graphics) + if (!(item instanceof Graphics)) { - // if the item is not dirty and already has webgl data, then it got prepared or rendered - // before now and we shouldn't waste time updating it again - if (item.dirty || item.clearDirty || !item._webGL[renderer.plugins.graphics.CONTEXT_UID]) - { - renderer.plugins.graphics.updateGraphics(item); - } - - return true; + return false; } - return false; + var geometry = item.geometry; + + // update dirty graphics to get batches + item.finishPoly(); + geometry.updateBatches(); + + var batches = geometry.batches; + + // upload all textures found in styles + for (var i = 0; i < batches.length; i++) + { + var ref = batches[i].style; + var texture = ref.texture; + + if (texture) + { + uploadBaseTextures(renderer, texture.baseTexture); + } + } + + // if its not batchable - update vao for particular shader + if (!geometry.batchable) + { + renderer.geometry.bind(geometry, item._resolveDirectShader()); + } + + return true; } /** @@ -37095,8 +37938,8 @@ var PIXI = (function (exports) { }); /*! - * @pixi/app - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/app - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/app is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -39112,7 +39955,7 @@ var PIXI = (function (exports) { * @namespace middleware */ - var index$1 = ({ + var index$2 = ({ caching: caching, parsing: parsing }); @@ -39858,8 +40701,8 @@ var PIXI = (function (exports) { }; /*! - * @pixi/loaders - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/loaders - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/loaders is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -40060,7 +40903,7 @@ var PIXI = (function (exports) { }; // parse any blob into more usable objects (e.g. Image) - Loader$1.registerPlugin({ use: index$1.parsing }); + Loader$1.registerPlugin({ use: index$2.parsing }); // parse any Image objects into textures Loader$1.registerPlugin(TextureLoader); @@ -40159,8 +41002,8 @@ var PIXI = (function (exports) { var LoaderResource = Resource$1; /*! - * @pixi/particles - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/particles - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/particles is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -40266,7 +41109,7 @@ var PIXI = (function (exports) { * @default PIXI.BLEND_MODES.NORMAL * @see PIXI.BLEND_MODES */ - this.blendMode = BLEND_MODES.NORMAL; + this.blendMode = exports.BLEND_MODES.NORMAL; /** * If true, container allocates more batches in case there are more than `maxSize` particles. @@ -40509,7 +41352,7 @@ var PIXI = (function (exports) { attributeName: property.attributeName, size: property.size, uploadFunction: property.uploadFunction, - type: property.type || TYPES.FLOAT, + type: property.type || exports.TYPES.FLOAT, offset: property.offset, }; @@ -40603,7 +41446,7 @@ var PIXI = (function (exports) { property$2.attributeName, this.dynamicBuffer, 0, - property$2.type === TYPES.UNSIGNED_BYTE, + property$2.type === exports.TYPES.UNSIGNED_BYTE, property$2.type, this.dynamicStride * 4, property$2.offset * 4 @@ -40618,7 +41461,7 @@ var PIXI = (function (exports) { property$3.attributeName, this.staticBuffer, 0, - property$3.type === TYPES.UNSIGNED_BYTE, + property$3.type === exports.TYPES.UNSIGNED_BYTE, property$3.type, this.staticStride * 4, property$3.offset * 4 @@ -40641,7 +41484,7 @@ var PIXI = (function (exports) { var property = this.dynamicProperties[i]; property.uploadFunction(children, startIndex, amount, - property.type === TYPES.UNSIGNED_BYTE ? this.dynamicDataUint32 : this.dynamicData, + property.type === exports.TYPES.UNSIGNED_BYTE ? this.dynamicDataUint32 : this.dynamicData, this.dynamicStride, property.offset); } @@ -40663,7 +41506,7 @@ var PIXI = (function (exports) { var property = this.staticProperties[i]; property.uploadFunction(children, startIndex, amount, - property.type === TYPES.UNSIGNED_BYTE ? this.staticDataUint32 : this.staticData, + property.type === exports.TYPES.UNSIGNED_BYTE ? this.staticDataUint32 : this.staticData, this.staticStride, property.offset); } @@ -40771,7 +41614,7 @@ var PIXI = (function (exports) { { attributeName: 'aColor', size: 1, - type: TYPES.UNSIGNED_BYTE, + type: exports.TYPES.UNSIGNED_BYTE, uploadFunction: this.uploadTint, offset: 0, } ]; @@ -40815,7 +41658,7 @@ var PIXI = (function (exports) { var baseTexture = children[0]._texture.baseTexture; // if the uvs have not updated then no point rendering just yet! - this.renderer.state.setBlendMode(correctBlendMode(container.blendMode, baseTexture.premultiplyAlpha)); + this.renderer.state.setBlendMode(correctBlendMode(container.blendMode, baseTexture.alphaMode)); var gl = renderer.gl; @@ -40826,7 +41669,7 @@ var PIXI = (function (exports) { this.shader.uniforms.translationMatrix = m.toArray(true); this.shader.uniforms.uColor = premultiplyRgba(container.tintRgb, - container.worldAlpha, this.shader.uniforms.uColor, baseTexture.premultiplyAlpha); + container.worldAlpha, this.shader.uniforms.uColor, baseTexture.alphaMode); this.shader.uniforms.uSampler = baseTexture; @@ -41092,7 +41935,7 @@ var PIXI = (function (exports) { for (var i = 0; i < amount; ++i) { var sprite = children[startIndex + i]; - var premultiplied = sprite._texture.baseTexture.premultiplyAlpha; + var premultiplied = sprite._texture.baseTexture.alphaMode > 0; var alpha = sprite.alpha; // we dont call extra function if alpha is 1.0, that's faster var argb = alpha < 1.0 && premultiplied ? premultiplyTint(sprite._tintRGB, alpha) @@ -41127,8 +41970,8 @@ var PIXI = (function (exports) { }(ObjectRenderer)); /*! - * @pixi/spritesheet - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/spritesheet - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/spritesheet is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -41232,7 +42075,7 @@ var PIXI = (function (exports) { this._callback = null; }; - var staticAccessors$4 = { BATCH_SIZE: { configurable: true } }; + var staticAccessors$2 = { BATCH_SIZE: { configurable: true } }; /** * Generate the resolution from the filename or fallback @@ -41243,7 +42086,7 @@ var PIXI = (function (exports) { * the default resolution. * @return {number} Resolution to use for spritesheet. */ - staticAccessors$4.BATCH_SIZE.get = function () + staticAccessors$2.BATCH_SIZE.get = function () { return 1000; }; @@ -41456,7 +42299,7 @@ var PIXI = (function (exports) { this.baseTexture = null; }; - Object.defineProperties( Spritesheet, staticAccessors$4 ); + Object.defineProperties( Spritesheet, staticAccessors$2 ); /** * {@link PIXI.Loader Loader} middleware for loading texture atlases that have been created with @@ -41535,8 +42378,8 @@ var PIXI = (function (exports) { }; /*! - * @pixi/sprite-tiling - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/sprite-tiling - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/sprite-tiling is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -41898,7 +42741,7 @@ var PIXI = (function (exports) { var vertex$2 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n"; - var fragment$2 = "varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = mod(vTextureCoord - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 sample = texture2D(uSampler, coord);\n gl_FragColor = sample * uColor;\n}\n"; + var fragment$2 = "varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord - floor(vTextureCoord - uClampOffset);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture2D(uSampler, coord);\n gl_FragColor = texSample * uColor;\n}\n"; var fragmentSimple = "varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = sample * uColor;\n}\n"; @@ -41971,14 +42814,14 @@ var PIXI = (function (exports) { { if (!baseTex._glTextures[renderer.CONTEXT_UID]) { - if (baseTex.wrapMode === WRAP_MODES.CLAMP) + if (baseTex.wrapMode === exports.WRAP_MODES.CLAMP) { - baseTex.wrapMode = WRAP_MODES.REPEAT; + baseTex.wrapMode = exports.WRAP_MODES.REPEAT; } } else { - isSimple = baseTex.wrapMode !== WRAP_MODES.CLAMP; + isSimple = baseTex.wrapMode !== exports.WRAP_MODES.CLAMP; } } @@ -42016,14 +42859,14 @@ var PIXI = (function (exports) { shader.uniforms.uTransform = tempMat$1.toArray(true); shader.uniforms.uColor = premultiplyTintToRgba(ts.tint, ts.worldAlpha, - shader.uniforms.uColor, baseTex.premultiplyAlpha); + shader.uniforms.uColor, baseTex.alphaMode); shader.uniforms.translationMatrix = ts.transform.worldTransform.toArray(true); shader.uniforms.uSampler = tex; renderer.shader.bind(shader); renderer.geometry.bind(quad);// , renderer.shader.getGLShader()); - renderer.state.setBlendMode(correctBlendMode(ts.blendMode, baseTex.premultiplyAlpha)); + renderer.state.setBlendMode(correctBlendMode(ts.blendMode, baseTex.alphaMode)); renderer.geometry.draw(this.renderer.gl.TRIANGLES, 6, 0); }; @@ -42031,8 +42874,8 @@ var PIXI = (function (exports) { }(ObjectRenderer)); /*! - * @pixi/text-bitmap - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/text-bitmap - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/text-bitmap is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -42856,8 +43699,8 @@ var PIXI = (function (exports) { }; /*! - * @pixi/filter-alpha - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/filter-alpha - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/filter-alpha is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -42920,14 +43763,14 @@ var PIXI = (function (exports) { }(Filter)); /*! - * @pixi/filter-blur - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/filter-blur - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/filter-blur is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ - var vertTemplate = "\n attribute vec2 aVertexPosition;\n\n uniform mat3 projectionMatrix;\n\n uniform float strength;\n\n varying vec2 vBlurTexCoords[%size%];\n\n uniform vec4 inputSize;\n uniform vec4 outputFrame;\n \n vec4 filterVertexPosition( void )\n {\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n \n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n }\n \n vec2 filterTextureCoord( void )\n {\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n\n vec2 textureCoord = filterTextureCoord();\n %blur%\n }"; + var vertTemplate = "\n attribute vec2 aVertexPosition;\n\n uniform mat3 projectionMatrix;\n\n uniform float strength;\n\n varying vec2 vBlurTexCoords[%size%];\n\n uniform vec4 inputSize;\n uniform vec4 outputFrame;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n }\n\n vec2 filterTextureCoord( void )\n {\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n\n vec2 textureCoord = filterTextureCoord();\n %blur%\n }"; function generateBlurVertSource(kernelSize, x) { @@ -43345,8 +44188,8 @@ var PIXI = (function (exports) { }(Filter)); /*! - * @pixi/filter-color-matrix - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/filter-color-matrix - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/filter-color-matrix is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -43943,8 +44786,8 @@ var PIXI = (function (exports) { ColorMatrixFilter.prototype.grayscale = ColorMatrixFilter.prototype.greyscale; /*! - * @pixi/filter-displacement - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/filter-displacement - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/filter-displacement is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -44060,8 +44903,8 @@ var PIXI = (function (exports) { }(Filter)); /*! - * @pixi/filter-fxaa - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/filter-fxaa - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/filter-fxaa is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -44097,8 +44940,8 @@ var PIXI = (function (exports) { }(Filter)); /*! - * @pixi/filter-noise - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/filter-noise - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/filter-noise is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -44176,8 +45019,8 @@ var PIXI = (function (exports) { }(Filter)); /*! - * @pixi/mixin-cache-as-bitmap - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/mixin-cache-as-bitmap - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/mixin-cache-as-bitmap is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -44601,8 +45444,8 @@ var PIXI = (function (exports) { }; /*! - * @pixi/mixin-get-child-by-name - v5.1.3 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/mixin-get-child-by-name - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/mixin-get-child-by-name is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -44638,8 +45481,8 @@ var PIXI = (function (exports) { }; /*! - * @pixi/mixin-get-global-position - v5.1.3 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/mixin-get-global-position - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/mixin-get-global-position is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -44812,6 +45655,34 @@ var PIXI = (function (exports) { return PIXI.systems.FilterSystem; }, }, + + /** + * @namespace PIXI.CanvasTinter + * @see PIXI.canvasUtils + * @deprecated since 5.2.0 + */ + CanvasTinter: { + get: function get() + { + deprecation('5.2.0', 'PIXI.CanvasTinter namespace has moved to PIXI.canvasUtils'); + + return PIXI.canvasUtils; + }, + }, + + /** + * @namespace PIXI.GroupD8 + * @see PIXI.groupD8 + * @deprecated since 5.2.0 + */ + GroupD8: { + get: function get() + { + deprecation('5.2.0', 'PIXI.GroupD8 namespace has moved to PIXI.groupD8'); + + return PIXI.groupD8; + }, + }, }); /** @@ -45296,6 +46167,8 @@ var PIXI = (function (exports) { this.update(); }; + var baseTextureIdDeprecation = false; + Object.defineProperties(BaseTexture.prototype, { /** * @name PIXI.BaseTexture#hasLoaded @@ -45361,6 +46234,55 @@ var PIXI = (function (exports) { } }, }, + + /** + * @name PIXI.BaseTexture#premultiplyAlpha + * @type {boolean} + * @deprecated since 5.2.0 + * @readonly + * @see PIXI.BaseTexture#alphaMode + */ + premultiplyAlpha: { + get: function get() + { + deprecation('5.2.0', 'PIXI.BaseTexture.premultiplyAlpha property has been changed to `alphaMode`' + + ', see `PIXI.ALPHA_MODES`'); + + return this.alphaMode !== 0; + }, + set: function set(value) + { + deprecation('5.2.0', 'PIXI.BaseTexture.premultiplyAlpha property has been changed to `alphaMode`' + + ', see `PIXI.ALPHA_MODES`'); + + this.alphaMode = Number(value); + }, + }, + /** + * Batch local field, stores current texture location + * + * @name PIXI.BaseTexture#_id + * @deprecated since 5.2.0 + * @type {number} + * @see PIXI.BaseTexture#_batchLocation + */ + _id: { + get: function get() + { + if (!baseTextureIdDeprecation) + { + // #popelyshev: That property was a hot place, I don't want to call deprecation method on it if possible + deprecation('5.2.0', 'PIXI.BaseTexture._id batch local field has been changed to `_batchLocation`'); + baseTextureIdDeprecation = true; + } + + return this._batchLocation; + }, + set: function set(value) + { + this._batchLocation = value; + }, + }, }); /** @@ -45409,6 +46331,31 @@ var PIXI = (function (exports) { return BaseTexture.from(canvas, { scaleMode: scaleMode, resourceOptions: resourceOptions }); }; + Object.defineProperties(PIXI.resources.ImageResource.prototype, { + /** + * @name PIXI.resources.ImageResource#premultiplyAlpha + * @type {boolean} + * @deprecated since 5.2.0 + * @readonly + * @see PIXI.resources.ImageResource#alphaMode + */ + premultiplyAlpha: { + get: function get() + { + deprecation('5.2.0', 'PIXI.resources.ImageResource.premultiplyAlpha property ' + + 'has been changed to `alphaMode`, see `PIXI.ALPHA_MODES`'); + + return this.alphaMode !== 0; + }, + set: function set(value) + { + deprecation('5.2.0', 'PIXI.resources.ImageResource.premultiplyAlpha property ' + + 'has been changed to `alphaMode`, see `PIXI.ALPHA_MODES`'); + this.alphaMode = Number(value); + }, + }, + }); + /** * @method PIXI.Point#copy * @deprecated since 5.0.0 @@ -45833,8 +46780,8 @@ var PIXI = (function (exports) { } /*! - * @pixi/mesh - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/mesh - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/mesh is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -45927,7 +46874,7 @@ var PIXI = (function (exports) { var Mesh = /*@__PURE__*/(function (Container) { function Mesh(geometry, shader, state, drawMode)// vertices, uvs, indices, drawMode) { - if ( drawMode === void 0 ) { drawMode = DRAW_MODES.TRIANGLES; } + if ( drawMode === void 0 ) { drawMode = exports.DRAW_MODES.TRIANGLES; } Container.call(this); @@ -46011,7 +46958,7 @@ var PIXI = (function (exports) { // Inherited from DisplayMode, set defaults this.tint = 0xFFFFFF; - this.blendMode = BLEND_MODES.NORMAL; + this.blendMode = exports.BLEND_MODES.NORMAL; /** * Internal roundPixels field @@ -46155,7 +47102,7 @@ var PIXI = (function (exports) { var vertices = this.geometry.buffers[0].data; // TODO benchmark check for attribute size.. - if (this.shader.batchable && this.drawMode === DRAW_MODES.TRIANGLES && vertices.length < Mesh.BATCHABLE_SIZE * 2) + if (this.shader.batchable && this.drawMode === exports.DRAW_MODES.TRIANGLES && vertices.length < Mesh.BATCHABLE_SIZE * 2) { this._renderToBatch(renderer); } @@ -46534,7 +47481,7 @@ var PIXI = (function (exports) { this._colorDirty = false; var baseTexture = this.texture.baseTexture; - premultiplyTintToRgba(this._tint, this._alpha, this.uniforms.uColor, baseTexture.premultiplyAlpha); + premultiplyTintToRgba(this._tint, this._alpha, this.uniforms.uColor, baseTexture.alphaMode); } if (this.uvMatrix.update()) { @@ -46573,8 +47520,8 @@ var PIXI = (function (exports) { var uvsBuffer = new Buffer(uvs, true); var indexBuffer = new Buffer(index, true, true); - this.addAttribute('aVertexPosition', verticesBuffer, 2, false, TYPES.FLOAT) - .addAttribute('aTextureCoord', uvsBuffer, 2, false, TYPES.FLOAT) + this.addAttribute('aVertexPosition', verticesBuffer, 2, false, exports.TYPES.FLOAT) + .addAttribute('aTextureCoord', uvsBuffer, 2, false, exports.TYPES.FLOAT) .addIndex(indexBuffer); /** @@ -46611,8 +47558,8 @@ var PIXI = (function (exports) { }(Geometry)); /*! - * @pixi/mesh-extras - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/mesh-extras - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/mesh-extras is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -46712,9 +47659,10 @@ var PIXI = (function (exports) { * */ var RopeGeometry = /*@__PURE__*/(function (MeshGeometry) { - function RopeGeometry(width, points) + function RopeGeometry(width, points, textureScale) { if ( width === void 0 ) { width = 200; } + if ( textureScale === void 0 ) { textureScale = 0; } MeshGeometry.call(this, new Float32Array(points.length * 4), new Float32Array(points.length * 4), @@ -46733,6 +47681,13 @@ var PIXI = (function (exports) { */ this.width = width; + /** + * Rope texture scale, if zero then the rope texture is stretched. + * @member {number} + * @readOnly + */ + this.textureScale = textureScale; + this.build(); } @@ -46775,16 +47730,31 @@ var PIXI = (function (exports) { uvs[2] = 0; uvs[3] = 1; - // indices[0] = 0; - // indices[1] = 1; - + var amount = 0; + var prev = points[0]; + var textureWidth = this.width * this.textureScale; var total = points.length; // - 1; for (var i = 0; i < total; i++) { // time to do some smart drawing! var index = i * 4; - var amount = i / (total - 1); + + if (this.textureScale > 0) + { + // calculate pixel distance from previous point + var dx = prev.x - points[i].x; + var dy = prev.y - points[i].y; + var distance = Math.sqrt((dx * dx) + (dy * dy)); + + prev = points[i]; + amount += distance / textureWidth; + } + else + { + // stretch texture + amount = i / (total - 1); + } uvs[index] = amount; uvs[index + 1] = 0; @@ -46832,8 +47802,6 @@ var PIXI = (function (exports) { var perpX = 0; var perpY = 0; - // this.count -= 0.2; - var vertices = this.buffers[0].data; var total = points.length; @@ -46855,7 +47823,7 @@ var PIXI = (function (exports) { perpX = nextPoint.y - lastPoint.y; var perpLength = Math.sqrt((perpX * perpX) + (perpY * perpY)); - var num = this.width / 2; // (20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio; + var num = this.textureScale > 0 ? this.textureScale * this.width / 2 : this.width / 2; perpX /= perpLength; perpY /= perpLength; @@ -46876,7 +47844,14 @@ var PIXI = (function (exports) { RopeGeometry.prototype.update = function update () { - this.updateVertices(); + if (this.textureScale > 0) + { + this.build(); // we need to update UVs + } + else + { + this.updateVertices(); + } }; return RopeGeometry; @@ -46898,11 +47873,18 @@ var PIXI = (function (exports) { * */ var SimpleRope = /*@__PURE__*/(function (Mesh) { - function SimpleRope(texture, points) + function SimpleRope(texture, points, textureScale) { - var ropeGeometry = new RopeGeometry(texture.height, points); + if ( textureScale === void 0 ) { textureScale = 0; } + + var ropeGeometry = new RopeGeometry(texture.height, points, textureScale); var meshMaterial = new MeshMaterial(texture); + if (textureScale > 0) + { + // attempt to set UV wrapping, will fail on non-power of two textures + texture.baseTexture.wrapMode = exports.WRAP_MODES.REPEAT; + } Mesh.call(this, ropeGeometry, meshMaterial); /** @@ -47366,8 +48348,8 @@ var PIXI = (function (exports) { }(SimplePlane)); /*! - * @pixi/sprite-animated - v5.1.5 - * Compiled Tue, 24 Sep 2019 04:07:05 UTC + * @pixi/sprite-animated - v5.2.0 + * Compiled Wed, 06 Nov 2019 02:32:43 UTC * * @pixi/sprite-animated is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -47539,7 +48521,7 @@ var PIXI = (function (exports) { this.playing = true; if (this._autoUpdate) { - Ticker.shared.add(this.update, this, UPDATE_PRIORITY.HIGH); + Ticker.shared.add(this.update, this, exports.UPDATE_PRIORITY.HIGH); } }; @@ -47831,7 +48813,7 @@ var PIXI = (function (exports) { * @name VERSION * @type {string} */ - var VERSION$1 = '5.1.5'; + var VERSION$1 = '5.2.0'; /** * @namespace PIXI @@ -47880,7 +48862,6 @@ var PIXI = (function (exports) { exports.AppLoaderPlugin = AppLoaderPlugin; exports.Application = Application; exports.Attribute = Attribute; - exports.BLEND_MODES = BLEND_MODES; exports.BaseRenderTexture = BaseRenderTexture; exports.BaseTexture = BaseTexture; exports.BatchDrawCall = BatchDrawCall; @@ -47888,6 +48869,7 @@ var PIXI = (function (exports) { exports.BatchPluginFactory = BatchPluginFactory; exports.BatchRenderer = BatchRenderer; exports.BatchShaderGenerator = BatchShaderGenerator; + exports.BatchTextureArray = BatchTextureArray; exports.BitmapFontLoader = BitmapFontLoader; exports.BitmapText = BitmapText; exports.Bounds = Bounds; @@ -47896,27 +48878,22 @@ var PIXI = (function (exports) { exports.Container = Container; exports.CubeTexture = CubeTexture; exports.DEG_TO_RAD = DEG_TO_RAD; - exports.DRAW_MODES = DRAW_MODES; exports.DisplayObject = DisplayObject; - exports.ENV = ENV; exports.Ellipse = Ellipse; - exports.FORMATS = FORMATS; exports.FillStyle = FillStyle; exports.Filter = Filter; exports.Framebuffer = Framebuffer; - exports.GC_MODES = GC_MODES; exports.GLProgram = GLProgram; - exports.GLTexture = BaseTexture; + exports.GLTexture = GLTexture; exports.GRAPHICS_CURVES = GRAPHICS_CURVES; exports.Geometry = Geometry; exports.Graphics = Graphics; exports.GraphicsData = GraphicsData; exports.GraphicsGeometry = GraphicsGeometry; - exports.GroupD8 = GroupD8; exports.LineStyle = LineStyle; exports.Loader = Loader$1; exports.LoaderResource = LoaderResource; - exports.MIPMAP_MODES = MIPMAP_MODES; + exports.MaskData = MaskData; exports.Matrix = Matrix; exports.Mesh = Mesh; exports.MeshBatchUvs = MeshBatchUvs; @@ -47926,7 +48903,6 @@ var PIXI = (function (exports) { exports.ObjectRenderer = ObjectRenderer; exports.ObservablePoint = ObservablePoint; exports.PI_2 = PI_2; - exports.PRECISION = PRECISION; exports.ParticleContainer = ParticleContainer; exports.ParticleRenderer = ParticleRenderer; exports.PlaneGeometry = PlaneGeometry; @@ -47936,7 +48912,6 @@ var PIXI = (function (exports) { exports.Quad = Quad; exports.QuadUv = QuadUv; exports.RAD_TO_DEG = RAD_TO_DEG; - exports.RENDERER_TYPE = RENDERER_TYPE; exports.Rectangle = Rectangle; exports.RenderTexture = RenderTexture; exports.RenderTexturePool = RenderTexturePool; @@ -47944,8 +48919,6 @@ var PIXI = (function (exports) { exports.RopeGeometry = RopeGeometry; exports.RoundedRectangle = RoundedRectangle; exports.Runner = Runner; - exports.SCALE_MODES = SCALE_MODES; - exports.SHAPES = SHAPES; exports.Shader = Shader; exports.SimpleMesh = SimpleMesh; exports.SimplePlane = SimplePlane; @@ -47956,9 +48929,7 @@ var PIXI = (function (exports) { exports.SpritesheetLoader = SpritesheetLoader; exports.State = State; exports.System = System; - exports.TARGETS = TARGETS; exports.TEXT_GRADIENT = TEXT_GRADIENT; - exports.TYPES = TYPES; exports.Text = Text; exports.TextMetrics = TextMetrics; exports.TextStyle = TextStyle; @@ -47971,11 +48942,9 @@ var PIXI = (function (exports) { exports.TilingSprite = TilingSprite; exports.TilingSpriteRenderer = TilingSpriteRenderer; exports.Transform = Transform; - exports.UPDATE_PRIORITY = UPDATE_PRIORITY; exports.UniformGroup = UniformGroup; exports.VERSION = VERSION$1; exports.ViewableBuffer = ViewableBuffer; - exports.WRAP_MODES = WRAP_MODES; exports.accessibility = accessibility_es; exports.autoDetectRenderer = autoDetectRenderer; exports.checkMaxIfStatementsInShader = checkMaxIfStatementsInShader; @@ -47983,6 +48952,8 @@ var PIXI = (function (exports) { exports.defaultVertex = _default; exports.extract = extract_es; exports.filters = filters; + exports.graphicsUtils = index$1; + exports.groupD8 = groupD8; exports.interaction = interaction_es; exports.isMobile = isMobile_min; exports.prepare = prepare_es; diff --git a/dist/iwmlib.3rdparty.min.js b/dist/iwmlib.3rdparty.min.js index 87b51a0..8aba46c 100644 --- a/dist/iwmlib.3rdparty.min.js +++ b/dist/iwmlib.3rdparty.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.OptimalSelect=e():t.OptimalSelect=e()}(this,function(){return function(r){var i={};function n(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,n),e.l=!0,e.exports}return n.m=r,n.c=i,n.i=function(t){return t},n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=6)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.convertNodeList=function(t){for(var e=t.length,r=new Array(e),i=0;i@~]/g,"\\$&").replace(/\n/g,"A")}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCommonAncestor=function(t){var e=(1 /g,">").split(/\s+(?=(?:(?:[^"]*"){2})*[^"]*$)/);if(i.length<2)return f("",t,"",e);var n=[i.pop()];for(;1/g,"> ").trim()};var i,n=r(3),h=(i=n)&&i.__esModule?i:{default:i},c=r(0);function f(r,i,n,o){if(r.length&&(r+=" "),n.length&&(n=" "+n),/\[*\]/.test(i)){var t=i.replace(/=.*$/,"]"),a=""+r+t+n;if(g(document.querySelectorAll(a),o))i=t;else for(var s=document.querySelectorAll(""+r+t),e=function(){var e=s[l];if(o.some(function(t){return e.contains(t)})){var t=e.tagName.toLowerCase();return a=""+r+t+n,g(document.querySelectorAll(a),o)&&(i=t),"break"}},l=0,u=s.length;l/.test(i)){var h=i.replace(/>/,"");a=""+r+h+n;g(document.querySelectorAll(a),o)&&(i=h)}if(/:nth-child/.test(i)){var c=i.replace(/nth-child/g,"nth-of-type");a=""+r+c+n;g(document.querySelectorAll(a),o)&&(i=c)}if(/\.\S+\.\S+/.test(i)){for(var f=i.trim().split(".").slice(1).map(function(t){return"."+t}).sort(function(t,e){return t.length-e.length});f.length;){var p=i.replace(f.shift(),"").trim();if(!(a=(""+r+p+n).trim()).length||">"===a.charAt(0)||">"===a.charAt(a.length-1))break;g(document.querySelectorAll(a),o)&&(i=p)}if((f=i&&i.match(/\./g))&&2/.test(s):u=function(e){return function(t){return t(e.parent)&&e.parent}};break;case/^\./.test(s):var r=s.substr(1).split(".");l=function(t){var e=t.attribs.class;return e&&r.every(function(t){return-1)(\S)/g,"$1 $2").trim()),e=i.shift(),n=i.length;return e(this).filter(function(t){for(var e=0;e\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=o.console&&(o.console.warn||o.console.log);return r&&r.call(o.console,n,e),i.apply(this,arguments)}}a="function"!=typeof Object.assign?function(t){if(t===c||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),r=1;re[r]}):i.sort()),i}function E(t,e){for(var r,i,n=e[0].toUpperCase()+e.slice(1),o=0;of(u.y)?u.x:u.y,e.scale=a?function(t,e){return it(e[0],e[1],J)/it(t[0],t[1],J)}(a.pointers,i):1,e.rotation=a?function(t,e){return nt(e[1],e[0],J)+nt(t[1],t[0],J)}(a.pointers,i):0,e.maxPointers=r.prevInput?e.pointers.length>r.prevInput.maxPointers?e.pointers.length:r.prevInput.maxPointers:e.pointers.length,function(t,e){var r,i,n,o,a=t.lastInterval||e,s=e.timeStamp-a.timeStamp;if(e.eventType!=B&&(jf(h.y)?h.x:h.y,o=rt(l,u),t.lastInterval=e}else r=a.velocity,i=a.velocityX,n=a.velocityY,o=a.direction;e.velocity=r,e.velocityX=i,e.velocityY=n,e.direction=o}(r,e);var h=t.element;T(e.srcEvent.target,h)&&(h=e.srcEvent.target);e.target=h}(t,r),t.emit("hammer.input",r),t.recognize(r),t.session.prevInput=r}function $(t){for(var e=[],r=0;r=f(e)?t<0?X:H:e<0?q:W}function it(t,e,r){r||(r=Z);var i=e[r[0]]-t[r[0]],n=e[r[1]]-t[r[1]];return Math.sqrt(i*i+n*n)}function nt(t,e,r){r||(r=Z);var i=e[r[0]]-t[r[0]],n=e[r[1]]-t[r[1]];return 180*Math.atan2(n,i)/Math.PI}K.prototype={handler:function(){},init:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(O(this.element),this.evWin,this.domHandler)}};var ot={mousedown:L,mousemove:2,mouseup:N},at="mousedown",st="mousemove mouseup";function lt(){this.evEl=at,this.evWin=st,this.pressed=!1,K.apply(this,arguments)}v(lt,K,{handler:function(t){var e=ot[t.type];e&L&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=N),this.pressed&&(e&N&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:F,srcEvent:t}))}});var ut={pointerdown:L,pointermove:2,pointerup:N,pointercancel:B,pointerout:B},ht={2:R,3:"pen",4:F,5:"kinect"},ct="pointerdown",ft="pointermove pointerup pointercancel";function pt(){this.evEl=ct,this.evWin=ft,K.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}o.MSPointerEvent&&!o.PointerEvent&&(ct="MSPointerDown",ft="MSPointerMove MSPointerUp MSPointerCancel"),v(pt,K,{handler:function(t){var e=this.store,r=!1,i=t.type.toLowerCase().replace("ms",""),n=ut[i],o=ht[t.pointerType]||t.pointerType,a=o==R,s=P(e,t.pointerId,"pointerId");n&L&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):n&(N|B)&&(r=!0),s<0||(e[s]=t,this.callback(this.manager,n,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),r&&e.splice(s,1))}});var dt={touchstart:L,touchmove:2,touchend:N,touchcancel:B};function mt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,K.apply(this,arguments)}v(mt,K,{handler:function(t){var e=dt[t.type];if(e===L&&(this.started=!0),this.started){var r=function(t,e){var r=C(t.touches),i=C(t.changedTouches);e&(N|B)&&(r=A(r.concat(i),"identifier",!0));return[r,i]}.call(this,t,e);e&(N|B)&&r[0].length-r[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:r[0],changedPointers:r[1],pointerType:R,srcEvent:t})}}});var gt={touchstart:L,touchmove:2,touchend:N,touchcancel:B},vt="touchstart touchmove touchend touchcancel";function _t(){this.evTarget=vt,this.targetIds={},K.apply(this,arguments)}v(_t,K,{handler:function(t){var e=gt[t.type],r=function(t,e){var r=C(t.touches),i=this.targetIds;if(e&(2|L)&&1===r.length)return i[r[0].identifier]=!0,[r,r];var n,o,a=C(t.changedTouches),s=[],l=this.target;if(o=r.filter(function(t){return T(t.target,l)}),e===L)for(n=0;ne.threshold&&n&e.direction},attrTest:function(t){return Ft.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=zt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),v(Lt,Ft,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Pt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),v(Nt,Mt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,i=t.distancee.time;if(this._input=t,!i||!r||t.eventType&(N|B)&&!n)this.reset();else if(t.eventType&L)this.reset(),this._timer=u(function(){this.state=8,this.tryEmit()},e.time,this);else if(t.eventType&N)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&t.eventType&N?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),v(Bt,Ft,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Pt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),v(Ut,Ft,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:G|V,pointers:1},getTouchAction:function(){return jt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,r=this.options.direction;return r&(G|V)?e=t.overallVelocity:r&G?e=t.overallVelocityX:r&V&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&r&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&f(e)>this.options.velocity&&t.eventType&N},emit:function(t){var e=zt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),v(Xt,Mt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[St]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,i=t.distance80*r){i=o=t[0],n=a=t[1];for(var d=r;do.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,h=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,c=E(s,l,e,r,i),f=E(u,h,e,r,i),p=t.prevZ,d=t.nextZ;p&&p.z>=c&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&O(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=M(p.prev,p,p.next))return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&O(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=M(d.prev,d,d.next))return!1;d=d.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&O(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=M(p.prev,p,p.next))return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&O(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=M(d.prev,d,d.next))return!1;d=d.nextZ}return!0}function k(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!z(n,o)&&R(n,i,i.next,o)&&L(n,o)&&L(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),U(i),U(i.next),i=t=o),i=i.next}while(i!==t);return b(i)}function S(t,e,r,i,n,o){var a,s,l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&(s=u,(a=l).next.i!==s.i&&a.prev.i!==s.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&R(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(a,s)&&(L(a,s)&&L(s,a)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;for(;r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next,r!==t;);return i}(a,s)&&(M(a.prev,a,s.prev)||M(a,s.prev,s))||z(a,s)&&0=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&a=i.x&&i.x>=h&&n!==i.x&&O(or.x||i.x===r.x&&(d=i,M((p=r).prev,p,d.prev)<0&&M(d.next,p,p.next)<0)))&&(r=i,f=l)),i=i.next,i!==u;);var p,d;return r}(t,e)){var r=N(e,t);b(r,r.next)}}function E(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function I(t){for(var e=t,r=t;(e.x=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function j(t){return 0= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=_-y,k=Math.floor,S=String.fromCharCode;function P(t){throw RangeError(c[t])}function p(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function d(t,e){var r=t.split("@"),i="";return 1>>10&1023|55296),t=56320|1023&t),e+=S(t)}).join("")}function E(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function I(t,e,r){var i=0;for(t=r?k(t/s):t>>1,t+=k(t/e);f*b>>1k((v-d)/a))&&P("overflow"),d+=l*a,!(l<(u=s<=g?y:g+b<=s?b:s-g));s+=_)a>k(v/(h=_-u))&&P("overflow"),a*=h;g=I(d-o,e=f.length+1,0==o),k(d/e)>v-m&&P("overflow"),m+=k(d/e),d%=e,f.splice(d++,0,m)}return A(f)}function g(t){var e,r,i,n,o,a,s,l,u,h,c,f,p,d,m,g=[];for(f=(t=C(t)).length,e=w,o=x,a=r=0;ak((v-r)/(p=i+1))&&P("overflow"),r+=(s-e)*p,e=s,a=0;av&&P("overflow"),c==e){for(l=r,u=_;!(l<(h=u<=o?y:o+b<=u?b:u-o));u+=_)m=l-h,d=_-h,g.push(S(E(h+m%d,0))),l=k(m/d);g.push(S(E(l,0))),o=I(r,p,i==n),r=0,++i}++r,++e}return g.join("")}if(n={version:"1.3.2",ucs2:{decode:C,encode:A},decode:m,encode:g,toASCII:function(t){return d(t,function(t){return u.test(t)?"xn--"+g(t):t})},toUnicode:function(t){return d(t,function(t){return l.test(t)?m(t.slice(4).toLowerCase()):t})}},e&&r)if(O.exports==e)r.exports=n;else for(o in n)n.hasOwnProperty(o)&&(e[o]=n[o]);else t.punycode=n}(D)}),W={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};W.isString,W.isObject,W.isNull,W.isNullOrUndefined;var G=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var s,l,u=t.length;0",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(ot),st=["%","/","?",";","#"].concat(at),lt=["/","?","#"],ut=/^[+a-z0-9A-Z_-]{0,63}$/,ht=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ct={javascript:!0,"javascript:":!0},ft={javascript:!0,"javascript:":!0},pt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function dt(t,e,r){if(t&&W.isObject(t)&&t instanceof et)return t;var i=new et;return i.parse(t,e,r),i}et.prototype.parse=function(t,e,r){if(!W.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function zt(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Rt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}var Ft=function(){for(var t=[],e=[],r=0;r<32;r++)e[t[r]=r]=r;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function jt(t,e){return Ft[e?1:0][t]}function Lt(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function Nt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function Bt(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ut(t,e){void 0===e&&(e=null);var r=6*t;if((e=e||new Uint16Array(r)).length!==r)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+r);for(var i=0,n=0;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Vt(t){return!(t&t-1||!t)}function Yt(t){var e=(65535>>=e))<<3;return e|=r,e|=r=(15<(t>>>=r))<<2,(e|=r=(3<(t>>>=r))<<1)|(t>>>=r)>>1}var Zt={},Jt=Object.create(null),Kt=Object.create(null);function Qt(t){var e,r,i,n=t.width,o=t.height,a=t.getContext("2d"),s=a.getImageData(0,0,n,o).data,l=s.length,u={top:null,left:null,right:null,bottom:null},h=null;for(e=0;e=this.x&&t=this.y&&e=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},P.SORTABLE_CHILDREN=!1;var ze=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};ze.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},ze.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},ze.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Ce.EMPTY:((t=t||new Ce(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},ze.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},ze.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],a=t[1];e=oi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},ze.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXe.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXthis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),(t.parent=this).sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},t.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Xt(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},t.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},t.prototype.removeChild=function(t){var e=arguments,r=arguments.length;if(1this.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},Ne.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",-1e.priority){t.connect(r);break}e=(r=e).next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},We.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},We.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},We.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},We.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},We.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var r=t-this._lastFrame|0;if(r]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var lr=function(h){function r(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){var r=document.createElement("video");r.setAttribute("preload","auto"),r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),"string"==typeof t&&(t=[t]),h.crossOrigin(r,t[0].src||t[0],e.crossorigin);for(var i=0;ithis.baseTexture.width,a=r+n>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",l="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+l+" "+s+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},t.rotate.get=function(){return this._rotate},t.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},t.width.get=function(){return this.orig.width},t.height.get=function(){return this.orig.height},Object.defineProperties(s.prototype,t),s}(m);function yr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}_r.EMPTY=new _r(new ir),yr(_r.EMPTY),yr(_r.EMPTY.baseTexture),_r.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new _r(new ir(new or(t)))}(),yr(_r.WHITE),yr(_r.WHITE.baseTexture);var br=function(s){function e(t,e){var r=null;if(!(t instanceof mr)){var i=arguments[1],n=arguments[2],o=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+i+", "+n+") instead of the ctor directly."),r=arguments[0],e=null,t=new mr({width:i,height:n,scaleMode:o,resolution:a})}s.call(this,t,e),this.legacyRenderer=r,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return s&&(e.__proto__=s),((e.prototype=Object.create(s&&s.prototype)).constructor=e).prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=0=gt.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},t.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion?Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,{anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),colorBufferFloat:t.getExtension("EXT_color_buffer_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear")})},t.prototype.handleContextLost=function(t){t.preventDefault()},t.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},t.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},t.prototype.postrender=function(){this.gl.flush()},t.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(t.prototype,r),t}(cr),Ur=function(e){function t(t){e.call(this,t),this.managedFramebuffers=[],this.unknownFramebuffer=new pr(10,10)}e&&(t.__proto__=e);var r={size:{configurable:!0}};return((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ce,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;P.PREFER_ENV===gt.WEBGL_LEGACY&&(r=e=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},t.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var a=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,a)}}}},t.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},t.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},t.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],a=o[n];if(a)return o[e.id]=a;var s=t.buffers,l=t.attributes,u={},h={};for(var c in s)u[c]=0,h[c]=0;for(var f in l)!l[f].size&&e.attributeData[f]?l[f].size=e.attributeData[f].size:l[f].size||console.warn("PIXI Geometry attribute '"+f+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[l[f].buffer]+=l[f].size*Hr[l[f].type];for(var p in l){var d=l[p],m=d.size;void 0===d.stride&&(u[d.buffer]===m*Hr[d.type]?d.stride=0:d.stride=u[d.buffer]),void 0===d.start&&(d.start=h[d.buffer],h[d.buffer]+=m*Hr[d.type])}a=r.createVertexArray(),r.bindVertexArray(a);for(var g=0;g=gt.WEBGL2&&(t=e.getContext("webgl2",{})),t||((t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?t.getExtension("WEBGL_draw_buffers"):t=null),Kr=t}return Kr}function $r(t,e,r){if("precision"===t.substring(0,9))return r!==Ct.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t;var i=e;return e===Ct.HIGH&&r!==Ct.HIGH&&(i=Ct.MEDIUM),"precision "+i+" float;\n"+t}var ti={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};var ei=null,ri={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ii(t,e){if(!ei){var r=Object.keys(ri);ei={};for(var i=0;ie.name?1:-1});for(var h=0;h>=1,r++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run()))},t.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),r=!(e[i]=null))}if(r){for(var o=0,a=0;athis.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedElements[this._bufferSize++]=t)},t.prototype.flush=function(){if(0!==this._vertexCount){var t,e,r=this.getAttributeBuffer(this._vertexCount),i=this.getIndexBuffer(this._indexCount),n=this.renderer.gl,o=this._bufferedElements,a=this._drawCalls,s=this.MAX_TEXTURES,l=this._packedGeometries,u=this.vertexSize,h=this.renderer.textureGC.count,c=0,f=0,p=0,d=a[0],m=0,g=-1;d.textureCount=0,d.start=0,d.blend=g;var v,_=++ir._globalBatch;for(v=0;vthis.maxSegments&&(r=this.maxSegments),r}},dn=function(){this.reset()};dn.prototype.clone=function(){var t=new dn;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},dn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=_r.WHITE,this.matrix=null,this.visible=!1},dn.prototype.destroy=function(){this.texture=null,this.matrix=null};var mn=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type,this.points=[],this.holes=[]};mn.prototype.clone=function(){return new mn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},mn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var gn={build:function(t){var e,r,i=t.shape,n=t.points,o=i.x,a=i.y;if(n.length=0,r=t.type===de.CIRC?(e=i.radius,i.radius):(e=i.width,i.height),0!==e&&0!==r){var s=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height));s/=2.3;for(var l=2*Math.PI/s,u=0;u>16)+(65280&e)+((255&e)<<16),r);0>16&255)/255*n,o.tint[1]=(i>>8&255)/255*n,o.tint[2]=(255&i)/255*n,o.tint[3]=n,t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(var s=0,l=a.length;s>16)+(65280&n)+((255&n)<<16)}}},r.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,a=t.ty,s=this.geometry.points,l=this.vertexData,u=0,h=0;h=i&&Fn.x=n&&Fn.y>16)+(65280&t)+((255&t)<<16)},t.texture.get=function(){return this._texture},t.texture.set=function(t){this._texture!==t&&(this._texture=t||_r.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(i.prototype,t),i}(je),Nn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},Bn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Nn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Un=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Xn=function(t){this.styleID=0,this.reset(),Gn(this,t,t)},Hn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function qn(t){return"number"==typeof t?zt(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Wn(t){if(Array.isArray(t)){for(var e=0;e>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var a=0;a=a.length&&a.push(this._generateOneMoreBuffer(t));var d=a[f];d.uploadDynamic(e,c,p);var m=t._bufferUpdateIDs[f]||0;(h=h||d._updateID=i&&Yo.x=n&&Yo.ys&&(Xt(i,1+f-++d,1+g-f),g=f,f=-1,n.push(p),h=Math.max(h,p),c++,r.x=0,r.y+=t.lineHeight,l=null))}else n.push(u),h=Math.max(h,u),++c,++d,r.x=0,r.y+=t.lineHeight,l=null}var b=o.charAt(o.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(u=p),n.push(u),h=Math.max(h,u));for(var x=[],w=0;w<=c;w++){var T=0;"right"===this._font.align?T=h-n[w]:"center"===this._font.align&&(T=(h-n[w])/2),x.push(T)}for(var k=i.length,S=this.tint,P=0;P 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",t),this.alpha=1}e&&(t.__proto__=e);var r={matrix:{configurable:!0},alpha:{configurable:!0}};return((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},t.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},t.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},t.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},t.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},t.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},t.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=(0,Math.sqrt)(1/3),o=[r+1/3*(1-r),1/3*(1-r)-n*i,1/3*(1-r)+n*i,0,0,1/3*(1-r)+n*i,r+1/3*(1-r),1/3*(1-r)-n*i,0,0,1/3*(1-r)-n*i,1/3*(1-r)+n*i,r+1/3*(1-r),0,0,0,0,0,1,0];this._loadMatrix(o,e)},t.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},t.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},t.prototype.desaturate=function(){this.saturate(-1)},t.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},t.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},t.prototype.technicolor=function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},t.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},t.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},t.prototype.kodachrome=function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},t.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},t.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},t.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,a=(r>>8&255)/255,s=(255&r)/255,l=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,h=(255&i)/255,c=[.3,.59,.11,0,0,o,a,s,t=t||.2,0,l,u,h,e=e||.15,0,o-l,a-u,s-h,0,0];this._loadMatrix(c,n)},t.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},t.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},t.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},t.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(t.prototype,r),t}(_i);sa.prototype.grayscale=sa.prototype.greyscale;var la=function(i){function t(t,e){var r=new me;t.renderable=!1,i.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:t._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=t,this.maskMatrix=r,null==e&&(e=20),this.scale=new le(e,e)}i&&(t.__proto__=i);var e={map:{configurable:!0}};return((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),a=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==a&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/a,this.uniforms.rotation[3]=n.d/a),t.applyFilter(this,e,r,i)},e.map.get=function(){return this.uniforms.mapSampler},e.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(t.prototype,e),t}(_i),ua=function(t){function e(){t.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\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 --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(_i),ha=function(r){function t(t,e){void 0===t&&(t=.5),void 0===e&&(e=Math.random()),r.call(this,Ui,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0}),this.noise=t,this.seed=e}r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t;var e={noise:{configurable:!0},seed:{configurable:!0}};return e.noise.get=function(){return this.uniforms.uNoise},e.noise.set=function(t){this.uniforms.uNoise=t},e.seed.get=function(){return this.uniforms.uSeed},e.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(t.prototype,e),t}(_i),ca=new me;Re.prototype._cacheAsBitmap=!1,Re.prototype._cacheData=!1;var fa=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Re.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&((this._cacheAsBitmap=t)?(this._cacheData||(this._cacheData=new fa),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Re.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Re.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(P.RESOLUTION);var n=t.renderTexture.current,o=t.renderTexture.sourceFrame,a=t.projection.transform,s=br.create(r.width,r.height),l="cacheAsBitmap_"+qt();this._cacheData.textureCacheId=l,ir.addToCache(s.baseTexture,l),_r.addToCache(s,l);var u=ca;u.tx=-r.x,u.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,s,!0,u,!0),t.projection.transform=a,t.renderTexture.bind(n,o),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Ln(s);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Re.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Re.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(P.RESOLUTION);var n=br.create(e.width,e.height),o="cacheAsBitmap_"+qt();this._cacheData.textureCacheId=o,ir.addToCache(n.baseTexture,o),_r.addToCache(n,o);var a=ca;this.transform.localTransform.copyTo(a),a.invert(),a.tx-=e.x,a.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,a,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var s=new Ln(n);s.transform.worldTransform=this.transform.worldTransform,s.anchor.x=-e.x/e.width,s.anchor.y=-e.y/e.height,s.alpha=r,s._bounds=this._bounds,this._cacheData.sprite=s,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=s.containsPoint.bind(s)}},Re.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Re.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Re.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,ir.removeFromCache(this._cacheData.textureCacheId),_r.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Re.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Re.prototype.name=null,je.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},e.tint.get=function(){return this._tint},t.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Bt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(t.prototype,e),t}(di),ya=function(a){function t(t,e,r){a.call(this);var i=new kr(t),n=new kr(e,!0),o=new kr(r,!0,!0);this.addAttribute("aVertexPosition",i,2,!1,wt.FLOAT).addAttribute("aTextureCoord",n,2,!1,wt.FLOAT).addIndex(o),this._updateId=-1}a&&(t.__proto__=a),(t.prototype=Object.create(a&&a.prototype)).constructor=t;var e={vertexDirtyId:{configurable:!0}};return e.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(t.prototype,e),t}(Ir),ba=function(n){function t(t,e,r,i){void 0===t&&(t=100),void 0===e&&(e=100),void 0===r&&(r=10),void 0===i&&(i=10),n.call(this),this.segWidth=r,this.segHeight=i,this.width=t,this.height=e,this.build()}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,a=this.width/n,s=this.height/o,l=0;le?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},t.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},e.width.get=function(){return this._width},e.width.set=function(t){this._width=t,this._refresh()},e.height.get=function(){return this._height},e.height.set=function(t){this._height=t,this._refresh()},e.leftWidth.get=function(){return this._leftWidth},e.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},e.rightWidth.get=function(){return this._rightWidth},e.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},e.topHeight.get=function(){return this._topHeight},e.topHeight.set=function(t){this._topHeight=t,this._refresh()},e.bottomHeight.get=function(){return this._bottomHeight},e.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},t.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(t.prototype,e),t}(Ta),Pa=function(r){function i(t,e){r.call(this,t[0]instanceof _r?t[0]:t[0].texture),this._textures=null,this._durations=null,this.textures=t,this._autoUpdate=!1!==e,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}r&&(i.__proto__=r);var t={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return((i.prototype=Object.create(r&&r.prototype)).constructor=i).prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&We.shared.remove(this.update,this))},i.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&We.shared.add(this.update,this,He.HIGH))},i.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},i.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},i.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(0r&&this.onLoop()),this.updateTexture())},i.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},i.prototype.destroy=function(t){this.stop(),r.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},i.fromFrames=function(t){for(var e=[],r=0;r 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},"undefined"!=typeof arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(t){console.log(t)}),e.printErr||(e.printErr=function(t){console.log(t)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(t){document.title=t})}function ha(t){eval.call(null,t)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(t){ka=t},fb:function(){return ka},ua:function(){return m},ba:function(t){m=t},Ka:function(t){switch(t){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===t[t.length-1]?n.J:"i"===t[0]?(assert(0==(t=parseInt(t.substr(1)))%8),t/8):0}},eb:function(t){return Math.max(n.Ka(t),n.J)},ud:16,Qd:function(t,e){return"double"===e||"i64"===e?7&t&&(assert(4==(7&t)),t+=4):assert(0==(3&t)),t},Ed:function(t,e,r){return r||"i64"!=t&&"double"!=t?t?Math.min(e||(t?n.eb(t):0),n.J):Math.min(e,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(t){for(var e=0;e>>0)+4294967296*+(e>>>0):+(t>>>0)+4294967296*+(0|e)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(t,e){t||x("Assertion failed: "+e)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(t){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(t,e,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[t>>0]=e;break;case"i16":z[t>>1]=e;break;case"i32":C[t>>2]=e;break;case"i64":pa=[e>>>0,(oa=e,1<=+xa(oa)?0>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[t>>2]=pa[0],C[t+4>>2]=pa[1];break;case"float":Ba[t>>2]=e;break;case"double":Ca[t>>3]=e;break;default:x("invalid type for setValue: "+r)}}function Da(t,e){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return y[t>>0];case"i16":return z[t>>1];case"i32":case"i64":return C[t>>2];case"float":return Ba[t>>2];case"double":return Ca[t>>3];default:x("invalid type for setValue: "+e)}return null}function D(t,e,r,i){var o,a;a="number"==typeof t?(o=!0,t):(o=!1,t.length);var s,l,u="string"==typeof e?e:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,u?1:e.length)),o){for(assert(0==(3&(i=r))),t=r+(-4&a);i>2]=0;for(t=r+a;i>0]=0;return r}if("i8"===u)return t.subarray||t.slice?E.set(t,r):E.set(new Uint8Array(t),r),r;for(i=0;i>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(t,e,r,i){if(!(0>6}else{if(a<=65535){if(i<=r+2)break;e[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;e[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;e[r++]=248|a>>24}else{if(i<=r+5)break;e[r++]=252|a>>30,e[r++]=128|a>>24&63}e[r++]=128|a>>18&63}e[r++]=128|a>>12&63}e[r++]=128|a>>6&63}e[r++]=128|63&a}}return e[r]=0,r-n}function La(t){for(var e=0,r=0;r"):o=n;t:for(;c>0];if(!r)return e;e+=String.fromCharCode(r)}},e.stringToAscii=function(t,e){return Ia(t,e,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(t){return Ja(E,t)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(t,e,r){return Ka(t,E,e,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(t){for(var e=0,r="";;){var i=z[t+2*e>>1];if(0==i)return r;++e,r+=String.fromCharCode(i)}},e.stringToUTF16=function(t,e,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=e;r=(r-=2)<2*t.length?r/2:t.length;for(var n=0;n>1]=t.charCodeAt(n),e+=2;return z[e>>1]=0,e-i},e.lengthBytesUTF16=function(t){return 2*t.length},e.UTF32ToString=function(t){for(var e=0,r="";;){var i=C[t+4*e>>2];if(0==i)return r;++e,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(t,e,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=e;r=i+r-4;for(var n=0;n>2]=o,r<(e+=4)+4)break}return C[e>>2]=0,e-i},e.lengthBytesUTF32=function(t){for(var e=0,r=0;r>0]=t[r],r+=1}function ta(t,e){for(var r=0;r>0]=t[r]}function Ia(t,e,r){for(var i=0;i>0]=t.charCodeAt(i);r||(y[e>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(t){cb.unshift(t)},e.addOnPreMain=function(t){db.unshift(t)},e.addOnExit=function(t){H.unshift(t)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(t){for(var e=[],r=0;r>>16)*i+r*(e>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(t){t>>>=0;for(var e=0;e<32;e++)if(t&1<<31-e)return e;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(t,e){H.push(function(){n.L("vi",t,[e])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(t,e){wb.p||(wb.p={}),t in wb.p||(n.L("v",e),wb.p[t]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(t,e){for(var r=0,i=t.length-1;0<=i;i--){var n=t[i];"."===n?t.splice(i,1):".."===n?(t.splice(i,1),r++):r&&(t.splice(i,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function zb(t){var e="/"===t.charAt(0),r="/"===t.substr(-1);return(t=yb(t.split("/").filter(function(t){return!!t}),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t}function Ab(t){var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=e[0],e=e[1],t||e?(e&&(e=e.substr(0,e.length-1)),t+e):"."}function Bb(t){if("/"===t)return"/";var e=t.lastIndexOf("/");return-1===e?t:t.substr(e+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(t,e){return zb(t+"/"+e)}function Db(){for(var t="",e=!1,r=arguments.length-1;-1<=r&&!e;r--){if("string"!=typeof(e=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!e)return"";t=e+"/"+t,e="/"===e.charAt(0)}return(e?"/":"")+(t=yb(t.split("/").filter(function(t){return!!t}),!e).join("/"))||"."}var Eb=[];function Fb(t,e){Eb[t]={input:[],output:[],N:e},Gb(t,Hb)}var Hb={open:function(t){var e=Eb[t.g.rdev];if(!e)throw new L(J.ha);t.tty=e,t.seekable=!1},close:function(t){t.tty.N.flush(t.tty)},flush:function(t){t.tty.N.flush(t.tty)},read:function(t,e,r,i){if(!t.tty||!t.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;ot.e.length&&(t.e=M.cb(t),t.o=t.e.length),!t.e||t.e.subarray){var r=t.e?t.e.buffer.byteLength:0;e<=r||(e=Math.max(e,r*(r<1048576?2:1.125)|0),0!=r&&(e=Math.max(e,256)),r=t.e,t.e=new Uint8Array(e),0e)t.e.length=e;else for(;t.e.length=t.g.o)return 0;if(assert(0<=(t=Math.min(t.g.o-n,i))),8>1)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}return e.mode},B:function(t){for(var e=[];t.parent!==t;)e.push(t.name),t=t.parent;return e.push(t.A.pa.root),e.reverse(),Cb.apply(null,e)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(t){if((t&=-32769)in P.Ha)return P.Ha[t];throw new L(J.q)},k:{D:function(t){var e;t=P.B(t);try{e=fs.lstatSync(t)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}return P.$&&!e.K&&(e.K=4096),P.$&&!e.blocks&&(e.blocks=(e.size+e.K-1)/e.K|0),{dev:e.dev,ino:e.ino,mode:e.mode,nlink:e.nlink,uid:e.uid,gid:e.gid,rdev:e.rdev,size:e.size,atime:e.atime,mtime:e.mtime,ctime:e.ctime,K:e.K,blocks:e.blocks}},u:function(t,e){var r=P.B(t);try{void 0!==e.mode&&(fs.chmodSync(r,e.mode),t.mode=e.mode),void 0!==e.size&&fs.truncateSync(r,e.size)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},lookup:function(t,e){var r=K(P.B(t),e);r=P.Ja(r);return P.createNode(t,e,r)},T:function(t,e,r,i){t=P.createNode(t,e,r,i),e=P.B(t);try{N(t.mode)?fs.mkdirSync(e,t.mode):fs.writeFileSync(e,"",{mode:t.mode})}catch(t){if(!t.code)throw t;throw new L(J[t.code])}return t},rename:function(t,e,r){t=P.B(t),e=K(P.B(e),r);try{fs.renameSync(t,e)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},unlink:function(t,e){var r=K(P.B(t),e);try{fs.unlinkSync(r)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},rmdir:function(t,e){var r=K(P.B(t),e);try{fs.rmdirSync(r)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},readdir:function(t){t=P.B(t);try{return fs.readdirSync(t)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},symlink:function(t,e,r){t=K(P.B(t),e);try{fs.symlinkSync(r,t)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},readlink:function(t){var e=P.B(t);try{return e=fs.readlinkSync(e),e=Ob.relative(Ob.resolve(t.A.pa.root),e)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}}},n:{open:function(t){var e=P.B(t.g);try{32768==(61440&t.g.mode)&&(t.V=fs.openSync(e,P.$a(t.flags)))}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},close:function(t){try{32768==(61440&t.g.mode)&&t.V&&fs.closeSync(t.V)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},read:function(t,e,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(t.V,a,0,i,n)}catch(t){throw new L(J[t.code])}if(0>>0)%Q.length}function Xb(t){var e=Wb(t.parent.id,t.name);t.M=Q[e],Q[e]=t}function Nb(t,e){var r;if(r=(r=Yb(t,"x"))?r:t.k.lookup?0:J.da)throw new L(r,t);for(r=Q[Wb(t.id,e)];r;r=r.M){var i=r.name;if(r.parent.id===t.id&&i===e)return r}return t.k.lookup(t,e)}function Lb(t,e,r,i){return Zb||((Zb=function(t,e,r,i){t||(t=this),this.parent=t,this.A=t.A,this.U=null,this.id=Sb++,this.name=e,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(t){t?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(t){t?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(t=new Zb(t,e,r,i)),t}function N(t){return 16384==(61440&t)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(t,e){return Tb?0:(-1===e.indexOf("r")||292&t.mode)&&(-1===e.indexOf("w")||146&t.mode)&&(-1===e.indexOf("x")||73&t.mode)?0:J.da}function ac(t,e){try{return Nb(t,e),J.wa}catch(t){}return Yb(t,"wx")}function bc(){for(var t=0;t<=4096;t++)if(!Rb[t])return t;throw new L(J.Sa)}function cc(t){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(t){this.g=t}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var e,r=new dc;for(e in t)r[e]=t[e];return t=r,r=bc(),t.fd=r,Rb[r]=t}var Kb={open:function(t){t.n=Qb[t.g.rdev].n,t.n.open&&t.n.open(t)},G:function(){throw new L(J.ia)}},qc;function Gb(t,e){Qb[t]={n:e}}function ec(t,e){var r,i="/"===e,n=!e;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(e=(r=S(e,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:t,pa:{},Oa:e,lb:[]};var o=t.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(t,e,r){var i=S(t,{parent:!0}).g;if(!(t=Bb(t))||"."===t||".."===t)throw new L(J.q);var n=ac(i,t);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,t,e,r)}function gc(t,e){return e=4095&(void 0!==e?e:438),fc(t,e|=32768,0)}function V(t,e){return e=1023&(void 0!==e?e:511),fc(t,e|=16384,0)}function hc(t,e,r){return void 0===r&&(r=e,e=438),fc(t,8192|e,r)}function ic(t,e){if(!Db(t))throw new L(J.F);var r=S(e,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(e),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,t)}function Vb(t){if(!(t=S(t).g))throw new L(J.F);if(!t.k.readlink)throw new L(J.q);return Db(T(t.parent),t.k.readlink(t))}function jc(t,e){var r;if(!(r="string"==typeof t?S(t,{la:!0}).g:t).k.u)throw new L(J.I);r.k.u(r,{mode:4095&e|-4096&r.mode,timestamp:Date.now()})}function kc(r,t){var i,n,o;if(""===r)throw new L(J.F);if("string"==typeof t){if(void 0===(n=$b[t]))throw Error("Unknown file open mode: "+t)}else n=t;if(i=64&(t=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof r)o=r;else{r=zb(r);try{o=S(r,{la:!(131072&t)}).g}catch(t){}}if(n=!1,64&t)if(o){if(128&t)throw new L(J.wa)}else o=fc(r,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(t&=-513),65536&t&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&t)||512&t)?J.P:(i=["r","w","rw"][3&t],512&t&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&t){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}t&=-641,(o=cc({g:o,path:T(o),flags:t,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&t||(lc||(lc={}),r in lc||(lc[r]=1,e.printErr("read file: "+r)));try{R.onOpenFile&&(a=0,1!=(2097155&t)&&(a|=1),0!=(2097155&t)&&(a|=2),R.onOpenFile(r,a))}catch(t){console.log("FS.trackingDelegate['onOpenFile']('"+r+"', flags) threw an exception: "+t.message)}return o}function mc(t){t.na&&(t.na=null);try{t.n.close&&t.n.close(t)}catch(t){throw t}finally{Rb[t.fd]=null}}function nc(t,e,r){if(!t.seekable||!t.n.G)throw new L(J.ia);t.position=t.n.G(t,e,r),t.tb=[]}function oc(t,e,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&t.flags))throw new L(J.ea);if(N(t.g.mode))throw new L(J.P);if(!t.n.write)throw new L(J.q);1024&t.flags&&nc(t,0,2);var a=!0;if(void 0===n)n=t.position,a=!1;else if(!t.seekable)throw new L(J.ia);e=t.n.write(t,e,r,i,n,o),a||(t.position+=e);try{t.path&&R.onWriteToFile&&R.onWriteToFile(t.path)}catch(t){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+t.message)}return e}function pc(){L||((L=function(t,e){this.g=e,this.qb=function(t){for(var e in this.S=t,J)if(J[e]===t){this.code=e;break}},this.qb(t),this.message=xb[t]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(t){Mb[t]=new L(t),Mb[t].stack=""}))}function rc(t,e){var r=0;return t&&(r|=365),e&&(r|=146),r}function sc(t,e,r,i){return gc(t=K("string"==typeof t?t:T(t),e),rc(r,i))}function tc(t,e,r,i,n,o){if(n=gc(t=e?K("string"==typeof t?t:T(t),e):t,i=rc(i,n)),r){if("string"==typeof r){t=Array(r.length),e=0;for(var a=r.length;e>2]}function xc(){var t;if(t=X(),!(t=Rb[t]))throw new L(J.ea);return t}var yc={};function Ga(t){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var e=r;return 0==t||Ga.bb(t)?e:4294967295}e._i64Add=zc;var Ac=1;function Cc(t,e){if(Dc=t,Ec=e,!Fc)return 1;if(0==t)Y=function(){setTimeout(Gc,e)},Hc="timeout";else if(1==t)Y=function(){Ic(Gc)},Hc="rAF";else if(2==t){if(!window.setImmediate){var r=[];window.addEventListener("message",function(t){t.source===window&&"__emcc"===t.data&&(t.stopPropagation(),r.shift()())},!0),window.setImmediate=function(t){r.push(t),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var l=Lc;if(Gc=function(){if(!na)if(0>r-6&63;r=r-6,t=t+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&e)<<4],t+="=="):4==r&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&e)<<2],t+="="),u.src="data:audio/x-"+a.substr(-3)+";base64,"+t,s(u)}},u.src=n,ad(function(){s(u)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(t){!Tc&&r.sa&&(r.sa(),t.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(t){t()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(t){var e=Date.now();if(0===kd)kd=e+1e3/60;else for(;kd<=e+2;)kd+=1e3/60;e=Math.max(kd-e,0),setTimeout(t,e)}function Ic(t){"undefined"==typeof window?ld(t):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(t))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(t){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[t.substr(t.lastIndexOf(".")+1)]}function md(t,e,r){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?e(i.response):r()},i.onerror=r,i.send(null)}function nd(e,r,t){md(e,function(t){assert(t,'Loading data file "'+e+'" failed (no arrayBuffer).'),r(new Uint8Array(t)),lb()},function(){if(!t)throw'Loading data file "'+e+'" failed.';t()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var r=e.canvas;od.forEach(function(t){t(r.width,r.height)})}function gd(){if("undefined"!=typeof SDL){var t=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|t}pd()}function hd(){if("undefined"!=typeof SDL){var t=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&t}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0this.length-1||t<0)){var e=t%this.chunkSize;return this.gb(t/this.chunkSize|0)[e]}},a.prototype.pb=function(t){this.gb=t},a.prototype.Ca=function(){var t=new XMLHttpRequest;if(t.open("HEAD",l,!1),t.send(null),!(200<=t.status&&t.status<300||304===t.status))throw Error("Couldn't load "+l+". Status: "+t.status);var e,o=Number(t.getResponseHeader("Content-length")),a=1048576;(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e||(a=o);var s=this;s.pb(function(t){var e=t*a,r=(t+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[t]){var i=s.Y;if(r=(t=t.g.e).length)return 0;if(assert(0<=(i=Math.min(t.length-n,i))),t.slice)for(var o=0;o>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(t){return void 0!==vc&&t instanceof L||x(t),-t.S}},___syscall6:function(t,e){wc=e;try{return mc(xc()),0}catch(t){return void 0!==vc&&t instanceof L||x(t),-t.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(t){var e;tb.p--,ub.push(t);t:{if(t&&!vb[t])for(e in vb)if(vb[e].wd===t)break t;e=t}return e&&vb[e].Sd++,t},_emscripten_memcpy_big:function(t,e,r){return E.set(E.subarray(e,e+r),t),t},_sysconf:function(t){switch(t){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(t){return yc[t]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(t){return 0==t?J.q:(C[t>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(t,e){return t in yc?(yc[t]=e,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(t){var e=Date.now()/1e3|0;return t&&(C[t>>2]=e),e},___syscall140:function(t,e){wc=e;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(t){return void 0!==vc&&t instanceof L||x(t),-t.S}},___syscall146:function(t,e){wc=e;try{var r,i=xc(),n=X();t:{for(var o=X(),a=0,s=0;s>2],C[n+(8*s+4)>>2],void 0);if(l<0){r=-1;break t}a+=l}r=a}return r}catch(t){return void 0!==vc&&t instanceof L||x(t),-t.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(t,e,r){"use asm";var i=t.Int8Array;var n=t.Int16Array;var o=t.Int32Array;var a=t.Uint8Array;var s=t.Uint16Array;var l=t.Uint32Array;var u=t.Float32Array;var h=t.Float64Array;var pt=new i(r);var $=new n(r);var dt=new o(r);var mt=new a(r);var gt=new s(r);var c=new l(r);var f=new u(r);var tt=new h(r);var p=t.byteLength;var vt=e.STACKTOP|0;var d=e.STACK_MAX|0;var et=e.tempDoublePtr|0;var m=e.ABORT|0;var g=e.cttz_i8|0;var v=0;var _=0;var y=0;var b=0;var x=t.NaN,w=t.Infinity;var T=0,k=0,S=0,P=0,C=0.0,A=0,E=0,I=0,O=0.0;var rt=0;var M=0;var D=0;var z=0;var R=0;var F=0;var j=0;var L=0;var N=0;var B=0;var U=t.Math.floor;var X=t.Math.abs;var H=t.Math.sqrt;var q=t.Math.pow;var W=t.Math.cos;var G=t.Math.sin;var V=t.Math.tan;var Y=t.Math.acos;var Z=t.Math.asin;var J=t.Math.atan;var K=t.Math.atan2;var Q=t.Math.exp;var it=t.Math.log;var nt=t.Math.ceil;var _t=t.Math.imul;var ot=t.Math.min;var at=t.Math.clz32;var st=e.abort;var lt=e.assert;var ut=e.invoke_iiii;var ht=e.invoke_viiiii;var ct=e.invoke_vi;var ft=e.invoke_ii;var yt=e.invoke_viii;var bt=e.invoke_v;var xt=e.invoke_viiiiii;var wt=e.invoke_iiiiii;var Tt=e.invoke_viiii;var kt=e._pthread_cleanup_pop;var St=e.___syscall54;var Pt=e.___syscall6;var Ct=e._emscripten_set_main_loop_timing;var At=e.__ZSt18uncaught_exceptionv;var Et=e.___setErrNo;var It=e._sbrk;var Ot=e.___cxa_begin_catch;var Mt=e._emscripten_memcpy_big;var Dt=e._sysconf;var zt=e._pthread_getspecific;var Rt=e._pthread_self;var Ft=e._pthread_once;var jt=e._pthread_key_create;var Lt=e.___unlock;var Nt=e._emscripten_set_main_loop;var Bt=e._pthread_setspecific;var Ut=e.___lock;var Xt=e._abort;var Ht=e._pthread_cleanup_push;var qt=e._time;var Wt=e.___syscall140;var Gt=e.___syscall146;var Vt=0.0;function Yt(t){if(p(t)&16777215||p(t)<=16777215||p(t)>2147483648)return false;pt=new i(t);$=new n(t);dt=new o(t);mt=new a(t);gt=new s(t);c=new l(t);f=new u(t);tt=new h(t);r=t;return true}function Zt(t){t=t|0;var e=0;e=vt;vt=vt+t|0;vt=vt+15&-16;return e|0}function Jt(){return vt|0}function Kt(t){t=t|0;vt=t}function Qt(t,e){t=t|0;e=e|0;vt=t;d=e}function $t(t,e){t=t|0;e=e|0;if(!v){v=t;_=e}}function te(t){t=t|0;pt[et>>0]=pt[t>>0];pt[et+1>>0]=pt[t+1>>0];pt[et+2>>0]=pt[t+2>>0];pt[et+3>>0]=pt[t+3>>0]}function ee(t){t=t|0;pt[et>>0]=pt[t>>0];pt[et+1>>0]=pt[t+1>>0];pt[et+2>>0]=pt[t+2>>0];pt[et+3>>0]=pt[t+3>>0];pt[et+4>>0]=pt[t+4>>0];pt[et+5>>0]=pt[t+5>>0];pt[et+6>>0]=pt[t+6>>0];pt[et+7>>0]=pt[t+7>>0]}function re(t){t=t|0;rt=t}function ie(){return rt|0}function ne(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0;m=vt;vt=vt+608|0;f=m+88|0;c=m+72|0;l=m+64|0;s=m+48|0;a=m+24|0;o=m;h=m+96|0;p=m+92|0;u=t+4|0;d=t+8|0;if((dt[u>>2]|0)>>>0>(dt[d>>2]|0)>>>0){dt[o>>2]=1154;dt[o+4>>2]=2120;dt[o+8>>2]=1133;br(h,1100,o)|0;yr(h,m+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=e>>>0){dt[a>>2]=1154;dt[a+4>>2]=2121;dt[a+8>>2]=1169;br(h,1100,a)|0;yr(h,m+40|0)|0}a=dt[d>>2]|0;if(a>>>0>=e>>>0){d=1;vt=m;return d|0}do{if(r){if(e){o=e+-1|0;if(!(o&e)){o=11;break}else e=o}else e=-1;e=e>>>16|e;e=e>>>8|e;e=e>>>4|e;e=e>>>2|e;e=(e>>>1|e)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!e){e=0;o=12}else o=11;if((o|0)==11)if(e>>>0<=a>>>0)o=12;if((o|0)==12){dt[s>>2]=1154;dt[s+4>>2]=2130;dt[s+8>>2]=1217;br(h,1100,s)|0;yr(h,l)|0}r=_t(e,i)|0;do{if(!n){o=oe(dt[t>>2]|0,r,p,1)|0;if(!o){d=0;vt=m;return d|0}else{dt[t>>2]=o;break}}else{a=ae(r,p)|0;if(!a){d=0;vt=m;return d|0}Ii[n&0](a,dt[t>>2]|0,dt[u>>2]|0);o=dt[t>>2]|0;do{if(o)if(!(o&7)){Di[dt[104>>2]&1](o,0,0,1,dt[27]|0)|0;break}else{dt[c>>2]=1154;dt[c+4>>2]=2499;dt[c+8>>2]=1516;br(h,1100,c)|0;yr(h,f)|0;break}}while(0);dt[t>>2]=a}}while(0);o=dt[p>>2]|0;if(o>>>0>r>>>0)e=(o>>>0)/(i>>>0)|0;dt[d>>2]=e;d=1;vt=m;return d|0}function oe(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0;u=vt;vt=vt+592|0;l=u+48|0;o=u+24|0;n=u;s=u+72|0;a=u+68|0;if(t&7){dt[n>>2]=1154;dt[n+4>>2]=2499;dt[n+8>>2]=1494;br(s,1100,n)|0;yr(s,u+16|0)|0;l=0;vt=u;return l|0}if(e>>>0>2147418112){dt[o>>2]=1154;dt[o+4>>2]=2499;dt[o+8>>2]=1387;br(s,1100,o)|0;yr(s,u+40|0)|0;l=0;vt=u;return l|0}dt[a>>2]=e;i=Di[dt[104>>2]&1](t,e,a,i,dt[27]|0)|0;if(r)dt[r>>2]=dt[a>>2];if(!(i&7)){l=i;vt=u;return l|0}dt[l>>2]=1154;dt[l+4>>2]=2551;dt[l+8>>2]=1440;br(s,1100,l)|0;yr(s,u+64|0)|0;l=i;vt=u;return l|0}function ae(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0;l=vt;vt=vt+592|0;a=l+48|0;s=l+24|0;r=l;o=l+72|0;n=l+68|0;i=t+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){dt[r>>2]=1154;dt[r+4>>2]=2499;dt[r+8>>2]=1387;br(o,1100,r)|0;yr(o,l+16|0)|0;s=0;vt=l;return s|0}dt[n>>2]=i;r=Di[dt[104>>2]&1](0,i,n,1,dt[27]|0)|0;t=dt[n>>2]|0;if(e)dt[e>>2]=t;if((r|0)==0|t>>>0>>0){dt[s>>2]=1154;dt[s+4>>2]=2499;dt[s+8>>2]=1413;br(o,1100,s)|0;yr(o,l+40|0)|0;s=0;vt=l;return s|0}if(!(r&7)){s=r;vt=l;return s|0}dt[a>>2]=1154;dt[a+4>>2]=2526;dt[a+8>>2]=1440;br(o,1100,a)|0;yr(o,l+64|0)|0;s=r;vt=l;return s|0}function se(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,C=0,A=0,E=0,I=0,O=0,M=0,D=0,z=0,R=0,F=0,j=0,L=0;L=vt;vt=vt+960|0;R=L+232|0;z=L+216|0;D=L+208|0;M=L+192|0;O=L+184|0;I=L+168|0;E=L+160|0;A=L+144|0;S=L+136|0;k=L+120|0;T=L+112|0;w=L+96|0;y=L+88|0;_=L+72|0;v=L+64|0;g=L+48|0;c=L+40|0;p=L+24|0;f=L+16|0;h=L;C=L+440|0;F=L+376|0;j=L+304|0;m=L+236|0;if((e|0)==0|i>>>0>11){t=0;vt=L;return t|0}dt[t>>2]=e;n=j;o=n+68|0;do{dt[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=pt[r+o>>0]|0;if(n<<24>>24){P=j+((n&255)<<2)|0;dt[P>>2]=(dt[P>>2]|0)+1}o=o+1|0}while((o|0)!=(e|0));o=0;u=1;a=0;s=-1;l=0;while(1){n=dt[j+(u<<2)>>2]|0;if(!n)dt[t+28+(u+-1<<2)>>2]=0;else{P=u+-1|0;dt[F+(P<<2)>>2]=o;o=n+o|0;x=16-u|0;dt[t+28+(P<<2)>>2]=(o+-1<>2]=l;dt[m+(u<<2)>>2]=l;a=a>>>0>u>>>0?a:u;s=s>>>0>>0?s:u;l=n+l|0}u=u+1|0;if((u|0)==17){P=a;break}else o=o<<1}dt[t+4>>2]=l;o=t+172|0;do{if(l>>>0>(dt[o>>2]|0)>>>0){dt[o>>2]=l;if(l){n=l+-1|0;if(n&l)d=14}else{n=-1;d=14}if((d|0)==14){x=n>>>16|n;x=x>>>8|x;x=x>>>4|x;x=x>>>2|x;x=(x>>>1|x)+1|0;dt[o>>2]=x>>>0>e>>>0?e:x}a=t+176|0;n=dt[a>>2]|0;do{if(n){x=dt[n+-4>>2]|0;n=n+-8|0;if(!((x|0)!=0?(x|0)==(~dt[n>>2]|0):0)){dt[h>>2]=1154;dt[h+4>>2]=644;dt[h+8>>2]=1863;br(C,1100,h)|0;yr(C,f)|0}if(!(n&7)){Di[dt[104>>2]&1](n,0,0,1,dt[27]|0)|0;break}else{dt[p>>2]=1154;dt[p+4>>2]=2499;dt[p+8>>2]=1516;br(C,1100,p)|0;yr(C,c)|0;break}}}while(0);o=dt[o>>2]|0;o=(o|0)!=0?o:1;n=ae((o<<1)+8|0,0)|0;if(!n){dt[a>>2]=0;n=0;break}else{dt[n+4>>2]=o;dt[n>>2]=~o;dt[a>>2]=n+8;d=25;break}}else d=25}while(0);t:do{if((d|0)==25){x=t+24|0;pt[x>>0]=s;pt[t+25>>0]=P;o=t+176|0;a=0;do{b=pt[r+a>>0]|0;n=b&255;if(b<<24>>24){if(!(dt[j+(n<<2)>>2]|0)){dt[g>>2]=1154;dt[g+4>>2]=2273;dt[g+8>>2]=1261;br(C,1100,g)|0;yr(C,v)|0}b=m+(n<<2)|0;n=dt[b>>2]|0;dt[b>>2]=n+1;if(n>>>0>=l>>>0){dt[_>>2]=1154;dt[_+4>>2]=2277;dt[_+8>>2]=1274;br(C,1100,_)|0;yr(C,y)|0}$[(dt[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(e|0));n=pt[x>>0]|0;y=(n&255)>>>0>>0?i:0;b=t+8|0;dt[b>>2]=y;_=(y|0)!=0;if(_){v=1<>>0>(dt[n>>2]|0)>>>0){dt[n>>2]=v;a=t+168|0;n=dt[a>>2]|0;do{if(n){g=dt[n+-4>>2]|0;n=n+-8|0;if(!((g|0)!=0?(g|0)==(~dt[n>>2]|0):0)){dt[w>>2]=1154;dt[w+4>>2]=644;dt[w+8>>2]=1863;br(C,1100,w)|0;yr(C,T)|0}if(!(n&7)){Di[dt[104>>2]&1](n,0,0,1,dt[27]|0)|0;break}else{dt[k>>2]=1154;dt[k+4>>2]=2499;dt[k+8>>2]=1516;br(C,1100,k)|0;yr(C,S)|0;break}}}while(0);n=v<<2;o=ae(n+8|0,0)|0;if(!o){dt[a>>2]=0;n=0;break t}else{S=o+8|0;dt[o+4>>2]=v;dt[o>>2]=~v;dt[a>>2]=S;o=S;break}}else{o=t+168|0;n=v<<2;a=o;o=dt[o>>2]|0}}while(0);Yr(o|0,-1,n|0)|0;d=t+176|0;g=1;do{if(dt[j+(g<<2)>>2]|0){e=y-g|0;m=1<>2]|0;if(o>>>0>=16){dt[A>>2]=1154;dt[A+4>>2]=1953;dt[A+8>>2]=1737;br(C,1100,A)|0;yr(C,E)|0}n=dt[t+28+(o<<2)>>2]|0;if(!n)p=-1;else p=(n+-1|0)>>>(16-g|0);if(s>>>0<=p>>>0){c=(dt[t+96+(o<<2)>>2]|0)-s|0;f=g<<16;do{n=gt[(dt[d>>2]|0)+(c+s<<1)>>1]|0;if((mt[r+n>>0]|0|0)!=(g|0)){dt[I>>2]=1154;dt[I+4>>2]=2319;dt[I+8>>2]=1303;br(C,1100,I)|0;yr(C,O)|0}h=s<>>0>=v>>>0){dt[M>>2]=1154;dt[M+4>>2]=2325;dt[M+8>>2]=1337;br(C,1100,M)|0;yr(C,D)|0}n=dt[a>>2]|0;if((dt[n+(l<<2)>>2]|0)!=-1){dt[z>>2]=1154;dt[z+4>>2]=2327;dt[z+8>>2]=1360;br(C,1100,z)|0;yr(C,R)|0;n=dt[a>>2]|0}dt[n+(l<<2)>>2]=o;u=u+1|0}while(u>>>0>>0);s=s+1|0}while(s>>>0<=p>>>0)}}g=g+1|0}while(y>>>0>=g>>>0);n=pt[x>>0]|0}o=t+96|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F>>2]|0);o=t+100|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+4>>2]|0);o=t+104|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+8>>2]|0);o=t+108|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+12>>2]|0);o=t+112|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+16>>2]|0);o=t+116|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+20>>2]|0);o=t+120|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+24>>2]|0);o=t+124|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+28>>2]|0);o=t+128|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+32>>2]|0);o=t+132|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+36>>2]|0);o=t+136|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+40>>2]|0);o=t+140|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+44>>2]|0);o=t+144|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+48>>2]|0);o=t+148|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+52>>2]|0);o=t+152|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+56>>2]|0);o=t+156|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+60>>2]|0);o=t+16|0;dt[o>>2]=0;a=t+20|0;dt[a>>2]=n&255;e:do{if(_){while(1){if(!i)break e;n=i+-1|0;if(!(dt[j+(i<<2)>>2]|0))i=n;else break}dt[o>>2]=dt[t+28+(n<<2)>>2];n=y+1|0;dt[a>>2]=n;if(n>>>0<=P>>>0){while(1){if(dt[j+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>P>>>0)break e}dt[a>>2]=n}}}while(0);dt[t+92>>2]=-1;dt[t+160>>2]=1048575;dt[t+12>>2]=32-(dt[b>>2]|0);n=1}}while(0);t=n;vt=L;return t|0}function le(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0;if(!t){n=Br(e)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=Hr(n)|0;dt[r>>2]=o;r=n;return r|0}if(!e){Ur(t);if(!r){r=0;return r|0}dt[r>>2]=0;r=0;return r|0}n=Xr(t,e)|0;o=(n|0)!=0;if(o|i^1)o=o?n:t;else{n=Xr(t,e)|0;o=(n|0)==0?t:n}if(!r){r=n;return r|0}e=Hr(o)|0;dt[r>>2]=e;r=n;return r|0}function ue(t,e,r){t=t|0;e=e|0;r=r|0;var i=0;if(!((t|0)!=0&e>>>0>73&(r|0)!=0)){r=0;return r|0}if((dt[r>>2]|0)!=40|e>>>0<74){r=0;return r|0}if(((mt[t>>0]|0)<<8|(mt[t+1>>0]|0)|0)!=18552){r=0;return r|0}if(((mt[t+2>>0]|0)<<8|(mt[t+3>>0]|0))>>>0<74){r=0;return r|0}if(((mt[t+7>>0]|0)<<16|(mt[t+6>>0]|0)<<24|(mt[t+8>>0]|0)<<8|(mt[t+9>>0]|0))>>>0>e>>>0){r=0;return r|0}dt[r+4>>2]=(mt[t+12>>0]|0)<<8|(mt[t+13>>0]|0);dt[r+8>>2]=(mt[t+14>>0]|0)<<8|(mt[t+15>>0]|0);dt[r+12>>2]=mt[t+16>>0];dt[r+16>>2]=mt[t+17>>0];e=t+18|0;i=r+32|0;dt[i>>2]=mt[e>>0];dt[i+4>>2]=0;e=pt[e>>0]|0;dt[r+20>>2]=e<<24>>24==0|e<<24>>24==9?8:16;dt[r+24>>2]=(mt[t+26>>0]|0)<<16|(mt[t+25>>0]|0)<<24|(mt[t+27>>0]|0)<<8|(mt[t+28>>0]|0);dt[r+28>>2]=(mt[t+30>>0]|0)<<16|(mt[t+29>>0]|0)<<24|(mt[t+31>>0]|0)<<8|(mt[t+32>>0]|0);r=1;return r|0}function he(t){t=t|0;Ot(t|0)|0;Ue()}function ce(t){t=t|0;var e=0,r=0,i=0,n=0,o=0;o=vt;vt=vt+544|0;n=o;i=o+24|0;e=dt[t+20>>2]|0;if(e)fe(e);e=t+4|0;r=dt[e>>2]|0;if(!r){n=t+16|0;pt[n>>0]=0;vt=o;return}if(!(r&7))Di[dt[104>>2]&1](r,0,0,1,dt[27]|0)|0;else{dt[n>>2]=1154;dt[n+4>>2]=2499;dt[n+8>>2]=1516;br(i,1100,n)|0;yr(i,o+16|0)|0}dt[e>>2]=0;dt[t+8>>2]=0;dt[t+12>>2]=0;n=t+16|0;pt[n>>0]=0;vt=o;return}function fe(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0;p=vt;vt=vt+640|0;f=p+112|0;c=p+96|0;h=p+88|0;u=p+72|0;l=p+64|0;s=p+48|0;i=p+40|0;o=p+24|0;n=p+16|0;r=p;a=p+120|0;if(!t){vt=p;return}e=dt[t+168>>2]|0;do{if(e){d=dt[e+-4>>2]|0;e=e+-8|0;if(!((d|0)!=0?(d|0)==(~dt[e>>2]|0):0)){dt[r>>2]=1154;dt[r+4>>2]=644;dt[r+8>>2]=1863;br(a,1100,r)|0;yr(a,n)|0}if(!(e&7)){Di[dt[104>>2]&1](e,0,0,1,dt[27]|0)|0;break}else{dt[o>>2]=1154;dt[o+4>>2]=2499;dt[o+8>>2]=1516;br(a,1100,o)|0;yr(a,i)|0;break}}}while(0);e=dt[t+176>>2]|0;do{if(e){d=dt[e+-4>>2]|0;e=e+-8|0;if(!((d|0)!=0?(d|0)==(~dt[e>>2]|0):0)){dt[s>>2]=1154;dt[s+4>>2]=644;dt[s+8>>2]=1863;br(a,1100,s)|0;yr(a,l)|0}if(!(e&7)){Di[dt[104>>2]&1](e,0,0,1,dt[27]|0)|0;break}else{dt[u>>2]=1154;dt[u+4>>2]=2499;dt[u+8>>2]=1516;br(a,1100,u)|0;yr(a,h)|0;break}}}while(0);if(!(t&7)){Di[dt[104>>2]&1](t,0,0,1,dt[27]|0)|0;vt=p;return}else{dt[c>>2]=1154;dt[c+4>>2]=2499;dt[c+8>>2]=1516;br(a,1100,c)|0;yr(a,f)|0;vt=p;return}}function pe(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0;h=vt;vt=vt+560|0;a=h+40|0;s=h+24|0;e=h;o=h+48|0;n=t+8|0;r=dt[n>>2]|0;if((r+-1|0)>>>0>=8192){dt[e>>2]=1154;dt[e+4>>2]=2997;dt[e+8>>2]=1541;br(o,1100,e)|0;yr(o,h+16|0)|0}dt[t>>2]=r;i=t+20|0;e=dt[i>>2]|0;if(!e){e=ae(180,0)|0;if(!e)e=0;else{u=e+164|0;dt[u>>2]=0;dt[u+4>>2]=0;dt[u+8>>2]=0;dt[u+12>>2]=0}dt[i>>2]=e;u=e;l=dt[t>>2]|0}else{u=e;l=r}if(!(dt[n>>2]|0)){dt[s>>2]=1154;dt[s+4>>2]=903;dt[s+8>>2]=1781;br(o,1100,s)|0;yr(o,a)|0;o=dt[t>>2]|0}else o=l;n=dt[t+4>>2]|0;if(o>>>0>16){r=o;e=0}else{t=0;u=se(u,l,n,t)|0;vt=h;return u|0}while(1){i=e+1|0;if(r>>>0>3){r=r>>>1;e=i}else{r=i;break}}t=e+2+((r|0)!=32&1<>>0>>0&1)|0;t=t>>>0<11?t&255:11;u=se(u,l,n,t)|0;vt=h;return u|0}function de(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,C=0,A=0,E=0,I=0,O=0,M=0,D=0,z=0,R=0;R=vt;vt=vt+800|0;I=R+256|0;E=R+240|0;A=R+232|0;C=R+216|0;P=R+208|0;S=R+192|0;k=R+184|0;T=R+168|0;w=R+160|0;x=R+144|0;b=R+136|0;y=R+120|0;_=R+112|0;v=R+96|0;g=R+88|0;m=R+72|0;c=R+64|0;h=R+48|0;s=R+40|0;l=R+24|0;o=R+16|0;n=R;D=R+288|0;z=R+264|0;O=me(t,14)|0;if(!O){dt[e>>2]=0;r=e+4|0;i=dt[r>>2]|0;if(i){if(!(i&7))Di[dt[104>>2]&1](i,0,0,1,dt[27]|0)|0;else{dt[n>>2]=1154;dt[n+4>>2]=2499;dt[n+8>>2]=1516;br(D,1100,n)|0;yr(D,o)|0}dt[r>>2]=0;dt[e+8>>2]=0;dt[e+12>>2]=0}pt[e+16>>0]=0;r=e+20|0;i=dt[r>>2]|0;if(!i){e=1;vt=R;return e|0}fe(i);dt[r>>2]=0;e=1;vt=R;return e|0}p=e+4|0;d=e+8|0;r=dt[d>>2]|0;if((r|0)!=(O|0)){if(r>>>0<=O>>>0){do{if((dt[e+12>>2]|0)>>>0>>0){if(ne(p,O,(r+1|0)==(O|0),1,0)|0){r=dt[d>>2]|0;break}pt[e+16>>0]=1;e=0;vt=R;return e|0}}while(0);Yr((dt[p>>2]|0)+r|0,0,O-r|0)|0}dt[d>>2]=O}Yr(dt[p>>2]|0,0,O|0)|0;f=t+20|0;r=dt[f>>2]|0;if((r|0)<5){o=t+4|0;a=t+8|0;n=t+16|0;do{i=dt[o>>2]|0;if((i|0)==(dt[a>>2]|0))i=0;else{dt[o>>2]=i+1;i=mt[i>>0]|0}r=r+8|0;dt[f>>2]=r;if((r|0)>=33){dt[l>>2]=1154;dt[l+4>>2]=3199;dt[l+8>>2]=1650;br(D,1100,l)|0;yr(D,s)|0;r=dt[f>>2]|0}i=i<<32-r|dt[n>>2];dt[n>>2]=i}while((r|0)<5)}else{i=t+16|0;n=i;i=dt[i>>2]|0}u=i>>>27;dt[n>>2]=i<<5;dt[f>>2]=r+-5;if((u+-1|0)>>>0>20){e=0;vt=R;return e|0}dt[z+20>>2]=0;dt[z>>2]=0;dt[z+4>>2]=0;dt[z+8>>2]=0;dt[z+12>>2]=0;pt[z+16>>0]=0;r=z+4|0;i=z+8|0;t:do{if(ne(r,21,0,1,0)|0){s=dt[i>>2]|0;l=dt[r>>2]|0;Yr(l+s|0,0,21-s|0)|0;dt[i>>2]=21;if(u){n=t+4|0;o=t+8|0;a=t+16|0;s=0;do{r=dt[f>>2]|0;if((r|0)<3)do{i=dt[n>>2]|0;if((i|0)==(dt[o>>2]|0))i=0;else{dt[n>>2]=i+1;i=mt[i>>0]|0}r=r+8|0;dt[f>>2]=r;if((r|0)>=33){dt[h>>2]=1154;dt[h+4>>2]=3199;dt[h+8>>2]=1650;br(D,1100,h)|0;yr(D,c)|0;r=dt[f>>2]|0}i=i<<32-r|dt[a>>2];dt[a>>2]=i}while((r|0)<3);else i=dt[a>>2]|0;dt[a>>2]=i<<3;dt[f>>2]=r+-3;pt[l+(mt[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(u|0))}if(pe(z)|0){s=t+4|0;l=t+8|0;u=t+16|0;i=0;e:while(1){a=O-i|0;r=ge(t,z)|0;r:do{if(r>>>0<17){if((dt[d>>2]|0)>>>0<=i>>>0){dt[m>>2]=1154;dt[m+4>>2]=903;dt[m+8>>2]=1781;br(D,1100,m)|0;yr(D,g)|0}pt[(dt[p>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=dt[f>>2]|0;if((r|0)<3)do{n=dt[s>>2]|0;if((n|0)==(dt[l>>2]|0))n=0;else{dt[s>>2]=n+1;n=mt[n>>0]|0}r=r+8|0;dt[f>>2]=r;if((r|0)>=33){dt[v>>2]=1154;dt[v+4>>2]=3199;dt[v+8>>2]=1650;br(D,1100,v)|0;yr(D,_)|0;r=dt[f>>2]|0}n=n<<32-r|dt[u>>2];dt[u>>2]=n}while((r|0)<3);else n=dt[u>>2]|0;dt[u>>2]=n<<3;dt[f>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break t}r=r+i|0;break r}case 18:{r=dt[f>>2]|0;if((r|0)<7)do{n=dt[s>>2]|0;if((n|0)==(dt[l>>2]|0))n=0;else{dt[s>>2]=n+1;n=mt[n>>0]|0}r=r+8|0;dt[f>>2]=r;if((r|0)>=33){dt[y>>2]=1154;dt[y+4>>2]=3199;dt[y+8>>2]=1650;br(D,1100,y)|0;yr(D,b)|0;r=dt[f>>2]|0}n=n<<32-r|dt[u>>2];dt[u>>2]=n}while((r|0)<7);else n=dt[u>>2]|0;dt[u>>2]=n<<7;dt[f>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break t}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){M=90;break e}o=dt[f>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=dt[s>>2]|0;if((r|0)==(dt[l>>2]|0))o=0;else{dt[s>>2]=r+1;o=mt[r>>0]|0}r=n+8|0;dt[f>>2]=r;if((r|0)>=33){dt[x>>2]=1154;dt[x+4>>2]=3199;dt[x+8>>2]=1650;br(D,1100,x)|0;yr(D,w)|0;r=dt[f>>2]|0}n=o<<32-r|dt[u>>2];dt[u>>2]=n;if((r|0)<2)n=r;else break}}else{n=dt[u>>2]|0;r=o}dt[u>>2]=n<<2;dt[f>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=dt[s>>2]|0;if((r|0)==(dt[l>>2]|0))o=0;else{dt[s>>2]=r+1;o=mt[r>>0]|0}r=n+8|0;dt[f>>2]=r;if((r|0)>=33){dt[T>>2]=1154;dt[T+4>>2]=3199;dt[T+8>>2]=1650;br(D,1100,T)|0;yr(D,k)|0;r=dt[f>>2]|0}n=o<<32-r|dt[u>>2];dt[u>>2]=n;if((r|0)<6)n=r;else break}}else{n=dt[u>>2]|0;r=o}dt[u>>2]=n<<6;dt[f>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break t}r=i+-1|0;if((dt[d>>2]|0)>>>0<=r>>>0){dt[S>>2]=1154;dt[S+4>>2]=903;dt[S+8>>2]=1781;br(D,1100,S)|0;yr(D,P)|0}n=pt[(dt[p>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break t}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((dt[d>>2]|0)>>>0<=i>>>0){dt[C>>2]=1154;dt[C+4>>2]=903;dt[C+8>>2]=1781;br(D,1100,C)|0;yr(D,A)|0}pt[(dt[p>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(O>>>0>r>>>0)i=r;else break}if((M|0)==90){dt[E>>2]=1154;dt[E+4>>2]=3140;dt[E+8>>2]=1632;br(D,1100,E)|0;yr(D,I)|0;r=0;break}if((O|0)==(r|0))r=pe(e)|0;else r=0}else r=0}else{pt[z+16>>0]=1;r=0}}while(0);ce(z);e=r;vt=R;return e|0}function me(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0;h=vt;vt=vt+544|0;s=h+16|0;a=h;o=h+24|0;if(!e){u=0;vt=h;return u|0}if(e>>>0<=16){u=ve(t,e)|0;vt=h;return u|0}l=ve(t,e+-16|0)|0;u=t+20|0;e=dt[u>>2]|0;if((e|0)<16){i=t+4|0;n=t+8|0;r=t+16|0;do{t=dt[i>>2]|0;if((t|0)==(dt[n>>2]|0))t=0;else{dt[i>>2]=t+1;t=mt[t>>0]|0}e=e+8|0;dt[u>>2]=e;if((e|0)>=33){dt[a>>2]=1154;dt[a+4>>2]=3199;dt[a+8>>2]=1650;br(o,1100,a)|0;yr(o,s)|0;e=dt[u>>2]|0}t=t<<32-e|dt[r>>2];dt[r>>2]=t}while((e|0)<16)}else{t=t+16|0;r=t;t=dt[t>>2]|0}dt[r>>2]=t<<16;dt[u>>2]=e+-16;u=t>>>16|l<<16;vt=h;return u|0}function ge(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0;y=vt;vt=vt+608|0;m=y+88|0;d=y+72|0;f=y+64|0;c=y+48|0;h=y+40|0;p=y+24|0;u=y+16|0;l=y;v=y+96|0;g=dt[e+20>>2]|0;_=t+20|0;s=dt[_>>2]|0;do{if((s|0)<24){a=t+4|0;i=dt[a>>2]|0;n=dt[t+8>>2]|0;r=i>>>0>>0;if((s|0)>=16){if(r){dt[a>>2]=i+1;r=mt[i>>0]|0}else r=0;dt[_>>2]=s+8;a=t+16|0;o=r<<24-s|dt[a>>2];dt[a>>2]=o;break}if(r){o=(mt[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0>>0){i=mt[r>>0]|0;r=r+1|0}else i=0;dt[a>>2]=r;dt[_>>2]=s+16;a=t+16|0;o=(i|o)<<16-s|dt[a>>2];dt[a>>2]=o}else{o=t+16|0;a=o;o=dt[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(dt[g+16>>2]|0)>>>0){i=dt[(dt[g+168>>2]|0)+(o>>>(32-(dt[g+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){dt[l>>2]=1154;dt[l+4>>2]=3244;dt[l+8>>2]=1677;br(v,1100,l)|0;yr(v,u)|0}r=i&65535;i=i>>>16;if((dt[e+8>>2]|0)>>>0<=r>>>0){dt[p>>2]=1154;dt[p+4>>2]=902;dt[p+8>>2]=1781;br(v,1100,p)|0;yr(v,h)|0}if((mt[(dt[e+4>>2]|0)+r>>0]|0|0)!=(i|0)){dt[c>>2]=1154;dt[c+4>>2]=3248;dt[c+8>>2]=1694;br(v,1100,c)|0;yr(v,f)|0}}else{i=dt[g+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(dt[g+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(dt[g+96+(r<<2)>>2]|0)|0;if(r>>>0<(dt[e>>2]|0)>>>0){r=gt[(dt[g+176>>2]|0)+(r<<1)>>1]|0;break}dt[d>>2]=1154;dt[d+4>>2]=3266;dt[d+8>>2]=1632;br(v,1100,d)|0;yr(v,m)|0;_=0;vt=y;return _|0}}while(0);dt[a>>2]=dt[a>>2]<>2]=(dt[_>>2]|0)-i;_=r;vt=y;return _|0}function ve(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0;h=vt;vt=vt+560|0;s=h+40|0;l=h+24|0;r=h;a=h+48|0;if(e>>>0>=33){dt[r>>2]=1154;dt[r+4>>2]=3190;dt[r+8>>2]=1634;br(a,1100,r)|0;yr(a,h+16|0)|0}u=t+20|0;r=dt[u>>2]|0;if((r|0)>=(e|0)){o=t+16|0;a=o;o=dt[o>>2]|0;s=r;l=32-e|0;l=o>>>l;o=o<>2]=o;e=s-e|0;dt[u>>2]=e;vt=h;return l|0}n=t+4|0;o=t+8|0;i=t+16|0;do{t=dt[n>>2]|0;if((t|0)==(dt[o>>2]|0))t=0;else{dt[n>>2]=t+1;t=mt[t>>0]|0}r=r+8|0;dt[u>>2]=r;if((r|0)>=33){dt[l>>2]=1154;dt[l+4>>2]=3199;dt[l+8>>2]=1650;br(a,1100,l)|0;yr(a,s)|0;r=dt[u>>2]|0}t=t<<32-r|dt[i>>2];dt[i>>2]=t}while((r|0)<(e|0));l=32-e|0;l=t>>>l;s=t<>2]=s;e=r-e|0;dt[u>>2]=e;vt=h;return l|0}function _e(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0;d=vt;vt=vt+544|0;f=d+16|0;c=d;h=d+24|0;if((t|0)==0|e>>>0<62){p=0;vt=d;return p|0}u=ae(300,0)|0;if(!u){p=0;vt=d;return p|0}dt[u>>2]=519686845;r=u+4|0;dt[r>>2]=0;i=u+8|0;dt[i>>2]=0;l=u+88|0;n=u+136|0;o=u+160|0;a=l;s=a+44|0;do{dt[a>>2]=0;a=a+4|0}while((a|0)<(s|0));pt[l+44>>0]=0;m=u+184|0;a=u+208|0;s=u+232|0;g=u+252|0;dt[g>>2]=0;dt[g+4>>2]=0;dt[g+8>>2]=0;pt[g+12>>0]=0;g=u+268|0;dt[g>>2]=0;dt[g+4>>2]=0;dt[g+8>>2]=0;pt[g+12>>0]=0;g=u+284|0;dt[g>>2]=0;dt[g+4>>2]=0;dt[g+8>>2]=0;pt[g+12>>0]=0;dt[n>>2]=0;dt[n+4>>2]=0;dt[n+8>>2]=0;dt[n+12>>2]=0;dt[n+16>>2]=0;pt[n+20>>0]=0;dt[o>>2]=0;dt[o+4>>2]=0;dt[o+8>>2]=0;dt[o+12>>2]=0;dt[o+16>>2]=0;pt[o+20>>0]=0;dt[m>>2]=0;dt[m+4>>2]=0;dt[m+8>>2]=0;dt[m+12>>2]=0;dt[m+16>>2]=0;pt[m+20>>0]=0;dt[a>>2]=0;dt[a+4>>2]=0;dt[a+8>>2]=0;dt[a+12>>2]=0;dt[a+16>>2]=0;pt[a+20>>0]=0;dt[s>>2]=0;dt[s+4>>2]=0;dt[s+8>>2]=0;dt[s+12>>2]=0;pt[s+16>>0]=0;do{if(((e>>>0>=74?((mt[t>>0]|0)<<8|(mt[t+1>>0]|0)|0)==18552:0)?((mt[t+2>>0]|0)<<8|(mt[t+3>>0]|0))>>>0>=74:0)?((mt[t+7>>0]|0)<<16|(mt[t+6>>0]|0)<<24|(mt[t+8>>0]|0)<<8|(mt[t+9>>0]|0))>>>0<=e>>>0:0){dt[l>>2]=t;dt[r>>2]=t;dt[i>>2]=e;if(Ce(u)|0){r=dt[l>>2]|0;if((mt[r+39>>0]|0)<<8|(mt[r+40>>0]|0)){if(!(Ae(u)|0))break;if(!(Ee(u)|0))break;r=dt[l>>2]|0}if(!((mt[r+55>>0]|0)<<8|(mt[r+56>>0]|0))){g=u;vt=d;return g|0}if(Ie(u)|0?Oe(u)|0:0){g=u;vt=d;return g|0}}}else p=7}while(0);if((p|0)==7)dt[l>>2]=0;Fe(u);if(!(u&7)){Di[dt[104>>2]&1](u,0,0,1,dt[27]|0)|0;g=0;vt=d;return g|0}else{dt[c>>2]=1154;dt[c+4>>2]=2499;dt[c+8>>2]=1516;br(h,1100,c)|0;yr(h,f)|0;g=0;vt=d;return g|0}return 0}function ye(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,h=0;h=vt;vt=vt+544|0;u=h;l=h+24|0;o=dt[t+88>>2]|0;s=(mt[o+70+(n<<2)+1>>0]|0)<<16|(mt[o+70+(n<<2)>>0]|0)<<24|(mt[o+70+(n<<2)+2>>0]|0)<<8|(mt[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(mt[o+16>>0]|0)>>>0)o=(mt[o+70+(a<<2)+1>>0]|0)<<16|(mt[o+70+(a<<2)>>0]|0)<<24|(mt[o+70+(a<<2)+2>>0]|0)<<8|(mt[o+70+(a<<2)+3>>0]|0);else o=dt[t+8>>2]|0;if(o>>>0>s>>>0){l=t+4|0;l=dt[l>>2]|0;l=l+s|0;u=o-s|0;u=be(t,l,u,e,r,i,n)|0;vt=h;return u|0}dt[u>>2]=1154;dt[u+4>>2]=3704;dt[u+8>>2]=1792;br(l,1100,u)|0;yr(l,h+16|0)|0;l=t+4|0;l=dt[l>>2]|0;l=l+s|0;u=o-s|0;u=be(t,l,u,e,r,i,n)|0;vt=h;return u|0}function be(t,e,r,i,n,o,a){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,l=0,u=0,h=0;h=dt[t+88>>2]|0;l=((mt[h+12>>0]|0)<<8|(mt[h+13>>0]|0))>>>a;u=((mt[h+14>>0]|0)<<8|(mt[h+15>>0]|0))>>>a;l=l>>>0>1?(l+3|0)>>>2:1;u=u>>>0>1?(u+3|0)>>>2:1;h=h+18|0;a=pt[h>>0]|0;a=_t(a<<24>>24==0|a<<24>>24==9?8:16,l)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{t=0;return t|0}if((_t(a,u)|0)>>>0>n>>>0){t=0;return t|0}o=(l+1|0)>>>1;s=(u+1|0)>>>1;if(!r){t=0;return t|0}dt[t+92>>2]=e;dt[t+96>>2]=e;dt[t+104>>2]=r;dt[t+100>>2]=e+r;dt[t+108>>2]=0;dt[t+112>>2]=0;switch(mt[h>>0]|0|0){case 0:{Me(t,i,n,a,l,u,o,s)|0;t=1;return t|0}case 4:case 6:case 5:case 3:case 2:{De(t,i,n,a,l,u,o,s)|0;t=1;return t|0}case 9:{ze(t,i,n,a,l,u,o,s)|0;t=1;return t|0}case 8:case 7:{Re(t,i,n,a,l,u,o,s)|0;t=1;return t|0}default:{t=0;return t|0}}return 0}function xe(t,e){t=t|0;e=e|0;var r=0,i=0;i=vt;vt=vt+48|0;r=i;dt[r>>2]=40;ue(t,e,r)|0;vt=i;return dt[r+4>>2]|0}function we(t,e){t=t|0;e=e|0;var r=0,i=0;i=vt;vt=vt+48|0;r=i;dt[r>>2]=40;ue(t,e,r)|0;vt=i;return dt[r+8>>2]|0}function Te(t,e){t=t|0;e=e|0;var r=0,i=0;i=vt;vt=vt+48|0;r=i;dt[r>>2]=40;ue(t,e,r)|0;vt=i;return dt[r+12>>2]|0}function ke(t,e){t=t|0;e=e|0;var r=0,i=0;i=vt;vt=vt+48|0;r=i;dt[r>>2]=40;ue(t,e,r)|0;vt=i;return dt[r+32>>2]|0}function Se(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,l=0,u=0;l=vt;vt=vt+576|0;a=l+56|0;o=l+40|0;n=l+64|0;u=l;dt[u>>2]=40;ue(t,e,u)|0;i=(((dt[u+4>>2]|0)>>>r)+3|0)>>>2;e=(((dt[u+8>>2]|0)>>>r)+3|0)>>>2;r=u+32|0;t=dt[r+4>>2]|0;do{switch(dt[r>>2]|0){case 0:{if(!t)t=8;else s=13;break}case 1:{if(!t)s=12;else s=13;break}case 2:{if(!t)s=12;else s=13;break}case 3:{if(!t)s=12;else s=13;break}case 4:{if(!t)s=12;else s=13;break}case 5:{if(!t)s=12;else s=13;break}case 6:{if(!t)s=12;else s=13;break}case 7:{if(!t)s=12;else s=13;break}case 8:{if(!t)s=12;else s=13;break}case 9:{if(!t)t=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)t=16;else if((s|0)==13){dt[o>>2]=1154;dt[o+4>>2]=2663;dt[o+8>>2]=1535;br(n,1100,o)|0;yr(n,a)|0;t=0}u=_t(_t(e,i)|0,t)|0;vt=l;return u|0}function Pe(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0;d=vt;vt=vt+608|0;f=d+80|0;p=d+64|0;s=d+56|0;a=d+40|0;h=d+88|0;m=d;c=d+84|0;dt[m>>2]=40;ue(t,e,m)|0;l=(((dt[m+4>>2]|0)>>>n)+3|0)>>>2;m=m+32|0;o=dt[m+4>>2]|0;do{switch(dt[m>>2]|0){case 0:{if(!o)o=8;else u=13;break}case 1:{if(!o)u=12;else u=13;break}case 2:{if(!o)u=12;else u=13;break}case 3:{if(!o)u=12;else u=13;break}case 4:{if(!o)u=12;else u=13;break}case 5:{if(!o)u=12;else u=13;break}case 6:{if(!o)u=12;else u=13;break}case 7:{if(!o)u=12;else u=13;break}case 8:{if(!o)u=12;else u=13;break}case 9:{if(!o)o=8;else u=13;break}default:u=13}}while(0);if((u|0)==12)o=16;else if((u|0)==13){dt[a>>2]=1154;dt[a+4>>2]=2663;dt[a+8>>2]=1535;br(h,1100,a)|0;yr(h,s)|0;o=0}s=_t(o,l)|0;a=_e(t,e)|0;dt[c>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(dt[a>>2]|0)==519686845:0)ye(a,c,i,s,n)|0;if(o){vt=d;return}if((dt[a>>2]|0)!=519686845){vt=d;return}Fe(a);if(!(a&7)){Di[dt[104>>2]&1](a,0,0,1,dt[27]|0)|0;vt=d;return}else{dt[p>>2]=1154;dt[p+4>>2]=2499;dt[p+8>>2]=1516;br(h,1100,p)|0;yr(h,f)|0;vt=d;return}}function Ce(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0;a=t+92|0;i=dt[t+4>>2]|0;o=t+88|0;n=dt[o>>2]|0;e=(mt[n+68>>0]|0)<<8|(mt[n+67>>0]|0)<<16|(mt[n+69>>0]|0);r=i+e|0;n=(mt[n+65>>0]|0)<<8|(mt[n+66>>0]|0);if(!n){t=0;return t|0}dt[a>>2]=r;dt[t+96>>2]=r;dt[t+104>>2]=n;dt[t+100>>2]=i+(n+e);dt[t+108>>2]=0;dt[t+112>>2]=0;if(!(de(a,t+116|0)|0)){t=0;return t|0}e=dt[o>>2]|0;do{if(!((mt[e+39>>0]|0)<<8|(mt[e+40>>0]|0))){if(!((mt[e+55>>0]|0)<<8|(mt[e+56>>0]|0))){t=0;return t|0}}else{if(!(de(a,t+140|0)|0)){t=0;return t|0}if(de(a,t+188|0)|0){e=dt[o>>2]|0;break}else{t=0;return t|0}}}while(0);if((mt[e+55>>0]|0)<<8|(mt[e+56>>0]|0)){if(!(de(a,t+164|0)|0)){t=0;return t|0}if(!(de(a,t+212|0)|0)){t=0;return t|0}}t=1;return t|0}function Ae(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0;d=vt;vt=vt+592|0;l=d+16|0;s=d;a=d+72|0;p=d+24|0;i=t+88|0;e=dt[i>>2]|0;f=(mt[e+39>>0]|0)<<8|(mt[e+40>>0]|0);h=t+236|0;o=t+240|0;r=dt[o>>2]|0;if((r|0)!=(f|0)){if(r>>>0<=f>>>0){do{if((dt[t+244>>2]|0)>>>0>>0){if(ne(h,f,(r+1|0)==(f|0),4,0)|0){e=dt[o>>2]|0;break}pt[t+248>>0]=1;p=0;vt=d;return p|0}else e=r}while(0);Yr((dt[h>>2]|0)+(e<<2)|0,0,f-e<<2|0)|0;e=dt[i>>2]|0}dt[o>>2]=f}u=t+92|0;r=dt[t+4>>2]|0;i=(mt[e+34>>0]|0)<<8|(mt[e+33>>0]|0)<<16|(mt[e+35>>0]|0);n=r+i|0;e=(mt[e+37>>0]|0)<<8|(mt[e+36>>0]|0)<<16|(mt[e+38>>0]|0);if(!e){p=0;vt=d;return p|0}dt[u>>2]=n;dt[t+96>>2]=n;dt[t+104>>2]=e;dt[t+100>>2]=r+(e+i);dt[t+108>>2]=0;dt[t+112>>2]=0;dt[p+20>>2]=0;dt[p>>2]=0;dt[p+4>>2]=0;dt[p+8>>2]=0;dt[p+12>>2]=0;pt[p+16>>0]=0;t=p+24|0;dt[p+44>>2]=0;dt[t>>2]=0;dt[t+4>>2]=0;dt[t+8>>2]=0;dt[t+12>>2]=0;pt[t+16>>0]=0;if(de(u,p)|0?(c=p+24|0,de(u,c)|0):0){if(!(dt[o>>2]|0)){dt[s>>2]=1154;dt[s+4>>2]=903;dt[s+8>>2]=1781;br(a,1100,s)|0;yr(a,l)|0}if(!f)e=1;else{i=0;n=0;o=0;e=0;a=0;t=0;s=0;r=dt[h>>2]|0;while(1){i=(ge(u,p)|0)+i&31;n=(ge(u,c)|0)+n&63;o=(ge(u,p)|0)+o&31;e=(ge(u,p)|0)+e|0;a=(ge(u,c)|0)+a&63;t=(ge(u,p)|0)+t&31;dt[r>>2]=n<<5|i<<11|o|e<<27|a<<21|t<<16;s=s+1|0;if((s|0)==(f|0)){e=1;break}else{e=e&31;r=r+4|0}}}}else e=0;ce(p+24|0);ce(p);p=e;vt=d;return p|0}function Ee(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,C=0;S=vt;vt=vt+1024|0;s=S+16|0;a=S;o=S+504|0;k=S+480|0;w=S+284|0;T=S+88|0;x=S+24|0;n=dt[t+88>>2]|0;b=(mt[n+47>>0]|0)<<8|(mt[n+48>>0]|0);y=t+92|0;e=dt[t+4>>2]|0;r=(mt[n+42>>0]|0)<<8|(mt[n+41>>0]|0)<<16|(mt[n+43>>0]|0);i=e+r|0;n=(mt[n+45>>0]|0)<<8|(mt[n+44>>0]|0)<<16|(mt[n+46>>0]|0);if(!n){k=0;vt=S;return k|0}dt[y>>2]=i;dt[t+96>>2]=i;dt[t+104>>2]=n;dt[t+100>>2]=e+(n+r);dt[t+108>>2]=0;dt[t+112>>2]=0;dt[k+20>>2]=0;dt[k>>2]=0;dt[k+4>>2]=0;dt[k+8>>2]=0;dt[k+12>>2]=0;pt[k+16>>0]=0;if(de(y,k)|0){r=0;i=-3;n=-3;while(1){dt[w+(r<<2)>>2]=i;dt[T+(r<<2)>>2]=n;e=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=e?-3:i+1|0;n=(e&1)+n|0}}e=x;r=e+64|0;do{dt[e>>2]=0;e=e+4|0}while((e|0)<(r|0));_=t+252|0;r=t+256|0;e=dt[r>>2]|0;t:do{if((e|0)==(b|0))l=13;else{if(e>>>0<=b>>>0){do{if((dt[t+260>>2]|0)>>>0>>0)if(ne(_,b,(e+1|0)==(b|0),4,0)|0){e=dt[r>>2]|0;break}else{pt[t+264>>0]=1;e=0;break t}}while(0);Yr((dt[_>>2]|0)+(e<<2)|0,0,b-e<<2|0)|0}dt[r>>2]=b;l=13}}while(0);do{if((l|0)==13){if(!b){dt[a>>2]=1154;dt[a+4>>2]=903;dt[a+8>>2]=1781;br(o,1100,a)|0;yr(o,s)|0;e=1;break}i=x+4|0;n=x+8|0;t=x+12|0;o=x+16|0;a=x+20|0;s=x+24|0;l=x+28|0;u=x+32|0;h=x+36|0;c=x+40|0;f=x+44|0;p=x+48|0;d=x+52|0;m=x+56|0;g=x+60|0;v=0;r=dt[_>>2]|0;while(1){e=0;do{P=ge(y,k)|0;_=e<<1;C=x+(_<<2)|0;dt[C>>2]=(dt[C>>2]|0)+(dt[w+(P<<2)>>2]|0)&3;_=x+((_|1)<<2)|0;dt[_>>2]=(dt[_>>2]|0)+(dt[T+(P<<2)>>2]|0)&3;e=e+1|0}while((e|0)!=8);dt[r>>2]=(mt[1725+(dt[i>>2]|0)>>0]|0)<<2|(mt[1725+(dt[x>>2]|0)>>0]|0)|(mt[1725+(dt[n>>2]|0)>>0]|0)<<4|(mt[1725+(dt[t>>2]|0)>>0]|0)<<6|(mt[1725+(dt[o>>2]|0)>>0]|0)<<8|(mt[1725+(dt[a>>2]|0)>>0]|0)<<10|(mt[1725+(dt[s>>2]|0)>>0]|0)<<12|(mt[1725+(dt[l>>2]|0)>>0]|0)<<14|(mt[1725+(dt[u>>2]|0)>>0]|0)<<16|(mt[1725+(dt[h>>2]|0)>>0]|0)<<18|(mt[1725+(dt[c>>2]|0)>>0]|0)<<20|(mt[1725+(dt[f>>2]|0)>>0]|0)<<22|(mt[1725+(dt[p>>2]|0)>>0]|0)<<24|(mt[1725+(dt[d>>2]|0)>>0]|0)<<26|(mt[1725+(dt[m>>2]|0)>>0]|0)<<28|(mt[1725+(dt[g>>2]|0)>>0]|0)<<30;v=v+1|0;if((v|0)==(b|0)){e=1;break}else r=r+4|0}}}while(0)}else e=0;ce(k);C=e;vt=S;return C|0}function Ie(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0;f=vt;vt=vt+560|0;l=f+16|0;s=f;a=f+48|0;c=f+24|0;n=dt[t+88>>2]|0;h=(mt[n+55>>0]|0)<<8|(mt[n+56>>0]|0);u=t+92|0;e=dt[t+4>>2]|0;r=(mt[n+50>>0]|0)<<8|(mt[n+49>>0]|0)<<16|(mt[n+51>>0]|0);i=e+r|0;n=(mt[n+53>>0]|0)<<8|(mt[n+52>>0]|0)<<16|(mt[n+54>>0]|0);if(!n){c=0;vt=f;return c|0}dt[u>>2]=i;dt[t+96>>2]=i;dt[t+104>>2]=n;dt[t+100>>2]=e+(n+r);dt[t+108>>2]=0;dt[t+112>>2]=0;dt[c+20>>2]=0;dt[c>>2]=0;dt[c+4>>2]=0;dt[c+8>>2]=0;dt[c+12>>2]=0;pt[c+16>>0]=0;t:do{if(de(u,c)|0){o=t+268|0;r=t+272|0;e=dt[r>>2]|0;if((e|0)!=(h|0)){if(e>>>0<=h>>>0){do{if((dt[t+276>>2]|0)>>>0>>0)if(ne(o,h,(e+1|0)==(h|0),2,0)|0){e=dt[r>>2]|0;break}else{pt[t+280>>0]=1;e=0;break t}}while(0);Yr((dt[o>>2]|0)+(e<<1)|0,0,h-e<<1|0)|0}dt[r>>2]=h}if(!h){dt[s>>2]=1154;dt[s+4>>2]=903;dt[s+8>>2]=1781;br(a,1100,s)|0;yr(a,l)|0;e=1;break}r=0;i=0;n=0;e=dt[o>>2]|0;while(1){l=ge(u,c)|0;r=l+r&255;i=(ge(u,c)|0)+i&255;$[e>>1]=i<<8|r;n=n+1|0;if((n|0)==(h|0)){e=1;break}else e=e+2|0}}else e=0}while(0);ce(c);c=e;vt=f;return c|0}function Oe(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,C=0;S=vt;vt=vt+2432|0;s=S+16|0;a=S;o=S+1912|0;k=S+1888|0;w=S+988|0;T=S+88|0;x=S+24|0;n=dt[t+88>>2]|0;b=(mt[n+63>>0]|0)<<8|(mt[n+64>>0]|0);y=t+92|0;e=dt[t+4>>2]|0;r=(mt[n+58>>0]|0)<<8|(mt[n+57>>0]|0)<<16|(mt[n+59>>0]|0);i=e+r|0;n=(mt[n+61>>0]|0)<<8|(mt[n+60>>0]|0)<<16|(mt[n+62>>0]|0);if(!n){k=0;vt=S;return k|0}dt[y>>2]=i;dt[t+96>>2]=i;dt[t+104>>2]=n;dt[t+100>>2]=e+(n+r);dt[t+108>>2]=0;dt[t+112>>2]=0;dt[k+20>>2]=0;dt[k>>2]=0;dt[k+4>>2]=0;dt[k+8>>2]=0;dt[k+12>>2]=0;pt[k+16>>0]=0;if(de(y,k)|0){r=0;i=-7;n=-7;while(1){dt[w+(r<<2)>>2]=i;dt[T+(r<<2)>>2]=n;e=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=e?-7:i+1|0;n=(e&1)+n|0}}e=x;r=e+64|0;do{dt[e>>2]=0;e=e+4|0}while((e|0)<(r|0));_=t+284|0;r=b*3|0;i=t+288|0;e=dt[i>>2]|0;t:do{if((e|0)==(r|0))l=13;else{if(e>>>0<=r>>>0){do{if((dt[t+292>>2]|0)>>>0>>0)if(ne(_,r,(e+1|0)==(r|0),2,0)|0){e=dt[i>>2]|0;break}else{pt[t+296>>0]=1;e=0;break t}}while(0);Yr((dt[_>>2]|0)+(e<<1)|0,0,r-e<<1|0)|0}dt[i>>2]=r;l=13}}while(0);do{if((l|0)==13){if(!b){dt[a>>2]=1154;dt[a+4>>2]=903;dt[a+8>>2]=1781;br(o,1100,a)|0;yr(o,s)|0;e=1;break}i=x+4|0;n=x+8|0;t=x+12|0;o=x+16|0;a=x+20|0;s=x+24|0;l=x+28|0;u=x+32|0;h=x+36|0;c=x+40|0;f=x+44|0;p=x+48|0;d=x+52|0;m=x+56|0;g=x+60|0;v=0;r=dt[_>>2]|0;while(1){e=0;do{P=ge(y,k)|0;_=e<<1;C=x+(_<<2)|0;dt[C>>2]=(dt[C>>2]|0)+(dt[w+(P<<2)>>2]|0)&7;_=x+((_|1)<<2)|0;dt[_>>2]=(dt[_>>2]|0)+(dt[T+(P<<2)>>2]|0)&7;e=e+1|0}while((e|0)!=8);P=mt[1729+(dt[a>>2]|0)>>0]|0;$[r>>1]=(mt[1729+(dt[i>>2]|0)>>0]|0)<<3|(mt[1729+(dt[x>>2]|0)>>0]|0)|(mt[1729+(dt[n>>2]|0)>>0]|0)<<6|(mt[1729+(dt[t>>2]|0)>>0]|0)<<9|(mt[1729+(dt[o>>2]|0)>>0]|0)<<12|P<<15;C=mt[1729+(dt[c>>2]|0)>>0]|0;$[r+2>>1]=(mt[1729+(dt[s>>2]|0)>>0]|0)<<2|P>>>1|(mt[1729+(dt[l>>2]|0)>>0]|0)<<5|(mt[1729+(dt[u>>2]|0)>>0]|0)<<8|(mt[1729+(dt[h>>2]|0)>>0]|0)<<11|C<<14;$[r+4>>1]=(mt[1729+(dt[f>>2]|0)>>0]|0)<<1|C>>>2|(mt[1729+(dt[p>>2]|0)>>0]|0)<<4|(mt[1729+(dt[d>>2]|0)>>0]|0)<<7|(mt[1729+(dt[m>>2]|0)>>0]|0)<<10|(mt[1729+(dt[g>>2]|0)>>0]|0)<<13;v=v+1|0;if((v|0)==(b|0)){e=1;break}else r=r+6|0}}}while(0)}else e=0;ce(k);C=e;vt=S;return C|0}function Me(t,e,r,i,n,o,a,s){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,C=0,A=0,E=0,I=0,O=0,M=0,D=0,z=0,R=0,F=0,j=0,L=0,N=0,B=0,U=0,X=0,H=0,q=0,W=0,G=0,V=0,Y=0,Z=0,J=0,K=0,Q=0,$=0,tt=0,et=0,rt=0,it=0,nt=0,ot=0,at=0,st=0,lt=0,ut=0,ht=0,ct=0,ft=0;ht=vt;vt=vt+720|0;ut=ht+184|0;st=ht+168|0;at=ht+160|0;ot=ht+144|0;nt=ht+136|0;it=ht+120|0;rt=ht+112|0;tt=ht+96|0;$=ht+88|0;Q=ht+72|0;K=ht+64|0;J=ht+48|0;Z=ht+40|0;lt=ht+24|0;et=ht+16|0;Y=ht;G=ht+208|0;V=ht+192|0;N=t+240|0;B=dt[N>>2]|0;H=t+256|0;q=dt[H>>2]|0;r=pt[(dt[t+88>>2]|0)+17>>0]|0;W=i>>>2;if(!(r<<24>>24)){vt=ht;return 1}U=(s|0)==0;X=s+-1|0;M=(o&1|0)!=0;D=i<<1;z=t+92|0;R=t+116|0;F=t+140|0;j=t+236|0;L=a+-1|0;O=(n&1|0)!=0;I=t+188|0;S=t+252|0;P=W+1|0;C=W+2|0;A=W+3|0;E=L<<4;T=r&255;r=0;o=0;n=1;k=0;do{if(!U){x=dt[e+(k<<2)>>2]|0;w=0;while(1){_=w&1;l=(_|0)==0;v=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;b=l?a:-1;u=l?0:L;t=(w|0)==(X|0);y=M&t;if((u|0)!=(b|0)){g=M&t^1;m=l?x:x+E|0;while(1){if((n|0)==1)n=ge(z,R)|0|512;d=n&7;n=n>>>3;l=mt[1823+d>>0]|0;t=0;do{f=(ge(z,F)|0)+o|0;p=f-B|0;o=p>>31;o=o&f|p&~o;if((dt[N>>2]|0)>>>0<=o>>>0){dt[Y>>2]=1154;dt[Y+4>>2]=903;dt[Y+8>>2]=1781;br(G,1100,Y)|0;yr(G,et)|0}dt[V+(t<<2)>>2]=dt[(dt[j>>2]|0)+(o<<2)>>2];t=t+1|0}while(t>>>0>>0);p=O&(u|0)==(L|0);if(y|p){f=0;do{h=_t(f,i)|0;t=m+h|0;l=(f|0)==0|g;c=f<<1;ft=(ge(z,I)|0)+r|0;ct=ft-q|0;r=ct>>31;r=r&ft|ct&~r;do{if(p){if(!l){ct=(ge(z,I)|0)+r|0;ft=ct-q|0;r=ft>>31;r=r&ct|ft&~r;break}dt[t>>2]=dt[V+((mt[1831+(d<<2)+c>>0]|0)<<2)>>2];if((dt[H>>2]|0)>>>0<=r>>>0){dt[ot>>2]=1154;dt[ot+4>>2]=903;dt[ot+8>>2]=1781;br(G,1100,ot)|0;yr(G,at)|0}dt[m+(h+4)>>2]=dt[(dt[S>>2]|0)+(r<<2)>>2];ct=(ge(z,I)|0)+r|0;ft=ct-q|0;r=ft>>31;r=r&ct|ft&~r}else{if(!l){ct=(ge(z,I)|0)+r|0;ft=ct-q|0;r=ft>>31;r=r&ct|ft&~r;break}dt[t>>2]=dt[V+((mt[1831+(d<<2)+c>>0]|0)<<2)>>2];if((dt[H>>2]|0)>>>0<=r>>>0){dt[it>>2]=1154;dt[it+4>>2]=903;dt[it+8>>2]=1781;br(G,1100,it)|0;yr(G,nt)|0}dt[m+(h+4)>>2]=dt[(dt[S>>2]|0)+(r<<2)>>2];ct=(ge(z,I)|0)+r|0;ft=ct-q|0;r=ft>>31;r=r&ct|ft&~r;dt[m+(h+8)>>2]=dt[V+((mt[(c|1)+(1831+(d<<2))>>0]|0)<<2)>>2];if((dt[H>>2]|0)>>>0<=r>>>0){dt[st>>2]=1154;dt[st+4>>2]=903;dt[st+8>>2]=1781;br(G,1100,st)|0;yr(G,ut)|0}dt[m+(h+12)>>2]=dt[(dt[S>>2]|0)+(r<<2)>>2]}}while(0);f=f+1|0}while((f|0)!=2)}else{dt[m>>2]=dt[V+((mt[1831+(d<<2)>>0]|0)<<2)>>2];ct=(ge(z,I)|0)+r|0;ft=ct-q|0;r=ft>>31;r=r&ct|ft&~r;if((dt[H>>2]|0)>>>0<=r>>>0){dt[lt>>2]=1154;dt[lt+4>>2]=903;dt[lt+8>>2]=1781;br(G,1100,lt)|0;yr(G,Z)|0}dt[m+4>>2]=dt[(dt[S>>2]|0)+(r<<2)>>2];dt[m+8>>2]=dt[V+((mt[1831+(d<<2)+1>>0]|0)<<2)>>2];ct=(ge(z,I)|0)+r|0;ft=ct-q|0;r=ft>>31;r=r&ct|ft&~r;if((dt[H>>2]|0)>>>0<=r>>>0){dt[J>>2]=1154;dt[J+4>>2]=903;dt[J+8>>2]=1781;br(G,1100,J)|0;yr(G,K)|0}dt[m+12>>2]=dt[(dt[S>>2]|0)+(r<<2)>>2];dt[m+(W<<2)>>2]=dt[V+((mt[1831+(d<<2)+2>>0]|0)<<2)>>2];ct=(ge(z,I)|0)+r|0;ft=ct-q|0;r=ft>>31;r=r&ct|ft&~r;if((dt[H>>2]|0)>>>0<=r>>>0){dt[Q>>2]=1154;dt[Q+4>>2]=903;dt[Q+8>>2]=1781;br(G,1100,Q)|0;yr(G,$)|0}dt[m+(P<<2)>>2]=dt[(dt[S>>2]|0)+(r<<2)>>2];dt[m+(C<<2)>>2]=dt[V+((mt[1831+(d<<2)+3>>0]|0)<<2)>>2];ct=(ge(z,I)|0)+r|0;ft=ct-q|0;r=ft>>31;r=r&ct|ft&~r;if((dt[H>>2]|0)>>>0<=r>>>0){dt[tt>>2]=1154;dt[tt+4>>2]=903;dt[tt+8>>2]=1781;br(G,1100,tt)|0;yr(G,rt)|0}dt[m+(A<<2)>>2]=dt[(dt[S>>2]|0)+(r<<2)>>2]}u=u+_|0;if((u|0)==(b|0))break;else m=m+v|0}}w=w+1|0;if((w|0)==(s|0))break;else x=x+D|0}}k=k+1|0}while((k|0)!=(T|0));vt=ht;return 1}function De(t,e,r,i,n,o,a,s){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,C=0,A=0,E=0,I=0,O=0,M=0,D=0,z=0,R=0,F=0,j=0,L=0,N=0,B=0,U=0,X=0,H=0,q=0,W=0,G=0,V=0,Y=0,Z=0,J=0,K=0,Q=0,$=0,tt=0,et=0,rt=0,it=0,nt=0,ot=0,at=0,st=0,lt=0,ut=0,ht=0,ct=0,ft=0;ct=vt;vt=vt+640|0;lt=ct+88|0;st=ct+72|0;at=ct+64|0;ot=ct+48|0;nt=ct+40|0;ht=ct+24|0;ut=ct+16|0;it=ct;et=ct+128|0;rt=ct+112|0;tt=ct+96|0;N=t+240|0;B=dt[N>>2]|0;H=t+256|0;K=dt[H>>2]|0;Q=t+272|0;$=dt[Q>>2]|0;r=dt[t+88>>2]|0;U=(mt[r+63>>0]|0)<<8|(mt[r+64>>0]|0);r=pt[r+17>>0]|0;if(!(r<<24>>24)){vt=ct;return 1}X=(s|0)==0;q=s+-1|0;W=i<<1;G=t+92|0;V=t+116|0;Y=a+-1|0;Z=t+212|0;J=t+188|0;L=(n&1|0)==0;j=(o&1|0)==0;O=t+288|0;M=t+284|0;D=t+252|0;z=t+140|0;R=t+236|0;F=t+164|0;E=t+268|0;I=Y<<5;C=r&255;r=0;n=0;o=0;t=0;l=1;A=0;do{if(!X){S=dt[e+(A<<2)>>2]|0;P=0;while(1){T=P&1;u=(T|0)==0;w=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;k=u?a:-1;h=u?0:Y;if((h|0)!=(k|0)){x=j|(P|0)!=(q|0);b=u?S:S+I|0;while(1){if((l|0)==1)l=ge(G,V)|0|512;y=l&7;l=l>>>3;c=mt[1823+y>>0]|0;u=0;do{v=(ge(G,F)|0)+n|0;_=v-$|0;n=_>>31;n=n&v|_&~n;if((dt[Q>>2]|0)>>>0<=n>>>0){dt[it>>2]=1154;dt[it+4>>2]=903;dt[it+8>>2]=1781;br(et,1100,it)|0;yr(et,ut)|0}dt[tt+(u<<2)>>2]=gt[(dt[E>>2]|0)+(n<<1)>>1];u=u+1|0}while(u>>>0>>0);u=0;do{v=(ge(G,z)|0)+t|0;_=v-B|0;t=_>>31;t=t&v|_&~t;if((dt[N>>2]|0)>>>0<=t>>>0){dt[ht>>2]=1154;dt[ht+4>>2]=903;dt[ht+8>>2]=1781;br(et,1100,ht)|0;yr(et,nt)|0}dt[rt+(u<<2)>>2]=dt[(dt[R>>2]|0)+(t<<2)>>2];u=u+1|0}while(u>>>0>>0);_=L|(h|0)!=(Y|0);g=0;v=b;while(1){m=x|(g|0)==0;d=g<<1;f=0;p=v;while(1){c=(ge(G,Z)|0)+r|0;u=c-U|0;r=u>>31;r=r&c|u&~r;u=(ge(G,J)|0)+o|0;c=u-K|0;o=c>>31;o=o&u|c&~o;if((_|(f|0)==0)&m){u=mt[f+d+(1831+(y<<2))>>0]|0;c=r*3|0;if((dt[O>>2]|0)>>>0<=c>>>0){dt[ot>>2]=1154;dt[ot+4>>2]=903;dt[ot+8>>2]=1781;br(et,1100,ot)|0;yr(et,at)|0}ft=dt[M>>2]|0;dt[p>>2]=(gt[ft+(c<<1)>>1]|0)<<16|dt[tt+(u<<2)>>2];dt[p+4>>2]=(gt[ft+(c+2<<1)>>1]|0)<<16|(gt[ft+(c+1<<1)>>1]|0);dt[p+8>>2]=dt[rt+(u<<2)>>2];if((dt[H>>2]|0)>>>0<=o>>>0){dt[st>>2]=1154;dt[st+4>>2]=903;dt[st+8>>2]=1781;br(et,1100,st)|0;yr(et,lt)|0}dt[p+12>>2]=dt[(dt[D>>2]|0)+(o<<2)>>2]}f=f+1|0;if((f|0)==2)break;else p=p+16|0}g=g+1|0;if((g|0)==2)break;else v=v+i|0}h=h+T|0;if((h|0)==(k|0))break;else b=b+w|0}}P=P+1|0;if((P|0)==(s|0))break;else S=S+W|0}}A=A+1|0}while((A|0)!=(C|0));vt=ct;return 1}function ze(t,e,r,i,n,o,a,s){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,C=0,A=0,E=0,I=0,O=0,M=0,D=0,z=0,R=0,F=0,j=0,L=0,N=0,B=0,U=0,X=0,H=0,q=0,W=0,G=0,V=0,Y=0,Z=0,J=0,K=0;K=vt;vt=vt+608|0;Y=K+64|0;V=K+48|0;G=K+40|0;J=K+24|0;Z=K+16|0;W=K;q=K+88|0;H=K+72|0;D=t+272|0;z=dt[D>>2]|0;r=dt[t+88>>2]|0;R=(mt[r+63>>0]|0)<<8|(mt[r+64>>0]|0);r=pt[r+17>>0]|0;if(!(r<<24>>24)){vt=K;return 1}F=(s|0)==0;j=s+-1|0;L=i<<1;N=t+92|0;B=t+116|0;U=a+-1|0;X=t+212|0;M=(o&1|0)==0;E=t+288|0;I=t+284|0;O=t+164|0;C=t+268|0;A=U<<4;P=r&255;S=(n&1|0)!=0;r=0;o=0;t=1;k=0;do{if(!F){w=dt[e+(k<<2)>>2]|0;T=0;while(1){b=T&1;n=(b|0)==0;y=(b<<5^32)+-16|0;b=(b<<1^2)+-1|0;x=n?a:-1;l=n?0:U;if((l|0)!=(x|0)){_=M|(T|0)!=(j|0);v=n?w:w+A|0;while(1){if((t|0)==1)t=ge(N,B)|0|512;g=t&7;t=t>>>3;u=mt[1823+g>>0]|0;n=0;do{d=(ge(N,O)|0)+o|0;m=d-z|0;o=m>>31;o=o&d|m&~o;if((dt[D>>2]|0)>>>0<=o>>>0){dt[W>>2]=1154;dt[W+4>>2]=903;dt[W+8>>2]=1781;br(q,1100,W)|0;yr(q,Z)|0}dt[H+(n<<2)>>2]=gt[(dt[C>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0>>0);m=(l|0)==(U|0)&S;p=0;d=v;while(1){f=_|(p|0)==0;c=p<<1;n=(ge(N,X)|0)+r|0;h=n-R|0;u=h>>31;u=u&n|h&~u;if(f){r=mt[1831+(g<<2)+c>>0]|0;n=u*3|0;if((dt[E>>2]|0)>>>0<=n>>>0){dt[J>>2]=1154;dt[J+4>>2]=903;dt[J+8>>2]=1781;br(q,1100,J)|0;yr(q,G)|0}h=dt[I>>2]|0;dt[d>>2]=(gt[h+(n<<1)>>1]|0)<<16|dt[H+(r<<2)>>2];dt[d+4>>2]=(gt[h+(n+2<<1)>>1]|0)<<16|(gt[h+(n+1<<1)>>1]|0)}h=d+8|0;n=(ge(N,X)|0)+u|0;u=n-R|0;r=u>>31;r=r&n|u&~r;if(!(m|f^1)){n=mt[(c|1)+(1831+(g<<2))>>0]|0;u=r*3|0;if((dt[E>>2]|0)>>>0<=u>>>0){dt[V>>2]=1154;dt[V+4>>2]=903;dt[V+8>>2]=1781;br(q,1100,V)|0;yr(q,Y)|0}f=dt[I>>2]|0;dt[h>>2]=(gt[f+(u<<1)>>1]|0)<<16|dt[H+(n<<2)>>2];dt[d+12>>2]=(gt[f+(u+2<<1)>>1]|0)<<16|(gt[f+(u+1<<1)>>1]|0)}p=p+1|0;if((p|0)==2)break;else d=d+i|0}l=l+b|0;if((l|0)==(x|0))break;else v=v+y|0}}T=T+1|0;if((T|0)==(s|0))break;else w=w+L|0}}k=k+1|0}while((k|0)!=(P|0));vt=K;return 1}function Re(t,e,r,i,n,o,a,s){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,C=0,A=0,E=0,I=0,O=0,M=0,D=0,z=0,R=0,F=0,j=0,L=0,N=0,B=0,U=0,X=0,H=0,q=0,W=0,G=0,V=0,Y=0,Z=0,J=0,K=0,Q=0,$=0,tt=0,et=0,rt=0,it=0,nt=0,ot=0,at=0;at=vt;vt=vt+640|0;it=at+88|0;rt=at+72|0;et=at+64|0;tt=at+48|0;$=at+40|0;ot=at+24|0;nt=at+16|0;Q=at;K=at+128|0;Z=at+112|0;J=at+96|0;N=t+272|0;B=dt[N>>2]|0;r=dt[t+88>>2]|0;U=(mt[r+63>>0]|0)<<8|(mt[r+64>>0]|0);r=pt[r+17>>0]|0;if(!(r<<24>>24)){vt=at;return 1}X=(s|0)==0;H=s+-1|0;q=i<<1;W=t+92|0;G=t+116|0;V=a+-1|0;Y=t+212|0;L=(n&1|0)==0;j=(o&1|0)==0;z=t+288|0;R=t+284|0;F=t+164|0;M=t+268|0;D=V<<5;I=r&255;r=0;n=0;o=0;t=0;l=1;O=0;do{if(!X){A=dt[e+(O<<2)>>2]|0;E=0;while(1){P=E&1;u=(P|0)==0;S=(P<<6^64)+-32|0;P=(P<<1^2)+-1|0;C=u?a:-1;h=u?0:V;if((h|0)!=(C|0)){k=j|(E|0)!=(H|0);T=u?A:A+D|0;while(1){if((l|0)==1)l=ge(W,G)|0|512;w=l&7;l=l>>>3;c=mt[1823+w>>0]|0;u=0;do{b=(ge(W,F)|0)+t|0;x=b-B|0;t=x>>31;t=t&b|x&~t;if((dt[N>>2]|0)>>>0<=t>>>0){dt[Q>>2]=1154;dt[Q+4>>2]=903;dt[Q+8>>2]=1781;br(K,1100,Q)|0;yr(K,nt)|0}dt[Z+(u<<2)>>2]=gt[(dt[M>>2]|0)+(t<<1)>>1];u=u+1|0}while(u>>>0>>0);u=0;do{b=(ge(W,F)|0)+n|0;x=b-B|0;n=x>>31;n=n&b|x&~n;if((dt[N>>2]|0)>>>0<=n>>>0){dt[ot>>2]=1154;dt[ot+4>>2]=903;dt[ot+8>>2]=1781;br(K,1100,ot)|0;yr(K,$)|0}dt[J+(u<<2)>>2]=gt[(dt[M>>2]|0)+(n<<1)>>1];u=u+1|0}while(u>>>0>>0);x=L|(h|0)!=(V|0);y=0;b=T;while(1){_=k|(y|0)==0;v=y<<1;m=0;g=b;while(1){d=(ge(W,Y)|0)+o|0;p=d-U|0;o=p>>31;o=o&d|p&~o;p=(ge(W,Y)|0)+r|0;d=p-U|0;r=d>>31;r=r&p|d&~r;if((x|(m|0)==0)&_){p=mt[m+v+(1831+(w<<2))>>0]|0;d=o*3|0;u=dt[z>>2]|0;if(u>>>0<=d>>>0){dt[tt>>2]=1154;dt[tt+4>>2]=903;dt[tt+8>>2]=1781;br(K,1100,tt)|0;yr(K,et)|0;u=dt[z>>2]|0}c=dt[R>>2]|0;f=r*3|0;if(u>>>0>f>>>0)u=c;else{dt[rt>>2]=1154;dt[rt+4>>2]=903;dt[rt+8>>2]=1781;br(K,1100,rt)|0;yr(K,it)|0;u=dt[R>>2]|0}dt[g>>2]=(gt[c+(d<<1)>>1]|0)<<16|dt[Z+(p<<2)>>2];dt[g+4>>2]=(gt[c+(d+2<<1)>>1]|0)<<16|(gt[c+(d+1<<1)>>1]|0);dt[g+8>>2]=(gt[u+(f<<1)>>1]|0)<<16|dt[J+(p<<2)>>2];dt[g+12>>2]=(gt[u+(f+2<<1)>>1]|0)<<16|(gt[u+(f+1<<1)>>1]|0)}m=m+1|0;if((m|0)==2)break;else g=g+16|0}y=y+1|0;if((y|0)==2)break;else b=b+i|0}h=h+P|0;if((h|0)==(C|0))break;else T=T+S|0}}E=E+1|0;if((E|0)==(s|0))break;else A=A+q|0}}O=O+1|0}while((O|0)!=(I|0));vt=at;return 1}function Fe(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0;f=vt;vt=vt+608|0;c=f+88|0;h=f+72|0;l=f+64|0;s=f+48|0;o=f+40|0;a=f+24|0;n=f+16|0;i=f;u=f+96|0;dt[t>>2]=0;e=t+284|0;r=dt[e>>2]|0;if(r){if(!(r&7))Di[dt[104>>2]&1](r,0,0,1,dt[27]|0)|0;else{dt[i>>2]=1154;dt[i+4>>2]=2499;dt[i+8>>2]=1516;br(u,1100,i)|0;yr(u,n)|0}dt[e>>2]=0;dt[t+288>>2]=0;dt[t+292>>2]=0}pt[t+296>>0]=0;e=t+268|0;r=dt[e>>2]|0;if(r){if(!(r&7))Di[dt[104>>2]&1](r,0,0,1,dt[27]|0)|0;else{dt[a>>2]=1154;dt[a+4>>2]=2499;dt[a+8>>2]=1516;br(u,1100,a)|0;yr(u,o)|0}dt[e>>2]=0;dt[t+272>>2]=0;dt[t+276>>2]=0}pt[t+280>>0]=0;e=t+252|0;r=dt[e>>2]|0;if(r){if(!(r&7))Di[dt[104>>2]&1](r,0,0,1,dt[27]|0)|0;else{dt[s>>2]=1154;dt[s+4>>2]=2499;dt[s+8>>2]=1516;br(u,1100,s)|0;yr(u,l)|0}dt[e>>2]=0;dt[t+256>>2]=0;dt[t+260>>2]=0}pt[t+264>>0]=0;e=t+236|0;r=dt[e>>2]|0;if(!r){c=t+248|0;pt[c>>0]=0;c=t+212|0;ce(c);c=t+188|0;ce(c);c=t+164|0;ce(c);c=t+140|0;ce(c);c=t+116|0;ce(c);vt=f;return}if(!(r&7))Di[dt[104>>2]&1](r,0,0,1,dt[27]|0)|0;else{dt[h>>2]=1154;dt[h+4>>2]=2499;dt[h+8>>2]=1516;br(u,1100,h)|0;yr(u,c)|0}dt[e>>2]=0;dt[t+240>>2]=0;dt[t+244>>2]=0;c=t+248|0;pt[c>>0]=0;c=t+212|0;ce(c);c=t+188|0;ce(c);c=t+164|0;ce(c);c=t+140|0;ce(c);c=t+116|0;ce(c);vt=f;return}function je(t,e){t=t|0;e=e|0;var r=0;r=vt;vt=vt+16|0;dt[r>>2]=e;e=dt[63]|0;xr(e,t,r)|0;vr(10,e)|0;Xt()}function Le(){var t=0,e=0;t=vt;vt=vt+16|0;if(!(Ft(200,2)|0)){e=zt(dt[49]|0)|0;vt=t;return e|0}else je(2090,t);return 0}function Ne(t){t=t|0;Ur(t);return}function Be(t){t=t|0;var e=0;e=vt;vt=vt+16|0;Oi[t&3]();je(2139,e)}function Ue(){var t=0,e=0;t=Le()|0;if(((t|0)!=0?(e=dt[t>>2]|0,(e|0)!=0):0)?(t=e+48|0,(dt[t>>2]&-256|0)==1126902528?(dt[t+4>>2]|0)==1129074247:0):0)Be(dt[e+12>>2]|0);e=dt[28]|0;dt[28]=e+0;Be(e)}function Xe(t){t=t|0;return}function He(t){t=t|0;return}function qe(t){t=t|0;return}function We(t){t=t|0;return}function Ge(t){t=t|0;Ne(t);return}function Ve(t){t=t|0;Ne(t);return}function Ye(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0,a=0;a=vt;vt=vt+64|0;o=a;if((t|0)!=(e|0))if((e|0)!=0?(n=Qe(e,24,40,0)|0,(n|0)!=0):0){e=o;i=e+56|0;do{dt[e>>2]=0;e=e+4|0}while((e|0)<(i|0));dt[o>>2]=n;dt[o+8>>2]=t;dt[o+12>>2]=-1;dt[o+48>>2]=1;zi[dt[(dt[n>>2]|0)+28>>2]&3](n,o,dt[r>>2]|0,1);if((dt[o+24>>2]|0)==1){dt[r>>2]=dt[o+16>>2];e=1}else e=0}else e=0;else e=1;vt=a;return e|0}function Ze(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0;t=e+16|0;n=dt[t>>2]|0;do{if(n){if((n|0)!=(r|0)){i=e+36|0;dt[i>>2]=(dt[i>>2]|0)+1;dt[e+24>>2]=2;pt[e+54>>0]=1;break}t=e+24|0;if((dt[t>>2]|0)==2)dt[t>>2]=i}else{dt[t>>2]=r;dt[e+24>>2]=i;dt[e+36>>2]=1}}while(0);return}function Je(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;if((t|0)==(dt[e+8>>2]|0))Ze(0,e,r,i);return}function Ke(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;if((t|0)==(dt[e+8>>2]|0))Ze(0,e,r,i);else{t=dt[t+8>>2]|0;zi[dt[(dt[t>>2]|0)+28>>2]&3](t,e,r,i)}return}function Qe(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0;p=vt;vt=vt+64|0;f=p;c=dt[t>>2]|0;h=t+(dt[c+-8>>2]|0)|0;c=dt[c+-4>>2]|0;dt[f>>2]=r;dt[f+4>>2]=t;dt[f+8>>2]=e;dt[f+12>>2]=i;i=f+16|0;t=f+20|0;e=f+24|0;n=f+28|0;o=f+32|0;a=f+40|0;s=(c|0)==(r|0);l=i;u=l+36|0;do{dt[l>>2]=0;l=l+4|0}while((l|0)<(u|0));$[i+36>>1]=0;pt[i+38>>0]=0;t:do{if(s){dt[f+48>>2]=1;Mi[dt[(dt[r>>2]|0)+20>>2]&3](r,f,h,h,1,0);i=(dt[e>>2]|0)==1?h:0}else{Ci[dt[(dt[c>>2]|0)+24>>2]&3](c,f,h,1,0);switch(dt[f+36>>2]|0){case 0:{i=(dt[a>>2]|0)==1&(dt[n>>2]|0)==1&(dt[o>>2]|0)==1?dt[t>>2]|0:0;break t}case 1:break;default:{i=0;break t}}if((dt[e>>2]|0)!=1?!((dt[a>>2]|0)==0&(dt[n>>2]|0)==1&(dt[o>>2]|0)==1):0){i=0;break}i=dt[i>>2]|0}}while(0);vt=p;return i|0}function $e(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;pt[e+53>>0]=1;do{if((dt[e+4>>2]|0)==(i|0)){pt[e+52>>0]=1;i=e+16|0;t=dt[i>>2]|0;if(!t){dt[i>>2]=r;dt[e+24>>2]=n;dt[e+36>>2]=1;if(!((n|0)==1?(dt[e+48>>2]|0)==1:0))break;pt[e+54>>0]=1;break}if((t|0)!=(r|0)){n=e+36|0;dt[n>>2]=(dt[n>>2]|0)+1;pt[e+54>>0]=1;break}t=e+24|0;i=dt[t>>2]|0;if((i|0)==2){dt[t>>2]=n;i=n}if((i|0)==1?(dt[e+48>>2]|0)==1:0)pt[e+54>>0]=1}}while(0);return}function tr(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0;t:do{if((t|0)==(dt[e+8>>2]|0)){if((dt[e+4>>2]|0)==(r|0)?(o=e+28|0,(dt[o>>2]|0)!=1):0)dt[o>>2]=i}else{if((t|0)!=(dt[e>>2]|0)){s=dt[t+8>>2]|0;Ci[dt[(dt[s>>2]|0)+24>>2]&3](s,e,r,i,n);break}if((dt[e+16>>2]|0)!=(r|0)?(a=e+20|0,(dt[a>>2]|0)!=(r|0)):0){dt[e+32>>2]=i;i=e+44|0;if((dt[i>>2]|0)==4)break;o=e+52|0;pt[o>>0]=0;l=e+53|0;pt[l>>0]=0;t=dt[t+8>>2]|0;Mi[dt[(dt[t>>2]|0)+20>>2]&3](t,e,r,r,1,n);if(pt[l>>0]|0){if(!(pt[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){dt[a>>2]=r;l=e+40|0;dt[l>>2]=(dt[l>>2]|0)+1;if((dt[e+36>>2]|0)==1?(dt[e+24>>2]|0)==2:0){pt[e+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;dt[i>>2]=4;break t}}while(0);dt[i>>2]=3;break}if((i|0)==1)dt[e+32>>2]=1}}while(0);return}function er(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((t|0)==(dt[e+8>>2]|0)){if((dt[e+4>>2]|0)==(r|0)?(a=e+28|0,(dt[a>>2]|0)!=1):0)dt[a>>2]=i}else if((t|0)==(dt[e>>2]|0)){if((dt[e+16>>2]|0)!=(r|0)?(o=e+20|0,(dt[o>>2]|0)!=(r|0)):0){dt[e+32>>2]=i;dt[o>>2]=r;n=e+40|0;dt[n>>2]=(dt[n>>2]|0)+1;if((dt[e+36>>2]|0)==1?(dt[e+24>>2]|0)==2:0)pt[e+54>>0]=1;dt[e+44>>2]=4;break}if((i|0)==1)dt[e+32>>2]=1}}while(0);return}function rr(t,e,r,i,n,o){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;if((t|0)==(dt[e+8>>2]|0))$e(0,e,r,i,n);else{t=dt[t+8>>2]|0;Mi[dt[(dt[t>>2]|0)+20>>2]&3](t,e,r,i,n,o)}return}function ir(t,e,r,i,n,o){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;if((t|0)==(dt[e+8>>2]|0))$e(0,e,r,i,n);return}function nr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0;n=vt;vt=vt+16|0;i=n;dt[i>>2]=dt[r>>2];t=Pi[dt[(dt[t>>2]|0)+16>>2]&7](t,e,i)|0;if(t)dt[r>>2]=dt[i>>2];vt=n;return t&1|0}function or(t){t=t|0;if(!t)t=0;else t=(Qe(t,24,72,0)|0)!=0;return t&1|0}function ar(){var t=0,e=0,r=0,i=0,n=0,o=0,a=0,s=0;n=vt;vt=vt+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;t=Le()|0;if((t|0)!=0?(i=dt[t>>2]|0,(i|0)!=0):0){t=i+48|0;e=dt[t>>2]|0;t=dt[t+4>>2]|0;if(!((e&-256|0)==1126902528&(t|0)==1129074247)){dt[r>>2]=dt[51];je(2368,r)}if((e|0)==1126902529&(t|0)==1129074247)t=dt[i+44>>2]|0;else t=i+80|0;dt[n>>2]=t;i=dt[i>>2]|0;t=dt[i+4>>2]|0;if(Pi[dt[(dt[8>>2]|0)+16>>2]&7](8,i,n)|0){s=dt[n>>2]|0;n=dt[51]|0;s=Ei[dt[(dt[s>>2]|0)+8>>2]&1](s)|0;dt[o>>2]=n;dt[o+4>>2]=t;dt[o+8>>2]=s;je(2282,o)}else{dt[s>>2]=dt[51];dt[s+4>>2]=t;je(2327,s)}}je(2406,a)}function sr(){var t=0;t=vt;vt=vt+16|0;if(!(jt(196,6)|0)){vt=t;return}else je(2179,t)}function lr(t){t=t|0;var e=0;e=vt;vt=vt+16|0;Ur(t);if(!(Bt(dt[49]|0,0)|0)){vt=e;return}else je(2229,e)}function ur(t){t=t|0;var e=0,r=0;e=0;while(1){if((mt[2427+e>>0]|0)==(t|0)){r=2;break}e=e+1|0;if((e|0)==87){e=87;t=2515;r=5;break}}if((r|0)==2)if(!e)t=2515;else{t=2515;r=5}if((r|0)==5)while(1){r=t;while(1){t=r+1|0;if(!(pt[r>>0]|0))break;else r=t}e=e+-1|0;if(!e)break;else r=5}return t|0}function hr(){var t=0;if(!(dt[52]|0))t=264;else{t=(Rt()|0)+60|0;t=dt[t>>2]|0}return t|0}function cr(t){t=t|0;var e=0;if(t>>>0>4294963200){e=hr()|0;dt[e>>2]=0-t;t=-1}return t|0}function fr(t,e){t=+t;e=e|0;var r=0,i=0,n=0;tt[et>>3]=t;r=dt[et>>2]|0;i=dt[et+4>>2]|0;n=Zr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(t!=0.0){t=+fr(t*18446744073709552.0e3,e);r=(dt[e>>2]|0)+-64|0}else r=0;dt[e>>2]=r;break}case 2047:break;default:{dt[e>>2]=n+-1022;dt[et>>2]=r;dt[et+4>>2]=i&-2146435073|1071644672;t=+tt[et>>3]}}return+t}function pr(t,e){t=+t;e=e|0;return+ +fr(t,e)}function dr(t,e,r){t=t|0;e=e|0;r=r|0;do{if(t){if(e>>>0<128){pt[t>>0]=e;t=1;break}if(e>>>0<2048){pt[t>>0]=e>>>6|192;pt[t+1>>0]=e&63|128;t=2;break}if(e>>>0<55296|(e&-8192|0)==57344){pt[t>>0]=e>>>12|224;pt[t+1>>0]=e>>>6&63|128;pt[t+2>>0]=e&63|128;t=3;break}if((e+-65536|0)>>>0<1048576){pt[t>>0]=e>>>18|240;pt[t+1>>0]=e>>>12&63|128;pt[t+2>>0]=e>>>6&63|128;pt[t+3>>0]=e&63|128;t=4;break}else{t=hr()|0;dt[t>>2]=84;t=-1;break}}else t=1}while(0);return t|0}function mr(t,e){t=t|0;e=e|0;if(!t)t=0;else t=dr(t,e,0)|0;return t|0}function gr(t){t=t|0;var e=0,r=0;do{if(t){if((dt[t+76>>2]|0)<=-1){e=Dr(t)|0;break}r=(kr(t)|0)==0;e=Dr(t)|0;if(!r)Sr(t)}else{if(!(dt[65]|0))e=0;else e=gr(dt[65]|0)|0;Ut(236);t=dt[58]|0;if(t)do{if((dt[t+76>>2]|0)>-1)r=kr(t)|0;else r=0;if((dt[t+20>>2]|0)>>>0>(dt[t+28>>2]|0)>>>0)e=Dr(t)|0|e;if(r)Sr(t);t=dt[t+56>>2]|0}while((t|0)!=0);Lt(236)}}while(0);return e|0}function vr(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0;if((dt[e+76>>2]|0)>=0?(kr(e)|0)!=0:0){if((pt[e+75>>0]|0)!=(t|0)?(i=e+20|0,n=dt[i>>2]|0,n>>>0<(dt[e+16>>2]|0)>>>0):0){dt[i>>2]=n+1;pt[n>>0]=t;r=t&255}else r=Pr(e,t)|0;Sr(e)}else a=3;do{if((a|0)==3){if((pt[e+75>>0]|0)!=(t|0)?(o=e+20|0,r=dt[o>>2]|0,r>>>0<(dt[e+16>>2]|0)>>>0):0){dt[o>>2]=r+1;pt[r>>0]=t;r=t&255;break}r=Pr(e,t)|0}}while(0);return r|0}function _r(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=dt[i>>2]|0;if(!n)if(!(Or(r)|0)){n=dt[i>>2]|0;o=4}else i=0;else o=4;t:do{if((o|0)==4){a=r+20|0;o=dt[a>>2]|0;if((n-o|0)>>>0>>0){i=Pi[dt[r+36>>2]&7](r,t,e)|0;break}e:do{if((pt[r+75>>0]|0)>-1){i=e;while(1){if(!i){n=o;i=0;break e}n=i+-1|0;if((pt[t+n>>0]|0)==10)break;else i=n}if((Pi[dt[r+36>>2]&7](r,t,i)|0)>>>0>>0)break t;e=e-i|0;t=t+i|0;n=dt[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,t|0,e|0)|0;dt[a>>2]=(dt[a>>2]|0)+e;i=i+e|0}}while(0);return i|0}function yr(t,e){t=t|0;e=e|0;var r=0,i=0;r=vt;vt=vt+16|0;i=r;dt[i>>2]=e;e=xr(dt[64]|0,t,i)|0;vt=r;return e|0}function br(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0;i=vt;vt=vt+16|0;n=i;dt[n>>2]=r;r=Tr(t,e,n)|0;vt=i;return r|0}function xr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0;m=vt;vt=vt+224|0;c=m+120|0;d=m+80|0;p=m;f=m+136|0;i=d;n=i+40|0;do{dt[i>>2]=0;i=i+4|0}while((i|0)<(n|0));dt[c>>2]=dt[r>>2];if((zr(0,e,c,p,d)|0)<0)r=-1;else{if((dt[t+76>>2]|0)>-1)u=kr(t)|0;else u=0;r=dt[t>>2]|0;h=r&32;if((pt[t+74>>0]|0)<1)dt[t>>2]=r&-33;r=t+48|0;if(!(dt[r>>2]|0)){n=t+44|0;o=dt[n>>2]|0;dt[n>>2]=f;a=t+28|0;dt[a>>2]=f;s=t+20|0;dt[s>>2]=f;dt[r>>2]=80;l=t+16|0;dt[l>>2]=f+80;i=zr(t,e,c,p,d)|0;if(o){Pi[dt[t+36>>2]&7](t,0,0)|0;i=(dt[s>>2]|0)==0?-1:i;dt[n>>2]=o;dt[r>>2]=0;dt[l>>2]=0;dt[a>>2]=0;dt[s>>2]=0}}else i=zr(t,e,c,p,d)|0;r=dt[t>>2]|0;dt[t>>2]=r|h;if(u)Sr(t);r=(r&32|0)==0?i:-1}vt=m;return r|0}function wr(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0,h=0;h=vt;vt=vt+128|0;n=h+112|0;u=h;o=u;a=268;s=o+112|0;do{dt[o>>2]=dt[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((e+-1|0)>>>0>2147483646)if(!e){e=1;l=4}else{e=hr()|0;dt[e>>2]=75;e=-1}else{n=t;l=4}if((l|0)==4){l=-2-n|0;l=e>>>0>l>>>0?l:e;dt[u+48>>2]=l;t=u+20|0;dt[t>>2]=n;dt[u+44>>2]=n;e=n+l|0;n=u+16|0;dt[n>>2]=e;dt[u+28>>2]=e;e=xr(u,r,i)|0;if(l){r=dt[t>>2]|0;pt[r+(((r|0)==(dt[n>>2]|0))<<31>>31)>>0]=0}}vt=h;return e|0}function Tr(t,e,r){t=t|0;e=e|0;r=r|0;return wr(t,2147483647,e,r)|0}function kr(t){t=t|0;return 0}function Sr(t){t=t|0;return}function Pr(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0;l=vt;vt=vt+16|0;s=l;a=e&255;pt[s>>0]=a;i=t+16|0;n=dt[i>>2]|0;if(!n)if(!(Or(t)|0)){n=dt[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=t+20|0;o=dt[i>>2]|0;if(o>>>0>>0?(r=e&255,(r|0)!=(pt[t+75>>0]|0)):0){dt[i>>2]=o+1;pt[o>>0]=a;break}if((Pi[dt[t+36>>2]&7](t,s,1)|0)==1)r=mt[s>>0]|0;else r=-1}}while(0);vt=l;return r|0}function Cr(t){t=t|0;var e=0,r=0;e=vt;vt=vt+16|0;r=e;dt[r>>2]=dt[t+60>>2];t=cr(Pt(6,r|0)|0)|0;vt=e;return t|0}function Ar(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0;n=vt;vt=vt+32|0;o=n;i=n+20|0;dt[o>>2]=dt[t+60>>2];dt[o+4>>2]=0;dt[o+8>>2]=e;dt[o+12>>2]=i;dt[o+16>>2]=r;if((cr(Wt(140,o|0)|0)|0)<0){dt[i>>2]=-1;t=-1}else t=dt[i>>2]|0;vt=n;return t|0}function Er(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0;d=vt;vt=vt+48|0;c=d+16|0;h=d;i=d+32|0;f=t+28|0;n=dt[f>>2]|0;dt[i>>2]=n;p=t+20|0;n=(dt[p>>2]|0)-n|0;dt[i+4>>2]=n;dt[i+8>>2]=e;dt[i+12>>2]=r;l=t+60|0;u=t+44|0;e=2;n=n+r|0;while(1){if(!(dt[52]|0)){dt[c>>2]=dt[l>>2];dt[c+4>>2]=i;dt[c+8>>2]=e;a=cr(Gt(146,c|0)|0)|0}else{Ht(7,t|0);dt[h>>2]=dt[l>>2];dt[h+4>>2]=i;dt[h+8>>2]=e;a=cr(Gt(146,h|0)|0)|0;kt(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=dt[i+4>>2]|0;if(a>>>0<=o>>>0)if((e|0)==2){dt[f>>2]=(dt[f>>2]|0)+a;s=o;e=2}else s=o;else{s=dt[u>>2]|0;dt[f>>2]=s;dt[p>>2]=s;s=dt[i+12>>2]|0;a=a-o|0;i=i+8|0;e=e+-1|0}dt[i>>2]=(dt[i>>2]|0)+a;dt[i+4>>2]=s-a}if((n|0)==6){c=dt[u>>2]|0;dt[t+16>>2]=c+(dt[t+48>>2]|0);t=c;dt[f>>2]=t;dt[p>>2]=t}else if((n|0)==8){dt[t+16>>2]=0;dt[f>>2]=0;dt[p>>2]=0;dt[t>>2]=dt[t>>2]|32;if((e|0)==2)r=0;else r=r-(dt[i+4>>2]|0)|0}vt=d;return r|0}function Ir(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0;n=vt;vt=vt+80|0;i=n;dt[t+36>>2]=3;if((dt[t>>2]&64|0)==0?(dt[i>>2]=dt[t+60>>2],dt[i+4>>2]=21505,dt[i+8>>2]=n+12,(St(54,i|0)|0)!=0):0)pt[t+75>>0]=-1;i=Er(t,e,r)|0;vt=n;return i|0}function Or(t){t=t|0;var e=0,r=0;e=t+74|0;r=pt[e>>0]|0;pt[e>>0]=r+255|r;e=dt[t>>2]|0;if(!(e&8)){dt[t+8>>2]=0;dt[t+4>>2]=0;e=dt[t+44>>2]|0;dt[t+28>>2]=e;dt[t+20>>2]=e;dt[t+16>>2]=e+(dt[t+48>>2]|0);e=0}else{dt[t>>2]=e|32;e=-1}return e|0}function Mr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0,a=0;o=e&255;i=(r|0)!=0;t:do{if(i&(t&3|0)!=0){n=e&255;while(1){if((pt[t>>0]|0)==n<<24>>24){a=6;break t}t=t+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(t&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;t:do{if((a|0)==6){n=e&255;if((pt[t>>0]|0)!=n<<24>>24){i=_t(o,16843009)|0;e:do{if(r>>>0>3)while(1){o=dt[t>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;t=t+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break e}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((pt[t>>0]|0)==n<<24>>24)break t;t=t+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?t:0)|0}function Dr(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0;e=t+20|0;o=t+28|0;if((dt[e>>2]|0)>>>0>(dt[o>>2]|0)>>>0?(Pi[dt[t+36>>2]&7](t,0,0)|0,(dt[e>>2]|0)==0):0)e=-1;else{a=t+4|0;r=dt[a>>2]|0;i=t+8|0;n=dt[i>>2]|0;if(r>>>0>>0)Pi[dt[t+40>>2]&7](t,r-n|0,1)|0;dt[t+16>>2]=0;dt[o>>2]=0;dt[e>>2]=0;dt[i>>2]=0;dt[a>>2]=0;e=0}return e|0}function zr(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0.0,h=0,c=0,f=0,p=0,d=0.0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,C=0,A=0,E=0,I=0,O=0,M=0,D=0,z=0,R=0,F=0,j=0,L=0,N=0,B=0,U=0,X=0,H=0,q=0,W=0,G=0,V=0,Y=0,Z=0,J=0,K=0,Q=0;Q=vt;vt=vt+624|0;V=Q+24|0;Z=Q+16|0;Y=Q+588|0;X=Q+576|0;G=Q;N=Q+536|0;K=Q+8|0;J=Q+528|0;I=(t|0)!=0;O=N+40|0;L=O;N=N+39|0;B=K+4|0;U=X+12|0;X=X+11|0;H=Y;q=U;W=q-H|0;M=-2-H|0;D=q+2|0;z=V+288|0;R=Y+9|0;F=R;j=Y+8|0;o=0;m=e;a=0;e=0;t:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=hr()|0;dt[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=pt[m>>0]|0;if(!(a<<24>>24)){E=245;break}else s=m;e:while(1){switch(a<<24>>24){case 37:{a=s;E=9;break e}case 0:{a=s;break e}default:{}}A=s+1|0;a=pt[A>>0]|0;s=A}e:do{if((E|0)==9)while(1){E=0;if((pt[a+1>>0]|0)!=37)break e;s=s+1|0;a=a+2|0;if((pt[a>>0]|0)==37)E=9;else break}}while(0);v=s-m|0;if(I?(dt[t>>2]&32|0)==0:0)_r(m,v,t)|0;if((s|0)!=(m|0)){m=a;a=v;continue}h=a+1|0;s=pt[h>>0]|0;l=(s<<24>>24)+-48|0;if(l>>>0<10){A=(pt[a+2>>0]|0)==36;h=A?a+3|0:h;s=pt[h>>0]|0;p=A?l:-1;e=A?1:e}else p=-1;a=s<<24>>24;e:do{if((a&-32|0)==32){l=0;while(1){if(!(1<>24)+-32|l;h=h+1|0;s=pt[h>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){c=l;a=h;break}}}else{c=0;a=h}}while(0);do{if(s<<24>>24==42){l=a+1|0;s=(pt[l>>0]|0)+-48|0;if(s>>>0<10?(pt[a+2>>0]|0)==36:0){dt[n+(s<<2)>>2]=10;e=1;a=a+3|0;s=dt[i+((pt[l>>0]|0)+-48<<3)>>2]|0}else{if(e){o=-1;break t}if(!I){g=c;a=l;e=0;A=0;break}e=(dt[r>>2]|0)+(4-1)&~(4-1);s=dt[e>>2]|0;dt[r>>2]=e+4;e=0;a=l}if((s|0)<0){g=c|8192;A=0-s|0}else{g=c;A=s}}else{l=(s<<24>>24)+-48|0;if(l>>>0<10){s=0;do{s=(s*10|0)+l|0;a=a+1|0;l=(pt[a>>0]|0)+-48|0}while(l>>>0<10);if((s|0)<0){o=-1;break t}else{g=c;A=s}}else{g=c;A=0}}}while(0);e:do{if((pt[a>>0]|0)==46){l=a+1|0;s=pt[l>>0]|0;if(s<<24>>24!=42){h=(s<<24>>24)+-48|0;if(h>>>0<10){a=l;s=0}else{a=l;h=0;break}while(1){s=(s*10|0)+h|0;a=a+1|0;h=(pt[a>>0]|0)+-48|0;if(h>>>0>=10){h=s;break e}}}l=a+2|0;s=(pt[l>>0]|0)+-48|0;if(s>>>0<10?(pt[a+3>>0]|0)==36:0){dt[n+(s<<2)>>2]=10;a=a+4|0;h=dt[i+((pt[l>>0]|0)+-48<<3)>>2]|0;break}if(e){o=-1;break t}if(I){a=(dt[r>>2]|0)+(4-1)&~(4-1);h=dt[a>>2]|0;dt[r>>2]=a+4;a=l}else{a=l;h=0}}else h=-1}while(0);f=0;while(1){s=(pt[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break t}l=a+1|0;s=pt[5359+(f*58|0)+s>>0]|0;c=s&255;if((c+-1|0)>>>0<8){a=l;f=c}else{C=l;break}}if(!(s<<24>>24)){o=-1;break}l=(p|0)>-1;do{if(s<<24>>24==19)if(l){o=-1;break t}else E=52;else{if(l){dt[n+(p<<2)>>2]=c;S=i+(p<<3)|0;P=dt[S+4>>2]|0;E=G;dt[E>>2]=dt[S>>2];dt[E+4>>2]=P;E=52;break}if(!I){o=0;break t}jr(G,c,r)}}while(0);if((E|0)==52?(E=0,!I):0){m=C;a=v;continue}p=pt[a>>0]|0;p=(f|0)!=0&(p&15|0)==3?p&-33:p;l=g&-65537;P=(g&8192|0)==0?g:l;e:do{switch(p|0){case 110:switch(f|0){case 0:{dt[dt[G>>2]>>2]=o;m=C;a=v;continue t}case 1:{dt[dt[G>>2]>>2]=o;m=C;a=v;continue t}case 2:{m=dt[G>>2]|0;dt[m>>2]=o;dt[m+4>>2]=((o|0)<0)<<31>>31;m=C;a=v;continue t}case 3:{$[dt[G>>2]>>1]=o;m=C;a=v;continue t}case 4:{pt[dt[G>>2]>>0]=o;m=C;a=v;continue t}case 6:{dt[dt[G>>2]>>2]=o;m=C;a=v;continue t}case 7:{m=dt[G>>2]|0;dt[m>>2]=o;dt[m+4>>2]=((o|0)<0)<<31>>31;m=C;a=v;continue t}default:{m=C;a=v;continue t}}case 112:{f=P|8;h=h>>>0>8?h:8;p=120;E=64;break}case 88:case 120:{f=P;E=64;break}case 111:{l=G;s=dt[l>>2]|0;l=dt[l+4>>2]|0;if((s|0)==0&(l|0)==0)a=O;else{a=O;do{a=a+-1|0;pt[a>>0]=s&7|48;s=Zr(s|0,l|0,3)|0;l=rt}while(!((s|0)==0&(l|0)==0))}if(!(P&8)){s=P;f=0;c=5839;E=77}else{f=L-a+1|0;s=P;h=(h|0)<(f|0)?f:h;f=0;c=5839;E=77}break}case 105:case 100:{s=G;a=dt[s>>2]|0;s=dt[s+4>>2]|0;if((s|0)<0){a=Vr(0,0,a|0,s|0)|0;s=rt;l=G;dt[l>>2]=a;dt[l+4>>2]=s;l=1;c=5839;E=76;break e}if(!(P&2048)){c=P&1;l=c;c=(c|0)==0?5839:5841;E=76}else{l=1;c=5840;E=76}break}case 117:{s=G;a=dt[s>>2]|0;s=dt[s+4>>2]|0;l=0;c=5839;E=76;break}case 99:{pt[N>>0]=dt[G>>2];m=N;s=1;f=0;p=5839;a=O;break}case 109:{a=hr()|0;a=ur(dt[a>>2]|0)|0;E=82;break}case 115:{a=dt[G>>2]|0;a=(a|0)!=0?a:5849;E=82;break}case 67:{dt[K>>2]=dt[G>>2];dt[B>>2]=0;dt[G>>2]=K;h=-1;E=86;break}case 83:{if(!h){Nr(t,32,A,0,P);a=0;E=98}else E=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{u=+tt[G>>3];dt[Z>>2]=0;tt[et>>3]=u;if((dt[et+4>>2]|0)>=0)if(!(P&2048)){S=P&1;k=S;S=(S|0)==0?5857:5862}else{k=1;S=5859}else{u=-u;k=1;S=5856}tt[et>>3]=u;T=dt[et+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){d=+pr(u,Z)*2.0;s=d!=0.0;if(s)dt[Z>>2]=(dt[Z>>2]|0)+-1;x=p|32;if((x|0)==97){m=p&32;v=(m|0)==0?S:S+9|0;g=k|2;a=12-h|0;do{if(!(h>>>0>11|(a|0)==0)){u=8.0;do{a=a+-1|0;u=u*16.0}while((a|0)!=0);if((pt[v>>0]|0)==45){u=-(u+(-d-u));break}else{u=d+u-u;break}}else u=d}while(0);s=dt[Z>>2]|0;a=(s|0)<0?0-s|0:s;a=Lr(a,((a|0)<0)<<31>>31,U)|0;if((a|0)==(U|0)){pt[X>>0]=48;a=X}pt[a+-1>>0]=(s>>31&2)+43;f=a+-2|0;pt[f>>0]=p+15;c=(h|0)<1;l=(P&8|0)==0;s=Y;while(1){S=~~u;a=s+1|0;pt[s>>0]=mt[5823+S>>0]|m;u=(u-+(S|0))*16.0;do{if((a-H|0)==1){if(l&(c&u==0.0))break;pt[a>>0]=46;a=s+2|0}}while(0);if(!(u!=0.0))break;else s=a}h=(h|0)!=0&(M+a|0)<(h|0)?D+h-f|0:W-f+a|0;l=h+g|0;Nr(t,32,A,l,P);if(!(dt[t>>2]&32))_r(v,g,t)|0;Nr(t,48,A,l,P^65536);a=a-H|0;if(!(dt[t>>2]&32))_r(Y,a,t)|0;s=q-f|0;Nr(t,48,h-(a+s)|0,0,0);if(!(dt[t>>2]&32))_r(f,s,t)|0;Nr(t,32,A,l,P^8192);a=(l|0)<(A|0)?A:l;break}a=(h|0)<0?6:h;if(s){s=(dt[Z>>2]|0)+-28|0;dt[Z>>2]=s;u=d*268435456.0}else{u=d;s=dt[Z>>2]|0}T=(s|0)<0?V:z;w=T;s=T;do{b=~~u>>>0;dt[s>>2]=b;s=s+4|0;u=(u-+(b>>>0))*1.0e9}while(u!=0.0);l=s;s=dt[Z>>2]|0;if((s|0)>0){c=T;while(1){f=(s|0)>29?29:s;h=l+-4|0;do{if(h>>>0>>0)h=c;else{s=0;do{b=Jr(dt[h>>2]|0,0,f|0)|0;b=Kr(b|0,rt|0,s|0,0)|0;s=rt;y=ai(b|0,s|0,1e9,0)|0;dt[h>>2]=y;s=oi(b|0,s|0,1e9,0)|0;h=h+-4|0}while(h>>>0>=c>>>0);if(!s){h=c;break}h=c+-4|0;dt[h>>2]=s}}while(0);while(1){if(l>>>0<=h>>>0)break;s=l+-4|0;if(!(dt[s>>2]|0))l=s;else break}s=(dt[Z>>2]|0)-f|0;dt[Z>>2]=s;if((s|0)>0)c=h;else break}}else h=T;if((s|0)<0){v=((a+25|0)/9|0)+1|0;_=(x|0)==102;m=h;while(1){g=0-s|0;g=(g|0)>9?9:g;do{if(m>>>0>>0){s=(1<>>g;h=0;f=m;do{b=dt[f>>2]|0;dt[f>>2]=(b>>>g)+h;h=_t(b&s,c)|0;f=f+4|0}while(f>>>0>>0);s=(dt[m>>2]|0)==0?m+4|0:m;if(!h){h=s;break}dt[l>>2]=h;h=s;l=l+4|0}else h=(dt[m>>2]|0)==0?m+4|0:m}while(0);s=_?T:h;l=(l-s>>2|0)>(v|0)?s+(v<<2)|0:l;s=(dt[Z>>2]|0)+g|0;dt[Z>>2]=s;if((s|0)>=0){m=h;break}else m=h}}else m=h;do{if(m>>>0>>0){s=(w-m>>2)*9|0;c=dt[m>>2]|0;if(c>>>0<10)break;else h=10;do{h=h*10|0;s=s+1|0}while(c>>>0>=h>>>0)}else s=0}while(0);y=(x|0)==103;b=(a|0)!=0;h=a-((x|0)!=102?s:0)+((b&y)<<31>>31)|0;if((h|0)<(((l-w>>2)*9|0)+-9|0)){f=h+9216|0;_=(f|0)/9|0;h=T+(_+-1023<<2)|0;f=((f|0)%9|0)+1|0;if((f|0)<9){c=10;do{c=c*10|0;f=f+1|0}while((f|0)!=9)}else c=10;g=dt[h>>2]|0;v=(g>>>0)%(c>>>0)|0;if((v|0)==0?(T+(_+-1022<<2)|0)==(l|0):0)c=m;else E=163;do{if((E|0)==163){E=0;d=(((g>>>0)/(c>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;f=(c|0)/2|0;do{if(v>>>0>>0)u=.5;else{if((v|0)==(f|0)?(T+(_+-1022<<2)|0)==(l|0):0){u=1.0;break}u=1.5}}while(0);do{if(k){if((pt[S>>0]|0)!=45)break;d=-d;u=-u}}while(0);f=g-v|0;dt[h>>2]=f;if(!(d+u!=d)){c=m;break}x=f+c|0;dt[h>>2]=x;if(x>>>0>999999999){s=m;while(1){c=h+-4|0;dt[h>>2]=0;if(c>>>0>>0){s=s+-4|0;dt[s>>2]=0}x=(dt[c>>2]|0)+1|0;dt[c>>2]=x;if(x>>>0>999999999)h=c;else{m=s;h=c;break}}}s=(w-m>>2)*9|0;f=dt[m>>2]|0;if(f>>>0<10){c=m;break}else c=10;do{c=c*10|0;s=s+1|0}while(f>>>0>=c>>>0);c=m}}while(0);x=h+4|0;m=c;l=l>>>0>x>>>0?x:l}v=0-s|0;while(1){if(l>>>0<=m>>>0){_=0;x=l;break}h=l+-4|0;if(!(dt[h>>2]|0))l=h;else{_=1;x=l;break}}do{if(y){a=(b&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){p=p+-1|0;a=a+-1-s|0}else{p=p+-2|0;a=a+-1|0}l=P&8;if(l)break;do{if(_){l=dt[x+-4>>2]|0;if(!l){h=9;break}if(!((l>>>0)%10|0)){c=10;h=0}else{h=0;break}do{c=c*10|0;h=h+1|0}while(((l>>>0)%(c>>>0)|0|0)==0)}else h=9}while(0);l=((x-w>>2)*9|0)+-9|0;if((p|32|0)==102){l=l-h|0;l=(l|0)<0?0:l;a=(a|0)<(l|0)?a:l;l=0;break}else{l=l+s-h|0;l=(l|0)<0?0:l;a=(a|0)<(l|0)?a:l;l=0;break}}else l=P&8}while(0);g=a|l;c=(g|0)!=0&1;f=(p|32|0)==102;if(f){s=(s|0)>0?s:0;p=0}else{h=(s|0)<0?v:s;h=Lr(h,((h|0)<0)<<31>>31,U)|0;if((q-h|0)<2)do{h=h+-1|0;pt[h>>0]=48}while((q-h|0)<2);pt[h+-1>>0]=(s>>31&2)+43;w=h+-2|0;pt[w>>0]=p;s=q-w|0;p=w}v=k+1+a+c+s|0;Nr(t,32,A,v,P);if(!(dt[t>>2]&32))_r(S,k,t)|0;Nr(t,48,A,v,P^65536);do{if(f){h=m>>>0>T>>>0?T:m;s=h;do{l=Lr(dt[s>>2]|0,0,R)|0;do{if((s|0)==(h|0)){if((l|0)!=(R|0))break;pt[j>>0]=48;l=j}else{if(l>>>0<=Y>>>0)break;do{l=l+-1|0;pt[l>>0]=48}while(l>>>0>Y>>>0)}}while(0);if(!(dt[t>>2]&32))_r(l,F-l|0,t)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(g){if(dt[t>>2]&32)break;_r(5891,1,t)|0}}while(0);if((a|0)>0&s>>>0>>0){l=s;while(1){s=Lr(dt[l>>2]|0,0,R)|0;if(s>>>0>Y>>>0)do{s=s+-1|0;pt[s>>0]=48}while(s>>>0>Y>>>0);if(!(dt[t>>2]&32))_r(s,(a|0)>9?9:a,t)|0;l=l+4|0;s=a+-9|0;if(!((a|0)>9&l>>>0>>0)){a=s;break}else a=s}}Nr(t,48,a+9|0,9,0)}else{f=_?x:m+4|0;if((a|0)>-1){c=(l|0)==0;h=m;do{s=Lr(dt[h>>2]|0,0,R)|0;if((s|0)==(R|0)){pt[j>>0]=48;s=j}do{if((h|0)==(m|0)){l=s+1|0;if(!(dt[t>>2]&32))_r(s,1,t)|0;if(c&(a|0)<1){s=l;break}if(dt[t>>2]&32){s=l;break}_r(5891,1,t)|0;s=l}else{if(s>>>0<=Y>>>0)break;do{s=s+-1|0;pt[s>>0]=48}while(s>>>0>Y>>>0)}}while(0);l=F-s|0;if(!(dt[t>>2]&32))_r(s,(a|0)>(l|0)?l:a,t)|0;a=a-l|0;h=h+4|0}while(h>>>0>>0&(a|0)>-1)}Nr(t,48,a+18|0,18,0);if(dt[t>>2]&32)break;_r(p,q-p|0,t)|0}}while(0);Nr(t,32,A,v,P^8192);a=(v|0)<(A|0)?A:v}else{f=(p&32|0)!=0;c=u!=u|0.0!=0.0;s=c?0:k;h=s+3|0;Nr(t,32,A,h,l);a=dt[t>>2]|0;if(!(a&32)){_r(S,s,t)|0;a=dt[t>>2]|0}if(!(a&32))_r(c?f?5883:5887:f?5875:5879,3,t)|0;Nr(t,32,A,h,P^8192);a=(h|0)<(A|0)?A:h}}while(0);m=C;continue t}default:{l=P;s=h;f=0;p=5839;a=O}}}while(0);e:do{if((E|0)==64){l=G;s=dt[l>>2]|0;l=dt[l+4>>2]|0;c=p&32;if(!((s|0)==0&(l|0)==0)){a=O;do{a=a+-1|0;pt[a>>0]=mt[5823+(s&15)>>0]|c;s=Zr(s|0,l|0,4)|0;l=rt}while(!((s|0)==0&(l|0)==0));E=G;if((f&8|0)==0|(dt[E>>2]|0)==0&(dt[E+4>>2]|0)==0){s=f;f=0;c=5839;E=77}else{s=f;f=2;c=5839+(p>>4)|0;E=77}}else{a=O;s=f;f=0;c=5839;E=77}}else if((E|0)==76){a=Lr(a,s,O)|0;s=P;f=l;E=77}else if((E|0)==82){E=0;P=Mr(a,0,h)|0;S=(P|0)==0;m=a;s=S?h:P-a|0;f=0;p=5839;a=S?a+h|0:P}else if((E|0)==86){E=0;s=0;a=0;c=dt[G>>2]|0;while(1){l=dt[c>>2]|0;if(!l)break;a=mr(J,l)|0;if((a|0)<0|a>>>0>(h-s|0)>>>0)break;s=a+s|0;if(h>>>0>s>>>0)c=c+4|0;else break}if((a|0)<0){o=-1;break t}Nr(t,32,A,s,P);if(!s){a=0;E=98}else{l=0;h=dt[G>>2]|0;while(1){a=dt[h>>2]|0;if(!a){a=s;E=98;break e}a=mr(J,a)|0;l=a+l|0;if((l|0)>(s|0)){a=s;E=98;break e}if(!(dt[t>>2]&32))_r(J,a,t)|0;if(l>>>0>=s>>>0){a=s;E=98;break}else h=h+4|0}}}}while(0);if((E|0)==98){E=0;Nr(t,32,A,a,P^8192);m=C;a=(A|0)>(a|0)?A:a;continue}if((E|0)==77){E=0;l=(h|0)>-1?s&-65537:s;s=G;s=(dt[s>>2]|0)!=0|(dt[s+4>>2]|0)!=0;if((h|0)!=0|s){s=(s&1^1)+(L-a)|0;m=a;s=(h|0)>(s|0)?h:s;p=c;a=O}else{m=O;s=0;p=c;a=O}}c=a-m|0;s=(s|0)<(c|0)?c:s;h=f+s|0;a=(A|0)<(h|0)?h:A;Nr(t,32,a,h,l);if(!(dt[t>>2]&32))_r(p,f,t)|0;Nr(t,48,a,h,l^65536);Nr(t,48,s,c,0);if(!(dt[t>>2]&32))_r(m,c,t)|0;Nr(t,32,a,h,l^8192);m=C}t:do{if((E|0)==245)if(!t)if(e){o=1;while(1){e=dt[n+(o<<2)>>2]|0;if(!e)break;jr(i+(o<<3)|0,e,r);o=o+1|0;if((o|0)>=10){o=1;break t}}if((o|0)<10)while(1){if(dt[n+(o<<2)>>2]|0){o=-1;break t}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);vt=Q;return o|0}function Rr(t){t=t|0;if(!(dt[t+68>>2]|0))Sr(t);return}function Fr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0;i=t+20|0;n=dt[i>>2]|0;t=(dt[t+16>>2]|0)-n|0;t=t>>>0>r>>>0?r:t;Qr(n|0,e|0,t|0)|0;dt[i>>2]=(dt[i>>2]|0)+t;return r|0}function jr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0.0;t:do{if(e>>>0<=20)do{switch(e|0){case 9:{i=(dt[r>>2]|0)+(4-1)&~(4-1);e=dt[i>>2]|0;dt[r>>2]=i+4;dt[t>>2]=e;break t}case 10:{i=(dt[r>>2]|0)+(4-1)&~(4-1);e=dt[i>>2]|0;dt[r>>2]=i+4;i=t;dt[i>>2]=e;dt[i+4>>2]=((e|0)<0)<<31>>31;break t}case 11:{i=(dt[r>>2]|0)+(4-1)&~(4-1);e=dt[i>>2]|0;dt[r>>2]=i+4;i=t;dt[i>>2]=e;dt[i+4>>2]=0;break t}case 12:{i=(dt[r>>2]|0)+(8-1)&~(8-1);e=i;n=dt[e>>2]|0;e=dt[e+4>>2]|0;dt[r>>2]=i+8;i=t;dt[i>>2]=n;dt[i+4>>2]=e;break t}case 13:{n=(dt[r>>2]|0)+(4-1)&~(4-1);i=dt[n>>2]|0;dt[r>>2]=n+4;i=(i&65535)<<16>>16;n=t;dt[n>>2]=i;dt[n+4>>2]=((i|0)<0)<<31>>31;break t}case 14:{n=(dt[r>>2]|0)+(4-1)&~(4-1);i=dt[n>>2]|0;dt[r>>2]=n+4;n=t;dt[n>>2]=i&65535;dt[n+4>>2]=0;break t}case 15:{n=(dt[r>>2]|0)+(4-1)&~(4-1);i=dt[n>>2]|0;dt[r>>2]=n+4;i=(i&255)<<24>>24;n=t;dt[n>>2]=i;dt[n+4>>2]=((i|0)<0)<<31>>31;break t}case 16:{n=(dt[r>>2]|0)+(4-1)&~(4-1);i=dt[n>>2]|0;dt[r>>2]=n+4;n=t;dt[n>>2]=i&255;dt[n+4>>2]=0;break t}case 17:{n=(dt[r>>2]|0)+(8-1)&~(8-1);o=+tt[n>>3];dt[r>>2]=n+8;tt[t>>3]=o;break t}case 18:{n=(dt[r>>2]|0)+(8-1)&~(8-1);o=+tt[n>>3];dt[r>>2]=n+8;tt[t>>3]=o;break t}default:break t}}while(0)}while(0);return}function Lr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0;if(e>>>0>0|(e|0)==0&t>>>0>4294967295)while(1){i=ai(t|0,e|0,10,0)|0;r=r+-1|0;pt[r>>0]=i|48;i=oi(t|0,e|0,10,0)|0;if(e>>>0>9|(e|0)==9&t>>>0>4294967295){t=i;e=rt}else{t=i;break}}if(t)while(1){r=r+-1|0;pt[r>>0]=(t>>>0)%10|0|48;if(t>>>0<10)break;else t=(t>>>0)/10|0}return r|0}function Nr(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=vt;vt=vt+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Yr(a|0,e|0,(n>>>0>256?256:n)|0)|0;e=dt[t>>2]|0;o=(e&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){_r(a,256,t)|0;e=dt[t>>2]|0}n=n+-256|0;o=(e&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;_r(a,n,t)|0}}while(0);vt=s;return}function Br(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,C=0,A=0,E=0,I=0,O=0,M=0,D=0,z=0,R=0,F=0,j=0;do{if(t>>>0<245){p=t>>>0<11?16:t+11&-8;t=p>>>3;s=dt[151]|0;r=s>>>t;if(r&3){t=(r&1^1)+t|0;i=t<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=dt[i>>2]|0;o=n+8|0;a=dt[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(dt[155]|0)>>>0)Xt();e=a+12|0;if((dt[e>>2]|0)==(n|0)){dt[e>>2]=r;dt[i>>2]=a;break}else Xt()}else dt[151]=s&~(1<>2]=j|3;j=n+(j|4)|0;dt[j>>2]=dt[j>>2]|1;j=o;return j|0}a=dt[153]|0;if(p>>>0>a>>>0){if(r){i=2<>>12&16;i=i>>>l;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;t=i>>>1&1;t=(n|l|o|r|t)+(i>>>t)|0;i=t<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=dt[i>>2]|0;l=o+8|0;n=dt[l>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(dt[155]|0)>>>0)Xt();e=n+12|0;if((dt[e>>2]|0)==(o|0)){dt[e>>2]=r;dt[i>>2]=n;u=dt[153]|0;break}else Xt()}else{dt[151]=s&~(1<>2]=p|3;s=o+p|0;dt[o+(p|4)>>2]=a|1;dt[o+j>>2]=a;if(u){n=dt[156]|0;r=u>>>3;e=r<<1;i=644+(e<<2)|0;t=dt[151]|0;r=1<>2]|0;if(e>>>0<(dt[155]|0)>>>0)Xt();else{h=t;c=e}}else{dt[151]=t|r;h=644+(e+2<<2)|0;c=i}dt[h>>2]=n;dt[c+12>>2]=n;dt[n+8>>2]=c;dt[n+12>>2]=i}dt[153]=a;dt[156]=s;j=l;return j|0}t=dt[152]|0;if(t){r=(t&0-t)+-1|0;F=r>>>12&16;r=r>>>F;R=r>>>5&8;r=r>>>R;j=r>>>2&4;r=r>>>j;t=r>>>1&2;r=r>>>t;i=r>>>1&1;i=dt[908+((R|F|j|t|i)+(r>>>i)<<2)>>2]|0;r=(dt[i+4>>2]&-8)-p|0;t=i;while(1){e=dt[t+16>>2]|0;if(!e){e=dt[t+20>>2]|0;if(!e){l=r;break}}t=(dt[e+4>>2]&-8)-p|0;j=t>>>0>>0;r=j?t:r;t=e;i=j?e:i}o=dt[155]|0;if(i>>>0>>0)Xt();s=i+p|0;if(i>>>0>=s>>>0)Xt();a=dt[i+24>>2]|0;r=dt[i+12>>2]|0;do{if((r|0)==(i|0)){t=i+20|0;e=dt[t>>2]|0;if(!e){t=i+16|0;e=dt[t>>2]|0;if(!e){f=0;break}}while(1){r=e+20|0;n=dt[r>>2]|0;if(n){e=n;t=r;continue}r=e+16|0;n=dt[r>>2]|0;if(!n)break;else{e=n;t=r}}if(t>>>0>>0)Xt();else{dt[t>>2]=0;f=e;break}}else{n=dt[i+8>>2]|0;if(n>>>0>>0)Xt();e=n+12|0;if((dt[e>>2]|0)!=(i|0))Xt();t=r+8|0;if((dt[t>>2]|0)==(i|0)){dt[e>>2]=r;dt[t>>2]=n;f=r;break}else Xt()}}while(0);do{if(a){e=dt[i+28>>2]|0;t=908+(e<<2)|0;if((i|0)==(dt[t>>2]|0)){dt[t>>2]=f;if(!f){dt[152]=dt[152]&~(1<>>0<(dt[155]|0)>>>0)Xt();e=a+16|0;if((dt[e>>2]|0)==(i|0))dt[e>>2]=f;else dt[a+20>>2]=f;if(!f)break}t=dt[155]|0;if(f>>>0>>0)Xt();dt[f+24>>2]=a;e=dt[i+16>>2]|0;do{if(e)if(e>>>0>>0)Xt();else{dt[f+16>>2]=e;dt[e+24>>2]=f;break}}while(0);e=dt[i+20>>2]|0;if(e)if(e>>>0<(dt[155]|0)>>>0)Xt();else{dt[f+20>>2]=e;dt[e+24>>2]=f;break}}}while(0);if(l>>>0<16){j=l+p|0;dt[i+4>>2]=j|3;j=i+(j+4)|0;dt[j>>2]=dt[j>>2]|1}else{dt[i+4>>2]=p|3;dt[i+(p|4)>>2]=l|1;dt[i+(l+p)>>2]=l;e=dt[153]|0;if(e){o=dt[156]|0;r=e>>>3;e=r<<1;n=644+(e<<2)|0;t=dt[151]|0;r=1<>2]|0;if(t>>>0<(dt[155]|0)>>>0)Xt();else{d=e;m=t}}else{dt[151]=t|r;d=644+(e+2<<2)|0;m=n}dt[d>>2]=o;dt[m+12>>2]=o;dt[o+8>>2]=m;dt[o+12>>2]=n}dt[153]=l;dt[156]=s}j=i+8|0;return j|0}else m=p}else m=p}else if(t>>>0<=4294967231){t=t+11|0;c=t&-8;h=dt[152]|0;if(h){r=0-c|0;t=t>>>8;if(t)if(c>>>0>16777215)u=31;else{m=(t+1048320|0)>>>16&8;b=t<>>16&4;b=b<>>16&2;u=14-(d|m|u)+(b<>>15)|0;u=c>>>(u+7|0)&1|u<<1}else u=0;t=dt[908+(u<<2)>>2]|0;t:do{if(!t){n=0;t=0;b=86}else{a=r;n=0;s=c<<((u|0)==31?0:25-(u>>>1)|0);l=t;t=0;while(1){o=dt[l+4>>2]&-8;r=o-c|0;if(r>>>0>>0)if((o|0)==(c|0)){o=l;t=l;b=90;break t}else t=l;else r=a;b=dt[l+20>>2]|0;l=dt[l+16+(s>>>31<<2)>>2]|0;n=(b|0)==0|(b|0)==(l|0)?n:b;if(!l){b=86;break}else{a=r;s=s<<1}}}}while(0);if((b|0)==86){if((n|0)==0&(t|0)==0){t=2<>>12&16;t=t>>>f;h=t>>>5&8;t=t>>>h;d=t>>>2&4;t=t>>>d;m=t>>>1&2;t=t>>>m;n=t>>>1&1;n=dt[908+((h|f|d|m|n)+(t>>>n)<<2)>>2]|0;t=0}if(!n){s=r;l=t}else{o=n;b=90}}if((b|0)==90)while(1){b=0;m=(dt[o+4>>2]&-8)-c|0;n=m>>>0>>0;r=n?m:r;t=n?o:t;n=dt[o+16>>2]|0;if(n){o=n;b=90;continue}o=dt[o+20>>2]|0;if(!o){s=r;l=t;break}else b=90}if((l|0)!=0?s>>>0<((dt[153]|0)-c|0)>>>0:0){n=dt[155]|0;if(l>>>0>>0)Xt();a=l+c|0;if(l>>>0>=a>>>0)Xt();o=dt[l+24>>2]|0;r=dt[l+12>>2]|0;do{if((r|0)==(l|0)){t=l+20|0;e=dt[t>>2]|0;if(!e){t=l+16|0;e=dt[t>>2]|0;if(!e){p=0;break}}while(1){r=e+20|0;i=dt[r>>2]|0;if(i){e=i;t=r;continue}r=e+16|0;i=dt[r>>2]|0;if(!i)break;else{e=i;t=r}}if(t>>>0>>0)Xt();else{dt[t>>2]=0;p=e;break}}else{i=dt[l+8>>2]|0;if(i>>>0>>0)Xt();e=i+12|0;if((dt[e>>2]|0)!=(l|0))Xt();t=r+8|0;if((dt[t>>2]|0)==(l|0)){dt[e>>2]=r;dt[t>>2]=i;p=r;break}else Xt()}}while(0);do{if(o){e=dt[l+28>>2]|0;t=908+(e<<2)|0;if((l|0)==(dt[t>>2]|0)){dt[t>>2]=p;if(!p){dt[152]=dt[152]&~(1<>>0<(dt[155]|0)>>>0)Xt();e=o+16|0;if((dt[e>>2]|0)==(l|0))dt[e>>2]=p;else dt[o+20>>2]=p;if(!p)break}t=dt[155]|0;if(p>>>0>>0)Xt();dt[p+24>>2]=o;e=dt[l+16>>2]|0;do{if(e)if(e>>>0>>0)Xt();else{dt[p+16>>2]=e;dt[e+24>>2]=p;break}}while(0);e=dt[l+20>>2]|0;if(e)if(e>>>0<(dt[155]|0)>>>0)Xt();else{dt[p+20>>2]=e;dt[e+24>>2]=p;break}}}while(0);t:do{if(s>>>0>=16){dt[l+4>>2]=c|3;dt[l+(c|4)>>2]=s|1;dt[l+(s+c)>>2]=s;e=s>>>3;if(s>>>0<256){t=e<<1;i=644+(t<<2)|0;r=dt[151]|0;e=1<>2]|0;if(t>>>0<(dt[155]|0)>>>0)Xt();else{v=e;_=t}}else{dt[151]=r|e;v=644+(t+2<<2)|0;_=i}dt[v>>2]=a;dt[_+12>>2]=a;dt[l+(c+8)>>2]=_;dt[l+(c+12)>>2]=i;break}e=s>>>8;if(e)if(s>>>0>16777215)i=31;else{F=(e+1048320|0)>>>16&8;j=e<>>16&4;j=j<>>16&2;i=14-(R|F|i)+(j<>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;e=908+(i<<2)|0;dt[l+(c+28)>>2]=i;dt[l+(c+20)>>2]=0;dt[l+(c+16)>>2]=0;t=dt[152]|0;r=1<>2]=a;dt[l+(c+24)>>2]=e;dt[l+(c+12)>>2]=a;dt[l+(c+8)>>2]=a;break}e=dt[e>>2]|0;e:do{if((dt[e+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){t=e+16+(i>>>31<<2)|0;r=dt[t>>2]|0;if(!r)break;if((dt[r+4>>2]&-8|0)==(s|0)){T=r;break e}else{i=i<<1;e=r}}if(t>>>0<(dt[155]|0)>>>0)Xt();else{dt[t>>2]=a;dt[l+(c+24)>>2]=e;dt[l+(c+12)>>2]=a;dt[l+(c+8)>>2]=a;break t}}else T=e}while(0);e=T+8|0;t=dt[e>>2]|0;j=dt[155]|0;if(t>>>0>=j>>>0&T>>>0>=j>>>0){dt[t+12>>2]=a;dt[e>>2]=a;dt[l+(c+8)>>2]=t;dt[l+(c+12)>>2]=T;dt[l+(c+24)>>2]=0;break}else Xt()}else{j=s+c|0;dt[l+4>>2]=j|3;j=l+(j+4)|0;dt[j>>2]=dt[j>>2]|1}}while(0);j=l+8|0;return j|0}else m=c}else m=c}else m=-1}while(0);r=dt[153]|0;if(r>>>0>=m>>>0){e=r-m|0;t=dt[156]|0;if(e>>>0>15){dt[156]=t+m;dt[153]=e;dt[t+(m+4)>>2]=e|1;dt[t+r>>2]=e;dt[t+4>>2]=m|3}else{dt[153]=0;dt[156]=0;dt[t+4>>2]=r|3;j=t+(r+4)|0;dt[j>>2]=dt[j>>2]|1}j=t+8|0;return j|0}t=dt[154]|0;if(t>>>0>m>>>0){F=t-m|0;dt[154]=F;j=dt[157]|0;dt[157]=j+m;dt[j+(m+4)>>2]=F|1;dt[j+4>>2]=m|3;j=j+8|0;return j|0}do{if(!(dt[269]|0)){t=Dt(30)|0;if(!(t+-1&t)){dt[271]=t;dt[270]=t;dt[272]=-1;dt[273]=-1;dt[274]=0;dt[262]=0;T=(qt(0)|0)&-16^1431655768;dt[269]=T;break}else Xt()}}while(0);l=m+48|0;s=dt[271]|0;u=m+47|0;a=s+u|0;s=0-s|0;h=a&s;if(h>>>0<=m>>>0){j=0;return j|0}t=dt[261]|0;if((t|0)!=0?(_=dt[259]|0,T=_+h|0,T>>>0<=_>>>0|T>>>0>t>>>0):0){j=0;return j|0}t:do{if(!(dt[262]&4)){t=dt[157]|0;e:do{if(t){n=1052;while(1){r=dt[n>>2]|0;if(r>>>0<=t>>>0?(g=n+4|0,(r+(dt[g>>2]|0)|0)>>>0>t>>>0):0){o=n;t=g;break}n=dt[n+8>>2]|0;if(!n){b=174;break e}}r=a-(dt[154]|0)&s;if(r>>>0<2147483647){n=It(r|0)|0;T=(n|0)==((dt[o>>2]|0)+(dt[t>>2]|0)|0);t=T?r:0;if(T){if((n|0)!=(-1|0)){x=n;d=t;b=194;break t}}else b=184}else t=0}else b=174}while(0);do{if((b|0)==174){o=It(0)|0;if((o|0)!=(-1|0)){t=o;r=dt[270]|0;n=r+-1|0;if(!(n&t))r=h;else r=h-t+(n+t&0-r)|0;t=dt[259]|0;n=t+r|0;if(r>>>0>m>>>0&r>>>0<2147483647){T=dt[261]|0;if((T|0)!=0?n>>>0<=t>>>0|n>>>0>T>>>0:0){t=0;break}n=It(r|0)|0;T=(n|0)==(o|0);t=T?r:0;if(T){x=o;d=t;b=194;break t}else b=184}else t=0}else t=0}}while(0);e:do{if((b|0)==184){o=0-r|0;do{if(l>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(y=dt[271]|0,y=u-r+y&0-y,y>>>0<2147483647):0)if((It(y|0)|0)==(-1|0)){It(o|0)|0;break e}else{r=y+r|0;break}}while(0);if((n|0)!=(-1|0)){x=n;d=r;b=194;break t}}}while(0);dt[262]=dt[262]|4;b=191}else{t=0;b=191}}while(0);if((((b|0)==191?h>>>0<2147483647:0)?(x=It(h|0)|0,w=It(0)|0,x>>>0>>0&((x|0)!=(-1|0)&(w|0)!=(-1|0))):0)?(k=w-x|0,S=k>>>0>(m+40|0)>>>0,S):0){d=S?k:t;b=194}if((b|0)==194){t=(dt[259]|0)+d|0;dt[259]=t;if(t>>>0>(dt[260]|0)>>>0)dt[260]=t;a=dt[157]|0;t:do{if(a){o=1052;do{t=dt[o>>2]|0;r=o+4|0;n=dt[r>>2]|0;if((x|0)==(t+n|0)){P=t;C=r;A=n;E=o;b=204;break}o=dt[o+8>>2]|0}while((o|0)!=0);if(((b|0)==204?(dt[E+12>>2]&8|0)==0:0)?a>>>0>>0&a>>>0>=P>>>0:0){dt[C>>2]=A+d;j=(dt[154]|0)+d|0;F=a+8|0;F=(F&7|0)==0?0:0-F&7;R=j-F|0;dt[157]=a+F;dt[154]=R;dt[a+(F+4)>>2]=R|1;dt[a+(j+4)>>2]=40;dt[158]=dt[273];break}t=dt[155]|0;if(x>>>0>>0){dt[155]=x;t=x}r=x+d|0;o=1052;while(1){if((dt[o>>2]|0)==(r|0)){n=o;r=o;b=212;break}o=dt[o+8>>2]|0;if(!o){r=1052;break}}if((b|0)==212)if(!(dt[r+12>>2]&8)){dt[n>>2]=x;f=r+4|0;dt[f>>2]=(dt[f>>2]|0)+d;f=x+8|0;f=(f&7|0)==0?0:0-f&7;u=x+(d+8)|0;u=(u&7|0)==0?0:0-u&7;e=x+(u+d)|0;c=f+m|0;p=x+c|0;h=e-(x+f)-m|0;dt[x+(f+4)>>2]=m|3;e:do{if((e|0)!=(a|0)){if((e|0)==(dt[156]|0)){j=(dt[153]|0)+h|0;dt[153]=j;dt[156]=p;dt[x+(c+4)>>2]=j|1;dt[x+(j+c)>>2]=j;break}s=d+4|0;r=dt[x+(s+u)>>2]|0;if((r&3|0)==1){l=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=dt[x+((u|24)+d)>>2]|0;i=dt[x+(d+12+u)>>2]|0;do{if((i|0)==(e|0)){n=u|16;i=x+(s+n)|0;r=dt[i>>2]|0;if(!r){i=x+(n+d)|0;r=dt[i>>2]|0;if(!r){z=0;break}}while(1){n=r+20|0;o=dt[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=dt[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xt();else{dt[i>>2]=0;z=r;break}}else{n=dt[x+((u|8)+d)>>2]|0;if(n>>>0>>0)Xt();t=n+12|0;if((dt[t>>2]|0)!=(e|0))Xt();r=i+8|0;if((dt[r>>2]|0)==(e|0)){dt[t>>2]=i;dt[r>>2]=n;z=i;break}else Xt()}}while(0);if(!a)break;t=dt[x+(d+28+u)>>2]|0;r=908+(t<<2)|0;do{if((e|0)!=(dt[r>>2]|0)){if(a>>>0<(dt[155]|0)>>>0)Xt();t=a+16|0;if((dt[t>>2]|0)==(e|0))dt[t>>2]=z;else dt[a+20>>2]=z;if(!z)break r}else{dt[r>>2]=z;if(z)break;dt[152]=dt[152]&~(1<>>0>>0)Xt();dt[z+24>>2]=a;e=u|16;t=dt[x+(e+d)>>2]|0;do{if(t)if(t>>>0>>0)Xt();else{dt[z+16>>2]=t;dt[t+24>>2]=z;break}}while(0);e=dt[x+(s+e)>>2]|0;if(!e)break;if(e>>>0<(dt[155]|0)>>>0)Xt();else{dt[z+20>>2]=e;dt[e+24>>2]=z;break}}else{i=dt[x+((u|8)+d)>>2]|0;n=dt[x+(d+12+u)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0>>0)Xt();if((dt[i+12>>2]|0)==(e|0))break;Xt()}}while(0);if((n|0)==(i|0)){dt[151]=dt[151]&~(1<>>0>>0)Xt();t=n+8|0;if((dt[t>>2]|0)==(e|0)){I=t;break}Xt()}}while(0);dt[i+12>>2]=n;dt[I>>2]=i}}while(0);e=x+((l|u)+d)|0;n=l+h|0}else n=h;e=e+4|0;dt[e>>2]=dt[e>>2]&-2;dt[x+(c+4)>>2]=n|1;dt[x+(n+c)>>2]=n;e=n>>>3;if(n>>>0<256){t=e<<1;i=644+(t<<2)|0;r=dt[151]|0;e=1<>2]|0;if(t>>>0>=(dt[155]|0)>>>0){R=e;F=t;break}Xt()}}while(0);dt[R>>2]=p;dt[F+12>>2]=p;dt[x+(c+8)>>2]=F;dt[x+(c+12)>>2]=i;break}e=n>>>8;do{if(!e)i=0;else{if(n>>>0>16777215){i=31;break}R=(e+1048320|0)>>>16&8;F=e<>>16&4;F=F<>>16&2;i=14-(z|R|i)+(F<>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);e=908+(i<<2)|0;dt[x+(c+28)>>2]=i;dt[x+(c+20)>>2]=0;dt[x+(c+16)>>2]=0;t=dt[152]|0;r=1<>2]=p;dt[x+(c+24)>>2]=e;dt[x+(c+12)>>2]=p;dt[x+(c+8)>>2]=p;break}e=dt[e>>2]|0;r:do{if((dt[e+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){t=e+16+(i>>>31<<2)|0;r=dt[t>>2]|0;if(!r)break;if((dt[r+4>>2]&-8|0)==(n|0)){j=r;break r}else{i=i<<1;e=r}}if(t>>>0<(dt[155]|0)>>>0)Xt();else{dt[t>>2]=p;dt[x+(c+24)>>2]=e;dt[x+(c+12)>>2]=p;dt[x+(c+8)>>2]=p;break e}}else j=e}while(0);e=j+8|0;t=dt[e>>2]|0;F=dt[155]|0;if(t>>>0>=F>>>0&j>>>0>=F>>>0){dt[t+12>>2]=p;dt[e>>2]=p;dt[x+(c+8)>>2]=t;dt[x+(c+12)>>2]=j;dt[x+(c+24)>>2]=0;break}else Xt()}else{j=(dt[154]|0)+h|0;dt[154]=j;dt[157]=p;dt[x+(c+4)>>2]=j|1}}while(0);j=x+(f|8)|0;return j|0}else r=1052;while(1){t=dt[r>>2]|0;if(t>>>0<=a>>>0?(e=dt[r+4>>2]|0,i=t+e|0,i>>>0>a>>>0):0)break;r=dt[r+8>>2]|0}n=t+(e+-39)|0;t=t+(e+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;t=t>>>0>>0?a:t;e=t+8|0;r=x+8|0;r=(r&7|0)==0?0:0-r&7;j=d+-40-r|0;dt[157]=x+r;dt[154]=j;dt[x+(r+4)>>2]=j|1;dt[x+(d+-36)>>2]=40;dt[158]=dt[273];r=t+4|0;dt[r>>2]=27;dt[e>>2]=dt[263];dt[e+4>>2]=dt[264];dt[e+8>>2]=dt[265];dt[e+12>>2]=dt[266];dt[263]=x;dt[264]=d;dt[266]=0;dt[265]=e;e=t+28|0;dt[e>>2]=7;if((t+32|0)>>>0>>0)do{j=e;e=e+4|0;dt[e>>2]=7}while((j+8|0)>>>0>>0);if((t|0)!=(a|0)){o=t-a|0;dt[r>>2]=dt[r>>2]&-2;dt[a+4>>2]=o|1;dt[t>>2]=o;e=o>>>3;if(o>>>0<256){t=e<<1;i=644+(t<<2)|0;r=dt[151]|0;e=1<>2]|0;if(t>>>0<(dt[155]|0)>>>0)Xt();else{O=e;M=t}}else{dt[151]=r|e;O=644+(t+2<<2)|0;M=i}dt[O>>2]=a;dt[M+12>>2]=a;dt[a+8>>2]=M;dt[a+12>>2]=i;break}e=o>>>8;if(e)if(o>>>0>16777215)i=31;else{F=(e+1048320|0)>>>16&8;j=e<>>16&4;j=j<>>16&2;i=14-(R|F|i)+(j<>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;dt[a+28>>2]=i;dt[a+20>>2]=0;dt[n>>2]=0;e=dt[152]|0;t=1<>2]=a;dt[a+24>>2]=r;dt[a+12>>2]=a;dt[a+8>>2]=a;break}e=dt[r>>2]|0;e:do{if((dt[e+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){t=e+16+(i>>>31<<2)|0;r=dt[t>>2]|0;if(!r)break;if((dt[r+4>>2]&-8|0)==(o|0)){D=r;break e}else{i=i<<1;e=r}}if(t>>>0<(dt[155]|0)>>>0)Xt();else{dt[t>>2]=a;dt[a+24>>2]=e;dt[a+12>>2]=a;dt[a+8>>2]=a;break t}}else D=e}while(0);e=D+8|0;t=dt[e>>2]|0;j=dt[155]|0;if(t>>>0>=j>>>0&D>>>0>=j>>>0){dt[t+12>>2]=a;dt[e>>2]=a;dt[a+8>>2]=t;dt[a+12>>2]=D;dt[a+24>>2]=0;break}else Xt()}}else{j=dt[155]|0;if((j|0)==0|x>>>0>>0)dt[155]=x;dt[263]=x;dt[264]=d;dt[266]=0;dt[160]=dt[269];dt[159]=-1;e=0;do{j=e<<1;F=644+(j<<2)|0;dt[644+(j+3<<2)>>2]=F;dt[644+(j+2<<2)>>2]=F;e=e+1|0}while((e|0)!=32);j=x+8|0;j=(j&7|0)==0?0:0-j&7;F=d+-40-j|0;dt[157]=x+j;dt[154]=F;dt[x+(j+4)>>2]=F|1;dt[x+(d+-36)>>2]=40;dt[158]=dt[273]}}while(0);e=dt[154]|0;if(e>>>0>m>>>0){F=e-m|0;dt[154]=F;j=dt[157]|0;dt[157]=j+m;dt[j+(m+4)>>2]=F|1;dt[j+4>>2]=m|3;j=j+8|0;return j|0}}j=hr()|0;dt[j>>2]=12;j=0;return j|0}function Ur(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0;if(!t)return;e=t+-8|0;s=dt[155]|0;if(e>>>0>>0)Xt();r=dt[t+-4>>2]|0;i=r&3;if((i|0)==1)Xt();p=r&-8;m=t+(p+-8)|0;do{if(!(r&1)){e=dt[e>>2]|0;if(!i)return;l=-8-e|0;h=t+l|0;c=e+p|0;if(h>>>0>>0)Xt();if((h|0)==(dt[156]|0)){e=t+(p+-4)|0;r=dt[e>>2]|0;if((r&3|0)!=3){y=h;o=c;break}dt[153]=c;dt[e>>2]=r&-2;dt[t+(l+4)>>2]=c|1;dt[m>>2]=c;return}n=e>>>3;if(e>>>0<256){i=dt[t+(l+8)>>2]|0;r=dt[t+(l+12)>>2]|0;e=644+(n<<1<<2)|0;if((i|0)!=(e|0)){if(i>>>0>>0)Xt();if((dt[i+12>>2]|0)!=(h|0))Xt()}if((r|0)==(i|0)){dt[151]=dt[151]&~(1<>>0>>0)Xt();e=r+8|0;if((dt[e>>2]|0)==(h|0))a=e;else Xt()}else a=r+8|0;dt[i+12>>2]=r;dt[a>>2]=i;y=h;o=c;break}a=dt[t+(l+24)>>2]|0;i=dt[t+(l+12)>>2]|0;do{if((i|0)==(h|0)){r=t+(l+20)|0;e=dt[r>>2]|0;if(!e){r=t+(l+16)|0;e=dt[r>>2]|0;if(!e){u=0;break}}while(1){i=e+20|0;n=dt[i>>2]|0;if(n){e=n;r=i;continue}i=e+16|0;n=dt[i>>2]|0;if(!n)break;else{e=n;r=i}}if(r>>>0>>0)Xt();else{dt[r>>2]=0;u=e;break}}else{n=dt[t+(l+8)>>2]|0;if(n>>>0>>0)Xt();e=n+12|0;if((dt[e>>2]|0)!=(h|0))Xt();r=i+8|0;if((dt[r>>2]|0)==(h|0)){dt[e>>2]=i;dt[r>>2]=n;u=i;break}else Xt()}}while(0);if(a){e=dt[t+(l+28)>>2]|0;r=908+(e<<2)|0;if((h|0)==(dt[r>>2]|0)){dt[r>>2]=u;if(!u){dt[152]=dt[152]&~(1<>>0<(dt[155]|0)>>>0)Xt();e=a+16|0;if((dt[e>>2]|0)==(h|0))dt[e>>2]=u;else dt[a+20>>2]=u;if(!u){y=h;o=c;break}}r=dt[155]|0;if(u>>>0>>0)Xt();dt[u+24>>2]=a;e=dt[t+(l+16)>>2]|0;do{if(e)if(e>>>0>>0)Xt();else{dt[u+16>>2]=e;dt[e+24>>2]=u;break}}while(0);e=dt[t+(l+20)>>2]|0;if(e)if(e>>>0<(dt[155]|0)>>>0)Xt();else{dt[u+20>>2]=e;dt[e+24>>2]=u;y=h;o=c;break}else{y=h;o=c}}else{y=h;o=c}}else{y=e;o=p}}while(0);if(y>>>0>=m>>>0)Xt();e=t+(p+-4)|0;r=dt[e>>2]|0;if(!(r&1))Xt();if(!(r&2)){if((m|0)==(dt[157]|0)){_=(dt[154]|0)+o|0;dt[154]=_;dt[157]=y;dt[y+4>>2]=_|1;if((y|0)!=(dt[156]|0))return;dt[156]=0;dt[153]=0;return}if((m|0)==(dt[156]|0)){_=(dt[153]|0)+o|0;dt[153]=_;dt[156]=y;dt[y+4>>2]=_|1;dt[y+_>>2]=_;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=dt[t+(p+16)>>2]|0;e=dt[t+(p|4)>>2]|0;do{if((e|0)==(m|0)){r=t+(p+12)|0;e=dt[r>>2]|0;if(!e){r=t+(p+8)|0;e=dt[r>>2]|0;if(!e){d=0;break}}while(1){i=e+20|0;n=dt[i>>2]|0;if(n){e=n;r=i;continue}i=e+16|0;n=dt[i>>2]|0;if(!n)break;else{e=n;r=i}}if(r>>>0<(dt[155]|0)>>>0)Xt();else{dt[r>>2]=0;d=e;break}}else{r=dt[t+p>>2]|0;if(r>>>0<(dt[155]|0)>>>0)Xt();i=r+12|0;if((dt[i>>2]|0)!=(m|0))Xt();n=e+8|0;if((dt[n>>2]|0)==(m|0)){dt[i>>2]=e;dt[n>>2]=r;d=e;break}else Xt()}}while(0);if(a){e=dt[t+(p+20)>>2]|0;r=908+(e<<2)|0;if((m|0)==(dt[r>>2]|0)){dt[r>>2]=d;if(!d){dt[152]=dt[152]&~(1<>>0<(dt[155]|0)>>>0)Xt();e=a+16|0;if((dt[e>>2]|0)==(m|0))dt[e>>2]=d;else dt[a+20>>2]=d;if(!d)break}r=dt[155]|0;if(d>>>0>>0)Xt();dt[d+24>>2]=a;e=dt[t+(p+8)>>2]|0;do{if(e)if(e>>>0>>0)Xt();else{dt[d+16>>2]=e;dt[e+24>>2]=d;break}}while(0);e=dt[t+(p+12)>>2]|0;if(e)if(e>>>0<(dt[155]|0)>>>0)Xt();else{dt[d+20>>2]=e;dt[e+24>>2]=d;break}}}else{i=dt[t+p>>2]|0;r=dt[t+(p|4)>>2]|0;e=644+(n<<1<<2)|0;if((i|0)!=(e|0)){if(i>>>0<(dt[155]|0)>>>0)Xt();if((dt[i+12>>2]|0)!=(m|0))Xt()}if((r|0)==(i|0)){dt[151]=dt[151]&~(1<>>0<(dt[155]|0)>>>0)Xt();e=r+8|0;if((dt[e>>2]|0)==(m|0))f=e;else Xt()}else f=r+8|0;dt[i+12>>2]=r;dt[f>>2]=i}}while(0);dt[y+4>>2]=o|1;dt[y+o>>2]=o;if((y|0)==(dt[156]|0)){dt[153]=o;return}}else{dt[e>>2]=r&-2;dt[y+4>>2]=o|1;dt[y+o>>2]=o}e=o>>>3;if(o>>>0<256){r=e<<1;n=644+(r<<2)|0;i=dt[151]|0;e=1<>2]|0;if(r>>>0<(dt[155]|0)>>>0)Xt();else{g=e;v=r}}else{dt[151]=i|e;g=644+(r+2<<2)|0;v=n}dt[g>>2]=y;dt[v+12>>2]=y;dt[y+8>>2]=v;dt[y+12>>2]=n;return}e=o>>>8;if(e)if(o>>>0>16777215)n=31;else{g=(e+1048320|0)>>>16&8;v=e<>>16&4;v=v<>>16&2;n=14-(m|g|n)+(v<>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;e=908+(n<<2)|0;dt[y+28>>2]=n;dt[y+20>>2]=0;dt[y+16>>2]=0;r=dt[152]|0;i=1<>2]|0;e:do{if((dt[e+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=e+16+(n>>>31<<2)|0;i=dt[r>>2]|0;if(!i)break;if((dt[i+4>>2]&-8|0)==(o|0)){_=i;break e}else{n=n<<1;e=i}}if(r>>>0<(dt[155]|0)>>>0)Xt();else{dt[r>>2]=y;dt[y+24>>2]=e;dt[y+12>>2]=y;dt[y+8>>2]=y;break t}}else _=e}while(0);e=_+8|0;r=dt[e>>2]|0;v=dt[155]|0;if(r>>>0>=v>>>0&_>>>0>=v>>>0){dt[r+12>>2]=y;dt[e>>2]=y;dt[y+8>>2]=r;dt[y+12>>2]=_;dt[y+24>>2]=0;break}else Xt()}else{dt[152]=r|i;dt[e>>2]=y;dt[y+24>>2]=e;dt[y+12>>2]=y;dt[y+8>>2]=y}}while(0);y=(dt[159]|0)+-1|0;dt[159]=y;if(!y)e=1060;else return;while(1){e=dt[e>>2]|0;if(!e)break;else e=e+8|0}dt[159]=-1;return}function Xr(t,e){t=t|0;e=e|0;var r=0,i=0;if(!t){t=Br(e)|0;return t|0}if(e>>>0>4294967231){t=hr()|0;dt[t>>2]=12;t=0;return t|0}r=qr(t+-8|0,e>>>0<11?16:e+11&-8)|0;if(r){t=r+8|0;return t|0}r=Br(e)|0;if(!r){t=0;return t|0}i=dt[t+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,t|0,(i>>>0>>0?i:e)|0)|0;Ur(t);t=r;return t|0}function Hr(t){t=t|0;var e=0;if(!t){e=0;return e|0}t=dt[t+-4>>2]|0;e=t&3;if((e|0)==1){e=0;return e|0}e=(t&-8)-((e|0)==0?8:4)|0;return e|0}function qr(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0;p=t+4|0;d=dt[p>>2]|0;l=d&-8;h=t+l|0;s=dt[155]|0;r=d&3;if(!((r|0)!=1&t>>>0>=s>>>0&t>>>0>>0))Xt();i=t+(l|4)|0;n=dt[i>>2]|0;if(!(n&1))Xt();if(!r){if(e>>>0<256){t=0;return t|0}if(l>>>0>=(e+4|0)>>>0?(l-e|0)>>>0<=dt[271]<<1>>>0:0)return t|0;t=0;return t|0}if(l>>>0>=e>>>0){r=l-e|0;if(r>>>0<=15)return t|0;dt[p>>2]=d&1|e|2;dt[t+(e+4)>>2]=r|3;dt[i>>2]=dt[i>>2]|1;Wr(t+e|0,r);return t|0}if((h|0)==(dt[157]|0)){r=(dt[154]|0)+l|0;if(r>>>0<=e>>>0){t=0;return t|0}f=r-e|0;dt[p>>2]=d&1|e|2;dt[t+(e+4)>>2]=f|1;dt[157]=t+e;dt[154]=f;return t|0}if((h|0)==(dt[156]|0)){i=(dt[153]|0)+l|0;if(i>>>0>>0){t=0;return t|0}r=i-e|0;if(r>>>0>15){dt[p>>2]=d&1|e|2;dt[t+(e+4)>>2]=r|1;dt[t+i>>2]=r;i=t+(i+4)|0;dt[i>>2]=dt[i>>2]&-2;i=t+e|0}else{dt[p>>2]=d&1|i|2;i=t+(i+4)|0;dt[i>>2]=dt[i>>2]|1;i=0;r=0}dt[153]=r;dt[156]=i;return t|0}if(n&2){t=0;return t|0}c=(n&-8)+l|0;if(c>>>0>>0){t=0;return t|0}f=c-e|0;o=n>>>3;do{if(n>>>0>=256){a=dt[t+(l+24)>>2]|0;o=dt[t+(l+12)>>2]|0;do{if((o|0)==(h|0)){i=t+(l+20)|0;r=dt[i>>2]|0;if(!r){i=t+(l+16)|0;r=dt[i>>2]|0;if(!r){u=0;break}}while(1){n=r+20|0;o=dt[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=dt[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xt();else{dt[i>>2]=0;u=r;break}}else{n=dt[t+(l+8)>>2]|0;if(n>>>0>>0)Xt();r=n+12|0;if((dt[r>>2]|0)!=(h|0))Xt();i=o+8|0;if((dt[i>>2]|0)==(h|0)){dt[r>>2]=o;dt[i>>2]=n;u=o;break}else Xt()}}while(0);if(a){r=dt[t+(l+28)>>2]|0;i=908+(r<<2)|0;if((h|0)==(dt[i>>2]|0)){dt[i>>2]=u;if(!u){dt[152]=dt[152]&~(1<>>0<(dt[155]|0)>>>0)Xt();r=a+16|0;if((dt[r>>2]|0)==(h|0))dt[r>>2]=u;else dt[a+20>>2]=u;if(!u)break}i=dt[155]|0;if(u>>>0>>0)Xt();dt[u+24>>2]=a;r=dt[t+(l+16)>>2]|0;do{if(r)if(r>>>0>>0)Xt();else{dt[u+16>>2]=r;dt[r+24>>2]=u;break}}while(0);r=dt[t+(l+20)>>2]|0;if(r)if(r>>>0<(dt[155]|0)>>>0)Xt();else{dt[u+20>>2]=r;dt[r+24>>2]=u;break}}}else{n=dt[t+(l+8)>>2]|0;i=dt[t+(l+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xt();if((dt[n+12>>2]|0)!=(h|0))Xt()}if((i|0)==(n|0)){dt[151]=dt[151]&~(1<>>0>>0)Xt();r=i+8|0;if((dt[r>>2]|0)==(h|0))a=r;else Xt()}else a=i+8|0;dt[n+12>>2]=i;dt[a>>2]=n}}while(0);if(f>>>0<16){dt[p>>2]=c|d&1|2;e=t+(c|4)|0;dt[e>>2]=dt[e>>2]|1;return t|0}else{dt[p>>2]=d&1|e|2;dt[t+(e+4)>>2]=f|3;d=t+(c|4)|0;dt[d>>2]=dt[d>>2]|1;Wr(t+e|0,f);return t|0}return 0}function Wr(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0;m=t+e|0;r=dt[t+4>>2]|0;do{if(!(r&1)){u=dt[t>>2]|0;if(!(r&3))return;f=t+(0-u)|0;c=u+e|0;l=dt[155]|0;if(f>>>0>>0)Xt();if((f|0)==(dt[156]|0)){i=t+(e+4)|0;r=dt[i>>2]|0;if((r&3|0)!=3){_=f;a=c;break}dt[153]=c;dt[i>>2]=r&-2;dt[t+(4-u)>>2]=c|1;dt[m>>2]=c;return}o=u>>>3;if(u>>>0<256){n=dt[t+(8-u)>>2]|0;i=dt[t+(12-u)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xt();if((dt[n+12>>2]|0)!=(f|0))Xt()}if((i|0)==(n|0)){dt[151]=dt[151]&~(1<>>0>>0)Xt();r=i+8|0;if((dt[r>>2]|0)==(f|0))s=r;else Xt()}else s=i+8|0;dt[n+12>>2]=i;dt[s>>2]=n;_=f;a=c;break}s=dt[t+(24-u)>>2]|0;n=dt[t+(12-u)>>2]|0;do{if((n|0)==(f|0)){n=16-u|0;i=t+(n+4)|0;r=dt[i>>2]|0;if(!r){i=t+n|0;r=dt[i>>2]|0;if(!r){h=0;break}}while(1){n=r+20|0;o=dt[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=dt[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xt();else{dt[i>>2]=0;h=r;break}}else{o=dt[t+(8-u)>>2]|0;if(o>>>0>>0)Xt();r=o+12|0;if((dt[r>>2]|0)!=(f|0))Xt();i=n+8|0;if((dt[i>>2]|0)==(f|0)){dt[r>>2]=n;dt[i>>2]=o;h=n;break}else Xt()}}while(0);if(s){r=dt[t+(28-u)>>2]|0;i=908+(r<<2)|0;if((f|0)==(dt[i>>2]|0)){dt[i>>2]=h;if(!h){dt[152]=dt[152]&~(1<>>0<(dt[155]|0)>>>0)Xt();r=s+16|0;if((dt[r>>2]|0)==(f|0))dt[r>>2]=h;else dt[s+20>>2]=h;if(!h){_=f;a=c;break}}n=dt[155]|0;if(h>>>0>>0)Xt();dt[h+24>>2]=s;r=16-u|0;i=dt[t+r>>2]|0;do{if(i)if(i>>>0>>0)Xt();else{dt[h+16>>2]=i;dt[i+24>>2]=h;break}}while(0);r=dt[t+(r+4)>>2]|0;if(r)if(r>>>0<(dt[155]|0)>>>0)Xt();else{dt[h+20>>2]=r;dt[r+24>>2]=h;_=f;a=c;break}else{_=f;a=c}}else{_=f;a=c}}else{_=t;a=e}}while(0);l=dt[155]|0;if(m>>>0>>0)Xt();r=t+(e+4)|0;i=dt[r>>2]|0;if(!(i&2)){if((m|0)==(dt[157]|0)){v=(dt[154]|0)+a|0;dt[154]=v;dt[157]=_;dt[_+4>>2]=v|1;if((_|0)!=(dt[156]|0))return;dt[156]=0;dt[153]=0;return}if((m|0)==(dt[156]|0)){v=(dt[153]|0)+a|0;dt[153]=v;dt[156]=_;dt[_+4>>2]=v|1;dt[_+v>>2]=v;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=dt[t+(e+24)>>2]|0;n=dt[t+(e+12)>>2]|0;do{if((n|0)==(m|0)){i=t+(e+20)|0;r=dt[i>>2]|0;if(!r){i=t+(e+16)|0;r=dt[i>>2]|0;if(!r){d=0;break}}while(1){n=r+20|0;o=dt[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=dt[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xt();else{dt[i>>2]=0;d=r;break}}else{o=dt[t+(e+8)>>2]|0;if(o>>>0>>0)Xt();r=o+12|0;if((dt[r>>2]|0)!=(m|0))Xt();i=n+8|0;if((dt[i>>2]|0)==(m|0)){dt[r>>2]=n;dt[i>>2]=o;d=n;break}else Xt()}}while(0);if(s){r=dt[t+(e+28)>>2]|0;i=908+(r<<2)|0;if((m|0)==(dt[i>>2]|0)){dt[i>>2]=d;if(!d){dt[152]=dt[152]&~(1<>>0<(dt[155]|0)>>>0)Xt();r=s+16|0;if((dt[r>>2]|0)==(m|0))dt[r>>2]=d;else dt[s+20>>2]=d;if(!d)break}i=dt[155]|0;if(d>>>0>>0)Xt();dt[d+24>>2]=s;r=dt[t+(e+16)>>2]|0;do{if(r)if(r>>>0>>0)Xt();else{dt[d+16>>2]=r;dt[r+24>>2]=d;break}}while(0);r=dt[t+(e+20)>>2]|0;if(r)if(r>>>0<(dt[155]|0)>>>0)Xt();else{dt[d+20>>2]=r;dt[r+24>>2]=d;break}}}else{n=dt[t+(e+8)>>2]|0;i=dt[t+(e+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xt();if((dt[n+12>>2]|0)!=(m|0))Xt()}if((i|0)==(n|0)){dt[151]=dt[151]&~(1<>>0>>0)Xt();r=i+8|0;if((dt[r>>2]|0)==(m|0))p=r;else Xt()}else p=i+8|0;dt[n+12>>2]=i;dt[p>>2]=n}}while(0);dt[_+4>>2]=a|1;dt[_+a>>2]=a;if((_|0)==(dt[156]|0)){dt[153]=a;return}}else{dt[r>>2]=i&-2;dt[_+4>>2]=a|1;dt[_+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=dt[151]|0;r=1<>2]|0;if(i>>>0<(dt[155]|0)>>>0)Xt();else{g=r;v=i}}else{dt[151]=n|r;g=644+(i+2<<2)|0;v=o}dt[g>>2]=_;dt[v+12>>2]=_;dt[_+8>>2]=v;dt[_+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{g=(r+1048320|0)>>>16&8;v=r<>>16&4;v=v<>>16&2;o=14-(m|g|o)+(v<>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;dt[_+28>>2]=o;dt[_+20>>2]=0;dt[_+16>>2]=0;i=dt[152]|0;n=1<>2]=_;dt[_+24>>2]=r;dt[_+12>>2]=_;dt[_+8>>2]=_;return}r=dt[r>>2]|0;t:do{if((dt[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=dt[i>>2]|0;if(!n)break;if((dt[n+4>>2]&-8|0)==(a|0)){r=n;break t}else{o=o<<1;r=n}}if(i>>>0<(dt[155]|0)>>>0)Xt();dt[i>>2]=_;dt[_+24>>2]=r;dt[_+12>>2]=_;dt[_+8>>2]=_;return}}while(0);i=r+8|0;n=dt[i>>2]|0;v=dt[155]|0;if(!(n>>>0>=v>>>0&r>>>0>=v>>>0))Xt();dt[n+12>>2]=_;dt[i>>2]=_;dt[_+8>>2]=n;dt[_+12>>2]=r;dt[_+24>>2]=0;return}function Gr(){}function Vr(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;i=e-i-(r>>>0>t>>>0|0)>>>0;return(rt=i,t-r>>>0|0)|0}function Yr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0,a=0;i=t+r|0;if((r|0)>=20){e=e&255;o=t&3;a=e|e<<8|e<<16|e<<24;n=i&~3;if(o){o=t+4-o|0;while((t|0)<(o|0)){pt[t>>0]=e;t=t+1|0}}while((t|0)<(n|0)){dt[t>>2]=a;t=t+4|0}}while((t|0)<(i|0)){pt[t>>0]=e;t=t+1|0}return t-r|0}function Zr(t,e,r){t=t|0;e=e|0;r=r|0;if((r|0)<32){rt=e>>>r;return t>>>r|(e&(1<>>r-32|0}function Jr(t,e,r){t=t|0;e=e|0;r=r|0;if((r|0)<32){rt=e<>>32-r;return t<>>0;return(rt=e+i+(r>>>0>>0|0)>>>0,r|0)|0}function Qr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0;if((r|0)>=4096)return Mt(t|0,e|0,r|0)|0;i=t|0;if((t&3)==(e&3)){while(t&3){if(!r)return i|0;pt[t>>0]=pt[e>>0]|0;t=t+1|0;e=e+1|0;r=r-1|0}while((r|0)>=4){dt[t>>2]=dt[e>>2];t=t+4|0;e=e+4|0;r=r-4|0}}while((r|0)>0){pt[t>>0]=pt[e>>0]|0;t=t+1|0;e=e+1|0;r=r-1|0}return i|0}function $r(t,e,r){t=t|0;e=e|0;r=r|0;if((r|0)<32){rt=e>>r;return t>>>r|(e&(1<>r-32|0}function ti(t){t=t|0;var e=0;e=pt[g+(t&255)>>0]|0;if((e|0)<8)return e|0;e=pt[g+(t>>8&255)>>0]|0;if((e|0)<8)return e+8|0;e=pt[g+(t>>16&255)>>0]|0;if((e|0)<8)return e+16|0;return(pt[g+(t>>>24)>>0]|0)+24|0}function ei(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0;o=t&65535;n=e&65535;r=_t(n,o)|0;i=t>>>16;t=(r>>>16)+(_t(n,i)|0)|0;n=e>>>16;e=_t(n,o)|0;return(rt=(t>>>16)+(_t(n,i)|0)+(((t&65535)+e|0)>>>16)|0,t+e<<16|r&65535|0)|0}function ri(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0;u=e>>31|((e|0)<0?-1:0)<<1;l=((e|0)<0?-1:0)>>31|((e|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Vr(u^t,l^e,u,l)|0;a=rt;t=o^u;e=n^l;return Vr((si(s,a,Vr(o^r,n^i,o,n)|0,rt,0)|0)^t,rt^e,t,e)|0}function ii(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0;n=vt;vt=vt+16|0;s=n|0;a=e>>31|((e|0)<0?-1:0)<<1;o=((e|0)<0?-1:0)>>31|((e|0)<0?-1:0)<<1;u=i>>31|((i|0)<0?-1:0)<<1;l=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;t=Vr(a^t,o^e,a,o)|0;e=rt;si(t,e,Vr(u^r,l^i,u,l)|0,rt,s)|0;i=Vr(dt[s>>2]^a,dt[s+4>>2]^o,a,o)|0;r=rt;vt=n;return(rt=r,i)|0}function ni(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0;n=t;o=r;r=ei(n,o)|0;t=rt;return(rt=(_t(e,o)|0)+(_t(i,n)|0)+t|t&0,r|0|0)|0}function oi(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;return si(t,e,r,i,0)|0}function ai(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0;o=vt;vt=vt+16|0;n=o|0;si(t,e,r,i,n)|0;vt=o;return(rt=dt[n+4>>2]|0,dt[n>>2]|0)|0}function si(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0;h=t;l=e;u=l;a=r;f=i;s=f;if(!u){o=(n|0)!=0;if(!s){if(o){dt[n>>2]=(h>>>0)%(a>>>0);dt[n+4>>2]=0}f=0;n=(h>>>0)/(a>>>0)>>>0;return(rt=f,n)|0}else{if(!o){f=0;n=0;return(rt=f,n)|0}dt[n>>2]=t|0;dt[n+4>>2]=e&0;f=0;n=0;return(rt=f,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(at(s|0)|0)-(at(u|0)|0)|0;if(o>>>0<=31){c=o+1|0;s=31-o|0;e=o-31>>31;a=c;t=h>>>(c>>>0)&e|u<>>(c>>>0)&e;o=0;s=h<>2]=t|0;dt[n+4>>2]=l|e&0;f=0;n=0;return(rt=f,n)|0}o=a-1|0;if(o&a){s=(at(a|0)|0)+33-(at(u|0)|0)|0;d=64-s|0;c=32-s|0;l=c>>31;p=s-32|0;e=p>>31;a=s;t=c-1>>31&u>>>(p>>>0)|(u<>>(s>>>0))&e;e=e&u>>>(s>>>0);o=h<>>(p>>>0))&l|h<>31;break}if(n){dt[n>>2]=o&h;dt[n+4>>2]=0}if((a|0)==1){p=l|e&0;d=t|0|0;return(rt=p,d)|0}else{d=ti(a|0)|0;p=u>>>(d>>>0)|0;d=u<<32-d|h>>>(d>>>0)|0;return(rt=p,d)|0}}else{if(o){if(n){dt[n>>2]=(u>>>0)%(a>>>0);dt[n+4>>2]=0}p=0;d=(u>>>0)/(a>>>0)>>>0;return(rt=p,d)|0}if(!h){if(n){dt[n>>2]=0;dt[n+4>>2]=(u>>>0)%(s>>>0)}p=0;d=(u>>>0)/(s>>>0)>>>0;return(rt=p,d)|0}o=s-1|0;if(!(o&s)){if(n){dt[n>>2]=t|0;dt[n+4>>2]=o&u|e&0}p=0;d=u>>>((ti(s|0)|0)>>>0);return(rt=p,d)|0}o=(at(s|0)|0)-(at(u|0)|0)|0;if(o>>>0<=30){e=o+1|0;s=31-o|0;a=e;t=u<>>(e>>>0);e=u>>>(e>>>0);o=0;s=h<>2]=t|0;dt[n+4>>2]=l|e&0;p=0;d=0;return(rt=p,d)|0}}while(0);if(!a){u=s;l=0;s=0}else{c=r|0|0;h=f|i&0;u=Kr(c|0,h|0,-1,-1)|0;r=rt;l=s;s=0;do{i=l;l=o>>>31|l<<1;o=s|o<<1;i=t<<1|i>>>31|0;f=t>>>31|e<<1|0;Vr(u,r,i,f)|0;d=rt;p=d>>31|((d|0)<0?-1:0)<<1;s=p&1;t=Vr(i,f,p&c,(((d|0)<0?-1:0)>>31|((d|0)<0?-1:0)<<1)&h)|0;e=rt;a=a-1|0}while((a|0)!=0);u=l;l=0}a=0;if(n){dt[n>>2]=t;dt[n+4>>2]=e}p=(o|0)>>>31|(u|a)<<1|(a<<1|o>>>31)&0|l;d=(o<<1|0>>>31)&-2|s;return(rt=p,d)|0}function li(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;return Pi[t&7](e|0,r|0,i|0)|0}function ui(t,e,r,i,n,o){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;Ci[t&3](e|0,r|0,i|0,n|0,o|0)}function hi(t,e){t=t|0;e=e|0;Ai[t&7](e|0)}function ci(t,e){t=t|0;e=e|0;return Ei[t&1](e|0)|0}function fi(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;Ii[t&0](e|0,r|0,i|0)}function pi(t){t=t|0;Oi[t&3]()}function di(t,e,r,i,n,o,a){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Mi[t&3](e|0,r|0,i|0,n|0,o|0,a|0)}function mi(t,e,r,i,n,o){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;return Di[t&1](e|0,r|0,i|0,n|0,o|0)|0}function gi(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;zi[t&3](e|0,r|0,i|0,n|0)}function vi(t,e,r){t=t|0;e=e|0;r=r|0;st(0);return 0}function _i(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;st(1)}function yi(t){t=t|0;st(2)}function bi(t){t=t|0;st(3);return 0}function xi(t,e,r){t=t|0;e=e|0;r=r|0;st(4)}function wi(){st(5)}function Ti(t,e,r,i,n,o){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;st(6)}function ki(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;st(7);return 0}function Si(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;st(8)}var Pi=[vi,Ye,Fr,Er,Ar,Ir,vi,vi];var Ci=[_i,er,tr,_i];var Ai=[yi,He,Ge,qe,We,Ve,lr,Rr];var Ei=[bi,Cr];var Ii=[xi];var Oi=[wi,ar,sr,wi];var Mi=[Ti,ir,rr,Ti];var Di=[ki,le];var zi=[Si,Je,Ke,Si];return{___cxa_can_catch:nr,_crn_get_levels:Te,_crn_get_uncompressed_size:Se,_crn_decompress:Pe,_i64Add:Kr,_crn_get_width:xe,___cxa_is_pointer_type:or,_i64Subtract:Vr,_memset:Yr,_malloc:Br,_free:Ur,_memcpy:Qr,_bitshift64Lshr:Zr,_fflush:gr,_bitshift64Shl:Jr,_crn_get_height:we,___errno_location:hr,_crn_get_dxt_format:ke,runPostSets:Gr,_emscripten_replace_memory:Yt,stackAlloc:Zt,stackSave:Jt,stackRestore:Kt,establishStackSpace:Qt,setThrew:$t,setTempRet0:re,getTempRet0:ie,dynCall_iiii:li,dynCall_viiiii:ui,dynCall_vi:hi,dynCall_ii:ci,dynCall_viii:fi,dynCall_v:pi,dynCall_viiiiii:di,dynCall_iiiiii:mi,dynCall_viiii:gi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0>8&255,t>>16&255,t>>24&255)}!function(s){s.loadFromArrayBuffer=function(t,e,r){return new i(e).loadFromArrayBuffer(t,r)};var i=function(l){function t(t,e,r,i,n,o,a){var s=l.call(this)||this;return s.complete=!1,s.isCompressedImage=!0,s.preserveSource=!0,s.onload=null,s.baseTexture=null,s.init(t,e,r,i,n,o,a),s}return __extends(t,l),t.prototype.init=function(t,e,r,i,n,o,a){void 0===i&&(i=-1),void 0===n&&(n=-1),this.src=t,this.resize(i,n),this._width=i,this._height=n,this.data=e,this.type=r,this.levels=o,this.internalFormat=a;var s=this.complete;return this.complete=!!e,!s&&this.complete&&this.onload&&this.onload({target:this}),this.update(),this},t.prototype.dispose=function(){this.data=null},t.prototype.bind=function(t){t.premultiplyAlpha=!1,l.prototype.bind.call(this,t)},t.prototype.upload=function(t,e,r){var i=t.state.gl;if(r.compressed=!1,t.texture.initCompressed(),null===this.data)throw"Trying to create a second (or more) webgl texture from the same CompressedImage : "+this.src;for(var n=this.levels,o=this.width,a=this.height,s=0,l=0;l>=1)<1&&(o=1),(a>>=1)<1&&(a=1),s+=u}return this._internalLoader.free(),this.preserveSource||(this.data=null),!0},t.prototype.style=function(t,e,r){var i=t.state.gl,n=this.levels;return e.scaleMode===PIXI.SCALE_MODES.LINEAR?1>2)*(e+3>>2)*8;case 33778:case 33779:case 35987:case 34798:return(t+3>>2)*(e+3>>2)*16;default:return 0}},h.type="DDS",h}(t.AbstractInternalLoader);t.DDSLoader=l}(pixi_compressed_textures||(pixi_compressed_textures={})),function(h){var t,c=((t={})[0]=35841,t[1]=35843,t[2]=35840,t[3]=35842,t[6]=36196,t[7]=33776,t[9]=33778,t[5]=33779,t),e=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.load=function(t){if(!h.DDSLoader.test(t))throw"Invalid magic number in PVR header";var e=new Int32Array(t,0,13),r=e[2],i=c[r]||-1,n=e[7],o=e[6],a=e[11],s=e[12]+52,l=new Uint8Array(t,s),u=this._image;return this._format=i,u.init(u.src,l,"PVR",n,o,a,i),u},t.test=function(t){return 55727696===new Int32Array(t,0,1)[0]},t.prototype.levelBufferSize=function(t,e,r){switch(void 0===r&&(r=0),this._format){case 33776:case 36196:return(t+3>>2)*(e+3>>2)*8;case 33778:case 33779:return(t+3>>2)*(e+3>>2)*16;case 35840:case 35842:return Math.floor((Math.max(t,8)*Math.max(e,8)*4+7)/8);case 35841:case 35843:return Math.floor((Math.max(t,16)*Math.max(e,8)*2+7)/8);default:return 0}},t.type="PVR",t}(h.AbstractInternalLoader);h.PVRTCLoader=e}(pixi_compressed_textures||(pixi_compressed_textures={}));var __awaiter=this&&this.__awaiter||function(t,a,s,l){return new(s||(s=Promise))(function(e,r){function i(t){try{o(l.next(t))}catch(t){r(t)}}function n(t){try{o(l.throw(t))}catch(t){r(t)}}function o(t){t.done?e(t.value):function(e){return e instanceof s?e:new s(function(t){t(e)})}(t.value).then(i,n)}o((l=l.apply(t,a||[])).next())})},__generator=this&&this.__generator||function(r,i){var n,o,a,t,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(a=2&e[0]?o.return:e[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,e[1])).done)return a;switch(o=0,a&&(e=[2&e[0],a.value]),e[0]){case 0:case 1:a=e;break;case 4:return s.label++,{value:e[1],done:!1};case 5:s.label++,o=e[1],e=[0];continue;case 7:e=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){s=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1] 0.0) {\n c.rgb /= c.a;\n\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n\n c.rgb *= c.a;\n }\n\n gl_FragColor = c * alpha;\n}\n"),Object.assign(this,{gamma:1,saturation:1,contrast:1,brightness:1,red:1,green:1,blue:1,alpha:1},t)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,t.applyFilter(this,e,r,i)},t}(n.Filter),d=function(i){function t(t,e,r){void 0===t&&(t=4),void 0===e&&(e=3),void 0===r&&(r=!1),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",r?"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample top right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}\n":"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample top right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}"),this.uniforms.uOffset=new Float32Array(2),this._pixelSize=new f.Point,this.pixelSize=1,this._clamp=r,this._kernels=null,Array.isArray(t)?this.kernels=t:(this._blur=t,this.quality=e)}i&&(t.__proto__=i);var e={kernels:{configurable:!0},clamp:{configurable:!0},pixelSize:{configurable:!0},quality:{configurable:!0},blur:{configurable:!0}};return((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.apply=function(t,e,r,i){var n,o=this.pixelSize.x/e._frame.width,a=this.pixelSize.y/e._frame.height;if(1===this._quality||0===this._blur)n=this._kernels[0]+.5,this.uniforms.uOffset[0]=n*o,this.uniforms.uOffset[1]=n*a,t.applyFilter(this,e,r,i);else{for(var s,l=t.getFilterTexture(),u=e,h=l,c=this._quality-1,f=0;f threshold) {\n gl_FragColor = color;\n } else {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n}\n"),this.threshold=t}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={threshold:{configurable:!0}};return r.threshold.get=function(){return this.uniforms.threshold},r.threshold.set=function(t){this.uniforms.threshold=t},Object.defineProperties(t.prototype,r),t}(n.Filter),i=function(a){function t(t){a.call(this,c,"uniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D bloomTexture;\nuniform float bloomScale;\nuniform float brightness;\n\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord);\n color.rgb *= brightness;\n vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0);\n bloomColor.rgb *= bloomScale;\n gl_FragColor = color + bloomColor;\n}\n"),"number"==typeof t&&(t={threshold:t}),t=Object.assign({threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:p.settings.RESOLUTION},t),this.bloomScale=t.bloomScale,this.brightness=t.brightness;var e=t.kernels,r=t.blur,i=t.quality,n=t.pixelSize,o=t.resolution;this._extractFilter=new m(t.threshold),this._extractFilter.resolution=o,this._blurFilter=e?new d(e):new d(r,i),this.pixelSize=n,this.resolution=o}a&&(t.__proto__=a);var e={resolution:{configurable:!0},threshold:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((t.prototype=Object.create(a&&a.prototype)).constructor=t).prototype.apply=function(t,e,r,i,n){var o=t.getFilterTexture();this._extractFilter.apply(t,e,o,!0,n);var a=t.getFilterTexture();this._blurFilter.apply(t,o,a,!0,n),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=a,t.applyFilter(this,e,r,i),t.returnFilterTexture(a),t.returnFilterTexture(o)},e.resolution.get=function(){return this._resolution},e.resolution.set=function(t){this._resolution=t,this._extractFilter&&(this._extractFilter.resolution=t),this._blurFilter&&(this._blurFilter.resolution=t)},e.threshold.get=function(){return this._extractFilter.threshold},e.threshold.set=function(t){this._extractFilter.threshold=t},e.kernels.get=function(){return this._blurFilter.kernels},e.kernels.set=function(t){this._blurFilter.kernels=t},e.blur.get=function(){return this._blurFilter.blur},e.blur.set=function(t){this._blurFilter.blur=t},e.quality.get=function(){return this._blurFilter.quality},e.quality.set=function(t){this._blurFilter.quality=t},e.pixelSize.get=function(){return this._blurFilter.pixelSize},e.pixelSize.set=function(t){this._blurFilter.pixelSize=t},Object.defineProperties(t.prototype,e),t}(n.Filter),o=function(e){function t(t){void 0===t&&(t=8),e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform float pixelSize;\nuniform sampler2D uSampler;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 pixelate(vec2 coord, vec2 size)\n{\n return floor( coord / size ) * size;\n}\n\nvec2 getMod(vec2 coord, vec2 size)\n{\n return mod( coord , size) / size;\n}\n\nfloat character(float n, vec2 p)\n{\n p = floor(p*vec2(4.0, -4.0) + 2.5);\n\n if (clamp(p.x, 0.0, 4.0) == p.x)\n {\n if (clamp(p.y, 0.0, 4.0) == p.y)\n {\n if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;\n }\n }\n return 0.0;\n}\n\nvoid main()\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n // get the rounded color..\n vec2 pixCoord = pixelate(coord, vec2(pixelSize));\n pixCoord = unmapCoord(pixCoord);\n\n vec4 color = texture2D(uSampler, pixCoord);\n\n // determine the character to use\n float gray = (color.r + color.g + color.b) / 3.0;\n\n float n = 65536.0; // .\n if (gray > 0.2) n = 65600.0; // :\n if (gray > 0.3) n = 332772.0; // *\n if (gray > 0.4) n = 15255086.0; // o\n if (gray > 0.5) n = 23385164.0; // &\n if (gray > 0.6) n = 15252014.0; // 8\n if (gray > 0.7) n = 13199452.0; // @\n if (gray > 0.8) n = 11512810.0; // #\n\n // get the mod..\n vec2 modd = getMod(coord, vec2(pixelSize));\n\n gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0);\n\n}\n"),this.size=t}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.pixelSize},r.size.set=function(t){this.uniforms.pixelSize=t},Object.defineProperties(t.prototype,r),t}(n.Filter),a=function(e){function t(t){void 0===t&&(t={}),e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float transformX;\nuniform float transformY;\nuniform vec3 lightColor;\nuniform float lightAlpha;\nuniform vec3 shadowColor;\nuniform float shadowAlpha;\n\nvoid main(void) {\n vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);\n vec4 color = texture2D(uSampler, vTextureCoord);\n float light = texture2D(uSampler, vTextureCoord - transform).a;\n float shadow = texture2D(uSampler, vTextureCoord + transform).a;\n\n color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0));\n color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"),this.uniforms.lightColor=new Float32Array(3),this.uniforms.shadowColor=new Float32Array(3),t=Object.assign({rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},t),this.rotation=t.rotation,this.thickness=t.thickness,this.lightColor=t.lightColor,this.lightAlpha=t.lightAlpha,this.shadowColor=t.shadowColor,this.shadowAlpha=t.shadowAlpha}e&&(t.__proto__=e);var r={rotation:{configurable:!0},thickness:{configurable:!0},lightColor:{configurable:!0},lightAlpha:{configurable:!0},shadowColor:{configurable:!0},shadowAlpha:{configurable:!0}};return((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},r.rotation.get=function(){return this._angle/f.DEG_TO_RAD},r.rotation.set=function(t){this._angle=t*f.DEG_TO_RAD,this._updateTransform()},r.thickness.get=function(){return this._thickness},r.thickness.set=function(t){this._thickness=t,this._updateTransform()},r.lightColor.get=function(){return l.rgb2hex(this.uniforms.lightColor)},r.lightColor.set=function(t){l.hex2rgb(t,this.uniforms.lightColor)},r.lightAlpha.get=function(){return this.uniforms.lightAlpha},r.lightAlpha.set=function(t){this.uniforms.lightAlpha=t},r.shadowColor.get=function(){return l.rgb2hex(this.uniforms.shadowColor)},r.shadowColor.set=function(t){l.hex2rgb(t,this.uniforms.shadowColor)},r.shadowAlpha.get=function(){return this.uniforms.shadowAlpha},r.shadowAlpha.set=function(t){this.uniforms.shadowAlpha=t},Object.defineProperties(t.prototype,r),t}(n.Filter),g=function(a){function t(t,e,r,i){var n,o;void 0===t&&(t=2),void 0===e&&(e=4),void 0===r&&(r=p.settings.RESOLUTION),void 0===i&&(i=5),a.call(this),"number"==typeof t?o=n=t:t instanceof f.Point?(n=t.x,o=t.y):Array.isArray(t)&&(n=t[0],o=t[1]),this.blurXFilter=new h.BlurFilterPass(!0,n,e,r,i),this.blurYFilter=new h.BlurFilterPass(!1,o,e,r,i),this.blurYFilter.blendMode=s.BLEND_MODES.SCREEN,this.defaultFilter=new u.AlphaFilter}a&&(t.__proto__=a);var e={blur:{configurable:!0},blurX:{configurable:!0},blurY:{configurable:!0}};return((t.prototype=Object.create(a&&a.prototype)).constructor=t).prototype.apply=function(t,e,r){var i=t.getFilterTexture(!0);this.defaultFilter.apply(t,e,r),this.blurXFilter.apply(t,e,i),this.blurYFilter.apply(t,i,r),t.returnFilterTexture(i)},e.blur.get=function(){return this.blurXFilter.blur},e.blur.set=function(t){this.blurXFilter.blur=this.blurYFilter.blur=t},e.blurX.get=function(){return this.blurXFilter.blur},e.blurX.set=function(t){this.blurXFilter.blur=t},e.blurY.get=function(){return this.blurYFilter.blur},e.blurY.set=function(t){this.blurYFilter.blur=t},Object.defineProperties(t.prototype,e),t}(n.Filter),v=function(i){function t(t,e,r){i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","uniform float radius;\nuniform float strength;\nuniform vec2 center;\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nvoid main()\n{\n vec2 coord = vTextureCoord * filterArea.xy;\n coord -= center * dimensions.xy;\n float distance = length(coord);\n if (distance < radius) {\n float percent = distance / radius;\n if (strength > 0.0) {\n coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75);\n } else {\n coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent);\n }\n }\n coord += center * dimensions.xy;\n coord /= filterArea.xy;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n gl_FragColor = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.center=t||[.5,.5],this.radius="number"==typeof e?e:100,this.strength="number"==typeof r?r:1}i&&(t.__proto__=i);var e={radius:{configurable:!0},strength:{configurable:!0},center:{configurable:!0}};return((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.dimensions[0]=e.filterFrame.width,this.uniforms.dimensions[1]=e.filterFrame.height,t.applyFilter(this,e,r,i)},e.radius.get=function(){return this.uniforms.radius},e.radius.set=function(t){this.uniforms.radius=t},e.strength.get=function(){return this.uniforms.strength},e.strength.set=function(t){this.uniforms.strength=t},e.center.get=function(){return this.uniforms.center},e.center.set=function(t){this.uniforms.center=t},Object.defineProperties(t.prototype,e),t}(n.Filter),_=function(i){function t(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=1),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform sampler2D colorMap;\nuniform float _mix;\nuniform float _size;\nuniform float _sliceSize;\nuniform float _slicePixelSize;\nuniform float _sliceInnerSize;\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord.xy);\n\n vec4 adjusted;\n if (color.a > 0.0) {\n color.rgb /= color.a;\n float innerWidth = _size - 1.0;\n float zSlice0 = min(floor(color.b * innerWidth), innerWidth);\n float zSlice1 = min(zSlice0 + 1.0, innerWidth);\n float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize;\n float s0 = xOffset + (zSlice0 * _sliceSize);\n float s1 = xOffset + (zSlice1 * _sliceSize);\n float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize);\n vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset));\n vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset));\n float zOffset = fract(color.b * innerWidth);\n adjusted = mix(slice0Color, slice1Color, zOffset);\n\n color.rgb *= color.a;\n }\n gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a);\n\n}"),this._size=0,this._sliceSize=0,this._slicePixelSize=0,this._sliceInnerSize=0,this._scaleMode=null,this._nearest=!1,this.nearest=e,this.mix=r,this.colorMap=t}i&&(t.__proto__=i);var e={colorSize:{configurable:!0},colorMap:{configurable:!0},nearest:{configurable:!0}};return((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms._mix=this.mix,t.applyFilter(this,e,r,i)},e.colorSize.get=function(){return this._size},e.colorMap.get=function(){return this._colorMap},e.colorMap.set=function(t){t instanceof n.Texture||(t=n.Texture.from(t)),t&&t.baseTexture&&(t.baseTexture.scaleMode=this._scaleMode,t.baseTexture.mipmap=!1,this._size=t.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms._size=this._size,this.uniforms._sliceSize=this._sliceSize,this.uniforms._slicePixelSize=this._slicePixelSize,this.uniforms._sliceInnerSize=this._sliceInnerSize,this.uniforms.colorMap=t),this._colorMap=t},e.nearest.get=function(){return this._nearest},e.nearest.set=function(t){this._nearest=t,this._scaleMode=t?s.SCALE_MODES.NEAREST:s.SCALE_MODES.LINEAR;var e=this._colorMap;e&&e.baseTexture&&(e.baseTexture._glTextures={},e.baseTexture.scaleMode=this._scaleMode,e.baseTexture.mipmap=!1,e._updateID++,e.baseTexture.emit("update",e.baseTexture))},t.prototype.updateColorMap=function(){var t=this._colorMap;t&&t.baseTexture&&(t._updateID++,t.baseTexture.emit("update",t.baseTexture),this.colorMap=t)},t.prototype.destroy=function(t){this._colorMap&&this._colorMap.destroy(t),i.prototype.destroy.call(this)},Object.defineProperties(t.prototype,e),t}(n.Filter),y=function(i){function t(t,e,r){void 0===t&&(t=16711680),void 0===e&&(e=0),void 0===r&&(r=.4),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec3 originalColor;\nuniform vec3 newColor;\nuniform float epsilon;\nvoid main(void) {\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\n vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n float doReplace = step(colorDistance, epsilon);\n gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a);\n}\n"),this.uniforms.originalColor=new Float32Array(3),this.uniforms.newColor=new Float32Array(3),this.originalColor=t,this.newColor=e,this.epsilon=r}i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t;var e={originalColor:{configurable:!0},newColor:{configurable:!0},epsilon:{configurable:!0}};return e.originalColor.set=function(t){var e=this.uniforms.originalColor;"number"==typeof t?(l.hex2rgb(t,e),this._originalColor=t):(e[0]=t[0],e[1]=t[1],e[2]=t[2],this._originalColor=l.rgb2hex(e))},e.originalColor.get=function(){return this._originalColor},e.newColor.set=function(t){var e=this.uniforms.newColor;"number"==typeof t?(l.hex2rgb(t,e),this._newColor=t):(e[0]=t[0],e[1]=t[1],e[2]=t[2],this._newColor=l.rgb2hex(e))},e.newColor.get=function(){return this._newColor},e.epsilon.set=function(t){this.uniforms.epsilon=t},e.epsilon.get=function(){return this.uniforms.epsilon},Object.defineProperties(t.prototype,e),t}(n.Filter),b=function(i){function t(t,e,r){void 0===e&&(e=200),void 0===r&&(r=200),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying mediump vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec2 texelSize;\nuniform float matrix[9];\n\nvoid main(void)\n{\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\n\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\n\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\n\n gl_FragColor =\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\n\n gl_FragColor.a = c22.a;\n}\n"),this.uniforms.texelSize=new Float32Array(2),this.uniforms.matrix=new Float32Array(9),void 0!==t&&(this.matrix=t),this.width=e,this.height=r}i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t;var e={matrix:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};return e.matrix.get=function(){return this.uniforms.matrix},e.matrix.set=function(t){var r=this;t.forEach(function(t,e){return r.uniforms.matrix[e]=t})},e.width.get=function(){return 1/this.uniforms.texelSize[0]},e.width.set=function(t){this.uniforms.texelSize[0]=1/t},e.height.get=function(){return 1/this.uniforms.texelSize[1]},e.height.set=function(t){this.uniforms.texelSize[1]=1/t},Object.defineProperties(t.prototype,e),t}(n.Filter),x=function(t){function e(){t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\n\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n\n if (lum < 1.00)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.75)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.50)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.3)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n}\n")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(n.Filter),w=function(e){function t(t){e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nconst float SQRT_2 = 1.414213;\n\nconst float light = 1.0;\n\nuniform float curvature;\nuniform float lineWidth;\nuniform float lineContrast;\nuniform bool verticalLine;\nuniform float noise;\nuniform float noiseSize;\n\nuniform float vignetting;\nuniform float vignettingAlpha;\nuniform float vignettingBlur;\n\nuniform float seed;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n vec2 dir = vec2(coord - vec2(0.5, 0.5));\n\n float _c = curvature > 0. ? curvature : 1.;\n float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.;\n vec2 uv = dir * k;\n\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 rgb = gl_FragColor.rgb;\n\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n rgb += _noise * noise;\n }\n\n if (lineWidth > 0.0) {\n float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c;\n float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast;\n rgb *= j;\n float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.);\n rgb *= 0.99 + ceil(segment) * 0.015;\n }\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n gl_FragColor.rgb = rgb;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.time=0,this.seed=0,Object.assign(this,{curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0},t)}e&&(t.__proto__=e);var r={curvature:{configurable:!0},lineWidth:{configurable:!0},lineContrast:{configurable:!0},verticalLine:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.dimensions[0]=e.filterFrame.width,this.uniforms.dimensions[1]=e.filterFrame.height,this.uniforms.seed=this.seed,this.uniforms.time=this.time,t.applyFilter(this,e,r,i)},r.curvature.set=function(t){this.uniforms.curvature=t},r.curvature.get=function(){return this.uniforms.curvature},r.lineWidth.set=function(t){this.uniforms.lineWidth=t},r.lineWidth.get=function(){return this.uniforms.lineWidth},r.lineContrast.set=function(t){this.uniforms.lineContrast=t},r.lineContrast.get=function(){return this.uniforms.lineContrast},r.verticalLine.set=function(t){this.uniforms.verticalLine=t},r.verticalLine.get=function(){return this.uniforms.verticalLine},r.noise.set=function(t){this.uniforms.noise=t},r.noise.get=function(){return this.uniforms.noise},r.noiseSize.set=function(t){this.uniforms.noiseSize=t},r.noiseSize.get=function(){return this.uniforms.noiseSize},r.vignetting.set=function(t){this.uniforms.vignetting=t},r.vignetting.get=function(){return this.uniforms.vignetting},r.vignettingAlpha.set=function(t){this.uniforms.vignettingAlpha=t},r.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},r.vignettingBlur.set=function(t){this.uniforms.vignettingBlur=t},r.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(t.prototype,r),t}(n.Filter),T=function(r){function t(t,e){void 0===t&&(t=1),void 0===e&&(e=5),r.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 filterArea;\nuniform sampler2D uSampler;\n\nuniform float angle;\nuniform float scale;\n\nfloat pattern()\n{\n float s = sin(angle), c = cos(angle);\n vec2 tex = vTextureCoord * filterArea.xy;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float average = (color.r + color.g + color.b) / 3.0;\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\n}\n"),this.scale=t,this.angle=e}r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t;var e={scale:{configurable:!0},angle:{configurable:!0}};return e.scale.get=function(){return this.uniforms.scale},e.scale.set=function(t){this.uniforms.scale=t},e.angle.get=function(){return this.uniforms.angle},e.angle.set=function(t){this.uniforms.angle=t},Object.defineProperties(t.prototype,e),t}(n.Filter),k=function(c){function t(t){t&&t.constructor!==Object&&(console.warn("DropShadowFilter now uses options instead of (rotation, distance, blur, color, alpha)"),t={rotation:t},void 0!==arguments[1]&&(t.distance=arguments[1]),void 0!==arguments[2]&&(t.blur=arguments[2]),void 0!==arguments[3]&&(t.color=arguments[3]),void 0!==arguments[4]&&(t.alpha=arguments[4])),t=Object.assign({rotation:45,distance:5,color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:p.settings.RESOLUTION},t),c.call(this);var e=t.kernels,r=t.blur,i=t.quality,n=t.pixelSize,o=t.resolution;this._tintFilter=new c("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform vec3 color;\n\nuniform vec2 shift;\nuniform vec4 inputSize;\n\nvoid main(void){\n vec4 sample = texture2D(uSampler, vTextureCoord - shift * inputSize.zw);\n\n // Un-premultiply alpha before applying the color\n if (sample.a > 0.0) {\n sample.rgb /= sample.a;\n }\n\n // Premultiply alpha again\n sample.rgb = color.rgb * sample.a;\n\n // alpha user alpha\n sample *= alpha;\n\n gl_FragColor = sample;\n}"),this._tintFilter.uniforms.color=new Float32Array(4),this._tintFilter.uniforms.shift=new f.Point,this._tintFilter.resolution=o,this._blurFilter=e?new d(e):new d(r,i),this.pixelSize=n,this.resolution=o;var a=t.shadowOnly,s=t.rotation,l=t.distance,u=t.alpha,h=t.color;this.shadowOnly=a,this.rotation=s,this.distance=l,this.alpha=u,this.color=h,this._updatePadding()}c&&(t.__proto__=c);var e={resolution:{configurable:!0},distance:{configurable:!0},rotation:{configurable:!0},alpha:{configurable:!0},color:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((t.prototype=Object.create(c&&c.prototype)).constructor=t).prototype.apply=function(t,e,r,i){var n=t.getFilterTexture();this._tintFilter.apply(t,e,n,!0),this._blurFilter.apply(t,n,r,i),!0!==this.shadowOnly&&t.applyFilter(this,e,r,!1),t.returnFilterTexture(n)},t.prototype._updatePadding=function(){this.padding=this.distance+2*this.blur},t.prototype._updateShift=function(){this._tintFilter.uniforms.shift.set(this.distance*Math.cos(this.angle),this.distance*Math.sin(this.angle))},e.resolution.get=function(){return this._resolution},e.resolution.set=function(t){this._resolution=t,this._tintFilter&&(this._tintFilter.resolution=t),this._blurFilter&&(this._blurFilter.resolution=t)},e.distance.get=function(){return this._distance},e.distance.set=function(t){this._distance=t,this._updatePadding(),this._updateShift()},e.rotation.get=function(){return this.angle/f.DEG_TO_RAD},e.rotation.set=function(t){this.angle=t*f.DEG_TO_RAD,this._updateShift()},e.alpha.get=function(){return this._tintFilter.uniforms.alpha},e.alpha.set=function(t){this._tintFilter.uniforms.alpha=t},e.color.get=function(){return l.rgb2hex(this._tintFilter.uniforms.color)},e.color.set=function(t){l.hex2rgb(t,this._tintFilter.uniforms.color)},e.kernels.get=function(){return this._blurFilter.kernels},e.kernels.set=function(t){this._blurFilter.kernels=t},e.blur.get=function(){return this._blurFilter.blur},e.blur.set=function(t){this._blurFilter.blur=t,this._updatePadding()},e.quality.get=function(){return this._blurFilter.quality},e.quality.set=function(t){this._blurFilter.quality=t},e.pixelSize.get=function(){return this._blurFilter.pixelSize},e.pixelSize.set=function(t){this._blurFilter.pixelSize=t},Object.defineProperties(t.prototype,e),t}(n.Filter),S=function(e){function t(t){void 0===t&&(t=5),e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float strength;\nuniform vec4 filterArea;\n\n\nvoid main(void)\n{\n\tvec2 onePixel = vec2(1.0 / filterArea);\n\n\tvec4 color;\n\n\tcolor.rgb = vec3(0.5);\n\n\tcolor -= texture2D(uSampler, vTextureCoord - onePixel) * strength;\n\tcolor += texture2D(uSampler, vTextureCoord + onePixel) * strength;\n\n\tcolor.rgb = vec3((color.r + color.g + color.b) / 3.0);\n\n\tfloat alpha = texture2D(uSampler, vTextureCoord).a;\n\n\tgl_FragColor = vec4(color.rgb * alpha, alpha);\n}\n"),this.strength=t}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={strength:{configurable:!0}};return r.strength.get=function(){return this.uniforms.strength},r.strength.set=function(t){this.uniforms.strength=t},Object.defineProperties(t.prototype,r),t}(n.Filter),P=function(e){function t(t){void 0===t&&(t={}),e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","// precision highp float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void)\n{\n vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture2D(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if( coord.x > filterClamp.z ) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n }\n } else if( coord.x < filterClamp.x ) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n }\n }\n\n if( coord.y > filterClamp.w ) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n }\n } else if( coord.y < filterClamp.y ) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n }\n }\n }\n\n gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, coord).a;\n}\n"),this.uniforms.dimensions=new Float32Array(2),t=Object.assign({slices:5,offset:100,direction:0,fillMode:0,average:!1,seed:0,red:[0,0],green:[0,0],blue:[0,0],minSize:8,sampleSize:512},t),this.direction=t.direction,this.red=t.red,this.green=t.green,this.blue=t.blue,this.offset=t.offset,this.fillMode=t.fillMode,this.average=t.average,this.seed=t.seed,this.minSize=t.minSize,this.sampleSize=t.sampleSize,this._canvas=document.createElement("canvas"),this._canvas.width=4,this._canvas.height=this.sampleSize,this.texture=n.Texture.from(this._canvas,{scaleMode:s.SCALE_MODES.NEAREST}),this._slices=0,this.slices=t.slices}e&&(t.__proto__=e);var r={sizes:{configurable:!0},offsets:{configurable:!0},slices:{configurable:!0},direction:{configurable:!0},red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.apply=function(t,e,r,i){var n=e.filterFrame.width,o=e.filterFrame.height;this.uniforms.dimensions[0]=n,this.uniforms.dimensions[1]=o,this.uniforms.aspect=o/n,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,t.applyFilter(this,e,r,i)},t.prototype._randomizeSizes=function(){var t=this._sizes,e=this._slices-1,r=this.sampleSize,i=Math.min(this.minSize/r,.9/this._slices);if(this.average){for(var n=this._slices,o=1,a=0;a>0,i=t[e];t[e]=t[r],t[r]=i}},t.prototype._randomizeOffsets=function(){for(var t=0;t>0,e,1+a>>0),n+=a}r.baseTexture.update(),this.uniforms.displacementMap=r},r.sizes.set=function(t){for(var e=Math.min(this._slices,t.length),r=0;rthis._maxColors)throw"Length of replacements ("+i+") exceeds the maximum colors length ("+this._maxColors+")";e[3*i]=-1;for(var n=0;n 0.5) then: 1 - 2 * (1 - dst) * (1 - src)\n return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)),\n (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)),\n (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z)));\n}\n\n\nvoid main()\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 color = gl_FragColor.rgb;\n\n if (sepia > 0.0)\n {\n float gray = (color.x + color.y + color.z) / 3.0;\n vec3 grayscale = vec3(gray);\n\n color = Overlay(SEPIA_RGB, grayscale);\n\n color = grayscale + sepia * (color - grayscale);\n }\n\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n vec2 dir = vec2(vec2(0.5, 0.5) - coord);\n dir.y *= dimensions.y / dimensions.x;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n if (scratchDensity > seed && scratch != 0.0)\n {\n float phase = seed * 256.0;\n float s = mod(floor(phase), 2.0);\n float dist = 1.0 / scratchDensity;\n float d = distance(coord, vec2(seed * dist, abs(s - seed * dist)));\n if (d < seed * 0.6 + 0.4)\n {\n highp float period = scratchDensity * 10.0;\n\n float xx = coord.x * period + phase;\n float aa = abs(mod(xx, 0.5) * 4.0);\n float bb = mod(floor(xx / 0.5), 2.0);\n float yy = (1.0 - bb) * aa + bb * (2.0 - aa);\n\n float kk = 2.0 * period;\n float dw = scratchWidth / dimensions.x * (0.75 + seed);\n float dh = dw * kk;\n\n float tine = (yy - (2.0 - dh));\n\n if (tine > 0.0) {\n float _sign = sign(scratch);\n\n tine = s * tine / period + scratch + 0.1;\n tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5);\n\n color.rgb *= tine;\n }\n }\n }\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0);\n // float _noise = snoise(d) * 0.5;\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n color += _noise * noise;\n }\n\n gl_FragColor.rgb = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),"number"==typeof t?(this.seed=t,t=null):this.seed=e,Object.assign(this,{sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3},t)}r&&(t.__proto__=r);var e={sepia:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},scratch:{configurable:!0},scratchDensity:{configurable:!0},scratchWidth:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((t.prototype=Object.create(r&&r.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.dimensions[0]=e.filterFrame.width,this.uniforms.dimensions[1]=e.filterFrame.height,this.uniforms.seed=this.seed,t.applyFilter(this,e,r,i)},e.sepia.set=function(t){this.uniforms.sepia=t},e.sepia.get=function(){return this.uniforms.sepia},e.noise.set=function(t){this.uniforms.noise=t},e.noise.get=function(){return this.uniforms.noise},e.noiseSize.set=function(t){this.uniforms.noiseSize=t},e.noiseSize.get=function(){return this.uniforms.noiseSize},e.scratch.set=function(t){this.uniforms.scratch=t},e.scratch.get=function(){return this.uniforms.scratch},e.scratchDensity.set=function(t){this.uniforms.scratchDensity=t},e.scratchDensity.get=function(){return this.uniforms.scratchDensity},e.scratchWidth.set=function(t){this.uniforms.scratchWidth=t},e.scratchWidth.get=function(){return this.uniforms.scratchWidth},e.vignetting.set=function(t){this.uniforms.vignetting=t},e.vignetting.get=function(){return this.uniforms.vignetting},e.vignettingAlpha.set=function(t){this.uniforms.vignettingAlpha=t},e.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},e.vignettingBlur.set=function(t){this.uniforms.vignettingBlur=t},e.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(t.prototype,e),t}(n.Filter),M=function(o){function a(t,e,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===r&&(r=.1);var i=Math.max(r*a.MAX_SAMPLES,a.MIN_SAMPLES),n=(2*Math.PI/i).toFixed(7);o.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 thickness;\nuniform vec4 outlineColor;\nuniform vec4 filterClamp;\n\nconst float DOUBLE_PI = 3.14159265358979323846264 * 2.;\n\nvoid main(void) {\n vec4 ownColor = texture2D(uSampler, vTextureCoord);\n vec4 curColor;\n float maxAlpha = 0.;\n vec2 displaced;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ${angleStep}) {\n displaced.x = vTextureCoord.x + thickness.x * cos(angle);\n displaced.y = vTextureCoord.y + thickness.y * sin(angle);\n curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw));\n maxAlpha = max(maxAlpha, curColor.a);\n }\n float resultAlpha = max(maxAlpha, ownColor.a);\n gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha);\n}\n".replace(/\$\{angleStep\}/,n)),this.uniforms.thickness=new Float32Array([0,0]),this.thickness=t,this.uniforms.outlineColor=new Float32Array([0,0,0,1]),this.color=e,this.quality=r}o&&(a.__proto__=o);var t={color:{configurable:!0}};return((a.prototype=Object.create(o&&o.prototype)).constructor=a).prototype.apply=function(t,e,r,i){this.uniforms.thickness[0]=this.thickness/e._frame.width,this.uniforms.thickness[1]=this.thickness/e._frame.height,t.applyFilter(this,e,r,i)},t.color.get=function(){return l.rgb2hex(this.uniforms.outlineColor)},t.color.set=function(t){l.hex2rgb(t,this.uniforms.outlineColor)},Object.defineProperties(a.prototype,t),a}(n.Filter);M.MIN_SAMPLES=1,M.MAX_SAMPLES=100;var D=function(e){function t(t){void 0===t&&(t=10),e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform vec2 size;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 pixelate(vec2 coord, vec2 size)\n{\n\treturn floor( coord / size ) * size;\n}\n\nvoid main(void)\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = pixelate(coord, size);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord);\n}\n"),this.size=t}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.size},r.size.set=function(t){"number"==typeof t&&(t=[t,t]),this.uniforms.size=t},Object.defineProperties(t.prototype,r),t}(n.Filter),z=function(n){function t(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=[0,0]),void 0===r&&(r=5),void 0===i&&(i=-1),n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float uRadian;\nuniform vec2 uCenter;\nuniform float uRadius;\nuniform int uKernelSize;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n if (uKernelSize == 0)\n {\n gl_FragColor = color;\n return;\n }\n\n float aspect = filterArea.y / filterArea.x;\n vec2 center = uCenter.xy / filterArea.xy;\n float gradient = uRadius / filterArea.x * 0.3;\n float radius = uRadius / filterArea.x - gradient * 0.5;\n int k = uKernelSize - 1;\n\n vec2 coord = vTextureCoord;\n vec2 dir = vec2(center - coord);\n float dist = length(vec2(dir.x, dir.y * aspect));\n\n float radianStep = uRadian;\n if (radius >= 0.0 && dist > radius) {\n float delta = dist - radius;\n float gap = gradient;\n float scale = 1.0 - abs(delta / gap);\n if (scale <= 0.0) {\n gl_FragColor = color;\n return;\n }\n radianStep *= scale;\n }\n radianStep /= float(k);\n\n float s = sin(radianStep);\n float c = cos(radianStep);\n mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c));\n\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\n if (i == k) {\n break;\n }\n\n coord -= center;\n coord.y *= aspect;\n coord = rotationMatrix * coord;\n coord.y /= aspect;\n coord += center;\n\n vec4 sample = texture2D(uSampler, coord);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample;\n }\n\n gl_FragColor = color / float(uKernelSize);\n}\n"),this._angle=0,this.angle=t,this.center=e,this.kernelSize=r,this.radius=i}n&&(t.__proto__=n);var e={angle:{configurable:!0},center:{configurable:!0},radius:{configurable:!0}};return((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.uKernelSize=0!==this._angle?this.kernelSize:0,t.applyFilter(this,e,r,i)},e.angle.set=function(t){this._angle=t,this.uniforms.uRadian=t*Math.PI/180},e.angle.get=function(){return this._angle},e.center.get=function(){return this.uniforms.uCenter},e.center.set=function(t){this.uniforms.uCenter=t},e.radius.get=function(){return this.uniforms.uRadius},e.radius.set=function(t){(t<0||t===1/0)&&(t=-1),this.uniforms.uRadius=t},Object.defineProperties(t.prototype,e),t}(n.Filter),R=function(e){function t(t){e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nuniform bool mirror;\nuniform float boundary;\nuniform vec2 amplitude;\nuniform vec2 waveLength;\nuniform vec2 alpha;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n if (coord.y < boundary) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n float k = (coord.y - boundary) / (1. - boundary + 0.0001);\n float areaY = boundary * dimensions.y / filterArea.y;\n float v = areaY + areaY - vTextureCoord.y;\n float y = mirror ? v : vTextureCoord.y;\n\n float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x;\n float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y;\n float _alpha = (alpha.y - alpha.x) * k + alpha.x;\n\n float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude;\n x = clamp(x, filterClamp.x, filterClamp.z);\n\n vec4 color = texture2D(uSampler, vec2(x, y));\n\n gl_FragColor = color * _alpha;\n}\n"),this.uniforms.amplitude=new Float32Array(2),this.uniforms.waveLength=new Float32Array(2),this.uniforms.alpha=new Float32Array(2),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,{mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0},t)}e&&(t.__proto__=e);var r={mirror:{configurable:!0},boundary:{configurable:!0},amplitude:{configurable:!0},waveLength:{configurable:!0},alpha:{configurable:!0}};return((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.dimensions[0]=e.filterFrame.width,this.uniforms.dimensions[1]=e.filterFrame.height,this.uniforms.time=this.time,t.applyFilter(this,e,r,i)},r.mirror.set=function(t){this.uniforms.mirror=t},r.mirror.get=function(){return this.uniforms.mirror},r.boundary.set=function(t){this.uniforms.boundary=t},r.boundary.get=function(){return this.uniforms.boundary},r.amplitude.set=function(t){this.uniforms.amplitude[0]=t[0],this.uniforms.amplitude[1]=t[1]},r.amplitude.get=function(){return this.uniforms.amplitude},r.waveLength.set=function(t){this.uniforms.waveLength[0]=t[0],this.uniforms.waveLength[1]=t[1]},r.waveLength.get=function(){return this.uniforms.waveLength},r.alpha.set=function(t){this.uniforms.alpha[0]=t[0],this.uniforms.alpha[1]=t[1]},r.alpha.get=function(){return this.uniforms.alpha},Object.defineProperties(t.prototype,r),t}(n.Filter),F=function(i){function t(t,e,r){void 0===t&&(t=[-10,0]),void 0===e&&(e=[0,10]),void 0===r&&(r=[0,0]),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nvoid main(void)\n{\n gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;\n}\n"),this.red=t,this.green=e,this.blue=r}i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t;var e={red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return e.red.get=function(){return this.uniforms.red},e.red.set=function(t){this.uniforms.red=t},e.green.get=function(){return this.uniforms.green},e.green.set=function(t){this.uniforms.green=t},e.blue.get=function(){return this.uniforms.blue},e.blue.set=function(t){this.uniforms.blue=t},Object.defineProperties(t.prototype,e),t}(n.Filter),j=function(i){function t(t,e,r){void 0===t&&(t=[0,0]),void 0===e&&(e={}),void 0===r&&(r=0),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\n\nuniform vec2 center;\n\nuniform float amplitude;\nuniform float wavelength;\n// uniform float power;\nuniform float brightness;\nuniform float speed;\nuniform float radius;\n\nuniform float time;\n\nconst float PI = 3.14159;\n\nvoid main()\n{\n float halfWavelength = wavelength * 0.5 / filterArea.x;\n float maxRadius = radius / filterArea.x;\n float currentRadius = time * speed / filterArea.x;\n\n float fade = 1.0;\n\n if (maxRadius > 0.0) {\n if (currentRadius > maxRadius) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n fade = 1.0 - pow(currentRadius / maxRadius, 2.0);\n }\n\n vec2 dir = vec2(vTextureCoord - center / filterArea.xy);\n dir.y *= filterArea.y / filterArea.x;\n float dist = length(dir);\n\n if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n vec2 diffUV = normalize(dir);\n\n float diff = (dist - currentRadius) / halfWavelength;\n\n float p = 1.0 - pow(abs(diff), 2.0);\n\n // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade );\n float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade );\n\n vec2 offset = diffUV * powDiff / filterArea.xy;\n\n // Do clamp :\n vec2 coord = vTextureCoord + offset;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n // No clamp :\n // gl_FragColor = texture2D(uSampler, vTextureCoord + offset);\n\n color.rgb *= 1.0 + (brightness - 1.0) * p * fade;\n\n gl_FragColor = color;\n}\n"),this.center=t,Array.isArray(e)&&(console.warn("Deprecated Warning: ShockwaveFilter params Array has been changed to options Object."),e={}),e=Object.assign({amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1},e),this.amplitude=e.amplitude,this.wavelength=e.wavelength,this.brightness=e.brightness,this.speed=e.speed,this.radius=e.radius,this.time=r}i&&(t.__proto__=i);var e={center:{configurable:!0},amplitude:{configurable:!0},wavelength:{configurable:!0},brightness:{configurable:!0},speed:{configurable:!0},radius:{configurable:!0}};return((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.time=this.time,t.applyFilter(this,e,r,i)},e.center.get=function(){return this.uniforms.center},e.center.set=function(t){this.uniforms.center=t},e.amplitude.get=function(){return this.uniforms.amplitude},e.amplitude.set=function(t){this.uniforms.amplitude=t},e.wavelength.get=function(){return this.uniforms.wavelength},e.wavelength.set=function(t){this.uniforms.wavelength=t},e.brightness.get=function(){return this.uniforms.brightness},e.brightness.set=function(t){this.uniforms.brightness=t},e.speed.get=function(){return this.uniforms.speed},e.speed.set=function(t){this.uniforms.speed=t},e.radius.get=function(){return this.uniforms.radius},e.radius.set=function(t){this.uniforms.radius=t},Object.defineProperties(t.prototype,e),t}(n.Filter),L=function(i){function t(t,e,r){void 0===e&&(e=0),void 0===r&&(r=1),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform sampler2D uLightmap;\nuniform vec4 filterArea;\nuniform vec2 dimensions;\nuniform vec4 ambientColor;\nvoid main() {\n vec4 diffuseColor = texture2D(uSampler, vTextureCoord);\n vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions;\n vec4 light = texture2D(uLightmap, lightCoord);\n vec3 ambient = ambientColor.rgb * ambientColor.a;\n vec3 intensity = ambient + light.rgb;\n vec3 finalColor = diffuseColor.rgb * intensity;\n gl_FragColor = vec4(finalColor, diffuseColor.a);\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.uniforms.ambientColor=new Float32Array([0,0,0,r]),this.texture=t,this.color=e}i&&(t.__proto__=i);var e={texture:{configurable:!0},color:{configurable:!0},alpha:{configurable:!0}};return((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.dimensions[0]=e.filterFrame.width,this.uniforms.dimensions[1]=e.filterFrame.height,t.applyFilter(this,e,r,i)},e.texture.get=function(){return this.uniforms.uLightmap},e.texture.set=function(t){this.uniforms.uLightmap=t},e.color.set=function(t){var e=this.uniforms.ambientColor;"number"==typeof t?(l.hex2rgb(t,e),this._color=t):(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this._color=l.rgb2hex(e))},e.color.get=function(){return this._color},e.alpha.get=function(){return this.uniforms.ambientColor[3]},e.alpha.set=function(t){this.uniforms.ambientColor[3]=t},Object.defineProperties(t.prototype,e),t}(n.Filter),N=function(n){function t(t,e,r,i){void 0===t&&(t=100),void 0===e&&(e=600),void 0===r&&(r=null),void 0===i&&(i=null),n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\n\nfloat random(vec3 scale, float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\n\n for (float t = -30.0; t <= 30.0; t++)\n {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\n sample.rgb *= sample.a;\n color += sample * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.uniforms.blur=t,this.uniforms.gradientBlur=e,this.uniforms.start=r||new f.Point(0,window.innerHeight/2),this.uniforms.end=i||new f.Point(600,window.innerHeight/2),this.uniforms.delta=new f.Point(30,30),this.uniforms.texSize=new f.Point(window.innerWidth,window.innerHeight),this.updateDelta()}n&&(t.__proto__=n);var e={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.updateDelta=function(){this.uniforms.delta.x=0,this.uniforms.delta.y=0},e.blur.get=function(){return this.uniforms.blur},e.blur.set=function(t){this.uniforms.blur=t},e.gradientBlur.get=function(){return this.uniforms.gradientBlur},e.gradientBlur.set=function(t){this.uniforms.gradientBlur=t},e.start.get=function(){return this.uniforms.start},e.start.set=function(t){this.uniforms.start=t,this.updateDelta()},e.end.get=function(){return this.uniforms.end},e.end.set=function(t){this.uniforms.end=t,this.updateDelta()},Object.defineProperties(t.prototype,e),t}(n.Filter),B=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.updateDelta=function(){var t=this.uniforms.end.x-this.uniforms.start.x,e=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.x=t/r,this.uniforms.delta.y=e/r},e}(N),U=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.updateDelta=function(){var t=this.uniforms.end.x-this.uniforms.start.x,e=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.x=-e/r,this.uniforms.delta.y=t/r},e}(N),X=function(n){function t(t,e,r,i){void 0===t&&(t=100),void 0===e&&(e=600),void 0===r&&(r=null),void 0===i&&(i=null),n.call(this),this.tiltShiftXFilter=new B(t,e,r,i),this.tiltShiftYFilter=new U(t,e,r,i)}n&&(t.__proto__=n);var e={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.apply=function(t,e,r){var i=t.getFilterTexture();this.tiltShiftXFilter.apply(t,e,i),this.tiltShiftYFilter.apply(t,i,r),t.returnFilterTexture(i)},e.blur.get=function(){return this.tiltShiftXFilter.blur},e.blur.set=function(t){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=t},e.gradientBlur.get=function(){return this.tiltShiftXFilter.gradientBlur},e.gradientBlur.set=function(t){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=t},e.start.get=function(){return this.tiltShiftXFilter.start},e.start.set=function(t){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=t},e.end.get=function(){return this.tiltShiftXFilter.end},e.end.set=function(t){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=t},Object.defineProperties(t.prototype,e),t}(n.Filter),H=function(i){function t(t,e,r){void 0===t&&(t=200),void 0===e&&(e=4),void 0===r&&(r=20),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 twist(vec2 coord)\n{\n coord -= offset;\n\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n coord += offset;\n\n return coord;\n}\n\nvoid main(void)\n{\n\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = twist(coord);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord );\n\n}\n"),this.radius=t,this.angle=e,this.padding=r}i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t;var e={offset:{configurable:!0},radius:{configurable:!0},angle:{configurable:!0}};return e.offset.get=function(){return this.uniforms.offset},e.offset.set=function(t){this.uniforms.offset=t},e.radius.get=function(){return this.uniforms.radius},e.radius.set=function(t){this.uniforms.radius=t},e.angle.get=function(){return this.uniforms.angle},e.angle.set=function(t){this.uniforms.angle=t},Object.defineProperties(t.prototype,e),t}(n.Filter),q=function(n){function t(t,e,r,i){void 0===t&&(t=.1),void 0===e&&(e=[0,0]),void 0===r&&(r=0),void 0===i&&(i=-1),n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\n// author: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n\n float minGradient = uInnerRadius * 0.3;\n float innerRadius = (uInnerRadius + minGradient * 0.5) / filterArea.x;\n\n float gradient = uRadius * 0.3;\n float radius = (uRadius - gradient * 0.5) / filterArea.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / filterArea.xy - vTextureCoord);\n float dist = length(vec2(dir.x, dir.y * filterArea.y / filterArea.x));\n\n float strength = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius) {\n delta = innerRadius - dist;\n gap = minGradient;\n } else if (radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity\n delta = dist - radius;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / filterArea.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength *= delta;\n if (countLimit < 1.0)\n {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n }\n\n // randomize the lookup values to hide the fixed number of samples\n float offset = rand(vTextureCoord, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vTextureCoord + dir * percent;\n vec4 sample = texture2D(uSampler, p);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n // switch back from pre-multiplied alpha\n // color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.center=e,this.strength=t,this.innerRadius=r,this.radius=i}n&&(t.__proto__=n),(t.prototype=Object.create(n&&n.prototype)).constructor=t;var e={center:{configurable:!0},strength:{configurable:!0},innerRadius:{configurable:!0},radius:{configurable:!0}};return e.center.get=function(){return this.uniforms.uCenter},e.center.set=function(t){this.uniforms.uCenter=t},e.strength.get=function(){return this.uniforms.uStrength},e.strength.set=function(t){this.uniforms.uStrength=t},e.innerRadius.get=function(){return this.uniforms.uInnerRadius},e.innerRadius.set=function(t){this.uniforms.uInnerRadius=t},e.radius.get=function(){return this.uniforms.uRadius},e.radius.set=function(t){(t<0||t===1/0)&&(t=-1),this.uniforms.uRadius=t},Object.defineProperties(t.prototype,e),t}(n.Filter);return t.AdjustmentFilter=e,t.AdvancedBloomFilter=i,t.AsciiFilter=o,t.BevelFilter=a,t.BloomFilter=g,t.BulgePinchFilter=v,t.CRTFilter=w,t.ColorMapFilter=_,t.ColorReplaceFilter=y,t.ConvolutionFilter=b,t.CrossHatchFilter=x,t.DotFilter=T,t.DropShadowFilter=k,t.EmbossFilter=S,t.GlitchFilter=P,t.GlowFilter=C,t.GodrayFilter=A,t.KawaseBlurFilter=d,t.MotionBlurFilter=E,t.MultiColorReplaceFilter=I,t.OldFilmFilter=O,t.OutlineFilter=M,t.PixelateFilter=D,t.RGBSplitFilter=F,t.RadialBlurFilter=z,t.ReflectionFilter=R,t.ShockwaveFilter=j,t.SimpleLightmapFilter=L,t.TiltShiftAxisFilter=N,t.TiltShiftFilter=X,t.TiltShiftXFilter=B,t.TiltShiftYFilter=U,t.TwistFilter=H,t.ZoomBlurFilter=q,t}({},PIXI,PIXI,PIXI,PIXI.utils,PIXI,PIXI.filters,PIXI.filters),pixi_projection,pixi_projection;Object.assign(PIXI.filters,__filters),this.PIXI=this.PIXI||{},function(p,v){"use strict";var e,f,d=function(){function f(t,e,r){this.value=t,this.time=e,this.next=null,this.isStepped=!1,this.ease=r?"function"==typeof r?r:p.ParticleUtils.generateEase(r):null}return f.createList=function(t){if("list"in t){var e=t.list,r=void 0,i=void 0,n=e[0],o=n.value,a=n.time;if(i=r=new f("string"==typeof o?p.ParticleUtils.hexToRGB(o):o,a,t.ease),2a.time;)n=a,a=t[++o];l=(l-n.time)/(a.time-n.time);var u=f.hexToRGB(n.value),h=f.hexToRGB(a.value),c={r:(h.r-u.r)*l+u.r,g:(h.g-u.g)*l+u.g,b:(h.b-u.b)*l+u.b};i.next=new d(c,s/e),i=i.next}return r};var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function n(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var o=function(){function t(t){void 0===t&&(t=!1),this.current=null,this.next=null,this.isColor=!!t,this.interpolate=null,this.ease=null}return t.prototype.reset=function(t){this.current=t,this.next=t.next,this.next&&1<=this.next.time?this.interpolate=this.isColor?a:r:t.isStepped?this.interpolate=this.isColor?c:u:this.interpolate=this.isColor?l:s,this.ease=this.current.ease},t}();function r(t){return this.ease&&(t=this.ease(t)),(this.next.value-this.current.value)*t+this.current.value}function a(t){this.ease&&(t=this.ease(t));var e=this.current.value,r=this.next.value,i=(r.r-e.r)*t+e.r,n=(r.g-e.g)*t+e.g,o=(r.b-e.b)*t+e.b;return p.ParticleUtils.combineRGBComponents(i,n,o)}function s(t){for(this.ease&&(t=this.ease(t));t>this.next.time;)this.current=this.next,this.next=this.next.next;return t=(t-this.current.time)/(this.next.time-this.current.time),(this.next.value-this.current.value)*t+this.current.value}function l(t){for(this.ease&&(t=this.ease(t));t>this.next.time;)this.current=this.next,this.next=this.next.next;t=(t-this.current.time)/(this.next.time-this.current.time);var e=this.current.value,r=this.next.value,i=(r.r-e.r)*t+e.r,n=(r.g-e.g)*t+e.g,o=(r.b-e.b)*t+e.b;return p.ParticleUtils.combineRGBComponents(i,n,o)}function u(t){for(this.ease&&(t=this.ease(t));this.next&&t>this.next.time;)this.current=this.next,this.next=this.next.next;return this.current.value}function c(t){for(this.ease&&(t=this.ease(t));this.next&&t>this.next.time;)this.current=this.next,this.next=this.next.next;var e=this.current.value;return p.ParticleUtils.combineRGBComponents(e.r,e.g,e.b)}var m,g=function(r){function i(t){var e=r.call(this)||this;return e.emitter=t,e.anchor.x=e.anchor.y=.5,e.velocity=new v.Point,e.rotationSpeed=0,e.rotationAcceleration=0,e.maxLife=0,e.age=0,e.ease=null,e.extraData=null,e.alphaList=new o,e.speedList=new o,e.speedMultiplier=1,e.acceleration=new v.Point,e.maxSpeed=NaN,e.scaleList=new o,e.scaleMultiplier=1,e.colorList=new o(!0),e._doAlpha=!1,e._doScale=!1,e._doSpeed=!1,e._doAcceleration=!1,e._doColor=!1,e._doNormalMovement=!1,e._oneOverLife=0,e.next=null,e.prev=null,e.init=e.init,e.Particle_init=i.prototype.init,e.update=e.update,e.Particle_update=i.prototype.update,e.Sprite_destroy=r.prototype.destroy,e.Particle_destroy=i.prototype.destroy,e.applyArt=e.applyArt,e.kill=e.kill,e}return n(i,r),i.prototype.init=function(){this.age=0,this.velocity.x=this.speedList.current.value*this.speedMultiplier,this.velocity.y=0,p.ParticleUtils.rotatePoint(this.rotation,this.velocity),this.noRotation?this.rotation=0:this.rotation*=p.ParticleUtils.DEG_TO_RADS,this.rotationSpeed*=p.ParticleUtils.DEG_TO_RADS,this.rotationAcceleration*=p.ParticleUtils.DEG_TO_RADS,this.alpha=this.alphaList.current.value,this.scale.x=this.scale.y=this.scaleList.current.value,this._doAlpha=!!this.alphaList.current.next,this._doSpeed=!!this.speedList.current.next,this._doScale=!!this.scaleList.current.next,this._doColor=!!this.colorList.current.next,this._doAcceleration=0!==this.acceleration.x||0!==this.acceleration.y,this._doNormalMovement=this._doSpeed||0!==this.speedList.current.value||this._doAcceleration,this._oneOverLife=1/this.maxLife;var t=this.colorList.current.value;this.tint=p.ParticleUtils.combineRGBComponents(t.r,t.g,t.b),this.visible=!0},i.prototype.applyArt=function(t){this.texture=t||v.Texture.EMPTY},i.prototype.update=function(t){if(this.age+=t,this.age>=this.maxLife||this.age<0)return this.kill(),-1;var e=this.age*this._oneOverLife;if(this.ease&&(e=4==this.ease.length?this.ease(e,0,1,1):this.ease(e)),this._doAlpha&&(this.alpha=this.alphaList.interpolate(e)),this._doScale){var r=this.scaleList.interpolate(e)*this.scaleMultiplier;this.scale.x=this.scale.y=r}if(this._doNormalMovement){var i=void 0,n=void 0;if(this._doSpeed){var o=this.speedList.interpolate(e)*this.speedMultiplier;p.ParticleUtils.normalize(this.velocity),p.ParticleUtils.scaleBy(this.velocity,o),i=this.velocity.x*t,n=this.velocity.y*t}else if(this._doAcceleration){var a=this.velocity.x,s=this.velocity.y;if(this.velocity.x+=this.acceleration.x*t,this.velocity.y+=this.acceleration.y*t,this.maxSpeed){var l=p.ParticleUtils.length(this.velocity);l>this.maxSpeed&&p.ParticleUtils.scaleBy(this.velocity,this.maxSpeed/l)}i=(a+this.velocity.x)/2*t,n=(s+this.velocity.y)/2*t}else i=this.velocity.x*t,n=this.velocity.y*t;this.position.x+=i,this.position.y+=n}if(this._doColor&&(this.tint=this.colorList.interpolate(e)),0!==this.rotationAcceleration){var u=this.rotationSpeed+this.rotationAcceleration*t;this.rotation+=(this.rotationSpeed+u)/2*t,this.rotationSpeed=u}else 0!==this.rotationSpeed?this.rotation+=this.rotationSpeed*t:this.acceleration&&!this.noRotation&&(this.rotation=Math.atan2(this.velocity.y,this.velocity.x));return e},i.prototype.kill=function(){this.emitter.recycle(this)},i.prototype.destroy=function(){this.parent&&this.parent.removeChild(this),this.Sprite_destroy(),this.emitter=this.velocity=this.colorList=this.scaleList=this.alphaList=this.speedList=this.ease=this.next=this.prev=null},i.parseArt=function(t){var e;for(e=t.length;0<=e;--e)"string"==typeof t[e]&&(t[e]=h(t[e]));if(p.ParticleUtils.verbose)for(e=t.length-1;0=this.maxParticles)this._spawnTimer+=this._frequency;else{var l=void 0;if(l=this.minLifetime==this.maxLifetime?this.minLifetime:Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer=this.spawnChance)){var p=void 0;if(this._poolFirst?(p=this._poolFirst,this._poolFirst=this._poolFirst.next,p.next=null):p=new this.particleConstructor(this),1=this.particleImages.length)&&(this._currentImageIndex=0)):p.applyArt(this.particleImages[Math.floor(Math.random()*this.particleImages.length)]):p.applyArt(this.particleImages[0]),p.alphaList.reset(this.startAlpha),1!=this.minimumSpeedMultiplier&&(p.speedMultiplier=Math.random()*(1-this.minimumSpeedMultiplier)+this.minimumSpeedMultiplier),p.speedList.reset(this.startSpeed),p.acceleration.x=this.acceleration.x,p.acceleration.y=this.acceleration.y,p.maxSpeed=this.maxSpeed,1!=this.minimumScaleMultiplier&&(p.scaleMultiplier=Math.random()*(1-this.minimumScaleMultiplier)+this.minimumScaleMultiplier),p.scaleList.reset(this.startScale),p.colorList.reset(this.startColor),this.minRotationSpeed==this.maxRotationSpeed?p.rotationSpeed=this.minRotationSpeed:p.rotationSpeed=Math.random()*(this.maxRotationSpeed-this.minRotationSpeed)+this.minRotationSpeed,p.rotationAcceleration=this.rotationAcceleration,p.noRotation=this.noRotation,p.maxLife=l,p.blendMode=this.particleBlendMode,p.ease=this.customEase,p.extraData=this.extraData,this.applyAdditionalProperties(p),this._spawnFunc(p,u,h,e),p.init(),p.update(-this._spawnTimer),p.parent){var d=this._parent.children;if(d[0]==p)d.shift();else if(d[d.length-1]==p)d.pop();else{var m=d.indexOf(p);d.splice(m,1)}this.addAtBack?d.unshift(p):d.push(p)}else this.addAtBack?this._parent.addChildAt(p,0):this._parent.addChild(p);this._activeParticlesLast?((this._activeParticlesLast.next=p).prev=this._activeParticlesLast,this._activeParticlesLast=p):this._activeParticlesLast=this._activeParticlesFirst=p,++this.particleCount}}this._spawnTimer+=this._frequency}}if(this._posChanged&&(this._prevEmitterPos.x=a,this._prevEmitterPos.y=s,this._prevPosIsValid=!0,this._posChanged=!1),!this._emit&&!this._activeParticlesFirst){if(this._completeCallback){var g=this._completeCallback;this._completeCallback=null,g()}this._destroyWhenComplete&&this.destroy()}}},t.prototype.applyAdditionalProperties=function(t){},t.prototype._spawnPoint=function(t,e,r){this.minStartRotation==this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,t.position.x=e,t.position.y=r},t.prototype._spawnRect=function(t,e,r){this.minStartRotation==this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,b.x=Math.random()*this.spawnRect.width+this.spawnRect.x,b.y=Math.random()*this.spawnRect.height+this.spawnRect.y,0!==this.rotation&&p.ParticleUtils.rotatePoint(this.rotation,b),t.position.x=e+b.x,t.position.y=r+b.y},t.prototype._spawnCircle=function(t,e,r){this.minStartRotation==this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,b.x=Math.random()*this.spawnCircle.radius,b.y=0,p.ParticleUtils.rotatePoint(360*Math.random(),b),b.x+=this.spawnCircle.x,b.y+=this.spawnCircle.y,0!==this.rotation&&p.ParticleUtils.rotatePoint(this.rotation,b),t.position.x=e+b.x,t.position.y=r+b.y},t.prototype._spawnRing=function(t,e,r){var i=this.spawnCircle;this.minStartRotation==this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,i.minRadius!==i.radius?b.x=Math.random()*(i.radius-i.minRadius)+i.minRadius:b.x=i.radius,b.y=0;var n=360*Math.random();t.rotation+=n,p.ParticleUtils.rotatePoint(n,b),b.x+=this.spawnCircle.x,b.y+=this.spawnCircle.y,0!==this.rotation&&p.ParticleUtils.rotatePoint(this.rotation,b),t.position.x=e+b.x,t.position.y=r+b.y},t.prototype._spawnPolygonalChain=function(t,e,r){this.minStartRotation==this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,this.spawnPolygonalChain.getRandomPoint(b),0!==this.rotation&&p.ParticleUtils.rotatePoint(this.rotation,b),t.position.x=e+b.x,t.position.y=r+b.y},t.prototype._spawnBurst=function(t,e,r,i){0===this.particleSpacing?t.rotation=360*Math.random():t.rotation=this.angleStart+this.particleSpacing*i+this.rotation,t.position.x=e,t.position.y=r},t.prototype.cleanup=function(){var t,e;for(t=this._activeParticlesFirst;t;t=e)e=t.next,this.recycle(t),t.parent&&t.parent.removeChild(t);this._activeParticlesFirst=this._activeParticlesLast=null,this.particleCount=0},t.prototype.destroy=function(){var t;this.autoUpdate=!1,this.cleanup();for(var e=this._poolFirst;e;e=t)t=e.next,e.destroy();this._poolFirst=this._parent=this.particleImages=this.spawnPos=this.ownerPos=this.startColor=this.startScale=this.startAlpha=this.startSpeed=this.customEase=this._completeCallback=null},t}(),w=new v.Point,T=["pow","sqrt","abs","floor","round","ceil","E","PI","sin","cos","tan","asin","acos","atan","atan2","log"],k=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(T).join("|"),"g"),S=function(r){function t(t){var e=r.call(this,t)||this;return e.path=null,e.initialRotation=0,e.initialPosition=new v.Point,e.movement=0,e}return n(t,r),t.prototype.init=function(){this.initialRotation=this.rotation,this.Particle_init(),this.path=this.extraData.path,this._doNormalMovement=!this.path,this.movement=0,this.initialPosition.x=this.position.x,this.initialPosition.y=this.position.y},t.prototype.update=function(t){var e=this.Particle_update(t);if(0<=e&&this.path){var r=this.speedList.interpolate(e)*this.speedMultiplier;this.movement+=r*t,w.x=this.movement,w.y=this.path(this.movement),p.ParticleUtils.rotatePoint(this.initialRotation,w),this.position.x=this.initialPosition.x+w.x,this.position.y=this.initialPosition.y+w.y}return e},t.prototype.destroy=function(){this.Particle_destroy(),this.path=this.initialPosition=null},t.parseArt=function(t){return g.parseArt(t)},t.parseData=function(t){var e={};if(t&&t.path)try{e.path=function(t){for(var e=t.match(k),r=e.length-1;0<=r;--r)0<=T.indexOf(e[r])&&(e[r]="Math."+e[r]);return t=e.join(""),new Function("x","return "+t+";")}(t.path)}catch(t){p.ParticleUtils.verbose&&console.error("PathParticle: error in parsing path expression"),e.path=null}else p.ParticleUtils.verbose&&console.error("PathParticle requires a path string in extraData!"),e.path=null;return e},t}(g),P=function(r){function t(t){var e=r.call(this,t)||this;return e.textures=null,e.duration=0,e.framerate=0,e.elapsed=0,e.loop=!1,e}return n(t,r),t.prototype.init=function(){this.Particle_init(),this.elapsed=0,this.framerate<0&&(this.duration=this.maxLife,this.framerate=this.textures.length/this.duration)},t.prototype.applyArt=function(t){this.textures=t.textures,this.framerate=t.framerate,this.duration=t.duration,this.loop=t.loop},t.prototype.update=function(t){var e=this.Particle_update(t);if(0<=e){this.elapsed+=t,this.elapsed>this.duration&&(this.loop?this.elapsed=this.elapsed%this.duration:this.elapsed=this.duration-1e-6);var r=this.elapsed*this.framerate+1e-7|0;this.texture=this.textures[r]||v.Texture.EMPTY}return e},t.prototype.destroy=function(){this.Particle_destroy(),this.textures=null},t.parseArt=function(t){for(var e,r,i,n,o,a=[],s=0;se[s]&&(i=e[s]),oe[s+1]&&(n=e[s+1]),af[u]){l=c[s];c[s]=c[u],c[u]=l;var h=f[s];f[s]=f[u],f[u]=h}if(e[0]=c[0].x,e[1]=c[0].y,e[2]=c[1].x,e[3]=c[1].y,e[4]=c[2].x,e[5]=c[2].y,e[6]=c[3].x,e[7]=c[3].y,(c[3].x-c[2].x)*(c[1].y-c[2].y)-(c[1].x-c[2].x)*(c[3].y-c[2].y)<0)return e[4]=c[3].x,void(e[5]=c[3].y)}},t}();t.Surface=e}(pixi_projection||(pixi_projection={})),function(t){var k=new PIXI.Matrix,n=new PIXI.Rectangle,S=new PIXI.Point,e=function(e){function t(){var t=e.call(this)||this;return t.distortion=new PIXI.Point,t}return __extends(t,e),t.prototype.clear=function(){this.distortion.set(0,0)},t.prototype.apply=function(t,e){e=e||new PIXI.Point;var r=this.distortion,i=t.x*t.y;return e.x=t.x+r.x*i,e.y=t.y+r.y*i,e},t.prototype.applyInverse=function(t,e){e=e||new PIXI.Point;var r=t.x,i=t.y,n=this.distortion.x,o=this.distortion.y;if(0==n)e.x=r,e.y=i/(1+o*r);else if(0==o)e.y=i,e.x=r/(1+n*i);else{var a=.5*(i*n-r*o+1)/o,s=a*a+r/o;if(s<=1e-5)return void e.set(NaN,NaN);e.x=0 vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n uv.x = vTrans1.x * surface2.x + vTrans1.y * surface2.y + vTrans1.z;\n uv.y = vTrans2.x * surface2.x + vTrans2.y * surface2.y + vTrans2.z;\n pixels = uv * samplerSize[0];\n \n if (pixels.x < vFrame.x || pixels.x > vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n discard;\n }\n}\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = 1.0; //edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\n%forloop%\ngl_FragColor = color * rColor;\n}",geometryClass:r.Batch3dGeometry,vertexSize:7},t),i=e.vertex,n=e.fragment,o=e.vertexSize,a=e.geometryClass;return function(r){function t(t){var e=r.call(this,t)||this;return e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e.shaderGenerator=new PIXI.BatchShaderGenerator(i,n),e.geometryClass=a,e.vertexSize=o,e}return __extends(t,r),t.prototype.getUniforms=function(t){var e=t.proj;this._shader;return null!==e.surface?e.uniforms:null!==e._activeProjection?e._activeProjection.uniforms:this.defUniforms},t.prototype.packGeometry=function(t,e,r,i,n,o){for(var a=n/this.vertexSize,s=(t.uvs,t.indices),l=t.vertexData,u=t._texture._frame,h=t.aTrans,c=Math.min(t.worldAlpha,1),f=c<1&&t._texture.baseTexture.premultiplyAlpha?d(t._tintRGB,c):t._tintRGB+(255*c<<24),p=0;p=o.TRANSFORM_STEP.PROJ?(i||this.displayObjectUpdateTransform(),this.proj.affine?this.transform.worldTransform.applyInverse(t,r):this.proj.world.applyInverse(t,r)):(this.parent?r=this.parent.worldTransform.applyInverse(t,r):r.copyFrom(t),n===o.TRANSFORM_STEP.NONE?r:this.transform.localTransform.applyInverse(r,r))},Object.defineProperty(t.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),t}(PIXI.Container);o.Container2d=t,o.container2dToLocal=t.prototype.toLocal}(pixi_projection||(pixi_projection={})),function(t){var l,e,v=PIXI.Point,r=[1,0,0,0,1,0,0,0,1];(e=l=t.AFFINE||(t.AFFINE={}))[e.NONE=0]="NONE",e[e.FREE=1]="FREE",e[e.AXIS_X=2]="AXIS_X",e[e.AXIS_Y=3]="AXIS_Y",e[e.POINT=4]="POINT",e[e.AXIS_XR=5]="AXIS_XR";var i=function(){function t(t){this.floatArray=null,this.mat3=new Float64Array(t||r)}return Object.defineProperty(t.prototype,"a",{get:function(){return this.mat3[0]/this.mat3[8]},set:function(t){this.mat3[0]=t*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this.mat3[1]/this.mat3[8]},set:function(t){this.mat3[1]=t*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"c",{get:function(){return this.mat3[3]/this.mat3[8]},set:function(t){this.mat3[3]=t*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"d",{get:function(){return this.mat3[4]/this.mat3[8]},set:function(t){this.mat3[4]=t*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tx",{get:function(){return this.mat3[6]/this.mat3[8]},set:function(t){this.mat3[6]=t*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ty",{get:function(){return this.mat3[7]/this.mat3[8]},set:function(t){this.mat3[7]=t*this.mat3[8]},enumerable:!0,configurable:!0}),t.prototype.set=function(t,e,r,i,n,o){var a=this.mat3;return a[0]=t,a[1]=e,a[2]=0,a[3]=r,a[4]=i,a[5]=0,a[6]=n,a[7]=o,a[8]=1,this},t.prototype.toArray=function(t,e){this.floatArray||(this.floatArray=new Float32Array(9));var r=e||this.floatArray,i=this.mat3;return t?(r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7]):(r[0]=i[0],r[1]=i[3],r[2]=i[6],r[3]=i[1],r[4]=i[4],r[5]=i[7],r[6]=i[2],r[7]=i[5]),r[8]=i[8],r},t.prototype.apply=function(t,e){e=e||new PIXI.Point;var r=this.mat3,i=t.x,n=t.y,o=1/(r[2]*i+r[5]*n+r[8]);return e.x=o*(r[0]*i+r[3]*n+r[6]),e.y=o*(r[1]*i+r[4]*n+r[7]),e},t.prototype.translate=function(t,e){var r=this.mat3;return r[0]+=t*r[2],r[1]+=e*r[2],r[3]+=t*r[5],r[4]+=e*r[5],r[6]+=t*r[8],r[7]+=e*r[8],this},t.prototype.scale=function(t,e){var r=this.mat3;return r[0]*=t,r[1]*=e,r[3]*=t,r[4]*=e,r[6]*=t,r[7]*=e,this},t.prototype.scaleAndTranslate=function(t,e,r,i){var n=this.mat3;n[0]=t*n[0]+r*n[2],n[1]=e*n[1]+i*n[2],n[3]=t*n[3]+r*n[5],n[4]=e*n[4]+i*n[5],n[6]=t*n[6]+r*n[8],n[7]=e*n[7]+i*n[8]},t.prototype.applyInverse=function(t,e){e=e||new v;var r=this.mat3,i=t.x,n=t.y,o=r[0],a=r[3],s=r[6],l=r[1],u=r[4],h=r[7],c=r[2],f=r[5],p=r[8],d=(p*u-h*f)*i+(-p*a+s*f)*n+(h*a-s*u),m=(-p*l+h*c)*i+(p*o-s*c)*n+(-h*o+s*l),g=(f*l-u*c)*i+(-f*o+a*c)*n+(u*o-a*l);return e.x=d/g,e.y=m/g,e},t.prototype.invert=function(){var t=this.mat3,e=t[0],r=t[1],i=t[2],n=t[3],o=t[4],a=t[5],s=t[6],l=t[7],u=t[8],h=u*o-a*l,c=-u*n+a*s,f=l*n-o*s,p=e*h+r*c+i*f;return p&&(p=1/p,t[0]=h*p,t[1]=(-u*r+i*l)*p,t[2]=(a*r-i*o)*p,t[3]=c*p,t[4]=(u*e-i*s)*p,t[5]=(-a*e+i*n)*p,t[6]=f*p,t[7]=(-l*e+r*s)*p,t[8]=(o*e-r*n)*p),this},t.prototype.identity=function(){var t=this.mat3;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},t.prototype.clone=function(){return new t(this.mat3)},t.prototype.copyTo2dOr3d=function(t){var e=this.mat3,r=t.mat3;return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],t},t.prototype.copyTo=function(t,e,r){var i=this.mat3,n=1/i[8],o=i[6]*n,a=i[7]*n;if(t.a=(i[0]-i[2]*o)*n,t.b=(i[1]-i[2]*a)*n,t.c=(i[3]-i[5]*o)*n,t.d=(i[4]-i[5]*a)*n,t.tx=o,t.ty=a,2<=e){var s=t.a*t.d-t.b*t.c;r||(s=Math.abs(s)),e===l.POINT?(s=0>0,0!==f._cycle&&f._cycle===f._totalTime/a&&m<=t&&f._cycle--,f._time=f._totalTime-f._cycle*a,f._yoyo&&0!=(1&f._cycle)&&(f._time=v-f._time,(c=f._yoyoEase||f.vars.yoyoEase)&&(f._yoyoEase||(!0!==c||f._initted?f._yoyoEase=c=!0===c?f._ease:c instanceof Ease?c:Ease.map[c]:(c=f.vars.ease,f._yoyoEase=c=c?c instanceof Ease?c:"function"==typeof c?new Ease(c,f.vars.easeParams):Ease.map[c]||y.defaultEase:y.defaultEase)),f.ratio=c?1-c.getRatio((v-f._time)/v):0)),f._time>v?f._time=v:f._time<0&&(f._time=0)),f._easeType&&!c?(s=f._time/v,(1===(l=f._easeType)||3===l&&.5<=s)&&(s=1-s),3===l&&(s*=2),1===(u=f._easePower)?s*=s:2===u?s*=s*s:3===u?s*=s*s*s:4===u&&(s*=s*s*s*s),f.ratio=1===l?1-s:2===l?s:f._time/v<.5?s/2:1-s/2):c||(f.ratio=f._ease.getRatio(f._time/v))),d!==f._time||r||g!==f._cycle){if(!f._initted){if(f._init(),!f._initted||f._gc)return;if(!r&&f._firstPT&&(!1!==f.vars.lazy&&f._duration||f.vars.lazy&&!f._duration))return f._time=d,f._totalTime=m,f._rawPrevTime=_,f._cycle=g,x.lazyTweens.push(f),void(f._lazy=[t,e]);!f._time||i||c?i&&this._ease._calcEnd&&!c&&(f.ratio=f._ease.getRatio(0===f._time?0:1)):f.ratio=f._ease.getRatio(f._time/v)}for(!1!==f._lazy&&(f._lazy=!1),f._active||!f._paused&&f._time!==d&&0<=t&&(f._active=!0),0===m&&(2===f._initted&&0t._startTime;l._timeline;)u&&l._timeline.smoothChildTiming?l.totalTime(l._totalTime,!0):l._gc&&l._enabled(!0,!1),l=l._timeline;return h},r.remove=function(t){if(t instanceof c){this._remove(t,!1);var e=t._timeline=t.vars.useFrames?c._rootFramesTimeline:c._rootTimeline;return t._startTime=(t._paused?t._pauseTime:e._time)-(t._reversed?t.totalDuration()-t._totalTime:t._totalTime)/t._timeScale,this}if(t instanceof Array||t&&t.push&&p(t)){for(var r=t.length;-1<--r;)this.remove(t[r]);return this}return"string"==typeof t?this.removeLabel(t):this.kill(null,t)},r._remove=function(t,e){return f.prototype._remove.call(this,t,e),this._last?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},r.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},r.insert=r.insertMultiple=function(t,e,r,i){return this.add(t,e||0,r,i)},r.appendMultiple=function(t,e,r,i){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),r,i)},r.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},r.addPause=function(t,e,r,i){var n=d.delayedCall(0,o,r,i||this);return n.vars.onComplete=n.vars.onReverseComplete=e,n.data="isPause",this._hasPause=!0,this.add(n,t)},r.removeLabel=function(t){return delete this._labels[t],this},r.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},r._parseTimeOrLabel=function(t,e,r,i){var n,o;if(i instanceof c&&i.timeline===this)this.remove(i);else if(i&&(i instanceof Array||i.push&&p(i)))for(o=i.length;-1<--o;)i[o]instanceof c&&i[o].timeline===this&&this.remove(i[o]);if(n="number"!=typeof t||e?99999999999=t&&!l;)i._duration||"isPause"===i.data&&0c._time;)l.render(l._reversed?l.totalDuration()-(t-l._startTime)*l._timeScale:(t-l._startTime)*l._timeScale,e,r),l=l._prev;l=null,c.pause(),c._pauseTime=h}i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(t-i._startTime)*i._timeScale,e,r):i.render((t-i._startTime)*i._timeScale,e,r)}i=o}c._onUpdate&&(e||(v.length&&_(),c._callback("onUpdate"))),a&&(c._gc||d!==c._startTime&&m===c._timeScale||(0===c._time||p>=c.totalDuration())&&(n&&(v.length&&_(),c._timeline.autoRemoveChildren&&c._enabled(!1,!1),c._active=!1),!e&&c.vars[a]&&c._callback(a)))}},r._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof m&&t._hasPausedChild())return!0;t=t._next}return!1},r.getChildren=function(t,e,r,i){i=i||-9999999999;for(var n=[],o=this._first,a=0;o;)o._startTime=r&&(n._startTime+=t),n=n._next;if(e)for(i in o)o[i]>=r&&(o[i]+=t);return this._uncache(!0)},r._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var r=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),i=r.length,n=!1;-1<--i;)r[i]._kill(t,e)&&(n=!0);return n},r.clear=function(t){var e=this.getChildren(!1,!0,!0),r=e.length;for(this._time=this._totalTime=0;-1<--r;)e[r]._enabled(!1,!1);return!1!==t&&(this._labels={}),this._uncache(!0)},r.invalidate=function(){for(var t=this._first;t;)t.invalidate(),t=t._next;return c.prototype.invalidate.call(this)},r._enabled=function(t,e){if(t===this._gc)for(var r=this._first;r;)r._enabled(t,!0),r=r._next;return f.prototype._enabled.call(this,t,e)},r.totalTime=function(t,e,r){this._forcingPlayhead=!0;var i=c.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,i},r.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},r.totalDuration=function(t){if(arguments.length)return t&&this.totalDuration()?this.timeScale(this._totalDuration/t):this;if(this._dirty){for(var e,r,i=0,n=this,o=n._last,a=999999999999;o;)e=o._prev,o._dirty&&o.totalDuration(),o._startTime>a&&n._sortChildren&&!o._paused&&!n._calculatingDuration?(n._calculatingDuration=1,n.add(o,o._startTime-o._delay),n._calculatingDuration=0):a=o._startTime,o._startTime<0&&!o._paused&&(i-=o._startTime,n._timeline.smoothChildTiming&&(n._startTime+=o._startTime/n._timeScale,n._time-=o._startTime,n._totalTime-=o._startTime,n._rawPrevTime-=o._startTime),n.shiftChildren(-o._startTime,!1,-9999999999),a=0),i<(r=o._startTime+o._totalDuration/o._timeScale)&&(i=r),o=e;n._duration=n._totalDuration=i,n._dirty=!1}return this._totalDuration},r.paused=function(t){if(!1===t&&this._paused)for(var e=this._first;e;)e._startTime===this._time&&"isPause"===e.data&&(e._rawPrevTime=0),e=e._next;return c.prototype.paused.apply(this,arguments)},r.usesFrames=function(){for(var t=this._timeline;t._timeline;)t=t._timeline;return t===c._rootFramesTimeline},r.rawTime=function(t){return t&&(this._paused||this._repeat&&0>0,f._cycle&&f._cycle===f._totalTime/l&&g<=t&&f._cycle--,f._time=f._totalTime-f._cycle*l,f._yoyo&&1&f._cycle&&(f._time=m-f._time),f._time>m?t=(f._time=m)+1e-4:f._time<0?f._time=t=0:t=f._time));if(f._hasPause&&!f._forcingPlayhead&&!e){if(p<(t=f._time)||f._repeat&&x!==f._cycle)for(i=f._first;i&&i._startTime<=t&&!u;)i._duration||"isPause"!==i.data||i.ratio||0===i._startTime&&0===f._rawPrevTime||(u=i),i=i._next;else for(i=f._last;i&&i._startTime>=t&&!u;)i._duration||"isPause"===i.data&&0f._time;)u.render(u._reversed?u.totalDuration()-(t-u._startTime)*u._timeScale:(t-u._startTime)*u._timeScale,e,r),u=u._prev;u=null,f.pause(),f._pauseTime=c}i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(t-i._startTime)*i._timeScale,e,r):i.render((t-i._startTime)*i._timeScale,e,r)}i=o}f._onUpdate&&(e||(E.length&&I(),f._callback("onUpdate"))),a&&(f._locked||f._gc||v!==f._startTime&&_===f._timeScale||(0===f._time||d>=f.totalDuration())&&(n&&(E.length&&I(),f._timeline.autoRemoveChildren&&f._enabled(!1,!1),f._active=!1),!e&&f.vars[a]&&f._callback(a)))}else g!==f._totalTime&&f._onUpdate&&(e||f._callback("onUpdate"))},n.getActive=function(t,e,r){var i,n,o=[],a=this.getChildren(t||null==t,e||null==t,!!r),s=0,l=a.length;for(i=0;it)return r[e].name;return null},n.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),r=e.length;-1<--r;)if(e[r].time>0||6)-1,c=[],f=[];for(r in t)d(t[r],a,e);for(n=a.length,i=0;i>0]=f,s[o]=u,l=0,f=[]);return{length:u,lengths:s,segments:c}}(this._beziers,this._timeRes);this._length=f.length,this._lengths=f.lengths,this._segments=f.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(c=this._autoRotate)for(this._initialRotations=[],c[0]instanceof Array||(this._autoRotate=c=[c]),o=c.length;-1<--o;){for(a=0;a<3;a++)i=c[o][a],this._func[i]="function"==typeof t[i]&&t[i.indexOf("set")||"function"!=typeof t["get"+i.substr(3)]?i:"get"+i.substr(3)];i=c[o][2],this._initialRotations[o]=(this._func[i]?this._func[i].call(this._target):this._target[i])||0,this._overwriteProps.push(i)}return this._startRatio=r.vars.runBackwards?1:0,!0},set:function(t){var e,r,i,n,o,a,s,l,u,h,c,f=this._segCount,p=this._func,d=this._target,m=t!==this._startRatio;if(this._timeRes){if(u=this._lengths,h=this._curSeg,c=t*this._length,i=this._li,c>this._l2&&i=c;);0===i&&cthis._s2&&i=c;);0===i&&c>0)*(1/f))*f;for(r=1-a,i=this._props.length;-1<--i;)n=this._props[i],s=(a*a*(o=this._beziers[n][e]).da+3*r*(a*o.ca+r*o.ba))*a+o.a,this._mod[n]&&(s=this._mod[n](s,d)),p[n]?d[n](s):d[n]=s;if(this._autoRotate){var g,v,_,y,b,x,w,T=this._autoRotate;for(i=T.length;-1<--i;)n=T[i][2],x=T[i][3]||0,w=!0===T[i][4]?1:k,o=this._beziers[T[i][0]],g=this._beziers[T[i][1]],o&&g&&(o=o[e],g=g[e],v=o.a+(o.b-o.a)*a,v+=((y=o.b+(o.c-o.b)*a)-v)*a,y+=(o.c+(o.d-o.c)*a-y)*a,_=g.a+(g.b-g.a)*a,_+=((b=g.b+(g.c-g.b)*a)-_)*a,b+=(g.c+(g.d-g.c)*a-b)*a,s=m?Math.atan2(b-_,y-v)*w+x:this._initialRotations[i],this._mod[n]&&(s=this._mod[n](s,d)),p[n]?d[n](s):d[n]=s)}}}),t=g.prototype,g.bezierThrough=p,g.cubicToQuadratic=S,g._autoCSS=!0,g.quadraticToCubic=function(t,e,r){return new _(t,(2*e+t)/3,(2*e+r)/3,r)},g._cssRegister=function(){var t=r.CSSPlugin;if(t){var e=t._internals,p=e._parseToProxy,d=e._setPluginRatio,m=e.CSSPropTween;e._registerComplexSpecialProp("bezier",{parser:function(t,e,r,i,n,o){e instanceof Array&&(e={values:e}),o=new g;var a,s,l,u=e.values,h=u.length-1,c=[],f={};if(h<0)return n;for(a=0;a<=h;a++)l=p(t,u[a],i,n,o,h!==a),c[a]=l.end;for(s in e)f[s]=e[s];return f.values=c,(n=new m(t,"bezier",0,0,l.pt,2)).data=l,n.plugin=o,n.setRatio=d,0===f.autoRotate&&(f.autoRotate=!0),!f.autoRotate||f.autoRotate instanceof Array||(a=!0===f.autoRotate?0:Number(f.autoRotate),f.autoRotate=null!=l.end.left?[["left","top","rotation",a,!1]]:null!=l.end.x&&[["x","y","rotation",a,!1]]),f.autoRotate&&(i._transform||i._enableTransforms(!1),l.autoRotate=i._target._gsTransform,l.proxy.rotation=l.autoRotate.rotation||0,i._overwriteProps.push("rotation")),o._onInitTween(l.proxy,f,i._tween),n}})}},t._mod=function(t){for(var e,r=this._overwriteProps,i=r.length;-1<--i;)(e=t[r[i]])&&"function"==typeof e&&(this._mod[r[i]]=e)},t._kill=function(t){var e,r,i=this._props;for(e in this._beziers)if(e in t)for(delete this._beziers[e],delete this._func[e],r=i.length;-1<--r;)i[r]===e&&i.splice(r,1);if(i=this._autoRotate)for(r=i.length;-1<--r;)t[i[r][2]]&&i.splice(r,1);return this._super._kill.call(this,t)},_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(o,B){var d,k,S,m,U=function(){o.call(this,"css"),this._overwriteProps.length=0,this.setRatio=U.prototype.setRatio},u=_gsScope._gsDefine.globals,g={},t=U.prototype=new o("css");(t.constructor=U).version="2.1.3",U.API=2,U.defaultTransformPerspective=0,U.defaultSkewType="compensated",U.defaultSmoothOrigin=!0,t="px",U.suffixMap={top:t,right:t,bottom:t,left:t,width:t,height:t,fontSize:t,padding:t,margin:t,perspective:t,lineHeight:""};var C,v,_,j,y,P,A,E,e,r,I=/(?:\-|\.|\b)(\d|\.|e\-)+/g,O=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,b=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,n=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b),?/gi,h=/(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,M=/(?:\d|\-|\+|=|#|\.)*/g,D=/opacity *= *([^)]*)/i,x=/opacity:([^;]*)/i,a=/alpha\(opacity *=.+?\)/i,w=/^(rgb|hsl)/,s=/([A-Z])/g,l=/-([a-z])/gi,T=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,c=function(t,e){return e.toUpperCase()},p=/(?:Left|Right|Width)/i,f=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,z=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,R=/,(?=[^\)]*(?:\(|$))/gi,F=/[\s,\(]/i,L=Math.PI/180,X=180/Math.PI,N={},i={style:{}},H=_gsScope.document||{createElement:function(){return i}},q=function(t,e){var r=H.createElementNS?H.createElementNS(e||"http://www.w3.org/1999/xhtml",t):H.createElement(t);return r.style?r:H.createElement(t)},W=q("div"),G=q("img"),V=U._internals={_specialProps:g},Y=(_gsScope.navigator||{}).userAgent||"",Z=(e=Y.indexOf("Android"),r=q("a"),_=-1!==Y.indexOf("Safari")&&-1===Y.indexOf("Chrome")&&(-1===e||3>16,t>>8&255,255&t];else{if(","===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)),mt[t])r=mt[t];else if("#"===t.charAt(0))4===t.length&&(t="#"+(i=t.charAt(1))+i+(n=t.charAt(2))+n+(o=t.charAt(3))+o),r=[(t=parseInt(t.substr(1),16))>>16,t>>8&255,255&t];else if("hsl"===t.substr(0,3))if(r=f=t.match(I),e){if(-1!==t.indexOf("="))return t.match(O)}else a=Number(r[0])%360/360,s=Number(r[1])/100,i=2*(l=Number(r[2])/100)-(n=l<=.5?l*(s+1):l+s-l*s),3i--)for(;++ii--)for(;++i>0];return i.parse(t,a,n,o)}},wt=(V._setPluginRatio=function(t){this.plugin.setRatio(t);for(var e,r,i,n,o,a=this.data,s=a.proxy,l=a.firstMPT;l;)e=s[l.v],l.r?e=l.r(e):e<1e-6&&-1e-6s.length?l.length:s.length,a=0;ao.pr;)a=a._next;(o._prev=a?a._prev:l)?o._prev._next=o:s=o,(o._next=a)?a._prev=o:l=o,o=u}this._firstPT=s}return!0},t.parse=function(t,e,r,i){var n,o,a,s,l,u,h,c,f,p,d=t.style;for(n in e){if(u=e[n],o=g[n],"function"!=typeof u||o&&o.allowFunc||(u=u(E,A)),o)r=o.parse(t,u,n,this,r,i,e);else{if("--"===n.substr(0,2)){this._tween._propLookup[n]=this._addTween.call(this._tween,t.style,"setProperty",rt(t).getPropertyValue(n)+"",u+"",n,!1,n);continue}l=it(t,n,S)+"",f="string"==typeof u,"color"===n||"fill"===n||"stroke"===n||-1!==n.indexOf("Color")||f&&w.test(u)?(f||(u=(3<(u=vt(u)).length?"rgba(":"rgb(")+u.join(",")+")"),r=St(d,n,l,u,!0,"transparent",r,0,i)):f&&F.test(u)?r=St(d,n,l,u,!0,null,r,0,i):(h=(a=parseFloat(l))||0===a?l.substr((a+"").length):"",""!==l&&"auto"!==l||(h="width"===n||"height"===n?(a=ht(t,n,S),"px"):"left"===n||"top"===n?(a=ot(t,n,S),"px"):(a="opacity"!==n?0:1,"")),""===(c=(p=f&&"="===u.charAt(1))?(s=parseInt(u.charAt(0)+"1",10),u=u.substr(2),s*=parseFloat(u),u.replace(M,"")):(s=parseFloat(u),f?u.replace(M,""):""))&&(c=n in k?k[n]:h),u=s||0===s?(p?s+a:s)+c:e[n],h!==c&&(""===c&&"lineHeight"!==n||(s||0===s)&&a&&(a=nt(t,n,a,h),"%"===c?(a/=nt(t,n,100,"%")/100,!0!==e.strictUnits&&(l=a+"%")):"em"===c||"rem"===c||"vw"===c||"vh"===c?a/=nt(t,n,1,c):"px"!==c&&(s=nt(t,n,s,c),c="px"),p&&(s||0===s)&&(u=s+a+c))),p&&(s+=a),!a&&0!==a||!s&&0!==s?void 0!==d[n]&&(u||u+""!="NaN"&&null!=u)?(r=new Tt(d,n,s||a||0,0,r,-1,n,!1,0,l,u)).xs0="none"!==u||"display"!==n&&-1===n.indexOf("Style")?u:l:K("invalid "+n+" tween value: "+e[n]):(r=new Tt(d,n,a,s-a,r,0,n,!1!==C&&("px"===c||"zIndex"===n),0,l,u)).xs0=c)}i&&r&&!r.plugin&&(r.plugin=i)}return r},t.setRatio=function(t){var e,r,i,n=this._firstPT;if(1!==t||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(t||this._tween._time!==this._tween._duration&&0!==this._tween._time||-1e-6===this._tween._rawPrevTime)for(;n;){if(e=n.c*t+n.s,n.r?e=n.r(e):e<1e-6&&-1e-6this._p3?this._calcEnd?1===t?0:1-(t=(t-this._p3)/this._p1)*t:e+(t-e)*(t=(t-this._p3)/this._p1)*t*t*t:this._calcEnd?1:e},d.ease=new d(.7,.7),m.config=d.config=function(t,e,r){return new d(t,e,r)},(m=(r=l("easing.SteppedEase",function(t,e){t=t||1,this._p1=1/t,this._p2=t+(e?0:1),this._p3=e?1:0},!0)).prototype=new g).constructor=r,m.getRatio=function(t){return t<0?t=0:1<=t&&(t=.999999999),((this._p2*t|0)+this._p3)*this._p1},m.config=r.config=function(t,e){return new r(t,e)},(m=(i=l("easing.ExpoScaleEase",function(t,e,r){this._p1=Math.log(e/t),this._p2=e-t,this._p3=t,this._ease=r},!0)).prototype=new g).constructor=i,m.getRatio=function(t){return this._ease&&(t=this._ease.getRatio(t)),(this._p3*Math.exp(this._p1*t)-this._p3)/this._p2},m.config=i.config=function(t,e,r){return new i(t,e,r)},(m=(e=l("easing.RoughEase",function(t){for(var e,r,i,n,o,a,s=(t=t||{}).taper||"none",l=[],u=0,h=0|(t.points||20),c=h,f=!1!==t.randomize,p=!0===t.clamp,d=t.template instanceof g?t.template:null,m="number"==typeof t.strength?.4*t.strength:.4;-1<--c;)e=f?Math.random():1/h*c,r=d?d.getRatio(e):e,i="none"===s?m:"out"===s?(n=1-e)*n*m:"in"===s?e*e*m:e<.5?(n=2*e)*n*.5*m:(n=2*(1-e))*n*.5*m,f?r+=Math.random()*i-.5*i:c%2?r+=.5*i:r-=.5*i,p&&(1e.t){for(;e.next&&t>=e.t;)e=e.next;e=e.prev}else for(;e.prev&&t<=e.t;)e=e.prev;return(this._prev=e).v+(t-e.t)/e.gap*e.c},m.config=function(t){return new e(t)},e.ease=new e,c("Bounce",u("BounceOut",function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}),u("BounceIn",function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}),u("BounceInOut",function(t){var e=t<.5;return(t=e?1-2*t:2*t-1)<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5})),c("Circ",u("CircOut",function(t){return Math.sqrt(1-(t-=1)*t)}),u("CircIn",function(t){return-(Math.sqrt(1-t*t)-1)}),u("CircInOut",function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)})),c("Elastic",(t=function(t,e,r){var i=l("easing."+t,function(t,e){this._p1=1<=t?t:1,this._p2=(e||r)/(t<1?t:1),this._p3=this._p2/a*(Math.asin(1/this._p1)||0),this._p2=a/this._p2},!0),n=i.prototype=new g;return n.constructor=i,n.getRatio=e,n.config=function(t,e){return new i(t,e)},i})("ElasticOut",function(t){return this._p1*Math.pow(2,-10*t)*Math.sin((t-this._p3)*this._p2)+1},.3),t("ElasticIn",function(t){return-this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2)},.3),t("ElasticInOut",function(t){return(t*=2)<1?this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2)*-.5:this._p1*Math.pow(2,-10*(t-=1))*Math.sin((t-this._p3)*this._p2)*.5+1},.45)),c("Expo",u("ExpoOut",function(t){return 1-Math.pow(2,-10*t)}),u("ExpoIn",function(t){return Math.pow(2,10*(t-1))-.001}),u("ExpoInOut",function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))})),c("Sine",u("SineOut",function(t){return Math.sin(t*s)}),u("SineIn",function(t){return 1-Math.cos(t*s)}),u("SineInOut",function(t){return-.5*(Math.cos(Math.PI*t)-1)})),l("easing.EaseLookup",{find:function(t){return g.map[t]}},!0),h(n.SlowMo,"SlowMo","ease,"),h(e,"RoughEase","ease,"),h(r,"SteppedEase","ease,"),p},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(f,p){"use strict";var d={},i=f.document,m=f.GreenSockGlobals=f.GreenSockGlobals||f,t=m[p];if(t)return"undefined"!=typeof module&&module.exports&&(module.exports=t);var e,r,n,g,v,o,a,_=function(t){var e,r=t.split("."),i=m;for(e=0;e=r&&tthis._duration?this._duration:t,e)):this._time},n.totalTime=function(t,e,r){if(v||g.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(t<0&&!r&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var i=this._totalDuration,n=this._timeline;if(io;)n=n._prev;return n?(t._next=n._next,n._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=n,this._recent=t,this._timeline&&this._uncache(!0),this},n._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,t===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(t,e,r){var i,n=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;n;)i=n._next,(n._active||t>=n._startTime&&!n._paused&&!n._gc)&&(n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(t-n._startTime)*n._timeScale,e,r):n.render((t-n._startTime)*n._timeScale,e,r)),n=i},n.rawTime=function(){return v||g.wake(),this._totalTime};var R=k("TweenLite",function(t,e,r){if(M.call(this,e,r),this.render=R.prototype.render,null==t)throw"Cannot tween a null target.";this.target=t="string"!=typeof t?t:R.selector(t)||t;var i,n,o,a=t.jquery||t.length&&t!==f&&t[0]&&(t[0]===f||t[0].nodeType&&t[0].style&&!t.nodeType),s=this.vars.overwrite;if(this._overwrite=s=null==s?J[R.defaultOverwrite]:"number"==typeof s?s>>0:J[s],(a||t instanceof Array||t.push&&x(t))&&"number"!=typeof t[0])for(this._targets=o=l(t),this._propLookup=[],this._siblings=[],i=0;i=$){for(r in $=g.frame+(parseInt(R.autoSleep,10)||120),V){for(t=(e=V[r].tweens).length;-1<--t;)e[t]._gc&&e.splice(t,1);0===e.length&&delete V[r]}if((!(r=Q._first)||r._paused)&&R.autoSleep&&!K._first&&1===g._listeners.tick.length){for(;r&&r._paused;)r=r._next;r||g.sleep()}}},g.addEventListener("tick",M._updateRoot);var et=function(t,e,r){var i,n,o=t._gsTweenID;if(V[o||(t._gsTweenID=o="t"+Y++)]||(V[o]={target:t,tweens:[]}),e&&((i=V[o].tweens)[n=i.length]=e,r))for(;-1<--n;)i[n]===e&&i.splice(n,1);return V[o].tweens},rt=function(t,e,r,i){var n,o,a=t.vars.onOverwrite;return a&&(n=a(t,e,r,i)),(a=R.onOverwrite)&&(o=a(t,e,r,i)),!1!==n&&!1!==o},it=function(t,e,r,i,n){var o,a,s,l;if(1===i||4<=i){for(l=n.length,o=0;oh&&((p||!s._initted)&&h-s._startTime<=2e-8||(c[f++]=s)));for(o=f;-1<--o;)if(l=(s=c[o])._firstPT,2===i&&s._kill(r,t,e)&&(a=!0),2!==i||!s._firstPT&&s._initted&&l){if(2!==i&&!rt(s,e))continue;s._enabled(!1,!1)&&(a=!0)}return a},nt=function(t,e,r){for(var i=t._timeline,n=i._timeScale,o=t._startTime;i._timeline;){if(o+=i._startTime,n*=i._timeScale,i._paused)return-100;i=i._timeline}return e<(o/=n)?o-e:r&&o===e||!t._initted&&o-e<2e-8?y:(o+=t.totalDuration()/t._timeScale/n)>e+y?0:o-e-y};n._init=function(){var t,e,r,i,n,o,a=this.vars,s=this._overwrittenProps,l=this._duration,u=!!a.immediateRender,h=a.ease,c=this._startAt;if(a.startAt){for(i in c&&(c.render(-1,!0),c.kill()),n={},a.startAt)n[i]=a.startAt[i];if(n.data="isStart",n.overwrite=!1,n.immediateRender=!0,n.lazy=u&&!1!==a.lazy,n.startAt=n.delay=null,n.onUpdate=a.onUpdate,n.onUpdateParams=a.onUpdateParams,n.onUpdateScope=a.onUpdateScope||a.callbackScope||this,this._startAt=R.to(this.target||{},0,n),u)if(0s.pr;)i=i._next;(s._prev=i?i._prev:o)?s._prev._next=s:n=s,(s._next=i)?i._prev=s:o=s,s=a}s=e._firstPT=n}for(;s;)s.pg&&"function"==typeof s.t[t]&&s.t[t]()&&(r=!0),s=s._next;return r},ot.activate=function(t){for(var e=t.length;-1<--e;)t[e].API===ot.API&&(G[(new t[e])._propName]=t[e]);return!0},s.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,r=t.propName,i=t.priority||0,n=t.overwriteProps,o={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},a=k("plugins."+r.charAt(0).toUpperCase()+r.substr(1)+"Plugin",function(){ot.call(this,r,i),this._overwriteProps=n||[]},!0===t.global),s=a.prototype=new ot(r);for(e in(s.constructor=a).API=t.API,o)"function"==typeof t[e]&&(s[o[e]]=t[e]);return a.version=t.version,ot.activate([a]),a},e=f._gsQueue){for(r=0;r>0,f._cycle&&f._cycle===f._totalTime/l&&g<=t&&f._cycle--,f._time=f._totalTime-f._cycle*l,f._yoyo&&1&f._cycle&&(f._time=m-f._time),f._time>m?t=(f._time=m)+1e-4:f._time<0?f._time=t=0:t=f._time));if(f._hasPause&&!f._forcingPlayhead&&!e){if(p<(t=f._time)||f._repeat&&x!==f._cycle)for(i=f._first;i&&i._startTime<=t&&!u;)i._duration||"isPause"!==i.data||i.ratio||0===i._startTime&&0===f._rawPrevTime||(u=i),i=i._next;else for(i=f._last;i&&i._startTime>=t&&!u;)i._duration||"isPause"===i.data&&0f._time;)u.render(u._reversed?u.totalDuration()-(t-u._startTime)*u._timeScale:(t-u._startTime)*u._timeScale,e,r),u=u._prev;u=null,f.pause(),f._pauseTime=c}i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(t-i._startTime)*i._timeScale,e,r):i.render((t-i._startTime)*i._timeScale,e,r)}i=o}f._onUpdate&&(e||(E.length&&I(),f._callback("onUpdate"))),a&&(f._locked||f._gc||v!==f._startTime&&_===f._timeScale||(0===f._time||d>=f.totalDuration())&&(n&&(E.length&&I(),f._timeline.autoRemoveChildren&&f._enabled(!1,!1),f._active=!1),!e&&f.vars[a]&&f._callback(a)))}else g!==f._totalTime&&f._onUpdate&&(e||f._callback("onUpdate"))},n.getActive=function(t,e,r){var i,n,o=[],a=this.getChildren(t||null==t,e||null==t,!!r),s=0,l=a.length;for(i=0;it)return r[e].name;return null},n.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),r=e.length;-1<--r;)if(e[r].timet._startTime;l._timeline;)u&&l._timeline.smoothChildTiming?l.totalTime(l._totalTime,!0):l._gc&&l._enabled(!0,!1),l=l._timeline;return h},r.remove=function(t){if(t instanceof c){this._remove(t,!1);var e=t._timeline=t.vars.useFrames?c._rootFramesTimeline:c._rootTimeline;return t._startTime=(t._paused?t._pauseTime:e._time)-(t._reversed?t.totalDuration()-t._totalTime:t._totalTime)/t._timeScale,this}if(t instanceof Array||t&&t.push&&p(t)){for(var r=t.length;-1<--r;)this.remove(t[r]);return this}return"string"==typeof t?this.removeLabel(t):this.kill(null,t)},r._remove=function(t,e){return f.prototype._remove.call(this,t,e),this._last?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},r.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},r.insert=r.insertMultiple=function(t,e,r,i){return this.add(t,e||0,r,i)},r.appendMultiple=function(t,e,r,i){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),r,i)},r.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},r.addPause=function(t,e,r,i){var n=d.delayedCall(0,o,r,i||this);return n.vars.onComplete=n.vars.onReverseComplete=e,n.data="isPause",this._hasPause=!0,this.add(n,t)},r.removeLabel=function(t){return delete this._labels[t],this},r.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},r._parseTimeOrLabel=function(t,e,r,i){var n,o;if(i instanceof c&&i.timeline===this)this.remove(i);else if(i&&(i instanceof Array||i.push&&p(i)))for(o=i.length;-1<--o;)i[o]instanceof c&&i[o].timeline===this&&this.remove(i[o]);if(n="number"!=typeof t||e?99999999999=t&&!l;)i._duration||"isPause"===i.data&&0c._time;)l.render(l._reversed?l.totalDuration()-(t-l._startTime)*l._timeScale:(t-l._startTime)*l._timeScale,e,r),l=l._prev;l=null,c.pause(),c._pauseTime=h}i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(t-i._startTime)*i._timeScale,e,r):i.render((t-i._startTime)*i._timeScale,e,r)}i=o}c._onUpdate&&(e||(v.length&&_(),c._callback("onUpdate"))),a&&(c._gc||d!==c._startTime&&m===c._timeScale||(0===c._time||p>=c.totalDuration())&&(n&&(v.length&&_(),c._timeline.autoRemoveChildren&&c._enabled(!1,!1),c._active=!1),!e&&c.vars[a]&&c._callback(a)))}},r._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof m&&t._hasPausedChild())return!0;t=t._next}return!1},r.getChildren=function(t,e,r,i){i=i||-9999999999;for(var n=[],o=this._first,a=0;o;)o._startTime=r&&(n._startTime+=t),n=n._next;if(e)for(i in o)o[i]>=r&&(o[i]+=t);return this._uncache(!0)},r._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var r=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),i=r.length,n=!1;-1<--i;)r[i]._kill(t,e)&&(n=!0);return n},r.clear=function(t){var e=this.getChildren(!1,!0,!0),r=e.length;for(this._time=this._totalTime=0;-1<--r;)e[r]._enabled(!1,!1);return!1!==t&&(this._labels={}),this._uncache(!0)},r.invalidate=function(){for(var t=this._first;t;)t.invalidate(),t=t._next;return c.prototype.invalidate.call(this)},r._enabled=function(t,e){if(t===this._gc)for(var r=this._first;r;)r._enabled(t,!0),r=r._next;return f.prototype._enabled.call(this,t,e)},r.totalTime=function(t,e,r){this._forcingPlayhead=!0;var i=c.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,i},r.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},r.totalDuration=function(t){if(arguments.length)return t&&this.totalDuration()?this.timeScale(this._totalDuration/t):this;if(this._dirty){for(var e,r,i=0,n=this,o=n._last,a=999999999999;o;)e=o._prev,o._dirty&&o.totalDuration(),o._startTime>a&&n._sortChildren&&!o._paused&&!n._calculatingDuration?(n._calculatingDuration=1,n.add(o,o._startTime-o._delay),n._calculatingDuration=0):a=o._startTime,o._startTime<0&&!o._paused&&(i-=o._startTime,n._timeline.smoothChildTiming&&(n._startTime+=o._startTime/n._timeScale,n._time-=o._startTime,n._totalTime-=o._startTime,n._rawPrevTime-=o._startTime),n.shiftChildren(-o._startTime,!1,-9999999999),a=0),i<(r=o._startTime+o._totalDuration/o._timeScale)&&(i=r),o=e;n._duration=n._totalDuration=i,n._dirty=!1}return this._totalDuration},r.paused=function(t){if(!1===t&&this._paused)for(var e=this._first;e;)e._startTime===this._time&&"isPause"===e.data&&(e._rawPrevTime=0),e=e._next;return c.prototype.paused.apply(this,arguments)},r.usesFrames=function(){for(var t=this._timeline;t._timeline;)t=t._timeline;return t===c._rootFramesTimeline},r.rawTime=function(t){return t&&(this._paused||this._repeat&&0+~]|"+F+")"+F+"*"),q=new RegExp("="+F+"*([^\\]'\"]*?)"+F+"*\\]","g"),W=new RegExp(N),G=new RegExp("^"+j+"$"),V={ID:new RegExp("^#("+j+")"),CLASS:new RegExp("^\\.("+j+")"),TAG:new RegExp("^("+j+"|[*])"),ATTR:new RegExp("^"+L),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/[+~]/,$=new RegExp("\\\\([\\da-f]{1,6}"+F+"?|("+F+")|.)","ig"),tt=function(t,e,r){var i="0x"+e-65536;return i!=i||r?e:i<0?String.fromCharCode(65536+i):String.fromCharCode(i>>10|55296,1023&i|56320)},et=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,rt=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},it=function(){w()},nt=_t(function(t){return!0===t.disabled&&("form"in t||"label"in t)},{dir:"parentNode",next:"legend"});try{M.apply(e=D.call(_.childNodes),_.childNodes),e[_.childNodes.length].nodeType}catch(t){M={apply:e.length?function(t,e){O.apply(t,D.call(e))}:function(t,e){for(var r=t.length,i=0;t[r++]=e[i++];);t.length=r-1}}}function ot(t,e,r,i){var n,o,a,s,l,u,h,c=e&&e.ownerDocument,f=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==f&&9!==f&&11!==f)return r;if(!i&&((e?e.ownerDocument||e:_)!==T&&w(e),e=e||T,k)){if(11!==f&&(l=K.exec(t)))if(n=l[1]){if(9===f){if(!(a=e.getElementById(n)))return r;if(a.id===n)return r.push(a),r}else if(c&&(a=c.getElementById(n))&&v(e,a)&&a.id===n)return r.push(a),r}else{if(l[2])return M.apply(r,e.getElementsByTagName(t)),r;if((n=l[3])&&p.getElementsByClassName&&e.getElementsByClassName)return M.apply(r,e.getElementsByClassName(n)),r}if(p.qsa&&!C[t+" "]&&(!g||!g.test(t))){if(1!==f)c=e,h=t;else if("object"!==e.nodeName.toLowerCase()){for((s=e.getAttribute("id"))?s=s.replace(et,rt):e.setAttribute("id",s=S),o=(u=d(t)).length;o--;)u[o]="#"+s+" "+vt(u[o]);h=u.join(","),c=Q.test(t)&&mt(e.parentNode)||e}if(h)try{return M.apply(r,c.querySelectorAll(h)),r}catch(t){}finally{s===S&&e.removeAttribute("id")}}}return m(t.replace(U,"$1"),e,r,i)}function at(){var i=[];return function t(e,r){return i.push(e+" ")>b.cacheLength&&delete t[i.shift()],t[e+" "]=r}}function st(t){return t[S]=!0,t}function lt(t){var e=T.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ut(t,e){for(var r=t.split("|"),i=r.length;i--;)b.attrHandle[r[i]]=e}function ht(t,e){var r=e&&t,i=r&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(r)for(;r=r.nextSibling;)if(r===e)return-1;return t?1:-1}function ct(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function ft(r){return function(t){var e=t.nodeName.toLowerCase();return("input"===e||"button"===e)&&t.type===r}}function pt(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&nt(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function dt(a){return st(function(o){return o=+o,st(function(t,e){for(var r,i=a([],t.length,o),n=i.length;n--;)t[r=i[n]]&&(t[r]=!(e[r]=t[r]))})})}function mt(t){return t&&void 0!==t.getElementsByTagName&&t}for(t in p=ot.support={},n=ot.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},w=ot.setDocument=function(t){var e,r,i=t?t.ownerDocument||t:_;return i!==T&&9===i.nodeType&&i.documentElement&&(a=(T=i).documentElement,k=!n(T),_!==T&&(r=T.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",it,!1):r.attachEvent&&r.attachEvent("onunload",it)),p.attributes=lt(function(t){return t.className="i",!t.getAttribute("className")}),p.getElementsByTagName=lt(function(t){return t.appendChild(T.createComment("")),!t.getElementsByTagName("*").length}),p.getElementsByClassName=J.test(T.getElementsByClassName),p.getById=lt(function(t){return a.appendChild(t).id=S,!T.getElementsByName||!T.getElementsByName(S).length}),p.getById?(b.filter.ID=function(t){var e=t.replace($,tt);return function(t){return t.getAttribute("id")===e}},b.find.ID=function(t,e){if(void 0!==e.getElementById&&k){var r=e.getElementById(t);return r?[r]:[]}}):(b.filter.ID=function(t){var r=t.replace($,tt);return function(t){var e=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return e&&e.value===r}},b.find.ID=function(t,e){if(void 0!==e.getElementById&&k){var r,i,n,o=e.getElementById(t);if(o){if((r=o.getAttributeNode("id"))&&r.value===t)return[o];for(n=e.getElementsByName(t),i=0;o=n[i++];)if((r=o.getAttributeNode("id"))&&r.value===t)return[o]}return[]}}),b.find.TAG=p.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):p.qsa?e.querySelectorAll(t):void 0}:function(t,e){var r,i=[],n=0,o=e.getElementsByTagName(t);if("*"!==t)return o;for(;r=o[n++];)1===r.nodeType&&i.push(r);return i},b.find.CLASS=p.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&k)return e.getElementsByClassName(t)},s=[],g=[],(p.qsa=J.test(T.querySelectorAll))&&(lt(function(t){a.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+F+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+F+"*(?:value|"+R+")"),t.querySelectorAll("[id~="+S+"-]").length||g.push("~="),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+S+"+*").length||g.push(".#.+[+~]")}),lt(function(t){t.innerHTML="";var e=T.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+F+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),a.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")})),(p.matchesSelector=J.test(h=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&<(function(t){p.disconnectedMatch=h.call(t,"*"),h.call(t,"[s!='']:x"),s.push("!=",N)}),g=g.length&&new RegExp(g.join("|")),s=s.length&&new RegExp(s.join("|")),e=J.test(a.compareDocumentPosition),v=e||J.test(a.contains)?function(t,e){var r=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(r.contains?r.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},A=e?function(t,e){if(t===e)return u=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!p.sortDetached&&e.compareDocumentPosition(t)===r?t===T||t.ownerDocument===_&&v(_,t)?-1:e===T||e.ownerDocument===_&&v(_,e)?1:l?z(l,t)-z(l,e):0:4&r?-1:1)}:function(t,e){if(t===e)return u=!0,0;var r,i=0,n=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!n||!o)return t===T?-1:e===T?1:n?-1:o?1:l?z(l,t)-z(l,e):0;if(n===o)return ht(t,e);for(r=t;r=r.parentNode;)a.unshift(r);for(r=e;r=r.parentNode;)s.unshift(r);for(;a[i]===s[i];)i++;return i?ht(a[i],s[i]):a[i]===_?-1:s[i]===_?1:0}),T},ot.matches=function(t,e){return ot(t,null,null,e)},ot.matchesSelector=function(t,e){if((t.ownerDocument||t)!==T&&w(t),e=e.replace(q,"='$1']"),p.matchesSelector&&k&&!C[e+" "]&&(!s||!s.test(e))&&(!g||!g.test(e)))try{var r=h.call(t,e);if(r||p.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace($,tt),t[3]=(t[3]||t[4]||t[5]||"").replace($,tt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ot.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ot.error(t[0]),t},PSEUDO:function(t){var e,r=!t[6]&&t[2];return V.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":r&&W.test(r)&&(e=d(r,!0))&&(e=r.indexOf(")",r.length-e)-r.length)&&(t[0]=t[0].slice(0,e),t[2]=r.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace($,tt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=f[t+" "];return e||(e=new RegExp("(^|"+F+")"+t+"("+F+"|$)"))&&f(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(r,i,n){return function(t){var e=ot.attr(t,r);return null==e?"!="===i:!i||(e+="","="===i?e===n:"!="===i?e!==n:"^="===i?n&&0===e.indexOf(n):"*="===i?n&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function E(t,r,i){return _(r)?S.grep(t,function(t,e){return!!r.call(t,e,t)!==i}):r.nodeType?S.grep(t,function(t){return t===r!==i}):"string"!=typeof r?S.grep(t,function(t){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(t,e,r){var i,n;if(!t)return this;if(r=r||I,"string"!=typeof t)return t.nodeType?(this[0]=t,this.length=1,this):_(t)?void 0!==r.ready?r.ready(t):t(S):S.makeArray(t,this);if(!(i="<"===t[0]&&">"===t[t.length-1]&&3<=t.length?[null,t,null]:O.exec(t))||!i[1]&&e)return!e||e.jquery?(e||r).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof S?e[0]:e,S.merge(this,S.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:k,!0)),A.test(i[1])&&S.isPlainObject(e))for(i in e)_(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(n=k.getElementById(i[2]))&&(this[0]=n,this.length=1),this}).prototype=S.fn,I=S(k);var M=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};function z(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}S.fn.extend({has:function(t){var e=S(t,this),r=e.length;return this.filter(function(){for(var t=0;t\x20\t\r\n\f]+)/i,ht=/^$|^module$|\/(?:java|ecma)script/i,ct={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ft(t,e){var r;return r=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&C(t,e)?S.merge([t],r):r}function pt(t,e){for(var r=0,i=t.length;rx",v.noCloneChecked=!!dt.cloneNode(!0).lastChild.defaultValue;var _t=k.documentElement,yt=/^key/,bt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,xt=/^([^.]*)(?:\.(.+)|)/;function wt(){return!0}function Tt(){return!1}function kt(){try{return k.activeElement}catch(t){}}function St(t,e,r,i,n,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof r&&(i=i||r,r=void 0),e)St(t,s,r,i,e[s],o);return t}if(null==i&&null==n?(n=r,i=r=void 0):null==n&&("string"==typeof r?(n=i,i=void 0):(n=i,i=r,r=void 0)),!1===n)n=Tt;else if(!n)return t;return 1===o&&(a=n,(n=function(t){return S().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),t.each(function(){S.event.add(this,e,n,i,r)})}S.event={global:{},add:function(e,t,r,i,n){var o,a,s,l,u,h,c,f,p,d,m,g=Z.get(e);if(g)for(r.handler&&(r=(o=r).handler,n=o.selector),n&&S.find.matchesSelector(_t,n),r.guid||(r.guid=S.guid++),(l=g.events)||(l=g.events={}),(a=g.handle)||(a=g.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(R)||[""]).length;u--;)p=m=(s=xt.exec(t[u])||[])[1],d=(s[2]||"").split(".").sort(),p&&(c=S.event.special[p]||{},p=(n?c.delegateType:c.bindType)||p,c=S.event.special[p]||{},h=S.extend({type:p,origType:m,data:i,handler:r,guid:r.guid,selector:n,needsContext:n&&S.expr.match.needsContext.test(n),namespace:d.join(".")},o),(f=l[p])||((f=l[p]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(e,i,d,a)||e.addEventListener&&e.addEventListener(p,a)),c.add&&(c.add.call(e,h),h.handler.guid||(h.handler.guid=r.guid)),n?f.splice(f.delegateCount++,0,h):f.push(h),S.event.global[p]=!0)},remove:function(t,e,r,i,n){var o,a,s,l,u,h,c,f,p,d,m,g=Z.hasData(t)&&Z.get(t);if(g&&(l=g.events)){for(u=(e=(e||"").match(R)||[""]).length;u--;)if(p=m=(s=xt.exec(e[u])||[])[1],d=(s[2]||"").split(".").sort(),p){for(c=S.event.special[p]||{},f=l[p=(i?c.delegateType:c.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=f.length;o--;)h=f[o],!n&&m!==h.origType||r&&r.guid!==h.guid||s&&!s.test(h.namespace)||i&&i!==h.selector&&("**"!==i||!h.selector)||(f.splice(o,1),h.selector&&f.delegateCount--,c.remove&&c.remove.call(t,h));a&&!f.length&&(c.teardown&&!1!==c.teardown.call(t,d,g.handle)||S.removeEvent(t,p,g.handle),delete l[p])}else for(p in l)S.event.remove(t,p+e[u],r,i,!0);S.isEmptyObject(l)&&Z.remove(t,"handle events")}},dispatch:function(t){var e,r,i,n,o,a,s=S.event.fix(t),l=new Array(arguments.length),u=(Z.get(this,"events")||{})[s.type]||[],h=S.event.special[s.type]||{};for(l[0]=s,e=1;e\x20\t\r\n\f]*)[^>]*)\/>/gi,Ct=/\s*$/g;function It(t,e){return C(t,"table")&&C(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function Ot(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Mt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Dt(t,e){var r,i,n,o,a,s,l,u;if(1===e.nodeType){if(Z.hasData(t)&&(o=Z.access(t),a=Z.set(e,o),u=o.events))for(n in delete a.handle,a.events={},u)for(r=0,i=u[n].length;r")},clone:function(t,e,r){var i,n,o,a,s,l,u,h=t.cloneNode(!0),c=S.contains(t.ownerDocument,t);if(!(v.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||S.isXMLDoc(t)))for(a=ft(h),i=0,n=(o=ft(t)).length;i").prop({charset:r.scriptCharset,src:r.url}).on("load error",n=function(t){i.remove(),n=null,t&&e("error"===t.type?404:200,t.type)}),k.head.appendChild(i[0])},abort:function(){n&&n()}}});var Xe,He=[],qe=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=He.pop()||S.expando+"_"+be++;return this[t]=!0,t}}),S.ajaxPrefilter("json jsonp",function(t,e,r){var i,n,o,a=!1!==t.jsonp&&(qe.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&qe.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=_(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(qe,"$1"+i):!1!==t.jsonp&&(t.url+=(xe.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return o||S.error(i+" was not called"),o[0]},t.dataTypes[0]="json",n=T[i],T[i]=function(){o=arguments},r.always(function(){void 0===n?S(T).removeProp(i):T[i]=n,t[i]&&(t.jsonpCallback=e.jsonpCallback,He.push(i)),o&&_(n)&&n(o[0]),o=n=void 0}),"script"}),v.createHTMLDocument=((Xe=k.implementation.createHTMLDocument("").body).innerHTML="
",2===Xe.childNodes.length),S.parseHTML=function(t,e,r){return"string"!=typeof t?[]:("boolean"==typeof e&&(r=e,e=!1),e||(v.createHTMLDocument?((i=(e=k.implementation.createHTMLDocument("")).createElement("base")).href=k.location.href,e.head.appendChild(i)):e=k),o=!r&&[],(n=A.exec(t))?[e.createElement(n[1])]:(n=vt([t],e,o),o&&o.length&&S(o).remove(),S.merge([],n.childNodes)));var i,n,o},S.fn.load=function(t,e,r){var i,n,o,a=this,s=t.indexOf(" ");return-1").append(S.parseHTML(t)).find(i):t)}).always(r&&function(t,e){a.each(function(){r.apply(this,o||[t.responseText,e,t])})}),this},S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){S.fn[e]=function(t){return this.on(e,t)}}),S.expr.pseudos.animated=function(e){return S.grep(S.timers,function(t){return e===t.elem}).length},S.offset={setOffset:function(t,e,r){var i,n,o,a,s,l,u=S.css(t,"position"),h=S(t),c={};"static"===u&&(t.style.position="relative"),s=h.offset(),o=S.css(t,"top"),l=S.css(t,"left"),n=("absolute"===u||"fixed"===u)&&-1<(o+l).indexOf("auto")?(a=(i=h.position()).top,i.left):(a=parseFloat(o)||0,parseFloat(l)||0),_(e)&&(e=e.call(t,r,S.extend({},s))),null!=e.top&&(c.top=e.top-s.top+a),null!=e.left&&(c.left=e.left-s.left+n),"using"in e?e.using.call(t,c):h.css(c)}},S.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){S.offset.setOffset(this,e,t)});var t,r,i=this[0];return i?i.getClientRects().length?(t=i.getBoundingClientRect(),r=i.ownerDocument.defaultView,{top:t.top+r.pageYOffset,left:t.left+r.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,r,i=this[0],n={top:0,left:0};if("fixed"===S.css(i,"position"))e=i.getBoundingClientRect();else{for(e=this.offset(),r=i.ownerDocument,t=i.offsetParent||r.documentElement;t&&(t===r.body||t===r.documentElement)&&"static"===S.css(t,"position");)t=t.parentNode;t&&t!==i&&1===t.nodeType&&((n=S(t).offset()).top+=S.css(t,"borderTopWidth",!0),n.left+=S.css(t,"borderLeftWidth",!0))}return{top:e.top-n.top-S.css(i,"marginTop",!0),left:e.left-n.left-S.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===S.css(t,"position");)t=t.offsetParent;return t||_t})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var o="pageYOffset"===n;S.fn[e]=function(t){return X(this,function(t,e,r){var i;if(y(t)?i=t:9===t.nodeType&&(i=t.defaultView),void 0===r)return i?i[n]:t[e];i?i.scrollTo(o?i.pageXOffset:r,o?r:i.pageYOffset):t[e]=r},e,t,arguments.length)}}),S.each(["top","left"],function(t,r){S.cssHooks[r]=Bt(v.pixelPosition,function(t,e){if(e)return e=Nt(t,r),Ft.test(e)?S(t).position()[r]+"px":e})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(i,o){S.fn[o]=function(t,e){var r=arguments.length&&(i||"boolean"!=typeof t),n=i||(!0===t||!0===e?"margin":"border");return X(this,function(t,e,r){var i;return y(t)?0===o.indexOf("outer")?t["inner"+a]:t.document.documentElement["client"+a]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+a],i["scroll"+a],t.body["offset"+a],i["offset"+a],i["client"+a])):void 0===r?S.css(t,e,n):S.style(t,e,r,n)},s,r?t:void 0,r)}})}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,r){S.fn[r]=function(t,e){return 0>>0,i=(r*=i)>>>0,i+=4294967296*(r-=i)}return 2.3283064365386963e-10*(i>>>0)}}();e.next=function(){var t=2091639*e.s0+2.3283064365386963e-10*e.c;return e.s0=e.s1,e.s1=e.s2,e.s2=t-(e.c=0|t)},e.c=1,e.s0=r(" "),e.s1=r(" "),e.s2=r(" "),e.s0-=r(t),e.s0<0&&(e.s0+=1),e.s1-=r(t),e.s1<0&&(e.s1+=1),e.s2-=r(t),e.s2<0&&(e.s2+=1),r=null}function a(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function i(t,e){var r=new o(t),i=e&&e.state,n=r.next;return n.int32=function(){return 4294967296*r.next()|0},n.double=function(){return n()+11102230246251565e-32*(2097152*n()|0)},n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.alea=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],16:[function(t,e,r){!function(t,e,r){function o(t){var n=this,e="";n.next=function(){var t=n.b,e=n.c,r=n.d,i=n.a;return t=t<<25^t>>>7^e,e=e-r|0,r=r<<24^r>>>8^i,i=i-t|0,n.b=t=t<<20^t>>>12^e,n.c=e=e-r|0,n.d=r<<16^e>>>16^i,n.a=i-t|0},n.a=0,n.b=0,n.c=-1640531527,n.d=1367130551,t===Math.floor(t)?(n.a=t/4294967296|0,n.b=0|t):e+=t;for(var r=0;r>>0)/4294967296};return n.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.tychei=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],17:[function(t,e,r){!function(t,e,r){function o(t){var e=this,r="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:r+=t;for(var i=0;i>>0)/4294967296};return n.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xor128=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],18:[function(t,e,r){!function(t,e,r){function o(t){var o=this;o.next=function(){var t,e,r=o.w,i=o.X,n=o.i;return o.w=r=r+1640531527|0,e=i[n+34&127],t=i[n=n+1&127],e^=e<<13,t^=t<<17,e^=e>>>15,t^=t>>>12,e=i[n]=e^t,o.i=n,e+(r^r>>>16)|0},function(t,e){var r,i,n,o,a,s=[],l=128;for(e===(0|e)?(i=e,e=null):(e+="\0",i=0,l=Math.max(l,e.length)),n=0,o=-32;o>>15,i^=i<<4,i^=i>>>13,0<=o&&(a=a+1640531527|0,n=0==(r=s[127&o]^=i+a)?n+1:0);for(128<=n&&(s[127&(e&&e.length||0)]=-1),n=127,o=512;0>>15,r^=r>>>12,s[n]=i^r;t.w=a,t.X=s,t.i=n}(o,t)}function a(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function i(t,e){null==t&&(t=+new Date);var r=new o(t),i=e&&e.state,n=function(){return(r.next()>>>0)/4294967296};return n.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},n.int32=r.next,n.quick=n,i&&(i.X&&a(i,r),n.state=function(){return a(r,{})}),n}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xor4096=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],19:[function(t,e,r){!function(t,e,r){function o(t){var n=this;n.next=function(){var t,e,r=n.x,i=n.i;return t=r[i],e=(t^=t>>>7)^t<<24,e^=(t=r[i+1&7])^t>>>10,e^=(t=r[i+3&7])^t>>>3,e^=(t=r[i+4&7])^t<<7,t=r[i+7&7],e^=(t^=t<<13)^t<<9,r[i]=e,n.i=i+1&7,e},function(t,e){var r,i=[];if(e===(0|e))i[0]=e;else for(e=""+e,r=0;r>>0)/4294967296};return n.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},n.int32=r.next,n.quick=n,i&&(i.x&&a(i,r),n.state=function(){return a(r,{})}),n}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xorshift7=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],20:[function(t,e,r){!function(t,e,r){function o(t){var e=this,r="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,t===((e.v=0)|t)?e.x=t:r+=t;for(var i=0;i>>4),e.next()}function a(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function i(t,e){var r=new o(t),i=e&&e.state,n=function(){return(r.next()>>>0)/4294967296};return n.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xorwow=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],21:[function(e,r,t){!function(s,l){var u,h=this,c=256,f=6,p="random",d=l.pow(c,f),m=l.pow(2,52),g=2*m,v=c-1;function t(t,e,r){var i=[],n=b(function t(e,r){var i,n=[],o=typeof e;if(r&&"object"==o)for(i in e)try{n.push(t(e[i],r-1))}catch(t){}return n.length?n:"string"==o?e:e+"\0"}((e=1==e?{entropy:!0}:e||{}).entropy?[t,x(s)]:null==t?function(){try{var t;return u&&(t=u.randomBytes)?t=t(c):(t=new Uint8Array(c),(h.crypto||h.msCrypto).getRandomValues(t)),x(t)}catch(t){var e=h.navigator,r=e&&e.plugins;return[+new Date,h,r,h.screen,x(s)]}}():t,3),i),o=new _(i),a=function(){for(var t=o.g(f),e=d,r=0;t>>=1;return(t+r)/e};return a.int32=function(){return 0|o.g(4)},a.quick=function(){return o.g(4)/4294967296},a.double=a,b(x(o.S),s),(e.pass||r||function(t,e,r,i){return i&&(i.S&&y(i,o),t.state=function(){return y(o,{})}),r?(l[p]=t,e):t})(a,n,"global"in e?e.global:this==l,e.state)}function _(t){var e,r=t.length,a=this,i=0,n=a.i=a.j=0,o=a.S=[];for(r||(t=[r++]);iMath.PI?c-r:r}function g(t){return t-c*Math.floor(t/c)}e.exports={UP:o,DOWN:a,LEFT:s,RIGHT:0,NORTH:l,SOUTH:u,WEST:h,EAST:0,PI_2:c,PI_QUARTER:f,PI_HALF:p,toDegrees:function(t){return t*i},toRadians:function(t){return t*n},isAngleBetween:function(t,e,r){if(((r-e)%c+c)%c>=Math.PI){var i=e;e=r,r=i}return e<=r?e<=t&&t<=r:e<=t||t<=r},differenceAnglesSign:d,differenceAngles:m,shortestAngle:function(t,e){return m(e,t)*d(e,t)+t},normalize:g,angleTwoPoints:function(){return 4===arguments.length?Math.atan2(arguments[3]-arguments[1],arguments[2]-arguments[0]):Math.atan2(arguments[1].y-arguments[0].y,arguments[1].x-arguments[0].x)},distanceTwoPoints:function(){return 2===arguments.length?Math.sqrt(Math.pow(arguments[1].x-arguments[0].x,2)+Math.pow(arguments[1].y-arguments[0].y,2)):Math.sqrt(Math.pow(arguments[2]-arguments[0],2)+Math.pow(arguments[3]-arguments[1],2))},distanceTwoPointsSquared:function(){return 2===arguments.length?Math.pow(arguments[1].x-arguments[0].x,2)+Math.pow(arguments[1].y-arguments[0].y,2):Math.pow(arguments[2]-arguments[0],2)+Math.pow(arguments[3]-arguments[1],2)},closestAngle:function(t){var e=m(t,s),r=m(t,0),i=m(t,o),n=m(t,a);return e<=r&&e<=i&&e<=n?s:r<=i&&r<=n?0:i<=n?o:a},equals:function(t,e,r){return r?m(t,e)>16)+t*(r>>16)<<16|i*(e>>8&255)+t*(r>>8&255)<<8|i*(255&e)+t*(255&r)},random:function(t,e){function r(){return s.range(t,e)}var i=s.pick([{r:1,g:1,b:1},{r:1,g:1,b:0},{r:1,g:0,b:1},{r:0,g:1,b:1},{r:1,g:0,b:0},{r:0,g:1,b:0},{r:0,g:0,b:1}]);return t=t||0,e=e||255,this.rgbToHex(i.r?r():0,i.g?r():0,i.b?r():0)},randomHSL:function(t,e,r,i,n,o){var a={h:s.range(t,e),s:s.range(r,i,!0),l:s.range(n,o,!0)};return this.hslToHex(a)},randomGoldenRatioHSL:function(t,e,r){for(var i=s.get(1,!0),n=[],o=0;o=this.time?(this.parent.x=e.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(e.time,e.start,e.delta,this.time),this.parent.dirty=!0}if(this.toY){var r=this.toY;r.time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),r.time>=this.time?(this.parent.y=r.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(r.time,r.start,r.delta,this.time),this.parent.dirty=!0}}}},{key:"calcUnderflowX",value:function(){var t=void 0;switch(this.underflowX){case-1:t=0;break;case 1:t=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:t=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return t}},{key:"calcUnderflowY",value:function(){var t=void 0;switch(this.underflowY){case-1:t=0;break;case 1:t=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:t=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return t}},{key:"bounce",value:function(){if(!this.paused){var t=void 0,e=this.parent.plugins.decelerate;e&&(e.x||e.y)&&(e.x&&e.percentChangeX===e.friction||e.y&&e.percentChangeY===e.friction)&&(((t=this.parent.OOB()).left&&this.left||t.right&&this.right)&&(e.percentChangeX=this.friction),(t.top&&this.top||t.bottom&&this.bottom)&&(e.percentChangeY=this.friction));var r=this.parent.plugins.drag||{},i=this.parent.plugins.pinch||{};if(e=e||{},!(r.active||i.active||this.toX&&this.toY||e.x&&e.y)){var n=(t=t||this.parent.OOB()).cornerPoint;if(!this.toX&&!e.x){var o=null;t.left&&this.left?o=this.parent.screenWorldWidththis.maxWidth&&(this.parent.fitWidth(this.maxWidth),t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})),this.minHeight&&ethis.maxHeight&&(this.parent.fitHeight(this.maxHeight),this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}}}]),i}()},{"./plugin":9}],3:[function(t,e,r){"use strict";var n=function(){function i(t,e){for(var r=0;r(!0===this.right?this.parent.worldWidth:this.right)&&(this.parent.x=-(!0===this.right?this.parent.worldWidth:this.right)*this.parent.scale.x+this.parent.screenWidth,e=!(t.x=0));e&&this.parent.emit("moved",{viewport:this.parent,type:"clamp-x"})}if(null!==this.top||null!==this.bottom){var r=void 0;if(this.parent.screenWorldHeight(!0===this.bottom?this.parent.worldHeight:this.bottom)&&(this.parent.y=-(!0===this.bottom?this.parent.worldHeight:this.bottom)*this.parent.scale.y+this.parent.screenHeight,r=!(t.y=0));r&&this.parent.emit("moved",{viewport:this.parent,type:"clamp-y"})}}}}]),i}()},{"./plugin":9,"./utils":12}],4:[function(t,e,r){"use strict";var n=function(){function i(t,e){for(var r=0;r=t-100){var s=t-a.time;this.x=(this.parent.x-a.x)/s,this.y=(this.parent.y-a.y)/s,this.percentChangeX=this.percentChangeY=this.friction;break}}}catch(t){r=!0,i=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw i}}}}},{key:"activate",value:function(t){void 0!==(t=t||{}).x&&(this.x=t.x,this.percentChangeX=this.friction),void 0!==t.y&&(this.y=t.y,this.percentChangeY=this.friction)}},{key:"update",value:function(t){if(!this.paused){var e=void 0;this.x&&(this.parent.x+=this.x*t,this.x*=this.percentChangeX,Math.abs(this.x)this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,t.x=0);if("x"!==this.clampWheel)if(this.parent.screenWorldHeightthis.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,t.y=0)}},{key:"active",get:function(){return this.moved}}]),i}()},{"./plugin":9,"./utils":12}],6:[function(t,e,r){"use strict";var i=function(){function i(t,e){for(var r=0;rthis.radius))return;var i=Math.atan2(this.target.y-t.y,this.target.x-t.x);e=this.target.x-Math.cos(i)*this.radius,r=this.target.y-Math.sin(i)*this.radius}if(this.speed){var n=e-t.x,o=r-t.y;if(n||o){var a=Math.atan2(r-t.y,e-t.x),s=Math.cos(a)*this.speed,l=Math.sin(a)*this.speed,u=Math.abs(s)>Math.abs(n)?e:t.x+s,h=Math.abs(l)>Math.abs(o)?r:t.y+l;this.parent.moveCenter(u,h),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else this.parent.moveCenter(e,r),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}}]),n}()},{"./plugin":9}],7:[function(t,e,r){"use strict";var n=function(){function i(t,e){for(var r=0;r=this.radiusSquared){var n=Math.atan2(i.y-r,i.x-e);this.linear?(this.horizontal=Math.round(Math.cos(n))*this.speed*this.reverse*.06,this.vertical=Math.round(Math.sin(n))*this.speed*this.reverse*.06):(this.horizontal=Math.cos(n)*this.speed*this.reverse*.06,this.vertical=Math.sin(n)*this.speed*this.reverse*.06)}else this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0}else o.exists(this.left)&&ethis.right?this.horizontal=-1*this.reverse*this.speed*.06:(this.decelerateHorizontal(),this.horizontal=0),o.exists(this.top)&&rthis.bottom?this.vertical=-1*this.reverse*this.speed*.06:(this.decelerateVertical(),this.vertical=0)}}},{key:"decelerateHorizontal",value:function(){var t=this.parent.plugins.decelerate;this.horizontal&&t&&!this.noDecelerate&&t.activate({x:this.horizontal*this.speed*this.reverse/(1e3/60)})}},{key:"decelerateVertical",value:function(){var t=this.parent.plugins.decelerate;this.vertical&&t&&!this.noDecelerate&&t.activate({y:this.vertical*this.speed*this.reverse/(1e3/60)})}},{key:"up",value:function(){this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=null}},{key:"update",value:function(){if(!this.paused&&(this.horizontal||this.vertical)){var t=this.parent.center;this.horizontal&&(t.x+=this.horizontal*this.speed),this.vertical&&(t.y+=this.vertical*this.speed),this.parent.moveCenter(t),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}]),i}()},{"./plugin":9,"./utils":12}],8:[function(t,e,r){"use strict";var n=function(){function i(t,e){for(var r=0;r=this.time)this.parent.scale.set(this.x_scale,this.y_scale),this.removeOnComplete&&this.parent.removePlugin("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null;else{var i=this.snapping;this.parent.scale.x=this.ease(i.time,i.startX,i.deltaX,this.time),this.parent.scale.y=this.ease(i.time,i.startY,i.deltaY,this.time)}var n=this.parent.plugins["clamp-zoom"];n&&n.clamp(),this.noMove||(this.center?this.parent.moveCenter(this.center):this.parent.moveCenter(e))}}else this.parent.scale.x===this.x_scale&&this.parent.scale.y===this.y_scale||this.createSnapping()}}},{key:"resume",value:function(){this.snapping=null,function t(e,r,i){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,r);if(void 0===n){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,r,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"resume",this).call(this)}}]),i}()},{"./plugin":9,"./utils":12}],11:[function(t,e,r){"use strict";var i=function(){function i(t,e){for(var r=0;rthis.time)r=!0,i=this.startX+this.deltaX,n=this.startY+this.deltaY;else{var o=this.ease(e.time,0,1,this.time);i=this.startX+this.deltaX*o,n=this.startY+this.deltaY*o}this.topLeft?this.parent.moveCorner(i,n):this.parent.moveCenter(i,n),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),r&&(this.removeOnComplete&&this.parent.removePlugin("snap"),this.parent.emit("snap-end",this.parent),this.snapping=null)}else{var a=this.topLeft?this.parent.corner:this.parent.center;a.x===this.x&&a.y===this.y||this.snapStart()}}}]),o}()},{"./plugin":9,"./utils":12}],12:[function(t,e,r){"use strict";var i=t("penner");function n(t){return null!=t}e.exports={exists:n,defaults:function(t,e){return null!=t?t:e},ease:function(t,e){return n(t)?"function"==typeof t?t:"string"==typeof t?i[t]:void 0:i[e]}}},{penner:15}],13:[function(t,e,r){"use strict";var i=function(){function i(t,e){for(var r=0;r=this.threshold}},{key:"move",value:function(t){if(!this.pause){var e=!0,r=!1,i=void 0;try{for(var n,o=this.pluginsList[Symbol.iterator]();!(e=(n=o.next()).done);e=!0){n.value.move(t)}}catch(t){r=!0,i=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw i}}if(this.clickedAvailable){var a=t.data.global.x-this.last.x,s=t.data.global.y-this.last.y;(this.checkThreshold(a)||this.checkThreshold(s))&&(this.clickedAvailable=!1)}}}},{key:"up",value:function(t){if(!this.pause){if(t.data.originalEvent instanceof MouseEvent&&0==t.data.originalEvent.button&&(this.leftDown=!1),"mouse"!==t.data.pointerType)for(var e=0;ethis._worldWidth,t.top=this.top<0,t.bottom=this.bottom>this._worldHeight,t.cornerPoint={x:this._worldWidth*this.scale.x-this._screenWidth,y:this._worldHeight*this.scale.y-this._screenHeight},t}},{key:"countDownPointers",value:function(){return(this.leftDown?1:0)+this.touches.length}},{key:"getTouchPointers",value:function(){var t=[],e=this.trackedPointers;for(var r in e){var i=e[r];-1!==this.touches.indexOf(i.pointerId)&&t.push(i)}return t}},{key:"getPointers",value:function(){var t=[],e=this.trackedPointers;for(var r in e)t.push(e[r]);return t}},{key:"_reset",value:function(){this.plugins.bounce&&(this.plugins.bounce.reset(),this.plugins.bounce.bounce()),this.plugins.decelerate&&this.plugins.decelerate.reset(),this.plugins.snap&&this.plugins.snap.reset(),this.plugins.clamp&&this.plugins.clamp.update(),this.plugins["clamp-zoom"]&&this.plugins["clamp-zoom"].clamp(),this.dirty=!0}},{key:"removePlugin",value:function(t){this.plugins[t]&&(this.plugins[t]=null,this.emit(t+"-remove"),this.pluginsSort())}},{key:"pausePlugin",value:function(t){this.plugins[t]&&this.plugins[t].pause()}},{key:"resumePlugin",value:function(t){this.plugins[t]&&this.plugins[t].resume()}},{key:"pluginsSort",value:function(){var t=!0,e=!(this.pluginsList=[]),r=void 0;try{for(var i,n=g[Symbol.iterator]();!(t=(i=n.next()).done);t=!0){var o=i.value;this.plugins[o]&&this.pluginsList.push(this.plugins[o])}}catch(t){e=!0,r=t}finally{try{!t&&n.return&&n.return()}finally{if(e)throw r}}}},{key:"drag",value:function(t){return this.plugins.drag=new o(this,t),this.pluginsSort(),this}},{key:"clamp",value:function(t){return this.plugins.clamp=new s(this,t),this.pluginsSort(),this}},{key:"decelerate",value:function(t){return this.plugins.decelerate=new u(this,t),this.pluginsSort(),this}},{key:"bounce",value:function(t){return this.plugins.bounce=new h(this,t),this.pluginsSort(),this}},{key:"pinch",value:function(t){return this.plugins.pinch=new a(this,t),this.pluginsSort(),this}},{key:"snap",value:function(t,e,r){return this.plugins.snap=new c(this,t,e,r),this.pluginsSort(),this}},{key:"follow",value:function(t,e){return this.plugins.follow=new p(this,t,e),this.pluginsSort(),this}},{key:"wheel",value:function(t){return this.plugins.wheel=new d(this,t),this.pluginsSort(),this}},{key:"clampZoom",value:function(t){return this.plugins["clamp-zoom"]=new l(this,t),this.pluginsSort(),this}},{key:"mouseEdges",value:function(t){return this.plugins["mouse-edges"]=new m(this,t),this.pluginsSort(),this}},{key:"screenWidth",get:function(){return this._screenWidth},set:function(t){this._screenWidth=t}},{key:"screenHeight",get:function(){return this._screenHeight},set:function(t){this._screenHeight=t}},{key:"worldWidth",get:function(){return this._worldWidth?this._worldWidth:this.width},set:function(t){this._worldWidth=t,this.resizePlugins()}},{key:"worldHeight",get:function(){return this._worldHeight?this._worldHeight:this.height},set:function(t){this._worldHeight=t,this.resizePlugins()}},{key:"worldScreenWidth",get:function(){return this._screenWidth/this.scale.x}},{key:"worldScreenHeight",get:function(){return this._screenHeight/this.scale.y}},{key:"screenWorldWidth",get:function(){return this._worldWidth*this.scale.x}},{key:"screenWorldHeight",get:function(){return this._worldHeight*this.scale.y}},{key:"center",get:function(){return{x:this.worldScreenWidth/2-this.x/this.scale.x,y:this.worldScreenHeight/2-this.y/this.scale.y}},set:function(t){this.moveCenter(t)}},{key:"corner",get:function(){return{x:-this.x/this.scale.x,y:-this.y/this.scale.y}},set:function(t){this.moveCorner(t)}},{key:"right",get:function(){return-this.x/this.scale.x+this.worldScreenWidth},set:function(t){this.x=-t*this.scale.x+this.screenWidth,this._reset()}},{key:"left",get:function(){return-this.x/this.scale.x},set:function(t){this.x=-t*this.scale.x,this._reset()}},{key:"top",get:function(){return-this.y/this.scale.y},set:function(t){this.y=-t*this.scale.y,this._reset()}},{key:"bottom",get:function(){return-this.y/this.scale.y+this.worldScreenHeight},set:function(t){this.y=-t*this.scale.y+this.screenHeight,this._reset()}},{key:"dirty",get:function(){return this._dirty},set:function(t){this._dirty=t}},{key:"forceHitArea",get:function(){return this._forceHitArea},set:function(t){t?(this._forceHitArea=t,this.hitArea=t):(this._forceHitArea=!1,this.hitArea=new PIXI.Rectangle(0,0,this.worldWidth,this.worldHeight))}},{key:"pause",get:function(){return this._pause},set:function(t){(this._pause=t)&&(this.touches=[],this.leftDown=!1)}}]),r}();PIXI.extras.Viewport=v,e.exports=v},{"./bounce":1,"./clamp":3,"./clamp-zoom":2,"./decelerate":4,"./drag":5,"./follow":6,"./mouse-edges":7,"./pinch":8,"./snap":11,"./snap-zoom":10,"./utils":12,"./wheel":14}],14:[function(t,e,r){"use strict";var n=function(){function i(t,e){for(var r=0;re&&(r[i]=this.hyphenate(r[i]).join("­"));return r.join("")},e.prototype.hyphenate=function(t){var e,r,i,n,o,a,s,l,u,h=[],c=[],f=t.toLowerCase(),p=Math.max,d=this.trie,m=[""];if(this.exceptions.hasOwnProperty(f))return t.match(this.exceptions[f]).slice(1);if(-1!==t.indexOf("­"))return[t];for(e=(t="_"+t+"_").toLowerCase().split(""),r=t.split(""),s=e.length,i=0;ithis.leftMin&&i@~]/g,"\\$&").replace(/\n/g,"A")}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCommonAncestor=function(t){var e=(1 /g,">").split(/\s+(?=(?:(?:[^"]*"){2})*[^"]*$)/);if(i.length<2)return f("",t,"",e);var n=[i.pop()];for(;1/g,"> ").trim()};var i,n=r(3),h=(i=n)&&i.__esModule?i:{default:i},c=r(0);function f(r,i,n,o){if(r.length&&(r+=" "),n.length&&(n=" "+n),/\[*\]/.test(i)){var t=i.replace(/=.*$/,"]"),a=""+r+t+n;if(g(document.querySelectorAll(a),o))i=t;else for(var s=document.querySelectorAll(""+r+t),e=function(){var e=s[l];if(o.some(function(t){return e.contains(t)})){var t=e.tagName.toLowerCase();return a=""+r+t+n,g(document.querySelectorAll(a),o)&&(i=t),"break"}},l=0,u=s.length;l/.test(i)){var h=i.replace(/>/,"");a=""+r+h+n;g(document.querySelectorAll(a),o)&&(i=h)}if(/:nth-child/.test(i)){var c=i.replace(/nth-child/g,"nth-of-type");a=""+r+c+n;g(document.querySelectorAll(a),o)&&(i=c)}if(/\.\S+\.\S+/.test(i)){for(var f=i.trim().split(".").slice(1).map(function(t){return"."+t}).sort(function(t,e){return t.length-e.length});f.length;){var p=i.replace(f.shift(),"").trim();if(!(a=(""+r+p+n).trim()).length||">"===a.charAt(0)||">"===a.charAt(a.length-1))break;g(document.querySelectorAll(a),o)&&(i=p)}if((f=i&&i.match(/\./g))&&2/.test(s):u=function(e){return function(t){return t(e.parent)&&e.parent}};break;case/^\./.test(s):var r=s.substr(1).split(".");l=function(t){var e=t.attribs.class;return e&&r.every(function(t){return-1)(\S)/g,"$1 $2").trim()),e=i.shift(),n=i.length;return e(this).filter(function(t){for(var e=0;e\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=o.console&&(o.console.warn||o.console.log);return r&&r.call(o.console,n,e),i.apply(this,arguments)}}a="function"!=typeof Object.assign?function(t){if(t===c||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),r=1;re[r]}):i.sort()),i}function A(t,e){for(var r,i,n=e[0].toUpperCase()+e.slice(1),o=0;of(u.y)?u.x:u.y,e.scale=a?function(t,e){return it(e[0],e[1],J)/it(t[0],t[1],J)}(a.pointers,i):1,e.rotation=a?function(t,e){return nt(e[1],e[0],J)+nt(t[1],t[0],J)}(a.pointers,i):0,e.maxPointers=r.prevInput?e.pointers.length>r.prevInput.maxPointers?e.pointers.length:r.prevInput.maxPointers:e.pointers.length,function(t,e){var r,i,n,o,a=t.lastInterval||e,s=e.timeStamp-a.timeStamp;if(e.eventType!=B&&(Lf(h.y)?h.x:h.y,o=rt(l,u),t.lastInterval=e}else r=a.velocity,i=a.velocityX,n=a.velocityY,o=a.direction;e.velocity=r,e.velocityX=i,e.velocityY=n,e.direction=o}(r,e);var h=t.element;T(e.srcEvent.target,h)&&(h=e.srcEvent.target);e.target=h}(t,r),t.emit("hammer.input",r),t.recognize(r),t.session.prevInput=r}function $(t){for(var e=[],r=0;r=f(e)?t<0?X:H:e<0?W:q}function it(t,e,r){r||(r=Z);var i=e[r[0]]-t[r[0]],n=e[r[1]]-t[r[1]];return Math.sqrt(i*i+n*n)}function nt(t,e,r){r||(r=Z);var i=e[r[0]]-t[r[0]],n=e[r[1]]-t[r[1]];return 180*Math.atan2(n,i)/Math.PI}K.prototype={handler:function(){},init:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(O(this.element),this.evWin,this.domHandler)}};var ot={mousedown:j,mousemove:2,mouseup:N},at="mousedown",st="mousemove mouseup";function lt(){this.evEl=at,this.evWin=st,this.pressed=!1,K.apply(this,arguments)}v(lt,K,{handler:function(t){var e=ot[t.type];e&j&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=N),this.pressed&&(e&N&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:F,srcEvent:t}))}});var ut={pointerdown:j,pointermove:2,pointerup:N,pointercancel:B,pointerout:B},ht={2:z,3:"pen",4:F,5:"kinect"},ct="pointerdown",ft="pointermove pointerup pointercancel";function pt(){this.evEl=ct,this.evWin=ft,K.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}o.MSPointerEvent&&!o.PointerEvent&&(ct="MSPointerDown",ft="MSPointerMove MSPointerUp MSPointerCancel"),v(pt,K,{handler:function(t){var e=this.store,r=!1,i=t.type.toLowerCase().replace("ms",""),n=ut[i],o=ht[t.pointerType]||t.pointerType,a=o==z,s=P(e,t.pointerId,"pointerId");n&j&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):n&(N|B)&&(r=!0),s<0||(e[s]=t,this.callback(this.manager,n,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),r&&e.splice(s,1))}});var dt={touchstart:j,touchmove:2,touchend:N,touchcancel:B};function mt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,K.apply(this,arguments)}v(mt,K,{handler:function(t){var e=dt[t.type];if(e===j&&(this.started=!0),this.started){var r=function(t,e){var r=E(t.touches),i=E(t.changedTouches);e&(N|B)&&(r=C(r.concat(i),"identifier",!0));return[r,i]}.call(this,t,e);e&(N|B)&&r[0].length-r[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:r[0],changedPointers:r[1],pointerType:z,srcEvent:t})}}});var gt={touchstart:j,touchmove:2,touchend:N,touchcancel:B},vt="touchstart touchmove touchend touchcancel";function _t(){this.evTarget=vt,this.targetIds={},K.apply(this,arguments)}v(_t,K,{handler:function(t){var e=gt[t.type],r=function(t,e){var r=E(t.touches),i=this.targetIds;if(e&(2|j)&&1===r.length)return i[r[0].identifier]=!0,[r,r];var n,o,a=E(t.changedTouches),s=[],l=this.target;if(o=r.filter(function(t){return T(t.target,l)}),e===j)for(n=0;ne.threshold&&n&e.direction},attrTest:function(t){return Ft.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Rt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),v(jt,Ft,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Pt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),v(Nt,Mt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,i=t.distancee.time;if(this._input=t,!i||!r||t.eventType&(N|B)&&!n)this.reset();else if(t.eventType&j)this.reset(),this._timer=u(function(){this.state=8,this.tryEmit()},e.time,this);else if(t.eventType&N)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&t.eventType&N?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),v(Bt,Ft,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Pt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),v(Ut,Ft,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:G|V,pointers:1},getTouchAction:function(){return Lt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,r=this.options.direction;return r&(G|V)?e=t.overallVelocity:r&G?e=t.overallVelocityX:r&V&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&r&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&f(e)>this.options.velocity&&t.eventType&N},emit:function(t){var e=Rt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),v(Xt,Mt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[St]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,i=t.distance80*r){i=o=t[0],n=a=t[1];for(var d=r;do.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,h=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,c=C(s,l,e,r,i),f=C(u,h,e,r,i),p=t.prevZ,d=t.nextZ;p&&p.z>=c&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&I(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=O(p.prev,p,p.next))return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&I(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=O(d.prev,d,d.next))return!1;d=d.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&I(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=O(p.prev,p,p.next))return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&I(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=O(d.prev,d,d.next))return!1;d=d.nextZ}return!0}function k(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!M(n,o)&&R(n,i,i.next,o)&&L(n,o)&&L(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),B(i),B(i.next),i=t=o),i=i.next}while(i!==t);return y(i)}function S(t,e,r,i,n,o){var a,s,l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&(s=u,(a=l).next.i!==s.i&&a.prev.i!==s.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&R(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(a,s)&&(L(a,s)&&L(s,a)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;for(;r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next,r!==t;);return i}(a,s)&&(O(a.prev,a,s.prev)||O(a,s.prev,s))||M(a,s)&&0=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&a=i.x&&i.x>=h&&n!==i.x&&I(or.x||i.x===r.x&&(d=i,O((p=r).prev,p,d.prev)<0&&O(d.next,p,p.next)<0)))&&(r=i,f=l)),i=i.next,i!==u;);var p,d;return r}(t,e)){var r=j(e,t);y(r,r.next)}}function C(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function A(t){for(var e=t,r=t;(e.x=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function F(t){return 0= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=_-y,k=Math.floor,S=String.fromCharCode;function P(t){throw RangeError(c[t])}function p(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function d(t,e){var r=t.split("@"),i="";return 1>>10&1023|55296),t=56320|1023&t),e+=S(t)}).join("")}function A(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function I(t,e,r){var i=0;for(t=r?k(t/s):t>>1,t+=k(t/e);f*b>>1k((v-d)/a))&&P("overflow"),d+=l*a,!(l<(u=s<=g?y:g+b<=s?b:s-g));s+=_)a>k(v/(h=_-u))&&P("overflow"),a*=h;g=I(d-o,e=f.length+1,0==o),k(d/e)>v-m&&P("overflow"),m+=k(d/e),d%=e,f.splice(d++,0,m)}return C(f)}function g(t){var e,r,i,n,o,a,s,l,u,h,c,f,p,d,m,g=[];for(f=(t=E(t)).length,e=w,o=x,a=r=0;ak((v-r)/(p=i+1))&&P("overflow"),r+=(s-e)*p,e=s,a=0;av&&P("overflow"),c==e){for(l=r,u=_;!(l<(h=u<=o?y:o+b<=u?b:u-o));u+=_)m=l-h,d=_-h,g.push(S(A(h+m%d,0))),l=k(m/d);g.push(S(A(l,0))),o=I(r,p,i==n),r=0,++i}++r,++e}return g.join("")}if(n={version:"1.3.2",ucs2:{decode:E,encode:C},decode:m,encode:g,toASCII:function(t){return d(t,function(t){return u.test(t)?"xn--"+g(t):t})},toUnicode:function(t){return d(t,function(t){return l.test(t)?m(t.slice(4).toLowerCase()):t})}},e&&r)if(O.exports==e)r.exports=n;else for(o in n)n.hasOwnProperty(o)&&(e[o]=n[o]);else t.punycode=n}(D)}),W={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};W.isString,W.isObject,W.isNull,W.isNullOrUndefined;var q=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var s,l,u=t.length;0",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(ot),st=["%","/","?",";","#"].concat(at),lt=["/","?","#"],ut=/^[+a-z0-9A-Z_-]{0,63}$/,ht=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ct={javascript:!0,"javascript:":!0},ft={javascript:!0,"javascript:":!0},pt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function dt(t,e,r){if(t&&W.isObject(t)&&t instanceof et)return t;var i=new et;return i.parse(t,e,r),i}et.prototype.parse=function(t,e,r){if(!W.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Ft(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Lt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}var jt=function(){for(var t=[],e=[],r=0;r<32;r++)e[t[r]=r]=r;t[G.BLEND_MODES.NORMAL_NPM]=G.BLEND_MODES.NORMAL,t[G.BLEND_MODES.ADD_NPM]=G.BLEND_MODES.ADD,t[G.BLEND_MODES.SCREEN_NPM]=G.BLEND_MODES.SCREEN,e[G.BLEND_MODES.NORMAL]=G.BLEND_MODES.NORMAL_NPM,e[G.BLEND_MODES.ADD]=G.BLEND_MODES.ADD_NPM,e[G.BLEND_MODES.SCREEN]=G.BLEND_MODES.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function Nt(t,e){return jt[e?1:0][t]}function Bt(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function Ut(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function Xt(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ht(t,e){void 0===e&&(e=null);var r=6*t;if((e=e||new Uint16Array(r)).length!==r)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+r);for(var i=0,n=0;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Zt(t){return!(t&t-1||!t)}function Jt(t){var e=(65535>>=e))<<3;return e|=r,e|=r=(15<(t>>>=r))<<2,(e|=r=(3<(t>>>=r))<<1)|(t>>>=r)>>1}var Kt={},Qt=Object.create(null),$t=Object.create(null);function te(t){var e,r,i,n=t.width,o=t.height,a=t.getContext("2d"),s=a.getImageData(0,0,n,o).data,l=s.length,u={top:null,left:null,right:null,bottom:null},h=null;for(e=0;e=this.x&&t=this.y&&e=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},t}();T.SORTABLE_CHILDREN=!1;var Oe=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Oe.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Oe.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Oe.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Pe.EMPTY:((t=t||new Pe(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Oe.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Oe.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],a=t[1];e=oi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},Oe.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXe.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXr?this.maxX:r,this.minY=this.minYi?this.maxY:i};var Me=function(t){function n(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Se,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Oe,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}t&&(n.__proto__=t);var e={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return((n.prototype=Object.create(t&&t.prototype)).constructor=n).mixin=function(t){for(var e=Object.keys(t),r=0;rthis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),(t.parent=this).sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},t.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Wt(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},t.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},t.prototype.removeChild=function(t){var e=arguments,r=arguments.length;if(1 title : "+t.title+"
tabIndex: "+t.tabIndex},Fe.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0),t.x+t.width>this.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},Fe.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",-1e.priority){t.connect(r);break}e=(r=e).next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},e.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},e.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var r=t-this._lastFrame|0;if(r]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var rr=function(h){function r(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){var r=document.createElement("video");r.setAttribute("preload","auto"),r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),"string"==typeof t&&(t=[t]),h.crossOrigin(r,t[0].src||t[0],e.crossorigin);for(var i=0;ithis.baseTexture.width,a=r+n>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",l="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+l+" "+s+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},t.rotate.get=function(){return this._rotate},t.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},t.width.get=function(){return this.orig.width},t.height.get=function(){return this.orig.height},Object.defineProperties(s.prototype,t),s}(d);function pr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}fr.EMPTY=new fr(new Ke),pr(fr.EMPTY),pr(fr.EMPTY.baseTexture),fr.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new fr(new Ke(new $e(t)))}(),pr(fr.WHITE),pr(fr.WHITE.baseTexture);var dr=function(s){function e(t,e){var r=null;if(!(t instanceof ur)){var i=arguments[1],n=arguments[2],o=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+i+", "+n+") instead of the ctor directly."),r=arguments[0],e=null,t=new ur({width:i,height:n,scaleMode:o,resolution:a})}s.call(this,t,e),this.legacyRenderer=r,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return s&&(e.__proto__=s),((e.prototype=Object.create(s&&s.prototype)).constructor=e).prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=0=G.ENV.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},t.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion?Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,{anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),colorBufferFloat:t.getExtension("EXT_color_buffer_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear")})},t.prototype.handleContextLost=function(t){t.preventDefault()},t.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},t.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},t.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},t.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(t.prototype,r),t}(or),zr=function(e){function t(t){e.call(this,t),this.managedFramebuffers=[],this.unknownFramebuffer=new sr(10,10)}e&&(t.__proto__=e);var r={size:{configurable:!0}};return((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Pe,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;T.PREFER_ENV===G.ENV.WEBGL_LEGACY&&(r=e=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},t.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var a=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,a)}}}},t.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},t.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},t.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],a=o[n];if(a)return o[e.id]=a;var s=t.buffers,l=t.attributes,u={},h={};for(var c in s)u[c]=0,h[c]=0;for(var f in l)!l[f].size&&e.attributeData[f]?l[f].size=e.attributeData[f].size:l[f].size||console.warn("PIXI Geometry attribute '"+f+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[l[f].buffer]+=l[f].size*Lr[l[f].type];for(var p in l){var d=l[p],m=d.size;void 0===d.stride&&(u[d.buffer]===m*Lr[d.type]?d.stride=0:d.stride=u[d.buffer]),void 0===d.start&&(d.start=h[d.buffer],h[d.buffer]+=m*Lr[d.type])}a=r.createVertexArray(),r.bindVertexArray(a);for(var g=0;g=G.ENV.WEBGL2&&(t=e.getContext("webgl2",{})),t||((t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?t.getExtension("WEBGL_draw_buffers"):t=null),Gr=t}return Gr}function Yr(t,e,r){if("precision"===t.substring(0,9))return r!==G.PRECISION.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t;var i=e;return e===G.PRECISION.HIGH&&r!==G.PRECISION.HIGH&&(i=G.PRECISION.MEDIUM),"precision "+i+" float;\n"+t}var Zr={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};var Jr=null,Kr={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function Qr(t,e){if(!Jr){var r=Object.keys(Kr);Jr={};for(var i=0;ie.name?1:-1});for(var h=0;h>=1,r++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run())))},t.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),r=!(e[i]=null))}if(r){for(var o=0,a=0;athis.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},g.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,e=this.MAX_TEXTURES,r=g._textureArrayPool,i=this.renderer.batch,n=this._tempBoundTextures,o=this.renderer.textureGC.count,a=++Ke._globalBatch,s=0,l=r[0],u=0;i.copyBoundTextures(n,e);for(var h=0;h=e&&(i.boundArray(l,n,a,e),this.buildDrawCalls(l,u,h),u=h,l=r[++s],++a),c._batchEnabled=a,c.touched=o,l.elements[l.count++]=c)}0this.maxSegments&&(r=this.maxSegments),r}},pn=function(){this.reset()};pn.prototype.clone=function(){var t=new pn;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},pn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=fr.WHITE,this.matrix=null,this.visible=!1},pn.prototype.destroy=function(){this.texture=null,this.matrix=null};var dn={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var r=t.points,i=t.holes,n=e.points,o=e.indices;if(6<=r.length){for(var a=[],s=0;s>16)+(65280&e)+((255&e)<<16),r);0>16&255)/255*n,o.tint[1]=(i>>8&255)/255*n,o.tint[2]=(255&i)/255*n,o.tint[3]=n,t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(var s=0,l=a.length;s>16)+(65280&n)+((255&n)<<16)}}},r.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,a=t.ty,s=this.geometry.points,l=this.vertexData,u=0,h=0;h=i&&jn.x=n&&jn.y>16)+(65280&t)+((255&t)<<16)},t.texture.get=function(){return this._texture},t.texture.set=function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||fr.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(i.prototype,t),i}(Re),Un={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},Xn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Un.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Hn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wn=function(t){this.styleID=0,this.reset(),Yn(this,t,t)},qn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function Gn(t){return"number"==typeof t?Ft(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Vn(t){if(Array.isArray(t)){for(var e=0;e>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var a=0;a=a.length&&a.push(this._generateOneMoreBuffer(t));var d=a[f];d.uploadDynamic(e,c,p);var m=t._bufferUpdateIDs[f]||0;(h=h||d._updateID=i&&Jo.x=n&&Jo.ys&&(Wt(i,1+f-++d,1+g-f),g=f,f=-1,n.push(p),h=Math.max(h,p),c++,r.x=0,r.y+=t.lineHeight,l=null))}else n.push(u),h=Math.max(h,u),++c,++d,r.x=0,r.y+=t.lineHeight,l=null}var b=o.charAt(o.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(u=p),n.push(u),h=Math.max(h,u));for(var x=[],w=0;w<=c;w++){var T=0;"right"===this._font.align?T=h-n[w]:"center"===this._font.align&&(T=(h-n[w])/2),x.push(T)}for(var k=i.length,S=this.tint,P=0;P 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",t),this.alpha=1}e&&(t.__proto__=e);var r={matrix:{configurable:!0},alpha:{configurable:!0}};return((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},t.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},t.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},t.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},t.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},t.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},t.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=(0,Math.sqrt)(1/3),o=[r+1/3*(1-r),1/3*(1-r)-n*i,1/3*(1-r)+n*i,0,0,1/3*(1-r)+n*i,r+1/3*(1-r),1/3*(1-r)-n*i,0,0,1/3*(1-r)-n*i,1/3*(1-r)+n*i,r+1/3*(1-r),0,0,0,0,0,1,0];this._loadMatrix(o,e)},t.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},t.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},t.prototype.desaturate=function(){this.saturate(-1)},t.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},t.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},t.prototype.technicolor=function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},t.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},t.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},t.prototype.kodachrome=function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},t.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},t.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},t.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,a=(r>>8&255)/255,s=(255&r)/255,l=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,h=(255&i)/255,c=[.3,.59,.11,0,0,o,a,s,t=t||.2,0,l,u,h,e=e||.15,0,o-l,a-u,s-h,0,0];this._loadMatrix(c,n)},t.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},t.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},t.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},t.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(t.prototype,r),t}(pi);ua.prototype.grayscale=ua.prototype.greyscale;var ha=function(i){function t(t,e){var r=new ge;t.renderable=!1,i.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:t._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=t,this.maskMatrix=r,null==e&&(e=20),this.scale=new ce(e,e)}i&&(t.__proto__=i);var e={map:{configurable:!0}};return((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),a=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==a&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/a,this.uniforms.rotation[3]=n.d/a),t.applyFilter(this,e,r,i)},e.map.get=function(){return this.uniforms.mapSampler},e.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(t.prototype,e),t}(pi),ca=function(t){function e(){t.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\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 --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(pi),fa=function(r){function t(t,e){void 0===t&&(t=.5),void 0===e&&(e=Math.random()),r.call(this,ji,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0}),this.noise=t,this.seed=e}r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t;var e={noise:{configurable:!0},seed:{configurable:!0}};return e.noise.get=function(){return this.uniforms.uNoise},e.noise.set=function(t){this.uniforms.uNoise=t},e.seed.get=function(){return this.uniforms.uSeed},e.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(t.prototype,e),t}(pi),pa=new ge;Me.prototype._cacheAsBitmap=!1,Me.prototype._cacheData=!1;var da=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Me.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&((this._cacheAsBitmap=t)?(this._cacheData||(this._cacheData=new da),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Me.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Me.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(T.RESOLUTION);var n=t.renderTexture.current,o=t.renderTexture.sourceFrame,a=t.projection.transform,s=dr.create(r.width,r.height),l="cacheAsBitmap_"+Gt();this._cacheData.textureCacheId=l,Ke.addToCache(s.baseTexture,l),fr.addToCache(s,l);var u=pa;u.tx=-r.x,u.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,s,!0,u,!0),t.projection.transform=a,t.renderTexture.bind(n,o),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Bn(s);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Me.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Me.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(T.RESOLUTION);var n=dr.create(e.width,e.height),o="cacheAsBitmap_"+Gt();this._cacheData.textureCacheId=o,Ke.addToCache(n.baseTexture,o),fr.addToCache(n,o);var a=pa;this.transform.localTransform.copyTo(a),a.invert(),a.tx-=e.x,a.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,a,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var s=new Bn(n);s.transform.worldTransform=this.transform.worldTransform,s.anchor.x=-e.x/e.width,s.anchor.y=-e.y/e.height,s.alpha=r,s._bounds=this._bounds,this._cacheData.sprite=s,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=s.containsPoint.bind(s)}},Me.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Me.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Me.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,Ke.removeFromCache(this._cacheData.textureCacheId),fr.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Me.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Me.prototype.name=null,Re.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},e.tint.get=function(){return this._tint},t.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Xt(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(t.prototype,e),t}(ui),xa=function(a){function t(t,e,r){a.call(this);var i=new _r(t),n=new _r(e,!0),o=new _r(r,!0,!0);this.addAttribute("aVertexPosition",i,2,!1,G.TYPES.FLOAT).addAttribute("aTextureCoord",n,2,!1,G.TYPES.FLOAT).addIndex(o),this._updateId=-1}a&&(t.__proto__=a),(t.prototype=Object.create(a&&a.prototype)).constructor=t;var e={vertexDirtyId:{configurable:!0}};return e.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(t.prototype,e),t}(kr),wa=function(n){function t(t,e,r,i){void 0===t&&(t=100),void 0===e&&(e=100),void 0===r&&(r=10),void 0===i&&(i=10),n.call(this),this.segWidth=r,this.segHeight=i,this.width=t,this.height=e,this.build()}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,a=this.width/n,s=this.height/o,l=0;le?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},t.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},e.width.get=function(){return this._width},e.width.set=function(t){this._width=t,this._refresh()},e.height.get=function(){return this._height},e.height.set=function(t){this._height=t,this._refresh()},e.leftWidth.get=function(){return this._leftWidth},e.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},e.rightWidth.get=function(){return this._rightWidth},e.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},e.topHeight.get=function(){return this._topHeight},e.topHeight.set=function(t){this._topHeight=t,this._refresh()},e.bottomHeight.get=function(){return this._bottomHeight},e.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},t.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(t.prototype,e),t}(Sa),Ca=function(r){function i(t,e){r.call(this,t[0]instanceof fr?t[0]:t[0].texture),this._textures=null,this._durations=null,this.textures=t,this._autoUpdate=!1!==e,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}r&&(i.__proto__=r);var t={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return((i.prototype=Object.create(r&&r.prototype)).constructor=i).prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&Ue.shared.remove(this.update,this))},i.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&Ue.shared.add(this.update,this,G.UPDATE_PRIORITY.HIGH))},i.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},i.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},i.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(0r&&this.onLoop()),this.updateTexture())},i.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},i.prototype.destroy=function(t){this.stop(),r.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},i.fromFrames=function(t){for(var e=[],r=0;r 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},"undefined"!=typeof arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(t){console.log(t)}),e.printErr||(e.printErr=function(t){console.log(t)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(t){document.title=t})}function ha(t){eval.call(null,t)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(t){ka=t},fb:function(){return ka},ua:function(){return m},ba:function(t){m=t},Ka:function(t){switch(t){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===t[t.length-1]?n.J:"i"===t[0]?(assert(0==(t=parseInt(t.substr(1)))%8),t/8):0}},eb:function(t){return Math.max(n.Ka(t),n.J)},ud:16,Qd:function(t,e){return"double"===e||"i64"===e?7&t&&(assert(4==(7&t)),t+=4):assert(0==(3&t)),t},Ed:function(t,e,r){return r||"i64"!=t&&"double"!=t?t?Math.min(e||(t?n.eb(t):0),n.J):Math.min(e,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(t){for(var e=0;e>>0)+4294967296*+(e>>>0):+(t>>>0)+4294967296*+(0|e)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(t,e){t||x("Assertion failed: "+e)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(t){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(t,e,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[t>>0]=e;break;case"i16":z[t>>1]=e;break;case"i32":C[t>>2]=e;break;case"i64":pa=[e>>>0,(oa=e,1<=+xa(oa)?0>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[t>>2]=pa[0],C[t+4>>2]=pa[1];break;case"float":Ba[t>>2]=e;break;case"double":Ca[t>>3]=e;break;default:x("invalid type for setValue: "+r)}}function Da(t,e){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return y[t>>0];case"i16":return z[t>>1];case"i32":case"i64":return C[t>>2];case"float":return Ba[t>>2];case"double":return Ca[t>>3];default:x("invalid type for setValue: "+e)}return null}function D(t,e,r,i){var o,a;a="number"==typeof t?(o=!0,t):(o=!1,t.length);var s,l,u="string"==typeof e?e:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,u?1:e.length)),o){for(assert(0==(3&(i=r))),t=r+(-4&a);i>2]=0;for(t=r+a;i>0]=0;return r}if("i8"===u)return t.subarray||t.slice?E.set(t,r):E.set(new Uint8Array(t),r),r;for(i=0;i>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(t,e,r,i){if(!(0>6}else{if(a<=65535){if(i<=r+2)break;e[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;e[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;e[r++]=248|a>>24}else{if(i<=r+5)break;e[r++]=252|a>>30,e[r++]=128|a>>24&63}e[r++]=128|a>>18&63}e[r++]=128|a>>12&63}e[r++]=128|a>>6&63}e[r++]=128|63&a}}return e[r]=0,r-n}function La(t){for(var e=0,r=0;r"):o=n;t:for(;c>0];if(!r)return e;e+=String.fromCharCode(r)}},e.stringToAscii=function(t,e){return Ia(t,e,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(t){return Ja(E,t)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(t,e,r){return Ka(t,E,e,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(t){for(var e=0,r="";;){var i=z[t+2*e>>1];if(0==i)return r;++e,r+=String.fromCharCode(i)}},e.stringToUTF16=function(t,e,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=e;r=(r-=2)<2*t.length?r/2:t.length;for(var n=0;n>1]=t.charCodeAt(n),e+=2;return z[e>>1]=0,e-i},e.lengthBytesUTF16=function(t){return 2*t.length},e.UTF32ToString=function(t){for(var e=0,r="";;){var i=C[t+4*e>>2];if(0==i)return r;++e,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(t,e,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=e;r=i+r-4;for(var n=0;n>2]=o,r<(e+=4)+4)break}return C[e>>2]=0,e-i},e.lengthBytesUTF32=function(t){for(var e=0,r=0;r>0]=t[r],r+=1}function ta(t,e){for(var r=0;r>0]=t[r]}function Ia(t,e,r){for(var i=0;i>0]=t.charCodeAt(i);r||(y[e>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(t){cb.unshift(t)},e.addOnPreMain=function(t){db.unshift(t)},e.addOnExit=function(t){H.unshift(t)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(t){for(var e=[],r=0;r>>16)*i+r*(e>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(t){t>>>=0;for(var e=0;e<32;e++)if(t&1<<31-e)return e;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(t,e){H.push(function(){n.L("vi",t,[e])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(t,e){wb.p||(wb.p={}),t in wb.p||(n.L("v",e),wb.p[t]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(t,e){for(var r=0,i=t.length-1;0<=i;i--){var n=t[i];"."===n?t.splice(i,1):".."===n?(t.splice(i,1),r++):r&&(t.splice(i,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function zb(t){var e="/"===t.charAt(0),r="/"===t.substr(-1);return(t=yb(t.split("/").filter(function(t){return!!t}),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t}function Ab(t){var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=e[0],e=e[1],t||e?(e&&(e=e.substr(0,e.length-1)),t+e):"."}function Bb(t){if("/"===t)return"/";var e=t.lastIndexOf("/");return-1===e?t:t.substr(e+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(t,e){return zb(t+"/"+e)}function Db(){for(var t="",e=!1,r=arguments.length-1;-1<=r&&!e;r--){if("string"!=typeof(e=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!e)return"";t=e+"/"+t,e="/"===e.charAt(0)}return(e?"/":"")+(t=yb(t.split("/").filter(function(t){return!!t}),!e).join("/"))||"."}var Eb=[];function Fb(t,e){Eb[t]={input:[],output:[],N:e},Gb(t,Hb)}var Hb={open:function(t){var e=Eb[t.g.rdev];if(!e)throw new L(J.ha);t.tty=e,t.seekable=!1},close:function(t){t.tty.N.flush(t.tty)},flush:function(t){t.tty.N.flush(t.tty)},read:function(t,e,r,i){if(!t.tty||!t.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;ot.e.length&&(t.e=M.cb(t),t.o=t.e.length),!t.e||t.e.subarray){var r=t.e?t.e.buffer.byteLength:0;e<=r||(e=Math.max(e,r*(r<1048576?2:1.125)|0),0!=r&&(e=Math.max(e,256)),r=t.e,t.e=new Uint8Array(e),0e)t.e.length=e;else for(;t.e.length=t.g.o)return 0;if(assert(0<=(t=Math.min(t.g.o-n,i))),8>1)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}return e.mode},B:function(t){for(var e=[];t.parent!==t;)e.push(t.name),t=t.parent;return e.push(t.A.pa.root),e.reverse(),Cb.apply(null,e)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(t){if((t&=-32769)in P.Ha)return P.Ha[t];throw new L(J.q)},k:{D:function(t){var e;t=P.B(t);try{e=fs.lstatSync(t)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}return P.$&&!e.K&&(e.K=4096),P.$&&!e.blocks&&(e.blocks=(e.size+e.K-1)/e.K|0),{dev:e.dev,ino:e.ino,mode:e.mode,nlink:e.nlink,uid:e.uid,gid:e.gid,rdev:e.rdev,size:e.size,atime:e.atime,mtime:e.mtime,ctime:e.ctime,K:e.K,blocks:e.blocks}},u:function(t,e){var r=P.B(t);try{void 0!==e.mode&&(fs.chmodSync(r,e.mode),t.mode=e.mode),void 0!==e.size&&fs.truncateSync(r,e.size)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},lookup:function(t,e){var r=K(P.B(t),e);r=P.Ja(r);return P.createNode(t,e,r)},T:function(t,e,r,i){t=P.createNode(t,e,r,i),e=P.B(t);try{N(t.mode)?fs.mkdirSync(e,t.mode):fs.writeFileSync(e,"",{mode:t.mode})}catch(t){if(!t.code)throw t;throw new L(J[t.code])}return t},rename:function(t,e,r){t=P.B(t),e=K(P.B(e),r);try{fs.renameSync(t,e)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},unlink:function(t,e){var r=K(P.B(t),e);try{fs.unlinkSync(r)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},rmdir:function(t,e){var r=K(P.B(t),e);try{fs.rmdirSync(r)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},readdir:function(t){t=P.B(t);try{return fs.readdirSync(t)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},symlink:function(t,e,r){t=K(P.B(t),e);try{fs.symlinkSync(r,t)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},readlink:function(t){var e=P.B(t);try{return e=fs.readlinkSync(e),e=Ob.relative(Ob.resolve(t.A.pa.root),e)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}}},n:{open:function(t){var e=P.B(t.g);try{32768==(61440&t.g.mode)&&(t.V=fs.openSync(e,P.$a(t.flags)))}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},close:function(t){try{32768==(61440&t.g.mode)&&t.V&&fs.closeSync(t.V)}catch(t){if(!t.code)throw t;throw new L(J[t.code])}},read:function(t,e,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(t.V,a,0,i,n)}catch(t){throw new L(J[t.code])}if(0>>0)%Q.length}function Xb(t){var e=Wb(t.parent.id,t.name);t.M=Q[e],Q[e]=t}function Nb(t,e){var r;if(r=(r=Yb(t,"x"))?r:t.k.lookup?0:J.da)throw new L(r,t);for(r=Q[Wb(t.id,e)];r;r=r.M){var i=r.name;if(r.parent.id===t.id&&i===e)return r}return t.k.lookup(t,e)}function Lb(t,e,r,i){return Zb||((Zb=function(t,e,r,i){t||(t=this),this.parent=t,this.A=t.A,this.U=null,this.id=Sb++,this.name=e,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(t){t?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(t){t?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(t=new Zb(t,e,r,i)),t}function N(t){return 16384==(61440&t)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(t,e){return Tb?0:(-1===e.indexOf("r")||292&t.mode)&&(-1===e.indexOf("w")||146&t.mode)&&(-1===e.indexOf("x")||73&t.mode)?0:J.da}function ac(t,e){try{return Nb(t,e),J.wa}catch(t){}return Yb(t,"wx")}function bc(){for(var t=0;t<=4096;t++)if(!Rb[t])return t;throw new L(J.Sa)}function cc(t){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(t){this.g=t}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var e,r=new dc;for(e in t)r[e]=t[e];return t=r,r=bc(),t.fd=r,Rb[r]=t}var Kb={open:function(t){t.n=Qb[t.g.rdev].n,t.n.open&&t.n.open(t)},G:function(){throw new L(J.ia)}},qc;function Gb(t,e){Qb[t]={n:e}}function ec(t,e){var r,i="/"===e,n=!e;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(e=(r=S(e,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:t,pa:{},Oa:e,lb:[]};var o=t.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(t,e,r){var i=S(t,{parent:!0}).g;if(!(t=Bb(t))||"."===t||".."===t)throw new L(J.q);var n=ac(i,t);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,t,e,r)}function gc(t,e){return e=4095&(void 0!==e?e:438),fc(t,e|=32768,0)}function V(t,e){return e=1023&(void 0!==e?e:511),fc(t,e|=16384,0)}function hc(t,e,r){return void 0===r&&(r=e,e=438),fc(t,8192|e,r)}function ic(t,e){if(!Db(t))throw new L(J.F);var r=S(e,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(e),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,t)}function Vb(t){if(!(t=S(t).g))throw new L(J.F);if(!t.k.readlink)throw new L(J.q);return Db(T(t.parent),t.k.readlink(t))}function jc(t,e){var r;if(!(r="string"==typeof t?S(t,{la:!0}).g:t).k.u)throw new L(J.I);r.k.u(r,{mode:4095&e|-4096&r.mode,timestamp:Date.now()})}function kc(r,t){var i,n,o;if(""===r)throw new L(J.F);if("string"==typeof t){if(void 0===(n=$b[t]))throw Error("Unknown file open mode: "+t)}else n=t;if(i=64&(t=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof r)o=r;else{r=zb(r);try{o=S(r,{la:!(131072&t)}).g}catch(t){}}if(n=!1,64&t)if(o){if(128&t)throw new L(J.wa)}else o=fc(r,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(t&=-513),65536&t&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&t)||512&t)?J.P:(i=["r","w","rw"][3&t],512&t&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&t){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}t&=-641,(o=cc({g:o,path:T(o),flags:t,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&t||(lc||(lc={}),r in lc||(lc[r]=1,e.printErr("read file: "+r)));try{R.onOpenFile&&(a=0,1!=(2097155&t)&&(a|=1),0!=(2097155&t)&&(a|=2),R.onOpenFile(r,a))}catch(t){console.log("FS.trackingDelegate['onOpenFile']('"+r+"', flags) threw an exception: "+t.message)}return o}function mc(t){t.na&&(t.na=null);try{t.n.close&&t.n.close(t)}catch(t){throw t}finally{Rb[t.fd]=null}}function nc(t,e,r){if(!t.seekable||!t.n.G)throw new L(J.ia);t.position=t.n.G(t,e,r),t.tb=[]}function oc(t,e,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&t.flags))throw new L(J.ea);if(N(t.g.mode))throw new L(J.P);if(!t.n.write)throw new L(J.q);1024&t.flags&&nc(t,0,2);var a=!0;if(void 0===n)n=t.position,a=!1;else if(!t.seekable)throw new L(J.ia);e=t.n.write(t,e,r,i,n,o),a||(t.position+=e);try{t.path&&R.onWriteToFile&&R.onWriteToFile(t.path)}catch(t){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+t.message)}return e}function pc(){L||((L=function(t,e){this.g=e,this.qb=function(t){for(var e in this.S=t,J)if(J[e]===t){this.code=e;break}},this.qb(t),this.message=xb[t]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(t){Mb[t]=new L(t),Mb[t].stack=""}))}function rc(t,e){var r=0;return t&&(r|=365),e&&(r|=146),r}function sc(t,e,r,i){return gc(t=K("string"==typeof t?t:T(t),e),rc(r,i))}function tc(t,e,r,i,n,o){if(n=gc(t=e?K("string"==typeof t?t:T(t),e):t,i=rc(i,n)),r){if("string"==typeof r){t=Array(r.length),e=0;for(var a=r.length;e>2]}function xc(){var t;if(t=X(),!(t=Rb[t]))throw new L(J.ea);return t}var yc={};function Ga(t){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var e=r;return 0==t||Ga.bb(t)?e:4294967295}e._i64Add=zc;var Ac=1;function Cc(t,e){if(Dc=t,Ec=e,!Fc)return 1;if(0==t)Y=function(){setTimeout(Gc,e)},Hc="timeout";else if(1==t)Y=function(){Ic(Gc)},Hc="rAF";else if(2==t){if(!window.setImmediate){var r=[];window.addEventListener("message",function(t){t.source===window&&"__emcc"===t.data&&(t.stopPropagation(),r.shift()())},!0),window.setImmediate=function(t){r.push(t),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var l=Lc;if(Gc=function(){if(!na)if(0>r-6&63;r=r-6,t=t+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&e)<<4],t+="=="):4==r&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&e)<<2],t+="="),u.src="data:audio/x-"+a.substr(-3)+";base64,"+t,s(u)}},u.src=n,ad(function(){s(u)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(t){!Tc&&r.sa&&(r.sa(),t.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(t){t()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(t){var e=Date.now();if(0===kd)kd=e+1e3/60;else for(;kd<=e+2;)kd+=1e3/60;e=Math.max(kd-e,0),setTimeout(t,e)}function Ic(t){"undefined"==typeof window?ld(t):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(t))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(t){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[t.substr(t.lastIndexOf(".")+1)]}function md(t,e,r){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?e(i.response):r()},i.onerror=r,i.send(null)}function nd(e,r,t){md(e,function(t){assert(t,'Loading data file "'+e+'" failed (no arrayBuffer).'),r(new Uint8Array(t)),lb()},function(){if(!t)throw'Loading data file "'+e+'" failed.';t()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var r=e.canvas;od.forEach(function(t){t(r.width,r.height)})}function gd(){if("undefined"!=typeof SDL){var t=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|t}pd()}function hd(){if("undefined"!=typeof SDL){var t=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&t}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0this.length-1||t<0)){var e=t%this.chunkSize;return this.gb(t/this.chunkSize|0)[e]}},a.prototype.pb=function(t){this.gb=t},a.prototype.Ca=function(){var t=new XMLHttpRequest;if(t.open("HEAD",l,!1),t.send(null),!(200<=t.status&&t.status<300||304===t.status))throw Error("Couldn't load "+l+". Status: "+t.status);var e,o=Number(t.getResponseHeader("Content-length")),a=1048576;(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e||(a=o);var s=this;s.pb(function(t){var e=t*a,r=(t+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[t]){var i=s.Y;if(r=(t=t.g.e).length)return 0;if(assert(0<=(i=Math.min(t.length-n,i))),t.slice)for(var o=0;o>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(t){return void 0!==vc&&t instanceof L||x(t),-t.S}},___syscall6:function(t,e){wc=e;try{return mc(xc()),0}catch(t){return void 0!==vc&&t instanceof L||x(t),-t.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(t){var e;tb.p--,ub.push(t);t:{if(t&&!vb[t])for(e in vb)if(vb[e].wd===t)break t;e=t}return e&&vb[e].Sd++,t},_emscripten_memcpy_big:function(t,e,r){return E.set(E.subarray(e,e+r),t),t},_sysconf:function(t){switch(t){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(t){return yc[t]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(t){return 0==t?J.q:(C[t>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(t,e){return t in yc?(yc[t]=e,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(t){var e=Date.now()/1e3|0;return t&&(C[t>>2]=e),e},___syscall140:function(t,e){wc=e;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(t){return void 0!==vc&&t instanceof L||x(t),-t.S}},___syscall146:function(t,e){wc=e;try{var r,i=xc(),n=X();t:{for(var o=X(),a=0,s=0;s>2],C[n+(8*s+4)>>2],void 0);if(l<0){r=-1;break t}a+=l}r=a}return r}catch(t){return void 0!==vc&&t instanceof L||x(t),-t.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(t,e,r){"use asm";var i=t.Int8Array;var n=t.Int16Array;var o=t.Int32Array;var a=t.Uint8Array;var s=t.Uint16Array;var l=t.Uint32Array;var u=t.Float32Array;var h=t.Float64Array;var pt=new i(r);var $=new n(r);var dt=new o(r);var mt=new a(r);var gt=new s(r);var c=new l(r);var f=new u(r);var tt=new h(r);var p=t.byteLength;var vt=e.STACKTOP|0;var d=e.STACK_MAX|0;var et=e.tempDoublePtr|0;var m=e.ABORT|0;var g=e.cttz_i8|0;var v=0;var _=0;var y=0;var b=0;var x=t.NaN,w=t.Infinity;var T=0,k=0,S=0,P=0,E=0.0,C=0,A=0,I=0,O=0.0;var rt=0;var M=0;var D=0;var R=0;var z=0;var F=0;var L=0;var j=0;var N=0;var B=0;var U=t.Math.floor;var X=t.Math.abs;var H=t.Math.sqrt;var W=t.Math.pow;var q=t.Math.cos;var G=t.Math.sin;var V=t.Math.tan;var Y=t.Math.acos;var Z=t.Math.asin;var J=t.Math.atan;var K=t.Math.atan2;var Q=t.Math.exp;var it=t.Math.log;var nt=t.Math.ceil;var _t=t.Math.imul;var ot=t.Math.min;var at=t.Math.clz32;var st=e.abort;var lt=e.assert;var ut=e.invoke_iiii;var ht=e.invoke_viiiii;var ct=e.invoke_vi;var ft=e.invoke_ii;var yt=e.invoke_viii;var bt=e.invoke_v;var xt=e.invoke_viiiiii;var wt=e.invoke_iiiiii;var Tt=e.invoke_viiii;var kt=e._pthread_cleanup_pop;var St=e.___syscall54;var Pt=e.___syscall6;var Et=e._emscripten_set_main_loop_timing;var Ct=e.__ZSt18uncaught_exceptionv;var At=e.___setErrNo;var It=e._sbrk;var Ot=e.___cxa_begin_catch;var Mt=e._emscripten_memcpy_big;var Dt=e._sysconf;var Rt=e._pthread_getspecific;var zt=e._pthread_self;var Ft=e._pthread_once;var Lt=e._pthread_key_create;var jt=e.___unlock;var Nt=e._emscripten_set_main_loop;var Bt=e._pthread_setspecific;var Ut=e.___lock;var Xt=e._abort;var Ht=e._pthread_cleanup_push;var Wt=e._time;var qt=e.___syscall140;var Gt=e.___syscall146;var Vt=0.0;function Yt(t){if(p(t)&16777215||p(t)<=16777215||p(t)>2147483648)return false;pt=new i(t);$=new n(t);dt=new o(t);mt=new a(t);gt=new s(t);c=new l(t);f=new u(t);tt=new h(t);r=t;return true}function Zt(t){t=t|0;var e=0;e=vt;vt=vt+t|0;vt=vt+15&-16;return e|0}function Jt(){return vt|0}function Kt(t){t=t|0;vt=t}function Qt(t,e){t=t|0;e=e|0;vt=t;d=e}function $t(t,e){t=t|0;e=e|0;if(!v){v=t;_=e}}function te(t){t=t|0;pt[et>>0]=pt[t>>0];pt[et+1>>0]=pt[t+1>>0];pt[et+2>>0]=pt[t+2>>0];pt[et+3>>0]=pt[t+3>>0]}function ee(t){t=t|0;pt[et>>0]=pt[t>>0];pt[et+1>>0]=pt[t+1>>0];pt[et+2>>0]=pt[t+2>>0];pt[et+3>>0]=pt[t+3>>0];pt[et+4>>0]=pt[t+4>>0];pt[et+5>>0]=pt[t+5>>0];pt[et+6>>0]=pt[t+6>>0];pt[et+7>>0]=pt[t+7>>0]}function re(t){t=t|0;rt=t}function ie(){return rt|0}function ne(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0;m=vt;vt=vt+608|0;f=m+88|0;c=m+72|0;l=m+64|0;s=m+48|0;a=m+24|0;o=m;h=m+96|0;p=m+92|0;u=t+4|0;d=t+8|0;if((dt[u>>2]|0)>>>0>(dt[d>>2]|0)>>>0){dt[o>>2]=1154;dt[o+4>>2]=2120;dt[o+8>>2]=1133;br(h,1100,o)|0;yr(h,m+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=e>>>0){dt[a>>2]=1154;dt[a+4>>2]=2121;dt[a+8>>2]=1169;br(h,1100,a)|0;yr(h,m+40|0)|0}a=dt[d>>2]|0;if(a>>>0>=e>>>0){d=1;vt=m;return d|0}do{if(r){if(e){o=e+-1|0;if(!(o&e)){o=11;break}else e=o}else e=-1;e=e>>>16|e;e=e>>>8|e;e=e>>>4|e;e=e>>>2|e;e=(e>>>1|e)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!e){e=0;o=12}else o=11;if((o|0)==11)if(e>>>0<=a>>>0)o=12;if((o|0)==12){dt[s>>2]=1154;dt[s+4>>2]=2130;dt[s+8>>2]=1217;br(h,1100,s)|0;yr(h,l)|0}r=_t(e,i)|0;do{if(!n){o=oe(dt[t>>2]|0,r,p,1)|0;if(!o){d=0;vt=m;return d|0}else{dt[t>>2]=o;break}}else{a=ae(r,p)|0;if(!a){d=0;vt=m;return d|0}Ii[n&0](a,dt[t>>2]|0,dt[u>>2]|0);o=dt[t>>2]|0;do{if(o)if(!(o&7)){Di[dt[104>>2]&1](o,0,0,1,dt[27]|0)|0;break}else{dt[c>>2]=1154;dt[c+4>>2]=2499;dt[c+8>>2]=1516;br(h,1100,c)|0;yr(h,f)|0;break}}while(0);dt[t>>2]=a}}while(0);o=dt[p>>2]|0;if(o>>>0>r>>>0)e=(o>>>0)/(i>>>0)|0;dt[d>>2]=e;d=1;vt=m;return d|0}function oe(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0;u=vt;vt=vt+592|0;l=u+48|0;o=u+24|0;n=u;s=u+72|0;a=u+68|0;if(t&7){dt[n>>2]=1154;dt[n+4>>2]=2499;dt[n+8>>2]=1494;br(s,1100,n)|0;yr(s,u+16|0)|0;l=0;vt=u;return l|0}if(e>>>0>2147418112){dt[o>>2]=1154;dt[o+4>>2]=2499;dt[o+8>>2]=1387;br(s,1100,o)|0;yr(s,u+40|0)|0;l=0;vt=u;return l|0}dt[a>>2]=e;i=Di[dt[104>>2]&1](t,e,a,i,dt[27]|0)|0;if(r)dt[r>>2]=dt[a>>2];if(!(i&7)){l=i;vt=u;return l|0}dt[l>>2]=1154;dt[l+4>>2]=2551;dt[l+8>>2]=1440;br(s,1100,l)|0;yr(s,u+64|0)|0;l=i;vt=u;return l|0}function ae(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0;l=vt;vt=vt+592|0;a=l+48|0;s=l+24|0;r=l;o=l+72|0;n=l+68|0;i=t+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){dt[r>>2]=1154;dt[r+4>>2]=2499;dt[r+8>>2]=1387;br(o,1100,r)|0;yr(o,l+16|0)|0;s=0;vt=l;return s|0}dt[n>>2]=i;r=Di[dt[104>>2]&1](0,i,n,1,dt[27]|0)|0;t=dt[n>>2]|0;if(e)dt[e>>2]=t;if((r|0)==0|t>>>0>>0){dt[s>>2]=1154;dt[s+4>>2]=2499;dt[s+8>>2]=1413;br(o,1100,s)|0;yr(o,l+40|0)|0;s=0;vt=l;return s|0}if(!(r&7)){s=r;vt=l;return s|0}dt[a>>2]=1154;dt[a+4>>2]=2526;dt[a+8>>2]=1440;br(o,1100,a)|0;yr(o,l+64|0)|0;s=r;vt=l;return s|0}function se(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,E=0,C=0,A=0,I=0,O=0,M=0,D=0,R=0,z=0,F=0,L=0,j=0;j=vt;vt=vt+960|0;z=j+232|0;R=j+216|0;D=j+208|0;M=j+192|0;O=j+184|0;I=j+168|0;A=j+160|0;C=j+144|0;S=j+136|0;k=j+120|0;T=j+112|0;w=j+96|0;y=j+88|0;_=j+72|0;v=j+64|0;g=j+48|0;c=j+40|0;p=j+24|0;f=j+16|0;h=j;E=j+440|0;F=j+376|0;L=j+304|0;m=j+236|0;if((e|0)==0|i>>>0>11){t=0;vt=j;return t|0}dt[t>>2]=e;n=L;o=n+68|0;do{dt[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=pt[r+o>>0]|0;if(n<<24>>24){P=L+((n&255)<<2)|0;dt[P>>2]=(dt[P>>2]|0)+1}o=o+1|0}while((o|0)!=(e|0));o=0;u=1;a=0;s=-1;l=0;while(1){n=dt[L+(u<<2)>>2]|0;if(!n)dt[t+28+(u+-1<<2)>>2]=0;else{P=u+-1|0;dt[F+(P<<2)>>2]=o;o=n+o|0;x=16-u|0;dt[t+28+(P<<2)>>2]=(o+-1<>2]=l;dt[m+(u<<2)>>2]=l;a=a>>>0>u>>>0?a:u;s=s>>>0>>0?s:u;l=n+l|0}u=u+1|0;if((u|0)==17){P=a;break}else o=o<<1}dt[t+4>>2]=l;o=t+172|0;do{if(l>>>0>(dt[o>>2]|0)>>>0){dt[o>>2]=l;if(l){n=l+-1|0;if(n&l)d=14}else{n=-1;d=14}if((d|0)==14){x=n>>>16|n;x=x>>>8|x;x=x>>>4|x;x=x>>>2|x;x=(x>>>1|x)+1|0;dt[o>>2]=x>>>0>e>>>0?e:x}a=t+176|0;n=dt[a>>2]|0;do{if(n){x=dt[n+-4>>2]|0;n=n+-8|0;if(!((x|0)!=0?(x|0)==(~dt[n>>2]|0):0)){dt[h>>2]=1154;dt[h+4>>2]=644;dt[h+8>>2]=1863;br(E,1100,h)|0;yr(E,f)|0}if(!(n&7)){Di[dt[104>>2]&1](n,0,0,1,dt[27]|0)|0;break}else{dt[p>>2]=1154;dt[p+4>>2]=2499;dt[p+8>>2]=1516;br(E,1100,p)|0;yr(E,c)|0;break}}}while(0);o=dt[o>>2]|0;o=(o|0)!=0?o:1;n=ae((o<<1)+8|0,0)|0;if(!n){dt[a>>2]=0;n=0;break}else{dt[n+4>>2]=o;dt[n>>2]=~o;dt[a>>2]=n+8;d=25;break}}else d=25}while(0);t:do{if((d|0)==25){x=t+24|0;pt[x>>0]=s;pt[t+25>>0]=P;o=t+176|0;a=0;do{b=pt[r+a>>0]|0;n=b&255;if(b<<24>>24){if(!(dt[L+(n<<2)>>2]|0)){dt[g>>2]=1154;dt[g+4>>2]=2273;dt[g+8>>2]=1261;br(E,1100,g)|0;yr(E,v)|0}b=m+(n<<2)|0;n=dt[b>>2]|0;dt[b>>2]=n+1;if(n>>>0>=l>>>0){dt[_>>2]=1154;dt[_+4>>2]=2277;dt[_+8>>2]=1274;br(E,1100,_)|0;yr(E,y)|0}$[(dt[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(e|0));n=pt[x>>0]|0;y=(n&255)>>>0>>0?i:0;b=t+8|0;dt[b>>2]=y;_=(y|0)!=0;if(_){v=1<>>0>(dt[n>>2]|0)>>>0){dt[n>>2]=v;a=t+168|0;n=dt[a>>2]|0;do{if(n){g=dt[n+-4>>2]|0;n=n+-8|0;if(!((g|0)!=0?(g|0)==(~dt[n>>2]|0):0)){dt[w>>2]=1154;dt[w+4>>2]=644;dt[w+8>>2]=1863;br(E,1100,w)|0;yr(E,T)|0}if(!(n&7)){Di[dt[104>>2]&1](n,0,0,1,dt[27]|0)|0;break}else{dt[k>>2]=1154;dt[k+4>>2]=2499;dt[k+8>>2]=1516;br(E,1100,k)|0;yr(E,S)|0;break}}}while(0);n=v<<2;o=ae(n+8|0,0)|0;if(!o){dt[a>>2]=0;n=0;break t}else{S=o+8|0;dt[o+4>>2]=v;dt[o>>2]=~v;dt[a>>2]=S;o=S;break}}else{o=t+168|0;n=v<<2;a=o;o=dt[o>>2]|0}}while(0);Yr(o|0,-1,n|0)|0;d=t+176|0;g=1;do{if(dt[L+(g<<2)>>2]|0){e=y-g|0;m=1<>2]|0;if(o>>>0>=16){dt[C>>2]=1154;dt[C+4>>2]=1953;dt[C+8>>2]=1737;br(E,1100,C)|0;yr(E,A)|0}n=dt[t+28+(o<<2)>>2]|0;if(!n)p=-1;else p=(n+-1|0)>>>(16-g|0);if(s>>>0<=p>>>0){c=(dt[t+96+(o<<2)>>2]|0)-s|0;f=g<<16;do{n=gt[(dt[d>>2]|0)+(c+s<<1)>>1]|0;if((mt[r+n>>0]|0|0)!=(g|0)){dt[I>>2]=1154;dt[I+4>>2]=2319;dt[I+8>>2]=1303;br(E,1100,I)|0;yr(E,O)|0}h=s<>>0>=v>>>0){dt[M>>2]=1154;dt[M+4>>2]=2325;dt[M+8>>2]=1337;br(E,1100,M)|0;yr(E,D)|0}n=dt[a>>2]|0;if((dt[n+(l<<2)>>2]|0)!=-1){dt[R>>2]=1154;dt[R+4>>2]=2327;dt[R+8>>2]=1360;br(E,1100,R)|0;yr(E,z)|0;n=dt[a>>2]|0}dt[n+(l<<2)>>2]=o;u=u+1|0}while(u>>>0>>0);s=s+1|0}while(s>>>0<=p>>>0)}}g=g+1|0}while(y>>>0>=g>>>0);n=pt[x>>0]|0}o=t+96|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F>>2]|0);o=t+100|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+4>>2]|0);o=t+104|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+8>>2]|0);o=t+108|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+12>>2]|0);o=t+112|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+16>>2]|0);o=t+116|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+20>>2]|0);o=t+120|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+24>>2]|0);o=t+124|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+28>>2]|0);o=t+128|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+32>>2]|0);o=t+132|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+36>>2]|0);o=t+136|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+40>>2]|0);o=t+140|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+44>>2]|0);o=t+144|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+48>>2]|0);o=t+148|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+52>>2]|0);o=t+152|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+56>>2]|0);o=t+156|0;dt[o>>2]=(dt[o>>2]|0)-(dt[F+60>>2]|0);o=t+16|0;dt[o>>2]=0;a=t+20|0;dt[a>>2]=n&255;e:do{if(_){while(1){if(!i)break e;n=i+-1|0;if(!(dt[L+(i<<2)>>2]|0))i=n;else break}dt[o>>2]=dt[t+28+(n<<2)>>2];n=y+1|0;dt[a>>2]=n;if(n>>>0<=P>>>0){while(1){if(dt[L+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>P>>>0)break e}dt[a>>2]=n}}}while(0);dt[t+92>>2]=-1;dt[t+160>>2]=1048575;dt[t+12>>2]=32-(dt[b>>2]|0);n=1}}while(0);t=n;vt=j;return t|0}function le(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0;if(!t){n=Br(e)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=Hr(n)|0;dt[r>>2]=o;r=n;return r|0}if(!e){Ur(t);if(!r){r=0;return r|0}dt[r>>2]=0;r=0;return r|0}n=Xr(t,e)|0;o=(n|0)!=0;if(o|i^1)o=o?n:t;else{n=Xr(t,e)|0;o=(n|0)==0?t:n}if(!r){r=n;return r|0}e=Hr(o)|0;dt[r>>2]=e;r=n;return r|0}function ue(t,e,r){t=t|0;e=e|0;r=r|0;var i=0;if(!((t|0)!=0&e>>>0>73&(r|0)!=0)){r=0;return r|0}if((dt[r>>2]|0)!=40|e>>>0<74){r=0;return r|0}if(((mt[t>>0]|0)<<8|(mt[t+1>>0]|0)|0)!=18552){r=0;return r|0}if(((mt[t+2>>0]|0)<<8|(mt[t+3>>0]|0))>>>0<74){r=0;return r|0}if(((mt[t+7>>0]|0)<<16|(mt[t+6>>0]|0)<<24|(mt[t+8>>0]|0)<<8|(mt[t+9>>0]|0))>>>0>e>>>0){r=0;return r|0}dt[r+4>>2]=(mt[t+12>>0]|0)<<8|(mt[t+13>>0]|0);dt[r+8>>2]=(mt[t+14>>0]|0)<<8|(mt[t+15>>0]|0);dt[r+12>>2]=mt[t+16>>0];dt[r+16>>2]=mt[t+17>>0];e=t+18|0;i=r+32|0;dt[i>>2]=mt[e>>0];dt[i+4>>2]=0;e=pt[e>>0]|0;dt[r+20>>2]=e<<24>>24==0|e<<24>>24==9?8:16;dt[r+24>>2]=(mt[t+26>>0]|0)<<16|(mt[t+25>>0]|0)<<24|(mt[t+27>>0]|0)<<8|(mt[t+28>>0]|0);dt[r+28>>2]=(mt[t+30>>0]|0)<<16|(mt[t+29>>0]|0)<<24|(mt[t+31>>0]|0)<<8|(mt[t+32>>0]|0);r=1;return r|0}function he(t){t=t|0;Ot(t|0)|0;Ue()}function ce(t){t=t|0;var e=0,r=0,i=0,n=0,o=0;o=vt;vt=vt+544|0;n=o;i=o+24|0;e=dt[t+20>>2]|0;if(e)fe(e);e=t+4|0;r=dt[e>>2]|0;if(!r){n=t+16|0;pt[n>>0]=0;vt=o;return}if(!(r&7))Di[dt[104>>2]&1](r,0,0,1,dt[27]|0)|0;else{dt[n>>2]=1154;dt[n+4>>2]=2499;dt[n+8>>2]=1516;br(i,1100,n)|0;yr(i,o+16|0)|0}dt[e>>2]=0;dt[t+8>>2]=0;dt[t+12>>2]=0;n=t+16|0;pt[n>>0]=0;vt=o;return}function fe(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0;p=vt;vt=vt+640|0;f=p+112|0;c=p+96|0;h=p+88|0;u=p+72|0;l=p+64|0;s=p+48|0;i=p+40|0;o=p+24|0;n=p+16|0;r=p;a=p+120|0;if(!t){vt=p;return}e=dt[t+168>>2]|0;do{if(e){d=dt[e+-4>>2]|0;e=e+-8|0;if(!((d|0)!=0?(d|0)==(~dt[e>>2]|0):0)){dt[r>>2]=1154;dt[r+4>>2]=644;dt[r+8>>2]=1863;br(a,1100,r)|0;yr(a,n)|0}if(!(e&7)){Di[dt[104>>2]&1](e,0,0,1,dt[27]|0)|0;break}else{dt[o>>2]=1154;dt[o+4>>2]=2499;dt[o+8>>2]=1516;br(a,1100,o)|0;yr(a,i)|0;break}}}while(0);e=dt[t+176>>2]|0;do{if(e){d=dt[e+-4>>2]|0;e=e+-8|0;if(!((d|0)!=0?(d|0)==(~dt[e>>2]|0):0)){dt[s>>2]=1154;dt[s+4>>2]=644;dt[s+8>>2]=1863;br(a,1100,s)|0;yr(a,l)|0}if(!(e&7)){Di[dt[104>>2]&1](e,0,0,1,dt[27]|0)|0;break}else{dt[u>>2]=1154;dt[u+4>>2]=2499;dt[u+8>>2]=1516;br(a,1100,u)|0;yr(a,h)|0;break}}}while(0);if(!(t&7)){Di[dt[104>>2]&1](t,0,0,1,dt[27]|0)|0;vt=p;return}else{dt[c>>2]=1154;dt[c+4>>2]=2499;dt[c+8>>2]=1516;br(a,1100,c)|0;yr(a,f)|0;vt=p;return}}function pe(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0;h=vt;vt=vt+560|0;a=h+40|0;s=h+24|0;e=h;o=h+48|0;n=t+8|0;r=dt[n>>2]|0;if((r+-1|0)>>>0>=8192){dt[e>>2]=1154;dt[e+4>>2]=2997;dt[e+8>>2]=1541;br(o,1100,e)|0;yr(o,h+16|0)|0}dt[t>>2]=r;i=t+20|0;e=dt[i>>2]|0;if(!e){e=ae(180,0)|0;if(!e)e=0;else{u=e+164|0;dt[u>>2]=0;dt[u+4>>2]=0;dt[u+8>>2]=0;dt[u+12>>2]=0}dt[i>>2]=e;u=e;l=dt[t>>2]|0}else{u=e;l=r}if(!(dt[n>>2]|0)){dt[s>>2]=1154;dt[s+4>>2]=903;dt[s+8>>2]=1781;br(o,1100,s)|0;yr(o,a)|0;o=dt[t>>2]|0}else o=l;n=dt[t+4>>2]|0;if(o>>>0>16){r=o;e=0}else{t=0;u=se(u,l,n,t)|0;vt=h;return u|0}while(1){i=e+1|0;if(r>>>0>3){r=r>>>1;e=i}else{r=i;break}}t=e+2+((r|0)!=32&1<>>0>>0&1)|0;t=t>>>0<11?t&255:11;u=se(u,l,n,t)|0;vt=h;return u|0}function de(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,E=0,C=0,A=0,I=0,O=0,M=0,D=0,R=0,z=0;z=vt;vt=vt+800|0;I=z+256|0;A=z+240|0;C=z+232|0;E=z+216|0;P=z+208|0;S=z+192|0;k=z+184|0;T=z+168|0;w=z+160|0;x=z+144|0;b=z+136|0;y=z+120|0;_=z+112|0;v=z+96|0;g=z+88|0;m=z+72|0;c=z+64|0;h=z+48|0;s=z+40|0;l=z+24|0;o=z+16|0;n=z;D=z+288|0;R=z+264|0;O=me(t,14)|0;if(!O){dt[e>>2]=0;r=e+4|0;i=dt[r>>2]|0;if(i){if(!(i&7))Di[dt[104>>2]&1](i,0,0,1,dt[27]|0)|0;else{dt[n>>2]=1154;dt[n+4>>2]=2499;dt[n+8>>2]=1516;br(D,1100,n)|0;yr(D,o)|0}dt[r>>2]=0;dt[e+8>>2]=0;dt[e+12>>2]=0}pt[e+16>>0]=0;r=e+20|0;i=dt[r>>2]|0;if(!i){e=1;vt=z;return e|0}fe(i);dt[r>>2]=0;e=1;vt=z;return e|0}p=e+4|0;d=e+8|0;r=dt[d>>2]|0;if((r|0)!=(O|0)){if(r>>>0<=O>>>0){do{if((dt[e+12>>2]|0)>>>0>>0){if(ne(p,O,(r+1|0)==(O|0),1,0)|0){r=dt[d>>2]|0;break}pt[e+16>>0]=1;e=0;vt=z;return e|0}}while(0);Yr((dt[p>>2]|0)+r|0,0,O-r|0)|0}dt[d>>2]=O}Yr(dt[p>>2]|0,0,O|0)|0;f=t+20|0;r=dt[f>>2]|0;if((r|0)<5){o=t+4|0;a=t+8|0;n=t+16|0;do{i=dt[o>>2]|0;if((i|0)==(dt[a>>2]|0))i=0;else{dt[o>>2]=i+1;i=mt[i>>0]|0}r=r+8|0;dt[f>>2]=r;if((r|0)>=33){dt[l>>2]=1154;dt[l+4>>2]=3199;dt[l+8>>2]=1650;br(D,1100,l)|0;yr(D,s)|0;r=dt[f>>2]|0}i=i<<32-r|dt[n>>2];dt[n>>2]=i}while((r|0)<5)}else{i=t+16|0;n=i;i=dt[i>>2]|0}u=i>>>27;dt[n>>2]=i<<5;dt[f>>2]=r+-5;if((u+-1|0)>>>0>20){e=0;vt=z;return e|0}dt[R+20>>2]=0;dt[R>>2]=0;dt[R+4>>2]=0;dt[R+8>>2]=0;dt[R+12>>2]=0;pt[R+16>>0]=0;r=R+4|0;i=R+8|0;t:do{if(ne(r,21,0,1,0)|0){s=dt[i>>2]|0;l=dt[r>>2]|0;Yr(l+s|0,0,21-s|0)|0;dt[i>>2]=21;if(u){n=t+4|0;o=t+8|0;a=t+16|0;s=0;do{r=dt[f>>2]|0;if((r|0)<3)do{i=dt[n>>2]|0;if((i|0)==(dt[o>>2]|0))i=0;else{dt[n>>2]=i+1;i=mt[i>>0]|0}r=r+8|0;dt[f>>2]=r;if((r|0)>=33){dt[h>>2]=1154;dt[h+4>>2]=3199;dt[h+8>>2]=1650;br(D,1100,h)|0;yr(D,c)|0;r=dt[f>>2]|0}i=i<<32-r|dt[a>>2];dt[a>>2]=i}while((r|0)<3);else i=dt[a>>2]|0;dt[a>>2]=i<<3;dt[f>>2]=r+-3;pt[l+(mt[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(u|0))}if(pe(R)|0){s=t+4|0;l=t+8|0;u=t+16|0;i=0;e:while(1){a=O-i|0;r=ge(t,R)|0;r:do{if(r>>>0<17){if((dt[d>>2]|0)>>>0<=i>>>0){dt[m>>2]=1154;dt[m+4>>2]=903;dt[m+8>>2]=1781;br(D,1100,m)|0;yr(D,g)|0}pt[(dt[p>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=dt[f>>2]|0;if((r|0)<3)do{n=dt[s>>2]|0;if((n|0)==(dt[l>>2]|0))n=0;else{dt[s>>2]=n+1;n=mt[n>>0]|0}r=r+8|0;dt[f>>2]=r;if((r|0)>=33){dt[v>>2]=1154;dt[v+4>>2]=3199;dt[v+8>>2]=1650;br(D,1100,v)|0;yr(D,_)|0;r=dt[f>>2]|0}n=n<<32-r|dt[u>>2];dt[u>>2]=n}while((r|0)<3);else n=dt[u>>2]|0;dt[u>>2]=n<<3;dt[f>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break t}r=r+i|0;break r}case 18:{r=dt[f>>2]|0;if((r|0)<7)do{n=dt[s>>2]|0;if((n|0)==(dt[l>>2]|0))n=0;else{dt[s>>2]=n+1;n=mt[n>>0]|0}r=r+8|0;dt[f>>2]=r;if((r|0)>=33){dt[y>>2]=1154;dt[y+4>>2]=3199;dt[y+8>>2]=1650;br(D,1100,y)|0;yr(D,b)|0;r=dt[f>>2]|0}n=n<<32-r|dt[u>>2];dt[u>>2]=n}while((r|0)<7);else n=dt[u>>2]|0;dt[u>>2]=n<<7;dt[f>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break t}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){M=90;break e}o=dt[f>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=dt[s>>2]|0;if((r|0)==(dt[l>>2]|0))o=0;else{dt[s>>2]=r+1;o=mt[r>>0]|0}r=n+8|0;dt[f>>2]=r;if((r|0)>=33){dt[x>>2]=1154;dt[x+4>>2]=3199;dt[x+8>>2]=1650;br(D,1100,x)|0;yr(D,w)|0;r=dt[f>>2]|0}n=o<<32-r|dt[u>>2];dt[u>>2]=n;if((r|0)<2)n=r;else break}}else{n=dt[u>>2]|0;r=o}dt[u>>2]=n<<2;dt[f>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=dt[s>>2]|0;if((r|0)==(dt[l>>2]|0))o=0;else{dt[s>>2]=r+1;o=mt[r>>0]|0}r=n+8|0;dt[f>>2]=r;if((r|0)>=33){dt[T>>2]=1154;dt[T+4>>2]=3199;dt[T+8>>2]=1650;br(D,1100,T)|0;yr(D,k)|0;r=dt[f>>2]|0}n=o<<32-r|dt[u>>2];dt[u>>2]=n;if((r|0)<6)n=r;else break}}else{n=dt[u>>2]|0;r=o}dt[u>>2]=n<<6;dt[f>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break t}r=i+-1|0;if((dt[d>>2]|0)>>>0<=r>>>0){dt[S>>2]=1154;dt[S+4>>2]=903;dt[S+8>>2]=1781;br(D,1100,S)|0;yr(D,P)|0}n=pt[(dt[p>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break t}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((dt[d>>2]|0)>>>0<=i>>>0){dt[E>>2]=1154;dt[E+4>>2]=903;dt[E+8>>2]=1781;br(D,1100,E)|0;yr(D,C)|0}pt[(dt[p>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(O>>>0>r>>>0)i=r;else break}if((M|0)==90){dt[A>>2]=1154;dt[A+4>>2]=3140;dt[A+8>>2]=1632;br(D,1100,A)|0;yr(D,I)|0;r=0;break}if((O|0)==(r|0))r=pe(e)|0;else r=0}else r=0}else{pt[R+16>>0]=1;r=0}}while(0);ce(R);e=r;vt=z;return e|0}function me(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0;h=vt;vt=vt+544|0;s=h+16|0;a=h;o=h+24|0;if(!e){u=0;vt=h;return u|0}if(e>>>0<=16){u=ve(t,e)|0;vt=h;return u|0}l=ve(t,e+-16|0)|0;u=t+20|0;e=dt[u>>2]|0;if((e|0)<16){i=t+4|0;n=t+8|0;r=t+16|0;do{t=dt[i>>2]|0;if((t|0)==(dt[n>>2]|0))t=0;else{dt[i>>2]=t+1;t=mt[t>>0]|0}e=e+8|0;dt[u>>2]=e;if((e|0)>=33){dt[a>>2]=1154;dt[a+4>>2]=3199;dt[a+8>>2]=1650;br(o,1100,a)|0;yr(o,s)|0;e=dt[u>>2]|0}t=t<<32-e|dt[r>>2];dt[r>>2]=t}while((e|0)<16)}else{t=t+16|0;r=t;t=dt[t>>2]|0}dt[r>>2]=t<<16;dt[u>>2]=e+-16;u=t>>>16|l<<16;vt=h;return u|0}function ge(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0;y=vt;vt=vt+608|0;m=y+88|0;d=y+72|0;f=y+64|0;c=y+48|0;h=y+40|0;p=y+24|0;u=y+16|0;l=y;v=y+96|0;g=dt[e+20>>2]|0;_=t+20|0;s=dt[_>>2]|0;do{if((s|0)<24){a=t+4|0;i=dt[a>>2]|0;n=dt[t+8>>2]|0;r=i>>>0>>0;if((s|0)>=16){if(r){dt[a>>2]=i+1;r=mt[i>>0]|0}else r=0;dt[_>>2]=s+8;a=t+16|0;o=r<<24-s|dt[a>>2];dt[a>>2]=o;break}if(r){o=(mt[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0>>0){i=mt[r>>0]|0;r=r+1|0}else i=0;dt[a>>2]=r;dt[_>>2]=s+16;a=t+16|0;o=(i|o)<<16-s|dt[a>>2];dt[a>>2]=o}else{o=t+16|0;a=o;o=dt[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(dt[g+16>>2]|0)>>>0){i=dt[(dt[g+168>>2]|0)+(o>>>(32-(dt[g+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){dt[l>>2]=1154;dt[l+4>>2]=3244;dt[l+8>>2]=1677;br(v,1100,l)|0;yr(v,u)|0}r=i&65535;i=i>>>16;if((dt[e+8>>2]|0)>>>0<=r>>>0){dt[p>>2]=1154;dt[p+4>>2]=902;dt[p+8>>2]=1781;br(v,1100,p)|0;yr(v,h)|0}if((mt[(dt[e+4>>2]|0)+r>>0]|0|0)!=(i|0)){dt[c>>2]=1154;dt[c+4>>2]=3248;dt[c+8>>2]=1694;br(v,1100,c)|0;yr(v,f)|0}}else{i=dt[g+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(dt[g+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(dt[g+96+(r<<2)>>2]|0)|0;if(r>>>0<(dt[e>>2]|0)>>>0){r=gt[(dt[g+176>>2]|0)+(r<<1)>>1]|0;break}dt[d>>2]=1154;dt[d+4>>2]=3266;dt[d+8>>2]=1632;br(v,1100,d)|0;yr(v,m)|0;_=0;vt=y;return _|0}}while(0);dt[a>>2]=dt[a>>2]<>2]=(dt[_>>2]|0)-i;_=r;vt=y;return _|0}function ve(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0;h=vt;vt=vt+560|0;s=h+40|0;l=h+24|0;r=h;a=h+48|0;if(e>>>0>=33){dt[r>>2]=1154;dt[r+4>>2]=3190;dt[r+8>>2]=1634;br(a,1100,r)|0;yr(a,h+16|0)|0}u=t+20|0;r=dt[u>>2]|0;if((r|0)>=(e|0)){o=t+16|0;a=o;o=dt[o>>2]|0;s=r;l=32-e|0;l=o>>>l;o=o<>2]=o;e=s-e|0;dt[u>>2]=e;vt=h;return l|0}n=t+4|0;o=t+8|0;i=t+16|0;do{t=dt[n>>2]|0;if((t|0)==(dt[o>>2]|0))t=0;else{dt[n>>2]=t+1;t=mt[t>>0]|0}r=r+8|0;dt[u>>2]=r;if((r|0)>=33){dt[l>>2]=1154;dt[l+4>>2]=3199;dt[l+8>>2]=1650;br(a,1100,l)|0;yr(a,s)|0;r=dt[u>>2]|0}t=t<<32-r|dt[i>>2];dt[i>>2]=t}while((r|0)<(e|0));l=32-e|0;l=t>>>l;s=t<>2]=s;e=r-e|0;dt[u>>2]=e;vt=h;return l|0}function _e(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0;d=vt;vt=vt+544|0;f=d+16|0;c=d;h=d+24|0;if((t|0)==0|e>>>0<62){p=0;vt=d;return p|0}u=ae(300,0)|0;if(!u){p=0;vt=d;return p|0}dt[u>>2]=519686845;r=u+4|0;dt[r>>2]=0;i=u+8|0;dt[i>>2]=0;l=u+88|0;n=u+136|0;o=u+160|0;a=l;s=a+44|0;do{dt[a>>2]=0;a=a+4|0}while((a|0)<(s|0));pt[l+44>>0]=0;m=u+184|0;a=u+208|0;s=u+232|0;g=u+252|0;dt[g>>2]=0;dt[g+4>>2]=0;dt[g+8>>2]=0;pt[g+12>>0]=0;g=u+268|0;dt[g>>2]=0;dt[g+4>>2]=0;dt[g+8>>2]=0;pt[g+12>>0]=0;g=u+284|0;dt[g>>2]=0;dt[g+4>>2]=0;dt[g+8>>2]=0;pt[g+12>>0]=0;dt[n>>2]=0;dt[n+4>>2]=0;dt[n+8>>2]=0;dt[n+12>>2]=0;dt[n+16>>2]=0;pt[n+20>>0]=0;dt[o>>2]=0;dt[o+4>>2]=0;dt[o+8>>2]=0;dt[o+12>>2]=0;dt[o+16>>2]=0;pt[o+20>>0]=0;dt[m>>2]=0;dt[m+4>>2]=0;dt[m+8>>2]=0;dt[m+12>>2]=0;dt[m+16>>2]=0;pt[m+20>>0]=0;dt[a>>2]=0;dt[a+4>>2]=0;dt[a+8>>2]=0;dt[a+12>>2]=0;dt[a+16>>2]=0;pt[a+20>>0]=0;dt[s>>2]=0;dt[s+4>>2]=0;dt[s+8>>2]=0;dt[s+12>>2]=0;pt[s+16>>0]=0;do{if(((e>>>0>=74?((mt[t>>0]|0)<<8|(mt[t+1>>0]|0)|0)==18552:0)?((mt[t+2>>0]|0)<<8|(mt[t+3>>0]|0))>>>0>=74:0)?((mt[t+7>>0]|0)<<16|(mt[t+6>>0]|0)<<24|(mt[t+8>>0]|0)<<8|(mt[t+9>>0]|0))>>>0<=e>>>0:0){dt[l>>2]=t;dt[r>>2]=t;dt[i>>2]=e;if(Ee(u)|0){r=dt[l>>2]|0;if((mt[r+39>>0]|0)<<8|(mt[r+40>>0]|0)){if(!(Ce(u)|0))break;if(!(Ae(u)|0))break;r=dt[l>>2]|0}if(!((mt[r+55>>0]|0)<<8|(mt[r+56>>0]|0))){g=u;vt=d;return g|0}if(Ie(u)|0?Oe(u)|0:0){g=u;vt=d;return g|0}}}else p=7}while(0);if((p|0)==7)dt[l>>2]=0;Fe(u);if(!(u&7)){Di[dt[104>>2]&1](u,0,0,1,dt[27]|0)|0;g=0;vt=d;return g|0}else{dt[c>>2]=1154;dt[c+4>>2]=2499;dt[c+8>>2]=1516;br(h,1100,c)|0;yr(h,f)|0;g=0;vt=d;return g|0}return 0}function ye(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,h=0;h=vt;vt=vt+544|0;u=h;l=h+24|0;o=dt[t+88>>2]|0;s=(mt[o+70+(n<<2)+1>>0]|0)<<16|(mt[o+70+(n<<2)>>0]|0)<<24|(mt[o+70+(n<<2)+2>>0]|0)<<8|(mt[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(mt[o+16>>0]|0)>>>0)o=(mt[o+70+(a<<2)+1>>0]|0)<<16|(mt[o+70+(a<<2)>>0]|0)<<24|(mt[o+70+(a<<2)+2>>0]|0)<<8|(mt[o+70+(a<<2)+3>>0]|0);else o=dt[t+8>>2]|0;if(o>>>0>s>>>0){l=t+4|0;l=dt[l>>2]|0;l=l+s|0;u=o-s|0;u=be(t,l,u,e,r,i,n)|0;vt=h;return u|0}dt[u>>2]=1154;dt[u+4>>2]=3704;dt[u+8>>2]=1792;br(l,1100,u)|0;yr(l,h+16|0)|0;l=t+4|0;l=dt[l>>2]|0;l=l+s|0;u=o-s|0;u=be(t,l,u,e,r,i,n)|0;vt=h;return u|0}function be(t,e,r,i,n,o,a){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,l=0,u=0,h=0;h=dt[t+88>>2]|0;l=((mt[h+12>>0]|0)<<8|(mt[h+13>>0]|0))>>>a;u=((mt[h+14>>0]|0)<<8|(mt[h+15>>0]|0))>>>a;l=l>>>0>1?(l+3|0)>>>2:1;u=u>>>0>1?(u+3|0)>>>2:1;h=h+18|0;a=pt[h>>0]|0;a=_t(a<<24>>24==0|a<<24>>24==9?8:16,l)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{t=0;return t|0}if((_t(a,u)|0)>>>0>n>>>0){t=0;return t|0}o=(l+1|0)>>>1;s=(u+1|0)>>>1;if(!r){t=0;return t|0}dt[t+92>>2]=e;dt[t+96>>2]=e;dt[t+104>>2]=r;dt[t+100>>2]=e+r;dt[t+108>>2]=0;dt[t+112>>2]=0;switch(mt[h>>0]|0|0){case 0:{Me(t,i,n,a,l,u,o,s)|0;t=1;return t|0}case 4:case 6:case 5:case 3:case 2:{De(t,i,n,a,l,u,o,s)|0;t=1;return t|0}case 9:{Re(t,i,n,a,l,u,o,s)|0;t=1;return t|0}case 8:case 7:{ze(t,i,n,a,l,u,o,s)|0;t=1;return t|0}default:{t=0;return t|0}}return 0}function xe(t,e){t=t|0;e=e|0;var r=0,i=0;i=vt;vt=vt+48|0;r=i;dt[r>>2]=40;ue(t,e,r)|0;vt=i;return dt[r+4>>2]|0}function we(t,e){t=t|0;e=e|0;var r=0,i=0;i=vt;vt=vt+48|0;r=i;dt[r>>2]=40;ue(t,e,r)|0;vt=i;return dt[r+8>>2]|0}function Te(t,e){t=t|0;e=e|0;var r=0,i=0;i=vt;vt=vt+48|0;r=i;dt[r>>2]=40;ue(t,e,r)|0;vt=i;return dt[r+12>>2]|0}function ke(t,e){t=t|0;e=e|0;var r=0,i=0;i=vt;vt=vt+48|0;r=i;dt[r>>2]=40;ue(t,e,r)|0;vt=i;return dt[r+32>>2]|0}function Se(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,l=0,u=0;l=vt;vt=vt+576|0;a=l+56|0;o=l+40|0;n=l+64|0;u=l;dt[u>>2]=40;ue(t,e,u)|0;i=(((dt[u+4>>2]|0)>>>r)+3|0)>>>2;e=(((dt[u+8>>2]|0)>>>r)+3|0)>>>2;r=u+32|0;t=dt[r+4>>2]|0;do{switch(dt[r>>2]|0){case 0:{if(!t)t=8;else s=13;break}case 1:{if(!t)s=12;else s=13;break}case 2:{if(!t)s=12;else s=13;break}case 3:{if(!t)s=12;else s=13;break}case 4:{if(!t)s=12;else s=13;break}case 5:{if(!t)s=12;else s=13;break}case 6:{if(!t)s=12;else s=13;break}case 7:{if(!t)s=12;else s=13;break}case 8:{if(!t)s=12;else s=13;break}case 9:{if(!t)t=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)t=16;else if((s|0)==13){dt[o>>2]=1154;dt[o+4>>2]=2663;dt[o+8>>2]=1535;br(n,1100,o)|0;yr(n,a)|0;t=0}u=_t(_t(e,i)|0,t)|0;vt=l;return u|0}function Pe(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0;d=vt;vt=vt+608|0;f=d+80|0;p=d+64|0;s=d+56|0;a=d+40|0;h=d+88|0;m=d;c=d+84|0;dt[m>>2]=40;ue(t,e,m)|0;l=(((dt[m+4>>2]|0)>>>n)+3|0)>>>2;m=m+32|0;o=dt[m+4>>2]|0;do{switch(dt[m>>2]|0){case 0:{if(!o)o=8;else u=13;break}case 1:{if(!o)u=12;else u=13;break}case 2:{if(!o)u=12;else u=13;break}case 3:{if(!o)u=12;else u=13;break}case 4:{if(!o)u=12;else u=13;break}case 5:{if(!o)u=12;else u=13;break}case 6:{if(!o)u=12;else u=13;break}case 7:{if(!o)u=12;else u=13;break}case 8:{if(!o)u=12;else u=13;break}case 9:{if(!o)o=8;else u=13;break}default:u=13}}while(0);if((u|0)==12)o=16;else if((u|0)==13){dt[a>>2]=1154;dt[a+4>>2]=2663;dt[a+8>>2]=1535;br(h,1100,a)|0;yr(h,s)|0;o=0}s=_t(o,l)|0;a=_e(t,e)|0;dt[c>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(dt[a>>2]|0)==519686845:0)ye(a,c,i,s,n)|0;if(o){vt=d;return}if((dt[a>>2]|0)!=519686845){vt=d;return}Fe(a);if(!(a&7)){Di[dt[104>>2]&1](a,0,0,1,dt[27]|0)|0;vt=d;return}else{dt[p>>2]=1154;dt[p+4>>2]=2499;dt[p+8>>2]=1516;br(h,1100,p)|0;yr(h,f)|0;vt=d;return}}function Ee(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0;a=t+92|0;i=dt[t+4>>2]|0;o=t+88|0;n=dt[o>>2]|0;e=(mt[n+68>>0]|0)<<8|(mt[n+67>>0]|0)<<16|(mt[n+69>>0]|0);r=i+e|0;n=(mt[n+65>>0]|0)<<8|(mt[n+66>>0]|0);if(!n){t=0;return t|0}dt[a>>2]=r;dt[t+96>>2]=r;dt[t+104>>2]=n;dt[t+100>>2]=i+(n+e);dt[t+108>>2]=0;dt[t+112>>2]=0;if(!(de(a,t+116|0)|0)){t=0;return t|0}e=dt[o>>2]|0;do{if(!((mt[e+39>>0]|0)<<8|(mt[e+40>>0]|0))){if(!((mt[e+55>>0]|0)<<8|(mt[e+56>>0]|0))){t=0;return t|0}}else{if(!(de(a,t+140|0)|0)){t=0;return t|0}if(de(a,t+188|0)|0){e=dt[o>>2]|0;break}else{t=0;return t|0}}}while(0);if((mt[e+55>>0]|0)<<8|(mt[e+56>>0]|0)){if(!(de(a,t+164|0)|0)){t=0;return t|0}if(!(de(a,t+212|0)|0)){t=0;return t|0}}t=1;return t|0}function Ce(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0;d=vt;vt=vt+592|0;l=d+16|0;s=d;a=d+72|0;p=d+24|0;i=t+88|0;e=dt[i>>2]|0;f=(mt[e+39>>0]|0)<<8|(mt[e+40>>0]|0);h=t+236|0;o=t+240|0;r=dt[o>>2]|0;if((r|0)!=(f|0)){if(r>>>0<=f>>>0){do{if((dt[t+244>>2]|0)>>>0>>0){if(ne(h,f,(r+1|0)==(f|0),4,0)|0){e=dt[o>>2]|0;break}pt[t+248>>0]=1;p=0;vt=d;return p|0}else e=r}while(0);Yr((dt[h>>2]|0)+(e<<2)|0,0,f-e<<2|0)|0;e=dt[i>>2]|0}dt[o>>2]=f}u=t+92|0;r=dt[t+4>>2]|0;i=(mt[e+34>>0]|0)<<8|(mt[e+33>>0]|0)<<16|(mt[e+35>>0]|0);n=r+i|0;e=(mt[e+37>>0]|0)<<8|(mt[e+36>>0]|0)<<16|(mt[e+38>>0]|0);if(!e){p=0;vt=d;return p|0}dt[u>>2]=n;dt[t+96>>2]=n;dt[t+104>>2]=e;dt[t+100>>2]=r+(e+i);dt[t+108>>2]=0;dt[t+112>>2]=0;dt[p+20>>2]=0;dt[p>>2]=0;dt[p+4>>2]=0;dt[p+8>>2]=0;dt[p+12>>2]=0;pt[p+16>>0]=0;t=p+24|0;dt[p+44>>2]=0;dt[t>>2]=0;dt[t+4>>2]=0;dt[t+8>>2]=0;dt[t+12>>2]=0;pt[t+16>>0]=0;if(de(u,p)|0?(c=p+24|0,de(u,c)|0):0){if(!(dt[o>>2]|0)){dt[s>>2]=1154;dt[s+4>>2]=903;dt[s+8>>2]=1781;br(a,1100,s)|0;yr(a,l)|0}if(!f)e=1;else{i=0;n=0;o=0;e=0;a=0;t=0;s=0;r=dt[h>>2]|0;while(1){i=(ge(u,p)|0)+i&31;n=(ge(u,c)|0)+n&63;o=(ge(u,p)|0)+o&31;e=(ge(u,p)|0)+e|0;a=(ge(u,c)|0)+a&63;t=(ge(u,p)|0)+t&31;dt[r>>2]=n<<5|i<<11|o|e<<27|a<<21|t<<16;s=s+1|0;if((s|0)==(f|0)){e=1;break}else{e=e&31;r=r+4|0}}}}else e=0;ce(p+24|0);ce(p);p=e;vt=d;return p|0}function Ae(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,E=0;S=vt;vt=vt+1024|0;s=S+16|0;a=S;o=S+504|0;k=S+480|0;w=S+284|0;T=S+88|0;x=S+24|0;n=dt[t+88>>2]|0;b=(mt[n+47>>0]|0)<<8|(mt[n+48>>0]|0);y=t+92|0;e=dt[t+4>>2]|0;r=(mt[n+42>>0]|0)<<8|(mt[n+41>>0]|0)<<16|(mt[n+43>>0]|0);i=e+r|0;n=(mt[n+45>>0]|0)<<8|(mt[n+44>>0]|0)<<16|(mt[n+46>>0]|0);if(!n){k=0;vt=S;return k|0}dt[y>>2]=i;dt[t+96>>2]=i;dt[t+104>>2]=n;dt[t+100>>2]=e+(n+r);dt[t+108>>2]=0;dt[t+112>>2]=0;dt[k+20>>2]=0;dt[k>>2]=0;dt[k+4>>2]=0;dt[k+8>>2]=0;dt[k+12>>2]=0;pt[k+16>>0]=0;if(de(y,k)|0){r=0;i=-3;n=-3;while(1){dt[w+(r<<2)>>2]=i;dt[T+(r<<2)>>2]=n;e=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=e?-3:i+1|0;n=(e&1)+n|0}}e=x;r=e+64|0;do{dt[e>>2]=0;e=e+4|0}while((e|0)<(r|0));_=t+252|0;r=t+256|0;e=dt[r>>2]|0;t:do{if((e|0)==(b|0))l=13;else{if(e>>>0<=b>>>0){do{if((dt[t+260>>2]|0)>>>0>>0)if(ne(_,b,(e+1|0)==(b|0),4,0)|0){e=dt[r>>2]|0;break}else{pt[t+264>>0]=1;e=0;break t}}while(0);Yr((dt[_>>2]|0)+(e<<2)|0,0,b-e<<2|0)|0}dt[r>>2]=b;l=13}}while(0);do{if((l|0)==13){if(!b){dt[a>>2]=1154;dt[a+4>>2]=903;dt[a+8>>2]=1781;br(o,1100,a)|0;yr(o,s)|0;e=1;break}i=x+4|0;n=x+8|0;t=x+12|0;o=x+16|0;a=x+20|0;s=x+24|0;l=x+28|0;u=x+32|0;h=x+36|0;c=x+40|0;f=x+44|0;p=x+48|0;d=x+52|0;m=x+56|0;g=x+60|0;v=0;r=dt[_>>2]|0;while(1){e=0;do{P=ge(y,k)|0;_=e<<1;E=x+(_<<2)|0;dt[E>>2]=(dt[E>>2]|0)+(dt[w+(P<<2)>>2]|0)&3;_=x+((_|1)<<2)|0;dt[_>>2]=(dt[_>>2]|0)+(dt[T+(P<<2)>>2]|0)&3;e=e+1|0}while((e|0)!=8);dt[r>>2]=(mt[1725+(dt[i>>2]|0)>>0]|0)<<2|(mt[1725+(dt[x>>2]|0)>>0]|0)|(mt[1725+(dt[n>>2]|0)>>0]|0)<<4|(mt[1725+(dt[t>>2]|0)>>0]|0)<<6|(mt[1725+(dt[o>>2]|0)>>0]|0)<<8|(mt[1725+(dt[a>>2]|0)>>0]|0)<<10|(mt[1725+(dt[s>>2]|0)>>0]|0)<<12|(mt[1725+(dt[l>>2]|0)>>0]|0)<<14|(mt[1725+(dt[u>>2]|0)>>0]|0)<<16|(mt[1725+(dt[h>>2]|0)>>0]|0)<<18|(mt[1725+(dt[c>>2]|0)>>0]|0)<<20|(mt[1725+(dt[f>>2]|0)>>0]|0)<<22|(mt[1725+(dt[p>>2]|0)>>0]|0)<<24|(mt[1725+(dt[d>>2]|0)>>0]|0)<<26|(mt[1725+(dt[m>>2]|0)>>0]|0)<<28|(mt[1725+(dt[g>>2]|0)>>0]|0)<<30;v=v+1|0;if((v|0)==(b|0)){e=1;break}else r=r+4|0}}}while(0)}else e=0;ce(k);E=e;vt=S;return E|0}function Ie(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0;f=vt;vt=vt+560|0;l=f+16|0;s=f;a=f+48|0;c=f+24|0;n=dt[t+88>>2]|0;h=(mt[n+55>>0]|0)<<8|(mt[n+56>>0]|0);u=t+92|0;e=dt[t+4>>2]|0;r=(mt[n+50>>0]|0)<<8|(mt[n+49>>0]|0)<<16|(mt[n+51>>0]|0);i=e+r|0;n=(mt[n+53>>0]|0)<<8|(mt[n+52>>0]|0)<<16|(mt[n+54>>0]|0);if(!n){c=0;vt=f;return c|0}dt[u>>2]=i;dt[t+96>>2]=i;dt[t+104>>2]=n;dt[t+100>>2]=e+(n+r);dt[t+108>>2]=0;dt[t+112>>2]=0;dt[c+20>>2]=0;dt[c>>2]=0;dt[c+4>>2]=0;dt[c+8>>2]=0;dt[c+12>>2]=0;pt[c+16>>0]=0;t:do{if(de(u,c)|0){o=t+268|0;r=t+272|0;e=dt[r>>2]|0;if((e|0)!=(h|0)){if(e>>>0<=h>>>0){do{if((dt[t+276>>2]|0)>>>0>>0)if(ne(o,h,(e+1|0)==(h|0),2,0)|0){e=dt[r>>2]|0;break}else{pt[t+280>>0]=1;e=0;break t}}while(0);Yr((dt[o>>2]|0)+(e<<1)|0,0,h-e<<1|0)|0}dt[r>>2]=h}if(!h){dt[s>>2]=1154;dt[s+4>>2]=903;dt[s+8>>2]=1781;br(a,1100,s)|0;yr(a,l)|0;e=1;break}r=0;i=0;n=0;e=dt[o>>2]|0;while(1){l=ge(u,c)|0;r=l+r&255;i=(ge(u,c)|0)+i&255;$[e>>1]=i<<8|r;n=n+1|0;if((n|0)==(h|0)){e=1;break}else e=e+2|0}}else e=0}while(0);ce(c);c=e;vt=f;return c|0}function Oe(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,E=0;S=vt;vt=vt+2432|0;s=S+16|0;a=S;o=S+1912|0;k=S+1888|0;w=S+988|0;T=S+88|0;x=S+24|0;n=dt[t+88>>2]|0;b=(mt[n+63>>0]|0)<<8|(mt[n+64>>0]|0);y=t+92|0;e=dt[t+4>>2]|0;r=(mt[n+58>>0]|0)<<8|(mt[n+57>>0]|0)<<16|(mt[n+59>>0]|0);i=e+r|0;n=(mt[n+61>>0]|0)<<8|(mt[n+60>>0]|0)<<16|(mt[n+62>>0]|0);if(!n){k=0;vt=S;return k|0}dt[y>>2]=i;dt[t+96>>2]=i;dt[t+104>>2]=n;dt[t+100>>2]=e+(n+r);dt[t+108>>2]=0;dt[t+112>>2]=0;dt[k+20>>2]=0;dt[k>>2]=0;dt[k+4>>2]=0;dt[k+8>>2]=0;dt[k+12>>2]=0;pt[k+16>>0]=0;if(de(y,k)|0){r=0;i=-7;n=-7;while(1){dt[w+(r<<2)>>2]=i;dt[T+(r<<2)>>2]=n;e=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=e?-7:i+1|0;n=(e&1)+n|0}}e=x;r=e+64|0;do{dt[e>>2]=0;e=e+4|0}while((e|0)<(r|0));_=t+284|0;r=b*3|0;i=t+288|0;e=dt[i>>2]|0;t:do{if((e|0)==(r|0))l=13;else{if(e>>>0<=r>>>0){do{if((dt[t+292>>2]|0)>>>0>>0)if(ne(_,r,(e+1|0)==(r|0),2,0)|0){e=dt[i>>2]|0;break}else{pt[t+296>>0]=1;e=0;break t}}while(0);Yr((dt[_>>2]|0)+(e<<1)|0,0,r-e<<1|0)|0}dt[i>>2]=r;l=13}}while(0);do{if((l|0)==13){if(!b){dt[a>>2]=1154;dt[a+4>>2]=903;dt[a+8>>2]=1781;br(o,1100,a)|0;yr(o,s)|0;e=1;break}i=x+4|0;n=x+8|0;t=x+12|0;o=x+16|0;a=x+20|0;s=x+24|0;l=x+28|0;u=x+32|0;h=x+36|0;c=x+40|0;f=x+44|0;p=x+48|0;d=x+52|0;m=x+56|0;g=x+60|0;v=0;r=dt[_>>2]|0;while(1){e=0;do{P=ge(y,k)|0;_=e<<1;E=x+(_<<2)|0;dt[E>>2]=(dt[E>>2]|0)+(dt[w+(P<<2)>>2]|0)&7;_=x+((_|1)<<2)|0;dt[_>>2]=(dt[_>>2]|0)+(dt[T+(P<<2)>>2]|0)&7;e=e+1|0}while((e|0)!=8);P=mt[1729+(dt[a>>2]|0)>>0]|0;$[r>>1]=(mt[1729+(dt[i>>2]|0)>>0]|0)<<3|(mt[1729+(dt[x>>2]|0)>>0]|0)|(mt[1729+(dt[n>>2]|0)>>0]|0)<<6|(mt[1729+(dt[t>>2]|0)>>0]|0)<<9|(mt[1729+(dt[o>>2]|0)>>0]|0)<<12|P<<15;E=mt[1729+(dt[c>>2]|0)>>0]|0;$[r+2>>1]=(mt[1729+(dt[s>>2]|0)>>0]|0)<<2|P>>>1|(mt[1729+(dt[l>>2]|0)>>0]|0)<<5|(mt[1729+(dt[u>>2]|0)>>0]|0)<<8|(mt[1729+(dt[h>>2]|0)>>0]|0)<<11|E<<14;$[r+4>>1]=(mt[1729+(dt[f>>2]|0)>>0]|0)<<1|E>>>2|(mt[1729+(dt[p>>2]|0)>>0]|0)<<4|(mt[1729+(dt[d>>2]|0)>>0]|0)<<7|(mt[1729+(dt[m>>2]|0)>>0]|0)<<10|(mt[1729+(dt[g>>2]|0)>>0]|0)<<13;v=v+1|0;if((v|0)==(b|0)){e=1;break}else r=r+6|0}}}while(0)}else e=0;ce(k);E=e;vt=S;return E|0}function Me(t,e,r,i,n,o,a,s){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,E=0,C=0,A=0,I=0,O=0,M=0,D=0,R=0,z=0,F=0,L=0,j=0,N=0,B=0,U=0,X=0,H=0,W=0,q=0,G=0,V=0,Y=0,Z=0,J=0,K=0,Q=0,$=0,tt=0,et=0,rt=0,it=0,nt=0,ot=0,at=0,st=0,lt=0,ut=0,ht=0,ct=0,ft=0;ht=vt;vt=vt+720|0;ut=ht+184|0;st=ht+168|0;at=ht+160|0;ot=ht+144|0;nt=ht+136|0;it=ht+120|0;rt=ht+112|0;tt=ht+96|0;$=ht+88|0;Q=ht+72|0;K=ht+64|0;J=ht+48|0;Z=ht+40|0;lt=ht+24|0;et=ht+16|0;Y=ht;G=ht+208|0;V=ht+192|0;N=t+240|0;B=dt[N>>2]|0;H=t+256|0;W=dt[H>>2]|0;r=pt[(dt[t+88>>2]|0)+17>>0]|0;q=i>>>2;if(!(r<<24>>24)){vt=ht;return 1}U=(s|0)==0;X=s+-1|0;M=(o&1|0)!=0;D=i<<1;R=t+92|0;z=t+116|0;F=t+140|0;L=t+236|0;j=a+-1|0;O=(n&1|0)!=0;I=t+188|0;S=t+252|0;P=q+1|0;E=q+2|0;C=q+3|0;A=j<<4;T=r&255;r=0;o=0;n=1;k=0;do{if(!U){x=dt[e+(k<<2)>>2]|0;w=0;while(1){_=w&1;l=(_|0)==0;v=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;b=l?a:-1;u=l?0:j;t=(w|0)==(X|0);y=M&t;if((u|0)!=(b|0)){g=M&t^1;m=l?x:x+A|0;while(1){if((n|0)==1)n=ge(R,z)|0|512;d=n&7;n=n>>>3;l=mt[1823+d>>0]|0;t=0;do{f=(ge(R,F)|0)+o|0;p=f-B|0;o=p>>31;o=o&f|p&~o;if((dt[N>>2]|0)>>>0<=o>>>0){dt[Y>>2]=1154;dt[Y+4>>2]=903;dt[Y+8>>2]=1781;br(G,1100,Y)|0;yr(G,et)|0}dt[V+(t<<2)>>2]=dt[(dt[L>>2]|0)+(o<<2)>>2];t=t+1|0}while(t>>>0>>0);p=O&(u|0)==(j|0);if(y|p){f=0;do{h=_t(f,i)|0;t=m+h|0;l=(f|0)==0|g;c=f<<1;ft=(ge(R,I)|0)+r|0;ct=ft-W|0;r=ct>>31;r=r&ft|ct&~r;do{if(p){if(!l){ct=(ge(R,I)|0)+r|0;ft=ct-W|0;r=ft>>31;r=r&ct|ft&~r;break}dt[t>>2]=dt[V+((mt[1831+(d<<2)+c>>0]|0)<<2)>>2];if((dt[H>>2]|0)>>>0<=r>>>0){dt[ot>>2]=1154;dt[ot+4>>2]=903;dt[ot+8>>2]=1781;br(G,1100,ot)|0;yr(G,at)|0}dt[m+(h+4)>>2]=dt[(dt[S>>2]|0)+(r<<2)>>2];ct=(ge(R,I)|0)+r|0;ft=ct-W|0;r=ft>>31;r=r&ct|ft&~r}else{if(!l){ct=(ge(R,I)|0)+r|0;ft=ct-W|0;r=ft>>31;r=r&ct|ft&~r;break}dt[t>>2]=dt[V+((mt[1831+(d<<2)+c>>0]|0)<<2)>>2];if((dt[H>>2]|0)>>>0<=r>>>0){dt[it>>2]=1154;dt[it+4>>2]=903;dt[it+8>>2]=1781;br(G,1100,it)|0;yr(G,nt)|0}dt[m+(h+4)>>2]=dt[(dt[S>>2]|0)+(r<<2)>>2];ct=(ge(R,I)|0)+r|0;ft=ct-W|0;r=ft>>31;r=r&ct|ft&~r;dt[m+(h+8)>>2]=dt[V+((mt[(c|1)+(1831+(d<<2))>>0]|0)<<2)>>2];if((dt[H>>2]|0)>>>0<=r>>>0){dt[st>>2]=1154;dt[st+4>>2]=903;dt[st+8>>2]=1781;br(G,1100,st)|0;yr(G,ut)|0}dt[m+(h+12)>>2]=dt[(dt[S>>2]|0)+(r<<2)>>2]}}while(0);f=f+1|0}while((f|0)!=2)}else{dt[m>>2]=dt[V+((mt[1831+(d<<2)>>0]|0)<<2)>>2];ct=(ge(R,I)|0)+r|0;ft=ct-W|0;r=ft>>31;r=r&ct|ft&~r;if((dt[H>>2]|0)>>>0<=r>>>0){dt[lt>>2]=1154;dt[lt+4>>2]=903;dt[lt+8>>2]=1781;br(G,1100,lt)|0;yr(G,Z)|0}dt[m+4>>2]=dt[(dt[S>>2]|0)+(r<<2)>>2];dt[m+8>>2]=dt[V+((mt[1831+(d<<2)+1>>0]|0)<<2)>>2];ct=(ge(R,I)|0)+r|0;ft=ct-W|0;r=ft>>31;r=r&ct|ft&~r;if((dt[H>>2]|0)>>>0<=r>>>0){dt[J>>2]=1154;dt[J+4>>2]=903;dt[J+8>>2]=1781;br(G,1100,J)|0;yr(G,K)|0}dt[m+12>>2]=dt[(dt[S>>2]|0)+(r<<2)>>2];dt[m+(q<<2)>>2]=dt[V+((mt[1831+(d<<2)+2>>0]|0)<<2)>>2];ct=(ge(R,I)|0)+r|0;ft=ct-W|0;r=ft>>31;r=r&ct|ft&~r;if((dt[H>>2]|0)>>>0<=r>>>0){dt[Q>>2]=1154;dt[Q+4>>2]=903;dt[Q+8>>2]=1781;br(G,1100,Q)|0;yr(G,$)|0}dt[m+(P<<2)>>2]=dt[(dt[S>>2]|0)+(r<<2)>>2];dt[m+(E<<2)>>2]=dt[V+((mt[1831+(d<<2)+3>>0]|0)<<2)>>2];ct=(ge(R,I)|0)+r|0;ft=ct-W|0;r=ft>>31;r=r&ct|ft&~r;if((dt[H>>2]|0)>>>0<=r>>>0){dt[tt>>2]=1154;dt[tt+4>>2]=903;dt[tt+8>>2]=1781;br(G,1100,tt)|0;yr(G,rt)|0}dt[m+(C<<2)>>2]=dt[(dt[S>>2]|0)+(r<<2)>>2]}u=u+_|0;if((u|0)==(b|0))break;else m=m+v|0}}w=w+1|0;if((w|0)==(s|0))break;else x=x+D|0}}k=k+1|0}while((k|0)!=(T|0));vt=ht;return 1}function De(t,e,r,i,n,o,a,s){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,E=0,C=0,A=0,I=0,O=0,M=0,D=0,R=0,z=0,F=0,L=0,j=0,N=0,B=0,U=0,X=0,H=0,W=0,q=0,G=0,V=0,Y=0,Z=0,J=0,K=0,Q=0,$=0,tt=0,et=0,rt=0,it=0,nt=0,ot=0,at=0,st=0,lt=0,ut=0,ht=0,ct=0,ft=0;ct=vt;vt=vt+640|0;lt=ct+88|0;st=ct+72|0;at=ct+64|0;ot=ct+48|0;nt=ct+40|0;ht=ct+24|0;ut=ct+16|0;it=ct;et=ct+128|0;rt=ct+112|0;tt=ct+96|0;N=t+240|0;B=dt[N>>2]|0;H=t+256|0;K=dt[H>>2]|0;Q=t+272|0;$=dt[Q>>2]|0;r=dt[t+88>>2]|0;U=(mt[r+63>>0]|0)<<8|(mt[r+64>>0]|0);r=pt[r+17>>0]|0;if(!(r<<24>>24)){vt=ct;return 1}X=(s|0)==0;W=s+-1|0;q=i<<1;G=t+92|0;V=t+116|0;Y=a+-1|0;Z=t+212|0;J=t+188|0;j=(n&1|0)==0;L=(o&1|0)==0;O=t+288|0;M=t+284|0;D=t+252|0;R=t+140|0;z=t+236|0;F=t+164|0;A=t+268|0;I=Y<<5;E=r&255;r=0;n=0;o=0;t=0;l=1;C=0;do{if(!X){S=dt[e+(C<<2)>>2]|0;P=0;while(1){T=P&1;u=(T|0)==0;w=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;k=u?a:-1;h=u?0:Y;if((h|0)!=(k|0)){x=L|(P|0)!=(W|0);b=u?S:S+I|0;while(1){if((l|0)==1)l=ge(G,V)|0|512;y=l&7;l=l>>>3;c=mt[1823+y>>0]|0;u=0;do{v=(ge(G,F)|0)+n|0;_=v-$|0;n=_>>31;n=n&v|_&~n;if((dt[Q>>2]|0)>>>0<=n>>>0){dt[it>>2]=1154;dt[it+4>>2]=903;dt[it+8>>2]=1781;br(et,1100,it)|0;yr(et,ut)|0}dt[tt+(u<<2)>>2]=gt[(dt[A>>2]|0)+(n<<1)>>1];u=u+1|0}while(u>>>0>>0);u=0;do{v=(ge(G,R)|0)+t|0;_=v-B|0;t=_>>31;t=t&v|_&~t;if((dt[N>>2]|0)>>>0<=t>>>0){dt[ht>>2]=1154;dt[ht+4>>2]=903;dt[ht+8>>2]=1781;br(et,1100,ht)|0;yr(et,nt)|0}dt[rt+(u<<2)>>2]=dt[(dt[z>>2]|0)+(t<<2)>>2];u=u+1|0}while(u>>>0>>0);_=j|(h|0)!=(Y|0);g=0;v=b;while(1){m=x|(g|0)==0;d=g<<1;f=0;p=v;while(1){c=(ge(G,Z)|0)+r|0;u=c-U|0;r=u>>31;r=r&c|u&~r;u=(ge(G,J)|0)+o|0;c=u-K|0;o=c>>31;o=o&u|c&~o;if((_|(f|0)==0)&m){u=mt[f+d+(1831+(y<<2))>>0]|0;c=r*3|0;if((dt[O>>2]|0)>>>0<=c>>>0){dt[ot>>2]=1154;dt[ot+4>>2]=903;dt[ot+8>>2]=1781;br(et,1100,ot)|0;yr(et,at)|0}ft=dt[M>>2]|0;dt[p>>2]=(gt[ft+(c<<1)>>1]|0)<<16|dt[tt+(u<<2)>>2];dt[p+4>>2]=(gt[ft+(c+2<<1)>>1]|0)<<16|(gt[ft+(c+1<<1)>>1]|0);dt[p+8>>2]=dt[rt+(u<<2)>>2];if((dt[H>>2]|0)>>>0<=o>>>0){dt[st>>2]=1154;dt[st+4>>2]=903;dt[st+8>>2]=1781;br(et,1100,st)|0;yr(et,lt)|0}dt[p+12>>2]=dt[(dt[D>>2]|0)+(o<<2)>>2]}f=f+1|0;if((f|0)==2)break;else p=p+16|0}g=g+1|0;if((g|0)==2)break;else v=v+i|0}h=h+T|0;if((h|0)==(k|0))break;else b=b+w|0}}P=P+1|0;if((P|0)==(s|0))break;else S=S+q|0}}C=C+1|0}while((C|0)!=(E|0));vt=ct;return 1}function Re(t,e,r,i,n,o,a,s){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,E=0,C=0,A=0,I=0,O=0,M=0,D=0,R=0,z=0,F=0,L=0,j=0,N=0,B=0,U=0,X=0,H=0,W=0,q=0,G=0,V=0,Y=0,Z=0,J=0,K=0;K=vt;vt=vt+608|0;Y=K+64|0;V=K+48|0;G=K+40|0;J=K+24|0;Z=K+16|0;q=K;W=K+88|0;H=K+72|0;D=t+272|0;R=dt[D>>2]|0;r=dt[t+88>>2]|0;z=(mt[r+63>>0]|0)<<8|(mt[r+64>>0]|0);r=pt[r+17>>0]|0;if(!(r<<24>>24)){vt=K;return 1}F=(s|0)==0;L=s+-1|0;j=i<<1;N=t+92|0;B=t+116|0;U=a+-1|0;X=t+212|0;M=(o&1|0)==0;A=t+288|0;I=t+284|0;O=t+164|0;E=t+268|0;C=U<<4;P=r&255;S=(n&1|0)!=0;r=0;o=0;t=1;k=0;do{if(!F){w=dt[e+(k<<2)>>2]|0;T=0;while(1){b=T&1;n=(b|0)==0;y=(b<<5^32)+-16|0;b=(b<<1^2)+-1|0;x=n?a:-1;l=n?0:U;if((l|0)!=(x|0)){_=M|(T|0)!=(L|0);v=n?w:w+C|0;while(1){if((t|0)==1)t=ge(N,B)|0|512;g=t&7;t=t>>>3;u=mt[1823+g>>0]|0;n=0;do{d=(ge(N,O)|0)+o|0;m=d-R|0;o=m>>31;o=o&d|m&~o;if((dt[D>>2]|0)>>>0<=o>>>0){dt[q>>2]=1154;dt[q+4>>2]=903;dt[q+8>>2]=1781;br(W,1100,q)|0;yr(W,Z)|0}dt[H+(n<<2)>>2]=gt[(dt[E>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0>>0);m=(l|0)==(U|0)&S;p=0;d=v;while(1){f=_|(p|0)==0;c=p<<1;n=(ge(N,X)|0)+r|0;h=n-z|0;u=h>>31;u=u&n|h&~u;if(f){r=mt[1831+(g<<2)+c>>0]|0;n=u*3|0;if((dt[A>>2]|0)>>>0<=n>>>0){dt[J>>2]=1154;dt[J+4>>2]=903;dt[J+8>>2]=1781;br(W,1100,J)|0;yr(W,G)|0}h=dt[I>>2]|0;dt[d>>2]=(gt[h+(n<<1)>>1]|0)<<16|dt[H+(r<<2)>>2];dt[d+4>>2]=(gt[h+(n+2<<1)>>1]|0)<<16|(gt[h+(n+1<<1)>>1]|0)}h=d+8|0;n=(ge(N,X)|0)+u|0;u=n-z|0;r=u>>31;r=r&n|u&~r;if(!(m|f^1)){n=mt[(c|1)+(1831+(g<<2))>>0]|0;u=r*3|0;if((dt[A>>2]|0)>>>0<=u>>>0){dt[V>>2]=1154;dt[V+4>>2]=903;dt[V+8>>2]=1781;br(W,1100,V)|0;yr(W,Y)|0}f=dt[I>>2]|0;dt[h>>2]=(gt[f+(u<<1)>>1]|0)<<16|dt[H+(n<<2)>>2];dt[d+12>>2]=(gt[f+(u+2<<1)>>1]|0)<<16|(gt[f+(u+1<<1)>>1]|0)}p=p+1|0;if((p|0)==2)break;else d=d+i|0}l=l+b|0;if((l|0)==(x|0))break;else v=v+y|0}}T=T+1|0;if((T|0)==(s|0))break;else w=w+j|0}}k=k+1|0}while((k|0)!=(P|0));vt=K;return 1}function ze(t,e,r,i,n,o,a,s){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,E=0,C=0,A=0,I=0,O=0,M=0,D=0,R=0,z=0,F=0,L=0,j=0,N=0,B=0,U=0,X=0,H=0,W=0,q=0,G=0,V=0,Y=0,Z=0,J=0,K=0,Q=0,$=0,tt=0,et=0,rt=0,it=0,nt=0,ot=0,at=0;at=vt;vt=vt+640|0;it=at+88|0;rt=at+72|0;et=at+64|0;tt=at+48|0;$=at+40|0;ot=at+24|0;nt=at+16|0;Q=at;K=at+128|0;Z=at+112|0;J=at+96|0;N=t+272|0;B=dt[N>>2]|0;r=dt[t+88>>2]|0;U=(mt[r+63>>0]|0)<<8|(mt[r+64>>0]|0);r=pt[r+17>>0]|0;if(!(r<<24>>24)){vt=at;return 1}X=(s|0)==0;H=s+-1|0;W=i<<1;q=t+92|0;G=t+116|0;V=a+-1|0;Y=t+212|0;j=(n&1|0)==0;L=(o&1|0)==0;R=t+288|0;z=t+284|0;F=t+164|0;M=t+268|0;D=V<<5;I=r&255;r=0;n=0;o=0;t=0;l=1;O=0;do{if(!X){C=dt[e+(O<<2)>>2]|0;A=0;while(1){P=A&1;u=(P|0)==0;S=(P<<6^64)+-32|0;P=(P<<1^2)+-1|0;E=u?a:-1;h=u?0:V;if((h|0)!=(E|0)){k=L|(A|0)!=(H|0);T=u?C:C+D|0;while(1){if((l|0)==1)l=ge(q,G)|0|512;w=l&7;l=l>>>3;c=mt[1823+w>>0]|0;u=0;do{b=(ge(q,F)|0)+t|0;x=b-B|0;t=x>>31;t=t&b|x&~t;if((dt[N>>2]|0)>>>0<=t>>>0){dt[Q>>2]=1154;dt[Q+4>>2]=903;dt[Q+8>>2]=1781;br(K,1100,Q)|0;yr(K,nt)|0}dt[Z+(u<<2)>>2]=gt[(dt[M>>2]|0)+(t<<1)>>1];u=u+1|0}while(u>>>0>>0);u=0;do{b=(ge(q,F)|0)+n|0;x=b-B|0;n=x>>31;n=n&b|x&~n;if((dt[N>>2]|0)>>>0<=n>>>0){dt[ot>>2]=1154;dt[ot+4>>2]=903;dt[ot+8>>2]=1781;br(K,1100,ot)|0;yr(K,$)|0}dt[J+(u<<2)>>2]=gt[(dt[M>>2]|0)+(n<<1)>>1];u=u+1|0}while(u>>>0>>0);x=j|(h|0)!=(V|0);y=0;b=T;while(1){_=k|(y|0)==0;v=y<<1;m=0;g=b;while(1){d=(ge(q,Y)|0)+o|0;p=d-U|0;o=p>>31;o=o&d|p&~o;p=(ge(q,Y)|0)+r|0;d=p-U|0;r=d>>31;r=r&p|d&~r;if((x|(m|0)==0)&_){p=mt[m+v+(1831+(w<<2))>>0]|0;d=o*3|0;u=dt[R>>2]|0;if(u>>>0<=d>>>0){dt[tt>>2]=1154;dt[tt+4>>2]=903;dt[tt+8>>2]=1781;br(K,1100,tt)|0;yr(K,et)|0;u=dt[R>>2]|0}c=dt[z>>2]|0;f=r*3|0;if(u>>>0>f>>>0)u=c;else{dt[rt>>2]=1154;dt[rt+4>>2]=903;dt[rt+8>>2]=1781;br(K,1100,rt)|0;yr(K,it)|0;u=dt[z>>2]|0}dt[g>>2]=(gt[c+(d<<1)>>1]|0)<<16|dt[Z+(p<<2)>>2];dt[g+4>>2]=(gt[c+(d+2<<1)>>1]|0)<<16|(gt[c+(d+1<<1)>>1]|0);dt[g+8>>2]=(gt[u+(f<<1)>>1]|0)<<16|dt[J+(p<<2)>>2];dt[g+12>>2]=(gt[u+(f+2<<1)>>1]|0)<<16|(gt[u+(f+1<<1)>>1]|0)}m=m+1|0;if((m|0)==2)break;else g=g+16|0}y=y+1|0;if((y|0)==2)break;else b=b+i|0}h=h+P|0;if((h|0)==(E|0))break;else T=T+S|0}}A=A+1|0;if((A|0)==(s|0))break;else C=C+W|0}}O=O+1|0}while((O|0)!=(I|0));vt=at;return 1}function Fe(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0;f=vt;vt=vt+608|0;c=f+88|0;h=f+72|0;l=f+64|0;s=f+48|0;o=f+40|0;a=f+24|0;n=f+16|0;i=f;u=f+96|0;dt[t>>2]=0;e=t+284|0;r=dt[e>>2]|0;if(r){if(!(r&7))Di[dt[104>>2]&1](r,0,0,1,dt[27]|0)|0;else{dt[i>>2]=1154;dt[i+4>>2]=2499;dt[i+8>>2]=1516;br(u,1100,i)|0;yr(u,n)|0}dt[e>>2]=0;dt[t+288>>2]=0;dt[t+292>>2]=0}pt[t+296>>0]=0;e=t+268|0;r=dt[e>>2]|0;if(r){if(!(r&7))Di[dt[104>>2]&1](r,0,0,1,dt[27]|0)|0;else{dt[a>>2]=1154;dt[a+4>>2]=2499;dt[a+8>>2]=1516;br(u,1100,a)|0;yr(u,o)|0}dt[e>>2]=0;dt[t+272>>2]=0;dt[t+276>>2]=0}pt[t+280>>0]=0;e=t+252|0;r=dt[e>>2]|0;if(r){if(!(r&7))Di[dt[104>>2]&1](r,0,0,1,dt[27]|0)|0;else{dt[s>>2]=1154;dt[s+4>>2]=2499;dt[s+8>>2]=1516;br(u,1100,s)|0;yr(u,l)|0}dt[e>>2]=0;dt[t+256>>2]=0;dt[t+260>>2]=0}pt[t+264>>0]=0;e=t+236|0;r=dt[e>>2]|0;if(!r){c=t+248|0;pt[c>>0]=0;c=t+212|0;ce(c);c=t+188|0;ce(c);c=t+164|0;ce(c);c=t+140|0;ce(c);c=t+116|0;ce(c);vt=f;return}if(!(r&7))Di[dt[104>>2]&1](r,0,0,1,dt[27]|0)|0;else{dt[h>>2]=1154;dt[h+4>>2]=2499;dt[h+8>>2]=1516;br(u,1100,h)|0;yr(u,c)|0}dt[e>>2]=0;dt[t+240>>2]=0;dt[t+244>>2]=0;c=t+248|0;pt[c>>0]=0;c=t+212|0;ce(c);c=t+188|0;ce(c);c=t+164|0;ce(c);c=t+140|0;ce(c);c=t+116|0;ce(c);vt=f;return}function Le(t,e){t=t|0;e=e|0;var r=0;r=vt;vt=vt+16|0;dt[r>>2]=e;e=dt[63]|0;xr(e,t,r)|0;vr(10,e)|0;Xt()}function je(){var t=0,e=0;t=vt;vt=vt+16|0;if(!(Ft(200,2)|0)){e=Rt(dt[49]|0)|0;vt=t;return e|0}else Le(2090,t);return 0}function Ne(t){t=t|0;Ur(t);return}function Be(t){t=t|0;var e=0;e=vt;vt=vt+16|0;Oi[t&3]();Le(2139,e)}function Ue(){var t=0,e=0;t=je()|0;if(((t|0)!=0?(e=dt[t>>2]|0,(e|0)!=0):0)?(t=e+48|0,(dt[t>>2]&-256|0)==1126902528?(dt[t+4>>2]|0)==1129074247:0):0)Be(dt[e+12>>2]|0);e=dt[28]|0;dt[28]=e+0;Be(e)}function Xe(t){t=t|0;return}function He(t){t=t|0;return}function We(t){t=t|0;return}function qe(t){t=t|0;return}function Ge(t){t=t|0;Ne(t);return}function Ve(t){t=t|0;Ne(t);return}function Ye(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0,a=0;a=vt;vt=vt+64|0;o=a;if((t|0)!=(e|0))if((e|0)!=0?(n=Qe(e,24,40,0)|0,(n|0)!=0):0){e=o;i=e+56|0;do{dt[e>>2]=0;e=e+4|0}while((e|0)<(i|0));dt[o>>2]=n;dt[o+8>>2]=t;dt[o+12>>2]=-1;dt[o+48>>2]=1;Ri[dt[(dt[n>>2]|0)+28>>2]&3](n,o,dt[r>>2]|0,1);if((dt[o+24>>2]|0)==1){dt[r>>2]=dt[o+16>>2];e=1}else e=0}else e=0;else e=1;vt=a;return e|0}function Ze(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0;t=e+16|0;n=dt[t>>2]|0;do{if(n){if((n|0)!=(r|0)){i=e+36|0;dt[i>>2]=(dt[i>>2]|0)+1;dt[e+24>>2]=2;pt[e+54>>0]=1;break}t=e+24|0;if((dt[t>>2]|0)==2)dt[t>>2]=i}else{dt[t>>2]=r;dt[e+24>>2]=i;dt[e+36>>2]=1}}while(0);return}function Je(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;if((t|0)==(dt[e+8>>2]|0))Ze(0,e,r,i);return}function Ke(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;if((t|0)==(dt[e+8>>2]|0))Ze(0,e,r,i);else{t=dt[t+8>>2]|0;Ri[dt[(dt[t>>2]|0)+28>>2]&3](t,e,r,i)}return}function Qe(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0;p=vt;vt=vt+64|0;f=p;c=dt[t>>2]|0;h=t+(dt[c+-8>>2]|0)|0;c=dt[c+-4>>2]|0;dt[f>>2]=r;dt[f+4>>2]=t;dt[f+8>>2]=e;dt[f+12>>2]=i;i=f+16|0;t=f+20|0;e=f+24|0;n=f+28|0;o=f+32|0;a=f+40|0;s=(c|0)==(r|0);l=i;u=l+36|0;do{dt[l>>2]=0;l=l+4|0}while((l|0)<(u|0));$[i+36>>1]=0;pt[i+38>>0]=0;t:do{if(s){dt[f+48>>2]=1;Mi[dt[(dt[r>>2]|0)+20>>2]&3](r,f,h,h,1,0);i=(dt[e>>2]|0)==1?h:0}else{Ei[dt[(dt[c>>2]|0)+24>>2]&3](c,f,h,1,0);switch(dt[f+36>>2]|0){case 0:{i=(dt[a>>2]|0)==1&(dt[n>>2]|0)==1&(dt[o>>2]|0)==1?dt[t>>2]|0:0;break t}case 1:break;default:{i=0;break t}}if((dt[e>>2]|0)!=1?!((dt[a>>2]|0)==0&(dt[n>>2]|0)==1&(dt[o>>2]|0)==1):0){i=0;break}i=dt[i>>2]|0}}while(0);vt=p;return i|0}function $e(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;pt[e+53>>0]=1;do{if((dt[e+4>>2]|0)==(i|0)){pt[e+52>>0]=1;i=e+16|0;t=dt[i>>2]|0;if(!t){dt[i>>2]=r;dt[e+24>>2]=n;dt[e+36>>2]=1;if(!((n|0)==1?(dt[e+48>>2]|0)==1:0))break;pt[e+54>>0]=1;break}if((t|0)!=(r|0)){n=e+36|0;dt[n>>2]=(dt[n>>2]|0)+1;pt[e+54>>0]=1;break}t=e+24|0;i=dt[t>>2]|0;if((i|0)==2){dt[t>>2]=n;i=n}if((i|0)==1?(dt[e+48>>2]|0)==1:0)pt[e+54>>0]=1}}while(0);return}function tr(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0;t:do{if((t|0)==(dt[e+8>>2]|0)){if((dt[e+4>>2]|0)==(r|0)?(o=e+28|0,(dt[o>>2]|0)!=1):0)dt[o>>2]=i}else{if((t|0)!=(dt[e>>2]|0)){s=dt[t+8>>2]|0;Ei[dt[(dt[s>>2]|0)+24>>2]&3](s,e,r,i,n);break}if((dt[e+16>>2]|0)!=(r|0)?(a=e+20|0,(dt[a>>2]|0)!=(r|0)):0){dt[e+32>>2]=i;i=e+44|0;if((dt[i>>2]|0)==4)break;o=e+52|0;pt[o>>0]=0;l=e+53|0;pt[l>>0]=0;t=dt[t+8>>2]|0;Mi[dt[(dt[t>>2]|0)+20>>2]&3](t,e,r,r,1,n);if(pt[l>>0]|0){if(!(pt[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){dt[a>>2]=r;l=e+40|0;dt[l>>2]=(dt[l>>2]|0)+1;if((dt[e+36>>2]|0)==1?(dt[e+24>>2]|0)==2:0){pt[e+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;dt[i>>2]=4;break t}}while(0);dt[i>>2]=3;break}if((i|0)==1)dt[e+32>>2]=1}}while(0);return}function er(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((t|0)==(dt[e+8>>2]|0)){if((dt[e+4>>2]|0)==(r|0)?(a=e+28|0,(dt[a>>2]|0)!=1):0)dt[a>>2]=i}else if((t|0)==(dt[e>>2]|0)){if((dt[e+16>>2]|0)!=(r|0)?(o=e+20|0,(dt[o>>2]|0)!=(r|0)):0){dt[e+32>>2]=i;dt[o>>2]=r;n=e+40|0;dt[n>>2]=(dt[n>>2]|0)+1;if((dt[e+36>>2]|0)==1?(dt[e+24>>2]|0)==2:0)pt[e+54>>0]=1;dt[e+44>>2]=4;break}if((i|0)==1)dt[e+32>>2]=1}}while(0);return}function rr(t,e,r,i,n,o){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;if((t|0)==(dt[e+8>>2]|0))$e(0,e,r,i,n);else{t=dt[t+8>>2]|0;Mi[dt[(dt[t>>2]|0)+20>>2]&3](t,e,r,i,n,o)}return}function ir(t,e,r,i,n,o){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;if((t|0)==(dt[e+8>>2]|0))$e(0,e,r,i,n);return}function nr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0;n=vt;vt=vt+16|0;i=n;dt[i>>2]=dt[r>>2];t=Pi[dt[(dt[t>>2]|0)+16>>2]&7](t,e,i)|0;if(t)dt[r>>2]=dt[i>>2];vt=n;return t&1|0}function or(t){t=t|0;if(!t)t=0;else t=(Qe(t,24,72,0)|0)!=0;return t&1|0}function ar(){var t=0,e=0,r=0,i=0,n=0,o=0,a=0,s=0;n=vt;vt=vt+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;t=je()|0;if((t|0)!=0?(i=dt[t>>2]|0,(i|0)!=0):0){t=i+48|0;e=dt[t>>2]|0;t=dt[t+4>>2]|0;if(!((e&-256|0)==1126902528&(t|0)==1129074247)){dt[r>>2]=dt[51];Le(2368,r)}if((e|0)==1126902529&(t|0)==1129074247)t=dt[i+44>>2]|0;else t=i+80|0;dt[n>>2]=t;i=dt[i>>2]|0;t=dt[i+4>>2]|0;if(Pi[dt[(dt[8>>2]|0)+16>>2]&7](8,i,n)|0){s=dt[n>>2]|0;n=dt[51]|0;s=Ai[dt[(dt[s>>2]|0)+8>>2]&1](s)|0;dt[o>>2]=n;dt[o+4>>2]=t;dt[o+8>>2]=s;Le(2282,o)}else{dt[s>>2]=dt[51];dt[s+4>>2]=t;Le(2327,s)}}Le(2406,a)}function sr(){var t=0;t=vt;vt=vt+16|0;if(!(Lt(196,6)|0)){vt=t;return}else Le(2179,t)}function lr(t){t=t|0;var e=0;e=vt;vt=vt+16|0;Ur(t);if(!(Bt(dt[49]|0,0)|0)){vt=e;return}else Le(2229,e)}function ur(t){t=t|0;var e=0,r=0;e=0;while(1){if((mt[2427+e>>0]|0)==(t|0)){r=2;break}e=e+1|0;if((e|0)==87){e=87;t=2515;r=5;break}}if((r|0)==2)if(!e)t=2515;else{t=2515;r=5}if((r|0)==5)while(1){r=t;while(1){t=r+1|0;if(!(pt[r>>0]|0))break;else r=t}e=e+-1|0;if(!e)break;else r=5}return t|0}function hr(){var t=0;if(!(dt[52]|0))t=264;else{t=(zt()|0)+60|0;t=dt[t>>2]|0}return t|0}function cr(t){t=t|0;var e=0;if(t>>>0>4294963200){e=hr()|0;dt[e>>2]=0-t;t=-1}return t|0}function fr(t,e){t=+t;e=e|0;var r=0,i=0,n=0;tt[et>>3]=t;r=dt[et>>2]|0;i=dt[et+4>>2]|0;n=Zr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(t!=0.0){t=+fr(t*18446744073709552.0e3,e);r=(dt[e>>2]|0)+-64|0}else r=0;dt[e>>2]=r;break}case 2047:break;default:{dt[e>>2]=n+-1022;dt[et>>2]=r;dt[et+4>>2]=i&-2146435073|1071644672;t=+tt[et>>3]}}return+t}function pr(t,e){t=+t;e=e|0;return+ +fr(t,e)}function dr(t,e,r){t=t|0;e=e|0;r=r|0;do{if(t){if(e>>>0<128){pt[t>>0]=e;t=1;break}if(e>>>0<2048){pt[t>>0]=e>>>6|192;pt[t+1>>0]=e&63|128;t=2;break}if(e>>>0<55296|(e&-8192|0)==57344){pt[t>>0]=e>>>12|224;pt[t+1>>0]=e>>>6&63|128;pt[t+2>>0]=e&63|128;t=3;break}if((e+-65536|0)>>>0<1048576){pt[t>>0]=e>>>18|240;pt[t+1>>0]=e>>>12&63|128;pt[t+2>>0]=e>>>6&63|128;pt[t+3>>0]=e&63|128;t=4;break}else{t=hr()|0;dt[t>>2]=84;t=-1;break}}else t=1}while(0);return t|0}function mr(t,e){t=t|0;e=e|0;if(!t)t=0;else t=dr(t,e,0)|0;return t|0}function gr(t){t=t|0;var e=0,r=0;do{if(t){if((dt[t+76>>2]|0)<=-1){e=Dr(t)|0;break}r=(kr(t)|0)==0;e=Dr(t)|0;if(!r)Sr(t)}else{if(!(dt[65]|0))e=0;else e=gr(dt[65]|0)|0;Ut(236);t=dt[58]|0;if(t)do{if((dt[t+76>>2]|0)>-1)r=kr(t)|0;else r=0;if((dt[t+20>>2]|0)>>>0>(dt[t+28>>2]|0)>>>0)e=Dr(t)|0|e;if(r)Sr(t);t=dt[t+56>>2]|0}while((t|0)!=0);jt(236)}}while(0);return e|0}function vr(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0;if((dt[e+76>>2]|0)>=0?(kr(e)|0)!=0:0){if((pt[e+75>>0]|0)!=(t|0)?(i=e+20|0,n=dt[i>>2]|0,n>>>0<(dt[e+16>>2]|0)>>>0):0){dt[i>>2]=n+1;pt[n>>0]=t;r=t&255}else r=Pr(e,t)|0;Sr(e)}else a=3;do{if((a|0)==3){if((pt[e+75>>0]|0)!=(t|0)?(o=e+20|0,r=dt[o>>2]|0,r>>>0<(dt[e+16>>2]|0)>>>0):0){dt[o>>2]=r+1;pt[r>>0]=t;r=t&255;break}r=Pr(e,t)|0}}while(0);return r|0}function _r(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=dt[i>>2]|0;if(!n)if(!(Or(r)|0)){n=dt[i>>2]|0;o=4}else i=0;else o=4;t:do{if((o|0)==4){a=r+20|0;o=dt[a>>2]|0;if((n-o|0)>>>0>>0){i=Pi[dt[r+36>>2]&7](r,t,e)|0;break}e:do{if((pt[r+75>>0]|0)>-1){i=e;while(1){if(!i){n=o;i=0;break e}n=i+-1|0;if((pt[t+n>>0]|0)==10)break;else i=n}if((Pi[dt[r+36>>2]&7](r,t,i)|0)>>>0>>0)break t;e=e-i|0;t=t+i|0;n=dt[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,t|0,e|0)|0;dt[a>>2]=(dt[a>>2]|0)+e;i=i+e|0}}while(0);return i|0}function yr(t,e){t=t|0;e=e|0;var r=0,i=0;r=vt;vt=vt+16|0;i=r;dt[i>>2]=e;e=xr(dt[64]|0,t,i)|0;vt=r;return e|0}function br(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0;i=vt;vt=vt+16|0;n=i;dt[n>>2]=r;r=Tr(t,e,n)|0;vt=i;return r|0}function xr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0;m=vt;vt=vt+224|0;c=m+120|0;d=m+80|0;p=m;f=m+136|0;i=d;n=i+40|0;do{dt[i>>2]=0;i=i+4|0}while((i|0)<(n|0));dt[c>>2]=dt[r>>2];if((Rr(0,e,c,p,d)|0)<0)r=-1;else{if((dt[t+76>>2]|0)>-1)u=kr(t)|0;else u=0;r=dt[t>>2]|0;h=r&32;if((pt[t+74>>0]|0)<1)dt[t>>2]=r&-33;r=t+48|0;if(!(dt[r>>2]|0)){n=t+44|0;o=dt[n>>2]|0;dt[n>>2]=f;a=t+28|0;dt[a>>2]=f;s=t+20|0;dt[s>>2]=f;dt[r>>2]=80;l=t+16|0;dt[l>>2]=f+80;i=Rr(t,e,c,p,d)|0;if(o){Pi[dt[t+36>>2]&7](t,0,0)|0;i=(dt[s>>2]|0)==0?-1:i;dt[n>>2]=o;dt[r>>2]=0;dt[l>>2]=0;dt[a>>2]=0;dt[s>>2]=0}}else i=Rr(t,e,c,p,d)|0;r=dt[t>>2]|0;dt[t>>2]=r|h;if(u)Sr(t);r=(r&32|0)==0?i:-1}vt=m;return r|0}function wr(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0,h=0;h=vt;vt=vt+128|0;n=h+112|0;u=h;o=u;a=268;s=o+112|0;do{dt[o>>2]=dt[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((e+-1|0)>>>0>2147483646)if(!e){e=1;l=4}else{e=hr()|0;dt[e>>2]=75;e=-1}else{n=t;l=4}if((l|0)==4){l=-2-n|0;l=e>>>0>l>>>0?l:e;dt[u+48>>2]=l;t=u+20|0;dt[t>>2]=n;dt[u+44>>2]=n;e=n+l|0;n=u+16|0;dt[n>>2]=e;dt[u+28>>2]=e;e=xr(u,r,i)|0;if(l){r=dt[t>>2]|0;pt[r+(((r|0)==(dt[n>>2]|0))<<31>>31)>>0]=0}}vt=h;return e|0}function Tr(t,e,r){t=t|0;e=e|0;r=r|0;return wr(t,2147483647,e,r)|0}function kr(t){t=t|0;return 0}function Sr(t){t=t|0;return}function Pr(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0;l=vt;vt=vt+16|0;s=l;a=e&255;pt[s>>0]=a;i=t+16|0;n=dt[i>>2]|0;if(!n)if(!(Or(t)|0)){n=dt[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=t+20|0;o=dt[i>>2]|0;if(o>>>0>>0?(r=e&255,(r|0)!=(pt[t+75>>0]|0)):0){dt[i>>2]=o+1;pt[o>>0]=a;break}if((Pi[dt[t+36>>2]&7](t,s,1)|0)==1)r=mt[s>>0]|0;else r=-1}}while(0);vt=l;return r|0}function Er(t){t=t|0;var e=0,r=0;e=vt;vt=vt+16|0;r=e;dt[r>>2]=dt[t+60>>2];t=cr(Pt(6,r|0)|0)|0;vt=e;return t|0}function Cr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0;n=vt;vt=vt+32|0;o=n;i=n+20|0;dt[o>>2]=dt[t+60>>2];dt[o+4>>2]=0;dt[o+8>>2]=e;dt[o+12>>2]=i;dt[o+16>>2]=r;if((cr(qt(140,o|0)|0)|0)<0){dt[i>>2]=-1;t=-1}else t=dt[i>>2]|0;vt=n;return t|0}function Ar(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0;d=vt;vt=vt+48|0;c=d+16|0;h=d;i=d+32|0;f=t+28|0;n=dt[f>>2]|0;dt[i>>2]=n;p=t+20|0;n=(dt[p>>2]|0)-n|0;dt[i+4>>2]=n;dt[i+8>>2]=e;dt[i+12>>2]=r;l=t+60|0;u=t+44|0;e=2;n=n+r|0;while(1){if(!(dt[52]|0)){dt[c>>2]=dt[l>>2];dt[c+4>>2]=i;dt[c+8>>2]=e;a=cr(Gt(146,c|0)|0)|0}else{Ht(7,t|0);dt[h>>2]=dt[l>>2];dt[h+4>>2]=i;dt[h+8>>2]=e;a=cr(Gt(146,h|0)|0)|0;kt(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=dt[i+4>>2]|0;if(a>>>0<=o>>>0)if((e|0)==2){dt[f>>2]=(dt[f>>2]|0)+a;s=o;e=2}else s=o;else{s=dt[u>>2]|0;dt[f>>2]=s;dt[p>>2]=s;s=dt[i+12>>2]|0;a=a-o|0;i=i+8|0;e=e+-1|0}dt[i>>2]=(dt[i>>2]|0)+a;dt[i+4>>2]=s-a}if((n|0)==6){c=dt[u>>2]|0;dt[t+16>>2]=c+(dt[t+48>>2]|0);t=c;dt[f>>2]=t;dt[p>>2]=t}else if((n|0)==8){dt[t+16>>2]=0;dt[f>>2]=0;dt[p>>2]=0;dt[t>>2]=dt[t>>2]|32;if((e|0)==2)r=0;else r=r-(dt[i+4>>2]|0)|0}vt=d;return r|0}function Ir(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0;n=vt;vt=vt+80|0;i=n;dt[t+36>>2]=3;if((dt[t>>2]&64|0)==0?(dt[i>>2]=dt[t+60>>2],dt[i+4>>2]=21505,dt[i+8>>2]=n+12,(St(54,i|0)|0)!=0):0)pt[t+75>>0]=-1;i=Ar(t,e,r)|0;vt=n;return i|0}function Or(t){t=t|0;var e=0,r=0;e=t+74|0;r=pt[e>>0]|0;pt[e>>0]=r+255|r;e=dt[t>>2]|0;if(!(e&8)){dt[t+8>>2]=0;dt[t+4>>2]=0;e=dt[t+44>>2]|0;dt[t+28>>2]=e;dt[t+20>>2]=e;dt[t+16>>2]=e+(dt[t+48>>2]|0);e=0}else{dt[t>>2]=e|32;e=-1}return e|0}function Mr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0,a=0;o=e&255;i=(r|0)!=0;t:do{if(i&(t&3|0)!=0){n=e&255;while(1){if((pt[t>>0]|0)==n<<24>>24){a=6;break t}t=t+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(t&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;t:do{if((a|0)==6){n=e&255;if((pt[t>>0]|0)!=n<<24>>24){i=_t(o,16843009)|0;e:do{if(r>>>0>3)while(1){o=dt[t>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;t=t+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break e}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((pt[t>>0]|0)==n<<24>>24)break t;t=t+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?t:0)|0}function Dr(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0;e=t+20|0;o=t+28|0;if((dt[e>>2]|0)>>>0>(dt[o>>2]|0)>>>0?(Pi[dt[t+36>>2]&7](t,0,0)|0,(dt[e>>2]|0)==0):0)e=-1;else{a=t+4|0;r=dt[a>>2]|0;i=t+8|0;n=dt[i>>2]|0;if(r>>>0>>0)Pi[dt[t+40>>2]&7](t,r-n|0,1)|0;dt[t+16>>2]=0;dt[o>>2]=0;dt[e>>2]=0;dt[i>>2]=0;dt[a>>2]=0;e=0}return e|0}function Rr(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0.0,h=0,c=0,f=0,p=0,d=0.0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,E=0,C=0,A=0,I=0,O=0,M=0,D=0,R=0,z=0,F=0,L=0,j=0,N=0,B=0,U=0,X=0,H=0,W=0,q=0,G=0,V=0,Y=0,Z=0,J=0,K=0,Q=0;Q=vt;vt=vt+624|0;V=Q+24|0;Z=Q+16|0;Y=Q+588|0;X=Q+576|0;G=Q;N=Q+536|0;K=Q+8|0;J=Q+528|0;I=(t|0)!=0;O=N+40|0;j=O;N=N+39|0;B=K+4|0;U=X+12|0;X=X+11|0;H=Y;W=U;q=W-H|0;M=-2-H|0;D=W+2|0;R=V+288|0;z=Y+9|0;F=z;L=Y+8|0;o=0;m=e;a=0;e=0;t:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=hr()|0;dt[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=pt[m>>0]|0;if(!(a<<24>>24)){A=245;break}else s=m;e:while(1){switch(a<<24>>24){case 37:{a=s;A=9;break e}case 0:{a=s;break e}default:{}}C=s+1|0;a=pt[C>>0]|0;s=C}e:do{if((A|0)==9)while(1){A=0;if((pt[a+1>>0]|0)!=37)break e;s=s+1|0;a=a+2|0;if((pt[a>>0]|0)==37)A=9;else break}}while(0);v=s-m|0;if(I?(dt[t>>2]&32|0)==0:0)_r(m,v,t)|0;if((s|0)!=(m|0)){m=a;a=v;continue}h=a+1|0;s=pt[h>>0]|0;l=(s<<24>>24)+-48|0;if(l>>>0<10){C=(pt[a+2>>0]|0)==36;h=C?a+3|0:h;s=pt[h>>0]|0;p=C?l:-1;e=C?1:e}else p=-1;a=s<<24>>24;e:do{if((a&-32|0)==32){l=0;while(1){if(!(1<>24)+-32|l;h=h+1|0;s=pt[h>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){c=l;a=h;break}}}else{c=0;a=h}}while(0);do{if(s<<24>>24==42){l=a+1|0;s=(pt[l>>0]|0)+-48|0;if(s>>>0<10?(pt[a+2>>0]|0)==36:0){dt[n+(s<<2)>>2]=10;e=1;a=a+3|0;s=dt[i+((pt[l>>0]|0)+-48<<3)>>2]|0}else{if(e){o=-1;break t}if(!I){g=c;a=l;e=0;C=0;break}e=(dt[r>>2]|0)+(4-1)&~(4-1);s=dt[e>>2]|0;dt[r>>2]=e+4;e=0;a=l}if((s|0)<0){g=c|8192;C=0-s|0}else{g=c;C=s}}else{l=(s<<24>>24)+-48|0;if(l>>>0<10){s=0;do{s=(s*10|0)+l|0;a=a+1|0;l=(pt[a>>0]|0)+-48|0}while(l>>>0<10);if((s|0)<0){o=-1;break t}else{g=c;C=s}}else{g=c;C=0}}}while(0);e:do{if((pt[a>>0]|0)==46){l=a+1|0;s=pt[l>>0]|0;if(s<<24>>24!=42){h=(s<<24>>24)+-48|0;if(h>>>0<10){a=l;s=0}else{a=l;h=0;break}while(1){s=(s*10|0)+h|0;a=a+1|0;h=(pt[a>>0]|0)+-48|0;if(h>>>0>=10){h=s;break e}}}l=a+2|0;s=(pt[l>>0]|0)+-48|0;if(s>>>0<10?(pt[a+3>>0]|0)==36:0){dt[n+(s<<2)>>2]=10;a=a+4|0;h=dt[i+((pt[l>>0]|0)+-48<<3)>>2]|0;break}if(e){o=-1;break t}if(I){a=(dt[r>>2]|0)+(4-1)&~(4-1);h=dt[a>>2]|0;dt[r>>2]=a+4;a=l}else{a=l;h=0}}else h=-1}while(0);f=0;while(1){s=(pt[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break t}l=a+1|0;s=pt[5359+(f*58|0)+s>>0]|0;c=s&255;if((c+-1|0)>>>0<8){a=l;f=c}else{E=l;break}}if(!(s<<24>>24)){o=-1;break}l=(p|0)>-1;do{if(s<<24>>24==19)if(l){o=-1;break t}else A=52;else{if(l){dt[n+(p<<2)>>2]=c;S=i+(p<<3)|0;P=dt[S+4>>2]|0;A=G;dt[A>>2]=dt[S>>2];dt[A+4>>2]=P;A=52;break}if(!I){o=0;break t}Lr(G,c,r)}}while(0);if((A|0)==52?(A=0,!I):0){m=E;a=v;continue}p=pt[a>>0]|0;p=(f|0)!=0&(p&15|0)==3?p&-33:p;l=g&-65537;P=(g&8192|0)==0?g:l;e:do{switch(p|0){case 110:switch(f|0){case 0:{dt[dt[G>>2]>>2]=o;m=E;a=v;continue t}case 1:{dt[dt[G>>2]>>2]=o;m=E;a=v;continue t}case 2:{m=dt[G>>2]|0;dt[m>>2]=o;dt[m+4>>2]=((o|0)<0)<<31>>31;m=E;a=v;continue t}case 3:{$[dt[G>>2]>>1]=o;m=E;a=v;continue t}case 4:{pt[dt[G>>2]>>0]=o;m=E;a=v;continue t}case 6:{dt[dt[G>>2]>>2]=o;m=E;a=v;continue t}case 7:{m=dt[G>>2]|0;dt[m>>2]=o;dt[m+4>>2]=((o|0)<0)<<31>>31;m=E;a=v;continue t}default:{m=E;a=v;continue t}}case 112:{f=P|8;h=h>>>0>8?h:8;p=120;A=64;break}case 88:case 120:{f=P;A=64;break}case 111:{l=G;s=dt[l>>2]|0;l=dt[l+4>>2]|0;if((s|0)==0&(l|0)==0)a=O;else{a=O;do{a=a+-1|0;pt[a>>0]=s&7|48;s=Zr(s|0,l|0,3)|0;l=rt}while(!((s|0)==0&(l|0)==0))}if(!(P&8)){s=P;f=0;c=5839;A=77}else{f=j-a+1|0;s=P;h=(h|0)<(f|0)?f:h;f=0;c=5839;A=77}break}case 105:case 100:{s=G;a=dt[s>>2]|0;s=dt[s+4>>2]|0;if((s|0)<0){a=Vr(0,0,a|0,s|0)|0;s=rt;l=G;dt[l>>2]=a;dt[l+4>>2]=s;l=1;c=5839;A=76;break e}if(!(P&2048)){c=P&1;l=c;c=(c|0)==0?5839:5841;A=76}else{l=1;c=5840;A=76}break}case 117:{s=G;a=dt[s>>2]|0;s=dt[s+4>>2]|0;l=0;c=5839;A=76;break}case 99:{pt[N>>0]=dt[G>>2];m=N;s=1;f=0;p=5839;a=O;break}case 109:{a=hr()|0;a=ur(dt[a>>2]|0)|0;A=82;break}case 115:{a=dt[G>>2]|0;a=(a|0)!=0?a:5849;A=82;break}case 67:{dt[K>>2]=dt[G>>2];dt[B>>2]=0;dt[G>>2]=K;h=-1;A=86;break}case 83:{if(!h){Nr(t,32,C,0,P);a=0;A=98}else A=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{u=+tt[G>>3];dt[Z>>2]=0;tt[et>>3]=u;if((dt[et+4>>2]|0)>=0)if(!(P&2048)){S=P&1;k=S;S=(S|0)==0?5857:5862}else{k=1;S=5859}else{u=-u;k=1;S=5856}tt[et>>3]=u;T=dt[et+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){d=+pr(u,Z)*2.0;s=d!=0.0;if(s)dt[Z>>2]=(dt[Z>>2]|0)+-1;x=p|32;if((x|0)==97){m=p&32;v=(m|0)==0?S:S+9|0;g=k|2;a=12-h|0;do{if(!(h>>>0>11|(a|0)==0)){u=8.0;do{a=a+-1|0;u=u*16.0}while((a|0)!=0);if((pt[v>>0]|0)==45){u=-(u+(-d-u));break}else{u=d+u-u;break}}else u=d}while(0);s=dt[Z>>2]|0;a=(s|0)<0?0-s|0:s;a=jr(a,((a|0)<0)<<31>>31,U)|0;if((a|0)==(U|0)){pt[X>>0]=48;a=X}pt[a+-1>>0]=(s>>31&2)+43;f=a+-2|0;pt[f>>0]=p+15;c=(h|0)<1;l=(P&8|0)==0;s=Y;while(1){S=~~u;a=s+1|0;pt[s>>0]=mt[5823+S>>0]|m;u=(u-+(S|0))*16.0;do{if((a-H|0)==1){if(l&(c&u==0.0))break;pt[a>>0]=46;a=s+2|0}}while(0);if(!(u!=0.0))break;else s=a}h=(h|0)!=0&(M+a|0)<(h|0)?D+h-f|0:q-f+a|0;l=h+g|0;Nr(t,32,C,l,P);if(!(dt[t>>2]&32))_r(v,g,t)|0;Nr(t,48,C,l,P^65536);a=a-H|0;if(!(dt[t>>2]&32))_r(Y,a,t)|0;s=W-f|0;Nr(t,48,h-(a+s)|0,0,0);if(!(dt[t>>2]&32))_r(f,s,t)|0;Nr(t,32,C,l,P^8192);a=(l|0)<(C|0)?C:l;break}a=(h|0)<0?6:h;if(s){s=(dt[Z>>2]|0)+-28|0;dt[Z>>2]=s;u=d*268435456.0}else{u=d;s=dt[Z>>2]|0}T=(s|0)<0?V:R;w=T;s=T;do{b=~~u>>>0;dt[s>>2]=b;s=s+4|0;u=(u-+(b>>>0))*1.0e9}while(u!=0.0);l=s;s=dt[Z>>2]|0;if((s|0)>0){c=T;while(1){f=(s|0)>29?29:s;h=l+-4|0;do{if(h>>>0>>0)h=c;else{s=0;do{b=Jr(dt[h>>2]|0,0,f|0)|0;b=Kr(b|0,rt|0,s|0,0)|0;s=rt;y=ai(b|0,s|0,1e9,0)|0;dt[h>>2]=y;s=oi(b|0,s|0,1e9,0)|0;h=h+-4|0}while(h>>>0>=c>>>0);if(!s){h=c;break}h=c+-4|0;dt[h>>2]=s}}while(0);while(1){if(l>>>0<=h>>>0)break;s=l+-4|0;if(!(dt[s>>2]|0))l=s;else break}s=(dt[Z>>2]|0)-f|0;dt[Z>>2]=s;if((s|0)>0)c=h;else break}}else h=T;if((s|0)<0){v=((a+25|0)/9|0)+1|0;_=(x|0)==102;m=h;while(1){g=0-s|0;g=(g|0)>9?9:g;do{if(m>>>0>>0){s=(1<>>g;h=0;f=m;do{b=dt[f>>2]|0;dt[f>>2]=(b>>>g)+h;h=_t(b&s,c)|0;f=f+4|0}while(f>>>0>>0);s=(dt[m>>2]|0)==0?m+4|0:m;if(!h){h=s;break}dt[l>>2]=h;h=s;l=l+4|0}else h=(dt[m>>2]|0)==0?m+4|0:m}while(0);s=_?T:h;l=(l-s>>2|0)>(v|0)?s+(v<<2)|0:l;s=(dt[Z>>2]|0)+g|0;dt[Z>>2]=s;if((s|0)>=0){m=h;break}else m=h}}else m=h;do{if(m>>>0>>0){s=(w-m>>2)*9|0;c=dt[m>>2]|0;if(c>>>0<10)break;else h=10;do{h=h*10|0;s=s+1|0}while(c>>>0>=h>>>0)}else s=0}while(0);y=(x|0)==103;b=(a|0)!=0;h=a-((x|0)!=102?s:0)+((b&y)<<31>>31)|0;if((h|0)<(((l-w>>2)*9|0)+-9|0)){f=h+9216|0;_=(f|0)/9|0;h=T+(_+-1023<<2)|0;f=((f|0)%9|0)+1|0;if((f|0)<9){c=10;do{c=c*10|0;f=f+1|0}while((f|0)!=9)}else c=10;g=dt[h>>2]|0;v=(g>>>0)%(c>>>0)|0;if((v|0)==0?(T+(_+-1022<<2)|0)==(l|0):0)c=m;else A=163;do{if((A|0)==163){A=0;d=(((g>>>0)/(c>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;f=(c|0)/2|0;do{if(v>>>0>>0)u=.5;else{if((v|0)==(f|0)?(T+(_+-1022<<2)|0)==(l|0):0){u=1.0;break}u=1.5}}while(0);do{if(k){if((pt[S>>0]|0)!=45)break;d=-d;u=-u}}while(0);f=g-v|0;dt[h>>2]=f;if(!(d+u!=d)){c=m;break}x=f+c|0;dt[h>>2]=x;if(x>>>0>999999999){s=m;while(1){c=h+-4|0;dt[h>>2]=0;if(c>>>0>>0){s=s+-4|0;dt[s>>2]=0}x=(dt[c>>2]|0)+1|0;dt[c>>2]=x;if(x>>>0>999999999)h=c;else{m=s;h=c;break}}}s=(w-m>>2)*9|0;f=dt[m>>2]|0;if(f>>>0<10){c=m;break}else c=10;do{c=c*10|0;s=s+1|0}while(f>>>0>=c>>>0);c=m}}while(0);x=h+4|0;m=c;l=l>>>0>x>>>0?x:l}v=0-s|0;while(1){if(l>>>0<=m>>>0){_=0;x=l;break}h=l+-4|0;if(!(dt[h>>2]|0))l=h;else{_=1;x=l;break}}do{if(y){a=(b&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){p=p+-1|0;a=a+-1-s|0}else{p=p+-2|0;a=a+-1|0}l=P&8;if(l)break;do{if(_){l=dt[x+-4>>2]|0;if(!l){h=9;break}if(!((l>>>0)%10|0)){c=10;h=0}else{h=0;break}do{c=c*10|0;h=h+1|0}while(((l>>>0)%(c>>>0)|0|0)==0)}else h=9}while(0);l=((x-w>>2)*9|0)+-9|0;if((p|32|0)==102){l=l-h|0;l=(l|0)<0?0:l;a=(a|0)<(l|0)?a:l;l=0;break}else{l=l+s-h|0;l=(l|0)<0?0:l;a=(a|0)<(l|0)?a:l;l=0;break}}else l=P&8}while(0);g=a|l;c=(g|0)!=0&1;f=(p|32|0)==102;if(f){s=(s|0)>0?s:0;p=0}else{h=(s|0)<0?v:s;h=jr(h,((h|0)<0)<<31>>31,U)|0;if((W-h|0)<2)do{h=h+-1|0;pt[h>>0]=48}while((W-h|0)<2);pt[h+-1>>0]=(s>>31&2)+43;w=h+-2|0;pt[w>>0]=p;s=W-w|0;p=w}v=k+1+a+c+s|0;Nr(t,32,C,v,P);if(!(dt[t>>2]&32))_r(S,k,t)|0;Nr(t,48,C,v,P^65536);do{if(f){h=m>>>0>T>>>0?T:m;s=h;do{l=jr(dt[s>>2]|0,0,z)|0;do{if((s|0)==(h|0)){if((l|0)!=(z|0))break;pt[L>>0]=48;l=L}else{if(l>>>0<=Y>>>0)break;do{l=l+-1|0;pt[l>>0]=48}while(l>>>0>Y>>>0)}}while(0);if(!(dt[t>>2]&32))_r(l,F-l|0,t)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(g){if(dt[t>>2]&32)break;_r(5891,1,t)|0}}while(0);if((a|0)>0&s>>>0>>0){l=s;while(1){s=jr(dt[l>>2]|0,0,z)|0;if(s>>>0>Y>>>0)do{s=s+-1|0;pt[s>>0]=48}while(s>>>0>Y>>>0);if(!(dt[t>>2]&32))_r(s,(a|0)>9?9:a,t)|0;l=l+4|0;s=a+-9|0;if(!((a|0)>9&l>>>0>>0)){a=s;break}else a=s}}Nr(t,48,a+9|0,9,0)}else{f=_?x:m+4|0;if((a|0)>-1){c=(l|0)==0;h=m;do{s=jr(dt[h>>2]|0,0,z)|0;if((s|0)==(z|0)){pt[L>>0]=48;s=L}do{if((h|0)==(m|0)){l=s+1|0;if(!(dt[t>>2]&32))_r(s,1,t)|0;if(c&(a|0)<1){s=l;break}if(dt[t>>2]&32){s=l;break}_r(5891,1,t)|0;s=l}else{if(s>>>0<=Y>>>0)break;do{s=s+-1|0;pt[s>>0]=48}while(s>>>0>Y>>>0)}}while(0);l=F-s|0;if(!(dt[t>>2]&32))_r(s,(a|0)>(l|0)?l:a,t)|0;a=a-l|0;h=h+4|0}while(h>>>0>>0&(a|0)>-1)}Nr(t,48,a+18|0,18,0);if(dt[t>>2]&32)break;_r(p,W-p|0,t)|0}}while(0);Nr(t,32,C,v,P^8192);a=(v|0)<(C|0)?C:v}else{f=(p&32|0)!=0;c=u!=u|0.0!=0.0;s=c?0:k;h=s+3|0;Nr(t,32,C,h,l);a=dt[t>>2]|0;if(!(a&32)){_r(S,s,t)|0;a=dt[t>>2]|0}if(!(a&32))_r(c?f?5883:5887:f?5875:5879,3,t)|0;Nr(t,32,C,h,P^8192);a=(h|0)<(C|0)?C:h}}while(0);m=E;continue t}default:{l=P;s=h;f=0;p=5839;a=O}}}while(0);e:do{if((A|0)==64){l=G;s=dt[l>>2]|0;l=dt[l+4>>2]|0;c=p&32;if(!((s|0)==0&(l|0)==0)){a=O;do{a=a+-1|0;pt[a>>0]=mt[5823+(s&15)>>0]|c;s=Zr(s|0,l|0,4)|0;l=rt}while(!((s|0)==0&(l|0)==0));A=G;if((f&8|0)==0|(dt[A>>2]|0)==0&(dt[A+4>>2]|0)==0){s=f;f=0;c=5839;A=77}else{s=f;f=2;c=5839+(p>>4)|0;A=77}}else{a=O;s=f;f=0;c=5839;A=77}}else if((A|0)==76){a=jr(a,s,O)|0;s=P;f=l;A=77}else if((A|0)==82){A=0;P=Mr(a,0,h)|0;S=(P|0)==0;m=a;s=S?h:P-a|0;f=0;p=5839;a=S?a+h|0:P}else if((A|0)==86){A=0;s=0;a=0;c=dt[G>>2]|0;while(1){l=dt[c>>2]|0;if(!l)break;a=mr(J,l)|0;if((a|0)<0|a>>>0>(h-s|0)>>>0)break;s=a+s|0;if(h>>>0>s>>>0)c=c+4|0;else break}if((a|0)<0){o=-1;break t}Nr(t,32,C,s,P);if(!s){a=0;A=98}else{l=0;h=dt[G>>2]|0;while(1){a=dt[h>>2]|0;if(!a){a=s;A=98;break e}a=mr(J,a)|0;l=a+l|0;if((l|0)>(s|0)){a=s;A=98;break e}if(!(dt[t>>2]&32))_r(J,a,t)|0;if(l>>>0>=s>>>0){a=s;A=98;break}else h=h+4|0}}}}while(0);if((A|0)==98){A=0;Nr(t,32,C,a,P^8192);m=E;a=(C|0)>(a|0)?C:a;continue}if((A|0)==77){A=0;l=(h|0)>-1?s&-65537:s;s=G;s=(dt[s>>2]|0)!=0|(dt[s+4>>2]|0)!=0;if((h|0)!=0|s){s=(s&1^1)+(j-a)|0;m=a;s=(h|0)>(s|0)?h:s;p=c;a=O}else{m=O;s=0;p=c;a=O}}c=a-m|0;s=(s|0)<(c|0)?c:s;h=f+s|0;a=(C|0)<(h|0)?h:C;Nr(t,32,a,h,l);if(!(dt[t>>2]&32))_r(p,f,t)|0;Nr(t,48,a,h,l^65536);Nr(t,48,s,c,0);if(!(dt[t>>2]&32))_r(m,c,t)|0;Nr(t,32,a,h,l^8192);m=E}t:do{if((A|0)==245)if(!t)if(e){o=1;while(1){e=dt[n+(o<<2)>>2]|0;if(!e)break;Lr(i+(o<<3)|0,e,r);o=o+1|0;if((o|0)>=10){o=1;break t}}if((o|0)<10)while(1){if(dt[n+(o<<2)>>2]|0){o=-1;break t}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);vt=Q;return o|0}function zr(t){t=t|0;if(!(dt[t+68>>2]|0))Sr(t);return}function Fr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0;i=t+20|0;n=dt[i>>2]|0;t=(dt[t+16>>2]|0)-n|0;t=t>>>0>r>>>0?r:t;Qr(n|0,e|0,t|0)|0;dt[i>>2]=(dt[i>>2]|0)+t;return r|0}function Lr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0.0;t:do{if(e>>>0<=20)do{switch(e|0){case 9:{i=(dt[r>>2]|0)+(4-1)&~(4-1);e=dt[i>>2]|0;dt[r>>2]=i+4;dt[t>>2]=e;break t}case 10:{i=(dt[r>>2]|0)+(4-1)&~(4-1);e=dt[i>>2]|0;dt[r>>2]=i+4;i=t;dt[i>>2]=e;dt[i+4>>2]=((e|0)<0)<<31>>31;break t}case 11:{i=(dt[r>>2]|0)+(4-1)&~(4-1);e=dt[i>>2]|0;dt[r>>2]=i+4;i=t;dt[i>>2]=e;dt[i+4>>2]=0;break t}case 12:{i=(dt[r>>2]|0)+(8-1)&~(8-1);e=i;n=dt[e>>2]|0;e=dt[e+4>>2]|0;dt[r>>2]=i+8;i=t;dt[i>>2]=n;dt[i+4>>2]=e;break t}case 13:{n=(dt[r>>2]|0)+(4-1)&~(4-1);i=dt[n>>2]|0;dt[r>>2]=n+4;i=(i&65535)<<16>>16;n=t;dt[n>>2]=i;dt[n+4>>2]=((i|0)<0)<<31>>31;break t}case 14:{n=(dt[r>>2]|0)+(4-1)&~(4-1);i=dt[n>>2]|0;dt[r>>2]=n+4;n=t;dt[n>>2]=i&65535;dt[n+4>>2]=0;break t}case 15:{n=(dt[r>>2]|0)+(4-1)&~(4-1);i=dt[n>>2]|0;dt[r>>2]=n+4;i=(i&255)<<24>>24;n=t;dt[n>>2]=i;dt[n+4>>2]=((i|0)<0)<<31>>31;break t}case 16:{n=(dt[r>>2]|0)+(4-1)&~(4-1);i=dt[n>>2]|0;dt[r>>2]=n+4;n=t;dt[n>>2]=i&255;dt[n+4>>2]=0;break t}case 17:{n=(dt[r>>2]|0)+(8-1)&~(8-1);o=+tt[n>>3];dt[r>>2]=n+8;tt[t>>3]=o;break t}case 18:{n=(dt[r>>2]|0)+(8-1)&~(8-1);o=+tt[n>>3];dt[r>>2]=n+8;tt[t>>3]=o;break t}default:break t}}while(0)}while(0);return}function jr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0;if(e>>>0>0|(e|0)==0&t>>>0>4294967295)while(1){i=ai(t|0,e|0,10,0)|0;r=r+-1|0;pt[r>>0]=i|48;i=oi(t|0,e|0,10,0)|0;if(e>>>0>9|(e|0)==9&t>>>0>4294967295){t=i;e=rt}else{t=i;break}}if(t)while(1){r=r+-1|0;pt[r>>0]=(t>>>0)%10|0|48;if(t>>>0<10)break;else t=(t>>>0)/10|0}return r|0}function Nr(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=vt;vt=vt+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Yr(a|0,e|0,(n>>>0>256?256:n)|0)|0;e=dt[t>>2]|0;o=(e&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){_r(a,256,t)|0;e=dt[t>>2]|0}n=n+-256|0;o=(e&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;_r(a,n,t)|0}}while(0);vt=s;return}function Br(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0,b=0,x=0,w=0,T=0,k=0,S=0,P=0,E=0,C=0,A=0,I=0,O=0,M=0,D=0,R=0,z=0,F=0,L=0;do{if(t>>>0<245){p=t>>>0<11?16:t+11&-8;t=p>>>3;s=dt[151]|0;r=s>>>t;if(r&3){t=(r&1^1)+t|0;i=t<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=dt[i>>2]|0;o=n+8|0;a=dt[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(dt[155]|0)>>>0)Xt();e=a+12|0;if((dt[e>>2]|0)==(n|0)){dt[e>>2]=r;dt[i>>2]=a;break}else Xt()}else dt[151]=s&~(1<>2]=L|3;L=n+(L|4)|0;dt[L>>2]=dt[L>>2]|1;L=o;return L|0}a=dt[153]|0;if(p>>>0>a>>>0){if(r){i=2<>>12&16;i=i>>>l;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;t=i>>>1&1;t=(n|l|o|r|t)+(i>>>t)|0;i=t<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=dt[i>>2]|0;l=o+8|0;n=dt[l>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(dt[155]|0)>>>0)Xt();e=n+12|0;if((dt[e>>2]|0)==(o|0)){dt[e>>2]=r;dt[i>>2]=n;u=dt[153]|0;break}else Xt()}else{dt[151]=s&~(1<>2]=p|3;s=o+p|0;dt[o+(p|4)>>2]=a|1;dt[o+L>>2]=a;if(u){n=dt[156]|0;r=u>>>3;e=r<<1;i=644+(e<<2)|0;t=dt[151]|0;r=1<>2]|0;if(e>>>0<(dt[155]|0)>>>0)Xt();else{h=t;c=e}}else{dt[151]=t|r;h=644+(e+2<<2)|0;c=i}dt[h>>2]=n;dt[c+12>>2]=n;dt[n+8>>2]=c;dt[n+12>>2]=i}dt[153]=a;dt[156]=s;L=l;return L|0}t=dt[152]|0;if(t){r=(t&0-t)+-1|0;F=r>>>12&16;r=r>>>F;z=r>>>5&8;r=r>>>z;L=r>>>2&4;r=r>>>L;t=r>>>1&2;r=r>>>t;i=r>>>1&1;i=dt[908+((z|F|L|t|i)+(r>>>i)<<2)>>2]|0;r=(dt[i+4>>2]&-8)-p|0;t=i;while(1){e=dt[t+16>>2]|0;if(!e){e=dt[t+20>>2]|0;if(!e){l=r;break}}t=(dt[e+4>>2]&-8)-p|0;L=t>>>0>>0;r=L?t:r;t=e;i=L?e:i}o=dt[155]|0;if(i>>>0>>0)Xt();s=i+p|0;if(i>>>0>=s>>>0)Xt();a=dt[i+24>>2]|0;r=dt[i+12>>2]|0;do{if((r|0)==(i|0)){t=i+20|0;e=dt[t>>2]|0;if(!e){t=i+16|0;e=dt[t>>2]|0;if(!e){f=0;break}}while(1){r=e+20|0;n=dt[r>>2]|0;if(n){e=n;t=r;continue}r=e+16|0;n=dt[r>>2]|0;if(!n)break;else{e=n;t=r}}if(t>>>0>>0)Xt();else{dt[t>>2]=0;f=e;break}}else{n=dt[i+8>>2]|0;if(n>>>0>>0)Xt();e=n+12|0;if((dt[e>>2]|0)!=(i|0))Xt();t=r+8|0;if((dt[t>>2]|0)==(i|0)){dt[e>>2]=r;dt[t>>2]=n;f=r;break}else Xt()}}while(0);do{if(a){e=dt[i+28>>2]|0;t=908+(e<<2)|0;if((i|0)==(dt[t>>2]|0)){dt[t>>2]=f;if(!f){dt[152]=dt[152]&~(1<>>0<(dt[155]|0)>>>0)Xt();e=a+16|0;if((dt[e>>2]|0)==(i|0))dt[e>>2]=f;else dt[a+20>>2]=f;if(!f)break}t=dt[155]|0;if(f>>>0>>0)Xt();dt[f+24>>2]=a;e=dt[i+16>>2]|0;do{if(e)if(e>>>0>>0)Xt();else{dt[f+16>>2]=e;dt[e+24>>2]=f;break}}while(0);e=dt[i+20>>2]|0;if(e)if(e>>>0<(dt[155]|0)>>>0)Xt();else{dt[f+20>>2]=e;dt[e+24>>2]=f;break}}}while(0);if(l>>>0<16){L=l+p|0;dt[i+4>>2]=L|3;L=i+(L+4)|0;dt[L>>2]=dt[L>>2]|1}else{dt[i+4>>2]=p|3;dt[i+(p|4)>>2]=l|1;dt[i+(l+p)>>2]=l;e=dt[153]|0;if(e){o=dt[156]|0;r=e>>>3;e=r<<1;n=644+(e<<2)|0;t=dt[151]|0;r=1<>2]|0;if(t>>>0<(dt[155]|0)>>>0)Xt();else{d=e;m=t}}else{dt[151]=t|r;d=644+(e+2<<2)|0;m=n}dt[d>>2]=o;dt[m+12>>2]=o;dt[o+8>>2]=m;dt[o+12>>2]=n}dt[153]=l;dt[156]=s}L=i+8|0;return L|0}else m=p}else m=p}else if(t>>>0<=4294967231){t=t+11|0;c=t&-8;h=dt[152]|0;if(h){r=0-c|0;t=t>>>8;if(t)if(c>>>0>16777215)u=31;else{m=(t+1048320|0)>>>16&8;b=t<>>16&4;b=b<>>16&2;u=14-(d|m|u)+(b<>>15)|0;u=c>>>(u+7|0)&1|u<<1}else u=0;t=dt[908+(u<<2)>>2]|0;t:do{if(!t){n=0;t=0;b=86}else{a=r;n=0;s=c<<((u|0)==31?0:25-(u>>>1)|0);l=t;t=0;while(1){o=dt[l+4>>2]&-8;r=o-c|0;if(r>>>0>>0)if((o|0)==(c|0)){o=l;t=l;b=90;break t}else t=l;else r=a;b=dt[l+20>>2]|0;l=dt[l+16+(s>>>31<<2)>>2]|0;n=(b|0)==0|(b|0)==(l|0)?n:b;if(!l){b=86;break}else{a=r;s=s<<1}}}}while(0);if((b|0)==86){if((n|0)==0&(t|0)==0){t=2<>>12&16;t=t>>>f;h=t>>>5&8;t=t>>>h;d=t>>>2&4;t=t>>>d;m=t>>>1&2;t=t>>>m;n=t>>>1&1;n=dt[908+((h|f|d|m|n)+(t>>>n)<<2)>>2]|0;t=0}if(!n){s=r;l=t}else{o=n;b=90}}if((b|0)==90)while(1){b=0;m=(dt[o+4>>2]&-8)-c|0;n=m>>>0>>0;r=n?m:r;t=n?o:t;n=dt[o+16>>2]|0;if(n){o=n;b=90;continue}o=dt[o+20>>2]|0;if(!o){s=r;l=t;break}else b=90}if((l|0)!=0?s>>>0<((dt[153]|0)-c|0)>>>0:0){n=dt[155]|0;if(l>>>0>>0)Xt();a=l+c|0;if(l>>>0>=a>>>0)Xt();o=dt[l+24>>2]|0;r=dt[l+12>>2]|0;do{if((r|0)==(l|0)){t=l+20|0;e=dt[t>>2]|0;if(!e){t=l+16|0;e=dt[t>>2]|0;if(!e){p=0;break}}while(1){r=e+20|0;i=dt[r>>2]|0;if(i){e=i;t=r;continue}r=e+16|0;i=dt[r>>2]|0;if(!i)break;else{e=i;t=r}}if(t>>>0>>0)Xt();else{dt[t>>2]=0;p=e;break}}else{i=dt[l+8>>2]|0;if(i>>>0>>0)Xt();e=i+12|0;if((dt[e>>2]|0)!=(l|0))Xt();t=r+8|0;if((dt[t>>2]|0)==(l|0)){dt[e>>2]=r;dt[t>>2]=i;p=r;break}else Xt()}}while(0);do{if(o){e=dt[l+28>>2]|0;t=908+(e<<2)|0;if((l|0)==(dt[t>>2]|0)){dt[t>>2]=p;if(!p){dt[152]=dt[152]&~(1<>>0<(dt[155]|0)>>>0)Xt();e=o+16|0;if((dt[e>>2]|0)==(l|0))dt[e>>2]=p;else dt[o+20>>2]=p;if(!p)break}t=dt[155]|0;if(p>>>0>>0)Xt();dt[p+24>>2]=o;e=dt[l+16>>2]|0;do{if(e)if(e>>>0>>0)Xt();else{dt[p+16>>2]=e;dt[e+24>>2]=p;break}}while(0);e=dt[l+20>>2]|0;if(e)if(e>>>0<(dt[155]|0)>>>0)Xt();else{dt[p+20>>2]=e;dt[e+24>>2]=p;break}}}while(0);t:do{if(s>>>0>=16){dt[l+4>>2]=c|3;dt[l+(c|4)>>2]=s|1;dt[l+(s+c)>>2]=s;e=s>>>3;if(s>>>0<256){t=e<<1;i=644+(t<<2)|0;r=dt[151]|0;e=1<>2]|0;if(t>>>0<(dt[155]|0)>>>0)Xt();else{v=e;_=t}}else{dt[151]=r|e;v=644+(t+2<<2)|0;_=i}dt[v>>2]=a;dt[_+12>>2]=a;dt[l+(c+8)>>2]=_;dt[l+(c+12)>>2]=i;break}e=s>>>8;if(e)if(s>>>0>16777215)i=31;else{F=(e+1048320|0)>>>16&8;L=e<>>16&4;L=L<>>16&2;i=14-(z|F|i)+(L<>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;e=908+(i<<2)|0;dt[l+(c+28)>>2]=i;dt[l+(c+20)>>2]=0;dt[l+(c+16)>>2]=0;t=dt[152]|0;r=1<>2]=a;dt[l+(c+24)>>2]=e;dt[l+(c+12)>>2]=a;dt[l+(c+8)>>2]=a;break}e=dt[e>>2]|0;e:do{if((dt[e+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){t=e+16+(i>>>31<<2)|0;r=dt[t>>2]|0;if(!r)break;if((dt[r+4>>2]&-8|0)==(s|0)){T=r;break e}else{i=i<<1;e=r}}if(t>>>0<(dt[155]|0)>>>0)Xt();else{dt[t>>2]=a;dt[l+(c+24)>>2]=e;dt[l+(c+12)>>2]=a;dt[l+(c+8)>>2]=a;break t}}else T=e}while(0);e=T+8|0;t=dt[e>>2]|0;L=dt[155]|0;if(t>>>0>=L>>>0&T>>>0>=L>>>0){dt[t+12>>2]=a;dt[e>>2]=a;dt[l+(c+8)>>2]=t;dt[l+(c+12)>>2]=T;dt[l+(c+24)>>2]=0;break}else Xt()}else{L=s+c|0;dt[l+4>>2]=L|3;L=l+(L+4)|0;dt[L>>2]=dt[L>>2]|1}}while(0);L=l+8|0;return L|0}else m=c}else m=c}else m=-1}while(0);r=dt[153]|0;if(r>>>0>=m>>>0){e=r-m|0;t=dt[156]|0;if(e>>>0>15){dt[156]=t+m;dt[153]=e;dt[t+(m+4)>>2]=e|1;dt[t+r>>2]=e;dt[t+4>>2]=m|3}else{dt[153]=0;dt[156]=0;dt[t+4>>2]=r|3;L=t+(r+4)|0;dt[L>>2]=dt[L>>2]|1}L=t+8|0;return L|0}t=dt[154]|0;if(t>>>0>m>>>0){F=t-m|0;dt[154]=F;L=dt[157]|0;dt[157]=L+m;dt[L+(m+4)>>2]=F|1;dt[L+4>>2]=m|3;L=L+8|0;return L|0}do{if(!(dt[269]|0)){t=Dt(30)|0;if(!(t+-1&t)){dt[271]=t;dt[270]=t;dt[272]=-1;dt[273]=-1;dt[274]=0;dt[262]=0;T=(Wt(0)|0)&-16^1431655768;dt[269]=T;break}else Xt()}}while(0);l=m+48|0;s=dt[271]|0;u=m+47|0;a=s+u|0;s=0-s|0;h=a&s;if(h>>>0<=m>>>0){L=0;return L|0}t=dt[261]|0;if((t|0)!=0?(_=dt[259]|0,T=_+h|0,T>>>0<=_>>>0|T>>>0>t>>>0):0){L=0;return L|0}t:do{if(!(dt[262]&4)){t=dt[157]|0;e:do{if(t){n=1052;while(1){r=dt[n>>2]|0;if(r>>>0<=t>>>0?(g=n+4|0,(r+(dt[g>>2]|0)|0)>>>0>t>>>0):0){o=n;t=g;break}n=dt[n+8>>2]|0;if(!n){b=174;break e}}r=a-(dt[154]|0)&s;if(r>>>0<2147483647){n=It(r|0)|0;T=(n|0)==((dt[o>>2]|0)+(dt[t>>2]|0)|0);t=T?r:0;if(T){if((n|0)!=(-1|0)){x=n;d=t;b=194;break t}}else b=184}else t=0}else b=174}while(0);do{if((b|0)==174){o=It(0)|0;if((o|0)!=(-1|0)){t=o;r=dt[270]|0;n=r+-1|0;if(!(n&t))r=h;else r=h-t+(n+t&0-r)|0;t=dt[259]|0;n=t+r|0;if(r>>>0>m>>>0&r>>>0<2147483647){T=dt[261]|0;if((T|0)!=0?n>>>0<=t>>>0|n>>>0>T>>>0:0){t=0;break}n=It(r|0)|0;T=(n|0)==(o|0);t=T?r:0;if(T){x=o;d=t;b=194;break t}else b=184}else t=0}else t=0}}while(0);e:do{if((b|0)==184){o=0-r|0;do{if(l>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(y=dt[271]|0,y=u-r+y&0-y,y>>>0<2147483647):0)if((It(y|0)|0)==(-1|0)){It(o|0)|0;break e}else{r=y+r|0;break}}while(0);if((n|0)!=(-1|0)){x=n;d=r;b=194;break t}}}while(0);dt[262]=dt[262]|4;b=191}else{t=0;b=191}}while(0);if((((b|0)==191?h>>>0<2147483647:0)?(x=It(h|0)|0,w=It(0)|0,x>>>0>>0&((x|0)!=(-1|0)&(w|0)!=(-1|0))):0)?(k=w-x|0,S=k>>>0>(m+40|0)>>>0,S):0){d=S?k:t;b=194}if((b|0)==194){t=(dt[259]|0)+d|0;dt[259]=t;if(t>>>0>(dt[260]|0)>>>0)dt[260]=t;a=dt[157]|0;t:do{if(a){o=1052;do{t=dt[o>>2]|0;r=o+4|0;n=dt[r>>2]|0;if((x|0)==(t+n|0)){P=t;E=r;C=n;A=o;b=204;break}o=dt[o+8>>2]|0}while((o|0)!=0);if(((b|0)==204?(dt[A+12>>2]&8|0)==0:0)?a>>>0>>0&a>>>0>=P>>>0:0){dt[E>>2]=C+d;L=(dt[154]|0)+d|0;F=a+8|0;F=(F&7|0)==0?0:0-F&7;z=L-F|0;dt[157]=a+F;dt[154]=z;dt[a+(F+4)>>2]=z|1;dt[a+(L+4)>>2]=40;dt[158]=dt[273];break}t=dt[155]|0;if(x>>>0>>0){dt[155]=x;t=x}r=x+d|0;o=1052;while(1){if((dt[o>>2]|0)==(r|0)){n=o;r=o;b=212;break}o=dt[o+8>>2]|0;if(!o){r=1052;break}}if((b|0)==212)if(!(dt[r+12>>2]&8)){dt[n>>2]=x;f=r+4|0;dt[f>>2]=(dt[f>>2]|0)+d;f=x+8|0;f=(f&7|0)==0?0:0-f&7;u=x+(d+8)|0;u=(u&7|0)==0?0:0-u&7;e=x+(u+d)|0;c=f+m|0;p=x+c|0;h=e-(x+f)-m|0;dt[x+(f+4)>>2]=m|3;e:do{if((e|0)!=(a|0)){if((e|0)==(dt[156]|0)){L=(dt[153]|0)+h|0;dt[153]=L;dt[156]=p;dt[x+(c+4)>>2]=L|1;dt[x+(L+c)>>2]=L;break}s=d+4|0;r=dt[x+(s+u)>>2]|0;if((r&3|0)==1){l=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=dt[x+((u|24)+d)>>2]|0;i=dt[x+(d+12+u)>>2]|0;do{if((i|0)==(e|0)){n=u|16;i=x+(s+n)|0;r=dt[i>>2]|0;if(!r){i=x+(n+d)|0;r=dt[i>>2]|0;if(!r){R=0;break}}while(1){n=r+20|0;o=dt[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=dt[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xt();else{dt[i>>2]=0;R=r;break}}else{n=dt[x+((u|8)+d)>>2]|0;if(n>>>0>>0)Xt();t=n+12|0;if((dt[t>>2]|0)!=(e|0))Xt();r=i+8|0;if((dt[r>>2]|0)==(e|0)){dt[t>>2]=i;dt[r>>2]=n;R=i;break}else Xt()}}while(0);if(!a)break;t=dt[x+(d+28+u)>>2]|0;r=908+(t<<2)|0;do{if((e|0)!=(dt[r>>2]|0)){if(a>>>0<(dt[155]|0)>>>0)Xt();t=a+16|0;if((dt[t>>2]|0)==(e|0))dt[t>>2]=R;else dt[a+20>>2]=R;if(!R)break r}else{dt[r>>2]=R;if(R)break;dt[152]=dt[152]&~(1<>>0>>0)Xt();dt[R+24>>2]=a;e=u|16;t=dt[x+(e+d)>>2]|0;do{if(t)if(t>>>0>>0)Xt();else{dt[R+16>>2]=t;dt[t+24>>2]=R;break}}while(0);e=dt[x+(s+e)>>2]|0;if(!e)break;if(e>>>0<(dt[155]|0)>>>0)Xt();else{dt[R+20>>2]=e;dt[e+24>>2]=R;break}}else{i=dt[x+((u|8)+d)>>2]|0;n=dt[x+(d+12+u)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0>>0)Xt();if((dt[i+12>>2]|0)==(e|0))break;Xt()}}while(0);if((n|0)==(i|0)){dt[151]=dt[151]&~(1<>>0>>0)Xt();t=n+8|0;if((dt[t>>2]|0)==(e|0)){I=t;break}Xt()}}while(0);dt[i+12>>2]=n;dt[I>>2]=i}}while(0);e=x+((l|u)+d)|0;n=l+h|0}else n=h;e=e+4|0;dt[e>>2]=dt[e>>2]&-2;dt[x+(c+4)>>2]=n|1;dt[x+(n+c)>>2]=n;e=n>>>3;if(n>>>0<256){t=e<<1;i=644+(t<<2)|0;r=dt[151]|0;e=1<>2]|0;if(t>>>0>=(dt[155]|0)>>>0){z=e;F=t;break}Xt()}}while(0);dt[z>>2]=p;dt[F+12>>2]=p;dt[x+(c+8)>>2]=F;dt[x+(c+12)>>2]=i;break}e=n>>>8;do{if(!e)i=0;else{if(n>>>0>16777215){i=31;break}z=(e+1048320|0)>>>16&8;F=e<>>16&4;F=F<>>16&2;i=14-(R|z|i)+(F<>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);e=908+(i<<2)|0;dt[x+(c+28)>>2]=i;dt[x+(c+20)>>2]=0;dt[x+(c+16)>>2]=0;t=dt[152]|0;r=1<>2]=p;dt[x+(c+24)>>2]=e;dt[x+(c+12)>>2]=p;dt[x+(c+8)>>2]=p;break}e=dt[e>>2]|0;r:do{if((dt[e+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){t=e+16+(i>>>31<<2)|0;r=dt[t>>2]|0;if(!r)break;if((dt[r+4>>2]&-8|0)==(n|0)){L=r;break r}else{i=i<<1;e=r}}if(t>>>0<(dt[155]|0)>>>0)Xt();else{dt[t>>2]=p;dt[x+(c+24)>>2]=e;dt[x+(c+12)>>2]=p;dt[x+(c+8)>>2]=p;break e}}else L=e}while(0);e=L+8|0;t=dt[e>>2]|0;F=dt[155]|0;if(t>>>0>=F>>>0&L>>>0>=F>>>0){dt[t+12>>2]=p;dt[e>>2]=p;dt[x+(c+8)>>2]=t;dt[x+(c+12)>>2]=L;dt[x+(c+24)>>2]=0;break}else Xt()}else{L=(dt[154]|0)+h|0;dt[154]=L;dt[157]=p;dt[x+(c+4)>>2]=L|1}}while(0);L=x+(f|8)|0;return L|0}else r=1052;while(1){t=dt[r>>2]|0;if(t>>>0<=a>>>0?(e=dt[r+4>>2]|0,i=t+e|0,i>>>0>a>>>0):0)break;r=dt[r+8>>2]|0}n=t+(e+-39)|0;t=t+(e+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;t=t>>>0>>0?a:t;e=t+8|0;r=x+8|0;r=(r&7|0)==0?0:0-r&7;L=d+-40-r|0;dt[157]=x+r;dt[154]=L;dt[x+(r+4)>>2]=L|1;dt[x+(d+-36)>>2]=40;dt[158]=dt[273];r=t+4|0;dt[r>>2]=27;dt[e>>2]=dt[263];dt[e+4>>2]=dt[264];dt[e+8>>2]=dt[265];dt[e+12>>2]=dt[266];dt[263]=x;dt[264]=d;dt[266]=0;dt[265]=e;e=t+28|0;dt[e>>2]=7;if((t+32|0)>>>0>>0)do{L=e;e=e+4|0;dt[e>>2]=7}while((L+8|0)>>>0>>0);if((t|0)!=(a|0)){o=t-a|0;dt[r>>2]=dt[r>>2]&-2;dt[a+4>>2]=o|1;dt[t>>2]=o;e=o>>>3;if(o>>>0<256){t=e<<1;i=644+(t<<2)|0;r=dt[151]|0;e=1<>2]|0;if(t>>>0<(dt[155]|0)>>>0)Xt();else{O=e;M=t}}else{dt[151]=r|e;O=644+(t+2<<2)|0;M=i}dt[O>>2]=a;dt[M+12>>2]=a;dt[a+8>>2]=M;dt[a+12>>2]=i;break}e=o>>>8;if(e)if(o>>>0>16777215)i=31;else{F=(e+1048320|0)>>>16&8;L=e<>>16&4;L=L<>>16&2;i=14-(z|F|i)+(L<>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;dt[a+28>>2]=i;dt[a+20>>2]=0;dt[n>>2]=0;e=dt[152]|0;t=1<>2]=a;dt[a+24>>2]=r;dt[a+12>>2]=a;dt[a+8>>2]=a;break}e=dt[r>>2]|0;e:do{if((dt[e+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){t=e+16+(i>>>31<<2)|0;r=dt[t>>2]|0;if(!r)break;if((dt[r+4>>2]&-8|0)==(o|0)){D=r;break e}else{i=i<<1;e=r}}if(t>>>0<(dt[155]|0)>>>0)Xt();else{dt[t>>2]=a;dt[a+24>>2]=e;dt[a+12>>2]=a;dt[a+8>>2]=a;break t}}else D=e}while(0);e=D+8|0;t=dt[e>>2]|0;L=dt[155]|0;if(t>>>0>=L>>>0&D>>>0>=L>>>0){dt[t+12>>2]=a;dt[e>>2]=a;dt[a+8>>2]=t;dt[a+12>>2]=D;dt[a+24>>2]=0;break}else Xt()}}else{L=dt[155]|0;if((L|0)==0|x>>>0>>0)dt[155]=x;dt[263]=x;dt[264]=d;dt[266]=0;dt[160]=dt[269];dt[159]=-1;e=0;do{L=e<<1;F=644+(L<<2)|0;dt[644+(L+3<<2)>>2]=F;dt[644+(L+2<<2)>>2]=F;e=e+1|0}while((e|0)!=32);L=x+8|0;L=(L&7|0)==0?0:0-L&7;F=d+-40-L|0;dt[157]=x+L;dt[154]=F;dt[x+(L+4)>>2]=F|1;dt[x+(d+-36)>>2]=40;dt[158]=dt[273]}}while(0);e=dt[154]|0;if(e>>>0>m>>>0){F=e-m|0;dt[154]=F;L=dt[157]|0;dt[157]=L+m;dt[L+(m+4)>>2]=F|1;dt[L+4>>2]=m|3;L=L+8|0;return L|0}}L=hr()|0;dt[L>>2]=12;L=0;return L|0}function Ur(t){t=t|0;var e=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0,y=0;if(!t)return;e=t+-8|0;s=dt[155]|0;if(e>>>0>>0)Xt();r=dt[t+-4>>2]|0;i=r&3;if((i|0)==1)Xt();p=r&-8;m=t+(p+-8)|0;do{if(!(r&1)){e=dt[e>>2]|0;if(!i)return;l=-8-e|0;h=t+l|0;c=e+p|0;if(h>>>0>>0)Xt();if((h|0)==(dt[156]|0)){e=t+(p+-4)|0;r=dt[e>>2]|0;if((r&3|0)!=3){y=h;o=c;break}dt[153]=c;dt[e>>2]=r&-2;dt[t+(l+4)>>2]=c|1;dt[m>>2]=c;return}n=e>>>3;if(e>>>0<256){i=dt[t+(l+8)>>2]|0;r=dt[t+(l+12)>>2]|0;e=644+(n<<1<<2)|0;if((i|0)!=(e|0)){if(i>>>0>>0)Xt();if((dt[i+12>>2]|0)!=(h|0))Xt()}if((r|0)==(i|0)){dt[151]=dt[151]&~(1<>>0>>0)Xt();e=r+8|0;if((dt[e>>2]|0)==(h|0))a=e;else Xt()}else a=r+8|0;dt[i+12>>2]=r;dt[a>>2]=i;y=h;o=c;break}a=dt[t+(l+24)>>2]|0;i=dt[t+(l+12)>>2]|0;do{if((i|0)==(h|0)){r=t+(l+20)|0;e=dt[r>>2]|0;if(!e){r=t+(l+16)|0;e=dt[r>>2]|0;if(!e){u=0;break}}while(1){i=e+20|0;n=dt[i>>2]|0;if(n){e=n;r=i;continue}i=e+16|0;n=dt[i>>2]|0;if(!n)break;else{e=n;r=i}}if(r>>>0>>0)Xt();else{dt[r>>2]=0;u=e;break}}else{n=dt[t+(l+8)>>2]|0;if(n>>>0>>0)Xt();e=n+12|0;if((dt[e>>2]|0)!=(h|0))Xt();r=i+8|0;if((dt[r>>2]|0)==(h|0)){dt[e>>2]=i;dt[r>>2]=n;u=i;break}else Xt()}}while(0);if(a){e=dt[t+(l+28)>>2]|0;r=908+(e<<2)|0;if((h|0)==(dt[r>>2]|0)){dt[r>>2]=u;if(!u){dt[152]=dt[152]&~(1<>>0<(dt[155]|0)>>>0)Xt();e=a+16|0;if((dt[e>>2]|0)==(h|0))dt[e>>2]=u;else dt[a+20>>2]=u;if(!u){y=h;o=c;break}}r=dt[155]|0;if(u>>>0>>0)Xt();dt[u+24>>2]=a;e=dt[t+(l+16)>>2]|0;do{if(e)if(e>>>0>>0)Xt();else{dt[u+16>>2]=e;dt[e+24>>2]=u;break}}while(0);e=dt[t+(l+20)>>2]|0;if(e)if(e>>>0<(dt[155]|0)>>>0)Xt();else{dt[u+20>>2]=e;dt[e+24>>2]=u;y=h;o=c;break}else{y=h;o=c}}else{y=h;o=c}}else{y=e;o=p}}while(0);if(y>>>0>=m>>>0)Xt();e=t+(p+-4)|0;r=dt[e>>2]|0;if(!(r&1))Xt();if(!(r&2)){if((m|0)==(dt[157]|0)){_=(dt[154]|0)+o|0;dt[154]=_;dt[157]=y;dt[y+4>>2]=_|1;if((y|0)!=(dt[156]|0))return;dt[156]=0;dt[153]=0;return}if((m|0)==(dt[156]|0)){_=(dt[153]|0)+o|0;dt[153]=_;dt[156]=y;dt[y+4>>2]=_|1;dt[y+_>>2]=_;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=dt[t+(p+16)>>2]|0;e=dt[t+(p|4)>>2]|0;do{if((e|0)==(m|0)){r=t+(p+12)|0;e=dt[r>>2]|0;if(!e){r=t+(p+8)|0;e=dt[r>>2]|0;if(!e){d=0;break}}while(1){i=e+20|0;n=dt[i>>2]|0;if(n){e=n;r=i;continue}i=e+16|0;n=dt[i>>2]|0;if(!n)break;else{e=n;r=i}}if(r>>>0<(dt[155]|0)>>>0)Xt();else{dt[r>>2]=0;d=e;break}}else{r=dt[t+p>>2]|0;if(r>>>0<(dt[155]|0)>>>0)Xt();i=r+12|0;if((dt[i>>2]|0)!=(m|0))Xt();n=e+8|0;if((dt[n>>2]|0)==(m|0)){dt[i>>2]=e;dt[n>>2]=r;d=e;break}else Xt()}}while(0);if(a){e=dt[t+(p+20)>>2]|0;r=908+(e<<2)|0;if((m|0)==(dt[r>>2]|0)){dt[r>>2]=d;if(!d){dt[152]=dt[152]&~(1<>>0<(dt[155]|0)>>>0)Xt();e=a+16|0;if((dt[e>>2]|0)==(m|0))dt[e>>2]=d;else dt[a+20>>2]=d;if(!d)break}r=dt[155]|0;if(d>>>0>>0)Xt();dt[d+24>>2]=a;e=dt[t+(p+8)>>2]|0;do{if(e)if(e>>>0>>0)Xt();else{dt[d+16>>2]=e;dt[e+24>>2]=d;break}}while(0);e=dt[t+(p+12)>>2]|0;if(e)if(e>>>0<(dt[155]|0)>>>0)Xt();else{dt[d+20>>2]=e;dt[e+24>>2]=d;break}}}else{i=dt[t+p>>2]|0;r=dt[t+(p|4)>>2]|0;e=644+(n<<1<<2)|0;if((i|0)!=(e|0)){if(i>>>0<(dt[155]|0)>>>0)Xt();if((dt[i+12>>2]|0)!=(m|0))Xt()}if((r|0)==(i|0)){dt[151]=dt[151]&~(1<>>0<(dt[155]|0)>>>0)Xt();e=r+8|0;if((dt[e>>2]|0)==(m|0))f=e;else Xt()}else f=r+8|0;dt[i+12>>2]=r;dt[f>>2]=i}}while(0);dt[y+4>>2]=o|1;dt[y+o>>2]=o;if((y|0)==(dt[156]|0)){dt[153]=o;return}}else{dt[e>>2]=r&-2;dt[y+4>>2]=o|1;dt[y+o>>2]=o}e=o>>>3;if(o>>>0<256){r=e<<1;n=644+(r<<2)|0;i=dt[151]|0;e=1<>2]|0;if(r>>>0<(dt[155]|0)>>>0)Xt();else{g=e;v=r}}else{dt[151]=i|e;g=644+(r+2<<2)|0;v=n}dt[g>>2]=y;dt[v+12>>2]=y;dt[y+8>>2]=v;dt[y+12>>2]=n;return}e=o>>>8;if(e)if(o>>>0>16777215)n=31;else{g=(e+1048320|0)>>>16&8;v=e<>>16&4;v=v<>>16&2;n=14-(m|g|n)+(v<>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;e=908+(n<<2)|0;dt[y+28>>2]=n;dt[y+20>>2]=0;dt[y+16>>2]=0;r=dt[152]|0;i=1<>2]|0;e:do{if((dt[e+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=e+16+(n>>>31<<2)|0;i=dt[r>>2]|0;if(!i)break;if((dt[i+4>>2]&-8|0)==(o|0)){_=i;break e}else{n=n<<1;e=i}}if(r>>>0<(dt[155]|0)>>>0)Xt();else{dt[r>>2]=y;dt[y+24>>2]=e;dt[y+12>>2]=y;dt[y+8>>2]=y;break t}}else _=e}while(0);e=_+8|0;r=dt[e>>2]|0;v=dt[155]|0;if(r>>>0>=v>>>0&_>>>0>=v>>>0){dt[r+12>>2]=y;dt[e>>2]=y;dt[y+8>>2]=r;dt[y+12>>2]=_;dt[y+24>>2]=0;break}else Xt()}else{dt[152]=r|i;dt[e>>2]=y;dt[y+24>>2]=e;dt[y+12>>2]=y;dt[y+8>>2]=y}}while(0);y=(dt[159]|0)+-1|0;dt[159]=y;if(!y)e=1060;else return;while(1){e=dt[e>>2]|0;if(!e)break;else e=e+8|0}dt[159]=-1;return}function Xr(t,e){t=t|0;e=e|0;var r=0,i=0;if(!t){t=Br(e)|0;return t|0}if(e>>>0>4294967231){t=hr()|0;dt[t>>2]=12;t=0;return t|0}r=Wr(t+-8|0,e>>>0<11?16:e+11&-8)|0;if(r){t=r+8|0;return t|0}r=Br(e)|0;if(!r){t=0;return t|0}i=dt[t+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,t|0,(i>>>0>>0?i:e)|0)|0;Ur(t);t=r;return t|0}function Hr(t){t=t|0;var e=0;if(!t){e=0;return e|0}t=dt[t+-4>>2]|0;e=t&3;if((e|0)==1){e=0;return e|0}e=(t&-8)-((e|0)==0?8:4)|0;return e|0}function Wr(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0;p=t+4|0;d=dt[p>>2]|0;l=d&-8;h=t+l|0;s=dt[155]|0;r=d&3;if(!((r|0)!=1&t>>>0>=s>>>0&t>>>0>>0))Xt();i=t+(l|4)|0;n=dt[i>>2]|0;if(!(n&1))Xt();if(!r){if(e>>>0<256){t=0;return t|0}if(l>>>0>=(e+4|0)>>>0?(l-e|0)>>>0<=dt[271]<<1>>>0:0)return t|0;t=0;return t|0}if(l>>>0>=e>>>0){r=l-e|0;if(r>>>0<=15)return t|0;dt[p>>2]=d&1|e|2;dt[t+(e+4)>>2]=r|3;dt[i>>2]=dt[i>>2]|1;qr(t+e|0,r);return t|0}if((h|0)==(dt[157]|0)){r=(dt[154]|0)+l|0;if(r>>>0<=e>>>0){t=0;return t|0}f=r-e|0;dt[p>>2]=d&1|e|2;dt[t+(e+4)>>2]=f|1;dt[157]=t+e;dt[154]=f;return t|0}if((h|0)==(dt[156]|0)){i=(dt[153]|0)+l|0;if(i>>>0>>0){t=0;return t|0}r=i-e|0;if(r>>>0>15){dt[p>>2]=d&1|e|2;dt[t+(e+4)>>2]=r|1;dt[t+i>>2]=r;i=t+(i+4)|0;dt[i>>2]=dt[i>>2]&-2;i=t+e|0}else{dt[p>>2]=d&1|i|2;i=t+(i+4)|0;dt[i>>2]=dt[i>>2]|1;i=0;r=0}dt[153]=r;dt[156]=i;return t|0}if(n&2){t=0;return t|0}c=(n&-8)+l|0;if(c>>>0>>0){t=0;return t|0}f=c-e|0;o=n>>>3;do{if(n>>>0>=256){a=dt[t+(l+24)>>2]|0;o=dt[t+(l+12)>>2]|0;do{if((o|0)==(h|0)){i=t+(l+20)|0;r=dt[i>>2]|0;if(!r){i=t+(l+16)|0;r=dt[i>>2]|0;if(!r){u=0;break}}while(1){n=r+20|0;o=dt[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=dt[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xt();else{dt[i>>2]=0;u=r;break}}else{n=dt[t+(l+8)>>2]|0;if(n>>>0>>0)Xt();r=n+12|0;if((dt[r>>2]|0)!=(h|0))Xt();i=o+8|0;if((dt[i>>2]|0)==(h|0)){dt[r>>2]=o;dt[i>>2]=n;u=o;break}else Xt()}}while(0);if(a){r=dt[t+(l+28)>>2]|0;i=908+(r<<2)|0;if((h|0)==(dt[i>>2]|0)){dt[i>>2]=u;if(!u){dt[152]=dt[152]&~(1<>>0<(dt[155]|0)>>>0)Xt();r=a+16|0;if((dt[r>>2]|0)==(h|0))dt[r>>2]=u;else dt[a+20>>2]=u;if(!u)break}i=dt[155]|0;if(u>>>0>>0)Xt();dt[u+24>>2]=a;r=dt[t+(l+16)>>2]|0;do{if(r)if(r>>>0>>0)Xt();else{dt[u+16>>2]=r;dt[r+24>>2]=u;break}}while(0);r=dt[t+(l+20)>>2]|0;if(r)if(r>>>0<(dt[155]|0)>>>0)Xt();else{dt[u+20>>2]=r;dt[r+24>>2]=u;break}}}else{n=dt[t+(l+8)>>2]|0;i=dt[t+(l+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xt();if((dt[n+12>>2]|0)!=(h|0))Xt()}if((i|0)==(n|0)){dt[151]=dt[151]&~(1<>>0>>0)Xt();r=i+8|0;if((dt[r>>2]|0)==(h|0))a=r;else Xt()}else a=i+8|0;dt[n+12>>2]=i;dt[a>>2]=n}}while(0);if(f>>>0<16){dt[p>>2]=c|d&1|2;e=t+(c|4)|0;dt[e>>2]=dt[e>>2]|1;return t|0}else{dt[p>>2]=d&1|e|2;dt[t+(e+4)>>2]=f|3;d=t+(c|4)|0;dt[d>>2]=dt[d>>2]|1;qr(t+e|0,f);return t|0}return 0}function qr(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0,m=0,g=0,v=0,_=0;m=t+e|0;r=dt[t+4>>2]|0;do{if(!(r&1)){u=dt[t>>2]|0;if(!(r&3))return;f=t+(0-u)|0;c=u+e|0;l=dt[155]|0;if(f>>>0>>0)Xt();if((f|0)==(dt[156]|0)){i=t+(e+4)|0;r=dt[i>>2]|0;if((r&3|0)!=3){_=f;a=c;break}dt[153]=c;dt[i>>2]=r&-2;dt[t+(4-u)>>2]=c|1;dt[m>>2]=c;return}o=u>>>3;if(u>>>0<256){n=dt[t+(8-u)>>2]|0;i=dt[t+(12-u)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xt();if((dt[n+12>>2]|0)!=(f|0))Xt()}if((i|0)==(n|0)){dt[151]=dt[151]&~(1<>>0>>0)Xt();r=i+8|0;if((dt[r>>2]|0)==(f|0))s=r;else Xt()}else s=i+8|0;dt[n+12>>2]=i;dt[s>>2]=n;_=f;a=c;break}s=dt[t+(24-u)>>2]|0;n=dt[t+(12-u)>>2]|0;do{if((n|0)==(f|0)){n=16-u|0;i=t+(n+4)|0;r=dt[i>>2]|0;if(!r){i=t+n|0;r=dt[i>>2]|0;if(!r){h=0;break}}while(1){n=r+20|0;o=dt[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=dt[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xt();else{dt[i>>2]=0;h=r;break}}else{o=dt[t+(8-u)>>2]|0;if(o>>>0>>0)Xt();r=o+12|0;if((dt[r>>2]|0)!=(f|0))Xt();i=n+8|0;if((dt[i>>2]|0)==(f|0)){dt[r>>2]=n;dt[i>>2]=o;h=n;break}else Xt()}}while(0);if(s){r=dt[t+(28-u)>>2]|0;i=908+(r<<2)|0;if((f|0)==(dt[i>>2]|0)){dt[i>>2]=h;if(!h){dt[152]=dt[152]&~(1<>>0<(dt[155]|0)>>>0)Xt();r=s+16|0;if((dt[r>>2]|0)==(f|0))dt[r>>2]=h;else dt[s+20>>2]=h;if(!h){_=f;a=c;break}}n=dt[155]|0;if(h>>>0>>0)Xt();dt[h+24>>2]=s;r=16-u|0;i=dt[t+r>>2]|0;do{if(i)if(i>>>0>>0)Xt();else{dt[h+16>>2]=i;dt[i+24>>2]=h;break}}while(0);r=dt[t+(r+4)>>2]|0;if(r)if(r>>>0<(dt[155]|0)>>>0)Xt();else{dt[h+20>>2]=r;dt[r+24>>2]=h;_=f;a=c;break}else{_=f;a=c}}else{_=f;a=c}}else{_=t;a=e}}while(0);l=dt[155]|0;if(m>>>0>>0)Xt();r=t+(e+4)|0;i=dt[r>>2]|0;if(!(i&2)){if((m|0)==(dt[157]|0)){v=(dt[154]|0)+a|0;dt[154]=v;dt[157]=_;dt[_+4>>2]=v|1;if((_|0)!=(dt[156]|0))return;dt[156]=0;dt[153]=0;return}if((m|0)==(dt[156]|0)){v=(dt[153]|0)+a|0;dt[153]=v;dt[156]=_;dt[_+4>>2]=v|1;dt[_+v>>2]=v;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=dt[t+(e+24)>>2]|0;n=dt[t+(e+12)>>2]|0;do{if((n|0)==(m|0)){i=t+(e+20)|0;r=dt[i>>2]|0;if(!r){i=t+(e+16)|0;r=dt[i>>2]|0;if(!r){d=0;break}}while(1){n=r+20|0;o=dt[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=dt[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xt();else{dt[i>>2]=0;d=r;break}}else{o=dt[t+(e+8)>>2]|0;if(o>>>0>>0)Xt();r=o+12|0;if((dt[r>>2]|0)!=(m|0))Xt();i=n+8|0;if((dt[i>>2]|0)==(m|0)){dt[r>>2]=n;dt[i>>2]=o;d=n;break}else Xt()}}while(0);if(s){r=dt[t+(e+28)>>2]|0;i=908+(r<<2)|0;if((m|0)==(dt[i>>2]|0)){dt[i>>2]=d;if(!d){dt[152]=dt[152]&~(1<>>0<(dt[155]|0)>>>0)Xt();r=s+16|0;if((dt[r>>2]|0)==(m|0))dt[r>>2]=d;else dt[s+20>>2]=d;if(!d)break}i=dt[155]|0;if(d>>>0>>0)Xt();dt[d+24>>2]=s;r=dt[t+(e+16)>>2]|0;do{if(r)if(r>>>0>>0)Xt();else{dt[d+16>>2]=r;dt[r+24>>2]=d;break}}while(0);r=dt[t+(e+20)>>2]|0;if(r)if(r>>>0<(dt[155]|0)>>>0)Xt();else{dt[d+20>>2]=r;dt[r+24>>2]=d;break}}}else{n=dt[t+(e+8)>>2]|0;i=dt[t+(e+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xt();if((dt[n+12>>2]|0)!=(m|0))Xt()}if((i|0)==(n|0)){dt[151]=dt[151]&~(1<>>0>>0)Xt();r=i+8|0;if((dt[r>>2]|0)==(m|0))p=r;else Xt()}else p=i+8|0;dt[n+12>>2]=i;dt[p>>2]=n}}while(0);dt[_+4>>2]=a|1;dt[_+a>>2]=a;if((_|0)==(dt[156]|0)){dt[153]=a;return}}else{dt[r>>2]=i&-2;dt[_+4>>2]=a|1;dt[_+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=dt[151]|0;r=1<>2]|0;if(i>>>0<(dt[155]|0)>>>0)Xt();else{g=r;v=i}}else{dt[151]=n|r;g=644+(i+2<<2)|0;v=o}dt[g>>2]=_;dt[v+12>>2]=_;dt[_+8>>2]=v;dt[_+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{g=(r+1048320|0)>>>16&8;v=r<>>16&4;v=v<>>16&2;o=14-(m|g|o)+(v<>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;dt[_+28>>2]=o;dt[_+20>>2]=0;dt[_+16>>2]=0;i=dt[152]|0;n=1<>2]=_;dt[_+24>>2]=r;dt[_+12>>2]=_;dt[_+8>>2]=_;return}r=dt[r>>2]|0;t:do{if((dt[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=dt[i>>2]|0;if(!n)break;if((dt[n+4>>2]&-8|0)==(a|0)){r=n;break t}else{o=o<<1;r=n}}if(i>>>0<(dt[155]|0)>>>0)Xt();dt[i>>2]=_;dt[_+24>>2]=r;dt[_+12>>2]=_;dt[_+8>>2]=_;return}}while(0);i=r+8|0;n=dt[i>>2]|0;v=dt[155]|0;if(!(n>>>0>=v>>>0&r>>>0>=v>>>0))Xt();dt[n+12>>2]=_;dt[i>>2]=_;dt[_+8>>2]=n;dt[_+12>>2]=r;dt[_+24>>2]=0;return}function Gr(){}function Vr(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;i=e-i-(r>>>0>t>>>0|0)>>>0;return(rt=i,t-r>>>0|0)|0}function Yr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0,n=0,o=0,a=0;i=t+r|0;if((r|0)>=20){e=e&255;o=t&3;a=e|e<<8|e<<16|e<<24;n=i&~3;if(o){o=t+4-o|0;while((t|0)<(o|0)){pt[t>>0]=e;t=t+1|0}}while((t|0)<(n|0)){dt[t>>2]=a;t=t+4|0}}while((t|0)<(i|0)){pt[t>>0]=e;t=t+1|0}return t-r|0}function Zr(t,e,r){t=t|0;e=e|0;r=r|0;if((r|0)<32){rt=e>>>r;return t>>>r|(e&(1<>>r-32|0}function Jr(t,e,r){t=t|0;e=e|0;r=r|0;if((r|0)<32){rt=e<>>32-r;return t<>>0;return(rt=e+i+(r>>>0>>0|0)>>>0,r|0)|0}function Qr(t,e,r){t=t|0;e=e|0;r=r|0;var i=0;if((r|0)>=4096)return Mt(t|0,e|0,r|0)|0;i=t|0;if((t&3)==(e&3)){while(t&3){if(!r)return i|0;pt[t>>0]=pt[e>>0]|0;t=t+1|0;e=e+1|0;r=r-1|0}while((r|0)>=4){dt[t>>2]=dt[e>>2];t=t+4|0;e=e+4|0;r=r-4|0}}while((r|0)>0){pt[t>>0]=pt[e>>0]|0;t=t+1|0;e=e+1|0;r=r-1|0}return i|0}function $r(t,e,r){t=t|0;e=e|0;r=r|0;if((r|0)<32){rt=e>>r;return t>>>r|(e&(1<>r-32|0}function ti(t){t=t|0;var e=0;e=pt[g+(t&255)>>0]|0;if((e|0)<8)return e|0;e=pt[g+(t>>8&255)>>0]|0;if((e|0)<8)return e+8|0;e=pt[g+(t>>16&255)>>0]|0;if((e|0)<8)return e+16|0;return(pt[g+(t>>>24)>>0]|0)+24|0}function ei(t,e){t=t|0;e=e|0;var r=0,i=0,n=0,o=0;o=t&65535;n=e&65535;r=_t(n,o)|0;i=t>>>16;t=(r>>>16)+(_t(n,i)|0)|0;n=e>>>16;e=_t(n,o)|0;return(rt=(t>>>16)+(_t(n,i)|0)+(((t&65535)+e|0)>>>16)|0,t+e<<16|r&65535|0)|0}function ri(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0;u=e>>31|((e|0)<0?-1:0)<<1;l=((e|0)<0?-1:0)>>31|((e|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Vr(u^t,l^e,u,l)|0;a=rt;t=o^u;e=n^l;return Vr((si(s,a,Vr(o^r,n^i,o,n)|0,rt,0)|0)^t,rt^e,t,e)|0}function ii(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0;n=vt;vt=vt+16|0;s=n|0;a=e>>31|((e|0)<0?-1:0)<<1;o=((e|0)<0?-1:0)>>31|((e|0)<0?-1:0)<<1;u=i>>31|((i|0)<0?-1:0)<<1;l=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;t=Vr(a^t,o^e,a,o)|0;e=rt;si(t,e,Vr(u^r,l^i,u,l)|0,rt,s)|0;i=Vr(dt[s>>2]^a,dt[s+4>>2]^o,a,o)|0;r=rt;vt=n;return(rt=r,i)|0}function ni(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0;n=t;o=r;r=ei(n,o)|0;t=rt;return(rt=(_t(e,o)|0)+(_t(i,n)|0)+t|t&0,r|0|0)|0}function oi(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;return si(t,e,r,i,0)|0}function ai(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;var n=0,o=0;o=vt;vt=vt+16|0;n=o|0;si(t,e,r,i,n)|0;vt=o;return(rt=dt[n+4>>2]|0,dt[n>>2]|0)|0}function si(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,h=0,c=0,f=0,p=0,d=0;h=t;l=e;u=l;a=r;f=i;s=f;if(!u){o=(n|0)!=0;if(!s){if(o){dt[n>>2]=(h>>>0)%(a>>>0);dt[n+4>>2]=0}f=0;n=(h>>>0)/(a>>>0)>>>0;return(rt=f,n)|0}else{if(!o){f=0;n=0;return(rt=f,n)|0}dt[n>>2]=t|0;dt[n+4>>2]=e&0;f=0;n=0;return(rt=f,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(at(s|0)|0)-(at(u|0)|0)|0;if(o>>>0<=31){c=o+1|0;s=31-o|0;e=o-31>>31;a=c;t=h>>>(c>>>0)&e|u<>>(c>>>0)&e;o=0;s=h<>2]=t|0;dt[n+4>>2]=l|e&0;f=0;n=0;return(rt=f,n)|0}o=a-1|0;if(o&a){s=(at(a|0)|0)+33-(at(u|0)|0)|0;d=64-s|0;c=32-s|0;l=c>>31;p=s-32|0;e=p>>31;a=s;t=c-1>>31&u>>>(p>>>0)|(u<>>(s>>>0))&e;e=e&u>>>(s>>>0);o=h<>>(p>>>0))&l|h<>31;break}if(n){dt[n>>2]=o&h;dt[n+4>>2]=0}if((a|0)==1){p=l|e&0;d=t|0|0;return(rt=p,d)|0}else{d=ti(a|0)|0;p=u>>>(d>>>0)|0;d=u<<32-d|h>>>(d>>>0)|0;return(rt=p,d)|0}}else{if(o){if(n){dt[n>>2]=(u>>>0)%(a>>>0);dt[n+4>>2]=0}p=0;d=(u>>>0)/(a>>>0)>>>0;return(rt=p,d)|0}if(!h){if(n){dt[n>>2]=0;dt[n+4>>2]=(u>>>0)%(s>>>0)}p=0;d=(u>>>0)/(s>>>0)>>>0;return(rt=p,d)|0}o=s-1|0;if(!(o&s)){if(n){dt[n>>2]=t|0;dt[n+4>>2]=o&u|e&0}p=0;d=u>>>((ti(s|0)|0)>>>0);return(rt=p,d)|0}o=(at(s|0)|0)-(at(u|0)|0)|0;if(o>>>0<=30){e=o+1|0;s=31-o|0;a=e;t=u<>>(e>>>0);e=u>>>(e>>>0);o=0;s=h<>2]=t|0;dt[n+4>>2]=l|e&0;p=0;d=0;return(rt=p,d)|0}}while(0);if(!a){u=s;l=0;s=0}else{c=r|0|0;h=f|i&0;u=Kr(c|0,h|0,-1,-1)|0;r=rt;l=s;s=0;do{i=l;l=o>>>31|l<<1;o=s|o<<1;i=t<<1|i>>>31|0;f=t>>>31|e<<1|0;Vr(u,r,i,f)|0;d=rt;p=d>>31|((d|0)<0?-1:0)<<1;s=p&1;t=Vr(i,f,p&c,(((d|0)<0?-1:0)>>31|((d|0)<0?-1:0)<<1)&h)|0;e=rt;a=a-1|0}while((a|0)!=0);u=l;l=0}a=0;if(n){dt[n>>2]=t;dt[n+4>>2]=e}p=(o|0)>>>31|(u|a)<<1|(a<<1|o>>>31)&0|l;d=(o<<1|0>>>31)&-2|s;return(rt=p,d)|0}function li(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;return Pi[t&7](e|0,r|0,i|0)|0}function ui(t,e,r,i,n,o){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;Ei[t&3](e|0,r|0,i|0,n|0,o|0)}function hi(t,e){t=t|0;e=e|0;Ci[t&7](e|0)}function ci(t,e){t=t|0;e=e|0;return Ai[t&1](e|0)|0}function fi(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;Ii[t&0](e|0,r|0,i|0)}function pi(t){t=t|0;Oi[t&3]()}function di(t,e,r,i,n,o,a){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Mi[t&3](e|0,r|0,i|0,n|0,o|0,a|0)}function mi(t,e,r,i,n,o){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;return Di[t&1](e|0,r|0,i|0,n|0,o|0)|0}function gi(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;Ri[t&3](e|0,r|0,i|0,n|0)}function vi(t,e,r){t=t|0;e=e|0;r=r|0;st(0);return 0}function _i(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;st(1)}function yi(t){t=t|0;st(2)}function bi(t){t=t|0;st(3);return 0}function xi(t,e,r){t=t|0;e=e|0;r=r|0;st(4)}function wi(){st(5)}function Ti(t,e,r,i,n,o){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;o=o|0;st(6)}function ki(t,e,r,i,n){t=t|0;e=e|0;r=r|0;i=i|0;n=n|0;st(7);return 0}function Si(t,e,r,i){t=t|0;e=e|0;r=r|0;i=i|0;st(8)}var Pi=[vi,Ye,Fr,Ar,Cr,Ir,vi,vi];var Ei=[_i,er,tr,_i];var Ci=[yi,He,Ge,We,qe,Ve,lr,zr];var Ai=[bi,Er];var Ii=[xi];var Oi=[wi,ar,sr,wi];var Mi=[Ti,ir,rr,Ti];var Di=[ki,le];var Ri=[Si,Je,Ke,Si];return{___cxa_can_catch:nr,_crn_get_levels:Te,_crn_get_uncompressed_size:Se,_crn_decompress:Pe,_i64Add:Kr,_crn_get_width:xe,___cxa_is_pointer_type:or,_i64Subtract:Vr,_memset:Yr,_malloc:Br,_free:Ur,_memcpy:Qr,_bitshift64Lshr:Zr,_fflush:gr,_bitshift64Shl:Jr,_crn_get_height:we,___errno_location:hr,_crn_get_dxt_format:ke,runPostSets:Gr,_emscripten_replace_memory:Yt,stackAlloc:Zt,stackSave:Jt,stackRestore:Kt,establishStackSpace:Qt,setThrew:$t,setTempRet0:re,getTempRet0:ie,dynCall_iiii:li,dynCall_viiiii:ui,dynCall_vi:hi,dynCall_ii:ci,dynCall_viii:fi,dynCall_v:pi,dynCall_viiiiii:di,dynCall_iiiiii:mi,dynCall_viiii:gi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0>8&255,t>>16&255,t>>24&255)}!function(s){s.loadFromArrayBuffer=function(t,e,r){return new i(e).loadFromArrayBuffer(t,r)};var i=function(l){function t(t,e,r,i,n,o,a){var s=l.call(this)||this;return s.complete=!1,s.isCompressedImage=!0,s.preserveSource=!0,s.onload=null,s.baseTexture=null,s.init(t,e,r,i,n,o,a),s}return __extends(t,l),t.prototype.init=function(t,e,r,i,n,o,a){void 0===i&&(i=-1),void 0===n&&(n=-1),this.src=t,this.resize(i,n),this._width=i,this._height=n,this.data=e,this.type=r,this.levels=o,this.internalFormat=a;var s=this.complete;return this.complete=!!e,!s&&this.complete&&this.onload&&this.onload({target:this}),this.update(),this},t.prototype.dispose=function(){this.data=null},t.prototype.bind=function(t){t.premultiplyAlpha=!1,l.prototype.bind.call(this,t)},t.prototype.upload=function(t,e,r){var i=t.state.gl;if(r.compressed=!1,t.texture.initCompressed(),null===this.data)throw"Trying to create a second (or more) webgl texture from the same CompressedImage : "+this.src;for(var n=this.levels,o=this.width,a=this.height,s=0,l=0;l>=1)<1&&(o=1),(a>>=1)<1&&(a=1),s+=u}return this._internalLoader.free(),this.preserveSource||(this.data=null),!0},t.prototype.style=function(t,e,r){var i=t.state.gl,n=this.levels;return e.scaleMode===PIXI.SCALE_MODES.LINEAR?1>2)*(e+3>>2)*8;case 33778:case 33779:case 35987:case 34798:return(t+3>>2)*(e+3>>2)*16;default:return 0}},h.type="DDS",h}(t.AbstractInternalLoader);t.DDSLoader=l}(pixi_compressed_textures||(pixi_compressed_textures={})),function(h){var t,c=((t={})[0]=35841,t[1]=35843,t[2]=35840,t[3]=35842,t[6]=36196,t[7]=33776,t[9]=33778,t[5]=33779,t),e=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.load=function(t){if(!h.DDSLoader.test(t))throw"Invalid magic number in PVR header";var e=new Int32Array(t,0,13),r=e[2],i=c[r]||-1,n=e[7],o=e[6],a=e[11],s=e[12]+52,l=new Uint8Array(t,s),u=this._image;return this._format=i,u.init(u.src,l,"PVR",n,o,a,i),u},t.test=function(t){return 55727696===new Int32Array(t,0,1)[0]},t.prototype.levelBufferSize=function(t,e,r){switch(void 0===r&&(r=0),this._format){case 33776:case 36196:return(t+3>>2)*(e+3>>2)*8;case 33778:case 33779:return(t+3>>2)*(e+3>>2)*16;case 35840:case 35842:return Math.floor((Math.max(t,8)*Math.max(e,8)*4+7)/8);case 35841:case 35843:return Math.floor((Math.max(t,16)*Math.max(e,8)*2+7)/8);default:return 0}},t.type="PVR",t}(h.AbstractInternalLoader);h.PVRTCLoader=e}(pixi_compressed_textures||(pixi_compressed_textures={}));var __awaiter=this&&this.__awaiter||function(t,a,s,l){return new(s||(s=Promise))(function(e,r){function i(t){try{o(l.next(t))}catch(t){r(t)}}function n(t){try{o(l.throw(t))}catch(t){r(t)}}function o(t){t.done?e(t.value):function(e){return e instanceof s?e:new s(function(t){t(e)})}(t.value).then(i,n)}o((l=l.apply(t,a||[])).next())})},__generator=this&&this.__generator||function(r,i){var n,o,a,t,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(a=2&e[0]?o.return:e[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,e[1])).done)return a;switch(o=0,a&&(e=[2&e[0],a.value]),e[0]){case 0:case 1:a=e;break;case 4:return s.label++,{value:e[1],done:!1};case 5:s.label++,o=e[1],e=[0];continue;case 7:e=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){s=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1] 0.0) {\n c.rgb /= c.a;\n\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n\n c.rgb *= c.a;\n }\n\n gl_FragColor = c * alpha;\n}\n"),Object.assign(this,{gamma:1,saturation:1,contrast:1,brightness:1,red:1,green:1,blue:1,alpha:1},t)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,t.applyFilter(this,e,r,i)},t}(n.Filter),d=function(i){function t(t,e,r){void 0===t&&(t=4),void 0===e&&(e=3),void 0===r&&(r=!1),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",r?"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample top right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}\n":"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample top right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}"),this.uniforms.uOffset=new Float32Array(2),this._pixelSize=new f.Point,this.pixelSize=1,this._clamp=r,this._kernels=null,Array.isArray(t)?this.kernels=t:(this._blur=t,this.quality=e)}i&&(t.__proto__=i);var e={kernels:{configurable:!0},clamp:{configurable:!0},pixelSize:{configurable:!0},quality:{configurable:!0},blur:{configurable:!0}};return((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.apply=function(t,e,r,i){var n,o=this.pixelSize.x/e._frame.width,a=this.pixelSize.y/e._frame.height;if(1===this._quality||0===this._blur)n=this._kernels[0]+.5,this.uniforms.uOffset[0]=n*o,this.uniforms.uOffset[1]=n*a,t.applyFilter(this,e,r,i);else{for(var s,l=t.getFilterTexture(),u=e,h=l,c=this._quality-1,f=0;f threshold) {\n gl_FragColor = color;\n } else {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n}\n"),this.threshold=t}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={threshold:{configurable:!0}};return r.threshold.get=function(){return this.uniforms.threshold},r.threshold.set=function(t){this.uniforms.threshold=t},Object.defineProperties(t.prototype,r),t}(n.Filter),i=function(a){function t(t){a.call(this,c,"uniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D bloomTexture;\nuniform float bloomScale;\nuniform float brightness;\n\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord);\n color.rgb *= brightness;\n vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0);\n bloomColor.rgb *= bloomScale;\n gl_FragColor = color + bloomColor;\n}\n"),"number"==typeof t&&(t={threshold:t}),t=Object.assign({threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:p.settings.RESOLUTION},t),this.bloomScale=t.bloomScale,this.brightness=t.brightness;var e=t.kernels,r=t.blur,i=t.quality,n=t.pixelSize,o=t.resolution;this._extractFilter=new m(t.threshold),this._extractFilter.resolution=o,this._blurFilter=e?new d(e):new d(r,i),this.pixelSize=n,this.resolution=o}a&&(t.__proto__=a);var e={resolution:{configurable:!0},threshold:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((t.prototype=Object.create(a&&a.prototype)).constructor=t).prototype.apply=function(t,e,r,i,n){var o=t.getFilterTexture();this._extractFilter.apply(t,e,o,!0,n);var a=t.getFilterTexture();this._blurFilter.apply(t,o,a,!0,n),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=a,t.applyFilter(this,e,r,i),t.returnFilterTexture(a),t.returnFilterTexture(o)},e.resolution.get=function(){return this._resolution},e.resolution.set=function(t){this._resolution=t,this._extractFilter&&(this._extractFilter.resolution=t),this._blurFilter&&(this._blurFilter.resolution=t)},e.threshold.get=function(){return this._extractFilter.threshold},e.threshold.set=function(t){this._extractFilter.threshold=t},e.kernels.get=function(){return this._blurFilter.kernels},e.kernels.set=function(t){this._blurFilter.kernels=t},e.blur.get=function(){return this._blurFilter.blur},e.blur.set=function(t){this._blurFilter.blur=t},e.quality.get=function(){return this._blurFilter.quality},e.quality.set=function(t){this._blurFilter.quality=t},e.pixelSize.get=function(){return this._blurFilter.pixelSize},e.pixelSize.set=function(t){this._blurFilter.pixelSize=t},Object.defineProperties(t.prototype,e),t}(n.Filter),o=function(e){function t(t){void 0===t&&(t=8),e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform float pixelSize;\nuniform sampler2D uSampler;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 pixelate(vec2 coord, vec2 size)\n{\n return floor( coord / size ) * size;\n}\n\nvec2 getMod(vec2 coord, vec2 size)\n{\n return mod( coord , size) / size;\n}\n\nfloat character(float n, vec2 p)\n{\n p = floor(p*vec2(4.0, -4.0) + 2.5);\n\n if (clamp(p.x, 0.0, 4.0) == p.x)\n {\n if (clamp(p.y, 0.0, 4.0) == p.y)\n {\n if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;\n }\n }\n return 0.0;\n}\n\nvoid main()\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n // get the rounded color..\n vec2 pixCoord = pixelate(coord, vec2(pixelSize));\n pixCoord = unmapCoord(pixCoord);\n\n vec4 color = texture2D(uSampler, pixCoord);\n\n // determine the character to use\n float gray = (color.r + color.g + color.b) / 3.0;\n\n float n = 65536.0; // .\n if (gray > 0.2) n = 65600.0; // :\n if (gray > 0.3) n = 332772.0; // *\n if (gray > 0.4) n = 15255086.0; // o\n if (gray > 0.5) n = 23385164.0; // &\n if (gray > 0.6) n = 15252014.0; // 8\n if (gray > 0.7) n = 13199452.0; // @\n if (gray > 0.8) n = 11512810.0; // #\n\n // get the mod..\n vec2 modd = getMod(coord, vec2(pixelSize));\n\n gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0);\n\n}\n"),this.size=t}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.pixelSize},r.size.set=function(t){this.uniforms.pixelSize=t},Object.defineProperties(t.prototype,r),t}(n.Filter),a=function(e){function t(t){void 0===t&&(t={}),e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float transformX;\nuniform float transformY;\nuniform vec3 lightColor;\nuniform float lightAlpha;\nuniform vec3 shadowColor;\nuniform float shadowAlpha;\n\nvoid main(void) {\n vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);\n vec4 color = texture2D(uSampler, vTextureCoord);\n float light = texture2D(uSampler, vTextureCoord - transform).a;\n float shadow = texture2D(uSampler, vTextureCoord + transform).a;\n\n color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0));\n color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"),this.uniforms.lightColor=new Float32Array(3),this.uniforms.shadowColor=new Float32Array(3),t=Object.assign({rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},t),this.rotation=t.rotation,this.thickness=t.thickness,this.lightColor=t.lightColor,this.lightAlpha=t.lightAlpha,this.shadowColor=t.shadowColor,this.shadowAlpha=t.shadowAlpha}e&&(t.__proto__=e);var r={rotation:{configurable:!0},thickness:{configurable:!0},lightColor:{configurable:!0},lightAlpha:{configurable:!0},shadowColor:{configurable:!0},shadowAlpha:{configurable:!0}};return((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},r.rotation.get=function(){return this._angle/f.DEG_TO_RAD},r.rotation.set=function(t){this._angle=t*f.DEG_TO_RAD,this._updateTransform()},r.thickness.get=function(){return this._thickness},r.thickness.set=function(t){this._thickness=t,this._updateTransform()},r.lightColor.get=function(){return l.rgb2hex(this.uniforms.lightColor)},r.lightColor.set=function(t){l.hex2rgb(t,this.uniforms.lightColor)},r.lightAlpha.get=function(){return this.uniforms.lightAlpha},r.lightAlpha.set=function(t){this.uniforms.lightAlpha=t},r.shadowColor.get=function(){return l.rgb2hex(this.uniforms.shadowColor)},r.shadowColor.set=function(t){l.hex2rgb(t,this.uniforms.shadowColor)},r.shadowAlpha.get=function(){return this.uniforms.shadowAlpha},r.shadowAlpha.set=function(t){this.uniforms.shadowAlpha=t},Object.defineProperties(t.prototype,r),t}(n.Filter),g=function(a){function t(t,e,r,i){var n,o;void 0===t&&(t=2),void 0===e&&(e=4),void 0===r&&(r=p.settings.RESOLUTION),void 0===i&&(i=5),a.call(this),"number"==typeof t?o=n=t:t instanceof f.Point?(n=t.x,o=t.y):Array.isArray(t)&&(n=t[0],o=t[1]),this.blurXFilter=new h.BlurFilterPass(!0,n,e,r,i),this.blurYFilter=new h.BlurFilterPass(!1,o,e,r,i),this.blurYFilter.blendMode=s.BLEND_MODES.SCREEN,this.defaultFilter=new u.AlphaFilter}a&&(t.__proto__=a);var e={blur:{configurable:!0},blurX:{configurable:!0},blurY:{configurable:!0}};return((t.prototype=Object.create(a&&a.prototype)).constructor=t).prototype.apply=function(t,e,r){var i=t.getFilterTexture(!0);this.defaultFilter.apply(t,e,r),this.blurXFilter.apply(t,e,i),this.blurYFilter.apply(t,i,r),t.returnFilterTexture(i)},e.blur.get=function(){return this.blurXFilter.blur},e.blur.set=function(t){this.blurXFilter.blur=this.blurYFilter.blur=t},e.blurX.get=function(){return this.blurXFilter.blur},e.blurX.set=function(t){this.blurXFilter.blur=t},e.blurY.get=function(){return this.blurYFilter.blur},e.blurY.set=function(t){this.blurYFilter.blur=t},Object.defineProperties(t.prototype,e),t}(n.Filter),v=function(i){function t(t,e,r){i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","uniform float radius;\nuniform float strength;\nuniform vec2 center;\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nvoid main()\n{\n vec2 coord = vTextureCoord * filterArea.xy;\n coord -= center * dimensions.xy;\n float distance = length(coord);\n if (distance < radius) {\n float percent = distance / radius;\n if (strength > 0.0) {\n coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75);\n } else {\n coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent);\n }\n }\n coord += center * dimensions.xy;\n coord /= filterArea.xy;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n gl_FragColor = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.center=t||[.5,.5],this.radius="number"==typeof e?e:100,this.strength="number"==typeof r?r:1}i&&(t.__proto__=i);var e={radius:{configurable:!0},strength:{configurable:!0},center:{configurable:!0}};return((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.dimensions[0]=e.filterFrame.width,this.uniforms.dimensions[1]=e.filterFrame.height,t.applyFilter(this,e,r,i)},e.radius.get=function(){return this.uniforms.radius},e.radius.set=function(t){this.uniforms.radius=t},e.strength.get=function(){return this.uniforms.strength},e.strength.set=function(t){this.uniforms.strength=t},e.center.get=function(){return this.uniforms.center},e.center.set=function(t){this.uniforms.center=t},Object.defineProperties(t.prototype,e),t}(n.Filter),_=function(i){function t(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=1),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform sampler2D colorMap;\nuniform float _mix;\nuniform float _size;\nuniform float _sliceSize;\nuniform float _slicePixelSize;\nuniform float _sliceInnerSize;\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord.xy);\n\n vec4 adjusted;\n if (color.a > 0.0) {\n color.rgb /= color.a;\n float innerWidth = _size - 1.0;\n float zSlice0 = min(floor(color.b * innerWidth), innerWidth);\n float zSlice1 = min(zSlice0 + 1.0, innerWidth);\n float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize;\n float s0 = xOffset + (zSlice0 * _sliceSize);\n float s1 = xOffset + (zSlice1 * _sliceSize);\n float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize);\n vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset));\n vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset));\n float zOffset = fract(color.b * innerWidth);\n adjusted = mix(slice0Color, slice1Color, zOffset);\n\n color.rgb *= color.a;\n }\n gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a);\n\n}"),this._size=0,this._sliceSize=0,this._slicePixelSize=0,this._sliceInnerSize=0,this._scaleMode=null,this._nearest=!1,this.nearest=e,this.mix=r,this.colorMap=t}i&&(t.__proto__=i);var e={colorSize:{configurable:!0},colorMap:{configurable:!0},nearest:{configurable:!0}};return((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms._mix=this.mix,t.applyFilter(this,e,r,i)},e.colorSize.get=function(){return this._size},e.colorMap.get=function(){return this._colorMap},e.colorMap.set=function(t){t instanceof n.Texture||(t=n.Texture.from(t)),t&&t.baseTexture&&(t.baseTexture.scaleMode=this._scaleMode,t.baseTexture.mipmap=!1,this._size=t.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms._size=this._size,this.uniforms._sliceSize=this._sliceSize,this.uniforms._slicePixelSize=this._slicePixelSize,this.uniforms._sliceInnerSize=this._sliceInnerSize,this.uniforms.colorMap=t),this._colorMap=t},e.nearest.get=function(){return this._nearest},e.nearest.set=function(t){this._nearest=t,this._scaleMode=t?s.SCALE_MODES.NEAREST:s.SCALE_MODES.LINEAR;var e=this._colorMap;e&&e.baseTexture&&(e.baseTexture._glTextures={},e.baseTexture.scaleMode=this._scaleMode,e.baseTexture.mipmap=!1,e._updateID++,e.baseTexture.emit("update",e.baseTexture))},t.prototype.updateColorMap=function(){var t=this._colorMap;t&&t.baseTexture&&(t._updateID++,t.baseTexture.emit("update",t.baseTexture),this.colorMap=t)},t.prototype.destroy=function(t){this._colorMap&&this._colorMap.destroy(t),i.prototype.destroy.call(this)},Object.defineProperties(t.prototype,e),t}(n.Filter),y=function(i){function t(t,e,r){void 0===t&&(t=16711680),void 0===e&&(e=0),void 0===r&&(r=.4),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec3 originalColor;\nuniform vec3 newColor;\nuniform float epsilon;\nvoid main(void) {\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\n vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n float doReplace = step(colorDistance, epsilon);\n gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a);\n}\n"),this.uniforms.originalColor=new Float32Array(3),this.uniforms.newColor=new Float32Array(3),this.originalColor=t,this.newColor=e,this.epsilon=r}i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t;var e={originalColor:{configurable:!0},newColor:{configurable:!0},epsilon:{configurable:!0}};return e.originalColor.set=function(t){var e=this.uniforms.originalColor;"number"==typeof t?(l.hex2rgb(t,e),this._originalColor=t):(e[0]=t[0],e[1]=t[1],e[2]=t[2],this._originalColor=l.rgb2hex(e))},e.originalColor.get=function(){return this._originalColor},e.newColor.set=function(t){var e=this.uniforms.newColor;"number"==typeof t?(l.hex2rgb(t,e),this._newColor=t):(e[0]=t[0],e[1]=t[1],e[2]=t[2],this._newColor=l.rgb2hex(e))},e.newColor.get=function(){return this._newColor},e.epsilon.set=function(t){this.uniforms.epsilon=t},e.epsilon.get=function(){return this.uniforms.epsilon},Object.defineProperties(t.prototype,e),t}(n.Filter),b=function(i){function t(t,e,r){void 0===e&&(e=200),void 0===r&&(r=200),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying mediump vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec2 texelSize;\nuniform float matrix[9];\n\nvoid main(void)\n{\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\n\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\n\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\n\n gl_FragColor =\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\n\n gl_FragColor.a = c22.a;\n}\n"),this.uniforms.texelSize=new Float32Array(2),this.uniforms.matrix=new Float32Array(9),void 0!==t&&(this.matrix=t),this.width=e,this.height=r}i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t;var e={matrix:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};return e.matrix.get=function(){return this.uniforms.matrix},e.matrix.set=function(t){var r=this;t.forEach(function(t,e){return r.uniforms.matrix[e]=t})},e.width.get=function(){return 1/this.uniforms.texelSize[0]},e.width.set=function(t){this.uniforms.texelSize[0]=1/t},e.height.get=function(){return 1/this.uniforms.texelSize[1]},e.height.set=function(t){this.uniforms.texelSize[1]=1/t},Object.defineProperties(t.prototype,e),t}(n.Filter),x=function(t){function e(){t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\n\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n\n if (lum < 1.00)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.75)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.50)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.3)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n}\n")}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(n.Filter),w=function(e){function t(t){e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nconst float SQRT_2 = 1.414213;\n\nconst float light = 1.0;\n\nuniform float curvature;\nuniform float lineWidth;\nuniform float lineContrast;\nuniform bool verticalLine;\nuniform float noise;\nuniform float noiseSize;\n\nuniform float vignetting;\nuniform float vignettingAlpha;\nuniform float vignettingBlur;\n\nuniform float seed;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n vec2 dir = vec2(coord - vec2(0.5, 0.5));\n\n float _c = curvature > 0. ? curvature : 1.;\n float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.;\n vec2 uv = dir * k;\n\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 rgb = gl_FragColor.rgb;\n\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n rgb += _noise * noise;\n }\n\n if (lineWidth > 0.0) {\n float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c;\n float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast;\n rgb *= j;\n float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.);\n rgb *= 0.99 + ceil(segment) * 0.015;\n }\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n gl_FragColor.rgb = rgb;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.time=0,this.seed=0,Object.assign(this,{curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0},t)}e&&(t.__proto__=e);var r={curvature:{configurable:!0},lineWidth:{configurable:!0},lineContrast:{configurable:!0},verticalLine:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.dimensions[0]=e.filterFrame.width,this.uniforms.dimensions[1]=e.filterFrame.height,this.uniforms.seed=this.seed,this.uniforms.time=this.time,t.applyFilter(this,e,r,i)},r.curvature.set=function(t){this.uniforms.curvature=t},r.curvature.get=function(){return this.uniforms.curvature},r.lineWidth.set=function(t){this.uniforms.lineWidth=t},r.lineWidth.get=function(){return this.uniforms.lineWidth},r.lineContrast.set=function(t){this.uniforms.lineContrast=t},r.lineContrast.get=function(){return this.uniforms.lineContrast},r.verticalLine.set=function(t){this.uniforms.verticalLine=t},r.verticalLine.get=function(){return this.uniforms.verticalLine},r.noise.set=function(t){this.uniforms.noise=t},r.noise.get=function(){return this.uniforms.noise},r.noiseSize.set=function(t){this.uniforms.noiseSize=t},r.noiseSize.get=function(){return this.uniforms.noiseSize},r.vignetting.set=function(t){this.uniforms.vignetting=t},r.vignetting.get=function(){return this.uniforms.vignetting},r.vignettingAlpha.set=function(t){this.uniforms.vignettingAlpha=t},r.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},r.vignettingBlur.set=function(t){this.uniforms.vignettingBlur=t},r.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(t.prototype,r),t}(n.Filter),T=function(r){function t(t,e){void 0===t&&(t=1),void 0===e&&(e=5),r.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 filterArea;\nuniform sampler2D uSampler;\n\nuniform float angle;\nuniform float scale;\n\nfloat pattern()\n{\n float s = sin(angle), c = cos(angle);\n vec2 tex = vTextureCoord * filterArea.xy;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float average = (color.r + color.g + color.b) / 3.0;\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\n}\n"),this.scale=t,this.angle=e}r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t;var e={scale:{configurable:!0},angle:{configurable:!0}};return e.scale.get=function(){return this.uniforms.scale},e.scale.set=function(t){this.uniforms.scale=t},e.angle.get=function(){return this.uniforms.angle},e.angle.set=function(t){this.uniforms.angle=t},Object.defineProperties(t.prototype,e),t}(n.Filter),k=function(c){function t(t){t&&t.constructor!==Object&&(console.warn("DropShadowFilter now uses options instead of (rotation, distance, blur, color, alpha)"),t={rotation:t},void 0!==arguments[1]&&(t.distance=arguments[1]),void 0!==arguments[2]&&(t.blur=arguments[2]),void 0!==arguments[3]&&(t.color=arguments[3]),void 0!==arguments[4]&&(t.alpha=arguments[4])),t=Object.assign({rotation:45,distance:5,color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:p.settings.RESOLUTION},t),c.call(this);var e=t.kernels,r=t.blur,i=t.quality,n=t.pixelSize,o=t.resolution;this._tintFilter=new c("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform vec3 color;\n\nuniform vec2 shift;\nuniform vec4 inputSize;\n\nvoid main(void){\n vec4 sample = texture2D(uSampler, vTextureCoord - shift * inputSize.zw);\n\n // Un-premultiply alpha before applying the color\n if (sample.a > 0.0) {\n sample.rgb /= sample.a;\n }\n\n // Premultiply alpha again\n sample.rgb = color.rgb * sample.a;\n\n // alpha user alpha\n sample *= alpha;\n\n gl_FragColor = sample;\n}"),this._tintFilter.uniforms.color=new Float32Array(4),this._tintFilter.uniforms.shift=new f.Point,this._tintFilter.resolution=o,this._blurFilter=e?new d(e):new d(r,i),this.pixelSize=n,this.resolution=o;var a=t.shadowOnly,s=t.rotation,l=t.distance,u=t.alpha,h=t.color;this.shadowOnly=a,this.rotation=s,this.distance=l,this.alpha=u,this.color=h,this._updatePadding()}c&&(t.__proto__=c);var e={resolution:{configurable:!0},distance:{configurable:!0},rotation:{configurable:!0},alpha:{configurable:!0},color:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((t.prototype=Object.create(c&&c.prototype)).constructor=t).prototype.apply=function(t,e,r,i){var n=t.getFilterTexture();this._tintFilter.apply(t,e,n,!0),this._blurFilter.apply(t,n,r,i),!0!==this.shadowOnly&&t.applyFilter(this,e,r,!1),t.returnFilterTexture(n)},t.prototype._updatePadding=function(){this.padding=this.distance+2*this.blur},t.prototype._updateShift=function(){this._tintFilter.uniforms.shift.set(this.distance*Math.cos(this.angle),this.distance*Math.sin(this.angle))},e.resolution.get=function(){return this._resolution},e.resolution.set=function(t){this._resolution=t,this._tintFilter&&(this._tintFilter.resolution=t),this._blurFilter&&(this._blurFilter.resolution=t)},e.distance.get=function(){return this._distance},e.distance.set=function(t){this._distance=t,this._updatePadding(),this._updateShift()},e.rotation.get=function(){return this.angle/f.DEG_TO_RAD},e.rotation.set=function(t){this.angle=t*f.DEG_TO_RAD,this._updateShift()},e.alpha.get=function(){return this._tintFilter.uniforms.alpha},e.alpha.set=function(t){this._tintFilter.uniforms.alpha=t},e.color.get=function(){return l.rgb2hex(this._tintFilter.uniforms.color)},e.color.set=function(t){l.hex2rgb(t,this._tintFilter.uniforms.color)},e.kernels.get=function(){return this._blurFilter.kernels},e.kernels.set=function(t){this._blurFilter.kernels=t},e.blur.get=function(){return this._blurFilter.blur},e.blur.set=function(t){this._blurFilter.blur=t,this._updatePadding()},e.quality.get=function(){return this._blurFilter.quality},e.quality.set=function(t){this._blurFilter.quality=t},e.pixelSize.get=function(){return this._blurFilter.pixelSize},e.pixelSize.set=function(t){this._blurFilter.pixelSize=t},Object.defineProperties(t.prototype,e),t}(n.Filter),S=function(e){function t(t){void 0===t&&(t=5),e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float strength;\nuniform vec4 filterArea;\n\n\nvoid main(void)\n{\n\tvec2 onePixel = vec2(1.0 / filterArea);\n\n\tvec4 color;\n\n\tcolor.rgb = vec3(0.5);\n\n\tcolor -= texture2D(uSampler, vTextureCoord - onePixel) * strength;\n\tcolor += texture2D(uSampler, vTextureCoord + onePixel) * strength;\n\n\tcolor.rgb = vec3((color.r + color.g + color.b) / 3.0);\n\n\tfloat alpha = texture2D(uSampler, vTextureCoord).a;\n\n\tgl_FragColor = vec4(color.rgb * alpha, alpha);\n}\n"),this.strength=t}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={strength:{configurable:!0}};return r.strength.get=function(){return this.uniforms.strength},r.strength.set=function(t){this.uniforms.strength=t},Object.defineProperties(t.prototype,r),t}(n.Filter),P=function(e){function t(t){void 0===t&&(t={}),e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","// precision highp float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void)\n{\n vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture2D(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if( coord.x > filterClamp.z ) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n }\n } else if( coord.x < filterClamp.x ) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n }\n }\n\n if( coord.y > filterClamp.w ) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n }\n } else if( coord.y < filterClamp.y ) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n }\n }\n }\n\n gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, coord).a;\n}\n"),this.uniforms.dimensions=new Float32Array(2),t=Object.assign({slices:5,offset:100,direction:0,fillMode:0,average:!1,seed:0,red:[0,0],green:[0,0],blue:[0,0],minSize:8,sampleSize:512},t),this.direction=t.direction,this.red=t.red,this.green=t.green,this.blue=t.blue,this.offset=t.offset,this.fillMode=t.fillMode,this.average=t.average,this.seed=t.seed,this.minSize=t.minSize,this.sampleSize=t.sampleSize,this._canvas=document.createElement("canvas"),this._canvas.width=4,this._canvas.height=this.sampleSize,this.texture=n.Texture.from(this._canvas,{scaleMode:s.SCALE_MODES.NEAREST}),this._slices=0,this.slices=t.slices}e&&(t.__proto__=e);var r={sizes:{configurable:!0},offsets:{configurable:!0},slices:{configurable:!0},direction:{configurable:!0},red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.apply=function(t,e,r,i){var n=e.filterFrame.width,o=e.filterFrame.height;this.uniforms.dimensions[0]=n,this.uniforms.dimensions[1]=o,this.uniforms.aspect=o/n,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,t.applyFilter(this,e,r,i)},t.prototype._randomizeSizes=function(){var t=this._sizes,e=this._slices-1,r=this.sampleSize,i=Math.min(this.minSize/r,.9/this._slices);if(this.average){for(var n=this._slices,o=1,a=0;a>0,i=t[e];t[e]=t[r],t[r]=i}},t.prototype._randomizeOffsets=function(){for(var t=0;t>0,e,1+a>>0),n+=a}r.baseTexture.update(),this.uniforms.displacementMap=r},r.sizes.set=function(t){for(var e=Math.min(this._slices,t.length),r=0;rthis._maxColors)throw"Length of replacements ("+i+") exceeds the maximum colors length ("+this._maxColors+")";e[3*i]=-1;for(var n=0;n 0.5) then: 1 - 2 * (1 - dst) * (1 - src)\n return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)),\n (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)),\n (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z)));\n}\n\n\nvoid main()\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 color = gl_FragColor.rgb;\n\n if (sepia > 0.0)\n {\n float gray = (color.x + color.y + color.z) / 3.0;\n vec3 grayscale = vec3(gray);\n\n color = Overlay(SEPIA_RGB, grayscale);\n\n color = grayscale + sepia * (color - grayscale);\n }\n\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n vec2 dir = vec2(vec2(0.5, 0.5) - coord);\n dir.y *= dimensions.y / dimensions.x;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n if (scratchDensity > seed && scratch != 0.0)\n {\n float phase = seed * 256.0;\n float s = mod(floor(phase), 2.0);\n float dist = 1.0 / scratchDensity;\n float d = distance(coord, vec2(seed * dist, abs(s - seed * dist)));\n if (d < seed * 0.6 + 0.4)\n {\n highp float period = scratchDensity * 10.0;\n\n float xx = coord.x * period + phase;\n float aa = abs(mod(xx, 0.5) * 4.0);\n float bb = mod(floor(xx / 0.5), 2.0);\n float yy = (1.0 - bb) * aa + bb * (2.0 - aa);\n\n float kk = 2.0 * period;\n float dw = scratchWidth / dimensions.x * (0.75 + seed);\n float dh = dw * kk;\n\n float tine = (yy - (2.0 - dh));\n\n if (tine > 0.0) {\n float _sign = sign(scratch);\n\n tine = s * tine / period + scratch + 0.1;\n tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5);\n\n color.rgb *= tine;\n }\n }\n }\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0);\n // float _noise = snoise(d) * 0.5;\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n color += _noise * noise;\n }\n\n gl_FragColor.rgb = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),"number"==typeof t?(this.seed=t,t=null):this.seed=e,Object.assign(this,{sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3},t)}r&&(t.__proto__=r);var e={sepia:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},scratch:{configurable:!0},scratchDensity:{configurable:!0},scratchWidth:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((t.prototype=Object.create(r&&r.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.dimensions[0]=e.filterFrame.width,this.uniforms.dimensions[1]=e.filterFrame.height,this.uniforms.seed=this.seed,t.applyFilter(this,e,r,i)},e.sepia.set=function(t){this.uniforms.sepia=t},e.sepia.get=function(){return this.uniforms.sepia},e.noise.set=function(t){this.uniforms.noise=t},e.noise.get=function(){return this.uniforms.noise},e.noiseSize.set=function(t){this.uniforms.noiseSize=t},e.noiseSize.get=function(){return this.uniforms.noiseSize},e.scratch.set=function(t){this.uniforms.scratch=t},e.scratch.get=function(){return this.uniforms.scratch},e.scratchDensity.set=function(t){this.uniforms.scratchDensity=t},e.scratchDensity.get=function(){return this.uniforms.scratchDensity},e.scratchWidth.set=function(t){this.uniforms.scratchWidth=t},e.scratchWidth.get=function(){return this.uniforms.scratchWidth},e.vignetting.set=function(t){this.uniforms.vignetting=t},e.vignetting.get=function(){return this.uniforms.vignetting},e.vignettingAlpha.set=function(t){this.uniforms.vignettingAlpha=t},e.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},e.vignettingBlur.set=function(t){this.uniforms.vignettingBlur=t},e.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(t.prototype,e),t}(n.Filter),M=function(o){function a(t,e,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===r&&(r=.1);var i=Math.max(r*a.MAX_SAMPLES,a.MIN_SAMPLES),n=(2*Math.PI/i).toFixed(7);o.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 thickness;\nuniform vec4 outlineColor;\nuniform vec4 filterClamp;\n\nconst float DOUBLE_PI = 3.14159265358979323846264 * 2.;\n\nvoid main(void) {\n vec4 ownColor = texture2D(uSampler, vTextureCoord);\n vec4 curColor;\n float maxAlpha = 0.;\n vec2 displaced;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ${angleStep}) {\n displaced.x = vTextureCoord.x + thickness.x * cos(angle);\n displaced.y = vTextureCoord.y + thickness.y * sin(angle);\n curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw));\n maxAlpha = max(maxAlpha, curColor.a);\n }\n float resultAlpha = max(maxAlpha, ownColor.a);\n gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha);\n}\n".replace(/\$\{angleStep\}/,n)),this.uniforms.thickness=new Float32Array([0,0]),this.thickness=t,this.uniforms.outlineColor=new Float32Array([0,0,0,1]),this.color=e,this.quality=r}o&&(a.__proto__=o);var t={color:{configurable:!0}};return((a.prototype=Object.create(o&&o.prototype)).constructor=a).prototype.apply=function(t,e,r,i){this.uniforms.thickness[0]=this.thickness/e._frame.width,this.uniforms.thickness[1]=this.thickness/e._frame.height,t.applyFilter(this,e,r,i)},t.color.get=function(){return l.rgb2hex(this.uniforms.outlineColor)},t.color.set=function(t){l.hex2rgb(t,this.uniforms.outlineColor)},Object.defineProperties(a.prototype,t),a}(n.Filter);M.MIN_SAMPLES=1,M.MAX_SAMPLES=100;var D=function(e){function t(t){void 0===t&&(t=10),e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform vec2 size;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 pixelate(vec2 coord, vec2 size)\n{\n\treturn floor( coord / size ) * size;\n}\n\nvoid main(void)\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = pixelate(coord, size);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord);\n}\n"),this.size=t}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.size},r.size.set=function(t){"number"==typeof t&&(t=[t,t]),this.uniforms.size=t},Object.defineProperties(t.prototype,r),t}(n.Filter),R=function(n){function t(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=[0,0]),void 0===r&&(r=5),void 0===i&&(i=-1),n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float uRadian;\nuniform vec2 uCenter;\nuniform float uRadius;\nuniform int uKernelSize;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n if (uKernelSize == 0)\n {\n gl_FragColor = color;\n return;\n }\n\n float aspect = filterArea.y / filterArea.x;\n vec2 center = uCenter.xy / filterArea.xy;\n float gradient = uRadius / filterArea.x * 0.3;\n float radius = uRadius / filterArea.x - gradient * 0.5;\n int k = uKernelSize - 1;\n\n vec2 coord = vTextureCoord;\n vec2 dir = vec2(center - coord);\n float dist = length(vec2(dir.x, dir.y * aspect));\n\n float radianStep = uRadian;\n if (radius >= 0.0 && dist > radius) {\n float delta = dist - radius;\n float gap = gradient;\n float scale = 1.0 - abs(delta / gap);\n if (scale <= 0.0) {\n gl_FragColor = color;\n return;\n }\n radianStep *= scale;\n }\n radianStep /= float(k);\n\n float s = sin(radianStep);\n float c = cos(radianStep);\n mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c));\n\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\n if (i == k) {\n break;\n }\n\n coord -= center;\n coord.y *= aspect;\n coord = rotationMatrix * coord;\n coord.y /= aspect;\n coord += center;\n\n vec4 sample = texture2D(uSampler, coord);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample;\n }\n\n gl_FragColor = color / float(uKernelSize);\n}\n"),this._angle=0,this.angle=t,this.center=e,this.kernelSize=r,this.radius=i}n&&(t.__proto__=n);var e={angle:{configurable:!0},center:{configurable:!0},radius:{configurable:!0}};return((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.uKernelSize=0!==this._angle?this.kernelSize:0,t.applyFilter(this,e,r,i)},e.angle.set=function(t){this._angle=t,this.uniforms.uRadian=t*Math.PI/180},e.angle.get=function(){return this._angle},e.center.get=function(){return this.uniforms.uCenter},e.center.set=function(t){this.uniforms.uCenter=t},e.radius.get=function(){return this.uniforms.uRadius},e.radius.set=function(t){(t<0||t===1/0)&&(t=-1),this.uniforms.uRadius=t},Object.defineProperties(t.prototype,e),t}(n.Filter),z=function(e){function t(t){e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nuniform bool mirror;\nuniform float boundary;\nuniform vec2 amplitude;\nuniform vec2 waveLength;\nuniform vec2 alpha;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n if (coord.y < boundary) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n float k = (coord.y - boundary) / (1. - boundary + 0.0001);\n float areaY = boundary * dimensions.y / filterArea.y;\n float v = areaY + areaY - vTextureCoord.y;\n float y = mirror ? v : vTextureCoord.y;\n\n float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x;\n float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y;\n float _alpha = (alpha.y - alpha.x) * k + alpha.x;\n\n float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude;\n x = clamp(x, filterClamp.x, filterClamp.z);\n\n vec4 color = texture2D(uSampler, vec2(x, y));\n\n gl_FragColor = color * _alpha;\n}\n"),this.uniforms.amplitude=new Float32Array(2),this.uniforms.waveLength=new Float32Array(2),this.uniforms.alpha=new Float32Array(2),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,{mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0},t)}e&&(t.__proto__=e);var r={mirror:{configurable:!0},boundary:{configurable:!0},amplitude:{configurable:!0},waveLength:{configurable:!0},alpha:{configurable:!0}};return((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.dimensions[0]=e.filterFrame.width,this.uniforms.dimensions[1]=e.filterFrame.height,this.uniforms.time=this.time,t.applyFilter(this,e,r,i)},r.mirror.set=function(t){this.uniforms.mirror=t},r.mirror.get=function(){return this.uniforms.mirror},r.boundary.set=function(t){this.uniforms.boundary=t},r.boundary.get=function(){return this.uniforms.boundary},r.amplitude.set=function(t){this.uniforms.amplitude[0]=t[0],this.uniforms.amplitude[1]=t[1]},r.amplitude.get=function(){return this.uniforms.amplitude},r.waveLength.set=function(t){this.uniforms.waveLength[0]=t[0],this.uniforms.waveLength[1]=t[1]},r.waveLength.get=function(){return this.uniforms.waveLength},r.alpha.set=function(t){this.uniforms.alpha[0]=t[0],this.uniforms.alpha[1]=t[1]},r.alpha.get=function(){return this.uniforms.alpha},Object.defineProperties(t.prototype,r),t}(n.Filter),F=function(i){function t(t,e,r){void 0===t&&(t=[-10,0]),void 0===e&&(e=[0,10]),void 0===r&&(r=[0,0]),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nvoid main(void)\n{\n gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;\n}\n"),this.red=t,this.green=e,this.blue=r}i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t;var e={red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return e.red.get=function(){return this.uniforms.red},e.red.set=function(t){this.uniforms.red=t},e.green.get=function(){return this.uniforms.green},e.green.set=function(t){this.uniforms.green=t},e.blue.get=function(){return this.uniforms.blue},e.blue.set=function(t){this.uniforms.blue=t},Object.defineProperties(t.prototype,e),t}(n.Filter),L=function(i){function t(t,e,r){void 0===t&&(t=[0,0]),void 0===e&&(e={}),void 0===r&&(r=0),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\n\nuniform vec2 center;\n\nuniform float amplitude;\nuniform float wavelength;\n// uniform float power;\nuniform float brightness;\nuniform float speed;\nuniform float radius;\n\nuniform float time;\n\nconst float PI = 3.14159;\n\nvoid main()\n{\n float halfWavelength = wavelength * 0.5 / filterArea.x;\n float maxRadius = radius / filterArea.x;\n float currentRadius = time * speed / filterArea.x;\n\n float fade = 1.0;\n\n if (maxRadius > 0.0) {\n if (currentRadius > maxRadius) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n fade = 1.0 - pow(currentRadius / maxRadius, 2.0);\n }\n\n vec2 dir = vec2(vTextureCoord - center / filterArea.xy);\n dir.y *= filterArea.y / filterArea.x;\n float dist = length(dir);\n\n if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n vec2 diffUV = normalize(dir);\n\n float diff = (dist - currentRadius) / halfWavelength;\n\n float p = 1.0 - pow(abs(diff), 2.0);\n\n // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade );\n float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade );\n\n vec2 offset = diffUV * powDiff / filterArea.xy;\n\n // Do clamp :\n vec2 coord = vTextureCoord + offset;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n // No clamp :\n // gl_FragColor = texture2D(uSampler, vTextureCoord + offset);\n\n color.rgb *= 1.0 + (brightness - 1.0) * p * fade;\n\n gl_FragColor = color;\n}\n"),this.center=t,Array.isArray(e)&&(console.warn("Deprecated Warning: ShockwaveFilter params Array has been changed to options Object."),e={}),e=Object.assign({amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1},e),this.amplitude=e.amplitude,this.wavelength=e.wavelength,this.brightness=e.brightness,this.speed=e.speed,this.radius=e.radius,this.time=r}i&&(t.__proto__=i);var e={center:{configurable:!0},amplitude:{configurable:!0},wavelength:{configurable:!0},brightness:{configurable:!0},speed:{configurable:!0},radius:{configurable:!0}};return((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.time=this.time,t.applyFilter(this,e,r,i)},e.center.get=function(){return this.uniforms.center},e.center.set=function(t){this.uniforms.center=t},e.amplitude.get=function(){return this.uniforms.amplitude},e.amplitude.set=function(t){this.uniforms.amplitude=t},e.wavelength.get=function(){return this.uniforms.wavelength},e.wavelength.set=function(t){this.uniforms.wavelength=t},e.brightness.get=function(){return this.uniforms.brightness},e.brightness.set=function(t){this.uniforms.brightness=t},e.speed.get=function(){return this.uniforms.speed},e.speed.set=function(t){this.uniforms.speed=t},e.radius.get=function(){return this.uniforms.radius},e.radius.set=function(t){this.uniforms.radius=t},Object.defineProperties(t.prototype,e),t}(n.Filter),j=function(i){function t(t,e,r){void 0===e&&(e=0),void 0===r&&(r=1),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform sampler2D uLightmap;\nuniform vec4 filterArea;\nuniform vec2 dimensions;\nuniform vec4 ambientColor;\nvoid main() {\n vec4 diffuseColor = texture2D(uSampler, vTextureCoord);\n vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions;\n vec4 light = texture2D(uLightmap, lightCoord);\n vec3 ambient = ambientColor.rgb * ambientColor.a;\n vec3 intensity = ambient + light.rgb;\n vec3 finalColor = diffuseColor.rgb * intensity;\n gl_FragColor = vec4(finalColor, diffuseColor.a);\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.uniforms.ambientColor=new Float32Array([0,0,0,r]),this.texture=t,this.color=e}i&&(t.__proto__=i);var e={texture:{configurable:!0},color:{configurable:!0},alpha:{configurable:!0}};return((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.apply=function(t,e,r,i){this.uniforms.dimensions[0]=e.filterFrame.width,this.uniforms.dimensions[1]=e.filterFrame.height,t.applyFilter(this,e,r,i)},e.texture.get=function(){return this.uniforms.uLightmap},e.texture.set=function(t){this.uniforms.uLightmap=t},e.color.set=function(t){var e=this.uniforms.ambientColor;"number"==typeof t?(l.hex2rgb(t,e),this._color=t):(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this._color=l.rgb2hex(e))},e.color.get=function(){return this._color},e.alpha.get=function(){return this.uniforms.ambientColor[3]},e.alpha.set=function(t){this.uniforms.ambientColor[3]=t},Object.defineProperties(t.prototype,e),t}(n.Filter),N=function(n){function t(t,e,r,i){void 0===t&&(t=100),void 0===e&&(e=600),void 0===r&&(r=null),void 0===i&&(i=null),n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\n\nfloat random(vec3 scale, float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\n\n for (float t = -30.0; t <= 30.0; t++)\n {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\n sample.rgb *= sample.a;\n color += sample * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.uniforms.blur=t,this.uniforms.gradientBlur=e,this.uniforms.start=r||new f.Point(0,window.innerHeight/2),this.uniforms.end=i||new f.Point(600,window.innerHeight/2),this.uniforms.delta=new f.Point(30,30),this.uniforms.texSize=new f.Point(window.innerWidth,window.innerHeight),this.updateDelta()}n&&(t.__proto__=n);var e={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.updateDelta=function(){this.uniforms.delta.x=0,this.uniforms.delta.y=0},e.blur.get=function(){return this.uniforms.blur},e.blur.set=function(t){this.uniforms.blur=t},e.gradientBlur.get=function(){return this.uniforms.gradientBlur},e.gradientBlur.set=function(t){this.uniforms.gradientBlur=t},e.start.get=function(){return this.uniforms.start},e.start.set=function(t){this.uniforms.start=t,this.updateDelta()},e.end.get=function(){return this.uniforms.end},e.end.set=function(t){this.uniforms.end=t,this.updateDelta()},Object.defineProperties(t.prototype,e),t}(n.Filter),B=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.updateDelta=function(){var t=this.uniforms.end.x-this.uniforms.start.x,e=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.x=t/r,this.uniforms.delta.y=e/r},e}(N),U=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.updateDelta=function(){var t=this.uniforms.end.x-this.uniforms.start.x,e=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.x=-e/r,this.uniforms.delta.y=t/r},e}(N),X=function(n){function t(t,e,r,i){void 0===t&&(t=100),void 0===e&&(e=600),void 0===r&&(r=null),void 0===i&&(i=null),n.call(this),this.tiltShiftXFilter=new B(t,e,r,i),this.tiltShiftYFilter=new U(t,e,r,i)}n&&(t.__proto__=n);var e={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.apply=function(t,e,r){var i=t.getFilterTexture();this.tiltShiftXFilter.apply(t,e,i),this.tiltShiftYFilter.apply(t,i,r),t.returnFilterTexture(i)},e.blur.get=function(){return this.tiltShiftXFilter.blur},e.blur.set=function(t){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=t},e.gradientBlur.get=function(){return this.tiltShiftXFilter.gradientBlur},e.gradientBlur.set=function(t){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=t},e.start.get=function(){return this.tiltShiftXFilter.start},e.start.set=function(t){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=t},e.end.get=function(){return this.tiltShiftXFilter.end},e.end.set=function(t){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=t},Object.defineProperties(t.prototype,e),t}(n.Filter),H=function(i){function t(t,e,r){void 0===t&&(t=200),void 0===e&&(e=4),void 0===r&&(r=20),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 twist(vec2 coord)\n{\n coord -= offset;\n\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n coord += offset;\n\n return coord;\n}\n\nvoid main(void)\n{\n\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = twist(coord);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord );\n\n}\n"),this.radius=t,this.angle=e,this.padding=r}i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t;var e={offset:{configurable:!0},radius:{configurable:!0},angle:{configurable:!0}};return e.offset.get=function(){return this.uniforms.offset},e.offset.set=function(t){this.uniforms.offset=t},e.radius.get=function(){return this.uniforms.radius},e.radius.set=function(t){this.uniforms.radius=t},e.angle.get=function(){return this.uniforms.angle},e.angle.set=function(t){this.uniforms.angle=t},Object.defineProperties(t.prototype,e),t}(n.Filter),W=function(n){function t(t,e,r,i){void 0===t&&(t=.1),void 0===e&&(e=[0,0]),void 0===r&&(r=0),void 0===i&&(i=-1),n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\n// author: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n\n float minGradient = uInnerRadius * 0.3;\n float innerRadius = (uInnerRadius + minGradient * 0.5) / filterArea.x;\n\n float gradient = uRadius * 0.3;\n float radius = (uRadius - gradient * 0.5) / filterArea.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / filterArea.xy - vTextureCoord);\n float dist = length(vec2(dir.x, dir.y * filterArea.y / filterArea.x));\n\n float strength = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius) {\n delta = innerRadius - dist;\n gap = minGradient;\n } else if (radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity\n delta = dist - radius;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / filterArea.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength *= delta;\n if (countLimit < 1.0)\n {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n }\n\n // randomize the lookup values to hide the fixed number of samples\n float offset = rand(vTextureCoord, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vTextureCoord + dir * percent;\n vec4 sample = texture2D(uSampler, p);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n // switch back from pre-multiplied alpha\n // color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.center=e,this.strength=t,this.innerRadius=r,this.radius=i}n&&(t.__proto__=n),(t.prototype=Object.create(n&&n.prototype)).constructor=t;var e={center:{configurable:!0},strength:{configurable:!0},innerRadius:{configurable:!0},radius:{configurable:!0}};return e.center.get=function(){return this.uniforms.uCenter},e.center.set=function(t){this.uniforms.uCenter=t},e.strength.get=function(){return this.uniforms.uStrength},e.strength.set=function(t){this.uniforms.uStrength=t},e.innerRadius.get=function(){return this.uniforms.uInnerRadius},e.innerRadius.set=function(t){this.uniforms.uInnerRadius=t},e.radius.get=function(){return this.uniforms.uRadius},e.radius.set=function(t){(t<0||t===1/0)&&(t=-1),this.uniforms.uRadius=t},Object.defineProperties(t.prototype,e),t}(n.Filter);return t.AdjustmentFilter=e,t.AdvancedBloomFilter=i,t.AsciiFilter=o,t.BevelFilter=a,t.BloomFilter=g,t.BulgePinchFilter=v,t.CRTFilter=w,t.ColorMapFilter=_,t.ColorReplaceFilter=y,t.ConvolutionFilter=b,t.CrossHatchFilter=x,t.DotFilter=T,t.DropShadowFilter=k,t.EmbossFilter=S,t.GlitchFilter=P,t.GlowFilter=E,t.GodrayFilter=C,t.KawaseBlurFilter=d,t.MotionBlurFilter=A,t.MultiColorReplaceFilter=I,t.OldFilmFilter=O,t.OutlineFilter=M,t.PixelateFilter=D,t.RGBSplitFilter=F,t.RadialBlurFilter=R,t.ReflectionFilter=z,t.ShockwaveFilter=L,t.SimpleLightmapFilter=j,t.TiltShiftAxisFilter=N,t.TiltShiftFilter=X,t.TiltShiftXFilter=B,t.TiltShiftYFilter=U,t.TwistFilter=H,t.ZoomBlurFilter=W,t}({},PIXI,PIXI,PIXI,PIXI.utils,PIXI,PIXI.filters,PIXI.filters),pixi_projection,pixi_projection;Object.assign(PIXI.filters,__filters),this.PIXI=this.PIXI||{},function(p,v){"use strict";var e,f,d=function(){function f(t,e,r){this.value=t,this.time=e,this.next=null,this.isStepped=!1,this.ease=r?"function"==typeof r?r:p.ParticleUtils.generateEase(r):null}return f.createList=function(t){if("list"in t){var e=t.list,r=void 0,i=void 0,n=e[0],o=n.value,a=n.time;if(i=r=new f("string"==typeof o?p.ParticleUtils.hexToRGB(o):o,a,t.ease),2a.time;)n=a,a=t[++o];l=(l-n.time)/(a.time-n.time);var u=f.hexToRGB(n.value),h=f.hexToRGB(a.value),c={r:(h.r-u.r)*l+u.r,g:(h.g-u.g)*l+u.g,b:(h.b-u.b)*l+u.b};i.next=new d(c,s/e),i=i.next}return r};var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function n(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var o=function(){function t(t){void 0===t&&(t=!1),this.current=null,this.next=null,this.isColor=!!t,this.interpolate=null,this.ease=null}return t.prototype.reset=function(t){this.current=t,this.next=t.next,this.next&&1<=this.next.time?this.interpolate=this.isColor?a:r:t.isStepped?this.interpolate=this.isColor?c:u:this.interpolate=this.isColor?l:s,this.ease=this.current.ease},t}();function r(t){return this.ease&&(t=this.ease(t)),(this.next.value-this.current.value)*t+this.current.value}function a(t){this.ease&&(t=this.ease(t));var e=this.current.value,r=this.next.value,i=(r.r-e.r)*t+e.r,n=(r.g-e.g)*t+e.g,o=(r.b-e.b)*t+e.b;return p.ParticleUtils.combineRGBComponents(i,n,o)}function s(t){for(this.ease&&(t=this.ease(t));t>this.next.time;)this.current=this.next,this.next=this.next.next;return t=(t-this.current.time)/(this.next.time-this.current.time),(this.next.value-this.current.value)*t+this.current.value}function l(t){for(this.ease&&(t=this.ease(t));t>this.next.time;)this.current=this.next,this.next=this.next.next;t=(t-this.current.time)/(this.next.time-this.current.time);var e=this.current.value,r=this.next.value,i=(r.r-e.r)*t+e.r,n=(r.g-e.g)*t+e.g,o=(r.b-e.b)*t+e.b;return p.ParticleUtils.combineRGBComponents(i,n,o)}function u(t){for(this.ease&&(t=this.ease(t));this.next&&t>this.next.time;)this.current=this.next,this.next=this.next.next;return this.current.value}function c(t){for(this.ease&&(t=this.ease(t));this.next&&t>this.next.time;)this.current=this.next,this.next=this.next.next;var e=this.current.value;return p.ParticleUtils.combineRGBComponents(e.r,e.g,e.b)}var m,g=function(r){function i(t){var e=r.call(this)||this;return e.emitter=t,e.anchor.x=e.anchor.y=.5,e.velocity=new v.Point,e.rotationSpeed=0,e.rotationAcceleration=0,e.maxLife=0,e.age=0,e.ease=null,e.extraData=null,e.alphaList=new o,e.speedList=new o,e.speedMultiplier=1,e.acceleration=new v.Point,e.maxSpeed=NaN,e.scaleList=new o,e.scaleMultiplier=1,e.colorList=new o(!0),e._doAlpha=!1,e._doScale=!1,e._doSpeed=!1,e._doAcceleration=!1,e._doColor=!1,e._doNormalMovement=!1,e._oneOverLife=0,e.next=null,e.prev=null,e.init=e.init,e.Particle_init=i.prototype.init,e.update=e.update,e.Particle_update=i.prototype.update,e.Sprite_destroy=r.prototype.destroy,e.Particle_destroy=i.prototype.destroy,e.applyArt=e.applyArt,e.kill=e.kill,e}return n(i,r),i.prototype.init=function(){this.age=0,this.velocity.x=this.speedList.current.value*this.speedMultiplier,this.velocity.y=0,p.ParticleUtils.rotatePoint(this.rotation,this.velocity),this.noRotation?this.rotation=0:this.rotation*=p.ParticleUtils.DEG_TO_RADS,this.rotationSpeed*=p.ParticleUtils.DEG_TO_RADS,this.rotationAcceleration*=p.ParticleUtils.DEG_TO_RADS,this.alpha=this.alphaList.current.value,this.scale.x=this.scale.y=this.scaleList.current.value,this._doAlpha=!!this.alphaList.current.next,this._doSpeed=!!this.speedList.current.next,this._doScale=!!this.scaleList.current.next,this._doColor=!!this.colorList.current.next,this._doAcceleration=0!==this.acceleration.x||0!==this.acceleration.y,this._doNormalMovement=this._doSpeed||0!==this.speedList.current.value||this._doAcceleration,this._oneOverLife=1/this.maxLife;var t=this.colorList.current.value;this.tint=p.ParticleUtils.combineRGBComponents(t.r,t.g,t.b),this.visible=!0},i.prototype.applyArt=function(t){this.texture=t||v.Texture.EMPTY},i.prototype.update=function(t){if(this.age+=t,this.age>=this.maxLife||this.age<0)return this.kill(),-1;var e=this.age*this._oneOverLife;if(this.ease&&(e=4==this.ease.length?this.ease(e,0,1,1):this.ease(e)),this._doAlpha&&(this.alpha=this.alphaList.interpolate(e)),this._doScale){var r=this.scaleList.interpolate(e)*this.scaleMultiplier;this.scale.x=this.scale.y=r}if(this._doNormalMovement){var i=void 0,n=void 0;if(this._doSpeed){var o=this.speedList.interpolate(e)*this.speedMultiplier;p.ParticleUtils.normalize(this.velocity),p.ParticleUtils.scaleBy(this.velocity,o),i=this.velocity.x*t,n=this.velocity.y*t}else if(this._doAcceleration){var a=this.velocity.x,s=this.velocity.y;if(this.velocity.x+=this.acceleration.x*t,this.velocity.y+=this.acceleration.y*t,this.maxSpeed){var l=p.ParticleUtils.length(this.velocity);l>this.maxSpeed&&p.ParticleUtils.scaleBy(this.velocity,this.maxSpeed/l)}i=(a+this.velocity.x)/2*t,n=(s+this.velocity.y)/2*t}else i=this.velocity.x*t,n=this.velocity.y*t;this.position.x+=i,this.position.y+=n}if(this._doColor&&(this.tint=this.colorList.interpolate(e)),0!==this.rotationAcceleration){var u=this.rotationSpeed+this.rotationAcceleration*t;this.rotation+=(this.rotationSpeed+u)/2*t,this.rotationSpeed=u}else 0!==this.rotationSpeed?this.rotation+=this.rotationSpeed*t:this.acceleration&&!this.noRotation&&(this.rotation=Math.atan2(this.velocity.y,this.velocity.x));return e},i.prototype.kill=function(){this.emitter.recycle(this)},i.prototype.destroy=function(){this.parent&&this.parent.removeChild(this),this.Sprite_destroy(),this.emitter=this.velocity=this.colorList=this.scaleList=this.alphaList=this.speedList=this.ease=this.next=this.prev=null},i.parseArt=function(t){var e;for(e=t.length;0<=e;--e)"string"==typeof t[e]&&(t[e]=h(t[e]));if(p.ParticleUtils.verbose)for(e=t.length-1;0=this.maxParticles)this._spawnTimer+=this._frequency;else{var l=void 0;if(l=this.minLifetime==this.maxLifetime?this.minLifetime:Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer=this.spawnChance)){var p=void 0;if(this._poolFirst?(p=this._poolFirst,this._poolFirst=this._poolFirst.next,p.next=null):p=new this.particleConstructor(this),1=this.particleImages.length)&&(this._currentImageIndex=0)):p.applyArt(this.particleImages[Math.floor(Math.random()*this.particleImages.length)]):p.applyArt(this.particleImages[0]),p.alphaList.reset(this.startAlpha),1!=this.minimumSpeedMultiplier&&(p.speedMultiplier=Math.random()*(1-this.minimumSpeedMultiplier)+this.minimumSpeedMultiplier),p.speedList.reset(this.startSpeed),p.acceleration.x=this.acceleration.x,p.acceleration.y=this.acceleration.y,p.maxSpeed=this.maxSpeed,1!=this.minimumScaleMultiplier&&(p.scaleMultiplier=Math.random()*(1-this.minimumScaleMultiplier)+this.minimumScaleMultiplier),p.scaleList.reset(this.startScale),p.colorList.reset(this.startColor),this.minRotationSpeed==this.maxRotationSpeed?p.rotationSpeed=this.minRotationSpeed:p.rotationSpeed=Math.random()*(this.maxRotationSpeed-this.minRotationSpeed)+this.minRotationSpeed,p.rotationAcceleration=this.rotationAcceleration,p.noRotation=this.noRotation,p.maxLife=l,p.blendMode=this.particleBlendMode,p.ease=this.customEase,p.extraData=this.extraData,this.applyAdditionalProperties(p),this._spawnFunc(p,u,h,e),p.init(),p.update(-this._spawnTimer),p.parent){var d=this._parent.children;if(d[0]==p)d.shift();else if(d[d.length-1]==p)d.pop();else{var m=d.indexOf(p);d.splice(m,1)}this.addAtBack?d.unshift(p):d.push(p)}else this.addAtBack?this._parent.addChildAt(p,0):this._parent.addChild(p);this._activeParticlesLast?((this._activeParticlesLast.next=p).prev=this._activeParticlesLast,this._activeParticlesLast=p):this._activeParticlesLast=this._activeParticlesFirst=p,++this.particleCount}}this._spawnTimer+=this._frequency}}if(this._posChanged&&(this._prevEmitterPos.x=a,this._prevEmitterPos.y=s,this._prevPosIsValid=!0,this._posChanged=!1),!this._emit&&!this._activeParticlesFirst){if(this._completeCallback){var g=this._completeCallback;this._completeCallback=null,g()}this._destroyWhenComplete&&this.destroy()}}},t.prototype.applyAdditionalProperties=function(t){},t.prototype._spawnPoint=function(t,e,r){this.minStartRotation==this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,t.position.x=e,t.position.y=r},t.prototype._spawnRect=function(t,e,r){this.minStartRotation==this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,b.x=Math.random()*this.spawnRect.width+this.spawnRect.x,b.y=Math.random()*this.spawnRect.height+this.spawnRect.y,0!==this.rotation&&p.ParticleUtils.rotatePoint(this.rotation,b),t.position.x=e+b.x,t.position.y=r+b.y},t.prototype._spawnCircle=function(t,e,r){this.minStartRotation==this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,b.x=Math.random()*this.spawnCircle.radius,b.y=0,p.ParticleUtils.rotatePoint(360*Math.random(),b),b.x+=this.spawnCircle.x,b.y+=this.spawnCircle.y,0!==this.rotation&&p.ParticleUtils.rotatePoint(this.rotation,b),t.position.x=e+b.x,t.position.y=r+b.y},t.prototype._spawnRing=function(t,e,r){var i=this.spawnCircle;this.minStartRotation==this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,i.minRadius!==i.radius?b.x=Math.random()*(i.radius-i.minRadius)+i.minRadius:b.x=i.radius,b.y=0;var n=360*Math.random();t.rotation+=n,p.ParticleUtils.rotatePoint(n,b),b.x+=this.spawnCircle.x,b.y+=this.spawnCircle.y,0!==this.rotation&&p.ParticleUtils.rotatePoint(this.rotation,b),t.position.x=e+b.x,t.position.y=r+b.y},t.prototype._spawnPolygonalChain=function(t,e,r){this.minStartRotation==this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,this.spawnPolygonalChain.getRandomPoint(b),0!==this.rotation&&p.ParticleUtils.rotatePoint(this.rotation,b),t.position.x=e+b.x,t.position.y=r+b.y},t.prototype._spawnBurst=function(t,e,r,i){0===this.particleSpacing?t.rotation=360*Math.random():t.rotation=this.angleStart+this.particleSpacing*i+this.rotation,t.position.x=e,t.position.y=r},t.prototype.cleanup=function(){var t,e;for(t=this._activeParticlesFirst;t;t=e)e=t.next,this.recycle(t),t.parent&&t.parent.removeChild(t);this._activeParticlesFirst=this._activeParticlesLast=null,this.particleCount=0},t.prototype.destroy=function(){var t;this.autoUpdate=!1,this.cleanup();for(var e=this._poolFirst;e;e=t)t=e.next,e.destroy();this._poolFirst=this._parent=this.particleImages=this.spawnPos=this.ownerPos=this.startColor=this.startScale=this.startAlpha=this.startSpeed=this.customEase=this._completeCallback=null},t}(),w=new v.Point,T=["pow","sqrt","abs","floor","round","ceil","E","PI","sin","cos","tan","asin","acos","atan","atan2","log"],k=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(T).join("|"),"g"),S=function(r){function t(t){var e=r.call(this,t)||this;return e.path=null,e.initialRotation=0,e.initialPosition=new v.Point,e.movement=0,e}return n(t,r),t.prototype.init=function(){this.initialRotation=this.rotation,this.Particle_init(),this.path=this.extraData.path,this._doNormalMovement=!this.path,this.movement=0,this.initialPosition.x=this.position.x,this.initialPosition.y=this.position.y},t.prototype.update=function(t){var e=this.Particle_update(t);if(0<=e&&this.path){var r=this.speedList.interpolate(e)*this.speedMultiplier;this.movement+=r*t,w.x=this.movement,w.y=this.path(this.movement),p.ParticleUtils.rotatePoint(this.initialRotation,w),this.position.x=this.initialPosition.x+w.x,this.position.y=this.initialPosition.y+w.y}return e},t.prototype.destroy=function(){this.Particle_destroy(),this.path=this.initialPosition=null},t.parseArt=function(t){return g.parseArt(t)},t.parseData=function(t){var e={};if(t&&t.path)try{e.path=function(t){for(var e=t.match(k),r=e.length-1;0<=r;--r)0<=T.indexOf(e[r])&&(e[r]="Math."+e[r]);return t=e.join(""),new Function("x","return "+t+";")}(t.path)}catch(t){p.ParticleUtils.verbose&&console.error("PathParticle: error in parsing path expression"),e.path=null}else p.ParticleUtils.verbose&&console.error("PathParticle requires a path string in extraData!"),e.path=null;return e},t}(g),P=function(r){function t(t){var e=r.call(this,t)||this;return e.textures=null,e.duration=0,e.framerate=0,e.elapsed=0,e.loop=!1,e}return n(t,r),t.prototype.init=function(){this.Particle_init(),this.elapsed=0,this.framerate<0&&(this.duration=this.maxLife,this.framerate=this.textures.length/this.duration)},t.prototype.applyArt=function(t){this.textures=t.textures,this.framerate=t.framerate,this.duration=t.duration,this.loop=t.loop},t.prototype.update=function(t){var e=this.Particle_update(t);if(0<=e){this.elapsed+=t,this.elapsed>this.duration&&(this.loop?this.elapsed=this.elapsed%this.duration:this.elapsed=this.duration-1e-6);var r=this.elapsed*this.framerate+1e-7|0;this.texture=this.textures[r]||v.Texture.EMPTY}return e},t.prototype.destroy=function(){this.Particle_destroy(),this.textures=null},t.parseArt=function(t){for(var e,r,i,n,o,a=[],s=0;se[s]&&(i=e[s]),oe[s+1]&&(n=e[s+1]),af[u]){l=c[s];c[s]=c[u],c[u]=l;var h=f[s];f[s]=f[u],f[u]=h}if(e[0]=c[0].x,e[1]=c[0].y,e[2]=c[1].x,e[3]=c[1].y,e[4]=c[2].x,e[5]=c[2].y,e[6]=c[3].x,e[7]=c[3].y,(c[3].x-c[2].x)*(c[1].y-c[2].y)-(c[1].x-c[2].x)*(c[3].y-c[2].y)<0)return e[4]=c[3].x,void(e[5]=c[3].y)}},t}();t.Surface=e}(pixi_projection||(pixi_projection={})),function(t){var k=new PIXI.Matrix,n=new PIXI.Rectangle,S=new PIXI.Point,e=function(e){function t(){var t=e.call(this)||this;return t.distortion=new PIXI.Point,t}return __extends(t,e),t.prototype.clear=function(){this.distortion.set(0,0)},t.prototype.apply=function(t,e){e=e||new PIXI.Point;var r=this.distortion,i=t.x*t.y;return e.x=t.x+r.x*i,e.y=t.y+r.y*i,e},t.prototype.applyInverse=function(t,e){e=e||new PIXI.Point;var r=t.x,i=t.y,n=this.distortion.x,o=this.distortion.y;if(0==n)e.x=r,e.y=i/(1+o*r);else if(0==o)e.y=i,e.x=r/(1+n*i);else{var a=.5*(i*n-r*o+1)/o,s=a*a+r/o;if(s<=1e-5)return void e.set(NaN,NaN);e.x=0 vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n uv.x = vTrans1.x * surface2.x + vTrans1.y * surface2.y + vTrans1.z;\n uv.y = vTrans2.x * surface2.x + vTrans2.y * surface2.y + vTrans2.z;\n pixels = uv * samplerSize[0];\n \n if (pixels.x < vFrame.x || pixels.x > vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n discard;\n }\n}\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = 1.0; //edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\n%forloop%\ngl_FragColor = color * rColor;\n}",geometryClass:r.Batch3dGeometry,vertexSize:7},t),i=e.vertex,n=e.fragment,o=e.vertexSize,a=e.geometryClass;return function(r){function t(t){var e=r.call(this,t)||this;return e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e.shaderGenerator=new PIXI.BatchShaderGenerator(i,n),e.geometryClass=a,e.vertexSize=o,e}return __extends(t,r),t.prototype.getUniforms=function(t){var e=t.proj;this._shader;return null!==e.surface?e.uniforms:null!==e._activeProjection?e._activeProjection.uniforms:this.defUniforms},t.prototype.packGeometry=function(t,e,r,i,n,o){for(var a=n/this.vertexSize,s=(t.uvs,t.indices),l=t.vertexData,u=t._texture._frame,h=t.aTrans,c=Math.min(t.worldAlpha,1),f=c<1&&t._texture.baseTexture.premultiplyAlpha?d(t._tintRGB,c):t._tintRGB+(255*c<<24),p=0;p=o.TRANSFORM_STEP.PROJ?(i||this.displayObjectUpdateTransform(),this.proj.affine?this.transform.worldTransform.applyInverse(t,r):this.proj.world.applyInverse(t,r)):(this.parent?r=this.parent.worldTransform.applyInverse(t,r):r.copyFrom(t),n===o.TRANSFORM_STEP.NONE?r:this.transform.localTransform.applyInverse(r,r))},Object.defineProperty(t.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),t}(PIXI.Container);o.Container2d=t,o.container2dToLocal=t.prototype.toLocal}(pixi_projection||(pixi_projection={})),function(t){var l,e,v=PIXI.Point,r=[1,0,0,0,1,0,0,0,1];(e=l=t.AFFINE||(t.AFFINE={}))[e.NONE=0]="NONE",e[e.FREE=1]="FREE",e[e.AXIS_X=2]="AXIS_X",e[e.AXIS_Y=3]="AXIS_Y",e[e.POINT=4]="POINT",e[e.AXIS_XR=5]="AXIS_XR";var i=function(){function t(t){this.floatArray=null,this.mat3=new Float64Array(t||r)}return Object.defineProperty(t.prototype,"a",{get:function(){return this.mat3[0]/this.mat3[8]},set:function(t){this.mat3[0]=t*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this.mat3[1]/this.mat3[8]},set:function(t){this.mat3[1]=t*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"c",{get:function(){return this.mat3[3]/this.mat3[8]},set:function(t){this.mat3[3]=t*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"d",{get:function(){return this.mat3[4]/this.mat3[8]},set:function(t){this.mat3[4]=t*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tx",{get:function(){return this.mat3[6]/this.mat3[8]},set:function(t){this.mat3[6]=t*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ty",{get:function(){return this.mat3[7]/this.mat3[8]},set:function(t){this.mat3[7]=t*this.mat3[8]},enumerable:!0,configurable:!0}),t.prototype.set=function(t,e,r,i,n,o){var a=this.mat3;return a[0]=t,a[1]=e,a[2]=0,a[3]=r,a[4]=i,a[5]=0,a[6]=n,a[7]=o,a[8]=1,this},t.prototype.toArray=function(t,e){this.floatArray||(this.floatArray=new Float32Array(9));var r=e||this.floatArray,i=this.mat3;return t?(r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7]):(r[0]=i[0],r[1]=i[3],r[2]=i[6],r[3]=i[1],r[4]=i[4],r[5]=i[7],r[6]=i[2],r[7]=i[5]),r[8]=i[8],r},t.prototype.apply=function(t,e){e=e||new PIXI.Point;var r=this.mat3,i=t.x,n=t.y,o=1/(r[2]*i+r[5]*n+r[8]);return e.x=o*(r[0]*i+r[3]*n+r[6]),e.y=o*(r[1]*i+r[4]*n+r[7]),e},t.prototype.translate=function(t,e){var r=this.mat3;return r[0]+=t*r[2],r[1]+=e*r[2],r[3]+=t*r[5],r[4]+=e*r[5],r[6]+=t*r[8],r[7]+=e*r[8],this},t.prototype.scale=function(t,e){var r=this.mat3;return r[0]*=t,r[1]*=e,r[3]*=t,r[4]*=e,r[6]*=t,r[7]*=e,this},t.prototype.scaleAndTranslate=function(t,e,r,i){var n=this.mat3;n[0]=t*n[0]+r*n[2],n[1]=e*n[1]+i*n[2],n[3]=t*n[3]+r*n[5],n[4]=e*n[4]+i*n[5],n[6]=t*n[6]+r*n[8],n[7]=e*n[7]+i*n[8]},t.prototype.applyInverse=function(t,e){e=e||new v;var r=this.mat3,i=t.x,n=t.y,o=r[0],a=r[3],s=r[6],l=r[1],u=r[4],h=r[7],c=r[2],f=r[5],p=r[8],d=(p*u-h*f)*i+(-p*a+s*f)*n+(h*a-s*u),m=(-p*l+h*c)*i+(p*o-s*c)*n+(-h*o+s*l),g=(f*l-u*c)*i+(-f*o+a*c)*n+(u*o-a*l);return e.x=d/g,e.y=m/g,e},t.prototype.invert=function(){var t=this.mat3,e=t[0],r=t[1],i=t[2],n=t[3],o=t[4],a=t[5],s=t[6],l=t[7],u=t[8],h=u*o-a*l,c=-u*n+a*s,f=l*n-o*s,p=e*h+r*c+i*f;return p&&(p=1/p,t[0]=h*p,t[1]=(-u*r+i*l)*p,t[2]=(a*r-i*o)*p,t[3]=c*p,t[4]=(u*e-i*s)*p,t[5]=(-a*e+i*n)*p,t[6]=f*p,t[7]=(-l*e+r*s)*p,t[8]=(o*e-r*n)*p),this},t.prototype.identity=function(){var t=this.mat3;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},t.prototype.clone=function(){return new t(this.mat3)},t.prototype.copyTo2dOr3d=function(t){var e=this.mat3,r=t.mat3;return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],t},t.prototype.copyTo=function(t,e,r){var i=this.mat3,n=1/i[8],o=i[6]*n,a=i[7]*n;if(t.a=(i[0]-i[2]*o)*n,t.b=(i[1]-i[2]*a)*n,t.c=(i[3]-i[5]*o)*n,t.d=(i[4]-i[5]*a)*n,t.tx=o,t.ty=a,2<=e){var s=t.a*t.d-t.b*t.c;r||(s=Math.abs(s)),e===l.POINT?(s=0>0,0!==f._cycle&&f._cycle===f._totalTime/a&&m<=t&&f._cycle--,f._time=f._totalTime-f._cycle*a,f._yoyo&&0!=(1&f._cycle)&&(f._time=v-f._time,(c=f._yoyoEase||f.vars.yoyoEase)&&(f._yoyoEase||(!0!==c||f._initted?f._yoyoEase=c=!0===c?f._ease:c instanceof Ease?c:Ease.map[c]:(c=f.vars.ease,f._yoyoEase=c=c?c instanceof Ease?c:"function"==typeof c?new Ease(c,f.vars.easeParams):Ease.map[c]||y.defaultEase:y.defaultEase)),f.ratio=c?1-c.getRatio((v-f._time)/v):0)),f._time>v?f._time=v:f._time<0&&(f._time=0)),f._easeType&&!c?(s=f._time/v,(1===(l=f._easeType)||3===l&&.5<=s)&&(s=1-s),3===l&&(s*=2),1===(u=f._easePower)?s*=s:2===u?s*=s*s:3===u?s*=s*s*s:4===u&&(s*=s*s*s*s),f.ratio=1===l?1-s:2===l?s:f._time/v<.5?s/2:1-s/2):c||(f.ratio=f._ease.getRatio(f._time/v))),d!==f._time||r||g!==f._cycle){if(!f._initted){if(f._init(),!f._initted||f._gc)return;if(!r&&f._firstPT&&(!1!==f.vars.lazy&&f._duration||f.vars.lazy&&!f._duration))return f._time=d,f._totalTime=m,f._rawPrevTime=_,f._cycle=g,x.lazyTweens.push(f),void(f._lazy=[t,e]);!f._time||i||c?i&&this._ease._calcEnd&&!c&&(f.ratio=f._ease.getRatio(0===f._time?0:1)):f.ratio=f._ease.getRatio(f._time/v)}for(!1!==f._lazy&&(f._lazy=!1),f._active||!f._paused&&f._time!==d&&0<=t&&(f._active=!0),0===m&&(2===f._initted&&0t._startTime;l._timeline;)u&&l._timeline.smoothChildTiming?l.totalTime(l._totalTime,!0):l._gc&&l._enabled(!0,!1),l=l._timeline;return h},r.remove=function(t){if(t instanceof c){this._remove(t,!1);var e=t._timeline=t.vars.useFrames?c._rootFramesTimeline:c._rootTimeline;return t._startTime=(t._paused?t._pauseTime:e._time)-(t._reversed?t.totalDuration()-t._totalTime:t._totalTime)/t._timeScale,this}if(t instanceof Array||t&&t.push&&p(t)){for(var r=t.length;-1<--r;)this.remove(t[r]);return this}return"string"==typeof t?this.removeLabel(t):this.kill(null,t)},r._remove=function(t,e){return f.prototype._remove.call(this,t,e),this._last?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},r.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},r.insert=r.insertMultiple=function(t,e,r,i){return this.add(t,e||0,r,i)},r.appendMultiple=function(t,e,r,i){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),r,i)},r.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},r.addPause=function(t,e,r,i){var n=d.delayedCall(0,o,r,i||this);return n.vars.onComplete=n.vars.onReverseComplete=e,n.data="isPause",this._hasPause=!0,this.add(n,t)},r.removeLabel=function(t){return delete this._labels[t],this},r.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},r._parseTimeOrLabel=function(t,e,r,i){var n,o;if(i instanceof c&&i.timeline===this)this.remove(i);else if(i&&(i instanceof Array||i.push&&p(i)))for(o=i.length;-1<--o;)i[o]instanceof c&&i[o].timeline===this&&this.remove(i[o]);if(n="number"!=typeof t||e?99999999999=t&&!l;)i._duration||"isPause"===i.data&&0c._time;)l.render(l._reversed?l.totalDuration()-(t-l._startTime)*l._timeScale:(t-l._startTime)*l._timeScale,e,r),l=l._prev;l=null,c.pause(),c._pauseTime=h}i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(t-i._startTime)*i._timeScale,e,r):i.render((t-i._startTime)*i._timeScale,e,r)}i=o}c._onUpdate&&(e||(v.length&&_(),c._callback("onUpdate"))),a&&(c._gc||d!==c._startTime&&m===c._timeScale||(0===c._time||p>=c.totalDuration())&&(n&&(v.length&&_(),c._timeline.autoRemoveChildren&&c._enabled(!1,!1),c._active=!1),!e&&c.vars[a]&&c._callback(a)))}},r._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof m&&t._hasPausedChild())return!0;t=t._next}return!1},r.getChildren=function(t,e,r,i){i=i||-9999999999;for(var n=[],o=this._first,a=0;o;)o._startTime=r&&(n._startTime+=t),n=n._next;if(e)for(i in o)o[i]>=r&&(o[i]+=t);return this._uncache(!0)},r._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var r=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),i=r.length,n=!1;-1<--i;)r[i]._kill(t,e)&&(n=!0);return n},r.clear=function(t){var e=this.getChildren(!1,!0,!0),r=e.length;for(this._time=this._totalTime=0;-1<--r;)e[r]._enabled(!1,!1);return!1!==t&&(this._labels={}),this._uncache(!0)},r.invalidate=function(){for(var t=this._first;t;)t.invalidate(),t=t._next;return c.prototype.invalidate.call(this)},r._enabled=function(t,e){if(t===this._gc)for(var r=this._first;r;)r._enabled(t,!0),r=r._next;return f.prototype._enabled.call(this,t,e)},r.totalTime=function(t,e,r){this._forcingPlayhead=!0;var i=c.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,i},r.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},r.totalDuration=function(t){if(arguments.length)return t&&this.totalDuration()?this.timeScale(this._totalDuration/t):this;if(this._dirty){for(var e,r,i=0,n=this,o=n._last,a=999999999999;o;)e=o._prev,o._dirty&&o.totalDuration(),o._startTime>a&&n._sortChildren&&!o._paused&&!n._calculatingDuration?(n._calculatingDuration=1,n.add(o,o._startTime-o._delay),n._calculatingDuration=0):a=o._startTime,o._startTime<0&&!o._paused&&(i-=o._startTime,n._timeline.smoothChildTiming&&(n._startTime+=o._startTime/n._timeScale,n._time-=o._startTime,n._totalTime-=o._startTime,n._rawPrevTime-=o._startTime),n.shiftChildren(-o._startTime,!1,-9999999999),a=0),i<(r=o._startTime+o._totalDuration/o._timeScale)&&(i=r),o=e;n._duration=n._totalDuration=i,n._dirty=!1}return this._totalDuration},r.paused=function(t){if(!1===t&&this._paused)for(var e=this._first;e;)e._startTime===this._time&&"isPause"===e.data&&(e._rawPrevTime=0),e=e._next;return c.prototype.paused.apply(this,arguments)},r.usesFrames=function(){for(var t=this._timeline;t._timeline;)t=t._timeline;return t===c._rootFramesTimeline},r.rawTime=function(t){return t&&(this._paused||this._repeat&&0>0,f._cycle&&f._cycle===f._totalTime/l&&g<=t&&f._cycle--,f._time=f._totalTime-f._cycle*l,f._yoyo&&1&f._cycle&&(f._time=m-f._time),f._time>m?t=(f._time=m)+1e-4:f._time<0?f._time=t=0:t=f._time));if(f._hasPause&&!f._forcingPlayhead&&!e){if(p<(t=f._time)||f._repeat&&x!==f._cycle)for(i=f._first;i&&i._startTime<=t&&!u;)i._duration||"isPause"!==i.data||i.ratio||0===i._startTime&&0===f._rawPrevTime||(u=i),i=i._next;else for(i=f._last;i&&i._startTime>=t&&!u;)i._duration||"isPause"===i.data&&0f._time;)u.render(u._reversed?u.totalDuration()-(t-u._startTime)*u._timeScale:(t-u._startTime)*u._timeScale,e,r),u=u._prev;u=null,f.pause(),f._pauseTime=c}i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(t-i._startTime)*i._timeScale,e,r):i.render((t-i._startTime)*i._timeScale,e,r)}i=o}f._onUpdate&&(e||(A.length&&I(),f._callback("onUpdate"))),a&&(f._locked||f._gc||v!==f._startTime&&_===f._timeScale||(0===f._time||d>=f.totalDuration())&&(n&&(A.length&&I(),f._timeline.autoRemoveChildren&&f._enabled(!1,!1),f._active=!1),!e&&f.vars[a]&&f._callback(a)))}else g!==f._totalTime&&f._onUpdate&&(e||f._callback("onUpdate"))},n.getActive=function(t,e,r){var i,n,o=[],a=this.getChildren(t||null==t,e||null==t,!!r),s=0,l=a.length;for(i=0;it)return r[e].name;return null},n.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),r=e.length;-1<--r;)if(e[r].time>0||6)-1,c=[],f=[];for(r in t)d(t[r],a,e);for(n=a.length,i=0;i>0]=f,s[o]=u,l=0,f=[]);return{length:u,lengths:s,segments:c}}(this._beziers,this._timeRes);this._length=f.length,this._lengths=f.lengths,this._segments=f.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(c=this._autoRotate)for(this._initialRotations=[],c[0]instanceof Array||(this._autoRotate=c=[c]),o=c.length;-1<--o;){for(a=0;a<3;a++)i=c[o][a],this._func[i]="function"==typeof t[i]&&t[i.indexOf("set")||"function"!=typeof t["get"+i.substr(3)]?i:"get"+i.substr(3)];i=c[o][2],this._initialRotations[o]=(this._func[i]?this._func[i].call(this._target):this._target[i])||0,this._overwriteProps.push(i)}return this._startRatio=r.vars.runBackwards?1:0,!0},set:function(t){var e,r,i,n,o,a,s,l,u,h,c,f=this._segCount,p=this._func,d=this._target,m=t!==this._startRatio;if(this._timeRes){if(u=this._lengths,h=this._curSeg,c=t*this._length,i=this._li,c>this._l2&&i=c;);0===i&&cthis._s2&&i=c;);0===i&&c>0)*(1/f))*f;for(r=1-a,i=this._props.length;-1<--i;)n=this._props[i],s=(a*a*(o=this._beziers[n][e]).da+3*r*(a*o.ca+r*o.ba))*a+o.a,this._mod[n]&&(s=this._mod[n](s,d)),p[n]?d[n](s):d[n]=s;if(this._autoRotate){var g,v,_,y,b,x,w,T=this._autoRotate;for(i=T.length;-1<--i;)n=T[i][2],x=T[i][3]||0,w=!0===T[i][4]?1:k,o=this._beziers[T[i][0]],g=this._beziers[T[i][1]],o&&g&&(o=o[e],g=g[e],v=o.a+(o.b-o.a)*a,v+=((y=o.b+(o.c-o.b)*a)-v)*a,y+=(o.c+(o.d-o.c)*a-y)*a,_=g.a+(g.b-g.a)*a,_+=((b=g.b+(g.c-g.b)*a)-_)*a,b+=(g.c+(g.d-g.c)*a-b)*a,s=m?Math.atan2(b-_,y-v)*w+x:this._initialRotations[i],this._mod[n]&&(s=this._mod[n](s,d)),p[n]?d[n](s):d[n]=s)}}}),t=g.prototype,g.bezierThrough=p,g.cubicToQuadratic=S,g._autoCSS=!0,g.quadraticToCubic=function(t,e,r){return new _(t,(2*e+t)/3,(2*e+r)/3,r)},g._cssRegister=function(){var t=r.CSSPlugin;if(t){var e=t._internals,p=e._parseToProxy,d=e._setPluginRatio,m=e.CSSPropTween;e._registerComplexSpecialProp("bezier",{parser:function(t,e,r,i,n,o){e instanceof Array&&(e={values:e}),o=new g;var a,s,l,u=e.values,h=u.length-1,c=[],f={};if(h<0)return n;for(a=0;a<=h;a++)l=p(t,u[a],i,n,o,h!==a),c[a]=l.end;for(s in e)f[s]=e[s];return f.values=c,(n=new m(t,"bezier",0,0,l.pt,2)).data=l,n.plugin=o,n.setRatio=d,0===f.autoRotate&&(f.autoRotate=!0),!f.autoRotate||f.autoRotate instanceof Array||(a=!0===f.autoRotate?0:Number(f.autoRotate),f.autoRotate=null!=l.end.left?[["left","top","rotation",a,!1]]:null!=l.end.x&&[["x","y","rotation",a,!1]]),f.autoRotate&&(i._transform||i._enableTransforms(!1),l.autoRotate=i._target._gsTransform,l.proxy.rotation=l.autoRotate.rotation||0,i._overwriteProps.push("rotation")),o._onInitTween(l.proxy,f,i._tween),n}})}},t._mod=function(t){for(var e,r=this._overwriteProps,i=r.length;-1<--i;)(e=t[r[i]])&&"function"==typeof e&&(this._mod[r[i]]=e)},t._kill=function(t){var e,r,i=this._props;for(e in this._beziers)if(e in t)for(delete this._beziers[e],delete this._func[e],r=i.length;-1<--r;)i[r]===e&&i.splice(r,1);if(i=this._autoRotate)for(r=i.length;-1<--r;)t[i[r][2]]&&i.splice(r,1);return this._super._kill.call(this,t)},_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(o,B){var d,k,S,m,U=function(){o.call(this,"css"),this._overwriteProps.length=0,this.setRatio=U.prototype.setRatio},u=_gsScope._gsDefine.globals,g={},t=U.prototype=new o("css");(t.constructor=U).version="2.1.3",U.API=2,U.defaultTransformPerspective=0,U.defaultSkewType="compensated",U.defaultSmoothOrigin=!0,t="px",U.suffixMap={top:t,right:t,bottom:t,left:t,width:t,height:t,fontSize:t,padding:t,margin:t,perspective:t,lineHeight:""};var E,v,_,L,y,P,C,A,e,r,I=/(?:\-|\.|\b)(\d|\.|e\-)+/g,O=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,b=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,n=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b),?/gi,h=/(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,M=/(?:\d|\-|\+|=|#|\.)*/g,D=/opacity *= *([^)]*)/i,x=/opacity:([^;]*)/i,a=/alpha\(opacity *=.+?\)/i,w=/^(rgb|hsl)/,s=/([A-Z])/g,l=/-([a-z])/gi,T=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,c=function(t,e){return e.toUpperCase()},p=/(?:Left|Right|Width)/i,f=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,R=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,z=/,(?=[^\)]*(?:\(|$))/gi,F=/[\s,\(]/i,j=Math.PI/180,X=180/Math.PI,N={},i={style:{}},H=_gsScope.document||{createElement:function(){return i}},W=function(t,e){var r=H.createElementNS?H.createElementNS(e||"http://www.w3.org/1999/xhtml",t):H.createElement(t);return r.style?r:H.createElement(t)},q=W("div"),G=W("img"),V=U._internals={_specialProps:g},Y=(_gsScope.navigator||{}).userAgent||"",Z=(e=Y.indexOf("Android"),r=W("a"),_=-1!==Y.indexOf("Safari")&&-1===Y.indexOf("Chrome")&&(-1===e||3>16,t>>8&255,255&t];else{if(","===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)),mt[t])r=mt[t];else if("#"===t.charAt(0))4===t.length&&(t="#"+(i=t.charAt(1))+i+(n=t.charAt(2))+n+(o=t.charAt(3))+o),r=[(t=parseInt(t.substr(1),16))>>16,t>>8&255,255&t];else if("hsl"===t.substr(0,3))if(r=f=t.match(I),e){if(-1!==t.indexOf("="))return t.match(O)}else a=Number(r[0])%360/360,s=Number(r[1])/100,i=2*(l=Number(r[2])/100)-(n=l<=.5?l*(s+1):l+s-l*s),3i--)for(;++ii--)for(;++i>0];return i.parse(t,a,n,o)}},wt=(V._setPluginRatio=function(t){this.plugin.setRatio(t);for(var e,r,i,n,o,a=this.data,s=a.proxy,l=a.firstMPT;l;)e=s[l.v],l.r?e=l.r(e):e<1e-6&&-1e-6s.length?l.length:s.length,a=0;ao.pr;)a=a._next;(o._prev=a?a._prev:l)?o._prev._next=o:s=o,(o._next=a)?a._prev=o:l=o,o=u}this._firstPT=s}return!0},t.parse=function(t,e,r,i){var n,o,a,s,l,u,h,c,f,p,d=t.style;for(n in e){if(u=e[n],o=g[n],"function"!=typeof u||o&&o.allowFunc||(u=u(A,C)),o)r=o.parse(t,u,n,this,r,i,e);else{if("--"===n.substr(0,2)){this._tween._propLookup[n]=this._addTween.call(this._tween,t.style,"setProperty",rt(t).getPropertyValue(n)+"",u+"",n,!1,n);continue}l=it(t,n,S)+"",f="string"==typeof u,"color"===n||"fill"===n||"stroke"===n||-1!==n.indexOf("Color")||f&&w.test(u)?(f||(u=(3<(u=vt(u)).length?"rgba(":"rgb(")+u.join(",")+")"),r=St(d,n,l,u,!0,"transparent",r,0,i)):f&&F.test(u)?r=St(d,n,l,u,!0,null,r,0,i):(h=(a=parseFloat(l))||0===a?l.substr((a+"").length):"",""!==l&&"auto"!==l||(h="width"===n||"height"===n?(a=ht(t,n,S),"px"):"left"===n||"top"===n?(a=ot(t,n,S),"px"):(a="opacity"!==n?0:1,"")),""===(c=(p=f&&"="===u.charAt(1))?(s=parseInt(u.charAt(0)+"1",10),u=u.substr(2),s*=parseFloat(u),u.replace(M,"")):(s=parseFloat(u),f?u.replace(M,""):""))&&(c=n in k?k[n]:h),u=s||0===s?(p?s+a:s)+c:e[n],h!==c&&(""===c&&"lineHeight"!==n||(s||0===s)&&a&&(a=nt(t,n,a,h),"%"===c?(a/=nt(t,n,100,"%")/100,!0!==e.strictUnits&&(l=a+"%")):"em"===c||"rem"===c||"vw"===c||"vh"===c?a/=nt(t,n,1,c):"px"!==c&&(s=nt(t,n,s,c),c="px"),p&&(s||0===s)&&(u=s+a+c))),p&&(s+=a),!a&&0!==a||!s&&0!==s?void 0!==d[n]&&(u||u+""!="NaN"&&null!=u)?(r=new Tt(d,n,s||a||0,0,r,-1,n,!1,0,l,u)).xs0="none"!==u||"display"!==n&&-1===n.indexOf("Style")?u:l:K("invalid "+n+" tween value: "+e[n]):(r=new Tt(d,n,a,s-a,r,0,n,!1!==E&&("px"===c||"zIndex"===n),0,l,u)).xs0=c)}i&&r&&!r.plugin&&(r.plugin=i)}return r},t.setRatio=function(t){var e,r,i,n=this._firstPT;if(1!==t||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(t||this._tween._time!==this._tween._duration&&0!==this._tween._time||-1e-6===this._tween._rawPrevTime)for(;n;){if(e=n.c*t+n.s,n.r?e=n.r(e):e<1e-6&&-1e-6this._p3?this._calcEnd?1===t?0:1-(t=(t-this._p3)/this._p1)*t:e+(t-e)*(t=(t-this._p3)/this._p1)*t*t*t:this._calcEnd?1:e},d.ease=new d(.7,.7),m.config=d.config=function(t,e,r){return new d(t,e,r)},(m=(r=l("easing.SteppedEase",function(t,e){t=t||1,this._p1=1/t,this._p2=t+(e?0:1),this._p3=e?1:0},!0)).prototype=new g).constructor=r,m.getRatio=function(t){return t<0?t=0:1<=t&&(t=.999999999),((this._p2*t|0)+this._p3)*this._p1},m.config=r.config=function(t,e){return new r(t,e)},(m=(i=l("easing.ExpoScaleEase",function(t,e,r){this._p1=Math.log(e/t),this._p2=e-t,this._p3=t,this._ease=r},!0)).prototype=new g).constructor=i,m.getRatio=function(t){return this._ease&&(t=this._ease.getRatio(t)),(this._p3*Math.exp(this._p1*t)-this._p3)/this._p2},m.config=i.config=function(t,e,r){return new i(t,e,r)},(m=(e=l("easing.RoughEase",function(t){for(var e,r,i,n,o,a,s=(t=t||{}).taper||"none",l=[],u=0,h=0|(t.points||20),c=h,f=!1!==t.randomize,p=!0===t.clamp,d=t.template instanceof g?t.template:null,m="number"==typeof t.strength?.4*t.strength:.4;-1<--c;)e=f?Math.random():1/h*c,r=d?d.getRatio(e):e,i="none"===s?m:"out"===s?(n=1-e)*n*m:"in"===s?e*e*m:e<.5?(n=2*e)*n*.5*m:(n=2*(1-e))*n*.5*m,f?r+=Math.random()*i-.5*i:c%2?r+=.5*i:r-=.5*i,p&&(1e.t){for(;e.next&&t>=e.t;)e=e.next;e=e.prev}else for(;e.prev&&t<=e.t;)e=e.prev;return(this._prev=e).v+(t-e.t)/e.gap*e.c},m.config=function(t){return new e(t)},e.ease=new e,c("Bounce",u("BounceOut",function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}),u("BounceIn",function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}),u("BounceInOut",function(t){var e=t<.5;return(t=e?1-2*t:2*t-1)<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5})),c("Circ",u("CircOut",function(t){return Math.sqrt(1-(t-=1)*t)}),u("CircIn",function(t){return-(Math.sqrt(1-t*t)-1)}),u("CircInOut",function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)})),c("Elastic",(t=function(t,e,r){var i=l("easing."+t,function(t,e){this._p1=1<=t?t:1,this._p2=(e||r)/(t<1?t:1),this._p3=this._p2/a*(Math.asin(1/this._p1)||0),this._p2=a/this._p2},!0),n=i.prototype=new g;return n.constructor=i,n.getRatio=e,n.config=function(t,e){return new i(t,e)},i})("ElasticOut",function(t){return this._p1*Math.pow(2,-10*t)*Math.sin((t-this._p3)*this._p2)+1},.3),t("ElasticIn",function(t){return-this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2)},.3),t("ElasticInOut",function(t){return(t*=2)<1?this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2)*-.5:this._p1*Math.pow(2,-10*(t-=1))*Math.sin((t-this._p3)*this._p2)*.5+1},.45)),c("Expo",u("ExpoOut",function(t){return 1-Math.pow(2,-10*t)}),u("ExpoIn",function(t){return Math.pow(2,10*(t-1))-.001}),u("ExpoInOut",function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))})),c("Sine",u("SineOut",function(t){return Math.sin(t*s)}),u("SineIn",function(t){return 1-Math.cos(t*s)}),u("SineInOut",function(t){return-.5*(Math.cos(Math.PI*t)-1)})),l("easing.EaseLookup",{find:function(t){return g.map[t]}},!0),h(n.SlowMo,"SlowMo","ease,"),h(e,"RoughEase","ease,"),h(r,"SteppedEase","ease,"),p},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(f,p){"use strict";var d={},i=f.document,m=f.GreenSockGlobals=f.GreenSockGlobals||f,t=m[p];if(t)return"undefined"!=typeof module&&module.exports&&(module.exports=t);var e,r,n,g,v,o,a,_=function(t){var e,r=t.split("."),i=m;for(e=0;e=r&&tthis._duration?this._duration:t,e)):this._time},n.totalTime=function(t,e,r){if(v||g.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(t<0&&!r&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var i=this._totalDuration,n=this._timeline;if(io;)n=n._prev;return n?(t._next=n._next,n._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=n,this._recent=t,this._timeline&&this._uncache(!0),this},n._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,t===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(t,e,r){var i,n=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;n;)i=n._next,(n._active||t>=n._startTime&&!n._paused&&!n._gc)&&(n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(t-n._startTime)*n._timeScale,e,r):n.render((t-n._startTime)*n._timeScale,e,r)),n=i},n.rawTime=function(){return v||g.wake(),this._totalTime};var z=k("TweenLite",function(t,e,r){if(M.call(this,e,r),this.render=z.prototype.render,null==t)throw"Cannot tween a null target.";this.target=t="string"!=typeof t?t:z.selector(t)||t;var i,n,o,a=t.jquery||t.length&&t!==f&&t[0]&&(t[0]===f||t[0].nodeType&&t[0].style&&!t.nodeType),s=this.vars.overwrite;if(this._overwrite=s=null==s?J[z.defaultOverwrite]:"number"==typeof s?s>>0:J[s],(a||t instanceof Array||t.push&&x(t))&&"number"!=typeof t[0])for(this._targets=o=l(t),this._propLookup=[],this._siblings=[],i=0;i=$){for(r in $=g.frame+(parseInt(z.autoSleep,10)||120),V){for(t=(e=V[r].tweens).length;-1<--t;)e[t]._gc&&e.splice(t,1);0===e.length&&delete V[r]}if((!(r=Q._first)||r._paused)&&z.autoSleep&&!K._first&&1===g._listeners.tick.length){for(;r&&r._paused;)r=r._next;r||g.sleep()}}},g.addEventListener("tick",M._updateRoot);var et=function(t,e,r){var i,n,o=t._gsTweenID;if(V[o||(t._gsTweenID=o="t"+Y++)]||(V[o]={target:t,tweens:[]}),e&&((i=V[o].tweens)[n=i.length]=e,r))for(;-1<--n;)i[n]===e&&i.splice(n,1);return V[o].tweens},rt=function(t,e,r,i){var n,o,a=t.vars.onOverwrite;return a&&(n=a(t,e,r,i)),(a=z.onOverwrite)&&(o=a(t,e,r,i)),!1!==n&&!1!==o},it=function(t,e,r,i,n){var o,a,s,l;if(1===i||4<=i){for(l=n.length,o=0;oh&&((p||!s._initted)&&h-s._startTime<=2e-8||(c[f++]=s)));for(o=f;-1<--o;)if(l=(s=c[o])._firstPT,2===i&&s._kill(r,t,e)&&(a=!0),2!==i||!s._firstPT&&s._initted&&l){if(2!==i&&!rt(s,e))continue;s._enabled(!1,!1)&&(a=!0)}return a},nt=function(t,e,r){for(var i=t._timeline,n=i._timeScale,o=t._startTime;i._timeline;){if(o+=i._startTime,n*=i._timeScale,i._paused)return-100;i=i._timeline}return e<(o/=n)?o-e:r&&o===e||!t._initted&&o-e<2e-8?y:(o+=t.totalDuration()/t._timeScale/n)>e+y?0:o-e-y};n._init=function(){var t,e,r,i,n,o,a=this.vars,s=this._overwrittenProps,l=this._duration,u=!!a.immediateRender,h=a.ease,c=this._startAt;if(a.startAt){for(i in c&&(c.render(-1,!0),c.kill()),n={},a.startAt)n[i]=a.startAt[i];if(n.data="isStart",n.overwrite=!1,n.immediateRender=!0,n.lazy=u&&!1!==a.lazy,n.startAt=n.delay=null,n.onUpdate=a.onUpdate,n.onUpdateParams=a.onUpdateParams,n.onUpdateScope=a.onUpdateScope||a.callbackScope||this,this._startAt=z.to(this.target||{},0,n),u)if(0s.pr;)i=i._next;(s._prev=i?i._prev:o)?s._prev._next=s:n=s,(s._next=i)?i._prev=s:o=s,s=a}s=e._firstPT=n}for(;s;)s.pg&&"function"==typeof s.t[t]&&s.t[t]()&&(r=!0),s=s._next;return r},ot.activate=function(t){for(var e=t.length;-1<--e;)t[e].API===ot.API&&(G[(new t[e])._propName]=t[e]);return!0},s.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,r=t.propName,i=t.priority||0,n=t.overwriteProps,o={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},a=k("plugins."+r.charAt(0).toUpperCase()+r.substr(1)+"Plugin",function(){ot.call(this,r,i),this._overwriteProps=n||[]},!0===t.global),s=a.prototype=new ot(r);for(e in(s.constructor=a).API=t.API,o)"function"==typeof t[e]&&(s[o[e]]=t[e]);return a.version=t.version,ot.activate([a]),a},e=f._gsQueue){for(r=0;r>0,f._cycle&&f._cycle===f._totalTime/l&&g<=t&&f._cycle--,f._time=f._totalTime-f._cycle*l,f._yoyo&&1&f._cycle&&(f._time=m-f._time),f._time>m?t=(f._time=m)+1e-4:f._time<0?f._time=t=0:t=f._time));if(f._hasPause&&!f._forcingPlayhead&&!e){if(p<(t=f._time)||f._repeat&&x!==f._cycle)for(i=f._first;i&&i._startTime<=t&&!u;)i._duration||"isPause"!==i.data||i.ratio||0===i._startTime&&0===f._rawPrevTime||(u=i),i=i._next;else for(i=f._last;i&&i._startTime>=t&&!u;)i._duration||"isPause"===i.data&&0f._time;)u.render(u._reversed?u.totalDuration()-(t-u._startTime)*u._timeScale:(t-u._startTime)*u._timeScale,e,r),u=u._prev;u=null,f.pause(),f._pauseTime=c}i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(t-i._startTime)*i._timeScale,e,r):i.render((t-i._startTime)*i._timeScale,e,r)}i=o}f._onUpdate&&(e||(A.length&&I(),f._callback("onUpdate"))),a&&(f._locked||f._gc||v!==f._startTime&&_===f._timeScale||(0===f._time||d>=f.totalDuration())&&(n&&(A.length&&I(),f._timeline.autoRemoveChildren&&f._enabled(!1,!1),f._active=!1),!e&&f.vars[a]&&f._callback(a)))}else g!==f._totalTime&&f._onUpdate&&(e||f._callback("onUpdate"))},n.getActive=function(t,e,r){var i,n,o=[],a=this.getChildren(t||null==t,e||null==t,!!r),s=0,l=a.length;for(i=0;it)return r[e].name;return null},n.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),r=e.length;-1<--r;)if(e[r].timet._startTime;l._timeline;)u&&l._timeline.smoothChildTiming?l.totalTime(l._totalTime,!0):l._gc&&l._enabled(!0,!1),l=l._timeline;return h},r.remove=function(t){if(t instanceof c){this._remove(t,!1);var e=t._timeline=t.vars.useFrames?c._rootFramesTimeline:c._rootTimeline;return t._startTime=(t._paused?t._pauseTime:e._time)-(t._reversed?t.totalDuration()-t._totalTime:t._totalTime)/t._timeScale,this}if(t instanceof Array||t&&t.push&&p(t)){for(var r=t.length;-1<--r;)this.remove(t[r]);return this}return"string"==typeof t?this.removeLabel(t):this.kill(null,t)},r._remove=function(t,e){return f.prototype._remove.call(this,t,e),this._last?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},r.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},r.insert=r.insertMultiple=function(t,e,r,i){return this.add(t,e||0,r,i)},r.appendMultiple=function(t,e,r,i){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),r,i)},r.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},r.addPause=function(t,e,r,i){var n=d.delayedCall(0,o,r,i||this);return n.vars.onComplete=n.vars.onReverseComplete=e,n.data="isPause",this._hasPause=!0,this.add(n,t)},r.removeLabel=function(t){return delete this._labels[t],this},r.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},r._parseTimeOrLabel=function(t,e,r,i){var n,o;if(i instanceof c&&i.timeline===this)this.remove(i);else if(i&&(i instanceof Array||i.push&&p(i)))for(o=i.length;-1<--o;)i[o]instanceof c&&i[o].timeline===this&&this.remove(i[o]);if(n="number"!=typeof t||e?99999999999=t&&!l;)i._duration||"isPause"===i.data&&0c._time;)l.render(l._reversed?l.totalDuration()-(t-l._startTime)*l._timeScale:(t-l._startTime)*l._timeScale,e,r),l=l._prev;l=null,c.pause(),c._pauseTime=h}i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(t-i._startTime)*i._timeScale,e,r):i.render((t-i._startTime)*i._timeScale,e,r)}i=o}c._onUpdate&&(e||(v.length&&_(),c._callback("onUpdate"))),a&&(c._gc||d!==c._startTime&&m===c._timeScale||(0===c._time||p>=c.totalDuration())&&(n&&(v.length&&_(),c._timeline.autoRemoveChildren&&c._enabled(!1,!1),c._active=!1),!e&&c.vars[a]&&c._callback(a)))}},r._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof m&&t._hasPausedChild())return!0;t=t._next}return!1},r.getChildren=function(t,e,r,i){i=i||-9999999999;for(var n=[],o=this._first,a=0;o;)o._startTime=r&&(n._startTime+=t),n=n._next;if(e)for(i in o)o[i]>=r&&(o[i]+=t);return this._uncache(!0)},r._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var r=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),i=r.length,n=!1;-1<--i;)r[i]._kill(t,e)&&(n=!0);return n},r.clear=function(t){var e=this.getChildren(!1,!0,!0),r=e.length;for(this._time=this._totalTime=0;-1<--r;)e[r]._enabled(!1,!1);return!1!==t&&(this._labels={}),this._uncache(!0)},r.invalidate=function(){for(var t=this._first;t;)t.invalidate(),t=t._next;return c.prototype.invalidate.call(this)},r._enabled=function(t,e){if(t===this._gc)for(var r=this._first;r;)r._enabled(t,!0),r=r._next;return f.prototype._enabled.call(this,t,e)},r.totalTime=function(t,e,r){this._forcingPlayhead=!0;var i=c.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,i},r.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},r.totalDuration=function(t){if(arguments.length)return t&&this.totalDuration()?this.timeScale(this._totalDuration/t):this;if(this._dirty){for(var e,r,i=0,n=this,o=n._last,a=999999999999;o;)e=o._prev,o._dirty&&o.totalDuration(),o._startTime>a&&n._sortChildren&&!o._paused&&!n._calculatingDuration?(n._calculatingDuration=1,n.add(o,o._startTime-o._delay),n._calculatingDuration=0):a=o._startTime,o._startTime<0&&!o._paused&&(i-=o._startTime,n._timeline.smoothChildTiming&&(n._startTime+=o._startTime/n._timeScale,n._time-=o._startTime,n._totalTime-=o._startTime,n._rawPrevTime-=o._startTime),n.shiftChildren(-o._startTime,!1,-9999999999),a=0),i<(r=o._startTime+o._totalDuration/o._timeScale)&&(i=r),o=e;n._duration=n._totalDuration=i,n._dirty=!1}return this._totalDuration},r.paused=function(t){if(!1===t&&this._paused)for(var e=this._first;e;)e._startTime===this._time&&"isPause"===e.data&&(e._rawPrevTime=0),e=e._next;return c.prototype.paused.apply(this,arguments)},r.usesFrames=function(){for(var t=this._timeline;t._timeline;)t=t._timeline;return t===c._rootFramesTimeline},r.rawTime=function(t){return t&&(this._paused||this._repeat&&0+~]|"+F+")"+F+"*"),W=new RegExp("="+F+"*([^\\]'\"]*?)"+F+"*\\]","g"),q=new RegExp(N),G=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+j),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+z+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/[+~]/,$=new RegExp("\\\\([\\da-f]{1,6}"+F+"?|("+F+")|.)","ig"),tt=function(t,e,r){var i="0x"+e-65536;return i!=i||r?e:i<0?String.fromCharCode(65536+i):String.fromCharCode(i>>10|55296,1023&i|56320)},et=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,rt=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},it=function(){w()},nt=_t(function(t){return!0===t.disabled&&("form"in t||"label"in t)},{dir:"parentNode",next:"legend"});try{M.apply(e=D.call(_.childNodes),_.childNodes),e[_.childNodes.length].nodeType}catch(t){M={apply:e.length?function(t,e){O.apply(t,D.call(e))}:function(t,e){for(var r=t.length,i=0;t[r++]=e[i++];);t.length=r-1}}}function ot(t,e,r,i){var n,o,a,s,l,u,h,c=e&&e.ownerDocument,f=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==f&&9!==f&&11!==f)return r;if(!i&&((e?e.ownerDocument||e:_)!==T&&w(e),e=e||T,k)){if(11!==f&&(l=K.exec(t)))if(n=l[1]){if(9===f){if(!(a=e.getElementById(n)))return r;if(a.id===n)return r.push(a),r}else if(c&&(a=c.getElementById(n))&&v(e,a)&&a.id===n)return r.push(a),r}else{if(l[2])return M.apply(r,e.getElementsByTagName(t)),r;if((n=l[3])&&p.getElementsByClassName&&e.getElementsByClassName)return M.apply(r,e.getElementsByClassName(n)),r}if(p.qsa&&!E[t+" "]&&(!g||!g.test(t))){if(1!==f)c=e,h=t;else if("object"!==e.nodeName.toLowerCase()){for((s=e.getAttribute("id"))?s=s.replace(et,rt):e.setAttribute("id",s=S),o=(u=d(t)).length;o--;)u[o]="#"+s+" "+vt(u[o]);h=u.join(","),c=Q.test(t)&&mt(e.parentNode)||e}if(h)try{return M.apply(r,c.querySelectorAll(h)),r}catch(t){}finally{s===S&&e.removeAttribute("id")}}}return m(t.replace(U,"$1"),e,r,i)}function at(){var i=[];return function t(e,r){return i.push(e+" ")>b.cacheLength&&delete t[i.shift()],t[e+" "]=r}}function st(t){return t[S]=!0,t}function lt(t){var e=T.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ut(t,e){for(var r=t.split("|"),i=r.length;i--;)b.attrHandle[r[i]]=e}function ht(t,e){var r=e&&t,i=r&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(r)for(;r=r.nextSibling;)if(r===e)return-1;return t?1:-1}function ct(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function ft(r){return function(t){var e=t.nodeName.toLowerCase();return("input"===e||"button"===e)&&t.type===r}}function pt(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&nt(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function dt(a){return st(function(o){return o=+o,st(function(t,e){for(var r,i=a([],t.length,o),n=i.length;n--;)t[r=i[n]]&&(t[r]=!(e[r]=t[r]))})})}function mt(t){return t&&void 0!==t.getElementsByTagName&&t}for(t in p=ot.support={},n=ot.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},w=ot.setDocument=function(t){var e,r,i=t?t.ownerDocument||t:_;return i!==T&&9===i.nodeType&&i.documentElement&&(a=(T=i).documentElement,k=!n(T),_!==T&&(r=T.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",it,!1):r.attachEvent&&r.attachEvent("onunload",it)),p.attributes=lt(function(t){return t.className="i",!t.getAttribute("className")}),p.getElementsByTagName=lt(function(t){return t.appendChild(T.createComment("")),!t.getElementsByTagName("*").length}),p.getElementsByClassName=J.test(T.getElementsByClassName),p.getById=lt(function(t){return a.appendChild(t).id=S,!T.getElementsByName||!T.getElementsByName(S).length}),p.getById?(b.filter.ID=function(t){var e=t.replace($,tt);return function(t){return t.getAttribute("id")===e}},b.find.ID=function(t,e){if(void 0!==e.getElementById&&k){var r=e.getElementById(t);return r?[r]:[]}}):(b.filter.ID=function(t){var r=t.replace($,tt);return function(t){var e=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return e&&e.value===r}},b.find.ID=function(t,e){if(void 0!==e.getElementById&&k){var r,i,n,o=e.getElementById(t);if(o){if((r=o.getAttributeNode("id"))&&r.value===t)return[o];for(n=e.getElementsByName(t),i=0;o=n[i++];)if((r=o.getAttributeNode("id"))&&r.value===t)return[o]}return[]}}),b.find.TAG=p.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):p.qsa?e.querySelectorAll(t):void 0}:function(t,e){var r,i=[],n=0,o=e.getElementsByTagName(t);if("*"!==t)return o;for(;r=o[n++];)1===r.nodeType&&i.push(r);return i},b.find.CLASS=p.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&k)return e.getElementsByClassName(t)},s=[],g=[],(p.qsa=J.test(T.querySelectorAll))&&(lt(function(t){a.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+F+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+F+"*(?:value|"+z+")"),t.querySelectorAll("[id~="+S+"-]").length||g.push("~="),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+S+"+*").length||g.push(".#.+[+~]")}),lt(function(t){t.innerHTML="";var e=T.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+F+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),a.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")})),(p.matchesSelector=J.test(h=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&<(function(t){p.disconnectedMatch=h.call(t,"*"),h.call(t,"[s!='']:x"),s.push("!=",N)}),g=g.length&&new RegExp(g.join("|")),s=s.length&&new RegExp(s.join("|")),e=J.test(a.compareDocumentPosition),v=e||J.test(a.contains)?function(t,e){var r=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(r.contains?r.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},C=e?function(t,e){if(t===e)return u=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!p.sortDetached&&e.compareDocumentPosition(t)===r?t===T||t.ownerDocument===_&&v(_,t)?-1:e===T||e.ownerDocument===_&&v(_,e)?1:l?R(l,t)-R(l,e):0:4&r?-1:1)}:function(t,e){if(t===e)return u=!0,0;var r,i=0,n=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!n||!o)return t===T?-1:e===T?1:n?-1:o?1:l?R(l,t)-R(l,e):0;if(n===o)return ht(t,e);for(r=t;r=r.parentNode;)a.unshift(r);for(r=e;r=r.parentNode;)s.unshift(r);for(;a[i]===s[i];)i++;return i?ht(a[i],s[i]):a[i]===_?-1:s[i]===_?1:0}),T},ot.matches=function(t,e){return ot(t,null,null,e)},ot.matchesSelector=function(t,e){if((t.ownerDocument||t)!==T&&w(t),e=e.replace(W,"='$1']"),p.matchesSelector&&k&&!E[e+" "]&&(!s||!s.test(e))&&(!g||!g.test(e)))try{var r=h.call(t,e);if(r||p.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace($,tt),t[3]=(t[3]||t[4]||t[5]||"").replace($,tt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ot.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ot.error(t[0]),t},PSEUDO:function(t){var e,r=!t[6]&&t[2];return V.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":r&&q.test(r)&&(e=d(r,!0))&&(e=r.indexOf(")",r.length-e)-r.length)&&(t[0]=t[0].slice(0,e),t[2]=r.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace($,tt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=f[t+" "];return e||(e=new RegExp("(^|"+F+")"+t+"("+F+"|$)"))&&f(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(r,i,n){return function(t){var e=ot.attr(t,r);return null==e?"!="===i:!i||(e+="","="===i?e===n:"!="===i?e!==n:"^="===i?n&&0===e.indexOf(n):"*="===i?n&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(t,r,i){return _(r)?S.grep(t,function(t,e){return!!r.call(t,e,t)!==i}):r.nodeType?S.grep(t,function(t){return t===r!==i}):"string"!=typeof r?S.grep(t,function(t){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(t,e,r){var i,n;if(!t)return this;if(r=r||I,"string"!=typeof t)return t.nodeType?(this[0]=t,this.length=1,this):_(t)?void 0!==r.ready?r.ready(t):t(S):S.makeArray(t,this);if(!(i="<"===t[0]&&">"===t[t.length-1]&&3<=t.length?[null,t,null]:O.exec(t))||!i[1]&&e)return!e||e.jquery?(e||r).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof S?e[0]:e,S.merge(this,S.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:k,!0)),C.test(i[1])&&S.isPlainObject(e))for(i in e)_(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(n=k.getElementById(i[2]))&&(this[0]=n,this.length=1),this}).prototype=S.fn,I=S(k);var M=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};function R(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}S.fn.extend({has:function(t){var e=S(t,this),r=e.length;return this.filter(function(){for(var t=0;t\x20\t\r\n\f]+)/i,ht=/^$|^module$|\/(?:java|ecma)script/i,ct={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ft(t,e){var r;return r=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&E(t,e)?S.merge([t],r):r}function pt(t,e){for(var r=0,i=t.length;rx",v.noCloneChecked=!!dt.cloneNode(!0).lastChild.defaultValue;var _t=k.documentElement,yt=/^key/,bt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,xt=/^([^.]*)(?:\.(.+)|)/;function wt(){return!0}function Tt(){return!1}function kt(){try{return k.activeElement}catch(t){}}function St(t,e,r,i,n,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof r&&(i=i||r,r=void 0),e)St(t,s,r,i,e[s],o);return t}if(null==i&&null==n?(n=r,i=r=void 0):null==n&&("string"==typeof r?(n=i,i=void 0):(n=i,i=r,r=void 0)),!1===n)n=Tt;else if(!n)return t;return 1===o&&(a=n,(n=function(t){return S().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),t.each(function(){S.event.add(this,e,n,i,r)})}S.event={global:{},add:function(e,t,r,i,n){var o,a,s,l,u,h,c,f,p,d,m,g=Z.get(e);if(g)for(r.handler&&(r=(o=r).handler,n=o.selector),n&&S.find.matchesSelector(_t,n),r.guid||(r.guid=S.guid++),(l=g.events)||(l=g.events={}),(a=g.handle)||(a=g.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(z)||[""]).length;u--;)p=m=(s=xt.exec(t[u])||[])[1],d=(s[2]||"").split(".").sort(),p&&(c=S.event.special[p]||{},p=(n?c.delegateType:c.bindType)||p,c=S.event.special[p]||{},h=S.extend({type:p,origType:m,data:i,handler:r,guid:r.guid,selector:n,needsContext:n&&S.expr.match.needsContext.test(n),namespace:d.join(".")},o),(f=l[p])||((f=l[p]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(e,i,d,a)||e.addEventListener&&e.addEventListener(p,a)),c.add&&(c.add.call(e,h),h.handler.guid||(h.handler.guid=r.guid)),n?f.splice(f.delegateCount++,0,h):f.push(h),S.event.global[p]=!0)},remove:function(t,e,r,i,n){var o,a,s,l,u,h,c,f,p,d,m,g=Z.hasData(t)&&Z.get(t);if(g&&(l=g.events)){for(u=(e=(e||"").match(z)||[""]).length;u--;)if(p=m=(s=xt.exec(e[u])||[])[1],d=(s[2]||"").split(".").sort(),p){for(c=S.event.special[p]||{},f=l[p=(i?c.delegateType:c.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=f.length;o--;)h=f[o],!n&&m!==h.origType||r&&r.guid!==h.guid||s&&!s.test(h.namespace)||i&&i!==h.selector&&("**"!==i||!h.selector)||(f.splice(o,1),h.selector&&f.delegateCount--,c.remove&&c.remove.call(t,h));a&&!f.length&&(c.teardown&&!1!==c.teardown.call(t,d,g.handle)||S.removeEvent(t,p,g.handle),delete l[p])}else for(p in l)S.event.remove(t,p+e[u],r,i,!0);S.isEmptyObject(l)&&Z.remove(t,"handle events")}},dispatch:function(t){var e,r,i,n,o,a,s=S.event.fix(t),l=new Array(arguments.length),u=(Z.get(this,"events")||{})[s.type]||[],h=S.event.special[s.type]||{};for(l[0]=s,e=1;e\x20\t\r\n\f]*)[^>]*)\/>/gi,Et=/\s*$/g;function It(t,e){return E(t,"table")&&E(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function Ot(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Mt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Dt(t,e){var r,i,n,o,a,s,l,u;if(1===e.nodeType){if(Z.hasData(t)&&(o=Z.access(t),a=Z.set(e,o),u=o.events))for(n in delete a.handle,a.events={},u)for(r=0,i=u[n].length;r")},clone:function(t,e,r){var i,n,o,a,s,l,u,h=t.cloneNode(!0),c=S.contains(t.ownerDocument,t);if(!(v.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||S.isXMLDoc(t)))for(a=ft(h),i=0,n=(o=ft(t)).length;i").prop({charset:r.scriptCharset,src:r.url}).on("load error",n=function(t){i.remove(),n=null,t&&e("error"===t.type?404:200,t.type)}),k.head.appendChild(i[0])},abort:function(){n&&n()}}});var Xe,He=[],We=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=He.pop()||S.expando+"_"+be++;return this[t]=!0,t}}),S.ajaxPrefilter("json jsonp",function(t,e,r){var i,n,o,a=!1!==t.jsonp&&(We.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&We.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=_(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(We,"$1"+i):!1!==t.jsonp&&(t.url+=(xe.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return o||S.error(i+" was not called"),o[0]},t.dataTypes[0]="json",n=T[i],T[i]=function(){o=arguments},r.always(function(){void 0===n?S(T).removeProp(i):T[i]=n,t[i]&&(t.jsonpCallback=e.jsonpCallback,He.push(i)),o&&_(n)&&n(o[0]),o=n=void 0}),"script"}),v.createHTMLDocument=((Xe=k.implementation.createHTMLDocument("").body).innerHTML="
",2===Xe.childNodes.length),S.parseHTML=function(t,e,r){return"string"!=typeof t?[]:("boolean"==typeof e&&(r=e,e=!1),e||(v.createHTMLDocument?((i=(e=k.implementation.createHTMLDocument("")).createElement("base")).href=k.location.href,e.head.appendChild(i)):e=k),o=!r&&[],(n=C.exec(t))?[e.createElement(n[1])]:(n=vt([t],e,o),o&&o.length&&S(o).remove(),S.merge([],n.childNodes)));var i,n,o},S.fn.load=function(t,e,r){var i,n,o,a=this,s=t.indexOf(" ");return-1").append(S.parseHTML(t)).find(i):t)}).always(r&&function(t,e){a.each(function(){r.apply(this,o||[t.responseText,e,t])})}),this},S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){S.fn[e]=function(t){return this.on(e,t)}}),S.expr.pseudos.animated=function(e){return S.grep(S.timers,function(t){return e===t.elem}).length},S.offset={setOffset:function(t,e,r){var i,n,o,a,s,l,u=S.css(t,"position"),h=S(t),c={};"static"===u&&(t.style.position="relative"),s=h.offset(),o=S.css(t,"top"),l=S.css(t,"left"),n=("absolute"===u||"fixed"===u)&&-1<(o+l).indexOf("auto")?(a=(i=h.position()).top,i.left):(a=parseFloat(o)||0,parseFloat(l)||0),_(e)&&(e=e.call(t,r,S.extend({},s))),null!=e.top&&(c.top=e.top-s.top+a),null!=e.left&&(c.left=e.left-s.left+n),"using"in e?e.using.call(t,c):h.css(c)}},S.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){S.offset.setOffset(this,e,t)});var t,r,i=this[0];return i?i.getClientRects().length?(t=i.getBoundingClientRect(),r=i.ownerDocument.defaultView,{top:t.top+r.pageYOffset,left:t.left+r.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,r,i=this[0],n={top:0,left:0};if("fixed"===S.css(i,"position"))e=i.getBoundingClientRect();else{for(e=this.offset(),r=i.ownerDocument,t=i.offsetParent||r.documentElement;t&&(t===r.body||t===r.documentElement)&&"static"===S.css(t,"position");)t=t.parentNode;t&&t!==i&&1===t.nodeType&&((n=S(t).offset()).top+=S.css(t,"borderTopWidth",!0),n.left+=S.css(t,"borderLeftWidth",!0))}return{top:e.top-n.top-S.css(i,"marginTop",!0),left:e.left-n.left-S.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===S.css(t,"position");)t=t.offsetParent;return t||_t})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var o="pageYOffset"===n;S.fn[e]=function(t){return X(this,function(t,e,r){var i;if(y(t)?i=t:9===t.nodeType&&(i=t.defaultView),void 0===r)return i?i[n]:t[e];i?i.scrollTo(o?i.pageXOffset:r,o?r:i.pageYOffset):t[e]=r},e,t,arguments.length)}}),S.each(["top","left"],function(t,r){S.cssHooks[r]=Bt(v.pixelPosition,function(t,e){if(e)return e=Nt(t,r),Ft.test(e)?S(t).position()[r]+"px":e})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(i,o){S.fn[o]=function(t,e){var r=arguments.length&&(i||"boolean"!=typeof t),n=i||(!0===t||!0===e?"margin":"border");return X(this,function(t,e,r){var i;return y(t)?0===o.indexOf("outer")?t["inner"+a]:t.document.documentElement["client"+a]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+a],i["scroll"+a],t.body["offset"+a],i["offset"+a],i["client"+a])):void 0===r?S.css(t,e,n):S.style(t,e,r,n)},s,r?t:void 0,r)}})}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,r){S.fn[r]=function(t,e){return 0>>0,i=(r*=i)>>>0,i+=4294967296*(r-=i)}return 2.3283064365386963e-10*(i>>>0)}}();e.next=function(){var t=2091639*e.s0+2.3283064365386963e-10*e.c;return e.s0=e.s1,e.s1=e.s2,e.s2=t-(e.c=0|t)},e.c=1,e.s0=r(" "),e.s1=r(" "),e.s2=r(" "),e.s0-=r(t),e.s0<0&&(e.s0+=1),e.s1-=r(t),e.s1<0&&(e.s1+=1),e.s2-=r(t),e.s2<0&&(e.s2+=1),r=null}function a(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function i(t,e){var r=new o(t),i=e&&e.state,n=r.next;return n.int32=function(){return 4294967296*r.next()|0},n.double=function(){return n()+11102230246251565e-32*(2097152*n()|0)},n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.alea=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],16:[function(t,e,r){!function(t,e,r){function o(t){var n=this,e="";n.next=function(){var t=n.b,e=n.c,r=n.d,i=n.a;return t=t<<25^t>>>7^e,e=e-r|0,r=r<<24^r>>>8^i,i=i-t|0,n.b=t=t<<20^t>>>12^e,n.c=e=e-r|0,n.d=r<<16^e>>>16^i,n.a=i-t|0},n.a=0,n.b=0,n.c=-1640531527,n.d=1367130551,t===Math.floor(t)?(n.a=t/4294967296|0,n.b=0|t):e+=t;for(var r=0;r>>0)/4294967296};return n.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.tychei=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],17:[function(t,e,r){!function(t,e,r){function o(t){var e=this,r="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:r+=t;for(var i=0;i>>0)/4294967296};return n.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xor128=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],18:[function(t,e,r){!function(t,e,r){function o(t){var o=this;o.next=function(){var t,e,r=o.w,i=o.X,n=o.i;return o.w=r=r+1640531527|0,e=i[n+34&127],t=i[n=n+1&127],e^=e<<13,t^=t<<17,e^=e>>>15,t^=t>>>12,e=i[n]=e^t,o.i=n,e+(r^r>>>16)|0},function(t,e){var r,i,n,o,a,s=[],l=128;for(e===(0|e)?(i=e,e=null):(e+="\0",i=0,l=Math.max(l,e.length)),n=0,o=-32;o>>15,i^=i<<4,i^=i>>>13,0<=o&&(a=a+1640531527|0,n=0==(r=s[127&o]^=i+a)?n+1:0);for(128<=n&&(s[127&(e&&e.length||0)]=-1),n=127,o=512;0>>15,r^=r>>>12,s[n]=i^r;t.w=a,t.X=s,t.i=n}(o,t)}function a(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function i(t,e){null==t&&(t=+new Date);var r=new o(t),i=e&&e.state,n=function(){return(r.next()>>>0)/4294967296};return n.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},n.int32=r.next,n.quick=n,i&&(i.X&&a(i,r),n.state=function(){return a(r,{})}),n}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xor4096=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],19:[function(t,e,r){!function(t,e,r){function o(t){var n=this;n.next=function(){var t,e,r=n.x,i=n.i;return t=r[i],e=(t^=t>>>7)^t<<24,e^=(t=r[i+1&7])^t>>>10,e^=(t=r[i+3&7])^t>>>3,e^=(t=r[i+4&7])^t<<7,t=r[i+7&7],e^=(t^=t<<13)^t<<9,r[i]=e,n.i=i+1&7,e},function(t,e){var r,i=[];if(e===(0|e))i[0]=e;else for(e=""+e,r=0;r>>0)/4294967296};return n.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},n.int32=r.next,n.quick=n,i&&(i.x&&a(i,r),n.state=function(){return a(r,{})}),n}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xorshift7=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],20:[function(t,e,r){!function(t,e,r){function o(t){var e=this,r="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,t===((e.v=0)|t)?e.x=t:r+=t;for(var i=0;i>>4),e.next()}function a(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function i(t,e){var r=new o(t),i=e&&e.state,n=function(){return(r.next()>>>0)/4294967296};return n.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xorwow=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],21:[function(e,r,t){!function(s,l){var u,h=this,c=256,f=6,p="random",d=l.pow(c,f),m=l.pow(2,52),g=2*m,v=c-1;function t(t,e,r){var i=[],n=b(function t(e,r){var i,n=[],o=typeof e;if(r&&"object"==o)for(i in e)try{n.push(t(e[i],r-1))}catch(t){}return n.length?n:"string"==o?e:e+"\0"}((e=1==e?{entropy:!0}:e||{}).entropy?[t,x(s)]:null==t?function(){try{var t;return u&&(t=u.randomBytes)?t=t(c):(t=new Uint8Array(c),(h.crypto||h.msCrypto).getRandomValues(t)),x(t)}catch(t){var e=h.navigator,r=e&&e.plugins;return[+new Date,h,r,h.screen,x(s)]}}():t,3),i),o=new _(i),a=function(){for(var t=o.g(f),e=d,r=0;t>>=1;return(t+r)/e};return a.int32=function(){return 0|o.g(4)},a.quick=function(){return o.g(4)/4294967296},a.double=a,b(x(o.S),s),(e.pass||r||function(t,e,r,i){return i&&(i.S&&y(i,o),t.state=function(){return y(o,{})}),r?(l[p]=t,e):t})(a,n,"global"in e?e.global:this==l,e.state)}function _(t){var e,r=t.length,a=this,i=0,n=a.i=a.j=0,o=a.S=[];for(r||(t=[r++]);iMath.PI?c-r:r}function g(t){return t-c*Math.floor(t/c)}e.exports={UP:o,DOWN:a,LEFT:s,RIGHT:0,NORTH:l,SOUTH:u,WEST:h,EAST:0,PI_2:c,PI_QUARTER:f,PI_HALF:p,toDegrees:function(t){return t*i},toRadians:function(t){return t*n},isAngleBetween:function(t,e,r){if(((r-e)%c+c)%c>=Math.PI){var i=e;e=r,r=i}return e<=r?e<=t&&t<=r:e<=t||t<=r},differenceAnglesSign:d,differenceAngles:m,shortestAngle:function(t,e){return m(e,t)*d(e,t)+t},normalize:g,angleTwoPoints:function(){return 4===arguments.length?Math.atan2(arguments[3]-arguments[1],arguments[2]-arguments[0]):Math.atan2(arguments[1].y-arguments[0].y,arguments[1].x-arguments[0].x)},distanceTwoPoints:function(){return 2===arguments.length?Math.sqrt(Math.pow(arguments[1].x-arguments[0].x,2)+Math.pow(arguments[1].y-arguments[0].y,2)):Math.sqrt(Math.pow(arguments[2]-arguments[0],2)+Math.pow(arguments[3]-arguments[1],2))},distanceTwoPointsSquared:function(){return 2===arguments.length?Math.pow(arguments[1].x-arguments[0].x,2)+Math.pow(arguments[1].y-arguments[0].y,2):Math.pow(arguments[2]-arguments[0],2)+Math.pow(arguments[3]-arguments[1],2)},closestAngle:function(t){var e=m(t,s),r=m(t,0),i=m(t,o),n=m(t,a);return e<=r&&e<=i&&e<=n?s:r<=i&&r<=n?0:i<=n?o:a},equals:function(t,e,r){return r?m(t,e)>16)+t*(r>>16)<<16|i*(e>>8&255)+t*(r>>8&255)<<8|i*(255&e)+t*(255&r)},random:function(t,e){function r(){return s.range(t,e)}var i=s.pick([{r:1,g:1,b:1},{r:1,g:1,b:0},{r:1,g:0,b:1},{r:0,g:1,b:1},{r:1,g:0,b:0},{r:0,g:1,b:0},{r:0,g:0,b:1}]);return t=t||0,e=e||255,this.rgbToHex(i.r?r():0,i.g?r():0,i.b?r():0)},randomHSL:function(t,e,r,i,n,o){var a={h:s.range(t,e),s:s.range(r,i,!0),l:s.range(n,o,!0)};return this.hslToHex(a)},randomGoldenRatioHSL:function(t,e,r){for(var i=s.get(1,!0),n=[],o=0;o=this.time?(this.parent.x=e.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(e.time,e.start,e.delta,this.time),this.parent.dirty=!0}if(this.toY){var r=this.toY;r.time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),r.time>=this.time?(this.parent.y=r.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(r.time,r.start,r.delta,this.time),this.parent.dirty=!0}}}},{key:"calcUnderflowX",value:function(){var t=void 0;switch(this.underflowX){case-1:t=0;break;case 1:t=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:t=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return t}},{key:"calcUnderflowY",value:function(){var t=void 0;switch(this.underflowY){case-1:t=0;break;case 1:t=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:t=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return t}},{key:"bounce",value:function(){if(!this.paused){var t=void 0,e=this.parent.plugins.decelerate;e&&(e.x||e.y)&&(e.x&&e.percentChangeX===e.friction||e.y&&e.percentChangeY===e.friction)&&(((t=this.parent.OOB()).left&&this.left||t.right&&this.right)&&(e.percentChangeX=this.friction),(t.top&&this.top||t.bottom&&this.bottom)&&(e.percentChangeY=this.friction));var r=this.parent.plugins.drag||{},i=this.parent.plugins.pinch||{};if(e=e||{},!(r.active||i.active||this.toX&&this.toY||e.x&&e.y)){var n=(t=t||this.parent.OOB()).cornerPoint;if(!this.toX&&!e.x){var o=null;t.left&&this.left?o=this.parent.screenWorldWidththis.maxWidth&&(this.parent.fitWidth(this.maxWidth),t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})),this.minHeight&&ethis.maxHeight&&(this.parent.fitHeight(this.maxHeight),this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}}}]),i}()},{"./plugin":9}],3:[function(t,e,r){"use strict";var n=function(){function i(t,e){for(var r=0;r(!0===this.right?this.parent.worldWidth:this.right)&&(this.parent.x=-(!0===this.right?this.parent.worldWidth:this.right)*this.parent.scale.x+this.parent.screenWidth,e=!(t.x=0));e&&this.parent.emit("moved",{viewport:this.parent,type:"clamp-x"})}if(null!==this.top||null!==this.bottom){var r=void 0;if(this.parent.screenWorldHeight(!0===this.bottom?this.parent.worldHeight:this.bottom)&&(this.parent.y=-(!0===this.bottom?this.parent.worldHeight:this.bottom)*this.parent.scale.y+this.parent.screenHeight,r=!(t.y=0));r&&this.parent.emit("moved",{viewport:this.parent,type:"clamp-y"})}}}}]),i}()},{"./plugin":9,"./utils":12}],4:[function(t,e,r){"use strict";var n=function(){function i(t,e){for(var r=0;r=t-100){var s=t-a.time;this.x=(this.parent.x-a.x)/s,this.y=(this.parent.y-a.y)/s,this.percentChangeX=this.percentChangeY=this.friction;break}}}catch(t){r=!0,i=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw i}}}}},{key:"activate",value:function(t){void 0!==(t=t||{}).x&&(this.x=t.x,this.percentChangeX=this.friction),void 0!==t.y&&(this.y=t.y,this.percentChangeY=this.friction)}},{key:"update",value:function(t){if(!this.paused){var e=void 0;this.x&&(this.parent.x+=this.x*t,this.x*=this.percentChangeX,Math.abs(this.x)this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,t.x=0);if("x"!==this.clampWheel)if(this.parent.screenWorldHeightthis.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,t.y=0)}},{key:"active",get:function(){return this.moved}}]),i}()},{"./plugin":9,"./utils":12}],6:[function(t,e,r){"use strict";var i=function(){function i(t,e){for(var r=0;rthis.radius))return;var i=Math.atan2(this.target.y-t.y,this.target.x-t.x);e=this.target.x-Math.cos(i)*this.radius,r=this.target.y-Math.sin(i)*this.radius}if(this.speed){var n=e-t.x,o=r-t.y;if(n||o){var a=Math.atan2(r-t.y,e-t.x),s=Math.cos(a)*this.speed,l=Math.sin(a)*this.speed,u=Math.abs(s)>Math.abs(n)?e:t.x+s,h=Math.abs(l)>Math.abs(o)?r:t.y+l;this.parent.moveCenter(u,h),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else this.parent.moveCenter(e,r),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}}]),n}()},{"./plugin":9}],7:[function(t,e,r){"use strict";var n=function(){function i(t,e){for(var r=0;r=this.radiusSquared){var n=Math.atan2(i.y-r,i.x-e);this.linear?(this.horizontal=Math.round(Math.cos(n))*this.speed*this.reverse*.06,this.vertical=Math.round(Math.sin(n))*this.speed*this.reverse*.06):(this.horizontal=Math.cos(n)*this.speed*this.reverse*.06,this.vertical=Math.sin(n)*this.speed*this.reverse*.06)}else this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0}else o.exists(this.left)&&ethis.right?this.horizontal=-1*this.reverse*this.speed*.06:(this.decelerateHorizontal(),this.horizontal=0),o.exists(this.top)&&rthis.bottom?this.vertical=-1*this.reverse*this.speed*.06:(this.decelerateVertical(),this.vertical=0)}}},{key:"decelerateHorizontal",value:function(){var t=this.parent.plugins.decelerate;this.horizontal&&t&&!this.noDecelerate&&t.activate({x:this.horizontal*this.speed*this.reverse/(1e3/60)})}},{key:"decelerateVertical",value:function(){var t=this.parent.plugins.decelerate;this.vertical&&t&&!this.noDecelerate&&t.activate({y:this.vertical*this.speed*this.reverse/(1e3/60)})}},{key:"up",value:function(){this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=null}},{key:"update",value:function(){if(!this.paused&&(this.horizontal||this.vertical)){var t=this.parent.center;this.horizontal&&(t.x+=this.horizontal*this.speed),this.vertical&&(t.y+=this.vertical*this.speed),this.parent.moveCenter(t),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}]),i}()},{"./plugin":9,"./utils":12}],8:[function(t,e,r){"use strict";var n=function(){function i(t,e){for(var r=0;r=this.time)this.parent.scale.set(this.x_scale,this.y_scale),this.removeOnComplete&&this.parent.removePlugin("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null;else{var i=this.snapping;this.parent.scale.x=this.ease(i.time,i.startX,i.deltaX,this.time),this.parent.scale.y=this.ease(i.time,i.startY,i.deltaY,this.time)}var n=this.parent.plugins["clamp-zoom"];n&&n.clamp(),this.noMove||(this.center?this.parent.moveCenter(this.center):this.parent.moveCenter(e))}}else this.parent.scale.x===this.x_scale&&this.parent.scale.y===this.y_scale||this.createSnapping()}}},{key:"resume",value:function(){this.snapping=null,function t(e,r,i){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,r);if(void 0===n){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,r,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"resume",this).call(this)}}]),i}()},{"./plugin":9,"./utils":12}],11:[function(t,e,r){"use strict";var i=function(){function i(t,e){for(var r=0;rthis.time)r=!0,i=this.startX+this.deltaX,n=this.startY+this.deltaY;else{var o=this.ease(e.time,0,1,this.time);i=this.startX+this.deltaX*o,n=this.startY+this.deltaY*o}this.topLeft?this.parent.moveCorner(i,n):this.parent.moveCenter(i,n),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),r&&(this.removeOnComplete&&this.parent.removePlugin("snap"),this.parent.emit("snap-end",this.parent),this.snapping=null)}else{var a=this.topLeft?this.parent.corner:this.parent.center;a.x===this.x&&a.y===this.y||this.snapStart()}}}]),o}()},{"./plugin":9,"./utils":12}],12:[function(t,e,r){"use strict";var i=t("penner");function n(t){return null!=t}e.exports={exists:n,defaults:function(t,e){return null!=t?t:e},ease:function(t,e){return n(t)?"function"==typeof t?t:"string"==typeof t?i[t]:void 0:i[e]}}},{penner:15}],13:[function(t,e,r){"use strict";var i=function(){function i(t,e){for(var r=0;r=this.threshold}},{key:"move",value:function(t){if(!this.pause){var e=!0,r=!1,i=void 0;try{for(var n,o=this.pluginsList[Symbol.iterator]();!(e=(n=o.next()).done);e=!0){n.value.move(t)}}catch(t){r=!0,i=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw i}}if(this.clickedAvailable){var a=t.data.global.x-this.last.x,s=t.data.global.y-this.last.y;(this.checkThreshold(a)||this.checkThreshold(s))&&(this.clickedAvailable=!1)}}}},{key:"up",value:function(t){if(!this.pause){if(t.data.originalEvent instanceof MouseEvent&&0==t.data.originalEvent.button&&(this.leftDown=!1),"mouse"!==t.data.pointerType)for(var e=0;ethis._worldWidth,t.top=this.top<0,t.bottom=this.bottom>this._worldHeight,t.cornerPoint={x:this._worldWidth*this.scale.x-this._screenWidth,y:this._worldHeight*this.scale.y-this._screenHeight},t}},{key:"countDownPointers",value:function(){return(this.leftDown?1:0)+this.touches.length}},{key:"getTouchPointers",value:function(){var t=[],e=this.trackedPointers;for(var r in e){var i=e[r];-1!==this.touches.indexOf(i.pointerId)&&t.push(i)}return t}},{key:"getPointers",value:function(){var t=[],e=this.trackedPointers;for(var r in e)t.push(e[r]);return t}},{key:"_reset",value:function(){this.plugins.bounce&&(this.plugins.bounce.reset(),this.plugins.bounce.bounce()),this.plugins.decelerate&&this.plugins.decelerate.reset(),this.plugins.snap&&this.plugins.snap.reset(),this.plugins.clamp&&this.plugins.clamp.update(),this.plugins["clamp-zoom"]&&this.plugins["clamp-zoom"].clamp(),this.dirty=!0}},{key:"removePlugin",value:function(t){this.plugins[t]&&(this.plugins[t]=null,this.emit(t+"-remove"),this.pluginsSort())}},{key:"pausePlugin",value:function(t){this.plugins[t]&&this.plugins[t].pause()}},{key:"resumePlugin",value:function(t){this.plugins[t]&&this.plugins[t].resume()}},{key:"pluginsSort",value:function(){var t=!0,e=!(this.pluginsList=[]),r=void 0;try{for(var i,n=g[Symbol.iterator]();!(t=(i=n.next()).done);t=!0){var o=i.value;this.plugins[o]&&this.pluginsList.push(this.plugins[o])}}catch(t){e=!0,r=t}finally{try{!t&&n.return&&n.return()}finally{if(e)throw r}}}},{key:"drag",value:function(t){return this.plugins.drag=new o(this,t),this.pluginsSort(),this}},{key:"clamp",value:function(t){return this.plugins.clamp=new s(this,t),this.pluginsSort(),this}},{key:"decelerate",value:function(t){return this.plugins.decelerate=new u(this,t),this.pluginsSort(),this}},{key:"bounce",value:function(t){return this.plugins.bounce=new h(this,t),this.pluginsSort(),this}},{key:"pinch",value:function(t){return this.plugins.pinch=new a(this,t),this.pluginsSort(),this}},{key:"snap",value:function(t,e,r){return this.plugins.snap=new c(this,t,e,r),this.pluginsSort(),this}},{key:"follow",value:function(t,e){return this.plugins.follow=new p(this,t,e),this.pluginsSort(),this}},{key:"wheel",value:function(t){return this.plugins.wheel=new d(this,t),this.pluginsSort(),this}},{key:"clampZoom",value:function(t){return this.plugins["clamp-zoom"]=new l(this,t),this.pluginsSort(),this}},{key:"mouseEdges",value:function(t){return this.plugins["mouse-edges"]=new m(this,t),this.pluginsSort(),this}},{key:"screenWidth",get:function(){return this._screenWidth},set:function(t){this._screenWidth=t}},{key:"screenHeight",get:function(){return this._screenHeight},set:function(t){this._screenHeight=t}},{key:"worldWidth",get:function(){return this._worldWidth?this._worldWidth:this.width},set:function(t){this._worldWidth=t,this.resizePlugins()}},{key:"worldHeight",get:function(){return this._worldHeight?this._worldHeight:this.height},set:function(t){this._worldHeight=t,this.resizePlugins()}},{key:"worldScreenWidth",get:function(){return this._screenWidth/this.scale.x}},{key:"worldScreenHeight",get:function(){return this._screenHeight/this.scale.y}},{key:"screenWorldWidth",get:function(){return this._worldWidth*this.scale.x}},{key:"screenWorldHeight",get:function(){return this._worldHeight*this.scale.y}},{key:"center",get:function(){return{x:this.worldScreenWidth/2-this.x/this.scale.x,y:this.worldScreenHeight/2-this.y/this.scale.y}},set:function(t){this.moveCenter(t)}},{key:"corner",get:function(){return{x:-this.x/this.scale.x,y:-this.y/this.scale.y}},set:function(t){this.moveCorner(t)}},{key:"right",get:function(){return-this.x/this.scale.x+this.worldScreenWidth},set:function(t){this.x=-t*this.scale.x+this.screenWidth,this._reset()}},{key:"left",get:function(){return-this.x/this.scale.x},set:function(t){this.x=-t*this.scale.x,this._reset()}},{key:"top",get:function(){return-this.y/this.scale.y},set:function(t){this.y=-t*this.scale.y,this._reset()}},{key:"bottom",get:function(){return-this.y/this.scale.y+this.worldScreenHeight},set:function(t){this.y=-t*this.scale.y+this.screenHeight,this._reset()}},{key:"dirty",get:function(){return this._dirty},set:function(t){this._dirty=t}},{key:"forceHitArea",get:function(){return this._forceHitArea},set:function(t){t?(this._forceHitArea=t,this.hitArea=t):(this._forceHitArea=!1,this.hitArea=new PIXI.Rectangle(0,0,this.worldWidth,this.worldHeight))}},{key:"pause",get:function(){return this._pause},set:function(t){(this._pause=t)&&(this.touches=[],this.leftDown=!1)}}]),r}();PIXI.extras.Viewport=v,e.exports=v},{"./bounce":1,"./clamp":3,"./clamp-zoom":2,"./decelerate":4,"./drag":5,"./follow":6,"./mouse-edges":7,"./pinch":8,"./snap":11,"./snap-zoom":10,"./utils":12,"./wheel":14}],14:[function(t,e,r){"use strict";var n=function(){function i(t,e){for(var r=0;re&&(r[i]=this.hyphenate(r[i]).join("­"));return r.join("")},e.prototype.hyphenate=function(t){var e,r,i,n,o,a,s,l,u,h=[],c=[],f=t.toLowerCase(),p=Math.max,d=this.trie,m=[""];if(this.exceptions.hasOwnProperty(f))return t.match(this.exceptions[f]).slice(1);if(-1!==t.indexOf("­"))return[t];for(e=(t="_"+t+"_").toLowerCase().split(""),r=t.split(""),s=e.length,i=0;ithis.leftMin&&i listener.call(context, ...args)); - this.onces.forEach(listener => listener.call(context, ...args)); + if (context == null) { + this.listeners.forEach(listener => listener(...args)); + this.onces.forEach(listener => listener(...args)); + } else { + this.listeners.forEach(listener => listener.call(context, ...args)); + this.onces.forEach(listener => listener.call(context, ...args)); + } + this.onces = []; } @@ -16987,7 +16961,7 @@ let interactionManager = this.renderer.plugins.interaction; let displayObject = interactionManager.hitTest(local, this); - console.log(displayObject.dontBlockScatter, displayObject.parent); + if (displayObject.dontBlockScatter && displayObject.parent != null) { displayObject = interactionManager.hitTest(local, displayObject.parent); } @@ -16995,7 +16969,7 @@ if (displayObject != null && displayObject.scatter != null) this.hitScatter = displayObject.scatter; if (this.claimEvents) event.claimedByScatter = this.hitScatter; - console.log(displayObject); + return this.hitScatter } } @@ -17197,26 +17171,22 @@ this.debugGraphics.endFill(); } - if (this.cover) { - // The reference to the element handler needs to be stored, - // that we can remove it later on. - const eventHandler = this._applyInitialCover.bind(this, null, true); - this._applyInitialCover(eventHandler); - } + // if (this.cover) { + // // The reference to the element handler needs to be stored, + // // that we can remove it later on. + // this._applyInitialCover = this._applyInitialCover.bind(this) + // } } - _applyInitialCover(eventHandler, removeListener = false) { - if (this.debug) console.log('ApplyInitialCover: ', parent); - if (removeListener) { - this.displayObject.off('added', eventHandler); - } + // _applyInitialCover() { + // if (this.debug) console.log('ApplyInitialCover: ', parent) - if (this.displayObject.parent) - this.forceCover(this.displayObject.parent.width, this.displayObject.parent.height); - else { - this.displayObject.on('added', eventHandler); - } - } + // if (this.displayObject.parent) + // this.forceCover(this.displayObject.parent.width, this.displayObject.parent.height) + // else { + // this.displayObject.on('added', eventHandler) + // } + // } get boundaries() { if (this._boundaries) return this._boundaries @@ -17338,7 +17308,11 @@ if (this.scalable && this.parent != null) { if (this.cover) { let minCoverScale = this.calculateMinCoverScale(this.parent.width, this.parent.height); - scale = scale < minCoverScale ? minCoverScale : scale; + if (scale < minCoverScale) { + console.error('USE MIN COVER SCALE', minCoverScale, scale); + + scale = minCoverScale; + } } this.scale = scale; } @@ -17394,7 +17368,6 @@ ); super(displayObject, renderer, opts); - if (!renderer) { console.error('Renderer was not set!'); return @@ -17791,11 +17764,8 @@ } unload() { - console.log('unload', this, this.image); if (this.image) { - console.log('removeScatter'); if (this.image.parent) { - console.log('Remove from parent'); this.image.parent.removeChild(this.image); } this.image.scatter = null; @@ -18044,6 +18014,7 @@ if (GeoMap._validateJson(json, error)) { for (let [mapname, data] of Object.entries(json)) { maps[mapname] = GeoMap._createMap(data); + maps[mapname].name = mapname; } } else console.error('Could not validate JSON: ' + error.message); @@ -18217,7 +18188,6 @@ */ load(container = null, scatter = null) { this.info = new DeepZoomInfo(this.tilesConfig); - console.log('APP:', this.mapdata.app); let image = new DeepZoomImage(this.info, { app: this.mapdata.app, alpha: this.alpha, @@ -18275,7 +18245,6 @@ // Don't scale beyond boundaries. if (this.maxScale) targetScale = Math.min(this.maxScale, targetScale); - if (this.minScale) targetScale = Math.max(targetScale, this.minScale); this.image.scatter.requestScale(targetScale); @@ -18287,15 +18256,12 @@ let containerCenter; if (this.frame) { - containerCenter = this.getFrame().localCenter; - //console.log("HAS FRAME: ", containerCenter) + containerCenter = this.getFrame().center; } else { containerCenter = { x: this.image.parent.width / 2, y: this.image.parent.height / 2 }; - - //console.log("GET CONTAINER CENTER") } //Calculate the delta depending on image position and center the @@ -18304,7 +18270,6 @@ x: containerCenter.x - point.x * this.image.scatter.scale - this.scatter.position.x, y: containerCenter.y - point.y * this.image.scatter.scale - this.scatter.position.y }; - // console.log("MOVE TO: " , this.image.scatter.translatable,point, delta) if (animate > 0) { let last = 0; @@ -18355,25 +18320,6 @@ viewport: this.viewport }); - //TODO: If frame is not set, the map does not work anymore. - - //map.load(container, scatter) - - // this.image.parent.children.forEach(child=>{ - // if(child instanceof PIXI.DisplayObject){ - - // if(child instanceof PIXI.Graphics){ - // // let clone = child.clone() - // // const position = child.position - // // clone.position.set(position.x, position.y) - // // map.addChild(clone) - // // console.log(map.mapLayer) - - // }else console.log("DisplayObject is not yet implemented for cloning.", child) - - // }else console.error("Not implemented object to clone: ", child) - // }) - return map } @@ -18426,7 +18372,6 @@ load(container = null, scatter = null) { super.load(this.sprite, container, scatter); - console.log('LOADED'); this.image.alpha = this.alpha; this.image.interactive = true; } @@ -18446,19 +18391,9 @@ }); map.load(container, scatter); - console.log(map.image); return map } - // transformed(e) { - // for (let key in this.overlays) { - // this.overlays[key].forEach((overlay) => { - // overlay.sprite.scale.x = overlay.scale / e.scale - // overlay.sprite.scale.y = overlay.scale / e.scale - // }) - // } - // } - /** * * @@ -18468,37 +18403,6 @@ * @memberof ImageMap */ moveTo(coordinates, zoom = null, { animate = 0 } = {}) { - // console.log('Coordinates: ', coordinates) - - // if (zoom) { - // this.image.scatter.requestScale(zoom) - // } - - // if (coordinates) { - // //Get pixel position of lat lang values - // let offset = Points.multiplyScalar(this.coordinatesToPoint(coordinates), this.scatter.scale) - - // let frame = this.getFrame() - // console.log(frame) - - // //Calculate the delta depending on image position and center the - // // desired position in the frame. - // let delta = { - // x: frame.center.x - offset.x - this.scatter.position.x, - // y: frame.center.y - offset.y - this.scatter.position.y - // } - - // console.log('Move to: ', offset, frame, delta) - - // if (this.image) { - // if (animate > 0) { - // console.log(animate) - // //TODO Replace this with a more robus manipulation method (RequestMovement + animation) - // this.image.scatter.move(delta, { animate }) - // //Requesting the transform dhoul be okay. Maybe also replace with an request mehtod. - // } else this.image.scatter.transform(delta, /*ratio*/ 1, 0, { x: 0, y: 0 }) - // } else console.error('Imge was not loaded yet.') - // } if (this.image.scatter == null) { return @@ -18528,14 +18432,11 @@ let containerCenter; if (this.frame) { containerCenter = this.getFrame().localCenter; - //console.log("HAS FRAME: ", containerCenter) } else { containerCenter = { x: this.image.parent.width / 2, y: this.image.parent.height / 2 }; - - //console.log("GET CONTAINER CENTER") } //Calculate the delta depending on image position and center the @@ -18545,7 +18446,6 @@ x: containerCenter.x - point.x * this.image.scatter.scale - this.scatter.position.x, y: containerCenter.y - point.y * this.image.scatter.scale - this.scatter.position.y }; - // console.log("MOVE TO: " , this.image.scatter.translatable,point, delta) if (animate > 0) { let last = 0; @@ -18603,7 +18503,7 @@ return this._zoom } - update(map) { + apply(map) { map.moveTo(this._focus, this._zoom); } @@ -18612,7 +18512,7 @@ this.updateFocusPoint(map); } - applyCameraPosition(map) { + updatePosition(map) { this.updateFocusPoint(map); this.updateZoom(map); } @@ -18634,24 +18534,39 @@ } mapPointToWindowPoint(map, point) { - let container = map.image.parent; + let windowPoint = { x: 0, y: 0 }; - let _point = new PIXI.Point( - map.scatter.position.x + map.scatter.scale * point.x, - map.scatter.position.y + map.scatter.scale * point.y - ); + if (map['image'] && map.image['parent']) { + let container = map.image.parent; - return container.toGlobal(_point) + windowPoint = new PIXI.Point( + map.scatter.position.x + map.scatter.scale * point.x, + map.scatter.position.y + map.scatter.scale * point.y + ); + + windowPoint = container.toGlobal(windowPoint); + } else { + console.error(this._noParentError); + } + + return windowPoint } windowPointToMapPoint(map, point) { - let offset = map.image.parent.toGlobal({ x: 0, y: 0 }); - let _point = new PIXI.Point( - (point.x - map.scatter.position.x - offset.x) / map.scatter.scale, - (point.y - map.scatter.position.y - offset.y) / map.scatter.scale - ); + let pointOnMap = { x: 0, y: 0 }; + if (map['image'] && map.image['parent']) { + let offset = map.image.parent.toGlobal({ x: 0, y: 0 }); + pointOnMap = new PIXI.Point( + (point.x - map.scatter.position.x - offset.x) / map.scatter.scale, + (point.y - map.scatter.position.y - offset.y) / map.scatter.scale + ); + } else console.error(this._noParentError); - return _point + return pointOnMap + } + + get _noParentError() { + return 'Cannot compute map point when map has no parent.' } /** @@ -19136,6 +19051,7 @@ this.drawEndHandler = new EventHandler('onDrawEnd', { listeners: onDrawEnd }); this._points = null; this._position = null; + this.map = null; } clone() { @@ -19201,6 +19117,7 @@ * Called by the containing geo layer, when the map changes. */ adaptTo(map) { + this.map = map; this._points = this._adaptCoordinates(map); this._updatePosition(); this.draw(); @@ -19235,6 +19152,14 @@ return this._position } + get layer() { + return this._layer ? this._layer : null + } + + setLayer(layer) { + this._layer = layer; + } + // get map() { // if ( // this.graphics.layer && @@ -19640,6 +19565,69 @@ } } + class MapList { + constructor(active, maps) { + this.maps = maps; + this.active = active; + + if (Object.keys(maps).length > 0) this.select(active); + } + + /** + * Selects a map from the map list. + * + * @param {string} active - Name of the map to select. + * @returns + * @memberof MapList + */ + select(active) { + let map = null; + + if (active !== this.active) { + let keys = Object.keys(this.maps); + if (keys.length > 0) { + if (this.maps[active] == null) { + let altActive = keys[0]; + console.warn( + `The MapList does not contain the provided active key '${active}'. Used '${altActive}' as fallback.` + ); + + active = altActive; + } + + if (this.active !== active) { + this.active = active; + map = this.maps[active]; + } + } else { + console.error(`Could not provide a fallback map! The map object is empty.`); + } + } + + return map + } + + add(key, map) { + if (this.maps[key] != null) consol.warn('Key already in mapList. The existing key was overwritten.'); + map.name = key; + this.maps[key] = map; + } + + get map() { + console.log(this.maps, this.active); + return this.maps[this.active] + } + + next() { + let keys = Object.keys(this.maps); + let idx = keys.indexOf(this.active); + + let next = idx + 1 < key.length ? keys[idx + 1] : keys[0]; + console.log(keys, idx, next); + return next + } + } + //import { GeoGraphics } from "../pixi/geographics.js" /** @@ -19648,7 +19636,7 @@ * of the Adaption. */ class GeoLayer { - constructor(displayObject) { + constructor(displayObject, opts = {}) { if (displayObject == null || !(displayObject instanceof PIXI.DisplayObject)) { console.error( `You need to provide a displayObject to make a ${this.constructor.name} out of it.`, @@ -19657,15 +19645,14 @@ return null } else { this.geographics = []; - displayObject.map = this; + // displayObject.map = this this.displayObject = displayObject; - this.layers = []; - this.pixiAddChild = displayObject.addChild.bind(displayObject); displayObject.addChild = (...elements) => { elements.forEach(element => { if (element instanceof GeoGraphics) { + element.setLayer(this); this.geographics.push(element); this.pixiAddChild(element.graphics); } else { @@ -19674,6 +19661,62 @@ }); }; } + + this.name = opts['name'] != null ? opts.name : 'Unnamed Layer'; + this.parent = null; + this.parentMapLayerTransformedHandler = new EventHandler('onParentMapLayerTransformed'); + this.layers = []; + this._visibility = { min: 0, max: Number.MAX_VALUE }; + } + + parentMapLayerTransformed(mapLayer) { + this.layers.forEach(layer => { + if (!(layer instanceof MapList)) { + layer.parentMapLayerTransformed(); + } + }); + + this.parentMapLayerTransformedHandler.call(null, mapLayer); + + this.rescaleChildren(); + } + + rescaleChildren() { + let map = this.map; + + if (this.rescale) { + if (map != null) { + let scale = map.image.scatter.scale; + + this.displayObject.children.forEach(graphics => { + graphics.scale.set(1 / scale, 1 / scale); + }); + } + } + + let mapLayer = this.mapLayer; + if (this.visibility && mapLayer != null) { + const zoom = mapLayer.mapview.zoom; + + // TODO + // Currently I dont know what elemnts was. + // We just log an error and resolve this on a later point. + if (zoom > this.visibility.min && zoom < this.visibility.max) { + this.displayObject.children.forEach(it => (it.visible = true)); + } else { + this.displayObject.children.forEach(it => (it.visible = false)); + } + } + } + + set visibility(value) { + let { min = 0, max = Infinity } = value; + console.log(min); + this._visibility = { min, max }; + } + + get visibility() { + return this._visibility } addChild(element) { @@ -19695,6 +19738,8 @@ this.layers.forEach(layer => { if (layer.adapt) layer.adapt(map); }); + + this.rescaleChildren(); } else console.error('There was no map specified.', this); } @@ -19707,19 +19752,54 @@ // } else super.place(geographic) // } + removeFromParent() { + if (this.parent) { + this.parent.removeLayer(this); + } + } + + removeLayer(layer) { + let idx = this.layers.indexOf(layer); + if (idx != -1) { + layer.parent = null; + this.layers.splice(idx, 1); + + if (layer.displayObject.parent) { + layer.displayObject.parent.removeChild(layer.displayObject); + } + } else console.warn('Tried to remove layer that was not set.', this, layer); + } + + set parent(parent) { + this._parent = parent; + } + + get parent() { + return this._parent + } + addLayer(layer) { if (layer instanceof GeoLayer || layer instanceof MapLayer) { + layer.removeFromParent(); + this.layers.push(layer); + layer.parent = this; + layer.parentChanged(); + this.displayObject.addChild(layer.displayObject); if (this.map) layer.geographics.forEach(geographics => geographics.adaptTo(this.map)); } else console.error('Could not place layer. Only MapLayer and GeoLayers can be child layers of GeoLayers.', layer); } + parentChanged() { + this.rescaleChildren(); + } + //GeoLayers have to be children of a map layer, // therefore we can recursively get the map. get map() { - return this._mapLayer.map + return this.mapLayer ? this.mapLayer.map : null } get mapLayer() { @@ -19755,18 +19835,12 @@ constructor( scatterContainer, displayObject, - { onTransform = null, onChange = null, focus = null, zoom = null, viewport = null } = {} + { onTransform = null, onChange = null, focus = null, zoom = null, viewport = null, mapList = null } = {} ) { super(displayObject); - let onTransformListeners = [ - () => { - this.labelVisibility(); - } - ]; - if (onTransform) onTransformListeners.push(onTransform); this.transformHandler = new EventHandler('onTransform', { - listeners: onTransformListeners + listeners: onTransform }); this.scatterContainer = scatterContainer; @@ -19781,6 +19855,7 @@ viewport }); + this.mapList = mapList; this._map = null; // //TODO Implement error handling here. @@ -19789,39 +19864,6 @@ this.dynamicElements = new Map(); } - labelVisibility() { - const visibility = this.childrenVisibility; - - if (visibility) { - const zoom = this.mapview.zoom; - - const min = visibility.min || 0; - const max = visibility.max || Number.MAX_VALUE; - - if (zoom > min && zoom < max) { - this.elements.forEach(it => (it.visible = true)); - - this.elements.forEach(it => { - const scale = 1 / it.parent.scale.x; - - // it.children are poi groups - // it.children[0] is the poi group of the tübingen poi - // it.children[0].children are the text containers (not PIXI.Text), about 20 pieces - - if (it.children.length > 0) { - it.children[0].children.forEach(poi => { - if (poi.children.length === 1) { - poi.scale.set(scale, scale); - } - }); - } - }); - } else { - this.elements.forEach(it => (it.visible = false)); - } - } - } - adapt() { this.layers.forEach(layer => { if (layer.adapt) layer.adapt(this.map); @@ -19837,6 +19879,7 @@ transformed(e) { this.mapview.transformed(this.map); + this.layers.forEach(layer => layer.parentMapLayerTransformed(this)); this.transformHandler.call(this); } @@ -19871,6 +19914,7 @@ useScatterAsContainer = true // If set to false, the normal container is used. This is necessary when using submaps and the container need to be a RigidContainer.*/ ) { if (map instanceof GeoMap) { + console.log('Change map to: ', map); let oldMap = this.map; if (oldMap) oldMap.unload(); @@ -19879,8 +19923,8 @@ this.map.load(); this.scatterContainer.addChild(this.map.image); + this.mapview.apply(this.map); map.image.addChild(this.displayObject); - this.mapview.update(this.map); // A geolayer's displayObject is on the parent layer. // A maplayer's displayobject is always the child of the map. @@ -19964,723 +20008,6 @@ MapLayer.idx = 0; - /** - * The Layers Framework makes managing layers, that may have a different underlying - * technology (e.g. PIXI and DOM) more convenient. - * - * Layer is an abstract class, which makes the Framework quite generic and expandable. - */ - class Layer { - constructor({ name = 'unnamed', layers = [], debug = false, container = null, root = null } = {}) { - this.parent = null; - - this._container = container; - if (this.container) { - this._defineAsLayer(); - } - - // Layers should be distinct from regular elements. - this.name = name; - //Object to backup values when manipulating the Dom. - this.backup = {}; - - this.layers = []; - layers.forEach(layer => this.addLayer(layer)); - - this.elements = []; - - // Adds the root Element to the page. - if (root) { - this._appendRoot(root); - } - - this.debug = debug; - if (debug) this._visualizeLayer(); - } - - /** - * If the element is a root element, it has to know - * how it appends to the page. - */ - _appendRoot(ground) { - console.error('Method _appendRoot(_appendRoot) is abstract. Overload it in subclass', this, ground); - } - - /** - * The container has to know which layer it corresponds to. - * Therefore we need to set an attribute to identify the layer. - * This may change depending on the elements. - * Therefore subclasses have to overload it. - */ - _defineAsLayer() { - console.error('Method _defineAsLayer is abstract. Overload it in subclass.', this); - } - - /** - * Adds an element as child, whether it's an element or an layer. - * - * @param {object} elem - Element or Layer to add as child to the layer. - */ - place(elem) { - if (elem instanceof Layer) this.placeLayer(elem); - if (elem instanceof GeoLayer) { - this.placeElement(elem.displayObject); - } else { - this.placeElement(elem); - } - } - - /** - * Adds an layer as child of the layer- - * - * @param {Layer} layer - Layer to be added as child. - */ - placeLayer(layer) { - if (this.container) this.placeElement(layer.container); - this.layers.push(layer); - layer.parent = this; - return true - } - - remove(elem) { - if (elem instanceof Layer) { - this.removeLayer(elem); - } else this._removeElement(elem); - } - - removeLayer(layer) { - let idx = this.layers.indexOf(layer); - let removedArr = this.layers.splice(idx, 1); - if (removedArr.length > 0) { - let container = removedArr[0].container; - if (container) container.parent.removeChild(container); - } - } - - /** - * Removes an element from the Layer. - * Calls the abstract method removeElement for custom behaviours in - * subclasses. - * - * @private - * @param {object} element - Element within the 'this.children' array to be removed. - * @memberof Layer - */ - _removeElement(element) { - let elementIndex = this.elements.indexOf(element); - - if (elementIndex === -1) { - console.error('The element you wanted to remove was not a child of the layer.', element, this); - } else { - this.elements.splice(elementIndex, 1); - this.elements.forEach(child => console.log(child)); - this.removeElement(element); - } - } - - /** - * Removes an element from the Layer. - * - * @publuc - * @param {object} element - Element within the 'this.children' array to be removed. - * @memberof Layer - */ - removeElement(element) { - console.error('Method removeElement(element) is abstract. Overload it in subclass.', this, element); - } - - getLayerByName(name) { - for (let i = 0; i < this.layers.length; i++) { - if (this.layers[i].name == name) { - return this.layers[i] - } - } - return null - } - - /** - * The container, that holds the child elements of - * the respective technology. - */ - get container() { - return this._container - } - - /** - * Adds a non-layer child to the layer. - */ - placeElement(element) { - console.error('Method placeElement(element) is abstract. Overload it in subclass.', this, element); - } - - /** - * Moves the layer one up. - */ - up() { - if (this.parent) this.parent.requestUp(this); - else console.warn("Root layer can't be moved up: ", this); - } - - /** - * Moves a child element one layer up. - * - * @param {object} child - Child element to change. - */ - requestUp(child) { - console.error('Method requestUp(child) is abstract. Overload it in subclass.', child); - } - - /** - * Moves the layer one down. - */ - down() { - if (this.parent) this.parent.requestDown(this); - else console.warn("Root layer can't moved down: ", this); - } - - /** - * Moves a child element one layer down. - * - * @param {object} child - Child element to change. - */ - requestDown(child) { - console.error('Method requestDown(child) is abstract. Overload it in subclass.', child); - } - - /** - * Bring the element on Top of the layer. - * - * @param {object} element - Child element, that should be put on top. - */ - toFront() { - console.log(this); - if (this.parent && this.container) this.parent.requestToFront(this.container); - else console.warn("Root layer can't be put toFront: ", this); - } - - /** - * Brings the element to the top of the layer. - * - * @param {object} element - Child element, that should be put on top. - */ - requestToFront(element) { - console.error('Method requestToFront(element) is abstract. Overload it in subclass.', element); - } - - /** - * Brings the layer to the bottom. - */ - toBottom() { - if (this.parent && this.container) this.parent.requestToBottom(this.container); - else console.warn("Root layer can't be put ToBottom: ", this); - } - - /** - * Brings the element to the bottom of the layer. - * - * @param {object} element - Child element, that should be put on bottom. - */ - requestToBottom(element) { - console.error('Method requestToBottom(element) is abstract. Overload it in subclass.', element); - } - - get position() { - console.error('Getter position is abstract. Overload is in subclass:', this); - } - - set position(value) { - console.error('Setter position is abstract. Overload is in subclass:', this, value); - } - - /* - * Hides the layer. - */ - hide() { - console.error('Method hide() is abstract. Overload is in subclass:', this); - } - - /* - * Shows the layer. - */ - show() { - console.error('Method show() is abstract. Overload is in subclass:', this); - } - - get visible() { - console.error("Getter 'visible' is abstract. Overload it in subclass.", this); - } - - toggle() { - if (this.visible) this.hide(); - else this.show(); - } - - get root() { - if (this.parent) return this.parent.root - else return this - } - - static find(element) { - console.error('Call the find method of an appropriate child method: ', element); - } - - subscribeEvent(name, callback, { bubbleOnly = false, captureOnly = false, stopPropagation = false } = {}) { - let event = { - callback, - options: { bubbleOnly, captureOnly, stopPropagation } - }; - if (!this.eventListeners.hasOwnProperty(name)) { - this.eventListeners.name = event; - } else { - if (Array.isArray(this.eventListeners.name)) { - this.eventListeners.name.push(event); - } else { - let arr = [this.eventListeners.name]; - this.eventListeners.name = arr; - this.eventListeners.name.push(event); - } - } - } - - dispatchEvent(name, data, { bubble = false, capture = false } = {}) { - if (bubble && this.parent) this.parent._eventOccured(name, data, this, 'bubble'); - if (capture) - this.layers.forEach(layer => { - layer.dispatchEvent(name, data, this, 'capture'); - }); - } - - _eventOccured(name, data, target, phase) { - if (this.eventListeners.hasOwnProperty(name)) { - this.eventListeners.name.callback({ name, data, target, phase }); - } - } - - /** - * Clones the layer with all its children. - */ - clone() { - console.error('Call of abstract method Layer.clone(). Inherit in subclass.', this); - } - - /** - * Clones an element on the layer. - */ - static cloneElement(element) { - console.error('Call of abstract static method Layer.cloneElement(element). Inherit in subclass.', this); - } - } - - /** - * The Layer class for DOM elements. - */ - class DOMLayer extends Layer { - constructor(opts) { - super( - Object.assign( - { - container: DOMLayer._createContainer() - }, - opts - ) - ); - } - - _appendRoot(ground) { - ground.appendChild(this.container); - } - - _visualizeLayer() { - if (this.container) { - let span = document.createElement('span'); - span.innerHTML = this.name; - this.container.appendChild(span); - } - } - - _defineAsLayer() { - this._container.layer = this; - } - - static _createContainer() { - let container = document.createElement('div'); - return container - } - - placeLayer(layer) { - layer.container.position = 'absolute'; - super.placeLayer(layer); - } - - placeElement(domElement) { - if (domElement instanceof HTMLElement) { - this.elements.push(domElement); - this._container.appendChild(domElement); - } else console.error('Could not add element, it is not a DOM Element.', domElement); - } - - static createLayer(style) { - let dom = document.createElement('div'); - - return dom - } - - static find(element) { - if (element.layer) return element.layer - - while (element.parentNode) { - element = element.parentNode; - if (element.layer) return element.layer - } - - return null - } - - /** - * Moves the layer one up. - */ - up() { - if (this.parent && this.container) this.parent.requestUp(this.container); - else console.warn("Root layer can't be moved up: ", this); - } - - /** - * Moves a child element one layer up. - * - * @param {object} child - Child element to change. - */ - requestUp(child) { - if (child.nextSibling) child.parentNode.insertBefore(child.nextSibling, child); - } - - /** - * Moves the layer one down. - */ - down() { - if (this.parent && this.container) this.parent.requestDown(this.container); - else console.warn("Root layer can't moved down: ", this); - } - - /** - * Moves a child element one layer down. - * - * @param {object} child - Child element to change. - */ - requestDown(child) { - if (child.previousSibling) child.parentNode.insertBefore(child, child.previousSibling); - } - - /** - * Brings the element to the top of the layer. - * - * @param {object} element - Child element, that should be put on top. - */ - requestToFront(element) { - console.log(element); - element.parentNode.appendChild(element); - } - - /** - * Brings the element to the bottom of the layer. - * - * @param {object} element - Child element, that should be put on bottom. - */ - requestToBottom(element) { - element.parentNode.prepend(element); - } - - /* - * Hides the layer. - */ - hide() { - if (this._container.style.display != 'none') { - this.backup.display = this._container.style.display; - } - this._container.style.display = 'none'; - } - - /* - * Shows the layer. - */ - show() { - this._container.style.display = this.backup.display ? this.backup.display : 'initial'; - } - - get visible() { - return this._container.style.display == 'none' - } - - get position() { - let x = this.container && this.container.style.left ? parseInt(this.container.style.left) : 0; - let y = this.container && this.container.style.top ? parseInt(this.container.style.top) : 0; - return { x, y } - } - - set position(value) { - if (this.container) { - this.container.style.left = value.x + 'px'; - this.container.style.top = value.y + 'px'; - } - } - } - - /** - * The Layer class for PIXI Elements. - */ - class PIXILayer extends Layer { - constructor(opts = {}) { - opts = Object.assign( - { - container: new PIXI.Graphics(), - debug: false - }, - opts - ); - super(opts); - - if (opts.debug) { - this.container.interactive = true; - this.container.on('pointerdown', event => { - console.log(this.name); - }); - } - } - - static cloneElement(element) { - if (element instanceof PIXI.Graphics) { - let clone = element.clone(); - console.log('Clone Parent: ', clone.parent); - // PIXI does not clone the transform properties. - // We have to apply them manually. - - clone.position = element.position; - clone.rotation = element.rotation; - clone.scale = element.scale; - - return clone - } else { - console.error('Cloning of PIXI element not yet implemented: ', element); - } - } - - _appendRoot(ground) { - ground.stage.addChild(this.container); - } - - _defineAsLayer() { - this._container.layer = this; - } - - transform(event) { - if (event.about) { - let relScale = this.scale / event.scale - 1; - let localAnchor = this.toLocal(event.about); - event.translate = Points.add(event.translate, Points.multiplyScalar(localAnchor, relScale)); - } - - super.transform(event); - } - - toLocal(point) { - return Points.subtract(point, this.position) - } - - _visualizeLayer() { - this.place(new PIXI.Text(this.name)); - } - - _update(delta) { - const margin = 30; - const length = 100; - - let origin = new PIXI.Polygon([ - new PIXI.Point(this.position.x, this.position.y + length * this.scale), - new PIXI.Point(this.position.x, this.position.y), - new PIXI.Point(this.position.x, this.position.y - length * this.scale), - new PIXI.Point(this.position.x, this.position.y), - new PIXI.Point(this.position.x - length * this.scale, this.position.y), - new PIXI.Point(this.position.x, this.position.y), - new PIXI.Point(this.position.x + length * this.scale, this.position.y) - ]); - - let rect = new PIXI.Rectangle( - this.position.x + margin * this.scale, - this.position.y + margin * this.scale, - length * this.scale, - length * this.scale - ); - - this.container.drawShape(origin); - this.container.drawShape(rect); - } - - placeElement(pixiElement) { - try { - pixiElement.layer = this; - this.container.addChild(pixiElement); - this.elements.push(pixiElement); - return true - } catch (e) { - console.error(e, this, pixiElement); - } - return false - } - - requestUp(child) { - if (child instanceof Layer) { - if (child.container) child = child.container; - else return - } - - const oldIdx = this.children.indexOf(child); - if (oldIdx > -1) { - const newIdx = oldIdx + 1; - - if (newIdx < this.children.length) { - let elem = this.children.splice(oldIdx, 1); - this.children.splice(newIdx, 0, elem[0]); - } - } - } - - requestDown(child) { - if (child instanceof Layer) { - if (child.container) child = child.container; - else return - } - - const oldIdx = this.children.indexOf(child); - if (oldIdx > -1) { - const newIdx = oldIdx - 1; - - if (newIdx >= 0) { - let elem = this.children.splice(oldIdx, 1); - this.children.splice(newIdx, 0, elem[0]); - } - } - } - - requestToFront(child) { - const oldIdx = this.children.indexOf(child); - this.children.splice(oldIdx, 1); - this.children.push(child); - } - - requestToBottom(child) { - const oldIdx = this.children.indexOf(child); - this.children.splice(oldIdx, 1); - this.children.unshift(child); - } - - get children() { - return this.container.children - } - - follow(layer) { - super.follow(layer); - this.container.position = this.position; - this.container.scale = { x: this.scale, y: this.scale }; - } - - set position(value) { - if (this.container) this.container.position = value; - } - - get position() { - if (this.container) return this.container.position - } - - show() { - this.container.visible = true; - } - - hide() { - this.container.visible = false; - } - - get visible() { - return this.container.visible - } - - static find(element) { - if (element.layer) return element.layer - - while (element.parent) { - element = element.parent; - if (element.layer) return element.layer - } - - return null - } - - removeElement(element) { - element.parent.removeChild(element); - } - } - - class MapList { - constructor(active, maps) { - this.maps = maps; - this.active = active; - - if (Object.keys(maps).length > 0) this.select(active); - } - - /** - * Selects a map from the map list. - * - * @param {string} active - Name of the map to select. - * @returns - * @memberof MapList - */ - select(active) { - let map = null; - - if (active !== this.active) { - let keys = Object.keys(this.maps); - if (keys.length > 0) { - if (this.maps[active] == null) { - let altActive = keys[0]; - console.warn( - `The MapList does not contain the provided active key '${active}'. Used '${altActive}' as fallback.` - ); - - active = altActive; - } - - if (this.active !== active) { - this.active = active; - map = this.maps[active]; - } - } else { - console.error(`Could not provide a fallback map! The map object is empty.`); - } - } - - return map - } - - add(key, map) { - if (this.maps[key] != null) consol.warn('Key already in mapList. The existing key was overwritten.'); - map.name = key; - this.maps[key] = map; - } - - get map() { - console.log(this.maps, this.active); - return this.maps[this.active] - } - - next() { - let keys = Object.keys(this.maps); - let idx = keys.indexOf(this.active); - - let next = idx + 1 < key.length ? keys[idx + 1] : keys[0]; - console.log(keys, idx, next); - return next - } - } - /** * MapApp is responsible for showing fullscreen * map applications. @@ -20764,7 +20091,8 @@ _setupMapLayer() { this.mapContainer = new PIXI.Container(); - this.mapLayer = new MapLayer(this.scene, this.mapContainer, { + console.log(this.mapList); + this.mapLayer = new MapLayer(this.mapList, this.scene, this.mapContainer, { name: 'Map Layer', focus: this.focus, zoom: this.zoom @@ -20779,22 +20107,16 @@ super.setup(); // TODO get access to fps display - let fpsDisplay; + let fpsDisplay = null; this.stage.children.forEach(element => { if (element.refreshFps) fpsDisplay = element; }); - this.pixiLayer = new PIXILayer({ - name: 'Pixi Root', - container: this.scene - }); - this._setupMapLayer(); this.ui = new PIXI.Container(); this.scene.addChild(this.ui); - - if (this.fpsLogging && fpsDisplay) this.ui.addChild(fpsDisplay); + if (this.fpsLogging != null && fpsDisplay != null) this.ui.addChild(fpsDisplay); if (this.coordsLogging) { this.coordsDisplay = new CoordinateDisplay(this); @@ -20876,9 +20198,7 @@ } addMap(key, map) { - if (this.mapLayer != null) this.mapLayer.mapList.add(key, map); if (this.mapList) this.mapList.add(key, map); - //This is necessary as there is a state, when the mapList else console.error('Cannot access mapLayer. It was not initialized yet.'); } @@ -20897,24 +20217,11 @@ lastMap.flushHandlers(); } - /** - * TODO: A problem is that the map layer has no container - * on its own and it lives in the ScatterContainer. - * Here we guarantee, that the layer order is as it - * is defined in the layers. - */ - // this.pixiLayer.layers.forEach(layer => { - // if (layer !== this.mapLayer) { - // layer.parent.container.removeChild(layer.container) - // layer.parent.container.addChild(layer.container) - // } - // }) - - this.map.onTransform.add(this.transformed.bind(this)); - this.transformed(); this.onMapChanged.call(this, this.map); + this.map.onTransform.add(this.transformed.bind(this)); + if (this.ui && this.ui.parent) { const parent = this.ui.parent; parent.removeChild(this.ui); @@ -20943,20 +20250,6 @@ this.overlayElements.set(layer, obj); } - place(layer) { - if (layer instanceof PIXILayer) { - this.pixiLayer.place(layer); - } else if (layer instanceof DOMLayer) { - this.domLayer.place(layer); - } else { - console.error('Could not add layer to ', this, layer); - } - } - - addMapOverlay(layer) { - this.mapLayer.place(layer); - } - /** * Copies the current coordinates to the clipboard. */ @@ -20995,6 +20288,7 @@ } get map() { + console.log(this.mapList); return this.mapList.map } @@ -21645,6 +20939,7 @@ scale: 1, rescale: false, popoverOffset: { x: 0, y: 0 }, + zoomVisibility: { min: 0, max: Number.MAX_VALUE }, /** * The following Attributes are taken from the TextStyle class @@ -21754,6 +21049,10 @@ } = {}) { const name = this.name[0].toUpperCase() + this.name.slice(1).toLowerCase() + ' Overlay'; let geoLayer = new GeoLayer(new PIXI.Container(), { name }); + + console.log(this); + geoLayer.visibility = this.zoomVisibility; + if (this.rescale) geoLayer.rescale = this.rescale; this.items.forEach(item => { if (!excludeItems(item)) { @@ -21768,7 +21067,6 @@ }); return geoLayer } - getItemProperty(item, property) { let propertyValue = null; const propertyExistsOnItem = item[property] !== undefined; @@ -22075,6 +21373,11 @@ maxWidth: 350 }); + if (geographics.map) { + const scale = 1 / geographics.map.scatter.scale; + popup.scale.set(scale, scale); + } + popup.position.set( geographics.graphics.position.x - popup.width / 2, geographics.graphics.position.y - popup.height - 20 diff --git a/package-lock.json b/package-lock.json index 2c484eb..2e28549 100644 --- a/package-lock.json +++ b/package-lock.json @@ -220,52 +220,158 @@ "dev": true }, "@pixi/accessibility": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/accessibility/-/accessibility-5.1.5.tgz", - "integrity": "sha512-xHgcVN6sDqqpkcgk+yJ5s6tCf7ZW2YZVop7bQL9avuJaP6I/0mbwUN3evWonQ4QNO6SF8V/QXOc3ZmEdkYILPA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/accessibility/-/accessibility-5.2.0.tgz", + "integrity": "sha512-IXnCy9YmzXl9/rMiXOzgFpP7onW0YNSnVQtFotonCEPd2azM/1p3Fy7wRTcpfOJm/JsMZRbnDeE/wB9Shg9/QQ==", "requires": { - "@pixi/core": "^5.1.5", - "@pixi/display": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/core": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/utils": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } }, "@pixi/app": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/app/-/app-5.1.5.tgz", - "integrity": "sha512-BxcNAulUXVkTpOqS5gjorO2d3+wksmBfn0VFGdiq7Elbv3v0s8wCwGOlOSMJoAjYSPXz8H8t3dw8NHxqxpI53A==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/app/-/app-5.2.0.tgz", + "integrity": "sha512-5rhjAGPruzC3w6+knySIWk4II1Td8Fw0LVfg1K48BRXI1mLXCrZ3tJb6hdFuBPhgeIDz1tUwecJ4KfkJOWgqPg==", "requires": { - "@pixi/core": "^5.1.5", - "@pixi/display": "^5.1.3" + "@pixi/core": "^5.2.0", + "@pixi/display": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } @@ -300,27 +406,80 @@ } }, "@pixi/extract": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/extract/-/extract-5.1.5.tgz", - "integrity": "sha512-sn13RxtWpqZq05K9IJxF/00ddMsiDlpQAwEwA8fQIsMSbt6lBTm1fa0u/nZqQjRhJk72Q+41h4LXEhZEMMowAg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/extract/-/extract-5.2.0.tgz", + "integrity": "sha512-LUDsB6z+gkSYcS8urr/JjdpLlf/z3mAjpMJDOZlcxCdPXdayVka2ruNnrWb4dvf9nV9Wg7T8v1IOFGOWpOHEdQ==", "requires": { - "@pixi/core": "^5.1.5", - "@pixi/math": "^5.1.0", - "@pixi/utils": "^5.1.3" + "@pixi/core": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/utils": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } @@ -409,25 +568,78 @@ } }, "@pixi/filter-color-matrix": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/filter-color-matrix/-/filter-color-matrix-5.1.5.tgz", - "integrity": "sha512-zhg8FE22WA7sH1mhvjjSaWav7BXFbU63usdh9pVNv2Hd7cuDtO9x8aLy+RqGozqENfYHzRUlTdKrNdl5QEbYMg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/filter-color-matrix/-/filter-color-matrix-5.2.0.tgz", + "integrity": "sha512-wtPzz+2NtP9zDW9cFn/lTryf97/DYwka4yi9A+sMCteoATsrZJCKz0zzPV5AORKv0hpCfu9wGYTISItOC8mBKw==", "requires": { - "@pixi/core": "^5.1.5" + "@pixi/core": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } @@ -466,26 +678,79 @@ } }, "@pixi/filter-displacement": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/filter-displacement/-/filter-displacement-5.1.5.tgz", - "integrity": "sha512-/ZzlTT+jFQTwg57jj6kl4lH+0Z3iwtp+tDXdYcusNDe44hZn9Wd+IzZkS/LCeay40cY4JPRrXznVwlZ6AiBsHQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/filter-displacement/-/filter-displacement-5.2.0.tgz", + "integrity": "sha512-489KUlNF4ZmHZPNmI2X77cE95sfbvvw5NASeNXKmbCn5xi2gPSxiPMTv4XUTdhdOKxNcy81NFEQicG21eW335Q==", "requires": { - "@pixi/core": "^5.1.5", - "@pixi/math": "^5.1.0" + "@pixi/core": "^5.2.0", + "@pixi/math": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } @@ -519,25 +784,78 @@ } }, "@pixi/filter-fxaa": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/filter-fxaa/-/filter-fxaa-5.1.5.tgz", - "integrity": "sha512-Zg2pSBpb0pxJozWraNrHUC97C3gSjK+NSaMGBN6NpfaGcn+/xaZjFBwwYDeTpHAw6IDV+3Ln+z7D5h9pPEliKg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/filter-fxaa/-/filter-fxaa-5.2.0.tgz", + "integrity": "sha512-rlhC65BALzQAVBEXYzr8bKqyhZIWLco+VWJ7Fs8D3bJCutyu6xX6d7XDAqQW5SmJCNrIdaKvl/B6Xzer/+z8DA==", "requires": { - "@pixi/core": "^5.1.5" + "@pixi/core": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } @@ -598,25 +916,78 @@ } }, "@pixi/filter-noise": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/filter-noise/-/filter-noise-5.1.5.tgz", - "integrity": "sha512-/HGr9dxvBVc+qRJ/JU/6ZHz3BshnUwCTgEfQtxJmo2I6lqn9cWoiL4q+iKk9QkGmLtLNip77zc0KveYN01eh/g==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/filter-noise/-/filter-noise-5.2.0.tgz", + "integrity": "sha512-7IBHqjuze5VEMYOKPz/O7wR3mks7xvYKvWmUaLV7FopUtDUFjklrVBWY39nBOsXKXm0qLOkkdKcwsqyXZ7xOFg==", "requires": { - "@pixi/core": "^5.1.5" + "@pixi/core": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } @@ -713,58 +1084,164 @@ } }, "@pixi/graphics": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/graphics/-/graphics-5.1.5.tgz", - "integrity": "sha512-u9uq/6ylS5oRCsWaTi0uOCuAimAvaXJ57ATKT/nylHRXv+GfbPoMJAHpqTWx8HojK7P6PBUJCenPa0BFVcq9gg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/graphics/-/graphics-5.2.0.tgz", + "integrity": "sha512-sXmN8CEjzd56wVh18AOv1cxsB70tP1FWIukTPg8EaSlhiFqiclQDGkf6mKDajuVrj7JhBjvFenKmv3ADYnLkqA==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/core": "^5.1.5", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/sprite": "^5.1.5", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/core": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/sprite": "^5.2.0", + "@pixi/utils": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } }, "@pixi/interaction": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/interaction/-/interaction-5.1.5.tgz", - "integrity": "sha512-N8SONgHZZuDLPAL3LvfMTfgRsD6084KJA9VbwJ6Ujvm95NwSInNC2HRB6uXsSYTC4I1bMcRhot3CjZkB5BEURA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/interaction/-/interaction-5.2.0.tgz", + "integrity": "sha512-YoFGrwkKgNFsusXObcfgKJtLxjqeOaek3tZxssnZZOUSzIJGQ4mLur2I36C2AAufB+GxBL38TiP1nkAVurMC6A==", "requires": { - "@pixi/core": "^5.1.5", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/core": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } @@ -780,27 +1257,80 @@ } }, "@pixi/loaders": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/loaders/-/loaders-5.1.5.tgz", - "integrity": "sha512-jcuJMMGIr7/o8HKtVL9YzUTQQGk4K4uNQylUbhnNDFVuJcVzuBwD/TCWJ/+2Y879vBzipXdhCw7JLA4F8w6bkg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/loaders/-/loaders-5.2.0.tgz", + "integrity": "sha512-lKd5RYGQ86NoQNFcu/IYLEkC/oa6XypDKewG9LDd7n9XKKeed0NRipg7HhcYVsliayYkszoQ/JdzidV/yxnHYw==", "requires": { - "@pixi/core": "^5.1.5", - "@pixi/utils": "^5.1.3", + "@pixi/core": "^5.2.0", + "@pixi/utils": "^5.2.0", "resource-loader": "^3.0.1" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } @@ -811,170 +1341,519 @@ "integrity": "sha512-Vf9W4SgYRRQMdSq8tFViKKKGCU3iklf0RDzd+wzp4gezOxe3m0PLB7XKwvVrP1hRjUh49zIAL9JBpYREPS1EMw==" }, "@pixi/mesh": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/mesh/-/mesh-5.1.5.tgz", - "integrity": "sha512-gWBwBkIV0Dj0nA+a/ymtv4oQOium3oiehKdhSynQZj9C+pwd3YUSJGjHWs4b+TIQxZm2RHEsSSw4gCw/Ih1cuw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/mesh/-/mesh-5.2.0.tgz", + "integrity": "sha512-GTgxMlK3T2aWNk2CpWw6+zDXzOxDN15v4noVM6hqm691GQn6HXD68J14BHJhZxuP3PU9VD7/FARooMtAwaxVvg==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/core": "^5.1.5", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/settings": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/core": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } }, "@pixi/mesh-extras": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/mesh-extras/-/mesh-extras-5.1.5.tgz", - "integrity": "sha512-aMjTD3kBf2h31ijYapapQOJIoQuO26i4pP7P4ux886FE8E48QSc3edXZzULq2Rc5ZdWMPUFYnd8AJ6F8dw/ocQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/mesh-extras/-/mesh-extras-5.2.0.tgz", + "integrity": "sha512-vmBcV3sRqHWZIfwd8GQEscqR8zzsgCLXdgE/tWOCGqgGbv0+mv25y/vRnRnL42YXZb/sPU1RrtgnDr7xHNVL2w==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/core": "^5.1.5", - "@pixi/math": "^5.1.0", - "@pixi/mesh": "^5.1.5", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/core": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/mesh": "^5.2.0", + "@pixi/utils": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } }, "@pixi/mixin-cache-as-bitmap": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/mixin-cache-as-bitmap/-/mixin-cache-as-bitmap-5.1.5.tgz", - "integrity": "sha512-XRVTz5nOgj7wUFXXIixTlg+2oynNerebUwjkw11mnr+HNP3vMmt2O8ZtXEyij2VXNMuDmbYo8/O53FI+81CnAQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/mixin-cache-as-bitmap/-/mixin-cache-as-bitmap-5.2.0.tgz", + "integrity": "sha512-VaFxBiPFu5Ii3T/vwe+QozvQk/OMLApe0eTSXCzAZspijVCGVmnalTqDgY9GC6SvuLG967jRTdEwCAsc+w2uXA==", "requires": { - "@pixi/core": "^5.1.5", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/settings": "^5.1.3", - "@pixi/sprite": "^5.1.5", - "@pixi/utils": "^5.1.3" + "@pixi/core": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/sprite": "^5.2.0", + "@pixi/utils": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } }, "@pixi/mixin-get-child-by-name": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/@pixi/mixin-get-child-by-name/-/mixin-get-child-by-name-5.1.3.tgz", - "integrity": "sha512-0nvNfcQAeND9iuzQr0AYCxINDaXQx5Kft8Fauu0T4LKbYAchO0qzuSpv7L+cD4LvKdvGQyxHHWP6u4wQ9yuKrg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/mixin-get-child-by-name/-/mixin-get-child-by-name-5.2.0.tgz", + "integrity": "sha512-exL50cOrjOmJ02++Q56AamYkVKt7RqwdM0QQdfmJKRX9r8cG9u09IKW2/hWKGbyqNoP5gGORtZvXRCJG8JYH/A==", "requires": { - "@pixi/display": "^5.1.3" + "@pixi/display": "^5.2.0" + }, + "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" + } + } } }, "@pixi/mixin-get-global-position": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/@pixi/mixin-get-global-position/-/mixin-get-global-position-5.1.3.tgz", - "integrity": "sha512-dgIUjjIDnI/wrNXt+ROWdv0syQeV5hlt/TJot/ULXw6HnBoDDmXqcKzIp38o3Ei6n2eQ0CUVbKYGd668tdk5EQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/mixin-get-global-position/-/mixin-get-global-position-5.2.0.tgz", + "integrity": "sha512-9P2EeymV23OonCVOdgYu0ZFlUZoCXh0wK/6wf6wb0N4Nefcz0mPfafHV5gp/qwCgB9OJk4RLKna1BDfxXn4LCA==", "requires": { - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0" + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0" + }, + "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" + } + } } }, "@pixi/particles": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/particles/-/particles-5.1.5.tgz", - "integrity": "sha512-eIYd1wKyuzBL/re3EuyhUjXNRe8fkqbUgpeevV2e7tIoFcyK3g3cT4E1ajTv+7IIAvj2505xRJ3dxcAxLDzd6g==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/particles/-/particles-5.2.0.tgz", + "integrity": "sha512-uB86M9hpiamclCOLMk6go0WJGXoiNfNzIIiC5OmUt61Fk3TSZiXbF//xWt/NB/unm3+WhycudSfR1IhLL1OdSw==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/core": "^5.1.5", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/core": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/utils": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } }, "@pixi/polyfill": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@pixi/polyfill/-/polyfill-5.1.0.tgz", - "integrity": "sha512-8M3nYCO0a599fsdLW7wv9SBYriMqS1QckKAkRuN2JualRuK/GjxZjm5Vcbcwc1gGONRUKZroH12CuPyTcU2HnQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/polyfill/-/polyfill-5.2.0.tgz", + "integrity": "sha512-xvwJ0vRVwf6fByvGTRzOsAv0N5GmopVI+pT5MV8Rk4AoqGQ8vWkhQQ8jy7PS4g0ak2DpwVrcTwUjxfrmjJCYTw==", "requires": { "es6-promise-polyfill": "^1.2.0", "object-assign": "^4.1.1" } }, "@pixi/prepare": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/prepare/-/prepare-5.1.5.tgz", - "integrity": "sha512-0Gq6whHFuLYy3uUVoVmRnVWMZU4Z0WSs7+BYGWrDqxlOqfuZ6ZS4SSEjzcUUvyCK8MWisEn7O3EnDRYFr+3K5g==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/prepare/-/prepare-5.2.0.tgz", + "integrity": "sha512-WE/VUIJXFrYMXFmWom4BZYB78IHQNeRZfN1SDN4X11cOciFH8uDafDpkMsjND95HZAqw+yQPU2pKResQnWEtag==", "requires": { - "@pixi/core": "^5.1.5", - "@pixi/display": "^5.1.3", - "@pixi/graphics": "^5.1.5", - "@pixi/settings": "^5.1.3", - "@pixi/text": "^5.1.5", - "@pixi/ticker": "^5.1.3" + "@pixi/core": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/graphics": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/text": "^5.2.0", + "@pixi/ticker": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } @@ -993,170 +1872,488 @@ } }, "@pixi/sprite": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/sprite/-/sprite-5.1.5.tgz", - "integrity": "sha512-a8M5P7xarbYMut3YKIb5I4hr94c0/VA18jV/eOhtyOKOsS5jkjul5WGssnIyR73aQp7iaNGWfh7FD+BiWCLzXQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/sprite/-/sprite-5.2.0.tgz", + "integrity": "sha512-IW+S2Cs3MTcMSrsSA5fjk+xx3Q8eNrsT4hGVXy6JxViv3IknIqbyQwdSFGAyoowOwzhyg7xJExz7VDZRQBBLwg==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/core": "^5.1.5", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/settings": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/core": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } }, "@pixi/sprite-animated": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/sprite-animated/-/sprite-animated-5.1.5.tgz", - "integrity": "sha512-jsxqmWpDpjy7BoqVFpPWNvIeJ6yePQ0/uTyvzhKZBM8ihZVFJMa1+C4IFQpQYUCp9rlZHG6og4UzAHlwceQb+A==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/sprite-animated/-/sprite-animated-5.2.0.tgz", + "integrity": "sha512-Liy5s3CKh2MuSJeVYX7w8mJ0//WMUPm/4ZHRJqRJApijjlXSxcnhHNxIMRLDb8iJNmqaoOi9qMUgK0AkGWuAtA==", "requires": { - "@pixi/core": "^5.1.5", - "@pixi/sprite": "^5.1.5", - "@pixi/ticker": "^5.1.3" + "@pixi/core": "^5.2.0", + "@pixi/sprite": "^5.2.0", + "@pixi/ticker": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } }, "@pixi/sprite-tiling": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/sprite-tiling/-/sprite-tiling-5.1.5.tgz", - "integrity": "sha512-9P0jyAA9I8hrDnN04rABxxs09Knb2AZr+Ky2yvWAUngumoMmIEbc/JtW9R8ich72uTBcl8Ax+bTz520wB36HpA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/sprite-tiling/-/sprite-tiling-5.2.0.tgz", + "integrity": "sha512-iLQ98PrUVKqVzTYJsu+ZMCIRsJ1wapg55tf+m/78KK+h0WmgY70CJbO/A68dTqYZMLR39XPCtUp9bXXzXNEEdQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/core": "^5.1.5", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/sprite": "^5.1.5", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/core": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/sprite": "^5.2.0", + "@pixi/utils": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } }, "@pixi/spritesheet": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/spritesheet/-/spritesheet-5.1.5.tgz", - "integrity": "sha512-kZBiI/eYRKoNxOTI9h4tl13oGdCaFkH/cOI0MZ0st0Dos6clB5OJStJ19bEe/Ik1Yt7NxGCCuFLLa3WKhQ5idQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/spritesheet/-/spritesheet-5.2.0.tgz", + "integrity": "sha512-48WNC3tSUXbWA7ZswEacSiVh396FLe3KLhFpWk2oIJ+7MtMQ1IdtkGjAaXgv0zx0EvvnvEt1VoQVo2eALswR5Q==", "requires": { - "@pixi/core": "^5.1.5", - "@pixi/loaders": "^5.1.5", - "@pixi/math": "^5.1.0", - "@pixi/utils": "^5.1.3" + "@pixi/core": "^5.2.0", + "@pixi/loaders": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/utils": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } }, "@pixi/text": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/text/-/text-5.1.5.tgz", - "integrity": "sha512-8pKWuyccdWrZgvssyPUrOdn7CMeetRTpM8W51KYwU8gla6tnddMj3TaBW56dXRdtddadDc2KdGtDYPOuonHOfA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/text/-/text-5.2.0.tgz", + "integrity": "sha512-enEq/rJYXVobyGeTXCBTbRMlnKc7am+/WicymRt1bT7ia8L8A00xgOdEbfg6OeP2jLcyBVnopFhgHFe8jcp07Q==", "requires": { - "@pixi/core": "^5.1.5", - "@pixi/math": "^5.1.0", - "@pixi/settings": "^5.1.3", - "@pixi/sprite": "^5.1.5", - "@pixi/utils": "^5.1.3" + "@pixi/core": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/sprite": "^5.2.0", + "@pixi/utils": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } }, "@pixi/text-bitmap": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/text-bitmap/-/text-bitmap-5.1.5.tgz", - "integrity": "sha512-Qvnq35MdDWjW9JwJsLcVpnTX4ApW52zLMeMezuTtN+QrfsXmYXRE+SOeBERccbGmyxcM2yIKIItiqS2eFvlzRw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/text-bitmap/-/text-bitmap-5.2.0.tgz", + "integrity": "sha512-RZD7GpQrKD+1B2wehnX0dI7ABB43JWNWoWXHl5wKfhjmPCxVmKEB9UfvOZd3sbnlxeL7BUA/gpYSxD6b6ZiA8g==", "requires": { - "@pixi/core": "^5.1.5", - "@pixi/display": "^5.1.3", - "@pixi/loaders": "^5.1.5", - "@pixi/math": "^5.1.0", - "@pixi/settings": "^5.1.3", - "@pixi/sprite": "^5.1.5", - "@pixi/utils": "^5.1.3" + "@pixi/core": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/loaders": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/sprite": "^5.2.0", + "@pixi/utils": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } @@ -2848,7 +4045,8 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", - "dev": true + "dev": true, + "optional": true }, "expand-brackets": { "version": "2.1.4", @@ -3279,7 +4477,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -3300,12 +4499,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3320,17 +4521,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -3447,7 +4651,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -3459,6 +4664,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3473,6 +4679,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -3480,12 +4687,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -3504,6 +4713,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -3584,7 +4794,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -3596,6 +4807,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -3681,7 +4893,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -3717,6 +4930,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -3736,6 +4950,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -3779,12 +4994,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -4091,9 +5308,9 @@ } }, "gulp-prettier": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/gulp-prettier/-/gulp-prettier-2.2.0.tgz", - "integrity": "sha512-IYHqgF4bg7GNOQ1h3JiVlZyHGY0rTvd3QYM+nkEOXQJKCsF2jF6BUs8Jd52Hmz/tSJmYg3XRwAgezDn20Q3JbQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/gulp-prettier/-/gulp-prettier-2.3.0.tgz", + "integrity": "sha512-3byhZ6+tT3uqZUmIuhNs+upiUiwTtZXQ5vD/rrXq+ZypYyYlCIGGmSYq7wDc0uTJyGhHtYNTJ97ix2hI747zyg==", "dev": true, "requires": { "plugin-error": "^1.0.1", @@ -6108,75 +7325,128 @@ } }, "pixi.js": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/pixi.js/-/pixi.js-5.1.5.tgz", - "integrity": "sha512-VUvM/eoOahQV1wx+wEOM7/Xw+XXdbwP3qGaANZKeJAyVvOa4ZcsSTyWHV9bAITOJFyoLhJ/h7h2QCNtvv1s/WA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/pixi.js/-/pixi.js-5.2.0.tgz", + "integrity": "sha512-q4gxbTU51nrh8qxbplU6EVx2dnb9SiI9OeQOrQmtmCTpysJXAK5p9M2c3v5JRIgK8ZCL74y5vrwHaaB1ZQoPKw==", "requires": { - "@pixi/accessibility": "^5.1.5", - "@pixi/app": "^5.1.5", - "@pixi/constants": "^5.1.0", - "@pixi/core": "^5.1.5", - "@pixi/display": "^5.1.3", - "@pixi/extract": "^5.1.5", - "@pixi/filter-alpha": "^5.1.5", - "@pixi/filter-blur": "^5.1.5", - "@pixi/filter-color-matrix": "^5.1.5", - "@pixi/filter-displacement": "^5.1.5", - "@pixi/filter-fxaa": "^5.1.5", - "@pixi/filter-noise": "^5.1.5", - "@pixi/graphics": "^5.1.5", - "@pixi/interaction": "^5.1.5", - "@pixi/loaders": "^5.1.5", - "@pixi/math": "^5.1.0", - "@pixi/mesh": "^5.1.5", - "@pixi/mesh-extras": "^5.1.5", - "@pixi/mixin-cache-as-bitmap": "^5.1.5", - "@pixi/mixin-get-child-by-name": "^5.1.3", - "@pixi/mixin-get-global-position": "^5.1.3", - "@pixi/particles": "^5.1.5", - "@pixi/polyfill": "^5.1.0", - "@pixi/prepare": "^5.1.5", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/sprite": "^5.1.5", - "@pixi/sprite-animated": "^5.1.5", - "@pixi/sprite-tiling": "^5.1.5", - "@pixi/spritesheet": "^5.1.5", - "@pixi/text": "^5.1.5", - "@pixi/text-bitmap": "^5.1.5", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/accessibility": "^5.2.0", + "@pixi/app": "^5.2.0", + "@pixi/constants": "^5.2.0", + "@pixi/core": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/extract": "^5.2.0", + "@pixi/filter-alpha": "^5.2.0", + "@pixi/filter-blur": "^5.2.0", + "@pixi/filter-color-matrix": "^5.2.0", + "@pixi/filter-displacement": "^5.2.0", + "@pixi/filter-fxaa": "^5.2.0", + "@pixi/filter-noise": "^5.2.0", + "@pixi/graphics": "^5.2.0", + "@pixi/interaction": "^5.2.0", + "@pixi/loaders": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/mesh": "^5.2.0", + "@pixi/mesh-extras": "^5.2.0", + "@pixi/mixin-cache-as-bitmap": "^5.2.0", + "@pixi/mixin-get-child-by-name": "^5.2.0", + "@pixi/mixin-get-global-position": "^5.2.0", + "@pixi/particles": "^5.2.0", + "@pixi/polyfill": "^5.2.0", + "@pixi/prepare": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/sprite": "^5.2.0", + "@pixi/sprite-animated": "^5.2.0", + "@pixi/sprite-tiling": "^5.2.0", + "@pixi/spritesheet": "^5.2.0", + "@pixi/text": "^5.2.0", + "@pixi/text-bitmap": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" }, "dependencies": { + "@pixi/constants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.2.0.tgz", + "integrity": "sha512-dXwzkKAvgpvOJmDBe9OQiE+HPp4uMIL/3ijHlyW0fgMqDPhtQtFcSUdSUAoFwb23Uaq56j1ejuEmly8LehJ0aQ==" + }, "@pixi/core": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.1.5.tgz", - "integrity": "sha512-pt7JTgRyGyOm1VNGhYqAjdIggQ5SjGpctLEBFwPlZDOTeEjJ85NADwCvN/E9ToIW7Gv/1urrNKsoVGlADcV6vw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.2.0.tgz", + "integrity": "sha512-h8UuVWHfbWVGEO3a4SQS4vk70LSFMUMPKCvVpPq/3LtIUgPVDZO3tGL4O2jFteKwbmWNIMDCpDmBMu3XlqPlNQ==", "requires": { - "@pixi/constants": "^5.1.0", - "@pixi/display": "^5.1.3", - "@pixi/math": "^5.1.0", - "@pixi/runner": "^5.1.1", - "@pixi/settings": "^5.1.3", - "@pixi/ticker": "^5.1.3", - "@pixi/utils": "^5.1.3" + "@pixi/constants": "^5.2.0", + "@pixi/display": "^5.2.0", + "@pixi/math": "^5.2.0", + "@pixi/runner": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/ticker": "^5.2.0", + "@pixi/utils": "^5.2.0" + } + }, + "@pixi/display": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.2.0.tgz", + "integrity": "sha512-P+exW4aI7eyqhdmi0M3HmKJI+XzDYNYAiEsKMUyyONwbHYSVdjQF5hzPuvjUYotTNZ1stCWbf0457cNNSPLOzQ==", + "requires": { + "@pixi/math": "^5.2.0", + "@pixi/settings": "^5.2.0", + "@pixi/utils": "^5.2.0" } }, "@pixi/filter-alpha": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/filter-alpha/-/filter-alpha-5.1.5.tgz", - "integrity": "sha512-Jb5e7lybvMOXjdTOEN883h2N5Qe5rLNdTmPxOoK43RR+LQMk8D/Iw3zWpQ1oIwpJFiUkgwn0CmO5YaK6STh34w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/filter-alpha/-/filter-alpha-5.2.0.tgz", + "integrity": "sha512-Jv/eqSt6zmKr9oGoi4UgUWA/pgxhyBSGMtUWMHiwuqjkXWl4Em4bC5l0f5GUX85xqMCRLwvOeqOH+fBE9fKadw==", "requires": { - "@pixi/core": "^5.1.5" + "@pixi/core": "^5.2.0" } }, "@pixi/filter-blur": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@pixi/filter-blur/-/filter-blur-5.1.5.tgz", - "integrity": "sha512-9eSJtg8kLwKrNnJmg2c1vlOcP0PYhvZdUk97D2+HrE0j1BZTJ2OxHb26UJSiMU0kBCUomtuFvCiNtFT2GCWbjg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/filter-blur/-/filter-blur-5.2.0.tgz", + "integrity": "sha512-052qyY+X3HMEvHdorqXIbe+iODK0Sj3j8goZMvOL2qATW6bDBGRuwrO2rGZ70BnmGgrbIrXzDVemwo9uLWEZSA==", "requires": { - "@pixi/core": "^5.1.5", - "@pixi/settings": "^5.1.3" + "@pixi/core": "^5.2.0", + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/math": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.2.0.tgz", + "integrity": "sha512-Y21H/kMluJqZ/QWb8cdXuZlib6G26QfZtgc85KbSJmjpMVWw03g0OELqFqOhsMzNanXp3B4OL1ZsNXnp0lWROQ==" + }, + "@pixi/runner": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.2.0.tgz", + "integrity": "sha512-vy/SGG8QFHMrWAqebMQdhxl/l6WlIbHXMDNDCYBWwXKYjmKzycrrj2o/mK9cBko8WDuoTRZ0Pe3JZ3XDYEsn9w==" + }, + "@pixi/settings": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.2.0.tgz", + "integrity": "sha512-AIxcUbgM3mh2QxS+nxNcPsqnJEBg3x/UO9ZpNMRhed9UPM/5mQ8CGZUMLTzIxhjSS16Do4uK9vZikMjV8dXm/Q==", + "requires": { + "ismobilejs": "^0.5.1" + } + }, + "@pixi/ticker": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.2.0.tgz", + "integrity": "sha512-6xX786cX/RWmQKeRQ3bNvg8JjS0VLA2LQy1sOmUctx2AwdZysI04k2xdw9Krtpn1mkudgAcNrTEsgPeGEjIF9Q==", + "requires": { + "@pixi/settings": "^5.2.0" + } + }, + "@pixi/utils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.2.0.tgz", + "integrity": "sha512-oMLRlvx+vWHPR06uiOvfOhtkG/LDBR3Syea9QZoIbCJE/GLYgJX8f0cVfrdI0kCgfGj4luc8/CWI745MKafUqQ==", + "requires": { + "@pixi/constants": "^5.2.0", + "@pixi/settings": "^5.2.0", + "earcut": "^2.1.5", + "eventemitter3": "^3.1.0", + "url": "^0.11.0" } } } @@ -6357,9 +7627,9 @@ "dev": true }, "prettier": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", - "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", "dev": true }, "prettier-linter-helpers": { diff --git a/package.json b/package.json index 866230b..faf3708 100644 --- a/package.json +++ b/package.json @@ -34,12 +34,12 @@ "fs-extra": "^8.0.1", "gulp": "^4.0.2", "gulp-concat": "^2.6.1", - "gulp-prettier": "^2.2.0", + "gulp-prettier": "^2.3.0", "gulp-rename": "^1.4.0", "gulp-replace": "^1.0.0", "gulp-uglify": "^3.0.2", "htmlhint": "^0.11.0", - "prettier": "^1.18.2", + "prettier": "^1.19.1", "puppeteer": "^1.20.0", "stylelint": "^11.1.1", "stylelint-config-standard": "^19.0.0" @@ -54,7 +54,7 @@ "pixi-particles": "^4.2.0", "pixi-projection": "^0.3.5", "pixi-viewport": "^4.3.3", - "pixi.js": "^5.1.5", + "pixi.js": "^5.2.0", "propagating-hammerjs": "^1.4.7" } }