From b6ccf474a493e189ee6943513231e03d89243dab Mon Sep 17 00:00:00 2001 From: PixelsCommander Date: Thu, 10 Sep 2015 14:47:45 +0200 Subject: [PATCH] Fixed Retina support bugs --- demo/js/vendor/html2canvas.js | 183 +++++++++++++++++---------------- dist/htmlgl.js | 185 +++++++++++++++++----------------- dist/htmlgl.min.js | 26 ++--- page/js/htmlgl.min.js | 26 ++--- src/gl-element.js | 2 - 5 files changed, 216 insertions(+), 206 deletions(-) diff --git a/demo/js/vendor/html2canvas.js b/demo/js/vendor/html2canvas.js index 97034ba..6294dc3 100755 --- a/demo/js/vendor/html2canvas.js +++ b/demo/js/vendor/html2canvas.js @@ -1635,8 +1635,6 @@ function cloneNode(node, javascriptEnabled) { var child = node.firstChild; while(child) { if (javascriptEnabled === true || child.nodeType !== 1 || child.nodeName !== 'SCRIPT') { - console.log(clone); - clone.appendChild(cloneNode(child, javascriptEnabled)); } child = child.nextSibling; @@ -4027,13 +4025,14 @@ module.exports = Renderer; },{"./log":15}],23:[function(require,module,exports){ var Renderer = require('../renderer'); var LinearGradientContainer = require('../lineargradientcontainer'); +var Utils = require('../utils'); var log = require('../log'); function CanvasRenderer(width, height) { - this.ratio = window.devicePixelRatio; + this.ratio = Utils.getDeviceRatio(); - width = this.applyRatio(width); - height = this.applyRatio(height); + width = Utils.applyRatio(width); + height = Utils.applyRatio(height); Renderer.apply(this, arguments); this.canvas = this.options.canvas || this.document.createElement("canvas"); @@ -4057,62 +4056,16 @@ function CanvasRenderer(width, height) { CanvasRenderer.prototype = Object.create(Renderer.prototype); -CanvasRenderer.prototype.applyRatio = function(value) { - return value * this.ratio; -} - -CanvasRenderer.prototype.applyRatioToBounds = function(bounds) { - bounds.width = bounds.width * this.ratio; - bounds.top = bounds.top * this.ratio; - - //In case this is a size - try { - bounds.left = bounds.left * this.ratio; - bounds.height = bounds.height * this.ratio; - } catch (e) { - - } - - return bounds; -} - -CanvasRenderer.prototype.applyRatioToPosition = function(position) { - position.left = position.left * this.ratio; - position.height = position.height * this.ratio; - - return bounds; -} - -CanvasRenderer.prototype.applyRatioToShape = function(shape) { - for (var i = 0; i < shape.length; i++) { - if (shape[i] instanceof Array) { - for (var k = 1; k < shape[i].length; k++) { - shape[i][k] = this.applyRatio(shape[i][k]); - } - } - } - return shape; -} - -CanvasRenderer.prototype.applyRatioToFontSize = function(fontSize) { - var numericPart = parseFloat(fontSize) * this.ratio; - var stringPart = fontSize.replace(/[0-9]/g, ''); - - fontSize = numericPart + stringPart; - - return fontSize; -} - CanvasRenderer.prototype.setFillStyle = function(fillStyle) { this.ctx.fillStyle = typeof(fillStyle) === "object" && !!fillStyle.isColor ? fillStyle.toString() : fillStyle; return this.ctx; }; CanvasRenderer.prototype.rectangle = function(left, top, width, height, color) { - left = this.applyRatio(left); - top = this.applyRatio(top); - width = this.applyRatio(width); - height = this.applyRatio(height); + left = Utils.applyRatio(left); + top = Utils.applyRatio(top); + width = Utils.applyRatio(width); + height = Utils.applyRatio(height); this.setFillStyle(color).fillRect(left, top, width, height); }; @@ -4126,9 +4079,9 @@ CanvasRenderer.prototype.circle = function(left, top, size, color) { }; CanvasRenderer.prototype.circleStroke = function(left, top, size, color, stroke, strokeColor) { - left = this.applyRatio(left); - top = this.applyRatio(top); - size = this.applyRatio(size); + left = Utils.applyRatio(left); + top = Utils.applyRatio(top); + size = Utils.applyRatio(size); this.circle(left, top, size, color); this.ctx.strokeStyle = strokeColor.toString(); @@ -4136,7 +4089,7 @@ CanvasRenderer.prototype.circleStroke = function(left, top, size, color, stroke, }; CanvasRenderer.prototype.drawShape = function(shape, color) { - shape = this.applyRatioToShape(shape); + shape = Utils.applyRatioToShape(shape); this.shape(shape); this.setFillStyle(color).fill(); @@ -4158,14 +4111,16 @@ CanvasRenderer.prototype.taints = function(imageContainer) { }; CanvasRenderer.prototype.drawImage = function(imageContainer, sx, sy, sw, sh, dx, dy, dw, dh) { - sx = this.applyRatio(sx); - sy = this.applyRatio(sy); - //sw = this.applyRatio(sw); - //sh = this.applyRatio(sh); - dx = this.applyRatio(dx); - dy = this.applyRatio(dy); - dw = this.applyRatio(dw); - dh = this.applyRatio(dh); + //Do not scale source coordinates + //sx = Utils.applyRatio(sx); + //sy = Utils.applyRatio(sy); + //sw = Utils.applyRatio(sw); + //sh = Utils.applyRatio(sh); + + dx = Utils.applyRatio(dx); + dy = Utils.applyRatio(dy); + dw = Utils.applyRatio(dw); + dh = Utils.applyRatio(dh); if (!this.taints(imageContainer) || this.options.allowTaint) { this.ctx.drawImage(imageContainer.image, sx, sy, sw, sh, dx, dy, dw, dh); @@ -4175,8 +4130,8 @@ CanvasRenderer.prototype.drawImage = function(imageContainer, sx, sy, sw, sh, dx CanvasRenderer.prototype.clip = function(shapes, callback, context) { this.ctx.save(); shapes.filter(hasEntries).forEach(function(shape) { - shape = this.applyRatioToShape(shape); - this.shape(shape).clip(); + shape = Utils.applyRatioToShape(shape); + this.shape(shape)//.clip(); }, this); callback.call(context); this.ctx.restore(); @@ -4196,13 +4151,13 @@ CanvasRenderer.prototype.shape = function(shape) { }; CanvasRenderer.prototype.font = function(color, style, variant, weight, size, family) { - size = this.applyRatioToFontSize(size); + size = Utils.applyRatioToFontSize(size); this.setFillStyle(color).font = [style, variant, weight, size, family].join(" ").split(",")[0]; }; CanvasRenderer.prototype.fontShadow = function(color, offsetX, offsetY, blur) { - offsetX = this.applyRatio(offsetX); - offsetY = this.applyRatio(offsetY); + offsetX = Utils.applyRatio(offsetX); + offsetY = Utils.applyRatio(offsetY); this.setVariable("shadowColor", color.toString()) .setVariable("shadowOffsetY", offsetX) @@ -4234,20 +4189,20 @@ CanvasRenderer.prototype.setVariable = function(property, value) { }; CanvasRenderer.prototype.text = function(text, left, bottom) { - left = this.applyRatio(left); - bottom = this.applyRatio(bottom); + left = Utils.applyRatio(left); + bottom = Utils.applyRatio(bottom); this.ctx.fillText(text, left, bottom); }; CanvasRenderer.prototype.backgroundRepeatShape = function(imageContainer, backgroundPosition, size, bounds, left, top, width, height, borderData) { debugger; - size = this.applyRatio(size); - bounds = this.applyRatioToBounds(bounds); - left = this.applyRatio(left); - top = this.applyRatio(top); - width = this.applyRatio(width); - height = this.applyRatio(height); + size = Utils.applyRatio(size); + bounds = Utils.applyRatioToBounds(bounds); + left = Utils.applyRatio(left); + top = Utils.applyRatio(top); + width = Utils.applyRatio(width); + height = Utils.applyRatio(height); var shape = [ ["line", Math.round(left), Math.round(top)], @@ -4262,11 +4217,11 @@ CanvasRenderer.prototype.backgroundRepeatShape = function(imageContainer, backgr CanvasRenderer.prototype.renderBackgroundRepeat = function(imageContainer, backgroundPosition, size, bounds, borderLeft, borderTop) { debugger; - bounds = this.applyRatioToBounds(bounds); - size = this.applyRatioToBounds(size); - backgroundPosition = this.applyRatioToBounds(backgroundPosition); - borderLeft = this.applyRatio(borderLeft); - borderTop = this.applyRatio(borderTop); + bounds = Utils.applyRatioToBounds(bounds); + size = Utils.applyRatioToBounds(size); + backgroundPosition = Utils.applyRatioToBounds(backgroundPosition); + borderLeft = Utils.applyRatio(borderLeft); + borderTop = Utils.applyRatio(borderTop); var offsetX = Math.round(bounds.left + backgroundPosition.left + borderLeft), offsetY = Math.round(bounds.top + backgroundPosition.top + borderTop); this.setFillStyle(this.ctx.createPattern(this.resizeImage(imageContainer, size), "repeat")); @@ -4277,7 +4232,7 @@ CanvasRenderer.prototype.renderBackgroundRepeat = function(imageContainer, backg CanvasRenderer.prototype.renderBackgroundGradient = function(gradientImage, bounds) { debugger; - bounds = this.applyRatioToBounds(bounds); + bounds = Utils.applyRatioToBounds(bounds); if (gradientImage instanceof LinearGradientContainer) { var gradient = this.ctx.createLinearGradient( @@ -4293,7 +4248,7 @@ CanvasRenderer.prototype.renderBackgroundGradient = function(gradientImage, boun }; CanvasRenderer.prototype.resizeImage = function(imageContainer, size) { - size = this.applyRatioToBounds(size); + size = Utils.applyRatioToBounds(size); var image = imageContainer.image; if(image.width === size.width && image.height === size.height) { @@ -4314,7 +4269,7 @@ function hasEntries(array) { module.exports = CanvasRenderer; -},{"../lineargradientcontainer":14,"../log":15,"../renderer":22}],24:[function(require,module,exports){ +},{"../lineargradientcontainer":14,"../log":15,"../renderer":22,"../utils":29}],24:[function(require,module,exports){ var NodeContainer = require('./nodecontainer'); function StackingContext(hasOwnStacking, opacity, element, parent) { @@ -4676,6 +4631,58 @@ exports.parseBackgrounds = function(backgroundImage) { return results; }; +exports.getDeviceRatio = function() { + return window.devicePixelRatio; +}; + +exports.applyRatio = function(value) { + return value * exports.getDeviceRatio(); +} + +exports.applyRatioToBounds = function(bounds) { + bounds.width = bounds.width * exports.getDeviceRatio(); + bounds.top = bounds.top * exports.getDeviceRatio(); + + //In case this is a size + try { + bounds.left = bounds.left * exports.getDeviceRatio(); + bounds.height = bounds.height * exports.getDeviceRatio(); + } catch (e) { + + } + + return bounds; +} + +exports.applyRatioToPosition = function(position) { + position.left = position.left * exports.getDeviceRatio(); + position.height = position.height * exports.getDeviceRatio(); + + return bounds; +} + +exports.applyRatioToShape = function(shape) { + for (var i = 0; i < shape.length; i++) { + if (shape[i] instanceof Array) { + for (var k = 1; k < shape[i].length; k++) { + shape[i][k] = this.applyRatio(shape[i][k]); + } + } + } + return shape; +} + +exports.applyRatioToFontSize = function(fontSize) { + var numericPart = parseFloat(fontSize) * exports.getDeviceRatio(); + var stringPart = fontSize.replace(/[0-9]/g, ''); + + fontSize = numericPart + stringPart; + + return fontSize; +} + + + },{}],30:[function(require,module,exports){ var GradientContainer = require('./gradientcontainer'); diff --git a/dist/htmlgl.js b/dist/htmlgl.js index df64da8..f21c8fb 100644 --- a/dist/htmlgl.js +++ b/dist/htmlgl.js @@ -1659,8 +1659,6 @@ function cloneNode(node, javascriptEnabled) { var child = node.firstChild; while(child) { if (javascriptEnabled === true || child.nodeType !== 1 || child.nodeName !== 'SCRIPT') { - console.log(clone); - clone.appendChild(cloneNode(child, javascriptEnabled)); } child = child.nextSibling; @@ -4051,13 +4049,14 @@ module.exports = Renderer; },{"./log":15}],23:[function(require,module,exports){ var Renderer = require('../renderer'); var LinearGradientContainer = require('../lineargradientcontainer'); +var Utils = require('../utils'); var log = require('../log'); function CanvasRenderer(width, height) { - this.ratio = window.devicePixelRatio; + this.ratio = Utils.getDeviceRatio(); - width = this.applyRatio(width); - height = this.applyRatio(height); + width = Utils.applyRatio(width); + height = Utils.applyRatio(height); Renderer.apply(this, arguments); this.canvas = this.options.canvas || this.document.createElement("canvas"); @@ -4081,62 +4080,16 @@ function CanvasRenderer(width, height) { CanvasRenderer.prototype = Object.create(Renderer.prototype); -CanvasRenderer.prototype.applyRatio = function(value) { - return value * this.ratio; -} - -CanvasRenderer.prototype.applyRatioToBounds = function(bounds) { - bounds.width = bounds.width * this.ratio; - bounds.top = bounds.top * this.ratio; - - //In case this is a size - try { - bounds.left = bounds.left * this.ratio; - bounds.height = bounds.height * this.ratio; - } catch (e) { - - } - - return bounds; -} - -CanvasRenderer.prototype.applyRatioToPosition = function(position) { - position.left = position.left * this.ratio; - position.height = position.height * this.ratio; - - return bounds; -} - -CanvasRenderer.prototype.applyRatioToShape = function(shape) { - for (var i = 0; i < shape.length; i++) { - if (shape[i] instanceof Array) { - for (var k = 1; k < shape[i].length; k++) { - shape[i][k] = this.applyRatio(shape[i][k]); - } - } - } - return shape; -} - -CanvasRenderer.prototype.applyRatioToFontSize = function(fontSize) { - var numericPart = parseFloat(fontSize) * this.ratio; - var stringPart = fontSize.replace(/[0-9]/g, ''); - - fontSize = numericPart + stringPart; - - return fontSize; -} - CanvasRenderer.prototype.setFillStyle = function(fillStyle) { this.ctx.fillStyle = typeof(fillStyle) === "object" && !!fillStyle.isColor ? fillStyle.toString() : fillStyle; return this.ctx; }; CanvasRenderer.prototype.rectangle = function(left, top, width, height, color) { - left = this.applyRatio(left); - top = this.applyRatio(top); - width = this.applyRatio(width); - height = this.applyRatio(height); + left = Utils.applyRatio(left); + top = Utils.applyRatio(top); + width = Utils.applyRatio(width); + height = Utils.applyRatio(height); this.setFillStyle(color).fillRect(left, top, width, height); }; @@ -4150,9 +4103,9 @@ CanvasRenderer.prototype.circle = function(left, top, size, color) { }; CanvasRenderer.prototype.circleStroke = function(left, top, size, color, stroke, strokeColor) { - left = this.applyRatio(left); - top = this.applyRatio(top); - size = this.applyRatio(size); + left = Utils.applyRatio(left); + top = Utils.applyRatio(top); + size = Utils.applyRatio(size); this.circle(left, top, size, color); this.ctx.strokeStyle = strokeColor.toString(); @@ -4160,7 +4113,7 @@ CanvasRenderer.prototype.circleStroke = function(left, top, size, color, stroke, }; CanvasRenderer.prototype.drawShape = function(shape, color) { - shape = this.applyRatioToShape(shape); + shape = Utils.applyRatioToShape(shape); this.shape(shape); this.setFillStyle(color).fill(); @@ -4182,14 +4135,16 @@ CanvasRenderer.prototype.taints = function(imageContainer) { }; CanvasRenderer.prototype.drawImage = function(imageContainer, sx, sy, sw, sh, dx, dy, dw, dh) { - sx = this.applyRatio(sx); - sy = this.applyRatio(sy); - //sw = this.applyRatio(sw); - //sh = this.applyRatio(sh); - dx = this.applyRatio(dx); - dy = this.applyRatio(dy); - dw = this.applyRatio(dw); - dh = this.applyRatio(dh); + //Do not scale source coordinates + //sx = Utils.applyRatio(sx); + //sy = Utils.applyRatio(sy); + //sw = Utils.applyRatio(sw); + //sh = Utils.applyRatio(sh); + + dx = Utils.applyRatio(dx); + dy = Utils.applyRatio(dy); + dw = Utils.applyRatio(dw); + dh = Utils.applyRatio(dh); if (!this.taints(imageContainer) || this.options.allowTaint) { this.ctx.drawImage(imageContainer.image, sx, sy, sw, sh, dx, dy, dw, dh); @@ -4199,8 +4154,8 @@ CanvasRenderer.prototype.drawImage = function(imageContainer, sx, sy, sw, sh, dx CanvasRenderer.prototype.clip = function(shapes, callback, context) { this.ctx.save(); shapes.filter(hasEntries).forEach(function(shape) { - shape = this.applyRatioToShape(shape); - this.shape(shape).clip(); + shape = Utils.applyRatioToShape(shape); + this.shape(shape)//.clip(); }, this); callback.call(context); this.ctx.restore(); @@ -4220,13 +4175,13 @@ CanvasRenderer.prototype.shape = function(shape) { }; CanvasRenderer.prototype.font = function(color, style, variant, weight, size, family) { - size = this.applyRatioToFontSize(size); + size = Utils.applyRatioToFontSize(size); this.setFillStyle(color).font = [style, variant, weight, size, family].join(" ").split(",")[0]; }; CanvasRenderer.prototype.fontShadow = function(color, offsetX, offsetY, blur) { - offsetX = this.applyRatio(offsetX); - offsetY = this.applyRatio(offsetY); + offsetX = Utils.applyRatio(offsetX); + offsetY = Utils.applyRatio(offsetY); this.setVariable("shadowColor", color.toString()) .setVariable("shadowOffsetY", offsetX) @@ -4258,20 +4213,20 @@ CanvasRenderer.prototype.setVariable = function(property, value) { }; CanvasRenderer.prototype.text = function(text, left, bottom) { - left = this.applyRatio(left); - bottom = this.applyRatio(bottom); + left = Utils.applyRatio(left); + bottom = Utils.applyRatio(bottom); this.ctx.fillText(text, left, bottom); }; CanvasRenderer.prototype.backgroundRepeatShape = function(imageContainer, backgroundPosition, size, bounds, left, top, width, height, borderData) { debugger; - size = this.applyRatio(size); - bounds = this.applyRatioToBounds(bounds); - left = this.applyRatio(left); - top = this.applyRatio(top); - width = this.applyRatio(width); - height = this.applyRatio(height); + size = Utils.applyRatio(size); + bounds = Utils.applyRatioToBounds(bounds); + left = Utils.applyRatio(left); + top = Utils.applyRatio(top); + width = Utils.applyRatio(width); + height = Utils.applyRatio(height); var shape = [ ["line", Math.round(left), Math.round(top)], @@ -4286,11 +4241,11 @@ CanvasRenderer.prototype.backgroundRepeatShape = function(imageContainer, backgr CanvasRenderer.prototype.renderBackgroundRepeat = function(imageContainer, backgroundPosition, size, bounds, borderLeft, borderTop) { debugger; - bounds = this.applyRatioToBounds(bounds); - size = this.applyRatioToBounds(size); - backgroundPosition = this.applyRatioToBounds(backgroundPosition); - borderLeft = this.applyRatio(borderLeft); - borderTop = this.applyRatio(borderTop); + bounds = Utils.applyRatioToBounds(bounds); + size = Utils.applyRatioToBounds(size); + backgroundPosition = Utils.applyRatioToBounds(backgroundPosition); + borderLeft = Utils.applyRatio(borderLeft); + borderTop = Utils.applyRatio(borderTop); var offsetX = Math.round(bounds.left + backgroundPosition.left + borderLeft), offsetY = Math.round(bounds.top + backgroundPosition.top + borderTop); this.setFillStyle(this.ctx.createPattern(this.resizeImage(imageContainer, size), "repeat")); @@ -4301,7 +4256,7 @@ CanvasRenderer.prototype.renderBackgroundRepeat = function(imageContainer, backg CanvasRenderer.prototype.renderBackgroundGradient = function(gradientImage, bounds) { debugger; - bounds = this.applyRatioToBounds(bounds); + bounds = Utils.applyRatioToBounds(bounds); if (gradientImage instanceof LinearGradientContainer) { var gradient = this.ctx.createLinearGradient( @@ -4317,7 +4272,7 @@ CanvasRenderer.prototype.renderBackgroundGradient = function(gradientImage, boun }; CanvasRenderer.prototype.resizeImage = function(imageContainer, size) { - size = this.applyRatioToBounds(size); + size = Utils.applyRatioToBounds(size); var image = imageContainer.image; if(image.width === size.width && image.height === size.height) { @@ -4338,7 +4293,7 @@ function hasEntries(array) { module.exports = CanvasRenderer; -},{"../lineargradientcontainer":14,"../log":15,"../renderer":22}],24:[function(require,module,exports){ +},{"../lineargradientcontainer":14,"../log":15,"../renderer":22,"../utils":29}],24:[function(require,module,exports){ var NodeContainer = require('./nodecontainer'); function StackingContext(hasOwnStacking, opacity, element, parent) { @@ -4700,6 +4655,58 @@ exports.parseBackgrounds = function(backgroundImage) { return results; }; +exports.getDeviceRatio = function() { + return window.devicePixelRatio; +}; + +exports.applyRatio = function(value) { + return value * exports.getDeviceRatio(); +} + +exports.applyRatioToBounds = function(bounds) { + bounds.width = bounds.width * exports.getDeviceRatio(); + bounds.top = bounds.top * exports.getDeviceRatio(); + + //In case this is a size + try { + bounds.left = bounds.left * exports.getDeviceRatio(); + bounds.height = bounds.height * exports.getDeviceRatio(); + } catch (e) { + + } + + return bounds; +} + +exports.applyRatioToPosition = function(position) { + position.left = position.left * exports.getDeviceRatio(); + position.height = position.height * exports.getDeviceRatio(); + + return bounds; +} + +exports.applyRatioToShape = function(shape) { + for (var i = 0; i < shape.length; i++) { + if (shape[i] instanceof Array) { + for (var k = 1; k < shape[i].length; k++) { + shape[i][k] = this.applyRatio(shape[i][k]); + } + } + } + return shape; +} + +exports.applyRatioToFontSize = function(fontSize) { + var numericPart = parseFloat(fontSize) * exports.getDeviceRatio(); + var stringPart = fontSize.replace(/[0-9]/g, ''); + + fontSize = numericPart + stringPart; + + return fontSize; +} + + + },{}],30:[function(require,module,exports){ var GradientContainer = require('./gradientcontainer'); @@ -8996,7 +9003,6 @@ will produce an inaccurate conversion value. The same issue exists with the cx/c } } - debugger; var isInsideHtml2Canvas = !isMounted || (this.baseURI === undefined || this.baseURI === '' || this.baseURI === null); if (!isInsideHtml2Canvas) { @@ -9100,7 +9106,6 @@ will produce an inaccurate conversion value. The same issue exists with the cx/c //Recreating texture from canvas given after calling updateTexture p.applyNewTexture = function (textureCanvas) { - document.body.appendChild(textureCanvas); this.image = textureCanvas; this.texture = PIXI.Texture.fromCanvas(this.image); diff --git a/dist/htmlgl.min.js b/dist/htmlgl.min.js index 4841198..62f0856 100644 --- a/dist/htmlgl.min.js +++ b/dist/htmlgl.min.js @@ -1,13 +1,13 @@ -!function(t){function e(t,e){return function(){t.apply(e,arguments)}}function r(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],h(t,e(i,this),e(o,this))}function n(t){var e=this;return null===this._state?void this._deferreds.push(t):void l(function(){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return void(e._state?t.resolve:t.reject)(e._value);var n;try{n=r(e._value)}catch(i){return void t.reject(i)}t.resolve(n)})}function i(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var r=t.then;if("function"==typeof r)return void h(e(r,t),e(i,this),e(o,this))}this._state=!0,this._value=t,s.call(this)}catch(n){o.call(this,n)}}function o(t){this._state=!1,this._value=t,s.call(this)}function s(){for(var t=0,e=this._deferreds.length;e>t;t++)n.call(this,this._deferreds[t]);this._deferreds=null}function a(t,e,r,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=r,this.reject=n}function h(t,e,r){var n=!1;try{t(function(t){n||(n=!0,e(t))},function(t){n||(n=!0,r(t))})}catch(i){if(n)return;n=!0,r(i)}}var l=r.immediateFn||"function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)},u=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};r.prototype["catch"]=function(t){return this.then(null,t)},r.prototype.then=function(t,e){var i=this;return new r(function(r,o){n.call(i,new a(t,e,r,o))})},r.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&u(arguments[0])?arguments[0]:arguments);return new r(function(e,r){function n(o,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,function(t){n(o,t)},r)}t[o]=s,0===--i&&e(t)}catch(h){r(h)}}if(0===t.length)return e([]);for(var i=t.length,o=0;on;n++)t[n].then(e,r)})},"undefined"!=typeof module&&module.exports?module.exports=r:t.Promise||(t.Promise=r)}(this),"undefined"==typeof WeakMap&&!function(){var t=Object.defineProperty,e=Date.now()%1e9,r=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")};r.prototype={set:function(e,r){var n=e[this.name];return n&&n[0]===e?n[1]=r:t(e,this.name,{value:[e,r],writable:!0}),this},get:function(t){var e;return(e=t[this.name])&&e[0]===t?e[1]:void 0},"delete":function(t){var e=t[this.name];return e&&e[0]===t?(e[0]=e[1]=void 0,!0):!1},has:function(t){var e=t[this.name];return e?e[0]===t:!1}},window.WeakMap=r}(),window.CustomElements=window.CustomElements||{flags:{}},function(t){var e=t.flags,r=[],n=function(t){r.push(t)},i=function(){r.forEach(function(e){e(t)})};t.addModule=n,t.initializeModules=i,t.hasNative=Boolean(document.registerElement),t.useNative=!e.register&&t.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||HTMLImports.useNative)}(CustomElements),CustomElements.addModule(function(t){function e(t,e){r(t,function(t){return e(t)?!0:void n(t,e)}),n(t,e)}function r(t,e,n){var i=t.firstElementChild;if(!i)for(i=t.firstChild;i&&i.nodeType!==Node.ELEMENT_NODE;)i=i.nextSibling;for(;i;)e(i,n)!==!0&&r(i,e,n),i=i.nextElementSibling;return null}function n(t,r){for(var n=t.shadowRoot;n;)e(n,r),n=n.olderShadowRoot}function i(t,e){s=[],o(t,e),s=null}function o(t,e){if(t=wrap(t),!(s.indexOf(t)>=0)){s.push(t);for(var r,n=t.querySelectorAll("link[rel="+a+"]"),i=0,h=n.length;h>i&&(r=n[i]);i++)r["import"]&&o(r["import"],e);e(t)}}var s,a=window.HTMLImports?HTMLImports.IMPORT_LINK_TYPE:"none";t.forDocumentTree=i,t.forSubtree=e}),CustomElements.addModule(function(t){function e(t){return r(t)||n(t)}function r(e){return t.upgrade(e)?!0:void a(e)}function n(t){x(t,function(t){return r(t)?!0:void 0})}function i(t){a(t),f(t)&&x(t,function(t){a(t)})}function o(t){b.push(t),C||(C=!0,setTimeout(s))}function s(){C=!1;for(var t,e=b,r=0,n=e.length;n>r&&(t=e[r]);r++)t();b=[]}function a(t){E?o(function(){h(t)}):h(t)}function h(t){t.__upgraded__&&(t.attachedCallback||t.detachedCallback)&&!t.__attached&&f(t)&&(t.__attached=!0,t.attachedCallback&&t.attachedCallback())}function l(t){u(t),x(t,function(t){u(t)})}function u(t){E?o(function(){c(t)}):c(t)}function c(t){t.__upgraded__&&(t.attachedCallback||t.detachedCallback)&&t.__attached&&!f(t)&&(t.__attached=!1,t.detachedCallback&&t.detachedCallback())}function f(t){for(var e=t,r=wrap(document);e;){if(e==r)return!0;e=e.parentNode||e.host}}function d(t){if(t.shadowRoot&&!t.shadowRoot.__watched){y.dom&&console.log("watching shadow-root for: ",t.localName);for(var e=t.shadowRoot;e;)A(e),e=e.olderShadowRoot}}function p(t){if(y.dom){var r=t[0];if(r&&"childList"===r.type&&r.addedNodes&&r.addedNodes){for(var n=r.addedNodes[0];n&&n!==document&&!n.host;)n=n.parentNode;var i=n&&(n.URL||n._URL||n.host&&n.host.localName)||"";i=i.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",t.length,i||"")}t.forEach(function(t){"childList"===t.type&&(B(t.addedNodes,function(t){t.localName&&e(t)}),B(t.removedNodes,function(t){t.localName&&l(t)}))}),y.dom&&console.groupEnd()}function g(t){for(t=wrap(t),t||(t=wrap(document));t.parentNode;)t=t.parentNode;var e=t.__observer;e&&(p(e.takeRecords()),s())}function A(t){if(!t.__observer){var e=new MutationObserver(p);e.observe(t,{childList:!0,subtree:!0}),t.__observer=e}}function v(t){t=wrap(t),y.dom&&console.group("upgradeDocument: ",t.baseURI.split("/").pop()),e(t),A(t),y.dom&&console.groupEnd()}function m(t){w(t,v)}var y=t.flags,x=t.forSubtree,w=t.forDocumentTree,E=!window.MutationObserver||window.MutationObserver===window.JsMutationObserver;t.hasPolyfillMutations=E;var C=!1,b=[],B=Array.prototype.forEach.call.bind(Array.prototype.forEach),T=Element.prototype.createShadowRoot;T&&(Element.prototype.createShadowRoot=function(){var t=T.call(this);return CustomElements.watchShadow(this),t}),t.watchShadow=d,t.upgradeDocumentTree=m,t.upgradeSubtree=n,t.upgradeAll=e,t.attachedNode=i,t.takeRecords=g}),CustomElements.addModule(function(t){function e(e){if(!e.__upgraded__&&e.nodeType===Node.ELEMENT_NODE){var n=e.getAttribute("is"),i=t.getRegisteredDefinition(n||e.localName);if(i){if(n&&i.tag==e.localName)return r(e,i);if(!n&&!i["extends"])return r(e,i)}}}function r(e,r){return s.upgrade&&console.group("upgrade:",e.localName),r.is&&e.setAttribute("is",r.is),n(e,r),e.__upgraded__=!0,o(e),t.attachedNode(e),t.upgradeSubtree(e),s.upgrade&&console.groupEnd(),e}function n(t,e){Object.__proto__?t.__proto__=e.prototype:(i(t,e.prototype,e["native"]),t.__proto__=e.prototype)}function i(t,e,r){for(var n={},i=e;i!==r&&i!==HTMLElement.prototype;){for(var o,s=Object.getOwnPropertyNames(i),a=0;o=s[a];a++)n[o]||(Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(i,o)),n[o]=1);i=Object.getPrototypeOf(i)}}function o(t){t.createdCallback&&t.createdCallback()}var s=t.flags;t.upgrade=e,t.upgradeWithDefinition=r,t.implementPrototype=n}),CustomElements.addModule(function(t){function e(e,n){var h=n||{};if(!e)throw new Error("document.registerElement: first argument `name` must not be empty");if(e.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(e)+"'.");if(i(e))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(e)+"'. The type name is invalid.");if(l(e))throw new Error("DuplicateDefinitionError: a type with name '"+String(e)+"' is already registered");return h.prototype||(h.prototype=Object.create(HTMLElement.prototype)),h.__name=e.toLowerCase(),h.lifecycle=h.lifecycle||{},h.ancestry=o(h["extends"]),s(h),a(h),r(h.prototype),u(h.__name,h),h.ctor=c(h),h.ctor.prototype=h.prototype,h.prototype.constructor=h.ctor,t.ready&&A(document),h.ctor}function r(t){if(!t.setAttribute._polyfilled){var e=t.setAttribute;t.setAttribute=function(t,r){n.call(this,t,r,e)};var r=t.removeAttribute;t.removeAttribute=function(t){n.call(this,t,null,r)},t.setAttribute._polyfilled=!0}}function n(t,e,r){t=t.toLowerCase();var n=this.getAttribute(t);r.apply(this,arguments);var i=this.getAttribute(t);this.attributeChangedCallback&&i!==n&&this.attributeChangedCallback(t,n,i)}function i(t){for(var e=0;e=0&&y(n,HTMLElement),n)}function p(t){var e=T.call(this,t);return v(e),e}var g,A=t.upgradeDocumentTree,v=t.upgrade,m=t.upgradeWithDefinition,y=t.implementPrototype,x=t.useNative,w=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],E={},C="http://www.w3.org/1999/xhtml",b=document.createElement.bind(document),B=document.createElementNS.bind(document),T=Node.prototype.cloneNode;g=Object.__proto__||x?function(t,e){return t instanceof e}:function(t,e){for(var r=t;r;){if(r===e.prototype)return!0;r=r.__proto__}return!1},document.registerElement=e,document.createElement=d,document.createElementNS=f,Node.prototype.cloneNode=p,t.registry=E,t["instanceof"]=g,t.reservedTagList=w,t.getRegisteredDefinition=l,document.register=document.registerElement}),function(t){function e(){s(wrap(document)),window.HTMLImports&&(HTMLImports.__importsParsingHook=function(t){s(wrap(t["import"]))}),CustomElements.ready=!0,setTimeout(function(){CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})}var r=t.useNative,n=t.initializeModules,i=/Trident/.test(navigator.userAgent);if(r){var o=function(){};t.watchShadow=o,t.upgrade=o,t.upgradeAll=o,t.upgradeDocumentTree=o,t.upgradeSubtree=o,t.takeRecords=o,t["instanceof"]=function(t,e){return t instanceof e}}else n();var s=t.upgradeDocumentTree;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(t){return t}),i&&"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(t,e){e=e||{};var r=document.createEvent("CustomEvent");return r.initCustomEvent(t,Boolean(e.bubbles),Boolean(e.cancelable),e.detail),r},window.CustomEvent.prototype=window.Event.prototype),"complete"===document.readyState||t.flags.eager)e();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var a=window.HTMLImports&&!HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(a,e)}else e()}(window.CustomElements),!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.PIXI=t()}}(function(){var t;return function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){var h="function"==typeof require&&require;if(!a&&h)return h(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[s]={exports:{}};t[s][0].call(u.exports,function(e){var r=t[s][1][e];return i(r?r:e)},u,u.exports,e,t,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s=t.length&&r())}if(r=r||function(){},!t.length)return r();var o=0;l(t,function(t){e(t,n(i))})},s.forEach=s.each,s.eachSeries=function(t,e,r){if(r=r||function(){},!t.length)return r();var n=0,i=function(){e(t[n],function(e){e?(r(e),r=function(){}):(n+=1,n>=t.length?r():i())})};i()},s.forEachSeries=s.eachSeries,s.eachLimit=function(t,e,r,n){var i=d(e);i.apply(null,[t,r,n])},s.forEachLimit=s.eachLimit;var d=function(t){return function(e,r,n){if(n=n||function(){},!e.length||0>=t)return n();var i=0,o=0,s=0;!function a(){if(i>=e.length)return n();for(;t>s&&o=e.length?n():a())})}()}},p=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.each].concat(e))}},g=function(t,e){return function(){var r=Array.prototype.slice.call(arguments);return e.apply(null,[d(t)].concat(r))}},A=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.eachSeries].concat(e))}},v=function(t,e,r,n){if(e=u(e,function(t,e){return{index:e,value:t}}),n){var i=[];t(e,function(t,e){r(t.value,function(r,n){i[t.index]=n,e(r)})},function(t){n(t,i)})}else t(e,function(t,e){r(t.value,function(t){e(t)})})};s.map=p(v),s.mapSeries=A(v),s.mapLimit=function(t,e,r,n){return m(e)(t,r,n)};var m=function(t){return g(t,v)};s.reduce=function(t,e,r,n){s.eachSeries(t,function(t,n){r(e,t,function(t,r){e=r,n(t)})},function(t){n(t,e)})},s.inject=s.reduce,s.foldl=s.reduce,s.reduceRight=function(t,e,r,n){var i=u(t,function(t){return t}).reverse();s.reduce(i,e,r,n)},s.foldr=s.reduceRight;var y=function(t,e,r,n){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r&&i.push(t),e()})},function(t){n(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.filter=p(y),s.filterSeries=A(y),s.select=s.filter,s.selectSeries=s.filterSeries;var x=function(t,e,r,n){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r||i.push(t),e()})},function(t){n(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.reject=p(x),s.rejectSeries=A(x);var w=function(t,e,r,n){t(e,function(t,e){r(t,function(r){r?(n(t),n=function(){}):e()})},function(t){n()})};s.detect=p(w),s.detectSeries=A(w),s.some=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t&&(r(!0),r=function(){}),n()})},function(t){r(!1)})},s.any=s.some,s.every=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t||(r(!1),r=function(){}),n()})},function(t){r(!0)})},s.all=s.every,s.sortBy=function(t,e,r){s.map(t,function(t,r){e(t,function(e,n){e?r(e):r(null,{value:t,criteria:n})})},function(t,e){if(t)return r(t);var n=function(t,e){var r=t.criteria,n=e.criteria;return n>r?-1:r>n?1:0};r(null,u(e.sort(n),function(t){return t.value}))})},s.auto=function(t,e){e=e||function(){};var r=f(t),n=r.length;if(!n)return e();var i={},o=[],a=function(t){o.unshift(t)},u=function(t){for(var e=0;en;){var o=n+(i-n+1>>>1);r(e,t[o])>=0?n=o:i=o-1}return n}function i(t,e,i,o){return t.started||(t.started=!0),h(e)||(e=[e]),0==e.length?s.setImmediate(function(){t.drain&&t.drain()}):void l(e,function(e){var a={data:e,priority:i,callback:"function"==typeof o?o:null};t.tasks.splice(n(t.tasks,a,r)+1,0,a),t.saturated&&t.tasks.length===t.concurrency&&t.saturated(),s.setImmediate(t.process)})}var o=s.queue(t,e);return o.push=function(t,e,r){i(o,t,e,r)},delete o.unshift,o},s.cargo=function(t,e){var r=!1,n=[],i={tasks:n,payload:e,saturated:null,empty:null,drain:null,drained:!0,push:function(t,r){h(t)||(t=[t]),l(t,function(t){n.push({data:t,callback:"function"==typeof r?r:null}),i.drained=!1,i.saturated&&n.length===e&&i.saturated()}),s.setImmediate(i.process)},process:function o(){if(!r){if(0===n.length)return i.drain&&!i.drained&&i.drain(),void(i.drained=!0);var s="number"==typeof e?n.splice(0,e):n.splice(0,n.length),a=u(s,function(t){return t.data});i.empty&&i.empty(),r=!0,t(a,function(){r=!1;var t=arguments;l(s,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return n.length},running:function(){return r}};return i};var b=function(t){return function(e){var r=Array.prototype.slice.call(arguments,1);e.apply(null,r.concat([function(e){var r=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&l(r,function(e){console[t](e)}))}]))}};s.log=b("log"),s.dir=b("dir"),s.memoize=function(t,e){var r={},n={};e=e||function(t){return t};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=e.apply(null,i);a in r?s.nextTick(function(){o.apply(null,r[a])}):a in n?n[a].push(o):(n[a]=[o],t.apply(null,i.concat([function(){r[a]=arguments;var t=n[a];delete n[a];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,arguments)}])))};return i.memo=r,i.unmemoized=t,i},s.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},s.times=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.map(n,e,r)},s.timesSeries=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.mapSeries(n,e,r)},s.seq=function(){var t=arguments;return function(){var e=this,r=Array.prototype.slice.call(arguments),n=r.pop();s.reduce(t,r,function(t,r,n){r.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);n(t,e)}]))},function(t,r){n.apply(e,[t].concat(r))})}},s.compose=function(){return s.seq.apply(null,Array.prototype.reverse.call(arguments))};var B=function(t,e){var r=function(){var r=this,n=Array.prototype.slice.call(arguments),i=n.pop();return t(e,function(t,e){t.apply(r,n.concat([e]))},i)};if(arguments.length>2){var n=Array.prototype.slice.call(arguments,2);return r.apply(this,n)}return r};s.applyEach=p(B),s.applyEachSeries=A(B),s.forever=function(t,e){function r(n){if(n){if(e)return e(n);throw n}t(r)}r()},"undefined"!=typeof r&&r.exports?r.exports=s:"undefined"!=typeof t&&t.amd?t([],function(){return s}):i.async=s}()}).call(this,e("_process"))},{_process:4}],3:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,i="/"===s.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),o="/"===s(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),o=n(e.split("/")),s=Math.min(i.length,o.length),a=s,h=0;s>h;h++)if(i[h]!==o[h]){a=h;break}for(var l=[],h=a;he&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:4}],4:[function(t,e,r){function n(){if(!a){a=!0;for(var t,e=s.length;e;){t=s,s=[];for(var r=-1;++ri;)e=t.charCodeAt(i++),e>=55296&&56319>=e&&o>i?(r=t.charCodeAt(i++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--)):n.push(e);return n}function l(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=N(t>>>10&1023|55296),t=56320|1023&t),e+=N(t)}).join("")}function u(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:C}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?L(t/D):t>>1,t+=L(t/e);t>Q*B>>1;n+=C)t=L(t/Q);return L(n+(Q+1)*t/(t+T))}function d(t){var e,r,n,i,s,a,h,c,d,p,g=[],A=t.length,v=0,m=P,y=M;for(r=t.lastIndexOf(R),0>r&&(r=0),n=0;r>n;++n)t.charCodeAt(n)>=128&&o("not-basic"),g.push(t.charCodeAt(n));for(i=r>0?r+1:0;A>i;){for(s=v,a=1,h=C;i>=A&&o("invalid-input"),c=u(t.charCodeAt(i++)),(c>=C||c>L((E-v)/a))&&o("overflow"),v+=c*a,d=y>=h?b:h>=y+B?B:h-y,!(d>c);h+=C)p=C-d,a>L(E/p)&&o("overflow"),a*=p;e=g.length+1,y=f(v-s,e,0==s),L(v/e)>E-m&&o("overflow"),m+=L(v/e),v%=e,g.splice(v++,0,m)}return l(g)}function p(t){var e,r,n,i,s,a,l,u,d,p,g,A,v,m,y,x=[];for(t=h(t),A=t.length,e=P,r=0,s=M,a=0;A>a;++a)g=t[a],128>g&&x.push(N(g));for(n=i=x.length,i&&x.push(R);A>n;){for(l=E,a=0;A>a;++a)g=t[a],g>=e&&l>g&&(l=g);for(v=n+1,l-e>L((E-r)/v)&&o("overflow"),r+=(l-e)*v,e=l,a=0;A>a;++a)if(g=t[a],e>g&&++r>E&&o("overflow"),g==e){for(u=r,d=C;p=s>=d?b:d>=s+B?B:d-s,!(p>u);d+=C)y=u-p,m=C-p,x.push(N(c(p+y%m,0))),u=L(y/m);x.push(N(c(u,0))),s=f(r,v,n==i),r=0,++n}++r,++e}return x.join("")}function g(t){return a(t,function(t){return I.test(t)?d(t.slice(4).toLowerCase()):t})}function A(t){return a(t,function(t){return S.test(t)?"xn--"+p(t):t})}var v="object"==typeof n&&n,m="object"==typeof r&&r&&r.exports==v&&r,y="object"==typeof e&&e;(y.global===y||y.window===y)&&(i=y);var x,w,E=2147483647,C=36,b=1,B=26,T=38,D=700,M=72,P=128,R="-",I=/^xn--/,S=/[^ -~]/,O=/\x2E|\u3002|\uFF0E|\uFF61/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Q=C-b,L=Math.floor,N=String.fromCharCode;if(x={version:"1.2.4",ucs2:{decode:h,encode:l},decode:d,encode:p,toASCII:A,toUnicode:g},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return x});else if(v&&!v.nodeType)if(m)m.exports=x;else for(w in x)x.hasOwnProperty(w)&&(v[w]=x[w]);else i.punycode=x}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var h=1e3;o&&"number"==typeof o.maxKeys&&(h=o.maxKeys);var l=t.length;h>0&&l>h&&(l=h);for(var u=0;l>u;++u){var c,f,d,p,g=t[u].replace(a,"%20"),A=g.indexOf(r);A>=0?(c=g.substr(0,A),f=g.substr(A+1)):(c=g,f=""),d=decodeURIComponent(c),p=decodeURIComponent(f),n(s,d)?i(s[d])?s[d].push(p):s[d]=[s[d],p]:s[d]=p}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],7:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n",'"',"`"," ","\r","\n"," "],A=["{","}","|","\\","^","`"].concat(g),v=["'"].concat(A),m=["%","/","?",";","#"].concat(v),y=["/","?","#"],x=255,w=/^[a-z0-9A-Z_-]{0,63}$/,E=/^([a-z0-9A-Z_-]{0,63})(.*)$/,C={ -javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},B={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},T=t("querystring");n.prototype.parse=function(t,e,r){if(!h(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t;n=n.trim();var i=d.exec(n);if(i){i=i[0];var o=i.toLowerCase();this.protocol=o,n=n.substr(i.length)}if(r||i||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===n.substr(0,2);!s||i&&b[i]||(n=n.substr(2),this.slashes=!0)}if(!b[i]&&(s||i&&!B[i])){for(var a=-1,l=0;lu)&&(a=u)}var c,p;p=-1===a?n.lastIndexOf("@"):n.lastIndexOf("@",a),-1!==p&&(c=n.slice(0,p),n=n.slice(p+1),this.auth=decodeURIComponent(c)),a=-1;for(var l=0;lu)&&(a=u)}-1===a&&(a=n.length),this.host=n.slice(0,a),n=n.slice(a),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var A=this.hostname.split(/\./),l=0,D=A.length;D>l;l++){var M=A[l];if(M&&!M.match(w)){for(var P="",R=0,I=M.length;I>R;R++)P+=M.charCodeAt(R)>127?"x":M[R];if(!P.match(w)){var S=A.slice(0,l),O=A.slice(l+1),F=M.match(E);F&&(S.push(F[1]),O.unshift(F[2])),O.length&&(n="/"+O.join(".")+n),this.hostname=S.join(".");break}}}if(this.hostname=this.hostname.length>x?"":this.hostname.toLowerCase(),!g){for(var Q=this.hostname.split("."),L=[],l=0;ll;l++){var G=v[l],Y=encodeURIComponent(G);Y===G&&(Y=escape(G)),n=n.split(G).join(Y)}var j=n.indexOf("#");-1!==j&&(this.hash=n.substr(j),n=n.slice(0,j));var z=n.indexOf("?");if(-1!==z?(this.search=n.substr(z),this.query=n.substr(z+1),e&&(this.query=T.parse(this.query)),n=n.slice(0,z)):e&&(this.search="",this.query={}),n&&(this.pathname=n),B[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var H=this.pathname||"",N=this.search||"";this.path=H+N}return this.href=this.format(),this},n.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=t+this.host:this.hostname&&(i=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&l(this.query)&&Object.keys(this.query).length&&(o=T.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||B[e])&&i!==!1?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),s=s.replace("#","%23"),e+i+r+s+n},n.prototype.resolve=function(t){return this.resolveObject(i(t,!1,!0)).format()},n.prototype.resolveObject=function(t){if(h(t)){var e=new n;e.parse(t,!1,!0),t=e}var r=new n;if(Object.keys(this).forEach(function(t){r[t]=this[t]},this),r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol)return Object.keys(t).forEach(function(e){"protocol"!==e&&(r[e]=t[e])}),B[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r;if(t.protocol&&t.protocol!==r.protocol){if(!B[t.protocol])return Object.keys(t).forEach(function(e){r[e]=t[e]}),r.href=r.format(),r;if(r.protocol=t.protocol,t.host||b[t.protocol])r.pathname=t.pathname;else{for(var i=(t.pathname||"").split("/");i.length&&!(t.host=i.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==i[0]&&i.unshift(""),i.length<2&&i.unshift(""),r.pathname=i.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var o=r.pathname||"",s=r.search||"";r.path=o+s}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var a=r.pathname&&"/"===r.pathname.charAt(0),l=t.host||t.pathname&&"/"===t.pathname.charAt(0),f=l||a||r.host&&t.pathname,d=f,p=r.pathname&&r.pathname.split("/")||[],i=t.pathname&&t.pathname.split("/")||[],g=r.protocol&&!B[r.protocol];if(g&&(r.hostname="",r.port=null,r.host&&(""===p[0]?p[0]=r.host:p.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===i[0]?i[0]=t.host:i.unshift(t.host)),t.host=null),f=f&&(""===i[0]||""===p[0])),l)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,p=i;else if(i.length)p||(p=[]),p.pop(),p=p.concat(i),r.search=t.search,r.query=t.query;else if(!c(t.search)){if(g){r.hostname=r.host=p.shift();var A=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;A&&(r.auth=A.shift(),r.host=r.hostname=A.shift())}return r.search=t.search,r.query=t.query,u(r.pathname)&&u(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!p.length)return r.pathname=null,r.path=r.search?"/"+r.search:null,r.href=r.format(),r;for(var v=p.slice(-1)[0],m=(r.host||t.host)&&("."===v||".."===v)||""===v,y=0,x=p.length;x>=0;x--)v=p[x],"."==v?p.splice(x,1):".."===v?(p.splice(x,1),y++):y&&(p.splice(x,1),y--);if(!f&&!d)for(;y--;y)p.unshift("..");!f||""===p[0]||p[0]&&"/"===p[0].charAt(0)||p.unshift(""),m&&"/"!==p.join("/").substr(-1)&&p.push("");var w=""===p[0]||p[0]&&"/"===p[0].charAt(0);if(g){r.hostname=r.host=w?"":p.length?p.shift():"";var A=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;A&&(r.auth=A.shift(),r.host=r.hostname=A.shift())}return f=f||r.host&&p.length,f&&!w&&p.unshift(""),p.length?r.pathname=p.join("/"):(r.pathname=null,r.path=null),u(r.pathname)&&u(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=p.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{punycode:5,querystring:8}],10:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n=e&&e.length,a=n?e[0]*r:t.length,h=o(t,i(t,0,a,r,!0)),l=[];if(!h)return l;var c,f,d,p,g,A,v;if(n&&(h=u(t,e,h,r)),t.length>80*r){c=d=t[0],f=p=t[1];for(var m=r;a>m;m+=r)g=t[m],A=t[m+1],c>g&&(c=g),f>A&&(f=A),g>d&&(d=g),A>p&&(p=A);v=Math.max(d-c,p-f)}return s(t,h,l,r,c,f,v),l}function i(t,e,r,n,i){var o,s,a,h=0;for(o=e,s=r-n;r>o;o+=n)h+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;if(i===h>0)for(o=e;r>o;o+=n)a=B(o,a);else for(o=r-n;o>=e;o-=n)a=B(o,a);return a}function o(t,e,r){r||(r=e);var n,i=e;do if(n=!1,y(t,i.i,i.next.i)||0===m(t,i.prev.i,i.i,i.next.i)){if(i.prev.next=i.next,i.next.prev=i.prev,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ),i=r=i.prev,i===i.next)return null;n=!0}else i=i.next;while(n||i!==r);return r}function s(t,e,r,n,i,u,c,f){if(e){f||void 0===i||d(t,e,i,u,c);for(var p,g,A=e;e.prev!==e.next;)if(p=e.prev,g=e.next,a(t,e,i,u,c))r.push(p.i/n),r.push(e.i/n),r.push(g.i/n),g.prev=p,p.next=g,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),e=g.next,A=g.next;else if(e=g,e===A){f?1===f?(e=h(t,e,r,n),s(t,e,r,n,i,u,c,2)):2===f&&l(t,e,r,n,i,u,c):s(t,o(t,e),r,n,i,u,c,1);break}}}function a(t,e,r,n,i){var o=e.prev.i,s=e.i,a=e.next.i,h=t[o],l=t[o+1],u=t[s],c=t[s+1],f=t[a],d=t[a+1],p=h*c-l*u,A=h*d-l*f,v=f*c-d*u,m=p-A-v;if(0>=m)return!1;var y,x,w,E,C,b,B,T=d-l,D=h-f,M=l-c,P=u-h;if(void 0!==r){var R=u>h?f>h?h:f:f>u?u:f,I=c>l?d>l?l:d:d>c?c:d,S=h>u?h>f?h:f:u>f?u:f,O=l>c?l>d?l:d:c>d?c:d,F=g(R,I,r,n,i),Q=g(S,O,r,n,i);for(B=e.nextZ;B&&B.z<=Q;)if(y=B.i,B=B.nextZ,y!==o&&y!==a&&(x=t[y],w=t[y+1],E=T*x+D*w-A,E>=0&&(C=M*x+P*w+p,C>=0&&(b=m-E-C,b>=0&&(E&&C||E&&b||C&&b)))))return!1;for(B=e.prevZ;B&&B.z>=F;)if(y=B.i,B=B.prevZ,y!==o&&y!==a&&(x=t[y],w=t[y+1],E=T*x+D*w-A,E>=0&&(C=M*x+P*w+p,C>=0&&(b=m-E-C,b>=0&&(E&&C||E&&b||C&&b)))))return!1}else for(B=e.next.next;B!==e.prev;)if(y=B.i,B=B.next,x=t[y],w=t[y+1],E=T*x+D*w-A,E>=0&&(C=M*x+P*w+p,C>=0&&(b=m-E-C,b>=0&&(E&&C||E&&b||C&&b))))return!1;return!0}function h(t,e,r,n){var i=e;do{var o=i.prev,s=i.next.next;if(o.i!==s.i&&x(t,o.i,i.i,i.next.i,s.i)&&E(t,o,s)&&E(t,s,o)){r.push(o.i/n),r.push(i.i/n),r.push(s.i/n),o.next=s,s.prev=o;var a=i.prevZ,h=i.nextZ&&i.nextZ.nextZ;a&&(a.nextZ=h),h&&(h.prevZ=a),i=e=s}i=i.next}while(i!==e);return i}function l(t,e,r,n,i,a,h){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&v(t,l,u)){var c=b(l,u);return l=o(t,l,l.next),c=o(t,c,c.next),s(t,l,r,n,i,a,h),void s(t,c,r,n,i,a,h)}u=u.next}l=l.next}while(l!==e)}function u(t,e,r,n){var s,a,h,l,u,f=[];for(s=0,a=e.length;a>s;s++)h=e[s]*n,l=a-1>s?e[s+1]*n:t.length,u=o(t,i(t,h,l,n,!1)),u&&f.push(A(t,u));for(f.sort(function(e,r){return t[e.i]-t[r.i]}),s=0;s=t[o+1]){var c=t[i]+(l-t[i+1])*(t[o]-t[i])/(t[o+1]-t[i+1]);h>=c&&c>u&&(u=c,n=t[i]=D?-1:1,P=n,R=1/0;for(s=n.next;s!==P;)f=t[s.i],d=t[s.i+1],p=h-f,p>=0&&f>=m&&(g=(C*f+b*d-w)*M,g>=0&&(A=(B*f+T*d+x)*M,A>=0&&D*M-g-A>=0&&(v=Math.abs(l-d)/p,R>v&&E(t,s,e)&&(n=s,R=v)))),s=s.next;return n}function d(t,e,r,n,i){var o=e;do null===o.z&&(o.z=g(t[o.i],t[o.i+1],r,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,p(o)}function p(t){var e,r,n,i,o,s,a,h,l=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,n=r,a=0,e=0;l>e&&(a++,n=n.nextZ);e++);for(h=l;a>0||h>0&&n;)0===a?(i=n,n=n.nextZ,h--):0!==h&&n?r.z<=n.z?(i=r,r=r.nextZ,a--):(i=n,n=n.nextZ,h--):(i=r,r=r.nextZ,a--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(s>1);return t}function g(t,e,r,n,i){return t=1e3*(t-r)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=1e3*(e-n)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function A(t,e){var r=e,n=e;do t[r.i]0?1:0>i?-1:0}function y(t,e,r){return t[e]===t[r]&&t[e+1]===t[r+1]}function x(t,e,r,n,i){return m(t,e,r,n)!==m(t,e,r,i)&&m(t,n,i,e)!==m(t,n,i,r)}function w(t,e,r,n){var i=e;do{var o=i.i,s=i.next.i;if(o!==r&&s!==r&&o!==n&&s!==n&&x(t,o,s,r,n))return!0;i=i.next}while(i!==e);return!1}function E(t,e,r){return-1===m(t,e.prev.i,e.i,e.next.i)?-1!==m(t,e.i,r.i,e.next.i)&&-1!==m(t,e.i,e.prev.i,r.i):-1===m(t,e.i,r.i,e.prev.i)||-1===m(t,e.i,e.next.i,r.i)}function C(t,e,r,n){var i=e,o=!1,s=(t[r]+t[n])/2,a=(t[r+1]+t[n+1])/2;do{var h=i.i,l=i.next.i;t[h+1]>a!=t[l+1]>a&&s<(t[l]-t[h])*(a-t[h+1])/(t[l+1]-t[h+1])+t[h]&&(o=!o),i=i.next}while(i!==e);return o}function b(t,e){var r=new T(t.i),n=new T(e.i),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function B(t,e){var r=new T(t);return e?(r.next=e.next,r.prev=e,e.next.prev=r,e.next=r):(r.prev=r,r.next=r),r}function T(t){this.i=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null}e.exports=n},{}],11:[function(t,e,r){"use strict";function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function i(){}var o="function"!=typeof Object.create?"~":!1;i.prototype._events=void 0,i.prototype.listeners=function(t,e){var r=o?o+t:t,n=this._events&&this._events[r];if(e)return!!n;if(!n)return[];if(this._events[r].fn)return[this._events[r].fn];for(var i=0,s=this._events[r].length,a=new Array(s);s>i;i++)a[i]=this._events[r][i].fn;return a},i.prototype.emit=function(t,e,r,n,i,s){var a=o?o+t:t;if(!this._events||!this._events[a])return!1;var h,l,u=this._events[a],c=arguments.length;if("function"==typeof u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,n),!0;case 5:return u.fn.call(u.context,e,r,n,i),!0;case 6:return u.fn.call(u.context,e,r,n,i,s),!0}for(l=1,h=new Array(c-1);c>l;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var f,d=u.length;for(l=0;d>l;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),c){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;default:if(!h)for(f=1,h=new Array(c-1);c>f;f++)h[f-1]=arguments[f];u[l].fn.apply(u[l].context,h)}}return!0},i.prototype.on=function(t,e,r){var i=new n(e,r||this),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],i]:this._events[s].push(i):this._events[s]=i,this},i.prototype.once=function(t,e,r){var i=new n(e,r||this,!0),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],i]:this._events[s].push(i):this._events[s]=i,this},i.prototype.removeListener=function(t,e,r,n){var i=o?o+t:t;if(!this._events||!this._events[i])return this;var s=this._events[i],a=[];if(e)if(s.fn)(s.fn!==e||n&&!s.once||r&&s.context!==r)&&a.push(s);else for(var h=0,l=s.length;l>h;h++)(s[h].fn!==e||n&&!s[h].once||r&&s[h].context!==r)&&a.push(s[h]);return a.length?this._events[i]=1===a.length?a[0]:a:delete this._events[i],this},i.prototype.removeAllListeners=function(t){return this._events?(t?delete this._events[o?o+t:t]:this._events=o?{}:Object.create(null),this):this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prototype.setMaxListeners=function(){return this},i.prefixed=o,e.exports=i},{}],12:[function(t,e,r){"use strict";function n(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}e.exports=Object.assign||function(t,e){for(var r,i,o=n(t),s=1;s=t.length&&r())}if(r=r||function(){},!t.length)return r();var o=0;l(t,function(t){e(t,n(i))})},s.forEach=s.each,s.eachSeries=function(t,e,r){if(r=r||function(){},!t.length)return r();var n=0,i=function(){e(t[n],function(e){e?(r(e),r=function(){}):(n+=1,n>=t.length?r():i())})};i()},s.forEachSeries=s.eachSeries,s.eachLimit=function(t,e,r,n){var i=d(e);i.apply(null,[t,r,n])},s.forEachLimit=s.eachLimit;var d=function(t){return function(e,r,n){if(n=n||function(){},!e.length||0>=t)return n();var i=0,o=0,s=0;!function a(){if(i>=e.length)return n();for(;t>s&&o=e.length?n():a())})}()}},p=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.each].concat(e))}},g=function(t,e){return function(){var r=Array.prototype.slice.call(arguments);return e.apply(null,[d(t)].concat(r))}},A=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.eachSeries].concat(e))}},v=function(t,e,r,n){if(e=u(e,function(t,e){return{index:e,value:t}}),n){var i=[];t(e,function(t,e){r(t.value,function(r,n){i[t.index]=n,e(r)})},function(t){n(t,i)})}else t(e,function(t,e){r(t.value,function(t){e(t)})})};s.map=p(v),s.mapSeries=A(v),s.mapLimit=function(t,e,r,n){return m(e)(t,r,n)};var m=function(t){return g(t,v)};s.reduce=function(t,e,r,n){s.eachSeries(t,function(t,n){r(e,t,function(t,r){e=r,n(t)})},function(t){n(t,e)})},s.inject=s.reduce,s.foldl=s.reduce,s.reduceRight=function(t,e,r,n){var i=u(t,function(t){return t}).reverse();s.reduce(i,e,r,n)},s.foldr=s.reduceRight;var y=function(t,e,r,n){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r&&i.push(t),e()})},function(t){n(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.filter=p(y),s.filterSeries=A(y),s.select=s.filter,s.selectSeries=s.filterSeries;var x=function(t,e,r,n){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r||i.push(t),e()})},function(t){n(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.reject=p(x),s.rejectSeries=A(x);var w=function(t,e,r,n){t(e,function(t,e){r(t,function(r){r?(n(t),n=function(){}):e()})},function(t){n()})};s.detect=p(w),s.detectSeries=A(w),s.some=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t&&(r(!0),r=function(){}),n()})},function(t){r(!1)})},s.any=s.some,s.every=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t||(r(!1),r=function(){}),n()})},function(t){r(!0)})},s.all=s.every,s.sortBy=function(t,e,r){s.map(t,function(t,r){e(t,function(e,n){e?r(e):r(null,{value:t,criteria:n})})},function(t,e){if(t)return r(t);var n=function(t,e){var r=t.criteria,n=e.criteria;return n>r?-1:r>n?1:0};r(null,u(e.sort(n),function(t){return t.value}))})},s.auto=function(t,e){e=e||function(){};var r=f(t),n=r.length;if(!n)return e();var i={},o=[],a=function(t){o.unshift(t)},u=function(t){for(var e=0;en;){var o=n+(i-n+1>>>1);r(e,t[o])>=0?n=o:i=o-1}return n}function i(t,e,i,o){return t.started||(t.started=!0),h(e)||(e=[e]),0==e.length?s.setImmediate(function(){t.drain&&t.drain()}):void l(e,function(e){var a={data:e,priority:i,callback:"function"==typeof o?o:null};t.tasks.splice(n(t.tasks,a,r)+1,0,a),t.saturated&&t.tasks.length===t.concurrency&&t.saturated(),s.setImmediate(t.process)})}var o=s.queue(t,e);return o.push=function(t,e,r){i(o,t,e,r)},delete o.unshift,o},s.cargo=function(t,e){var r=!1,n=[],i={tasks:n,payload:e,saturated:null,empty:null,drain:null,drained:!0,push:function(t,r){h(t)||(t=[t]),l(t,function(t){n.push({data:t,callback:"function"==typeof r?r:null}),i.drained=!1,i.saturated&&n.length===e&&i.saturated()}),s.setImmediate(i.process)},process:function o(){if(!r){if(0===n.length)return i.drain&&!i.drained&&i.drain(),void(i.drained=!0);var s="number"==typeof e?n.splice(0,e):n.splice(0,n.length),a=u(s,function(t){return t.data});i.empty&&i.empty(),r=!0,t(a,function(){r=!1;var t=arguments;l(s,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return n.length},running:function(){return r}};return i};var b=function(t){return function(e){var r=Array.prototype.slice.call(arguments,1);e.apply(null,r.concat([function(e){var r=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&l(r,function(e){console[t](e)}))}]))}};s.log=b("log"),s.dir=b("dir"),s.memoize=function(t,e){var r={},n={};e=e||function(t){return t};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=e.apply(null,i);a in r?s.nextTick(function(){o.apply(null,r[a])}):a in n?n[a].push(o):(n[a]=[o],t.apply(null,i.concat([function(){r[a]=arguments;var t=n[a];delete n[a];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,arguments)}])))};return i.memo=r,i.unmemoized=t,i},s.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},s.times=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.map(n,e,r)},s.timesSeries=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.mapSeries(n,e,r)},s.seq=function(){var t=arguments;return function(){var e=this,r=Array.prototype.slice.call(arguments),n=r.pop();s.reduce(t,r,function(t,r,n){r.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);n(t,e)}]))},function(t,r){n.apply(e,[t].concat(r))})}},s.compose=function(){return s.seq.apply(null,Array.prototype.reverse.call(arguments))};var B=function(t,e){var r=function(){var r=this,n=Array.prototype.slice.call(arguments),i=n.pop();return t(e,function(t,e){t.apply(r,n.concat([e]))},i)};if(arguments.length>2){var n=Array.prototype.slice.call(arguments,2);return r.apply(this,n)}return r};s.applyEach=p(B),s.applyEachSeries=A(B),s.forever=function(t,e){function r(n){if(n){if(e)return e(n);throw n}t(r)}r()},"undefined"!=typeof r&&r.exports?r.exports=s:"undefined"!=typeof t&&t.amd?t([],function(){return s}):i.async=s}()}).call(this,e("_process"))},{_process:4}],14:[function(t,e,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],15:[function(t,e,r){function n(t,e){a.call(this),e=e||10,this.baseUrl=t||"",this.progress=0,this.loading=!1,this._progressChunk=0,this._beforeMiddleware=[],this._afterMiddleware=[],this._boundLoadResource=this._loadResource.bind(this),this._boundOnLoad=this._onLoad.bind(this),this._buffer=[],this._numToLoad=0,this._queue=i.queue(this._boundLoadResource,e),this.resources={}}var i=t("async"),o=t("url"),s=t("./Resource"),a=t("eventemitter3");n.prototype=Object.create(a.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.add=n.prototype.enqueue=function(t,e,r,n){if(Array.isArray(t)){for(var i=0;i0)if(this.xhrType===n.XHR_RESPONSE_TYPE.TEXT)this.data=t.responseText;else if(this.xhrType===n.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t.responseText),this.isJson=!0}catch(r){this.error=new Error("Error trying to parse loaded json:",r)}else if(this.xhrType===n.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var i=new DOMParser;this.data=i.parseFromString(t.responseText,"text/xml")}else{var o=document.createElement("div");o.innerHTML=t.responseText,this.data=o}this.isXml=!0}catch(r){this.error=new Error("Error trying to parse loaded xml:",r)}else this.data=t.response||t.responseText;else this.error=new Error("["+t.status+"]"+t.statusText+":"+t.responseURL);this.complete()},n.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";e=e||window.location,l||(l=document.createElement("a")),l.href=t,t=a.parse(l.href);var r=!t.port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&r&&t.protocol===e.protocol?"":"anonymous"},n.prototype._determineXhrType=function(){return n._xhrTypeMap[this._getExtension()]||n.XHR_RESPONSE_TYPE.TEXT},n.prototype._determineLoadType=function(){return n._loadTypeMap[this._getExtension()]||n.LOAD_TYPE.XHR},n.prototype._getExtension=function(){var t,e=this.url;if(this.isDataUrl){var r=e.indexOf("/");t=e.substring(r+1,e.indexOf(";",r))}else{var n=e.indexOf("?");-1!==n&&(e=e.substring(0,n)),t=e.substring(e.lastIndexOf(".")+1)}return t},n.prototype._getMimeFromXhrType=function(t){switch(t){case n.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case n.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case n.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case n.XHR_RESPONSE_TYPE.JSON:return"application/json";case n.XHR_RESPONSE_TYPE.DEFAULT:case n.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},n.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},n.XHR_READY_STATE={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},n.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},n._loadTypeMap={gif:n.LOAD_TYPE.IMAGE,png:n.LOAD_TYPE.IMAGE,bmp:n.LOAD_TYPE.IMAGE,jpg:n.LOAD_TYPE.IMAGE,jpeg:n.LOAD_TYPE.IMAGE,tif:n.LOAD_TYPE.IMAGE,tiff:n.LOAD_TYPE.IMAGE,webp:n.LOAD_TYPE.IMAGE,tga:n.LOAD_TYPE.IMAGE},n._xhrTypeMap={xhtml:n.XHR_RESPONSE_TYPE.DOCUMENT,html:n.XHR_RESPONSE_TYPE.DOCUMENT,htm:n.XHR_RESPONSE_TYPE.DOCUMENT,xml:n.XHR_RESPONSE_TYPE.DOCUMENT,tmx:n.XHR_RESPONSE_TYPE.DOCUMENT,tsx:n.XHR_RESPONSE_TYPE.DOCUMENT,svg:n.XHR_RESPONSE_TYPE.DOCUMENT,gif:n.XHR_RESPONSE_TYPE.BLOB,png:n.XHR_RESPONSE_TYPE.BLOB,bmp:n.XHR_RESPONSE_TYPE.BLOB,jpg:n.XHR_RESPONSE_TYPE.BLOB,jpeg:n.XHR_RESPONSE_TYPE.BLOB,tif:n.XHR_RESPONSE_TYPE.BLOB,tiff:n.XHR_RESPONSE_TYPE.BLOB,webp:n.XHR_RESPONSE_TYPE.BLOB,tga:n.XHR_RESPONSE_TYPE.BLOB,json:n.XHR_RESPONSE_TYPE.JSON,text:n.XHR_RESPONSE_TYPE.TEXT,txt:n.XHR_RESPONSE_TYPE.TEXT},n.setExtensionLoadType=function(t,e){o(n._loadTypeMap,t,e)},n.setExtensionXhrType=function(t,e){o(n._xhrTypeMap,t,e)}},{eventemitter3:14,url:9}],17:[function(t,e,r){e.exports={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encodeBinary:function(t){for(var e,r="",n=new Array(4),i=0,o=0,s=0;i>2,n[1]=(3&e[0])<<4|e[1]>>4,n[2]=(15&e[1])<<2|e[2]>>6,n[3]=63&e[2],s=i-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(o=0;o","Richard Davey "],main:"./src/index.js",homepage:"http://goodboydigital.com/",bugs:"https://github.com/GoodBoyDigital/pixi.js/issues",license:"MIT",repository:{type:"git",url:"https://github.com/GoodBoyDigital/pixi.js.git"},scripts:{start:"gulp && gulp watch",test:"gulp && testem ci",build:"gulp",docs:"jsdoc -c ./gulp/util/jsdoc.conf.json -R README.md"},files:["bin/","src/"],dependencies:{async:"^0.9.0",brfs:"^1.4.0",earcut:"^2.0.1",eventemitter3:"^1.1.0","object-assign":"^2.0.0","resource-loader":"^1.6.1"},devDependencies:{browserify:"^10.2.3",chai:"^3.0.0",del:"^1.2.0",gulp:"^3.9.0","gulp-cached":"^1.1.0","gulp-concat":"^2.5.2","gulp-debug":"^2.0.1","gulp-jshint":"^1.11.0","gulp-mirror":"^0.4.0","gulp-plumber":"^1.0.1","gulp-rename":"^1.2.2","gulp-sourcemaps":"^1.5.2","gulp-uglify":"^1.2.0","gulp-util":"^3.0.5","jaguarjs-jsdoc":"git+https://github.com/davidshimjs/jaguarjs-jsdoc.git",jsdoc:"^3.3.0","jshint-summary":"^0.4.0",minimist:"^1.1.1",mocha:"^2.2.5","require-dir":"^0.3.0","run-sequence":"^1.1.0",testem:"^0.8.3","vinyl-buffer":"^1.0.0","vinyl-source-stream":"^1.1.0",watchify:"^3.2.1"},browserify:{transform:["brfs"]}}},{}],22:[function(t,e,r){var n={VERSION:t("../../package.json").version,PI_2:2*Math.PI,RAD_TO_DEG:180/Math.PI,DEG_TO_RAD:Math.PI/180,TARGET_FPMS:.06,RENDERER_TYPE:{UNKNOWN:0,WEBGL:1,CANVAS:2},BLEND_MODES:{NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},DRAW_MODES:{POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},SCALE_MODES:{DEFAULT:0,LINEAR:0,NEAREST:1},RETINA_PREFIX:/@(.+)x/,RESOLUTION:1,FILTER_RESOLUTION:1,DEFAULT_RENDER_OPTIONS:{view:null,resolution:1,antialias:!1,forceFXAA:!1,autoResize:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1},SHAPES:{POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},SPRITE_BATCH_SIZE:2e3};e.exports=n},{"../../package.json":21}],23:[function(t,e,r){function n(){o.call(this),this.children=[]}var i=t("../math"),o=t("./DisplayObject"),s=t("../textures/RenderTexture"),a=new i.Matrix;n.prototype=Object.create(o.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{width:{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t}},height:{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t}}}),n.prototype.addChild=function(t){return this.addChildAt(t,this.children.length)},n.prototype.addChildAt=function(t,e){if(t===this)return t;if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),t.emit("added",this),t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},n.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),n=this.getChildIndex(e);if(0>r||0>n)throw new Error("swapChildren: Both the supplied DisplayObjects must be children of the caller.");this.children[r]=e,this.children[n]=t}},n.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},n.prototype.setChildIndex=function(t,e){if(0>e||e>=this.children.length)throw new Error("The supplied index is out of bounds");var r=this.getChildIndex(t);this.children.splice(r,1),this.children.splice(e,0,t)},n.prototype.getChildAt=function(t){if(0>t||t>=this.children.length)throw new Error("getChildAt: Supplied index "+t+" does not exist in the child list, or the supplied DisplayObject is not a child of the caller");return this.children[t]},n.prototype.removeChild=function(t){var e=this.children.indexOf(t);return-1!==e?this.removeChildAt(e):void 0},n.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,this.children.splice(t,1),e.emit("removed",this),e},n.prototype.removeChildren=function(t,e){var r=t||0,n="number"==typeof e?e:this.children.length,i=n-r;if(i>0&&n>=i){for(var o=this.children.splice(r,i),s=0;st;++t)this.children[t].updateTransform()}},n.prototype.containerUpdateTransform=n.prototype.updateTransform,n.prototype.getBounds=function(){if(!this._currentBounds){if(0===this.children.length)return i.Rectangle.EMPTY;for(var t,e,r,n=1/0,o=1/0,s=-(1/0),a=-(1/0),h=!1,l=0,u=this.children.length;u>l;++l){var c=this.children[l];c.visible&&(h=!0,t=this.children[l].getBounds(),n=ne?s:e,a=a>r?a:r)}if(!h)return i.Rectangle.EMPTY;var f=this._bounds;f.x=n,f.y=o,f.width=s-n,f.height=a-o,this._currentBounds=f}return this._currentBounds},n.prototype.containerGetBounds=n.prototype.getBounds,n.prototype.getLocalBounds=function(){var t=this.worldTransform;this.worldTransform=i.Matrix.IDENTITY;for(var e=0,r=this.children.length;r>e;++e)this.children[e].updateTransform();return this.worldTransform=t,this._currentBounds=null,this.getBounds(i.Matrix.IDENTITY)},n.prototype.renderWebGL=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var e,r;if(this._mask||this._filters){for(t.currentRenderer.flush(),this._filters&&t.filterManager.pushFilter(this,this._filters),this._mask&&t.maskManager.pushMask(this,this._mask),t.currentRenderer.start(),this._renderWebGL(t),e=0,r=this.children.length;r>e;e++)this.children[e].renderWebGL(t);t.currentRenderer.flush(),this._mask&&t.maskManager.popMask(this,this._mask),this._filters&&t.filterManager.popFilter(),t.currentRenderer.start()}else for(this._renderWebGL(t),e=0,r=this.children.length;r>e;++e)this.children[e].renderWebGL(t)}},n.prototype._renderWebGL=function(t){},n.prototype._renderCanvas=function(t){},n.prototype.renderCanvas=function(t){if(this.visible&&!(this.alpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask,t),this._renderCanvas(t);for(var e=0,r=this.children.length;r>e;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},n.prototype.destroy=function(t){if(o.prototype.destroy.call(this),t)for(var e=0,r=this.children.length;r>e;++e)this.children[e].destroy(t);this.removeChildren(),this.children=null}},{"../math":32,"../textures/RenderTexture":70,"./DisplayObject":24}],24:[function(t,e,r){function n(){s.call(this),this.position=new i.Point,this.scale=new i.Point(1,1),this.pivot=new i.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this.worldTransform=new i.Matrix,this.filterArea=null,this._sr=0,this._cr=1,this._bounds=new i.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cachedObject=null}var i=t("../math"),o=t("../textures/RenderTexture"),s=t("eventemitter3"),a=t("../const"),h=new i.Matrix;n.prototype=Object.create(s.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},worldVisible:{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},mask:{get:function(){return this._mask},set:function(t){this._mask&&(this._mask.renderable=!0),this._mask=t,this._mask&&(this._mask.renderable=!1)}},filters:{get:function(){return this._filters&&this._filters.slice()},set:function(t){this._filters=t&&t.slice()}}}),n.prototype.updateTransform=function(){var t,e,r,n,i,o,s=this.parent.worldTransform,h=this.worldTransform;this.rotation%a.PI_2?(this.rotation!==this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation)),t=this._cr*this.scale.x,e=this._sr*this.scale.x,r=-this._sr*this.scale.y,n=this._cr*this.scale.y,i=this.position.x,o=this.position.y,(this.pivot.x||this.pivot.y)&&(i-=this.pivot.x*t+this.pivot.y*r,o-=this.pivot.x*e+this.pivot.y*n),h.a=t*s.a+e*s.c,h.b=t*s.b+e*s.d,h.c=r*s.a+n*s.c,h.d=r*s.b+n*s.d,h.tx=i*s.a+o*s.c+s.tx,h.ty=i*s.b+o*s.d+s.ty):(t=this.scale.x,n=this.scale.y,i=this.position.x-this.pivot.x*t,o=this.position.y-this.pivot.y*n,h.a=t*s.a,h.b=t*s.b,h.c=n*s.c,h.d=n*s.d,h.tx=i*s.a+o*s.c+s.tx,h.ty=i*s.b+o*s.d+s.ty),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._currentBounds=null},n.prototype.displayObjectUpdateTransform=n.prototype.updateTransform,n.prototype.getBounds=function(t){return i.Rectangle.EMPTY},n.prototype.getLocalBounds=function(){return this.getBounds(i.Matrix.IDENTITY)},n.prototype.toGlobal=function(t){return this.displayObjectUpdateTransform(),this.worldTransform.apply(t)},n.prototype.toLocal=function(t,e){return e&&(t=e.toGlobal(t)),this.displayObjectUpdateTransform(),this.worldTransform.applyInverse(t)},n.prototype.renderWebGL=function(t){},n.prototype.renderCanvas=function(t){},n.prototype.generateTexture=function(t,e,r){var n=this.getLocalBounds(),i=new o(t,0|n.width,0|n.height,e,r);return h.tx=-n.x,h.ty=-n.y,i.render(this,h),i},n.prototype.destroy=function(){this.position=null,this.scale=null,this.pivot=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.worldTransform=null,this.filterArea=null}},{"../const":22,"../math":32,"../textures/RenderTexture":70,eventemitter3:11}],25:[function(t,e,r){function n(){i.call(this),this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this._prevTint=16777215,this.blendMode=u.BLEND_MODES.NORMAL,this.currentPath=null,this._webGL={},this.isMask=!1,this.boundsPadding=0,this._localBounds=new l.Rectangle(0,0,1,1),this.dirty=!0,this.glDirty=!1,this.boundsDirty=!0,this.cachedSpriteDirty=!1}var i=t("../display/Container"),o=t("../textures/Texture"),s=t("../renderers/canvas/utils/CanvasBuffer"),a=t("../renderers/canvas/utils/CanvasGraphics"),h=t("./GraphicsData"),l=t("../math"),u=t("../const"),c=new l.Point;n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{}),n.prototype.clone=function(){var t=new n;t.renderable=this.renderable,t.fillAlpha=this.fillAlpha,t.lineWidth=this.lineWidth,t.lineColor=this.lineColor,t.tint=this.tint,t.blendMode=this.blendMode,t.isMask=this.isMask,t.boundsPadding=this.boundsPadding,t.dirty=this.dirty,t.glDirty=this.glDirty,t.cachedSpriteDirty=this.cachedSpriteDirty;for(var e=0;e=c;++c)u=c/s,i=h+(t-h)*u,o=l+(e-l)*u,a.push(i+(t+(r-t)*u-i)*u,o+(e+(n-e)*u-o)*u);return this.dirty=this.boundsDirty=!0,this},n.prototype.bezierCurveTo=function(t,e,r,n,i,o){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var s,a,h,l,u,c=20,f=this.currentPath.shape.points,d=f[f.length-2],p=f[f.length-1],g=0,A=1;c>=A;++A)g=A/c,s=1-g,a=s*s,h=a*s,l=g*g,u=l*g,f.push(h*d+3*a*g*t+3*s*l*r+u*i,h*p+3*a*g*e+3*s*l*n+u*o);return this.dirty=this.boundsDirty=!0,this},n.prototype.arcTo=function(t,e,r,n,i){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var o=this.currentPath.shape.points,s=o[o.length-2],a=o[o.length-1],h=a-e,l=s-t,u=n-e,c=r-t,f=Math.abs(h*c-l*u);if(1e-8>f||0===i)(o[o.length-2]!==t||o[o.length-1]!==e)&&o.push(t,e);else{var d=h*h+l*l,p=u*u+c*c,g=h*u+l*c,A=i*Math.sqrt(d)/f,v=i*Math.sqrt(p)/f,m=A*g/d,y=v*g/p,x=A*c+v*l,w=A*u+v*h,E=l*(v+m),C=h*(v+m),b=c*(A+y),B=u*(A+y),T=Math.atan2(C-w,E-x),D=Math.atan2(B-w,b-x);this.arc(x+t,w+e,i,T,D,l*u>c*h)}return this.dirty=this.boundsDirty=!0,this},n.prototype.arc=function(t,e,r,n,i,o){if(o=o||!1,n===i)return this;!o&&n>=i?i+=2*Math.PI:o&&i>=n&&(n+=2*Math.PI);var s=o?-1*(n-i):i-n,a=40*Math.ceil(Math.abs(s)/(2*Math.PI));if(0===s)return this;var h=t+Math.cos(n)*r,l=e+Math.sin(n)*r;this.currentPath?o&&this.filling?this.currentPath.shape.points.push(t,e):this.currentPath.shape.points.push(h,l):o&&this.filling?this.moveTo(t,e):this.moveTo(h,l);for(var u=this.currentPath.shape.points,c=s/(2*a),f=2*c,d=Math.cos(c),p=Math.sin(c),g=a-1,A=g%1/g,v=0;g>=v;v++){var m=v+A*v,y=c+n+f*m,x=Math.cos(y),w=-Math.sin(y);u.push((d*x+p*w)*r+t,(d*-w+p*x)*r+e)}return this.dirty=this.boundsDirty=!0,this},n.prototype.beginFill=function(t,e){return this.filling=!0,this.fillColor=t||0,this.fillAlpha=void 0===e?1:e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},n.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},n.prototype.drawRect=function(t,e,r,n){return this.drawShape(new l.Rectangle(t,e,r,n)),this},n.prototype.drawRoundedRect=function(t,e,r,n,i){return this.drawShape(new l.RoundedRectangle(t,e,r,n,i)),this},n.prototype.drawCircle=function(t,e,r){return this.drawShape(new l.Circle(t,e,r)),this},n.prototype.drawEllipse=function(t,e,r,n){return this.drawShape(new l.Ellipse(t,e,r,n)),this},n.prototype.drawPolygon=function(t){var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;rA?A:b,b=b>m?m:b,b=b>x?x:b,B=B>v?v:B,B=B>y?y:B,B=B>w?w:B,E=A>E?A:E,E=m>E?m:E,E=x>E?x:E,C=v>C?v:C,C=y>C?y:C,C=w>C?w:C,this._bounds.x=b,this._bounds.width=E-b,this._bounds.y=B,this._bounds.height=C-B,this._currentBounds=this._bounds}return this._currentBounds},n.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,c);for(var e=this.graphicsData,r=0;rs?s:t,e=s+h>e?s+h:e,r=r>a?a:r,n=a+l>n?a+l:n;else if(d===u.SHAPES.CIRC)s=i.x,a=i.y,h=i.radius+p/2,l=i.radius+p/2,t=t>s-h?s-h:t,e=s+h>e?s+h:e,r=r>a-l?a-l:r,n=a+l>n?a+l:n;else if(d===u.SHAPES.ELIP)s=i.x,a=i.y,h=i.width+p/2,l=i.height+p/2,t=t>s-h?s-h:t,e=s+h>e?s+h:e,r=r>a-l?a-l:r,n=a+l>n?a+l:n;else{o=i.points;for(var g=0;gs-p?s-p:t,e=s+p>e?s+p:e,r=r>a-p?a-p:r,n=a+p>n?a+p:n}}else t=0,e=0,r=0,n=0;var A=this.boundsPadding;this._localBounds.x=t-A,this._localBounds.width=e-t+2*A,this._localBounds.y=r-A,this._localBounds.height=n-r+2*A},n.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var e=new h(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,t);return this.graphicsData.push(e),e.type===u.SHAPES.POLY&&(e.shape.closed=e.shape.closed||this.filling,this.currentPath=e),this.dirty=this.boundsDirty=!0,e},n.prototype.destroy=function(){i.prototype.destroy.apply(this,arguments);for(var t=0;t=6)if(a.points.length<2*this.maximumSimplePolySize){o=this.switchMode(r,0);var h=this.buildPoly(a,o);h||(o=this.switchMode(r,1),this.buildComplexPoly(a,o))}else o=this.switchMode(r,1),this.buildComplexPoly(a,o);a.lineWidth>0&&(o=this.switchMode(r,0),this.buildLine(a,o))}else o=this.switchMode(r,0),a.type===s.SHAPES.RECT?this.buildRectangle(a,o):a.type===s.SHAPES.CIRC||a.type===s.SHAPES.ELIP?this.buildCircle(a,o):a.type===s.SHAPES.RREC&&this.buildRoundedRectangle(a,o);r.lastIndex++}for(n=0;n32e4||r.mode!==e||1===e)&&(r=this.graphicsDataPool.pop()||new l(t.gl),r.mode=e,t.data.push(r))):(r=this.graphicsDataPool.pop()||new l(t.gl),r.mode=e,t.data.push(r)),r.dirty=!0,r},n.prototype.buildRectangle=function(t,e){var r=t.shape,n=r.x,o=r.y,s=r.width,a=r.height;if(t.fill){var h=i.hex2rgb(t.fillColor),l=t.fillAlpha,u=h[0]*l,c=h[1]*l,f=h[2]*l,d=e.points,p=e.indices,g=d.length/6;d.push(n,o),d.push(u,c,f,l),d.push(n+s,o),d.push(u,c,f,l),d.push(n,o+a),d.push(u,c,f,l),d.push(n+s,o+a),d.push(u,c,f,l),p.push(g,g,g+1,g+2,g+3,g+3)}if(t.lineWidth){var A=t.points;t.points=[n,o,n+s,o,n+s,o+a,n,o+a,n,o],this.buildLine(t,e),t.points=A}},n.prototype.buildRoundedRectangle=function(t,e){var r=t.shape,n=r.x,o=r.y,s=r.width,a=r.height,h=r.radius,l=[];if(l.push(n,o+h),this.quadraticBezierCurve(n,o+a-h,n,o+a,n+h,o+a,l),this.quadraticBezierCurve(n+s-h,o+a,n+s,o+a,n+s,o+a-h,l),this.quadraticBezierCurve(n+s,o+h,n+s,o,n+s-h,o,l),this.quadraticBezierCurve(n+h,o,n,o,n,o+h+1e-10,l),t.fill){var c=i.hex2rgb(t.fillColor),f=t.fillAlpha,d=c[0]*f,p=c[1]*f,g=c[2]*f,A=e.points,v=e.indices,m=A.length/6,y=u(l,null,2),x=0;for(x=0;x=v;v++)A=v/p,h=a(t,r,A),l=a(e,n,A),u=a(r,i,A),c=a(n,o,A),f=a(h,u,A),d=a(l,c,A),g.push(f,d);return g},n.prototype.buildCircle=function(t,e){var r,n,o=t.shape,a=o.x,h=o.y;t.type===s.SHAPES.CIRC?(r=o.radius,n=o.radius):(r=o.width,n=o.height);var l=40,u=2*Math.PI/l,c=0;if(t.fill){var f=i.hex2rgb(t.fillColor),d=t.fillAlpha,p=f[0]*d,g=f[1]*d,A=f[2]*d,v=e.points,m=e.indices,y=v.length/6;for(m.push(y),c=0;l+1>c;c++)v.push(a,h,p,g,A,d),v.push(a+Math.sin(u*c)*r,h+Math.cos(u*c)*n,p,g,A,d),m.push(y++,y++);m.push(y-1)}if(t.lineWidth){var x=t.points;for(t.points=[],c=0;l+1>c;c++)t.points.push(a+Math.sin(u*c)*r,h+Math.cos(u*c)*n);this.buildLine(t,e),t.points=x}},n.prototype.buildLine=function(t,e){var r=0,n=t.points;if(0!==n.length){if(t.lineWidth%2)for(r=0;rr;r++)f=n[2*(r-1)],d=n[2*(r-1)+1],p=n[2*r],g=n[2*r+1],A=n[2*(r+1)],v=n[2*(r+1)+1],m=-(d-g),y=f-p,S=Math.sqrt(m*m+y*y),m/=S,y/=S,m*=H,y*=H,x=-(g-v),w=p-A,S=Math.sqrt(x*x+w*w),x/=S,w/=S,x*=H,w*=H,b=-y+d-(-y+g),B=-m+p-(-m+f),T=(-m+f)*(-y+g)-(-m+p)*(-y+d),D=-w+v-(-w+g),M=-x+p-(-x+A),P=(-x+A)*(-w+g)-(-x+p)*(-w+v),R=b*M-D*B,Math.abs(R)<.1?(R+=10.1,O.push(p-m,g-y,Y,j,z,G),O.push(p+m,g+y,Y,j,z,G)):(u=(B*P-M*T)/R,c=(D*T-b*P)/R,I=(u-p)*(u-p)+(c-g)+(c-g),I>19600?(E=m-x,C=y-w,S=Math.sqrt(E*E+C*C),E/=S, -C/=S,E*=H,C*=H,O.push(p-E,g-C),O.push(Y,j,z,G),O.push(p+E,g+C),O.push(Y,j,z,G),O.push(p-E,g-C),O.push(Y,j,z,G),L++):(O.push(u,c),O.push(Y,j,z,G),O.push(p-(u-p),g-(c-g)),O.push(Y,j,z,G)));for(f=n[2*(Q-2)],d=n[2*(Q-2)+1],p=n[2*(Q-1)],g=n[2*(Q-1)+1],m=-(d-g),y=f-p,S=Math.sqrt(m*m+y*y),m/=S,y/=S,m*=H,y*=H,O.push(p-m,g-y),O.push(Y,j,z,G),O.push(p+m,g+y),O.push(Y,j,z,G),F.push(N),r=0;L>r;r++)F.push(N++);F.push(N-1)}},n.prototype.buildComplexPoly=function(t,e){var r=t.points.slice();if(!(r.length<6)){var n=e.indices;e.points=r,e.alpha=t.fillAlpha,e.color=i.hex2rgb(t.fillColor);for(var o,s,a=1/0,h=-(1/0),l=1/0,u=-(1/0),c=0;co?o:a,h=o>h?o:h,l=l>s?s:l,u=s>u?s:u;r.push(a,l,h,l,h,u,a,u);var f=r.length/2;for(c=0;f>c;c++)n.push(c)}},n.prototype.buildPoly=function(t,e){var r=t.points;if(!(r.length<6)){var n=e.points,o=e.indices,s=r.length/2,a=i.hex2rgb(t.fillColor),h=t.fillAlpha,l=a[0]*h,c=a[1]*h,f=a[2]*h,d=u(r,null,2);if(!d)return!1;var p=n.length/6,g=0;for(g=0;gg;g++)n.push(r[2*g],r[2*g+1],l,c,f,h);return!0}}},{"../../const":22,"../../math":32,"../../renderers/webgl/WebGLRenderer":48,"../../renderers/webgl/utils/ObjectRenderer":62,"../../utils":76,"./WebGLGraphicsData":28,earcut:10}],28:[function(t,e,r){function n(t){this.gl=t,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0,this.glPoints=null,this.glIndices=null}n.prototype.constructor=n,e.exports=n,n.prototype.reset=function(){this.points.length=0,this.indices.length=0},n.prototype.upload=function(){var t=this.gl;this.glPoints=new Float32Array(this.points),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.bufferData(t.ARRAY_BUFFER,this.glPoints,t.STATIC_DRAW),this.glIndices=new Uint16Array(this.indices),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.glIndices,t.STATIC_DRAW),this.dirty=!1},n.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.gl.deleteBuffer(this.buffer),this.gl.deleteBuffer(this.indexBuffer),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null}},{}],29:[function(t,e,r){var n=e.exports=Object.assign(t("./const"),t("./math"),{utils:t("./utils"),ticker:t("./ticker"),DisplayObject:t("./display/DisplayObject"),Container:t("./display/Container"),Sprite:t("./sprites/Sprite"),ParticleContainer:t("./particles/ParticleContainer"),SpriteRenderer:t("./sprites/webgl/SpriteRenderer"),ParticleRenderer:t("./particles/webgl/ParticleRenderer"),Text:t("./text/Text"),Graphics:t("./graphics/Graphics"),GraphicsData:t("./graphics/GraphicsData"),GraphicsRenderer:t("./graphics/webgl/GraphicsRenderer"),Texture:t("./textures/Texture"),BaseTexture:t("./textures/BaseTexture"),RenderTexture:t("./textures/RenderTexture"),VideoBaseTexture:t("./textures/VideoBaseTexture"),TextureUvs:t("./textures/TextureUvs"),CanvasRenderer:t("./renderers/canvas/CanvasRenderer"),CanvasGraphics:t("./renderers/canvas/utils/CanvasGraphics"),CanvasBuffer:t("./renderers/canvas/utils/CanvasBuffer"),WebGLRenderer:t("./renderers/webgl/WebGLRenderer"),ShaderManager:t("./renderers/webgl/managers/ShaderManager"),Shader:t("./renderers/webgl/shaders/Shader"),ObjectRenderer:t("./renderers/webgl/utils/ObjectRenderer"),RenderTarget:t("./renderers/webgl/utils/RenderTarget"),AbstractFilter:t("./renderers/webgl/filters/AbstractFilter"),FXAAFilter:t("./renderers/webgl/filters/FXAAFilter"),SpriteMaskFilter:t("./renderers/webgl/filters/SpriteMaskFilter"),autoDetectRenderer:function(t,e,r,i){return t=t||800,e=e||600,!i&&n.utils.isWebGLSupported()?new n.WebGLRenderer(t,e,r):new n.CanvasRenderer(t,e,r)}})},{"./const":22,"./display/Container":23,"./display/DisplayObject":24,"./graphics/Graphics":25,"./graphics/GraphicsData":26,"./graphics/webgl/GraphicsRenderer":27,"./math":32,"./particles/ParticleContainer":38,"./particles/webgl/ParticleRenderer":40,"./renderers/canvas/CanvasRenderer":43,"./renderers/canvas/utils/CanvasBuffer":44,"./renderers/canvas/utils/CanvasGraphics":45,"./renderers/webgl/WebGLRenderer":48,"./renderers/webgl/filters/AbstractFilter":49,"./renderers/webgl/filters/FXAAFilter":50,"./renderers/webgl/filters/SpriteMaskFilter":51,"./renderers/webgl/managers/ShaderManager":55,"./renderers/webgl/shaders/Shader":60,"./renderers/webgl/utils/ObjectRenderer":62,"./renderers/webgl/utils/RenderTarget":64,"./sprites/Sprite":66,"./sprites/webgl/SpriteRenderer":67,"./text/Text":68,"./textures/BaseTexture":69,"./textures/RenderTexture":70,"./textures/Texture":71,"./textures/TextureUvs":72,"./textures/VideoBaseTexture":73,"./ticker":75,"./utils":76}],30:[function(t,e,r){function n(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0}var i=t("./Point");n.prototype.constructor=n,e.exports=n,n.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},n.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},n.prototype.apply=function(t,e){e=e||new i;var r=t.x,n=t.y;return e.x=this.a*r+this.c*n+this.tx,e.y=this.b*r+this.d*n+this.ty,e},n.prototype.applyInverse=function(t,e){e=e||new i;var r=1/(this.a*this.d+this.c*-this.b),n=t.x,o=t.y;return e.x=this.d*r*n+-this.c*r*o+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*o+-this.b*r*n+(-this.ty*this.a+this.tx*this.b)*r,e},n.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},n.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},n.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),n=this.a,i=this.c,o=this.tx;return this.a=n*e-this.b*r,this.b=n*r+this.b*e,this.c=i*e-this.d*r,this.d=i*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},n.prototype.append=function(t){var e=this.a,r=this.b,n=this.c,i=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*r+t.b*i,this.c=t.c*e+t.d*n,this.d=t.c*r+t.d*i,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*r+t.ty*i+this.ty,this},n.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,n=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},n.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,n=this.d,i=this.tx,o=t*n-e*r;return this.a=n/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-n*i)/o,this.ty=-(t*this.ty-e*i)/o,this},n.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},n.prototype.clone=function(){var t=new n;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},n.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},n.IDENTITY=new n,n.TEMP_MATRIX=new n},{"./Point":31}],31:[function(t,e,r){function n(t,e){this.x=t||0,this.y=e||0}n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.x,this.y)},n.prototype.copy=function(t){this.set(t.x,t.y)},n.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},n.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)}},{}],32:[function(t,e,r){e.exports={Point:t("./Point"),Matrix:t("./Matrix"),Circle:t("./shapes/Circle"),Ellipse:t("./shapes/Ellipse"),Polygon:t("./shapes/Polygon"),Rectangle:t("./shapes/Rectangle"),RoundedRectangle:t("./shapes/RoundedRectangle")}},{"./Matrix":30,"./Point":31,"./shapes/Circle":33,"./shapes/Ellipse":34,"./shapes/Polygon":35,"./shapes/Rectangle":36,"./shapes/RoundedRectangle":37}],33:[function(t,e,r){function n(t,e,r){this.x=t||0,this.y=e||0,this.radius=r||0,this.type=o.SHAPES.CIRC}var i=t("./Rectangle"),o=t("../../const");n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.x,this.y,this.radius)},n.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.x-t,n=this.y-e,i=this.radius*this.radius;return r*=r,n*=n,i>=r+n},n.prototype.getBounds=function(){return new i(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}},{"../../const":22,"./Rectangle":36}],34:[function(t,e,r){function n(t,e,r,n){this.x=t||0,this.y=e||0,this.width=r||0,this.height=n||0,this.type=o.SHAPES.ELIP}var i=t("./Rectangle"),o=t("../../const");n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.x,this.y,this.width,this.height)},n.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,n=(e-this.y)/this.height;return r*=r,n*=n,1>=r+n},n.prototype.getBounds=function(){return new i(this.x-this.width,this.y-this.height,this.width,this.height)}},{"../../const":22,"./Rectangle":36}],35:[function(t,e,r){function n(t){var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;rs;s++)n.push(e[s].x,e[s].y);e=n}this.closed=!0,this.points=e,this.type=o.SHAPES.POLY}var i=t("../Point"),o=t("../../const");n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.points.slice())},n.prototype.contains=function(t,e){for(var r=!1,n=this.points.length/2,i=0,o=n-1;n>i;o=i++){var s=this.points[2*i],a=this.points[2*i+1],h=this.points[2*o],l=this.points[2*o+1],u=a>e!=l>e&&(h-s)*(e-a)/(l-a)+s>t;u&&(r=!r)}return r}},{"../../const":22,"../Point":31}],36:[function(t,e,r){function n(t,e,r,n){this.x=t||0,this.y=e||0,this.width=r||0,this.height=n||0,this.type=i.SHAPES.RECT}var i=t("../../const");n.prototype.constructor=n,e.exports=n,n.EMPTY=new n(0,0,0,0),n.prototype.clone=function(){return new n(this.x,this.y,this.width,this.height)},n.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&e=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height?!0:!1}},{"../../const":22}],38:[function(t,e,r){function n(t,e){i.call(this),this._properties=[!1,!0,!1,!1,!1],this._size=t||15e3,this._buffers=null,this._updateStatic=!1,this.interactiveChildren=!1,this.blendMode=o.BLEND_MODES.NORMAL,this.roundPixels=!0,this.setProperties(e)}var i=t("../display/Container"),o=t("../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.setProperties=function(t){t&&(this._properties[0]="scale"in t?!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="alpha"in t?!!t.alpha:this._properties[4])},n.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},n.prototype.renderWebGL=function(t){this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(t.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},n.prototype.addChildAt=function(t,e){if(t===this)return t;if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),this._updateStatic=!0,t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},n.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,this.children.splice(t,1),this._updateStatic=!0,e},n.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,n=!0,i=0,o=0,s=0,a=0;e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;hr;r+=6,n+=4)this.indices[r+0]=n+0,this.indices[r+1]=n+1,this.indices[r+2]=n+2,this.indices[r+3]=n+0,this.indices[r+4]=n+2,this.indices[r+5]=n+3;this.shader=null,this.indexBuffer=null,this.properties=null,this.tempMatrix=new h.Matrix}var i=t("../../renderers/webgl/utils/ObjectRenderer"),o=t("../../renderers/webgl/WebGLRenderer"),s=t("./ParticleShader"),a=t("./ParticleBuffer"),h=t("../../math");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,o.registerPlugin("particle",n),n.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=new s(this.renderer.shaderManager),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.properties=[{attribute:this.shader.attributes.aVertexPosition,dynamic:!1,size:2,uploadFunction:this.uploadVertices,offset:0},{attribute:this.shader.attributes.aPositionCoord,dynamic:!0,size:2,uploadFunction:this.uploadPosition,offset:0},{attribute:this.shader.attributes.aRotation,dynamic:!1,size:1,uploadFunction:this.uploadRotation,offset:0},{attribute:this.shader.attributes.aTextureCoord,dynamic:!1,size:2,uploadFunction:this.uploadUvs,offset:0},{attribute:this.shader.attributes.aColor,dynamic:!1,size:1,uploadFunction:this.uploadAlpha,offset:0}]},n.prototype.start=function(){var t=this.renderer.gl;t.activeTexture(t.TEXTURE0),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.shader;this.renderer.shaderManager.setShader(e)},n.prototype.render=function(t){var e=t.children,r=e.length,n=t._size;if(0!==r){r>n&&(r=n),t._buffers||(t._buffers=this.generateBuffers(t)),this.renderer.blendModeManager.setBlendMode(t.blendMode);var i=this.renderer.gl,o=t.worldTransform.copy(this.tempMatrix);o.prepend(this.renderer.currentRenderTarget.projectionMatrix),i.uniformMatrix3fv(this.shader.uniforms.projectionMatrix._location,!1,o.toArray(!0)),i.uniform1f(this.shader.uniforms.uAlpha._location,t.worldAlpha);var s=t._updateStatic,a=e[0]._texture.baseTexture;if(a._glTextures[i.id])i.bindTexture(i.TEXTURE_2D,a._glTextures[i.id]);else{if(!this.renderer.updateTexture(a))return;this.properties[0].dynamic&&this.properties[3].dynamic||(s=!0)}for(var h=0,l=0;r>l;l+=this.size){var u=r-l;u>this.size&&(u=this.size);var c=t._buffers[h++];c.uploadDynamic(e,l,u),s&&c.uploadStatic(e,l,u),c.bind(this.shader),i.drawElements(i.TRIANGLES,6*u,i.UNSIGNED_SHORT,0),this.renderer.drawCount++}t._updateStatic=!1}},n.prototype.generateBuffers=function(t){var e,r=this.renderer.gl,n=[],i=t._size;for(e=0;ee;e+=this.size)n.push(new a(r,this.properties,this.size,this.shader));return n},n.prototype.uploadVertices=function(t,e,r,n,i,o){for(var s,a,h,l,u,c,f,d,p,g=0;r>g;g++)s=t[e+g],a=s._texture,l=s.scale.x,u=s.scale.y,a.trim?(h=a.trim,f=h.x-s.anchor.x*h.width,c=f+a.crop.width,p=h.y-s.anchor.y*h.height,d=p+a.crop.height):(c=a._frame.width*(1-s.anchor.x),f=a._frame.width*-s.anchor.x,d=a._frame.height*(1-s.anchor.y),p=a._frame.height*-s.anchor.y),n[o]=f*l,n[o+1]=p*u,n[o+i]=c*l,n[o+i+1]=p*u,n[o+2*i]=c*l,n[o+2*i+1]=d*u,n[o+3*i]=f*l,n[o+3*i+1]=d*u,o+=4*i},n.prototype.uploadPosition=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s].position;n[o]=a.x,n[o+1]=a.y,n[o+i]=a.x,n[o+i+1]=a.y,n[o+2*i]=a.x,n[o+2*i+1]=a.y,n[o+3*i]=a.x,n[o+3*i+1]=a.y,o+=4*i}},n.prototype.uploadRotation=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s].rotation;n[o]=a,n[o+i]=a,n[o+2*i]=a,n[o+3*i]=a,o+=4*i}},n.prototype.uploadUvs=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s]._texture._uvs;a?(n[o]=a.x0,n[o+1]=a.y0,n[o+i]=a.x1,n[o+i+1]=a.y1,n[o+2*i]=a.x2,n[o+2*i+1]=a.y2,n[o+3*i]=a.x3,n[o+3*i+1]=a.y3,o+=4*i):(n[o]=0,n[o+1]=0,n[o+i]=0,n[o+i+1]=0,n[o+2*i]=0,n[o+2*i+1]=0,n[o+3*i]=0,n[o+3*i+1]=0,o+=4*i)}},n.prototype.uploadAlpha=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s].alpha;n[o]=a,n[o+i]=a,n[o+2*i]=a,n[o+3*i]=a,o+=4*i}},n.prototype.destroy=function(){this.renderer.gl&&this.renderer.gl.deleteBuffer(this.indexBuffer),i.prototype.destroy.apply(this,arguments),this.shader.destroy(),this.indices=null,this.tempMatrix=null}},{"../../math":32,"../../renderers/webgl/WebGLRenderer":48,"../../renderers/webgl/utils/ObjectRenderer":62,"./ParticleBuffer":39,"./ParticleShader":41}],41:[function(t,e,r){function n(t){i.call(this,t,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void){"," vec2 v = aVertexPosition;"," v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);"," v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);"," v = v + aPositionCoord;"," gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","uniform float uAlpha;","void main(void){"," vec4 color = texture2D(uSampler, vTextureCoord) * vColor * uAlpha;"," if (color.a == 0.0) discard;"," gl_FragColor = color;","}"].join("\n"),{uAlpha:{type:"1f",value:1}},{aPositionCoord:0,aRotation:0})}var i=t("../../renderers/webgl/shaders/TextureShader");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n},{"../../renderers/webgl/shaders/TextureShader":61}],42:[function(t,e,r){function n(t,e,r,n){if(a.call(this),i.sayHello(t),n)for(var h in s.DEFAULT_RENDER_OPTIONS)"undefined"==typeof n[h]&&(n[h]=s.DEFAULT_RENDER_OPTIONS[h]);else n=s.DEFAULT_RENDER_OPTIONS;this.type=s.RENDERER_TYPE.UNKNOWN,this.width=e||800,this.height=r||600,this.view=n.view||document.createElement("canvas"),this.resolution=n.resolution,this.transparent=n.transparent,this.autoResize=n.autoResize||!1,this.blendModes=null,this.preserveDrawingBuffer=n.preserveDrawingBuffer,this.clearBeforeRender=n.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgb=[0,0,0],this._backgroundColorString="#000000",this.backgroundColor=n.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent={worldTransform:new o.Matrix,worldAlpha:1,children:[]},this._lastObjectRendered=this._tempDisplayObjectParent}var i=t("../utils"),o=t("../math"),s=t("../const"),a=t("eventemitter3");n.prototype=Object.create(a.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{backgroundColor:{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=i.hex2string(t),i.hex2rgb(t,this._backgroundColorRgb)}}}),n.prototype.resize=function(t,e){this.width=t*this.resolution,this.height=e*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px")},n.prototype.destroy=function(t){t&&this.view.parent&&this.view.parent.removeChild(this.view),this.type=s.RENDERER_TYPE.UNKNOWN,this.width=0,this.height=0,this.view=null,this.resolution=0,this.transparent=!1,this.autoResize=!1,this.blendModes=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgb=null,this._backgroundColorString=null}},{"../const":22,"../math":32,"../utils":76,eventemitter3:11}],43:[function(t,e,r){function n(t,e,r){i.call(this,"Canvas",t,e,r),this.type=h.RENDERER_TYPE.CANVAS,this.context=this.view.getContext("2d",{alpha:this.transparent}),this.refresh=!0,this.maskManager=new o,this.roundPixels=!1,this.currentScaleMode=h.SCALE_MODES.DEFAULT,this.currentBlendMode=h.BLEND_MODES.NORMAL,this.smoothProperty="imageSmoothingEnabled",this.context.imageSmoothingEnabled||(this.context.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.context.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.context.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.context.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(),this._mapBlendModes(),this._tempDisplayObjectParent={worldTransform:new a.Matrix,worldAlpha:1},this.resize(t,e)}var i=t("../SystemRenderer"),o=t("./utils/CanvasMaskManager"),s=t("../../utils"),a=t("../../math"),h=t("../../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,s.pluginTarget.mixin(n),n.prototype.render=function(t){var e=t.parent;this._lastObjectRendered=t,t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=e,this.context.setTransform(1,0,0,1,0,0),this.context.globalAlpha=1,this.currentBlendMode=h.BLEND_MODES.NORMAL,this.context.globalCompositeOperation=this.blendModes[h.BLEND_MODES.NORMAL],navigator.isCocoonJS&&this.view.screencanvas&&(this.context.fillStyle="black",this.context.clear()),this.clearBeforeRender&&(this.transparent?this.context.clearRect(0,0,this.width,this.height):(this.context.fillStyle=this._backgroundColorString,this.context.fillRect(0,0,this.width,this.height))),this.renderDisplayObject(t,this.context)},n.prototype.destroy=function(t){this.destroyPlugins(),i.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.roundPixels=!1,this.currentScaleMode=0,this.currentBlendMode=0,this.smoothProperty=null},n.prototype.renderDisplayObject=function(t,e){var r=this.context;this.context=e,t.renderCanvas(this),this.context=r},n.prototype.resize=function(t,e){i.prototype.resize.call(this,t,e),this.currentScaleMode=h.SCALE_MODES.DEFAULT,this.smoothProperty&&(this.context[this.smoothProperty]=this.currentScaleMode===h.SCALE_MODES.LINEAR)},n.prototype._mapBlendModes=function(){this.blendModes||(this.blendModes={},s.canUseNewCanvasBlendModes()?(this.blendModes[h.BLEND_MODES.NORMAL]="source-over",this.blendModes[h.BLEND_MODES.ADD]="lighter",this.blendModes[h.BLEND_MODES.MULTIPLY]="multiply",this.blendModes[h.BLEND_MODES.SCREEN]="screen",this.blendModes[h.BLEND_MODES.OVERLAY]="overlay",this.blendModes[h.BLEND_MODES.DARKEN]="darken",this.blendModes[h.BLEND_MODES.LIGHTEN]="lighten",this.blendModes[h.BLEND_MODES.COLOR_DODGE]="color-dodge",this.blendModes[h.BLEND_MODES.COLOR_BURN]="color-burn",this.blendModes[h.BLEND_MODES.HARD_LIGHT]="hard-light",this.blendModes[h.BLEND_MODES.SOFT_LIGHT]="soft-light",this.blendModes[h.BLEND_MODES.DIFFERENCE]="difference",this.blendModes[h.BLEND_MODES.EXCLUSION]="exclusion",this.blendModes[h.BLEND_MODES.HUE]="hue",this.blendModes[h.BLEND_MODES.SATURATION]="saturate",this.blendModes[h.BLEND_MODES.COLOR]="color",this.blendModes[h.BLEND_MODES.LUMINOSITY]="luminosity"):(this.blendModes[h.BLEND_MODES.NORMAL]="source-over",this.blendModes[h.BLEND_MODES.ADD]="lighter",this.blendModes[h.BLEND_MODES.MULTIPLY]="source-over",this.blendModes[h.BLEND_MODES.SCREEN]="source-over",this.blendModes[h.BLEND_MODES.OVERLAY]="source-over",this.blendModes[h.BLEND_MODES.DARKEN]="source-over",this.blendModes[h.BLEND_MODES.LIGHTEN]="source-over",this.blendModes[h.BLEND_MODES.COLOR_DODGE]="source-over",this.blendModes[h.BLEND_MODES.COLOR_BURN]="source-over",this.blendModes[h.BLEND_MODES.HARD_LIGHT]="source-over",this.blendModes[h.BLEND_MODES.SOFT_LIGHT]="source-over",this.blendModes[h.BLEND_MODES.DIFFERENCE]="source-over",this.blendModes[h.BLEND_MODES.EXCLUSION]="source-over",this.blendModes[h.BLEND_MODES.HUE]="source-over",this.blendModes[h.BLEND_MODES.SATURATION]="source-over",this.blendModes[h.BLEND_MODES.COLOR]="source-over",this.blendModes[h.BLEND_MODES.LUMINOSITY]="source-over"))}},{"../../const":22,"../../math":32,"../../utils":76,"../SystemRenderer":42,"./utils/CanvasMaskManager":46}],44:[function(t,e,r){function n(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=t,this.canvas.height=e}n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{width:{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t}},height:{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t}}}),n.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},n.prototype.resize=function(t,e){this.canvas.width=t,this.canvas.height=e},n.prototype.destroy=function(){this.context=null,this.canvas=null}},{}],45:[function(t,e,r){var n=t("../../../const"),i={};e.exports=i,i.renderGraphics=function(t,e){var r=t.worldAlpha;t.dirty&&(this.updateGraphicsTint(t),t.dirty=!1);for(var i=0;iD?D:T,e.beginPath(),e.moveTo(E,C+T),e.lineTo(E,C+B-T),e.quadraticCurveTo(E,C+B,E+T,C+B),e.lineTo(E+b-T,C+B),e.quadraticCurveTo(E+b,C+B,E+b,C+B-T),e.lineTo(E+b,C+T),e.quadraticCurveTo(E+b,C,E+b-T,C),e.lineTo(E+T,C),e.quadraticCurveTo(E,C,E,C+T),e.closePath(),(o.fillColor||0===o.fillColor)&&(e.globalAlpha=o.fillAlpha*r,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fill()),o.lineWidth&&(e.globalAlpha=o.lineAlpha*r,e.strokeStyle="#"+("00000"+(0|h).toString(16)).substr(-6),e.stroke())}}},i.renderGraphicsMask=function(t,e){var r=t.graphicsData.length;if(0!==r){e.beginPath();for(var i=0;r>i;i++){var o=t.graphicsData[i],s=o.shape;if(o.type===n.SHAPES.POLY){var a=s.points;e.moveTo(a[0],a[1]);for(var h=1;hB?B:b,e.moveTo(x,w+b),e.lineTo(x,w+C-b),e.quadraticCurveTo(x,w+C,x+b,w+C),e.lineTo(x+E-b,w+C),e.quadraticCurveTo(x+E,w+C,x+E,w+C-b),e.lineTo(x+E,w+b),e.quadraticCurveTo(x+E,w,x+E-b,w),e.lineTo(x+b,w),e.quadraticCurveTo(x,w,x,w+b), -e.closePath()}}}},i.updateGraphicsTint=function(t){if(16777215!==t.tint)for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,n=(255&t.tint)/255,i=0;i>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*n*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*n*255}}},{"../../../const":22}],46:[function(t,e,r){function n(){}var i=t("./CanvasGraphics");n.prototype.constructor=n,e.exports=n,n.prototype.pushMask=function(t,e){e.context.save();var r=t.alpha,n=t.worldTransform,o=e.resolution;e.context.setTransform(n.a*o,n.b*o,n.c*o,n.d*o,n.tx*o,n.ty*o),t.texture||(i.renderGraphicsMask(t,e.context),e.context.clip()),t.worldAlpha=r},n.prototype.popMask=function(t){t.context.restore()},n.prototype.destroy=function(){}},{"./CanvasGraphics":45}],47:[function(t,e,r){var n=t("../../../utils"),i={};e.exports=i,i.getTintedTexture=function(t,e){var r=t.texture;e=i.roundColor(e);var n="#"+("00000"+(0|e).toString(16)).substr(-6);if(r.tintCache=r.tintCache||{},r.tintCache[n])return r.tintCache[n];var o=i.canvas||document.createElement("canvas");if(i.tintMethod(r,e,o),i.convertTintToImage){var s=new Image;s.src=o.toDataURL(),r.tintCache[n]=s}else r.tintCache[n]=o,i.canvas=null;return o},i.tintWithMultiply=function(t,e,r){var n=r.getContext("2d"),i=t.crop;r.width=i.width,r.height=i.height,n.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),n.fillRect(0,0,i.width,i.height),n.globalCompositeOperation="multiply",n.drawImage(t.baseTexture.source,i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.globalCompositeOperation="destination-atop",n.drawImage(t.baseTexture.source,i.x,i.y,i.width,i.height,0,0,i.width,i.height)},i.tintWithOverlay=function(t,e,r){var n=r.getContext("2d"),i=t.crop;r.width=i.width,r.height=i.height,n.globalCompositeOperation="copy",n.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),n.fillRect(0,0,i.width,i.height),n.globalCompositeOperation="destination-atop",n.drawImage(t.baseTexture.source,i.x,i.y,i.width,i.height,0,0,i.width,i.height)},i.tintWithPerPixel=function(t,e,r){var i=r.getContext("2d"),o=t.crop;r.width=o.width,r.height=o.height,i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.source,o.x,o.y,o.width,o.height,0,0,o.width,o.height);for(var s=n.hex2rgb(e),a=s[0],h=s[1],l=s[2],u=i.getImageData(0,0,o.width,o.height),c=u.data,f=0;fe;++e)this.shaders[e].syncUniform(t)}},{"../shaders/TextureShader":61}],50:[function(t,e,r){function n(){i.call(this,"\nprecision mediump float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform vec2 resolution;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\n\nvoid texcoords(vec2 fragCoord, vec2 resolution,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n vec2 inverseVP = 1.0 / resolution.xy;\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 gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n vResolution = resolution;\n\n //compute the texture coords and send them to varyings\n texcoords(aTextureCoord * resolution, resolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'precision lowp float;\n\n\n/**\nBasic FXAA implementation based on the code on geeks3d.com with the\nmodification that the texture2DLod stuff was removed since it\'s\nunsupported by WebGL.\n\n--\n\nFrom:\nhttps://github.com/mitsuhiko/webgl-meincraft\n\nCopyright (c) 2011 by Armin Ronacher.\n\nSome rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\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\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF 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 resolution,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);\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\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nuniform sampler2D uSampler;\n\n\nvoid main(void){\n\n gl_FragColor = fxaa(uSampler, vTextureCoord * vResolution, vResolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n}\n',{resolution:{type:"v2",value:{x:1,y:1}}})}var i=t("./AbstractFilter");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager,i=this.getShader(t);n.applyFilter(i,e,r)}},{"./AbstractFilter":49}],51:[function(t,e,r){function n(t){var e=new o.Matrix;i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform sampler2D mask;\n\nvoid main(void)\n{\n // check clip! this will stop the mask bleeding out from the edges\n vec2 text = abs( vMaskCoord - 0.5 );\n text = step(0.5, text);\n float clip = 1.0 - max(text.y, text.x);\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n original *= (masky.r * masky.a * alpha * clip);\n gl_FragColor = original;\n}\n",{mask:{type:"sampler2D",value:t._texture},alpha:{type:"f",value:1},otherMatrix:{type:"mat3",value:e.toArray(!0)}}),this.maskSprite=t,this.maskMatrix=e}var i=t("./AbstractFilter"),o=t("../../../math");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager;this.uniforms.mask.value=this.maskSprite._texture,n.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.alpha.value=this.maskSprite.worldAlpha;var i=this.getShader(t);n.applyFilter(i,e,r)},Object.defineProperties(n.prototype,{map:{get:function(){return this.uniforms.mask.value},set:function(t){this.uniforms.mask.value=t}},offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}}})},{"../../../math":32,"./AbstractFilter":49}],52:[function(t,e,r){function n(t){i.call(this,t),this.currentBlendMode=99999}var i=t("./WebGLManager");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.setBlendMode=function(t){if(this.currentBlendMode===t)return!1;this.currentBlendMode=t;var e=this.renderer.blendModes[this.currentBlendMode];return this.renderer.gl.blendFunc(e[0],e[1]),!0}},{"./WebGLManager":57}],53:[function(t,e,r){function n(t){i.call(this,t),this.filterStack=[],this.filterStack.push({renderTarget:t.currentRenderTarget,filter:[],bounds:null}),this.texturePool=[],this.textureSize=new h.Rectangle(0,0,t.width,t.height),this.currentFrame=null}var i=t("./WebGLManager"),o=t("../utils/RenderTarget"),s=t("../../../const"),a=t("../utils/Quad"),h=t("../../../math");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.onContextChange=function(){this.texturePool.length=0;var t=this.renderer.gl;this.quad=new a(t)},n.prototype.setFilterStack=function(t){this.filterStack=t},n.prototype.pushFilter=function(t,e){var r=t.filterArea?t.filterArea.clone():t.getBounds();r.x=0|r.x,r.y=0|r.y,r.width=0|r.width,r.height=0|r.height;var n=0|e[0].padding;if(r.x-=n,r.y-=n,r.width+=2*n,r.height+=2*n,this.renderer.currentRenderTarget.transform){var i=this.renderer.currentRenderTarget.transform;r.x+=i.tx,r.y+=i.ty,this.capFilterArea(r),r.x-=i.tx,r.y-=i.ty}else this.capFilterArea(r);if(r.width>0&&r.height>0){this.currentFrame=r;var o=this.getRenderTarget();this.renderer.setRenderTarget(o),o.clear(),this.filterStack.push({renderTarget:o,filter:e})}else this.filterStack.push({renderTarget:null,filter:e})},n.prototype.popFilter=function(){var t=this.filterStack.pop(),e=this.filterStack[this.filterStack.length-1],r=t.renderTarget;if(t.renderTarget){var n=e.renderTarget,i=this.renderer.gl;this.currentFrame=r.frame,this.quad.map(this.textureSize,r.frame),i.bindBuffer(i.ARRAY_BUFFER,this.quad.vertexBuffer),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,this.quad.indexBuffer);var o=t.filter;if(i.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aVertexPosition,2,i.FLOAT,!1,0,0),i.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aTextureCoord,2,i.FLOAT,!1,0,32),i.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aColor,4,i.FLOAT,!1,0,64),this.renderer.blendModeManager.setBlendMode(s.BLEND_MODES.NORMAL),1===o.length)o[0].uniforms.dimensions&&(o[0].uniforms.dimensions.value[0]=this.renderer.width,o[0].uniforms.dimensions.value[1]=this.renderer.height,o[0].uniforms.dimensions.value[2]=this.quad.vertices[0],o[0].uniforms.dimensions.value[3]=this.quad.vertices[5]),o[0].applyFilter(this.renderer,r,n),this.returnRenderTarget(r);else{for(var a=r,h=this.getRenderTarget(!0),l=0;lthis.textureSize.width&&(t.width=this.textureSize.width-t.x),t.y+t.height>this.textureSize.height&&(t.height=this.textureSize.height-t.y)},n.prototype.resize=function(t,e){this.textureSize.width=t,this.textureSize.height=e;for(var r=0;re;++e)t._array[2*e]=o[e].x,t._array[2*e+1]=o[e].y;s.uniform2fv(n,t._array);break;case"v3v":for(t._array||(t._array=new Float32Array(3*o.length)),e=0,r=o.length;r>e;++e)t._array[3*e]=o[e].x,t._array[3*e+1]=o[e].y,t._array[3*e+2]=o[e].z;s.uniform3fv(n,t._array);break;case"v4v":for(t._array||(t._array=new Float32Array(4*o.length)),e=0,r=o.length;r>e;++e)t._array[4*e]=o[e].x,t._array[4*e+1]=o[e].y,t._array[4*e+2]=o[e].z,t._array[4*e+3]=o[e].w;s.uniform4fv(n,t._array);break;case"t":case"sampler2D":if(!t.value||!t.value.baseTexture.hasLoaded)break;s.activeTexture(s["TEXTURE"+this.textureCount]);var a=t.value.baseTexture._glTextures[s.id];a||(this.initSampler2D(t),a=t.value.baseTexture._glTextures[s.id]),s.bindTexture(s.TEXTURE_2D,a),s.uniform1i(t._location,this.textureCount),this.textureCount++;break;default:console.warn("Pixi.js Shader Warning: Unknown uniform type: "+t.type)}},n.prototype.syncUniforms=function(){this.textureCount=1;for(var t in this.uniforms)this.syncUniform(this.uniforms[t])},n.prototype.initSampler2D=function(t){var e=this.gl,r=t.value.baseTexture;if(r.hasLoaded)if(t.textureData){var n=t.textureData;r._glTextures[e.id]=e.createTexture(),e.bindTexture(e.TEXTURE_2D,r._glTextures[e.id]),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultipliedAlpha),e.texImage2D(e.TEXTURE_2D,0,n.luminance?e.LUMINANCE:e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n.magFilter?n.magFilter:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n.wrapS?n.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,n.wrapS?n.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,n.wrapT?n.wrapT:e.CLAMP_TO_EDGE)}else this.shaderManager.renderer.updateTexture(r)},n.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.gl=null,this.uniforms=null,this.attributes=null,this.vertexSrc=null,this.fragmentSrc=null},n.prototype._glCompile=function(t,e){var r=this.gl.createShader(t);return this.gl.shaderSource(r,e),this.gl.compileShader(r),this.gl.getShaderParameter(r,this.gl.COMPILE_STATUS)?r:(console.log(this.gl.getShaderInfoLog(r)),null)}},{"../../../utils":76}],61:[function(t,e,r){function n(t,e,r,o,s){var a={uSampler:{type:"sampler2D",value:0},projectionMatrix:{type:"mat3",value:new Float32Array([1,0,0,0,1,0,0,0,1])}};if(o)for(var h in o)a[h]=o[h];var l={aVertexPosition:0,aTextureCoord:0,aColor:0};if(s)for(var u in s)l[u]=s[u];e=e||n.defaultVertexSrc,r=r||n.defaultFragmentSrc,i.call(this,t,e,r,a,l)}var i=t("./Shader");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.defaultVertexSrc=["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"].join("\n"),n.defaultFragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"].join("\n")},{"./Shader":60}],62:[function(t,e,r){function n(t){i.call(this,t)}var i=t("../managers/WebGLManager");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.start=function(){},n.prototype.stop=function(){this.flush()},n.prototype.flush=function(){},n.prototype.render=function(t){}},{"../managers/WebGLManager":57}],63:[function(t,e,r){function n(t){this.gl=t,this.vertices=new Float32Array([0,0,200,0,200,200,0,200]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.colors=new Float32Array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]),this.indices=new Uint16Array([0,1,2,0,3,2]),this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,128,t.DYNAMIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.upload()}n.prototype.constructor=n,n.prototype.map=function(t,e){var r=0,n=0;this.uvs[0]=r,this.uvs[1]=n,this.uvs[2]=r+e.width/t.width,this.uvs[3]=n,this.uvs[4]=r+e.width/t.width,this.uvs[5]=n+e.height/t.height,this.uvs[6]=r,this.uvs[7]=n+e.height/t.height,r=e.x,n=e.y,this.vertices[0]=r,this.vertices[1]=n,this.vertices[2]=r+e.width,this.vertices[3]=n,this.vertices[4]=r+e.width,this.vertices[5]=n+e.height,this.vertices[6]=r,this.vertices[7]=n+e.height,this.upload()},n.prototype.upload=function(){var t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferSubData(t.ARRAY_BUFFER,0,this.vertices),t.bufferSubData(t.ARRAY_BUFFER,32,this.uvs),t.bufferSubData(t.ARRAY_BUFFER,64,this.colors)},e.exports=n},{}],64:[function(t,e,r){var n=t("../../../math"),i=t("../../../utils"),o=t("../../../const"),s=t("./StencilMaskStack"),a=function(t,e,r,a,h,l){if(this.gl=t,this.frameBuffer=null,this.texture=null,this.size=new n.Rectangle(0,0,1,1),this.resolution=h||o.RESOLUTION,this.projectionMatrix=new n.Matrix,this.transform=null,this.frame=null,this.stencilBuffer=null,this.stencilMaskStack=new s,this.filterStack=[{renderTarget:this,filter:[],bounds:this.size}],this.scaleMode=a||o.SCALE_MODES.DEFAULT,this.root=l,!this.root){this.frameBuffer=t.createFramebuffer(),this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,a===o.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,a===o.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST);var u=i.isPowerOfTwo(e,r);u?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0)}this.resize(e,r)};a.prototype.constructor=a,e.exports=a,a.prototype.clear=function(t){var e=this.gl;t&&e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},a.prototype.attachStencilBuffer=function(){if(!this.stencilBuffer&&!this.root){var t=this.gl;this.stencilBuffer=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.stencilBuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,this.stencilBuffer),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.size.width*this.resolution,this.size.height*this.resolution)}},a.prototype.activate=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer);var e=this.frame||this.size;this.calculateProjection(e),this.transform&&this.projectionMatrix.append(this.transform),t.viewport(0,0,e.width*this.resolution,e.height*this.resolution)},a.prototype.calculateProjection=function(t){var e=this.projectionMatrix;e.identity(),this.root?(e.a=1/t.width*2,e.d=-1/t.height*2,e.tx=-1-t.x*e.a,e.ty=1-t.y*e.d):(e.a=1/t.width*2,e.d=1/t.height*2,e.tx=-1-t.x*e.a,e.ty=-1-t.y*e.d)},a.prototype.resize=function(t,e){if(t=0|t,e=0|e,this.size.width!==t||this.size.height!==e){if(this.size.width=t,this.size.height=e,!this.root){var r=this.gl;r.bindTexture(r.TEXTURE_2D,this.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,t*this.resolution,e*this.resolution,0,r.RGBA,r.UNSIGNED_BYTE,null),this.stencilBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencilBuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t*this.resolution,e*this.resolution))}var n=this.frame||this.size;this.calculateProjection(n)}},a.prototype.destroy=function(){var t=this.gl;t.deleteFramebuffer(this.frameBuffer),t.deleteTexture(this.texture),this.frameBuffer=null,this.texture=null}},{"../../../const":22,"../../../math":32,"../../../utils":76,"./StencilMaskStack":65}],65:[function(t,e,r){function n(){this.stencilStack=[],this.reverse=!0,this.count=0}n.prototype.constructor=n,e.exports=n},{}],66:[function(t,e,r){function n(t){s.call(this),this.anchor=new i.Point,this._texture=null,this._width=0,this._height=0,this.tint=16777215,this.blendMode=l.BLEND_MODES.NORMAL,this.shader=null,this.cachedTint=16777215,this.texture=t||o.EMPTY}var i=t("../math"),o=t("../textures/Texture"),s=t("../display/Container"),a=t("../renderers/canvas/utils/CanvasTinter"),h=t("../utils"),l=t("../const"),u=new i.Point;n.prototype=Object.create(s.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{width:{get:function(){return this.scale.x*this.texture._frame.width},set:function(t){this.scale.x=t/this.texture._frame.width,this._width=t}},height:{get:function(){return this.scale.y*this.texture._frame.height},set:function(t){this.scale.y=t/this.texture._frame.height,this._height=t}},texture:{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t,this.cachedTint=16777215,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}}),n.prototype._onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height)},n.prototype._renderWebGL=function(t){t.setObjectRenderer(t.plugins.sprite),t.plugins.sprite.render(this)},n.prototype.getBounds=function(t){if(!this._currentBounds){var e,r,n,i,o=this._texture._frame.width,s=this._texture._frame.height,a=o*(1-this.anchor.x),h=o*-this.anchor.x,l=s*(1-this.anchor.y),u=s*-this.anchor.y,c=t||this.worldTransform,f=c.a,d=c.b,p=c.c,g=c.d,A=c.tx,v=c.ty;if(0===d&&0===p)0>f&&(f*=-1),0>g&&(g*=-1),e=f*h+A,r=f*a+A,n=g*u+v,i=g*l+v;else{var m=f*h+p*u+A,y=g*u+d*h+v,x=f*a+p*u+A,w=g*u+d*a+v,E=f*a+p*l+A,C=g*l+d*a+v,b=f*h+p*l+A,B=g*l+d*h+v;e=m,e=e>x?x:e,e=e>E?E:e,e=e>b?b:e,n=y,n=n>w?w:n,n=n>C?C:n,n=n>B?B:n,r=m,r=x>r?x:r,r=E>r?E:r,r=b>r?b:r,i=y,i=w>i?w:i,i=C>i?C:i,i=B>i?B:i}if(this.children.length){var T=this.containerGetBounds();a=T.x,h=T.x+T.width,l=T.y,u=T.y+T.height,e=a>e?e:a,n=l>n?n:l,r=r>h?r:h,i=i>u?i:u}var D=this._bounds;D.x=e,D.width=r-e,D.y=n,D.height=i-n,this._currentBounds=D}return this._currentBounds},n.prototype.getLocalBounds=function(){return this._bounds.x=-this._texture._frame.width*this.anchor.x,this._bounds.y=-this._texture._frame.height*this.anchor.y,this._bounds.width=this._texture._frame.width,this._bounds.height=this._texture._frame.height,this._bounds},n.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,u);var e,r=this._texture._frame.width,n=this._texture._frame.height,i=-r*this.anchor.x;return u.x>i&&u.xe&&u.yn;n+=6,o+=4)this.indices[n+0]=o+0,this.indices[n+1]=o+1,this.indices[n+2]=o+2,this.indices[n+3]=o+0,this.indices[n+4]=o+2,this.indices[n+5]=o+3;this.currentBatchSize=0,this.sprites=[],this.shader=null}var i=t("../../renderers/webgl/utils/ObjectRenderer"),o=t("../../renderers/webgl/WebGLRenderer"),s=t("../../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,o.registerPlugin("sprite",n),n.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=this.renderer.shaderManager.defaultShader,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices,t.DYNAMIC_DRAW),this.currentBlendMode=99999},n.prototype.render=function(t){var e=t._texture;this.currentBatchSize>=this.size&&this.flush();var r=e._uvs;if(r){var n,i,o,s,a=t.anchor.x,h=t.anchor.y;if(e.trim){var l=e.trim;i=l.x-a*l.width,n=i+e.crop.width,s=l.y-h*l.height,o=s+e.crop.height}else n=e._frame.width*(1-a),i=e._frame.width*-a,o=e._frame.height*(1-h),s=e._frame.height*-h;var u=this.currentBatchSize*this.vertByteSize,c=t.worldTransform,f=c.a,d=c.b,p=c.c,g=c.d,A=c.tx,v=c.ty,m=this.colors,y=this.positions;this.renderer.roundPixels?(y[u]=f*i+p*s+A|0,y[u+1]=g*s+d*i+v|0,y[u+5]=f*n+p*s+A|0,y[u+6]=g*s+d*n+v|0,y[u+10]=f*n+p*o+A|0,y[u+11]=g*o+d*n+v|0,y[u+15]=f*i+p*o+A|0,y[u+16]=g*o+d*i+v|0):(y[u]=f*i+p*s+A,y[u+1]=g*s+d*i+v,y[u+5]=f*n+p*s+A,y[u+6]=g*s+d*n+v,y[u+10]=f*n+p*o+A,y[u+11]=g*o+d*n+v,y[u+15]=f*i+p*o+A,y[u+16]=g*o+d*i+v),y[u+2]=r.x0,y[u+3]=r.y0,y[u+7]=r.x1,y[u+8]=r.y1,y[u+12]=r.x2,y[u+13]=r.y2,y[u+17]=r.x3,y[u+18]=r.y3;var x=t.tint;m[u+4]=m[u+9]=m[u+14]=m[u+19]=(x>>16)+(65280&x)+((255&x)<<16)+(255*t.worldAlpha<<24),this.sprites[this.currentBatchSize++]=t}},n.prototype.flush=function(){if(0!==this.currentBatchSize){var t,e=this.renderer.gl;if(this.currentBatchSize>.5*this.size)e.bufferSubData(e.ARRAY_BUFFER,0,this.vertices);else{var r=this.positions.subarray(0,this.currentBatchSize*this.vertByteSize);e.bufferSubData(e.ARRAY_BUFFER,0,r)}for(var n,i,o,s,a=0,h=0,l=null,u=this.renderer.blendModeManager.currentBlendMode,c=null,f=!1,d=!1,p=0,g=this.currentBatchSize;g>p;p++)s=this.sprites[p],n=s._texture.baseTexture,i=s.blendMode,o=s.shader||this.shader,f=u!==i,d=c!==o,(l!==n||f||d)&&(this.renderBatch(l,a,h),h=p,a=0,l=n,f&&(u=i,this.renderer.blendModeManager.setBlendMode(u)),d&&(c=o,t=c.shaders?c.shaders[e.id]:c,t||(t=c.getShader(this.renderer)),this.renderer.shaderManager.setShader(t),t.uniforms.projectionMatrix.value=this.renderer.currentRenderTarget.projectionMatrix.toArray(!0),t.syncUniforms(),e.activeTexture(e.TEXTURE0))),a++;this.renderBatch(l,a,h),this.currentBatchSize=0}},n.prototype.renderBatch=function(t,e,r){if(0!==e){var n=this.renderer.gl;t._glTextures[n.id]?n.bindTexture(n.TEXTURE_2D,t._glTextures[n.id]):this.renderer.updateTexture(t),n.drawElements(n.TRIANGLES,6*e,n.UNSIGNED_SHORT,6*r*2),this.renderer.drawCount++}},n.prototype.start=function(){var t=this.renderer.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.vertByteSize;t.vertexAttribPointer(this.shader.attributes.aVertexPosition,2,t.FLOAT,!1,e,0),t.vertexAttribPointer(this.shader.attributes.aTextureCoord,2,t.FLOAT,!1,e,8),t.vertexAttribPointer(this.shader.attributes.aColor,4,t.UNSIGNED_BYTE,!0,e,16)},n.prototype.destroy=function(){this.renderer.gl.deleteBuffer(this.vertexBuffer),this.renderer.gl.deleteBuffer(this.indexBuffer),this.shader.destroy(),this.renderer=null,this.vertices=null,this.positions=null,this.colors=null,this.indices=null,this.vertexBuffer=null,this.indexBuffer=null,this.sprites=null,this.shader=null}},{"../../const":22,"../../renderers/webgl/WebGLRenderer":48,"../../renderers/webgl/utils/ObjectRenderer":62}],68:[function(t,e,r){function n(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||h.RESOLUTION,this._text=null,this._style=null;var n=o.fromCanvas(this.canvas);n.trim=new s.Rectangle,i.call(this,n),this.text=t,this.style=e}var i=t("../sprites/Sprite"),o=t("../textures/Texture"),s=t("../math"),a=t("../utils"),h=t("../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.fontPropertiesCache={},n.fontPropertiesCanvas=document.createElement("canvas"),n.fontPropertiesContext=n.fontPropertiesCanvas.getContext("2d"),Object.defineProperties(n.prototype,{width:{get:function(){return this.dirty&&this.updateText(),this.scale.x*this._texture._frame.width},set:function(t){this.scale.x=t/this._texture._frame.width,this._width=t}},height:{get:function(){return this.dirty&&this.updateText(),this.scale.y*this._texture._frame.height},set:function(t){this.scale.y=t/this._texture._frame.height,this._height=t}},style:{get:function(){return this._style},set:function(t){t=t||{},"number"==typeof t.fill&&(t.fill=a.hex2string(t.fill)),"number"==typeof t.stroke&&(t.stroke=a.hex2string(t.stroke)),"number"==typeof t.dropShadowColor&&(t.dropShadowColor=a.hex2string(t.dropShadowColor)),t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,t.dropShadow=t.dropShadow||!1,t.dropShadowColor=t.dropShadowColor||"#000000",t.dropShadowAngle=t.dropShadowAngle||Math.PI/6,t.dropShadowDistance=t.dropShadowDistance||5,t.padding=t.padding||0,t.textBaseline=t.textBaseline||"alphabetic",t.lineJoin=t.lineJoin||"miter",t.miterLimit=t.miterLimit||10,this._style=t,this.dirty=!0}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),n.prototype.updateText=function(){var t=this._style;this.context.font=t.font;for(var e=t.wordWrap?this.wordWrap(this._text):this._text,r=e.split(/(?:\r\n|\r|\n)/),n=new Array(r.length),i=0,o=this.determineFontProperties(t.font),s=0;sh;h++){for(l=0;f>l;l+=4)if(255!==u[d+l]){p=!0;break}if(p)break;d+=f}for(e.ascent=s-h,d=c-f,p=!1,h=a;h>s;h--){for(l=0;f>l;l+=4)if(255!==u[d+l]){p=!0;break}if(p)break;d-=f}e.descent=h-s,e.fontSize=e.ascent+e.descent,n.fontPropertiesCache[t]=e}return e},n.prototype.wordWrap=function(t){for(var e="",r=t.split("\n"),n=this._style.wordWrapWidth,i=0;io?(a>0&&(e+="\n"),e+=s[a],o=n-h):(o-=l,e+=" "+s[a])}i0&&e>0,this.width=this._frame.width=this.crop.width=t,this.height=this._frame.height=this.crop.height=e,r&&(this.baseTexture.width=this.width,this.baseTexture.height=this.height),this.valid&&(this.textureBuffer.resize(this.width,this.height),this.filterManager&&this.filterManager.resize(this.width,this.height)))},n.prototype.clear=function(){this.valid&&(this.renderer.type===u.RENDERER_TYPE.WEBGL&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear()); -},n.prototype.renderWebGL=function(t,e,r,n){if(this.valid){if(n=void 0!==n?n:!0,this.textureBuffer.transform=e,this.textureBuffer.activate(),t.worldAlpha=1,n){t.worldTransform.identity(),t.currentBounds=null;var i,o,s=t.children;for(i=0,o=s.length;o>i;++i)s[i].updateTransform()}var a=this.renderer.filterManager;this.renderer.filterManager=this.filterManager,this.renderer.renderDisplayObject(t,this.textureBuffer,r),this.renderer.filterManager=a}},n.prototype.renderCanvas=function(t,e,r,n){if(this.valid){n=!!n;var i=t.worldTransform,o=c;o.identity(),e&&o.append(e),t.worldTransform=o,t.worldAlpha=1;var s,a,h=t.children;for(s=0,a=h.length;a>s;++s)h[s].updateTransform();r&&this.textureBuffer.clear(),t.worldTransform=i;var l=this.textureBuffer.context,u=this.renderer.resolution;this.renderer.resolution=this.resolution,this.renderer.renderDisplayObject(t,l),this.renderer.resolution=u}},n.prototype.destroy=function(){o.prototype.destroy.call(this,!0),this.textureBuffer.destroy(),this.filterManager&&this.filterManager.destroy(),this.renderer=null},n.prototype.getImage=function(){var t=new Image;return t.src=this.getBase64(),t},n.prototype.getBase64=function(){return this.getCanvas().toDataURL()},n.prototype.getCanvas=function(){if(this.renderer.type===u.RENDERER_TYPE.WEBGL){var t=this.renderer.gl,e=this.textureBuffer.size.width,r=this.textureBuffer.size.height,n=new Uint8Array(4*e*r);t.bindFramebuffer(t.FRAMEBUFFER,this.textureBuffer.frameBuffer),t.readPixels(0,0,e,r,t.RGBA,t.UNSIGNED_BYTE,n),t.bindFramebuffer(t.FRAMEBUFFER,null);var i=new h(e,r),o=i.context.getImageData(0,0,e,r);return o.data.set(n),i.context.putImageData(o,0,0),i.canvas}return this.textureBuffer.canvas},n.prototype.getPixels=function(){var t,e;if(this.renderer.type===u.RENDERER_TYPE.WEBGL){var r=this.renderer.gl;t=this.textureBuffer.size.width,e=this.textureBuffer.size.height;var n=new Uint8Array(4*t*e);return r.bindFramebuffer(r.FRAMEBUFFER,this.textureBuffer.frameBuffer),r.readPixels(0,0,t,e,r.RGBA,r.UNSIGNED_BYTE,n),r.bindFramebuffer(r.FRAMEBUFFER,null),n}return t=this.textureBuffer.canvas.width,e=this.textureBuffer.canvas.height,this.textureBuffer.canvas.getContext("2d").getImageData(0,0,t,e).data},n.prototype.getPixel=function(t,e){if(this.renderer.type===u.RENDERER_TYPE.WEBGL){var r=this.renderer.gl,n=new Uint8Array(4);return r.bindFramebuffer(r.FRAMEBUFFER,this.textureBuffer.frameBuffer),r.readPixels(t,e,1,1,r.RGBA,r.UNSIGNED_BYTE,n),r.bindFramebuffer(r.FRAMEBUFFER,null),n}return this.textureBuffer.canvas.getContext("2d").getImageData(t,e,1,1).data}},{"../const":22,"../math":32,"../renderers/canvas/utils/CanvasBuffer":44,"../renderers/webgl/managers/FilterManager":53,"../renderers/webgl/utils/RenderTarget":64,"./BaseTexture":69,"./Texture":71}],71:[function(t,e,r){function n(t,e,r,i,o){a.call(this),this.noFrame=!1,e||(this.noFrame=!0,e=new h.Rectangle(0,0,1,1)),t instanceof n&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=i,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.width=0,this.height=0,this.crop=r||e,this.rotate=!!o,t.hasLoaded?(this.noFrame&&(e=new h.Rectangle(0,0,t.width,t.height),t.on("update",this.onBaseTextureUpdated,this)),this.frame=e):t.once("loaded",this.onBaseTextureLoaded,this)}var i=t("./BaseTexture"),o=t("./VideoBaseTexture"),s=t("./TextureUvs"),a=t("eventemitter3"),h=t("../math"),l=t("../utils");n.prototype=Object.create(a.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{frame:{get:function(){return this._frame},set:function(t){if(this._frame=t,this.noFrame=!1,this.width=t.width,this.height=t.height,!this.trim&&!this.rotate&&(t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height))throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=t&&t.width&&t.height&&this.baseTexture.hasLoaded,this.trim?(this.width=this.trim.width,this.height=this.trim.height,this._frame.width=this.trim.width,this._frame.height=this.trim.height):this.crop=t,this.valid&&this._updateUvs()}}}),n.prototype.update=function(){this.baseTexture.update()},n.prototype.onBaseTextureLoaded=function(t){this.frame=this.noFrame?new h.Rectangle(0,0,t.width,t.height):this._frame,this.emit("update",this)},n.prototype.onBaseTextureUpdated=function(t){this._frame.width=t.width,this._frame.height=t.height,this.emit("update",this)},n.prototype.destroy=function(t){this.baseTexture&&(t&&this.baseTexture.destroy(),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture.off("loaded",this.onBaseTextureLoaded,this),this.baseTexture=null),this._frame=null,this._uvs=null,this.trim=null,this.crop=null,this.valid=!1},n.prototype.clone=function(){return new n(this.baseTexture,this.frame,this.crop,this.trim,this.rotate)},n.prototype._updateUvs=function(){this._uvs||(this._uvs=new s),this._uvs.set(this.crop,this.baseTexture,this.rotate)},n.fromImage=function(t,e,r){var o=l.TextureCache[t];return o||(o=new n(i.fromImage(t,e,r)),l.TextureCache[t]=o),o},n.fromFrame=function(t){var e=l.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return e},n.fromCanvas=function(t,e){return new n(i.fromCanvas(t,e))},n.fromVideo=function(t,e){return"string"==typeof t?n.fromVideoUrl(t,e):new n(o.fromVideo(t,e))},n.fromVideoUrl=function(t,e){return new n(o.fromUrl(t,e))},n.addTextureToCache=function(t,e){l.TextureCache[e]=t},n.removeTextureFromCache=function(t){var e=l.TextureCache[t];return delete l.TextureCache[t],delete l.BaseTextureCache[t],e},n.EMPTY=new n(new i)},{"../math":32,"../utils":76,"./BaseTexture":69,"./TextureUvs":72,"./VideoBaseTexture":73,eventemitter3:11}],72:[function(t,e,r){function n(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1}e.exports=n,n.prototype.set=function(t,e,r){var n=e.width,i=e.height;r?(this.x0=(t.x+t.height)/n,this.y0=t.y/i,this.x1=(t.x+t.height)/n,this.y1=(t.y+t.width)/i,this.x2=t.x/n,this.y2=(t.y+t.width)/i,this.x3=t.x/n,this.y3=t.y/i):(this.x0=t.x/n,this.y0=t.y/i,this.x1=(t.x+t.width)/n,this.y1=t.y/i,this.x2=(t.x+t.width)/n,this.y2=(t.y+t.height)/i,this.x3=t.x/n,this.y3=(t.y+t.height)/i)}},{}],73:[function(t,e,r){function n(t,e){if(!t)throw new Error("No video source element specified.");(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),o.call(this,t,e),this.autoUpdate=!1,this._onUpdate=this._onUpdate.bind(this),this._onCanPlay=this._onCanPlay.bind(this),t.complete||(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this))),this.__loaded=!1}function i(t,e){e||(e="video/"+t.substr(t.lastIndexOf(".")+1));var r=document.createElement("source");return r.src=t,r.type=e,r}var o=t("./BaseTexture"),s=t("../utils");n.prototype=Object.create(o.prototype),n.prototype.constructor=n,e.exports=n,n.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this._onUpdate),this.update())},n.prototype._onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this._onUpdate),this.autoUpdate=!0)},n.prototype._onPlayStop=function(){this.autoUpdate=!1},n.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.source.play(),this.__loaded||(this.__loaded=!0,this.emit("loaded",this)))},n.prototype.destroy=function(){this.source&&this.source._pixiId&&(delete s.BaseTextureCache[this.source._pixiId],delete this.source._pixiId),o.prototype.destroy.call(this)},n.fromVideo=function(t,e){t._pixiId||(t._pixiId="video_"+s.uid());var r=s.BaseTextureCache[t._pixiId];return r||(r=new n(t,e),s.BaseTextureCache[t._pixiId]=r),r},n.fromUrl=function(t,e){var r=document.createElement("video");if(Array.isArray(t))for(var o=0;othis._maxElapsedMS&&(e=this._maxElapsedMS),this.deltaTime=e*i.TARGET_FPMS*this.speed,this._emitter.emit(s,this.deltaTime),this.lastTime=t},e.exports=n},{"../const":22,eventemitter3:11}],75:[function(t,e,r){var n=t("./Ticker"),i=new n;i.autoStart=!0,e.exports={shared:i,Ticker:n}},{"./Ticker":74}],76:[function(t,e,r){var n=t("../const"),i=e.exports={_uid:0,_saidHello:!1,pluginTarget:t("./pluginTarget"),async:t("async"),uid:function(){return++i._uid},hex2rgb:function(t,e){return e=e||[],e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},hex2string:function(t){return t=t.toString(16),t="000000".substr(0,6-t.length)+t,"#"+t},rgb2hex:function(t){return(255*t[0]<<16)+(255*t[1]<<8)+255*t[2]},canUseNewCanvasBlendModes:function(){if("undefined"==typeof document)return!1;var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",e="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",r=new Image;r.src=t+"AP804Oa6"+e;var n=new Image;n.src=t+"/wCKxvRF"+e;var i=document.createElement("canvas");i.width=6,i.height=1;var o=i.getContext("2d");o.globalCompositeOperation="multiply",o.drawImage(r,0,0),o.drawImage(n,2,0);var s=o.getImageData(2,0,1,1).data;return 255===s[0]&&0===s[1]&&0===s[2]},getNextPowerOfTwo:function(t){if(t>0&&0===(t&t-1))return t;for(var e=1;t>e;)e<<=1;return e},isPowerOfTwo:function(t,e){return t>0&&0===(t&t-1)&&e>0&&0===(e&e-1)},getResolutionOfUrl:function(t){var e=n.RETINA_PREFIX.exec(t);return e?parseFloat(e[1]):1},sayHello:function(t){if(!i._saidHello){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c Pixi.js "+n.VERSION+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("Pixi.js "+n.VERSION+" - "+t+" - http://www.pixijs.com/");i._saidHello=!0}},isWebGLSupported:function(){var t={stencil:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);return!(!r||!r.getContextAttributes().stencil)}catch(n){return!1}},TextureCache:{},BaseTextureCache:{}}},{"../const":22,"./pluginTarget":77,async:2}],77:[function(t,e,r){function n(t){t.__plugins={},t.registerPlugin=function(e,r){t.__plugins[e]=r},t.prototype.initPlugins=function(){this.plugins=this.plugins||{};for(var e in t.__plugins)this.plugins[e]=new t.__plugins[e](this)},t.prototype.destroyPlugins=function(){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;this.plugins=null}}e.exports={mixin:function(t){n(t)}}},{}],78:[function(t,e,r){var n=t("./core"),i=t("./mesh"),o=t("./extras"),s=t("./filters");n.SpriteBatch=function(){throw new ReferenceError("SpriteBatch does not exist any more, please use the new ParticleContainer instead.")},n.AssetLoader=function(){throw new ReferenceError("The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.")},Object.defineProperties(n,{Stage:{get:function(){return console.warn("You do not need to use a PIXI Stage any more, you can simply render any container."),n.Container}},DisplayObjectContainer:{get:function(){return console.warn("DisplayObjectContainer has been shortened to Container, please use Container from now on."),n.Container}},Strip:{get:function(){return console.warn("The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on."),i.Mesh}},Rope:{get:function(){return console.warn("The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on."),i.Rope}},MovieClip:{get:function(){return console.warn("The MovieClip class has been moved to extras.MovieClip, please use extras.MovieClip from now on."),o.MovieClip}},TilingSprite:{get:function(){return console.warn("The TilingSprite class has been moved to extras.TilingSprite, please use extras.TilingSprite from now on."),o.TilingSprite}},BitmapText:{get:function(){return console.warn("The BitmapText class has been moved to extras.BitmapText, please use extras.BitmapText from now on."),o.BitmapText}},blendModes:{get:function(){return console.warn("The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on."),n.BLEND_MODES}},scaleModes:{get:function(){return console.warn("The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on."),n.SCALE_MODES}},BaseTextureCache:{get:function(){return console.warn("The BaseTextureCache class has been moved to utils.BaseTextureCache, please use utils.BaseTextureCache from now on."),n.utils.BaseTextureCache}},TextureCache:{get:function(){return console.warn("The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on."),n.utils.TextureCache}},math:{get:function(){return console.warn("The math namespace is deprecated, please access members already accessible on PIXI."),n}}}),n.Sprite.prototype.setTexture=function(t){this.texture=t,console.warn("setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;")},o.BitmapText.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myBitmapText.text = 'my text';")},n.Text.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myText.text = 'my text';")},n.Text.prototype.setStyle=function(t){this.style=t,console.warn("setStyle is now deprecated, please use the style property, e.g : myText.style = style;")},n.Texture.prototype.setFrame=function(t){this.frame=t,console.warn("setFrame is now deprecated, please use the frame property, e.g : myTexture.frame = frame;")},Object.defineProperties(s,{AbstractFilter:{get:function(){return console.warn("filters.AbstractFilter is an undocumented alias, please use AbstractFilter from now on."),n.AbstractFilter}},FXAAFilter:{get:function(){return console.warn("filters.FXAAFilter is an undocumented alias, please use FXAAFilter from now on."),n.FXAAFilter}},SpriteMaskFilter:{get:function(){return console.warn("filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on."),n.SpriteMaskFilter}}}),n.utils.uuid=function(){return console.warn("utils.uuid() is deprecated, please use utils.uid() from now on."),n.utils.uid()}},{"./core":29,"./extras":85,"./filters":102,"./mesh":126}],79:[function(t,e,r){function n(t,e){i.Container.call(this),e=e||{},this.textWidth=0,this.textHeight=0,this._glyphs=[],this._font={tint:void 0!==e.tint?e.tint:16777215,align:e.align||"left",name:null,size:0},this.font=e.font,this._text=t,this.maxWidth=0,this.dirty=!1,this.updateText()}var i=t("../core");n.prototype=Object.create(i.Container.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{tint:{get:function(){return this._font.tint},set:function(t){this._font.tint="number"==typeof t&&t>=0?t:16777215,this.dirty=!0}},align:{get:function(){return this._font.align},set:function(t){this._font.align=t||"left",this.dirty=!0}},font:{get:function(){return this._font},set:function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):n.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),n.prototype.updateText=function(){for(var t=n.fonts[this._font.name],e=new i.Point,r=null,o=[],s=0,a=0,h=[],l=0,u=this._font.size/t.size,c=-1,f=0;f0&&e.x*u>this.maxWidth)o.splice(c,f-c),f=c,c=-1,h.push(s),a=Math.max(a,s),l++,e.x=0,e.y+=t.lineHeight,r=null;else{var p=t.chars[d];p&&(r&&p.kerning[r]&&(e.x+=p.kerning[r]),o.push({texture:p.texture,line:l,charCode:d,position:new i.Point(e.x+p.xOffset,e.y+p.yOffset)}),s=e.x+(p.texture.width+p.xOffset),e.x+=p.xAdvance,r=d)}}h.push(s),a=Math.max(a,s);var g=[];for(f=0;l>=f;f++){var A=0;"right"===this._font.align?A=a-h[f]:"center"===this._font.align&&(A=(a-h[f])/2),g.push(A)}var v=o.length,m=this.tint;for(f=0;v>f;f++){var y=this._glyphs[f];y?y.texture=o[f].texture:(y=new i.Sprite(o[f].texture),this._glyphs.push(y)),y.position.x=(o[f].position.x+g[o[f].line])*u,y.position.y=o[f].position.y*u,y.scale.x=y.scale.y=u,y.tint=m,y.parent||this.addChild(y)}for(f=v;fe?this.loop?this._texture=this._textures[this._textures.length-1+e%this._textures.length]:(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this.loop||e=this._textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())},n.prototype.destroy=function(){this.stop(),i.Sprite.prototype.destroy.call(this)},n.fromFrames=function(t){for(var e=[],r=0;ry?y:t,t=t>w?w:t,t=t>C?C:t,r=m,r=r>x?x:r,r=r>E?E:r,r=r>b?b:r,e=v,e=y>e?y:e,e=w>e?w:e,e=C>e?C:e,n=m,n=x>n?x:n,n=E>n?E:n,n=b>n?b:n;var B=this._bounds;return B.x=t,B.width=e-t,B.y=r,B.height=n-r,this._currentBounds=B,B},n.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,o);var e,r=this._width,n=this._height,i=-r*this.anchor.x;return o.x>i&&o.xe&&o.y 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 vec2 p = mod( uv / ( pixelSize * 0.5 ), 2.0) - vec2(1.0);\n col = col * character(n, p);\n\n gl_FragColor = vec4(col, 1.0);\n}\n",{dimensions:{type:"4fv",value:new Float32Array([0,0,0,0])},pixelSize:{type:"1f",value:8}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{size:{get:function(){return this.uniforms.pixelSize.value},set:function(t){this.uniforms.pixelSize.value=t}}})},{"../../core":29}],87:[function(t,e,r){function n(){i.AbstractFilter.call(this),this.blurXFilter=new o,this.blurYFilter=new s,this.defaultFilter=new i.AbstractFilter}var i=t("../../core"),o=t("../blur/BlurXFilter"),s=t("../blur/BlurYFilter");n.prototype=Object.create(i.AbstractFilter.prototype), -n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager.getRenderTarget(!0);this.defaultFilter.applyFilter(t,e,r),this.blurXFilter.applyFilter(t,e,n),t.blendModeManager.setBlendMode(i.BLEND_MODES.SCREEN),this.blurYFilter.applyFilter(t,n,r),t.blendModeManager.setBlendMode(i.BLEND_MODES.NORMAL),t.filterManager.returnRenderTarget(n)},Object.defineProperties(n.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t}},blurX:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t}},blurY:{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t}}})},{"../../core":29,"../blur/BlurXFilter":90,"../blur/BlurYFilter":91}],88:[function(t,e,r){function n(t,e){i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform float strength;\nuniform float dirX;\nuniform float dirY;\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vBlurTexCoords[3];\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n\n vBlurTexCoords[0] = aTextureCoord + vec2( (0.004 * strength) * dirX, (0.004 * strength) * dirY );\n vBlurTexCoords[1] = aTextureCoord + vec2( (0.008 * strength) * dirX, (0.008 * strength) * dirY );\n vBlurTexCoords[2] = aTextureCoord + vec2( (0.012 * strength) * dirX, (0.012 * strength) * dirY );\n\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vBlurTexCoords[3];\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = vec4(0.0);\n\n gl_FragColor += texture2D(uSampler, vTextureCoord ) * 0.3989422804014327;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 0]) * 0.2419707245191454;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 1]) * 0.05399096651318985;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 2]) * 0.004431848411938341;\n}\n",{strength:{type:"1f",value:1},dirX:{type:"1f",value:t||0},dirY:{type:"1f",value:e||0}}),this.defaultFilter=new i.AbstractFilter,this.passes=1,this.dirX=t||0,this.dirY=e||0,this.strength=4}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r,n){var i=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.width/e.size.width),1===this.passes)t.filterManager.applyFilter(i,e,r,n);else{var o=t.filterManager.getRenderTarget(!0);t.filterManager.applyFilter(i,e,o,n);for(var s=0;s>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=(n>>16&255)/255,l=(n>>8&255)/255,u=(255&n)/255,c=[.3,.59,.11,0,0,o,s,a,t,0,h,l,u,e,0,o-h,s-l,a-u,0,0];this._loadMatrix(c,i)},n.prototype.night=function(t,e){t=t||.1;var r=[-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},n.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)},n.prototype.lsd=function(t){var e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(e,t)},n.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)},Object.defineProperties(n.prototype,{matrix:{get:function(){return this.uniforms.m.value},set:function(t){this.uniforms.m.value=t}}})},{"../../core":29}],94:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float step;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n color = floor(color * step) / step;\n\n gl_FragColor = color;\n}\n",{step:{type:"1f",value:5}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{step:{get:function(){return this.uniforms.step.value},set:function(t){this.uniforms.step.value=t}}})},{"../../core":29}],95:[function(t,e,r){function n(t,e,r){i.AbstractFilter.call(this,null,"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",{matrix:{type:"1fv",value:new Float32Array(t)},texelSize:{type:"v2",value:{x:1/e,y:1/r}}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{matrix:{get:function(){return this.uniforms.matrix.value},set:function(t){this.uniforms.matrix.value=new Float32Array(t)}},width:{get:function(){return 1/this.uniforms.texelSize.value.x},set:function(t){this.uniforms.texelSize.value.x=1/t}},height:{get:function(){return 1/this.uniforms.texelSize.value.y},set:function(t){this.uniforms.texelSize.value.y=1/t}}})},{"../../core":29}],96:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"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")}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n},{"../../core":29}],97:[function(t,e,r){function n(t){var e=new i.Matrix;t.renderable=!1,i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMapCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec2 scale;\n\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nvoid main(void)\n{\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 map = texture2D(mapSampler, vMapCoord);\n\n map -= 0.5;\n map.xy *= scale;\n\n gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y));\n}\n",{mapSampler:{type:"sampler2D",value:t.texture},otherMatrix:{type:"mat3",value:e.toArray(!0)},scale:{type:"v2",value:{x:1,y:1}}}),this.maskSprite=t,this.maskMatrix=e,this.scale=new i.Point(20,20)}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager;n.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.scale.value.x=this.scale.x*(1/e.frame.width),this.uniforms.scale.value.y=this.scale.y*(1/e.frame.height);var i=this.getShader(t);n.applyFilter(i,e,r)},Object.defineProperties(n.prototype,{map:{get:function(){return this.uniforms.mapSampler.value},set:function(t){this.uniforms.mapSampler.value=t}}})},{"../../core":29}],98:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 dimensions;\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 * dimensions.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",{scale:{type:"1f",value:1},angle:{type:"1f",value:5},dimensions:{type:"4fv",value:[0,0,0,0]}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{scale:{get:function(){return this.uniforms.scale.value},set:function(t){this.uniforms.scale.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},{"../../core":29}],99:[function(t,e,r){function n(){i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform float strength;\nuniform vec2 offset;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vBlurTexCoords[6];\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3((aVertexPosition+offset), 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n\n vBlurTexCoords[ 0] = aTextureCoord + vec2(0.0, -0.012 * strength);\n vBlurTexCoords[ 1] = aTextureCoord + vec2(0.0, -0.008 * strength);\n vBlurTexCoords[ 2] = aTextureCoord + vec2(0.0, -0.004 * strength);\n vBlurTexCoords[ 3] = aTextureCoord + vec2(0.0, 0.004 * strength);\n vBlurTexCoords[ 4] = aTextureCoord + vec2(0.0, 0.008 * strength);\n vBlurTexCoords[ 5] = aTextureCoord + vec2(0.0, 0.012 * strength);\n\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vBlurTexCoords[6];\nvarying vec4 vColor;\n\nuniform vec3 color;\nuniform float alpha;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n vec4 sum = vec4(0.0);\n\n sum += texture2D(uSampler, vBlurTexCoords[ 0])*0.004431848411938341;\n sum += texture2D(uSampler, vBlurTexCoords[ 1])*0.05399096651318985;\n sum += texture2D(uSampler, vBlurTexCoords[ 2])*0.2419707245191454;\n sum += texture2D(uSampler, vTextureCoord )*0.3989422804014327;\n sum += texture2D(uSampler, vBlurTexCoords[ 3])*0.2419707245191454;\n sum += texture2D(uSampler, vBlurTexCoords[ 4])*0.05399096651318985;\n sum += texture2D(uSampler, vBlurTexCoords[ 5])*0.004431848411938341;\n\n gl_FragColor = vec4( color.rgb * sum.a * alpha, sum.a * alpha );\n}\n",{blur:{type:"1f",value:1/512},color:{type:"c",value:[0,0,0]},alpha:{type:"1f",value:.7},offset:{type:"2f",value:[5,5]},strength:{type:"1f",value:1}}),this.passes=1,this.strength=4}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r,n){var i=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.height/e.size.height),1===this.passes)t.filterManager.applyFilter(i,e,r,n);else{for(var o=t.filterManager.getRenderTarget(!0),s=e,a=o,h=0;h= (time - params.z)) )\n {\n float diff = (dist - time);\n float powDiff = 1.0 - pow(abs(diff*params.x), params.y);\n\n float diffTime = diff * powDiff;\n vec2 diffUV = normalize(uv - center);\n texCoord = uv + (diffUV * diffTime);\n }\n\n gl_FragColor = texture2D(uSampler, texCoord);\n}\n",{center:{type:"v2",value:{x:.5,y:.5}},params:{type:"v3",value:{x:10,y:.8,z:.1}},time:{type:"1f",value:0}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{center:{get:function(){return this.uniforms.center.value},set:function(t){this.uniforms.center.value=t}},params:{get:function(){return this.uniforms.params.value},set:function(t){this.uniforms.params.value=t}},time:{get:function(){return this.uniforms.time.value},set:function(t){this.uniforms.time.value=t}}})},{"../../core":29}],110:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying 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 gl_FragColor = color / total;\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n}\n",{blur:{type:"1f",value:100},gradientBlur:{type:"1f",value:600},start:{type:"v2",value:{x:0,y:window.innerHeight/2}},end:{type:"v2",value:{x:600,y:window.innerHeight/2}},delta:{type:"v2",value:{x:30,y:30}},texSize:{type:"v2",value:{x:window.innerWidth,y:window.innerHeight}}}),this.updateDelta()}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.updateDelta=function(){this.uniforms.delta.value.x=0,this.uniforms.delta.value.y=0},Object.defineProperties(n.prototype,{blur:{get:function(){return this.uniforms.blur.value},set:function(t){this.uniforms.blur.value=t}},gradientBlur:{get:function(){return this.uniforms.gradientBlur.value},set:function(t){this.uniforms.gradientBlur.value=t}},start:{get:function(){return this.uniforms.start.value},set:function(t){this.uniforms.start.value=t,this.updateDelta()}},end:{get:function(){return this.uniforms.end.value},set:function(t){this.uniforms.end.value=t,this.updateDelta()}}})},{"../../core":29}],111:[function(t,e,r){function n(){i.AbstractFilter.call(this),this.tiltShiftXFilter=new o,this.tiltShiftYFilter=new s}var i=t("../../core"),o=t("./TiltShiftXFilter"),s=t("./TiltShiftYFilter");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager.getRenderTarget(!0);this.tiltShiftXFilter.applyFilter(t,e,n),this.tiltShiftYFilter.applyFilter(t,n,r),t.filterManager.returnRenderTarget(n)},Object.defineProperties(n.prototype,{blur:{get:function(){return this.tiltShiftXFilter.blur},set:function(t){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=t}},gradientBlur:{get:function(){return this.tiltShiftXFilter.gradientBlur},set:function(t){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=t}},start:{get:function(){return this.tiltShiftXFilter.start},set:function(t){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=t}},end:{get:function(){return this.tiltShiftXFilter.end},set:function(t){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=t}}})},{"../../core":29,"./TiltShiftXFilter":112,"./TiltShiftYFilter":113}],112:[function(t,e,r){function n(){i.call(this)}var i=t("./TiltShiftAxisFilter");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=t/r,this.uniforms.delta.value.y=e/r}},{"./TiltShiftAxisFilter":110}],113:[function(t,e,r){function n(){i.call(this)}var i=t("./TiltShiftAxisFilter");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=-e/r,this.uniforms.delta.value.y=t/r}},{"./TiltShiftAxisFilter":110}],114:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord - offset;\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratio = (radius - dist) / radius;\n float angleMod = ratio * ratio * 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 gl_FragColor = texture2D(uSampler, coord+offset);\n}\n",{radius:{type:"1f",value:.5},angle:{type:"1f",value:5},offset:{type:"v2",value:{x:.5,y:.5}}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}},radius:{get:function(){return this.uniforms.radius.value},set:function(t){this.uniforms.radius.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},{"../../core":29}],115:[function(t,e,r){function n(){this.global=new i.Point,this.target=null,this.originalEvent=null}var i=t("../core");n.prototype.constructor=n,e.exports=n,n.prototype.getLocalPosition=function(t,e,r){var n=t.worldTransform,o=r?r:this.global,s=n.a,a=n.c,h=n.tx,l=n.b,u=n.d,c=n.ty,f=1/(s*u+a*-l);return e=e||new i.Point,e.x=u*f*o.x+-a*f*o.x+(c*a-h*u)*f,e.y=s*f*o.y+-l*f*o.y+(-c*s+h*l)*f,e}},{"../core":29}],116:[function(t,e,r){function n(t,e){e=e||{},this.renderer=t,this.autoPreventDefault=void 0!==e.autoPreventDefault?e.autoPreventDefault:!0,this.interactionFrequency=e.interactionFrequency||10,this.mouse=new o,this.eventData={stopped:!1,target:null,type:null,data:this.mouse,stopPropagation:function(){this.stopped=!0}},this.interactiveDataPool=[],this.interactionDOMElement=null,this.eventsAdded=!1,this.onMouseUp=this.onMouseUp.bind(this),this.processMouseUp=this.processMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.processMouseDown=this.processMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.processMouseMove=this.processMouseMove.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.processMouseOverOut=this.processMouseOverOut.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.processTouchStart=this.processTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.processTouchEnd=this.processTouchEnd.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.processTouchMove=this.processTouchMove.bind(this),this.last=0,this.currentCursorStyle="inherit",this._tempPoint=new i.Point,this.resolution=1,this.setTargetElement(this.renderer.view,this.renderer.resolution)}var i=t("../core"),o=t("./InteractionData");Object.assign(i.DisplayObject.prototype,t("./interactiveTarget")),n.prototype.constructor=n,e.exports=n,n.prototype.setTargetElement=function(t,e){this.removeEvents(),this.interactionDOMElement=t,this.resolution=e||1,this.addEvents()},n.prototype.addEvents=function(){this.interactionDOMElement&&(i.ticker.shared.add(this.update,this),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"),window.document.addEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.addEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.addEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!0)},n.prototype.removeEvents=function(){this.interactionDOMElement&&(i.ticker.shared.remove(this.update),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""),window.document.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!1)},n.prototype.update=function(t){if(this._deltaTime+=t,!(this._deltaTime=0;a--)!s&&n?s=this.processInteractive(t,o[a],r,!0,i):this.processInteractive(t,o[a],r,!1,!1);return i&&(n&&(e.hitArea?(e.worldTransform.applyInverse(t,this._tempPoint),s=e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)):e.containsPoint&&(s=e.containsPoint(t))),e.interactive&&r(e,s)),s},n.prototype.onMouseDown=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.autoPreventDefault&&this.mouse.originalEvent.preventDefault(),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseDown,!0)},n.prototype.processMouseDown=function(t,e){var r=this.mouse.originalEvent,n=2===r.button||3===r.which;e&&(t[n?"_isRightDown":"_isLeftDown"]=!0,this.dispatchEvent(t,n?"rightdown":"mousedown",this.eventData))},n.prototype.onMouseUp=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseUp,!0)},n.prototype.processMouseUp=function(t,e){var r=this.mouse.originalEvent,n=2===r.button||3===r.which,i=n?"_isRightDown":"_isLeftDown";e?(this.dispatchEvent(t,n?"rightup":"mouseup",this.eventData),t[i]&&(t[i]=!1,this.dispatchEvent(t,n?"rightclick":"click",this.eventData))):t[i]&&(t[i]=!1,this.dispatchEvent(t,n?"rightupoutside":"mouseupoutside",this.eventData))},n.prototype.onMouseMove=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.didMove=!0,this.cursor="inherit",this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseMove,!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor)},n.prototype.processMouseMove=function(t,e){this.dispatchEvent(t,"mousemove",this.eventData),this.processMouseOverOut(t,e)},n.prototype.onMouseOut=function(t){this.mouse.originalEvent=t,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.interactionDOMElement.style.cursor="inherit",this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut,!1)},n.prototype.processMouseOverOut=function(t,e){e?(t._over||(t._over=!0,this.dispatchEvent(t,"mouseover",this.eventData)),t.buttonMode&&(this.cursor=t.defaultCursor)):t._over&&(t._over=!1,this.dispatchEvent(t,"mouseout",this.eventData))},n.prototype.onTouchStart=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,n=0;r>n;n++){var i=e[n],o=this.getTouchData(i);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchStart,!0),this.returnTouchData(o)}},n.prototype.processTouchStart=function(t,e){e&&(t._touchDown=!0,this.dispatchEvent(t,"touchstart",this.eventData))},n.prototype.onTouchEnd=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,n=0;r>n;n++){var i=e[n],o=this.getTouchData(i);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchEnd,!0),this.returnTouchData(o)}},n.prototype.processTouchEnd=function(t,e){e?(this.dispatchEvent(t,"touchend",this.eventData),t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"tap",this.eventData))):t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"touchendoutside",this.eventData))},n.prototype.onTouchMove=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,n=0;r>n;n++){var i=e[n],o=this.getTouchData(i);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchMove,!1),this.returnTouchData(o)}},n.prototype.processTouchMove=function(t,e){e=e,this.dispatchEvent(t,"touchmove",this.eventData)},n.prototype.getTouchData=function(t){var e=this.interactiveDataPool.pop();return e||(e=new o),e.identifier=t.identifier,this.mapPositionToPoint(e.global,t.clientX,t.clientY),navigator.isCocoonJS&&(e.global.x=e.global.x/this.resolution,e.global.y=e.global.y/this.resolution),t.globalX=e.global.x,t.globalY=e.global.y,e},n.prototype.returnTouchData=function(t){this.interactiveDataPool.push(t)},n.prototype.destroy=function(){this.removeEvents(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactiveDataPool=null,this.interactionDOMElement=null,this.onMouseUp=null,this.processMouseUp=null,this.onMouseDown=null,this.processMouseDown=null,this.onMouseMove=null,this.processMouseMove=null,this.onMouseOut=null,this.processMouseOverOut=null,this.onTouchStart=null,this.processTouchStart=null,this.onTouchEnd=null,this.processTouchEnd=null,this.onTouchMove=null,this.processTouchMove=null,this._tempPoint=null},i.WebGLRenderer.registerPlugin("interaction",n),i.CanvasRenderer.registerPlugin("interaction",n)},{"../core":29,"./InteractionData":115,"./interactiveTarget":118}],117:[function(t,e,r){e.exports={InteractionData:t("./InteractionData"),InteractionManager:t("./InteractionManager"),interactiveTarget:t("./interactiveTarget")}},{"./InteractionData":115,"./InteractionManager":116,"./interactiveTarget":118}],118:[function(t,e,r){var n={interactive:!1,buttonMode:!1,interactiveChildren:!0,defaultCursor:"pointer",_over:!1,_touchDown:!1};e.exports=n},{}],119:[function(t,e,r){function n(t,e){var r={},n=t.data.getElementsByTagName("info")[0],i=t.data.getElementsByTagName("common")[0];r.font=n.getAttribute("face"),r.size=parseInt(n.getAttribute("size"),10),r.lineHeight=parseInt(i.getAttribute("lineHeight"),10),r.chars={};for(var a=t.data.getElementsByTagName("char"),h=0;hi;i++){var o=2*i;this._renderCanvasDrawTriangle(t,e,r,o,o+2,o+4)}},n.prototype._renderCanvasTriangles=function(t){for(var e=this.vertices,r=this.uvs,n=this.indices,i=n.length,o=0;i>o;o+=3){var s=2*n[o],a=2*n[o+1],h=2*n[o+2];this._renderCanvasDrawTriangle(t,e,r,s,a,h)}},n.prototype._renderCanvasDrawTriangle=function(t,e,r,n,i,o){var s=this._texture.baseTexture.source,a=this._texture.baseTexture.width,h=this._texture.baseTexture.height,l=e[n],u=e[i],c=e[o],f=e[n+1],d=e[i+1],p=e[o+1],g=r[n]*a,A=r[i]*a,v=r[o]*a,m=r[n+1]*h,y=r[i+1]*h,x=r[o+1]*h;if(this.canvasPadding>0){var w=this.canvasPadding/this.worldTransform.a,E=this.canvasPadding/this.worldTransform.d,C=(l+u+c)/3,b=(f+d+p)/3,B=l-C,T=f-b,D=Math.sqrt(B*B+T*T);l=C+B/D*(D+w),f=b+T/D*(D+E),B=u-C,T=d-b,D=Math.sqrt(B*B+T*T),u=C+B/D*(D+w),d=b+T/D*(D+E),B=c-C,T=p-b,D=Math.sqrt(B*B+T*T),c=C+B/D*(D+w),p=b+T/D*(D+E)}t.save(),t.beginPath(),t.moveTo(l,f),t.lineTo(u,d),t.lineTo(c,p),t.closePath(),t.clip();var M=g*y+m*v+A*x-y*v-m*A-g*x,P=l*y+m*c+u*x-y*c-m*u-l*x,R=g*u+l*v+A*c-u*v-l*A-g*c,I=g*y*c+m*u*v+l*A*x-l*y*v-m*A*c-g*u*x,S=f*y+m*p+d*x-y*p-m*d-f*x,O=g*d+f*v+A*p-d*v-f*A-g*p,F=g*y*p+m*d*v+f*A*x-f*y*v-m*A*p-g*d*x;t.transform(P/M,S/M,R/M,O/M,I/M,F/M),t.drawImage(s,0,0),t.restore()},n.prototype.renderMeshFlat=function(t){var e=this.context,r=t.vertices,n=r.length/2;e.beginPath();for(var i=1;n-2>i;i++){var o=2*i,s=r[o],a=r[o+2],h=r[o+4],l=r[o+1],u=r[o+3],c=r[o+5];e.moveTo(s,l),e.lineTo(a,u),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},n.prototype._onTextureUpdate=function(){this.updateFrame=!0},n.prototype.getBounds=function(t){if(!this._currentBounds){for(var e=t||this.worldTransform,r=e.a,n=e.b,o=e.c,s=e.d,a=e.tx,h=e.ty,l=-(1/0),u=-(1/0),c=1/0,f=1/0,d=this.vertices,p=0,g=d.length;g>p;p+=2){var A=d[p],v=d[p+1],m=r*A+o*v+a,y=s*v+n*A+h;c=c>m?m:c,f=f>y?y:f,l=m>l?m:l,u=y>u?y:u}if(c===-(1/0)||u===1/0)return i.Rectangle.EMPTY;var x=this._bounds;x.x=c,x.width=l-c,x.y=f,x.height=u-f,this._currentBounds=x}return this._currentBounds},n.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,o);var e,r,i=this.vertices,a=s.points;if(this.drawMode===n.DRAW_MODES.TRIANGLES){var h=this.indices;for(r=this.indices.length,e=0;r>e;e+=3){var l=2*h[e],u=2*h[e+1],c=2*h[e+2];if(a[0]=i[l],a[1]=i[l+1],a[2]=i[u],a[3]=i[u+1],a[4]=i[c],a[5]=i[c+1],s.contains(o.x,o.y))return!0}}else for(r=i.length,e=0;r>e;e+=6)if(a[0]=i[e],a[1]=i[e+1],a[2]=i[e+2],a[3]=i[e+3],a[4]=i[e+4],a[5]=i[e+5],s.contains(o.x,o.y))return!0;return!1},n.DRAW_MODES={TRIANGLE_MESH:0,TRIANGLES:1}},{"../core":29}],125:[function(t,e,r){function n(t,e){i.call(this,t),this.points=e,this.vertices=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length), -this.indices=new Uint16Array(2*e.length),this._ready=!0,this.refresh()}var i=t("./Mesh"),o=t("../core");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.refresh=function(){var t=this.points;if(!(t.length<1)&&this._texture._uvs){var e=this.uvs,r=this.indices,n=this.colors,i=this._texture._uvs,s=new o.Point(i.x0,i.y0),a=new o.Point(i.x2-i.x0,i.y2-i.y0);e[0]=0+s.x,e[1]=0+s.y,e[2]=0+s.x,e[3]=1*a.y+s.y,n[0]=1,n[1]=1,r[0]=0,r[1]=1;for(var h,l,u,c=t.length,f=1;c>f;f++)h=t[f],l=4*f,u=f/(c-1),e[l]=u*a.x+s.x,e[l+1]=0+s.y,e[l+2]=u*a.x+s.x,e[l+3]=1*a.y+s.y,l=2*f,n[l]=1,n[l+1]=1,l=2*f,r[l]=l,r[l+1]=l+1;this.dirty=!0}},n.prototype._onTextureUpdate=function(){i.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()},n.prototype.updateTransform=function(){var t=this.points;if(!(t.length<1)){for(var e,r,n,i,o,s,a=t[0],h=0,l=0,u=this.vertices,c=t.length,f=0;c>f;f++)r=t[f],n=4*f,e=f1&&(i=1),o=Math.sqrt(h*h+l*l),s=this._texture.height/2,h/=o,l/=o,h*=s,l*=s,u[n]=r.x+h,u[n+1]=r.y+l,u[n+2]=r.x-h,u[n+3]=r.y-l,a=r;this.containerUpdateTransform()}}},{"../core":29,"./Mesh":124}],126:[function(t,e,r){e.exports={Mesh:t("./Mesh"),Rope:t("./Rope"),MeshRenderer:t("./webgl/MeshRenderer"),MeshShader:t("./webgl/MeshShader")}},{"./Mesh":124,"./Rope":125,"./webgl/MeshRenderer":127,"./webgl/MeshShader":128}],127:[function(t,e,r){function n(t){i.ObjectRenderer.call(this,t),this.indices=new Uint16Array(15e3);for(var e=0,r=0;15e3>e;e+=6,r+=4)this.indices[e+0]=r+0,this.indices[e+1]=r+1,this.indices[e+2]=r+2,this.indices[e+3]=r+0,this.indices[e+4]=r+2,this.indices[e+5]=r+3}var i=t("../../core"),o=t("../Mesh");n.prototype=Object.create(i.ObjectRenderer.prototype),n.prototype.constructor=n,e.exports=n,i.WebGLRenderer.registerPlugin("mesh",n),n.prototype.onContextChange=function(){},n.prototype.render=function(t){t._vertexBuffer||this._initWebGL(t);var e=this.renderer,r=e.gl,n=t._texture.baseTexture,i=e.shaderManager.plugins.meshShader,s=t.drawMode===o.DRAW_MODES.TRIANGLE_MESH?r.TRIANGLE_STRIP:r.TRIANGLES;e.blendModeManager.setBlendMode(t.blendMode),r.uniformMatrix3fv(i.uniforms.translationMatrix._location,!1,t.worldTransform.toArray(!0)),r.uniformMatrix3fv(i.uniforms.projectionMatrix._location,!1,e.currentRenderTarget.projectionMatrix.toArray(!0)),r.uniform1f(i.uniforms.alpha._location,t.worldAlpha),t.dirty?(t.dirty=!1,r.bindBuffer(r.ARRAY_BUFFER,t._vertexBuffer),r.bufferData(r.ARRAY_BUFFER,t.vertices,r.STATIC_DRAW),r.vertexAttribPointer(i.attributes.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,t._uvBuffer),r.bufferData(r.ARRAY_BUFFER,t.uvs,r.STATIC_DRAW),r.vertexAttribPointer(i.attributes.aTextureCoord,2,r.FLOAT,!1,0,0),r.activeTexture(r.TEXTURE0),n._glTextures[r.id]?r.bindTexture(r.TEXTURE_2D,n._glTextures[r.id]):this.renderer.updateTexture(n),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._indexBuffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.indices,r.STATIC_DRAW)):(r.bindBuffer(r.ARRAY_BUFFER,t._vertexBuffer),r.bufferSubData(r.ARRAY_BUFFER,0,t.vertices),r.vertexAttribPointer(i.attributes.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,t._uvBuffer),r.vertexAttribPointer(i.attributes.aTextureCoord,2,r.FLOAT,!1,0,0),r.activeTexture(r.TEXTURE0),n._glTextures[r.id]?r.bindTexture(r.TEXTURE_2D,n._glTextures[r.id]):this.renderer.updateTexture(n),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._indexBuffer),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,t.indices)),r.drawElements(s,t.indices.length,r.UNSIGNED_SHORT,0)},n.prototype._initWebGL=function(t){var e=this.renderer.gl;t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.vertices,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),t.colors&&(t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW)),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},n.prototype.flush=function(){},n.prototype.start=function(){var t=this.renderer.shaderManager.plugins.meshShader;this.renderer.shaderManager.setShader(t)},n.prototype.destroy=function(){}},{"../../core":29,"../Mesh":124}],128:[function(t,e,r){function n(t){i.Shader.call(this,t,["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * alpha ;","}"].join("\n"),{alpha:{type:"1f",value:0},translationMatrix:{type:"mat3",value:new Float32Array(9)},projectionMatrix:{type:"mat3",value:new Float32Array(9)}},{aVertexPosition:0,aTextureCoord:0})}var i=t("../../core");n.prototype=Object.create(i.Shader.prototype),n.prototype.constructor=n,e.exports=n,i.ShaderManager.registerPlugin("meshShader",n)},{"../../core":29}],129:[function(t,e,r){Object.assign||(Object.assign=t("object-assign"))},{"object-assign":12}],130:[function(t,e,r){t("./Object.assign"),t("./requestAnimationFrame")},{"./Object.assign":129,"./requestAnimationFrame":131}],131:[function(t,e,r){(function(t){if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var r=Date.now(),n=["ms","moz","webkit","o"],i=0;in&&(n=0),r=e,setTimeout(function(){r=Date.now(),t(performance.now())},n)}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.html2canvas=t()}}(function(){var t;return function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){var h="function"==typeof require&&require;if(!a&&h)return h(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[s]={exports:{}};t[s][0].call(u.exports,function(e){var r=t[s][1][e];return i(r?r:e)},u,u.exports,e,t,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;st;t+=2){var e=rt[t],r=rt[t+1];e(r),rt[t]=void 0,rt[t+1]=void 0}V=0}function A(){try{var t=e,r=t("vertx");return J=r.runOnLoop||r.runOnContext,c()}catch(n){return p()}}function v(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function y(){return new TypeError("A promises callback cannot return that same promise.")}function x(t){try{return t.then}catch(e){return st.error=e,st}}function w(t,e,r,n){try{t.call(e,r,n)}catch(i){return i}}function E(t,e,r){Z(function(t){var n=!1,i=w(r,e,function(r){n||(n=!0,e!==r?B(t,r):D(t,r))},function(e){n||(n=!0,M(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&i&&(n=!0,M(t,i))},t)}function C(t,e){e._state===it?D(t,e._result):e._state===ot?M(t,e._result):P(e,void 0,function(e){B(t,e)},function(e){M(t,e)})}function b(t,e){if(e.constructor===t.constructor)C(t,e);else{var r=x(e);r===st?M(t,st.error):void 0===r?D(t,e):s(r)?E(t,e,r):D(t,e)}}function B(t,e){t===e?M(t,m()):o(e)?b(t,e):D(t,e)}function T(t){t._onerror&&t._onerror(t._result),R(t)}function D(t,e){t._state===nt&&(t._result=e,t._state=it,0!==t._subscribers.length&&Z(R,t))}function M(t,e){t._state===nt&&(t._state=ot,t._result=e,Z(T,t))}function P(t,e,r,n){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+it]=r,i[o+ot]=n,0===o&&t._state&&Z(R,t)}function R(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n,i,o=t._result,s=0;ss;s++)P(n.resolve(t[s]),void 0,e,r);return i}function H(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(v);return B(r,t),r}function k(t){var e=this,r=new e(v);return M(r,t),r}function G(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Y(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function j(t){this._id=dt++,this._state=void 0,this._result=void 0,this._subscribers=[],v!==t&&(s(t)||G(),this instanceof j||Y(),F(this,t))}function z(){var t;if("undefined"!=typeof i)t=i;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=t.Promise;(!r||"[object Promise]"!==Object.prototype.toString.call(r.resolve())||r.cast)&&(t.Promise=pt)}var U;U=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var J,X,W,K=U,V=0,Z=({}.toString,function(t,e){rt[V]=t,rt[V+1]=e,V+=2,2===V&&(X?X(g):W())}),q="undefined"!=typeof window?window:void 0,_=q||{},$=_.MutationObserver||_.WebKitMutationObserver,tt="undefined"!=typeof n&&"[object process]"==={}.toString.call(n),et="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,rt=new Array(1e3);W=tt?u():$?f():et?d():void 0===q&&"function"==typeof e?A():p();var nt=void 0,it=1,ot=2,st=new I,at=new I;Q.prototype._validateInput=function(t){return K(t)},Q.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},Q.prototype._init=function(){this._result=new Array(this.length)};var ht=Q;Q.prototype._enumerate=function(){for(var t=this,e=t.length,r=t.promise,n=t._input,i=0;r._state===nt&&e>i;i++)t._eachEntry(n[i],i)},Q.prototype._eachEntry=function(t,e){var r=this,n=r._instanceConstructor;a(t)?t.constructor===n&&t._state!==nt?(t._onerror=null,r._settledAt(t._state,e,t._result)):r._willSettleAt(n.resolve(t),e):(r._remaining--,r._result[e]=t)},Q.prototype._settledAt=function(t,e,r){var n=this,i=n.promise;i._state===nt&&(n._remaining--,t===ot?M(i,r):n._result[e]=r),0===n._remaining&&D(i,n._result)},Q.prototype._willSettleAt=function(t,e){var r=this;P(t,void 0,function(t){r._settledAt(it,e,t)},function(t){r._settledAt(ot,e,t)})};var lt=L,ut=N,ct=H,ft=k,dt=0,pt=j;j.all=lt,j.race=ut,j.resolve=ct,j.reject=ft,j._setScheduler=h,j._setAsap=l,j._asap=Z,j.prototype={constructor:j,then:function(t,e){var r=this,n=r._state;if(n===it&&!t||n===ot&&!e)return this;var i=new this.constructor(v),o=r._result;if(n){var s=arguments[n-1];Z(function(){O(n,i,s,o)})}else P(r,i,t,e);return i},"catch":function(t){return this.then(null,t)}};var gt=z,At={Promise:pt,polyfill:gt};"function"==typeof t&&t.amd?t(function(){return At}):"undefined"!=typeof r&&r.exports?r.exports=At:"undefined"!=typeof this&&(this.ES6Promise=At),gt()}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:2}],2:[function(t,e,r){function n(){u=!1,a.length?l=a.concat(l):c=-1,l.length&&i()}function i(){if(!u){var t=setTimeout(n);u=!0;for(var e=l.length;e;){for(a=l,l=[];++c1)for(var r=1;r1&&(n=r[0]+"@",t=r[1]),t=t.replace(O,".");var i=t.split("."),o=s(i,e).join(".");return n+o}function h(t){for(var e,r,n=[],i=0,o=t.length;o>i;)e=t.charCodeAt(i++),e>=55296&&56319>=e&&o>i?(r=t.charCodeAt(i++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--)):n.push(e);return n}function l(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=N(t>>>10&1023|55296),t=56320|1023&t),e+=N(t)}).join("")}function u(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:C}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?L(t/D):t>>1,t+=L(t/e);t>Q*B>>1;n+=C)t=L(t/Q);return L(n+(Q+1)*t/(t+T))}function d(t){var e,r,n,i,s,a,h,c,d,p,g=[],A=t.length,v=0,m=P,y=M;for(r=t.lastIndexOf(R),0>r&&(r=0),n=0;r>n;++n)t.charCodeAt(n)>=128&&o("not-basic"),g.push(t.charCodeAt(n));for(i=r>0?r+1:0;A>i;){for(s=v,a=1,h=C;i>=A&&o("invalid-input"),c=u(t.charCodeAt(i++)),(c>=C||c>L((E-v)/a))&&o("overflow"),v+=c*a,d=y>=h?b:h>=y+B?B:h-y,!(d>c);h+=C)p=C-d,a>L(E/p)&&o("overflow"),a*=p;e=g.length+1,y=f(v-s,e,0==s),L(v/e)>E-m&&o("overflow"),m+=L(v/e),v%=e,g.splice(v++,0,m)}return l(g)}function p(t){var e,r,n,i,s,a,l,u,d,p,g,A,v,m,y,x=[];for(t=h(t),A=t.length,e=P,r=0,s=M,a=0;A>a;++a)g=t[a],128>g&&x.push(N(g));for(n=i=x.length,i&&x.push(R);A>n;){for(l=E,a=0;A>a;++a)g=t[a],g>=e&&l>g&&(l=g);for(v=n+1,l-e>L((E-r)/v)&&o("overflow"),r+=(l-e)*v,e=l,a=0;A>a;++a)if(g=t[a],e>g&&++r>E&&o("overflow"),g==e){for(u=r,d=C;p=s>=d?b:d>=s+B?B:d-s,!(p>u);d+=C)y=u-p,m=C-p,x.push(N(c(p+y%m,0))),u=L(y/m);x.push(N(c(u,0))),s=f(r,v,n==i),r=0,++n}++r,++e}return x.join("")}function g(t){return a(t,function(t){return I.test(t)?d(t.slice(4).toLowerCase()):t})}function A(t){return a(t,function(t){return S.test(t)?"xn--"+p(t):t})}var v="object"==typeof n&&n&&!n.nodeType&&n,m="object"==typeof r&&r&&!r.nodeType&&r,y="object"==typeof e&&e;(y.global===y||y.window===y||y.self===y)&&(i=y);var x,w,E=2147483647,C=36,b=1,B=26,T=38,D=700,M=72,P=128,R="-",I=/^xn--/,S=/[^\x20-\x7E]/,O=/[\x2E\u3002\uFF0E\uFF61]/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Q=C-b,L=Math.floor,N=String.fromCharCode;if(x={version:"1.3.2",ucs2:{decode:h,encode:l},decode:d,encode:p,toASCII:A,toUnicode:g},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return x});else if(v&&m)if(r.exports==v)m.exports=x;else for(w in x)x.hasOwnProperty(w)&&(v[w]=x[w]);else i.punycode=x}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(t,e,r){function n(t,e,r){!t.defaultView||e===t.defaultView.pageXOffset&&r===t.defaultView.pageYOffset||t.defaultView.scrollTo(e,r)}function i(t,e){try{e&&(e.width=t.width,e.height=t.height,e.getContext("2d").putImageData(t.getContext("2d").getImageData(0,0,t.width,t.height),0,0))}catch(r){a("Unable to copy canvas content from",t,r)}}function o(t,e){for(var r=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),n=t.firstChild;n;)(e===!0||1!==n.nodeType||"SCRIPT"!==n.nodeName)&&(console.log(r),r.appendChild(o(n,e))),n=n.nextSibling;return 1===t.nodeType&&"BODY"!==t.tagName&&(r._scrollTop=t.scrollTop,r._scrollLeft=t.scrollLeft,"CANVAS"===t.nodeName?i(t,r):("TEXTAREA"===t.nodeName||"SELECT"===t.nodeName)&&(r.value=t.value)),r}function s(t){if(1===t.nodeType){t.scrollTop=t._scrollTop,t.scrollLeft=t._scrollLeft;for(var e=t.firstChild;e;)s(e),e=e.nextSibling}}var a=t("./log"),h=t("./promise");e.exports=function(t,e,r,i,a,l,u){var c=o(t.documentElement,a.javascriptEnabled),f=e.createElement("iframe");return f.className="html2canvas-container",f.style.visibility="hidden",f.style.position="fixed",f.style.left="-10000px",f.style.top="0px",f.style.border="0",f.style.border="0",f.width=r,f.height=i,f.scrolling="no",e.body.appendChild(f),new h(function(e){var r=f.contentWindow.document;f.contentWindow.onload=f.onload=function(){var t=setInterval(function(){r.body.childNodes.length>0&&(s(r.documentElement),clearInterval(t),"view"===a.type&&(f.contentWindow.scrollTo(l,u),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||f.contentWindow.scrollY===u&&f.contentWindow.scrollX===l||(r.documentElement.style.top=-u+"px",r.documentElement.style.left=-l+"px",r.documentElement.style.position="absolute")),e(f))},50)},r.open(),r.write(""),n(t,l,u),r.replaceChild(r.adoptNode(c),r.documentElement),r.close()})}},{"./log":15,"./promise":18}],5:[function(t,e,r){function n(t){this.r=0,this.g=0,this.b=0,this.a=null;this.fromArray(t)||this.namedColor(t)||this.rgb(t)||this.rgba(t)||this.hex6(t)||this.hex3(t)}n.prototype.darken=function(t){var e=1-t;return new n([Math.round(this.r*e),Math.round(this.g*e),Math.round(this.b*e),this.a])},n.prototype.isTransparent=function(){return 0===this.a},n.prototype.isBlack=function(){return 0===this.r&&0===this.g&&0===this.b},n.prototype.fromArray=function(t){return Array.isArray(t)&&(this.r=Math.min(t[0],255),this.g=Math.min(t[1],255),this.b=Math.min(t[2],255),t.length>3&&(this.a=t[3])),Array.isArray(t)};var i=/^#([a-f0-9]{3})$/i;n.prototype.hex3=function(t){var e=null;return null!==(e=t.match(i))&&(this.r=parseInt(e[1][0]+e[1][0],16),this.g=parseInt(e[1][1]+e[1][1],16),this.b=parseInt(e[1][2]+e[1][2],16)),null!==e};var o=/^#([a-f0-9]{6})$/i;n.prototype.hex6=function(t){var e=null;return null!==(e=t.match(o))&&(this.r=parseInt(e[1].substring(0,2),16),this.g=parseInt(e[1].substring(2,4),16),this.b=parseInt(e[1].substring(4,6),16)),null!==e};var s=/^rgb\((\d{1,3}) *, *(\d{1,3}) *, *(\d{1,3})\)$/;n.prototype.rgb=function(t){var e=null;return null!==(e=t.match(s))&&(this.r=Number(e[1]),this.g=Number(e[2]),this.b=Number(e[3])),null!==e};var a=/^rgba\((\d{1,3}) *, *(\d{1,3}) *, *(\d{1,3}) *, *(\d+\.?\d*)\)$/;n.prototype.rgba=function(t){var e=null;return null!==(e=t.match(a))&&(this.r=Number(e[1]),this.g=Number(e[2]),this.b=Number(e[3]),this.a=Number(e[4])),null!==e},n.prototype.toString=function(){return null!==this.a&&1!==this.a?"rgba("+[this.r,this.g,this.b,this.a].join(",")+")":"rgb("+[this.r,this.g,this.b].join(",")+")"},n.prototype.namedColor=function(t){var e=h[t.toLowerCase()];if(e)this.r=e[0],this.g=e[1],this.b=e[2];else if("transparent"===t.toLowerCase())return this.r=this.g=this.b=this.a=0,!0;return!!e},n.prototype.isColor=!0;var h={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};e.exports=n},{}],6:[function(t,e,r){function n(t,e){var r=C++;if(e=e||{},e.logging&&(window.html2canvas.logging=!0,window.html2canvas.start=Date.now()),e.async="undefined"==typeof e.async?!0:e.async,e.allowTaint="undefined"==typeof e.allowTaint?!1:e.allowTaint,e.removeContainer="undefined"==typeof e.removeContainer?!0:e.removeContainer,e.javascriptEnabled="undefined"==typeof e.javascriptEnabled?!1:e.javascriptEnabled,e.imageTimeout="undefined"==typeof e.imageTimeout?1e4:e.imageTimeout,e.renderer="function"==typeof e.renderer?e.renderer:d,e.strict=!!e.strict,"string"==typeof t){if("string"!=typeof e.proxy)return c.reject("Proxy must be used when rendering url");var n=null!=e.width?e.width:window.innerWidth,s=null!=e.height?e.height:window.innerHeight;return x(u(t),e.proxy,document,n,s,e).then(function(t){return o(t.contentWindow.document.documentElement,t,e,n,s)})}var a=(void 0===t?[document.documentElement]:t.length?t:[t])[0];return a.setAttribute(E+r,r),i(a.ownerDocument,e,a.ownerDocument.defaultView.innerWidth,a.ownerDocument.defaultView.innerHeight,r).then(function(t){return"function"==typeof e.onrendered&&(v("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas"),e.onrendered(t)),t})}function i(t,e,r,n,i){return y(t,t,r,n,e,t.defaultView.pageXOffset,t.defaultView.pageYOffset).then(function(s){v("Document cloned");var a=E+i,h="["+a+"='"+i+"']";t.querySelector(h).removeAttribute(a);var l=s.contentWindow,u=l.document.querySelector(h);"0"===u.style.opacity&&"webgl"===u.getAttribute("renderer")?u.style.opacity=1:null;var f="function"==typeof e.onclone?c.resolve(e.onclone(l.document)):c.resolve(!0);return f.then(function(){return o(u,s,e,r,n)})})}function o(t,e,r,n,i){var o=e.contentWindow,u=new f(o.document),c=new p(r,u),d=w(t),A="view"===r.type?n:h(o.document),m="view"===r.type?i:l(o.document),y=new r.renderer(A,m,c,r,document),x=new g(t,y,u,c,r);return x.ready.then(function(){v("Finished rendering");var n;return"view"===r.type?n=a(y.canvas,{width:y.canvas.width,height:y.canvas.height,top:0,left:0,x:0,y:0}):t===o.document.body||t===o.document.documentElement||null!=r.canvas?n=y.canvas:(1!==window.devicePixelRatio&&(d.top=d.top*window.devicePixelRatio,d.left=d.left*window.devicePixelRatio,d.right=d.right*window.devicePixelRatio,d.bottom=d.bottom*window.devicePixelRatio),n=a(y.canvas,{width:null!=r.width?r.width:d.width,height:null!=r.height?r.height:d.height,top:d.top,left:d.left,x:o.pageXOffset,y:o.pageYOffset})),s(e,r),n})}function s(t,e){e.removeContainer&&(t.parentNode.removeChild(t),v("Cleaned up container"))}function a(t,e){var r=document.createElement("canvas"),n=Math.min(t.width-1,Math.max(0,e.left)),i=Math.min(t.width,Math.max(1,e.left+e.width)),o=Math.min(t.height-1,Math.max(0,e.top)),s=Math.min(t.height,Math.max(1,e.top+e.height));return r.width=e.width,r.height=e.height,v("Cropping canvas at:","left:",e.left,"top:",e.top,"width:",i-n,"height:",s-o),v("Resulting crop with width",e.width,"and height",e.height," with x",n,"and y",o),r.getContext("2d").drawImage(t,n,o,i-n,s-o,e.x,e.y,i-n,s-o),r}function h(t){return Math.max(Math.max(t.body.scrollWidth,t.documentElement.scrollWidth),Math.max(t.body.offsetWidth,t.documentElement.offsetWidth),Math.max(t.body.clientWidth,t.documentElement.clientWidth))}function l(t){return Math.max(Math.max(t.body.scrollHeight,t.documentElement.scrollHeight),Math.max(t.body.offsetHeight,t.documentElement.offsetHeight),Math.max(t.body.clientHeight,t.documentElement.clientHeight))}function u(t){var e=document.createElement("a");return e.href=t,e.href=e.href,e}var c=t("./promise"),f=t("./support"),d=t("./renderers/canvas"),p=t("./imageloader"),g=t("./nodeparser"),A=t("./nodecontainer"),v=t("./log"),m=t("./utils"),y=t("./clone"),x=t("./proxy").loadUrlDocument,w=m.getBounds,E="data-html2canvas-node",C=0;n.Promise=c,n.CanvasRenderer=d,n.NodeContainer=A,n.log=v,n.utils=m,e.exports="undefined"==typeof document||"function"!=typeof Object.create||"function"!=typeof document.createElement("canvas").getContext?function(){return c.reject("No canvas support")}:n},{"./clone":4,"./imageloader":13,"./log":15,"./nodecontainer":16,"./nodeparser":17,"./promise":18,"./proxy":19,"./renderers/canvas":23,"./support":25,"./utils":29}],7:[function(t,e,r){function n(t){if(this.src=t,o("DummyImageContainer for",t),!this.promise||!this.image){o("Initiating DummyImageContainer"),n.prototype.image=new Image;var e=this.image;n.prototype.promise=new i(function(t,r){e.onload=t,e.onerror=r,e.src=s(),e.complete===!0&&t(e)})}}var i=t("./promise"),o=t("./log"),s=t("./utils").smallImage;e.exports=n},{"./log":15,"./promise":18,"./utils":29}],8:[function(t,e,r){function n(t,e){var r,n,o=document.createElement("div"),s=document.createElement("img"),a=document.createElement("span"),h="Hidden Text";o.style.visibility="hidden",o.style.fontFamily=t,o.style.fontSize=e,o.style.margin=0,o.style.padding=0,document.body.appendChild(o),s.src=i(),s.width=1,s.height=1,s.style.margin=0,s.style.padding=0,s.style.verticalAlign="baseline",a.style.fontFamily=t,a.style.fontSize=e,a.style.margin=0,a.style.padding=0,a.appendChild(document.createTextNode(h)),o.appendChild(a),o.appendChild(s),r=s.offsetTop-a.offsetTop+1,o.removeChild(a),o.appendChild(document.createTextNode(h)),o.style.lineHeight="normal",s.style.verticalAlign="super",n=s.offsetTop-o.offsetTop+1,document.body.removeChild(o),this.baseline=r,this.lineWidth=1,this.middle=n}var i=t("./utils").smallImage;e.exports=n},{"./utils":29}],9:[function(t,e,r){function n(){this.data={}}var i=t("./font");n.prototype.getMetrics=function(t,e){return void 0===this.data[t+"-"+e]&&(this.data[t+"-"+e]=new i(t,e)),this.data[t+"-"+e]},e.exports=n},{"./font":8}],10:[function(t,e,r){function n(e,r,n){this.image=null,this.src=e;var i=this,a=s(e);this.promise=(r?new o(function(t){"about:blank"===e.contentWindow.document.URL||null==e.contentWindow.document.documentElement?e.contentWindow.onload=e.onload=function(){t(e)}:t(e)}):this.proxyLoad(n.proxy,a,n)).then(function(e){var r=t("./core");return r(e.contentWindow.document.documentElement,{type:"view",width:e.width,height:e.height,proxy:n.proxy,javascriptEnabled:n.javascriptEnabled,removeContainer:n.removeContainer,allowTaint:n.allowTaint,imageTimeout:n.imageTimeout/2})}).then(function(t){return i.image=t})}var i=t("./utils"),o=t("./promise"),s=i.getBounds,a=t("./proxy").loadUrlDocument;n.prototype.proxyLoad=function(t,e,r){var n=this.src;return a(n.src,t,n.ownerDocument,e.width,e.height,r)},e.exports=n},{"./core":6,"./promise":18,"./proxy":19,"./utils":29}],11:[function(t,e,r){function n(t){this.src=t.value,this.colorStops=[],this.type=null,this.x0=.5,this.y0=.5,this.x1=.5,this.y1=.5,this.promise=i.resolve(!0)}var i=t("./promise");n.prototype.TYPES={LINEAR:1,RADIAL:2},e.exports=n},{"./promise":18}],12:[function(t,e,r){function n(t,e){this.src=t,this.image=new Image;var r=this;this.tainted=null,this.promise=new i(function(n,i){r.image.onload=n,r.image.onerror=i,e&&(r.image.crossOrigin="anonymous"),r.image.src=t,r.image.complete===!0&&n(r.image)})}var i=t("./promise");e.exports=n},{"./promise":18}],13:[function(t,e,r){function n(t,e){this.link=null,this.options=t,this.support=e,this.origin=this.getOrigin(window.location.href)}var i=t("./promise"),o=t("./log"),s=t("./imagecontainer"),a=t("./dummyimagecontainer"),h=t("./proxyimagecontainer"),l=t("./framecontainer"),u=t("./svgcontainer"),c=t("./svgnodecontainer"),f=t("./lineargradientcontainer"),d=t("./webkitgradientcontainer"),p=t("./utils").bind; -n.prototype.findImages=function(t){var e=[];return t.reduce(function(t,e){switch(e.node.nodeName){case"IMG":return t.concat([{args:[e.node.src],method:"url"}]);case"svg":case"IFRAME":return t.concat([{args:[e.node],method:e.node.nodeName}])}return t},[]).forEach(this.addImage(e,this.loadImage),this),e},n.prototype.findBackgroundImage=function(t,e){return e.parseBackgroundImages().filter(this.hasImageBackground).forEach(this.addImage(t,this.loadImage),this),t},n.prototype.addImage=function(t,e){return function(r){r.args.forEach(function(n){this.imageExists(t,n)||(t.splice(0,0,e.call(this,r)),o("Added image #"+t.length,"string"==typeof n?n.substring(0,100):n))},this)}},n.prototype.hasImageBackground=function(t){return"none"!==t.method},n.prototype.loadImage=function(t){if("url"===t.method){var e=t.args[0];return!this.isSVG(e)||this.support.svg||this.options.allowTaint?e.match(/data:image\/.*;base64,/i)?new s(e.replace(/url\(['"]{0,}|['"]{0,}\)$/gi,""),!1):this.isSameOrigin(e)||this.options.allowTaint===!0||this.isSVG(e)?new s(e,!1):this.support.cors&&!this.options.allowTaint&&this.options.useCORS?new s(e,!0):this.options.proxy?new h(e,this.options.proxy):new a(e):new u(e)}return"linear-gradient"===t.method?new f(t):"gradient"===t.method?new d(t):"svg"===t.method?new c(t.args[0],this.support.svg):"IFRAME"===t.method?new l(t.args[0],this.isSameOrigin(t.args[0].src),this.options):new a(t)},n.prototype.isSVG=function(t){return"svg"===t.substring(t.length-3).toLowerCase()||u.prototype.isInline(t)},n.prototype.imageExists=function(t,e){return t.some(function(t){return t.src===e})},n.prototype.isSameOrigin=function(t){return this.getOrigin(t)===this.origin},n.prototype.getOrigin=function(t){var e=this.link||(this.link=document.createElement("a"));return e.href=t,e.href=e.href,e.protocol+e.hostname+e.port},n.prototype.getPromise=function(t){return this.timeout(t,this.options.imageTimeout)["catch"](function(){var e=new a(t.src);return e.promise.then(function(e){t.image=e})})},n.prototype.get=function(t){var e=null;return this.images.some(function(r){return(e=r).src===t})?e:null},n.prototype.fetch=function(t){return this.images=t.reduce(p(this.findBackgroundImage,this),this.findImages(t)),this.images.forEach(function(t,e){t.promise.then(function(){o("Succesfully loaded image #"+(e+1),t)},function(r){o("Failed loading image #"+(e+1),t,r)})}),this.ready=i.all(this.images.map(this.getPromise,this)),o("Finished searching images"),this},n.prototype.timeout=function(t,e){var r,n=i.race([t.promise,new i(function(n,i){r=setTimeout(function(){o("Timed out loading image",t),i(t)},e)})]).then(function(t){return clearTimeout(r),t});return n["catch"](function(){clearTimeout(r)}),n},e.exports=n},{"./dummyimagecontainer":7,"./framecontainer":10,"./imagecontainer":12,"./lineargradientcontainer":14,"./log":15,"./promise":18,"./proxyimagecontainer":20,"./svgcontainer":26,"./svgnodecontainer":27,"./utils":29,"./webkitgradientcontainer":30}],14:[function(t,e,r){function n(t){i.apply(this,arguments),this.type=this.TYPES.LINEAR;var e=null===t.args[0].match(this.stepRegExp);e?t.args[0].split(" ").reverse().forEach(function(t){switch(t){case"left":this.x0=0,this.x1=1;break;case"top":this.y0=0,this.y1=1;break;case"right":this.x0=1,this.x1=0;break;case"bottom":this.y0=1,this.y1=0;break;case"to":var e=this.y0,r=this.x0;this.y0=this.y1,this.x0=this.x1,this.x1=r,this.y1=e}},this):(this.y0=0,this.y1=1),this.colorStops=t.args.slice(e?1:0).map(function(t){var e=t.match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)|\w+)\s*(\d{1,3})?(%|px)?/);return{color:new o(e[1]),stop:"%"===e[3]?e[2]/100:null}},this),null===this.colorStops[0].stop&&(this.colorStops[0].stop=0),null===this.colorStops[this.colorStops.length-1].stop&&(this.colorStops[this.colorStops.length-1].stop=1),this.colorStops.forEach(function(t,e){null===t.stop&&this.colorStops.slice(e).some(function(r,n){return null!==r.stop?(t.stop=(r.stop-this.colorStops[e-1].stop)/(n+1)+this.colorStops[e-1].stop,!0):!1},this)},this)}var i=t("./gradientcontainer"),o=t("./color");n.prototype=Object.create(i.prototype),n.prototype.stepRegExp=/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/,e.exports=n},{"./color":5,"./gradientcontainer":11}],15:[function(t,e,r){e.exports=function(){window.html2canvas.logging&&window.console&&window.console.log&&Function.prototype.bind.call(window.console.log,window.console).apply(window.console,[Date.now()-window.html2canvas.start+"ms","html2canvas:"].concat([].slice.call(arguments,0)))}},{}],16:[function(t,e,r){function n(t,e){this.node=t,this.parent=e,this.stack=null,this.bounds=null,this.borders=null,this.clip=[],this.backgroundClip=[],this.offsetBounds=null,this.visible=null,this.computedStyles=null,this.colors={},this.styles={},this.backgroundImages=null,this.transformData=null,this.transformMatrix=null,this.isPseudoElement=!1,this.opacity=null}function i(t){var e=t.options[t.selectedIndex||0];return e?e.text||"":""}function o(t){if(t&&"matrix"===t[1])return t[2].split(",").map(function(t){return parseFloat(t.trim())});if(t&&"matrix3d"===t[1]){var e=t[2].split(",").map(function(t){return parseFloat(t.trim())});return[e[0],e[1],e[4],e[5],e[12],e[13]]}}function s(t){return-1!==t.toString().indexOf("%")}function a(t){return t.replace("px","")}function h(t){return parseFloat(t)}var l=t("./color"),u=t("./utils"),c=u.getBounds,f=u.parseBackgrounds,d=u.offsetBounds;n.prototype.cloneTo=function(t){t.visible=this.visible,t.borders=this.borders,t.bounds=this.bounds,t.clip=this.clip,t.backgroundClip=this.backgroundClip,t.computedStyles=this.computedStyles,t.styles=this.styles,t.backgroundImages=this.backgroundImages,t.opacity=this.opacity},n.prototype.getOpacity=function(){return null===this.opacity?this.opacity=this.cssFloat("opacity"):this.opacity},n.prototype.assignStack=function(t){this.stack=t,t.children.push(this)},n.prototype.isElementVisible=function(){return this.node.nodeType===Node.TEXT_NODE?this.parent.visible:"none"!==this.css("display")&&"hidden"!==this.css("visibility")&&!this.node.hasAttribute("data-html2canvas-ignore")&&("INPUT"!==this.node.nodeName||"hidden"!==this.node.getAttribute("type"))},n.prototype.css=function(t){return this.computedStyles||(this.computedStyles=this.isPseudoElement?this.parent.computedStyle(this.before?":before":":after"):this.computedStyle(null)),this.styles[t]||(this.styles[t]=this.computedStyles[t])},n.prototype.prefixedCss=function(t){var e=["webkit","moz","ms","o"],r=this.css(t);return void 0===r&&e.some(function(e){return r=this.css(e+t.substr(0,1).toUpperCase()+t.substr(1)),void 0!==r},this),void 0===r?null:r},n.prototype.computedStyle=function(t){return this.node.ownerDocument.defaultView.getComputedStyle(this.node,t)},n.prototype.cssInt=function(t){var e=parseInt(this.css(t),10);return isNaN(e)?0:e},n.prototype.color=function(t){return this.colors[t]||(this.colors[t]=new l(this.css(t)))},n.prototype.cssFloat=function(t){var e=parseFloat(this.css(t));return isNaN(e)?0:e},n.prototype.fontWeight=function(){var t=this.css("fontWeight");switch(parseInt(t,10)){case 401:t="bold";break;case 400:t="normal"}return t},n.prototype.parseClip=function(){var t=this.css("clip").match(this.CLIP);return t?{top:parseInt(t[1],10),right:parseInt(t[2],10),bottom:parseInt(t[3],10),left:parseInt(t[4],10)}:null},n.prototype.parseBackgroundImages=function(){return this.backgroundImages||(this.backgroundImages=f(this.css("backgroundImage")))},n.prototype.cssList=function(t,e){var r=(this.css(t)||"").split(",");return r=r[e||0]||r[0]||"auto",r=r.trim().split(" "),1===r.length&&(r=[r[0],s(r[0])?"auto":r[0]]),r},n.prototype.parseBackgroundSize=function(t,e,r){var n,i,o=this.cssList("backgroundSize",r);if(s(o[0]))n=t.width*parseFloat(o[0])/100;else{if(/contain|cover/.test(o[0])){var a=t.width/t.height,h=e.width/e.height;return h>a^"contain"===o[0]?{width:t.height*h,height:t.height}:{width:t.width,height:t.width/h}}n=parseInt(o[0],10)}return i="auto"===o[0]&&"auto"===o[1]?e.height:"auto"===o[1]?n/e.width*e.height:s(o[1])?t.height*parseFloat(o[1])/100:parseInt(o[1],10),"auto"===o[0]&&(n=i/e.height*e.width),{width:n,height:i}},n.prototype.parseBackgroundPosition=function(t,e,r,n){var i,o,a=this.cssList("backgroundPosition",r);return i=s(a[0])?(t.width-(n||e).width)*(parseFloat(a[0])/100):parseInt(a[0],10),o="auto"===a[1]?i/e.width*e.height:s(a[1])?(t.height-(n||e).height)*parseFloat(a[1])/100:parseInt(a[1],10),"auto"===a[0]&&(i=o/e.height*e.width),{left:i,top:o}},n.prototype.parseBackgroundRepeat=function(t){return this.cssList("backgroundRepeat",t)[0]},n.prototype.parseTextShadows=function(){var t=this.css("textShadow"),e=[];if(t&&"none"!==t)for(var r=t.match(this.TEXT_SHADOW_PROPERTY),n=0;r&&n0?(this.renderIndex=0,this.asyncRenderer(this.renderQueue,t)):t():(this.renderQueue.forEach(this.paint,this),t())},this))},this))}function i(t){return t.parent&&t.parent.clip.length}function o(t){return t.replace(/(\-[a-z])/g,function(t){return t.toUpperCase().replace("-","")})}function s(){}function a(t,e,r,n){return t.map(function(i,o){if(i.width>0){var s=e.left,a=e.top,h=e.width,l=e.height-t[2].width;switch(o){case 0:l=t[0].width,i.args=c({c1:[s,a],c2:[s+h,a],c3:[s+h-t[1].width,a+l],c4:[s+t[3].width,a+l]},n[0],n[1],r.topLeftOuter,r.topLeftInner,r.topRightOuter,r.topRightInner);break;case 1:s=e.left+e.width-t[1].width,h=t[1].width,i.args=c({c1:[s+h,a],c2:[s+h,a+l+t[2].width],c3:[s,a+l],c4:[s,a+t[0].width]},n[1],n[2],r.topRightOuter,r.topRightInner,r.bottomRightOuter,r.bottomRightInner);break;case 2:a=a+e.height-t[2].width,l=t[2].width,i.args=c({c1:[s+h,a+l],c2:[s,a+l],c3:[s+t[3].width,a],c4:[s+h-t[3].width,a]},n[2],n[3],r.bottomRightOuter,r.bottomRightInner,r.bottomLeftOuter,r.bottomLeftInner);break;case 3:h=t[3].width,i.args=c({c1:[s,a+l+t[2].width],c2:[s,a],c3:[s+h,a+t[0].width],c4:[s+h,a+l]},n[3],n[0],r.bottomLeftOuter,r.bottomLeftInner,r.topLeftOuter,r.topLeftInner)}}return i})}function h(t,e,r,n){var i=4*((Math.sqrt(2)-1)/3),o=r*i,s=n*i,a=t+r,h=e+n;return{topLeft:u({x:t,y:h},{x:t,y:h-s},{x:a-o,y:e},{x:a,y:e}),topRight:u({x:t,y:e},{x:t+o,y:e},{x:a,y:h-s},{x:a,y:h}),bottomRight:u({x:a,y:e},{x:a,y:e+s},{x:t+o,y:h},{x:t,y:h}),bottomLeft:u({x:a,y:h},{x:a-o,y:h},{x:t,y:e+s},{x:t,y:e})}}function l(t,e,r){var n=t.left,i=t.top,o=t.width,s=t.height,a=e[0][0],l=e[0][1],u=e[1][0],c=e[1][1],f=e[2][0],d=e[2][1],p=e[3][0],g=e[3][1],A=Math.floor(s/2);a=a>A?A:a,l=l>A?A:l,u=u>A?A:u,c=c>A?A:c,f=f>A?A:f,d=d>A?A:d,p=p>A?A:p,g=g>A?A:g;var v=o-u,m=s-d,y=o-f,x=s-g;return{topLeftOuter:h(n,i,a,l).topLeft.subdivide(.5),topLeftInner:h(n+r[3].width,i+r[0].width,Math.max(0,a-r[3].width),Math.max(0,l-r[0].width)).topLeft.subdivide(.5),topRightOuter:h(n+v,i,u,c).topRight.subdivide(.5),topRightInner:h(n+Math.min(v,o+r[3].width),i+r[0].width,v>o+r[3].width?0:u-r[3].width,c-r[0].width).topRight.subdivide(.5),bottomRightOuter:h(n+y,i+m,f,d).bottomRight.subdivide(.5),bottomRightInner:h(n+Math.min(y,o-r[3].width),i+Math.min(m,s+r[0].width),Math.max(0,f-r[1].width),d-r[2].width).bottomRight.subdivide(.5),bottomLeftOuter:h(n,i+x,p,g).bottomLeft.subdivide(.5),bottomLeftInner:h(n+r[3].width,i+x,Math.max(0,p-r[3].width),g-r[2].width).bottomLeft.subdivide(.5)}}function u(t,e,r,n){var i=function(t,e,r){return{x:t.x+(e.x-t.x)*r,y:t.y+(e.y-t.y)*r}};return{start:t,startControl:e,endControl:r,end:n,subdivide:function(o){var s=i(t,e,o),a=i(e,r,o),h=i(r,n,o),l=i(s,a,o),c=i(a,h,o),f=i(l,c,o);return[u(t,s,l,f),u(f,c,h,n)]},curveTo:function(t){t.push(["bezierCurve",e.x,e.y,r.x,r.y,n.x,n.y])},curveToReversed:function(n){n.push(["bezierCurve",r.x,r.y,e.x,e.y,t.x,t.y])}}}function c(t,e,r,n,i,o,s){var a=[];return e[0]>0||e[1]>0?(a.push(["line",n[1].start.x,n[1].start.y]),n[1].curveTo(a)):a.push(["line",t.c1[0],t.c1[1]]),r[0]>0||r[1]>0?(a.push(["line",o[0].start.x,o[0].start.y]),o[0].curveTo(a),a.push(["line",s[0].end.x,s[0].end.y]),s[0].curveToReversed(a)):(a.push(["line",t.c2[0],t.c2[1]]),a.push(["line",t.c3[0],t.c3[1]])),e[0]>0||e[1]>0?(a.push(["line",i[1].end.x,i[1].end.y]),i[1].curveToReversed(a)):a.push(["line",t.c4[0],t.c4[1]]),a}function f(t,e,r,n,i,o,s){e[0]>0||e[1]>0?(t.push(["line",n[0].start.x,n[0].start.y]),n[0].curveTo(t),n[1].curveTo(t)):t.push(["line",o,s]),(r[0]>0||r[1]>0)&&t.push(["line",i[0].start.x,i[0].start.y])}function d(t){return t.cssInt("zIndex")<0}function p(t){return t.cssInt("zIndex")>0}function g(t){return 0===t.cssInt("zIndex")}function A(t){return-1!==["inline","inline-block","inline-table"].indexOf(t.css("display"))}function v(t){return t instanceof K}function m(t){return t.node.data.trim().length>0}function y(t){return/^(normal|none|0px)$/.test(t.parent.css("letterSpacing"))}function x(t){return["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(e){var r=t.css("border"+e+"Radius"),n=r.split(" ");return n.length<=1&&(n[1]=n[0]),n.map(S)})}function w(t){return t.nodeType===Node.TEXT_NODE||t.nodeType===Node.ELEMENT_NODE}function E(t){var e=t.css("position"),r=-1!==["absolute","relative","fixed"].indexOf(e)?t.css("zIndex"):"auto";return"auto"!==r}function C(t){return"static"!==t.css("position")}function b(t){return"none"!==t.css("float")}function B(t){return-1!==["inline-block","inline-table"].indexOf(t.css("display"))}function T(t){var e=this;return function(){return!t.apply(e,arguments)}}function D(t){return t.node.nodeType===Node.ELEMENT_NODE}function M(t){return t.isPseudoElement===!0}function P(t){return t.node.nodeType===Node.TEXT_NODE}function R(t){return function(e,r){return e.cssInt("zIndex")+t.indexOf(e)/t.length-(r.cssInt("zIndex")+t.indexOf(r)/t.length)}}function I(t){return t.getOpacity()<1}function S(t){return parseInt(t,10)}function O(t){return t.width}function F(t){return t.node.nodeType!==Node.ELEMENT_NODE||-1===["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"].indexOf(t.node.nodeName)}function Q(t){return[].concat.apply([],t)}function L(t){var e=t.substr(0,1);return e===t.substr(t.length-1)&&e.match(/'|"/)?t.substr(1,t.length-2):t}function N(t){for(var e,r=[],n=0,i=!1;t.length;)H(t[n])===i?(e=t.splice(0,n),e.length&&r.push(Y.ucs2.encode(e)),i=!i,n=0):n++,n>=t.length&&(e=t.splice(0,n),e.length&&r.push(Y.ucs2.encode(e)));return r}function H(t){return-1!==[32,13,10,9,45].indexOf(t)}function k(t){return/[^\u0000-\u00ff]/.test(t)}var G=t("./log"),Y=t("punycode"),j=t("./nodecontainer"),z=t("./textcontainer"),U=t("./pseudoelementcontainer"),J=t("./fontmetrics"),X=t("./color"),W=t("./promise"),K=t("./stackingcontext"),V=t("./utils"),Z=V.bind,q=V.getBounds,_=V.parseBackgrounds,$=V.offsetBounds;n.prototype.calculateOverflowClips=function(){this.nodes.forEach(function(t){if(D(t)){M(t)&&t.appendToDOM(),t.borders=this.parseBorders(t);var e="hidden"===t.css("overflow")?[t.borders.clip]:[],r=t.parseClip();r&&-1!==["absolute","fixed"].indexOf(t.css("position"))&&e.push([["rect",t.bounds.left+r.left,t.bounds.top+r.top,r.right-r.left,r.bottom-r.top]]),t.clip=i(t)?t.parent.clip.concat(e):e,t.backgroundClip="hidden"!==t.css("overflow")?t.clip.concat([t.borders.clip]):t.clip,M(t)&&t.cleanDOM()}else P(t)&&(t.clip=i(t)?t.parent.clip:[]);M(t)||(t.bounds=null)},this)},n.prototype.asyncRenderer=function(t,e,r){r=r||Date.now(),this.paint(t[this.renderIndex++]),t.length===this.renderIndex?e():r+20>Date.now()?this.asyncRenderer(t,e,r):setTimeout(Z(function(){this.asyncRenderer(t,e)},this),0)},n.prototype.createPseudoHideStyles=function(t){this.createStyles(t,"."+U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+':before { content: "" !important; display: none !important; }.'+U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER+':after { content: "" !important; display: none !important; }')},n.prototype.disableAnimations=function(t){this.createStyles(t,"* { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; animation: none !important; -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; transition: none !important;}")},n.prototype.createStyles=function(t,e){var r=t.createElement("style");r.innerHTML=e,t.body.appendChild(r)},n.prototype.getPseudoElements=function(t){var e=[[t]];if(t.node.nodeType===Node.ELEMENT_NODE){var r=this.getPseudoElement(t,":before"),n=this.getPseudoElement(t,":after");r&&e.push(r),n&&e.push(n)}return Q(e)},n.prototype.getPseudoElement=function(t,e){var r=t.computedStyle(e);if(!r||!r.content||"none"===r.content||"-moz-alt-content"===r.content||"none"===r.display)return null;for(var n=L(r.content),i="url"===n.substr(0,3),s=document.createElement(i?"img":"html2canvaspseudoelement"),a=new U(s,t,e),h=r.length-1;h>=0;h--){var l=o(r.item(h));s.style[l]=r[l]}if(s.className=U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+" "+U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER,i)return s.src=_(n)[0].args[0],[a];var u=document.createTextNode(n);return s.appendChild(u),[a,new z(u,a)]},n.prototype.getChildren=function(t){return Q([].filter.call(t.node.childNodes,w).map(function(e){var r=[e.nodeType===Node.TEXT_NODE?new z(e,t):new j(e,t)].filter(F);return e.nodeType===Node.ELEMENT_NODE&&r.length&&"TEXTAREA"!==e.tagName?r[0].isElementVisible()?r.concat(this.getChildren(r[0])):[]:r},this))},n.prototype.newStackingContext=function(t,e){var r=new K(e,t.getOpacity(),t.node,t.parent);t.cloneTo(r);var n=e?r.getParentStack(this):r.parent.stack;n.contexts.push(r),t.stack=r},n.prototype.createStackingContexts=function(){this.nodes.forEach(function(t){D(t)&&(this.isRootElement(t)||I(t)||E(t)||this.isBodyWithTransparentRoot(t)||t.hasTransform())?this.newStackingContext(t,!0):D(t)&&(C(t)&&g(t)||B(t)||b(t))?this.newStackingContext(t,!1):t.assignStack(t.parent.stack)},this)},n.prototype.isBodyWithTransparentRoot=function(t){return"BODY"===t.node.nodeName&&t.parent.color("backgroundColor").isTransparent()},n.prototype.isRootElement=function(t){return null===t.parent},n.prototype.sortStackingContexts=function(t){t.contexts.sort(R(t.contexts.slice(0))),t.contexts.forEach(this.sortStackingContexts,this)},n.prototype.parseTextBounds=function(t){return function(e,r,n){if("none"!==t.parent.css("textDecoration").substr(0,4)||0!==e.trim().length){if(this.support.rangeBounds&&!t.parent.hasTransform()){var i=n.slice(0,r).join("").length;return this.getRangeBounds(t.node,i,e.length)}if(t.node&&"string"==typeof t.node.data){var o=t.node.splitText(e.length),s=this.getWrapperBounds(t.node,t.parent.hasTransform());return t.node=o,s}}else(!this.support.rangeBounds||t.parent.hasTransform())&&(t.node=t.node.splitText(e.length));return{}}},n.prototype.getWrapperBounds=function(t,e){var r=t.ownerDocument.createElement("html2canvaswrapper"),n=t.parentNode,i=t.cloneNode(!0);r.appendChild(t.cloneNode(!0)),n.replaceChild(r,t);var o=e?$(r):q(r);return n.replaceChild(i,r),o},n.prototype.getRangeBounds=function(t,e,r){var n=this.range||(this.range=t.ownerDocument.createRange());return n.setStart(t,e),n.setEnd(t,e+r),n.getBoundingClientRect()},n.prototype.parse=function(t){var e=t.contexts.filter(d),r=t.children.filter(D),n=r.filter(T(b)),i=n.filter(T(C)).filter(T(A)),o=r.filter(T(C)).filter(b),a=n.filter(T(C)).filter(A),h=t.contexts.concat(n.filter(C)).filter(g),l=t.children.filter(P).filter(m),u=t.contexts.filter(p);e.concat(i).concat(o).concat(a).concat(h).concat(l).concat(u).forEach(function(t){this.renderQueue.push(t),v(t)&&(this.parse(t),this.renderQueue.push(new s))},this)},n.prototype.paint=function(t){try{t instanceof s?this.renderer.ctx.restore():P(t)?(M(t.parent)&&t.parent.appendToDOM(),this.paintText(t),M(t.parent)&&t.parent.cleanDOM()):this.paintNode(t)}catch(e){if(G(e),this.options.strict)throw e}},n.prototype.paintNode=function(t){v(t)&&(this.renderer.setOpacity(t.opacity),this.renderer.ctx.save(),t.hasTransform()&&this.renderer.setTransform(t.parseTransform())),"INPUT"===t.node.nodeName&&"checkbox"===t.node.type?this.paintCheckbox(t):"INPUT"===t.node.nodeName&&"radio"===t.node.type?this.paintRadio(t):this.paintElement(t)},n.prototype.paintElement=function(t){var e=t.parseBounds();this.renderer.clip(t.backgroundClip,function(){this.renderer.renderBackground(t,e,t.borders.borders.map(O))},this),this.renderer.clip(t.clip,function(){this.renderer.renderBorders(t.borders.borders)},this),this.renderer.clip(t.backgroundClip,function(){switch(t.node.nodeName){case"svg":case"IFRAME":var r=this.images.get(t.node);r?this.renderer.renderImage(t,e,t.borders,r):G("Error loading <"+t.node.nodeName+">",t.node);break;case"IMG":var n=this.images.get(t.node.src);n?this.renderer.renderImage(t,e,t.borders,n):G("Error loading ",t.node.src);break;case"CANVAS":this.renderer.renderImage(t,e,t.borders,{image:t.node});break;case"SELECT":case"INPUT":case"TEXTAREA":this.paintFormValue(t)}},this)},n.prototype.paintCheckbox=function(t){var e=t.parseBounds(),r=Math.min(e.width,e.height),n={width:r-1,height:r-1,top:e.top,left:e.left},i=[3,3],o=[i,i,i,i],s=[1,1,1,1].map(function(t){return{color:new X("#A5A5A5"),width:t}}),h=l(n,o,s);this.renderer.clip(t.backgroundClip,function(){this.renderer.rectangle(n.left+1,n.top+1,n.width-2,n.height-2,new X("#DEDEDE")),this.renderer.renderBorders(a(s,n,h,o)),t.node.checked&&(this.renderer.font(new X("#424242"),"normal","normal","bold",r-3+"px","arial"),this.renderer.text("✔",n.left+r/6,n.top+r-1))},this)},n.prototype.paintRadio=function(t){var e=t.parseBounds(),r=Math.min(e.width,e.height)-2;this.renderer.clip(t.backgroundClip,function(){this.renderer.circleStroke(e.left+1,e.top+1,r,new X("#DEDEDE"),1,new X("#A5A5A5")),t.node.checked&&this.renderer.circle(Math.ceil(e.left+r/4)+1,Math.ceil(e.top+r/4)+1,Math.floor(r/2),new X("#424242"))},this)},n.prototype.paintFormValue=function(t){var e=t.getValue();if(e.length>0){var r=t.node.ownerDocument,n=r.createElement("html2canvaswrapper"),i=["lineHeight","textAlign","fontFamily","fontWeight","fontSize","color","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","borderLeftStyle","borderTopStyle","borderLeftWidth","borderTopWidth","boxSizing","whiteSpace","wordWrap"];i.forEach(function(e){try{n.style[e]=t.css(e)}catch(r){G("html2canvas: Parse: Exception caught in renderFormValue: "+r.message)}});var o=t.parseBounds();n.style.position="fixed",n.style.left=o.left+"px",n.style.top=o.top+"px",n.textContent=e,r.body.appendChild(n),this.paintText(new z(n.firstChild,t)),r.body.removeChild(n)}},n.prototype.paintText=function(t){t.applyTextTransform();var e=Y.ucs2.decode(t.node.data),r=this.options.letterRendering&&!y(t)||k(t.node.data)?e.map(function(t){return Y.ucs2.encode([t])}):N(e),n=t.parent.fontWeight(),i=t.parent.css("fontSize"),o=t.parent.css("fontFamily"),s=t.parent.parseTextShadows();this.renderer.font(t.parent.color("color"),t.parent.css("fontStyle"),t.parent.css("fontVariant"),n,i,o),s.length?this.renderer.fontShadow(s[0].color,s[0].offsetX,s[0].offsetY,s[0].blur):this.renderer.clearShadow(),this.renderer.clip(t.parent.clip,function(){r.map(this.parseTextBounds(t),this).forEach(function(e,n){e&&(this.renderer.text(r[n],e.left,e.bottom),this.renderTextDecoration(t.parent,e,this.fontMetrics.getMetrics(o,i)))},this)},this)},n.prototype.renderTextDecoration=function(t,e,r){switch(t.css("textDecoration").split(" ")[0]){case"underline":this.renderer.rectangle(e.left,Math.round(e.top+r.baseline+r.lineWidth),e.width,1,t.color("color"));break;case"overline":this.renderer.rectangle(e.left,Math.round(e.top),e.width,1,t.color("color"));break;case"line-through":this.renderer.rectangle(e.left,Math.ceil(e.top+r.middle+r.lineWidth),e.width,1,t.color("color"))}};var tt={inset:[["darken",.6],["darken",.1],["darken",.1],["darken",.6]]};n.prototype.parseBorders=function(t){var e=t.parseBounds(),r=x(t),n=["Top","Right","Bottom","Left"].map(function(e,r){var n=t.css("border"+e+"Style"),i=t.color("border"+e+"Color");"inset"===n&&i.isBlack()&&(i=new X([255,255,255,i.a]));var o=tt[n]?tt[n][r]:null;return{width:t.cssInt("border"+e+"Width"),color:o?i[o[0]](o[1]):i,args:null}}),i=l(e,r,n);return{clip:this.parseBackgroundClip(t,i,n,r,e),borders:a(n,e,i,r)}},n.prototype.parseBackgroundClip=function(t,e,r,n,i){var o=t.css("backgroundClip"),s=[];switch(o){case"content-box":case"padding-box":f(s,n[0],n[1],e.topLeftInner,e.topRightInner,i.left+r[3].width,i.top+r[0].width),f(s,n[1],n[2],e.topRightInner,e.bottomRightInner,i.left+i.width-r[1].width,i.top+r[0].width),f(s,n[2],n[3],e.bottomRightInner,e.bottomLeftInner,i.left+i.width-r[1].width,i.top+i.height-r[2].width),f(s,n[3],n[0],e.bottomLeftInner,e.topLeftInner,i.left+r[3].width,i.top+i.height-r[2].width);break;default:f(s,n[0],n[1],e.topLeftOuter,e.topRightOuter,i.left,i.top),f(s,n[1],n[2],e.topRightOuter,e.bottomRightOuter,i.left+i.width,i.top),f(s,n[2],n[3],e.bottomRightOuter,e.bottomLeftOuter,i.left+i.width,i.top+i.height),f(s,n[3],n[0],e.bottomLeftOuter,e.topLeftOuter,i.left,i.top+i.height)}return s},e.exports=n},{"./color":5,"./fontmetrics":9,"./log":15,"./nodecontainer":16,"./promise":18,"./pseudoelementcontainer":21,"./stackingcontext":24,"./textcontainer":28,"./utils":29,punycode:3}],18:[function(t,e,r){e.exports=t("es6-promise").Promise},{"es6-promise":1}],19:[function(t,e,r){function n(t,e,r){var n="withCredentials"in new XMLHttpRequest;if(!e)return u.reject("No proxy configured");var i=s(n),h=a(e,t,i);return n?c(h):o(r,h,i).then(function(t){return g(t.content)})}function i(t,e,r){var n="crossOrigin"in new Image,i=s(n),h=a(e,t,i);return n?u.resolve(h):o(r,h,i).then(function(t){return"data:"+t.type+";base64,"+t.content})}function o(t,e,r){return new u(function(n,i){var o=t.createElement("script"),s=function(){delete window.html2canvas.proxy[r],t.body.removeChild(o)};window.html2canvas.proxy[r]=function(t){s(),n(t)},o.src=e,o.onerror=function(t){s(),i(t)},t.body.appendChild(o)})}function s(t){return t?"":"html2canvas_"+Date.now()+"_"+ ++A+"_"+Math.round(1e5*Math.random())}function a(t,e,r){return t+"?url="+encodeURIComponent(e)+(r.length?"&callback=html2canvas.proxy."+r:"")}function h(t){return function(e){var r,n=new DOMParser;try{r=n.parseFromString(e,"text/html")}catch(i){d("DOMParser not supported, falling back to createHTMLDocument"),r=document.implementation.createHTMLDocument("");try{r.open(),r.write(e),r.close()}catch(o){d("createHTMLDocument write not supported, falling back to document.body.innerHTML"),r.body.innerHTML=e}}var s=r.querySelector("base");if(!s||!s.href.host){var a=r.createElement("base");a.href=t,r.head.insertBefore(a,r.head.firstChild)}return r}}function l(t,e,r,i,o,s){return new n(t,e,window.document).then(h(t)).then(function(t){return p(t,r,i,o,s,0,0)})}var u=t("./promise"),c=t("./xhr"),f=t("./utils"),d=t("./log"),p=t("./clone"),g=f.decode64,A=0;r.Proxy=n,r.ProxyURL=i,r.loadUrlDocument=l},{"./clone":4,"./log":15,"./promise":18,"./utils":29,"./xhr":31}],20:[function(t,e,r){function n(t,e){var r=document.createElement("a");r.href=t,t=r.href,this.src=t,this.image=new Image;var n=this;this.promise=new o(function(r,o){n.image.crossOrigin="Anonymous",n.image.onload=r,n.image.onerror=o,new i(t,e,document).then(function(t){n.image.src=t})["catch"](o)})}var i=t("./proxy").ProxyURL,o=t("./promise");e.exports=n},{"./promise":18,"./proxy":19}],21:[function(t,e,r){function n(t,e,r){i.call(this,t,e),this.isPseudoElement=!0,this.before=":before"===r}var i=t("./nodecontainer");n.prototype.cloneTo=function(t){n.prototype.cloneTo.call(this,t),t.isPseudoElement=!0,t.before=this.before},n.prototype=Object.create(i.prototype),n.prototype.appendToDOM=function(){this.before?this.parent.node.insertBefore(this.node,this.parent.node.firstChild):this.parent.node.appendChild(this.node),this.parent.node.className+=" "+this.getHideClass()},n.prototype.cleanDOM=function(){this.node.parentNode.removeChild(this.node),this.parent.node.className=this.parent.node.className.replace(this.getHideClass(),"")},n.prototype.getHideClass=function(){return this["PSEUDO_HIDE_ELEMENT_CLASS_"+(this.before?"BEFORE":"AFTER")]},n.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE="___html2canvas___pseudoelement_before",n.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER="___html2canvas___pseudoelement_after",e.exports=n},{"./nodecontainer":16}],22:[function(t,e,r){function n(t,e,r,n,i){this.width=t,this.height=e,this.images=r,this.options=n,this.document=i}var i=t("./log");n.prototype.renderImage=function(t,e,r,n){var i=t.cssInt("paddingLeft"),o=t.cssInt("paddingTop"),s=t.cssInt("paddingRight"),a=t.cssInt("paddingBottom"),h=r.borders,l=e.width-(h[1].width+h[3].width+i+s),u=e.height-(h[0].width+h[2].width+o+a);this.drawImage(n,0,0,n.image.width||l,n.image.height||u,e.left+i+h[3].width,e.top+o+h[0].width,l,u)},n.prototype.renderBackground=function(t,e,r){e.height>0&&e.width>0&&(this.renderBackgroundColor(t,e),this.renderBackgroundImage(t,e,r))},n.prototype.renderBackgroundColor=function(t,e){var r=t.color("backgroundColor");r.isTransparent()||this.rectangle(e.left,e.top,e.width,e.height,r)},n.prototype.renderBorders=function(t){t.forEach(this.renderBorder,this)},n.prototype.renderBorder=function(t){t.color.isTransparent()||null===t.args||this.drawShape(t.args,t.color)},n.prototype.renderBackgroundImage=function(t,e,r){ -var n=t.parseBackgroundImages();n.reverse().forEach(function(n,o,s){switch(n.method){case"url":var a=this.images.get(n.args[0]);a?this.renderBackgroundRepeating(t,e,a,s.length-(o+1),r):i("Error loading background-image",n.args[0]);break;case"linear-gradient":case"gradient":var h=this.images.get(n.value);h?this.renderBackgroundGradient(h,e,r):i("Error loading background-image",n.args[0]);break;case"none":break;default:i("Unknown background-image type",n.args[0])}},this)},n.prototype.renderBackgroundRepeating=function(t,e,r,n,i){var o=t.parseBackgroundSize(e,r.image,n),s=t.parseBackgroundPosition(e,r.image,n,o),a=t.parseBackgroundRepeat(n);switch(a){case"repeat-x":case"repeat no-repeat":this.backgroundRepeatShape(r,s,o,e,e.left+i[3],e.top+s.top+i[0],99999,o.height,i);break;case"repeat-y":case"no-repeat repeat":this.backgroundRepeatShape(r,s,o,e,e.left+s.left+i[3],e.top+i[0],o.width,99999,i);break;case"no-repeat":this.backgroundRepeatShape(r,s,o,e,e.left+s.left+i[3],e.top+s.top+i[0],o.width,o.height,i);break;default:this.renderBackgroundRepeat(r,s,o,{top:e.top,left:e.left},i[3],i[0])}},e.exports=n},{"./log":15}],23:[function(t,e,r){function n(t,e){if(this.ratio=window.devicePixelRatio,t=this.applyRatio(t),e=this.applyRatio(e),o.apply(this,arguments),this.canvas=this.options.canvas||this.document.createElement("canvas"),!this.options.canvas&&(this.canvas.width=t,this.canvas.height=e,1!==this.ratio)){var r=1/this.ratio;this.canvas.style.transform="scaleX("+r+") scaleY("+r+")",this.canvas.style.transformOrigin="0 0"}this.ctx=this.canvas.getContext("2d"),this.taintCtx=this.document.createElement("canvas").getContext("2d"),this.ctx.textBaseline="bottom",this.variables={},a("Initialized CanvasRenderer with size",t,"x",e)}function i(t){return t.length>0}var o=t("../renderer"),s=t("../lineargradientcontainer"),a=t("../log");n.prototype=Object.create(o.prototype),n.prototype.applyRatio=function(t){return t*this.ratio},n.prototype.applyRatioToBounds=function(t){t.width=t.width*this.ratio,t.top=t.top*this.ratio;try{t.left=t.left*this.ratio,t.height=t.height*this.ratio}catch(e){}return t},n.prototype.applyRatioToPosition=function(t){return t.left=t.left*this.ratio,t.height=t.height*this.ratio,bounds},n.prototype.applyRatioToShape=function(t){for(var e=0;e";try{r.drawImage(t,0,0),e.toDataURL()}catch(n){return!1}return!0},e.exports=n},{}],26:[function(t,e,r){function n(t){this.src=t,this.image=null;var e=this;this.promise=this.hasFabric().then(function(){return e.isInline(t)?i.resolve(e.inlineFormatting(t)):o(t)}).then(function(t){return new i(function(r){window.html2canvas.svg.fabric.loadSVGFromString(t,e.createCanvas.call(e,r))})})}var i=t("./promise"),o=t("./xhr"),s=t("./utils").decode64;n.prototype.hasFabric=function(){return window.html2canvas.svg&&window.html2canvas.svg.fabric?i.resolve():i.reject(new Error("html2canvas.svg.js is not loaded, cannot render svg"))},n.prototype.inlineFormatting=function(t){return/^data:image\/svg\+xml;base64,/.test(t)?this.decode64(this.removeContentType(t)):this.removeContentType(t)},n.prototype.removeContentType=function(t){return t.replace(/^data:image\/svg\+xml(;base64)?,/,"")},n.prototype.isInline=function(t){return/^data:image\/svg\+xml/i.test(t)},n.prototype.createCanvas=function(t){var e=this;return function(r,n){var i=new window.html2canvas.svg.fabric.StaticCanvas("c");e.image=i.lowerCanvasEl,i.setWidth(n.width).setHeight(n.height).add(window.html2canvas.svg.fabric.util.groupSVGElements(r,n)).renderAll(),t(i.lowerCanvasEl)}},n.prototype.decode64=function(t){return"function"==typeof window.atob?window.atob(t):s(t)},e.exports=n},{"./promise":18,"./utils":29,"./xhr":31}],27:[function(t,e,r){function n(t,e){this.src=t,this.image=null;var r=this;this.promise=e?new o(function(e,n){r.image=new Image,r.image.onload=e,r.image.onerror=n,r.image.src="data:image/svg+xml,"+(new XMLSerializer).serializeToString(t),r.image.complete===!0&&e(r.image)}):this.hasFabric().then(function(){return new o(function(e){window.html2canvas.svg.fabric.parseSVGDocument(t,r.createCanvas.call(r,e))})})}var i=t("./svgcontainer"),o=t("./promise");n.prototype=Object.create(i.prototype),e.exports=n},{"./promise":18,"./svgcontainer":26}],28:[function(t,e,r){function n(t,e){o.call(this,t,e)}function i(t,e,r){return t.length>0?e+r.toUpperCase():void 0}var o=t("./nodecontainer");n.prototype=Object.create(o.prototype),n.prototype.applyTextTransform=function(){this.node.data=this.transform(this.parent.css("textTransform"))},n.prototype.transform=function(t){var e=this.node.data;switch(t){case"lowercase":return e.toLowerCase();case"capitalize":return e.replace(/(^|\s|:|-|\(|\))([a-z])/g,i);case"uppercase":return e.toUpperCase();default:return e}},e.exports=n},{"./nodecontainer":16}],29:[function(t,e,r){r.smallImage=function(){return"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"},r.bind=function(t,e){return function(){return t.apply(e,arguments)}},r.decode64=function(t){var e,r,n,i,o,s,a,h,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=t.length,c="";for(e=0;u>e;e+=4)r=l.indexOf(t[e]),n=l.indexOf(t[e+1]),i=l.indexOf(t[e+2]),o=l.indexOf(t[e+3]),s=r<<2|n>>4,a=(15&n)<<4|i>>2,h=(3&i)<<6|o,c+=64===i?String.fromCharCode(s):64===o||-1===o?String.fromCharCode(s,a):String.fromCharCode(s,a,h);return c},r.getBounds=function(t){if(t.getBoundingClientRect){var e=t.getBoundingClientRect(),r=null==t.offsetWidth?e.width:t.offsetWidth;return{top:e.top,bottom:e.bottom||e.top+e.height,right:e.left+r,left:e.left,width:r,height:null==t.offsetHeight?e.height:t.offsetHeight}}return{}},r.offsetBounds=function(t){var e=t.offsetParent?r.offsetBounds(t.offsetParent):{top:0,left:0};return{top:t.offsetTop+e.top,bottom:t.offsetTop+t.offsetHeight+e.top,right:t.offsetLeft+e.left+t.offsetWidth,left:t.offsetLeft+e.left,width:t.offsetWidth,height:t.offsetHeight}},r.parseBackgrounds=function(t){var e,r,n,i,o,s,a,h=" \r\n ",l=[],u=0,c=0,f=function(){e&&('"'===r.substr(0,1)&&(r=r.substr(1,r.length-2)),r&&a.push(r),"-"===e.substr(0,1)&&(i=e.indexOf("-",1)+1)>0&&(n=e.substr(0,i),e=e.substr(i)),l.push({prefix:n,method:e.toLowerCase(),value:o,args:a,image:null})),a=[],e=n=r=o=""};return a=[],e=n=r=o="",t.split("").forEach(function(t){if(!(0===u&&h.indexOf(t)>-1)){switch(t){case'"':s?s===t&&(s=null):s=t;break;case"(":if(s)break;if(0===u)return u=1,void(o+=t);c++;break;case")":if(s)break;if(1===u){if(0===c)return u=0,o+=t,void f();c--}break;case",":if(s)break;if(0===u)return void f();if(1===u&&0===c&&!e.match(/^url$/i))return a.push(r),r="",void(o+=t)}o+=t,0===u?e+=t:r+=t}}),f(),l}},{}],30:[function(t,e,r){function n(t){i.apply(this,arguments),this.type="linear"===t.args[0]?this.TYPES.LINEAR:this.TYPES.RADIAL}var i=t("./gradientcontainer");n.prototype=Object.create(i.prototype),e.exports=n},{"./gradientcontainer":11}],31:[function(t,e,r){function n(t){return new i(function(e,r){var n=new XMLHttpRequest;n.open("GET",t),n.onload=function(){200===n.status?e(n.responseText):r(new Error(n.statusText))},n.onerror=function(){r(new Error("Network Error"))},n.send()})}var i=t("./promise");e.exports=n},{"./promise":18}]},{},[6])(6)}),function(t){function e(t){var e=t.length,n=r.type(t);return"function"===n||r.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t}if(!t.jQuery){var r=function(t,e){return new r.fn.init(t,e)};r.isWindow=function(t){return null!=t&&t==t.window},r.type=function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?i[s.call(t)]||"object":typeof t},r.isArray=Array.isArray||function(t){return"array"===r.type(t)},r.isPlainObject=function(t){var e;if(!t||"object"!==r.type(t)||t.nodeType||r.isWindow(t))return!1;try{if(t.constructor&&!o.call(t,"constructor")&&!o.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}for(e in t);return void 0===e||o.call(t,e)},r.each=function(t,r,n){var i,o=0,s=t.length,a=e(t);if(n){if(a)for(;s>o&&(i=r.apply(t[o],n),i!==!1);o++);else for(o in t)if(i=r.apply(t[o],n),i===!1)break}else if(a)for(;s>o&&(i=r.call(t[o],o,t[o]),i!==!1);o++);else for(o in t)if(i=r.call(t[o],o,t[o]),i===!1)break;return t},r.data=function(t,e,i){if(void 0===i){var o=t[r.expando],s=o&&n[o];if(void 0===e)return s;if(s&&e in s)return s[e]}else if(void 0!==e){var o=t[r.expando]||(t[r.expando]=++r.uuid);return n[o]=n[o]||{},n[o][e]=i,i}},r.removeData=function(t,e){var i=t[r.expando],o=i&&n[i];o&&r.each(e,function(t,e){delete o[e]})},r.extend=function(){var t,e,n,i,o,s,a=arguments[0]||{},h=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[h]||{},h++),"object"!=typeof a&&"function"!==r.type(a)&&(a={}),h===l&&(a=this,h--);l>h;h++)if(null!=(o=arguments[h]))for(i in o)t=a[i],n=o[i],a!==n&&(u&&n&&(r.isPlainObject(n)||(e=r.isArray(n)))?(e?(e=!1,s=t&&r.isArray(t)?t:[]):s=t&&r.isPlainObject(t)?t:{},a[i]=r.extend(u,s,n)):void 0!==n&&(a[i]=n));return a},r.queue=function(t,n,i){function o(t,r){var n=r||[];return null!=t&&(e(Object(t))?!function(t,e){for(var r=+e.length,n=0,i=t.length;r>n;)t[i++]=e[n++];if(r!==r)for(;void 0!==e[n];)t[i++]=e[n++];return t.length=i,t}(n,"string"==typeof t?[t]:t):[].push.call(n,t)),n}if(t){n=(n||"fx")+"queue";var s=r.data(t,n);return i?(!s||r.isArray(i)?s=r.data(t,n,o(i)):s.push(i),s):s||[]}},r.dequeue=function(t,e){r.each(t.nodeType?[t]:t,function(t,n){e=e||"fx";var i=r.queue(n,e),o=i.shift();"inprogress"===o&&(o=i.shift()),o&&("fx"===e&&i.unshift("inprogress"),o.call(n,function(){r.dequeue(n,e)}))})},r.fn=r.prototype={init:function(t){if(t.nodeType)return this[0]=t,this;throw new Error("Not a DOM node.")},offset:function(){var e=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:e.top+(t.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:e.left+(t.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function t(){for(var t=this.offsetParent||document;t&&"html"===!t.nodeType.toLowerCase&&"static"===t.style.position;)t=t.offsetParent;return t||document}var e=this[0],t=t.apply(e),n=this.offset(),i=/^(?:body|html)$/i.test(t.nodeName)?{top:0,left:0}:r(t).offset();return n.top-=parseFloat(e.style.marginTop)||0,n.left-=parseFloat(e.style.marginLeft)||0,t.style&&(i.top+=parseFloat(t.style.borderTopWidth)||0,i.left+=parseFloat(t.style.borderLeftWidth)||0),{top:n.top-i.top,left:n.left-i.left}}};var n={};r.expando="velocity"+(new Date).getTime(),r.uuid=0;for(var i={},o=i.hasOwnProperty,s=i.toString,a="Boolean Number String Function Array Date RegExp Object Error".split(" "),h=0;hi;++i){var o=l(r,t,n);if(0===o)return r;var s=h(r,t,n)-e;r-=s/o}return r}function c(){for(var e=0;y>e;++e)C[e]=h(e*x,t,n)}function f(e,r,i){var o,s,a=0;do s=r+(i-r)/2,o=h(s,t,n)-e,o>0?i=s:r=s;while(Math.abs(o)>v&&++a=A?u(e,a):0==h?a:f(e,r,r+x)}function p(){b=!0,(t!=r||n!=i)&&c()}var g=4,A=.001,v=1e-7,m=10,y=11,x=1/(y-1),w="Float32Array"in e;if(4!==arguments.length)return!1;for(var E=0;4>E;++E)if("number"!=typeof arguments[E]||isNaN(arguments[E])||!isFinite(arguments[E]))return!1;t=Math.min(t,1),n=Math.min(n,1),t=Math.max(t,0),n=Math.max(n,0);var C=w?new Float32Array(y):new Array(y),b=!1,B=function(e){return b||p(),t===r&&n===i?e:0===e?0:1===e?1:h(d(e),r,i)};B.getControlPoints=function(){return[{x:t,y:r},{x:n,y:i}]};var T="generateBezier("+[t,r,n,i]+")";return B.toString=function(){return T},B}function l(t,e){var r=t;return g.isString(t)?y.Easings[t]||(r=!1):r=g.isArray(t)&&1===t.length?a.apply(null,t):g.isArray(t)&&2===t.length?x.apply(null,t.concat([e])):g.isArray(t)&&4===t.length?h.apply(null,t):!1,r===!1&&(r=y.Easings[y.defaults.easing]?y.defaults.easing:m),r}function u(t){if(t){var e=(new Date).getTime(),r=y.State.calls.length;r>1e4&&(y.State.calls=i(y.State.calls));for(var o=0;r>o;o++)if(y.State.calls[o]){var a=y.State.calls[o],h=a[0],l=a[2],d=a[3],p=!!d,A=null;d||(d=y.State.calls[o][3]=e-16);for(var v=Math.min((e-d)/l.duration,1),m=0,x=h.length;x>m;m++){var E=h[m],b=E.element;if(s(b)){var B=!1;if(l.display!==n&&null!==l.display&&"none"!==l.display){if("flex"===l.display){var T=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];f.each(T,function(t,e){w.setPropertyValue(b,"display",e)})}w.setPropertyValue(b,"display",l.display)}l.visibility!==n&&"hidden"!==l.visibility&&w.setPropertyValue(b,"visibility",l.visibility);for(var D in E)if("element"!==D){var M,P=E[D],R=g.isString(P.easing)?y.Easings[P.easing]:P.easing;if(1===v)M=P.endValue;else{var I=P.endValue-P.startValue;if(M=P.startValue+I*R(v,l,I),!p&&M===P.currentValue)continue}if(P.currentValue=M,"tween"===D)A=M;else{if(w.Hooks.registered[D]){var S=w.Hooks.getRoot(D),O=s(b).rootPropertyValueCache[S];O&&(P.rootPropertyValue=O)}var F=w.setPropertyValue(b,D,P.currentValue+(0===parseFloat(M)?"":P.unitType),P.rootPropertyValue,P.scrollData);w.Hooks.registered[D]&&(w.Normalizations.registered[S]?s(b).rootPropertyValueCache[S]=w.Normalizations.registered[S]("extract",null,F[1]):s(b).rootPropertyValueCache[S]=F[1]),"transform"===F[0]&&(B=!0)}}l.mobileHA&&s(b).transformCache.translate3d===n&&(s(b).transformCache.translate3d="(0px, 0px, 0px)",B=!0),B&&w.flushTransformCache(b)}}l.display!==n&&"none"!==l.display&&(y.State.calls[o][2].display=!1),l.visibility!==n&&"hidden"!==l.visibility&&(y.State.calls[o][2].visibility=!1),l.progress&&l.progress.call(a[1],a[1],v,Math.max(0,d+l.duration-e),d,A),1===v&&c(o)}}y.State.isTicking&&C(u)}function c(t,e){if(!y.State.calls[t])return!1;for(var r=y.State.calls[t][0],i=y.State.calls[t][1],o=y.State.calls[t][2],a=y.State.calls[t][4],h=!1,l=0,u=r.length;u>l;l++){var c=r[l].element;if(e||o.loop||("none"===o.display&&w.setPropertyValue(c,"display",o.display),"hidden"===o.visibility&&w.setPropertyValue(c,"visibility",o.visibility)),o.loop!==!0&&(f.queue(c)[1]===n||!/\.velocityQueueEntryFlag/i.test(f.queue(c)[1]))&&s(c)){s(c).isAnimating=!1,s(c).rootPropertyValueCache={};var d=!1;f.each(w.Lists.transforms3D,function(t,e){var r=/^scale/.test(e)?1:0,i=s(c).transformCache[e];s(c).transformCache[e]!==n&&new RegExp("^\\("+r+"[^.]").test(i)&&(d=!0,delete s(c).transformCache[e])}),o.mobileHA&&(d=!0,delete s(c).transformCache.translate3d),d&&w.flushTransformCache(c),w.Values.removeClass(c,"velocity-animating")}if(!e&&o.complete&&!o.loop&&l===u-1)try{o.complete.call(i,i)}catch(p){setTimeout(function(){throw p},1)}a&&o.loop!==!0&&a(i),s(c)&&o.loop===!0&&!e&&(f.each(s(c).tweensContainer,function(t,e){/^rotate/.test(t)&&360===parseFloat(e.endValue)&&(e.endValue=0,e.startValue=360),/^backgroundPosition/.test(t)&&100===parseFloat(e.endValue)&&"%"===e.unitType&&(e.endValue=0,e.startValue=100)}),y(c,"reverse",{loop:!0,delay:o.delay})),o.queue!==!1&&f.dequeue(c,o.queue)}y.State.calls[t]=!1;for(var g=0,A=y.State.calls.length;A>g;g++)if(y.State.calls[g]!==!1){h=!0;break}h===!1&&(y.State.isTicking=!1,delete y.State.calls,y.State.calls=[])}var f,d=function(){if(r.documentMode)return r.documentMode;for(var t=7;t>4;t--){var e=r.createElement("div");if(e.innerHTML="",e.getElementsByTagName("span").length)return e=null,t}return n}(),p=function(){var t=0;return e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||function(e){var r,n=(new Date).getTime();return r=Math.max(0,16-(n-t)),t=n+r,setTimeout(function(){e(n+r)},r)}}(),g={isString:function(t){return"string"==typeof t},isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},isFunction:function(t){return"[object Function]"===Object.prototype.toString.call(t)},isNode:function(t){return t&&t.nodeType},isNodeList:function(t){return"object"==typeof t&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(t))&&t.length!==n&&(0===t.length||"object"==typeof t[0]&&t[0].nodeType>0)},isWrapped:function(t){return t&&(t.jquery||e.Zepto&&e.Zepto.zepto.isZ(t))},isSVG:function(t){return e.SVGElement&&t instanceof e.SVGElement},isEmptyObject:function(t){for(var e in t)return!1;return!0}},A=!1;if(t.fn&&t.fn.jquery?(f=t,A=!0):f=e.Velocity.Utilities,8>=d&&!A)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(7>=d)return void(jQuery.fn.velocity=jQuery.fn.animate);var v=400,m="swing",y={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:e.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:r.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:f,Redirects:{},Easings:{},Promise:e.Promise,defaults:{queue:"",duration:v,easing:m,begin:n,complete:n,progress:n,display:n,visibility:n,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},init:function(t){f.data(t,"velocity",{isSVG:g.isSVG(t),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:2,patch:2},debug:!1};e.pageYOffset!==n?(y.State.scrollAnchor=e,y.State.scrollPropertyLeft="pageXOffset",y.State.scrollPropertyTop="pageYOffset"):(y.State.scrollAnchor=r.documentElement||r.body.parentNode||r.body,y.State.scrollPropertyLeft="scrollLeft",y.State.scrollPropertyTop="scrollTop");var x=function(){function t(t){return-t.tension*t.x-t.friction*t.v}function e(e,r,n){var i={x:e.x+n.dx*r,v:e.v+n.dv*r,tension:e.tension,friction:e.friction};return{dx:i.v,dv:t(i)}}function r(r,n){var i={dx:r.v,dv:t(r)},o=e(r,.5*n,i),s=e(r,.5*n,o),a=e(r,n,s),h=1/6*(i.dx+2*(o.dx+s.dx)+a.dx),l=1/6*(i.dv+2*(o.dv+s.dv)+a.dv);return r.x=r.x+h*n,r.v=r.v+l*n,r}return function n(t,e,i){var o,s,a,h={x:-1,v:0,tension:null,friction:null},l=[0],u=0,c=1e-4,f=.016;for(t=parseFloat(t)||500,e=parseFloat(e)||20,i=i||null,h.tension=t,h.friction=e,o=null!==i,o?(u=n(t,e),s=u/i*f):s=f;;)if(a=r(a||h,s),l.push(1+a.x),u+=16,!(Math.abs(a.x)>c&&Math.abs(a.v)>c))break;return o?function(t){return l[t*(l.length-1)|0]}:u}}();y.Easings={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},spring:function(t){return 1-Math.cos(4.5*t*Math.PI)*Math.exp(6*-t)}},f.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(t,e){y.Easings[e[0]]=h.apply(null,e[1])});var w=y.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var t=0;t=d)switch(t){case"name":return"filter";case"extract":var n=r.toString().match(/alpha\(opacity=(.*)\)/i);return r=n?n[1]/100:1;case"inject":return e.style.zoom=1,parseFloat(r)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(r),10)+")"}else switch(t){case"name":return"opacity";case"extract":return r;case"inject":return r}}},register:function(){9>=d||y.State.isGingerbread||(w.Lists.transformsBase=w.Lists.transformsBase.concat(w.Lists.transforms3D));for(var t=0;ti&&(i=1),o=!/(\d)$/i.test(i);break;case"skew":o=!/(deg|\d)$/i.test(i);break;case"rotate":o=!/(deg|\d)$/i.test(i)}return o||(s(r).transformCache[e]="("+i+")"),s(r).transformCache[e]}}}();for(var t=0;t=d||3!==o.split(" ").length||(o+=" 1"),o;case"inject":return 8>=d?4===i.split(" ").length&&(i=i.split(/\s+/).slice(0,3).join(" ")):3===i.split(" ").length&&(i+=" 1"),(8>=d?"rgb":"rgba")+"("+i.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})},SVGAttribute:function(t){var e="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(d||y.State.isAndroid&&!y.State.isChrome)&&(e+="|transform"),new RegExp("^("+e+")$","i").test(t)},prefixCheck:function(t){if(y.State.prefixMatches[t])return[y.State.prefixMatches[t],!0];for(var e=["","Webkit","Moz","ms","O"],r=0,n=e.length;n>r;r++){var i;if(i=0===r?t:e[r]+t.replace(/^\w/,function(t){return t.toUpperCase()}),g.isString(y.State.prefixElement.style[i]))return y.State.prefixMatches[t]=i,[i,!0]}return[t,!1]}},Values:{hexToRgb:function(t){var e,r=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;return t=t.replace(r,function(t,e,r,n){return e+e+r+r+n+n}),e=n.exec(t),e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:[0,0,0]},isCSSNullValue:function(t){return 0==t||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(t)},getUnitType:function(t){return/^(rotate|skew)/i.test(t)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(t)?"":"px"},getDisplayType:function(t){var e=t&&t.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(e)?"inline":/^(li)$/i.test(e)?"list-item":/^(tr)$/i.test(e)?"table-row":/^(table)$/i.test(e)?"table":/^(tbody)$/i.test(e)?"table-row-group":"block"},addClass:function(t,e){t.classList?t.classList.add(e):t.className+=(t.className.length?" ":"")+e},removeClass:function(t,e){t.classList?t.classList.remove(e):t.className=t.className.toString().replace(new RegExp("(^|\\s)"+e.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(t,r,i,o){function a(t,r){function i(){l&&w.setPropertyValue(t,"display","none")}var h=0;if(8>=d)h=f.css(t,r);else{var l=!1;if(/^(width|height)$/.test(r)&&0===w.getPropertyValue(t,"display")&&(l=!0, -w.setPropertyValue(t,"display",w.Values.getDisplayType(t))),!o){if("height"===r&&"border-box"!==w.getPropertyValue(t,"boxSizing").toString().toLowerCase()){var u=t.offsetHeight-(parseFloat(w.getPropertyValue(t,"borderTopWidth"))||0)-(parseFloat(w.getPropertyValue(t,"borderBottomWidth"))||0)-(parseFloat(w.getPropertyValue(t,"paddingTop"))||0)-(parseFloat(w.getPropertyValue(t,"paddingBottom"))||0);return i(),u}if("width"===r&&"border-box"!==w.getPropertyValue(t,"boxSizing").toString().toLowerCase()){var c=t.offsetWidth-(parseFloat(w.getPropertyValue(t,"borderLeftWidth"))||0)-(parseFloat(w.getPropertyValue(t,"borderRightWidth"))||0)-(parseFloat(w.getPropertyValue(t,"paddingLeft"))||0)-(parseFloat(w.getPropertyValue(t,"paddingRight"))||0);return i(),c}}var p;p=s(t)===n?e.getComputedStyle(t,null):s(t).computedStyle?s(t).computedStyle:s(t).computedStyle=e.getComputedStyle(t,null),"borderColor"===r&&(r="borderTopColor"),h=9===d&&"filter"===r?p.getPropertyValue(r):p[r],(""===h||null===h)&&(h=t.style[r]),i()}if("auto"===h&&/^(top|right|bottom|left)$/i.test(r)){var g=a(t,"position");("fixed"===g||"absolute"===g&&/top|left/i.test(r))&&(h=f(t).position()[r]+"px")}return h}var h;if(w.Hooks.registered[r]){var l=r,u=w.Hooks.getRoot(l);i===n&&(i=w.getPropertyValue(t,w.Names.prefixCheck(u)[0])),w.Normalizations.registered[u]&&(i=w.Normalizations.registered[u]("extract",t,i)),h=w.Hooks.extractValue(l,i)}else if(w.Normalizations.registered[r]){var c,p;c=w.Normalizations.registered[r]("name",t),"transform"!==c&&(p=a(t,w.Names.prefixCheck(c)[0]),w.Values.isCSSNullValue(p)&&w.Hooks.templates[r]&&(p=w.Hooks.templates[r][1])),h=w.Normalizations.registered[r]("extract",t,p)}if(!/^[\d-]/.test(h))if(s(t)&&s(t).isSVG&&w.Names.SVGAttribute(r))if(/^(height|width)$/i.test(r))try{h=t.getBBox()[r]}catch(g){h=0}else h=t.getAttribute(r);else h=a(t,w.Names.prefixCheck(r)[0]);return w.Values.isCSSNullValue(h)&&(h=0),y.debug>=2&&console.log("Get "+r+": "+h),h},setPropertyValue:function(t,r,n,i,o){var a=r;if("scroll"===r)o.container?o.container["scroll"+o.direction]=n:"Left"===o.direction?e.scrollTo(n,o.alternateValue):e.scrollTo(o.alternateValue,n);else if(w.Normalizations.registered[r]&&"transform"===w.Normalizations.registered[r]("name",t))w.Normalizations.registered[r]("inject",t,n),a="transform",n=s(t).transformCache[r];else{if(w.Hooks.registered[r]){var h=r,l=w.Hooks.getRoot(r);i=i||w.getPropertyValue(t,l),n=w.Hooks.injectValue(h,n,i),r=l}if(w.Normalizations.registered[r]&&(n=w.Normalizations.registered[r]("inject",t,n),r=w.Normalizations.registered[r]("name",t)),a=w.Names.prefixCheck(r)[0],8>=d)try{t.style[a]=n}catch(u){y.debug&&console.log("Browser does not support ["+n+"] for ["+a+"]")}else if(s(t)&&s(t).isSVG&&w.Names.SVGAttribute(r))t.setAttribute(r,n);else{var c="webgl"===t.renderer?t.styleGL:t.style;c[a]=n}y.debug>=2&&console.log("Set "+r+" ("+a+"): "+n)}return[a,n]},flushTransformCache:function(t){function e(e){return parseFloat(w.getPropertyValue(t,e))}var r="";if((d||y.State.isAndroid&&!y.State.isChrome)&&s(t).isSVG){var n={translate:[e("translateX"),e("translateY")],skewX:[e("skewX")],skewY:[e("skewY")],scale:1!==e("scale")?[e("scale"),e("scale")]:[e("scaleX"),e("scaleY")],rotate:[e("rotateZ"),0,0]};f.each(s(t).transformCache,function(t){/^translate/i.test(t)?t="translate":/^scale/i.test(t)?t="scale":/^rotate/i.test(t)&&(t="rotate"),n[t]&&(r+=t+"("+n[t].join(" ")+") ",delete n[t])})}else{var i,o;f.each(s(t).transformCache,function(e){return i=s(t).transformCache[e],"transformPerspective"===e?(o=i,!0):(9===d&&"rotateZ"===e&&(e="rotate"),void(r+=e+i+" "))}),o&&(r="perspective"+o+" "+r)}w.setPropertyValue(t,"transform",r)}};w.Hooks.register(),w.Normalizations.register(),y.hook=function(t,e,r){var i=n;return t=o(t),f.each(t,function(t,o){if(s(o)===n&&y.init(o),r===n)i===n&&(i=y.CSS.getPropertyValue(o,e));else{var a=y.CSS.setPropertyValue(o,e,r);"transform"===a[0]&&y.CSS.flushTransformCache(o),i=a}}),i};var E=function(){function t(){return a?D.promise||null:h}function i(){function t(t){function c(t,e){var r=n,i=n,s=n;return g.isArray(t)?(r=t[0],!g.isArray(t[1])&&/^[\d-]/.test(t[1])||g.isFunction(t[1])||w.RegEx.isHex.test(t[1])?s=t[1]:(g.isString(t[1])&&!w.RegEx.isHex.test(t[1])||g.isArray(t[1]))&&(i=e?t[1]:l(t[1],a.duration),t[2]!==n&&(s=t[2]))):r=t,e||(i=i||a.easing),g.isFunction(r)&&(r=r.call(o,b,C)),g.isFunction(s)&&(s=s.call(o,b,C)),[r||0,i,s]}function d(t,e){var r,n;return n=(e||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(t){return r=t,""}),r||(r=w.Values.getUnitType(t)),[n,r]}function v(){var t={myParent:o.parentNode||r.body,position:w.getPropertyValue(o,"position"),fontSize:w.getPropertyValue(o,"fontSize")},n=t.position===F.lastPosition&&t.myParent===F.lastParent,i=t.fontSize===F.lastFontSize;F.lastParent=t.myParent,F.lastPosition=t.position,F.lastFontSize=t.fontSize;var a=100,h={};if(i&&n)h.emToPx=F.lastEmToPx,h.percentToPxWidth=F.lastPercentToPxWidth,h.percentToPxHeight=F.lastPercentToPxHeight;else{var l=s(o).isSVG?r.createElementNS("http://www.w3.org/2000/svg","rect"):r.createElement("div");y.init(l),t.myParent.appendChild(l),f.each(["overflow","overflowX","overflowY"],function(t,e){y.CSS.setPropertyValue(l,e,"hidden")}),y.CSS.setPropertyValue(l,"position",t.position),y.CSS.setPropertyValue(l,"fontSize",t.fontSize),y.CSS.setPropertyValue(l,"boxSizing","content-box"),f.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(t,e){y.CSS.setPropertyValue(l,e,a+"%")}),y.CSS.setPropertyValue(l,"paddingLeft",a+"em"),h.percentToPxWidth=F.lastPercentToPxWidth=(parseFloat(w.getPropertyValue(l,"width",null,!0))||1)/a,h.percentToPxHeight=F.lastPercentToPxHeight=(parseFloat(w.getPropertyValue(l,"height",null,!0))||1)/a,h.emToPx=F.lastEmToPx=(parseFloat(w.getPropertyValue(l,"paddingLeft"))||1)/a,t.myParent.removeChild(l)}return null===F.remToPx&&(F.remToPx=parseFloat(w.getPropertyValue(r.body,"fontSize"))||16),null===F.vwToPx&&(F.vwToPx=parseFloat(e.innerWidth)/100,F.vhToPx=parseFloat(e.innerHeight)/100),h.remToPx=F.remToPx,h.vwToPx=F.vwToPx,h.vhToPx=F.vhToPx,y.debug>=1&&console.log("Unit ratios: "+JSON.stringify(h),o),h}if(a.begin&&0===b)try{a.begin.call(p,p)}catch(x){setTimeout(function(){throw x},1)}if("scroll"===M){var E,B,T,P=/^x$/i.test(a.axis)?"Left":"Top",R=parseFloat(a.offset)||0;a.container?g.isWrapped(a.container)||g.isNode(a.container)?(a.container=a.container[0]||a.container,E=a.container["scroll"+P],T=E+f(o).position()[P.toLowerCase()]+R):a.container=null:(E=y.State.scrollAnchor[y.State["scrollProperty"+P]],B=y.State.scrollAnchor[y.State["scrollProperty"+("Left"===P?"Top":"Left")]],T=f(o).offset()[P.toLowerCase()]+R),h={scroll:{rootPropertyValue:!1,startValue:E,currentValue:E,endValue:T,unitType:"",easing:a.easing,scrollData:{container:a.container,direction:P,alternateValue:B}},element:o},y.debug&&console.log("tweensContainer (scroll): ",h.scroll,o)}else if("reverse"===M){if(!s(o).tweensContainer)return void f.dequeue(o,a.queue);"none"===s(o).opts.display&&(s(o).opts.display="auto"),"hidden"===s(o).opts.visibility&&(s(o).opts.visibility="visible"),s(o).opts.loop=!1,s(o).opts.begin=null,s(o).opts.complete=null,m.easing||delete a.easing,m.duration||delete a.duration,a=f.extend({},s(o).opts,a);var I=f.extend(!0,{},s(o).tweensContainer);for(var S in I)if("element"!==S){var O=I[S].startValue;I[S].startValue=I[S].currentValue=I[S].endValue,I[S].endValue=O,g.isEmptyObject(m)||(I[S].easing=a.easing),y.debug&&console.log("reverse tweensContainer ("+S+"): "+JSON.stringify(I[S]),o)}h=I}else if("start"===M){var I;s(o).tweensContainer&&s(o).isAnimating===!0&&(I=s(o).tweensContainer),f.each(A,function(t,e){if(RegExp("^"+w.Lists.colors.join("$|^")+"$").test(t)){var r=c(e,!0),i=r[0],o=r[1],s=r[2];if(w.RegEx.isHex.test(i)){for(var a=["Red","Green","Blue"],h=w.Values.hexToRgb(i),l=s?w.Values.hexToRgb(s):n,u=0;uN;N++){var H={delay:R.delay,progress:R.progress};N===L-1&&(H.display=R.display,H.visibility=R.visibility,H.complete=R.complete),E(p,"reverse",H)}return t()}};y=f.extend(E,y),y.animate=E;var C=e.requestAnimationFrame||p;return y.State.isMobile||r.hidden===n||r.addEventListener("visibilitychange",function(){r.hidden?(C=function(t){return setTimeout(function(){t(!0)},16)},u()):C=e.requestAnimationFrame||p}),t.Velocity=y,t!==e&&(t.fn.velocity=E,t.fn.velocity.defaults=y.defaults),f.each(["Down","Up"],function(t,e){y.Redirects["slide"+e]=function(t,r,i,o,s,a){var h=f.extend({},r),l=h.begin,u=h.complete,c={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""},d={};h.display===n&&(h.display="Down"===e?"inline"===y.CSS.Values.getDisplayType(t)?"inline-block":"block":"none"),h.begin=function(){var r="webgl"===t.renderer?t.styleGL:t.style;l&&l.call(s,s);for(var n in c){d[n]=r[n];var i=y.CSS.getPropertyValue(t,n);c[n]="Down"===e?[i,0]:[0,i]}d.overflow=r.overflow,r.overflow="hidden"},h.complete=function(){for(var t in d)style[t]=d[t];u&&u.call(s,s),a&&a.resolver(s)},y(t,c,h)}}),f.each(["In","Out"],function(t,e){y.Redirects["fade"+e]=function(t,r,i,o,s,a){var h=f.extend({},r),l={opacity:"In"===e?1:0},u=h.complete;i!==o-1?h.complete=h.begin=null:h.complete=function(){u&&u.call(s,s),a&&a.resolver(s)},h.display===n&&(h.display="In"===e?"auto":"none"),y(this,l,h)}}),y}(window.jQuery||window.Zepto||window,window,document)}),function(t){t.HTMLGL=t.HTMLGL||{},t.HTMLGL.util={getterSetter:function(t,e,r,n){Object.defineProperty?Object.defineProperty(t,e,{get:r,set:n}):document.__defineGetter__&&(t.__defineGetter__(e,r),t.__defineSetter__(e,n)),t["get"+e]=r,t["set"+e]=n},emitEvent:function(t,e){var r=new MouseEvent(e.type,e);r.dispatcher="html-gl",e.stopPropagation(),t.dispatchEvent(r)},debounce:function(t,e,r){var n;return function(){var i=this,o=arguments,s=function(){n=null,r||t.apply(i,o)},a=r&&!n;clearTimeout(n),n=setTimeout(s,e),a&&t.apply(i,o)}}}}(window),function(t){var e=function(t){},r=e.prototype;r.getElementByCoordinates=function(e,r){var n,i,o=this;return t.HTMLGL.elements.forEach(function(t){n=document.elementFromPoint(e-parseInt(t.transformObject.translateX||0),r-parseInt(t.transformObject.translateY||0)),o.isChildOf(n,t)&&(i=n)}),i},r.isChildOf=function(t,e){for(var r=t;r;){if(r===e)return!0;r=r.parentNode}return!1},t.HTMLGL.GLElementResolver=e}(window),function(t){HTMLGL=t.HTMLGL=t.HTMLGL||{},HTMLGL.JQ_PLUGIN_NAME="htmlgl",HTMLGL.CUSTOM_ELEMENT_TAG_NAME="html-gl",HTMLGL.READY_EVENT="htmlglReady",HTMLGL.context=void 0,HTMLGL.stage=void 0,HTMLGL.renderer=void 0,HTMLGL.elements=[],HTMLGL.pixelRatio=null,HTMLGL.oldPixelRatio=null,HTMLGL.enabled=!0,HTMLGL.scrollX=0,HTMLGL.scrollY=0;var e=function(){t.HTMLGL.context=this,this.createStage(),this.updateScrollPosition(),this.initListeners(),this.elementResolver=new t.HTMLGL.GLElementResolver(this),document.body?this.initViewer():document.addEventListener("DOMContentLoaded",this.initViewer.bind(this))},r=e.prototype;r.initViewer=function(){this.createViewer(),this.resizeViewer(),this.appendViewer()},r.createViewer=function(){t.HTMLGL.renderer=this.renderer=PIXI.autoDetectRenderer(0,0,{transparent:!0}),this.renderer.view.style.position="fixed",this.renderer.view.style.top="0px",this.renderer.view.style.left="0px",this.renderer.view.style["pointer-events"]="none",this.renderer.view.style.pointerEvents="none"},r.appendViewer=function(){document.body.appendChild(this.renderer.view),requestAnimationFrame(this.redrawStage.bind(this))},r.resizeViewer=function(){var e=this,r=t.innerWidth,n=t.innerHeight;HTMLGL.pixelRatio=window.devicePixelRatio||1,console.log(HTMLGL.pixelRatio),r*=HTMLGL.pixelRatio,n*=HTMLGL.pixelRatio,HTMLGL.pixelRatio!==HTMLGL.oldPixelRatio?(this.disable(),this.updateTextures().then(function(){e.updateScrollPosition(),e.updateElementsPositions();var i=1/HTMLGL.pixelRatio;e.renderer.view.style.transformOrigin="0 0",e.renderer.view.style.webkitTransformOrigin="0 0",e.renderer.view.style.transform="scaleX("+i+") scaleY("+i+")",e.renderer.view.style.webkitTransform="scaleX("+i+") scaleY("+i+")",e.renderer.resize(r,n),this.enable(),t.HTMLGL.renderer.render(t.HTMLGL.stage)})):(this.renderer.view.parentNode&&this.updateTextures(),this.updateElementsPositions(),this.markStageAsChanged()),HTMLGL.oldPixelRatio=HTMLGL.pixelRatio},r.initListeners=function(){t.addEventListener("scroll",this.updateScrollPosition.bind(this)),t.addEventListener("resize",t.HTMLGL.util.debounce(this.resizeViewer,500).bind(this)),t.addEventListener("resize",this.updateElementsPositions.bind(this)),document.addEventListener("click",this.onMouseEvent.bind(this),!0),document.addEventListener("mousemove",this.onMouseEvent.bind(this),!0),document.addEventListener("mouseup",this.onMouseEvent.bind(this),!0),document.addEventListener("mousedown",this.onMouseEvent.bind(this),!0),document.addEventListener("touchstart",this.onMouseEvent.bind(this)),document.addEventListener("touchend",this.onMouseEvent.bind(this))},r.updateScrollPosition=function(){var e={};if(void 0!=window.pageYOffset)e={left:pageXOffset,top:pageYOffset};else{var r,n,i=document,o=i.documentElement,s=i.body;r=o.scrollLeft||s.scrollLeft||0,n=o.scrollTop||s.scrollTop||0,e={left:r,top:n}}this.document.x=-e.left*HTMLGL.pixelRatio,this.document.y=-e.top*HTMLGL.pixelRatio,t.HTMLGL.scrollX=e.left,t.HTMLGL.scrollY=e.top,this.markStageAsChanged()},r.createStage=function(){t.HTMLGL.stage=this.stage=new PIXI.Stage(16777215),t.HTMLGL.document=this.document=new PIXI.DisplayObjectContainer,this.stage.addChild(t.HTMLGL.document)},r.redrawStage=function(){t.HTMLGL.stage.changed&&t.HTMLGL.renderer&&t.HTMLGL.enabled&&(t.HTMLGL.renderer.render(t.HTMLGL.stage),t.HTMLGL.stage.changed=!1)},r.updateTextures=function(){var e=[];return t.HTMLGL.elements.forEach(function(t){e.push(t.updateTexture())}),Promise.all(e)},r.initElements=function(){t.HTMLGL.elements.forEach(function(t){t.init()})},r.updateElementsPositions=function(){t.HTMLGL.elements.forEach(function(t){t.updateBoundingRect(),t.updatePivot(),t.updateSpriteTransform()})},r.onMouseEvent=function(e){var r=e.x||e.pageX,n=e.y||e.pageY,i="html-gl"!==e.dispatcher?this.elementResolver.getElementByCoordinates(r,n):null;i?t.HTMLGL.util.emitEvent(i,e):null},r.markStageAsChanged=function(){t.HTMLGL.stage&&!t.HTMLGL.stage.changed&&(requestAnimationFrame(this.redrawStage),t.HTMLGL.stage.changed=!0)},r.disable=function(){t.HTMLGL.enabled=!0},r.enable=function(){t.HTMLGL.enabled=!1},t.HTMLGL.pixelRatio=window.devicePixelRatio||1,t.HTMLGL.GLContext=e,new e}(window),function(t){var e=function(t,e){this.element=t,this.images=this.element.querySelectorAll("img"),this.callback=e,this.imagesLoaded=this.getImagesLoaded(),this.images.length===this.imagesLoaded?this.onImageLoaded():this.addListeners()},r=e.prototype;r.getImagesLoaded=function(){for(var t=0,e=0;et;t++)n.call(this,this._deferreds[t]);this._deferreds=null}function a(t,e,r,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=r,this.reject=n}function l(t,e,r){var n=!1;try{t(function(t){n||(n=!0,e(t))},function(t){n||(n=!0,r(t))})}catch(i){if(n)return;n=!0,r(i)}}var u=r.immediateFn||"function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)},h=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};r.prototype["catch"]=function(t){return this.then(null,t)},r.prototype.then=function(t,e){var i=this;return new r(function(r,o){n.call(i,new a(t,e,r,o))})},r.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&h(arguments[0])?arguments[0]:arguments);return new r(function(e,r){function n(o,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,function(t){n(o,t)},r)}t[o]=s,0===--i&&e(t)}catch(l){r(l)}}if(0===t.length)return e([]);for(var i=t.length,o=0;on;n++)t[n].then(e,r)})},"undefined"!=typeof module&&module.exports?module.exports=r:t.Promise||(t.Promise=r)}(this),"undefined"==typeof WeakMap&&!function(){var t=Object.defineProperty,e=Date.now()%1e9,r=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")};r.prototype={set:function(e,r){var n=e[this.name];return n&&n[0]===e?n[1]=r:t(e,this.name,{value:[e,r],writable:!0}),this},get:function(t){var e;return(e=t[this.name])&&e[0]===t?e[1]:void 0},"delete":function(t){var e=t[this.name];return e&&e[0]===t?(e[0]=e[1]=void 0,!0):!1},has:function(t){var e=t[this.name];return e?e[0]===t:!1}},window.WeakMap=r}(),window.CustomElements=window.CustomElements||{flags:{}},function(t){var e=t.flags,r=[],n=function(t){r.push(t)},i=function(){r.forEach(function(e){e(t)})};t.addModule=n,t.initializeModules=i,t.hasNative=Boolean(document.registerElement),t.useNative=!e.register&&t.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||HTMLImports.useNative)}(CustomElements),CustomElements.addModule(function(t){function e(t,e){r(t,function(t){return e(t)?!0:void n(t,e)}),n(t,e)}function r(t,e,n){var i=t.firstElementChild;if(!i)for(i=t.firstChild;i&&i.nodeType!==Node.ELEMENT_NODE;)i=i.nextSibling;for(;i;)e(i,n)!==!0&&r(i,e,n),i=i.nextElementSibling;return null}function n(t,r){for(var n=t.shadowRoot;n;)e(n,r),n=n.olderShadowRoot}function i(t,e){s=[],o(t,e),s=null}function o(t,e){if(t=wrap(t),!(s.indexOf(t)>=0)){s.push(t);for(var r,n=t.querySelectorAll("link[rel="+a+"]"),i=0,l=n.length;l>i&&(r=n[i]);i++)r["import"]&&o(r["import"],e);e(t)}}var s,a=window.HTMLImports?HTMLImports.IMPORT_LINK_TYPE:"none";t.forDocumentTree=i,t.forSubtree=e}),CustomElements.addModule(function(t){function e(t){return r(t)||n(t)}function r(e){return t.upgrade(e)?!0:void a(e)}function n(t){x(t,function(t){return r(t)?!0:void 0})}function i(t){a(t),f(t)&&x(t,function(t){a(t)})}function o(t){b.push(t),C||(C=!0,setTimeout(s))}function s(){C=!1;for(var t,e=b,r=0,n=e.length;n>r&&(t=e[r]);r++)t();b=[]}function a(t){E?o(function(){l(t)}):l(t)}function l(t){t.__upgraded__&&(t.attachedCallback||t.detachedCallback)&&!t.__attached&&f(t)&&(t.__attached=!0,t.attachedCallback&&t.attachedCallback())}function u(t){h(t),x(t,function(t){h(t)})}function h(t){E?o(function(){c(t)}):c(t)}function c(t){t.__upgraded__&&(t.attachedCallback||t.detachedCallback)&&t.__attached&&!f(t)&&(t.__attached=!1,t.detachedCallback&&t.detachedCallback())}function f(t){for(var e=t,r=wrap(document);e;){if(e==r)return!0;e=e.parentNode||e.host}}function d(t){if(t.shadowRoot&&!t.shadowRoot.__watched){y.dom&&console.log("watching shadow-root for: ",t.localName);for(var e=t.shadowRoot;e;)A(e),e=e.olderShadowRoot}}function p(t){if(y.dom){var r=t[0];if(r&&"childList"===r.type&&r.addedNodes&&r.addedNodes){for(var n=r.addedNodes[0];n&&n!==document&&!n.host;)n=n.parentNode;var i=n&&(n.URL||n._URL||n.host&&n.host.localName)||"";i=i.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",t.length,i||"")}t.forEach(function(t){"childList"===t.type&&(B(t.addedNodes,function(t){t.localName&&e(t)}),B(t.removedNodes,function(t){t.localName&&u(t)}))}),y.dom&&console.groupEnd()}function g(t){for(t=wrap(t),t||(t=wrap(document));t.parentNode;)t=t.parentNode;var e=t.__observer;e&&(p(e.takeRecords()),s())}function A(t){if(!t.__observer){var e=new MutationObserver(p);e.observe(t,{childList:!0,subtree:!0}),t.__observer=e}}function v(t){t=wrap(t),y.dom&&console.group("upgradeDocument: ",t.baseURI.split("/").pop()),e(t),A(t),y.dom&&console.groupEnd()}function m(t){w(t,v)}var y=t.flags,x=t.forSubtree,w=t.forDocumentTree,E=!window.MutationObserver||window.MutationObserver===window.JsMutationObserver;t.hasPolyfillMutations=E;var C=!1,b=[],B=Array.prototype.forEach.call.bind(Array.prototype.forEach),T=Element.prototype.createShadowRoot;T&&(Element.prototype.createShadowRoot=function(){var t=T.call(this);return CustomElements.watchShadow(this),t}),t.watchShadow=d,t.upgradeDocumentTree=m,t.upgradeSubtree=n,t.upgradeAll=e,t.attachedNode=i,t.takeRecords=g}),CustomElements.addModule(function(t){function e(e){if(!e.__upgraded__&&e.nodeType===Node.ELEMENT_NODE){var n=e.getAttribute("is"),i=t.getRegisteredDefinition(n||e.localName);if(i){if(n&&i.tag==e.localName)return r(e,i);if(!n&&!i["extends"])return r(e,i)}}}function r(e,r){return s.upgrade&&console.group("upgrade:",e.localName),r.is&&e.setAttribute("is",r.is),n(e,r),e.__upgraded__=!0,o(e),t.attachedNode(e),t.upgradeSubtree(e),s.upgrade&&console.groupEnd(),e}function n(t,e){Object.__proto__?t.__proto__=e.prototype:(i(t,e.prototype,e["native"]),t.__proto__=e.prototype)}function i(t,e,r){for(var n={},i=e;i!==r&&i!==HTMLElement.prototype;){for(var o,s=Object.getOwnPropertyNames(i),a=0;o=s[a];a++)n[o]||(Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(i,o)),n[o]=1);i=Object.getPrototypeOf(i)}}function o(t){t.createdCallback&&t.createdCallback()}var s=t.flags;t.upgrade=e,t.upgradeWithDefinition=r,t.implementPrototype=n}),CustomElements.addModule(function(t){function e(e,n){var l=n||{};if(!e)throw new Error("document.registerElement: first argument `name` must not be empty");if(e.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(e)+"'.");if(i(e))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(e)+"'. The type name is invalid.");if(u(e))throw new Error("DuplicateDefinitionError: a type with name '"+String(e)+"' is already registered");return l.prototype||(l.prototype=Object.create(HTMLElement.prototype)),l.__name=e.toLowerCase(),l.lifecycle=l.lifecycle||{},l.ancestry=o(l["extends"]),s(l),a(l),r(l.prototype),h(l.__name,l),l.ctor=c(l),l.ctor.prototype=l.prototype,l.prototype.constructor=l.ctor,t.ready&&A(document),l.ctor}function r(t){if(!t.setAttribute._polyfilled){var e=t.setAttribute;t.setAttribute=function(t,r){n.call(this,t,r,e)};var r=t.removeAttribute;t.removeAttribute=function(t){n.call(this,t,null,r)},t.setAttribute._polyfilled=!0}}function n(t,e,r){t=t.toLowerCase();var n=this.getAttribute(t);r.apply(this,arguments);var i=this.getAttribute(t);this.attributeChangedCallback&&i!==n&&this.attributeChangedCallback(t,n,i)}function i(t){for(var e=0;e=0&&y(n,HTMLElement),n)}function p(t){var e=T.call(this,t);return v(e),e}var g,A=t.upgradeDocumentTree,v=t.upgrade,m=t.upgradeWithDefinition,y=t.implementPrototype,x=t.useNative,w=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],E={},C="http://www.w3.org/1999/xhtml",b=document.createElement.bind(document),B=document.createElementNS.bind(document),T=Node.prototype.cloneNode;g=Object.__proto__||x?function(t,e){return t instanceof e}:function(t,e){for(var r=t;r;){if(r===e.prototype)return!0;r=r.__proto__}return!1},document.registerElement=e,document.createElement=d,document.createElementNS=f,Node.prototype.cloneNode=p,t.registry=E,t["instanceof"]=g,t.reservedTagList=w,t.getRegisteredDefinition=u,document.register=document.registerElement}),function(t){function e(){s(wrap(document)),window.HTMLImports&&(HTMLImports.__importsParsingHook=function(t){s(wrap(t["import"]))}),CustomElements.ready=!0,setTimeout(function(){CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})}var r=t.useNative,n=t.initializeModules,i=/Trident/.test(navigator.userAgent);if(r){var o=function(){};t.watchShadow=o,t.upgrade=o,t.upgradeAll=o,t.upgradeDocumentTree=o,t.upgradeSubtree=o,t.takeRecords=o,t["instanceof"]=function(t,e){return t instanceof e}}else n();var s=t.upgradeDocumentTree;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(t){return t}),i&&"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(t,e){e=e||{};var r=document.createEvent("CustomEvent");return r.initCustomEvent(t,Boolean(e.bubbles),Boolean(e.cancelable),e.detail),r},window.CustomEvent.prototype=window.Event.prototype),"complete"===document.readyState||t.flags.eager)e();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var a=window.HTMLImports&&!HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(a,e)}else e()}(window.CustomElements),!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.PIXI=t()}}(function(){var t;return function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[s]={exports:{}};t[s][0].call(h.exports,function(e){var r=t[s][1][e];return i(r?r:e)},h,h.exports,e,t,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s=t.length&&r())}if(r=r||function(){},!t.length)return r();var o=0;u(t,function(t){e(t,n(i))})},s.forEach=s.each,s.eachSeries=function(t,e,r){if(r=r||function(){},!t.length)return r();var n=0,i=function(){e(t[n],function(e){e?(r(e),r=function(){}):(n+=1,n>=t.length?r():i())})};i()},s.forEachSeries=s.eachSeries,s.eachLimit=function(t,e,r,n){var i=d(e);i.apply(null,[t,r,n])},s.forEachLimit=s.eachLimit;var d=function(t){return function(e,r,n){if(n=n||function(){},!e.length||0>=t)return n();var i=0,o=0,s=0;!function a(){if(i>=e.length)return n();for(;t>s&&o=e.length?n():a())})}()}},p=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.each].concat(e))}},g=function(t,e){return function(){var r=Array.prototype.slice.call(arguments);return e.apply(null,[d(t)].concat(r))}},A=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.eachSeries].concat(e))}},v=function(t,e,r,n){if(e=h(e,function(t,e){return{index:e,value:t}}),n){var i=[];t(e,function(t,e){r(t.value,function(r,n){i[t.index]=n,e(r)})},function(t){n(t,i)})}else t(e,function(t,e){r(t.value,function(t){e(t)})})};s.map=p(v),s.mapSeries=A(v),s.mapLimit=function(t,e,r,n){return m(e)(t,r,n)};var m=function(t){return g(t,v)};s.reduce=function(t,e,r,n){s.eachSeries(t,function(t,n){r(e,t,function(t,r){e=r,n(t)})},function(t){n(t,e)})},s.inject=s.reduce,s.foldl=s.reduce,s.reduceRight=function(t,e,r,n){var i=h(t,function(t){return t}).reverse();s.reduce(i,e,r,n)},s.foldr=s.reduceRight;var y=function(t,e,r,n){var i=[];e=h(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r&&i.push(t),e()})},function(t){n(h(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.filter=p(y),s.filterSeries=A(y),s.select=s.filter,s.selectSeries=s.filterSeries;var x=function(t,e,r,n){var i=[];e=h(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r||i.push(t),e()})},function(t){n(h(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.reject=p(x),s.rejectSeries=A(x);var w=function(t,e,r,n){t(e,function(t,e){r(t,function(r){r?(n(t),n=function(){}):e()})},function(t){n()})};s.detect=p(w),s.detectSeries=A(w),s.some=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t&&(r(!0),r=function(){}),n()})},function(t){r(!1)})},s.any=s.some,s.every=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t||(r(!1),r=function(){}),n()})},function(t){r(!0)})},s.all=s.every,s.sortBy=function(t,e,r){s.map(t,function(t,r){e(t,function(e,n){e?r(e):r(null,{value:t,criteria:n})})},function(t,e){if(t)return r(t);var n=function(t,e){var r=t.criteria,n=e.criteria;return n>r?-1:r>n?1:0};r(null,h(e.sort(n),function(t){return t.value}))})},s.auto=function(t,e){e=e||function(){};var r=f(t),n=r.length;if(!n)return e();var i={},o=[],a=function(t){o.unshift(t)},h=function(t){for(var e=0;en;){var o=n+(i-n+1>>>1);r(e,t[o])>=0?n=o:i=o-1}return n}function i(t,e,i,o){return t.started||(t.started=!0),l(e)||(e=[e]),0==e.length?s.setImmediate(function(){t.drain&&t.drain()}):void u(e,function(e){var a={data:e,priority:i,callback:"function"==typeof o?o:null};t.tasks.splice(n(t.tasks,a,r)+1,0,a),t.saturated&&t.tasks.length===t.concurrency&&t.saturated(),s.setImmediate(t.process)})}var o=s.queue(t,e);return o.push=function(t,e,r){i(o,t,e,r)},delete o.unshift,o},s.cargo=function(t,e){var r=!1,n=[],i={tasks:n,payload:e,saturated:null,empty:null,drain:null,drained:!0,push:function(t,r){l(t)||(t=[t]),u(t,function(t){n.push({data:t,callback:"function"==typeof r?r:null}),i.drained=!1,i.saturated&&n.length===e&&i.saturated()}),s.setImmediate(i.process)},process:function o(){if(!r){if(0===n.length)return i.drain&&!i.drained&&i.drain(),void(i.drained=!0);var s="number"==typeof e?n.splice(0,e):n.splice(0,n.length),a=h(s,function(t){return t.data});i.empty&&i.empty(),r=!0,t(a,function(){r=!1;var t=arguments;u(s,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return n.length},running:function(){return r}};return i};var b=function(t){return function(e){var r=Array.prototype.slice.call(arguments,1);e.apply(null,r.concat([function(e){var r=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&u(r,function(e){console[t](e)}))}]))}};s.log=b("log"),s.dir=b("dir"),s.memoize=function(t,e){var r={},n={};e=e||function(t){return t};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=e.apply(null,i);a in r?s.nextTick(function(){o.apply(null,r[a])}):a in n?n[a].push(o):(n[a]=[o],t.apply(null,i.concat([function(){r[a]=arguments;var t=n[a];delete n[a];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,arguments)}])))};return i.memo=r,i.unmemoized=t,i},s.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},s.times=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.map(n,e,r)},s.timesSeries=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.mapSeries(n,e,r)},s.seq=function(){var t=arguments;return function(){var e=this,r=Array.prototype.slice.call(arguments),n=r.pop();s.reduce(t,r,function(t,r,n){r.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);n(t,e)}]))},function(t,r){n.apply(e,[t].concat(r))})}},s.compose=function(){return s.seq.apply(null,Array.prototype.reverse.call(arguments))};var B=function(t,e){var r=function(){var r=this,n=Array.prototype.slice.call(arguments),i=n.pop();return t(e,function(t,e){t.apply(r,n.concat([e]))},i)};if(arguments.length>2){var n=Array.prototype.slice.call(arguments,2);return r.apply(this,n)}return r};s.applyEach=p(B),s.applyEachSeries=A(B),s.forever=function(t,e){function r(n){if(n){if(e)return e(n);throw n}t(r)}r()},"undefined"!=typeof r&&r.exports?r.exports=s:"undefined"!=typeof t&&t.amd?t([],function(){return s}):i.async=s}()}).call(this,e("_process"))},{_process:4}],3:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,i="/"===s.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),o="/"===s(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),o=n(e.split("/")),s=Math.min(i.length,o.length),a=s,l=0;s>l;l++)if(i[l]!==o[l]){a=l;break}for(var u=[],l=a;le&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:4}],4:[function(t,e,r){function n(){if(!a){a=!0;for(var t,e=s.length;e;){t=s,s=[];for(var r=-1;++ri;)e=t.charCodeAt(i++),e>=55296&&56319>=e&&o>i?(r=t.charCodeAt(i++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--)):n.push(e);return n}function u(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=N(t>>>10&1023|55296),t=56320|1023&t),e+=N(t)}).join("")}function h(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:C}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?L(t/D):t>>1,t+=L(t/e);t>Q*B>>1;n+=C)t=L(t/Q);return L(n+(Q+1)*t/(t+T))}function d(t){var e,r,n,i,s,a,l,c,d,p,g=[],A=t.length,v=0,m=P,y=M;for(r=t.lastIndexOf(R),0>r&&(r=0),n=0;r>n;++n)t.charCodeAt(n)>=128&&o("not-basic"),g.push(t.charCodeAt(n));for(i=r>0?r+1:0;A>i;){for(s=v,a=1,l=C;i>=A&&o("invalid-input"),c=h(t.charCodeAt(i++)),(c>=C||c>L((E-v)/a))&&o("overflow"),v+=c*a,d=y>=l?b:l>=y+B?B:l-y,!(d>c);l+=C)p=C-d,a>L(E/p)&&o("overflow"),a*=p;e=g.length+1,y=f(v-s,e,0==s),L(v/e)>E-m&&o("overflow"),m+=L(v/e),v%=e,g.splice(v++,0,m)}return u(g)}function p(t){var e,r,n,i,s,a,u,h,d,p,g,A,v,m,y,x=[];for(t=l(t),A=t.length,e=P,r=0,s=M,a=0;A>a;++a)g=t[a],128>g&&x.push(N(g));for(n=i=x.length,i&&x.push(R);A>n;){for(u=E,a=0;A>a;++a)g=t[a],g>=e&&u>g&&(u=g);for(v=n+1,u-e>L((E-r)/v)&&o("overflow"),r+=(u-e)*v,e=u,a=0;A>a;++a)if(g=t[a],e>g&&++r>E&&o("overflow"),g==e){for(h=r,d=C;p=s>=d?b:d>=s+B?B:d-s,!(p>h);d+=C)y=h-p,m=C-p,x.push(N(c(p+y%m,0))),h=L(y/m);x.push(N(c(h,0))),s=f(r,v,n==i),r=0,++n}++r,++e}return x.join("")}function g(t){return a(t,function(t){return I.test(t)?d(t.slice(4).toLowerCase()):t})}function A(t){return a(t,function(t){return S.test(t)?"xn--"+p(t):t})}var v="object"==typeof n&&n,m="object"==typeof r&&r&&r.exports==v&&r,y="object"==typeof e&&e;(y.global===y||y.window===y)&&(i=y);var x,w,E=2147483647,C=36,b=1,B=26,T=38,D=700,M=72,P=128,R="-",I=/^xn--/,S=/[^ -~]/,O=/\x2E|\u3002|\uFF0E|\uFF61/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Q=C-b,L=Math.floor,N=String.fromCharCode;if(x={version:"1.2.4",ucs2:{decode:l,encode:u},decode:d,encode:p,toASCII:A,toUnicode:g},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return x});else if(v&&!v.nodeType)if(m)m.exports=x;else for(w in x)x.hasOwnProperty(w)&&(v[w]=x[w]);else i.punycode=x}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var u=t.length;l>0&&u>l&&(u=l);for(var h=0;u>h;++h){var c,f,d,p,g=t[h].replace(a,"%20"),A=g.indexOf(r);A>=0?(c=g.substr(0,A),f=g.substr(A+1)):(c=g,f=""),d=decodeURIComponent(c),p=decodeURIComponent(f),n(s,d)?i(s[d])?s[d].push(p):s[d]=[s[d],p]:s[d]=p}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],7:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n",'"',"`"," ","\r","\n"," "],A=["{","}","|","\\","^","`"].concat(g),v=["'"].concat(A),m=["%","/","?",";","#"].concat(v),y=["/","?","#"],x=255,w=/^[a-z0-9A-Z_-]{0,63}$/,E=/^([a-z0-9A-Z_-]{0,63})(.*)$/,C={ +javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},B={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},T=t("querystring");n.prototype.parse=function(t,e,r){if(!l(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t;n=n.trim();var i=d.exec(n);if(i){i=i[0];var o=i.toLowerCase();this.protocol=o,n=n.substr(i.length)}if(r||i||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===n.substr(0,2);!s||i&&b[i]||(n=n.substr(2),this.slashes=!0)}if(!b[i]&&(s||i&&!B[i])){for(var a=-1,u=0;uh)&&(a=h)}var c,p;p=-1===a?n.lastIndexOf("@"):n.lastIndexOf("@",a),-1!==p&&(c=n.slice(0,p),n=n.slice(p+1),this.auth=decodeURIComponent(c)),a=-1;for(var u=0;uh)&&(a=h)}-1===a&&(a=n.length),this.host=n.slice(0,a),n=n.slice(a),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var A=this.hostname.split(/\./),u=0,D=A.length;D>u;u++){var M=A[u];if(M&&!M.match(w)){for(var P="",R=0,I=M.length;I>R;R++)P+=M.charCodeAt(R)>127?"x":M[R];if(!P.match(w)){var S=A.slice(0,u),O=A.slice(u+1),F=M.match(E);F&&(S.push(F[1]),O.unshift(F[2])),O.length&&(n="/"+O.join(".")+n),this.hostname=S.join(".");break}}}if(this.hostname=this.hostname.length>x?"":this.hostname.toLowerCase(),!g){for(var Q=this.hostname.split("."),L=[],u=0;uu;u++){var G=v[u],Y=encodeURIComponent(G);Y===G&&(Y=escape(G)),n=n.split(G).join(Y)}var j=n.indexOf("#");-1!==j&&(this.hash=n.substr(j),n=n.slice(0,j));var z=n.indexOf("?");if(-1!==z?(this.search=n.substr(z),this.query=n.substr(z+1),e&&(this.query=T.parse(this.query)),n=n.slice(0,z)):e&&(this.search="",this.query={}),n&&(this.pathname=n),B[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var H=this.pathname||"",N=this.search||"";this.path=H+N}return this.href=this.format(),this},n.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=t+this.host:this.hostname&&(i=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&u(this.query)&&Object.keys(this.query).length&&(o=T.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||B[e])&&i!==!1?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),s=s.replace("#","%23"),e+i+r+s+n},n.prototype.resolve=function(t){return this.resolveObject(i(t,!1,!0)).format()},n.prototype.resolveObject=function(t){if(l(t)){var e=new n;e.parse(t,!1,!0),t=e}var r=new n;if(Object.keys(this).forEach(function(t){r[t]=this[t]},this),r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol)return Object.keys(t).forEach(function(e){"protocol"!==e&&(r[e]=t[e])}),B[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r;if(t.protocol&&t.protocol!==r.protocol){if(!B[t.protocol])return Object.keys(t).forEach(function(e){r[e]=t[e]}),r.href=r.format(),r;if(r.protocol=t.protocol,t.host||b[t.protocol])r.pathname=t.pathname;else{for(var i=(t.pathname||"").split("/");i.length&&!(t.host=i.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==i[0]&&i.unshift(""),i.length<2&&i.unshift(""),r.pathname=i.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var o=r.pathname||"",s=r.search||"";r.path=o+s}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var a=r.pathname&&"/"===r.pathname.charAt(0),u=t.host||t.pathname&&"/"===t.pathname.charAt(0),f=u||a||r.host&&t.pathname,d=f,p=r.pathname&&r.pathname.split("/")||[],i=t.pathname&&t.pathname.split("/")||[],g=r.protocol&&!B[r.protocol];if(g&&(r.hostname="",r.port=null,r.host&&(""===p[0]?p[0]=r.host:p.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===i[0]?i[0]=t.host:i.unshift(t.host)),t.host=null),f=f&&(""===i[0]||""===p[0])),u)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,p=i;else if(i.length)p||(p=[]),p.pop(),p=p.concat(i),r.search=t.search,r.query=t.query;else if(!c(t.search)){if(g){r.hostname=r.host=p.shift();var A=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;A&&(r.auth=A.shift(),r.host=r.hostname=A.shift())}return r.search=t.search,r.query=t.query,h(r.pathname)&&h(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!p.length)return r.pathname=null,r.path=r.search?"/"+r.search:null,r.href=r.format(),r;for(var v=p.slice(-1)[0],m=(r.host||t.host)&&("."===v||".."===v)||""===v,y=0,x=p.length;x>=0;x--)v=p[x],"."==v?p.splice(x,1):".."===v?(p.splice(x,1),y++):y&&(p.splice(x,1),y--);if(!f&&!d)for(;y--;y)p.unshift("..");!f||""===p[0]||p[0]&&"/"===p[0].charAt(0)||p.unshift(""),m&&"/"!==p.join("/").substr(-1)&&p.push("");var w=""===p[0]||p[0]&&"/"===p[0].charAt(0);if(g){r.hostname=r.host=w?"":p.length?p.shift():"";var A=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;A&&(r.auth=A.shift(),r.host=r.hostname=A.shift())}return f=f||r.host&&p.length,f&&!w&&p.unshift(""),p.length?r.pathname=p.join("/"):(r.pathname=null,r.path=null),h(r.pathname)&&h(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=p.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{punycode:5,querystring:8}],10:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n=e&&e.length,a=n?e[0]*r:t.length,l=o(t,i(t,0,a,r,!0)),u=[];if(!l)return u;var c,f,d,p,g,A,v;if(n&&(l=h(t,e,l,r)),t.length>80*r){c=d=t[0],f=p=t[1];for(var m=r;a>m;m+=r)g=t[m],A=t[m+1],c>g&&(c=g),f>A&&(f=A),g>d&&(d=g),A>p&&(p=A);v=Math.max(d-c,p-f)}return s(t,l,u,r,c,f,v),u}function i(t,e,r,n,i){var o,s,a,l=0;for(o=e,s=r-n;r>o;o+=n)l+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;if(i===l>0)for(o=e;r>o;o+=n)a=B(o,a);else for(o=r-n;o>=e;o-=n)a=B(o,a);return a}function o(t,e,r){r||(r=e);var n,i=e;do if(n=!1,y(t,i.i,i.next.i)||0===m(t,i.prev.i,i.i,i.next.i)){if(i.prev.next=i.next,i.next.prev=i.prev,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ),i=r=i.prev,i===i.next)return null;n=!0}else i=i.next;while(n||i!==r);return r}function s(t,e,r,n,i,h,c,f){if(e){f||void 0===i||d(t,e,i,h,c);for(var p,g,A=e;e.prev!==e.next;)if(p=e.prev,g=e.next,a(t,e,i,h,c))r.push(p.i/n),r.push(e.i/n),r.push(g.i/n),g.prev=p,p.next=g,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),e=g.next,A=g.next;else if(e=g,e===A){f?1===f?(e=l(t,e,r,n),s(t,e,r,n,i,h,c,2)):2===f&&u(t,e,r,n,i,h,c):s(t,o(t,e),r,n,i,h,c,1);break}}}function a(t,e,r,n,i){var o=e.prev.i,s=e.i,a=e.next.i,l=t[o],u=t[o+1],h=t[s],c=t[s+1],f=t[a],d=t[a+1],p=l*c-u*h,A=l*d-u*f,v=f*c-d*h,m=p-A-v;if(0>=m)return!1;var y,x,w,E,C,b,B,T=d-u,D=l-f,M=u-c,P=h-l;if(void 0!==r){var R=h>l?f>l?l:f:f>h?h:f,I=c>u?d>u?u:d:d>c?c:d,S=l>h?l>f?l:f:h>f?h:f,O=u>c?u>d?u:d:c>d?c:d,F=g(R,I,r,n,i),Q=g(S,O,r,n,i);for(B=e.nextZ;B&&B.z<=Q;)if(y=B.i,B=B.nextZ,y!==o&&y!==a&&(x=t[y],w=t[y+1],E=T*x+D*w-A,E>=0&&(C=M*x+P*w+p,C>=0&&(b=m-E-C,b>=0&&(E&&C||E&&b||C&&b)))))return!1;for(B=e.prevZ;B&&B.z>=F;)if(y=B.i,B=B.prevZ,y!==o&&y!==a&&(x=t[y],w=t[y+1],E=T*x+D*w-A,E>=0&&(C=M*x+P*w+p,C>=0&&(b=m-E-C,b>=0&&(E&&C||E&&b||C&&b)))))return!1}else for(B=e.next.next;B!==e.prev;)if(y=B.i,B=B.next,x=t[y],w=t[y+1],E=T*x+D*w-A,E>=0&&(C=M*x+P*w+p,C>=0&&(b=m-E-C,b>=0&&(E&&C||E&&b||C&&b))))return!1;return!0}function l(t,e,r,n){var i=e;do{var o=i.prev,s=i.next.next;if(o.i!==s.i&&x(t,o.i,i.i,i.next.i,s.i)&&E(t,o,s)&&E(t,s,o)){r.push(o.i/n),r.push(i.i/n),r.push(s.i/n),o.next=s,s.prev=o;var a=i.prevZ,l=i.nextZ&&i.nextZ.nextZ;a&&(a.nextZ=l),l&&(l.prevZ=a),i=e=s}i=i.next}while(i!==e);return i}function u(t,e,r,n,i,a,l){var u=e;do{for(var h=u.next.next;h!==u.prev;){if(u.i!==h.i&&v(t,u,h)){var c=b(u,h);return u=o(t,u,u.next),c=o(t,c,c.next),s(t,u,r,n,i,a,l),void s(t,c,r,n,i,a,l)}h=h.next}u=u.next}while(u!==e)}function h(t,e,r,n){var s,a,l,u,h,f=[];for(s=0,a=e.length;a>s;s++)l=e[s]*n,u=a-1>s?e[s+1]*n:t.length,h=o(t,i(t,l,u,n,!1)),h&&f.push(A(t,h));for(f.sort(function(e,r){return t[e.i]-t[r.i]}),s=0;s=t[o+1]){var c=t[i]+(u-t[i+1])*(t[o]-t[i])/(t[o+1]-t[i+1]);l>=c&&c>h&&(h=c,n=t[i]=D?-1:1,P=n,R=1/0;for(s=n.next;s!==P;)f=t[s.i],d=t[s.i+1],p=l-f,p>=0&&f>=m&&(g=(C*f+b*d-w)*M,g>=0&&(A=(B*f+T*d+x)*M,A>=0&&D*M-g-A>=0&&(v=Math.abs(u-d)/p,R>v&&E(t,s,e)&&(n=s,R=v)))),s=s.next;return n}function d(t,e,r,n,i){var o=e;do null===o.z&&(o.z=g(t[o.i],t[o.i+1],r,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,p(o)}function p(t){var e,r,n,i,o,s,a,l,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,n=r,a=0,e=0;u>e&&(a++,n=n.nextZ);e++);for(l=u;a>0||l>0&&n;)0===a?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,a--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,a--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,u*=2}while(s>1);return t}function g(t,e,r,n,i){return t=1e3*(t-r)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=1e3*(e-n)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function A(t,e){var r=e,n=e;do t[r.i]0?1:0>i?-1:0}function y(t,e,r){return t[e]===t[r]&&t[e+1]===t[r+1]}function x(t,e,r,n,i){return m(t,e,r,n)!==m(t,e,r,i)&&m(t,n,i,e)!==m(t,n,i,r)}function w(t,e,r,n){var i=e;do{var o=i.i,s=i.next.i;if(o!==r&&s!==r&&o!==n&&s!==n&&x(t,o,s,r,n))return!0;i=i.next}while(i!==e);return!1}function E(t,e,r){return-1===m(t,e.prev.i,e.i,e.next.i)?-1!==m(t,e.i,r.i,e.next.i)&&-1!==m(t,e.i,e.prev.i,r.i):-1===m(t,e.i,r.i,e.prev.i)||-1===m(t,e.i,e.next.i,r.i)}function C(t,e,r,n){var i=e,o=!1,s=(t[r]+t[n])/2,a=(t[r+1]+t[n+1])/2;do{var l=i.i,u=i.next.i;t[l+1]>a!=t[u+1]>a&&s<(t[u]-t[l])*(a-t[l+1])/(t[u+1]-t[l+1])+t[l]&&(o=!o),i=i.next}while(i!==e);return o}function b(t,e){var r=new T(t.i),n=new T(e.i),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function B(t,e){var r=new T(t);return e?(r.next=e.next,r.prev=e,e.next.prev=r,e.next=r):(r.prev=r,r.next=r),r}function T(t){this.i=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null}e.exports=n},{}],11:[function(t,e,r){"use strict";function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function i(){}var o="function"!=typeof Object.create?"~":!1;i.prototype._events=void 0,i.prototype.listeners=function(t,e){var r=o?o+t:t,n=this._events&&this._events[r];if(e)return!!n;if(!n)return[];if(this._events[r].fn)return[this._events[r].fn];for(var i=0,s=this._events[r].length,a=new Array(s);s>i;i++)a[i]=this._events[r][i].fn;return a},i.prototype.emit=function(t,e,r,n,i,s){var a=o?o+t:t;if(!this._events||!this._events[a])return!1;var l,u,h=this._events[a],c=arguments.length;if("function"==typeof h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),c){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,r),!0;case 4:return h.fn.call(h.context,e,r,n),!0;case 5:return h.fn.call(h.context,e,r,n,i),!0;case 6:return h.fn.call(h.context,e,r,n,i,s),!0}for(u=1,l=new Array(c-1);c>u;u++)l[u-1]=arguments[u];h.fn.apply(h.context,l)}else{var f,d=h.length;for(u=0;d>u;u++)switch(h[u].once&&this.removeListener(t,h[u].fn,void 0,!0),c){case 1:h[u].fn.call(h[u].context);break;case 2:h[u].fn.call(h[u].context,e);break;case 3:h[u].fn.call(h[u].context,e,r);break;default:if(!l)for(f=1,l=new Array(c-1);c>f;f++)l[f-1]=arguments[f];h[u].fn.apply(h[u].context,l)}}return!0},i.prototype.on=function(t,e,r){var i=new n(e,r||this),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],i]:this._events[s].push(i):this._events[s]=i,this},i.prototype.once=function(t,e,r){var i=new n(e,r||this,!0),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],i]:this._events[s].push(i):this._events[s]=i,this},i.prototype.removeListener=function(t,e,r,n){var i=o?o+t:t;if(!this._events||!this._events[i])return this;var s=this._events[i],a=[];if(e)if(s.fn)(s.fn!==e||n&&!s.once||r&&s.context!==r)&&a.push(s);else for(var l=0,u=s.length;u>l;l++)(s[l].fn!==e||n&&!s[l].once||r&&s[l].context!==r)&&a.push(s[l]);return a.length?this._events[i]=1===a.length?a[0]:a:delete this._events[i],this},i.prototype.removeAllListeners=function(t){return this._events?(t?delete this._events[o?o+t:t]:this._events=o?{}:Object.create(null),this):this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prototype.setMaxListeners=function(){return this},i.prefixed=o,e.exports=i},{}],12:[function(t,e,r){"use strict";function n(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}e.exports=Object.assign||function(t,e){for(var r,i,o=n(t),s=1;s=t.length&&r())}if(r=r||function(){},!t.length)return r();var o=0;u(t,function(t){e(t,n(i))})},s.forEach=s.each,s.eachSeries=function(t,e,r){if(r=r||function(){},!t.length)return r();var n=0,i=function(){e(t[n],function(e){e?(r(e),r=function(){}):(n+=1,n>=t.length?r():i())})};i()},s.forEachSeries=s.eachSeries,s.eachLimit=function(t,e,r,n){var i=d(e);i.apply(null,[t,r,n])},s.forEachLimit=s.eachLimit;var d=function(t){return function(e,r,n){if(n=n||function(){},!e.length||0>=t)return n();var i=0,o=0,s=0;!function a(){if(i>=e.length)return n();for(;t>s&&o=e.length?n():a())})}()}},p=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.each].concat(e))}},g=function(t,e){return function(){var r=Array.prototype.slice.call(arguments);return e.apply(null,[d(t)].concat(r))}},A=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.eachSeries].concat(e))}},v=function(t,e,r,n){if(e=h(e,function(t,e){return{index:e,value:t}}),n){var i=[];t(e,function(t,e){r(t.value,function(r,n){i[t.index]=n,e(r)})},function(t){n(t,i)})}else t(e,function(t,e){r(t.value,function(t){e(t)})})};s.map=p(v),s.mapSeries=A(v),s.mapLimit=function(t,e,r,n){return m(e)(t,r,n)};var m=function(t){return g(t,v)};s.reduce=function(t,e,r,n){s.eachSeries(t,function(t,n){r(e,t,function(t,r){e=r,n(t)})},function(t){n(t,e)})},s.inject=s.reduce,s.foldl=s.reduce,s.reduceRight=function(t,e,r,n){var i=h(t,function(t){return t}).reverse();s.reduce(i,e,r,n)},s.foldr=s.reduceRight;var y=function(t,e,r,n){var i=[];e=h(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r&&i.push(t),e()})},function(t){n(h(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.filter=p(y),s.filterSeries=A(y),s.select=s.filter,s.selectSeries=s.filterSeries;var x=function(t,e,r,n){var i=[];e=h(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r||i.push(t),e()})},function(t){n(h(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.reject=p(x),s.rejectSeries=A(x);var w=function(t,e,r,n){t(e,function(t,e){r(t,function(r){r?(n(t),n=function(){}):e()})},function(t){n()})};s.detect=p(w),s.detectSeries=A(w),s.some=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t&&(r(!0),r=function(){}),n()})},function(t){r(!1)})},s.any=s.some,s.every=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t||(r(!1),r=function(){}),n()})},function(t){r(!0)})},s.all=s.every,s.sortBy=function(t,e,r){s.map(t,function(t,r){e(t,function(e,n){e?r(e):r(null,{value:t,criteria:n})})},function(t,e){if(t)return r(t);var n=function(t,e){var r=t.criteria,n=e.criteria;return n>r?-1:r>n?1:0};r(null,h(e.sort(n),function(t){return t.value}))})},s.auto=function(t,e){e=e||function(){};var r=f(t),n=r.length;if(!n)return e();var i={},o=[],a=function(t){o.unshift(t)},h=function(t){for(var e=0;en;){var o=n+(i-n+1>>>1);r(e,t[o])>=0?n=o:i=o-1}return n}function i(t,e,i,o){return t.started||(t.started=!0),l(e)||(e=[e]),0==e.length?s.setImmediate(function(){t.drain&&t.drain()}):void u(e,function(e){var a={data:e,priority:i,callback:"function"==typeof o?o:null};t.tasks.splice(n(t.tasks,a,r)+1,0,a),t.saturated&&t.tasks.length===t.concurrency&&t.saturated(),s.setImmediate(t.process)})}var o=s.queue(t,e);return o.push=function(t,e,r){i(o,t,e,r)},delete o.unshift,o},s.cargo=function(t,e){var r=!1,n=[],i={tasks:n,payload:e,saturated:null,empty:null,drain:null,drained:!0,push:function(t,r){l(t)||(t=[t]),u(t,function(t){n.push({data:t,callback:"function"==typeof r?r:null}),i.drained=!1,i.saturated&&n.length===e&&i.saturated()}),s.setImmediate(i.process)},process:function o(){if(!r){if(0===n.length)return i.drain&&!i.drained&&i.drain(),void(i.drained=!0);var s="number"==typeof e?n.splice(0,e):n.splice(0,n.length),a=h(s,function(t){return t.data});i.empty&&i.empty(),r=!0,t(a,function(){r=!1;var t=arguments;u(s,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return n.length},running:function(){return r}};return i};var b=function(t){return function(e){var r=Array.prototype.slice.call(arguments,1);e.apply(null,r.concat([function(e){var r=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&u(r,function(e){console[t](e)}))}]))}};s.log=b("log"),s.dir=b("dir"),s.memoize=function(t,e){var r={},n={};e=e||function(t){return t};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=e.apply(null,i);a in r?s.nextTick(function(){o.apply(null,r[a])}):a in n?n[a].push(o):(n[a]=[o],t.apply(null,i.concat([function(){r[a]=arguments;var t=n[a];delete n[a];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,arguments)}])))};return i.memo=r,i.unmemoized=t,i},s.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},s.times=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.map(n,e,r)},s.timesSeries=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.mapSeries(n,e,r)},s.seq=function(){var t=arguments;return function(){var e=this,r=Array.prototype.slice.call(arguments),n=r.pop();s.reduce(t,r,function(t,r,n){r.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);n(t,e)}]))},function(t,r){n.apply(e,[t].concat(r))})}},s.compose=function(){return s.seq.apply(null,Array.prototype.reverse.call(arguments))};var B=function(t,e){var r=function(){var r=this,n=Array.prototype.slice.call(arguments),i=n.pop();return t(e,function(t,e){t.apply(r,n.concat([e]))},i)};if(arguments.length>2){var n=Array.prototype.slice.call(arguments,2);return r.apply(this,n)}return r};s.applyEach=p(B),s.applyEachSeries=A(B),s.forever=function(t,e){function r(n){if(n){if(e)return e(n);throw n}t(r)}r()},"undefined"!=typeof r&&r.exports?r.exports=s:"undefined"!=typeof t&&t.amd?t([],function(){return s}):i.async=s}()}).call(this,e("_process"))},{_process:4}],14:[function(t,e,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],15:[function(t,e,r){function n(t,e){a.call(this),e=e||10,this.baseUrl=t||"",this.progress=0,this.loading=!1,this._progressChunk=0,this._beforeMiddleware=[],this._afterMiddleware=[],this._boundLoadResource=this._loadResource.bind(this),this._boundOnLoad=this._onLoad.bind(this),this._buffer=[],this._numToLoad=0,this._queue=i.queue(this._boundLoadResource,e),this.resources={}}var i=t("async"),o=t("url"),s=t("./Resource"),a=t("eventemitter3");n.prototype=Object.create(a.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.add=n.prototype.enqueue=function(t,e,r,n){if(Array.isArray(t)){for(var i=0;i0)if(this.xhrType===n.XHR_RESPONSE_TYPE.TEXT)this.data=t.responseText;else if(this.xhrType===n.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t.responseText),this.isJson=!0}catch(r){this.error=new Error("Error trying to parse loaded json:",r)}else if(this.xhrType===n.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var i=new DOMParser;this.data=i.parseFromString(t.responseText,"text/xml")}else{var o=document.createElement("div");o.innerHTML=t.responseText,this.data=o}this.isXml=!0}catch(r){this.error=new Error("Error trying to parse loaded xml:",r)}else this.data=t.response||t.responseText;else this.error=new Error("["+t.status+"]"+t.statusText+":"+t.responseURL);this.complete()},n.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";e=e||window.location,u||(u=document.createElement("a")),u.href=t,t=a.parse(u.href);var r=!t.port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&r&&t.protocol===e.protocol?"":"anonymous"},n.prototype._determineXhrType=function(){return n._xhrTypeMap[this._getExtension()]||n.XHR_RESPONSE_TYPE.TEXT},n.prototype._determineLoadType=function(){return n._loadTypeMap[this._getExtension()]||n.LOAD_TYPE.XHR},n.prototype._getExtension=function(){var t,e=this.url;if(this.isDataUrl){var r=e.indexOf("/");t=e.substring(r+1,e.indexOf(";",r))}else{var n=e.indexOf("?");-1!==n&&(e=e.substring(0,n)),t=e.substring(e.lastIndexOf(".")+1)}return t},n.prototype._getMimeFromXhrType=function(t){switch(t){case n.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case n.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case n.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case n.XHR_RESPONSE_TYPE.JSON:return"application/json";case n.XHR_RESPONSE_TYPE.DEFAULT:case n.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},n.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},n.XHR_READY_STATE={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},n.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},n._loadTypeMap={gif:n.LOAD_TYPE.IMAGE,png:n.LOAD_TYPE.IMAGE,bmp:n.LOAD_TYPE.IMAGE,jpg:n.LOAD_TYPE.IMAGE,jpeg:n.LOAD_TYPE.IMAGE,tif:n.LOAD_TYPE.IMAGE,tiff:n.LOAD_TYPE.IMAGE,webp:n.LOAD_TYPE.IMAGE,tga:n.LOAD_TYPE.IMAGE},n._xhrTypeMap={xhtml:n.XHR_RESPONSE_TYPE.DOCUMENT,html:n.XHR_RESPONSE_TYPE.DOCUMENT,htm:n.XHR_RESPONSE_TYPE.DOCUMENT,xml:n.XHR_RESPONSE_TYPE.DOCUMENT,tmx:n.XHR_RESPONSE_TYPE.DOCUMENT,tsx:n.XHR_RESPONSE_TYPE.DOCUMENT,svg:n.XHR_RESPONSE_TYPE.DOCUMENT,gif:n.XHR_RESPONSE_TYPE.BLOB,png:n.XHR_RESPONSE_TYPE.BLOB,bmp:n.XHR_RESPONSE_TYPE.BLOB,jpg:n.XHR_RESPONSE_TYPE.BLOB,jpeg:n.XHR_RESPONSE_TYPE.BLOB,tif:n.XHR_RESPONSE_TYPE.BLOB,tiff:n.XHR_RESPONSE_TYPE.BLOB,webp:n.XHR_RESPONSE_TYPE.BLOB,tga:n.XHR_RESPONSE_TYPE.BLOB,json:n.XHR_RESPONSE_TYPE.JSON,text:n.XHR_RESPONSE_TYPE.TEXT,txt:n.XHR_RESPONSE_TYPE.TEXT},n.setExtensionLoadType=function(t,e){o(n._loadTypeMap,t,e)},n.setExtensionXhrType=function(t,e){o(n._xhrTypeMap,t,e)}},{eventemitter3:14,url:9}],17:[function(t,e,r){e.exports={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encodeBinary:function(t){for(var e,r="",n=new Array(4),i=0,o=0,s=0;i>2,n[1]=(3&e[0])<<4|e[1]>>4,n[2]=(15&e[1])<<2|e[2]>>6,n[3]=63&e[2],s=i-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(o=0;o","Richard Davey "],main:"./src/index.js",homepage:"http://goodboydigital.com/",bugs:"https://github.com/GoodBoyDigital/pixi.js/issues",license:"MIT",repository:{type:"git",url:"https://github.com/GoodBoyDigital/pixi.js.git"},scripts:{start:"gulp && gulp watch",test:"gulp && testem ci",build:"gulp",docs:"jsdoc -c ./gulp/util/jsdoc.conf.json -R README.md"},files:["bin/","src/"],dependencies:{async:"^0.9.0",brfs:"^1.4.0",earcut:"^2.0.1",eventemitter3:"^1.1.0","object-assign":"^2.0.0","resource-loader":"^1.6.1"},devDependencies:{browserify:"^10.2.3",chai:"^3.0.0",del:"^1.2.0",gulp:"^3.9.0","gulp-cached":"^1.1.0","gulp-concat":"^2.5.2","gulp-debug":"^2.0.1","gulp-jshint":"^1.11.0","gulp-mirror":"^0.4.0","gulp-plumber":"^1.0.1","gulp-rename":"^1.2.2","gulp-sourcemaps":"^1.5.2","gulp-uglify":"^1.2.0","gulp-util":"^3.0.5","jaguarjs-jsdoc":"git+https://github.com/davidshimjs/jaguarjs-jsdoc.git",jsdoc:"^3.3.0","jshint-summary":"^0.4.0",minimist:"^1.1.1",mocha:"^2.2.5","require-dir":"^0.3.0","run-sequence":"^1.1.0",testem:"^0.8.3","vinyl-buffer":"^1.0.0","vinyl-source-stream":"^1.1.0",watchify:"^3.2.1"},browserify:{transform:["brfs"]}}},{}],22:[function(t,e,r){var n={VERSION:t("../../package.json").version,PI_2:2*Math.PI,RAD_TO_DEG:180/Math.PI,DEG_TO_RAD:Math.PI/180,TARGET_FPMS:.06,RENDERER_TYPE:{UNKNOWN:0,WEBGL:1,CANVAS:2},BLEND_MODES:{NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},DRAW_MODES:{POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},SCALE_MODES:{DEFAULT:0,LINEAR:0,NEAREST:1},RETINA_PREFIX:/@(.+)x/,RESOLUTION:1,FILTER_RESOLUTION:1,DEFAULT_RENDER_OPTIONS:{view:null,resolution:1,antialias:!1,forceFXAA:!1,autoResize:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1},SHAPES:{POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},SPRITE_BATCH_SIZE:2e3};e.exports=n},{"../../package.json":21}],23:[function(t,e,r){function n(){o.call(this),this.children=[]}var i=t("../math"),o=t("./DisplayObject"),s=t("../textures/RenderTexture"),a=new i.Matrix;n.prototype=Object.create(o.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{width:{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t}},height:{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t}}}),n.prototype.addChild=function(t){return this.addChildAt(t,this.children.length)},n.prototype.addChildAt=function(t,e){if(t===this)return t;if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),t.emit("added",this),t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},n.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),n=this.getChildIndex(e);if(0>r||0>n)throw new Error("swapChildren: Both the supplied DisplayObjects must be children of the caller.");this.children[r]=e,this.children[n]=t}},n.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},n.prototype.setChildIndex=function(t,e){if(0>e||e>=this.children.length)throw new Error("The supplied index is out of bounds");var r=this.getChildIndex(t);this.children.splice(r,1),this.children.splice(e,0,t)},n.prototype.getChildAt=function(t){if(0>t||t>=this.children.length)throw new Error("getChildAt: Supplied index "+t+" does not exist in the child list, or the supplied DisplayObject is not a child of the caller");return this.children[t]},n.prototype.removeChild=function(t){var e=this.children.indexOf(t);return-1!==e?this.removeChildAt(e):void 0},n.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,this.children.splice(t,1),e.emit("removed",this),e},n.prototype.removeChildren=function(t,e){var r=t||0,n="number"==typeof e?e:this.children.length,i=n-r;if(i>0&&n>=i){for(var o=this.children.splice(r,i),s=0;st;++t)this.children[t].updateTransform()}},n.prototype.containerUpdateTransform=n.prototype.updateTransform,n.prototype.getBounds=function(){if(!this._currentBounds){if(0===this.children.length)return i.Rectangle.EMPTY;for(var t,e,r,n=1/0,o=1/0,s=-(1/0),a=-(1/0),l=!1,u=0,h=this.children.length;h>u;++u){var c=this.children[u];c.visible&&(l=!0,t=this.children[u].getBounds(),n=ne?s:e,a=a>r?a:r)}if(!l)return i.Rectangle.EMPTY;var f=this._bounds;f.x=n,f.y=o,f.width=s-n,f.height=a-o,this._currentBounds=f}return this._currentBounds},n.prototype.containerGetBounds=n.prototype.getBounds,n.prototype.getLocalBounds=function(){var t=this.worldTransform;this.worldTransform=i.Matrix.IDENTITY;for(var e=0,r=this.children.length;r>e;++e)this.children[e].updateTransform();return this.worldTransform=t,this._currentBounds=null,this.getBounds(i.Matrix.IDENTITY)},n.prototype.renderWebGL=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var e,r;if(this._mask||this._filters){for(t.currentRenderer.flush(),this._filters&&t.filterManager.pushFilter(this,this._filters),this._mask&&t.maskManager.pushMask(this,this._mask),t.currentRenderer.start(),this._renderWebGL(t),e=0,r=this.children.length;r>e;e++)this.children[e].renderWebGL(t);t.currentRenderer.flush(),this._mask&&t.maskManager.popMask(this,this._mask),this._filters&&t.filterManager.popFilter(),t.currentRenderer.start()}else for(this._renderWebGL(t),e=0,r=this.children.length;r>e;++e)this.children[e].renderWebGL(t)}},n.prototype._renderWebGL=function(t){},n.prototype._renderCanvas=function(t){},n.prototype.renderCanvas=function(t){if(this.visible&&!(this.alpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask,t),this._renderCanvas(t);for(var e=0,r=this.children.length;r>e;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},n.prototype.destroy=function(t){if(o.prototype.destroy.call(this),t)for(var e=0,r=this.children.length;r>e;++e)this.children[e].destroy(t);this.removeChildren(),this.children=null}},{"../math":32,"../textures/RenderTexture":70,"./DisplayObject":24}],24:[function(t,e,r){function n(){s.call(this),this.position=new i.Point,this.scale=new i.Point(1,1),this.pivot=new i.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this.worldTransform=new i.Matrix,this.filterArea=null,this._sr=0,this._cr=1,this._bounds=new i.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cachedObject=null}var i=t("../math"),o=t("../textures/RenderTexture"),s=t("eventemitter3"),a=t("../const"),l=new i.Matrix;n.prototype=Object.create(s.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},worldVisible:{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},mask:{get:function(){return this._mask},set:function(t){this._mask&&(this._mask.renderable=!0),this._mask=t,this._mask&&(this._mask.renderable=!1)}},filters:{get:function(){return this._filters&&this._filters.slice()},set:function(t){this._filters=t&&t.slice()}}}),n.prototype.updateTransform=function(){var t,e,r,n,i,o,s=this.parent.worldTransform,l=this.worldTransform;this.rotation%a.PI_2?(this.rotation!==this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation)),t=this._cr*this.scale.x,e=this._sr*this.scale.x,r=-this._sr*this.scale.y,n=this._cr*this.scale.y,i=this.position.x,o=this.position.y,(this.pivot.x||this.pivot.y)&&(i-=this.pivot.x*t+this.pivot.y*r,o-=this.pivot.x*e+this.pivot.y*n),l.a=t*s.a+e*s.c,l.b=t*s.b+e*s.d,l.c=r*s.a+n*s.c,l.d=r*s.b+n*s.d,l.tx=i*s.a+o*s.c+s.tx,l.ty=i*s.b+o*s.d+s.ty):(t=this.scale.x,n=this.scale.y,i=this.position.x-this.pivot.x*t,o=this.position.y-this.pivot.y*n,l.a=t*s.a,l.b=t*s.b,l.c=n*s.c,l.d=n*s.d,l.tx=i*s.a+o*s.c+s.tx,l.ty=i*s.b+o*s.d+s.ty),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._currentBounds=null},n.prototype.displayObjectUpdateTransform=n.prototype.updateTransform,n.prototype.getBounds=function(t){return i.Rectangle.EMPTY},n.prototype.getLocalBounds=function(){return this.getBounds(i.Matrix.IDENTITY)},n.prototype.toGlobal=function(t){return this.displayObjectUpdateTransform(),this.worldTransform.apply(t)},n.prototype.toLocal=function(t,e){return e&&(t=e.toGlobal(t)),this.displayObjectUpdateTransform(),this.worldTransform.applyInverse(t)},n.prototype.renderWebGL=function(t){},n.prototype.renderCanvas=function(t){},n.prototype.generateTexture=function(t,e,r){var n=this.getLocalBounds(),i=new o(t,0|n.width,0|n.height,e,r);return l.tx=-n.x,l.ty=-n.y,i.render(this,l),i},n.prototype.destroy=function(){this.position=null,this.scale=null,this.pivot=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.worldTransform=null,this.filterArea=null}},{"../const":22,"../math":32,"../textures/RenderTexture":70,eventemitter3:11}],25:[function(t,e,r){function n(){i.call(this),this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this._prevTint=16777215,this.blendMode=h.BLEND_MODES.NORMAL,this.currentPath=null,this._webGL={},this.isMask=!1,this.boundsPadding=0,this._localBounds=new u.Rectangle(0,0,1,1),this.dirty=!0,this.glDirty=!1,this.boundsDirty=!0,this.cachedSpriteDirty=!1}var i=t("../display/Container"),o=t("../textures/Texture"),s=t("../renderers/canvas/utils/CanvasBuffer"),a=t("../renderers/canvas/utils/CanvasGraphics"),l=t("./GraphicsData"),u=t("../math"),h=t("../const"),c=new u.Point;n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{}),n.prototype.clone=function(){var t=new n;t.renderable=this.renderable,t.fillAlpha=this.fillAlpha,t.lineWidth=this.lineWidth,t.lineColor=this.lineColor,t.tint=this.tint,t.blendMode=this.blendMode,t.isMask=this.isMask,t.boundsPadding=this.boundsPadding,t.dirty=this.dirty,t.glDirty=this.glDirty,t.cachedSpriteDirty=this.cachedSpriteDirty;for(var e=0;e=c;++c)h=c/s,i=l+(t-l)*h,o=u+(e-u)*h,a.push(i+(t+(r-t)*h-i)*h,o+(e+(n-e)*h-o)*h);return this.dirty=this.boundsDirty=!0,this},n.prototype.bezierCurveTo=function(t,e,r,n,i,o){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var s,a,l,u,h,c=20,f=this.currentPath.shape.points,d=f[f.length-2],p=f[f.length-1],g=0,A=1;c>=A;++A)g=A/c,s=1-g,a=s*s,l=a*s,u=g*g,h=u*g,f.push(l*d+3*a*g*t+3*s*u*r+h*i,l*p+3*a*g*e+3*s*u*n+h*o);return this.dirty=this.boundsDirty=!0,this},n.prototype.arcTo=function(t,e,r,n,i){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var o=this.currentPath.shape.points,s=o[o.length-2],a=o[o.length-1],l=a-e,u=s-t,h=n-e,c=r-t,f=Math.abs(l*c-u*h);if(1e-8>f||0===i)(o[o.length-2]!==t||o[o.length-1]!==e)&&o.push(t,e);else{var d=l*l+u*u,p=h*h+c*c,g=l*h+u*c,A=i*Math.sqrt(d)/f,v=i*Math.sqrt(p)/f,m=A*g/d,y=v*g/p,x=A*c+v*u,w=A*h+v*l,E=u*(v+m),C=l*(v+m),b=c*(A+y),B=h*(A+y),T=Math.atan2(C-w,E-x),D=Math.atan2(B-w,b-x);this.arc(x+t,w+e,i,T,D,u*h>c*l)}return this.dirty=this.boundsDirty=!0,this},n.prototype.arc=function(t,e,r,n,i,o){if(o=o||!1,n===i)return this;!o&&n>=i?i+=2*Math.PI:o&&i>=n&&(n+=2*Math.PI);var s=o?-1*(n-i):i-n,a=40*Math.ceil(Math.abs(s)/(2*Math.PI));if(0===s)return this;var l=t+Math.cos(n)*r,u=e+Math.sin(n)*r;this.currentPath?o&&this.filling?this.currentPath.shape.points.push(t,e):this.currentPath.shape.points.push(l,u):o&&this.filling?this.moveTo(t,e):this.moveTo(l,u);for(var h=this.currentPath.shape.points,c=s/(2*a),f=2*c,d=Math.cos(c),p=Math.sin(c),g=a-1,A=g%1/g,v=0;g>=v;v++){var m=v+A*v,y=c+n+f*m,x=Math.cos(y),w=-Math.sin(y);h.push((d*x+p*w)*r+t,(d*-w+p*x)*r+e)}return this.dirty=this.boundsDirty=!0,this},n.prototype.beginFill=function(t,e){return this.filling=!0,this.fillColor=t||0,this.fillAlpha=void 0===e?1:e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},n.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},n.prototype.drawRect=function(t,e,r,n){return this.drawShape(new u.Rectangle(t,e,r,n)),this},n.prototype.drawRoundedRect=function(t,e,r,n,i){return this.drawShape(new u.RoundedRectangle(t,e,r,n,i)),this},n.prototype.drawCircle=function(t,e,r){return this.drawShape(new u.Circle(t,e,r)),this},n.prototype.drawEllipse=function(t,e,r,n){return this.drawShape(new u.Ellipse(t,e,r,n)),this},n.prototype.drawPolygon=function(t){var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;rA?A:b,b=b>m?m:b,b=b>x?x:b,B=B>v?v:B,B=B>y?y:B,B=B>w?w:B,E=A>E?A:E,E=m>E?m:E,E=x>E?x:E,C=v>C?v:C,C=y>C?y:C,C=w>C?w:C,this._bounds.x=b,this._bounds.width=E-b,this._bounds.y=B,this._bounds.height=C-B,this._currentBounds=this._bounds}return this._currentBounds},n.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,c);for(var e=this.graphicsData,r=0;rs?s:t,e=s+l>e?s+l:e,r=r>a?a:r,n=a+u>n?a+u:n;else if(d===h.SHAPES.CIRC)s=i.x,a=i.y,l=i.radius+p/2,u=i.radius+p/2,t=t>s-l?s-l:t,e=s+l>e?s+l:e,r=r>a-u?a-u:r,n=a+u>n?a+u:n;else if(d===h.SHAPES.ELIP)s=i.x,a=i.y,l=i.width+p/2,u=i.height+p/2,t=t>s-l?s-l:t,e=s+l>e?s+l:e,r=r>a-u?a-u:r,n=a+u>n?a+u:n;else{o=i.points;for(var g=0;gs-p?s-p:t,e=s+p>e?s+p:e,r=r>a-p?a-p:r,n=a+p>n?a+p:n}}else t=0,e=0,r=0,n=0;var A=this.boundsPadding;this._localBounds.x=t-A,this._localBounds.width=e-t+2*A,this._localBounds.y=r-A,this._localBounds.height=n-r+2*A},n.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var e=new l(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,t);return this.graphicsData.push(e),e.type===h.SHAPES.POLY&&(e.shape.closed=e.shape.closed||this.filling,this.currentPath=e),this.dirty=this.boundsDirty=!0,e},n.prototype.destroy=function(){i.prototype.destroy.apply(this,arguments);for(var t=0;t=6)if(a.points.length<2*this.maximumSimplePolySize){o=this.switchMode(r,0);var l=this.buildPoly(a,o);l||(o=this.switchMode(r,1),this.buildComplexPoly(a,o))}else o=this.switchMode(r,1),this.buildComplexPoly(a,o);a.lineWidth>0&&(o=this.switchMode(r,0),this.buildLine(a,o))}else o=this.switchMode(r,0),a.type===s.SHAPES.RECT?this.buildRectangle(a,o):a.type===s.SHAPES.CIRC||a.type===s.SHAPES.ELIP?this.buildCircle(a,o):a.type===s.SHAPES.RREC&&this.buildRoundedRectangle(a,o);r.lastIndex++}for(n=0;n32e4||r.mode!==e||1===e)&&(r=this.graphicsDataPool.pop()||new u(t.gl),r.mode=e,t.data.push(r))):(r=this.graphicsDataPool.pop()||new u(t.gl),r.mode=e,t.data.push(r)),r.dirty=!0,r},n.prototype.buildRectangle=function(t,e){var r=t.shape,n=r.x,o=r.y,s=r.width,a=r.height;if(t.fill){var l=i.hex2rgb(t.fillColor),u=t.fillAlpha,h=l[0]*u,c=l[1]*u,f=l[2]*u,d=e.points,p=e.indices,g=d.length/6;d.push(n,o),d.push(h,c,f,u),d.push(n+s,o),d.push(h,c,f,u),d.push(n,o+a),d.push(h,c,f,u),d.push(n+s,o+a),d.push(h,c,f,u),p.push(g,g,g+1,g+2,g+3,g+3)}if(t.lineWidth){var A=t.points;t.points=[n,o,n+s,o,n+s,o+a,n,o+a,n,o],this.buildLine(t,e),t.points=A}},n.prototype.buildRoundedRectangle=function(t,e){var r=t.shape,n=r.x,o=r.y,s=r.width,a=r.height,l=r.radius,u=[];if(u.push(n,o+l),this.quadraticBezierCurve(n,o+a-l,n,o+a,n+l,o+a,u),this.quadraticBezierCurve(n+s-l,o+a,n+s,o+a,n+s,o+a-l,u),this.quadraticBezierCurve(n+s,o+l,n+s,o,n+s-l,o,u),this.quadraticBezierCurve(n+l,o,n,o,n,o+l+1e-10,u),t.fill){var c=i.hex2rgb(t.fillColor),f=t.fillAlpha,d=c[0]*f,p=c[1]*f,g=c[2]*f,A=e.points,v=e.indices,m=A.length/6,y=h(u,null,2),x=0;for(x=0;x=v;v++)A=v/p,l=a(t,r,A),u=a(e,n,A),h=a(r,i,A),c=a(n,o,A),f=a(l,h,A),d=a(u,c,A),g.push(f,d);return g},n.prototype.buildCircle=function(t,e){var r,n,o=t.shape,a=o.x,l=o.y;t.type===s.SHAPES.CIRC?(r=o.radius,n=o.radius):(r=o.width,n=o.height);var u=40,h=2*Math.PI/u,c=0;if(t.fill){var f=i.hex2rgb(t.fillColor),d=t.fillAlpha,p=f[0]*d,g=f[1]*d,A=f[2]*d,v=e.points,m=e.indices,y=v.length/6;for(m.push(y),c=0;u+1>c;c++)v.push(a,l,p,g,A,d),v.push(a+Math.sin(h*c)*r,l+Math.cos(h*c)*n,p,g,A,d),m.push(y++,y++);m.push(y-1)}if(t.lineWidth){var x=t.points;for(t.points=[],c=0;u+1>c;c++)t.points.push(a+Math.sin(h*c)*r,l+Math.cos(h*c)*n);this.buildLine(t,e),t.points=x}},n.prototype.buildLine=function(t,e){var r=0,n=t.points;if(0!==n.length){if(t.lineWidth%2)for(r=0;rr;r++)f=n[2*(r-1)],d=n[2*(r-1)+1],p=n[2*r],g=n[2*r+1],A=n[2*(r+1)],v=n[2*(r+1)+1],m=-(d-g),y=f-p,S=Math.sqrt(m*m+y*y),m/=S,y/=S,m*=H,y*=H,x=-(g-v),w=p-A,S=Math.sqrt(x*x+w*w),x/=S,w/=S,x*=H,w*=H,b=-y+d-(-y+g),B=-m+p-(-m+f),T=(-m+f)*(-y+g)-(-m+p)*(-y+d),D=-w+v-(-w+g),M=-x+p-(-x+A),P=(-x+A)*(-w+g)-(-x+p)*(-w+v),R=b*M-D*B,Math.abs(R)<.1?(R+=10.1,O.push(p-m,g-y,Y,j,z,G),O.push(p+m,g+y,Y,j,z,G)):(h=(B*P-M*T)/R,c=(D*T-b*P)/R,I=(h-p)*(h-p)+(c-g)+(c-g),I>19600?(E=m-x,C=y-w,S=Math.sqrt(E*E+C*C),E/=S, +C/=S,E*=H,C*=H,O.push(p-E,g-C),O.push(Y,j,z,G),O.push(p+E,g+C),O.push(Y,j,z,G),O.push(p-E,g-C),O.push(Y,j,z,G),L++):(O.push(h,c),O.push(Y,j,z,G),O.push(p-(h-p),g-(c-g)),O.push(Y,j,z,G)));for(f=n[2*(Q-2)],d=n[2*(Q-2)+1],p=n[2*(Q-1)],g=n[2*(Q-1)+1],m=-(d-g),y=f-p,S=Math.sqrt(m*m+y*y),m/=S,y/=S,m*=H,y*=H,O.push(p-m,g-y),O.push(Y,j,z,G),O.push(p+m,g+y),O.push(Y,j,z,G),F.push(N),r=0;L>r;r++)F.push(N++);F.push(N-1)}},n.prototype.buildComplexPoly=function(t,e){var r=t.points.slice();if(!(r.length<6)){var n=e.indices;e.points=r,e.alpha=t.fillAlpha,e.color=i.hex2rgb(t.fillColor);for(var o,s,a=1/0,l=-(1/0),u=1/0,h=-(1/0),c=0;co?o:a,l=o>l?o:l,u=u>s?s:u,h=s>h?s:h;r.push(a,u,l,u,l,h,a,h);var f=r.length/2;for(c=0;f>c;c++)n.push(c)}},n.prototype.buildPoly=function(t,e){var r=t.points;if(!(r.length<6)){var n=e.points,o=e.indices,s=r.length/2,a=i.hex2rgb(t.fillColor),l=t.fillAlpha,u=a[0]*l,c=a[1]*l,f=a[2]*l,d=h(r,null,2);if(!d)return!1;var p=n.length/6,g=0;for(g=0;gg;g++)n.push(r[2*g],r[2*g+1],u,c,f,l);return!0}}},{"../../const":22,"../../math":32,"../../renderers/webgl/WebGLRenderer":48,"../../renderers/webgl/utils/ObjectRenderer":62,"../../utils":76,"./WebGLGraphicsData":28,earcut:10}],28:[function(t,e,r){function n(t){this.gl=t,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0,this.glPoints=null,this.glIndices=null}n.prototype.constructor=n,e.exports=n,n.prototype.reset=function(){this.points.length=0,this.indices.length=0},n.prototype.upload=function(){var t=this.gl;this.glPoints=new Float32Array(this.points),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.bufferData(t.ARRAY_BUFFER,this.glPoints,t.STATIC_DRAW),this.glIndices=new Uint16Array(this.indices),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.glIndices,t.STATIC_DRAW),this.dirty=!1},n.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.gl.deleteBuffer(this.buffer),this.gl.deleteBuffer(this.indexBuffer),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null}},{}],29:[function(t,e,r){var n=e.exports=Object.assign(t("./const"),t("./math"),{utils:t("./utils"),ticker:t("./ticker"),DisplayObject:t("./display/DisplayObject"),Container:t("./display/Container"),Sprite:t("./sprites/Sprite"),ParticleContainer:t("./particles/ParticleContainer"),SpriteRenderer:t("./sprites/webgl/SpriteRenderer"),ParticleRenderer:t("./particles/webgl/ParticleRenderer"),Text:t("./text/Text"),Graphics:t("./graphics/Graphics"),GraphicsData:t("./graphics/GraphicsData"),GraphicsRenderer:t("./graphics/webgl/GraphicsRenderer"),Texture:t("./textures/Texture"),BaseTexture:t("./textures/BaseTexture"),RenderTexture:t("./textures/RenderTexture"),VideoBaseTexture:t("./textures/VideoBaseTexture"),TextureUvs:t("./textures/TextureUvs"),CanvasRenderer:t("./renderers/canvas/CanvasRenderer"),CanvasGraphics:t("./renderers/canvas/utils/CanvasGraphics"),CanvasBuffer:t("./renderers/canvas/utils/CanvasBuffer"),WebGLRenderer:t("./renderers/webgl/WebGLRenderer"),ShaderManager:t("./renderers/webgl/managers/ShaderManager"),Shader:t("./renderers/webgl/shaders/Shader"),ObjectRenderer:t("./renderers/webgl/utils/ObjectRenderer"),RenderTarget:t("./renderers/webgl/utils/RenderTarget"),AbstractFilter:t("./renderers/webgl/filters/AbstractFilter"),FXAAFilter:t("./renderers/webgl/filters/FXAAFilter"),SpriteMaskFilter:t("./renderers/webgl/filters/SpriteMaskFilter"),autoDetectRenderer:function(t,e,r,i){return t=t||800,e=e||600,!i&&n.utils.isWebGLSupported()?new n.WebGLRenderer(t,e,r):new n.CanvasRenderer(t,e,r)}})},{"./const":22,"./display/Container":23,"./display/DisplayObject":24,"./graphics/Graphics":25,"./graphics/GraphicsData":26,"./graphics/webgl/GraphicsRenderer":27,"./math":32,"./particles/ParticleContainer":38,"./particles/webgl/ParticleRenderer":40,"./renderers/canvas/CanvasRenderer":43,"./renderers/canvas/utils/CanvasBuffer":44,"./renderers/canvas/utils/CanvasGraphics":45,"./renderers/webgl/WebGLRenderer":48,"./renderers/webgl/filters/AbstractFilter":49,"./renderers/webgl/filters/FXAAFilter":50,"./renderers/webgl/filters/SpriteMaskFilter":51,"./renderers/webgl/managers/ShaderManager":55,"./renderers/webgl/shaders/Shader":60,"./renderers/webgl/utils/ObjectRenderer":62,"./renderers/webgl/utils/RenderTarget":64,"./sprites/Sprite":66,"./sprites/webgl/SpriteRenderer":67,"./text/Text":68,"./textures/BaseTexture":69,"./textures/RenderTexture":70,"./textures/Texture":71,"./textures/TextureUvs":72,"./textures/VideoBaseTexture":73,"./ticker":75,"./utils":76}],30:[function(t,e,r){function n(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0}var i=t("./Point");n.prototype.constructor=n,e.exports=n,n.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},n.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},n.prototype.apply=function(t,e){e=e||new i;var r=t.x,n=t.y;return e.x=this.a*r+this.c*n+this.tx,e.y=this.b*r+this.d*n+this.ty,e},n.prototype.applyInverse=function(t,e){e=e||new i;var r=1/(this.a*this.d+this.c*-this.b),n=t.x,o=t.y;return e.x=this.d*r*n+-this.c*r*o+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*o+-this.b*r*n+(-this.ty*this.a+this.tx*this.b)*r,e},n.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},n.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},n.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),n=this.a,i=this.c,o=this.tx;return this.a=n*e-this.b*r,this.b=n*r+this.b*e,this.c=i*e-this.d*r,this.d=i*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},n.prototype.append=function(t){var e=this.a,r=this.b,n=this.c,i=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*r+t.b*i,this.c=t.c*e+t.d*n,this.d=t.c*r+t.d*i,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*r+t.ty*i+this.ty,this},n.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,n=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},n.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,n=this.d,i=this.tx,o=t*n-e*r;return this.a=n/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-n*i)/o,this.ty=-(t*this.ty-e*i)/o,this},n.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},n.prototype.clone=function(){var t=new n;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},n.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},n.IDENTITY=new n,n.TEMP_MATRIX=new n},{"./Point":31}],31:[function(t,e,r){function n(t,e){this.x=t||0,this.y=e||0}n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.x,this.y)},n.prototype.copy=function(t){this.set(t.x,t.y)},n.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},n.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)}},{}],32:[function(t,e,r){e.exports={Point:t("./Point"),Matrix:t("./Matrix"),Circle:t("./shapes/Circle"),Ellipse:t("./shapes/Ellipse"),Polygon:t("./shapes/Polygon"),Rectangle:t("./shapes/Rectangle"),RoundedRectangle:t("./shapes/RoundedRectangle")}},{"./Matrix":30,"./Point":31,"./shapes/Circle":33,"./shapes/Ellipse":34,"./shapes/Polygon":35,"./shapes/Rectangle":36,"./shapes/RoundedRectangle":37}],33:[function(t,e,r){function n(t,e,r){this.x=t||0,this.y=e||0,this.radius=r||0,this.type=o.SHAPES.CIRC}var i=t("./Rectangle"),o=t("../../const");n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.x,this.y,this.radius)},n.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.x-t,n=this.y-e,i=this.radius*this.radius;return r*=r,n*=n,i>=r+n},n.prototype.getBounds=function(){return new i(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}},{"../../const":22,"./Rectangle":36}],34:[function(t,e,r){function n(t,e,r,n){this.x=t||0,this.y=e||0,this.width=r||0,this.height=n||0,this.type=o.SHAPES.ELIP}var i=t("./Rectangle"),o=t("../../const");n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.x,this.y,this.width,this.height)},n.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,n=(e-this.y)/this.height;return r*=r,n*=n,1>=r+n},n.prototype.getBounds=function(){return new i(this.x-this.width,this.y-this.height,this.width,this.height)}},{"../../const":22,"./Rectangle":36}],35:[function(t,e,r){function n(t){var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;rs;s++)n.push(e[s].x,e[s].y);e=n}this.closed=!0,this.points=e,this.type=o.SHAPES.POLY}var i=t("../Point"),o=t("../../const");n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.points.slice())},n.prototype.contains=function(t,e){for(var r=!1,n=this.points.length/2,i=0,o=n-1;n>i;o=i++){var s=this.points[2*i],a=this.points[2*i+1],l=this.points[2*o],u=this.points[2*o+1],h=a>e!=u>e&&(l-s)*(e-a)/(u-a)+s>t;h&&(r=!r)}return r}},{"../../const":22,"../Point":31}],36:[function(t,e,r){function n(t,e,r,n){this.x=t||0,this.y=e||0,this.width=r||0,this.height=n||0,this.type=i.SHAPES.RECT}var i=t("../../const");n.prototype.constructor=n,e.exports=n,n.EMPTY=new n(0,0,0,0),n.prototype.clone=function(){return new n(this.x,this.y,this.width,this.height)},n.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&e=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height?!0:!1}},{"../../const":22}],38:[function(t,e,r){function n(t,e){i.call(this),this._properties=[!1,!0,!1,!1,!1],this._size=t||15e3,this._buffers=null,this._updateStatic=!1,this.interactiveChildren=!1,this.blendMode=o.BLEND_MODES.NORMAL,this.roundPixels=!0,this.setProperties(e)}var i=t("../display/Container"),o=t("../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.setProperties=function(t){t&&(this._properties[0]="scale"in t?!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="alpha"in t?!!t.alpha:this._properties[4])},n.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},n.prototype.renderWebGL=function(t){this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(t.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},n.prototype.addChildAt=function(t,e){if(t===this)return t;if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),this._updateStatic=!0,t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},n.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,this.children.splice(t,1),this._updateStatic=!0,e},n.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,n=!0,i=0,o=0,s=0,a=0;e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var l=0;lr;r+=6,n+=4)this.indices[r+0]=n+0,this.indices[r+1]=n+1,this.indices[r+2]=n+2,this.indices[r+3]=n+0,this.indices[r+4]=n+2,this.indices[r+5]=n+3;this.shader=null,this.indexBuffer=null,this.properties=null,this.tempMatrix=new l.Matrix}var i=t("../../renderers/webgl/utils/ObjectRenderer"),o=t("../../renderers/webgl/WebGLRenderer"),s=t("./ParticleShader"),a=t("./ParticleBuffer"),l=t("../../math");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,o.registerPlugin("particle",n),n.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=new s(this.renderer.shaderManager),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.properties=[{attribute:this.shader.attributes.aVertexPosition,dynamic:!1,size:2,uploadFunction:this.uploadVertices,offset:0},{attribute:this.shader.attributes.aPositionCoord,dynamic:!0,size:2,uploadFunction:this.uploadPosition,offset:0},{attribute:this.shader.attributes.aRotation,dynamic:!1,size:1,uploadFunction:this.uploadRotation,offset:0},{attribute:this.shader.attributes.aTextureCoord,dynamic:!1,size:2,uploadFunction:this.uploadUvs,offset:0},{attribute:this.shader.attributes.aColor,dynamic:!1,size:1,uploadFunction:this.uploadAlpha,offset:0}]},n.prototype.start=function(){var t=this.renderer.gl;t.activeTexture(t.TEXTURE0),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.shader;this.renderer.shaderManager.setShader(e)},n.prototype.render=function(t){var e=t.children,r=e.length,n=t._size;if(0!==r){r>n&&(r=n),t._buffers||(t._buffers=this.generateBuffers(t)),this.renderer.blendModeManager.setBlendMode(t.blendMode);var i=this.renderer.gl,o=t.worldTransform.copy(this.tempMatrix);o.prepend(this.renderer.currentRenderTarget.projectionMatrix),i.uniformMatrix3fv(this.shader.uniforms.projectionMatrix._location,!1,o.toArray(!0)),i.uniform1f(this.shader.uniforms.uAlpha._location,t.worldAlpha);var s=t._updateStatic,a=e[0]._texture.baseTexture;if(a._glTextures[i.id])i.bindTexture(i.TEXTURE_2D,a._glTextures[i.id]);else{if(!this.renderer.updateTexture(a))return;this.properties[0].dynamic&&this.properties[3].dynamic||(s=!0)}for(var l=0,u=0;r>u;u+=this.size){var h=r-u;h>this.size&&(h=this.size);var c=t._buffers[l++];c.uploadDynamic(e,u,h),s&&c.uploadStatic(e,u,h),c.bind(this.shader),i.drawElements(i.TRIANGLES,6*h,i.UNSIGNED_SHORT,0),this.renderer.drawCount++}t._updateStatic=!1}},n.prototype.generateBuffers=function(t){var e,r=this.renderer.gl,n=[],i=t._size;for(e=0;ee;e+=this.size)n.push(new a(r,this.properties,this.size,this.shader));return n},n.prototype.uploadVertices=function(t,e,r,n,i,o){for(var s,a,l,u,h,c,f,d,p,g=0;r>g;g++)s=t[e+g],a=s._texture,u=s.scale.x,h=s.scale.y,a.trim?(l=a.trim,f=l.x-s.anchor.x*l.width,c=f+a.crop.width,p=l.y-s.anchor.y*l.height,d=p+a.crop.height):(c=a._frame.width*(1-s.anchor.x),f=a._frame.width*-s.anchor.x,d=a._frame.height*(1-s.anchor.y),p=a._frame.height*-s.anchor.y),n[o]=f*u,n[o+1]=p*h,n[o+i]=c*u,n[o+i+1]=p*h,n[o+2*i]=c*u,n[o+2*i+1]=d*h,n[o+3*i]=f*u,n[o+3*i+1]=d*h,o+=4*i},n.prototype.uploadPosition=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s].position;n[o]=a.x,n[o+1]=a.y,n[o+i]=a.x,n[o+i+1]=a.y,n[o+2*i]=a.x,n[o+2*i+1]=a.y,n[o+3*i]=a.x,n[o+3*i+1]=a.y,o+=4*i}},n.prototype.uploadRotation=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s].rotation;n[o]=a,n[o+i]=a,n[o+2*i]=a,n[o+3*i]=a,o+=4*i}},n.prototype.uploadUvs=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s]._texture._uvs;a?(n[o]=a.x0,n[o+1]=a.y0,n[o+i]=a.x1,n[o+i+1]=a.y1,n[o+2*i]=a.x2,n[o+2*i+1]=a.y2,n[o+3*i]=a.x3,n[o+3*i+1]=a.y3,o+=4*i):(n[o]=0,n[o+1]=0,n[o+i]=0,n[o+i+1]=0,n[o+2*i]=0,n[o+2*i+1]=0,n[o+3*i]=0,n[o+3*i+1]=0,o+=4*i)}},n.prototype.uploadAlpha=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s].alpha;n[o]=a,n[o+i]=a,n[o+2*i]=a,n[o+3*i]=a,o+=4*i}},n.prototype.destroy=function(){this.renderer.gl&&this.renderer.gl.deleteBuffer(this.indexBuffer),i.prototype.destroy.apply(this,arguments),this.shader.destroy(),this.indices=null,this.tempMatrix=null}},{"../../math":32,"../../renderers/webgl/WebGLRenderer":48,"../../renderers/webgl/utils/ObjectRenderer":62,"./ParticleBuffer":39,"./ParticleShader":41}],41:[function(t,e,r){function n(t){i.call(this,t,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void){"," vec2 v = aVertexPosition;"," v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);"," v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);"," v = v + aPositionCoord;"," gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","uniform float uAlpha;","void main(void){"," vec4 color = texture2D(uSampler, vTextureCoord) * vColor * uAlpha;"," if (color.a == 0.0) discard;"," gl_FragColor = color;","}"].join("\n"),{uAlpha:{type:"1f",value:1}},{aPositionCoord:0,aRotation:0})}var i=t("../../renderers/webgl/shaders/TextureShader");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n},{"../../renderers/webgl/shaders/TextureShader":61}],42:[function(t,e,r){function n(t,e,r,n){if(a.call(this),i.sayHello(t),n)for(var l in s.DEFAULT_RENDER_OPTIONS)"undefined"==typeof n[l]&&(n[l]=s.DEFAULT_RENDER_OPTIONS[l]);else n=s.DEFAULT_RENDER_OPTIONS;this.type=s.RENDERER_TYPE.UNKNOWN,this.width=e||800,this.height=r||600,this.view=n.view||document.createElement("canvas"),this.resolution=n.resolution,this.transparent=n.transparent,this.autoResize=n.autoResize||!1,this.blendModes=null,this.preserveDrawingBuffer=n.preserveDrawingBuffer,this.clearBeforeRender=n.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgb=[0,0,0],this._backgroundColorString="#000000",this.backgroundColor=n.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent={worldTransform:new o.Matrix,worldAlpha:1,children:[]},this._lastObjectRendered=this._tempDisplayObjectParent}var i=t("../utils"),o=t("../math"),s=t("../const"),a=t("eventemitter3");n.prototype=Object.create(a.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{backgroundColor:{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=i.hex2string(t),i.hex2rgb(t,this._backgroundColorRgb)}}}),n.prototype.resize=function(t,e){this.width=t*this.resolution,this.height=e*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px")},n.prototype.destroy=function(t){t&&this.view.parent&&this.view.parent.removeChild(this.view),this.type=s.RENDERER_TYPE.UNKNOWN,this.width=0,this.height=0,this.view=null,this.resolution=0,this.transparent=!1,this.autoResize=!1,this.blendModes=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgb=null,this._backgroundColorString=null}},{"../const":22,"../math":32,"../utils":76,eventemitter3:11}],43:[function(t,e,r){function n(t,e,r){i.call(this,"Canvas",t,e,r),this.type=l.RENDERER_TYPE.CANVAS,this.context=this.view.getContext("2d",{alpha:this.transparent}),this.refresh=!0,this.maskManager=new o,this.roundPixels=!1,this.currentScaleMode=l.SCALE_MODES.DEFAULT,this.currentBlendMode=l.BLEND_MODES.NORMAL,this.smoothProperty="imageSmoothingEnabled",this.context.imageSmoothingEnabled||(this.context.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.context.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.context.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.context.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(),this._mapBlendModes(),this._tempDisplayObjectParent={worldTransform:new a.Matrix,worldAlpha:1},this.resize(t,e)}var i=t("../SystemRenderer"),o=t("./utils/CanvasMaskManager"),s=t("../../utils"),a=t("../../math"),l=t("../../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,s.pluginTarget.mixin(n),n.prototype.render=function(t){var e=t.parent;this._lastObjectRendered=t,t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=e,this.context.setTransform(1,0,0,1,0,0),this.context.globalAlpha=1,this.currentBlendMode=l.BLEND_MODES.NORMAL,this.context.globalCompositeOperation=this.blendModes[l.BLEND_MODES.NORMAL],navigator.isCocoonJS&&this.view.screencanvas&&(this.context.fillStyle="black",this.context.clear()),this.clearBeforeRender&&(this.transparent?this.context.clearRect(0,0,this.width,this.height):(this.context.fillStyle=this._backgroundColorString,this.context.fillRect(0,0,this.width,this.height))),this.renderDisplayObject(t,this.context)},n.prototype.destroy=function(t){this.destroyPlugins(),i.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.roundPixels=!1,this.currentScaleMode=0,this.currentBlendMode=0,this.smoothProperty=null},n.prototype.renderDisplayObject=function(t,e){var r=this.context;this.context=e,t.renderCanvas(this),this.context=r},n.prototype.resize=function(t,e){i.prototype.resize.call(this,t,e),this.currentScaleMode=l.SCALE_MODES.DEFAULT,this.smoothProperty&&(this.context[this.smoothProperty]=this.currentScaleMode===l.SCALE_MODES.LINEAR)},n.prototype._mapBlendModes=function(){this.blendModes||(this.blendModes={},s.canUseNewCanvasBlendModes()?(this.blendModes[l.BLEND_MODES.NORMAL]="source-over",this.blendModes[l.BLEND_MODES.ADD]="lighter",this.blendModes[l.BLEND_MODES.MULTIPLY]="multiply",this.blendModes[l.BLEND_MODES.SCREEN]="screen",this.blendModes[l.BLEND_MODES.OVERLAY]="overlay",this.blendModes[l.BLEND_MODES.DARKEN]="darken",this.blendModes[l.BLEND_MODES.LIGHTEN]="lighten",this.blendModes[l.BLEND_MODES.COLOR_DODGE]="color-dodge",this.blendModes[l.BLEND_MODES.COLOR_BURN]="color-burn",this.blendModes[l.BLEND_MODES.HARD_LIGHT]="hard-light",this.blendModes[l.BLEND_MODES.SOFT_LIGHT]="soft-light",this.blendModes[l.BLEND_MODES.DIFFERENCE]="difference",this.blendModes[l.BLEND_MODES.EXCLUSION]="exclusion",this.blendModes[l.BLEND_MODES.HUE]="hue",this.blendModes[l.BLEND_MODES.SATURATION]="saturate",this.blendModes[l.BLEND_MODES.COLOR]="color",this.blendModes[l.BLEND_MODES.LUMINOSITY]="luminosity"):(this.blendModes[l.BLEND_MODES.NORMAL]="source-over",this.blendModes[l.BLEND_MODES.ADD]="lighter",this.blendModes[l.BLEND_MODES.MULTIPLY]="source-over",this.blendModes[l.BLEND_MODES.SCREEN]="source-over",this.blendModes[l.BLEND_MODES.OVERLAY]="source-over",this.blendModes[l.BLEND_MODES.DARKEN]="source-over",this.blendModes[l.BLEND_MODES.LIGHTEN]="source-over",this.blendModes[l.BLEND_MODES.COLOR_DODGE]="source-over",this.blendModes[l.BLEND_MODES.COLOR_BURN]="source-over",this.blendModes[l.BLEND_MODES.HARD_LIGHT]="source-over",this.blendModes[l.BLEND_MODES.SOFT_LIGHT]="source-over",this.blendModes[l.BLEND_MODES.DIFFERENCE]="source-over",this.blendModes[l.BLEND_MODES.EXCLUSION]="source-over",this.blendModes[l.BLEND_MODES.HUE]="source-over",this.blendModes[l.BLEND_MODES.SATURATION]="source-over",this.blendModes[l.BLEND_MODES.COLOR]="source-over",this.blendModes[l.BLEND_MODES.LUMINOSITY]="source-over"))}},{"../../const":22,"../../math":32,"../../utils":76,"../SystemRenderer":42,"./utils/CanvasMaskManager":46}],44:[function(t,e,r){function n(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=t,this.canvas.height=e}n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{width:{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t}},height:{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t}}}),n.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},n.prototype.resize=function(t,e){this.canvas.width=t,this.canvas.height=e},n.prototype.destroy=function(){this.context=null,this.canvas=null}},{}],45:[function(t,e,r){var n=t("../../../const"),i={};e.exports=i,i.renderGraphics=function(t,e){var r=t.worldAlpha;t.dirty&&(this.updateGraphicsTint(t),t.dirty=!1);for(var i=0;iD?D:T,e.beginPath(),e.moveTo(E,C+T),e.lineTo(E,C+B-T),e.quadraticCurveTo(E,C+B,E+T,C+B),e.lineTo(E+b-T,C+B),e.quadraticCurveTo(E+b,C+B,E+b,C+B-T),e.lineTo(E+b,C+T),e.quadraticCurveTo(E+b,C,E+b-T,C),e.lineTo(E+T,C),e.quadraticCurveTo(E,C,E,C+T),e.closePath(),(o.fillColor||0===o.fillColor)&&(e.globalAlpha=o.fillAlpha*r,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fill()),o.lineWidth&&(e.globalAlpha=o.lineAlpha*r,e.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),e.stroke())}}},i.renderGraphicsMask=function(t,e){var r=t.graphicsData.length;if(0!==r){e.beginPath();for(var i=0;r>i;i++){var o=t.graphicsData[i],s=o.shape;if(o.type===n.SHAPES.POLY){var a=s.points;e.moveTo(a[0],a[1]);for(var l=1;lB?B:b,e.moveTo(x,w+b),e.lineTo(x,w+C-b),e.quadraticCurveTo(x,w+C,x+b,w+C),e.lineTo(x+E-b,w+C),e.quadraticCurveTo(x+E,w+C,x+E,w+C-b),e.lineTo(x+E,w+b),e.quadraticCurveTo(x+E,w,x+E-b,w),e.lineTo(x+b,w),e.quadraticCurveTo(x,w,x,w+b), +e.closePath()}}}},i.updateGraphicsTint=function(t){if(16777215!==t.tint)for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,n=(255&t.tint)/255,i=0;i>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*n*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*n*255}}},{"../../../const":22}],46:[function(t,e,r){function n(){}var i=t("./CanvasGraphics");n.prototype.constructor=n,e.exports=n,n.prototype.pushMask=function(t,e){e.context.save();var r=t.alpha,n=t.worldTransform,o=e.resolution;e.context.setTransform(n.a*o,n.b*o,n.c*o,n.d*o,n.tx*o,n.ty*o),t.texture||(i.renderGraphicsMask(t,e.context),e.context.clip()),t.worldAlpha=r},n.prototype.popMask=function(t){t.context.restore()},n.prototype.destroy=function(){}},{"./CanvasGraphics":45}],47:[function(t,e,r){var n=t("../../../utils"),i={};e.exports=i,i.getTintedTexture=function(t,e){var r=t.texture;e=i.roundColor(e);var n="#"+("00000"+(0|e).toString(16)).substr(-6);if(r.tintCache=r.tintCache||{},r.tintCache[n])return r.tintCache[n];var o=i.canvas||document.createElement("canvas");if(i.tintMethod(r,e,o),i.convertTintToImage){var s=new Image;s.src=o.toDataURL(),r.tintCache[n]=s}else r.tintCache[n]=o,i.canvas=null;return o},i.tintWithMultiply=function(t,e,r){var n=r.getContext("2d"),i=t.crop;r.width=i.width,r.height=i.height,n.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),n.fillRect(0,0,i.width,i.height),n.globalCompositeOperation="multiply",n.drawImage(t.baseTexture.source,i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.globalCompositeOperation="destination-atop",n.drawImage(t.baseTexture.source,i.x,i.y,i.width,i.height,0,0,i.width,i.height)},i.tintWithOverlay=function(t,e,r){var n=r.getContext("2d"),i=t.crop;r.width=i.width,r.height=i.height,n.globalCompositeOperation="copy",n.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),n.fillRect(0,0,i.width,i.height),n.globalCompositeOperation="destination-atop",n.drawImage(t.baseTexture.source,i.x,i.y,i.width,i.height,0,0,i.width,i.height)},i.tintWithPerPixel=function(t,e,r){var i=r.getContext("2d"),o=t.crop;r.width=o.width,r.height=o.height,i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.source,o.x,o.y,o.width,o.height,0,0,o.width,o.height);for(var s=n.hex2rgb(e),a=s[0],l=s[1],u=s[2],h=i.getImageData(0,0,o.width,o.height),c=h.data,f=0;fe;++e)this.shaders[e].syncUniform(t)}},{"../shaders/TextureShader":61}],50:[function(t,e,r){function n(){i.call(this,"\nprecision mediump float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform vec2 resolution;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\n\nvoid texcoords(vec2 fragCoord, vec2 resolution,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n vec2 inverseVP = 1.0 / resolution.xy;\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 gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n vResolution = resolution;\n\n //compute the texture coords and send them to varyings\n texcoords(aTextureCoord * resolution, resolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'precision lowp float;\n\n\n/**\nBasic FXAA implementation based on the code on geeks3d.com with the\nmodification that the texture2DLod stuff was removed since it\'s\nunsupported by WebGL.\n\n--\n\nFrom:\nhttps://github.com/mitsuhiko/webgl-meincraft\n\nCopyright (c) 2011 by Armin Ronacher.\n\nSome rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\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\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF 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 resolution,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);\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\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nuniform sampler2D uSampler;\n\n\nvoid main(void){\n\n gl_FragColor = fxaa(uSampler, vTextureCoord * vResolution, vResolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n}\n',{resolution:{type:"v2",value:{x:1,y:1}}})}var i=t("./AbstractFilter");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager,i=this.getShader(t);n.applyFilter(i,e,r)}},{"./AbstractFilter":49}],51:[function(t,e,r){function n(t){var e=new o.Matrix;i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform sampler2D mask;\n\nvoid main(void)\n{\n // check clip! this will stop the mask bleeding out from the edges\n vec2 text = abs( vMaskCoord - 0.5 );\n text = step(0.5, text);\n float clip = 1.0 - max(text.y, text.x);\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n original *= (masky.r * masky.a * alpha * clip);\n gl_FragColor = original;\n}\n",{mask:{type:"sampler2D",value:t._texture},alpha:{type:"f",value:1},otherMatrix:{type:"mat3",value:e.toArray(!0)}}),this.maskSprite=t,this.maskMatrix=e}var i=t("./AbstractFilter"),o=t("../../../math");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager;this.uniforms.mask.value=this.maskSprite._texture,n.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.alpha.value=this.maskSprite.worldAlpha;var i=this.getShader(t);n.applyFilter(i,e,r)},Object.defineProperties(n.prototype,{map:{get:function(){return this.uniforms.mask.value},set:function(t){this.uniforms.mask.value=t}},offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}}})},{"../../../math":32,"./AbstractFilter":49}],52:[function(t,e,r){function n(t){i.call(this,t),this.currentBlendMode=99999}var i=t("./WebGLManager");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.setBlendMode=function(t){if(this.currentBlendMode===t)return!1;this.currentBlendMode=t;var e=this.renderer.blendModes[this.currentBlendMode];return this.renderer.gl.blendFunc(e[0],e[1]),!0}},{"./WebGLManager":57}],53:[function(t,e,r){function n(t){i.call(this,t),this.filterStack=[],this.filterStack.push({renderTarget:t.currentRenderTarget,filter:[],bounds:null}),this.texturePool=[],this.textureSize=new l.Rectangle(0,0,t.width,t.height),this.currentFrame=null}var i=t("./WebGLManager"),o=t("../utils/RenderTarget"),s=t("../../../const"),a=t("../utils/Quad"),l=t("../../../math");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.onContextChange=function(){this.texturePool.length=0;var t=this.renderer.gl;this.quad=new a(t)},n.prototype.setFilterStack=function(t){this.filterStack=t},n.prototype.pushFilter=function(t,e){var r=t.filterArea?t.filterArea.clone():t.getBounds();r.x=0|r.x,r.y=0|r.y,r.width=0|r.width,r.height=0|r.height;var n=0|e[0].padding;if(r.x-=n,r.y-=n,r.width+=2*n,r.height+=2*n,this.renderer.currentRenderTarget.transform){var i=this.renderer.currentRenderTarget.transform;r.x+=i.tx,r.y+=i.ty,this.capFilterArea(r),r.x-=i.tx,r.y-=i.ty}else this.capFilterArea(r);if(r.width>0&&r.height>0){this.currentFrame=r;var o=this.getRenderTarget();this.renderer.setRenderTarget(o),o.clear(),this.filterStack.push({renderTarget:o,filter:e})}else this.filterStack.push({renderTarget:null,filter:e})},n.prototype.popFilter=function(){var t=this.filterStack.pop(),e=this.filterStack[this.filterStack.length-1],r=t.renderTarget;if(t.renderTarget){var n=e.renderTarget,i=this.renderer.gl;this.currentFrame=r.frame,this.quad.map(this.textureSize,r.frame),i.bindBuffer(i.ARRAY_BUFFER,this.quad.vertexBuffer),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,this.quad.indexBuffer);var o=t.filter;if(i.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aVertexPosition,2,i.FLOAT,!1,0,0),i.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aTextureCoord,2,i.FLOAT,!1,0,32),i.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aColor,4,i.FLOAT,!1,0,64),this.renderer.blendModeManager.setBlendMode(s.BLEND_MODES.NORMAL),1===o.length)o[0].uniforms.dimensions&&(o[0].uniforms.dimensions.value[0]=this.renderer.width,o[0].uniforms.dimensions.value[1]=this.renderer.height,o[0].uniforms.dimensions.value[2]=this.quad.vertices[0],o[0].uniforms.dimensions.value[3]=this.quad.vertices[5]),o[0].applyFilter(this.renderer,r,n),this.returnRenderTarget(r);else{for(var a=r,l=this.getRenderTarget(!0),u=0;uthis.textureSize.width&&(t.width=this.textureSize.width-t.x),t.y+t.height>this.textureSize.height&&(t.height=this.textureSize.height-t.y)},n.prototype.resize=function(t,e){this.textureSize.width=t,this.textureSize.height=e;for(var r=0;re;++e)t._array[2*e]=o[e].x,t._array[2*e+1]=o[e].y;s.uniform2fv(n,t._array);break;case"v3v":for(t._array||(t._array=new Float32Array(3*o.length)),e=0,r=o.length;r>e;++e)t._array[3*e]=o[e].x,t._array[3*e+1]=o[e].y,t._array[3*e+2]=o[e].z;s.uniform3fv(n,t._array);break;case"v4v":for(t._array||(t._array=new Float32Array(4*o.length)),e=0,r=o.length;r>e;++e)t._array[4*e]=o[e].x,t._array[4*e+1]=o[e].y,t._array[4*e+2]=o[e].z,t._array[4*e+3]=o[e].w;s.uniform4fv(n,t._array);break;case"t":case"sampler2D":if(!t.value||!t.value.baseTexture.hasLoaded)break;s.activeTexture(s["TEXTURE"+this.textureCount]);var a=t.value.baseTexture._glTextures[s.id];a||(this.initSampler2D(t),a=t.value.baseTexture._glTextures[s.id]),s.bindTexture(s.TEXTURE_2D,a),s.uniform1i(t._location,this.textureCount),this.textureCount++;break;default:console.warn("Pixi.js Shader Warning: Unknown uniform type: "+t.type)}},n.prototype.syncUniforms=function(){this.textureCount=1;for(var t in this.uniforms)this.syncUniform(this.uniforms[t])},n.prototype.initSampler2D=function(t){var e=this.gl,r=t.value.baseTexture;if(r.hasLoaded)if(t.textureData){var n=t.textureData;r._glTextures[e.id]=e.createTexture(),e.bindTexture(e.TEXTURE_2D,r._glTextures[e.id]),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultipliedAlpha),e.texImage2D(e.TEXTURE_2D,0,n.luminance?e.LUMINANCE:e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n.magFilter?n.magFilter:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n.wrapS?n.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,n.wrapS?n.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,n.wrapT?n.wrapT:e.CLAMP_TO_EDGE)}else this.shaderManager.renderer.updateTexture(r)},n.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.gl=null,this.uniforms=null,this.attributes=null,this.vertexSrc=null,this.fragmentSrc=null},n.prototype._glCompile=function(t,e){var r=this.gl.createShader(t);return this.gl.shaderSource(r,e),this.gl.compileShader(r),this.gl.getShaderParameter(r,this.gl.COMPILE_STATUS)?r:(console.log(this.gl.getShaderInfoLog(r)),null)}},{"../../../utils":76}],61:[function(t,e,r){function n(t,e,r,o,s){var a={uSampler:{type:"sampler2D",value:0},projectionMatrix:{type:"mat3",value:new Float32Array([1,0,0,0,1,0,0,0,1])}};if(o)for(var l in o)a[l]=o[l];var u={aVertexPosition:0,aTextureCoord:0,aColor:0};if(s)for(var h in s)u[h]=s[h];e=e||n.defaultVertexSrc,r=r||n.defaultFragmentSrc,i.call(this,t,e,r,a,u)}var i=t("./Shader");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.defaultVertexSrc=["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"].join("\n"),n.defaultFragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"].join("\n")},{"./Shader":60}],62:[function(t,e,r){function n(t){i.call(this,t)}var i=t("../managers/WebGLManager");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.start=function(){},n.prototype.stop=function(){this.flush()},n.prototype.flush=function(){},n.prototype.render=function(t){}},{"../managers/WebGLManager":57}],63:[function(t,e,r){function n(t){this.gl=t,this.vertices=new Float32Array([0,0,200,0,200,200,0,200]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.colors=new Float32Array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]),this.indices=new Uint16Array([0,1,2,0,3,2]),this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,128,t.DYNAMIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.upload()}n.prototype.constructor=n,n.prototype.map=function(t,e){var r=0,n=0;this.uvs[0]=r,this.uvs[1]=n,this.uvs[2]=r+e.width/t.width,this.uvs[3]=n,this.uvs[4]=r+e.width/t.width,this.uvs[5]=n+e.height/t.height,this.uvs[6]=r,this.uvs[7]=n+e.height/t.height,r=e.x,n=e.y,this.vertices[0]=r,this.vertices[1]=n,this.vertices[2]=r+e.width,this.vertices[3]=n,this.vertices[4]=r+e.width,this.vertices[5]=n+e.height,this.vertices[6]=r,this.vertices[7]=n+e.height,this.upload()},n.prototype.upload=function(){var t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferSubData(t.ARRAY_BUFFER,0,this.vertices),t.bufferSubData(t.ARRAY_BUFFER,32,this.uvs),t.bufferSubData(t.ARRAY_BUFFER,64,this.colors)},e.exports=n},{}],64:[function(t,e,r){var n=t("../../../math"),i=t("../../../utils"),o=t("../../../const"),s=t("./StencilMaskStack"),a=function(t,e,r,a,l,u){if(this.gl=t,this.frameBuffer=null,this.texture=null,this.size=new n.Rectangle(0,0,1,1),this.resolution=l||o.RESOLUTION,this.projectionMatrix=new n.Matrix,this.transform=null,this.frame=null,this.stencilBuffer=null,this.stencilMaskStack=new s,this.filterStack=[{renderTarget:this,filter:[],bounds:this.size}],this.scaleMode=a||o.SCALE_MODES.DEFAULT,this.root=u,!this.root){this.frameBuffer=t.createFramebuffer(),this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,a===o.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,a===o.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST);var h=i.isPowerOfTwo(e,r);h?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0)}this.resize(e,r)};a.prototype.constructor=a,e.exports=a,a.prototype.clear=function(t){var e=this.gl;t&&e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},a.prototype.attachStencilBuffer=function(){if(!this.stencilBuffer&&!this.root){var t=this.gl;this.stencilBuffer=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.stencilBuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,this.stencilBuffer),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.size.width*this.resolution,this.size.height*this.resolution)}},a.prototype.activate=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer);var e=this.frame||this.size;this.calculateProjection(e),this.transform&&this.projectionMatrix.append(this.transform),t.viewport(0,0,e.width*this.resolution,e.height*this.resolution)},a.prototype.calculateProjection=function(t){var e=this.projectionMatrix;e.identity(),this.root?(e.a=1/t.width*2,e.d=-1/t.height*2,e.tx=-1-t.x*e.a,e.ty=1-t.y*e.d):(e.a=1/t.width*2,e.d=1/t.height*2,e.tx=-1-t.x*e.a,e.ty=-1-t.y*e.d)},a.prototype.resize=function(t,e){if(t=0|t,e=0|e,this.size.width!==t||this.size.height!==e){if(this.size.width=t,this.size.height=e,!this.root){var r=this.gl;r.bindTexture(r.TEXTURE_2D,this.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,t*this.resolution,e*this.resolution,0,r.RGBA,r.UNSIGNED_BYTE,null),this.stencilBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencilBuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t*this.resolution,e*this.resolution))}var n=this.frame||this.size;this.calculateProjection(n)}},a.prototype.destroy=function(){var t=this.gl;t.deleteFramebuffer(this.frameBuffer),t.deleteTexture(this.texture),this.frameBuffer=null,this.texture=null}},{"../../../const":22,"../../../math":32,"../../../utils":76,"./StencilMaskStack":65}],65:[function(t,e,r){function n(){this.stencilStack=[],this.reverse=!0,this.count=0}n.prototype.constructor=n,e.exports=n},{}],66:[function(t,e,r){function n(t){s.call(this),this.anchor=new i.Point,this._texture=null,this._width=0,this._height=0,this.tint=16777215,this.blendMode=u.BLEND_MODES.NORMAL,this.shader=null,this.cachedTint=16777215,this.texture=t||o.EMPTY}var i=t("../math"),o=t("../textures/Texture"),s=t("../display/Container"),a=t("../renderers/canvas/utils/CanvasTinter"),l=t("../utils"),u=t("../const"),h=new i.Point;n.prototype=Object.create(s.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{width:{get:function(){return this.scale.x*this.texture._frame.width},set:function(t){this.scale.x=t/this.texture._frame.width,this._width=t}},height:{get:function(){return this.scale.y*this.texture._frame.height},set:function(t){this.scale.y=t/this.texture._frame.height,this._height=t}},texture:{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t,this.cachedTint=16777215,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}}),n.prototype._onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height)},n.prototype._renderWebGL=function(t){t.setObjectRenderer(t.plugins.sprite),t.plugins.sprite.render(this)},n.prototype.getBounds=function(t){if(!this._currentBounds){var e,r,n,i,o=this._texture._frame.width,s=this._texture._frame.height,a=o*(1-this.anchor.x),l=o*-this.anchor.x,u=s*(1-this.anchor.y),h=s*-this.anchor.y,c=t||this.worldTransform,f=c.a,d=c.b,p=c.c,g=c.d,A=c.tx,v=c.ty;if(0===d&&0===p)0>f&&(f*=-1),0>g&&(g*=-1),e=f*l+A,r=f*a+A,n=g*h+v,i=g*u+v;else{var m=f*l+p*h+A,y=g*h+d*l+v,x=f*a+p*h+A,w=g*h+d*a+v,E=f*a+p*u+A,C=g*u+d*a+v,b=f*l+p*u+A,B=g*u+d*l+v;e=m,e=e>x?x:e,e=e>E?E:e,e=e>b?b:e,n=y,n=n>w?w:n,n=n>C?C:n,n=n>B?B:n,r=m,r=x>r?x:r,r=E>r?E:r,r=b>r?b:r,i=y,i=w>i?w:i,i=C>i?C:i,i=B>i?B:i}if(this.children.length){var T=this.containerGetBounds();a=T.x,l=T.x+T.width,u=T.y,h=T.y+T.height,e=a>e?e:a,n=u>n?n:u,r=r>l?r:l,i=i>h?i:h}var D=this._bounds;D.x=e,D.width=r-e,D.y=n,D.height=i-n,this._currentBounds=D}return this._currentBounds},n.prototype.getLocalBounds=function(){return this._bounds.x=-this._texture._frame.width*this.anchor.x,this._bounds.y=-this._texture._frame.height*this.anchor.y,this._bounds.width=this._texture._frame.width,this._bounds.height=this._texture._frame.height,this._bounds},n.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,h);var e,r=this._texture._frame.width,n=this._texture._frame.height,i=-r*this.anchor.x;return h.x>i&&h.xe&&h.yn;n+=6,o+=4)this.indices[n+0]=o+0,this.indices[n+1]=o+1,this.indices[n+2]=o+2,this.indices[n+3]=o+0,this.indices[n+4]=o+2,this.indices[n+5]=o+3;this.currentBatchSize=0,this.sprites=[],this.shader=null}var i=t("../../renderers/webgl/utils/ObjectRenderer"),o=t("../../renderers/webgl/WebGLRenderer"),s=t("../../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,o.registerPlugin("sprite",n),n.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=this.renderer.shaderManager.defaultShader,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices,t.DYNAMIC_DRAW),this.currentBlendMode=99999},n.prototype.render=function(t){var e=t._texture;this.currentBatchSize>=this.size&&this.flush();var r=e._uvs;if(r){var n,i,o,s,a=t.anchor.x,l=t.anchor.y;if(e.trim){var u=e.trim;i=u.x-a*u.width,n=i+e.crop.width,s=u.y-l*u.height,o=s+e.crop.height}else n=e._frame.width*(1-a),i=e._frame.width*-a,o=e._frame.height*(1-l),s=e._frame.height*-l;var h=this.currentBatchSize*this.vertByteSize,c=t.worldTransform,f=c.a,d=c.b,p=c.c,g=c.d,A=c.tx,v=c.ty,m=this.colors,y=this.positions;this.renderer.roundPixels?(y[h]=f*i+p*s+A|0,y[h+1]=g*s+d*i+v|0,y[h+5]=f*n+p*s+A|0,y[h+6]=g*s+d*n+v|0,y[h+10]=f*n+p*o+A|0,y[h+11]=g*o+d*n+v|0,y[h+15]=f*i+p*o+A|0,y[h+16]=g*o+d*i+v|0):(y[h]=f*i+p*s+A,y[h+1]=g*s+d*i+v,y[h+5]=f*n+p*s+A,y[h+6]=g*s+d*n+v,y[h+10]=f*n+p*o+A,y[h+11]=g*o+d*n+v,y[h+15]=f*i+p*o+A,y[h+16]=g*o+d*i+v),y[h+2]=r.x0,y[h+3]=r.y0,y[h+7]=r.x1,y[h+8]=r.y1,y[h+12]=r.x2,y[h+13]=r.y2,y[h+17]=r.x3,y[h+18]=r.y3;var x=t.tint;m[h+4]=m[h+9]=m[h+14]=m[h+19]=(x>>16)+(65280&x)+((255&x)<<16)+(255*t.worldAlpha<<24),this.sprites[this.currentBatchSize++]=t}},n.prototype.flush=function(){if(0!==this.currentBatchSize){var t,e=this.renderer.gl;if(this.currentBatchSize>.5*this.size)e.bufferSubData(e.ARRAY_BUFFER,0,this.vertices);else{var r=this.positions.subarray(0,this.currentBatchSize*this.vertByteSize);e.bufferSubData(e.ARRAY_BUFFER,0,r)}for(var n,i,o,s,a=0,l=0,u=null,h=this.renderer.blendModeManager.currentBlendMode,c=null,f=!1,d=!1,p=0,g=this.currentBatchSize;g>p;p++)s=this.sprites[p],n=s._texture.baseTexture,i=s.blendMode,o=s.shader||this.shader,f=h!==i,d=c!==o,(u!==n||f||d)&&(this.renderBatch(u,a,l),l=p,a=0,u=n,f&&(h=i,this.renderer.blendModeManager.setBlendMode(h)),d&&(c=o,t=c.shaders?c.shaders[e.id]:c,t||(t=c.getShader(this.renderer)),this.renderer.shaderManager.setShader(t),t.uniforms.projectionMatrix.value=this.renderer.currentRenderTarget.projectionMatrix.toArray(!0),t.syncUniforms(),e.activeTexture(e.TEXTURE0))),a++;this.renderBatch(u,a,l),this.currentBatchSize=0}},n.prototype.renderBatch=function(t,e,r){if(0!==e){var n=this.renderer.gl;t._glTextures[n.id]?n.bindTexture(n.TEXTURE_2D,t._glTextures[n.id]):this.renderer.updateTexture(t),n.drawElements(n.TRIANGLES,6*e,n.UNSIGNED_SHORT,6*r*2),this.renderer.drawCount++}},n.prototype.start=function(){var t=this.renderer.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.vertByteSize;t.vertexAttribPointer(this.shader.attributes.aVertexPosition,2,t.FLOAT,!1,e,0),t.vertexAttribPointer(this.shader.attributes.aTextureCoord,2,t.FLOAT,!1,e,8),t.vertexAttribPointer(this.shader.attributes.aColor,4,t.UNSIGNED_BYTE,!0,e,16)},n.prototype.destroy=function(){this.renderer.gl.deleteBuffer(this.vertexBuffer),this.renderer.gl.deleteBuffer(this.indexBuffer),this.shader.destroy(),this.renderer=null,this.vertices=null,this.positions=null,this.colors=null,this.indices=null,this.vertexBuffer=null,this.indexBuffer=null,this.sprites=null,this.shader=null}},{"../../const":22,"../../renderers/webgl/WebGLRenderer":48,"../../renderers/webgl/utils/ObjectRenderer":62}],68:[function(t,e,r){function n(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||l.RESOLUTION,this._text=null,this._style=null;var n=o.fromCanvas(this.canvas);n.trim=new s.Rectangle,i.call(this,n),this.text=t,this.style=e}var i=t("../sprites/Sprite"),o=t("../textures/Texture"),s=t("../math"),a=t("../utils"),l=t("../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.fontPropertiesCache={},n.fontPropertiesCanvas=document.createElement("canvas"),n.fontPropertiesContext=n.fontPropertiesCanvas.getContext("2d"),Object.defineProperties(n.prototype,{width:{get:function(){return this.dirty&&this.updateText(),this.scale.x*this._texture._frame.width},set:function(t){this.scale.x=t/this._texture._frame.width,this._width=t}},height:{get:function(){return this.dirty&&this.updateText(),this.scale.y*this._texture._frame.height},set:function(t){this.scale.y=t/this._texture._frame.height,this._height=t}},style:{get:function(){return this._style},set:function(t){t=t||{},"number"==typeof t.fill&&(t.fill=a.hex2string(t.fill)),"number"==typeof t.stroke&&(t.stroke=a.hex2string(t.stroke)),"number"==typeof t.dropShadowColor&&(t.dropShadowColor=a.hex2string(t.dropShadowColor)),t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,t.dropShadow=t.dropShadow||!1,t.dropShadowColor=t.dropShadowColor||"#000000",t.dropShadowAngle=t.dropShadowAngle||Math.PI/6,t.dropShadowDistance=t.dropShadowDistance||5,t.padding=t.padding||0,t.textBaseline=t.textBaseline||"alphabetic",t.lineJoin=t.lineJoin||"miter",t.miterLimit=t.miterLimit||10,this._style=t,this.dirty=!0}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),n.prototype.updateText=function(){var t=this._style;this.context.font=t.font;for(var e=t.wordWrap?this.wordWrap(this._text):this._text,r=e.split(/(?:\r\n|\r|\n)/),n=new Array(r.length),i=0,o=this.determineFontProperties(t.font),s=0;sl;l++){for(u=0;f>u;u+=4)if(255!==h[d+u]){p=!0;break}if(p)break;d+=f}for(e.ascent=s-l,d=c-f,p=!1,l=a;l>s;l--){for(u=0;f>u;u+=4)if(255!==h[d+u]){p=!0;break}if(p)break;d-=f}e.descent=l-s,e.fontSize=e.ascent+e.descent,n.fontPropertiesCache[t]=e}return e},n.prototype.wordWrap=function(t){for(var e="",r=t.split("\n"),n=this._style.wordWrapWidth,i=0;io?(a>0&&(e+="\n"),e+=s[a],o=n-l):(o-=u,e+=" "+s[a])}i0&&e>0,this.width=this._frame.width=this.crop.width=t,this.height=this._frame.height=this.crop.height=e,r&&(this.baseTexture.width=this.width,this.baseTexture.height=this.height),this.valid&&(this.textureBuffer.resize(this.width,this.height),this.filterManager&&this.filterManager.resize(this.width,this.height)))},n.prototype.clear=function(){this.valid&&(this.renderer.type===h.RENDERER_TYPE.WEBGL&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear()); +},n.prototype.renderWebGL=function(t,e,r,n){if(this.valid){if(n=void 0!==n?n:!0,this.textureBuffer.transform=e,this.textureBuffer.activate(),t.worldAlpha=1,n){t.worldTransform.identity(),t.currentBounds=null;var i,o,s=t.children;for(i=0,o=s.length;o>i;++i)s[i].updateTransform()}var a=this.renderer.filterManager;this.renderer.filterManager=this.filterManager,this.renderer.renderDisplayObject(t,this.textureBuffer,r),this.renderer.filterManager=a}},n.prototype.renderCanvas=function(t,e,r,n){if(this.valid){n=!!n;var i=t.worldTransform,o=c;o.identity(),e&&o.append(e),t.worldTransform=o,t.worldAlpha=1;var s,a,l=t.children;for(s=0,a=l.length;a>s;++s)l[s].updateTransform();r&&this.textureBuffer.clear(),t.worldTransform=i;var u=this.textureBuffer.context,h=this.renderer.resolution;this.renderer.resolution=this.resolution,this.renderer.renderDisplayObject(t,u),this.renderer.resolution=h}},n.prototype.destroy=function(){o.prototype.destroy.call(this,!0),this.textureBuffer.destroy(),this.filterManager&&this.filterManager.destroy(),this.renderer=null},n.prototype.getImage=function(){var t=new Image;return t.src=this.getBase64(),t},n.prototype.getBase64=function(){return this.getCanvas().toDataURL()},n.prototype.getCanvas=function(){if(this.renderer.type===h.RENDERER_TYPE.WEBGL){var t=this.renderer.gl,e=this.textureBuffer.size.width,r=this.textureBuffer.size.height,n=new Uint8Array(4*e*r);t.bindFramebuffer(t.FRAMEBUFFER,this.textureBuffer.frameBuffer),t.readPixels(0,0,e,r,t.RGBA,t.UNSIGNED_BYTE,n),t.bindFramebuffer(t.FRAMEBUFFER,null);var i=new l(e,r),o=i.context.getImageData(0,0,e,r);return o.data.set(n),i.context.putImageData(o,0,0),i.canvas}return this.textureBuffer.canvas},n.prototype.getPixels=function(){var t,e;if(this.renderer.type===h.RENDERER_TYPE.WEBGL){var r=this.renderer.gl;t=this.textureBuffer.size.width,e=this.textureBuffer.size.height;var n=new Uint8Array(4*t*e);return r.bindFramebuffer(r.FRAMEBUFFER,this.textureBuffer.frameBuffer),r.readPixels(0,0,t,e,r.RGBA,r.UNSIGNED_BYTE,n),r.bindFramebuffer(r.FRAMEBUFFER,null),n}return t=this.textureBuffer.canvas.width,e=this.textureBuffer.canvas.height,this.textureBuffer.canvas.getContext("2d").getImageData(0,0,t,e).data},n.prototype.getPixel=function(t,e){if(this.renderer.type===h.RENDERER_TYPE.WEBGL){var r=this.renderer.gl,n=new Uint8Array(4);return r.bindFramebuffer(r.FRAMEBUFFER,this.textureBuffer.frameBuffer),r.readPixels(t,e,1,1,r.RGBA,r.UNSIGNED_BYTE,n),r.bindFramebuffer(r.FRAMEBUFFER,null),n}return this.textureBuffer.canvas.getContext("2d").getImageData(t,e,1,1).data}},{"../const":22,"../math":32,"../renderers/canvas/utils/CanvasBuffer":44,"../renderers/webgl/managers/FilterManager":53,"../renderers/webgl/utils/RenderTarget":64,"./BaseTexture":69,"./Texture":71}],71:[function(t,e,r){function n(t,e,r,i,o){a.call(this),this.noFrame=!1,e||(this.noFrame=!0,e=new l.Rectangle(0,0,1,1)),t instanceof n&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=i,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.width=0,this.height=0,this.crop=r||e,this.rotate=!!o,t.hasLoaded?(this.noFrame&&(e=new l.Rectangle(0,0,t.width,t.height),t.on("update",this.onBaseTextureUpdated,this)),this.frame=e):t.once("loaded",this.onBaseTextureLoaded,this)}var i=t("./BaseTexture"),o=t("./VideoBaseTexture"),s=t("./TextureUvs"),a=t("eventemitter3"),l=t("../math"),u=t("../utils");n.prototype=Object.create(a.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{frame:{get:function(){return this._frame},set:function(t){if(this._frame=t,this.noFrame=!1,this.width=t.width,this.height=t.height,!this.trim&&!this.rotate&&(t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height))throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=t&&t.width&&t.height&&this.baseTexture.hasLoaded,this.trim?(this.width=this.trim.width,this.height=this.trim.height,this._frame.width=this.trim.width,this._frame.height=this.trim.height):this.crop=t,this.valid&&this._updateUvs()}}}),n.prototype.update=function(){this.baseTexture.update()},n.prototype.onBaseTextureLoaded=function(t){this.frame=this.noFrame?new l.Rectangle(0,0,t.width,t.height):this._frame,this.emit("update",this)},n.prototype.onBaseTextureUpdated=function(t){this._frame.width=t.width,this._frame.height=t.height,this.emit("update",this)},n.prototype.destroy=function(t){this.baseTexture&&(t&&this.baseTexture.destroy(),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture.off("loaded",this.onBaseTextureLoaded,this),this.baseTexture=null),this._frame=null,this._uvs=null,this.trim=null,this.crop=null,this.valid=!1},n.prototype.clone=function(){return new n(this.baseTexture,this.frame,this.crop,this.trim,this.rotate)},n.prototype._updateUvs=function(){this._uvs||(this._uvs=new s),this._uvs.set(this.crop,this.baseTexture,this.rotate)},n.fromImage=function(t,e,r){var o=u.TextureCache[t];return o||(o=new n(i.fromImage(t,e,r)),u.TextureCache[t]=o),o},n.fromFrame=function(t){var e=u.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return e},n.fromCanvas=function(t,e){return new n(i.fromCanvas(t,e))},n.fromVideo=function(t,e){return"string"==typeof t?n.fromVideoUrl(t,e):new n(o.fromVideo(t,e))},n.fromVideoUrl=function(t,e){return new n(o.fromUrl(t,e))},n.addTextureToCache=function(t,e){u.TextureCache[e]=t},n.removeTextureFromCache=function(t){var e=u.TextureCache[t];return delete u.TextureCache[t],delete u.BaseTextureCache[t],e},n.EMPTY=new n(new i)},{"../math":32,"../utils":76,"./BaseTexture":69,"./TextureUvs":72,"./VideoBaseTexture":73,eventemitter3:11}],72:[function(t,e,r){function n(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1}e.exports=n,n.prototype.set=function(t,e,r){var n=e.width,i=e.height;r?(this.x0=(t.x+t.height)/n,this.y0=t.y/i,this.x1=(t.x+t.height)/n,this.y1=(t.y+t.width)/i,this.x2=t.x/n,this.y2=(t.y+t.width)/i,this.x3=t.x/n,this.y3=t.y/i):(this.x0=t.x/n,this.y0=t.y/i,this.x1=(t.x+t.width)/n,this.y1=t.y/i,this.x2=(t.x+t.width)/n,this.y2=(t.y+t.height)/i,this.x3=t.x/n,this.y3=(t.y+t.height)/i)}},{}],73:[function(t,e,r){function n(t,e){if(!t)throw new Error("No video source element specified.");(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),o.call(this,t,e),this.autoUpdate=!1,this._onUpdate=this._onUpdate.bind(this),this._onCanPlay=this._onCanPlay.bind(this),t.complete||(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this))),this.__loaded=!1}function i(t,e){e||(e="video/"+t.substr(t.lastIndexOf(".")+1));var r=document.createElement("source");return r.src=t,r.type=e,r}var o=t("./BaseTexture"),s=t("../utils");n.prototype=Object.create(o.prototype),n.prototype.constructor=n,e.exports=n,n.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this._onUpdate),this.update())},n.prototype._onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this._onUpdate),this.autoUpdate=!0)},n.prototype._onPlayStop=function(){this.autoUpdate=!1},n.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.source.play(),this.__loaded||(this.__loaded=!0,this.emit("loaded",this)))},n.prototype.destroy=function(){this.source&&this.source._pixiId&&(delete s.BaseTextureCache[this.source._pixiId],delete this.source._pixiId),o.prototype.destroy.call(this)},n.fromVideo=function(t,e){t._pixiId||(t._pixiId="video_"+s.uid());var r=s.BaseTextureCache[t._pixiId];return r||(r=new n(t,e),s.BaseTextureCache[t._pixiId]=r),r},n.fromUrl=function(t,e){var r=document.createElement("video");if(Array.isArray(t))for(var o=0;othis._maxElapsedMS&&(e=this._maxElapsedMS),this.deltaTime=e*i.TARGET_FPMS*this.speed,this._emitter.emit(s,this.deltaTime),this.lastTime=t},e.exports=n},{"../const":22,eventemitter3:11}],75:[function(t,e,r){var n=t("./Ticker"),i=new n;i.autoStart=!0,e.exports={shared:i,Ticker:n}},{"./Ticker":74}],76:[function(t,e,r){var n=t("../const"),i=e.exports={_uid:0,_saidHello:!1,pluginTarget:t("./pluginTarget"),async:t("async"),uid:function(){return++i._uid},hex2rgb:function(t,e){return e=e||[],e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},hex2string:function(t){return t=t.toString(16),t="000000".substr(0,6-t.length)+t,"#"+t},rgb2hex:function(t){return(255*t[0]<<16)+(255*t[1]<<8)+255*t[2]},canUseNewCanvasBlendModes:function(){if("undefined"==typeof document)return!1;var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",e="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",r=new Image;r.src=t+"AP804Oa6"+e;var n=new Image;n.src=t+"/wCKxvRF"+e;var i=document.createElement("canvas");i.width=6,i.height=1;var o=i.getContext("2d");o.globalCompositeOperation="multiply",o.drawImage(r,0,0),o.drawImage(n,2,0);var s=o.getImageData(2,0,1,1).data;return 255===s[0]&&0===s[1]&&0===s[2]},getNextPowerOfTwo:function(t){if(t>0&&0===(t&t-1))return t;for(var e=1;t>e;)e<<=1;return e},isPowerOfTwo:function(t,e){return t>0&&0===(t&t-1)&&e>0&&0===(e&e-1)},getResolutionOfUrl:function(t){var e=n.RETINA_PREFIX.exec(t);return e?parseFloat(e[1]):1},sayHello:function(t){if(!i._saidHello){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c Pixi.js "+n.VERSION+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("Pixi.js "+n.VERSION+" - "+t+" - http://www.pixijs.com/");i._saidHello=!0}},isWebGLSupported:function(){var t={stencil:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);return!(!r||!r.getContextAttributes().stencil)}catch(n){return!1}},TextureCache:{},BaseTextureCache:{}}},{"../const":22,"./pluginTarget":77,async:2}],77:[function(t,e,r){function n(t){t.__plugins={},t.registerPlugin=function(e,r){t.__plugins[e]=r},t.prototype.initPlugins=function(){this.plugins=this.plugins||{};for(var e in t.__plugins)this.plugins[e]=new t.__plugins[e](this)},t.prototype.destroyPlugins=function(){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;this.plugins=null}}e.exports={mixin:function(t){n(t)}}},{}],78:[function(t,e,r){var n=t("./core"),i=t("./mesh"),o=t("./extras"),s=t("./filters");n.SpriteBatch=function(){throw new ReferenceError("SpriteBatch does not exist any more, please use the new ParticleContainer instead.")},n.AssetLoader=function(){throw new ReferenceError("The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.")},Object.defineProperties(n,{Stage:{get:function(){return console.warn("You do not need to use a PIXI Stage any more, you can simply render any container."),n.Container}},DisplayObjectContainer:{get:function(){return console.warn("DisplayObjectContainer has been shortened to Container, please use Container from now on."),n.Container}},Strip:{get:function(){return console.warn("The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on."),i.Mesh}},Rope:{get:function(){return console.warn("The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on."),i.Rope}},MovieClip:{get:function(){return console.warn("The MovieClip class has been moved to extras.MovieClip, please use extras.MovieClip from now on."),o.MovieClip}},TilingSprite:{get:function(){return console.warn("The TilingSprite class has been moved to extras.TilingSprite, please use extras.TilingSprite from now on."),o.TilingSprite}},BitmapText:{get:function(){return console.warn("The BitmapText class has been moved to extras.BitmapText, please use extras.BitmapText from now on."),o.BitmapText}},blendModes:{get:function(){return console.warn("The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on."),n.BLEND_MODES}},scaleModes:{get:function(){return console.warn("The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on."),n.SCALE_MODES}},BaseTextureCache:{get:function(){return console.warn("The BaseTextureCache class has been moved to utils.BaseTextureCache, please use utils.BaseTextureCache from now on."),n.utils.BaseTextureCache}},TextureCache:{get:function(){return console.warn("The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on."),n.utils.TextureCache}},math:{get:function(){return console.warn("The math namespace is deprecated, please access members already accessible on PIXI."),n}}}),n.Sprite.prototype.setTexture=function(t){this.texture=t,console.warn("setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;")},o.BitmapText.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myBitmapText.text = 'my text';")},n.Text.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myText.text = 'my text';")},n.Text.prototype.setStyle=function(t){this.style=t,console.warn("setStyle is now deprecated, please use the style property, e.g : myText.style = style;")},n.Texture.prototype.setFrame=function(t){this.frame=t,console.warn("setFrame is now deprecated, please use the frame property, e.g : myTexture.frame = frame;")},Object.defineProperties(s,{AbstractFilter:{get:function(){return console.warn("filters.AbstractFilter is an undocumented alias, please use AbstractFilter from now on."),n.AbstractFilter}},FXAAFilter:{get:function(){return console.warn("filters.FXAAFilter is an undocumented alias, please use FXAAFilter from now on."),n.FXAAFilter}},SpriteMaskFilter:{get:function(){return console.warn("filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on."),n.SpriteMaskFilter}}}),n.utils.uuid=function(){return console.warn("utils.uuid() is deprecated, please use utils.uid() from now on."),n.utils.uid()}},{"./core":29,"./extras":85,"./filters":102,"./mesh":126}],79:[function(t,e,r){function n(t,e){i.Container.call(this),e=e||{},this.textWidth=0,this.textHeight=0,this._glyphs=[],this._font={tint:void 0!==e.tint?e.tint:16777215,align:e.align||"left",name:null,size:0},this.font=e.font,this._text=t,this.maxWidth=0,this.dirty=!1,this.updateText()}var i=t("../core");n.prototype=Object.create(i.Container.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{tint:{get:function(){return this._font.tint},set:function(t){this._font.tint="number"==typeof t&&t>=0?t:16777215,this.dirty=!0}},align:{get:function(){return this._font.align},set:function(t){this._font.align=t||"left",this.dirty=!0}},font:{get:function(){return this._font},set:function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):n.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),n.prototype.updateText=function(){for(var t=n.fonts[this._font.name],e=new i.Point,r=null,o=[],s=0,a=0,l=[],u=0,h=this._font.size/t.size,c=-1,f=0;f0&&e.x*h>this.maxWidth)o.splice(c,f-c),f=c,c=-1,l.push(s),a=Math.max(a,s),u++,e.x=0,e.y+=t.lineHeight,r=null;else{var p=t.chars[d];p&&(r&&p.kerning[r]&&(e.x+=p.kerning[r]),o.push({texture:p.texture,line:u,charCode:d,position:new i.Point(e.x+p.xOffset,e.y+p.yOffset)}),s=e.x+(p.texture.width+p.xOffset),e.x+=p.xAdvance,r=d)}}l.push(s),a=Math.max(a,s);var g=[];for(f=0;u>=f;f++){var A=0;"right"===this._font.align?A=a-l[f]:"center"===this._font.align&&(A=(a-l[f])/2),g.push(A)}var v=o.length,m=this.tint;for(f=0;v>f;f++){var y=this._glyphs[f];y?y.texture=o[f].texture:(y=new i.Sprite(o[f].texture),this._glyphs.push(y)),y.position.x=(o[f].position.x+g[o[f].line])*h,y.position.y=o[f].position.y*h,y.scale.x=y.scale.y=h,y.tint=m,y.parent||this.addChild(y)}for(f=v;fe?this.loop?this._texture=this._textures[this._textures.length-1+e%this._textures.length]:(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this.loop||e=this._textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())},n.prototype.destroy=function(){this.stop(),i.Sprite.prototype.destroy.call(this)},n.fromFrames=function(t){for(var e=[],r=0;ry?y:t,t=t>w?w:t,t=t>C?C:t,r=m,r=r>x?x:r,r=r>E?E:r,r=r>b?b:r,e=v,e=y>e?y:e,e=w>e?w:e,e=C>e?C:e,n=m,n=x>n?x:n,n=E>n?E:n,n=b>n?b:n;var B=this._bounds;return B.x=t,B.width=e-t,B.y=r,B.height=n-r,this._currentBounds=B,B},n.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,o);var e,r=this._width,n=this._height,i=-r*this.anchor.x;return o.x>i&&o.xe&&o.y 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 vec2 p = mod( uv / ( pixelSize * 0.5 ), 2.0) - vec2(1.0);\n col = col * character(n, p);\n\n gl_FragColor = vec4(col, 1.0);\n}\n",{dimensions:{type:"4fv",value:new Float32Array([0,0,0,0])},pixelSize:{type:"1f",value:8}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{size:{get:function(){return this.uniforms.pixelSize.value},set:function(t){this.uniforms.pixelSize.value=t}}})},{"../../core":29}],87:[function(t,e,r){function n(){i.AbstractFilter.call(this),this.blurXFilter=new o,this.blurYFilter=new s,this.defaultFilter=new i.AbstractFilter}var i=t("../../core"),o=t("../blur/BlurXFilter"),s=t("../blur/BlurYFilter");n.prototype=Object.create(i.AbstractFilter.prototype), +n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager.getRenderTarget(!0);this.defaultFilter.applyFilter(t,e,r),this.blurXFilter.applyFilter(t,e,n),t.blendModeManager.setBlendMode(i.BLEND_MODES.SCREEN),this.blurYFilter.applyFilter(t,n,r),t.blendModeManager.setBlendMode(i.BLEND_MODES.NORMAL),t.filterManager.returnRenderTarget(n)},Object.defineProperties(n.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t}},blurX:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t}},blurY:{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t}}})},{"../../core":29,"../blur/BlurXFilter":90,"../blur/BlurYFilter":91}],88:[function(t,e,r){function n(t,e){i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform float strength;\nuniform float dirX;\nuniform float dirY;\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vBlurTexCoords[3];\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n\n vBlurTexCoords[0] = aTextureCoord + vec2( (0.004 * strength) * dirX, (0.004 * strength) * dirY );\n vBlurTexCoords[1] = aTextureCoord + vec2( (0.008 * strength) * dirX, (0.008 * strength) * dirY );\n vBlurTexCoords[2] = aTextureCoord + vec2( (0.012 * strength) * dirX, (0.012 * strength) * dirY );\n\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vBlurTexCoords[3];\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = vec4(0.0);\n\n gl_FragColor += texture2D(uSampler, vTextureCoord ) * 0.3989422804014327;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 0]) * 0.2419707245191454;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 1]) * 0.05399096651318985;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 2]) * 0.004431848411938341;\n}\n",{strength:{type:"1f",value:1},dirX:{type:"1f",value:t||0},dirY:{type:"1f",value:e||0}}),this.defaultFilter=new i.AbstractFilter,this.passes=1,this.dirX=t||0,this.dirY=e||0,this.strength=4}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r,n){var i=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.width/e.size.width),1===this.passes)t.filterManager.applyFilter(i,e,r,n);else{var o=t.filterManager.getRenderTarget(!0);t.filterManager.applyFilter(i,e,o,n);for(var s=0;s>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,l=(n>>16&255)/255,u=(n>>8&255)/255,h=(255&n)/255,c=[.3,.59,.11,0,0,o,s,a,t,0,l,u,h,e,0,o-l,s-u,a-h,0,0];this._loadMatrix(c,i)},n.prototype.night=function(t,e){t=t||.1;var r=[-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},n.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)},n.prototype.lsd=function(t){var e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(e,t)},n.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)},Object.defineProperties(n.prototype,{matrix:{get:function(){return this.uniforms.m.value},set:function(t){this.uniforms.m.value=t}}})},{"../../core":29}],94:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float step;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n color = floor(color * step) / step;\n\n gl_FragColor = color;\n}\n",{step:{type:"1f",value:5}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{step:{get:function(){return this.uniforms.step.value},set:function(t){this.uniforms.step.value=t}}})},{"../../core":29}],95:[function(t,e,r){function n(t,e,r){i.AbstractFilter.call(this,null,"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",{matrix:{type:"1fv",value:new Float32Array(t)},texelSize:{type:"v2",value:{x:1/e,y:1/r}}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{matrix:{get:function(){return this.uniforms.matrix.value},set:function(t){this.uniforms.matrix.value=new Float32Array(t)}},width:{get:function(){return 1/this.uniforms.texelSize.value.x},set:function(t){this.uniforms.texelSize.value.x=1/t}},height:{get:function(){return 1/this.uniforms.texelSize.value.y},set:function(t){this.uniforms.texelSize.value.y=1/t}}})},{"../../core":29}],96:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"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")}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n},{"../../core":29}],97:[function(t,e,r){function n(t){var e=new i.Matrix;t.renderable=!1,i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMapCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec2 scale;\n\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nvoid main(void)\n{\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 map = texture2D(mapSampler, vMapCoord);\n\n map -= 0.5;\n map.xy *= scale;\n\n gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y));\n}\n",{mapSampler:{type:"sampler2D",value:t.texture},otherMatrix:{type:"mat3",value:e.toArray(!0)},scale:{type:"v2",value:{x:1,y:1}}}),this.maskSprite=t,this.maskMatrix=e,this.scale=new i.Point(20,20)}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager;n.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.scale.value.x=this.scale.x*(1/e.frame.width),this.uniforms.scale.value.y=this.scale.y*(1/e.frame.height);var i=this.getShader(t);n.applyFilter(i,e,r)},Object.defineProperties(n.prototype,{map:{get:function(){return this.uniforms.mapSampler.value},set:function(t){this.uniforms.mapSampler.value=t}}})},{"../../core":29}],98:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 dimensions;\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 * dimensions.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",{scale:{type:"1f",value:1},angle:{type:"1f",value:5},dimensions:{type:"4fv",value:[0,0,0,0]}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{scale:{get:function(){return this.uniforms.scale.value},set:function(t){this.uniforms.scale.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},{"../../core":29}],99:[function(t,e,r){function n(){i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform float strength;\nuniform vec2 offset;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vBlurTexCoords[6];\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3((aVertexPosition+offset), 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n\n vBlurTexCoords[ 0] = aTextureCoord + vec2(0.0, -0.012 * strength);\n vBlurTexCoords[ 1] = aTextureCoord + vec2(0.0, -0.008 * strength);\n vBlurTexCoords[ 2] = aTextureCoord + vec2(0.0, -0.004 * strength);\n vBlurTexCoords[ 3] = aTextureCoord + vec2(0.0, 0.004 * strength);\n vBlurTexCoords[ 4] = aTextureCoord + vec2(0.0, 0.008 * strength);\n vBlurTexCoords[ 5] = aTextureCoord + vec2(0.0, 0.012 * strength);\n\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vBlurTexCoords[6];\nvarying vec4 vColor;\n\nuniform vec3 color;\nuniform float alpha;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n vec4 sum = vec4(0.0);\n\n sum += texture2D(uSampler, vBlurTexCoords[ 0])*0.004431848411938341;\n sum += texture2D(uSampler, vBlurTexCoords[ 1])*0.05399096651318985;\n sum += texture2D(uSampler, vBlurTexCoords[ 2])*0.2419707245191454;\n sum += texture2D(uSampler, vTextureCoord )*0.3989422804014327;\n sum += texture2D(uSampler, vBlurTexCoords[ 3])*0.2419707245191454;\n sum += texture2D(uSampler, vBlurTexCoords[ 4])*0.05399096651318985;\n sum += texture2D(uSampler, vBlurTexCoords[ 5])*0.004431848411938341;\n\n gl_FragColor = vec4( color.rgb * sum.a * alpha, sum.a * alpha );\n}\n",{blur:{type:"1f",value:1/512},color:{type:"c",value:[0,0,0]},alpha:{type:"1f",value:.7},offset:{type:"2f",value:[5,5]},strength:{type:"1f",value:1}}),this.passes=1,this.strength=4}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r,n){var i=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.height/e.size.height),1===this.passes)t.filterManager.applyFilter(i,e,r,n);else{for(var o=t.filterManager.getRenderTarget(!0),s=e,a=o,l=0;l= (time - params.z)) )\n {\n float diff = (dist - time);\n float powDiff = 1.0 - pow(abs(diff*params.x), params.y);\n\n float diffTime = diff * powDiff;\n vec2 diffUV = normalize(uv - center);\n texCoord = uv + (diffUV * diffTime);\n }\n\n gl_FragColor = texture2D(uSampler, texCoord);\n}\n",{center:{type:"v2",value:{x:.5,y:.5}},params:{type:"v3",value:{x:10,y:.8,z:.1}},time:{type:"1f",value:0}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{center:{get:function(){return this.uniforms.center.value},set:function(t){this.uniforms.center.value=t}},params:{get:function(){return this.uniforms.params.value},set:function(t){this.uniforms.params.value=t}},time:{get:function(){return this.uniforms.time.value},set:function(t){this.uniforms.time.value=t}}})},{"../../core":29}],110:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying 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 gl_FragColor = color / total;\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n}\n",{blur:{type:"1f",value:100},gradientBlur:{type:"1f",value:600},start:{type:"v2",value:{x:0,y:window.innerHeight/2}},end:{type:"v2",value:{x:600,y:window.innerHeight/2}},delta:{type:"v2",value:{x:30,y:30}},texSize:{type:"v2",value:{x:window.innerWidth,y:window.innerHeight}}}),this.updateDelta()}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.updateDelta=function(){this.uniforms.delta.value.x=0,this.uniforms.delta.value.y=0},Object.defineProperties(n.prototype,{blur:{get:function(){return this.uniforms.blur.value},set:function(t){this.uniforms.blur.value=t}},gradientBlur:{get:function(){return this.uniforms.gradientBlur.value},set:function(t){this.uniforms.gradientBlur.value=t}},start:{get:function(){return this.uniforms.start.value},set:function(t){this.uniforms.start.value=t,this.updateDelta()}},end:{get:function(){return this.uniforms.end.value},set:function(t){this.uniforms.end.value=t,this.updateDelta()}}})},{"../../core":29}],111:[function(t,e,r){function n(){i.AbstractFilter.call(this),this.tiltShiftXFilter=new o,this.tiltShiftYFilter=new s}var i=t("../../core"),o=t("./TiltShiftXFilter"),s=t("./TiltShiftYFilter");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager.getRenderTarget(!0);this.tiltShiftXFilter.applyFilter(t,e,n),this.tiltShiftYFilter.applyFilter(t,n,r),t.filterManager.returnRenderTarget(n)},Object.defineProperties(n.prototype,{blur:{get:function(){return this.tiltShiftXFilter.blur},set:function(t){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=t}},gradientBlur:{get:function(){return this.tiltShiftXFilter.gradientBlur},set:function(t){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=t}},start:{get:function(){return this.tiltShiftXFilter.start},set:function(t){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=t}},end:{get:function(){return this.tiltShiftXFilter.end},set:function(t){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=t}}})},{"../../core":29,"./TiltShiftXFilter":112,"./TiltShiftYFilter":113}],112:[function(t,e,r){function n(){i.call(this)}var i=t("./TiltShiftAxisFilter");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=t/r,this.uniforms.delta.value.y=e/r}},{"./TiltShiftAxisFilter":110}],113:[function(t,e,r){function n(){i.call(this)}var i=t("./TiltShiftAxisFilter");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=-e/r,this.uniforms.delta.value.y=t/r}},{"./TiltShiftAxisFilter":110}],114:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord - offset;\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratio = (radius - dist) / radius;\n float angleMod = ratio * ratio * 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 gl_FragColor = texture2D(uSampler, coord+offset);\n}\n",{radius:{type:"1f",value:.5},angle:{type:"1f",value:5},offset:{type:"v2",value:{x:.5,y:.5}}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}},radius:{get:function(){return this.uniforms.radius.value},set:function(t){this.uniforms.radius.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},{"../../core":29}],115:[function(t,e,r){function n(){this.global=new i.Point,this.target=null,this.originalEvent=null}var i=t("../core");n.prototype.constructor=n,e.exports=n,n.prototype.getLocalPosition=function(t,e,r){var n=t.worldTransform,o=r?r:this.global,s=n.a,a=n.c,l=n.tx,u=n.b,h=n.d,c=n.ty,f=1/(s*h+a*-u);return e=e||new i.Point,e.x=h*f*o.x+-a*f*o.x+(c*a-l*h)*f,e.y=s*f*o.y+-u*f*o.y+(-c*s+l*u)*f,e}},{"../core":29}],116:[function(t,e,r){function n(t,e){e=e||{},this.renderer=t,this.autoPreventDefault=void 0!==e.autoPreventDefault?e.autoPreventDefault:!0,this.interactionFrequency=e.interactionFrequency||10,this.mouse=new o,this.eventData={stopped:!1,target:null,type:null,data:this.mouse,stopPropagation:function(){this.stopped=!0}},this.interactiveDataPool=[],this.interactionDOMElement=null,this.eventsAdded=!1,this.onMouseUp=this.onMouseUp.bind(this),this.processMouseUp=this.processMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.processMouseDown=this.processMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.processMouseMove=this.processMouseMove.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.processMouseOverOut=this.processMouseOverOut.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.processTouchStart=this.processTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.processTouchEnd=this.processTouchEnd.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.processTouchMove=this.processTouchMove.bind(this),this.last=0,this.currentCursorStyle="inherit",this._tempPoint=new i.Point,this.resolution=1,this.setTargetElement(this.renderer.view,this.renderer.resolution)}var i=t("../core"),o=t("./InteractionData");Object.assign(i.DisplayObject.prototype,t("./interactiveTarget")),n.prototype.constructor=n,e.exports=n,n.prototype.setTargetElement=function(t,e){this.removeEvents(),this.interactionDOMElement=t,this.resolution=e||1,this.addEvents()},n.prototype.addEvents=function(){this.interactionDOMElement&&(i.ticker.shared.add(this.update,this),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"),window.document.addEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.addEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.addEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!0)},n.prototype.removeEvents=function(){this.interactionDOMElement&&(i.ticker.shared.remove(this.update),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""),window.document.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!1)},n.prototype.update=function(t){if(this._deltaTime+=t,!(this._deltaTime=0;a--)!s&&n?s=this.processInteractive(t,o[a],r,!0,i):this.processInteractive(t,o[a],r,!1,!1);return i&&(n&&(e.hitArea?(e.worldTransform.applyInverse(t,this._tempPoint),s=e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)):e.containsPoint&&(s=e.containsPoint(t))),e.interactive&&r(e,s)),s},n.prototype.onMouseDown=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.autoPreventDefault&&this.mouse.originalEvent.preventDefault(),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseDown,!0)},n.prototype.processMouseDown=function(t,e){var r=this.mouse.originalEvent,n=2===r.button||3===r.which;e&&(t[n?"_isRightDown":"_isLeftDown"]=!0,this.dispatchEvent(t,n?"rightdown":"mousedown",this.eventData))},n.prototype.onMouseUp=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseUp,!0)},n.prototype.processMouseUp=function(t,e){var r=this.mouse.originalEvent,n=2===r.button||3===r.which,i=n?"_isRightDown":"_isLeftDown";e?(this.dispatchEvent(t,n?"rightup":"mouseup",this.eventData),t[i]&&(t[i]=!1,this.dispatchEvent(t,n?"rightclick":"click",this.eventData))):t[i]&&(t[i]=!1,this.dispatchEvent(t,n?"rightupoutside":"mouseupoutside",this.eventData))},n.prototype.onMouseMove=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.didMove=!0,this.cursor="inherit",this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseMove,!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor)},n.prototype.processMouseMove=function(t,e){this.dispatchEvent(t,"mousemove",this.eventData),this.processMouseOverOut(t,e)},n.prototype.onMouseOut=function(t){this.mouse.originalEvent=t,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.interactionDOMElement.style.cursor="inherit",this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut,!1)},n.prototype.processMouseOverOut=function(t,e){e?(t._over||(t._over=!0,this.dispatchEvent(t,"mouseover",this.eventData)),t.buttonMode&&(this.cursor=t.defaultCursor)):t._over&&(t._over=!1,this.dispatchEvent(t,"mouseout",this.eventData))},n.prototype.onTouchStart=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,n=0;r>n;n++){var i=e[n],o=this.getTouchData(i);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchStart,!0),this.returnTouchData(o)}},n.prototype.processTouchStart=function(t,e){e&&(t._touchDown=!0,this.dispatchEvent(t,"touchstart",this.eventData))},n.prototype.onTouchEnd=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,n=0;r>n;n++){var i=e[n],o=this.getTouchData(i);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchEnd,!0),this.returnTouchData(o)}},n.prototype.processTouchEnd=function(t,e){e?(this.dispatchEvent(t,"touchend",this.eventData),t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"tap",this.eventData))):t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"touchendoutside",this.eventData))},n.prototype.onTouchMove=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,n=0;r>n;n++){var i=e[n],o=this.getTouchData(i);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchMove,!1),this.returnTouchData(o)}},n.prototype.processTouchMove=function(t,e){e=e,this.dispatchEvent(t,"touchmove",this.eventData)},n.prototype.getTouchData=function(t){var e=this.interactiveDataPool.pop();return e||(e=new o),e.identifier=t.identifier,this.mapPositionToPoint(e.global,t.clientX,t.clientY),navigator.isCocoonJS&&(e.global.x=e.global.x/this.resolution,e.global.y=e.global.y/this.resolution),t.globalX=e.global.x,t.globalY=e.global.y,e},n.prototype.returnTouchData=function(t){this.interactiveDataPool.push(t)},n.prototype.destroy=function(){this.removeEvents(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactiveDataPool=null,this.interactionDOMElement=null,this.onMouseUp=null,this.processMouseUp=null,this.onMouseDown=null,this.processMouseDown=null,this.onMouseMove=null,this.processMouseMove=null,this.onMouseOut=null,this.processMouseOverOut=null,this.onTouchStart=null,this.processTouchStart=null,this.onTouchEnd=null,this.processTouchEnd=null,this.onTouchMove=null,this.processTouchMove=null,this._tempPoint=null},i.WebGLRenderer.registerPlugin("interaction",n),i.CanvasRenderer.registerPlugin("interaction",n)},{"../core":29,"./InteractionData":115,"./interactiveTarget":118}],117:[function(t,e,r){e.exports={InteractionData:t("./InteractionData"),InteractionManager:t("./InteractionManager"),interactiveTarget:t("./interactiveTarget")}},{"./InteractionData":115,"./InteractionManager":116,"./interactiveTarget":118}],118:[function(t,e,r){var n={interactive:!1,buttonMode:!1,interactiveChildren:!0,defaultCursor:"pointer",_over:!1,_touchDown:!1};e.exports=n},{}],119:[function(t,e,r){function n(t,e){var r={},n=t.data.getElementsByTagName("info")[0],i=t.data.getElementsByTagName("common")[0];r.font=n.getAttribute("face"),r.size=parseInt(n.getAttribute("size"),10),r.lineHeight=parseInt(i.getAttribute("lineHeight"),10),r.chars={};for(var a=t.data.getElementsByTagName("char"),l=0;li;i++){var o=2*i;this._renderCanvasDrawTriangle(t,e,r,o,o+2,o+4)}},n.prototype._renderCanvasTriangles=function(t){for(var e=this.vertices,r=this.uvs,n=this.indices,i=n.length,o=0;i>o;o+=3){var s=2*n[o],a=2*n[o+1],l=2*n[o+2];this._renderCanvasDrawTriangle(t,e,r,s,a,l)}},n.prototype._renderCanvasDrawTriangle=function(t,e,r,n,i,o){var s=this._texture.baseTexture.source,a=this._texture.baseTexture.width,l=this._texture.baseTexture.height,u=e[n],h=e[i],c=e[o],f=e[n+1],d=e[i+1],p=e[o+1],g=r[n]*a,A=r[i]*a,v=r[o]*a,m=r[n+1]*l,y=r[i+1]*l,x=r[o+1]*l;if(this.canvasPadding>0){var w=this.canvasPadding/this.worldTransform.a,E=this.canvasPadding/this.worldTransform.d,C=(u+h+c)/3,b=(f+d+p)/3,B=u-C,T=f-b,D=Math.sqrt(B*B+T*T);u=C+B/D*(D+w),f=b+T/D*(D+E),B=h-C,T=d-b,D=Math.sqrt(B*B+T*T),h=C+B/D*(D+w),d=b+T/D*(D+E),B=c-C,T=p-b,D=Math.sqrt(B*B+T*T),c=C+B/D*(D+w),p=b+T/D*(D+E)}t.save(),t.beginPath(),t.moveTo(u,f),t.lineTo(h,d),t.lineTo(c,p),t.closePath(),t.clip();var M=g*y+m*v+A*x-y*v-m*A-g*x,P=u*y+m*c+h*x-y*c-m*h-u*x,R=g*h+u*v+A*c-h*v-u*A-g*c,I=g*y*c+m*h*v+u*A*x-u*y*v-m*A*c-g*h*x,S=f*y+m*p+d*x-y*p-m*d-f*x,O=g*d+f*v+A*p-d*v-f*A-g*p,F=g*y*p+m*d*v+f*A*x-f*y*v-m*A*p-g*d*x;t.transform(P/M,S/M,R/M,O/M,I/M,F/M),t.drawImage(s,0,0),t.restore()},n.prototype.renderMeshFlat=function(t){var e=this.context,r=t.vertices,n=r.length/2;e.beginPath();for(var i=1;n-2>i;i++){var o=2*i,s=r[o],a=r[o+2],l=r[o+4],u=r[o+1],h=r[o+3],c=r[o+5];e.moveTo(s,u),e.lineTo(a,h),e.lineTo(l,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},n.prototype._onTextureUpdate=function(){this.updateFrame=!0},n.prototype.getBounds=function(t){if(!this._currentBounds){for(var e=t||this.worldTransform,r=e.a,n=e.b,o=e.c,s=e.d,a=e.tx,l=e.ty,u=-(1/0),h=-(1/0),c=1/0,f=1/0,d=this.vertices,p=0,g=d.length;g>p;p+=2){var A=d[p],v=d[p+1],m=r*A+o*v+a,y=s*v+n*A+l;c=c>m?m:c,f=f>y?y:f,u=m>u?m:u,h=y>h?y:h}if(c===-(1/0)||h===1/0)return i.Rectangle.EMPTY;var x=this._bounds;x.x=c,x.width=u-c,x.y=f,x.height=h-f,this._currentBounds=x}return this._currentBounds},n.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,o);var e,r,i=this.vertices,a=s.points;if(this.drawMode===n.DRAW_MODES.TRIANGLES){var l=this.indices;for(r=this.indices.length,e=0;r>e;e+=3){var u=2*l[e],h=2*l[e+1],c=2*l[e+2];if(a[0]=i[u],a[1]=i[u+1],a[2]=i[h],a[3]=i[h+1],a[4]=i[c],a[5]=i[c+1],s.contains(o.x,o.y))return!0}}else for(r=i.length,e=0;r>e;e+=6)if(a[0]=i[e],a[1]=i[e+1],a[2]=i[e+2],a[3]=i[e+3],a[4]=i[e+4],a[5]=i[e+5],s.contains(o.x,o.y))return!0;return!1},n.DRAW_MODES={TRIANGLE_MESH:0,TRIANGLES:1}},{"../core":29}],125:[function(t,e,r){function n(t,e){i.call(this,t),this.points=e,this.vertices=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length), +this.indices=new Uint16Array(2*e.length),this._ready=!0,this.refresh()}var i=t("./Mesh"),o=t("../core");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.refresh=function(){var t=this.points;if(!(t.length<1)&&this._texture._uvs){var e=this.uvs,r=this.indices,n=this.colors,i=this._texture._uvs,s=new o.Point(i.x0,i.y0),a=new o.Point(i.x2-i.x0,i.y2-i.y0);e[0]=0+s.x,e[1]=0+s.y,e[2]=0+s.x,e[3]=1*a.y+s.y,n[0]=1,n[1]=1,r[0]=0,r[1]=1;for(var l,u,h,c=t.length,f=1;c>f;f++)l=t[f],u=4*f,h=f/(c-1),e[u]=h*a.x+s.x,e[u+1]=0+s.y,e[u+2]=h*a.x+s.x,e[u+3]=1*a.y+s.y,u=2*f,n[u]=1,n[u+1]=1,u=2*f,r[u]=u,r[u+1]=u+1;this.dirty=!0}},n.prototype._onTextureUpdate=function(){i.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()},n.prototype.updateTransform=function(){var t=this.points;if(!(t.length<1)){for(var e,r,n,i,o,s,a=t[0],l=0,u=0,h=this.vertices,c=t.length,f=0;c>f;f++)r=t[f],n=4*f,e=f1&&(i=1),o=Math.sqrt(l*l+u*u),s=this._texture.height/2,l/=o,u/=o,l*=s,u*=s,h[n]=r.x+l,h[n+1]=r.y+u,h[n+2]=r.x-l,h[n+3]=r.y-u,a=r;this.containerUpdateTransform()}}},{"../core":29,"./Mesh":124}],126:[function(t,e,r){e.exports={Mesh:t("./Mesh"),Rope:t("./Rope"),MeshRenderer:t("./webgl/MeshRenderer"),MeshShader:t("./webgl/MeshShader")}},{"./Mesh":124,"./Rope":125,"./webgl/MeshRenderer":127,"./webgl/MeshShader":128}],127:[function(t,e,r){function n(t){i.ObjectRenderer.call(this,t),this.indices=new Uint16Array(15e3);for(var e=0,r=0;15e3>e;e+=6,r+=4)this.indices[e+0]=r+0,this.indices[e+1]=r+1,this.indices[e+2]=r+2,this.indices[e+3]=r+0,this.indices[e+4]=r+2,this.indices[e+5]=r+3}var i=t("../../core"),o=t("../Mesh");n.prototype=Object.create(i.ObjectRenderer.prototype),n.prototype.constructor=n,e.exports=n,i.WebGLRenderer.registerPlugin("mesh",n),n.prototype.onContextChange=function(){},n.prototype.render=function(t){t._vertexBuffer||this._initWebGL(t);var e=this.renderer,r=e.gl,n=t._texture.baseTexture,i=e.shaderManager.plugins.meshShader,s=t.drawMode===o.DRAW_MODES.TRIANGLE_MESH?r.TRIANGLE_STRIP:r.TRIANGLES;e.blendModeManager.setBlendMode(t.blendMode),r.uniformMatrix3fv(i.uniforms.translationMatrix._location,!1,t.worldTransform.toArray(!0)),r.uniformMatrix3fv(i.uniforms.projectionMatrix._location,!1,e.currentRenderTarget.projectionMatrix.toArray(!0)),r.uniform1f(i.uniforms.alpha._location,t.worldAlpha),t.dirty?(t.dirty=!1,r.bindBuffer(r.ARRAY_BUFFER,t._vertexBuffer),r.bufferData(r.ARRAY_BUFFER,t.vertices,r.STATIC_DRAW),r.vertexAttribPointer(i.attributes.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,t._uvBuffer),r.bufferData(r.ARRAY_BUFFER,t.uvs,r.STATIC_DRAW),r.vertexAttribPointer(i.attributes.aTextureCoord,2,r.FLOAT,!1,0,0),r.activeTexture(r.TEXTURE0),n._glTextures[r.id]?r.bindTexture(r.TEXTURE_2D,n._glTextures[r.id]):this.renderer.updateTexture(n),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._indexBuffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.indices,r.STATIC_DRAW)):(r.bindBuffer(r.ARRAY_BUFFER,t._vertexBuffer),r.bufferSubData(r.ARRAY_BUFFER,0,t.vertices),r.vertexAttribPointer(i.attributes.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,t._uvBuffer),r.vertexAttribPointer(i.attributes.aTextureCoord,2,r.FLOAT,!1,0,0),r.activeTexture(r.TEXTURE0),n._glTextures[r.id]?r.bindTexture(r.TEXTURE_2D,n._glTextures[r.id]):this.renderer.updateTexture(n),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._indexBuffer),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,t.indices)),r.drawElements(s,t.indices.length,r.UNSIGNED_SHORT,0)},n.prototype._initWebGL=function(t){var e=this.renderer.gl;t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.vertices,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),t.colors&&(t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW)),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},n.prototype.flush=function(){},n.prototype.start=function(){var t=this.renderer.shaderManager.plugins.meshShader;this.renderer.shaderManager.setShader(t)},n.prototype.destroy=function(){}},{"../../core":29,"../Mesh":124}],128:[function(t,e,r){function n(t){i.Shader.call(this,t,["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * alpha ;","}"].join("\n"),{alpha:{type:"1f",value:0},translationMatrix:{type:"mat3",value:new Float32Array(9)},projectionMatrix:{type:"mat3",value:new Float32Array(9)}},{aVertexPosition:0,aTextureCoord:0})}var i=t("../../core");n.prototype=Object.create(i.Shader.prototype),n.prototype.constructor=n,e.exports=n,i.ShaderManager.registerPlugin("meshShader",n)},{"../../core":29}],129:[function(t,e,r){Object.assign||(Object.assign=t("object-assign"))},{"object-assign":12}],130:[function(t,e,r){t("./Object.assign"),t("./requestAnimationFrame")},{"./Object.assign":129,"./requestAnimationFrame":131}],131:[function(t,e,r){(function(t){if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var r=Date.now(),n=["ms","moz","webkit","o"],i=0;in&&(n=0),r=e,setTimeout(function(){r=Date.now(),t(performance.now())},n)}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.html2canvas=t()}}(function(){var t;return function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[s]={exports:{}};t[s][0].call(h.exports,function(e){var r=t[s][1][e];return i(r?r:e)},h,h.exports,e,t,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;st;t+=2){var e=rt[t],r=rt[t+1];e(r),rt[t]=void 0,rt[t+1]=void 0}V=0}function A(){try{var t=e,r=t("vertx");return J=r.runOnLoop||r.runOnContext,c()}catch(n){return p()}}function v(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function y(){return new TypeError("A promises callback cannot return that same promise.")}function x(t){try{return t.then}catch(e){return st.error=e,st}}function w(t,e,r,n){try{t.call(e,r,n)}catch(i){return i}}function E(t,e,r){Z(function(t){var n=!1,i=w(r,e,function(r){n||(n=!0,e!==r?B(t,r):D(t,r))},function(e){n||(n=!0,M(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&i&&(n=!0,M(t,i))},t)}function C(t,e){e._state===it?D(t,e._result):e._state===ot?M(t,e._result):P(e,void 0,function(e){B(t,e)},function(e){M(t,e)})}function b(t,e){if(e.constructor===t.constructor)C(t,e);else{var r=x(e);r===st?M(t,st.error):void 0===r?D(t,e):s(r)?E(t,e,r):D(t,e)}}function B(t,e){t===e?M(t,m()):o(e)?b(t,e):D(t,e)}function T(t){t._onerror&&t._onerror(t._result),R(t)}function D(t,e){t._state===nt&&(t._result=e,t._state=it,0!==t._subscribers.length&&Z(R,t))}function M(t,e){t._state===nt&&(t._state=ot,t._result=e,Z(T,t))}function P(t,e,r,n){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+it]=r,i[o+ot]=n,0===o&&t._state&&Z(R,t)}function R(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n,i,o=t._result,s=0;ss;s++)P(n.resolve(t[s]),void 0,e,r);return i}function H(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(v);return B(r,t),r}function k(t){var e=this,r=new e(v);return M(r,t),r}function G(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Y(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function j(t){this._id=dt++,this._state=void 0,this._result=void 0,this._subscribers=[],v!==t&&(s(t)||G(),this instanceof j||Y(),F(this,t))}function z(){var t;if("undefined"!=typeof i)t=i;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=t.Promise;(!r||"[object Promise]"!==Object.prototype.toString.call(r.resolve())||r.cast)&&(t.Promise=pt)}var U;U=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var J,X,W,K=U,V=0,Z=({}.toString,function(t,e){rt[V]=t,rt[V+1]=e,V+=2,2===V&&(X?X(g):W())}),q="undefined"!=typeof window?window:void 0,_=q||{},$=_.MutationObserver||_.WebKitMutationObserver,tt="undefined"!=typeof n&&"[object process]"==={}.toString.call(n),et="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,rt=new Array(1e3);W=tt?h():$?f():et?d():void 0===q&&"function"==typeof e?A():p();var nt=void 0,it=1,ot=2,st=new I,at=new I;Q.prototype._validateInput=function(t){return K(t)},Q.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},Q.prototype._init=function(){this._result=new Array(this.length)};var lt=Q;Q.prototype._enumerate=function(){for(var t=this,e=t.length,r=t.promise,n=t._input,i=0;r._state===nt&&e>i;i++)t._eachEntry(n[i],i)},Q.prototype._eachEntry=function(t,e){var r=this,n=r._instanceConstructor;a(t)?t.constructor===n&&t._state!==nt?(t._onerror=null,r._settledAt(t._state,e,t._result)):r._willSettleAt(n.resolve(t),e):(r._remaining--,r._result[e]=t)},Q.prototype._settledAt=function(t,e,r){var n=this,i=n.promise;i._state===nt&&(n._remaining--,t===ot?M(i,r):n._result[e]=r),0===n._remaining&&D(i,n._result)},Q.prototype._willSettleAt=function(t,e){var r=this;P(t,void 0,function(t){r._settledAt(it,e,t)},function(t){r._settledAt(ot,e,t)})};var ut=L,ht=N,ct=H,ft=k,dt=0,pt=j;j.all=ut,j.race=ht,j.resolve=ct,j.reject=ft,j._setScheduler=l,j._setAsap=u,j._asap=Z,j.prototype={constructor:j,then:function(t,e){var r=this,n=r._state;if(n===it&&!t||n===ot&&!e)return this;var i=new this.constructor(v),o=r._result;if(n){var s=arguments[n-1];Z(function(){O(n,i,s,o)})}else P(r,i,t,e);return i},"catch":function(t){return this.then(null,t)}};var gt=z,At={Promise:pt,polyfill:gt};"function"==typeof t&&t.amd?t(function(){return At}):"undefined"!=typeof r&&r.exports?r.exports=At:"undefined"!=typeof this&&(this.ES6Promise=At),gt()}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:2}],2:[function(t,e,r){function n(){h=!1,a.length?u=a.concat(u):c=-1,u.length&&i()}function i(){if(!h){var t=setTimeout(n);h=!0;for(var e=u.length;e;){for(a=u,u=[];++c1)for(var r=1;r1&&(n=r[0]+"@",t=r[1]),t=t.replace(O,".");var i=t.split("."),o=s(i,e).join(".");return n+o}function l(t){for(var e,r,n=[],i=0,o=t.length;o>i;)e=t.charCodeAt(i++),e>=55296&&56319>=e&&o>i?(r=t.charCodeAt(i++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--)):n.push(e);return n}function u(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=N(t>>>10&1023|55296),t=56320|1023&t),e+=N(t)}).join("")}function h(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:C}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?L(t/D):t>>1,t+=L(t/e);t>Q*B>>1;n+=C)t=L(t/Q);return L(n+(Q+1)*t/(t+T))}function d(t){var e,r,n,i,s,a,l,c,d,p,g=[],A=t.length,v=0,m=P,y=M;for(r=t.lastIndexOf(R),0>r&&(r=0),n=0;r>n;++n)t.charCodeAt(n)>=128&&o("not-basic"),g.push(t.charCodeAt(n));for(i=r>0?r+1:0;A>i;){for(s=v,a=1,l=C;i>=A&&o("invalid-input"),c=h(t.charCodeAt(i++)),(c>=C||c>L((E-v)/a))&&o("overflow"),v+=c*a,d=y>=l?b:l>=y+B?B:l-y,!(d>c);l+=C)p=C-d,a>L(E/p)&&o("overflow"),a*=p;e=g.length+1,y=f(v-s,e,0==s),L(v/e)>E-m&&o("overflow"),m+=L(v/e),v%=e,g.splice(v++,0,m)}return u(g)}function p(t){var e,r,n,i,s,a,u,h,d,p,g,A,v,m,y,x=[];for(t=l(t),A=t.length,e=P,r=0,s=M,a=0;A>a;++a)g=t[a],128>g&&x.push(N(g));for(n=i=x.length,i&&x.push(R);A>n;){for(u=E,a=0;A>a;++a)g=t[a],g>=e&&u>g&&(u=g);for(v=n+1,u-e>L((E-r)/v)&&o("overflow"),r+=(u-e)*v,e=u,a=0;A>a;++a)if(g=t[a],e>g&&++r>E&&o("overflow"),g==e){for(h=r,d=C;p=s>=d?b:d>=s+B?B:d-s,!(p>h);d+=C)y=h-p,m=C-p,x.push(N(c(p+y%m,0))),h=L(y/m);x.push(N(c(h,0))),s=f(r,v,n==i),r=0,++n}++r,++e}return x.join("")}function g(t){return a(t,function(t){return I.test(t)?d(t.slice(4).toLowerCase()):t})}function A(t){return a(t,function(t){return S.test(t)?"xn--"+p(t):t})}var v="object"==typeof n&&n&&!n.nodeType&&n,m="object"==typeof r&&r&&!r.nodeType&&r,y="object"==typeof e&&e;(y.global===y||y.window===y||y.self===y)&&(i=y);var x,w,E=2147483647,C=36,b=1,B=26,T=38,D=700,M=72,P=128,R="-",I=/^xn--/,S=/[^\x20-\x7E]/,O=/[\x2E\u3002\uFF0E\uFF61]/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Q=C-b,L=Math.floor,N=String.fromCharCode;if(x={version:"1.3.2",ucs2:{decode:l,encode:u},decode:d,encode:p,toASCII:A,toUnicode:g},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return x});else if(v&&m)if(r.exports==v)m.exports=x;else for(w in x)x.hasOwnProperty(w)&&(v[w]=x[w]);else i.punycode=x}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(t,e,r){function n(t,e,r){!t.defaultView||e===t.defaultView.pageXOffset&&r===t.defaultView.pageYOffset||t.defaultView.scrollTo(e,r)}function i(t,e){try{e&&(e.width=t.width,e.height=t.height,e.getContext("2d").putImageData(t.getContext("2d").getImageData(0,0,t.width,t.height),0,0))}catch(r){a("Unable to copy canvas content from",t,r)}}function o(t,e){for(var r=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),n=t.firstChild;n;)(e===!0||1!==n.nodeType||"SCRIPT"!==n.nodeName)&&r.appendChild(o(n,e)),n=n.nextSibling;return 1===t.nodeType&&"BODY"!==t.tagName&&(r._scrollTop=t.scrollTop,r._scrollLeft=t.scrollLeft,"CANVAS"===t.nodeName?i(t,r):("TEXTAREA"===t.nodeName||"SELECT"===t.nodeName)&&(r.value=t.value)),r}function s(t){if(1===t.nodeType){t.scrollTop=t._scrollTop,t.scrollLeft=t._scrollLeft;for(var e=t.firstChild;e;)s(e),e=e.nextSibling}}var a=t("./log"),l=t("./promise");e.exports=function(t,e,r,i,a,u,h){var c=o(t.documentElement,a.javascriptEnabled),f=e.createElement("iframe");return f.className="html2canvas-container",f.style.visibility="hidden",f.style.position="fixed",f.style.left="-10000px",f.style.top="0px",f.style.border="0",f.style.border="0",f.width=r,f.height=i,f.scrolling="no",e.body.appendChild(f),new l(function(e){var r=f.contentWindow.document;f.contentWindow.onload=f.onload=function(){var t=setInterval(function(){r.body.childNodes.length>0&&(s(r.documentElement),clearInterval(t),"view"===a.type&&(f.contentWindow.scrollTo(u,h),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||f.contentWindow.scrollY===h&&f.contentWindow.scrollX===u||(r.documentElement.style.top=-h+"px",r.documentElement.style.left=-u+"px",r.documentElement.style.position="absolute")),e(f))},50)},r.open(),r.write(""),n(t,u,h),r.replaceChild(r.adoptNode(c),r.documentElement),r.close()})}},{"./log":15,"./promise":18}],5:[function(t,e,r){function n(t){this.r=0,this.g=0,this.b=0,this.a=null;this.fromArray(t)||this.namedColor(t)||this.rgb(t)||this.rgba(t)||this.hex6(t)||this.hex3(t)}n.prototype.darken=function(t){var e=1-t;return new n([Math.round(this.r*e),Math.round(this.g*e),Math.round(this.b*e),this.a])},n.prototype.isTransparent=function(){return 0===this.a},n.prototype.isBlack=function(){return 0===this.r&&0===this.g&&0===this.b},n.prototype.fromArray=function(t){return Array.isArray(t)&&(this.r=Math.min(t[0],255),this.g=Math.min(t[1],255),this.b=Math.min(t[2],255),t.length>3&&(this.a=t[3])),Array.isArray(t)};var i=/^#([a-f0-9]{3})$/i;n.prototype.hex3=function(t){var e=null;return null!==(e=t.match(i))&&(this.r=parseInt(e[1][0]+e[1][0],16),this.g=parseInt(e[1][1]+e[1][1],16),this.b=parseInt(e[1][2]+e[1][2],16)),null!==e};var o=/^#([a-f0-9]{6})$/i;n.prototype.hex6=function(t){var e=null;return null!==(e=t.match(o))&&(this.r=parseInt(e[1].substring(0,2),16),this.g=parseInt(e[1].substring(2,4),16),this.b=parseInt(e[1].substring(4,6),16)),null!==e};var s=/^rgb\((\d{1,3}) *, *(\d{1,3}) *, *(\d{1,3})\)$/;n.prototype.rgb=function(t){var e=null;return null!==(e=t.match(s))&&(this.r=Number(e[1]),this.g=Number(e[2]),this.b=Number(e[3])),null!==e};var a=/^rgba\((\d{1,3}) *, *(\d{1,3}) *, *(\d{1,3}) *, *(\d+\.?\d*)\)$/;n.prototype.rgba=function(t){var e=null;return null!==(e=t.match(a))&&(this.r=Number(e[1]),this.g=Number(e[2]),this.b=Number(e[3]),this.a=Number(e[4])),null!==e},n.prototype.toString=function(){return null!==this.a&&1!==this.a?"rgba("+[this.r,this.g,this.b,this.a].join(",")+")":"rgb("+[this.r,this.g,this.b].join(",")+")"},n.prototype.namedColor=function(t){var e=l[t.toLowerCase()];if(e)this.r=e[0],this.g=e[1],this.b=e[2];else if("transparent"===t.toLowerCase())return this.r=this.g=this.b=this.a=0,!0;return!!e},n.prototype.isColor=!0;var l={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};e.exports=n},{}],6:[function(t,e,r){function n(t,e){var r=C++;if(e=e||{},e.logging&&(window.html2canvas.logging=!0,window.html2canvas.start=Date.now()),e.async="undefined"==typeof e.async?!0:e.async,e.allowTaint="undefined"==typeof e.allowTaint?!1:e.allowTaint,e.removeContainer="undefined"==typeof e.removeContainer?!0:e.removeContainer,e.javascriptEnabled="undefined"==typeof e.javascriptEnabled?!1:e.javascriptEnabled,e.imageTimeout="undefined"==typeof e.imageTimeout?1e4:e.imageTimeout,e.renderer="function"==typeof e.renderer?e.renderer:d,e.strict=!!e.strict,"string"==typeof t){if("string"!=typeof e.proxy)return c.reject("Proxy must be used when rendering url");var n=null!=e.width?e.width:window.innerWidth,s=null!=e.height?e.height:window.innerHeight;return x(h(t),e.proxy,document,n,s,e).then(function(t){return o(t.contentWindow.document.documentElement,t,e,n,s)})}var a=(void 0===t?[document.documentElement]:t.length?t:[t])[0];return a.setAttribute(E+r,r),i(a.ownerDocument,e,a.ownerDocument.defaultView.innerWidth,a.ownerDocument.defaultView.innerHeight,r).then(function(t){return"function"==typeof e.onrendered&&(v("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas"),e.onrendered(t)),t})}function i(t,e,r,n,i){return y(t,t,r,n,e,t.defaultView.pageXOffset,t.defaultView.pageYOffset).then(function(s){v("Document cloned");var a=E+i,l="["+a+"='"+i+"']";t.querySelector(l).removeAttribute(a);var u=s.contentWindow,h=u.document.querySelector(l);"0"===h.style.opacity&&"webgl"===h.getAttribute("renderer")?h.style.opacity=1:null;var f="function"==typeof e.onclone?c.resolve(e.onclone(u.document)):c.resolve(!0);return f.then(function(){return o(h,s,e,r,n)})})}function o(t,e,r,n,i){var o=e.contentWindow,h=new f(o.document),c=new p(r,h),d=w(t),A="view"===r.type?n:l(o.document),m="view"===r.type?i:u(o.document),y=new r.renderer(A,m,c,r,document),x=new g(t,y,h,c,r);return x.ready.then(function(){v("Finished rendering");var n;return"view"===r.type?n=a(y.canvas,{width:y.canvas.width,height:y.canvas.height,top:0,left:0,x:0,y:0}):t===o.document.body||t===o.document.documentElement||null!=r.canvas?n=y.canvas:(1!==window.devicePixelRatio&&(d.top=d.top*window.devicePixelRatio,d.left=d.left*window.devicePixelRatio,d.right=d.right*window.devicePixelRatio,d.bottom=d.bottom*window.devicePixelRatio),n=a(y.canvas,{width:null!=r.width?r.width:d.width,height:null!=r.height?r.height:d.height,top:d.top,left:d.left,x:o.pageXOffset,y:o.pageYOffset})),s(e,r),n})}function s(t,e){e.removeContainer&&(t.parentNode.removeChild(t),v("Cleaned up container"))}function a(t,e){var r=document.createElement("canvas"),n=Math.min(t.width-1,Math.max(0,e.left)),i=Math.min(t.width,Math.max(1,e.left+e.width)),o=Math.min(t.height-1,Math.max(0,e.top)),s=Math.min(t.height,Math.max(1,e.top+e.height));return r.width=e.width,r.height=e.height,v("Cropping canvas at:","left:",e.left,"top:",e.top,"width:",i-n,"height:",s-o),v("Resulting crop with width",e.width,"and height",e.height," with x",n,"and y",o),r.getContext("2d").drawImage(t,n,o,i-n,s-o,e.x,e.y,i-n,s-o),r}function l(t){return Math.max(Math.max(t.body.scrollWidth,t.documentElement.scrollWidth),Math.max(t.body.offsetWidth,t.documentElement.offsetWidth),Math.max(t.body.clientWidth,t.documentElement.clientWidth))}function u(t){return Math.max(Math.max(t.body.scrollHeight,t.documentElement.scrollHeight),Math.max(t.body.offsetHeight,t.documentElement.offsetHeight),Math.max(t.body.clientHeight,t.documentElement.clientHeight))}function h(t){var e=document.createElement("a");return e.href=t,e.href=e.href,e}var c=t("./promise"),f=t("./support"),d=t("./renderers/canvas"),p=t("./imageloader"),g=t("./nodeparser"),A=t("./nodecontainer"),v=t("./log"),m=t("./utils"),y=t("./clone"),x=t("./proxy").loadUrlDocument,w=m.getBounds,E="data-html2canvas-node",C=0;n.Promise=c,n.CanvasRenderer=d,n.NodeContainer=A,n.log=v,n.utils=m,e.exports="undefined"==typeof document||"function"!=typeof Object.create||"function"!=typeof document.createElement("canvas").getContext?function(){return c.reject("No canvas support")}:n},{"./clone":4,"./imageloader":13,"./log":15,"./nodecontainer":16,"./nodeparser":17,"./promise":18,"./proxy":19,"./renderers/canvas":23,"./support":25,"./utils":29}],7:[function(t,e,r){function n(t){if(this.src=t,o("DummyImageContainer for",t),!this.promise||!this.image){o("Initiating DummyImageContainer"),n.prototype.image=new Image;var e=this.image;n.prototype.promise=new i(function(t,r){e.onload=t,e.onerror=r,e.src=s(),e.complete===!0&&t(e)})}}var i=t("./promise"),o=t("./log"),s=t("./utils").smallImage;e.exports=n},{"./log":15,"./promise":18,"./utils":29}],8:[function(t,e,r){function n(t,e){var r,n,o=document.createElement("div"),s=document.createElement("img"),a=document.createElement("span"),l="Hidden Text";o.style.visibility="hidden",o.style.fontFamily=t,o.style.fontSize=e,o.style.margin=0,o.style.padding=0,document.body.appendChild(o),s.src=i(),s.width=1,s.height=1,s.style.margin=0,s.style.padding=0,s.style.verticalAlign="baseline",a.style.fontFamily=t,a.style.fontSize=e,a.style.margin=0,a.style.padding=0,a.appendChild(document.createTextNode(l)),o.appendChild(a),o.appendChild(s),r=s.offsetTop-a.offsetTop+1,o.removeChild(a),o.appendChild(document.createTextNode(l)),o.style.lineHeight="normal",s.style.verticalAlign="super",n=s.offsetTop-o.offsetTop+1,document.body.removeChild(o),this.baseline=r,this.lineWidth=1,this.middle=n}var i=t("./utils").smallImage;e.exports=n},{"./utils":29}],9:[function(t,e,r){function n(){this.data={}}var i=t("./font");n.prototype.getMetrics=function(t,e){return void 0===this.data[t+"-"+e]&&(this.data[t+"-"+e]=new i(t,e)),this.data[t+"-"+e]},e.exports=n},{"./font":8}],10:[function(t,e,r){function n(e,r,n){this.image=null,this.src=e;var i=this,a=s(e);this.promise=(r?new o(function(t){"about:blank"===e.contentWindow.document.URL||null==e.contentWindow.document.documentElement?e.contentWindow.onload=e.onload=function(){t(e)}:t(e)}):this.proxyLoad(n.proxy,a,n)).then(function(e){var r=t("./core");return r(e.contentWindow.document.documentElement,{type:"view",width:e.width,height:e.height,proxy:n.proxy,javascriptEnabled:n.javascriptEnabled,removeContainer:n.removeContainer,allowTaint:n.allowTaint,imageTimeout:n.imageTimeout/2})}).then(function(t){return i.image=t})}var i=t("./utils"),o=t("./promise"),s=i.getBounds,a=t("./proxy").loadUrlDocument;n.prototype.proxyLoad=function(t,e,r){var n=this.src;return a(n.src,t,n.ownerDocument,e.width,e.height,r)},e.exports=n},{"./core":6,"./promise":18,"./proxy":19,"./utils":29}],11:[function(t,e,r){function n(t){this.src=t.value,this.colorStops=[],this.type=null,this.x0=.5,this.y0=.5,this.x1=.5,this.y1=.5,this.promise=i.resolve(!0)}var i=t("./promise");n.prototype.TYPES={LINEAR:1,RADIAL:2},e.exports=n},{"./promise":18}],12:[function(t,e,r){function n(t,e){this.src=t,this.image=new Image;var r=this;this.tainted=null,this.promise=new i(function(n,i){r.image.onload=n,r.image.onerror=i,e&&(r.image.crossOrigin="anonymous"),r.image.src=t,r.image.complete===!0&&n(r.image)})}var i=t("./promise");e.exports=n},{"./promise":18}],13:[function(t,e,r){function n(t,e){this.link=null,this.options=t,this.support=e,this.origin=this.getOrigin(window.location.href)}var i=t("./promise"),o=t("./log"),s=t("./imagecontainer"),a=t("./dummyimagecontainer"),l=t("./proxyimagecontainer"),u=t("./framecontainer"),h=t("./svgcontainer"),c=t("./svgnodecontainer"),f=t("./lineargradientcontainer"),d=t("./webkitgradientcontainer"),p=t("./utils").bind; +n.prototype.findImages=function(t){var e=[];return t.reduce(function(t,e){switch(e.node.nodeName){case"IMG":return t.concat([{args:[e.node.src],method:"url"}]);case"svg":case"IFRAME":return t.concat([{args:[e.node],method:e.node.nodeName}])}return t},[]).forEach(this.addImage(e,this.loadImage),this),e},n.prototype.findBackgroundImage=function(t,e){return e.parseBackgroundImages().filter(this.hasImageBackground).forEach(this.addImage(t,this.loadImage),this),t},n.prototype.addImage=function(t,e){return function(r){r.args.forEach(function(n){this.imageExists(t,n)||(t.splice(0,0,e.call(this,r)),o("Added image #"+t.length,"string"==typeof n?n.substring(0,100):n))},this)}},n.prototype.hasImageBackground=function(t){return"none"!==t.method},n.prototype.loadImage=function(t){if("url"===t.method){var e=t.args[0];return!this.isSVG(e)||this.support.svg||this.options.allowTaint?e.match(/data:image\/.*;base64,/i)?new s(e.replace(/url\(['"]{0,}|['"]{0,}\)$/gi,""),!1):this.isSameOrigin(e)||this.options.allowTaint===!0||this.isSVG(e)?new s(e,!1):this.support.cors&&!this.options.allowTaint&&this.options.useCORS?new s(e,!0):this.options.proxy?new l(e,this.options.proxy):new a(e):new h(e)}return"linear-gradient"===t.method?new f(t):"gradient"===t.method?new d(t):"svg"===t.method?new c(t.args[0],this.support.svg):"IFRAME"===t.method?new u(t.args[0],this.isSameOrigin(t.args[0].src),this.options):new a(t)},n.prototype.isSVG=function(t){return"svg"===t.substring(t.length-3).toLowerCase()||h.prototype.isInline(t)},n.prototype.imageExists=function(t,e){return t.some(function(t){return t.src===e})},n.prototype.isSameOrigin=function(t){return this.getOrigin(t)===this.origin},n.prototype.getOrigin=function(t){var e=this.link||(this.link=document.createElement("a"));return e.href=t,e.href=e.href,e.protocol+e.hostname+e.port},n.prototype.getPromise=function(t){return this.timeout(t,this.options.imageTimeout)["catch"](function(){var e=new a(t.src);return e.promise.then(function(e){t.image=e})})},n.prototype.get=function(t){var e=null;return this.images.some(function(r){return(e=r).src===t})?e:null},n.prototype.fetch=function(t){return this.images=t.reduce(p(this.findBackgroundImage,this),this.findImages(t)),this.images.forEach(function(t,e){t.promise.then(function(){o("Succesfully loaded image #"+(e+1),t)},function(r){o("Failed loading image #"+(e+1),t,r)})}),this.ready=i.all(this.images.map(this.getPromise,this)),o("Finished searching images"),this},n.prototype.timeout=function(t,e){var r,n=i.race([t.promise,new i(function(n,i){r=setTimeout(function(){o("Timed out loading image",t),i(t)},e)})]).then(function(t){return clearTimeout(r),t});return n["catch"](function(){clearTimeout(r)}),n},e.exports=n},{"./dummyimagecontainer":7,"./framecontainer":10,"./imagecontainer":12,"./lineargradientcontainer":14,"./log":15,"./promise":18,"./proxyimagecontainer":20,"./svgcontainer":26,"./svgnodecontainer":27,"./utils":29,"./webkitgradientcontainer":30}],14:[function(t,e,r){function n(t){i.apply(this,arguments),this.type=this.TYPES.LINEAR;var e=null===t.args[0].match(this.stepRegExp);e?t.args[0].split(" ").reverse().forEach(function(t){switch(t){case"left":this.x0=0,this.x1=1;break;case"top":this.y0=0,this.y1=1;break;case"right":this.x0=1,this.x1=0;break;case"bottom":this.y0=1,this.y1=0;break;case"to":var e=this.y0,r=this.x0;this.y0=this.y1,this.x0=this.x1,this.x1=r,this.y1=e}},this):(this.y0=0,this.y1=1),this.colorStops=t.args.slice(e?1:0).map(function(t){var e=t.match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)|\w+)\s*(\d{1,3})?(%|px)?/);return{color:new o(e[1]),stop:"%"===e[3]?e[2]/100:null}},this),null===this.colorStops[0].stop&&(this.colorStops[0].stop=0),null===this.colorStops[this.colorStops.length-1].stop&&(this.colorStops[this.colorStops.length-1].stop=1),this.colorStops.forEach(function(t,e){null===t.stop&&this.colorStops.slice(e).some(function(r,n){return null!==r.stop?(t.stop=(r.stop-this.colorStops[e-1].stop)/(n+1)+this.colorStops[e-1].stop,!0):!1},this)},this)}var i=t("./gradientcontainer"),o=t("./color");n.prototype=Object.create(i.prototype),n.prototype.stepRegExp=/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/,e.exports=n},{"./color":5,"./gradientcontainer":11}],15:[function(t,e,r){e.exports=function(){window.html2canvas.logging&&window.console&&window.console.log&&Function.prototype.bind.call(window.console.log,window.console).apply(window.console,[Date.now()-window.html2canvas.start+"ms","html2canvas:"].concat([].slice.call(arguments,0)))}},{}],16:[function(t,e,r){function n(t,e){this.node=t,this.parent=e,this.stack=null,this.bounds=null,this.borders=null,this.clip=[],this.backgroundClip=[],this.offsetBounds=null,this.visible=null,this.computedStyles=null,this.colors={},this.styles={},this.backgroundImages=null,this.transformData=null,this.transformMatrix=null,this.isPseudoElement=!1,this.opacity=null}function i(t){var e=t.options[t.selectedIndex||0];return e?e.text||"":""}function o(t){if(t&&"matrix"===t[1])return t[2].split(",").map(function(t){return parseFloat(t.trim())});if(t&&"matrix3d"===t[1]){var e=t[2].split(",").map(function(t){return parseFloat(t.trim())});return[e[0],e[1],e[4],e[5],e[12],e[13]]}}function s(t){return-1!==t.toString().indexOf("%")}function a(t){return t.replace("px","")}function l(t){return parseFloat(t)}var u=t("./color"),h=t("./utils"),c=h.getBounds,f=h.parseBackgrounds,d=h.offsetBounds;n.prototype.cloneTo=function(t){t.visible=this.visible,t.borders=this.borders,t.bounds=this.bounds,t.clip=this.clip,t.backgroundClip=this.backgroundClip,t.computedStyles=this.computedStyles,t.styles=this.styles,t.backgroundImages=this.backgroundImages,t.opacity=this.opacity},n.prototype.getOpacity=function(){return null===this.opacity?this.opacity=this.cssFloat("opacity"):this.opacity},n.prototype.assignStack=function(t){this.stack=t,t.children.push(this)},n.prototype.isElementVisible=function(){return this.node.nodeType===Node.TEXT_NODE?this.parent.visible:"none"!==this.css("display")&&"hidden"!==this.css("visibility")&&!this.node.hasAttribute("data-html2canvas-ignore")&&("INPUT"!==this.node.nodeName||"hidden"!==this.node.getAttribute("type"))},n.prototype.css=function(t){return this.computedStyles||(this.computedStyles=this.isPseudoElement?this.parent.computedStyle(this.before?":before":":after"):this.computedStyle(null)),this.styles[t]||(this.styles[t]=this.computedStyles[t])},n.prototype.prefixedCss=function(t){var e=["webkit","moz","ms","o"],r=this.css(t);return void 0===r&&e.some(function(e){return r=this.css(e+t.substr(0,1).toUpperCase()+t.substr(1)),void 0!==r},this),void 0===r?null:r},n.prototype.computedStyle=function(t){return this.node.ownerDocument.defaultView.getComputedStyle(this.node,t)},n.prototype.cssInt=function(t){var e=parseInt(this.css(t),10);return isNaN(e)?0:e},n.prototype.color=function(t){return this.colors[t]||(this.colors[t]=new u(this.css(t)))},n.prototype.cssFloat=function(t){var e=parseFloat(this.css(t));return isNaN(e)?0:e},n.prototype.fontWeight=function(){var t=this.css("fontWeight");switch(parseInt(t,10)){case 401:t="bold";break;case 400:t="normal"}return t},n.prototype.parseClip=function(){var t=this.css("clip").match(this.CLIP);return t?{top:parseInt(t[1],10),right:parseInt(t[2],10),bottom:parseInt(t[3],10),left:parseInt(t[4],10)}:null},n.prototype.parseBackgroundImages=function(){return this.backgroundImages||(this.backgroundImages=f(this.css("backgroundImage")))},n.prototype.cssList=function(t,e){var r=(this.css(t)||"").split(",");return r=r[e||0]||r[0]||"auto",r=r.trim().split(" "),1===r.length&&(r=[r[0],s(r[0])?"auto":r[0]]),r},n.prototype.parseBackgroundSize=function(t,e,r){var n,i,o=this.cssList("backgroundSize",r);if(s(o[0]))n=t.width*parseFloat(o[0])/100;else{if(/contain|cover/.test(o[0])){var a=t.width/t.height,l=e.width/e.height;return l>a^"contain"===o[0]?{width:t.height*l,height:t.height}:{width:t.width,height:t.width/l}}n=parseInt(o[0],10)}return i="auto"===o[0]&&"auto"===o[1]?e.height:"auto"===o[1]?n/e.width*e.height:s(o[1])?t.height*parseFloat(o[1])/100:parseInt(o[1],10),"auto"===o[0]&&(n=i/e.height*e.width),{width:n,height:i}},n.prototype.parseBackgroundPosition=function(t,e,r,n){var i,o,a=this.cssList("backgroundPosition",r);return i=s(a[0])?(t.width-(n||e).width)*(parseFloat(a[0])/100):parseInt(a[0],10),o="auto"===a[1]?i/e.width*e.height:s(a[1])?(t.height-(n||e).height)*parseFloat(a[1])/100:parseInt(a[1],10),"auto"===a[0]&&(i=o/e.height*e.width),{left:i,top:o}},n.prototype.parseBackgroundRepeat=function(t){return this.cssList("backgroundRepeat",t)[0]},n.prototype.parseTextShadows=function(){var t=this.css("textShadow"),e=[];if(t&&"none"!==t)for(var r=t.match(this.TEXT_SHADOW_PROPERTY),n=0;r&&n0?(this.renderIndex=0,this.asyncRenderer(this.renderQueue,t)):t():(this.renderQueue.forEach(this.paint,this),t())},this))},this))}function i(t){return t.parent&&t.parent.clip.length}function o(t){return t.replace(/(\-[a-z])/g,function(t){return t.toUpperCase().replace("-","")})}function s(){}function a(t,e,r,n){return t.map(function(i,o){if(i.width>0){var s=e.left,a=e.top,l=e.width,u=e.height-t[2].width;switch(o){case 0:u=t[0].width,i.args=c({c1:[s,a],c2:[s+l,a],c3:[s+l-t[1].width,a+u],c4:[s+t[3].width,a+u]},n[0],n[1],r.topLeftOuter,r.topLeftInner,r.topRightOuter,r.topRightInner);break;case 1:s=e.left+e.width-t[1].width,l=t[1].width,i.args=c({c1:[s+l,a],c2:[s+l,a+u+t[2].width],c3:[s,a+u],c4:[s,a+t[0].width]},n[1],n[2],r.topRightOuter,r.topRightInner,r.bottomRightOuter,r.bottomRightInner);break;case 2:a=a+e.height-t[2].width,u=t[2].width,i.args=c({c1:[s+l,a+u],c2:[s,a+u],c3:[s+t[3].width,a],c4:[s+l-t[3].width,a]},n[2],n[3],r.bottomRightOuter,r.bottomRightInner,r.bottomLeftOuter,r.bottomLeftInner);break;case 3:l=t[3].width,i.args=c({c1:[s,a+u+t[2].width],c2:[s,a],c3:[s+l,a+t[0].width],c4:[s+l,a+u]},n[3],n[0],r.bottomLeftOuter,r.bottomLeftInner,r.topLeftOuter,r.topLeftInner)}}return i})}function l(t,e,r,n){var i=4*((Math.sqrt(2)-1)/3),o=r*i,s=n*i,a=t+r,l=e+n;return{topLeft:h({x:t,y:l},{x:t,y:l-s},{x:a-o,y:e},{x:a,y:e}),topRight:h({x:t,y:e},{x:t+o,y:e},{x:a,y:l-s},{x:a,y:l}),bottomRight:h({x:a,y:e},{x:a,y:e+s},{x:t+o,y:l},{x:t,y:l}),bottomLeft:h({x:a,y:l},{x:a-o,y:l},{x:t,y:e+s},{x:t,y:e})}}function u(t,e,r){var n=t.left,i=t.top,o=t.width,s=t.height,a=e[0][0],u=e[0][1],h=e[1][0],c=e[1][1],f=e[2][0],d=e[2][1],p=e[3][0],g=e[3][1],A=Math.floor(s/2);a=a>A?A:a,u=u>A?A:u,h=h>A?A:h,c=c>A?A:c,f=f>A?A:f,d=d>A?A:d,p=p>A?A:p,g=g>A?A:g;var v=o-h,m=s-d,y=o-f,x=s-g;return{topLeftOuter:l(n,i,a,u).topLeft.subdivide(.5),topLeftInner:l(n+r[3].width,i+r[0].width,Math.max(0,a-r[3].width),Math.max(0,u-r[0].width)).topLeft.subdivide(.5),topRightOuter:l(n+v,i,h,c).topRight.subdivide(.5),topRightInner:l(n+Math.min(v,o+r[3].width),i+r[0].width,v>o+r[3].width?0:h-r[3].width,c-r[0].width).topRight.subdivide(.5),bottomRightOuter:l(n+y,i+m,f,d).bottomRight.subdivide(.5),bottomRightInner:l(n+Math.min(y,o-r[3].width),i+Math.min(m,s+r[0].width),Math.max(0,f-r[1].width),d-r[2].width).bottomRight.subdivide(.5),bottomLeftOuter:l(n,i+x,p,g).bottomLeft.subdivide(.5),bottomLeftInner:l(n+r[3].width,i+x,Math.max(0,p-r[3].width),g-r[2].width).bottomLeft.subdivide(.5)}}function h(t,e,r,n){var i=function(t,e,r){return{x:t.x+(e.x-t.x)*r,y:t.y+(e.y-t.y)*r}};return{start:t,startControl:e,endControl:r,end:n,subdivide:function(o){var s=i(t,e,o),a=i(e,r,o),l=i(r,n,o),u=i(s,a,o),c=i(a,l,o),f=i(u,c,o);return[h(t,s,u,f),h(f,c,l,n)]},curveTo:function(t){t.push(["bezierCurve",e.x,e.y,r.x,r.y,n.x,n.y])},curveToReversed:function(n){n.push(["bezierCurve",r.x,r.y,e.x,e.y,t.x,t.y])}}}function c(t,e,r,n,i,o,s){var a=[];return e[0]>0||e[1]>0?(a.push(["line",n[1].start.x,n[1].start.y]),n[1].curveTo(a)):a.push(["line",t.c1[0],t.c1[1]]),r[0]>0||r[1]>0?(a.push(["line",o[0].start.x,o[0].start.y]),o[0].curveTo(a),a.push(["line",s[0].end.x,s[0].end.y]),s[0].curveToReversed(a)):(a.push(["line",t.c2[0],t.c2[1]]),a.push(["line",t.c3[0],t.c3[1]])),e[0]>0||e[1]>0?(a.push(["line",i[1].end.x,i[1].end.y]),i[1].curveToReversed(a)):a.push(["line",t.c4[0],t.c4[1]]),a}function f(t,e,r,n,i,o,s){e[0]>0||e[1]>0?(t.push(["line",n[0].start.x,n[0].start.y]),n[0].curveTo(t),n[1].curveTo(t)):t.push(["line",o,s]),(r[0]>0||r[1]>0)&&t.push(["line",i[0].start.x,i[0].start.y])}function d(t){return t.cssInt("zIndex")<0}function p(t){return t.cssInt("zIndex")>0}function g(t){return 0===t.cssInt("zIndex")}function A(t){return-1!==["inline","inline-block","inline-table"].indexOf(t.css("display"))}function v(t){return t instanceof K}function m(t){return t.node.data.trim().length>0}function y(t){return/^(normal|none|0px)$/.test(t.parent.css("letterSpacing"))}function x(t){return["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(e){var r=t.css("border"+e+"Radius"),n=r.split(" ");return n.length<=1&&(n[1]=n[0]),n.map(S)})}function w(t){return t.nodeType===Node.TEXT_NODE||t.nodeType===Node.ELEMENT_NODE}function E(t){var e=t.css("position"),r=-1!==["absolute","relative","fixed"].indexOf(e)?t.css("zIndex"):"auto";return"auto"!==r}function C(t){return"static"!==t.css("position")}function b(t){return"none"!==t.css("float")}function B(t){return-1!==["inline-block","inline-table"].indexOf(t.css("display"))}function T(t){var e=this;return function(){return!t.apply(e,arguments)}}function D(t){return t.node.nodeType===Node.ELEMENT_NODE}function M(t){return t.isPseudoElement===!0}function P(t){return t.node.nodeType===Node.TEXT_NODE}function R(t){return function(e,r){return e.cssInt("zIndex")+t.indexOf(e)/t.length-(r.cssInt("zIndex")+t.indexOf(r)/t.length)}}function I(t){return t.getOpacity()<1}function S(t){return parseInt(t,10)}function O(t){return t.width}function F(t){return t.node.nodeType!==Node.ELEMENT_NODE||-1===["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"].indexOf(t.node.nodeName)}function Q(t){return[].concat.apply([],t)}function L(t){var e=t.substr(0,1);return e===t.substr(t.length-1)&&e.match(/'|"/)?t.substr(1,t.length-2):t}function N(t){for(var e,r=[],n=0,i=!1;t.length;)H(t[n])===i?(e=t.splice(0,n),e.length&&r.push(Y.ucs2.encode(e)),i=!i,n=0):n++,n>=t.length&&(e=t.splice(0,n),e.length&&r.push(Y.ucs2.encode(e)));return r}function H(t){return-1!==[32,13,10,9,45].indexOf(t)}function k(t){return/[^\u0000-\u00ff]/.test(t)}var G=t("./log"),Y=t("punycode"),j=t("./nodecontainer"),z=t("./textcontainer"),U=t("./pseudoelementcontainer"),J=t("./fontmetrics"),X=t("./color"),W=t("./promise"),K=t("./stackingcontext"),V=t("./utils"),Z=V.bind,q=V.getBounds,_=V.parseBackgrounds,$=V.offsetBounds;n.prototype.calculateOverflowClips=function(){this.nodes.forEach(function(t){if(D(t)){M(t)&&t.appendToDOM(),t.borders=this.parseBorders(t);var e="hidden"===t.css("overflow")?[t.borders.clip]:[],r=t.parseClip();r&&-1!==["absolute","fixed"].indexOf(t.css("position"))&&e.push([["rect",t.bounds.left+r.left,t.bounds.top+r.top,r.right-r.left,r.bottom-r.top]]),t.clip=i(t)?t.parent.clip.concat(e):e,t.backgroundClip="hidden"!==t.css("overflow")?t.clip.concat([t.borders.clip]):t.clip,M(t)&&t.cleanDOM()}else P(t)&&(t.clip=i(t)?t.parent.clip:[]);M(t)||(t.bounds=null)},this)},n.prototype.asyncRenderer=function(t,e,r){r=r||Date.now(),this.paint(t[this.renderIndex++]),t.length===this.renderIndex?e():r+20>Date.now()?this.asyncRenderer(t,e,r):setTimeout(Z(function(){this.asyncRenderer(t,e)},this),0)},n.prototype.createPseudoHideStyles=function(t){this.createStyles(t,"."+U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+':before { content: "" !important; display: none !important; }.'+U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER+':after { content: "" !important; display: none !important; }')},n.prototype.disableAnimations=function(t){this.createStyles(t,"* { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; animation: none !important; -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; transition: none !important;}")},n.prototype.createStyles=function(t,e){var r=t.createElement("style");r.innerHTML=e,t.body.appendChild(r)},n.prototype.getPseudoElements=function(t){var e=[[t]];if(t.node.nodeType===Node.ELEMENT_NODE){var r=this.getPseudoElement(t,":before"),n=this.getPseudoElement(t,":after");r&&e.push(r),n&&e.push(n)}return Q(e)},n.prototype.getPseudoElement=function(t,e){var r=t.computedStyle(e);if(!r||!r.content||"none"===r.content||"-moz-alt-content"===r.content||"none"===r.display)return null;for(var n=L(r.content),i="url"===n.substr(0,3),s=document.createElement(i?"img":"html2canvaspseudoelement"),a=new U(s,t,e),l=r.length-1;l>=0;l--){var u=o(r.item(l));s.style[u]=r[u]}if(s.className=U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+" "+U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER,i)return s.src=_(n)[0].args[0],[a];var h=document.createTextNode(n);return s.appendChild(h),[a,new z(h,a)]},n.prototype.getChildren=function(t){return Q([].filter.call(t.node.childNodes,w).map(function(e){var r=[e.nodeType===Node.TEXT_NODE?new z(e,t):new j(e,t)].filter(F);return e.nodeType===Node.ELEMENT_NODE&&r.length&&"TEXTAREA"!==e.tagName?r[0].isElementVisible()?r.concat(this.getChildren(r[0])):[]:r},this))},n.prototype.newStackingContext=function(t,e){var r=new K(e,t.getOpacity(),t.node,t.parent);t.cloneTo(r);var n=e?r.getParentStack(this):r.parent.stack;n.contexts.push(r),t.stack=r},n.prototype.createStackingContexts=function(){this.nodes.forEach(function(t){D(t)&&(this.isRootElement(t)||I(t)||E(t)||this.isBodyWithTransparentRoot(t)||t.hasTransform())?this.newStackingContext(t,!0):D(t)&&(C(t)&&g(t)||B(t)||b(t))?this.newStackingContext(t,!1):t.assignStack(t.parent.stack)},this)},n.prototype.isBodyWithTransparentRoot=function(t){return"BODY"===t.node.nodeName&&t.parent.color("backgroundColor").isTransparent()},n.prototype.isRootElement=function(t){return null===t.parent},n.prototype.sortStackingContexts=function(t){t.contexts.sort(R(t.contexts.slice(0))),t.contexts.forEach(this.sortStackingContexts,this)},n.prototype.parseTextBounds=function(t){return function(e,r,n){if("none"!==t.parent.css("textDecoration").substr(0,4)||0!==e.trim().length){if(this.support.rangeBounds&&!t.parent.hasTransform()){var i=n.slice(0,r).join("").length;return this.getRangeBounds(t.node,i,e.length)}if(t.node&&"string"==typeof t.node.data){var o=t.node.splitText(e.length),s=this.getWrapperBounds(t.node,t.parent.hasTransform());return t.node=o,s}}else(!this.support.rangeBounds||t.parent.hasTransform())&&(t.node=t.node.splitText(e.length));return{}}},n.prototype.getWrapperBounds=function(t,e){var r=t.ownerDocument.createElement("html2canvaswrapper"),n=t.parentNode,i=t.cloneNode(!0);r.appendChild(t.cloneNode(!0)),n.replaceChild(r,t);var o=e?$(r):q(r);return n.replaceChild(i,r),o},n.prototype.getRangeBounds=function(t,e,r){var n=this.range||(this.range=t.ownerDocument.createRange());return n.setStart(t,e),n.setEnd(t,e+r),n.getBoundingClientRect()},n.prototype.parse=function(t){var e=t.contexts.filter(d),r=t.children.filter(D),n=r.filter(T(b)),i=n.filter(T(C)).filter(T(A)),o=r.filter(T(C)).filter(b),a=n.filter(T(C)).filter(A),l=t.contexts.concat(n.filter(C)).filter(g),u=t.children.filter(P).filter(m),h=t.contexts.filter(p);e.concat(i).concat(o).concat(a).concat(l).concat(u).concat(h).forEach(function(t){this.renderQueue.push(t),v(t)&&(this.parse(t),this.renderQueue.push(new s))},this)},n.prototype.paint=function(t){try{t instanceof s?this.renderer.ctx.restore():P(t)?(M(t.parent)&&t.parent.appendToDOM(),this.paintText(t),M(t.parent)&&t.parent.cleanDOM()):this.paintNode(t)}catch(e){if(G(e),this.options.strict)throw e}},n.prototype.paintNode=function(t){v(t)&&(this.renderer.setOpacity(t.opacity),this.renderer.ctx.save(),t.hasTransform()&&this.renderer.setTransform(t.parseTransform())),"INPUT"===t.node.nodeName&&"checkbox"===t.node.type?this.paintCheckbox(t):"INPUT"===t.node.nodeName&&"radio"===t.node.type?this.paintRadio(t):this.paintElement(t)},n.prototype.paintElement=function(t){var e=t.parseBounds();this.renderer.clip(t.backgroundClip,function(){this.renderer.renderBackground(t,e,t.borders.borders.map(O))},this),this.renderer.clip(t.clip,function(){this.renderer.renderBorders(t.borders.borders)},this),this.renderer.clip(t.backgroundClip,function(){switch(t.node.nodeName){case"svg":case"IFRAME":var r=this.images.get(t.node);r?this.renderer.renderImage(t,e,t.borders,r):G("Error loading <"+t.node.nodeName+">",t.node);break;case"IMG":var n=this.images.get(t.node.src);n?this.renderer.renderImage(t,e,t.borders,n):G("Error loading ",t.node.src);break;case"CANVAS":this.renderer.renderImage(t,e,t.borders,{image:t.node});break;case"SELECT":case"INPUT":case"TEXTAREA":this.paintFormValue(t)}},this)},n.prototype.paintCheckbox=function(t){var e=t.parseBounds(),r=Math.min(e.width,e.height),n={width:r-1,height:r-1,top:e.top,left:e.left},i=[3,3],o=[i,i,i,i],s=[1,1,1,1].map(function(t){return{color:new X("#A5A5A5"),width:t}}),l=u(n,o,s);this.renderer.clip(t.backgroundClip,function(){this.renderer.rectangle(n.left+1,n.top+1,n.width-2,n.height-2,new X("#DEDEDE")),this.renderer.renderBorders(a(s,n,l,o)),t.node.checked&&(this.renderer.font(new X("#424242"),"normal","normal","bold",r-3+"px","arial"),this.renderer.text("✔",n.left+r/6,n.top+r-1))},this)},n.prototype.paintRadio=function(t){var e=t.parseBounds(),r=Math.min(e.width,e.height)-2;this.renderer.clip(t.backgroundClip,function(){this.renderer.circleStroke(e.left+1,e.top+1,r,new X("#DEDEDE"),1,new X("#A5A5A5")),t.node.checked&&this.renderer.circle(Math.ceil(e.left+r/4)+1,Math.ceil(e.top+r/4)+1,Math.floor(r/2),new X("#424242"))},this)},n.prototype.paintFormValue=function(t){var e=t.getValue();if(e.length>0){var r=t.node.ownerDocument,n=r.createElement("html2canvaswrapper"),i=["lineHeight","textAlign","fontFamily","fontWeight","fontSize","color","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","borderLeftStyle","borderTopStyle","borderLeftWidth","borderTopWidth","boxSizing","whiteSpace","wordWrap"];i.forEach(function(e){try{n.style[e]=t.css(e)}catch(r){G("html2canvas: Parse: Exception caught in renderFormValue: "+r.message)}});var o=t.parseBounds();n.style.position="fixed",n.style.left=o.left+"px",n.style.top=o.top+"px",n.textContent=e,r.body.appendChild(n),this.paintText(new z(n.firstChild,t)),r.body.removeChild(n)}},n.prototype.paintText=function(t){t.applyTextTransform();var e=Y.ucs2.decode(t.node.data),r=this.options.letterRendering&&!y(t)||k(t.node.data)?e.map(function(t){return Y.ucs2.encode([t])}):N(e),n=t.parent.fontWeight(),i=t.parent.css("fontSize"),o=t.parent.css("fontFamily"),s=t.parent.parseTextShadows();this.renderer.font(t.parent.color("color"),t.parent.css("fontStyle"),t.parent.css("fontVariant"),n,i,o),s.length?this.renderer.fontShadow(s[0].color,s[0].offsetX,s[0].offsetY,s[0].blur):this.renderer.clearShadow(),this.renderer.clip(t.parent.clip,function(){r.map(this.parseTextBounds(t),this).forEach(function(e,n){e&&(this.renderer.text(r[n],e.left,e.bottom),this.renderTextDecoration(t.parent,e,this.fontMetrics.getMetrics(o,i)))},this)},this)},n.prototype.renderTextDecoration=function(t,e,r){switch(t.css("textDecoration").split(" ")[0]){case"underline":this.renderer.rectangle(e.left,Math.round(e.top+r.baseline+r.lineWidth),e.width,1,t.color("color"));break;case"overline":this.renderer.rectangle(e.left,Math.round(e.top),e.width,1,t.color("color"));break;case"line-through":this.renderer.rectangle(e.left,Math.ceil(e.top+r.middle+r.lineWidth),e.width,1,t.color("color"))}};var tt={inset:[["darken",.6],["darken",.1],["darken",.1],["darken",.6]]};n.prototype.parseBorders=function(t){var e=t.parseBounds(),r=x(t),n=["Top","Right","Bottom","Left"].map(function(e,r){var n=t.css("border"+e+"Style"),i=t.color("border"+e+"Color");"inset"===n&&i.isBlack()&&(i=new X([255,255,255,i.a]));var o=tt[n]?tt[n][r]:null;return{width:t.cssInt("border"+e+"Width"),color:o?i[o[0]](o[1]):i,args:null}}),i=u(e,r,n);return{clip:this.parseBackgroundClip(t,i,n,r,e),borders:a(n,e,i,r)}},n.prototype.parseBackgroundClip=function(t,e,r,n,i){var o=t.css("backgroundClip"),s=[];switch(o){case"content-box":case"padding-box":f(s,n[0],n[1],e.topLeftInner,e.topRightInner,i.left+r[3].width,i.top+r[0].width),f(s,n[1],n[2],e.topRightInner,e.bottomRightInner,i.left+i.width-r[1].width,i.top+r[0].width),f(s,n[2],n[3],e.bottomRightInner,e.bottomLeftInner,i.left+i.width-r[1].width,i.top+i.height-r[2].width),f(s,n[3],n[0],e.bottomLeftInner,e.topLeftInner,i.left+r[3].width,i.top+i.height-r[2].width);break;default:f(s,n[0],n[1],e.topLeftOuter,e.topRightOuter,i.left,i.top),f(s,n[1],n[2],e.topRightOuter,e.bottomRightOuter,i.left+i.width,i.top),f(s,n[2],n[3],e.bottomRightOuter,e.bottomLeftOuter,i.left+i.width,i.top+i.height),f(s,n[3],n[0],e.bottomLeftOuter,e.topLeftOuter,i.left,i.top+i.height)}return s},e.exports=n},{"./color":5,"./fontmetrics":9,"./log":15,"./nodecontainer":16,"./promise":18,"./pseudoelementcontainer":21,"./stackingcontext":24,"./textcontainer":28,"./utils":29,punycode:3}],18:[function(t,e,r){e.exports=t("es6-promise").Promise},{"es6-promise":1}],19:[function(t,e,r){function n(t,e,r){var n="withCredentials"in new XMLHttpRequest;if(!e)return h.reject("No proxy configured");var i=s(n),l=a(e,t,i);return n?c(l):o(r,l,i).then(function(t){return g(t.content)})}function i(t,e,r){var n="crossOrigin"in new Image,i=s(n),l=a(e,t,i);return n?h.resolve(l):o(r,l,i).then(function(t){return"data:"+t.type+";base64,"+t.content})}function o(t,e,r){return new h(function(n,i){var o=t.createElement("script"),s=function(){delete window.html2canvas.proxy[r],t.body.removeChild(o)};window.html2canvas.proxy[r]=function(t){s(),n(t)},o.src=e,o.onerror=function(t){s(),i(t)},t.body.appendChild(o)})}function s(t){return t?"":"html2canvas_"+Date.now()+"_"+ ++A+"_"+Math.round(1e5*Math.random())}function a(t,e,r){return t+"?url="+encodeURIComponent(e)+(r.length?"&callback=html2canvas.proxy."+r:"")}function l(t){return function(e){var r,n=new DOMParser;try{r=n.parseFromString(e,"text/html")}catch(i){d("DOMParser not supported, falling back to createHTMLDocument"),r=document.implementation.createHTMLDocument("");try{r.open(),r.write(e),r.close()}catch(o){d("createHTMLDocument write not supported, falling back to document.body.innerHTML"),r.body.innerHTML=e}}var s=r.querySelector("base");if(!s||!s.href.host){var a=r.createElement("base");a.href=t,r.head.insertBefore(a,r.head.firstChild)}return r}}function u(t,e,r,i,o,s){return new n(t,e,window.document).then(l(t)).then(function(t){return p(t,r,i,o,s,0,0)})}var h=t("./promise"),c=t("./xhr"),f=t("./utils"),d=t("./log"),p=t("./clone"),g=f.decode64,A=0;r.Proxy=n,r.ProxyURL=i,r.loadUrlDocument=u},{"./clone":4,"./log":15,"./promise":18,"./utils":29,"./xhr":31}],20:[function(t,e,r){function n(t,e){var r=document.createElement("a");r.href=t,t=r.href,this.src=t,this.image=new Image;var n=this;this.promise=new o(function(r,o){n.image.crossOrigin="Anonymous",n.image.onload=r,n.image.onerror=o,new i(t,e,document).then(function(t){n.image.src=t})["catch"](o)})}var i=t("./proxy").ProxyURL,o=t("./promise");e.exports=n},{"./promise":18,"./proxy":19}],21:[function(t,e,r){function n(t,e,r){i.call(this,t,e),this.isPseudoElement=!0,this.before=":before"===r}var i=t("./nodecontainer");n.prototype.cloneTo=function(t){n.prototype.cloneTo.call(this,t),t.isPseudoElement=!0,t.before=this.before},n.prototype=Object.create(i.prototype),n.prototype.appendToDOM=function(){this.before?this.parent.node.insertBefore(this.node,this.parent.node.firstChild):this.parent.node.appendChild(this.node),this.parent.node.className+=" "+this.getHideClass()},n.prototype.cleanDOM=function(){this.node.parentNode.removeChild(this.node),this.parent.node.className=this.parent.node.className.replace(this.getHideClass(),"")},n.prototype.getHideClass=function(){return this["PSEUDO_HIDE_ELEMENT_CLASS_"+(this.before?"BEFORE":"AFTER")]},n.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE="___html2canvas___pseudoelement_before",n.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER="___html2canvas___pseudoelement_after",e.exports=n},{"./nodecontainer":16}],22:[function(t,e,r){function n(t,e,r,n,i){this.width=t,this.height=e,this.images=r,this.options=n,this.document=i}var i=t("./log");n.prototype.renderImage=function(t,e,r,n){var i=t.cssInt("paddingLeft"),o=t.cssInt("paddingTop"),s=t.cssInt("paddingRight"),a=t.cssInt("paddingBottom"),l=r.borders,u=e.width-(l[1].width+l[3].width+i+s),h=e.height-(l[0].width+l[2].width+o+a);this.drawImage(n,0,0,n.image.width||u,n.image.height||h,e.left+i+l[3].width,e.top+o+l[0].width,u,h)},n.prototype.renderBackground=function(t,e,r){e.height>0&&e.width>0&&(this.renderBackgroundColor(t,e),this.renderBackgroundImage(t,e,r))},n.prototype.renderBackgroundColor=function(t,e){var r=t.color("backgroundColor");r.isTransparent()||this.rectangle(e.left,e.top,e.width,e.height,r)},n.prototype.renderBorders=function(t){t.forEach(this.renderBorder,this)},n.prototype.renderBorder=function(t){t.color.isTransparent()||null===t.args||this.drawShape(t.args,t.color)},n.prototype.renderBackgroundImage=function(t,e,r){ +var n=t.parseBackgroundImages();n.reverse().forEach(function(n,o,s){switch(n.method){case"url":var a=this.images.get(n.args[0]);a?this.renderBackgroundRepeating(t,e,a,s.length-(o+1),r):i("Error loading background-image",n.args[0]);break;case"linear-gradient":case"gradient":var l=this.images.get(n.value);l?this.renderBackgroundGradient(l,e,r):i("Error loading background-image",n.args[0]);break;case"none":break;default:i("Unknown background-image type",n.args[0])}},this)},n.prototype.renderBackgroundRepeating=function(t,e,r,n,i){var o=t.parseBackgroundSize(e,r.image,n),s=t.parseBackgroundPosition(e,r.image,n,o),a=t.parseBackgroundRepeat(n);switch(a){case"repeat-x":case"repeat no-repeat":this.backgroundRepeatShape(r,s,o,e,e.left+i[3],e.top+s.top+i[0],99999,o.height,i);break;case"repeat-y":case"no-repeat repeat":this.backgroundRepeatShape(r,s,o,e,e.left+s.left+i[3],e.top+i[0],o.width,99999,i);break;case"no-repeat":this.backgroundRepeatShape(r,s,o,e,e.left+s.left+i[3],e.top+s.top+i[0],o.width,o.height,i);break;default:this.renderBackgroundRepeat(r,s,o,{top:e.top,left:e.left},i[3],i[0])}},e.exports=n},{"./log":15}],23:[function(t,e,r){function n(t,e){if(this.ratio=a.getDeviceRatio(),t=a.applyRatio(t),e=a.applyRatio(e),o.apply(this,arguments),this.canvas=this.options.canvas||this.document.createElement("canvas"),!this.options.canvas&&(this.canvas.width=t,this.canvas.height=e,1!==this.ratio)){var r=1/this.ratio;this.canvas.style.transform="scaleX("+r+") scaleY("+r+")",this.canvas.style.transformOrigin="0 0"}this.ctx=this.canvas.getContext("2d"),this.taintCtx=this.document.createElement("canvas").getContext("2d"),this.ctx.textBaseline="bottom",this.variables={},l("Initialized CanvasRenderer with size",t,"x",e)}function i(t){return t.length>0}var o=t("../renderer"),s=t("../lineargradientcontainer"),a=t("../utils"),l=t("../log");n.prototype=Object.create(o.prototype),n.prototype.setFillStyle=function(t){return this.ctx.fillStyle="object"==typeof t&&t.isColor?t.toString():t,this.ctx},n.prototype.rectangle=function(t,e,r,n,i){t=a.applyRatio(t),e=a.applyRatio(e),r=a.applyRatio(r),n=a.applyRatio(n),this.setFillStyle(i).fillRect(t,e,r,n)},n.prototype.circle=function(t,e,r,n){this.setFillStyle(n),this.ctx.beginPath(),this.ctx.arc(t+r/2,e+r/2,r/2,0,2*Math.PI,!0),this.ctx.closePath(),this.ctx.fill()},n.prototype.circleStroke=function(t,e,r,n,i,o){t=a.applyRatio(t),e=a.applyRatio(e),r=a.applyRatio(r),this.circle(t,e,r,n),this.ctx.strokeStyle=o.toString(),this.ctx.stroke()},n.prototype.drawShape=function(t,e){t=a.applyRatioToShape(t),this.shape(t),this.setFillStyle(e).fill()},n.prototype.taints=function(t){if(null===t.tainted){this.taintCtx.drawImage(t.image,0,0);try{this.taintCtx.getImageData(0,0,1,1),t.tainted=!1}catch(e){this.taintCtx=document.createElement("canvas").getContext("2d"),t.tainted=!0}}return t.tainted},n.prototype.drawImage=function(t,e,r,n,i,o,s,l,u){o=a.applyRatio(o),s=a.applyRatio(s),l=a.applyRatio(l),u=a.applyRatio(u),(!this.taints(t)||this.options.allowTaint)&&this.ctx.drawImage(t.image,e,r,n,i,o,s,l,u)},n.prototype.clip=function(t,e,r){this.ctx.save(),t.filter(i).forEach(function(t){t=a.applyRatioToShape(t),this.shape(t)},this),e.call(r),this.ctx.restore()},n.prototype.shape=function(t){return this.ctx.beginPath(),t.forEach(function(t,e){"rect"===t[0]?this.ctx.rect.apply(this.ctx,t.slice(1)):this.ctx[0===e?"moveTo":t[0]+"To"].apply(this.ctx,t.slice(1))},this),this.ctx.closePath(),this.ctx},n.prototype.font=function(t,e,r,n,i,o){i=a.applyRatioToFontSize(i),this.setFillStyle(t).font=[e,r,n,i,o].join(" ").split(",")[0]},n.prototype.fontShadow=function(t,e,r,n){e=a.applyRatio(e),r=a.applyRatio(r),this.setVariable("shadowColor",t.toString()).setVariable("shadowOffsetY",e).setVariable("shadowOffsetX",r).setVariable("shadowBlur",n)},n.prototype.clearShadow=function(){this.setVariable("shadowColor","rgba(0,0,0,0)")},n.prototype.setOpacity=function(t){this.ctx.globalAlpha=t},n.prototype.setTransform=function(t){this.ctx.translate(t.origin[0],t.origin[1]),this.ctx.transform.apply(this.ctx,t.matrix),this.ctx.translate(-t.origin[0],-t.origin[1])},n.prototype.setVariable=function(t,e){return this.variables[t]!==e&&(this.variables[t]=this.ctx[t]=e),this},n.prototype.text=function(t,e,r){e=a.applyRatio(e),r=a.applyRatio(r),this.ctx.fillText(t,e,r)},n.prototype.backgroundRepeatShape=function(t,e,r,n,i,o,s,l,u){r=a.applyRatio(r),n=a.applyRatioToBounds(n),i=a.applyRatio(i),o=a.applyRatio(o),s=a.applyRatio(s),l=a.applyRatio(l);var h=[["line",Math.round(i),Math.round(o)],["line",Math.round(i+s),Math.round(o)],["line",Math.round(i+s),Math.round(l+o)],["line",Math.round(i),Math.round(l+o)]];this.clip([h],function(){this.renderBackgroundRepeat(t,e,r,n,u[3],u[0])},this)},n.prototype.renderBackgroundRepeat=function(t,e,r,n,i,o){n=a.applyRatioToBounds(n),r=a.applyRatioToBounds(r),e=a.applyRatioToBounds(e),i=a.applyRatio(i),o=a.applyRatio(o);var s=Math.round(n.left+e.left+i),l=Math.round(n.top+e.top+o);this.setFillStyle(this.ctx.createPattern(this.resizeImage(t,r),"repeat")),this.ctx.translate(s,l),this.ctx.fill(),this.ctx.translate(-s,-l)},n.prototype.renderBackgroundGradient=function(t,e){if(e=a.applyRatioToBounds(e),t instanceof s){var r=this.ctx.createLinearGradient(e.left+e.width*t.x0,e.top+e.height*t.y0,e.left+e.width*t.x1,e.top+e.height*t.y1);t.colorStops.forEach(function(t){r.addColorStop(t.stop,t.color.toString())}),this.rectangle(e.left,e.top,e.width,e.height,r)}},n.prototype.resizeImage=function(t,e){e=a.applyRatioToBounds(e);var r=t.image;if(r.width===e.width&&r.height===e.height)return r;var n,i=document.createElement("canvas");return i.width=e.width,i.height=e.height,n=i.getContext("2d"),n.drawImage(r,0,0,r.width,r.height,0,0,e.width,e.height),i},e.exports=n},{"../lineargradientcontainer":14,"../log":15,"../renderer":22,"../utils":29}],24:[function(t,e,r){function n(t,e,r,n){i.call(this,r,n),this.ownStacking=t,this.contexts=[],this.children=[],this.opacity=(this.parent?this.parent.stack.opacity:1)*e}var i=t("./nodecontainer");n.prototype=Object.create(i.prototype),n.prototype.getParentStack=function(t){var e=this.parent?this.parent.stack:null;return e?e.ownStacking?e:e.getParentStack(t):t.stack},e.exports=n},{"./nodecontainer":16}],25:[function(t,e,r){function n(t){this.rangeBounds=this.testRangeBounds(t),this.cors=this.testCORS(),this.svg=this.testSVG()}n.prototype.testRangeBounds=function(t){var e,r,n,i,o=!1;return t.createRange&&(e=t.createRange(),e.getBoundingClientRect&&(r=t.createElement("boundtest"),r.style.height="123px",r.style.display="block",t.body.appendChild(r),e.selectNode(r),n=e.getBoundingClientRect(),i=n.height,123===i&&(o=!0),t.body.removeChild(r))),o},n.prototype.testCORS=function(){return"undefined"!=typeof(new Image).crossOrigin},n.prototype.testSVG=function(){var t=new Image,e=document.createElement("canvas"),r=e.getContext("2d");t.src="data:image/svg+xml,";try{r.drawImage(t,0,0),e.toDataURL()}catch(n){return!1}return!0},e.exports=n},{}],26:[function(t,e,r){function n(t){this.src=t,this.image=null;var e=this;this.promise=this.hasFabric().then(function(){return e.isInline(t)?i.resolve(e.inlineFormatting(t)):o(t)}).then(function(t){return new i(function(r){window.html2canvas.svg.fabric.loadSVGFromString(t,e.createCanvas.call(e,r))})})}var i=t("./promise"),o=t("./xhr"),s=t("./utils").decode64;n.prototype.hasFabric=function(){return window.html2canvas.svg&&window.html2canvas.svg.fabric?i.resolve():i.reject(new Error("html2canvas.svg.js is not loaded, cannot render svg"))},n.prototype.inlineFormatting=function(t){return/^data:image\/svg\+xml;base64,/.test(t)?this.decode64(this.removeContentType(t)):this.removeContentType(t)},n.prototype.removeContentType=function(t){return t.replace(/^data:image\/svg\+xml(;base64)?,/,"")},n.prototype.isInline=function(t){return/^data:image\/svg\+xml/i.test(t)},n.prototype.createCanvas=function(t){var e=this;return function(r,n){var i=new window.html2canvas.svg.fabric.StaticCanvas("c");e.image=i.lowerCanvasEl,i.setWidth(n.width).setHeight(n.height).add(window.html2canvas.svg.fabric.util.groupSVGElements(r,n)).renderAll(),t(i.lowerCanvasEl)}},n.prototype.decode64=function(t){return"function"==typeof window.atob?window.atob(t):s(t)},e.exports=n},{"./promise":18,"./utils":29,"./xhr":31}],27:[function(t,e,r){function n(t,e){this.src=t,this.image=null;var r=this;this.promise=e?new o(function(e,n){r.image=new Image,r.image.onload=e,r.image.onerror=n,r.image.src="data:image/svg+xml,"+(new XMLSerializer).serializeToString(t),r.image.complete===!0&&e(r.image)}):this.hasFabric().then(function(){return new o(function(e){window.html2canvas.svg.fabric.parseSVGDocument(t,r.createCanvas.call(r,e))})})}var i=t("./svgcontainer"),o=t("./promise");n.prototype=Object.create(i.prototype),e.exports=n},{"./promise":18,"./svgcontainer":26}],28:[function(t,e,r){function n(t,e){o.call(this,t,e)}function i(t,e,r){return t.length>0?e+r.toUpperCase():void 0}var o=t("./nodecontainer");n.prototype=Object.create(o.prototype),n.prototype.applyTextTransform=function(){this.node.data=this.transform(this.parent.css("textTransform"))},n.prototype.transform=function(t){var e=this.node.data;switch(t){case"lowercase":return e.toLowerCase();case"capitalize":return e.replace(/(^|\s|:|-|\(|\))([a-z])/g,i);case"uppercase":return e.toUpperCase();default:return e}},e.exports=n},{"./nodecontainer":16}],29:[function(t,e,r){r.smallImage=function(){return"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"},r.bind=function(t,e){return function(){return t.apply(e,arguments)}},r.decode64=function(t){var e,r,n,i,o,s,a,l,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=t.length,c="";for(e=0;h>e;e+=4)r=u.indexOf(t[e]),n=u.indexOf(t[e+1]),i=u.indexOf(t[e+2]),o=u.indexOf(t[e+3]),s=r<<2|n>>4,a=(15&n)<<4|i>>2,l=(3&i)<<6|o,c+=64===i?String.fromCharCode(s):64===o||-1===o?String.fromCharCode(s,a):String.fromCharCode(s,a,l);return c},r.getBounds=function(t){if(t.getBoundingClientRect){var e=t.getBoundingClientRect(),r=null==t.offsetWidth?e.width:t.offsetWidth;return{top:e.top,bottom:e.bottom||e.top+e.height,right:e.left+r,left:e.left,width:r,height:null==t.offsetHeight?e.height:t.offsetHeight}}return{}},r.offsetBounds=function(t){var e=t.offsetParent?r.offsetBounds(t.offsetParent):{top:0,left:0};return{top:t.offsetTop+e.top,bottom:t.offsetTop+t.offsetHeight+e.top,right:t.offsetLeft+e.left+t.offsetWidth,left:t.offsetLeft+e.left,width:t.offsetWidth,height:t.offsetHeight}},r.parseBackgrounds=function(t){var e,r,n,i,o,s,a,l=" \r\n ",u=[],h=0,c=0,f=function(){e&&('"'===r.substr(0,1)&&(r=r.substr(1,r.length-2)),r&&a.push(r),"-"===e.substr(0,1)&&(i=e.indexOf("-",1)+1)>0&&(n=e.substr(0,i),e=e.substr(i)),u.push({prefix:n,method:e.toLowerCase(),value:o,args:a,image:null})),a=[],e=n=r=o=""};return a=[],e=n=r=o="",t.split("").forEach(function(t){if(!(0===h&&l.indexOf(t)>-1)){switch(t){case'"':s?s===t&&(s=null):s=t;break;case"(":if(s)break;if(0===h)return h=1,void(o+=t);c++;break;case")":if(s)break;if(1===h){if(0===c)return h=0,o+=t,void f();c--}break;case",":if(s)break;if(0===h)return void f();if(1===h&&0===c&&!e.match(/^url$/i))return a.push(r),r="",void(o+=t)}o+=t,0===h?e+=t:r+=t}}),f(),u},r.getDeviceRatio=function(){return window.devicePixelRatio},r.applyRatio=function(t){return t*r.getDeviceRatio()},r.applyRatioToBounds=function(t){t.width=t.width*r.getDeviceRatio(),t.top=t.top*r.getDeviceRatio();try{t.left=t.left*r.getDeviceRatio(),t.height=t.height*r.getDeviceRatio()}catch(e){}return t},r.applyRatioToPosition=function(t){return t.left=t.left*r.getDeviceRatio(),t.height=t.height*r.getDeviceRatio(),bounds},r.applyRatioToShape=function(t){for(var e=0;e0&&e-1 in t}if(!t.jQuery){var r=function(t,e){return new r.fn.init(t,e)};r.isWindow=function(t){return null!=t&&t==t.window},r.type=function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?i[s.call(t)]||"object":typeof t},r.isArray=Array.isArray||function(t){return"array"===r.type(t)},r.isPlainObject=function(t){var e;if(!t||"object"!==r.type(t)||t.nodeType||r.isWindow(t))return!1;try{if(t.constructor&&!o.call(t,"constructor")&&!o.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}for(e in t);return void 0===e||o.call(t,e)},r.each=function(t,r,n){var i,o=0,s=t.length,a=e(t);if(n){if(a)for(;s>o&&(i=r.apply(t[o],n),i!==!1);o++);else for(o in t)if(i=r.apply(t[o],n),i===!1)break}else if(a)for(;s>o&&(i=r.call(t[o],o,t[o]),i!==!1);o++);else for(o in t)if(i=r.call(t[o],o,t[o]),i===!1)break;return t},r.data=function(t,e,i){if(void 0===i){var o=t[r.expando],s=o&&n[o];if(void 0===e)return s;if(s&&e in s)return s[e]}else if(void 0!==e){var o=t[r.expando]||(t[r.expando]=++r.uuid);return n[o]=n[o]||{},n[o][e]=i,i}},r.removeData=function(t,e){var i=t[r.expando],o=i&&n[i];o&&r.each(e,function(t,e){delete o[e]})},r.extend=function(){var t,e,n,i,o,s,a=arguments[0]||{},l=1,u=arguments.length,h=!1;for("boolean"==typeof a&&(h=a,a=arguments[l]||{},l++),"object"!=typeof a&&"function"!==r.type(a)&&(a={}),l===u&&(a=this,l--);u>l;l++)if(null!=(o=arguments[l]))for(i in o)t=a[i],n=o[i],a!==n&&(h&&n&&(r.isPlainObject(n)||(e=r.isArray(n)))?(e?(e=!1,s=t&&r.isArray(t)?t:[]):s=t&&r.isPlainObject(t)?t:{},a[i]=r.extend(h,s,n)):void 0!==n&&(a[i]=n));return a},r.queue=function(t,n,i){function o(t,r){var n=r||[];return null!=t&&(e(Object(t))?!function(t,e){for(var r=+e.length,n=0,i=t.length;r>n;)t[i++]=e[n++];if(r!==r)for(;void 0!==e[n];)t[i++]=e[n++];return t.length=i,t}(n,"string"==typeof t?[t]:t):[].push.call(n,t)),n}if(t){n=(n||"fx")+"queue";var s=r.data(t,n);return i?(!s||r.isArray(i)?s=r.data(t,n,o(i)):s.push(i),s):s||[]}},r.dequeue=function(t,e){r.each(t.nodeType?[t]:t,function(t,n){e=e||"fx";var i=r.queue(n,e),o=i.shift();"inprogress"===o&&(o=i.shift()),o&&("fx"===e&&i.unshift("inprogress"),o.call(n,function(){r.dequeue(n,e)}))})},r.fn=r.prototype={init:function(t){if(t.nodeType)return this[0]=t,this;throw new Error("Not a DOM node.")},offset:function(){var e=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:e.top+(t.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:e.left+(t.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function t(){for(var t=this.offsetParent||document;t&&"html"===!t.nodeType.toLowerCase&&"static"===t.style.position;)t=t.offsetParent;return t||document}var e=this[0],t=t.apply(e),n=this.offset(),i=/^(?:body|html)$/i.test(t.nodeName)?{top:0,left:0}:r(t).offset();return n.top-=parseFloat(e.style.marginTop)||0,n.left-=parseFloat(e.style.marginLeft)||0,t.style&&(i.top+=parseFloat(t.style.borderTopWidth)||0,i.left+=parseFloat(t.style.borderLeftWidth)||0),{top:n.top-i.top,left:n.left-i.left}}};var n={};r.expando="velocity"+(new Date).getTime(),r.uuid=0;for(var i={},o=i.hasOwnProperty,s=i.toString,a="Boolean Number String Function Array Date RegExp Object Error".split(" "),l=0;li;++i){var o=u(r,t,n);if(0===o)return r;var s=l(r,t,n)-e;r-=s/o}return r}function c(){for(var e=0;y>e;++e)C[e]=l(e*x,t,n)}function f(e,r,i){var o,s,a=0;do s=r+(i-r)/2,o=l(s,t,n)-e,o>0?i=s:r=s;while(Math.abs(o)>v&&++a=A?h(e,a):0==l?a:f(e,r,r+x)}function p(){b=!0,(t!=r||n!=i)&&c()}var g=4,A=.001,v=1e-7,m=10,y=11,x=1/(y-1),w="Float32Array"in e;if(4!==arguments.length)return!1;for(var E=0;4>E;++E)if("number"!=typeof arguments[E]||isNaN(arguments[E])||!isFinite(arguments[E]))return!1;t=Math.min(t,1),n=Math.min(n,1),t=Math.max(t,0),n=Math.max(n,0);var C=w?new Float32Array(y):new Array(y),b=!1,B=function(e){return b||p(),t===r&&n===i?e:0===e?0:1===e?1:l(d(e),r,i)};B.getControlPoints=function(){return[{x:t,y:r},{x:n,y:i}]};var T="generateBezier("+[t,r,n,i]+")";return B.toString=function(){return T},B}function u(t,e){var r=t;return g.isString(t)?y.Easings[t]||(r=!1):r=g.isArray(t)&&1===t.length?a.apply(null,t):g.isArray(t)&&2===t.length?x.apply(null,t.concat([e])):g.isArray(t)&&4===t.length?l.apply(null,t):!1,r===!1&&(r=y.Easings[y.defaults.easing]?y.defaults.easing:m),r}function h(t){if(t){var e=(new Date).getTime(),r=y.State.calls.length;r>1e4&&(y.State.calls=i(y.State.calls));for(var o=0;r>o;o++)if(y.State.calls[o]){var a=y.State.calls[o],l=a[0],u=a[2],d=a[3],p=!!d,A=null;d||(d=y.State.calls[o][3]=e-16);for(var v=Math.min((e-d)/u.duration,1),m=0,x=l.length;x>m;m++){var E=l[m],b=E.element;if(s(b)){var B=!1;if(u.display!==n&&null!==u.display&&"none"!==u.display){if("flex"===u.display){var T=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];f.each(T,function(t,e){w.setPropertyValue(b,"display",e)})}w.setPropertyValue(b,"display",u.display)}u.visibility!==n&&"hidden"!==u.visibility&&w.setPropertyValue(b,"visibility",u.visibility);for(var D in E)if("element"!==D){var M,P=E[D],R=g.isString(P.easing)?y.Easings[P.easing]:P.easing;if(1===v)M=P.endValue;else{var I=P.endValue-P.startValue;if(M=P.startValue+I*R(v,u,I),!p&&M===P.currentValue)continue}if(P.currentValue=M,"tween"===D)A=M;else{if(w.Hooks.registered[D]){var S=w.Hooks.getRoot(D),O=s(b).rootPropertyValueCache[S];O&&(P.rootPropertyValue=O)}var F=w.setPropertyValue(b,D,P.currentValue+(0===parseFloat(M)?"":P.unitType),P.rootPropertyValue,P.scrollData);w.Hooks.registered[D]&&(w.Normalizations.registered[S]?s(b).rootPropertyValueCache[S]=w.Normalizations.registered[S]("extract",null,F[1]):s(b).rootPropertyValueCache[S]=F[1]),"transform"===F[0]&&(B=!0)}}u.mobileHA&&s(b).transformCache.translate3d===n&&(s(b).transformCache.translate3d="(0px, 0px, 0px)",B=!0),B&&w.flushTransformCache(b)}}u.display!==n&&"none"!==u.display&&(y.State.calls[o][2].display=!1),u.visibility!==n&&"hidden"!==u.visibility&&(y.State.calls[o][2].visibility=!1),u.progress&&u.progress.call(a[1],a[1],v,Math.max(0,d+u.duration-e),d,A),1===v&&c(o)}}y.State.isTicking&&C(h)}function c(t,e){if(!y.State.calls[t])return!1;for(var r=y.State.calls[t][0],i=y.State.calls[t][1],o=y.State.calls[t][2],a=y.State.calls[t][4],l=!1,u=0,h=r.length;h>u;u++){var c=r[u].element;if(e||o.loop||("none"===o.display&&w.setPropertyValue(c,"display",o.display),"hidden"===o.visibility&&w.setPropertyValue(c,"visibility",o.visibility)),o.loop!==!0&&(f.queue(c)[1]===n||!/\.velocityQueueEntryFlag/i.test(f.queue(c)[1]))&&s(c)){s(c).isAnimating=!1,s(c).rootPropertyValueCache={};var d=!1;f.each(w.Lists.transforms3D,function(t,e){var r=/^scale/.test(e)?1:0,i=s(c).transformCache[e];s(c).transformCache[e]!==n&&new RegExp("^\\("+r+"[^.]").test(i)&&(d=!0,delete s(c).transformCache[e])}),o.mobileHA&&(d=!0,delete s(c).transformCache.translate3d),d&&w.flushTransformCache(c),w.Values.removeClass(c,"velocity-animating")}if(!e&&o.complete&&!o.loop&&u===h-1)try{o.complete.call(i,i)}catch(p){setTimeout(function(){throw p},1)}a&&o.loop!==!0&&a(i),s(c)&&o.loop===!0&&!e&&(f.each(s(c).tweensContainer,function(t,e){/^rotate/.test(t)&&360===parseFloat(e.endValue)&&(e.endValue=0,e.startValue=360),/^backgroundPosition/.test(t)&&100===parseFloat(e.endValue)&&"%"===e.unitType&&(e.endValue=0,e.startValue=100)}),y(c,"reverse",{loop:!0,delay:o.delay})),o.queue!==!1&&f.dequeue(c,o.queue)}y.State.calls[t]=!1;for(var g=0,A=y.State.calls.length;A>g;g++)if(y.State.calls[g]!==!1){l=!0;break}l===!1&&(y.State.isTicking=!1,delete y.State.calls,y.State.calls=[])}var f,d=function(){if(r.documentMode)return r.documentMode;for(var t=7;t>4;t--){var e=r.createElement("div");if(e.innerHTML="",e.getElementsByTagName("span").length)return e=null,t}return n}(),p=function(){var t=0;return e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||function(e){var r,n=(new Date).getTime();return r=Math.max(0,16-(n-t)),t=n+r,setTimeout(function(){e(n+r)},r)}}(),g={isString:function(t){return"string"==typeof t},isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},isFunction:function(t){return"[object Function]"===Object.prototype.toString.call(t)},isNode:function(t){return t&&t.nodeType},isNodeList:function(t){return"object"==typeof t&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(t))&&t.length!==n&&(0===t.length||"object"==typeof t[0]&&t[0].nodeType>0)},isWrapped:function(t){return t&&(t.jquery||e.Zepto&&e.Zepto.zepto.isZ(t))},isSVG:function(t){return e.SVGElement&&t instanceof e.SVGElement},isEmptyObject:function(t){for(var e in t)return!1;return!0}},A=!1;if(t.fn&&t.fn.jquery?(f=t,A=!0):f=e.Velocity.Utilities,8>=d&&!A)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(7>=d)return void(jQuery.fn.velocity=jQuery.fn.animate);var v=400,m="swing",y={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:e.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:r.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:f,Redirects:{},Easings:{},Promise:e.Promise,defaults:{queue:"",duration:v,easing:m,begin:n,complete:n,progress:n,display:n,visibility:n,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},init:function(t){f.data(t,"velocity",{isSVG:g.isSVG(t),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:2,patch:2},debug:!1};e.pageYOffset!==n?(y.State.scrollAnchor=e,y.State.scrollPropertyLeft="pageXOffset",y.State.scrollPropertyTop="pageYOffset"):(y.State.scrollAnchor=r.documentElement||r.body.parentNode||r.body,y.State.scrollPropertyLeft="scrollLeft",y.State.scrollPropertyTop="scrollTop");var x=function(){function t(t){return-t.tension*t.x-t.friction*t.v}function e(e,r,n){var i={x:e.x+n.dx*r,v:e.v+n.dv*r,tension:e.tension,friction:e.friction};return{dx:i.v,dv:t(i)}}function r(r,n){var i={dx:r.v,dv:t(r)},o=e(r,.5*n,i),s=e(r,.5*n,o),a=e(r,n,s),l=1/6*(i.dx+2*(o.dx+s.dx)+a.dx),u=1/6*(i.dv+2*(o.dv+s.dv)+a.dv);return r.x=r.x+l*n,r.v=r.v+u*n,r}return function n(t,e,i){var o,s,a,l={x:-1,v:0,tension:null,friction:null},u=[0],h=0,c=1e-4,f=.016;for(t=parseFloat(t)||500,e=parseFloat(e)||20,i=i||null,l.tension=t,l.friction=e,o=null!==i,o?(h=n(t,e),s=h/i*f):s=f;;)if(a=r(a||l,s),u.push(1+a.x),h+=16,!(Math.abs(a.x)>c&&Math.abs(a.v)>c))break;return o?function(t){return u[t*(u.length-1)|0]}:h}}();y.Easings={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},spring:function(t){return 1-Math.cos(4.5*t*Math.PI)*Math.exp(6*-t)}},f.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(t,e){y.Easings[e[0]]=l.apply(null,e[1])});var w=y.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var t=0;t=d)switch(t){case"name":return"filter";case"extract":var n=r.toString().match(/alpha\(opacity=(.*)\)/i);return r=n?n[1]/100:1;case"inject":return e.style.zoom=1,parseFloat(r)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(r),10)+")"}else switch(t){case"name":return"opacity";case"extract":return r;case"inject":return r}}},register:function(){9>=d||y.State.isGingerbread||(w.Lists.transformsBase=w.Lists.transformsBase.concat(w.Lists.transforms3D));for(var t=0;ti&&(i=1),o=!/(\d)$/i.test(i);break;case"skew":o=!/(deg|\d)$/i.test(i);break;case"rotate":o=!/(deg|\d)$/i.test(i)}return o||(s(r).transformCache[e]="("+i+")"),s(r).transformCache[e]}}}();for(var t=0;t=d||3!==o.split(" ").length||(o+=" 1"),o;case"inject":return 8>=d?4===i.split(" ").length&&(i=i.split(/\s+/).slice(0,3).join(" ")):3===i.split(" ").length&&(i+=" 1"),(8>=d?"rgb":"rgba")+"("+i.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})},SVGAttribute:function(t){var e="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(d||y.State.isAndroid&&!y.State.isChrome)&&(e+="|transform"),new RegExp("^("+e+")$","i").test(t)},prefixCheck:function(t){if(y.State.prefixMatches[t])return[y.State.prefixMatches[t],!0];for(var e=["","Webkit","Moz","ms","O"],r=0,n=e.length;n>r;r++){var i;if(i=0===r?t:e[r]+t.replace(/^\w/,function(t){return t.toUpperCase()}),g.isString(y.State.prefixElement.style[i]))return y.State.prefixMatches[t]=i,[i,!0]}return[t,!1]}},Values:{hexToRgb:function(t){var e,r=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;return t=t.replace(r,function(t,e,r,n){return e+e+r+r+n+n}),e=n.exec(t),e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:[0,0,0]},isCSSNullValue:function(t){return 0==t||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(t)},getUnitType:function(t){return/^(rotate|skew)/i.test(t)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(t)?"":"px"},getDisplayType:function(t){var e=t&&t.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(e)?"inline":/^(li)$/i.test(e)?"list-item":/^(tr)$/i.test(e)?"table-row":/^(table)$/i.test(e)?"table":/^(tbody)$/i.test(e)?"table-row-group":"block"},addClass:function(t,e){t.classList?t.classList.add(e):t.className+=(t.className.length?" ":"")+e},removeClass:function(t,e){t.classList?t.classList.remove(e):t.className=t.className.toString().replace(new RegExp("(^|\\s)"+e.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(t,r,i,o){function a(t,r){function i(){u&&w.setPropertyValue(t,"display","none")}var l=0;if(8>=d)l=f.css(t,r);else{var u=!1;if(/^(width|height)$/.test(r)&&0===w.getPropertyValue(t,"display")&&(u=!0,w.setPropertyValue(t,"display",w.Values.getDisplayType(t))), +!o){if("height"===r&&"border-box"!==w.getPropertyValue(t,"boxSizing").toString().toLowerCase()){var h=t.offsetHeight-(parseFloat(w.getPropertyValue(t,"borderTopWidth"))||0)-(parseFloat(w.getPropertyValue(t,"borderBottomWidth"))||0)-(parseFloat(w.getPropertyValue(t,"paddingTop"))||0)-(parseFloat(w.getPropertyValue(t,"paddingBottom"))||0);return i(),h}if("width"===r&&"border-box"!==w.getPropertyValue(t,"boxSizing").toString().toLowerCase()){var c=t.offsetWidth-(parseFloat(w.getPropertyValue(t,"borderLeftWidth"))||0)-(parseFloat(w.getPropertyValue(t,"borderRightWidth"))||0)-(parseFloat(w.getPropertyValue(t,"paddingLeft"))||0)-(parseFloat(w.getPropertyValue(t,"paddingRight"))||0);return i(),c}}var p;p=s(t)===n?e.getComputedStyle(t,null):s(t).computedStyle?s(t).computedStyle:s(t).computedStyle=e.getComputedStyle(t,null),"borderColor"===r&&(r="borderTopColor"),l=9===d&&"filter"===r?p.getPropertyValue(r):p[r],(""===l||null===l)&&(l=t.style[r]),i()}if("auto"===l&&/^(top|right|bottom|left)$/i.test(r)){var g=a(t,"position");("fixed"===g||"absolute"===g&&/top|left/i.test(r))&&(l=f(t).position()[r]+"px")}return l}var l;if(w.Hooks.registered[r]){var u=r,h=w.Hooks.getRoot(u);i===n&&(i=w.getPropertyValue(t,w.Names.prefixCheck(h)[0])),w.Normalizations.registered[h]&&(i=w.Normalizations.registered[h]("extract",t,i)),l=w.Hooks.extractValue(u,i)}else if(w.Normalizations.registered[r]){var c,p;c=w.Normalizations.registered[r]("name",t),"transform"!==c&&(p=a(t,w.Names.prefixCheck(c)[0]),w.Values.isCSSNullValue(p)&&w.Hooks.templates[r]&&(p=w.Hooks.templates[r][1])),l=w.Normalizations.registered[r]("extract",t,p)}if(!/^[\d-]/.test(l))if(s(t)&&s(t).isSVG&&w.Names.SVGAttribute(r))if(/^(height|width)$/i.test(r))try{l=t.getBBox()[r]}catch(g){l=0}else l=t.getAttribute(r);else l=a(t,w.Names.prefixCheck(r)[0]);return w.Values.isCSSNullValue(l)&&(l=0),y.debug>=2&&console.log("Get "+r+": "+l),l},setPropertyValue:function(t,r,n,i,o){var a=r;if("scroll"===r)o.container?o.container["scroll"+o.direction]=n:"Left"===o.direction?e.scrollTo(n,o.alternateValue):e.scrollTo(o.alternateValue,n);else if(w.Normalizations.registered[r]&&"transform"===w.Normalizations.registered[r]("name",t))w.Normalizations.registered[r]("inject",t,n),a="transform",n=s(t).transformCache[r];else{if(w.Hooks.registered[r]){var l=r,u=w.Hooks.getRoot(r);i=i||w.getPropertyValue(t,u),n=w.Hooks.injectValue(l,n,i),r=u}if(w.Normalizations.registered[r]&&(n=w.Normalizations.registered[r]("inject",t,n),r=w.Normalizations.registered[r]("name",t)),a=w.Names.prefixCheck(r)[0],8>=d)try{t.style[a]=n}catch(h){y.debug&&console.log("Browser does not support ["+n+"] for ["+a+"]")}else if(s(t)&&s(t).isSVG&&w.Names.SVGAttribute(r))t.setAttribute(r,n);else{var c="webgl"===t.renderer?t.styleGL:t.style;c[a]=n}y.debug>=2&&console.log("Set "+r+" ("+a+"): "+n)}return[a,n]},flushTransformCache:function(t){function e(e){return parseFloat(w.getPropertyValue(t,e))}var r="";if((d||y.State.isAndroid&&!y.State.isChrome)&&s(t).isSVG){var n={translate:[e("translateX"),e("translateY")],skewX:[e("skewX")],skewY:[e("skewY")],scale:1!==e("scale")?[e("scale"),e("scale")]:[e("scaleX"),e("scaleY")],rotate:[e("rotateZ"),0,0]};f.each(s(t).transformCache,function(t){/^translate/i.test(t)?t="translate":/^scale/i.test(t)?t="scale":/^rotate/i.test(t)&&(t="rotate"),n[t]&&(r+=t+"("+n[t].join(" ")+") ",delete n[t])})}else{var i,o;f.each(s(t).transformCache,function(e){return i=s(t).transformCache[e],"transformPerspective"===e?(o=i,!0):(9===d&&"rotateZ"===e&&(e="rotate"),void(r+=e+i+" "))}),o&&(r="perspective"+o+" "+r)}w.setPropertyValue(t,"transform",r)}};w.Hooks.register(),w.Normalizations.register(),y.hook=function(t,e,r){var i=n;return t=o(t),f.each(t,function(t,o){if(s(o)===n&&y.init(o),r===n)i===n&&(i=y.CSS.getPropertyValue(o,e));else{var a=y.CSS.setPropertyValue(o,e,r);"transform"===a[0]&&y.CSS.flushTransformCache(o),i=a}}),i};var E=function(){function t(){return a?D.promise||null:l}function i(){function t(t){function c(t,e){var r=n,i=n,s=n;return g.isArray(t)?(r=t[0],!g.isArray(t[1])&&/^[\d-]/.test(t[1])||g.isFunction(t[1])||w.RegEx.isHex.test(t[1])?s=t[1]:(g.isString(t[1])&&!w.RegEx.isHex.test(t[1])||g.isArray(t[1]))&&(i=e?t[1]:u(t[1],a.duration),t[2]!==n&&(s=t[2]))):r=t,e||(i=i||a.easing),g.isFunction(r)&&(r=r.call(o,b,C)),g.isFunction(s)&&(s=s.call(o,b,C)),[r||0,i,s]}function d(t,e){var r,n;return n=(e||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(t){return r=t,""}),r||(r=w.Values.getUnitType(t)),[n,r]}function v(){var t={myParent:o.parentNode||r.body,position:w.getPropertyValue(o,"position"),fontSize:w.getPropertyValue(o,"fontSize")},n=t.position===F.lastPosition&&t.myParent===F.lastParent,i=t.fontSize===F.lastFontSize;F.lastParent=t.myParent,F.lastPosition=t.position,F.lastFontSize=t.fontSize;var a=100,l={};if(i&&n)l.emToPx=F.lastEmToPx,l.percentToPxWidth=F.lastPercentToPxWidth,l.percentToPxHeight=F.lastPercentToPxHeight;else{var u=s(o).isSVG?r.createElementNS("http://www.w3.org/2000/svg","rect"):r.createElement("div");y.init(u),t.myParent.appendChild(u),f.each(["overflow","overflowX","overflowY"],function(t,e){y.CSS.setPropertyValue(u,e,"hidden")}),y.CSS.setPropertyValue(u,"position",t.position),y.CSS.setPropertyValue(u,"fontSize",t.fontSize),y.CSS.setPropertyValue(u,"boxSizing","content-box"),f.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(t,e){y.CSS.setPropertyValue(u,e,a+"%")}),y.CSS.setPropertyValue(u,"paddingLeft",a+"em"),l.percentToPxWidth=F.lastPercentToPxWidth=(parseFloat(w.getPropertyValue(u,"width",null,!0))||1)/a,l.percentToPxHeight=F.lastPercentToPxHeight=(parseFloat(w.getPropertyValue(u,"height",null,!0))||1)/a,l.emToPx=F.lastEmToPx=(parseFloat(w.getPropertyValue(u,"paddingLeft"))||1)/a,t.myParent.removeChild(u)}return null===F.remToPx&&(F.remToPx=parseFloat(w.getPropertyValue(r.body,"fontSize"))||16),null===F.vwToPx&&(F.vwToPx=parseFloat(e.innerWidth)/100,F.vhToPx=parseFloat(e.innerHeight)/100),l.remToPx=F.remToPx,l.vwToPx=F.vwToPx,l.vhToPx=F.vhToPx,y.debug>=1&&console.log("Unit ratios: "+JSON.stringify(l),o),l}if(a.begin&&0===b)try{a.begin.call(p,p)}catch(x){setTimeout(function(){throw x},1)}if("scroll"===M){var E,B,T,P=/^x$/i.test(a.axis)?"Left":"Top",R=parseFloat(a.offset)||0;a.container?g.isWrapped(a.container)||g.isNode(a.container)?(a.container=a.container[0]||a.container,E=a.container["scroll"+P],T=E+f(o).position()[P.toLowerCase()]+R):a.container=null:(E=y.State.scrollAnchor[y.State["scrollProperty"+P]],B=y.State.scrollAnchor[y.State["scrollProperty"+("Left"===P?"Top":"Left")]],T=f(o).offset()[P.toLowerCase()]+R),l={scroll:{rootPropertyValue:!1,startValue:E,currentValue:E,endValue:T,unitType:"",easing:a.easing,scrollData:{container:a.container,direction:P,alternateValue:B}},element:o},y.debug&&console.log("tweensContainer (scroll): ",l.scroll,o)}else if("reverse"===M){if(!s(o).tweensContainer)return void f.dequeue(o,a.queue);"none"===s(o).opts.display&&(s(o).opts.display="auto"),"hidden"===s(o).opts.visibility&&(s(o).opts.visibility="visible"),s(o).opts.loop=!1,s(o).opts.begin=null,s(o).opts.complete=null,m.easing||delete a.easing,m.duration||delete a.duration,a=f.extend({},s(o).opts,a);var I=f.extend(!0,{},s(o).tweensContainer);for(var S in I)if("element"!==S){var O=I[S].startValue;I[S].startValue=I[S].currentValue=I[S].endValue,I[S].endValue=O,g.isEmptyObject(m)||(I[S].easing=a.easing),y.debug&&console.log("reverse tweensContainer ("+S+"): "+JSON.stringify(I[S]),o)}l=I}else if("start"===M){var I;s(o).tweensContainer&&s(o).isAnimating===!0&&(I=s(o).tweensContainer),f.each(A,function(t,e){if(RegExp("^"+w.Lists.colors.join("$|^")+"$").test(t)){var r=c(e,!0),i=r[0],o=r[1],s=r[2];if(w.RegEx.isHex.test(i)){for(var a=["Red","Green","Blue"],l=w.Values.hexToRgb(i),u=s?w.Values.hexToRgb(s):n,h=0;hN;N++){var H={delay:R.delay,progress:R.progress};N===L-1&&(H.display=R.display,H.visibility=R.visibility,H.complete=R.complete),E(p,"reverse",H)}return t()}};y=f.extend(E,y),y.animate=E;var C=e.requestAnimationFrame||p;return y.State.isMobile||r.hidden===n||r.addEventListener("visibilitychange",function(){r.hidden?(C=function(t){return setTimeout(function(){t(!0)},16)},h()):C=e.requestAnimationFrame||p}),t.Velocity=y,t!==e&&(t.fn.velocity=E,t.fn.velocity.defaults=y.defaults),f.each(["Down","Up"],function(t,e){y.Redirects["slide"+e]=function(t,r,i,o,s,a){var l=f.extend({},r),u=l.begin,h=l.complete,c={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""},d={};l.display===n&&(l.display="Down"===e?"inline"===y.CSS.Values.getDisplayType(t)?"inline-block":"block":"none"),l.begin=function(){var r="webgl"===t.renderer?t.styleGL:t.style;u&&u.call(s,s);for(var n in c){d[n]=r[n];var i=y.CSS.getPropertyValue(t,n);c[n]="Down"===e?[i,0]:[0,i]}d.overflow=r.overflow,r.overflow="hidden"},l.complete=function(){for(var t in d)style[t]=d[t];h&&h.call(s,s),a&&a.resolver(s)},y(t,c,l)}}),f.each(["In","Out"],function(t,e){y.Redirects["fade"+e]=function(t,r,i,o,s,a){var l=f.extend({},r),u={opacity:"In"===e?1:0},h=l.complete;i!==o-1?l.complete=l.begin=null:l.complete=function(){h&&h.call(s,s),a&&a.resolver(s)},l.display===n&&(l.display="In"===e?"auto":"none"),y(this,u,l)}}),y}(window.jQuery||window.Zepto||window,window,document)}),function(t){t.HTMLGL=t.HTMLGL||{},t.HTMLGL.util={getterSetter:function(t,e,r,n){Object.defineProperty?Object.defineProperty(t,e,{get:r,set:n}):document.__defineGetter__&&(t.__defineGetter__(e,r),t.__defineSetter__(e,n)),t["get"+e]=r,t["set"+e]=n},emitEvent:function(t,e){var r=new MouseEvent(e.type,e);r.dispatcher="html-gl",e.stopPropagation(),t.dispatchEvent(r)},debounce:function(t,e,r){var n;return function(){var i=this,o=arguments,s=function(){n=null,r||t.apply(i,o)},a=r&&!n;clearTimeout(n),n=setTimeout(s,e),a&&t.apply(i,o)}}}}(window),function(t){var e=function(t){},r=e.prototype;r.getElementByCoordinates=function(e,r){var n,i,o=this;return t.HTMLGL.elements.forEach(function(t){n=document.elementFromPoint(e-parseInt(t.transformObject.translateX||0),r-parseInt(t.transformObject.translateY||0)),o.isChildOf(n,t)&&(i=n)}),i},r.isChildOf=function(t,e){for(var r=t;r;){if(r===e)return!0;r=r.parentNode}return!1},t.HTMLGL.GLElementResolver=e}(window),function(t){HTMLGL=t.HTMLGL=t.HTMLGL||{},HTMLGL.JQ_PLUGIN_NAME="htmlgl",HTMLGL.CUSTOM_ELEMENT_TAG_NAME="html-gl",HTMLGL.READY_EVENT="htmlglReady",HTMLGL.context=void 0,HTMLGL.stage=void 0,HTMLGL.renderer=void 0,HTMLGL.elements=[],HTMLGL.pixelRatio=null,HTMLGL.oldPixelRatio=null,HTMLGL.enabled=!0,HTMLGL.scrollX=0,HTMLGL.scrollY=0;var e=function(){t.HTMLGL.context=this,this.createStage(),this.updateScrollPosition(),this.initListeners(),this.elementResolver=new t.HTMLGL.GLElementResolver(this),document.body?this.initViewer():document.addEventListener("DOMContentLoaded",this.initViewer.bind(this))},r=e.prototype;r.initViewer=function(){this.createViewer(),this.resizeViewer(),this.appendViewer()},r.createViewer=function(){t.HTMLGL.renderer=this.renderer=PIXI.autoDetectRenderer(0,0,{transparent:!0}),this.renderer.view.style.position="fixed",this.renderer.view.style.top="0px",this.renderer.view.style.left="0px",this.renderer.view.style["pointer-events"]="none",this.renderer.view.style.pointerEvents="none"},r.appendViewer=function(){document.body.appendChild(this.renderer.view),requestAnimationFrame(this.redrawStage.bind(this))},r.resizeViewer=function(){var e=this,r=t.innerWidth,n=t.innerHeight;HTMLGL.pixelRatio=window.devicePixelRatio||1,console.log(HTMLGL.pixelRatio),r*=HTMLGL.pixelRatio,n*=HTMLGL.pixelRatio,HTMLGL.pixelRatio!==HTMLGL.oldPixelRatio?(this.disable(),this.updateTextures().then(function(){e.updateScrollPosition(),e.updateElementsPositions();var i=1/HTMLGL.pixelRatio;e.renderer.view.style.transformOrigin="0 0",e.renderer.view.style.webkitTransformOrigin="0 0",e.renderer.view.style.transform="scaleX("+i+") scaleY("+i+")",e.renderer.view.style.webkitTransform="scaleX("+i+") scaleY("+i+")",e.renderer.resize(r,n),this.enable(),t.HTMLGL.renderer.render(t.HTMLGL.stage)})):(this.renderer.view.parentNode&&this.updateTextures(),this.updateElementsPositions(),this.markStageAsChanged()),HTMLGL.oldPixelRatio=HTMLGL.pixelRatio},r.initListeners=function(){t.addEventListener("scroll",this.updateScrollPosition.bind(this)),t.addEventListener("resize",t.HTMLGL.util.debounce(this.resizeViewer,500).bind(this)),t.addEventListener("resize",this.updateElementsPositions.bind(this)),document.addEventListener("click",this.onMouseEvent.bind(this),!0),document.addEventListener("mousemove",this.onMouseEvent.bind(this),!0),document.addEventListener("mouseup",this.onMouseEvent.bind(this),!0),document.addEventListener("mousedown",this.onMouseEvent.bind(this),!0),document.addEventListener("touchstart",this.onMouseEvent.bind(this)),document.addEventListener("touchend",this.onMouseEvent.bind(this))},r.updateScrollPosition=function(){var e={};if(void 0!=window.pageYOffset)e={left:pageXOffset,top:pageYOffset};else{var r,n,i=document,o=i.documentElement,s=i.body;r=o.scrollLeft||s.scrollLeft||0,n=o.scrollTop||s.scrollTop||0,e={left:r,top:n}}this.document.x=-e.left*HTMLGL.pixelRatio,this.document.y=-e.top*HTMLGL.pixelRatio,t.HTMLGL.scrollX=e.left,t.HTMLGL.scrollY=e.top,this.markStageAsChanged()},r.createStage=function(){t.HTMLGL.stage=this.stage=new PIXI.Stage(16777215),t.HTMLGL.document=this.document=new PIXI.DisplayObjectContainer,this.stage.addChild(t.HTMLGL.document)},r.redrawStage=function(){t.HTMLGL.stage.changed&&t.HTMLGL.renderer&&t.HTMLGL.enabled&&(t.HTMLGL.renderer.render(t.HTMLGL.stage),t.HTMLGL.stage.changed=!1)},r.updateTextures=function(){var e=[];return t.HTMLGL.elements.forEach(function(t){e.push(t.updateTexture())}),Promise.all(e)},r.initElements=function(){t.HTMLGL.elements.forEach(function(t){t.init()})},r.updateElementsPositions=function(){t.HTMLGL.elements.forEach(function(t){t.updateBoundingRect(),t.updatePivot(),t.updateSpriteTransform()})},r.onMouseEvent=function(e){var r=e.x||e.pageX,n=e.y||e.pageY,i="html-gl"!==e.dispatcher?this.elementResolver.getElementByCoordinates(r,n):null;i?t.HTMLGL.util.emitEvent(i,e):null},r.markStageAsChanged=function(){t.HTMLGL.stage&&!t.HTMLGL.stage.changed&&(requestAnimationFrame(this.redrawStage),t.HTMLGL.stage.changed=!0)},r.disable=function(){t.HTMLGL.enabled=!0},r.enable=function(){t.HTMLGL.enabled=!1},t.HTMLGL.pixelRatio=window.devicePixelRatio||1,t.HTMLGL.GLContext=e,new e}(window),function(t){var e=function(t,e){this.element=t,this.images=this.element.querySelectorAll("img"),this.callback=e,this.imagesLoaded=this.getImagesLoaded(),this.images.length===this.imagesLoaded?this.onImageLoaded():this.addListeners()},r=e.prototype;r.getImagesLoaded=function(){for(var t=0,e=0;et;t++)n.call(this,this._deferreds[t]);this._deferreds=null}function a(t,e,r,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=r,this.reject=n}function h(t,e,r){var n=!1;try{t(function(t){n||(n=!0,e(t))},function(t){n||(n=!0,r(t))})}catch(i){if(n)return;n=!0,r(i)}}var l=r.immediateFn||"function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)},u=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};r.prototype["catch"]=function(t){return this.then(null,t)},r.prototype.then=function(t,e){var i=this;return new r(function(r,o){n.call(i,new a(t,e,r,o))})},r.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&u(arguments[0])?arguments[0]:arguments);return new r(function(e,r){function n(o,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,function(t){n(o,t)},r)}t[o]=s,0===--i&&e(t)}catch(h){r(h)}}if(0===t.length)return e([]);for(var i=t.length,o=0;on;n++)t[n].then(e,r)})},"undefined"!=typeof module&&module.exports?module.exports=r:t.Promise||(t.Promise=r)}(this),"undefined"==typeof WeakMap&&!function(){var t=Object.defineProperty,e=Date.now()%1e9,r=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")};r.prototype={set:function(e,r){var n=e[this.name];return n&&n[0]===e?n[1]=r:t(e,this.name,{value:[e,r],writable:!0}),this},get:function(t){var e;return(e=t[this.name])&&e[0]===t?e[1]:void 0},"delete":function(t){var e=t[this.name];return e&&e[0]===t?(e[0]=e[1]=void 0,!0):!1},has:function(t){var e=t[this.name];return e?e[0]===t:!1}},window.WeakMap=r}(),window.CustomElements=window.CustomElements||{flags:{}},function(t){var e=t.flags,r=[],n=function(t){r.push(t)},i=function(){r.forEach(function(e){e(t)})};t.addModule=n,t.initializeModules=i,t.hasNative=Boolean(document.registerElement),t.useNative=!e.register&&t.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||HTMLImports.useNative)}(CustomElements),CustomElements.addModule(function(t){function e(t,e){r(t,function(t){return e(t)?!0:void n(t,e)}),n(t,e)}function r(t,e,n){var i=t.firstElementChild;if(!i)for(i=t.firstChild;i&&i.nodeType!==Node.ELEMENT_NODE;)i=i.nextSibling;for(;i;)e(i,n)!==!0&&r(i,e,n),i=i.nextElementSibling;return null}function n(t,r){for(var n=t.shadowRoot;n;)e(n,r),n=n.olderShadowRoot}function i(t,e){s=[],o(t,e),s=null}function o(t,e){if(t=wrap(t),!(s.indexOf(t)>=0)){s.push(t);for(var r,n=t.querySelectorAll("link[rel="+a+"]"),i=0,h=n.length;h>i&&(r=n[i]);i++)r["import"]&&o(r["import"],e);e(t)}}var s,a=window.HTMLImports?HTMLImports.IMPORT_LINK_TYPE:"none";t.forDocumentTree=i,t.forSubtree=e}),CustomElements.addModule(function(t){function e(t){return r(t)||n(t)}function r(e){return t.upgrade(e)?!0:void a(e)}function n(t){x(t,function(t){return r(t)?!0:void 0})}function i(t){a(t),f(t)&&x(t,function(t){a(t)})}function o(t){b.push(t),C||(C=!0,setTimeout(s))}function s(){C=!1;for(var t,e=b,r=0,n=e.length;n>r&&(t=e[r]);r++)t();b=[]}function a(t){E?o(function(){h(t)}):h(t)}function h(t){t.__upgraded__&&(t.attachedCallback||t.detachedCallback)&&!t.__attached&&f(t)&&(t.__attached=!0,t.attachedCallback&&t.attachedCallback())}function l(t){u(t),x(t,function(t){u(t)})}function u(t){E?o(function(){c(t)}):c(t)}function c(t){t.__upgraded__&&(t.attachedCallback||t.detachedCallback)&&t.__attached&&!f(t)&&(t.__attached=!1,t.detachedCallback&&t.detachedCallback())}function f(t){for(var e=t,r=wrap(document);e;){if(e==r)return!0;e=e.parentNode||e.host}}function d(t){if(t.shadowRoot&&!t.shadowRoot.__watched){y.dom&&console.log("watching shadow-root for: ",t.localName);for(var e=t.shadowRoot;e;)A(e),e=e.olderShadowRoot}}function p(t){if(y.dom){var r=t[0];if(r&&"childList"===r.type&&r.addedNodes&&r.addedNodes){for(var n=r.addedNodes[0];n&&n!==document&&!n.host;)n=n.parentNode;var i=n&&(n.URL||n._URL||n.host&&n.host.localName)||"";i=i.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",t.length,i||"")}t.forEach(function(t){"childList"===t.type&&(B(t.addedNodes,function(t){t.localName&&e(t)}),B(t.removedNodes,function(t){t.localName&&l(t)}))}),y.dom&&console.groupEnd()}function g(t){for(t=wrap(t),t||(t=wrap(document));t.parentNode;)t=t.parentNode;var e=t.__observer;e&&(p(e.takeRecords()),s())}function A(t){if(!t.__observer){var e=new MutationObserver(p);e.observe(t,{childList:!0,subtree:!0}),t.__observer=e}}function v(t){t=wrap(t),y.dom&&console.group("upgradeDocument: ",t.baseURI.split("/").pop()),e(t),A(t),y.dom&&console.groupEnd()}function m(t){w(t,v)}var y=t.flags,x=t.forSubtree,w=t.forDocumentTree,E=!window.MutationObserver||window.MutationObserver===window.JsMutationObserver;t.hasPolyfillMutations=E;var C=!1,b=[],B=Array.prototype.forEach.call.bind(Array.prototype.forEach),T=Element.prototype.createShadowRoot;T&&(Element.prototype.createShadowRoot=function(){var t=T.call(this);return CustomElements.watchShadow(this),t}),t.watchShadow=d,t.upgradeDocumentTree=m,t.upgradeSubtree=n,t.upgradeAll=e,t.attachedNode=i,t.takeRecords=g}),CustomElements.addModule(function(t){function e(e){if(!e.__upgraded__&&e.nodeType===Node.ELEMENT_NODE){var n=e.getAttribute("is"),i=t.getRegisteredDefinition(n||e.localName);if(i){if(n&&i.tag==e.localName)return r(e,i);if(!n&&!i["extends"])return r(e,i)}}}function r(e,r){return s.upgrade&&console.group("upgrade:",e.localName),r.is&&e.setAttribute("is",r.is),n(e,r),e.__upgraded__=!0,o(e),t.attachedNode(e),t.upgradeSubtree(e),s.upgrade&&console.groupEnd(),e}function n(t,e){Object.__proto__?t.__proto__=e.prototype:(i(t,e.prototype,e["native"]),t.__proto__=e.prototype)}function i(t,e,r){for(var n={},i=e;i!==r&&i!==HTMLElement.prototype;){for(var o,s=Object.getOwnPropertyNames(i),a=0;o=s[a];a++)n[o]||(Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(i,o)),n[o]=1);i=Object.getPrototypeOf(i)}}function o(t){t.createdCallback&&t.createdCallback()}var s=t.flags;t.upgrade=e,t.upgradeWithDefinition=r,t.implementPrototype=n}),CustomElements.addModule(function(t){function e(e,n){var h=n||{};if(!e)throw new Error("document.registerElement: first argument `name` must not be empty");if(e.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(e)+"'.");if(i(e))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(e)+"'. The type name is invalid.");if(l(e))throw new Error("DuplicateDefinitionError: a type with name '"+String(e)+"' is already registered");return h.prototype||(h.prototype=Object.create(HTMLElement.prototype)),h.__name=e.toLowerCase(),h.lifecycle=h.lifecycle||{},h.ancestry=o(h["extends"]),s(h),a(h),r(h.prototype),u(h.__name,h),h.ctor=c(h),h.ctor.prototype=h.prototype,h.prototype.constructor=h.ctor,t.ready&&A(document),h.ctor}function r(t){if(!t.setAttribute._polyfilled){var e=t.setAttribute;t.setAttribute=function(t,r){n.call(this,t,r,e)};var r=t.removeAttribute;t.removeAttribute=function(t){n.call(this,t,null,r)},t.setAttribute._polyfilled=!0}}function n(t,e,r){t=t.toLowerCase();var n=this.getAttribute(t);r.apply(this,arguments);var i=this.getAttribute(t);this.attributeChangedCallback&&i!==n&&this.attributeChangedCallback(t,n,i)}function i(t){for(var e=0;e=0&&y(n,HTMLElement),n)}function p(t){var e=T.call(this,t);return v(e),e}var g,A=t.upgradeDocumentTree,v=t.upgrade,m=t.upgradeWithDefinition,y=t.implementPrototype,x=t.useNative,w=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],E={},C="http://www.w3.org/1999/xhtml",b=document.createElement.bind(document),B=document.createElementNS.bind(document),T=Node.prototype.cloneNode;g=Object.__proto__||x?function(t,e){return t instanceof e}:function(t,e){for(var r=t;r;){if(r===e.prototype)return!0;r=r.__proto__}return!1},document.registerElement=e,document.createElement=d,document.createElementNS=f,Node.prototype.cloneNode=p,t.registry=E,t["instanceof"]=g,t.reservedTagList=w,t.getRegisteredDefinition=l,document.register=document.registerElement}),function(t){function e(){s(wrap(document)),window.HTMLImports&&(HTMLImports.__importsParsingHook=function(t){s(wrap(t["import"]))}),CustomElements.ready=!0,setTimeout(function(){CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})}var r=t.useNative,n=t.initializeModules,i=/Trident/.test(navigator.userAgent);if(r){var o=function(){};t.watchShadow=o,t.upgrade=o,t.upgradeAll=o,t.upgradeDocumentTree=o,t.upgradeSubtree=o,t.takeRecords=o,t["instanceof"]=function(t,e){return t instanceof e}}else n();var s=t.upgradeDocumentTree;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(t){return t}),i&&"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(t,e){e=e||{};var r=document.createEvent("CustomEvent");return r.initCustomEvent(t,Boolean(e.bubbles),Boolean(e.cancelable),e.detail),r},window.CustomEvent.prototype=window.Event.prototype),"complete"===document.readyState||t.flags.eager)e();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var a=window.HTMLImports&&!HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(a,e)}else e()}(window.CustomElements),!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.PIXI=t()}}(function(){var t;return function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){var h="function"==typeof require&&require;if(!a&&h)return h(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[s]={exports:{}};t[s][0].call(u.exports,function(e){var r=t[s][1][e];return i(r?r:e)},u,u.exports,e,t,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s=t.length&&r())}if(r=r||function(){},!t.length)return r();var o=0;l(t,function(t){e(t,n(i))})},s.forEach=s.each,s.eachSeries=function(t,e,r){if(r=r||function(){},!t.length)return r();var n=0,i=function(){e(t[n],function(e){e?(r(e),r=function(){}):(n+=1,n>=t.length?r():i())})};i()},s.forEachSeries=s.eachSeries,s.eachLimit=function(t,e,r,n){var i=d(e);i.apply(null,[t,r,n])},s.forEachLimit=s.eachLimit;var d=function(t){return function(e,r,n){if(n=n||function(){},!e.length||0>=t)return n();var i=0,o=0,s=0;!function a(){if(i>=e.length)return n();for(;t>s&&o=e.length?n():a())})}()}},p=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.each].concat(e))}},g=function(t,e){return function(){var r=Array.prototype.slice.call(arguments);return e.apply(null,[d(t)].concat(r))}},A=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.eachSeries].concat(e))}},v=function(t,e,r,n){if(e=u(e,function(t,e){return{index:e,value:t}}),n){var i=[];t(e,function(t,e){r(t.value,function(r,n){i[t.index]=n,e(r)})},function(t){n(t,i)})}else t(e,function(t,e){r(t.value,function(t){e(t)})})};s.map=p(v),s.mapSeries=A(v),s.mapLimit=function(t,e,r,n){return m(e)(t,r,n)};var m=function(t){return g(t,v)};s.reduce=function(t,e,r,n){s.eachSeries(t,function(t,n){r(e,t,function(t,r){e=r,n(t)})},function(t){n(t,e)})},s.inject=s.reduce,s.foldl=s.reduce,s.reduceRight=function(t,e,r,n){var i=u(t,function(t){return t}).reverse();s.reduce(i,e,r,n)},s.foldr=s.reduceRight;var y=function(t,e,r,n){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r&&i.push(t),e()})},function(t){n(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.filter=p(y),s.filterSeries=A(y),s.select=s.filter,s.selectSeries=s.filterSeries;var x=function(t,e,r,n){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r||i.push(t),e()})},function(t){n(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.reject=p(x),s.rejectSeries=A(x);var w=function(t,e,r,n){t(e,function(t,e){r(t,function(r){r?(n(t),n=function(){}):e()})},function(t){n()})};s.detect=p(w),s.detectSeries=A(w),s.some=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t&&(r(!0),r=function(){}),n()})},function(t){r(!1)})},s.any=s.some,s.every=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t||(r(!1),r=function(){}),n()})},function(t){r(!0)})},s.all=s.every,s.sortBy=function(t,e,r){s.map(t,function(t,r){e(t,function(e,n){e?r(e):r(null,{value:t,criteria:n})})},function(t,e){if(t)return r(t);var n=function(t,e){var r=t.criteria,n=e.criteria;return n>r?-1:r>n?1:0};r(null,u(e.sort(n),function(t){return t.value}))})},s.auto=function(t,e){e=e||function(){};var r=f(t),n=r.length;if(!n)return e();var i={},o=[],a=function(t){o.unshift(t)},u=function(t){for(var e=0;en;){var o=n+(i-n+1>>>1);r(e,t[o])>=0?n=o:i=o-1}return n}function i(t,e,i,o){return t.started||(t.started=!0),h(e)||(e=[e]),0==e.length?s.setImmediate(function(){t.drain&&t.drain()}):void l(e,function(e){var a={data:e,priority:i,callback:"function"==typeof o?o:null};t.tasks.splice(n(t.tasks,a,r)+1,0,a),t.saturated&&t.tasks.length===t.concurrency&&t.saturated(),s.setImmediate(t.process)})}var o=s.queue(t,e);return o.push=function(t,e,r){i(o,t,e,r)},delete o.unshift,o},s.cargo=function(t,e){var r=!1,n=[],i={tasks:n,payload:e,saturated:null,empty:null,drain:null,drained:!0,push:function(t,r){h(t)||(t=[t]),l(t,function(t){n.push({data:t,callback:"function"==typeof r?r:null}),i.drained=!1,i.saturated&&n.length===e&&i.saturated()}),s.setImmediate(i.process)},process:function o(){if(!r){if(0===n.length)return i.drain&&!i.drained&&i.drain(),void(i.drained=!0);var s="number"==typeof e?n.splice(0,e):n.splice(0,n.length),a=u(s,function(t){return t.data});i.empty&&i.empty(),r=!0,t(a,function(){r=!1;var t=arguments;l(s,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return n.length},running:function(){return r}};return i};var b=function(t){return function(e){var r=Array.prototype.slice.call(arguments,1);e.apply(null,r.concat([function(e){var r=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&l(r,function(e){console[t](e)}))}]))}};s.log=b("log"),s.dir=b("dir"),s.memoize=function(t,e){var r={},n={};e=e||function(t){return t};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=e.apply(null,i);a in r?s.nextTick(function(){o.apply(null,r[a])}):a in n?n[a].push(o):(n[a]=[o],t.apply(null,i.concat([function(){r[a]=arguments;var t=n[a];delete n[a];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,arguments)}])))};return i.memo=r,i.unmemoized=t,i},s.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},s.times=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.map(n,e,r)},s.timesSeries=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.mapSeries(n,e,r)},s.seq=function(){var t=arguments;return function(){var e=this,r=Array.prototype.slice.call(arguments),n=r.pop();s.reduce(t,r,function(t,r,n){r.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);n(t,e)}]))},function(t,r){n.apply(e,[t].concat(r))})}},s.compose=function(){return s.seq.apply(null,Array.prototype.reverse.call(arguments))};var B=function(t,e){var r=function(){var r=this,n=Array.prototype.slice.call(arguments),i=n.pop();return t(e,function(t,e){t.apply(r,n.concat([e]))},i)};if(arguments.length>2){var n=Array.prototype.slice.call(arguments,2);return r.apply(this,n)}return r};s.applyEach=p(B),s.applyEachSeries=A(B),s.forever=function(t,e){function r(n){if(n){if(e)return e(n);throw n}t(r)}r()},"undefined"!=typeof r&&r.exports?r.exports=s:"undefined"!=typeof t&&t.amd?t([],function(){return s}):i.async=s}()}).call(this,e("_process"))},{_process:4}],3:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,i="/"===s.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),o="/"===s(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),o=n(e.split("/")),s=Math.min(i.length,o.length),a=s,h=0;s>h;h++)if(i[h]!==o[h]){a=h;break}for(var l=[],h=a;he&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:4}],4:[function(t,e,r){function n(){if(!a){a=!0;for(var t,e=s.length;e;){t=s,s=[];for(var r=-1;++ri;)e=t.charCodeAt(i++),e>=55296&&56319>=e&&o>i?(r=t.charCodeAt(i++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--)):n.push(e);return n}function l(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=N(t>>>10&1023|55296),t=56320|1023&t),e+=N(t)}).join("")}function u(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:C}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?L(t/D):t>>1,t+=L(t/e);t>Q*B>>1;n+=C)t=L(t/Q);return L(n+(Q+1)*t/(t+T))}function d(t){var e,r,n,i,s,a,h,c,d,p,g=[],A=t.length,v=0,m=P,y=M;for(r=t.lastIndexOf(R),0>r&&(r=0),n=0;r>n;++n)t.charCodeAt(n)>=128&&o("not-basic"),g.push(t.charCodeAt(n));for(i=r>0?r+1:0;A>i;){for(s=v,a=1,h=C;i>=A&&o("invalid-input"),c=u(t.charCodeAt(i++)),(c>=C||c>L((E-v)/a))&&o("overflow"),v+=c*a,d=y>=h?b:h>=y+B?B:h-y,!(d>c);h+=C)p=C-d,a>L(E/p)&&o("overflow"),a*=p;e=g.length+1,y=f(v-s,e,0==s),L(v/e)>E-m&&o("overflow"),m+=L(v/e),v%=e,g.splice(v++,0,m)}return l(g)}function p(t){var e,r,n,i,s,a,l,u,d,p,g,A,v,m,y,x=[];for(t=h(t),A=t.length,e=P,r=0,s=M,a=0;A>a;++a)g=t[a],128>g&&x.push(N(g));for(n=i=x.length,i&&x.push(R);A>n;){for(l=E,a=0;A>a;++a)g=t[a],g>=e&&l>g&&(l=g);for(v=n+1,l-e>L((E-r)/v)&&o("overflow"),r+=(l-e)*v,e=l,a=0;A>a;++a)if(g=t[a],e>g&&++r>E&&o("overflow"),g==e){for(u=r,d=C;p=s>=d?b:d>=s+B?B:d-s,!(p>u);d+=C)y=u-p,m=C-p,x.push(N(c(p+y%m,0))),u=L(y/m);x.push(N(c(u,0))),s=f(r,v,n==i),r=0,++n}++r,++e}return x.join("")}function g(t){return a(t,function(t){return I.test(t)?d(t.slice(4).toLowerCase()):t})}function A(t){return a(t,function(t){return S.test(t)?"xn--"+p(t):t})}var v="object"==typeof n&&n,m="object"==typeof r&&r&&r.exports==v&&r,y="object"==typeof e&&e;(y.global===y||y.window===y)&&(i=y);var x,w,E=2147483647,C=36,b=1,B=26,T=38,D=700,M=72,P=128,R="-",I=/^xn--/,S=/[^ -~]/,O=/\x2E|\u3002|\uFF0E|\uFF61/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Q=C-b,L=Math.floor,N=String.fromCharCode;if(x={version:"1.2.4",ucs2:{decode:h,encode:l},decode:d,encode:p,toASCII:A,toUnicode:g},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return x});else if(v&&!v.nodeType)if(m)m.exports=x;else for(w in x)x.hasOwnProperty(w)&&(v[w]=x[w]);else i.punycode=x}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var h=1e3;o&&"number"==typeof o.maxKeys&&(h=o.maxKeys);var l=t.length;h>0&&l>h&&(l=h);for(var u=0;l>u;++u){var c,f,d,p,g=t[u].replace(a,"%20"),A=g.indexOf(r);A>=0?(c=g.substr(0,A),f=g.substr(A+1)):(c=g,f=""),d=decodeURIComponent(c),p=decodeURIComponent(f),n(s,d)?i(s[d])?s[d].push(p):s[d]=[s[d],p]:s[d]=p}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],7:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n",'"',"`"," ","\r","\n"," "],A=["{","}","|","\\","^","`"].concat(g),v=["'"].concat(A),m=["%","/","?",";","#"].concat(v),y=["/","?","#"],x=255,w=/^[a-z0-9A-Z_-]{0,63}$/,E=/^([a-z0-9A-Z_-]{0,63})(.*)$/,C={ -javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},B={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},T=t("querystring");n.prototype.parse=function(t,e,r){if(!h(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t;n=n.trim();var i=d.exec(n);if(i){i=i[0];var o=i.toLowerCase();this.protocol=o,n=n.substr(i.length)}if(r||i||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===n.substr(0,2);!s||i&&b[i]||(n=n.substr(2),this.slashes=!0)}if(!b[i]&&(s||i&&!B[i])){for(var a=-1,l=0;lu)&&(a=u)}var c,p;p=-1===a?n.lastIndexOf("@"):n.lastIndexOf("@",a),-1!==p&&(c=n.slice(0,p),n=n.slice(p+1),this.auth=decodeURIComponent(c)),a=-1;for(var l=0;lu)&&(a=u)}-1===a&&(a=n.length),this.host=n.slice(0,a),n=n.slice(a),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var A=this.hostname.split(/\./),l=0,D=A.length;D>l;l++){var M=A[l];if(M&&!M.match(w)){for(var P="",R=0,I=M.length;I>R;R++)P+=M.charCodeAt(R)>127?"x":M[R];if(!P.match(w)){var S=A.slice(0,l),O=A.slice(l+1),F=M.match(E);F&&(S.push(F[1]),O.unshift(F[2])),O.length&&(n="/"+O.join(".")+n),this.hostname=S.join(".");break}}}if(this.hostname=this.hostname.length>x?"":this.hostname.toLowerCase(),!g){for(var Q=this.hostname.split("."),L=[],l=0;ll;l++){var G=v[l],Y=encodeURIComponent(G);Y===G&&(Y=escape(G)),n=n.split(G).join(Y)}var j=n.indexOf("#");-1!==j&&(this.hash=n.substr(j),n=n.slice(0,j));var z=n.indexOf("?");if(-1!==z?(this.search=n.substr(z),this.query=n.substr(z+1),e&&(this.query=T.parse(this.query)),n=n.slice(0,z)):e&&(this.search="",this.query={}),n&&(this.pathname=n),B[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var H=this.pathname||"",N=this.search||"";this.path=H+N}return this.href=this.format(),this},n.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=t+this.host:this.hostname&&(i=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&l(this.query)&&Object.keys(this.query).length&&(o=T.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||B[e])&&i!==!1?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),s=s.replace("#","%23"),e+i+r+s+n},n.prototype.resolve=function(t){return this.resolveObject(i(t,!1,!0)).format()},n.prototype.resolveObject=function(t){if(h(t)){var e=new n;e.parse(t,!1,!0),t=e}var r=new n;if(Object.keys(this).forEach(function(t){r[t]=this[t]},this),r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol)return Object.keys(t).forEach(function(e){"protocol"!==e&&(r[e]=t[e])}),B[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r;if(t.protocol&&t.protocol!==r.protocol){if(!B[t.protocol])return Object.keys(t).forEach(function(e){r[e]=t[e]}),r.href=r.format(),r;if(r.protocol=t.protocol,t.host||b[t.protocol])r.pathname=t.pathname;else{for(var i=(t.pathname||"").split("/");i.length&&!(t.host=i.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==i[0]&&i.unshift(""),i.length<2&&i.unshift(""),r.pathname=i.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var o=r.pathname||"",s=r.search||"";r.path=o+s}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var a=r.pathname&&"/"===r.pathname.charAt(0),l=t.host||t.pathname&&"/"===t.pathname.charAt(0),f=l||a||r.host&&t.pathname,d=f,p=r.pathname&&r.pathname.split("/")||[],i=t.pathname&&t.pathname.split("/")||[],g=r.protocol&&!B[r.protocol];if(g&&(r.hostname="",r.port=null,r.host&&(""===p[0]?p[0]=r.host:p.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===i[0]?i[0]=t.host:i.unshift(t.host)),t.host=null),f=f&&(""===i[0]||""===p[0])),l)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,p=i;else if(i.length)p||(p=[]),p.pop(),p=p.concat(i),r.search=t.search,r.query=t.query;else if(!c(t.search)){if(g){r.hostname=r.host=p.shift();var A=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;A&&(r.auth=A.shift(),r.host=r.hostname=A.shift())}return r.search=t.search,r.query=t.query,u(r.pathname)&&u(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!p.length)return r.pathname=null,r.path=r.search?"/"+r.search:null,r.href=r.format(),r;for(var v=p.slice(-1)[0],m=(r.host||t.host)&&("."===v||".."===v)||""===v,y=0,x=p.length;x>=0;x--)v=p[x],"."==v?p.splice(x,1):".."===v?(p.splice(x,1),y++):y&&(p.splice(x,1),y--);if(!f&&!d)for(;y--;y)p.unshift("..");!f||""===p[0]||p[0]&&"/"===p[0].charAt(0)||p.unshift(""),m&&"/"!==p.join("/").substr(-1)&&p.push("");var w=""===p[0]||p[0]&&"/"===p[0].charAt(0);if(g){r.hostname=r.host=w?"":p.length?p.shift():"";var A=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;A&&(r.auth=A.shift(),r.host=r.hostname=A.shift())}return f=f||r.host&&p.length,f&&!w&&p.unshift(""),p.length?r.pathname=p.join("/"):(r.pathname=null,r.path=null),u(r.pathname)&&u(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=p.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{punycode:5,querystring:8}],10:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n=e&&e.length,a=n?e[0]*r:t.length,h=o(t,i(t,0,a,r,!0)),l=[];if(!h)return l;var c,f,d,p,g,A,v;if(n&&(h=u(t,e,h,r)),t.length>80*r){c=d=t[0],f=p=t[1];for(var m=r;a>m;m+=r)g=t[m],A=t[m+1],c>g&&(c=g),f>A&&(f=A),g>d&&(d=g),A>p&&(p=A);v=Math.max(d-c,p-f)}return s(t,h,l,r,c,f,v),l}function i(t,e,r,n,i){var o,s,a,h=0;for(o=e,s=r-n;r>o;o+=n)h+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;if(i===h>0)for(o=e;r>o;o+=n)a=B(o,a);else for(o=r-n;o>=e;o-=n)a=B(o,a);return a}function o(t,e,r){r||(r=e);var n,i=e;do if(n=!1,y(t,i.i,i.next.i)||0===m(t,i.prev.i,i.i,i.next.i)){if(i.prev.next=i.next,i.next.prev=i.prev,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ),i=r=i.prev,i===i.next)return null;n=!0}else i=i.next;while(n||i!==r);return r}function s(t,e,r,n,i,u,c,f){if(e){f||void 0===i||d(t,e,i,u,c);for(var p,g,A=e;e.prev!==e.next;)if(p=e.prev,g=e.next,a(t,e,i,u,c))r.push(p.i/n),r.push(e.i/n),r.push(g.i/n),g.prev=p,p.next=g,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),e=g.next,A=g.next;else if(e=g,e===A){f?1===f?(e=h(t,e,r,n),s(t,e,r,n,i,u,c,2)):2===f&&l(t,e,r,n,i,u,c):s(t,o(t,e),r,n,i,u,c,1);break}}}function a(t,e,r,n,i){var o=e.prev.i,s=e.i,a=e.next.i,h=t[o],l=t[o+1],u=t[s],c=t[s+1],f=t[a],d=t[a+1],p=h*c-l*u,A=h*d-l*f,v=f*c-d*u,m=p-A-v;if(0>=m)return!1;var y,x,w,E,C,b,B,T=d-l,D=h-f,M=l-c,P=u-h;if(void 0!==r){var R=u>h?f>h?h:f:f>u?u:f,I=c>l?d>l?l:d:d>c?c:d,S=h>u?h>f?h:f:u>f?u:f,O=l>c?l>d?l:d:c>d?c:d,F=g(R,I,r,n,i),Q=g(S,O,r,n,i);for(B=e.nextZ;B&&B.z<=Q;)if(y=B.i,B=B.nextZ,y!==o&&y!==a&&(x=t[y],w=t[y+1],E=T*x+D*w-A,E>=0&&(C=M*x+P*w+p,C>=0&&(b=m-E-C,b>=0&&(E&&C||E&&b||C&&b)))))return!1;for(B=e.prevZ;B&&B.z>=F;)if(y=B.i,B=B.prevZ,y!==o&&y!==a&&(x=t[y],w=t[y+1],E=T*x+D*w-A,E>=0&&(C=M*x+P*w+p,C>=0&&(b=m-E-C,b>=0&&(E&&C||E&&b||C&&b)))))return!1}else for(B=e.next.next;B!==e.prev;)if(y=B.i,B=B.next,x=t[y],w=t[y+1],E=T*x+D*w-A,E>=0&&(C=M*x+P*w+p,C>=0&&(b=m-E-C,b>=0&&(E&&C||E&&b||C&&b))))return!1;return!0}function h(t,e,r,n){var i=e;do{var o=i.prev,s=i.next.next;if(o.i!==s.i&&x(t,o.i,i.i,i.next.i,s.i)&&E(t,o,s)&&E(t,s,o)){r.push(o.i/n),r.push(i.i/n),r.push(s.i/n),o.next=s,s.prev=o;var a=i.prevZ,h=i.nextZ&&i.nextZ.nextZ;a&&(a.nextZ=h),h&&(h.prevZ=a),i=e=s}i=i.next}while(i!==e);return i}function l(t,e,r,n,i,a,h){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&v(t,l,u)){var c=b(l,u);return l=o(t,l,l.next),c=o(t,c,c.next),s(t,l,r,n,i,a,h),void s(t,c,r,n,i,a,h)}u=u.next}l=l.next}while(l!==e)}function u(t,e,r,n){var s,a,h,l,u,f=[];for(s=0,a=e.length;a>s;s++)h=e[s]*n,l=a-1>s?e[s+1]*n:t.length,u=o(t,i(t,h,l,n,!1)),u&&f.push(A(t,u));for(f.sort(function(e,r){return t[e.i]-t[r.i]}),s=0;s=t[o+1]){var c=t[i]+(l-t[i+1])*(t[o]-t[i])/(t[o+1]-t[i+1]);h>=c&&c>u&&(u=c,n=t[i]=D?-1:1,P=n,R=1/0;for(s=n.next;s!==P;)f=t[s.i],d=t[s.i+1],p=h-f,p>=0&&f>=m&&(g=(C*f+b*d-w)*M,g>=0&&(A=(B*f+T*d+x)*M,A>=0&&D*M-g-A>=0&&(v=Math.abs(l-d)/p,R>v&&E(t,s,e)&&(n=s,R=v)))),s=s.next;return n}function d(t,e,r,n,i){var o=e;do null===o.z&&(o.z=g(t[o.i],t[o.i+1],r,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,p(o)}function p(t){var e,r,n,i,o,s,a,h,l=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,n=r,a=0,e=0;l>e&&(a++,n=n.nextZ);e++);for(h=l;a>0||h>0&&n;)0===a?(i=n,n=n.nextZ,h--):0!==h&&n?r.z<=n.z?(i=r,r=r.nextZ,a--):(i=n,n=n.nextZ,h--):(i=r,r=r.nextZ,a--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(s>1);return t}function g(t,e,r,n,i){return t=1e3*(t-r)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=1e3*(e-n)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function A(t,e){var r=e,n=e;do t[r.i]0?1:0>i?-1:0}function y(t,e,r){return t[e]===t[r]&&t[e+1]===t[r+1]}function x(t,e,r,n,i){return m(t,e,r,n)!==m(t,e,r,i)&&m(t,n,i,e)!==m(t,n,i,r)}function w(t,e,r,n){var i=e;do{var o=i.i,s=i.next.i;if(o!==r&&s!==r&&o!==n&&s!==n&&x(t,o,s,r,n))return!0;i=i.next}while(i!==e);return!1}function E(t,e,r){return-1===m(t,e.prev.i,e.i,e.next.i)?-1!==m(t,e.i,r.i,e.next.i)&&-1!==m(t,e.i,e.prev.i,r.i):-1===m(t,e.i,r.i,e.prev.i)||-1===m(t,e.i,e.next.i,r.i)}function C(t,e,r,n){var i=e,o=!1,s=(t[r]+t[n])/2,a=(t[r+1]+t[n+1])/2;do{var h=i.i,l=i.next.i;t[h+1]>a!=t[l+1]>a&&s<(t[l]-t[h])*(a-t[h+1])/(t[l+1]-t[h+1])+t[h]&&(o=!o),i=i.next}while(i!==e);return o}function b(t,e){var r=new T(t.i),n=new T(e.i),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function B(t,e){var r=new T(t);return e?(r.next=e.next,r.prev=e,e.next.prev=r,e.next=r):(r.prev=r,r.next=r),r}function T(t){this.i=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null}e.exports=n},{}],11:[function(t,e,r){"use strict";function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function i(){}var o="function"!=typeof Object.create?"~":!1;i.prototype._events=void 0,i.prototype.listeners=function(t,e){var r=o?o+t:t,n=this._events&&this._events[r];if(e)return!!n;if(!n)return[];if(this._events[r].fn)return[this._events[r].fn];for(var i=0,s=this._events[r].length,a=new Array(s);s>i;i++)a[i]=this._events[r][i].fn;return a},i.prototype.emit=function(t,e,r,n,i,s){var a=o?o+t:t;if(!this._events||!this._events[a])return!1;var h,l,u=this._events[a],c=arguments.length;if("function"==typeof u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,n),!0;case 5:return u.fn.call(u.context,e,r,n,i),!0;case 6:return u.fn.call(u.context,e,r,n,i,s),!0}for(l=1,h=new Array(c-1);c>l;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var f,d=u.length;for(l=0;d>l;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),c){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;default:if(!h)for(f=1,h=new Array(c-1);c>f;f++)h[f-1]=arguments[f];u[l].fn.apply(u[l].context,h)}}return!0},i.prototype.on=function(t,e,r){var i=new n(e,r||this),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],i]:this._events[s].push(i):this._events[s]=i,this},i.prototype.once=function(t,e,r){var i=new n(e,r||this,!0),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],i]:this._events[s].push(i):this._events[s]=i,this},i.prototype.removeListener=function(t,e,r,n){var i=o?o+t:t;if(!this._events||!this._events[i])return this;var s=this._events[i],a=[];if(e)if(s.fn)(s.fn!==e||n&&!s.once||r&&s.context!==r)&&a.push(s);else for(var h=0,l=s.length;l>h;h++)(s[h].fn!==e||n&&!s[h].once||r&&s[h].context!==r)&&a.push(s[h]);return a.length?this._events[i]=1===a.length?a[0]:a:delete this._events[i],this},i.prototype.removeAllListeners=function(t){return this._events?(t?delete this._events[o?o+t:t]:this._events=o?{}:Object.create(null),this):this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prototype.setMaxListeners=function(){return this},i.prefixed=o,e.exports=i},{}],12:[function(t,e,r){"use strict";function n(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}e.exports=Object.assign||function(t,e){for(var r,i,o=n(t),s=1;s=t.length&&r())}if(r=r||function(){},!t.length)return r();var o=0;l(t,function(t){e(t,n(i))})},s.forEach=s.each,s.eachSeries=function(t,e,r){if(r=r||function(){},!t.length)return r();var n=0,i=function(){e(t[n],function(e){e?(r(e),r=function(){}):(n+=1,n>=t.length?r():i())})};i()},s.forEachSeries=s.eachSeries,s.eachLimit=function(t,e,r,n){var i=d(e);i.apply(null,[t,r,n])},s.forEachLimit=s.eachLimit;var d=function(t){return function(e,r,n){if(n=n||function(){},!e.length||0>=t)return n();var i=0,o=0,s=0;!function a(){if(i>=e.length)return n();for(;t>s&&o=e.length?n():a())})}()}},p=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.each].concat(e))}},g=function(t,e){return function(){var r=Array.prototype.slice.call(arguments);return e.apply(null,[d(t)].concat(r))}},A=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.eachSeries].concat(e))}},v=function(t,e,r,n){if(e=u(e,function(t,e){return{index:e,value:t}}),n){var i=[];t(e,function(t,e){r(t.value,function(r,n){i[t.index]=n,e(r)})},function(t){n(t,i)})}else t(e,function(t,e){r(t.value,function(t){e(t)})})};s.map=p(v),s.mapSeries=A(v),s.mapLimit=function(t,e,r,n){return m(e)(t,r,n)};var m=function(t){return g(t,v)};s.reduce=function(t,e,r,n){s.eachSeries(t,function(t,n){r(e,t,function(t,r){e=r,n(t)})},function(t){n(t,e)})},s.inject=s.reduce,s.foldl=s.reduce,s.reduceRight=function(t,e,r,n){var i=u(t,function(t){return t}).reverse();s.reduce(i,e,r,n)},s.foldr=s.reduceRight;var y=function(t,e,r,n){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r&&i.push(t),e()})},function(t){n(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.filter=p(y),s.filterSeries=A(y),s.select=s.filter,s.selectSeries=s.filterSeries;var x=function(t,e,r,n){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r||i.push(t),e()})},function(t){n(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.reject=p(x),s.rejectSeries=A(x);var w=function(t,e,r,n){t(e,function(t,e){r(t,function(r){r?(n(t),n=function(){}):e()})},function(t){n()})};s.detect=p(w),s.detectSeries=A(w),s.some=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t&&(r(!0),r=function(){}),n()})},function(t){r(!1)})},s.any=s.some,s.every=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t||(r(!1),r=function(){}),n()})},function(t){r(!0)})},s.all=s.every,s.sortBy=function(t,e,r){s.map(t,function(t,r){e(t,function(e,n){e?r(e):r(null,{value:t,criteria:n})})},function(t,e){if(t)return r(t);var n=function(t,e){var r=t.criteria,n=e.criteria;return n>r?-1:r>n?1:0};r(null,u(e.sort(n),function(t){return t.value}))})},s.auto=function(t,e){e=e||function(){};var r=f(t),n=r.length;if(!n)return e();var i={},o=[],a=function(t){o.unshift(t)},u=function(t){for(var e=0;en;){var o=n+(i-n+1>>>1);r(e,t[o])>=0?n=o:i=o-1}return n}function i(t,e,i,o){return t.started||(t.started=!0),h(e)||(e=[e]),0==e.length?s.setImmediate(function(){t.drain&&t.drain()}):void l(e,function(e){var a={data:e,priority:i,callback:"function"==typeof o?o:null};t.tasks.splice(n(t.tasks,a,r)+1,0,a),t.saturated&&t.tasks.length===t.concurrency&&t.saturated(),s.setImmediate(t.process)})}var o=s.queue(t,e);return o.push=function(t,e,r){i(o,t,e,r)},delete o.unshift,o},s.cargo=function(t,e){var r=!1,n=[],i={tasks:n,payload:e,saturated:null,empty:null,drain:null,drained:!0,push:function(t,r){h(t)||(t=[t]),l(t,function(t){n.push({data:t,callback:"function"==typeof r?r:null}),i.drained=!1,i.saturated&&n.length===e&&i.saturated()}),s.setImmediate(i.process)},process:function o(){if(!r){if(0===n.length)return i.drain&&!i.drained&&i.drain(),void(i.drained=!0);var s="number"==typeof e?n.splice(0,e):n.splice(0,n.length),a=u(s,function(t){return t.data});i.empty&&i.empty(),r=!0,t(a,function(){r=!1;var t=arguments;l(s,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return n.length},running:function(){return r}};return i};var b=function(t){return function(e){var r=Array.prototype.slice.call(arguments,1);e.apply(null,r.concat([function(e){var r=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&l(r,function(e){console[t](e)}))}]))}};s.log=b("log"),s.dir=b("dir"),s.memoize=function(t,e){var r={},n={};e=e||function(t){return t};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=e.apply(null,i);a in r?s.nextTick(function(){o.apply(null,r[a])}):a in n?n[a].push(o):(n[a]=[o],t.apply(null,i.concat([function(){r[a]=arguments;var t=n[a];delete n[a];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,arguments)}])))};return i.memo=r,i.unmemoized=t,i},s.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},s.times=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.map(n,e,r)},s.timesSeries=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.mapSeries(n,e,r)},s.seq=function(){var t=arguments;return function(){var e=this,r=Array.prototype.slice.call(arguments),n=r.pop();s.reduce(t,r,function(t,r,n){r.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);n(t,e)}]))},function(t,r){n.apply(e,[t].concat(r))})}},s.compose=function(){return s.seq.apply(null,Array.prototype.reverse.call(arguments))};var B=function(t,e){var r=function(){var r=this,n=Array.prototype.slice.call(arguments),i=n.pop();return t(e,function(t,e){t.apply(r,n.concat([e]))},i)};if(arguments.length>2){var n=Array.prototype.slice.call(arguments,2);return r.apply(this,n)}return r};s.applyEach=p(B),s.applyEachSeries=A(B),s.forever=function(t,e){function r(n){if(n){if(e)return e(n);throw n}t(r)}r()},"undefined"!=typeof r&&r.exports?r.exports=s:"undefined"!=typeof t&&t.amd?t([],function(){return s}):i.async=s}()}).call(this,e("_process"))},{_process:4}],14:[function(t,e,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],15:[function(t,e,r){function n(t,e){a.call(this),e=e||10,this.baseUrl=t||"",this.progress=0,this.loading=!1,this._progressChunk=0,this._beforeMiddleware=[],this._afterMiddleware=[],this._boundLoadResource=this._loadResource.bind(this),this._boundOnLoad=this._onLoad.bind(this),this._buffer=[],this._numToLoad=0,this._queue=i.queue(this._boundLoadResource,e),this.resources={}}var i=t("async"),o=t("url"),s=t("./Resource"),a=t("eventemitter3");n.prototype=Object.create(a.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.add=n.prototype.enqueue=function(t,e,r,n){if(Array.isArray(t)){for(var i=0;i0)if(this.xhrType===n.XHR_RESPONSE_TYPE.TEXT)this.data=t.responseText;else if(this.xhrType===n.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t.responseText),this.isJson=!0}catch(r){this.error=new Error("Error trying to parse loaded json:",r)}else if(this.xhrType===n.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var i=new DOMParser;this.data=i.parseFromString(t.responseText,"text/xml")}else{var o=document.createElement("div");o.innerHTML=t.responseText,this.data=o}this.isXml=!0}catch(r){this.error=new Error("Error trying to parse loaded xml:",r)}else this.data=t.response||t.responseText;else this.error=new Error("["+t.status+"]"+t.statusText+":"+t.responseURL);this.complete()},n.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";e=e||window.location,l||(l=document.createElement("a")),l.href=t,t=a.parse(l.href);var r=!t.port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&r&&t.protocol===e.protocol?"":"anonymous"},n.prototype._determineXhrType=function(){return n._xhrTypeMap[this._getExtension()]||n.XHR_RESPONSE_TYPE.TEXT},n.prototype._determineLoadType=function(){return n._loadTypeMap[this._getExtension()]||n.LOAD_TYPE.XHR},n.prototype._getExtension=function(){var t,e=this.url;if(this.isDataUrl){var r=e.indexOf("/");t=e.substring(r+1,e.indexOf(";",r))}else{var n=e.indexOf("?");-1!==n&&(e=e.substring(0,n)),t=e.substring(e.lastIndexOf(".")+1)}return t},n.prototype._getMimeFromXhrType=function(t){switch(t){case n.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case n.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case n.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case n.XHR_RESPONSE_TYPE.JSON:return"application/json";case n.XHR_RESPONSE_TYPE.DEFAULT:case n.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},n.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},n.XHR_READY_STATE={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},n.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},n._loadTypeMap={gif:n.LOAD_TYPE.IMAGE,png:n.LOAD_TYPE.IMAGE,bmp:n.LOAD_TYPE.IMAGE,jpg:n.LOAD_TYPE.IMAGE,jpeg:n.LOAD_TYPE.IMAGE,tif:n.LOAD_TYPE.IMAGE,tiff:n.LOAD_TYPE.IMAGE,webp:n.LOAD_TYPE.IMAGE,tga:n.LOAD_TYPE.IMAGE},n._xhrTypeMap={xhtml:n.XHR_RESPONSE_TYPE.DOCUMENT,html:n.XHR_RESPONSE_TYPE.DOCUMENT,htm:n.XHR_RESPONSE_TYPE.DOCUMENT,xml:n.XHR_RESPONSE_TYPE.DOCUMENT,tmx:n.XHR_RESPONSE_TYPE.DOCUMENT,tsx:n.XHR_RESPONSE_TYPE.DOCUMENT,svg:n.XHR_RESPONSE_TYPE.DOCUMENT,gif:n.XHR_RESPONSE_TYPE.BLOB,png:n.XHR_RESPONSE_TYPE.BLOB,bmp:n.XHR_RESPONSE_TYPE.BLOB,jpg:n.XHR_RESPONSE_TYPE.BLOB,jpeg:n.XHR_RESPONSE_TYPE.BLOB,tif:n.XHR_RESPONSE_TYPE.BLOB,tiff:n.XHR_RESPONSE_TYPE.BLOB,webp:n.XHR_RESPONSE_TYPE.BLOB,tga:n.XHR_RESPONSE_TYPE.BLOB,json:n.XHR_RESPONSE_TYPE.JSON,text:n.XHR_RESPONSE_TYPE.TEXT,txt:n.XHR_RESPONSE_TYPE.TEXT},n.setExtensionLoadType=function(t,e){o(n._loadTypeMap,t,e)},n.setExtensionXhrType=function(t,e){o(n._xhrTypeMap,t,e)}},{eventemitter3:14,url:9}],17:[function(t,e,r){e.exports={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encodeBinary:function(t){for(var e,r="",n=new Array(4),i=0,o=0,s=0;i>2,n[1]=(3&e[0])<<4|e[1]>>4,n[2]=(15&e[1])<<2|e[2]>>6,n[3]=63&e[2],s=i-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(o=0;o","Richard Davey "],main:"./src/index.js",homepage:"http://goodboydigital.com/",bugs:"https://github.com/GoodBoyDigital/pixi.js/issues",license:"MIT",repository:{type:"git",url:"https://github.com/GoodBoyDigital/pixi.js.git"},scripts:{start:"gulp && gulp watch",test:"gulp && testem ci",build:"gulp",docs:"jsdoc -c ./gulp/util/jsdoc.conf.json -R README.md"},files:["bin/","src/"],dependencies:{async:"^0.9.0",brfs:"^1.4.0",earcut:"^2.0.1",eventemitter3:"^1.1.0","object-assign":"^2.0.0","resource-loader":"^1.6.1"},devDependencies:{browserify:"^10.2.3",chai:"^3.0.0",del:"^1.2.0",gulp:"^3.9.0","gulp-cached":"^1.1.0","gulp-concat":"^2.5.2","gulp-debug":"^2.0.1","gulp-jshint":"^1.11.0","gulp-mirror":"^0.4.0","gulp-plumber":"^1.0.1","gulp-rename":"^1.2.2","gulp-sourcemaps":"^1.5.2","gulp-uglify":"^1.2.0","gulp-util":"^3.0.5","jaguarjs-jsdoc":"git+https://github.com/davidshimjs/jaguarjs-jsdoc.git",jsdoc:"^3.3.0","jshint-summary":"^0.4.0",minimist:"^1.1.1",mocha:"^2.2.5","require-dir":"^0.3.0","run-sequence":"^1.1.0",testem:"^0.8.3","vinyl-buffer":"^1.0.0","vinyl-source-stream":"^1.1.0",watchify:"^3.2.1"},browserify:{transform:["brfs"]}}},{}],22:[function(t,e,r){var n={VERSION:t("../../package.json").version,PI_2:2*Math.PI,RAD_TO_DEG:180/Math.PI,DEG_TO_RAD:Math.PI/180,TARGET_FPMS:.06,RENDERER_TYPE:{UNKNOWN:0,WEBGL:1,CANVAS:2},BLEND_MODES:{NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},DRAW_MODES:{POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},SCALE_MODES:{DEFAULT:0,LINEAR:0,NEAREST:1},RETINA_PREFIX:/@(.+)x/,RESOLUTION:1,FILTER_RESOLUTION:1,DEFAULT_RENDER_OPTIONS:{view:null,resolution:1,antialias:!1,forceFXAA:!1,autoResize:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1},SHAPES:{POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},SPRITE_BATCH_SIZE:2e3};e.exports=n},{"../../package.json":21}],23:[function(t,e,r){function n(){o.call(this),this.children=[]}var i=t("../math"),o=t("./DisplayObject"),s=t("../textures/RenderTexture"),a=new i.Matrix;n.prototype=Object.create(o.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{width:{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t}},height:{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t}}}),n.prototype.addChild=function(t){return this.addChildAt(t,this.children.length)},n.prototype.addChildAt=function(t,e){if(t===this)return t;if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),t.emit("added",this),t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},n.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),n=this.getChildIndex(e);if(0>r||0>n)throw new Error("swapChildren: Both the supplied DisplayObjects must be children of the caller.");this.children[r]=e,this.children[n]=t}},n.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},n.prototype.setChildIndex=function(t,e){if(0>e||e>=this.children.length)throw new Error("The supplied index is out of bounds");var r=this.getChildIndex(t);this.children.splice(r,1),this.children.splice(e,0,t)},n.prototype.getChildAt=function(t){if(0>t||t>=this.children.length)throw new Error("getChildAt: Supplied index "+t+" does not exist in the child list, or the supplied DisplayObject is not a child of the caller");return this.children[t]},n.prototype.removeChild=function(t){var e=this.children.indexOf(t);return-1!==e?this.removeChildAt(e):void 0},n.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,this.children.splice(t,1),e.emit("removed",this),e},n.prototype.removeChildren=function(t,e){var r=t||0,n="number"==typeof e?e:this.children.length,i=n-r;if(i>0&&n>=i){for(var o=this.children.splice(r,i),s=0;st;++t)this.children[t].updateTransform()}},n.prototype.containerUpdateTransform=n.prototype.updateTransform,n.prototype.getBounds=function(){if(!this._currentBounds){if(0===this.children.length)return i.Rectangle.EMPTY;for(var t,e,r,n=1/0,o=1/0,s=-(1/0),a=-(1/0),h=!1,l=0,u=this.children.length;u>l;++l){var c=this.children[l];c.visible&&(h=!0,t=this.children[l].getBounds(),n=ne?s:e,a=a>r?a:r)}if(!h)return i.Rectangle.EMPTY;var f=this._bounds;f.x=n,f.y=o,f.width=s-n,f.height=a-o,this._currentBounds=f}return this._currentBounds},n.prototype.containerGetBounds=n.prototype.getBounds,n.prototype.getLocalBounds=function(){var t=this.worldTransform;this.worldTransform=i.Matrix.IDENTITY;for(var e=0,r=this.children.length;r>e;++e)this.children[e].updateTransform();return this.worldTransform=t,this._currentBounds=null,this.getBounds(i.Matrix.IDENTITY)},n.prototype.renderWebGL=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var e,r;if(this._mask||this._filters){for(t.currentRenderer.flush(),this._filters&&t.filterManager.pushFilter(this,this._filters),this._mask&&t.maskManager.pushMask(this,this._mask),t.currentRenderer.start(),this._renderWebGL(t),e=0,r=this.children.length;r>e;e++)this.children[e].renderWebGL(t);t.currentRenderer.flush(),this._mask&&t.maskManager.popMask(this,this._mask),this._filters&&t.filterManager.popFilter(),t.currentRenderer.start()}else for(this._renderWebGL(t),e=0,r=this.children.length;r>e;++e)this.children[e].renderWebGL(t)}},n.prototype._renderWebGL=function(t){},n.prototype._renderCanvas=function(t){},n.prototype.renderCanvas=function(t){if(this.visible&&!(this.alpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask,t),this._renderCanvas(t);for(var e=0,r=this.children.length;r>e;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},n.prototype.destroy=function(t){if(o.prototype.destroy.call(this),t)for(var e=0,r=this.children.length;r>e;++e)this.children[e].destroy(t);this.removeChildren(),this.children=null}},{"../math":32,"../textures/RenderTexture":70,"./DisplayObject":24}],24:[function(t,e,r){function n(){s.call(this),this.position=new i.Point,this.scale=new i.Point(1,1),this.pivot=new i.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this.worldTransform=new i.Matrix,this.filterArea=null,this._sr=0,this._cr=1,this._bounds=new i.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cachedObject=null}var i=t("../math"),o=t("../textures/RenderTexture"),s=t("eventemitter3"),a=t("../const"),h=new i.Matrix;n.prototype=Object.create(s.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},worldVisible:{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},mask:{get:function(){return this._mask},set:function(t){this._mask&&(this._mask.renderable=!0),this._mask=t,this._mask&&(this._mask.renderable=!1)}},filters:{get:function(){return this._filters&&this._filters.slice()},set:function(t){this._filters=t&&t.slice()}}}),n.prototype.updateTransform=function(){var t,e,r,n,i,o,s=this.parent.worldTransform,h=this.worldTransform;this.rotation%a.PI_2?(this.rotation!==this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation)),t=this._cr*this.scale.x,e=this._sr*this.scale.x,r=-this._sr*this.scale.y,n=this._cr*this.scale.y,i=this.position.x,o=this.position.y,(this.pivot.x||this.pivot.y)&&(i-=this.pivot.x*t+this.pivot.y*r,o-=this.pivot.x*e+this.pivot.y*n),h.a=t*s.a+e*s.c,h.b=t*s.b+e*s.d,h.c=r*s.a+n*s.c,h.d=r*s.b+n*s.d,h.tx=i*s.a+o*s.c+s.tx,h.ty=i*s.b+o*s.d+s.ty):(t=this.scale.x,n=this.scale.y,i=this.position.x-this.pivot.x*t,o=this.position.y-this.pivot.y*n,h.a=t*s.a,h.b=t*s.b,h.c=n*s.c,h.d=n*s.d,h.tx=i*s.a+o*s.c+s.tx,h.ty=i*s.b+o*s.d+s.ty),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._currentBounds=null},n.prototype.displayObjectUpdateTransform=n.prototype.updateTransform,n.prototype.getBounds=function(t){return i.Rectangle.EMPTY},n.prototype.getLocalBounds=function(){return this.getBounds(i.Matrix.IDENTITY)},n.prototype.toGlobal=function(t){return this.displayObjectUpdateTransform(),this.worldTransform.apply(t)},n.prototype.toLocal=function(t,e){return e&&(t=e.toGlobal(t)),this.displayObjectUpdateTransform(),this.worldTransform.applyInverse(t)},n.prototype.renderWebGL=function(t){},n.prototype.renderCanvas=function(t){},n.prototype.generateTexture=function(t,e,r){var n=this.getLocalBounds(),i=new o(t,0|n.width,0|n.height,e,r);return h.tx=-n.x,h.ty=-n.y,i.render(this,h),i},n.prototype.destroy=function(){this.position=null,this.scale=null,this.pivot=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.worldTransform=null,this.filterArea=null}},{"../const":22,"../math":32,"../textures/RenderTexture":70,eventemitter3:11}],25:[function(t,e,r){function n(){i.call(this),this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this._prevTint=16777215,this.blendMode=u.BLEND_MODES.NORMAL,this.currentPath=null,this._webGL={},this.isMask=!1,this.boundsPadding=0,this._localBounds=new l.Rectangle(0,0,1,1),this.dirty=!0,this.glDirty=!1,this.boundsDirty=!0,this.cachedSpriteDirty=!1}var i=t("../display/Container"),o=t("../textures/Texture"),s=t("../renderers/canvas/utils/CanvasBuffer"),a=t("../renderers/canvas/utils/CanvasGraphics"),h=t("./GraphicsData"),l=t("../math"),u=t("../const"),c=new l.Point;n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{}),n.prototype.clone=function(){var t=new n;t.renderable=this.renderable,t.fillAlpha=this.fillAlpha,t.lineWidth=this.lineWidth,t.lineColor=this.lineColor,t.tint=this.tint,t.blendMode=this.blendMode,t.isMask=this.isMask,t.boundsPadding=this.boundsPadding,t.dirty=this.dirty,t.glDirty=this.glDirty,t.cachedSpriteDirty=this.cachedSpriteDirty;for(var e=0;e=c;++c)u=c/s,i=h+(t-h)*u,o=l+(e-l)*u,a.push(i+(t+(r-t)*u-i)*u,o+(e+(n-e)*u-o)*u);return this.dirty=this.boundsDirty=!0,this},n.prototype.bezierCurveTo=function(t,e,r,n,i,o){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var s,a,h,l,u,c=20,f=this.currentPath.shape.points,d=f[f.length-2],p=f[f.length-1],g=0,A=1;c>=A;++A)g=A/c,s=1-g,a=s*s,h=a*s,l=g*g,u=l*g,f.push(h*d+3*a*g*t+3*s*l*r+u*i,h*p+3*a*g*e+3*s*l*n+u*o);return this.dirty=this.boundsDirty=!0,this},n.prototype.arcTo=function(t,e,r,n,i){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var o=this.currentPath.shape.points,s=o[o.length-2],a=o[o.length-1],h=a-e,l=s-t,u=n-e,c=r-t,f=Math.abs(h*c-l*u);if(1e-8>f||0===i)(o[o.length-2]!==t||o[o.length-1]!==e)&&o.push(t,e);else{var d=h*h+l*l,p=u*u+c*c,g=h*u+l*c,A=i*Math.sqrt(d)/f,v=i*Math.sqrt(p)/f,m=A*g/d,y=v*g/p,x=A*c+v*l,w=A*u+v*h,E=l*(v+m),C=h*(v+m),b=c*(A+y),B=u*(A+y),T=Math.atan2(C-w,E-x),D=Math.atan2(B-w,b-x);this.arc(x+t,w+e,i,T,D,l*u>c*h)}return this.dirty=this.boundsDirty=!0,this},n.prototype.arc=function(t,e,r,n,i,o){if(o=o||!1,n===i)return this;!o&&n>=i?i+=2*Math.PI:o&&i>=n&&(n+=2*Math.PI);var s=o?-1*(n-i):i-n,a=40*Math.ceil(Math.abs(s)/(2*Math.PI));if(0===s)return this;var h=t+Math.cos(n)*r,l=e+Math.sin(n)*r;this.currentPath?o&&this.filling?this.currentPath.shape.points.push(t,e):this.currentPath.shape.points.push(h,l):o&&this.filling?this.moveTo(t,e):this.moveTo(h,l);for(var u=this.currentPath.shape.points,c=s/(2*a),f=2*c,d=Math.cos(c),p=Math.sin(c),g=a-1,A=g%1/g,v=0;g>=v;v++){var m=v+A*v,y=c+n+f*m,x=Math.cos(y),w=-Math.sin(y);u.push((d*x+p*w)*r+t,(d*-w+p*x)*r+e)}return this.dirty=this.boundsDirty=!0,this},n.prototype.beginFill=function(t,e){return this.filling=!0,this.fillColor=t||0,this.fillAlpha=void 0===e?1:e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},n.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},n.prototype.drawRect=function(t,e,r,n){return this.drawShape(new l.Rectangle(t,e,r,n)),this},n.prototype.drawRoundedRect=function(t,e,r,n,i){return this.drawShape(new l.RoundedRectangle(t,e,r,n,i)),this},n.prototype.drawCircle=function(t,e,r){return this.drawShape(new l.Circle(t,e,r)),this},n.prototype.drawEllipse=function(t,e,r,n){return this.drawShape(new l.Ellipse(t,e,r,n)),this},n.prototype.drawPolygon=function(t){var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;rA?A:b,b=b>m?m:b,b=b>x?x:b,B=B>v?v:B,B=B>y?y:B,B=B>w?w:B,E=A>E?A:E,E=m>E?m:E,E=x>E?x:E,C=v>C?v:C,C=y>C?y:C,C=w>C?w:C,this._bounds.x=b,this._bounds.width=E-b,this._bounds.y=B,this._bounds.height=C-B,this._currentBounds=this._bounds}return this._currentBounds},n.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,c);for(var e=this.graphicsData,r=0;rs?s:t,e=s+h>e?s+h:e,r=r>a?a:r,n=a+l>n?a+l:n;else if(d===u.SHAPES.CIRC)s=i.x,a=i.y,h=i.radius+p/2,l=i.radius+p/2,t=t>s-h?s-h:t,e=s+h>e?s+h:e,r=r>a-l?a-l:r,n=a+l>n?a+l:n;else if(d===u.SHAPES.ELIP)s=i.x,a=i.y,h=i.width+p/2,l=i.height+p/2,t=t>s-h?s-h:t,e=s+h>e?s+h:e,r=r>a-l?a-l:r,n=a+l>n?a+l:n;else{o=i.points;for(var g=0;gs-p?s-p:t,e=s+p>e?s+p:e,r=r>a-p?a-p:r,n=a+p>n?a+p:n}}else t=0,e=0,r=0,n=0;var A=this.boundsPadding;this._localBounds.x=t-A,this._localBounds.width=e-t+2*A,this._localBounds.y=r-A,this._localBounds.height=n-r+2*A},n.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var e=new h(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,t);return this.graphicsData.push(e),e.type===u.SHAPES.POLY&&(e.shape.closed=e.shape.closed||this.filling,this.currentPath=e),this.dirty=this.boundsDirty=!0,e},n.prototype.destroy=function(){i.prototype.destroy.apply(this,arguments);for(var t=0;t=6)if(a.points.length<2*this.maximumSimplePolySize){o=this.switchMode(r,0);var h=this.buildPoly(a,o);h||(o=this.switchMode(r,1),this.buildComplexPoly(a,o))}else o=this.switchMode(r,1),this.buildComplexPoly(a,o);a.lineWidth>0&&(o=this.switchMode(r,0),this.buildLine(a,o))}else o=this.switchMode(r,0),a.type===s.SHAPES.RECT?this.buildRectangle(a,o):a.type===s.SHAPES.CIRC||a.type===s.SHAPES.ELIP?this.buildCircle(a,o):a.type===s.SHAPES.RREC&&this.buildRoundedRectangle(a,o);r.lastIndex++}for(n=0;n32e4||r.mode!==e||1===e)&&(r=this.graphicsDataPool.pop()||new l(t.gl),r.mode=e,t.data.push(r))):(r=this.graphicsDataPool.pop()||new l(t.gl),r.mode=e,t.data.push(r)),r.dirty=!0,r},n.prototype.buildRectangle=function(t,e){var r=t.shape,n=r.x,o=r.y,s=r.width,a=r.height;if(t.fill){var h=i.hex2rgb(t.fillColor),l=t.fillAlpha,u=h[0]*l,c=h[1]*l,f=h[2]*l,d=e.points,p=e.indices,g=d.length/6;d.push(n,o),d.push(u,c,f,l),d.push(n+s,o),d.push(u,c,f,l),d.push(n,o+a),d.push(u,c,f,l),d.push(n+s,o+a),d.push(u,c,f,l),p.push(g,g,g+1,g+2,g+3,g+3)}if(t.lineWidth){var A=t.points;t.points=[n,o,n+s,o,n+s,o+a,n,o+a,n,o],this.buildLine(t,e),t.points=A}},n.prototype.buildRoundedRectangle=function(t,e){var r=t.shape,n=r.x,o=r.y,s=r.width,a=r.height,h=r.radius,l=[];if(l.push(n,o+h),this.quadraticBezierCurve(n,o+a-h,n,o+a,n+h,o+a,l),this.quadraticBezierCurve(n+s-h,o+a,n+s,o+a,n+s,o+a-h,l),this.quadraticBezierCurve(n+s,o+h,n+s,o,n+s-h,o,l),this.quadraticBezierCurve(n+h,o,n,o,n,o+h+1e-10,l),t.fill){var c=i.hex2rgb(t.fillColor),f=t.fillAlpha,d=c[0]*f,p=c[1]*f,g=c[2]*f,A=e.points,v=e.indices,m=A.length/6,y=u(l,null,2),x=0;for(x=0;x=v;v++)A=v/p,h=a(t,r,A),l=a(e,n,A),u=a(r,i,A),c=a(n,o,A),f=a(h,u,A),d=a(l,c,A),g.push(f,d);return g},n.prototype.buildCircle=function(t,e){var r,n,o=t.shape,a=o.x,h=o.y;t.type===s.SHAPES.CIRC?(r=o.radius,n=o.radius):(r=o.width,n=o.height);var l=40,u=2*Math.PI/l,c=0;if(t.fill){var f=i.hex2rgb(t.fillColor),d=t.fillAlpha,p=f[0]*d,g=f[1]*d,A=f[2]*d,v=e.points,m=e.indices,y=v.length/6;for(m.push(y),c=0;l+1>c;c++)v.push(a,h,p,g,A,d),v.push(a+Math.sin(u*c)*r,h+Math.cos(u*c)*n,p,g,A,d),m.push(y++,y++);m.push(y-1)}if(t.lineWidth){var x=t.points;for(t.points=[],c=0;l+1>c;c++)t.points.push(a+Math.sin(u*c)*r,h+Math.cos(u*c)*n);this.buildLine(t,e),t.points=x}},n.prototype.buildLine=function(t,e){var r=0,n=t.points;if(0!==n.length){if(t.lineWidth%2)for(r=0;rr;r++)f=n[2*(r-1)],d=n[2*(r-1)+1],p=n[2*r],g=n[2*r+1],A=n[2*(r+1)],v=n[2*(r+1)+1],m=-(d-g),y=f-p,S=Math.sqrt(m*m+y*y),m/=S,y/=S,m*=H,y*=H,x=-(g-v),w=p-A,S=Math.sqrt(x*x+w*w),x/=S,w/=S,x*=H,w*=H,b=-y+d-(-y+g),B=-m+p-(-m+f),T=(-m+f)*(-y+g)-(-m+p)*(-y+d),D=-w+v-(-w+g),M=-x+p-(-x+A),P=(-x+A)*(-w+g)-(-x+p)*(-w+v),R=b*M-D*B,Math.abs(R)<.1?(R+=10.1,O.push(p-m,g-y,Y,j,z,G),O.push(p+m,g+y,Y,j,z,G)):(u=(B*P-M*T)/R,c=(D*T-b*P)/R,I=(u-p)*(u-p)+(c-g)+(c-g),I>19600?(E=m-x,C=y-w,S=Math.sqrt(E*E+C*C),E/=S, -C/=S,E*=H,C*=H,O.push(p-E,g-C),O.push(Y,j,z,G),O.push(p+E,g+C),O.push(Y,j,z,G),O.push(p-E,g-C),O.push(Y,j,z,G),L++):(O.push(u,c),O.push(Y,j,z,G),O.push(p-(u-p),g-(c-g)),O.push(Y,j,z,G)));for(f=n[2*(Q-2)],d=n[2*(Q-2)+1],p=n[2*(Q-1)],g=n[2*(Q-1)+1],m=-(d-g),y=f-p,S=Math.sqrt(m*m+y*y),m/=S,y/=S,m*=H,y*=H,O.push(p-m,g-y),O.push(Y,j,z,G),O.push(p+m,g+y),O.push(Y,j,z,G),F.push(N),r=0;L>r;r++)F.push(N++);F.push(N-1)}},n.prototype.buildComplexPoly=function(t,e){var r=t.points.slice();if(!(r.length<6)){var n=e.indices;e.points=r,e.alpha=t.fillAlpha,e.color=i.hex2rgb(t.fillColor);for(var o,s,a=1/0,h=-(1/0),l=1/0,u=-(1/0),c=0;co?o:a,h=o>h?o:h,l=l>s?s:l,u=s>u?s:u;r.push(a,l,h,l,h,u,a,u);var f=r.length/2;for(c=0;f>c;c++)n.push(c)}},n.prototype.buildPoly=function(t,e){var r=t.points;if(!(r.length<6)){var n=e.points,o=e.indices,s=r.length/2,a=i.hex2rgb(t.fillColor),h=t.fillAlpha,l=a[0]*h,c=a[1]*h,f=a[2]*h,d=u(r,null,2);if(!d)return!1;var p=n.length/6,g=0;for(g=0;gg;g++)n.push(r[2*g],r[2*g+1],l,c,f,h);return!0}}},{"../../const":22,"../../math":32,"../../renderers/webgl/WebGLRenderer":48,"../../renderers/webgl/utils/ObjectRenderer":62,"../../utils":76,"./WebGLGraphicsData":28,earcut:10}],28:[function(t,e,r){function n(t){this.gl=t,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0,this.glPoints=null,this.glIndices=null}n.prototype.constructor=n,e.exports=n,n.prototype.reset=function(){this.points.length=0,this.indices.length=0},n.prototype.upload=function(){var t=this.gl;this.glPoints=new Float32Array(this.points),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.bufferData(t.ARRAY_BUFFER,this.glPoints,t.STATIC_DRAW),this.glIndices=new Uint16Array(this.indices),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.glIndices,t.STATIC_DRAW),this.dirty=!1},n.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.gl.deleteBuffer(this.buffer),this.gl.deleteBuffer(this.indexBuffer),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null}},{}],29:[function(t,e,r){var n=e.exports=Object.assign(t("./const"),t("./math"),{utils:t("./utils"),ticker:t("./ticker"),DisplayObject:t("./display/DisplayObject"),Container:t("./display/Container"),Sprite:t("./sprites/Sprite"),ParticleContainer:t("./particles/ParticleContainer"),SpriteRenderer:t("./sprites/webgl/SpriteRenderer"),ParticleRenderer:t("./particles/webgl/ParticleRenderer"),Text:t("./text/Text"),Graphics:t("./graphics/Graphics"),GraphicsData:t("./graphics/GraphicsData"),GraphicsRenderer:t("./graphics/webgl/GraphicsRenderer"),Texture:t("./textures/Texture"),BaseTexture:t("./textures/BaseTexture"),RenderTexture:t("./textures/RenderTexture"),VideoBaseTexture:t("./textures/VideoBaseTexture"),TextureUvs:t("./textures/TextureUvs"),CanvasRenderer:t("./renderers/canvas/CanvasRenderer"),CanvasGraphics:t("./renderers/canvas/utils/CanvasGraphics"),CanvasBuffer:t("./renderers/canvas/utils/CanvasBuffer"),WebGLRenderer:t("./renderers/webgl/WebGLRenderer"),ShaderManager:t("./renderers/webgl/managers/ShaderManager"),Shader:t("./renderers/webgl/shaders/Shader"),ObjectRenderer:t("./renderers/webgl/utils/ObjectRenderer"),RenderTarget:t("./renderers/webgl/utils/RenderTarget"),AbstractFilter:t("./renderers/webgl/filters/AbstractFilter"),FXAAFilter:t("./renderers/webgl/filters/FXAAFilter"),SpriteMaskFilter:t("./renderers/webgl/filters/SpriteMaskFilter"),autoDetectRenderer:function(t,e,r,i){return t=t||800,e=e||600,!i&&n.utils.isWebGLSupported()?new n.WebGLRenderer(t,e,r):new n.CanvasRenderer(t,e,r)}})},{"./const":22,"./display/Container":23,"./display/DisplayObject":24,"./graphics/Graphics":25,"./graphics/GraphicsData":26,"./graphics/webgl/GraphicsRenderer":27,"./math":32,"./particles/ParticleContainer":38,"./particles/webgl/ParticleRenderer":40,"./renderers/canvas/CanvasRenderer":43,"./renderers/canvas/utils/CanvasBuffer":44,"./renderers/canvas/utils/CanvasGraphics":45,"./renderers/webgl/WebGLRenderer":48,"./renderers/webgl/filters/AbstractFilter":49,"./renderers/webgl/filters/FXAAFilter":50,"./renderers/webgl/filters/SpriteMaskFilter":51,"./renderers/webgl/managers/ShaderManager":55,"./renderers/webgl/shaders/Shader":60,"./renderers/webgl/utils/ObjectRenderer":62,"./renderers/webgl/utils/RenderTarget":64,"./sprites/Sprite":66,"./sprites/webgl/SpriteRenderer":67,"./text/Text":68,"./textures/BaseTexture":69,"./textures/RenderTexture":70,"./textures/Texture":71,"./textures/TextureUvs":72,"./textures/VideoBaseTexture":73,"./ticker":75,"./utils":76}],30:[function(t,e,r){function n(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0}var i=t("./Point");n.prototype.constructor=n,e.exports=n,n.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},n.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},n.prototype.apply=function(t,e){e=e||new i;var r=t.x,n=t.y;return e.x=this.a*r+this.c*n+this.tx,e.y=this.b*r+this.d*n+this.ty,e},n.prototype.applyInverse=function(t,e){e=e||new i;var r=1/(this.a*this.d+this.c*-this.b),n=t.x,o=t.y;return e.x=this.d*r*n+-this.c*r*o+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*o+-this.b*r*n+(-this.ty*this.a+this.tx*this.b)*r,e},n.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},n.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},n.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),n=this.a,i=this.c,o=this.tx;return this.a=n*e-this.b*r,this.b=n*r+this.b*e,this.c=i*e-this.d*r,this.d=i*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},n.prototype.append=function(t){var e=this.a,r=this.b,n=this.c,i=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*r+t.b*i,this.c=t.c*e+t.d*n,this.d=t.c*r+t.d*i,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*r+t.ty*i+this.ty,this},n.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,n=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},n.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,n=this.d,i=this.tx,o=t*n-e*r;return this.a=n/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-n*i)/o,this.ty=-(t*this.ty-e*i)/o,this},n.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},n.prototype.clone=function(){var t=new n;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},n.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},n.IDENTITY=new n,n.TEMP_MATRIX=new n},{"./Point":31}],31:[function(t,e,r){function n(t,e){this.x=t||0,this.y=e||0}n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.x,this.y)},n.prototype.copy=function(t){this.set(t.x,t.y)},n.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},n.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)}},{}],32:[function(t,e,r){e.exports={Point:t("./Point"),Matrix:t("./Matrix"),Circle:t("./shapes/Circle"),Ellipse:t("./shapes/Ellipse"),Polygon:t("./shapes/Polygon"),Rectangle:t("./shapes/Rectangle"),RoundedRectangle:t("./shapes/RoundedRectangle")}},{"./Matrix":30,"./Point":31,"./shapes/Circle":33,"./shapes/Ellipse":34,"./shapes/Polygon":35,"./shapes/Rectangle":36,"./shapes/RoundedRectangle":37}],33:[function(t,e,r){function n(t,e,r){this.x=t||0,this.y=e||0,this.radius=r||0,this.type=o.SHAPES.CIRC}var i=t("./Rectangle"),o=t("../../const");n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.x,this.y,this.radius)},n.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.x-t,n=this.y-e,i=this.radius*this.radius;return r*=r,n*=n,i>=r+n},n.prototype.getBounds=function(){return new i(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}},{"../../const":22,"./Rectangle":36}],34:[function(t,e,r){function n(t,e,r,n){this.x=t||0,this.y=e||0,this.width=r||0,this.height=n||0,this.type=o.SHAPES.ELIP}var i=t("./Rectangle"),o=t("../../const");n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.x,this.y,this.width,this.height)},n.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,n=(e-this.y)/this.height;return r*=r,n*=n,1>=r+n},n.prototype.getBounds=function(){return new i(this.x-this.width,this.y-this.height,this.width,this.height)}},{"../../const":22,"./Rectangle":36}],35:[function(t,e,r){function n(t){var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;rs;s++)n.push(e[s].x,e[s].y);e=n}this.closed=!0,this.points=e,this.type=o.SHAPES.POLY}var i=t("../Point"),o=t("../../const");n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.points.slice())},n.prototype.contains=function(t,e){for(var r=!1,n=this.points.length/2,i=0,o=n-1;n>i;o=i++){var s=this.points[2*i],a=this.points[2*i+1],h=this.points[2*o],l=this.points[2*o+1],u=a>e!=l>e&&(h-s)*(e-a)/(l-a)+s>t;u&&(r=!r)}return r}},{"../../const":22,"../Point":31}],36:[function(t,e,r){function n(t,e,r,n){this.x=t||0,this.y=e||0,this.width=r||0,this.height=n||0,this.type=i.SHAPES.RECT}var i=t("../../const");n.prototype.constructor=n,e.exports=n,n.EMPTY=new n(0,0,0,0),n.prototype.clone=function(){return new n(this.x,this.y,this.width,this.height)},n.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&e=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height?!0:!1}},{"../../const":22}],38:[function(t,e,r){function n(t,e){i.call(this),this._properties=[!1,!0,!1,!1,!1],this._size=t||15e3,this._buffers=null,this._updateStatic=!1,this.interactiveChildren=!1,this.blendMode=o.BLEND_MODES.NORMAL,this.roundPixels=!0,this.setProperties(e)}var i=t("../display/Container"),o=t("../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.setProperties=function(t){t&&(this._properties[0]="scale"in t?!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="alpha"in t?!!t.alpha:this._properties[4])},n.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},n.prototype.renderWebGL=function(t){this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(t.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},n.prototype.addChildAt=function(t,e){if(t===this)return t;if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),this._updateStatic=!0,t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},n.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,this.children.splice(t,1),this._updateStatic=!0,e},n.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,n=!0,i=0,o=0,s=0,a=0;e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;hr;r+=6,n+=4)this.indices[r+0]=n+0,this.indices[r+1]=n+1,this.indices[r+2]=n+2,this.indices[r+3]=n+0,this.indices[r+4]=n+2,this.indices[r+5]=n+3;this.shader=null,this.indexBuffer=null,this.properties=null,this.tempMatrix=new h.Matrix}var i=t("../../renderers/webgl/utils/ObjectRenderer"),o=t("../../renderers/webgl/WebGLRenderer"),s=t("./ParticleShader"),a=t("./ParticleBuffer"),h=t("../../math");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,o.registerPlugin("particle",n),n.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=new s(this.renderer.shaderManager),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.properties=[{attribute:this.shader.attributes.aVertexPosition,dynamic:!1,size:2,uploadFunction:this.uploadVertices,offset:0},{attribute:this.shader.attributes.aPositionCoord,dynamic:!0,size:2,uploadFunction:this.uploadPosition,offset:0},{attribute:this.shader.attributes.aRotation,dynamic:!1,size:1,uploadFunction:this.uploadRotation,offset:0},{attribute:this.shader.attributes.aTextureCoord,dynamic:!1,size:2,uploadFunction:this.uploadUvs,offset:0},{attribute:this.shader.attributes.aColor,dynamic:!1,size:1,uploadFunction:this.uploadAlpha,offset:0}]},n.prototype.start=function(){var t=this.renderer.gl;t.activeTexture(t.TEXTURE0),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.shader;this.renderer.shaderManager.setShader(e)},n.prototype.render=function(t){var e=t.children,r=e.length,n=t._size;if(0!==r){r>n&&(r=n),t._buffers||(t._buffers=this.generateBuffers(t)),this.renderer.blendModeManager.setBlendMode(t.blendMode);var i=this.renderer.gl,o=t.worldTransform.copy(this.tempMatrix);o.prepend(this.renderer.currentRenderTarget.projectionMatrix),i.uniformMatrix3fv(this.shader.uniforms.projectionMatrix._location,!1,o.toArray(!0)),i.uniform1f(this.shader.uniforms.uAlpha._location,t.worldAlpha);var s=t._updateStatic,a=e[0]._texture.baseTexture;if(a._glTextures[i.id])i.bindTexture(i.TEXTURE_2D,a._glTextures[i.id]);else{if(!this.renderer.updateTexture(a))return;this.properties[0].dynamic&&this.properties[3].dynamic||(s=!0)}for(var h=0,l=0;r>l;l+=this.size){var u=r-l;u>this.size&&(u=this.size);var c=t._buffers[h++];c.uploadDynamic(e,l,u),s&&c.uploadStatic(e,l,u),c.bind(this.shader),i.drawElements(i.TRIANGLES,6*u,i.UNSIGNED_SHORT,0),this.renderer.drawCount++}t._updateStatic=!1}},n.prototype.generateBuffers=function(t){var e,r=this.renderer.gl,n=[],i=t._size;for(e=0;ee;e+=this.size)n.push(new a(r,this.properties,this.size,this.shader));return n},n.prototype.uploadVertices=function(t,e,r,n,i,o){for(var s,a,h,l,u,c,f,d,p,g=0;r>g;g++)s=t[e+g],a=s._texture,l=s.scale.x,u=s.scale.y,a.trim?(h=a.trim,f=h.x-s.anchor.x*h.width,c=f+a.crop.width,p=h.y-s.anchor.y*h.height,d=p+a.crop.height):(c=a._frame.width*(1-s.anchor.x),f=a._frame.width*-s.anchor.x,d=a._frame.height*(1-s.anchor.y),p=a._frame.height*-s.anchor.y),n[o]=f*l,n[o+1]=p*u,n[o+i]=c*l,n[o+i+1]=p*u,n[o+2*i]=c*l,n[o+2*i+1]=d*u,n[o+3*i]=f*l,n[o+3*i+1]=d*u,o+=4*i},n.prototype.uploadPosition=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s].position;n[o]=a.x,n[o+1]=a.y,n[o+i]=a.x,n[o+i+1]=a.y,n[o+2*i]=a.x,n[o+2*i+1]=a.y,n[o+3*i]=a.x,n[o+3*i+1]=a.y,o+=4*i}},n.prototype.uploadRotation=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s].rotation;n[o]=a,n[o+i]=a,n[o+2*i]=a,n[o+3*i]=a,o+=4*i}},n.prototype.uploadUvs=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s]._texture._uvs;a?(n[o]=a.x0,n[o+1]=a.y0,n[o+i]=a.x1,n[o+i+1]=a.y1,n[o+2*i]=a.x2,n[o+2*i+1]=a.y2,n[o+3*i]=a.x3,n[o+3*i+1]=a.y3,o+=4*i):(n[o]=0,n[o+1]=0,n[o+i]=0,n[o+i+1]=0,n[o+2*i]=0,n[o+2*i+1]=0,n[o+3*i]=0,n[o+3*i+1]=0,o+=4*i)}},n.prototype.uploadAlpha=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s].alpha;n[o]=a,n[o+i]=a,n[o+2*i]=a,n[o+3*i]=a,o+=4*i}},n.prototype.destroy=function(){this.renderer.gl&&this.renderer.gl.deleteBuffer(this.indexBuffer),i.prototype.destroy.apply(this,arguments),this.shader.destroy(),this.indices=null,this.tempMatrix=null}},{"../../math":32,"../../renderers/webgl/WebGLRenderer":48,"../../renderers/webgl/utils/ObjectRenderer":62,"./ParticleBuffer":39,"./ParticleShader":41}],41:[function(t,e,r){function n(t){i.call(this,t,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void){"," vec2 v = aVertexPosition;"," v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);"," v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);"," v = v + aPositionCoord;"," gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","uniform float uAlpha;","void main(void){"," vec4 color = texture2D(uSampler, vTextureCoord) * vColor * uAlpha;"," if (color.a == 0.0) discard;"," gl_FragColor = color;","}"].join("\n"),{uAlpha:{type:"1f",value:1}},{aPositionCoord:0,aRotation:0})}var i=t("../../renderers/webgl/shaders/TextureShader");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n},{"../../renderers/webgl/shaders/TextureShader":61}],42:[function(t,e,r){function n(t,e,r,n){if(a.call(this),i.sayHello(t),n)for(var h in s.DEFAULT_RENDER_OPTIONS)"undefined"==typeof n[h]&&(n[h]=s.DEFAULT_RENDER_OPTIONS[h]);else n=s.DEFAULT_RENDER_OPTIONS;this.type=s.RENDERER_TYPE.UNKNOWN,this.width=e||800,this.height=r||600,this.view=n.view||document.createElement("canvas"),this.resolution=n.resolution,this.transparent=n.transparent,this.autoResize=n.autoResize||!1,this.blendModes=null,this.preserveDrawingBuffer=n.preserveDrawingBuffer,this.clearBeforeRender=n.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgb=[0,0,0],this._backgroundColorString="#000000",this.backgroundColor=n.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent={worldTransform:new o.Matrix,worldAlpha:1,children:[]},this._lastObjectRendered=this._tempDisplayObjectParent}var i=t("../utils"),o=t("../math"),s=t("../const"),a=t("eventemitter3");n.prototype=Object.create(a.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{backgroundColor:{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=i.hex2string(t),i.hex2rgb(t,this._backgroundColorRgb)}}}),n.prototype.resize=function(t,e){this.width=t*this.resolution,this.height=e*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px")},n.prototype.destroy=function(t){t&&this.view.parent&&this.view.parent.removeChild(this.view),this.type=s.RENDERER_TYPE.UNKNOWN,this.width=0,this.height=0,this.view=null,this.resolution=0,this.transparent=!1,this.autoResize=!1,this.blendModes=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgb=null,this._backgroundColorString=null}},{"../const":22,"../math":32,"../utils":76,eventemitter3:11}],43:[function(t,e,r){function n(t,e,r){i.call(this,"Canvas",t,e,r),this.type=h.RENDERER_TYPE.CANVAS,this.context=this.view.getContext("2d",{alpha:this.transparent}),this.refresh=!0,this.maskManager=new o,this.roundPixels=!1,this.currentScaleMode=h.SCALE_MODES.DEFAULT,this.currentBlendMode=h.BLEND_MODES.NORMAL,this.smoothProperty="imageSmoothingEnabled",this.context.imageSmoothingEnabled||(this.context.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.context.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.context.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.context.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(),this._mapBlendModes(),this._tempDisplayObjectParent={worldTransform:new a.Matrix,worldAlpha:1},this.resize(t,e)}var i=t("../SystemRenderer"),o=t("./utils/CanvasMaskManager"),s=t("../../utils"),a=t("../../math"),h=t("../../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,s.pluginTarget.mixin(n),n.prototype.render=function(t){var e=t.parent;this._lastObjectRendered=t,t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=e,this.context.setTransform(1,0,0,1,0,0),this.context.globalAlpha=1,this.currentBlendMode=h.BLEND_MODES.NORMAL,this.context.globalCompositeOperation=this.blendModes[h.BLEND_MODES.NORMAL],navigator.isCocoonJS&&this.view.screencanvas&&(this.context.fillStyle="black",this.context.clear()),this.clearBeforeRender&&(this.transparent?this.context.clearRect(0,0,this.width,this.height):(this.context.fillStyle=this._backgroundColorString,this.context.fillRect(0,0,this.width,this.height))),this.renderDisplayObject(t,this.context)},n.prototype.destroy=function(t){this.destroyPlugins(),i.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.roundPixels=!1,this.currentScaleMode=0,this.currentBlendMode=0,this.smoothProperty=null},n.prototype.renderDisplayObject=function(t,e){var r=this.context;this.context=e,t.renderCanvas(this),this.context=r},n.prototype.resize=function(t,e){i.prototype.resize.call(this,t,e),this.currentScaleMode=h.SCALE_MODES.DEFAULT,this.smoothProperty&&(this.context[this.smoothProperty]=this.currentScaleMode===h.SCALE_MODES.LINEAR)},n.prototype._mapBlendModes=function(){this.blendModes||(this.blendModes={},s.canUseNewCanvasBlendModes()?(this.blendModes[h.BLEND_MODES.NORMAL]="source-over",this.blendModes[h.BLEND_MODES.ADD]="lighter",this.blendModes[h.BLEND_MODES.MULTIPLY]="multiply",this.blendModes[h.BLEND_MODES.SCREEN]="screen",this.blendModes[h.BLEND_MODES.OVERLAY]="overlay",this.blendModes[h.BLEND_MODES.DARKEN]="darken",this.blendModes[h.BLEND_MODES.LIGHTEN]="lighten",this.blendModes[h.BLEND_MODES.COLOR_DODGE]="color-dodge",this.blendModes[h.BLEND_MODES.COLOR_BURN]="color-burn",this.blendModes[h.BLEND_MODES.HARD_LIGHT]="hard-light",this.blendModes[h.BLEND_MODES.SOFT_LIGHT]="soft-light",this.blendModes[h.BLEND_MODES.DIFFERENCE]="difference",this.blendModes[h.BLEND_MODES.EXCLUSION]="exclusion",this.blendModes[h.BLEND_MODES.HUE]="hue",this.blendModes[h.BLEND_MODES.SATURATION]="saturate",this.blendModes[h.BLEND_MODES.COLOR]="color",this.blendModes[h.BLEND_MODES.LUMINOSITY]="luminosity"):(this.blendModes[h.BLEND_MODES.NORMAL]="source-over",this.blendModes[h.BLEND_MODES.ADD]="lighter",this.blendModes[h.BLEND_MODES.MULTIPLY]="source-over",this.blendModes[h.BLEND_MODES.SCREEN]="source-over",this.blendModes[h.BLEND_MODES.OVERLAY]="source-over",this.blendModes[h.BLEND_MODES.DARKEN]="source-over",this.blendModes[h.BLEND_MODES.LIGHTEN]="source-over",this.blendModes[h.BLEND_MODES.COLOR_DODGE]="source-over",this.blendModes[h.BLEND_MODES.COLOR_BURN]="source-over",this.blendModes[h.BLEND_MODES.HARD_LIGHT]="source-over",this.blendModes[h.BLEND_MODES.SOFT_LIGHT]="source-over",this.blendModes[h.BLEND_MODES.DIFFERENCE]="source-over",this.blendModes[h.BLEND_MODES.EXCLUSION]="source-over",this.blendModes[h.BLEND_MODES.HUE]="source-over",this.blendModes[h.BLEND_MODES.SATURATION]="source-over",this.blendModes[h.BLEND_MODES.COLOR]="source-over",this.blendModes[h.BLEND_MODES.LUMINOSITY]="source-over"))}},{"../../const":22,"../../math":32,"../../utils":76,"../SystemRenderer":42,"./utils/CanvasMaskManager":46}],44:[function(t,e,r){function n(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=t,this.canvas.height=e}n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{width:{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t}},height:{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t}}}),n.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},n.prototype.resize=function(t,e){this.canvas.width=t,this.canvas.height=e},n.prototype.destroy=function(){this.context=null,this.canvas=null}},{}],45:[function(t,e,r){var n=t("../../../const"),i={};e.exports=i,i.renderGraphics=function(t,e){var r=t.worldAlpha;t.dirty&&(this.updateGraphicsTint(t),t.dirty=!1);for(var i=0;iD?D:T,e.beginPath(),e.moveTo(E,C+T),e.lineTo(E,C+B-T),e.quadraticCurveTo(E,C+B,E+T,C+B),e.lineTo(E+b-T,C+B),e.quadraticCurveTo(E+b,C+B,E+b,C+B-T),e.lineTo(E+b,C+T),e.quadraticCurveTo(E+b,C,E+b-T,C),e.lineTo(E+T,C),e.quadraticCurveTo(E,C,E,C+T),e.closePath(),(o.fillColor||0===o.fillColor)&&(e.globalAlpha=o.fillAlpha*r,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fill()),o.lineWidth&&(e.globalAlpha=o.lineAlpha*r,e.strokeStyle="#"+("00000"+(0|h).toString(16)).substr(-6),e.stroke())}}},i.renderGraphicsMask=function(t,e){var r=t.graphicsData.length;if(0!==r){e.beginPath();for(var i=0;r>i;i++){var o=t.graphicsData[i],s=o.shape;if(o.type===n.SHAPES.POLY){var a=s.points;e.moveTo(a[0],a[1]);for(var h=1;hB?B:b,e.moveTo(x,w+b),e.lineTo(x,w+C-b),e.quadraticCurveTo(x,w+C,x+b,w+C),e.lineTo(x+E-b,w+C),e.quadraticCurveTo(x+E,w+C,x+E,w+C-b),e.lineTo(x+E,w+b),e.quadraticCurveTo(x+E,w,x+E-b,w),e.lineTo(x+b,w),e.quadraticCurveTo(x,w,x,w+b), -e.closePath()}}}},i.updateGraphicsTint=function(t){if(16777215!==t.tint)for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,n=(255&t.tint)/255,i=0;i>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*n*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*n*255}}},{"../../../const":22}],46:[function(t,e,r){function n(){}var i=t("./CanvasGraphics");n.prototype.constructor=n,e.exports=n,n.prototype.pushMask=function(t,e){e.context.save();var r=t.alpha,n=t.worldTransform,o=e.resolution;e.context.setTransform(n.a*o,n.b*o,n.c*o,n.d*o,n.tx*o,n.ty*o),t.texture||(i.renderGraphicsMask(t,e.context),e.context.clip()),t.worldAlpha=r},n.prototype.popMask=function(t){t.context.restore()},n.prototype.destroy=function(){}},{"./CanvasGraphics":45}],47:[function(t,e,r){var n=t("../../../utils"),i={};e.exports=i,i.getTintedTexture=function(t,e){var r=t.texture;e=i.roundColor(e);var n="#"+("00000"+(0|e).toString(16)).substr(-6);if(r.tintCache=r.tintCache||{},r.tintCache[n])return r.tintCache[n];var o=i.canvas||document.createElement("canvas");if(i.tintMethod(r,e,o),i.convertTintToImage){var s=new Image;s.src=o.toDataURL(),r.tintCache[n]=s}else r.tintCache[n]=o,i.canvas=null;return o},i.tintWithMultiply=function(t,e,r){var n=r.getContext("2d"),i=t.crop;r.width=i.width,r.height=i.height,n.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),n.fillRect(0,0,i.width,i.height),n.globalCompositeOperation="multiply",n.drawImage(t.baseTexture.source,i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.globalCompositeOperation="destination-atop",n.drawImage(t.baseTexture.source,i.x,i.y,i.width,i.height,0,0,i.width,i.height)},i.tintWithOverlay=function(t,e,r){var n=r.getContext("2d"),i=t.crop;r.width=i.width,r.height=i.height,n.globalCompositeOperation="copy",n.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),n.fillRect(0,0,i.width,i.height),n.globalCompositeOperation="destination-atop",n.drawImage(t.baseTexture.source,i.x,i.y,i.width,i.height,0,0,i.width,i.height)},i.tintWithPerPixel=function(t,e,r){var i=r.getContext("2d"),o=t.crop;r.width=o.width,r.height=o.height,i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.source,o.x,o.y,o.width,o.height,0,0,o.width,o.height);for(var s=n.hex2rgb(e),a=s[0],h=s[1],l=s[2],u=i.getImageData(0,0,o.width,o.height),c=u.data,f=0;fe;++e)this.shaders[e].syncUniform(t)}},{"../shaders/TextureShader":61}],50:[function(t,e,r){function n(){i.call(this,"\nprecision mediump float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform vec2 resolution;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\n\nvoid texcoords(vec2 fragCoord, vec2 resolution,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n vec2 inverseVP = 1.0 / resolution.xy;\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 gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n vResolution = resolution;\n\n //compute the texture coords and send them to varyings\n texcoords(aTextureCoord * resolution, resolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'precision lowp float;\n\n\n/**\nBasic FXAA implementation based on the code on geeks3d.com with the\nmodification that the texture2DLod stuff was removed since it\'s\nunsupported by WebGL.\n\n--\n\nFrom:\nhttps://github.com/mitsuhiko/webgl-meincraft\n\nCopyright (c) 2011 by Armin Ronacher.\n\nSome rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\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\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF 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 resolution,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);\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\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nuniform sampler2D uSampler;\n\n\nvoid main(void){\n\n gl_FragColor = fxaa(uSampler, vTextureCoord * vResolution, vResolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n}\n',{resolution:{type:"v2",value:{x:1,y:1}}})}var i=t("./AbstractFilter");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager,i=this.getShader(t);n.applyFilter(i,e,r)}},{"./AbstractFilter":49}],51:[function(t,e,r){function n(t){var e=new o.Matrix;i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform sampler2D mask;\n\nvoid main(void)\n{\n // check clip! this will stop the mask bleeding out from the edges\n vec2 text = abs( vMaskCoord - 0.5 );\n text = step(0.5, text);\n float clip = 1.0 - max(text.y, text.x);\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n original *= (masky.r * masky.a * alpha * clip);\n gl_FragColor = original;\n}\n",{mask:{type:"sampler2D",value:t._texture},alpha:{type:"f",value:1},otherMatrix:{type:"mat3",value:e.toArray(!0)}}),this.maskSprite=t,this.maskMatrix=e}var i=t("./AbstractFilter"),o=t("../../../math");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager;this.uniforms.mask.value=this.maskSprite._texture,n.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.alpha.value=this.maskSprite.worldAlpha;var i=this.getShader(t);n.applyFilter(i,e,r)},Object.defineProperties(n.prototype,{map:{get:function(){return this.uniforms.mask.value},set:function(t){this.uniforms.mask.value=t}},offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}}})},{"../../../math":32,"./AbstractFilter":49}],52:[function(t,e,r){function n(t){i.call(this,t),this.currentBlendMode=99999}var i=t("./WebGLManager");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.setBlendMode=function(t){if(this.currentBlendMode===t)return!1;this.currentBlendMode=t;var e=this.renderer.blendModes[this.currentBlendMode];return this.renderer.gl.blendFunc(e[0],e[1]),!0}},{"./WebGLManager":57}],53:[function(t,e,r){function n(t){i.call(this,t),this.filterStack=[],this.filterStack.push({renderTarget:t.currentRenderTarget,filter:[],bounds:null}),this.texturePool=[],this.textureSize=new h.Rectangle(0,0,t.width,t.height),this.currentFrame=null}var i=t("./WebGLManager"),o=t("../utils/RenderTarget"),s=t("../../../const"),a=t("../utils/Quad"),h=t("../../../math");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.onContextChange=function(){this.texturePool.length=0;var t=this.renderer.gl;this.quad=new a(t)},n.prototype.setFilterStack=function(t){this.filterStack=t},n.prototype.pushFilter=function(t,e){var r=t.filterArea?t.filterArea.clone():t.getBounds();r.x=0|r.x,r.y=0|r.y,r.width=0|r.width,r.height=0|r.height;var n=0|e[0].padding;if(r.x-=n,r.y-=n,r.width+=2*n,r.height+=2*n,this.renderer.currentRenderTarget.transform){var i=this.renderer.currentRenderTarget.transform;r.x+=i.tx,r.y+=i.ty,this.capFilterArea(r),r.x-=i.tx,r.y-=i.ty}else this.capFilterArea(r);if(r.width>0&&r.height>0){this.currentFrame=r;var o=this.getRenderTarget();this.renderer.setRenderTarget(o),o.clear(),this.filterStack.push({renderTarget:o,filter:e})}else this.filterStack.push({renderTarget:null,filter:e})},n.prototype.popFilter=function(){var t=this.filterStack.pop(),e=this.filterStack[this.filterStack.length-1],r=t.renderTarget;if(t.renderTarget){var n=e.renderTarget,i=this.renderer.gl;this.currentFrame=r.frame,this.quad.map(this.textureSize,r.frame),i.bindBuffer(i.ARRAY_BUFFER,this.quad.vertexBuffer),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,this.quad.indexBuffer);var o=t.filter;if(i.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aVertexPosition,2,i.FLOAT,!1,0,0),i.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aTextureCoord,2,i.FLOAT,!1,0,32),i.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aColor,4,i.FLOAT,!1,0,64),this.renderer.blendModeManager.setBlendMode(s.BLEND_MODES.NORMAL),1===o.length)o[0].uniforms.dimensions&&(o[0].uniforms.dimensions.value[0]=this.renderer.width,o[0].uniforms.dimensions.value[1]=this.renderer.height,o[0].uniforms.dimensions.value[2]=this.quad.vertices[0],o[0].uniforms.dimensions.value[3]=this.quad.vertices[5]),o[0].applyFilter(this.renderer,r,n),this.returnRenderTarget(r);else{for(var a=r,h=this.getRenderTarget(!0),l=0;lthis.textureSize.width&&(t.width=this.textureSize.width-t.x),t.y+t.height>this.textureSize.height&&(t.height=this.textureSize.height-t.y)},n.prototype.resize=function(t,e){this.textureSize.width=t,this.textureSize.height=e;for(var r=0;re;++e)t._array[2*e]=o[e].x,t._array[2*e+1]=o[e].y;s.uniform2fv(n,t._array);break;case"v3v":for(t._array||(t._array=new Float32Array(3*o.length)),e=0,r=o.length;r>e;++e)t._array[3*e]=o[e].x,t._array[3*e+1]=o[e].y,t._array[3*e+2]=o[e].z;s.uniform3fv(n,t._array);break;case"v4v":for(t._array||(t._array=new Float32Array(4*o.length)),e=0,r=o.length;r>e;++e)t._array[4*e]=o[e].x,t._array[4*e+1]=o[e].y,t._array[4*e+2]=o[e].z,t._array[4*e+3]=o[e].w;s.uniform4fv(n,t._array);break;case"t":case"sampler2D":if(!t.value||!t.value.baseTexture.hasLoaded)break;s.activeTexture(s["TEXTURE"+this.textureCount]);var a=t.value.baseTexture._glTextures[s.id];a||(this.initSampler2D(t),a=t.value.baseTexture._glTextures[s.id]),s.bindTexture(s.TEXTURE_2D,a),s.uniform1i(t._location,this.textureCount),this.textureCount++;break;default:console.warn("Pixi.js Shader Warning: Unknown uniform type: "+t.type)}},n.prototype.syncUniforms=function(){this.textureCount=1;for(var t in this.uniforms)this.syncUniform(this.uniforms[t])},n.prototype.initSampler2D=function(t){var e=this.gl,r=t.value.baseTexture;if(r.hasLoaded)if(t.textureData){var n=t.textureData;r._glTextures[e.id]=e.createTexture(),e.bindTexture(e.TEXTURE_2D,r._glTextures[e.id]),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultipliedAlpha),e.texImage2D(e.TEXTURE_2D,0,n.luminance?e.LUMINANCE:e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n.magFilter?n.magFilter:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n.wrapS?n.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,n.wrapS?n.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,n.wrapT?n.wrapT:e.CLAMP_TO_EDGE)}else this.shaderManager.renderer.updateTexture(r)},n.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.gl=null,this.uniforms=null,this.attributes=null,this.vertexSrc=null,this.fragmentSrc=null},n.prototype._glCompile=function(t,e){var r=this.gl.createShader(t);return this.gl.shaderSource(r,e),this.gl.compileShader(r),this.gl.getShaderParameter(r,this.gl.COMPILE_STATUS)?r:(console.log(this.gl.getShaderInfoLog(r)),null)}},{"../../../utils":76}],61:[function(t,e,r){function n(t,e,r,o,s){var a={uSampler:{type:"sampler2D",value:0},projectionMatrix:{type:"mat3",value:new Float32Array([1,0,0,0,1,0,0,0,1])}};if(o)for(var h in o)a[h]=o[h];var l={aVertexPosition:0,aTextureCoord:0,aColor:0};if(s)for(var u in s)l[u]=s[u];e=e||n.defaultVertexSrc,r=r||n.defaultFragmentSrc,i.call(this,t,e,r,a,l)}var i=t("./Shader");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.defaultVertexSrc=["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"].join("\n"),n.defaultFragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"].join("\n")},{"./Shader":60}],62:[function(t,e,r){function n(t){i.call(this,t)}var i=t("../managers/WebGLManager");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.start=function(){},n.prototype.stop=function(){this.flush()},n.prototype.flush=function(){},n.prototype.render=function(t){}},{"../managers/WebGLManager":57}],63:[function(t,e,r){function n(t){this.gl=t,this.vertices=new Float32Array([0,0,200,0,200,200,0,200]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.colors=new Float32Array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]),this.indices=new Uint16Array([0,1,2,0,3,2]),this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,128,t.DYNAMIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.upload()}n.prototype.constructor=n,n.prototype.map=function(t,e){var r=0,n=0;this.uvs[0]=r,this.uvs[1]=n,this.uvs[2]=r+e.width/t.width,this.uvs[3]=n,this.uvs[4]=r+e.width/t.width,this.uvs[5]=n+e.height/t.height,this.uvs[6]=r,this.uvs[7]=n+e.height/t.height,r=e.x,n=e.y,this.vertices[0]=r,this.vertices[1]=n,this.vertices[2]=r+e.width,this.vertices[3]=n,this.vertices[4]=r+e.width,this.vertices[5]=n+e.height,this.vertices[6]=r,this.vertices[7]=n+e.height,this.upload()},n.prototype.upload=function(){var t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferSubData(t.ARRAY_BUFFER,0,this.vertices),t.bufferSubData(t.ARRAY_BUFFER,32,this.uvs),t.bufferSubData(t.ARRAY_BUFFER,64,this.colors)},e.exports=n},{}],64:[function(t,e,r){var n=t("../../../math"),i=t("../../../utils"),o=t("../../../const"),s=t("./StencilMaskStack"),a=function(t,e,r,a,h,l){if(this.gl=t,this.frameBuffer=null,this.texture=null,this.size=new n.Rectangle(0,0,1,1),this.resolution=h||o.RESOLUTION,this.projectionMatrix=new n.Matrix,this.transform=null,this.frame=null,this.stencilBuffer=null,this.stencilMaskStack=new s,this.filterStack=[{renderTarget:this,filter:[],bounds:this.size}],this.scaleMode=a||o.SCALE_MODES.DEFAULT,this.root=l,!this.root){this.frameBuffer=t.createFramebuffer(),this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,a===o.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,a===o.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST);var u=i.isPowerOfTwo(e,r);u?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0)}this.resize(e,r)};a.prototype.constructor=a,e.exports=a,a.prototype.clear=function(t){var e=this.gl;t&&e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},a.prototype.attachStencilBuffer=function(){if(!this.stencilBuffer&&!this.root){var t=this.gl;this.stencilBuffer=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.stencilBuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,this.stencilBuffer),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.size.width*this.resolution,this.size.height*this.resolution)}},a.prototype.activate=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer);var e=this.frame||this.size;this.calculateProjection(e),this.transform&&this.projectionMatrix.append(this.transform),t.viewport(0,0,e.width*this.resolution,e.height*this.resolution)},a.prototype.calculateProjection=function(t){var e=this.projectionMatrix;e.identity(),this.root?(e.a=1/t.width*2,e.d=-1/t.height*2,e.tx=-1-t.x*e.a,e.ty=1-t.y*e.d):(e.a=1/t.width*2,e.d=1/t.height*2,e.tx=-1-t.x*e.a,e.ty=-1-t.y*e.d)},a.prototype.resize=function(t,e){if(t=0|t,e=0|e,this.size.width!==t||this.size.height!==e){if(this.size.width=t,this.size.height=e,!this.root){var r=this.gl;r.bindTexture(r.TEXTURE_2D,this.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,t*this.resolution,e*this.resolution,0,r.RGBA,r.UNSIGNED_BYTE,null),this.stencilBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencilBuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t*this.resolution,e*this.resolution))}var n=this.frame||this.size;this.calculateProjection(n)}},a.prototype.destroy=function(){var t=this.gl;t.deleteFramebuffer(this.frameBuffer),t.deleteTexture(this.texture),this.frameBuffer=null,this.texture=null}},{"../../../const":22,"../../../math":32,"../../../utils":76,"./StencilMaskStack":65}],65:[function(t,e,r){function n(){this.stencilStack=[],this.reverse=!0,this.count=0}n.prototype.constructor=n,e.exports=n},{}],66:[function(t,e,r){function n(t){s.call(this),this.anchor=new i.Point,this._texture=null,this._width=0,this._height=0,this.tint=16777215,this.blendMode=l.BLEND_MODES.NORMAL,this.shader=null,this.cachedTint=16777215,this.texture=t||o.EMPTY}var i=t("../math"),o=t("../textures/Texture"),s=t("../display/Container"),a=t("../renderers/canvas/utils/CanvasTinter"),h=t("../utils"),l=t("../const"),u=new i.Point;n.prototype=Object.create(s.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{width:{get:function(){return this.scale.x*this.texture._frame.width},set:function(t){this.scale.x=t/this.texture._frame.width,this._width=t}},height:{get:function(){return this.scale.y*this.texture._frame.height},set:function(t){this.scale.y=t/this.texture._frame.height,this._height=t}},texture:{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t,this.cachedTint=16777215,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}}),n.prototype._onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height)},n.prototype._renderWebGL=function(t){t.setObjectRenderer(t.plugins.sprite),t.plugins.sprite.render(this)},n.prototype.getBounds=function(t){if(!this._currentBounds){var e,r,n,i,o=this._texture._frame.width,s=this._texture._frame.height,a=o*(1-this.anchor.x),h=o*-this.anchor.x,l=s*(1-this.anchor.y),u=s*-this.anchor.y,c=t||this.worldTransform,f=c.a,d=c.b,p=c.c,g=c.d,A=c.tx,v=c.ty;if(0===d&&0===p)0>f&&(f*=-1),0>g&&(g*=-1),e=f*h+A,r=f*a+A,n=g*u+v,i=g*l+v;else{var m=f*h+p*u+A,y=g*u+d*h+v,x=f*a+p*u+A,w=g*u+d*a+v,E=f*a+p*l+A,C=g*l+d*a+v,b=f*h+p*l+A,B=g*l+d*h+v;e=m,e=e>x?x:e,e=e>E?E:e,e=e>b?b:e,n=y,n=n>w?w:n,n=n>C?C:n,n=n>B?B:n,r=m,r=x>r?x:r,r=E>r?E:r,r=b>r?b:r,i=y,i=w>i?w:i,i=C>i?C:i,i=B>i?B:i}if(this.children.length){var T=this.containerGetBounds();a=T.x,h=T.x+T.width,l=T.y,u=T.y+T.height,e=a>e?e:a,n=l>n?n:l,r=r>h?r:h,i=i>u?i:u}var D=this._bounds;D.x=e,D.width=r-e,D.y=n,D.height=i-n,this._currentBounds=D}return this._currentBounds},n.prototype.getLocalBounds=function(){return this._bounds.x=-this._texture._frame.width*this.anchor.x,this._bounds.y=-this._texture._frame.height*this.anchor.y,this._bounds.width=this._texture._frame.width,this._bounds.height=this._texture._frame.height,this._bounds},n.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,u);var e,r=this._texture._frame.width,n=this._texture._frame.height,i=-r*this.anchor.x;return u.x>i&&u.xe&&u.yn;n+=6,o+=4)this.indices[n+0]=o+0,this.indices[n+1]=o+1,this.indices[n+2]=o+2,this.indices[n+3]=o+0,this.indices[n+4]=o+2,this.indices[n+5]=o+3;this.currentBatchSize=0,this.sprites=[],this.shader=null}var i=t("../../renderers/webgl/utils/ObjectRenderer"),o=t("../../renderers/webgl/WebGLRenderer"),s=t("../../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,o.registerPlugin("sprite",n),n.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=this.renderer.shaderManager.defaultShader,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices,t.DYNAMIC_DRAW),this.currentBlendMode=99999},n.prototype.render=function(t){var e=t._texture;this.currentBatchSize>=this.size&&this.flush();var r=e._uvs;if(r){var n,i,o,s,a=t.anchor.x,h=t.anchor.y;if(e.trim){var l=e.trim;i=l.x-a*l.width,n=i+e.crop.width,s=l.y-h*l.height,o=s+e.crop.height}else n=e._frame.width*(1-a),i=e._frame.width*-a,o=e._frame.height*(1-h),s=e._frame.height*-h;var u=this.currentBatchSize*this.vertByteSize,c=t.worldTransform,f=c.a,d=c.b,p=c.c,g=c.d,A=c.tx,v=c.ty,m=this.colors,y=this.positions;this.renderer.roundPixels?(y[u]=f*i+p*s+A|0,y[u+1]=g*s+d*i+v|0,y[u+5]=f*n+p*s+A|0,y[u+6]=g*s+d*n+v|0,y[u+10]=f*n+p*o+A|0,y[u+11]=g*o+d*n+v|0,y[u+15]=f*i+p*o+A|0,y[u+16]=g*o+d*i+v|0):(y[u]=f*i+p*s+A,y[u+1]=g*s+d*i+v,y[u+5]=f*n+p*s+A,y[u+6]=g*s+d*n+v,y[u+10]=f*n+p*o+A,y[u+11]=g*o+d*n+v,y[u+15]=f*i+p*o+A,y[u+16]=g*o+d*i+v),y[u+2]=r.x0,y[u+3]=r.y0,y[u+7]=r.x1,y[u+8]=r.y1,y[u+12]=r.x2,y[u+13]=r.y2,y[u+17]=r.x3,y[u+18]=r.y3;var x=t.tint;m[u+4]=m[u+9]=m[u+14]=m[u+19]=(x>>16)+(65280&x)+((255&x)<<16)+(255*t.worldAlpha<<24),this.sprites[this.currentBatchSize++]=t}},n.prototype.flush=function(){if(0!==this.currentBatchSize){var t,e=this.renderer.gl;if(this.currentBatchSize>.5*this.size)e.bufferSubData(e.ARRAY_BUFFER,0,this.vertices);else{var r=this.positions.subarray(0,this.currentBatchSize*this.vertByteSize);e.bufferSubData(e.ARRAY_BUFFER,0,r)}for(var n,i,o,s,a=0,h=0,l=null,u=this.renderer.blendModeManager.currentBlendMode,c=null,f=!1,d=!1,p=0,g=this.currentBatchSize;g>p;p++)s=this.sprites[p],n=s._texture.baseTexture,i=s.blendMode,o=s.shader||this.shader,f=u!==i,d=c!==o,(l!==n||f||d)&&(this.renderBatch(l,a,h),h=p,a=0,l=n,f&&(u=i,this.renderer.blendModeManager.setBlendMode(u)),d&&(c=o,t=c.shaders?c.shaders[e.id]:c,t||(t=c.getShader(this.renderer)),this.renderer.shaderManager.setShader(t),t.uniforms.projectionMatrix.value=this.renderer.currentRenderTarget.projectionMatrix.toArray(!0),t.syncUniforms(),e.activeTexture(e.TEXTURE0))),a++;this.renderBatch(l,a,h),this.currentBatchSize=0}},n.prototype.renderBatch=function(t,e,r){if(0!==e){var n=this.renderer.gl;t._glTextures[n.id]?n.bindTexture(n.TEXTURE_2D,t._glTextures[n.id]):this.renderer.updateTexture(t),n.drawElements(n.TRIANGLES,6*e,n.UNSIGNED_SHORT,6*r*2),this.renderer.drawCount++}},n.prototype.start=function(){var t=this.renderer.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.vertByteSize;t.vertexAttribPointer(this.shader.attributes.aVertexPosition,2,t.FLOAT,!1,e,0),t.vertexAttribPointer(this.shader.attributes.aTextureCoord,2,t.FLOAT,!1,e,8),t.vertexAttribPointer(this.shader.attributes.aColor,4,t.UNSIGNED_BYTE,!0,e,16)},n.prototype.destroy=function(){this.renderer.gl.deleteBuffer(this.vertexBuffer),this.renderer.gl.deleteBuffer(this.indexBuffer),this.shader.destroy(),this.renderer=null,this.vertices=null,this.positions=null,this.colors=null,this.indices=null,this.vertexBuffer=null,this.indexBuffer=null,this.sprites=null,this.shader=null}},{"../../const":22,"../../renderers/webgl/WebGLRenderer":48,"../../renderers/webgl/utils/ObjectRenderer":62}],68:[function(t,e,r){function n(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||h.RESOLUTION,this._text=null,this._style=null;var n=o.fromCanvas(this.canvas);n.trim=new s.Rectangle,i.call(this,n),this.text=t,this.style=e}var i=t("../sprites/Sprite"),o=t("../textures/Texture"),s=t("../math"),a=t("../utils"),h=t("../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.fontPropertiesCache={},n.fontPropertiesCanvas=document.createElement("canvas"),n.fontPropertiesContext=n.fontPropertiesCanvas.getContext("2d"),Object.defineProperties(n.prototype,{width:{get:function(){return this.dirty&&this.updateText(),this.scale.x*this._texture._frame.width},set:function(t){this.scale.x=t/this._texture._frame.width,this._width=t}},height:{get:function(){return this.dirty&&this.updateText(),this.scale.y*this._texture._frame.height},set:function(t){this.scale.y=t/this._texture._frame.height,this._height=t}},style:{get:function(){return this._style},set:function(t){t=t||{},"number"==typeof t.fill&&(t.fill=a.hex2string(t.fill)),"number"==typeof t.stroke&&(t.stroke=a.hex2string(t.stroke)),"number"==typeof t.dropShadowColor&&(t.dropShadowColor=a.hex2string(t.dropShadowColor)),t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,t.dropShadow=t.dropShadow||!1,t.dropShadowColor=t.dropShadowColor||"#000000",t.dropShadowAngle=t.dropShadowAngle||Math.PI/6,t.dropShadowDistance=t.dropShadowDistance||5,t.padding=t.padding||0,t.textBaseline=t.textBaseline||"alphabetic",t.lineJoin=t.lineJoin||"miter",t.miterLimit=t.miterLimit||10,this._style=t,this.dirty=!0}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),n.prototype.updateText=function(){var t=this._style;this.context.font=t.font;for(var e=t.wordWrap?this.wordWrap(this._text):this._text,r=e.split(/(?:\r\n|\r|\n)/),n=new Array(r.length),i=0,o=this.determineFontProperties(t.font),s=0;sh;h++){for(l=0;f>l;l+=4)if(255!==u[d+l]){p=!0;break}if(p)break;d+=f}for(e.ascent=s-h,d=c-f,p=!1,h=a;h>s;h--){for(l=0;f>l;l+=4)if(255!==u[d+l]){p=!0;break}if(p)break;d-=f}e.descent=h-s,e.fontSize=e.ascent+e.descent,n.fontPropertiesCache[t]=e}return e},n.prototype.wordWrap=function(t){for(var e="",r=t.split("\n"),n=this._style.wordWrapWidth,i=0;io?(a>0&&(e+="\n"),e+=s[a],o=n-h):(o-=l,e+=" "+s[a])}i0&&e>0,this.width=this._frame.width=this.crop.width=t,this.height=this._frame.height=this.crop.height=e,r&&(this.baseTexture.width=this.width,this.baseTexture.height=this.height),this.valid&&(this.textureBuffer.resize(this.width,this.height),this.filterManager&&this.filterManager.resize(this.width,this.height)))},n.prototype.clear=function(){this.valid&&(this.renderer.type===u.RENDERER_TYPE.WEBGL&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear()); -},n.prototype.renderWebGL=function(t,e,r,n){if(this.valid){if(n=void 0!==n?n:!0,this.textureBuffer.transform=e,this.textureBuffer.activate(),t.worldAlpha=1,n){t.worldTransform.identity(),t.currentBounds=null;var i,o,s=t.children;for(i=0,o=s.length;o>i;++i)s[i].updateTransform()}var a=this.renderer.filterManager;this.renderer.filterManager=this.filterManager,this.renderer.renderDisplayObject(t,this.textureBuffer,r),this.renderer.filterManager=a}},n.prototype.renderCanvas=function(t,e,r,n){if(this.valid){n=!!n;var i=t.worldTransform,o=c;o.identity(),e&&o.append(e),t.worldTransform=o,t.worldAlpha=1;var s,a,h=t.children;for(s=0,a=h.length;a>s;++s)h[s].updateTransform();r&&this.textureBuffer.clear(),t.worldTransform=i;var l=this.textureBuffer.context,u=this.renderer.resolution;this.renderer.resolution=this.resolution,this.renderer.renderDisplayObject(t,l),this.renderer.resolution=u}},n.prototype.destroy=function(){o.prototype.destroy.call(this,!0),this.textureBuffer.destroy(),this.filterManager&&this.filterManager.destroy(),this.renderer=null},n.prototype.getImage=function(){var t=new Image;return t.src=this.getBase64(),t},n.prototype.getBase64=function(){return this.getCanvas().toDataURL()},n.prototype.getCanvas=function(){if(this.renderer.type===u.RENDERER_TYPE.WEBGL){var t=this.renderer.gl,e=this.textureBuffer.size.width,r=this.textureBuffer.size.height,n=new Uint8Array(4*e*r);t.bindFramebuffer(t.FRAMEBUFFER,this.textureBuffer.frameBuffer),t.readPixels(0,0,e,r,t.RGBA,t.UNSIGNED_BYTE,n),t.bindFramebuffer(t.FRAMEBUFFER,null);var i=new h(e,r),o=i.context.getImageData(0,0,e,r);return o.data.set(n),i.context.putImageData(o,0,0),i.canvas}return this.textureBuffer.canvas},n.prototype.getPixels=function(){var t,e;if(this.renderer.type===u.RENDERER_TYPE.WEBGL){var r=this.renderer.gl;t=this.textureBuffer.size.width,e=this.textureBuffer.size.height;var n=new Uint8Array(4*t*e);return r.bindFramebuffer(r.FRAMEBUFFER,this.textureBuffer.frameBuffer),r.readPixels(0,0,t,e,r.RGBA,r.UNSIGNED_BYTE,n),r.bindFramebuffer(r.FRAMEBUFFER,null),n}return t=this.textureBuffer.canvas.width,e=this.textureBuffer.canvas.height,this.textureBuffer.canvas.getContext("2d").getImageData(0,0,t,e).data},n.prototype.getPixel=function(t,e){if(this.renderer.type===u.RENDERER_TYPE.WEBGL){var r=this.renderer.gl,n=new Uint8Array(4);return r.bindFramebuffer(r.FRAMEBUFFER,this.textureBuffer.frameBuffer),r.readPixels(t,e,1,1,r.RGBA,r.UNSIGNED_BYTE,n),r.bindFramebuffer(r.FRAMEBUFFER,null),n}return this.textureBuffer.canvas.getContext("2d").getImageData(t,e,1,1).data}},{"../const":22,"../math":32,"../renderers/canvas/utils/CanvasBuffer":44,"../renderers/webgl/managers/FilterManager":53,"../renderers/webgl/utils/RenderTarget":64,"./BaseTexture":69,"./Texture":71}],71:[function(t,e,r){function n(t,e,r,i,o){a.call(this),this.noFrame=!1,e||(this.noFrame=!0,e=new h.Rectangle(0,0,1,1)),t instanceof n&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=i,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.width=0,this.height=0,this.crop=r||e,this.rotate=!!o,t.hasLoaded?(this.noFrame&&(e=new h.Rectangle(0,0,t.width,t.height),t.on("update",this.onBaseTextureUpdated,this)),this.frame=e):t.once("loaded",this.onBaseTextureLoaded,this)}var i=t("./BaseTexture"),o=t("./VideoBaseTexture"),s=t("./TextureUvs"),a=t("eventemitter3"),h=t("../math"),l=t("../utils");n.prototype=Object.create(a.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{frame:{get:function(){return this._frame},set:function(t){if(this._frame=t,this.noFrame=!1,this.width=t.width,this.height=t.height,!this.trim&&!this.rotate&&(t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height))throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=t&&t.width&&t.height&&this.baseTexture.hasLoaded,this.trim?(this.width=this.trim.width,this.height=this.trim.height,this._frame.width=this.trim.width,this._frame.height=this.trim.height):this.crop=t,this.valid&&this._updateUvs()}}}),n.prototype.update=function(){this.baseTexture.update()},n.prototype.onBaseTextureLoaded=function(t){this.frame=this.noFrame?new h.Rectangle(0,0,t.width,t.height):this._frame,this.emit("update",this)},n.prototype.onBaseTextureUpdated=function(t){this._frame.width=t.width,this._frame.height=t.height,this.emit("update",this)},n.prototype.destroy=function(t){this.baseTexture&&(t&&this.baseTexture.destroy(),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture.off("loaded",this.onBaseTextureLoaded,this),this.baseTexture=null),this._frame=null,this._uvs=null,this.trim=null,this.crop=null,this.valid=!1},n.prototype.clone=function(){return new n(this.baseTexture,this.frame,this.crop,this.trim,this.rotate)},n.prototype._updateUvs=function(){this._uvs||(this._uvs=new s),this._uvs.set(this.crop,this.baseTexture,this.rotate)},n.fromImage=function(t,e,r){var o=l.TextureCache[t];return o||(o=new n(i.fromImage(t,e,r)),l.TextureCache[t]=o),o},n.fromFrame=function(t){var e=l.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return e},n.fromCanvas=function(t,e){return new n(i.fromCanvas(t,e))},n.fromVideo=function(t,e){return"string"==typeof t?n.fromVideoUrl(t,e):new n(o.fromVideo(t,e))},n.fromVideoUrl=function(t,e){return new n(o.fromUrl(t,e))},n.addTextureToCache=function(t,e){l.TextureCache[e]=t},n.removeTextureFromCache=function(t){var e=l.TextureCache[t];return delete l.TextureCache[t],delete l.BaseTextureCache[t],e},n.EMPTY=new n(new i)},{"../math":32,"../utils":76,"./BaseTexture":69,"./TextureUvs":72,"./VideoBaseTexture":73,eventemitter3:11}],72:[function(t,e,r){function n(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1}e.exports=n,n.prototype.set=function(t,e,r){var n=e.width,i=e.height;r?(this.x0=(t.x+t.height)/n,this.y0=t.y/i,this.x1=(t.x+t.height)/n,this.y1=(t.y+t.width)/i,this.x2=t.x/n,this.y2=(t.y+t.width)/i,this.x3=t.x/n,this.y3=t.y/i):(this.x0=t.x/n,this.y0=t.y/i,this.x1=(t.x+t.width)/n,this.y1=t.y/i,this.x2=(t.x+t.width)/n,this.y2=(t.y+t.height)/i,this.x3=t.x/n,this.y3=(t.y+t.height)/i)}},{}],73:[function(t,e,r){function n(t,e){if(!t)throw new Error("No video source element specified.");(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),o.call(this,t,e),this.autoUpdate=!1,this._onUpdate=this._onUpdate.bind(this),this._onCanPlay=this._onCanPlay.bind(this),t.complete||(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this))),this.__loaded=!1}function i(t,e){e||(e="video/"+t.substr(t.lastIndexOf(".")+1));var r=document.createElement("source");return r.src=t,r.type=e,r}var o=t("./BaseTexture"),s=t("../utils");n.prototype=Object.create(o.prototype),n.prototype.constructor=n,e.exports=n,n.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this._onUpdate),this.update())},n.prototype._onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this._onUpdate),this.autoUpdate=!0)},n.prototype._onPlayStop=function(){this.autoUpdate=!1},n.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.source.play(),this.__loaded||(this.__loaded=!0,this.emit("loaded",this)))},n.prototype.destroy=function(){this.source&&this.source._pixiId&&(delete s.BaseTextureCache[this.source._pixiId],delete this.source._pixiId),o.prototype.destroy.call(this)},n.fromVideo=function(t,e){t._pixiId||(t._pixiId="video_"+s.uid());var r=s.BaseTextureCache[t._pixiId];return r||(r=new n(t,e),s.BaseTextureCache[t._pixiId]=r),r},n.fromUrl=function(t,e){var r=document.createElement("video");if(Array.isArray(t))for(var o=0;othis._maxElapsedMS&&(e=this._maxElapsedMS),this.deltaTime=e*i.TARGET_FPMS*this.speed,this._emitter.emit(s,this.deltaTime),this.lastTime=t},e.exports=n},{"../const":22,eventemitter3:11}],75:[function(t,e,r){var n=t("./Ticker"),i=new n;i.autoStart=!0,e.exports={shared:i,Ticker:n}},{"./Ticker":74}],76:[function(t,e,r){var n=t("../const"),i=e.exports={_uid:0,_saidHello:!1,pluginTarget:t("./pluginTarget"),async:t("async"),uid:function(){return++i._uid},hex2rgb:function(t,e){return e=e||[],e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},hex2string:function(t){return t=t.toString(16),t="000000".substr(0,6-t.length)+t,"#"+t},rgb2hex:function(t){return(255*t[0]<<16)+(255*t[1]<<8)+255*t[2]},canUseNewCanvasBlendModes:function(){if("undefined"==typeof document)return!1;var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",e="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",r=new Image;r.src=t+"AP804Oa6"+e;var n=new Image;n.src=t+"/wCKxvRF"+e;var i=document.createElement("canvas");i.width=6,i.height=1;var o=i.getContext("2d");o.globalCompositeOperation="multiply",o.drawImage(r,0,0),o.drawImage(n,2,0);var s=o.getImageData(2,0,1,1).data;return 255===s[0]&&0===s[1]&&0===s[2]},getNextPowerOfTwo:function(t){if(t>0&&0===(t&t-1))return t;for(var e=1;t>e;)e<<=1;return e},isPowerOfTwo:function(t,e){return t>0&&0===(t&t-1)&&e>0&&0===(e&e-1)},getResolutionOfUrl:function(t){var e=n.RETINA_PREFIX.exec(t);return e?parseFloat(e[1]):1},sayHello:function(t){if(!i._saidHello){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c Pixi.js "+n.VERSION+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("Pixi.js "+n.VERSION+" - "+t+" - http://www.pixijs.com/");i._saidHello=!0}},isWebGLSupported:function(){var t={stencil:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);return!(!r||!r.getContextAttributes().stencil)}catch(n){return!1}},TextureCache:{},BaseTextureCache:{}}},{"../const":22,"./pluginTarget":77,async:2}],77:[function(t,e,r){function n(t){t.__plugins={},t.registerPlugin=function(e,r){t.__plugins[e]=r},t.prototype.initPlugins=function(){this.plugins=this.plugins||{};for(var e in t.__plugins)this.plugins[e]=new t.__plugins[e](this)},t.prototype.destroyPlugins=function(){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;this.plugins=null}}e.exports={mixin:function(t){n(t)}}},{}],78:[function(t,e,r){var n=t("./core"),i=t("./mesh"),o=t("./extras"),s=t("./filters");n.SpriteBatch=function(){throw new ReferenceError("SpriteBatch does not exist any more, please use the new ParticleContainer instead.")},n.AssetLoader=function(){throw new ReferenceError("The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.")},Object.defineProperties(n,{Stage:{get:function(){return console.warn("You do not need to use a PIXI Stage any more, you can simply render any container."),n.Container}},DisplayObjectContainer:{get:function(){return console.warn("DisplayObjectContainer has been shortened to Container, please use Container from now on."),n.Container}},Strip:{get:function(){return console.warn("The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on."),i.Mesh}},Rope:{get:function(){return console.warn("The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on."),i.Rope}},MovieClip:{get:function(){return console.warn("The MovieClip class has been moved to extras.MovieClip, please use extras.MovieClip from now on."),o.MovieClip}},TilingSprite:{get:function(){return console.warn("The TilingSprite class has been moved to extras.TilingSprite, please use extras.TilingSprite from now on."),o.TilingSprite}},BitmapText:{get:function(){return console.warn("The BitmapText class has been moved to extras.BitmapText, please use extras.BitmapText from now on."),o.BitmapText}},blendModes:{get:function(){return console.warn("The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on."),n.BLEND_MODES}},scaleModes:{get:function(){return console.warn("The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on."),n.SCALE_MODES}},BaseTextureCache:{get:function(){return console.warn("The BaseTextureCache class has been moved to utils.BaseTextureCache, please use utils.BaseTextureCache from now on."),n.utils.BaseTextureCache}},TextureCache:{get:function(){return console.warn("The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on."),n.utils.TextureCache}},math:{get:function(){return console.warn("The math namespace is deprecated, please access members already accessible on PIXI."),n}}}),n.Sprite.prototype.setTexture=function(t){this.texture=t,console.warn("setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;")},o.BitmapText.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myBitmapText.text = 'my text';")},n.Text.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myText.text = 'my text';")},n.Text.prototype.setStyle=function(t){this.style=t,console.warn("setStyle is now deprecated, please use the style property, e.g : myText.style = style;")},n.Texture.prototype.setFrame=function(t){this.frame=t,console.warn("setFrame is now deprecated, please use the frame property, e.g : myTexture.frame = frame;")},Object.defineProperties(s,{AbstractFilter:{get:function(){return console.warn("filters.AbstractFilter is an undocumented alias, please use AbstractFilter from now on."),n.AbstractFilter}},FXAAFilter:{get:function(){return console.warn("filters.FXAAFilter is an undocumented alias, please use FXAAFilter from now on."),n.FXAAFilter}},SpriteMaskFilter:{get:function(){return console.warn("filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on."),n.SpriteMaskFilter}}}),n.utils.uuid=function(){return console.warn("utils.uuid() is deprecated, please use utils.uid() from now on."),n.utils.uid()}},{"./core":29,"./extras":85,"./filters":102,"./mesh":126}],79:[function(t,e,r){function n(t,e){i.Container.call(this),e=e||{},this.textWidth=0,this.textHeight=0,this._glyphs=[],this._font={tint:void 0!==e.tint?e.tint:16777215,align:e.align||"left",name:null,size:0},this.font=e.font,this._text=t,this.maxWidth=0,this.dirty=!1,this.updateText()}var i=t("../core");n.prototype=Object.create(i.Container.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{tint:{get:function(){return this._font.tint},set:function(t){this._font.tint="number"==typeof t&&t>=0?t:16777215,this.dirty=!0}},align:{get:function(){return this._font.align},set:function(t){this._font.align=t||"left",this.dirty=!0}},font:{get:function(){return this._font},set:function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):n.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),n.prototype.updateText=function(){for(var t=n.fonts[this._font.name],e=new i.Point,r=null,o=[],s=0,a=0,h=[],l=0,u=this._font.size/t.size,c=-1,f=0;f0&&e.x*u>this.maxWidth)o.splice(c,f-c),f=c,c=-1,h.push(s),a=Math.max(a,s),l++,e.x=0,e.y+=t.lineHeight,r=null;else{var p=t.chars[d];p&&(r&&p.kerning[r]&&(e.x+=p.kerning[r]),o.push({texture:p.texture,line:l,charCode:d,position:new i.Point(e.x+p.xOffset,e.y+p.yOffset)}),s=e.x+(p.texture.width+p.xOffset),e.x+=p.xAdvance,r=d)}}h.push(s),a=Math.max(a,s);var g=[];for(f=0;l>=f;f++){var A=0;"right"===this._font.align?A=a-h[f]:"center"===this._font.align&&(A=(a-h[f])/2),g.push(A)}var v=o.length,m=this.tint;for(f=0;v>f;f++){var y=this._glyphs[f];y?y.texture=o[f].texture:(y=new i.Sprite(o[f].texture),this._glyphs.push(y)),y.position.x=(o[f].position.x+g[o[f].line])*u,y.position.y=o[f].position.y*u,y.scale.x=y.scale.y=u,y.tint=m,y.parent||this.addChild(y)}for(f=v;fe?this.loop?this._texture=this._textures[this._textures.length-1+e%this._textures.length]:(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this.loop||e=this._textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())},n.prototype.destroy=function(){this.stop(),i.Sprite.prototype.destroy.call(this)},n.fromFrames=function(t){for(var e=[],r=0;ry?y:t,t=t>w?w:t,t=t>C?C:t,r=m,r=r>x?x:r,r=r>E?E:r,r=r>b?b:r,e=v,e=y>e?y:e,e=w>e?w:e,e=C>e?C:e,n=m,n=x>n?x:n,n=E>n?E:n,n=b>n?b:n;var B=this._bounds;return B.x=t,B.width=e-t,B.y=r,B.height=n-r,this._currentBounds=B,B},n.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,o);var e,r=this._width,n=this._height,i=-r*this.anchor.x;return o.x>i&&o.xe&&o.y 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 vec2 p = mod( uv / ( pixelSize * 0.5 ), 2.0) - vec2(1.0);\n col = col * character(n, p);\n\n gl_FragColor = vec4(col, 1.0);\n}\n",{dimensions:{type:"4fv",value:new Float32Array([0,0,0,0])},pixelSize:{type:"1f",value:8}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{size:{get:function(){return this.uniforms.pixelSize.value},set:function(t){this.uniforms.pixelSize.value=t}}})},{"../../core":29}],87:[function(t,e,r){function n(){i.AbstractFilter.call(this),this.blurXFilter=new o,this.blurYFilter=new s,this.defaultFilter=new i.AbstractFilter}var i=t("../../core"),o=t("../blur/BlurXFilter"),s=t("../blur/BlurYFilter");n.prototype=Object.create(i.AbstractFilter.prototype), -n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager.getRenderTarget(!0);this.defaultFilter.applyFilter(t,e,r),this.blurXFilter.applyFilter(t,e,n),t.blendModeManager.setBlendMode(i.BLEND_MODES.SCREEN),this.blurYFilter.applyFilter(t,n,r),t.blendModeManager.setBlendMode(i.BLEND_MODES.NORMAL),t.filterManager.returnRenderTarget(n)},Object.defineProperties(n.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t}},blurX:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t}},blurY:{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t}}})},{"../../core":29,"../blur/BlurXFilter":90,"../blur/BlurYFilter":91}],88:[function(t,e,r){function n(t,e){i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform float strength;\nuniform float dirX;\nuniform float dirY;\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vBlurTexCoords[3];\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n\n vBlurTexCoords[0] = aTextureCoord + vec2( (0.004 * strength) * dirX, (0.004 * strength) * dirY );\n vBlurTexCoords[1] = aTextureCoord + vec2( (0.008 * strength) * dirX, (0.008 * strength) * dirY );\n vBlurTexCoords[2] = aTextureCoord + vec2( (0.012 * strength) * dirX, (0.012 * strength) * dirY );\n\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vBlurTexCoords[3];\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = vec4(0.0);\n\n gl_FragColor += texture2D(uSampler, vTextureCoord ) * 0.3989422804014327;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 0]) * 0.2419707245191454;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 1]) * 0.05399096651318985;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 2]) * 0.004431848411938341;\n}\n",{strength:{type:"1f",value:1},dirX:{type:"1f",value:t||0},dirY:{type:"1f",value:e||0}}),this.defaultFilter=new i.AbstractFilter,this.passes=1,this.dirX=t||0,this.dirY=e||0,this.strength=4}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r,n){var i=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.width/e.size.width),1===this.passes)t.filterManager.applyFilter(i,e,r,n);else{var o=t.filterManager.getRenderTarget(!0);t.filterManager.applyFilter(i,e,o,n);for(var s=0;s>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=(n>>16&255)/255,l=(n>>8&255)/255,u=(255&n)/255,c=[.3,.59,.11,0,0,o,s,a,t,0,h,l,u,e,0,o-h,s-l,a-u,0,0];this._loadMatrix(c,i)},n.prototype.night=function(t,e){t=t||.1;var r=[-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},n.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)},n.prototype.lsd=function(t){var e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(e,t)},n.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)},Object.defineProperties(n.prototype,{matrix:{get:function(){return this.uniforms.m.value},set:function(t){this.uniforms.m.value=t}}})},{"../../core":29}],94:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float step;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n color = floor(color * step) / step;\n\n gl_FragColor = color;\n}\n",{step:{type:"1f",value:5}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{step:{get:function(){return this.uniforms.step.value},set:function(t){this.uniforms.step.value=t}}})},{"../../core":29}],95:[function(t,e,r){function n(t,e,r){i.AbstractFilter.call(this,null,"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",{matrix:{type:"1fv",value:new Float32Array(t)},texelSize:{type:"v2",value:{x:1/e,y:1/r}}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{matrix:{get:function(){return this.uniforms.matrix.value},set:function(t){this.uniforms.matrix.value=new Float32Array(t)}},width:{get:function(){return 1/this.uniforms.texelSize.value.x},set:function(t){this.uniforms.texelSize.value.x=1/t}},height:{get:function(){return 1/this.uniforms.texelSize.value.y},set:function(t){this.uniforms.texelSize.value.y=1/t}}})},{"../../core":29}],96:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"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")}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n},{"../../core":29}],97:[function(t,e,r){function n(t){var e=new i.Matrix;t.renderable=!1,i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMapCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec2 scale;\n\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nvoid main(void)\n{\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 map = texture2D(mapSampler, vMapCoord);\n\n map -= 0.5;\n map.xy *= scale;\n\n gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y));\n}\n",{mapSampler:{type:"sampler2D",value:t.texture},otherMatrix:{type:"mat3",value:e.toArray(!0)},scale:{type:"v2",value:{x:1,y:1}}}),this.maskSprite=t,this.maskMatrix=e,this.scale=new i.Point(20,20)}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager;n.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.scale.value.x=this.scale.x*(1/e.frame.width),this.uniforms.scale.value.y=this.scale.y*(1/e.frame.height);var i=this.getShader(t);n.applyFilter(i,e,r)},Object.defineProperties(n.prototype,{map:{get:function(){return this.uniforms.mapSampler.value},set:function(t){this.uniforms.mapSampler.value=t}}})},{"../../core":29}],98:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 dimensions;\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 * dimensions.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",{scale:{type:"1f",value:1},angle:{type:"1f",value:5},dimensions:{type:"4fv",value:[0,0,0,0]}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{scale:{get:function(){return this.uniforms.scale.value},set:function(t){this.uniforms.scale.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},{"../../core":29}],99:[function(t,e,r){function n(){i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform float strength;\nuniform vec2 offset;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vBlurTexCoords[6];\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3((aVertexPosition+offset), 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n\n vBlurTexCoords[ 0] = aTextureCoord + vec2(0.0, -0.012 * strength);\n vBlurTexCoords[ 1] = aTextureCoord + vec2(0.0, -0.008 * strength);\n vBlurTexCoords[ 2] = aTextureCoord + vec2(0.0, -0.004 * strength);\n vBlurTexCoords[ 3] = aTextureCoord + vec2(0.0, 0.004 * strength);\n vBlurTexCoords[ 4] = aTextureCoord + vec2(0.0, 0.008 * strength);\n vBlurTexCoords[ 5] = aTextureCoord + vec2(0.0, 0.012 * strength);\n\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vBlurTexCoords[6];\nvarying vec4 vColor;\n\nuniform vec3 color;\nuniform float alpha;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n vec4 sum = vec4(0.0);\n\n sum += texture2D(uSampler, vBlurTexCoords[ 0])*0.004431848411938341;\n sum += texture2D(uSampler, vBlurTexCoords[ 1])*0.05399096651318985;\n sum += texture2D(uSampler, vBlurTexCoords[ 2])*0.2419707245191454;\n sum += texture2D(uSampler, vTextureCoord )*0.3989422804014327;\n sum += texture2D(uSampler, vBlurTexCoords[ 3])*0.2419707245191454;\n sum += texture2D(uSampler, vBlurTexCoords[ 4])*0.05399096651318985;\n sum += texture2D(uSampler, vBlurTexCoords[ 5])*0.004431848411938341;\n\n gl_FragColor = vec4( color.rgb * sum.a * alpha, sum.a * alpha );\n}\n",{blur:{type:"1f",value:1/512},color:{type:"c",value:[0,0,0]},alpha:{type:"1f",value:.7},offset:{type:"2f",value:[5,5]},strength:{type:"1f",value:1}}),this.passes=1,this.strength=4}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r,n){var i=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.height/e.size.height),1===this.passes)t.filterManager.applyFilter(i,e,r,n);else{for(var o=t.filterManager.getRenderTarget(!0),s=e,a=o,h=0;h= (time - params.z)) )\n {\n float diff = (dist - time);\n float powDiff = 1.0 - pow(abs(diff*params.x), params.y);\n\n float diffTime = diff * powDiff;\n vec2 diffUV = normalize(uv - center);\n texCoord = uv + (diffUV * diffTime);\n }\n\n gl_FragColor = texture2D(uSampler, texCoord);\n}\n",{center:{type:"v2",value:{x:.5,y:.5}},params:{type:"v3",value:{x:10,y:.8,z:.1}},time:{type:"1f",value:0}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{center:{get:function(){return this.uniforms.center.value},set:function(t){this.uniforms.center.value=t}},params:{get:function(){return this.uniforms.params.value},set:function(t){this.uniforms.params.value=t}},time:{get:function(){return this.uniforms.time.value},set:function(t){this.uniforms.time.value=t}}})},{"../../core":29}],110:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying 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 gl_FragColor = color / total;\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n}\n",{blur:{type:"1f",value:100},gradientBlur:{type:"1f",value:600},start:{type:"v2",value:{x:0,y:window.innerHeight/2}},end:{type:"v2",value:{x:600,y:window.innerHeight/2}},delta:{type:"v2",value:{x:30,y:30}},texSize:{type:"v2",value:{x:window.innerWidth,y:window.innerHeight}}}),this.updateDelta()}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.updateDelta=function(){this.uniforms.delta.value.x=0,this.uniforms.delta.value.y=0},Object.defineProperties(n.prototype,{blur:{get:function(){return this.uniforms.blur.value},set:function(t){this.uniforms.blur.value=t}},gradientBlur:{get:function(){return this.uniforms.gradientBlur.value},set:function(t){this.uniforms.gradientBlur.value=t}},start:{get:function(){return this.uniforms.start.value},set:function(t){this.uniforms.start.value=t,this.updateDelta()}},end:{get:function(){return this.uniforms.end.value},set:function(t){this.uniforms.end.value=t,this.updateDelta()}}})},{"../../core":29}],111:[function(t,e,r){function n(){i.AbstractFilter.call(this),this.tiltShiftXFilter=new o,this.tiltShiftYFilter=new s}var i=t("../../core"),o=t("./TiltShiftXFilter"),s=t("./TiltShiftYFilter");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager.getRenderTarget(!0);this.tiltShiftXFilter.applyFilter(t,e,n),this.tiltShiftYFilter.applyFilter(t,n,r),t.filterManager.returnRenderTarget(n)},Object.defineProperties(n.prototype,{blur:{get:function(){return this.tiltShiftXFilter.blur},set:function(t){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=t}},gradientBlur:{get:function(){return this.tiltShiftXFilter.gradientBlur},set:function(t){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=t}},start:{get:function(){return this.tiltShiftXFilter.start},set:function(t){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=t}},end:{get:function(){return this.tiltShiftXFilter.end},set:function(t){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=t}}})},{"../../core":29,"./TiltShiftXFilter":112,"./TiltShiftYFilter":113}],112:[function(t,e,r){function n(){i.call(this)}var i=t("./TiltShiftAxisFilter");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=t/r,this.uniforms.delta.value.y=e/r}},{"./TiltShiftAxisFilter":110}],113:[function(t,e,r){function n(){i.call(this)}var i=t("./TiltShiftAxisFilter");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=-e/r,this.uniforms.delta.value.y=t/r}},{"./TiltShiftAxisFilter":110}],114:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord - offset;\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratio = (radius - dist) / radius;\n float angleMod = ratio * ratio * 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 gl_FragColor = texture2D(uSampler, coord+offset);\n}\n",{radius:{type:"1f",value:.5},angle:{type:"1f",value:5},offset:{type:"v2",value:{x:.5,y:.5}}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}},radius:{get:function(){return this.uniforms.radius.value},set:function(t){this.uniforms.radius.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},{"../../core":29}],115:[function(t,e,r){function n(){this.global=new i.Point,this.target=null,this.originalEvent=null}var i=t("../core");n.prototype.constructor=n,e.exports=n,n.prototype.getLocalPosition=function(t,e,r){var n=t.worldTransform,o=r?r:this.global,s=n.a,a=n.c,h=n.tx,l=n.b,u=n.d,c=n.ty,f=1/(s*u+a*-l);return e=e||new i.Point,e.x=u*f*o.x+-a*f*o.x+(c*a-h*u)*f,e.y=s*f*o.y+-l*f*o.y+(-c*s+h*l)*f,e}},{"../core":29}],116:[function(t,e,r){function n(t,e){e=e||{},this.renderer=t,this.autoPreventDefault=void 0!==e.autoPreventDefault?e.autoPreventDefault:!0,this.interactionFrequency=e.interactionFrequency||10,this.mouse=new o,this.eventData={stopped:!1,target:null,type:null,data:this.mouse,stopPropagation:function(){this.stopped=!0}},this.interactiveDataPool=[],this.interactionDOMElement=null,this.eventsAdded=!1,this.onMouseUp=this.onMouseUp.bind(this),this.processMouseUp=this.processMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.processMouseDown=this.processMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.processMouseMove=this.processMouseMove.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.processMouseOverOut=this.processMouseOverOut.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.processTouchStart=this.processTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.processTouchEnd=this.processTouchEnd.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.processTouchMove=this.processTouchMove.bind(this),this.last=0,this.currentCursorStyle="inherit",this._tempPoint=new i.Point,this.resolution=1,this.setTargetElement(this.renderer.view,this.renderer.resolution)}var i=t("../core"),o=t("./InteractionData");Object.assign(i.DisplayObject.prototype,t("./interactiveTarget")),n.prototype.constructor=n,e.exports=n,n.prototype.setTargetElement=function(t,e){this.removeEvents(),this.interactionDOMElement=t,this.resolution=e||1,this.addEvents()},n.prototype.addEvents=function(){this.interactionDOMElement&&(i.ticker.shared.add(this.update,this),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"),window.document.addEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.addEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.addEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!0)},n.prototype.removeEvents=function(){this.interactionDOMElement&&(i.ticker.shared.remove(this.update),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""),window.document.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!1)},n.prototype.update=function(t){if(this._deltaTime+=t,!(this._deltaTime=0;a--)!s&&n?s=this.processInteractive(t,o[a],r,!0,i):this.processInteractive(t,o[a],r,!1,!1);return i&&(n&&(e.hitArea?(e.worldTransform.applyInverse(t,this._tempPoint),s=e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)):e.containsPoint&&(s=e.containsPoint(t))),e.interactive&&r(e,s)),s},n.prototype.onMouseDown=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.autoPreventDefault&&this.mouse.originalEvent.preventDefault(),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseDown,!0)},n.prototype.processMouseDown=function(t,e){var r=this.mouse.originalEvent,n=2===r.button||3===r.which;e&&(t[n?"_isRightDown":"_isLeftDown"]=!0,this.dispatchEvent(t,n?"rightdown":"mousedown",this.eventData))},n.prototype.onMouseUp=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseUp,!0)},n.prototype.processMouseUp=function(t,e){var r=this.mouse.originalEvent,n=2===r.button||3===r.which,i=n?"_isRightDown":"_isLeftDown";e?(this.dispatchEvent(t,n?"rightup":"mouseup",this.eventData),t[i]&&(t[i]=!1,this.dispatchEvent(t,n?"rightclick":"click",this.eventData))):t[i]&&(t[i]=!1,this.dispatchEvent(t,n?"rightupoutside":"mouseupoutside",this.eventData))},n.prototype.onMouseMove=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.didMove=!0,this.cursor="inherit",this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseMove,!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor)},n.prototype.processMouseMove=function(t,e){this.dispatchEvent(t,"mousemove",this.eventData),this.processMouseOverOut(t,e)},n.prototype.onMouseOut=function(t){this.mouse.originalEvent=t,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.interactionDOMElement.style.cursor="inherit",this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut,!1)},n.prototype.processMouseOverOut=function(t,e){e?(t._over||(t._over=!0,this.dispatchEvent(t,"mouseover",this.eventData)),t.buttonMode&&(this.cursor=t.defaultCursor)):t._over&&(t._over=!1,this.dispatchEvent(t,"mouseout",this.eventData))},n.prototype.onTouchStart=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,n=0;r>n;n++){var i=e[n],o=this.getTouchData(i);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchStart,!0),this.returnTouchData(o)}},n.prototype.processTouchStart=function(t,e){e&&(t._touchDown=!0,this.dispatchEvent(t,"touchstart",this.eventData))},n.prototype.onTouchEnd=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,n=0;r>n;n++){var i=e[n],o=this.getTouchData(i);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchEnd,!0),this.returnTouchData(o)}},n.prototype.processTouchEnd=function(t,e){e?(this.dispatchEvent(t,"touchend",this.eventData),t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"tap",this.eventData))):t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"touchendoutside",this.eventData))},n.prototype.onTouchMove=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,n=0;r>n;n++){var i=e[n],o=this.getTouchData(i);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchMove,!1),this.returnTouchData(o)}},n.prototype.processTouchMove=function(t,e){e=e,this.dispatchEvent(t,"touchmove",this.eventData)},n.prototype.getTouchData=function(t){var e=this.interactiveDataPool.pop();return e||(e=new o),e.identifier=t.identifier,this.mapPositionToPoint(e.global,t.clientX,t.clientY),navigator.isCocoonJS&&(e.global.x=e.global.x/this.resolution,e.global.y=e.global.y/this.resolution),t.globalX=e.global.x,t.globalY=e.global.y,e},n.prototype.returnTouchData=function(t){this.interactiveDataPool.push(t)},n.prototype.destroy=function(){this.removeEvents(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactiveDataPool=null,this.interactionDOMElement=null,this.onMouseUp=null,this.processMouseUp=null,this.onMouseDown=null,this.processMouseDown=null,this.onMouseMove=null,this.processMouseMove=null,this.onMouseOut=null,this.processMouseOverOut=null,this.onTouchStart=null,this.processTouchStart=null,this.onTouchEnd=null,this.processTouchEnd=null,this.onTouchMove=null,this.processTouchMove=null,this._tempPoint=null},i.WebGLRenderer.registerPlugin("interaction",n),i.CanvasRenderer.registerPlugin("interaction",n)},{"../core":29,"./InteractionData":115,"./interactiveTarget":118}],117:[function(t,e,r){e.exports={InteractionData:t("./InteractionData"),InteractionManager:t("./InteractionManager"),interactiveTarget:t("./interactiveTarget")}},{"./InteractionData":115,"./InteractionManager":116,"./interactiveTarget":118}],118:[function(t,e,r){var n={interactive:!1,buttonMode:!1,interactiveChildren:!0,defaultCursor:"pointer",_over:!1,_touchDown:!1};e.exports=n},{}],119:[function(t,e,r){function n(t,e){var r={},n=t.data.getElementsByTagName("info")[0],i=t.data.getElementsByTagName("common")[0];r.font=n.getAttribute("face"),r.size=parseInt(n.getAttribute("size"),10),r.lineHeight=parseInt(i.getAttribute("lineHeight"),10),r.chars={};for(var a=t.data.getElementsByTagName("char"),h=0;hi;i++){var o=2*i;this._renderCanvasDrawTriangle(t,e,r,o,o+2,o+4)}},n.prototype._renderCanvasTriangles=function(t){for(var e=this.vertices,r=this.uvs,n=this.indices,i=n.length,o=0;i>o;o+=3){var s=2*n[o],a=2*n[o+1],h=2*n[o+2];this._renderCanvasDrawTriangle(t,e,r,s,a,h)}},n.prototype._renderCanvasDrawTriangle=function(t,e,r,n,i,o){var s=this._texture.baseTexture.source,a=this._texture.baseTexture.width,h=this._texture.baseTexture.height,l=e[n],u=e[i],c=e[o],f=e[n+1],d=e[i+1],p=e[o+1],g=r[n]*a,A=r[i]*a,v=r[o]*a,m=r[n+1]*h,y=r[i+1]*h,x=r[o+1]*h;if(this.canvasPadding>0){var w=this.canvasPadding/this.worldTransform.a,E=this.canvasPadding/this.worldTransform.d,C=(l+u+c)/3,b=(f+d+p)/3,B=l-C,T=f-b,D=Math.sqrt(B*B+T*T);l=C+B/D*(D+w),f=b+T/D*(D+E),B=u-C,T=d-b,D=Math.sqrt(B*B+T*T),u=C+B/D*(D+w),d=b+T/D*(D+E),B=c-C,T=p-b,D=Math.sqrt(B*B+T*T),c=C+B/D*(D+w),p=b+T/D*(D+E)}t.save(),t.beginPath(),t.moveTo(l,f),t.lineTo(u,d),t.lineTo(c,p),t.closePath(),t.clip();var M=g*y+m*v+A*x-y*v-m*A-g*x,P=l*y+m*c+u*x-y*c-m*u-l*x,R=g*u+l*v+A*c-u*v-l*A-g*c,I=g*y*c+m*u*v+l*A*x-l*y*v-m*A*c-g*u*x,S=f*y+m*p+d*x-y*p-m*d-f*x,O=g*d+f*v+A*p-d*v-f*A-g*p,F=g*y*p+m*d*v+f*A*x-f*y*v-m*A*p-g*d*x;t.transform(P/M,S/M,R/M,O/M,I/M,F/M),t.drawImage(s,0,0),t.restore()},n.prototype.renderMeshFlat=function(t){var e=this.context,r=t.vertices,n=r.length/2;e.beginPath();for(var i=1;n-2>i;i++){var o=2*i,s=r[o],a=r[o+2],h=r[o+4],l=r[o+1],u=r[o+3],c=r[o+5];e.moveTo(s,l),e.lineTo(a,u),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},n.prototype._onTextureUpdate=function(){this.updateFrame=!0},n.prototype.getBounds=function(t){if(!this._currentBounds){for(var e=t||this.worldTransform,r=e.a,n=e.b,o=e.c,s=e.d,a=e.tx,h=e.ty,l=-(1/0),u=-(1/0),c=1/0,f=1/0,d=this.vertices,p=0,g=d.length;g>p;p+=2){var A=d[p],v=d[p+1],m=r*A+o*v+a,y=s*v+n*A+h;c=c>m?m:c,f=f>y?y:f,l=m>l?m:l,u=y>u?y:u}if(c===-(1/0)||u===1/0)return i.Rectangle.EMPTY;var x=this._bounds;x.x=c,x.width=l-c,x.y=f,x.height=u-f,this._currentBounds=x}return this._currentBounds},n.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,o);var e,r,i=this.vertices,a=s.points;if(this.drawMode===n.DRAW_MODES.TRIANGLES){var h=this.indices;for(r=this.indices.length,e=0;r>e;e+=3){var l=2*h[e],u=2*h[e+1],c=2*h[e+2];if(a[0]=i[l],a[1]=i[l+1],a[2]=i[u],a[3]=i[u+1],a[4]=i[c],a[5]=i[c+1],s.contains(o.x,o.y))return!0}}else for(r=i.length,e=0;r>e;e+=6)if(a[0]=i[e],a[1]=i[e+1],a[2]=i[e+2],a[3]=i[e+3],a[4]=i[e+4],a[5]=i[e+5],s.contains(o.x,o.y))return!0;return!1},n.DRAW_MODES={TRIANGLE_MESH:0,TRIANGLES:1}},{"../core":29}],125:[function(t,e,r){function n(t,e){i.call(this,t),this.points=e,this.vertices=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length), -this.indices=new Uint16Array(2*e.length),this._ready=!0,this.refresh()}var i=t("./Mesh"),o=t("../core");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.refresh=function(){var t=this.points;if(!(t.length<1)&&this._texture._uvs){var e=this.uvs,r=this.indices,n=this.colors,i=this._texture._uvs,s=new o.Point(i.x0,i.y0),a=new o.Point(i.x2-i.x0,i.y2-i.y0);e[0]=0+s.x,e[1]=0+s.y,e[2]=0+s.x,e[3]=1*a.y+s.y,n[0]=1,n[1]=1,r[0]=0,r[1]=1;for(var h,l,u,c=t.length,f=1;c>f;f++)h=t[f],l=4*f,u=f/(c-1),e[l]=u*a.x+s.x,e[l+1]=0+s.y,e[l+2]=u*a.x+s.x,e[l+3]=1*a.y+s.y,l=2*f,n[l]=1,n[l+1]=1,l=2*f,r[l]=l,r[l+1]=l+1;this.dirty=!0}},n.prototype._onTextureUpdate=function(){i.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()},n.prototype.updateTransform=function(){var t=this.points;if(!(t.length<1)){for(var e,r,n,i,o,s,a=t[0],h=0,l=0,u=this.vertices,c=t.length,f=0;c>f;f++)r=t[f],n=4*f,e=f1&&(i=1),o=Math.sqrt(h*h+l*l),s=this._texture.height/2,h/=o,l/=o,h*=s,l*=s,u[n]=r.x+h,u[n+1]=r.y+l,u[n+2]=r.x-h,u[n+3]=r.y-l,a=r;this.containerUpdateTransform()}}},{"../core":29,"./Mesh":124}],126:[function(t,e,r){e.exports={Mesh:t("./Mesh"),Rope:t("./Rope"),MeshRenderer:t("./webgl/MeshRenderer"),MeshShader:t("./webgl/MeshShader")}},{"./Mesh":124,"./Rope":125,"./webgl/MeshRenderer":127,"./webgl/MeshShader":128}],127:[function(t,e,r){function n(t){i.ObjectRenderer.call(this,t),this.indices=new Uint16Array(15e3);for(var e=0,r=0;15e3>e;e+=6,r+=4)this.indices[e+0]=r+0,this.indices[e+1]=r+1,this.indices[e+2]=r+2,this.indices[e+3]=r+0,this.indices[e+4]=r+2,this.indices[e+5]=r+3}var i=t("../../core"),o=t("../Mesh");n.prototype=Object.create(i.ObjectRenderer.prototype),n.prototype.constructor=n,e.exports=n,i.WebGLRenderer.registerPlugin("mesh",n),n.prototype.onContextChange=function(){},n.prototype.render=function(t){t._vertexBuffer||this._initWebGL(t);var e=this.renderer,r=e.gl,n=t._texture.baseTexture,i=e.shaderManager.plugins.meshShader,s=t.drawMode===o.DRAW_MODES.TRIANGLE_MESH?r.TRIANGLE_STRIP:r.TRIANGLES;e.blendModeManager.setBlendMode(t.blendMode),r.uniformMatrix3fv(i.uniforms.translationMatrix._location,!1,t.worldTransform.toArray(!0)),r.uniformMatrix3fv(i.uniforms.projectionMatrix._location,!1,e.currentRenderTarget.projectionMatrix.toArray(!0)),r.uniform1f(i.uniforms.alpha._location,t.worldAlpha),t.dirty?(t.dirty=!1,r.bindBuffer(r.ARRAY_BUFFER,t._vertexBuffer),r.bufferData(r.ARRAY_BUFFER,t.vertices,r.STATIC_DRAW),r.vertexAttribPointer(i.attributes.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,t._uvBuffer),r.bufferData(r.ARRAY_BUFFER,t.uvs,r.STATIC_DRAW),r.vertexAttribPointer(i.attributes.aTextureCoord,2,r.FLOAT,!1,0,0),r.activeTexture(r.TEXTURE0),n._glTextures[r.id]?r.bindTexture(r.TEXTURE_2D,n._glTextures[r.id]):this.renderer.updateTexture(n),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._indexBuffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.indices,r.STATIC_DRAW)):(r.bindBuffer(r.ARRAY_BUFFER,t._vertexBuffer),r.bufferSubData(r.ARRAY_BUFFER,0,t.vertices),r.vertexAttribPointer(i.attributes.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,t._uvBuffer),r.vertexAttribPointer(i.attributes.aTextureCoord,2,r.FLOAT,!1,0,0),r.activeTexture(r.TEXTURE0),n._glTextures[r.id]?r.bindTexture(r.TEXTURE_2D,n._glTextures[r.id]):this.renderer.updateTexture(n),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._indexBuffer),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,t.indices)),r.drawElements(s,t.indices.length,r.UNSIGNED_SHORT,0)},n.prototype._initWebGL=function(t){var e=this.renderer.gl;t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.vertices,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),t.colors&&(t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW)),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},n.prototype.flush=function(){},n.prototype.start=function(){var t=this.renderer.shaderManager.plugins.meshShader;this.renderer.shaderManager.setShader(t)},n.prototype.destroy=function(){}},{"../../core":29,"../Mesh":124}],128:[function(t,e,r){function n(t){i.Shader.call(this,t,["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * alpha ;","}"].join("\n"),{alpha:{type:"1f",value:0},translationMatrix:{type:"mat3",value:new Float32Array(9)},projectionMatrix:{type:"mat3",value:new Float32Array(9)}},{aVertexPosition:0,aTextureCoord:0})}var i=t("../../core");n.prototype=Object.create(i.Shader.prototype),n.prototype.constructor=n,e.exports=n,i.ShaderManager.registerPlugin("meshShader",n)},{"../../core":29}],129:[function(t,e,r){Object.assign||(Object.assign=t("object-assign"))},{"object-assign":12}],130:[function(t,e,r){t("./Object.assign"),t("./requestAnimationFrame")},{"./Object.assign":129,"./requestAnimationFrame":131}],131:[function(t,e,r){(function(t){if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var r=Date.now(),n=["ms","moz","webkit","o"],i=0;in&&(n=0),r=e,setTimeout(function(){r=Date.now(),t(performance.now())},n)}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.html2canvas=t()}}(function(){var t;return function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){var h="function"==typeof require&&require;if(!a&&h)return h(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[s]={exports:{}};t[s][0].call(u.exports,function(e){var r=t[s][1][e];return i(r?r:e)},u,u.exports,e,t,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;st;t+=2){var e=rt[t],r=rt[t+1];e(r),rt[t]=void 0,rt[t+1]=void 0}V=0}function A(){try{var t=e,r=t("vertx");return J=r.runOnLoop||r.runOnContext,c()}catch(n){return p()}}function v(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function y(){return new TypeError("A promises callback cannot return that same promise.")}function x(t){try{return t.then}catch(e){return st.error=e,st}}function w(t,e,r,n){try{t.call(e,r,n)}catch(i){return i}}function E(t,e,r){Z(function(t){var n=!1,i=w(r,e,function(r){n||(n=!0,e!==r?B(t,r):D(t,r))},function(e){n||(n=!0,M(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&i&&(n=!0,M(t,i))},t)}function C(t,e){e._state===it?D(t,e._result):e._state===ot?M(t,e._result):P(e,void 0,function(e){B(t,e)},function(e){M(t,e)})}function b(t,e){if(e.constructor===t.constructor)C(t,e);else{var r=x(e);r===st?M(t,st.error):void 0===r?D(t,e):s(r)?E(t,e,r):D(t,e)}}function B(t,e){t===e?M(t,m()):o(e)?b(t,e):D(t,e)}function T(t){t._onerror&&t._onerror(t._result),R(t)}function D(t,e){t._state===nt&&(t._result=e,t._state=it,0!==t._subscribers.length&&Z(R,t))}function M(t,e){t._state===nt&&(t._state=ot,t._result=e,Z(T,t))}function P(t,e,r,n){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+it]=r,i[o+ot]=n,0===o&&t._state&&Z(R,t)}function R(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n,i,o=t._result,s=0;ss;s++)P(n.resolve(t[s]),void 0,e,r);return i}function H(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(v);return B(r,t),r}function k(t){var e=this,r=new e(v);return M(r,t),r}function G(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Y(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function j(t){this._id=dt++,this._state=void 0,this._result=void 0,this._subscribers=[],v!==t&&(s(t)||G(),this instanceof j||Y(),F(this,t))}function z(){var t;if("undefined"!=typeof i)t=i;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=t.Promise;(!r||"[object Promise]"!==Object.prototype.toString.call(r.resolve())||r.cast)&&(t.Promise=pt)}var U;U=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var J,X,W,K=U,V=0,Z=({}.toString,function(t,e){rt[V]=t,rt[V+1]=e,V+=2,2===V&&(X?X(g):W())}),q="undefined"!=typeof window?window:void 0,_=q||{},$=_.MutationObserver||_.WebKitMutationObserver,tt="undefined"!=typeof n&&"[object process]"==={}.toString.call(n),et="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,rt=new Array(1e3);W=tt?u():$?f():et?d():void 0===q&&"function"==typeof e?A():p();var nt=void 0,it=1,ot=2,st=new I,at=new I;Q.prototype._validateInput=function(t){return K(t)},Q.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},Q.prototype._init=function(){this._result=new Array(this.length)};var ht=Q;Q.prototype._enumerate=function(){for(var t=this,e=t.length,r=t.promise,n=t._input,i=0;r._state===nt&&e>i;i++)t._eachEntry(n[i],i)},Q.prototype._eachEntry=function(t,e){var r=this,n=r._instanceConstructor;a(t)?t.constructor===n&&t._state!==nt?(t._onerror=null,r._settledAt(t._state,e,t._result)):r._willSettleAt(n.resolve(t),e):(r._remaining--,r._result[e]=t)},Q.prototype._settledAt=function(t,e,r){var n=this,i=n.promise;i._state===nt&&(n._remaining--,t===ot?M(i,r):n._result[e]=r),0===n._remaining&&D(i,n._result)},Q.prototype._willSettleAt=function(t,e){var r=this;P(t,void 0,function(t){r._settledAt(it,e,t)},function(t){r._settledAt(ot,e,t)})};var lt=L,ut=N,ct=H,ft=k,dt=0,pt=j;j.all=lt,j.race=ut,j.resolve=ct,j.reject=ft,j._setScheduler=h,j._setAsap=l,j._asap=Z,j.prototype={constructor:j,then:function(t,e){var r=this,n=r._state;if(n===it&&!t||n===ot&&!e)return this;var i=new this.constructor(v),o=r._result;if(n){var s=arguments[n-1];Z(function(){O(n,i,s,o)})}else P(r,i,t,e);return i},"catch":function(t){return this.then(null,t)}};var gt=z,At={Promise:pt,polyfill:gt};"function"==typeof t&&t.amd?t(function(){return At}):"undefined"!=typeof r&&r.exports?r.exports=At:"undefined"!=typeof this&&(this.ES6Promise=At),gt()}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:2}],2:[function(t,e,r){function n(){u=!1,a.length?l=a.concat(l):c=-1,l.length&&i()}function i(){if(!u){var t=setTimeout(n);u=!0;for(var e=l.length;e;){for(a=l,l=[];++c1)for(var r=1;r1&&(n=r[0]+"@",t=r[1]),t=t.replace(O,".");var i=t.split("."),o=s(i,e).join(".");return n+o}function h(t){for(var e,r,n=[],i=0,o=t.length;o>i;)e=t.charCodeAt(i++),e>=55296&&56319>=e&&o>i?(r=t.charCodeAt(i++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--)):n.push(e);return n}function l(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=N(t>>>10&1023|55296),t=56320|1023&t),e+=N(t)}).join("")}function u(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:C}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?L(t/D):t>>1,t+=L(t/e);t>Q*B>>1;n+=C)t=L(t/Q);return L(n+(Q+1)*t/(t+T))}function d(t){var e,r,n,i,s,a,h,c,d,p,g=[],A=t.length,v=0,m=P,y=M;for(r=t.lastIndexOf(R),0>r&&(r=0),n=0;r>n;++n)t.charCodeAt(n)>=128&&o("not-basic"),g.push(t.charCodeAt(n));for(i=r>0?r+1:0;A>i;){for(s=v,a=1,h=C;i>=A&&o("invalid-input"),c=u(t.charCodeAt(i++)),(c>=C||c>L((E-v)/a))&&o("overflow"),v+=c*a,d=y>=h?b:h>=y+B?B:h-y,!(d>c);h+=C)p=C-d,a>L(E/p)&&o("overflow"),a*=p;e=g.length+1,y=f(v-s,e,0==s),L(v/e)>E-m&&o("overflow"),m+=L(v/e),v%=e,g.splice(v++,0,m)}return l(g)}function p(t){var e,r,n,i,s,a,l,u,d,p,g,A,v,m,y,x=[];for(t=h(t),A=t.length,e=P,r=0,s=M,a=0;A>a;++a)g=t[a],128>g&&x.push(N(g));for(n=i=x.length,i&&x.push(R);A>n;){for(l=E,a=0;A>a;++a)g=t[a],g>=e&&l>g&&(l=g);for(v=n+1,l-e>L((E-r)/v)&&o("overflow"),r+=(l-e)*v,e=l,a=0;A>a;++a)if(g=t[a],e>g&&++r>E&&o("overflow"),g==e){for(u=r,d=C;p=s>=d?b:d>=s+B?B:d-s,!(p>u);d+=C)y=u-p,m=C-p,x.push(N(c(p+y%m,0))),u=L(y/m);x.push(N(c(u,0))),s=f(r,v,n==i),r=0,++n}++r,++e}return x.join("")}function g(t){return a(t,function(t){return I.test(t)?d(t.slice(4).toLowerCase()):t})}function A(t){return a(t,function(t){return S.test(t)?"xn--"+p(t):t})}var v="object"==typeof n&&n&&!n.nodeType&&n,m="object"==typeof r&&r&&!r.nodeType&&r,y="object"==typeof e&&e;(y.global===y||y.window===y||y.self===y)&&(i=y);var x,w,E=2147483647,C=36,b=1,B=26,T=38,D=700,M=72,P=128,R="-",I=/^xn--/,S=/[^\x20-\x7E]/,O=/[\x2E\u3002\uFF0E\uFF61]/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Q=C-b,L=Math.floor,N=String.fromCharCode;if(x={version:"1.3.2",ucs2:{decode:h,encode:l},decode:d,encode:p,toASCII:A,toUnicode:g},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return x});else if(v&&m)if(r.exports==v)m.exports=x;else for(w in x)x.hasOwnProperty(w)&&(v[w]=x[w]);else i.punycode=x}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(t,e,r){function n(t,e,r){!t.defaultView||e===t.defaultView.pageXOffset&&r===t.defaultView.pageYOffset||t.defaultView.scrollTo(e,r)}function i(t,e){try{e&&(e.width=t.width,e.height=t.height,e.getContext("2d").putImageData(t.getContext("2d").getImageData(0,0,t.width,t.height),0,0))}catch(r){a("Unable to copy canvas content from",t,r)}}function o(t,e){for(var r=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),n=t.firstChild;n;)(e===!0||1!==n.nodeType||"SCRIPT"!==n.nodeName)&&(console.log(r),r.appendChild(o(n,e))),n=n.nextSibling;return 1===t.nodeType&&"BODY"!==t.tagName&&(r._scrollTop=t.scrollTop,r._scrollLeft=t.scrollLeft,"CANVAS"===t.nodeName?i(t,r):("TEXTAREA"===t.nodeName||"SELECT"===t.nodeName)&&(r.value=t.value)),r}function s(t){if(1===t.nodeType){t.scrollTop=t._scrollTop,t.scrollLeft=t._scrollLeft;for(var e=t.firstChild;e;)s(e),e=e.nextSibling}}var a=t("./log"),h=t("./promise");e.exports=function(t,e,r,i,a,l,u){var c=o(t.documentElement,a.javascriptEnabled),f=e.createElement("iframe");return f.className="html2canvas-container",f.style.visibility="hidden",f.style.position="fixed",f.style.left="-10000px",f.style.top="0px",f.style.border="0",f.style.border="0",f.width=r,f.height=i,f.scrolling="no",e.body.appendChild(f),new h(function(e){var r=f.contentWindow.document;f.contentWindow.onload=f.onload=function(){var t=setInterval(function(){r.body.childNodes.length>0&&(s(r.documentElement),clearInterval(t),"view"===a.type&&(f.contentWindow.scrollTo(l,u),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||f.contentWindow.scrollY===u&&f.contentWindow.scrollX===l||(r.documentElement.style.top=-u+"px",r.documentElement.style.left=-l+"px",r.documentElement.style.position="absolute")),e(f))},50)},r.open(),r.write(""),n(t,l,u),r.replaceChild(r.adoptNode(c),r.documentElement),r.close()})}},{"./log":15,"./promise":18}],5:[function(t,e,r){function n(t){this.r=0,this.g=0,this.b=0,this.a=null;this.fromArray(t)||this.namedColor(t)||this.rgb(t)||this.rgba(t)||this.hex6(t)||this.hex3(t)}n.prototype.darken=function(t){var e=1-t;return new n([Math.round(this.r*e),Math.round(this.g*e),Math.round(this.b*e),this.a])},n.prototype.isTransparent=function(){return 0===this.a},n.prototype.isBlack=function(){return 0===this.r&&0===this.g&&0===this.b},n.prototype.fromArray=function(t){return Array.isArray(t)&&(this.r=Math.min(t[0],255),this.g=Math.min(t[1],255),this.b=Math.min(t[2],255),t.length>3&&(this.a=t[3])),Array.isArray(t)};var i=/^#([a-f0-9]{3})$/i;n.prototype.hex3=function(t){var e=null;return null!==(e=t.match(i))&&(this.r=parseInt(e[1][0]+e[1][0],16),this.g=parseInt(e[1][1]+e[1][1],16),this.b=parseInt(e[1][2]+e[1][2],16)),null!==e};var o=/^#([a-f0-9]{6})$/i;n.prototype.hex6=function(t){var e=null;return null!==(e=t.match(o))&&(this.r=parseInt(e[1].substring(0,2),16),this.g=parseInt(e[1].substring(2,4),16),this.b=parseInt(e[1].substring(4,6),16)),null!==e};var s=/^rgb\((\d{1,3}) *, *(\d{1,3}) *, *(\d{1,3})\)$/;n.prototype.rgb=function(t){var e=null;return null!==(e=t.match(s))&&(this.r=Number(e[1]),this.g=Number(e[2]),this.b=Number(e[3])),null!==e};var a=/^rgba\((\d{1,3}) *, *(\d{1,3}) *, *(\d{1,3}) *, *(\d+\.?\d*)\)$/;n.prototype.rgba=function(t){var e=null;return null!==(e=t.match(a))&&(this.r=Number(e[1]),this.g=Number(e[2]),this.b=Number(e[3]),this.a=Number(e[4])),null!==e},n.prototype.toString=function(){return null!==this.a&&1!==this.a?"rgba("+[this.r,this.g,this.b,this.a].join(",")+")":"rgb("+[this.r,this.g,this.b].join(",")+")"},n.prototype.namedColor=function(t){var e=h[t.toLowerCase()];if(e)this.r=e[0],this.g=e[1],this.b=e[2];else if("transparent"===t.toLowerCase())return this.r=this.g=this.b=this.a=0,!0;return!!e},n.prototype.isColor=!0;var h={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};e.exports=n},{}],6:[function(t,e,r){function n(t,e){var r=C++;if(e=e||{},e.logging&&(window.html2canvas.logging=!0,window.html2canvas.start=Date.now()),e.async="undefined"==typeof e.async?!0:e.async,e.allowTaint="undefined"==typeof e.allowTaint?!1:e.allowTaint,e.removeContainer="undefined"==typeof e.removeContainer?!0:e.removeContainer,e.javascriptEnabled="undefined"==typeof e.javascriptEnabled?!1:e.javascriptEnabled,e.imageTimeout="undefined"==typeof e.imageTimeout?1e4:e.imageTimeout,e.renderer="function"==typeof e.renderer?e.renderer:d,e.strict=!!e.strict,"string"==typeof t){if("string"!=typeof e.proxy)return c.reject("Proxy must be used when rendering url");var n=null!=e.width?e.width:window.innerWidth,s=null!=e.height?e.height:window.innerHeight;return x(u(t),e.proxy,document,n,s,e).then(function(t){return o(t.contentWindow.document.documentElement,t,e,n,s)})}var a=(void 0===t?[document.documentElement]:t.length?t:[t])[0];return a.setAttribute(E+r,r),i(a.ownerDocument,e,a.ownerDocument.defaultView.innerWidth,a.ownerDocument.defaultView.innerHeight,r).then(function(t){return"function"==typeof e.onrendered&&(v("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas"),e.onrendered(t)),t})}function i(t,e,r,n,i){return y(t,t,r,n,e,t.defaultView.pageXOffset,t.defaultView.pageYOffset).then(function(s){v("Document cloned");var a=E+i,h="["+a+"='"+i+"']";t.querySelector(h).removeAttribute(a);var l=s.contentWindow,u=l.document.querySelector(h);"0"===u.style.opacity&&"webgl"===u.getAttribute("renderer")?u.style.opacity=1:null;var f="function"==typeof e.onclone?c.resolve(e.onclone(l.document)):c.resolve(!0);return f.then(function(){return o(u,s,e,r,n)})})}function o(t,e,r,n,i){var o=e.contentWindow,u=new f(o.document),c=new p(r,u),d=w(t),A="view"===r.type?n:h(o.document),m="view"===r.type?i:l(o.document),y=new r.renderer(A,m,c,r,document),x=new g(t,y,u,c,r);return x.ready.then(function(){v("Finished rendering");var n;return"view"===r.type?n=a(y.canvas,{width:y.canvas.width,height:y.canvas.height,top:0,left:0,x:0,y:0}):t===o.document.body||t===o.document.documentElement||null!=r.canvas?n=y.canvas:(1!==window.devicePixelRatio&&(d.top=d.top*window.devicePixelRatio,d.left=d.left*window.devicePixelRatio,d.right=d.right*window.devicePixelRatio,d.bottom=d.bottom*window.devicePixelRatio),n=a(y.canvas,{width:null!=r.width?r.width:d.width,height:null!=r.height?r.height:d.height,top:d.top,left:d.left,x:o.pageXOffset,y:o.pageYOffset})),s(e,r),n})}function s(t,e){e.removeContainer&&(t.parentNode.removeChild(t),v("Cleaned up container"))}function a(t,e){var r=document.createElement("canvas"),n=Math.min(t.width-1,Math.max(0,e.left)),i=Math.min(t.width,Math.max(1,e.left+e.width)),o=Math.min(t.height-1,Math.max(0,e.top)),s=Math.min(t.height,Math.max(1,e.top+e.height));return r.width=e.width,r.height=e.height,v("Cropping canvas at:","left:",e.left,"top:",e.top,"width:",i-n,"height:",s-o),v("Resulting crop with width",e.width,"and height",e.height," with x",n,"and y",o),r.getContext("2d").drawImage(t,n,o,i-n,s-o,e.x,e.y,i-n,s-o),r}function h(t){return Math.max(Math.max(t.body.scrollWidth,t.documentElement.scrollWidth),Math.max(t.body.offsetWidth,t.documentElement.offsetWidth),Math.max(t.body.clientWidth,t.documentElement.clientWidth))}function l(t){return Math.max(Math.max(t.body.scrollHeight,t.documentElement.scrollHeight),Math.max(t.body.offsetHeight,t.documentElement.offsetHeight),Math.max(t.body.clientHeight,t.documentElement.clientHeight))}function u(t){var e=document.createElement("a");return e.href=t,e.href=e.href,e}var c=t("./promise"),f=t("./support"),d=t("./renderers/canvas"),p=t("./imageloader"),g=t("./nodeparser"),A=t("./nodecontainer"),v=t("./log"),m=t("./utils"),y=t("./clone"),x=t("./proxy").loadUrlDocument,w=m.getBounds,E="data-html2canvas-node",C=0;n.Promise=c,n.CanvasRenderer=d,n.NodeContainer=A,n.log=v,n.utils=m,e.exports="undefined"==typeof document||"function"!=typeof Object.create||"function"!=typeof document.createElement("canvas").getContext?function(){return c.reject("No canvas support")}:n},{"./clone":4,"./imageloader":13,"./log":15,"./nodecontainer":16,"./nodeparser":17,"./promise":18,"./proxy":19,"./renderers/canvas":23,"./support":25,"./utils":29}],7:[function(t,e,r){function n(t){if(this.src=t,o("DummyImageContainer for",t),!this.promise||!this.image){o("Initiating DummyImageContainer"),n.prototype.image=new Image;var e=this.image;n.prototype.promise=new i(function(t,r){e.onload=t,e.onerror=r,e.src=s(),e.complete===!0&&t(e)})}}var i=t("./promise"),o=t("./log"),s=t("./utils").smallImage;e.exports=n},{"./log":15,"./promise":18,"./utils":29}],8:[function(t,e,r){function n(t,e){var r,n,o=document.createElement("div"),s=document.createElement("img"),a=document.createElement("span"),h="Hidden Text";o.style.visibility="hidden",o.style.fontFamily=t,o.style.fontSize=e,o.style.margin=0,o.style.padding=0,document.body.appendChild(o),s.src=i(),s.width=1,s.height=1,s.style.margin=0,s.style.padding=0,s.style.verticalAlign="baseline",a.style.fontFamily=t,a.style.fontSize=e,a.style.margin=0,a.style.padding=0,a.appendChild(document.createTextNode(h)),o.appendChild(a),o.appendChild(s),r=s.offsetTop-a.offsetTop+1,o.removeChild(a),o.appendChild(document.createTextNode(h)),o.style.lineHeight="normal",s.style.verticalAlign="super",n=s.offsetTop-o.offsetTop+1,document.body.removeChild(o),this.baseline=r,this.lineWidth=1,this.middle=n}var i=t("./utils").smallImage;e.exports=n},{"./utils":29}],9:[function(t,e,r){function n(){this.data={}}var i=t("./font");n.prototype.getMetrics=function(t,e){return void 0===this.data[t+"-"+e]&&(this.data[t+"-"+e]=new i(t,e)),this.data[t+"-"+e]},e.exports=n},{"./font":8}],10:[function(t,e,r){function n(e,r,n){this.image=null,this.src=e;var i=this,a=s(e);this.promise=(r?new o(function(t){"about:blank"===e.contentWindow.document.URL||null==e.contentWindow.document.documentElement?e.contentWindow.onload=e.onload=function(){t(e)}:t(e)}):this.proxyLoad(n.proxy,a,n)).then(function(e){var r=t("./core");return r(e.contentWindow.document.documentElement,{type:"view",width:e.width,height:e.height,proxy:n.proxy,javascriptEnabled:n.javascriptEnabled,removeContainer:n.removeContainer,allowTaint:n.allowTaint,imageTimeout:n.imageTimeout/2})}).then(function(t){return i.image=t})}var i=t("./utils"),o=t("./promise"),s=i.getBounds,a=t("./proxy").loadUrlDocument;n.prototype.proxyLoad=function(t,e,r){var n=this.src;return a(n.src,t,n.ownerDocument,e.width,e.height,r)},e.exports=n},{"./core":6,"./promise":18,"./proxy":19,"./utils":29}],11:[function(t,e,r){function n(t){this.src=t.value,this.colorStops=[],this.type=null,this.x0=.5,this.y0=.5,this.x1=.5,this.y1=.5,this.promise=i.resolve(!0)}var i=t("./promise");n.prototype.TYPES={LINEAR:1,RADIAL:2},e.exports=n},{"./promise":18}],12:[function(t,e,r){function n(t,e){this.src=t,this.image=new Image;var r=this;this.tainted=null,this.promise=new i(function(n,i){r.image.onload=n,r.image.onerror=i,e&&(r.image.crossOrigin="anonymous"),r.image.src=t,r.image.complete===!0&&n(r.image)})}var i=t("./promise");e.exports=n},{"./promise":18}],13:[function(t,e,r){function n(t,e){this.link=null,this.options=t,this.support=e,this.origin=this.getOrigin(window.location.href)}var i=t("./promise"),o=t("./log"),s=t("./imagecontainer"),a=t("./dummyimagecontainer"),h=t("./proxyimagecontainer"),l=t("./framecontainer"),u=t("./svgcontainer"),c=t("./svgnodecontainer"),f=t("./lineargradientcontainer"),d=t("./webkitgradientcontainer"),p=t("./utils").bind; -n.prototype.findImages=function(t){var e=[];return t.reduce(function(t,e){switch(e.node.nodeName){case"IMG":return t.concat([{args:[e.node.src],method:"url"}]);case"svg":case"IFRAME":return t.concat([{args:[e.node],method:e.node.nodeName}])}return t},[]).forEach(this.addImage(e,this.loadImage),this),e},n.prototype.findBackgroundImage=function(t,e){return e.parseBackgroundImages().filter(this.hasImageBackground).forEach(this.addImage(t,this.loadImage),this),t},n.prototype.addImage=function(t,e){return function(r){r.args.forEach(function(n){this.imageExists(t,n)||(t.splice(0,0,e.call(this,r)),o("Added image #"+t.length,"string"==typeof n?n.substring(0,100):n))},this)}},n.prototype.hasImageBackground=function(t){return"none"!==t.method},n.prototype.loadImage=function(t){if("url"===t.method){var e=t.args[0];return!this.isSVG(e)||this.support.svg||this.options.allowTaint?e.match(/data:image\/.*;base64,/i)?new s(e.replace(/url\(['"]{0,}|['"]{0,}\)$/gi,""),!1):this.isSameOrigin(e)||this.options.allowTaint===!0||this.isSVG(e)?new s(e,!1):this.support.cors&&!this.options.allowTaint&&this.options.useCORS?new s(e,!0):this.options.proxy?new h(e,this.options.proxy):new a(e):new u(e)}return"linear-gradient"===t.method?new f(t):"gradient"===t.method?new d(t):"svg"===t.method?new c(t.args[0],this.support.svg):"IFRAME"===t.method?new l(t.args[0],this.isSameOrigin(t.args[0].src),this.options):new a(t)},n.prototype.isSVG=function(t){return"svg"===t.substring(t.length-3).toLowerCase()||u.prototype.isInline(t)},n.prototype.imageExists=function(t,e){return t.some(function(t){return t.src===e})},n.prototype.isSameOrigin=function(t){return this.getOrigin(t)===this.origin},n.prototype.getOrigin=function(t){var e=this.link||(this.link=document.createElement("a"));return e.href=t,e.href=e.href,e.protocol+e.hostname+e.port},n.prototype.getPromise=function(t){return this.timeout(t,this.options.imageTimeout)["catch"](function(){var e=new a(t.src);return e.promise.then(function(e){t.image=e})})},n.prototype.get=function(t){var e=null;return this.images.some(function(r){return(e=r).src===t})?e:null},n.prototype.fetch=function(t){return this.images=t.reduce(p(this.findBackgroundImage,this),this.findImages(t)),this.images.forEach(function(t,e){t.promise.then(function(){o("Succesfully loaded image #"+(e+1),t)},function(r){o("Failed loading image #"+(e+1),t,r)})}),this.ready=i.all(this.images.map(this.getPromise,this)),o("Finished searching images"),this},n.prototype.timeout=function(t,e){var r,n=i.race([t.promise,new i(function(n,i){r=setTimeout(function(){o("Timed out loading image",t),i(t)},e)})]).then(function(t){return clearTimeout(r),t});return n["catch"](function(){clearTimeout(r)}),n},e.exports=n},{"./dummyimagecontainer":7,"./framecontainer":10,"./imagecontainer":12,"./lineargradientcontainer":14,"./log":15,"./promise":18,"./proxyimagecontainer":20,"./svgcontainer":26,"./svgnodecontainer":27,"./utils":29,"./webkitgradientcontainer":30}],14:[function(t,e,r){function n(t){i.apply(this,arguments),this.type=this.TYPES.LINEAR;var e=null===t.args[0].match(this.stepRegExp);e?t.args[0].split(" ").reverse().forEach(function(t){switch(t){case"left":this.x0=0,this.x1=1;break;case"top":this.y0=0,this.y1=1;break;case"right":this.x0=1,this.x1=0;break;case"bottom":this.y0=1,this.y1=0;break;case"to":var e=this.y0,r=this.x0;this.y0=this.y1,this.x0=this.x1,this.x1=r,this.y1=e}},this):(this.y0=0,this.y1=1),this.colorStops=t.args.slice(e?1:0).map(function(t){var e=t.match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)|\w+)\s*(\d{1,3})?(%|px)?/);return{color:new o(e[1]),stop:"%"===e[3]?e[2]/100:null}},this),null===this.colorStops[0].stop&&(this.colorStops[0].stop=0),null===this.colorStops[this.colorStops.length-1].stop&&(this.colorStops[this.colorStops.length-1].stop=1),this.colorStops.forEach(function(t,e){null===t.stop&&this.colorStops.slice(e).some(function(r,n){return null!==r.stop?(t.stop=(r.stop-this.colorStops[e-1].stop)/(n+1)+this.colorStops[e-1].stop,!0):!1},this)},this)}var i=t("./gradientcontainer"),o=t("./color");n.prototype=Object.create(i.prototype),n.prototype.stepRegExp=/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/,e.exports=n},{"./color":5,"./gradientcontainer":11}],15:[function(t,e,r){e.exports=function(){window.html2canvas.logging&&window.console&&window.console.log&&Function.prototype.bind.call(window.console.log,window.console).apply(window.console,[Date.now()-window.html2canvas.start+"ms","html2canvas:"].concat([].slice.call(arguments,0)))}},{}],16:[function(t,e,r){function n(t,e){this.node=t,this.parent=e,this.stack=null,this.bounds=null,this.borders=null,this.clip=[],this.backgroundClip=[],this.offsetBounds=null,this.visible=null,this.computedStyles=null,this.colors={},this.styles={},this.backgroundImages=null,this.transformData=null,this.transformMatrix=null,this.isPseudoElement=!1,this.opacity=null}function i(t){var e=t.options[t.selectedIndex||0];return e?e.text||"":""}function o(t){if(t&&"matrix"===t[1])return t[2].split(",").map(function(t){return parseFloat(t.trim())});if(t&&"matrix3d"===t[1]){var e=t[2].split(",").map(function(t){return parseFloat(t.trim())});return[e[0],e[1],e[4],e[5],e[12],e[13]]}}function s(t){return-1!==t.toString().indexOf("%")}function a(t){return t.replace("px","")}function h(t){return parseFloat(t)}var l=t("./color"),u=t("./utils"),c=u.getBounds,f=u.parseBackgrounds,d=u.offsetBounds;n.prototype.cloneTo=function(t){t.visible=this.visible,t.borders=this.borders,t.bounds=this.bounds,t.clip=this.clip,t.backgroundClip=this.backgroundClip,t.computedStyles=this.computedStyles,t.styles=this.styles,t.backgroundImages=this.backgroundImages,t.opacity=this.opacity},n.prototype.getOpacity=function(){return null===this.opacity?this.opacity=this.cssFloat("opacity"):this.opacity},n.prototype.assignStack=function(t){this.stack=t,t.children.push(this)},n.prototype.isElementVisible=function(){return this.node.nodeType===Node.TEXT_NODE?this.parent.visible:"none"!==this.css("display")&&"hidden"!==this.css("visibility")&&!this.node.hasAttribute("data-html2canvas-ignore")&&("INPUT"!==this.node.nodeName||"hidden"!==this.node.getAttribute("type"))},n.prototype.css=function(t){return this.computedStyles||(this.computedStyles=this.isPseudoElement?this.parent.computedStyle(this.before?":before":":after"):this.computedStyle(null)),this.styles[t]||(this.styles[t]=this.computedStyles[t])},n.prototype.prefixedCss=function(t){var e=["webkit","moz","ms","o"],r=this.css(t);return void 0===r&&e.some(function(e){return r=this.css(e+t.substr(0,1).toUpperCase()+t.substr(1)),void 0!==r},this),void 0===r?null:r},n.prototype.computedStyle=function(t){return this.node.ownerDocument.defaultView.getComputedStyle(this.node,t)},n.prototype.cssInt=function(t){var e=parseInt(this.css(t),10);return isNaN(e)?0:e},n.prototype.color=function(t){return this.colors[t]||(this.colors[t]=new l(this.css(t)))},n.prototype.cssFloat=function(t){var e=parseFloat(this.css(t));return isNaN(e)?0:e},n.prototype.fontWeight=function(){var t=this.css("fontWeight");switch(parseInt(t,10)){case 401:t="bold";break;case 400:t="normal"}return t},n.prototype.parseClip=function(){var t=this.css("clip").match(this.CLIP);return t?{top:parseInt(t[1],10),right:parseInt(t[2],10),bottom:parseInt(t[3],10),left:parseInt(t[4],10)}:null},n.prototype.parseBackgroundImages=function(){return this.backgroundImages||(this.backgroundImages=f(this.css("backgroundImage")))},n.prototype.cssList=function(t,e){var r=(this.css(t)||"").split(",");return r=r[e||0]||r[0]||"auto",r=r.trim().split(" "),1===r.length&&(r=[r[0],s(r[0])?"auto":r[0]]),r},n.prototype.parseBackgroundSize=function(t,e,r){var n,i,o=this.cssList("backgroundSize",r);if(s(o[0]))n=t.width*parseFloat(o[0])/100;else{if(/contain|cover/.test(o[0])){var a=t.width/t.height,h=e.width/e.height;return h>a^"contain"===o[0]?{width:t.height*h,height:t.height}:{width:t.width,height:t.width/h}}n=parseInt(o[0],10)}return i="auto"===o[0]&&"auto"===o[1]?e.height:"auto"===o[1]?n/e.width*e.height:s(o[1])?t.height*parseFloat(o[1])/100:parseInt(o[1],10),"auto"===o[0]&&(n=i/e.height*e.width),{width:n,height:i}},n.prototype.parseBackgroundPosition=function(t,e,r,n){var i,o,a=this.cssList("backgroundPosition",r);return i=s(a[0])?(t.width-(n||e).width)*(parseFloat(a[0])/100):parseInt(a[0],10),o="auto"===a[1]?i/e.width*e.height:s(a[1])?(t.height-(n||e).height)*parseFloat(a[1])/100:parseInt(a[1],10),"auto"===a[0]&&(i=o/e.height*e.width),{left:i,top:o}},n.prototype.parseBackgroundRepeat=function(t){return this.cssList("backgroundRepeat",t)[0]},n.prototype.parseTextShadows=function(){var t=this.css("textShadow"),e=[];if(t&&"none"!==t)for(var r=t.match(this.TEXT_SHADOW_PROPERTY),n=0;r&&n0?(this.renderIndex=0,this.asyncRenderer(this.renderQueue,t)):t():(this.renderQueue.forEach(this.paint,this),t())},this))},this))}function i(t){return t.parent&&t.parent.clip.length}function o(t){return t.replace(/(\-[a-z])/g,function(t){return t.toUpperCase().replace("-","")})}function s(){}function a(t,e,r,n){return t.map(function(i,o){if(i.width>0){var s=e.left,a=e.top,h=e.width,l=e.height-t[2].width;switch(o){case 0:l=t[0].width,i.args=c({c1:[s,a],c2:[s+h,a],c3:[s+h-t[1].width,a+l],c4:[s+t[3].width,a+l]},n[0],n[1],r.topLeftOuter,r.topLeftInner,r.topRightOuter,r.topRightInner);break;case 1:s=e.left+e.width-t[1].width,h=t[1].width,i.args=c({c1:[s+h,a],c2:[s+h,a+l+t[2].width],c3:[s,a+l],c4:[s,a+t[0].width]},n[1],n[2],r.topRightOuter,r.topRightInner,r.bottomRightOuter,r.bottomRightInner);break;case 2:a=a+e.height-t[2].width,l=t[2].width,i.args=c({c1:[s+h,a+l],c2:[s,a+l],c3:[s+t[3].width,a],c4:[s+h-t[3].width,a]},n[2],n[3],r.bottomRightOuter,r.bottomRightInner,r.bottomLeftOuter,r.bottomLeftInner);break;case 3:h=t[3].width,i.args=c({c1:[s,a+l+t[2].width],c2:[s,a],c3:[s+h,a+t[0].width],c4:[s+h,a+l]},n[3],n[0],r.bottomLeftOuter,r.bottomLeftInner,r.topLeftOuter,r.topLeftInner)}}return i})}function h(t,e,r,n){var i=4*((Math.sqrt(2)-1)/3),o=r*i,s=n*i,a=t+r,h=e+n;return{topLeft:u({x:t,y:h},{x:t,y:h-s},{x:a-o,y:e},{x:a,y:e}),topRight:u({x:t,y:e},{x:t+o,y:e},{x:a,y:h-s},{x:a,y:h}),bottomRight:u({x:a,y:e},{x:a,y:e+s},{x:t+o,y:h},{x:t,y:h}),bottomLeft:u({x:a,y:h},{x:a-o,y:h},{x:t,y:e+s},{x:t,y:e})}}function l(t,e,r){var n=t.left,i=t.top,o=t.width,s=t.height,a=e[0][0],l=e[0][1],u=e[1][0],c=e[1][1],f=e[2][0],d=e[2][1],p=e[3][0],g=e[3][1],A=Math.floor(s/2);a=a>A?A:a,l=l>A?A:l,u=u>A?A:u,c=c>A?A:c,f=f>A?A:f,d=d>A?A:d,p=p>A?A:p,g=g>A?A:g;var v=o-u,m=s-d,y=o-f,x=s-g;return{topLeftOuter:h(n,i,a,l).topLeft.subdivide(.5),topLeftInner:h(n+r[3].width,i+r[0].width,Math.max(0,a-r[3].width),Math.max(0,l-r[0].width)).topLeft.subdivide(.5),topRightOuter:h(n+v,i,u,c).topRight.subdivide(.5),topRightInner:h(n+Math.min(v,o+r[3].width),i+r[0].width,v>o+r[3].width?0:u-r[3].width,c-r[0].width).topRight.subdivide(.5),bottomRightOuter:h(n+y,i+m,f,d).bottomRight.subdivide(.5),bottomRightInner:h(n+Math.min(y,o-r[3].width),i+Math.min(m,s+r[0].width),Math.max(0,f-r[1].width),d-r[2].width).bottomRight.subdivide(.5),bottomLeftOuter:h(n,i+x,p,g).bottomLeft.subdivide(.5),bottomLeftInner:h(n+r[3].width,i+x,Math.max(0,p-r[3].width),g-r[2].width).bottomLeft.subdivide(.5)}}function u(t,e,r,n){var i=function(t,e,r){return{x:t.x+(e.x-t.x)*r,y:t.y+(e.y-t.y)*r}};return{start:t,startControl:e,endControl:r,end:n,subdivide:function(o){var s=i(t,e,o),a=i(e,r,o),h=i(r,n,o),l=i(s,a,o),c=i(a,h,o),f=i(l,c,o);return[u(t,s,l,f),u(f,c,h,n)]},curveTo:function(t){t.push(["bezierCurve",e.x,e.y,r.x,r.y,n.x,n.y])},curveToReversed:function(n){n.push(["bezierCurve",r.x,r.y,e.x,e.y,t.x,t.y])}}}function c(t,e,r,n,i,o,s){var a=[];return e[0]>0||e[1]>0?(a.push(["line",n[1].start.x,n[1].start.y]),n[1].curveTo(a)):a.push(["line",t.c1[0],t.c1[1]]),r[0]>0||r[1]>0?(a.push(["line",o[0].start.x,o[0].start.y]),o[0].curveTo(a),a.push(["line",s[0].end.x,s[0].end.y]),s[0].curveToReversed(a)):(a.push(["line",t.c2[0],t.c2[1]]),a.push(["line",t.c3[0],t.c3[1]])),e[0]>0||e[1]>0?(a.push(["line",i[1].end.x,i[1].end.y]),i[1].curveToReversed(a)):a.push(["line",t.c4[0],t.c4[1]]),a}function f(t,e,r,n,i,o,s){e[0]>0||e[1]>0?(t.push(["line",n[0].start.x,n[0].start.y]),n[0].curveTo(t),n[1].curveTo(t)):t.push(["line",o,s]),(r[0]>0||r[1]>0)&&t.push(["line",i[0].start.x,i[0].start.y])}function d(t){return t.cssInt("zIndex")<0}function p(t){return t.cssInt("zIndex")>0}function g(t){return 0===t.cssInt("zIndex")}function A(t){return-1!==["inline","inline-block","inline-table"].indexOf(t.css("display"))}function v(t){return t instanceof K}function m(t){return t.node.data.trim().length>0}function y(t){return/^(normal|none|0px)$/.test(t.parent.css("letterSpacing"))}function x(t){return["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(e){var r=t.css("border"+e+"Radius"),n=r.split(" ");return n.length<=1&&(n[1]=n[0]),n.map(S)})}function w(t){return t.nodeType===Node.TEXT_NODE||t.nodeType===Node.ELEMENT_NODE}function E(t){var e=t.css("position"),r=-1!==["absolute","relative","fixed"].indexOf(e)?t.css("zIndex"):"auto";return"auto"!==r}function C(t){return"static"!==t.css("position")}function b(t){return"none"!==t.css("float")}function B(t){return-1!==["inline-block","inline-table"].indexOf(t.css("display"))}function T(t){var e=this;return function(){return!t.apply(e,arguments)}}function D(t){return t.node.nodeType===Node.ELEMENT_NODE}function M(t){return t.isPseudoElement===!0}function P(t){return t.node.nodeType===Node.TEXT_NODE}function R(t){return function(e,r){return e.cssInt("zIndex")+t.indexOf(e)/t.length-(r.cssInt("zIndex")+t.indexOf(r)/t.length)}}function I(t){return t.getOpacity()<1}function S(t){return parseInt(t,10)}function O(t){return t.width}function F(t){return t.node.nodeType!==Node.ELEMENT_NODE||-1===["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"].indexOf(t.node.nodeName)}function Q(t){return[].concat.apply([],t)}function L(t){var e=t.substr(0,1);return e===t.substr(t.length-1)&&e.match(/'|"/)?t.substr(1,t.length-2):t}function N(t){for(var e,r=[],n=0,i=!1;t.length;)H(t[n])===i?(e=t.splice(0,n),e.length&&r.push(Y.ucs2.encode(e)),i=!i,n=0):n++,n>=t.length&&(e=t.splice(0,n),e.length&&r.push(Y.ucs2.encode(e)));return r}function H(t){return-1!==[32,13,10,9,45].indexOf(t)}function k(t){return/[^\u0000-\u00ff]/.test(t)}var G=t("./log"),Y=t("punycode"),j=t("./nodecontainer"),z=t("./textcontainer"),U=t("./pseudoelementcontainer"),J=t("./fontmetrics"),X=t("./color"),W=t("./promise"),K=t("./stackingcontext"),V=t("./utils"),Z=V.bind,q=V.getBounds,_=V.parseBackgrounds,$=V.offsetBounds;n.prototype.calculateOverflowClips=function(){this.nodes.forEach(function(t){if(D(t)){M(t)&&t.appendToDOM(),t.borders=this.parseBorders(t);var e="hidden"===t.css("overflow")?[t.borders.clip]:[],r=t.parseClip();r&&-1!==["absolute","fixed"].indexOf(t.css("position"))&&e.push([["rect",t.bounds.left+r.left,t.bounds.top+r.top,r.right-r.left,r.bottom-r.top]]),t.clip=i(t)?t.parent.clip.concat(e):e,t.backgroundClip="hidden"!==t.css("overflow")?t.clip.concat([t.borders.clip]):t.clip,M(t)&&t.cleanDOM()}else P(t)&&(t.clip=i(t)?t.parent.clip:[]);M(t)||(t.bounds=null)},this)},n.prototype.asyncRenderer=function(t,e,r){r=r||Date.now(),this.paint(t[this.renderIndex++]),t.length===this.renderIndex?e():r+20>Date.now()?this.asyncRenderer(t,e,r):setTimeout(Z(function(){this.asyncRenderer(t,e)},this),0)},n.prototype.createPseudoHideStyles=function(t){this.createStyles(t,"."+U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+':before { content: "" !important; display: none !important; }.'+U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER+':after { content: "" !important; display: none !important; }')},n.prototype.disableAnimations=function(t){this.createStyles(t,"* { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; animation: none !important; -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; transition: none !important;}")},n.prototype.createStyles=function(t,e){var r=t.createElement("style");r.innerHTML=e,t.body.appendChild(r)},n.prototype.getPseudoElements=function(t){var e=[[t]];if(t.node.nodeType===Node.ELEMENT_NODE){var r=this.getPseudoElement(t,":before"),n=this.getPseudoElement(t,":after");r&&e.push(r),n&&e.push(n)}return Q(e)},n.prototype.getPseudoElement=function(t,e){var r=t.computedStyle(e);if(!r||!r.content||"none"===r.content||"-moz-alt-content"===r.content||"none"===r.display)return null;for(var n=L(r.content),i="url"===n.substr(0,3),s=document.createElement(i?"img":"html2canvaspseudoelement"),a=new U(s,t,e),h=r.length-1;h>=0;h--){var l=o(r.item(h));s.style[l]=r[l]}if(s.className=U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+" "+U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER,i)return s.src=_(n)[0].args[0],[a];var u=document.createTextNode(n);return s.appendChild(u),[a,new z(u,a)]},n.prototype.getChildren=function(t){return Q([].filter.call(t.node.childNodes,w).map(function(e){var r=[e.nodeType===Node.TEXT_NODE?new z(e,t):new j(e,t)].filter(F);return e.nodeType===Node.ELEMENT_NODE&&r.length&&"TEXTAREA"!==e.tagName?r[0].isElementVisible()?r.concat(this.getChildren(r[0])):[]:r},this))},n.prototype.newStackingContext=function(t,e){var r=new K(e,t.getOpacity(),t.node,t.parent);t.cloneTo(r);var n=e?r.getParentStack(this):r.parent.stack;n.contexts.push(r),t.stack=r},n.prototype.createStackingContexts=function(){this.nodes.forEach(function(t){D(t)&&(this.isRootElement(t)||I(t)||E(t)||this.isBodyWithTransparentRoot(t)||t.hasTransform())?this.newStackingContext(t,!0):D(t)&&(C(t)&&g(t)||B(t)||b(t))?this.newStackingContext(t,!1):t.assignStack(t.parent.stack)},this)},n.prototype.isBodyWithTransparentRoot=function(t){return"BODY"===t.node.nodeName&&t.parent.color("backgroundColor").isTransparent()},n.prototype.isRootElement=function(t){return null===t.parent},n.prototype.sortStackingContexts=function(t){t.contexts.sort(R(t.contexts.slice(0))),t.contexts.forEach(this.sortStackingContexts,this)},n.prototype.parseTextBounds=function(t){return function(e,r,n){if("none"!==t.parent.css("textDecoration").substr(0,4)||0!==e.trim().length){if(this.support.rangeBounds&&!t.parent.hasTransform()){var i=n.slice(0,r).join("").length;return this.getRangeBounds(t.node,i,e.length)}if(t.node&&"string"==typeof t.node.data){var o=t.node.splitText(e.length),s=this.getWrapperBounds(t.node,t.parent.hasTransform());return t.node=o,s}}else(!this.support.rangeBounds||t.parent.hasTransform())&&(t.node=t.node.splitText(e.length));return{}}},n.prototype.getWrapperBounds=function(t,e){var r=t.ownerDocument.createElement("html2canvaswrapper"),n=t.parentNode,i=t.cloneNode(!0);r.appendChild(t.cloneNode(!0)),n.replaceChild(r,t);var o=e?$(r):q(r);return n.replaceChild(i,r),o},n.prototype.getRangeBounds=function(t,e,r){var n=this.range||(this.range=t.ownerDocument.createRange());return n.setStart(t,e),n.setEnd(t,e+r),n.getBoundingClientRect()},n.prototype.parse=function(t){var e=t.contexts.filter(d),r=t.children.filter(D),n=r.filter(T(b)),i=n.filter(T(C)).filter(T(A)),o=r.filter(T(C)).filter(b),a=n.filter(T(C)).filter(A),h=t.contexts.concat(n.filter(C)).filter(g),l=t.children.filter(P).filter(m),u=t.contexts.filter(p);e.concat(i).concat(o).concat(a).concat(h).concat(l).concat(u).forEach(function(t){this.renderQueue.push(t),v(t)&&(this.parse(t),this.renderQueue.push(new s))},this)},n.prototype.paint=function(t){try{t instanceof s?this.renderer.ctx.restore():P(t)?(M(t.parent)&&t.parent.appendToDOM(),this.paintText(t),M(t.parent)&&t.parent.cleanDOM()):this.paintNode(t)}catch(e){if(G(e),this.options.strict)throw e}},n.prototype.paintNode=function(t){v(t)&&(this.renderer.setOpacity(t.opacity),this.renderer.ctx.save(),t.hasTransform()&&this.renderer.setTransform(t.parseTransform())),"INPUT"===t.node.nodeName&&"checkbox"===t.node.type?this.paintCheckbox(t):"INPUT"===t.node.nodeName&&"radio"===t.node.type?this.paintRadio(t):this.paintElement(t)},n.prototype.paintElement=function(t){var e=t.parseBounds();this.renderer.clip(t.backgroundClip,function(){this.renderer.renderBackground(t,e,t.borders.borders.map(O))},this),this.renderer.clip(t.clip,function(){this.renderer.renderBorders(t.borders.borders)},this),this.renderer.clip(t.backgroundClip,function(){switch(t.node.nodeName){case"svg":case"IFRAME":var r=this.images.get(t.node);r?this.renderer.renderImage(t,e,t.borders,r):G("Error loading <"+t.node.nodeName+">",t.node);break;case"IMG":var n=this.images.get(t.node.src);n?this.renderer.renderImage(t,e,t.borders,n):G("Error loading ",t.node.src);break;case"CANVAS":this.renderer.renderImage(t,e,t.borders,{image:t.node});break;case"SELECT":case"INPUT":case"TEXTAREA":this.paintFormValue(t)}},this)},n.prototype.paintCheckbox=function(t){var e=t.parseBounds(),r=Math.min(e.width,e.height),n={width:r-1,height:r-1,top:e.top,left:e.left},i=[3,3],o=[i,i,i,i],s=[1,1,1,1].map(function(t){return{color:new X("#A5A5A5"),width:t}}),h=l(n,o,s);this.renderer.clip(t.backgroundClip,function(){this.renderer.rectangle(n.left+1,n.top+1,n.width-2,n.height-2,new X("#DEDEDE")),this.renderer.renderBorders(a(s,n,h,o)),t.node.checked&&(this.renderer.font(new X("#424242"),"normal","normal","bold",r-3+"px","arial"),this.renderer.text("✔",n.left+r/6,n.top+r-1))},this)},n.prototype.paintRadio=function(t){var e=t.parseBounds(),r=Math.min(e.width,e.height)-2;this.renderer.clip(t.backgroundClip,function(){this.renderer.circleStroke(e.left+1,e.top+1,r,new X("#DEDEDE"),1,new X("#A5A5A5")),t.node.checked&&this.renderer.circle(Math.ceil(e.left+r/4)+1,Math.ceil(e.top+r/4)+1,Math.floor(r/2),new X("#424242"))},this)},n.prototype.paintFormValue=function(t){var e=t.getValue();if(e.length>0){var r=t.node.ownerDocument,n=r.createElement("html2canvaswrapper"),i=["lineHeight","textAlign","fontFamily","fontWeight","fontSize","color","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","borderLeftStyle","borderTopStyle","borderLeftWidth","borderTopWidth","boxSizing","whiteSpace","wordWrap"];i.forEach(function(e){try{n.style[e]=t.css(e)}catch(r){G("html2canvas: Parse: Exception caught in renderFormValue: "+r.message)}});var o=t.parseBounds();n.style.position="fixed",n.style.left=o.left+"px",n.style.top=o.top+"px",n.textContent=e,r.body.appendChild(n),this.paintText(new z(n.firstChild,t)),r.body.removeChild(n)}},n.prototype.paintText=function(t){t.applyTextTransform();var e=Y.ucs2.decode(t.node.data),r=this.options.letterRendering&&!y(t)||k(t.node.data)?e.map(function(t){return Y.ucs2.encode([t])}):N(e),n=t.parent.fontWeight(),i=t.parent.css("fontSize"),o=t.parent.css("fontFamily"),s=t.parent.parseTextShadows();this.renderer.font(t.parent.color("color"),t.parent.css("fontStyle"),t.parent.css("fontVariant"),n,i,o),s.length?this.renderer.fontShadow(s[0].color,s[0].offsetX,s[0].offsetY,s[0].blur):this.renderer.clearShadow(),this.renderer.clip(t.parent.clip,function(){r.map(this.parseTextBounds(t),this).forEach(function(e,n){e&&(this.renderer.text(r[n],e.left,e.bottom),this.renderTextDecoration(t.parent,e,this.fontMetrics.getMetrics(o,i)))},this)},this)},n.prototype.renderTextDecoration=function(t,e,r){switch(t.css("textDecoration").split(" ")[0]){case"underline":this.renderer.rectangle(e.left,Math.round(e.top+r.baseline+r.lineWidth),e.width,1,t.color("color"));break;case"overline":this.renderer.rectangle(e.left,Math.round(e.top),e.width,1,t.color("color"));break;case"line-through":this.renderer.rectangle(e.left,Math.ceil(e.top+r.middle+r.lineWidth),e.width,1,t.color("color"))}};var tt={inset:[["darken",.6],["darken",.1],["darken",.1],["darken",.6]]};n.prototype.parseBorders=function(t){var e=t.parseBounds(),r=x(t),n=["Top","Right","Bottom","Left"].map(function(e,r){var n=t.css("border"+e+"Style"),i=t.color("border"+e+"Color");"inset"===n&&i.isBlack()&&(i=new X([255,255,255,i.a]));var o=tt[n]?tt[n][r]:null;return{width:t.cssInt("border"+e+"Width"),color:o?i[o[0]](o[1]):i,args:null}}),i=l(e,r,n);return{clip:this.parseBackgroundClip(t,i,n,r,e),borders:a(n,e,i,r)}},n.prototype.parseBackgroundClip=function(t,e,r,n,i){var o=t.css("backgroundClip"),s=[];switch(o){case"content-box":case"padding-box":f(s,n[0],n[1],e.topLeftInner,e.topRightInner,i.left+r[3].width,i.top+r[0].width),f(s,n[1],n[2],e.topRightInner,e.bottomRightInner,i.left+i.width-r[1].width,i.top+r[0].width),f(s,n[2],n[3],e.bottomRightInner,e.bottomLeftInner,i.left+i.width-r[1].width,i.top+i.height-r[2].width),f(s,n[3],n[0],e.bottomLeftInner,e.topLeftInner,i.left+r[3].width,i.top+i.height-r[2].width);break;default:f(s,n[0],n[1],e.topLeftOuter,e.topRightOuter,i.left,i.top),f(s,n[1],n[2],e.topRightOuter,e.bottomRightOuter,i.left+i.width,i.top),f(s,n[2],n[3],e.bottomRightOuter,e.bottomLeftOuter,i.left+i.width,i.top+i.height),f(s,n[3],n[0],e.bottomLeftOuter,e.topLeftOuter,i.left,i.top+i.height)}return s},e.exports=n},{"./color":5,"./fontmetrics":9,"./log":15,"./nodecontainer":16,"./promise":18,"./pseudoelementcontainer":21,"./stackingcontext":24,"./textcontainer":28,"./utils":29,punycode:3}],18:[function(t,e,r){e.exports=t("es6-promise").Promise},{"es6-promise":1}],19:[function(t,e,r){function n(t,e,r){var n="withCredentials"in new XMLHttpRequest;if(!e)return u.reject("No proxy configured");var i=s(n),h=a(e,t,i);return n?c(h):o(r,h,i).then(function(t){return g(t.content)})}function i(t,e,r){var n="crossOrigin"in new Image,i=s(n),h=a(e,t,i);return n?u.resolve(h):o(r,h,i).then(function(t){return"data:"+t.type+";base64,"+t.content})}function o(t,e,r){return new u(function(n,i){var o=t.createElement("script"),s=function(){delete window.html2canvas.proxy[r],t.body.removeChild(o)};window.html2canvas.proxy[r]=function(t){s(),n(t)},o.src=e,o.onerror=function(t){s(),i(t)},t.body.appendChild(o)})}function s(t){return t?"":"html2canvas_"+Date.now()+"_"+ ++A+"_"+Math.round(1e5*Math.random())}function a(t,e,r){return t+"?url="+encodeURIComponent(e)+(r.length?"&callback=html2canvas.proxy."+r:"")}function h(t){return function(e){var r,n=new DOMParser;try{r=n.parseFromString(e,"text/html")}catch(i){d("DOMParser not supported, falling back to createHTMLDocument"),r=document.implementation.createHTMLDocument("");try{r.open(),r.write(e),r.close()}catch(o){d("createHTMLDocument write not supported, falling back to document.body.innerHTML"),r.body.innerHTML=e}}var s=r.querySelector("base");if(!s||!s.href.host){var a=r.createElement("base");a.href=t,r.head.insertBefore(a,r.head.firstChild)}return r}}function l(t,e,r,i,o,s){return new n(t,e,window.document).then(h(t)).then(function(t){return p(t,r,i,o,s,0,0)})}var u=t("./promise"),c=t("./xhr"),f=t("./utils"),d=t("./log"),p=t("./clone"),g=f.decode64,A=0;r.Proxy=n,r.ProxyURL=i,r.loadUrlDocument=l},{"./clone":4,"./log":15,"./promise":18,"./utils":29,"./xhr":31}],20:[function(t,e,r){function n(t,e){var r=document.createElement("a");r.href=t,t=r.href,this.src=t,this.image=new Image;var n=this;this.promise=new o(function(r,o){n.image.crossOrigin="Anonymous",n.image.onload=r,n.image.onerror=o,new i(t,e,document).then(function(t){n.image.src=t})["catch"](o)})}var i=t("./proxy").ProxyURL,o=t("./promise");e.exports=n},{"./promise":18,"./proxy":19}],21:[function(t,e,r){function n(t,e,r){i.call(this,t,e),this.isPseudoElement=!0,this.before=":before"===r}var i=t("./nodecontainer");n.prototype.cloneTo=function(t){n.prototype.cloneTo.call(this,t),t.isPseudoElement=!0,t.before=this.before},n.prototype=Object.create(i.prototype),n.prototype.appendToDOM=function(){this.before?this.parent.node.insertBefore(this.node,this.parent.node.firstChild):this.parent.node.appendChild(this.node),this.parent.node.className+=" "+this.getHideClass()},n.prototype.cleanDOM=function(){this.node.parentNode.removeChild(this.node),this.parent.node.className=this.parent.node.className.replace(this.getHideClass(),"")},n.prototype.getHideClass=function(){return this["PSEUDO_HIDE_ELEMENT_CLASS_"+(this.before?"BEFORE":"AFTER")]},n.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE="___html2canvas___pseudoelement_before",n.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER="___html2canvas___pseudoelement_after",e.exports=n},{"./nodecontainer":16}],22:[function(t,e,r){function n(t,e,r,n,i){this.width=t,this.height=e,this.images=r,this.options=n,this.document=i}var i=t("./log");n.prototype.renderImage=function(t,e,r,n){var i=t.cssInt("paddingLeft"),o=t.cssInt("paddingTop"),s=t.cssInt("paddingRight"),a=t.cssInt("paddingBottom"),h=r.borders,l=e.width-(h[1].width+h[3].width+i+s),u=e.height-(h[0].width+h[2].width+o+a);this.drawImage(n,0,0,n.image.width||l,n.image.height||u,e.left+i+h[3].width,e.top+o+h[0].width,l,u)},n.prototype.renderBackground=function(t,e,r){e.height>0&&e.width>0&&(this.renderBackgroundColor(t,e),this.renderBackgroundImage(t,e,r))},n.prototype.renderBackgroundColor=function(t,e){var r=t.color("backgroundColor");r.isTransparent()||this.rectangle(e.left,e.top,e.width,e.height,r)},n.prototype.renderBorders=function(t){t.forEach(this.renderBorder,this)},n.prototype.renderBorder=function(t){t.color.isTransparent()||null===t.args||this.drawShape(t.args,t.color)},n.prototype.renderBackgroundImage=function(t,e,r){ -var n=t.parseBackgroundImages();n.reverse().forEach(function(n,o,s){switch(n.method){case"url":var a=this.images.get(n.args[0]);a?this.renderBackgroundRepeating(t,e,a,s.length-(o+1),r):i("Error loading background-image",n.args[0]);break;case"linear-gradient":case"gradient":var h=this.images.get(n.value);h?this.renderBackgroundGradient(h,e,r):i("Error loading background-image",n.args[0]);break;case"none":break;default:i("Unknown background-image type",n.args[0])}},this)},n.prototype.renderBackgroundRepeating=function(t,e,r,n,i){var o=t.parseBackgroundSize(e,r.image,n),s=t.parseBackgroundPosition(e,r.image,n,o),a=t.parseBackgroundRepeat(n);switch(a){case"repeat-x":case"repeat no-repeat":this.backgroundRepeatShape(r,s,o,e,e.left+i[3],e.top+s.top+i[0],99999,o.height,i);break;case"repeat-y":case"no-repeat repeat":this.backgroundRepeatShape(r,s,o,e,e.left+s.left+i[3],e.top+i[0],o.width,99999,i);break;case"no-repeat":this.backgroundRepeatShape(r,s,o,e,e.left+s.left+i[3],e.top+s.top+i[0],o.width,o.height,i);break;default:this.renderBackgroundRepeat(r,s,o,{top:e.top,left:e.left},i[3],i[0])}},e.exports=n},{"./log":15}],23:[function(t,e,r){function n(t,e){if(this.ratio=window.devicePixelRatio,t=this.applyRatio(t),e=this.applyRatio(e),o.apply(this,arguments),this.canvas=this.options.canvas||this.document.createElement("canvas"),!this.options.canvas&&(this.canvas.width=t,this.canvas.height=e,1!==this.ratio)){var r=1/this.ratio;this.canvas.style.transform="scaleX("+r+") scaleY("+r+")",this.canvas.style.transformOrigin="0 0"}this.ctx=this.canvas.getContext("2d"),this.taintCtx=this.document.createElement("canvas").getContext("2d"),this.ctx.textBaseline="bottom",this.variables={},a("Initialized CanvasRenderer with size",t,"x",e)}function i(t){return t.length>0}var o=t("../renderer"),s=t("../lineargradientcontainer"),a=t("../log");n.prototype=Object.create(o.prototype),n.prototype.applyRatio=function(t){return t*this.ratio},n.prototype.applyRatioToBounds=function(t){t.width=t.width*this.ratio,t.top=t.top*this.ratio;try{t.left=t.left*this.ratio,t.height=t.height*this.ratio}catch(e){}return t},n.prototype.applyRatioToPosition=function(t){return t.left=t.left*this.ratio,t.height=t.height*this.ratio,bounds},n.prototype.applyRatioToShape=function(t){for(var e=0;e";try{r.drawImage(t,0,0),e.toDataURL()}catch(n){return!1}return!0},e.exports=n},{}],26:[function(t,e,r){function n(t){this.src=t,this.image=null;var e=this;this.promise=this.hasFabric().then(function(){return e.isInline(t)?i.resolve(e.inlineFormatting(t)):o(t)}).then(function(t){return new i(function(r){window.html2canvas.svg.fabric.loadSVGFromString(t,e.createCanvas.call(e,r))})})}var i=t("./promise"),o=t("./xhr"),s=t("./utils").decode64;n.prototype.hasFabric=function(){return window.html2canvas.svg&&window.html2canvas.svg.fabric?i.resolve():i.reject(new Error("html2canvas.svg.js is not loaded, cannot render svg"))},n.prototype.inlineFormatting=function(t){return/^data:image\/svg\+xml;base64,/.test(t)?this.decode64(this.removeContentType(t)):this.removeContentType(t)},n.prototype.removeContentType=function(t){return t.replace(/^data:image\/svg\+xml(;base64)?,/,"")},n.prototype.isInline=function(t){return/^data:image\/svg\+xml/i.test(t)},n.prototype.createCanvas=function(t){var e=this;return function(r,n){var i=new window.html2canvas.svg.fabric.StaticCanvas("c");e.image=i.lowerCanvasEl,i.setWidth(n.width).setHeight(n.height).add(window.html2canvas.svg.fabric.util.groupSVGElements(r,n)).renderAll(),t(i.lowerCanvasEl)}},n.prototype.decode64=function(t){return"function"==typeof window.atob?window.atob(t):s(t)},e.exports=n},{"./promise":18,"./utils":29,"./xhr":31}],27:[function(t,e,r){function n(t,e){this.src=t,this.image=null;var r=this;this.promise=e?new o(function(e,n){r.image=new Image,r.image.onload=e,r.image.onerror=n,r.image.src="data:image/svg+xml,"+(new XMLSerializer).serializeToString(t),r.image.complete===!0&&e(r.image)}):this.hasFabric().then(function(){return new o(function(e){window.html2canvas.svg.fabric.parseSVGDocument(t,r.createCanvas.call(r,e))})})}var i=t("./svgcontainer"),o=t("./promise");n.prototype=Object.create(i.prototype),e.exports=n},{"./promise":18,"./svgcontainer":26}],28:[function(t,e,r){function n(t,e){o.call(this,t,e)}function i(t,e,r){return t.length>0?e+r.toUpperCase():void 0}var o=t("./nodecontainer");n.prototype=Object.create(o.prototype),n.prototype.applyTextTransform=function(){this.node.data=this.transform(this.parent.css("textTransform"))},n.prototype.transform=function(t){var e=this.node.data;switch(t){case"lowercase":return e.toLowerCase();case"capitalize":return e.replace(/(^|\s|:|-|\(|\))([a-z])/g,i);case"uppercase":return e.toUpperCase();default:return e}},e.exports=n},{"./nodecontainer":16}],29:[function(t,e,r){r.smallImage=function(){return"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"},r.bind=function(t,e){return function(){return t.apply(e,arguments)}},r.decode64=function(t){var e,r,n,i,o,s,a,h,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=t.length,c="";for(e=0;u>e;e+=4)r=l.indexOf(t[e]),n=l.indexOf(t[e+1]),i=l.indexOf(t[e+2]),o=l.indexOf(t[e+3]),s=r<<2|n>>4,a=(15&n)<<4|i>>2,h=(3&i)<<6|o,c+=64===i?String.fromCharCode(s):64===o||-1===o?String.fromCharCode(s,a):String.fromCharCode(s,a,h);return c},r.getBounds=function(t){if(t.getBoundingClientRect){var e=t.getBoundingClientRect(),r=null==t.offsetWidth?e.width:t.offsetWidth;return{top:e.top,bottom:e.bottom||e.top+e.height,right:e.left+r,left:e.left,width:r,height:null==t.offsetHeight?e.height:t.offsetHeight}}return{}},r.offsetBounds=function(t){var e=t.offsetParent?r.offsetBounds(t.offsetParent):{top:0,left:0};return{top:t.offsetTop+e.top,bottom:t.offsetTop+t.offsetHeight+e.top,right:t.offsetLeft+e.left+t.offsetWidth,left:t.offsetLeft+e.left,width:t.offsetWidth,height:t.offsetHeight}},r.parseBackgrounds=function(t){var e,r,n,i,o,s,a,h=" \r\n ",l=[],u=0,c=0,f=function(){e&&('"'===r.substr(0,1)&&(r=r.substr(1,r.length-2)),r&&a.push(r),"-"===e.substr(0,1)&&(i=e.indexOf("-",1)+1)>0&&(n=e.substr(0,i),e=e.substr(i)),l.push({prefix:n,method:e.toLowerCase(),value:o,args:a,image:null})),a=[],e=n=r=o=""};return a=[],e=n=r=o="",t.split("").forEach(function(t){if(!(0===u&&h.indexOf(t)>-1)){switch(t){case'"':s?s===t&&(s=null):s=t;break;case"(":if(s)break;if(0===u)return u=1,void(o+=t);c++;break;case")":if(s)break;if(1===u){if(0===c)return u=0,o+=t,void f();c--}break;case",":if(s)break;if(0===u)return void f();if(1===u&&0===c&&!e.match(/^url$/i))return a.push(r),r="",void(o+=t)}o+=t,0===u?e+=t:r+=t}}),f(),l}},{}],30:[function(t,e,r){function n(t){i.apply(this,arguments),this.type="linear"===t.args[0]?this.TYPES.LINEAR:this.TYPES.RADIAL}var i=t("./gradientcontainer");n.prototype=Object.create(i.prototype),e.exports=n},{"./gradientcontainer":11}],31:[function(t,e,r){function n(t){return new i(function(e,r){var n=new XMLHttpRequest;n.open("GET",t),n.onload=function(){200===n.status?e(n.responseText):r(new Error(n.statusText))},n.onerror=function(){r(new Error("Network Error"))},n.send()})}var i=t("./promise");e.exports=n},{"./promise":18}]},{},[6])(6)}),function(t){function e(t){var e=t.length,n=r.type(t);return"function"===n||r.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t}if(!t.jQuery){var r=function(t,e){return new r.fn.init(t,e)};r.isWindow=function(t){return null!=t&&t==t.window},r.type=function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?i[s.call(t)]||"object":typeof t},r.isArray=Array.isArray||function(t){return"array"===r.type(t)},r.isPlainObject=function(t){var e;if(!t||"object"!==r.type(t)||t.nodeType||r.isWindow(t))return!1;try{if(t.constructor&&!o.call(t,"constructor")&&!o.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}for(e in t);return void 0===e||o.call(t,e)},r.each=function(t,r,n){var i,o=0,s=t.length,a=e(t);if(n){if(a)for(;s>o&&(i=r.apply(t[o],n),i!==!1);o++);else for(o in t)if(i=r.apply(t[o],n),i===!1)break}else if(a)for(;s>o&&(i=r.call(t[o],o,t[o]),i!==!1);o++);else for(o in t)if(i=r.call(t[o],o,t[o]),i===!1)break;return t},r.data=function(t,e,i){if(void 0===i){var o=t[r.expando],s=o&&n[o];if(void 0===e)return s;if(s&&e in s)return s[e]}else if(void 0!==e){var o=t[r.expando]||(t[r.expando]=++r.uuid);return n[o]=n[o]||{},n[o][e]=i,i}},r.removeData=function(t,e){var i=t[r.expando],o=i&&n[i];o&&r.each(e,function(t,e){delete o[e]})},r.extend=function(){var t,e,n,i,o,s,a=arguments[0]||{},h=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[h]||{},h++),"object"!=typeof a&&"function"!==r.type(a)&&(a={}),h===l&&(a=this,h--);l>h;h++)if(null!=(o=arguments[h]))for(i in o)t=a[i],n=o[i],a!==n&&(u&&n&&(r.isPlainObject(n)||(e=r.isArray(n)))?(e?(e=!1,s=t&&r.isArray(t)?t:[]):s=t&&r.isPlainObject(t)?t:{},a[i]=r.extend(u,s,n)):void 0!==n&&(a[i]=n));return a},r.queue=function(t,n,i){function o(t,r){var n=r||[];return null!=t&&(e(Object(t))?!function(t,e){for(var r=+e.length,n=0,i=t.length;r>n;)t[i++]=e[n++];if(r!==r)for(;void 0!==e[n];)t[i++]=e[n++];return t.length=i,t}(n,"string"==typeof t?[t]:t):[].push.call(n,t)),n}if(t){n=(n||"fx")+"queue";var s=r.data(t,n);return i?(!s||r.isArray(i)?s=r.data(t,n,o(i)):s.push(i),s):s||[]}},r.dequeue=function(t,e){r.each(t.nodeType?[t]:t,function(t,n){e=e||"fx";var i=r.queue(n,e),o=i.shift();"inprogress"===o&&(o=i.shift()),o&&("fx"===e&&i.unshift("inprogress"),o.call(n,function(){r.dequeue(n,e)}))})},r.fn=r.prototype={init:function(t){if(t.nodeType)return this[0]=t,this;throw new Error("Not a DOM node.")},offset:function(){var e=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:e.top+(t.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:e.left+(t.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function t(){for(var t=this.offsetParent||document;t&&"html"===!t.nodeType.toLowerCase&&"static"===t.style.position;)t=t.offsetParent;return t||document}var e=this[0],t=t.apply(e),n=this.offset(),i=/^(?:body|html)$/i.test(t.nodeName)?{top:0,left:0}:r(t).offset();return n.top-=parseFloat(e.style.marginTop)||0,n.left-=parseFloat(e.style.marginLeft)||0,t.style&&(i.top+=parseFloat(t.style.borderTopWidth)||0,i.left+=parseFloat(t.style.borderLeftWidth)||0),{top:n.top-i.top,left:n.left-i.left}}};var n={};r.expando="velocity"+(new Date).getTime(),r.uuid=0;for(var i={},o=i.hasOwnProperty,s=i.toString,a="Boolean Number String Function Array Date RegExp Object Error".split(" "),h=0;hi;++i){var o=l(r,t,n);if(0===o)return r;var s=h(r,t,n)-e;r-=s/o}return r}function c(){for(var e=0;y>e;++e)C[e]=h(e*x,t,n)}function f(e,r,i){var o,s,a=0;do s=r+(i-r)/2,o=h(s,t,n)-e,o>0?i=s:r=s;while(Math.abs(o)>v&&++a=A?u(e,a):0==h?a:f(e,r,r+x)}function p(){b=!0,(t!=r||n!=i)&&c()}var g=4,A=.001,v=1e-7,m=10,y=11,x=1/(y-1),w="Float32Array"in e;if(4!==arguments.length)return!1;for(var E=0;4>E;++E)if("number"!=typeof arguments[E]||isNaN(arguments[E])||!isFinite(arguments[E]))return!1;t=Math.min(t,1),n=Math.min(n,1),t=Math.max(t,0),n=Math.max(n,0);var C=w?new Float32Array(y):new Array(y),b=!1,B=function(e){return b||p(),t===r&&n===i?e:0===e?0:1===e?1:h(d(e),r,i)};B.getControlPoints=function(){return[{x:t,y:r},{x:n,y:i}]};var T="generateBezier("+[t,r,n,i]+")";return B.toString=function(){return T},B}function l(t,e){var r=t;return g.isString(t)?y.Easings[t]||(r=!1):r=g.isArray(t)&&1===t.length?a.apply(null,t):g.isArray(t)&&2===t.length?x.apply(null,t.concat([e])):g.isArray(t)&&4===t.length?h.apply(null,t):!1,r===!1&&(r=y.Easings[y.defaults.easing]?y.defaults.easing:m),r}function u(t){if(t){var e=(new Date).getTime(),r=y.State.calls.length;r>1e4&&(y.State.calls=i(y.State.calls));for(var o=0;r>o;o++)if(y.State.calls[o]){var a=y.State.calls[o],h=a[0],l=a[2],d=a[3],p=!!d,A=null;d||(d=y.State.calls[o][3]=e-16);for(var v=Math.min((e-d)/l.duration,1),m=0,x=h.length;x>m;m++){var E=h[m],b=E.element;if(s(b)){var B=!1;if(l.display!==n&&null!==l.display&&"none"!==l.display){if("flex"===l.display){var T=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];f.each(T,function(t,e){w.setPropertyValue(b,"display",e)})}w.setPropertyValue(b,"display",l.display)}l.visibility!==n&&"hidden"!==l.visibility&&w.setPropertyValue(b,"visibility",l.visibility);for(var D in E)if("element"!==D){var M,P=E[D],R=g.isString(P.easing)?y.Easings[P.easing]:P.easing;if(1===v)M=P.endValue;else{var I=P.endValue-P.startValue;if(M=P.startValue+I*R(v,l,I),!p&&M===P.currentValue)continue}if(P.currentValue=M,"tween"===D)A=M;else{if(w.Hooks.registered[D]){var S=w.Hooks.getRoot(D),O=s(b).rootPropertyValueCache[S];O&&(P.rootPropertyValue=O)}var F=w.setPropertyValue(b,D,P.currentValue+(0===parseFloat(M)?"":P.unitType),P.rootPropertyValue,P.scrollData);w.Hooks.registered[D]&&(w.Normalizations.registered[S]?s(b).rootPropertyValueCache[S]=w.Normalizations.registered[S]("extract",null,F[1]):s(b).rootPropertyValueCache[S]=F[1]),"transform"===F[0]&&(B=!0)}}l.mobileHA&&s(b).transformCache.translate3d===n&&(s(b).transformCache.translate3d="(0px, 0px, 0px)",B=!0),B&&w.flushTransformCache(b)}}l.display!==n&&"none"!==l.display&&(y.State.calls[o][2].display=!1),l.visibility!==n&&"hidden"!==l.visibility&&(y.State.calls[o][2].visibility=!1),l.progress&&l.progress.call(a[1],a[1],v,Math.max(0,d+l.duration-e),d,A),1===v&&c(o)}}y.State.isTicking&&C(u)}function c(t,e){if(!y.State.calls[t])return!1;for(var r=y.State.calls[t][0],i=y.State.calls[t][1],o=y.State.calls[t][2],a=y.State.calls[t][4],h=!1,l=0,u=r.length;u>l;l++){var c=r[l].element;if(e||o.loop||("none"===o.display&&w.setPropertyValue(c,"display",o.display),"hidden"===o.visibility&&w.setPropertyValue(c,"visibility",o.visibility)),o.loop!==!0&&(f.queue(c)[1]===n||!/\.velocityQueueEntryFlag/i.test(f.queue(c)[1]))&&s(c)){s(c).isAnimating=!1,s(c).rootPropertyValueCache={};var d=!1;f.each(w.Lists.transforms3D,function(t,e){var r=/^scale/.test(e)?1:0,i=s(c).transformCache[e];s(c).transformCache[e]!==n&&new RegExp("^\\("+r+"[^.]").test(i)&&(d=!0,delete s(c).transformCache[e])}),o.mobileHA&&(d=!0,delete s(c).transformCache.translate3d),d&&w.flushTransformCache(c),w.Values.removeClass(c,"velocity-animating")}if(!e&&o.complete&&!o.loop&&l===u-1)try{o.complete.call(i,i)}catch(p){setTimeout(function(){throw p},1)}a&&o.loop!==!0&&a(i),s(c)&&o.loop===!0&&!e&&(f.each(s(c).tweensContainer,function(t,e){/^rotate/.test(t)&&360===parseFloat(e.endValue)&&(e.endValue=0,e.startValue=360),/^backgroundPosition/.test(t)&&100===parseFloat(e.endValue)&&"%"===e.unitType&&(e.endValue=0,e.startValue=100)}),y(c,"reverse",{loop:!0,delay:o.delay})),o.queue!==!1&&f.dequeue(c,o.queue)}y.State.calls[t]=!1;for(var g=0,A=y.State.calls.length;A>g;g++)if(y.State.calls[g]!==!1){h=!0;break}h===!1&&(y.State.isTicking=!1,delete y.State.calls,y.State.calls=[])}var f,d=function(){if(r.documentMode)return r.documentMode;for(var t=7;t>4;t--){var e=r.createElement("div");if(e.innerHTML="",e.getElementsByTagName("span").length)return e=null,t}return n}(),p=function(){var t=0;return e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||function(e){var r,n=(new Date).getTime();return r=Math.max(0,16-(n-t)),t=n+r,setTimeout(function(){e(n+r)},r)}}(),g={isString:function(t){return"string"==typeof t},isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},isFunction:function(t){return"[object Function]"===Object.prototype.toString.call(t)},isNode:function(t){return t&&t.nodeType},isNodeList:function(t){return"object"==typeof t&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(t))&&t.length!==n&&(0===t.length||"object"==typeof t[0]&&t[0].nodeType>0)},isWrapped:function(t){return t&&(t.jquery||e.Zepto&&e.Zepto.zepto.isZ(t))},isSVG:function(t){return e.SVGElement&&t instanceof e.SVGElement},isEmptyObject:function(t){for(var e in t)return!1;return!0}},A=!1;if(t.fn&&t.fn.jquery?(f=t,A=!0):f=e.Velocity.Utilities,8>=d&&!A)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(7>=d)return void(jQuery.fn.velocity=jQuery.fn.animate);var v=400,m="swing",y={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:e.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:r.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:f,Redirects:{},Easings:{},Promise:e.Promise,defaults:{queue:"",duration:v,easing:m,begin:n,complete:n,progress:n,display:n,visibility:n,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},init:function(t){f.data(t,"velocity",{isSVG:g.isSVG(t),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:2,patch:2},debug:!1};e.pageYOffset!==n?(y.State.scrollAnchor=e,y.State.scrollPropertyLeft="pageXOffset",y.State.scrollPropertyTop="pageYOffset"):(y.State.scrollAnchor=r.documentElement||r.body.parentNode||r.body,y.State.scrollPropertyLeft="scrollLeft",y.State.scrollPropertyTop="scrollTop");var x=function(){function t(t){return-t.tension*t.x-t.friction*t.v}function e(e,r,n){var i={x:e.x+n.dx*r,v:e.v+n.dv*r,tension:e.tension,friction:e.friction};return{dx:i.v,dv:t(i)}}function r(r,n){var i={dx:r.v,dv:t(r)},o=e(r,.5*n,i),s=e(r,.5*n,o),a=e(r,n,s),h=1/6*(i.dx+2*(o.dx+s.dx)+a.dx),l=1/6*(i.dv+2*(o.dv+s.dv)+a.dv);return r.x=r.x+h*n,r.v=r.v+l*n,r}return function n(t,e,i){var o,s,a,h={x:-1,v:0,tension:null,friction:null},l=[0],u=0,c=1e-4,f=.016;for(t=parseFloat(t)||500,e=parseFloat(e)||20,i=i||null,h.tension=t,h.friction=e,o=null!==i,o?(u=n(t,e),s=u/i*f):s=f;;)if(a=r(a||h,s),l.push(1+a.x),u+=16,!(Math.abs(a.x)>c&&Math.abs(a.v)>c))break;return o?function(t){return l[t*(l.length-1)|0]}:u}}();y.Easings={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},spring:function(t){return 1-Math.cos(4.5*t*Math.PI)*Math.exp(6*-t)}},f.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(t,e){y.Easings[e[0]]=h.apply(null,e[1])});var w=y.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var t=0;t=d)switch(t){case"name":return"filter";case"extract":var n=r.toString().match(/alpha\(opacity=(.*)\)/i);return r=n?n[1]/100:1;case"inject":return e.style.zoom=1,parseFloat(r)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(r),10)+")"}else switch(t){case"name":return"opacity";case"extract":return r;case"inject":return r}}},register:function(){9>=d||y.State.isGingerbread||(w.Lists.transformsBase=w.Lists.transformsBase.concat(w.Lists.transforms3D));for(var t=0;ti&&(i=1),o=!/(\d)$/i.test(i);break;case"skew":o=!/(deg|\d)$/i.test(i);break;case"rotate":o=!/(deg|\d)$/i.test(i)}return o||(s(r).transformCache[e]="("+i+")"),s(r).transformCache[e]}}}();for(var t=0;t=d||3!==o.split(" ").length||(o+=" 1"),o;case"inject":return 8>=d?4===i.split(" ").length&&(i=i.split(/\s+/).slice(0,3).join(" ")):3===i.split(" ").length&&(i+=" 1"),(8>=d?"rgb":"rgba")+"("+i.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})},SVGAttribute:function(t){var e="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(d||y.State.isAndroid&&!y.State.isChrome)&&(e+="|transform"),new RegExp("^("+e+")$","i").test(t)},prefixCheck:function(t){if(y.State.prefixMatches[t])return[y.State.prefixMatches[t],!0];for(var e=["","Webkit","Moz","ms","O"],r=0,n=e.length;n>r;r++){var i;if(i=0===r?t:e[r]+t.replace(/^\w/,function(t){return t.toUpperCase()}),g.isString(y.State.prefixElement.style[i]))return y.State.prefixMatches[t]=i,[i,!0]}return[t,!1]}},Values:{hexToRgb:function(t){var e,r=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;return t=t.replace(r,function(t,e,r,n){return e+e+r+r+n+n}),e=n.exec(t),e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:[0,0,0]},isCSSNullValue:function(t){return 0==t||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(t)},getUnitType:function(t){return/^(rotate|skew)/i.test(t)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(t)?"":"px"},getDisplayType:function(t){var e=t&&t.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(e)?"inline":/^(li)$/i.test(e)?"list-item":/^(tr)$/i.test(e)?"table-row":/^(table)$/i.test(e)?"table":/^(tbody)$/i.test(e)?"table-row-group":"block"},addClass:function(t,e){t.classList?t.classList.add(e):t.className+=(t.className.length?" ":"")+e},removeClass:function(t,e){t.classList?t.classList.remove(e):t.className=t.className.toString().replace(new RegExp("(^|\\s)"+e.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(t,r,i,o){function a(t,r){function i(){l&&w.setPropertyValue(t,"display","none")}var h=0;if(8>=d)h=f.css(t,r);else{var l=!1;if(/^(width|height)$/.test(r)&&0===w.getPropertyValue(t,"display")&&(l=!0, -w.setPropertyValue(t,"display",w.Values.getDisplayType(t))),!o){if("height"===r&&"border-box"!==w.getPropertyValue(t,"boxSizing").toString().toLowerCase()){var u=t.offsetHeight-(parseFloat(w.getPropertyValue(t,"borderTopWidth"))||0)-(parseFloat(w.getPropertyValue(t,"borderBottomWidth"))||0)-(parseFloat(w.getPropertyValue(t,"paddingTop"))||0)-(parseFloat(w.getPropertyValue(t,"paddingBottom"))||0);return i(),u}if("width"===r&&"border-box"!==w.getPropertyValue(t,"boxSizing").toString().toLowerCase()){var c=t.offsetWidth-(parseFloat(w.getPropertyValue(t,"borderLeftWidth"))||0)-(parseFloat(w.getPropertyValue(t,"borderRightWidth"))||0)-(parseFloat(w.getPropertyValue(t,"paddingLeft"))||0)-(parseFloat(w.getPropertyValue(t,"paddingRight"))||0);return i(),c}}var p;p=s(t)===n?e.getComputedStyle(t,null):s(t).computedStyle?s(t).computedStyle:s(t).computedStyle=e.getComputedStyle(t,null),"borderColor"===r&&(r="borderTopColor"),h=9===d&&"filter"===r?p.getPropertyValue(r):p[r],(""===h||null===h)&&(h=t.style[r]),i()}if("auto"===h&&/^(top|right|bottom|left)$/i.test(r)){var g=a(t,"position");("fixed"===g||"absolute"===g&&/top|left/i.test(r))&&(h=f(t).position()[r]+"px")}return h}var h;if(w.Hooks.registered[r]){var l=r,u=w.Hooks.getRoot(l);i===n&&(i=w.getPropertyValue(t,w.Names.prefixCheck(u)[0])),w.Normalizations.registered[u]&&(i=w.Normalizations.registered[u]("extract",t,i)),h=w.Hooks.extractValue(l,i)}else if(w.Normalizations.registered[r]){var c,p;c=w.Normalizations.registered[r]("name",t),"transform"!==c&&(p=a(t,w.Names.prefixCheck(c)[0]),w.Values.isCSSNullValue(p)&&w.Hooks.templates[r]&&(p=w.Hooks.templates[r][1])),h=w.Normalizations.registered[r]("extract",t,p)}if(!/^[\d-]/.test(h))if(s(t)&&s(t).isSVG&&w.Names.SVGAttribute(r))if(/^(height|width)$/i.test(r))try{h=t.getBBox()[r]}catch(g){h=0}else h=t.getAttribute(r);else h=a(t,w.Names.prefixCheck(r)[0]);return w.Values.isCSSNullValue(h)&&(h=0),y.debug>=2&&console.log("Get "+r+": "+h),h},setPropertyValue:function(t,r,n,i,o){var a=r;if("scroll"===r)o.container?o.container["scroll"+o.direction]=n:"Left"===o.direction?e.scrollTo(n,o.alternateValue):e.scrollTo(o.alternateValue,n);else if(w.Normalizations.registered[r]&&"transform"===w.Normalizations.registered[r]("name",t))w.Normalizations.registered[r]("inject",t,n),a="transform",n=s(t).transformCache[r];else{if(w.Hooks.registered[r]){var h=r,l=w.Hooks.getRoot(r);i=i||w.getPropertyValue(t,l),n=w.Hooks.injectValue(h,n,i),r=l}if(w.Normalizations.registered[r]&&(n=w.Normalizations.registered[r]("inject",t,n),r=w.Normalizations.registered[r]("name",t)),a=w.Names.prefixCheck(r)[0],8>=d)try{t.style[a]=n}catch(u){y.debug&&console.log("Browser does not support ["+n+"] for ["+a+"]")}else if(s(t)&&s(t).isSVG&&w.Names.SVGAttribute(r))t.setAttribute(r,n);else{var c="webgl"===t.renderer?t.styleGL:t.style;c[a]=n}y.debug>=2&&console.log("Set "+r+" ("+a+"): "+n)}return[a,n]},flushTransformCache:function(t){function e(e){return parseFloat(w.getPropertyValue(t,e))}var r="";if((d||y.State.isAndroid&&!y.State.isChrome)&&s(t).isSVG){var n={translate:[e("translateX"),e("translateY")],skewX:[e("skewX")],skewY:[e("skewY")],scale:1!==e("scale")?[e("scale"),e("scale")]:[e("scaleX"),e("scaleY")],rotate:[e("rotateZ"),0,0]};f.each(s(t).transformCache,function(t){/^translate/i.test(t)?t="translate":/^scale/i.test(t)?t="scale":/^rotate/i.test(t)&&(t="rotate"),n[t]&&(r+=t+"("+n[t].join(" ")+") ",delete n[t])})}else{var i,o;f.each(s(t).transformCache,function(e){return i=s(t).transformCache[e],"transformPerspective"===e?(o=i,!0):(9===d&&"rotateZ"===e&&(e="rotate"),void(r+=e+i+" "))}),o&&(r="perspective"+o+" "+r)}w.setPropertyValue(t,"transform",r)}};w.Hooks.register(),w.Normalizations.register(),y.hook=function(t,e,r){var i=n;return t=o(t),f.each(t,function(t,o){if(s(o)===n&&y.init(o),r===n)i===n&&(i=y.CSS.getPropertyValue(o,e));else{var a=y.CSS.setPropertyValue(o,e,r);"transform"===a[0]&&y.CSS.flushTransformCache(o),i=a}}),i};var E=function(){function t(){return a?D.promise||null:h}function i(){function t(t){function c(t,e){var r=n,i=n,s=n;return g.isArray(t)?(r=t[0],!g.isArray(t[1])&&/^[\d-]/.test(t[1])||g.isFunction(t[1])||w.RegEx.isHex.test(t[1])?s=t[1]:(g.isString(t[1])&&!w.RegEx.isHex.test(t[1])||g.isArray(t[1]))&&(i=e?t[1]:l(t[1],a.duration),t[2]!==n&&(s=t[2]))):r=t,e||(i=i||a.easing),g.isFunction(r)&&(r=r.call(o,b,C)),g.isFunction(s)&&(s=s.call(o,b,C)),[r||0,i,s]}function d(t,e){var r,n;return n=(e||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(t){return r=t,""}),r||(r=w.Values.getUnitType(t)),[n,r]}function v(){var t={myParent:o.parentNode||r.body,position:w.getPropertyValue(o,"position"),fontSize:w.getPropertyValue(o,"fontSize")},n=t.position===F.lastPosition&&t.myParent===F.lastParent,i=t.fontSize===F.lastFontSize;F.lastParent=t.myParent,F.lastPosition=t.position,F.lastFontSize=t.fontSize;var a=100,h={};if(i&&n)h.emToPx=F.lastEmToPx,h.percentToPxWidth=F.lastPercentToPxWidth,h.percentToPxHeight=F.lastPercentToPxHeight;else{var l=s(o).isSVG?r.createElementNS("http://www.w3.org/2000/svg","rect"):r.createElement("div");y.init(l),t.myParent.appendChild(l),f.each(["overflow","overflowX","overflowY"],function(t,e){y.CSS.setPropertyValue(l,e,"hidden")}),y.CSS.setPropertyValue(l,"position",t.position),y.CSS.setPropertyValue(l,"fontSize",t.fontSize),y.CSS.setPropertyValue(l,"boxSizing","content-box"),f.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(t,e){y.CSS.setPropertyValue(l,e,a+"%")}),y.CSS.setPropertyValue(l,"paddingLeft",a+"em"),h.percentToPxWidth=F.lastPercentToPxWidth=(parseFloat(w.getPropertyValue(l,"width",null,!0))||1)/a,h.percentToPxHeight=F.lastPercentToPxHeight=(parseFloat(w.getPropertyValue(l,"height",null,!0))||1)/a,h.emToPx=F.lastEmToPx=(parseFloat(w.getPropertyValue(l,"paddingLeft"))||1)/a,t.myParent.removeChild(l)}return null===F.remToPx&&(F.remToPx=parseFloat(w.getPropertyValue(r.body,"fontSize"))||16),null===F.vwToPx&&(F.vwToPx=parseFloat(e.innerWidth)/100,F.vhToPx=parseFloat(e.innerHeight)/100),h.remToPx=F.remToPx,h.vwToPx=F.vwToPx,h.vhToPx=F.vhToPx,y.debug>=1&&console.log("Unit ratios: "+JSON.stringify(h),o),h}if(a.begin&&0===b)try{a.begin.call(p,p)}catch(x){setTimeout(function(){throw x},1)}if("scroll"===M){var E,B,T,P=/^x$/i.test(a.axis)?"Left":"Top",R=parseFloat(a.offset)||0;a.container?g.isWrapped(a.container)||g.isNode(a.container)?(a.container=a.container[0]||a.container,E=a.container["scroll"+P],T=E+f(o).position()[P.toLowerCase()]+R):a.container=null:(E=y.State.scrollAnchor[y.State["scrollProperty"+P]],B=y.State.scrollAnchor[y.State["scrollProperty"+("Left"===P?"Top":"Left")]],T=f(o).offset()[P.toLowerCase()]+R),h={scroll:{rootPropertyValue:!1,startValue:E,currentValue:E,endValue:T,unitType:"",easing:a.easing,scrollData:{container:a.container,direction:P,alternateValue:B}},element:o},y.debug&&console.log("tweensContainer (scroll): ",h.scroll,o)}else if("reverse"===M){if(!s(o).tweensContainer)return void f.dequeue(o,a.queue);"none"===s(o).opts.display&&(s(o).opts.display="auto"),"hidden"===s(o).opts.visibility&&(s(o).opts.visibility="visible"),s(o).opts.loop=!1,s(o).opts.begin=null,s(o).opts.complete=null,m.easing||delete a.easing,m.duration||delete a.duration,a=f.extend({},s(o).opts,a);var I=f.extend(!0,{},s(o).tweensContainer);for(var S in I)if("element"!==S){var O=I[S].startValue;I[S].startValue=I[S].currentValue=I[S].endValue,I[S].endValue=O,g.isEmptyObject(m)||(I[S].easing=a.easing),y.debug&&console.log("reverse tweensContainer ("+S+"): "+JSON.stringify(I[S]),o)}h=I}else if("start"===M){var I;s(o).tweensContainer&&s(o).isAnimating===!0&&(I=s(o).tweensContainer),f.each(A,function(t,e){if(RegExp("^"+w.Lists.colors.join("$|^")+"$").test(t)){var r=c(e,!0),i=r[0],o=r[1],s=r[2];if(w.RegEx.isHex.test(i)){for(var a=["Red","Green","Blue"],h=w.Values.hexToRgb(i),l=s?w.Values.hexToRgb(s):n,u=0;uN;N++){var H={delay:R.delay,progress:R.progress};N===L-1&&(H.display=R.display,H.visibility=R.visibility,H.complete=R.complete),E(p,"reverse",H)}return t()}};y=f.extend(E,y),y.animate=E;var C=e.requestAnimationFrame||p;return y.State.isMobile||r.hidden===n||r.addEventListener("visibilitychange",function(){r.hidden?(C=function(t){return setTimeout(function(){t(!0)},16)},u()):C=e.requestAnimationFrame||p}),t.Velocity=y,t!==e&&(t.fn.velocity=E,t.fn.velocity.defaults=y.defaults),f.each(["Down","Up"],function(t,e){y.Redirects["slide"+e]=function(t,r,i,o,s,a){var h=f.extend({},r),l=h.begin,u=h.complete,c={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""},d={};h.display===n&&(h.display="Down"===e?"inline"===y.CSS.Values.getDisplayType(t)?"inline-block":"block":"none"),h.begin=function(){var r="webgl"===t.renderer?t.styleGL:t.style;l&&l.call(s,s);for(var n in c){d[n]=r[n];var i=y.CSS.getPropertyValue(t,n);c[n]="Down"===e?[i,0]:[0,i]}d.overflow=r.overflow,r.overflow="hidden"},h.complete=function(){for(var t in d)style[t]=d[t];u&&u.call(s,s),a&&a.resolver(s)},y(t,c,h)}}),f.each(["In","Out"],function(t,e){y.Redirects["fade"+e]=function(t,r,i,o,s,a){var h=f.extend({},r),l={opacity:"In"===e?1:0},u=h.complete;i!==o-1?h.complete=h.begin=null:h.complete=function(){u&&u.call(s,s),a&&a.resolver(s)},h.display===n&&(h.display="In"===e?"auto":"none"),y(this,l,h)}}),y}(window.jQuery||window.Zepto||window,window,document)}),function(t){t.HTMLGL=t.HTMLGL||{},t.HTMLGL.util={getterSetter:function(t,e,r,n){Object.defineProperty?Object.defineProperty(t,e,{get:r,set:n}):document.__defineGetter__&&(t.__defineGetter__(e,r),t.__defineSetter__(e,n)),t["get"+e]=r,t["set"+e]=n},emitEvent:function(t,e){var r=new MouseEvent(e.type,e);r.dispatcher="html-gl",e.stopPropagation(),t.dispatchEvent(r)},debounce:function(t,e,r){var n;return function(){var i=this,o=arguments,s=function(){n=null,r||t.apply(i,o)},a=r&&!n;clearTimeout(n),n=setTimeout(s,e),a&&t.apply(i,o)}}}}(window),function(t){var e=function(t){},r=e.prototype;r.getElementByCoordinates=function(e,r){var n,i,o=this;return t.HTMLGL.elements.forEach(function(t){n=document.elementFromPoint(e-parseInt(t.transformObject.translateX||0),r-parseInt(t.transformObject.translateY||0)),o.isChildOf(n,t)&&(i=n)}),i},r.isChildOf=function(t,e){for(var r=t;r;){if(r===e)return!0;r=r.parentNode}return!1},t.HTMLGL.GLElementResolver=e}(window),function(t){HTMLGL=t.HTMLGL=t.HTMLGL||{},HTMLGL.JQ_PLUGIN_NAME="htmlgl",HTMLGL.CUSTOM_ELEMENT_TAG_NAME="html-gl",HTMLGL.READY_EVENT="htmlglReady",HTMLGL.context=void 0,HTMLGL.stage=void 0,HTMLGL.renderer=void 0,HTMLGL.elements=[],HTMLGL.pixelRatio=null,HTMLGL.oldPixelRatio=null,HTMLGL.enabled=!0,HTMLGL.scrollX=0,HTMLGL.scrollY=0;var e=function(){t.HTMLGL.context=this,this.createStage(),this.updateScrollPosition(),this.initListeners(),this.elementResolver=new t.HTMLGL.GLElementResolver(this),document.body?this.initViewer():document.addEventListener("DOMContentLoaded",this.initViewer.bind(this))},r=e.prototype;r.initViewer=function(){this.createViewer(),this.resizeViewer(),this.appendViewer()},r.createViewer=function(){t.HTMLGL.renderer=this.renderer=PIXI.autoDetectRenderer(0,0,{transparent:!0}),this.renderer.view.style.position="fixed",this.renderer.view.style.top="0px",this.renderer.view.style.left="0px",this.renderer.view.style["pointer-events"]="none",this.renderer.view.style.pointerEvents="none"},r.appendViewer=function(){document.body.appendChild(this.renderer.view),requestAnimationFrame(this.redrawStage.bind(this))},r.resizeViewer=function(){var e=this,r=t.innerWidth,n=t.innerHeight;HTMLGL.pixelRatio=window.devicePixelRatio||1,console.log(HTMLGL.pixelRatio),r*=HTMLGL.pixelRatio,n*=HTMLGL.pixelRatio,HTMLGL.pixelRatio!==HTMLGL.oldPixelRatio?(this.disable(),this.updateTextures().then(function(){e.updateScrollPosition(),e.updateElementsPositions();var i=1/HTMLGL.pixelRatio;e.renderer.view.style.transformOrigin="0 0",e.renderer.view.style.webkitTransformOrigin="0 0",e.renderer.view.style.transform="scaleX("+i+") scaleY("+i+")",e.renderer.view.style.webkitTransform="scaleX("+i+") scaleY("+i+")",e.renderer.resize(r,n),this.enable(),t.HTMLGL.renderer.render(t.HTMLGL.stage)})):(this.renderer.view.parentNode&&this.updateTextures(),this.updateElementsPositions(),this.markStageAsChanged()),HTMLGL.oldPixelRatio=HTMLGL.pixelRatio},r.initListeners=function(){t.addEventListener("scroll",this.updateScrollPosition.bind(this)),t.addEventListener("resize",t.HTMLGL.util.debounce(this.resizeViewer,500).bind(this)),t.addEventListener("resize",this.updateElementsPositions.bind(this)),document.addEventListener("click",this.onMouseEvent.bind(this),!0),document.addEventListener("mousemove",this.onMouseEvent.bind(this),!0),document.addEventListener("mouseup",this.onMouseEvent.bind(this),!0),document.addEventListener("mousedown",this.onMouseEvent.bind(this),!0),document.addEventListener("touchstart",this.onMouseEvent.bind(this)),document.addEventListener("touchend",this.onMouseEvent.bind(this))},r.updateScrollPosition=function(){var e={};if(void 0!=window.pageYOffset)e={left:pageXOffset,top:pageYOffset};else{var r,n,i=document,o=i.documentElement,s=i.body;r=o.scrollLeft||s.scrollLeft||0,n=o.scrollTop||s.scrollTop||0,e={left:r,top:n}}this.document.x=-e.left*HTMLGL.pixelRatio,this.document.y=-e.top*HTMLGL.pixelRatio,t.HTMLGL.scrollX=e.left,t.HTMLGL.scrollY=e.top,this.markStageAsChanged()},r.createStage=function(){t.HTMLGL.stage=this.stage=new PIXI.Stage(16777215),t.HTMLGL.document=this.document=new PIXI.DisplayObjectContainer,this.stage.addChild(t.HTMLGL.document)},r.redrawStage=function(){t.HTMLGL.stage.changed&&t.HTMLGL.renderer&&t.HTMLGL.enabled&&(t.HTMLGL.renderer.render(t.HTMLGL.stage),t.HTMLGL.stage.changed=!1)},r.updateTextures=function(){var e=[];return t.HTMLGL.elements.forEach(function(t){e.push(t.updateTexture())}),Promise.all(e)},r.initElements=function(){t.HTMLGL.elements.forEach(function(t){t.init()})},r.updateElementsPositions=function(){t.HTMLGL.elements.forEach(function(t){t.updateBoundingRect(),t.updatePivot(),t.updateSpriteTransform()})},r.onMouseEvent=function(e){var r=e.x||e.pageX,n=e.y||e.pageY,i="html-gl"!==e.dispatcher?this.elementResolver.getElementByCoordinates(r,n):null;i?t.HTMLGL.util.emitEvent(i,e):null},r.markStageAsChanged=function(){t.HTMLGL.stage&&!t.HTMLGL.stage.changed&&(requestAnimationFrame(this.redrawStage),t.HTMLGL.stage.changed=!0)},r.disable=function(){t.HTMLGL.enabled=!0},r.enable=function(){t.HTMLGL.enabled=!1},t.HTMLGL.pixelRatio=window.devicePixelRatio||1,t.HTMLGL.GLContext=e,new e}(window),function(t){var e=function(t,e){this.element=t,this.images=this.element.querySelectorAll("img"),this.callback=e,this.imagesLoaded=this.getImagesLoaded(),this.images.length===this.imagesLoaded?this.onImageLoaded():this.addListeners()},r=e.prototype;r.getImagesLoaded=function(){for(var t=0,e=0;et;t++)n.call(this,this._deferreds[t]);this._deferreds=null}function a(t,e,r,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=r,this.reject=n}function l(t,e,r){var n=!1;try{t(function(t){n||(n=!0,e(t))},function(t){n||(n=!0,r(t))})}catch(i){if(n)return;n=!0,r(i)}}var u=r.immediateFn||"function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)},h=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};r.prototype["catch"]=function(t){return this.then(null,t)},r.prototype.then=function(t,e){var i=this;return new r(function(r,o){n.call(i,new a(t,e,r,o))})},r.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&h(arguments[0])?arguments[0]:arguments);return new r(function(e,r){function n(o,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,function(t){n(o,t)},r)}t[o]=s,0===--i&&e(t)}catch(l){r(l)}}if(0===t.length)return e([]);for(var i=t.length,o=0;on;n++)t[n].then(e,r)})},"undefined"!=typeof module&&module.exports?module.exports=r:t.Promise||(t.Promise=r)}(this),"undefined"==typeof WeakMap&&!function(){var t=Object.defineProperty,e=Date.now()%1e9,r=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")};r.prototype={set:function(e,r){var n=e[this.name];return n&&n[0]===e?n[1]=r:t(e,this.name,{value:[e,r],writable:!0}),this},get:function(t){var e;return(e=t[this.name])&&e[0]===t?e[1]:void 0},"delete":function(t){var e=t[this.name];return e&&e[0]===t?(e[0]=e[1]=void 0,!0):!1},has:function(t){var e=t[this.name];return e?e[0]===t:!1}},window.WeakMap=r}(),window.CustomElements=window.CustomElements||{flags:{}},function(t){var e=t.flags,r=[],n=function(t){r.push(t)},i=function(){r.forEach(function(e){e(t)})};t.addModule=n,t.initializeModules=i,t.hasNative=Boolean(document.registerElement),t.useNative=!e.register&&t.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||HTMLImports.useNative)}(CustomElements),CustomElements.addModule(function(t){function e(t,e){r(t,function(t){return e(t)?!0:void n(t,e)}),n(t,e)}function r(t,e,n){var i=t.firstElementChild;if(!i)for(i=t.firstChild;i&&i.nodeType!==Node.ELEMENT_NODE;)i=i.nextSibling;for(;i;)e(i,n)!==!0&&r(i,e,n),i=i.nextElementSibling;return null}function n(t,r){for(var n=t.shadowRoot;n;)e(n,r),n=n.olderShadowRoot}function i(t,e){s=[],o(t,e),s=null}function o(t,e){if(t=wrap(t),!(s.indexOf(t)>=0)){s.push(t);for(var r,n=t.querySelectorAll("link[rel="+a+"]"),i=0,l=n.length;l>i&&(r=n[i]);i++)r["import"]&&o(r["import"],e);e(t)}}var s,a=window.HTMLImports?HTMLImports.IMPORT_LINK_TYPE:"none";t.forDocumentTree=i,t.forSubtree=e}),CustomElements.addModule(function(t){function e(t){return r(t)||n(t)}function r(e){return t.upgrade(e)?!0:void a(e)}function n(t){x(t,function(t){return r(t)?!0:void 0})}function i(t){a(t),f(t)&&x(t,function(t){a(t)})}function o(t){b.push(t),C||(C=!0,setTimeout(s))}function s(){C=!1;for(var t,e=b,r=0,n=e.length;n>r&&(t=e[r]);r++)t();b=[]}function a(t){E?o(function(){l(t)}):l(t)}function l(t){t.__upgraded__&&(t.attachedCallback||t.detachedCallback)&&!t.__attached&&f(t)&&(t.__attached=!0,t.attachedCallback&&t.attachedCallback())}function u(t){h(t),x(t,function(t){h(t)})}function h(t){E?o(function(){c(t)}):c(t)}function c(t){t.__upgraded__&&(t.attachedCallback||t.detachedCallback)&&t.__attached&&!f(t)&&(t.__attached=!1,t.detachedCallback&&t.detachedCallback())}function f(t){for(var e=t,r=wrap(document);e;){if(e==r)return!0;e=e.parentNode||e.host}}function d(t){if(t.shadowRoot&&!t.shadowRoot.__watched){y.dom&&console.log("watching shadow-root for: ",t.localName);for(var e=t.shadowRoot;e;)A(e),e=e.olderShadowRoot}}function p(t){if(y.dom){var r=t[0];if(r&&"childList"===r.type&&r.addedNodes&&r.addedNodes){for(var n=r.addedNodes[0];n&&n!==document&&!n.host;)n=n.parentNode;var i=n&&(n.URL||n._URL||n.host&&n.host.localName)||"";i=i.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",t.length,i||"")}t.forEach(function(t){"childList"===t.type&&(B(t.addedNodes,function(t){t.localName&&e(t)}),B(t.removedNodes,function(t){t.localName&&u(t)}))}),y.dom&&console.groupEnd()}function g(t){for(t=wrap(t),t||(t=wrap(document));t.parentNode;)t=t.parentNode;var e=t.__observer;e&&(p(e.takeRecords()),s())}function A(t){if(!t.__observer){var e=new MutationObserver(p);e.observe(t,{childList:!0,subtree:!0}),t.__observer=e}}function v(t){t=wrap(t),y.dom&&console.group("upgradeDocument: ",t.baseURI.split("/").pop()),e(t),A(t),y.dom&&console.groupEnd()}function m(t){w(t,v)}var y=t.flags,x=t.forSubtree,w=t.forDocumentTree,E=!window.MutationObserver||window.MutationObserver===window.JsMutationObserver;t.hasPolyfillMutations=E;var C=!1,b=[],B=Array.prototype.forEach.call.bind(Array.prototype.forEach),T=Element.prototype.createShadowRoot;T&&(Element.prototype.createShadowRoot=function(){var t=T.call(this);return CustomElements.watchShadow(this),t}),t.watchShadow=d,t.upgradeDocumentTree=m,t.upgradeSubtree=n,t.upgradeAll=e,t.attachedNode=i,t.takeRecords=g}),CustomElements.addModule(function(t){function e(e){if(!e.__upgraded__&&e.nodeType===Node.ELEMENT_NODE){var n=e.getAttribute("is"),i=t.getRegisteredDefinition(n||e.localName);if(i){if(n&&i.tag==e.localName)return r(e,i);if(!n&&!i["extends"])return r(e,i)}}}function r(e,r){return s.upgrade&&console.group("upgrade:",e.localName),r.is&&e.setAttribute("is",r.is),n(e,r),e.__upgraded__=!0,o(e),t.attachedNode(e),t.upgradeSubtree(e),s.upgrade&&console.groupEnd(),e}function n(t,e){Object.__proto__?t.__proto__=e.prototype:(i(t,e.prototype,e["native"]),t.__proto__=e.prototype)}function i(t,e,r){for(var n={},i=e;i!==r&&i!==HTMLElement.prototype;){for(var o,s=Object.getOwnPropertyNames(i),a=0;o=s[a];a++)n[o]||(Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(i,o)),n[o]=1);i=Object.getPrototypeOf(i)}}function o(t){t.createdCallback&&t.createdCallback()}var s=t.flags;t.upgrade=e,t.upgradeWithDefinition=r,t.implementPrototype=n}),CustomElements.addModule(function(t){function e(e,n){var l=n||{};if(!e)throw new Error("document.registerElement: first argument `name` must not be empty");if(e.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(e)+"'.");if(i(e))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(e)+"'. The type name is invalid.");if(u(e))throw new Error("DuplicateDefinitionError: a type with name '"+String(e)+"' is already registered");return l.prototype||(l.prototype=Object.create(HTMLElement.prototype)),l.__name=e.toLowerCase(),l.lifecycle=l.lifecycle||{},l.ancestry=o(l["extends"]),s(l),a(l),r(l.prototype),h(l.__name,l),l.ctor=c(l),l.ctor.prototype=l.prototype,l.prototype.constructor=l.ctor,t.ready&&A(document),l.ctor}function r(t){if(!t.setAttribute._polyfilled){var e=t.setAttribute;t.setAttribute=function(t,r){n.call(this,t,r,e)};var r=t.removeAttribute;t.removeAttribute=function(t){n.call(this,t,null,r)},t.setAttribute._polyfilled=!0}}function n(t,e,r){t=t.toLowerCase();var n=this.getAttribute(t);r.apply(this,arguments);var i=this.getAttribute(t);this.attributeChangedCallback&&i!==n&&this.attributeChangedCallback(t,n,i)}function i(t){for(var e=0;e=0&&y(n,HTMLElement),n)}function p(t){var e=T.call(this,t);return v(e),e}var g,A=t.upgradeDocumentTree,v=t.upgrade,m=t.upgradeWithDefinition,y=t.implementPrototype,x=t.useNative,w=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],E={},C="http://www.w3.org/1999/xhtml",b=document.createElement.bind(document),B=document.createElementNS.bind(document),T=Node.prototype.cloneNode;g=Object.__proto__||x?function(t,e){return t instanceof e}:function(t,e){for(var r=t;r;){if(r===e.prototype)return!0;r=r.__proto__}return!1},document.registerElement=e,document.createElement=d,document.createElementNS=f,Node.prototype.cloneNode=p,t.registry=E,t["instanceof"]=g,t.reservedTagList=w,t.getRegisteredDefinition=u,document.register=document.registerElement}),function(t){function e(){s(wrap(document)),window.HTMLImports&&(HTMLImports.__importsParsingHook=function(t){s(wrap(t["import"]))}),CustomElements.ready=!0,setTimeout(function(){CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})}var r=t.useNative,n=t.initializeModules,i=/Trident/.test(navigator.userAgent);if(r){var o=function(){};t.watchShadow=o,t.upgrade=o,t.upgradeAll=o,t.upgradeDocumentTree=o,t.upgradeSubtree=o,t.takeRecords=o,t["instanceof"]=function(t,e){return t instanceof e}}else n();var s=t.upgradeDocumentTree;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(t){return t}),i&&"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(t,e){e=e||{};var r=document.createEvent("CustomEvent");return r.initCustomEvent(t,Boolean(e.bubbles),Boolean(e.cancelable),e.detail),r},window.CustomEvent.prototype=window.Event.prototype),"complete"===document.readyState||t.flags.eager)e();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var a=window.HTMLImports&&!HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(a,e)}else e()}(window.CustomElements),!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.PIXI=t()}}(function(){var t;return function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[s]={exports:{}};t[s][0].call(h.exports,function(e){var r=t[s][1][e];return i(r?r:e)},h,h.exports,e,t,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s=t.length&&r())}if(r=r||function(){},!t.length)return r();var o=0;u(t,function(t){e(t,n(i))})},s.forEach=s.each,s.eachSeries=function(t,e,r){if(r=r||function(){},!t.length)return r();var n=0,i=function(){e(t[n],function(e){e?(r(e),r=function(){}):(n+=1,n>=t.length?r():i())})};i()},s.forEachSeries=s.eachSeries,s.eachLimit=function(t,e,r,n){var i=d(e);i.apply(null,[t,r,n])},s.forEachLimit=s.eachLimit;var d=function(t){return function(e,r,n){if(n=n||function(){},!e.length||0>=t)return n();var i=0,o=0,s=0;!function a(){if(i>=e.length)return n();for(;t>s&&o=e.length?n():a())})}()}},p=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.each].concat(e))}},g=function(t,e){return function(){var r=Array.prototype.slice.call(arguments);return e.apply(null,[d(t)].concat(r))}},A=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.eachSeries].concat(e))}},v=function(t,e,r,n){if(e=h(e,function(t,e){return{index:e,value:t}}),n){var i=[];t(e,function(t,e){r(t.value,function(r,n){i[t.index]=n,e(r)})},function(t){n(t,i)})}else t(e,function(t,e){r(t.value,function(t){e(t)})})};s.map=p(v),s.mapSeries=A(v),s.mapLimit=function(t,e,r,n){return m(e)(t,r,n)};var m=function(t){return g(t,v)};s.reduce=function(t,e,r,n){s.eachSeries(t,function(t,n){r(e,t,function(t,r){e=r,n(t)})},function(t){n(t,e)})},s.inject=s.reduce,s.foldl=s.reduce,s.reduceRight=function(t,e,r,n){var i=h(t,function(t){return t}).reverse();s.reduce(i,e,r,n)},s.foldr=s.reduceRight;var y=function(t,e,r,n){var i=[];e=h(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r&&i.push(t),e()})},function(t){n(h(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.filter=p(y),s.filterSeries=A(y),s.select=s.filter,s.selectSeries=s.filterSeries;var x=function(t,e,r,n){var i=[];e=h(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r||i.push(t),e()})},function(t){n(h(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.reject=p(x),s.rejectSeries=A(x);var w=function(t,e,r,n){t(e,function(t,e){r(t,function(r){r?(n(t),n=function(){}):e()})},function(t){n()})};s.detect=p(w),s.detectSeries=A(w),s.some=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t&&(r(!0),r=function(){}),n()})},function(t){r(!1)})},s.any=s.some,s.every=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t||(r(!1),r=function(){}),n()})},function(t){r(!0)})},s.all=s.every,s.sortBy=function(t,e,r){s.map(t,function(t,r){e(t,function(e,n){e?r(e):r(null,{value:t,criteria:n})})},function(t,e){if(t)return r(t);var n=function(t,e){var r=t.criteria,n=e.criteria;return n>r?-1:r>n?1:0};r(null,h(e.sort(n),function(t){return t.value}))})},s.auto=function(t,e){e=e||function(){};var r=f(t),n=r.length;if(!n)return e();var i={},o=[],a=function(t){o.unshift(t)},h=function(t){for(var e=0;en;){var o=n+(i-n+1>>>1);r(e,t[o])>=0?n=o:i=o-1}return n}function i(t,e,i,o){return t.started||(t.started=!0),l(e)||(e=[e]),0==e.length?s.setImmediate(function(){t.drain&&t.drain()}):void u(e,function(e){var a={data:e,priority:i,callback:"function"==typeof o?o:null};t.tasks.splice(n(t.tasks,a,r)+1,0,a),t.saturated&&t.tasks.length===t.concurrency&&t.saturated(),s.setImmediate(t.process)})}var o=s.queue(t,e);return o.push=function(t,e,r){i(o,t,e,r)},delete o.unshift,o},s.cargo=function(t,e){var r=!1,n=[],i={tasks:n,payload:e,saturated:null,empty:null,drain:null,drained:!0,push:function(t,r){l(t)||(t=[t]),u(t,function(t){n.push({data:t,callback:"function"==typeof r?r:null}),i.drained=!1,i.saturated&&n.length===e&&i.saturated()}),s.setImmediate(i.process)},process:function o(){if(!r){if(0===n.length)return i.drain&&!i.drained&&i.drain(),void(i.drained=!0);var s="number"==typeof e?n.splice(0,e):n.splice(0,n.length),a=h(s,function(t){return t.data});i.empty&&i.empty(),r=!0,t(a,function(){r=!1;var t=arguments;u(s,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return n.length},running:function(){return r}};return i};var b=function(t){return function(e){var r=Array.prototype.slice.call(arguments,1);e.apply(null,r.concat([function(e){var r=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&u(r,function(e){console[t](e)}))}]))}};s.log=b("log"),s.dir=b("dir"),s.memoize=function(t,e){var r={},n={};e=e||function(t){return t};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=e.apply(null,i);a in r?s.nextTick(function(){o.apply(null,r[a])}):a in n?n[a].push(o):(n[a]=[o],t.apply(null,i.concat([function(){r[a]=arguments;var t=n[a];delete n[a];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,arguments)}])))};return i.memo=r,i.unmemoized=t,i},s.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},s.times=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.map(n,e,r)},s.timesSeries=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.mapSeries(n,e,r)},s.seq=function(){var t=arguments;return function(){var e=this,r=Array.prototype.slice.call(arguments),n=r.pop();s.reduce(t,r,function(t,r,n){r.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);n(t,e)}]))},function(t,r){n.apply(e,[t].concat(r))})}},s.compose=function(){return s.seq.apply(null,Array.prototype.reverse.call(arguments))};var B=function(t,e){var r=function(){var r=this,n=Array.prototype.slice.call(arguments),i=n.pop();return t(e,function(t,e){t.apply(r,n.concat([e]))},i)};if(arguments.length>2){var n=Array.prototype.slice.call(arguments,2);return r.apply(this,n)}return r};s.applyEach=p(B),s.applyEachSeries=A(B),s.forever=function(t,e){function r(n){if(n){if(e)return e(n);throw n}t(r)}r()},"undefined"!=typeof r&&r.exports?r.exports=s:"undefined"!=typeof t&&t.amd?t([],function(){return s}):i.async=s}()}).call(this,e("_process"))},{_process:4}],3:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,i="/"===s.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),o="/"===s(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),o=n(e.split("/")),s=Math.min(i.length,o.length),a=s,l=0;s>l;l++)if(i[l]!==o[l]){a=l;break}for(var u=[],l=a;le&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:4}],4:[function(t,e,r){function n(){if(!a){a=!0;for(var t,e=s.length;e;){t=s,s=[];for(var r=-1;++ri;)e=t.charCodeAt(i++),e>=55296&&56319>=e&&o>i?(r=t.charCodeAt(i++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--)):n.push(e);return n}function u(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=N(t>>>10&1023|55296),t=56320|1023&t),e+=N(t)}).join("")}function h(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:C}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?L(t/D):t>>1,t+=L(t/e);t>Q*B>>1;n+=C)t=L(t/Q);return L(n+(Q+1)*t/(t+T))}function d(t){var e,r,n,i,s,a,l,c,d,p,g=[],A=t.length,v=0,m=P,y=M;for(r=t.lastIndexOf(R),0>r&&(r=0),n=0;r>n;++n)t.charCodeAt(n)>=128&&o("not-basic"),g.push(t.charCodeAt(n));for(i=r>0?r+1:0;A>i;){for(s=v,a=1,l=C;i>=A&&o("invalid-input"),c=h(t.charCodeAt(i++)),(c>=C||c>L((E-v)/a))&&o("overflow"),v+=c*a,d=y>=l?b:l>=y+B?B:l-y,!(d>c);l+=C)p=C-d,a>L(E/p)&&o("overflow"),a*=p;e=g.length+1,y=f(v-s,e,0==s),L(v/e)>E-m&&o("overflow"),m+=L(v/e),v%=e,g.splice(v++,0,m)}return u(g)}function p(t){var e,r,n,i,s,a,u,h,d,p,g,A,v,m,y,x=[];for(t=l(t),A=t.length,e=P,r=0,s=M,a=0;A>a;++a)g=t[a],128>g&&x.push(N(g));for(n=i=x.length,i&&x.push(R);A>n;){for(u=E,a=0;A>a;++a)g=t[a],g>=e&&u>g&&(u=g);for(v=n+1,u-e>L((E-r)/v)&&o("overflow"),r+=(u-e)*v,e=u,a=0;A>a;++a)if(g=t[a],e>g&&++r>E&&o("overflow"),g==e){for(h=r,d=C;p=s>=d?b:d>=s+B?B:d-s,!(p>h);d+=C)y=h-p,m=C-p,x.push(N(c(p+y%m,0))),h=L(y/m);x.push(N(c(h,0))),s=f(r,v,n==i),r=0,++n}++r,++e}return x.join("")}function g(t){return a(t,function(t){return I.test(t)?d(t.slice(4).toLowerCase()):t})}function A(t){return a(t,function(t){return S.test(t)?"xn--"+p(t):t})}var v="object"==typeof n&&n,m="object"==typeof r&&r&&r.exports==v&&r,y="object"==typeof e&&e;(y.global===y||y.window===y)&&(i=y);var x,w,E=2147483647,C=36,b=1,B=26,T=38,D=700,M=72,P=128,R="-",I=/^xn--/,S=/[^ -~]/,O=/\x2E|\u3002|\uFF0E|\uFF61/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Q=C-b,L=Math.floor,N=String.fromCharCode;if(x={version:"1.2.4",ucs2:{decode:l,encode:u},decode:d,encode:p,toASCII:A,toUnicode:g},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return x});else if(v&&!v.nodeType)if(m)m.exports=x;else for(w in x)x.hasOwnProperty(w)&&(v[w]=x[w]);else i.punycode=x}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var u=t.length;l>0&&u>l&&(u=l);for(var h=0;u>h;++h){var c,f,d,p,g=t[h].replace(a,"%20"),A=g.indexOf(r);A>=0?(c=g.substr(0,A),f=g.substr(A+1)):(c=g,f=""),d=decodeURIComponent(c),p=decodeURIComponent(f),n(s,d)?i(s[d])?s[d].push(p):s[d]=[s[d],p]:s[d]=p}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],7:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n",'"',"`"," ","\r","\n"," "],A=["{","}","|","\\","^","`"].concat(g),v=["'"].concat(A),m=["%","/","?",";","#"].concat(v),y=["/","?","#"],x=255,w=/^[a-z0-9A-Z_-]{0,63}$/,E=/^([a-z0-9A-Z_-]{0,63})(.*)$/,C={ +javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},B={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},T=t("querystring");n.prototype.parse=function(t,e,r){if(!l(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t;n=n.trim();var i=d.exec(n);if(i){i=i[0];var o=i.toLowerCase();this.protocol=o,n=n.substr(i.length)}if(r||i||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===n.substr(0,2);!s||i&&b[i]||(n=n.substr(2),this.slashes=!0)}if(!b[i]&&(s||i&&!B[i])){for(var a=-1,u=0;uh)&&(a=h)}var c,p;p=-1===a?n.lastIndexOf("@"):n.lastIndexOf("@",a),-1!==p&&(c=n.slice(0,p),n=n.slice(p+1),this.auth=decodeURIComponent(c)),a=-1;for(var u=0;uh)&&(a=h)}-1===a&&(a=n.length),this.host=n.slice(0,a),n=n.slice(a),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var A=this.hostname.split(/\./),u=0,D=A.length;D>u;u++){var M=A[u];if(M&&!M.match(w)){for(var P="",R=0,I=M.length;I>R;R++)P+=M.charCodeAt(R)>127?"x":M[R];if(!P.match(w)){var S=A.slice(0,u),O=A.slice(u+1),F=M.match(E);F&&(S.push(F[1]),O.unshift(F[2])),O.length&&(n="/"+O.join(".")+n),this.hostname=S.join(".");break}}}if(this.hostname=this.hostname.length>x?"":this.hostname.toLowerCase(),!g){for(var Q=this.hostname.split("."),L=[],u=0;uu;u++){var G=v[u],Y=encodeURIComponent(G);Y===G&&(Y=escape(G)),n=n.split(G).join(Y)}var j=n.indexOf("#");-1!==j&&(this.hash=n.substr(j),n=n.slice(0,j));var z=n.indexOf("?");if(-1!==z?(this.search=n.substr(z),this.query=n.substr(z+1),e&&(this.query=T.parse(this.query)),n=n.slice(0,z)):e&&(this.search="",this.query={}),n&&(this.pathname=n),B[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var H=this.pathname||"",N=this.search||"";this.path=H+N}return this.href=this.format(),this},n.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=t+this.host:this.hostname&&(i=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&u(this.query)&&Object.keys(this.query).length&&(o=T.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||B[e])&&i!==!1?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),s=s.replace("#","%23"),e+i+r+s+n},n.prototype.resolve=function(t){return this.resolveObject(i(t,!1,!0)).format()},n.prototype.resolveObject=function(t){if(l(t)){var e=new n;e.parse(t,!1,!0),t=e}var r=new n;if(Object.keys(this).forEach(function(t){r[t]=this[t]},this),r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol)return Object.keys(t).forEach(function(e){"protocol"!==e&&(r[e]=t[e])}),B[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r;if(t.protocol&&t.protocol!==r.protocol){if(!B[t.protocol])return Object.keys(t).forEach(function(e){r[e]=t[e]}),r.href=r.format(),r;if(r.protocol=t.protocol,t.host||b[t.protocol])r.pathname=t.pathname;else{for(var i=(t.pathname||"").split("/");i.length&&!(t.host=i.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==i[0]&&i.unshift(""),i.length<2&&i.unshift(""),r.pathname=i.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var o=r.pathname||"",s=r.search||"";r.path=o+s}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var a=r.pathname&&"/"===r.pathname.charAt(0),u=t.host||t.pathname&&"/"===t.pathname.charAt(0),f=u||a||r.host&&t.pathname,d=f,p=r.pathname&&r.pathname.split("/")||[],i=t.pathname&&t.pathname.split("/")||[],g=r.protocol&&!B[r.protocol];if(g&&(r.hostname="",r.port=null,r.host&&(""===p[0]?p[0]=r.host:p.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===i[0]?i[0]=t.host:i.unshift(t.host)),t.host=null),f=f&&(""===i[0]||""===p[0])),u)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,p=i;else if(i.length)p||(p=[]),p.pop(),p=p.concat(i),r.search=t.search,r.query=t.query;else if(!c(t.search)){if(g){r.hostname=r.host=p.shift();var A=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;A&&(r.auth=A.shift(),r.host=r.hostname=A.shift())}return r.search=t.search,r.query=t.query,h(r.pathname)&&h(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!p.length)return r.pathname=null,r.path=r.search?"/"+r.search:null,r.href=r.format(),r;for(var v=p.slice(-1)[0],m=(r.host||t.host)&&("."===v||".."===v)||""===v,y=0,x=p.length;x>=0;x--)v=p[x],"."==v?p.splice(x,1):".."===v?(p.splice(x,1),y++):y&&(p.splice(x,1),y--);if(!f&&!d)for(;y--;y)p.unshift("..");!f||""===p[0]||p[0]&&"/"===p[0].charAt(0)||p.unshift(""),m&&"/"!==p.join("/").substr(-1)&&p.push("");var w=""===p[0]||p[0]&&"/"===p[0].charAt(0);if(g){r.hostname=r.host=w?"":p.length?p.shift():"";var A=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;A&&(r.auth=A.shift(),r.host=r.hostname=A.shift())}return f=f||r.host&&p.length,f&&!w&&p.unshift(""),p.length?r.pathname=p.join("/"):(r.pathname=null,r.path=null),h(r.pathname)&&h(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=p.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{punycode:5,querystring:8}],10:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n=e&&e.length,a=n?e[0]*r:t.length,l=o(t,i(t,0,a,r,!0)),u=[];if(!l)return u;var c,f,d,p,g,A,v;if(n&&(l=h(t,e,l,r)),t.length>80*r){c=d=t[0],f=p=t[1];for(var m=r;a>m;m+=r)g=t[m],A=t[m+1],c>g&&(c=g),f>A&&(f=A),g>d&&(d=g),A>p&&(p=A);v=Math.max(d-c,p-f)}return s(t,l,u,r,c,f,v),u}function i(t,e,r,n,i){var o,s,a,l=0;for(o=e,s=r-n;r>o;o+=n)l+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;if(i===l>0)for(o=e;r>o;o+=n)a=B(o,a);else for(o=r-n;o>=e;o-=n)a=B(o,a);return a}function o(t,e,r){r||(r=e);var n,i=e;do if(n=!1,y(t,i.i,i.next.i)||0===m(t,i.prev.i,i.i,i.next.i)){if(i.prev.next=i.next,i.next.prev=i.prev,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ),i=r=i.prev,i===i.next)return null;n=!0}else i=i.next;while(n||i!==r);return r}function s(t,e,r,n,i,h,c,f){if(e){f||void 0===i||d(t,e,i,h,c);for(var p,g,A=e;e.prev!==e.next;)if(p=e.prev,g=e.next,a(t,e,i,h,c))r.push(p.i/n),r.push(e.i/n),r.push(g.i/n),g.prev=p,p.next=g,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),e=g.next,A=g.next;else if(e=g,e===A){f?1===f?(e=l(t,e,r,n),s(t,e,r,n,i,h,c,2)):2===f&&u(t,e,r,n,i,h,c):s(t,o(t,e),r,n,i,h,c,1);break}}}function a(t,e,r,n,i){var o=e.prev.i,s=e.i,a=e.next.i,l=t[o],u=t[o+1],h=t[s],c=t[s+1],f=t[a],d=t[a+1],p=l*c-u*h,A=l*d-u*f,v=f*c-d*h,m=p-A-v;if(0>=m)return!1;var y,x,w,E,C,b,B,T=d-u,D=l-f,M=u-c,P=h-l;if(void 0!==r){var R=h>l?f>l?l:f:f>h?h:f,I=c>u?d>u?u:d:d>c?c:d,S=l>h?l>f?l:f:h>f?h:f,O=u>c?u>d?u:d:c>d?c:d,F=g(R,I,r,n,i),Q=g(S,O,r,n,i);for(B=e.nextZ;B&&B.z<=Q;)if(y=B.i,B=B.nextZ,y!==o&&y!==a&&(x=t[y],w=t[y+1],E=T*x+D*w-A,E>=0&&(C=M*x+P*w+p,C>=0&&(b=m-E-C,b>=0&&(E&&C||E&&b||C&&b)))))return!1;for(B=e.prevZ;B&&B.z>=F;)if(y=B.i,B=B.prevZ,y!==o&&y!==a&&(x=t[y],w=t[y+1],E=T*x+D*w-A,E>=0&&(C=M*x+P*w+p,C>=0&&(b=m-E-C,b>=0&&(E&&C||E&&b||C&&b)))))return!1}else for(B=e.next.next;B!==e.prev;)if(y=B.i,B=B.next,x=t[y],w=t[y+1],E=T*x+D*w-A,E>=0&&(C=M*x+P*w+p,C>=0&&(b=m-E-C,b>=0&&(E&&C||E&&b||C&&b))))return!1;return!0}function l(t,e,r,n){var i=e;do{var o=i.prev,s=i.next.next;if(o.i!==s.i&&x(t,o.i,i.i,i.next.i,s.i)&&E(t,o,s)&&E(t,s,o)){r.push(o.i/n),r.push(i.i/n),r.push(s.i/n),o.next=s,s.prev=o;var a=i.prevZ,l=i.nextZ&&i.nextZ.nextZ;a&&(a.nextZ=l),l&&(l.prevZ=a),i=e=s}i=i.next}while(i!==e);return i}function u(t,e,r,n,i,a,l){var u=e;do{for(var h=u.next.next;h!==u.prev;){if(u.i!==h.i&&v(t,u,h)){var c=b(u,h);return u=o(t,u,u.next),c=o(t,c,c.next),s(t,u,r,n,i,a,l),void s(t,c,r,n,i,a,l)}h=h.next}u=u.next}while(u!==e)}function h(t,e,r,n){var s,a,l,u,h,f=[];for(s=0,a=e.length;a>s;s++)l=e[s]*n,u=a-1>s?e[s+1]*n:t.length,h=o(t,i(t,l,u,n,!1)),h&&f.push(A(t,h));for(f.sort(function(e,r){return t[e.i]-t[r.i]}),s=0;s=t[o+1]){var c=t[i]+(u-t[i+1])*(t[o]-t[i])/(t[o+1]-t[i+1]);l>=c&&c>h&&(h=c,n=t[i]=D?-1:1,P=n,R=1/0;for(s=n.next;s!==P;)f=t[s.i],d=t[s.i+1],p=l-f,p>=0&&f>=m&&(g=(C*f+b*d-w)*M,g>=0&&(A=(B*f+T*d+x)*M,A>=0&&D*M-g-A>=0&&(v=Math.abs(u-d)/p,R>v&&E(t,s,e)&&(n=s,R=v)))),s=s.next;return n}function d(t,e,r,n,i){var o=e;do null===o.z&&(o.z=g(t[o.i],t[o.i+1],r,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,p(o)}function p(t){var e,r,n,i,o,s,a,l,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,n=r,a=0,e=0;u>e&&(a++,n=n.nextZ);e++);for(l=u;a>0||l>0&&n;)0===a?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,a--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,a--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,u*=2}while(s>1);return t}function g(t,e,r,n,i){return t=1e3*(t-r)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=1e3*(e-n)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function A(t,e){var r=e,n=e;do t[r.i]0?1:0>i?-1:0}function y(t,e,r){return t[e]===t[r]&&t[e+1]===t[r+1]}function x(t,e,r,n,i){return m(t,e,r,n)!==m(t,e,r,i)&&m(t,n,i,e)!==m(t,n,i,r)}function w(t,e,r,n){var i=e;do{var o=i.i,s=i.next.i;if(o!==r&&s!==r&&o!==n&&s!==n&&x(t,o,s,r,n))return!0;i=i.next}while(i!==e);return!1}function E(t,e,r){return-1===m(t,e.prev.i,e.i,e.next.i)?-1!==m(t,e.i,r.i,e.next.i)&&-1!==m(t,e.i,e.prev.i,r.i):-1===m(t,e.i,r.i,e.prev.i)||-1===m(t,e.i,e.next.i,r.i)}function C(t,e,r,n){var i=e,o=!1,s=(t[r]+t[n])/2,a=(t[r+1]+t[n+1])/2;do{var l=i.i,u=i.next.i;t[l+1]>a!=t[u+1]>a&&s<(t[u]-t[l])*(a-t[l+1])/(t[u+1]-t[l+1])+t[l]&&(o=!o),i=i.next}while(i!==e);return o}function b(t,e){var r=new T(t.i),n=new T(e.i),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function B(t,e){var r=new T(t);return e?(r.next=e.next,r.prev=e,e.next.prev=r,e.next=r):(r.prev=r,r.next=r),r}function T(t){this.i=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null}e.exports=n},{}],11:[function(t,e,r){"use strict";function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function i(){}var o="function"!=typeof Object.create?"~":!1;i.prototype._events=void 0,i.prototype.listeners=function(t,e){var r=o?o+t:t,n=this._events&&this._events[r];if(e)return!!n;if(!n)return[];if(this._events[r].fn)return[this._events[r].fn];for(var i=0,s=this._events[r].length,a=new Array(s);s>i;i++)a[i]=this._events[r][i].fn;return a},i.prototype.emit=function(t,e,r,n,i,s){var a=o?o+t:t;if(!this._events||!this._events[a])return!1;var l,u,h=this._events[a],c=arguments.length;if("function"==typeof h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),c){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,r),!0;case 4:return h.fn.call(h.context,e,r,n),!0;case 5:return h.fn.call(h.context,e,r,n,i),!0;case 6:return h.fn.call(h.context,e,r,n,i,s),!0}for(u=1,l=new Array(c-1);c>u;u++)l[u-1]=arguments[u];h.fn.apply(h.context,l)}else{var f,d=h.length;for(u=0;d>u;u++)switch(h[u].once&&this.removeListener(t,h[u].fn,void 0,!0),c){case 1:h[u].fn.call(h[u].context);break;case 2:h[u].fn.call(h[u].context,e);break;case 3:h[u].fn.call(h[u].context,e,r);break;default:if(!l)for(f=1,l=new Array(c-1);c>f;f++)l[f-1]=arguments[f];h[u].fn.apply(h[u].context,l)}}return!0},i.prototype.on=function(t,e,r){var i=new n(e,r||this),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],i]:this._events[s].push(i):this._events[s]=i,this},i.prototype.once=function(t,e,r){var i=new n(e,r||this,!0),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],i]:this._events[s].push(i):this._events[s]=i,this},i.prototype.removeListener=function(t,e,r,n){var i=o?o+t:t;if(!this._events||!this._events[i])return this;var s=this._events[i],a=[];if(e)if(s.fn)(s.fn!==e||n&&!s.once||r&&s.context!==r)&&a.push(s);else for(var l=0,u=s.length;u>l;l++)(s[l].fn!==e||n&&!s[l].once||r&&s[l].context!==r)&&a.push(s[l]);return a.length?this._events[i]=1===a.length?a[0]:a:delete this._events[i],this},i.prototype.removeAllListeners=function(t){return this._events?(t?delete this._events[o?o+t:t]:this._events=o?{}:Object.create(null),this):this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prototype.setMaxListeners=function(){return this},i.prefixed=o,e.exports=i},{}],12:[function(t,e,r){"use strict";function n(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}e.exports=Object.assign||function(t,e){for(var r,i,o=n(t),s=1;s=t.length&&r())}if(r=r||function(){},!t.length)return r();var o=0;u(t,function(t){e(t,n(i))})},s.forEach=s.each,s.eachSeries=function(t,e,r){if(r=r||function(){},!t.length)return r();var n=0,i=function(){e(t[n],function(e){e?(r(e),r=function(){}):(n+=1,n>=t.length?r():i())})};i()},s.forEachSeries=s.eachSeries,s.eachLimit=function(t,e,r,n){var i=d(e);i.apply(null,[t,r,n])},s.forEachLimit=s.eachLimit;var d=function(t){return function(e,r,n){if(n=n||function(){},!e.length||0>=t)return n();var i=0,o=0,s=0;!function a(){if(i>=e.length)return n();for(;t>s&&o=e.length?n():a())})}()}},p=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.each].concat(e))}},g=function(t,e){return function(){var r=Array.prototype.slice.call(arguments);return e.apply(null,[d(t)].concat(r))}},A=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.eachSeries].concat(e))}},v=function(t,e,r,n){if(e=h(e,function(t,e){return{index:e,value:t}}),n){var i=[];t(e,function(t,e){r(t.value,function(r,n){i[t.index]=n,e(r)})},function(t){n(t,i)})}else t(e,function(t,e){r(t.value,function(t){e(t)})})};s.map=p(v),s.mapSeries=A(v),s.mapLimit=function(t,e,r,n){return m(e)(t,r,n)};var m=function(t){return g(t,v)};s.reduce=function(t,e,r,n){s.eachSeries(t,function(t,n){r(e,t,function(t,r){e=r,n(t)})},function(t){n(t,e)})},s.inject=s.reduce,s.foldl=s.reduce,s.reduceRight=function(t,e,r,n){var i=h(t,function(t){return t}).reverse();s.reduce(i,e,r,n)},s.foldr=s.reduceRight;var y=function(t,e,r,n){var i=[];e=h(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r&&i.push(t),e()})},function(t){n(h(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.filter=p(y),s.filterSeries=A(y),s.select=s.filter,s.selectSeries=s.filterSeries;var x=function(t,e,r,n){var i=[];e=h(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r||i.push(t),e()})},function(t){n(h(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.reject=p(x),s.rejectSeries=A(x);var w=function(t,e,r,n){t(e,function(t,e){r(t,function(r){r?(n(t),n=function(){}):e()})},function(t){n()})};s.detect=p(w),s.detectSeries=A(w),s.some=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t&&(r(!0),r=function(){}),n()})},function(t){r(!1)})},s.any=s.some,s.every=function(t,e,r){s.each(t,function(t,n){e(t,function(t){t||(r(!1),r=function(){}),n()})},function(t){r(!0)})},s.all=s.every,s.sortBy=function(t,e,r){s.map(t,function(t,r){e(t,function(e,n){e?r(e):r(null,{value:t,criteria:n})})},function(t,e){if(t)return r(t);var n=function(t,e){var r=t.criteria,n=e.criteria;return n>r?-1:r>n?1:0};r(null,h(e.sort(n),function(t){return t.value}))})},s.auto=function(t,e){e=e||function(){};var r=f(t),n=r.length;if(!n)return e();var i={},o=[],a=function(t){o.unshift(t)},h=function(t){for(var e=0;en;){var o=n+(i-n+1>>>1);r(e,t[o])>=0?n=o:i=o-1}return n}function i(t,e,i,o){return t.started||(t.started=!0),l(e)||(e=[e]),0==e.length?s.setImmediate(function(){t.drain&&t.drain()}):void u(e,function(e){var a={data:e,priority:i,callback:"function"==typeof o?o:null};t.tasks.splice(n(t.tasks,a,r)+1,0,a),t.saturated&&t.tasks.length===t.concurrency&&t.saturated(),s.setImmediate(t.process)})}var o=s.queue(t,e);return o.push=function(t,e,r){i(o,t,e,r)},delete o.unshift,o},s.cargo=function(t,e){var r=!1,n=[],i={tasks:n,payload:e,saturated:null,empty:null,drain:null,drained:!0,push:function(t,r){l(t)||(t=[t]),u(t,function(t){n.push({data:t,callback:"function"==typeof r?r:null}),i.drained=!1,i.saturated&&n.length===e&&i.saturated()}),s.setImmediate(i.process)},process:function o(){if(!r){if(0===n.length)return i.drain&&!i.drained&&i.drain(),void(i.drained=!0);var s="number"==typeof e?n.splice(0,e):n.splice(0,n.length),a=h(s,function(t){return t.data});i.empty&&i.empty(),r=!0,t(a,function(){r=!1;var t=arguments;u(s,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return n.length},running:function(){return r}};return i};var b=function(t){return function(e){var r=Array.prototype.slice.call(arguments,1);e.apply(null,r.concat([function(e){var r=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&u(r,function(e){console[t](e)}))}]))}};s.log=b("log"),s.dir=b("dir"),s.memoize=function(t,e){var r={},n={};e=e||function(t){return t};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=e.apply(null,i);a in r?s.nextTick(function(){o.apply(null,r[a])}):a in n?n[a].push(o):(n[a]=[o],t.apply(null,i.concat([function(){r[a]=arguments;var t=n[a];delete n[a];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,arguments)}])))};return i.memo=r,i.unmemoized=t,i},s.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},s.times=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.map(n,e,r)},s.timesSeries=function(t,e,r){for(var n=[],i=0;t>i;i++)n.push(i);return s.mapSeries(n,e,r)},s.seq=function(){var t=arguments;return function(){var e=this,r=Array.prototype.slice.call(arguments),n=r.pop();s.reduce(t,r,function(t,r,n){r.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);n(t,e)}]))},function(t,r){n.apply(e,[t].concat(r))})}},s.compose=function(){return s.seq.apply(null,Array.prototype.reverse.call(arguments))};var B=function(t,e){var r=function(){var r=this,n=Array.prototype.slice.call(arguments),i=n.pop();return t(e,function(t,e){t.apply(r,n.concat([e]))},i)};if(arguments.length>2){var n=Array.prototype.slice.call(arguments,2);return r.apply(this,n)}return r};s.applyEach=p(B),s.applyEachSeries=A(B),s.forever=function(t,e){function r(n){if(n){if(e)return e(n);throw n}t(r)}r()},"undefined"!=typeof r&&r.exports?r.exports=s:"undefined"!=typeof t&&t.amd?t([],function(){return s}):i.async=s}()}).call(this,e("_process"))},{_process:4}],14:[function(t,e,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],15:[function(t,e,r){function n(t,e){a.call(this),e=e||10,this.baseUrl=t||"",this.progress=0,this.loading=!1,this._progressChunk=0,this._beforeMiddleware=[],this._afterMiddleware=[],this._boundLoadResource=this._loadResource.bind(this),this._boundOnLoad=this._onLoad.bind(this),this._buffer=[],this._numToLoad=0,this._queue=i.queue(this._boundLoadResource,e),this.resources={}}var i=t("async"),o=t("url"),s=t("./Resource"),a=t("eventemitter3");n.prototype=Object.create(a.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.add=n.prototype.enqueue=function(t,e,r,n){if(Array.isArray(t)){for(var i=0;i0)if(this.xhrType===n.XHR_RESPONSE_TYPE.TEXT)this.data=t.responseText;else if(this.xhrType===n.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t.responseText),this.isJson=!0}catch(r){this.error=new Error("Error trying to parse loaded json:",r)}else if(this.xhrType===n.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var i=new DOMParser;this.data=i.parseFromString(t.responseText,"text/xml")}else{var o=document.createElement("div");o.innerHTML=t.responseText,this.data=o}this.isXml=!0}catch(r){this.error=new Error("Error trying to parse loaded xml:",r)}else this.data=t.response||t.responseText;else this.error=new Error("["+t.status+"]"+t.statusText+":"+t.responseURL);this.complete()},n.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";e=e||window.location,u||(u=document.createElement("a")),u.href=t,t=a.parse(u.href);var r=!t.port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&r&&t.protocol===e.protocol?"":"anonymous"},n.prototype._determineXhrType=function(){return n._xhrTypeMap[this._getExtension()]||n.XHR_RESPONSE_TYPE.TEXT},n.prototype._determineLoadType=function(){return n._loadTypeMap[this._getExtension()]||n.LOAD_TYPE.XHR},n.prototype._getExtension=function(){var t,e=this.url;if(this.isDataUrl){var r=e.indexOf("/");t=e.substring(r+1,e.indexOf(";",r))}else{var n=e.indexOf("?");-1!==n&&(e=e.substring(0,n)),t=e.substring(e.lastIndexOf(".")+1)}return t},n.prototype._getMimeFromXhrType=function(t){switch(t){case n.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case n.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case n.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case n.XHR_RESPONSE_TYPE.JSON:return"application/json";case n.XHR_RESPONSE_TYPE.DEFAULT:case n.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},n.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},n.XHR_READY_STATE={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},n.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},n._loadTypeMap={gif:n.LOAD_TYPE.IMAGE,png:n.LOAD_TYPE.IMAGE,bmp:n.LOAD_TYPE.IMAGE,jpg:n.LOAD_TYPE.IMAGE,jpeg:n.LOAD_TYPE.IMAGE,tif:n.LOAD_TYPE.IMAGE,tiff:n.LOAD_TYPE.IMAGE,webp:n.LOAD_TYPE.IMAGE,tga:n.LOAD_TYPE.IMAGE},n._xhrTypeMap={xhtml:n.XHR_RESPONSE_TYPE.DOCUMENT,html:n.XHR_RESPONSE_TYPE.DOCUMENT,htm:n.XHR_RESPONSE_TYPE.DOCUMENT,xml:n.XHR_RESPONSE_TYPE.DOCUMENT,tmx:n.XHR_RESPONSE_TYPE.DOCUMENT,tsx:n.XHR_RESPONSE_TYPE.DOCUMENT,svg:n.XHR_RESPONSE_TYPE.DOCUMENT,gif:n.XHR_RESPONSE_TYPE.BLOB,png:n.XHR_RESPONSE_TYPE.BLOB,bmp:n.XHR_RESPONSE_TYPE.BLOB,jpg:n.XHR_RESPONSE_TYPE.BLOB,jpeg:n.XHR_RESPONSE_TYPE.BLOB,tif:n.XHR_RESPONSE_TYPE.BLOB,tiff:n.XHR_RESPONSE_TYPE.BLOB,webp:n.XHR_RESPONSE_TYPE.BLOB,tga:n.XHR_RESPONSE_TYPE.BLOB,json:n.XHR_RESPONSE_TYPE.JSON,text:n.XHR_RESPONSE_TYPE.TEXT,txt:n.XHR_RESPONSE_TYPE.TEXT},n.setExtensionLoadType=function(t,e){o(n._loadTypeMap,t,e)},n.setExtensionXhrType=function(t,e){o(n._xhrTypeMap,t,e)}},{eventemitter3:14,url:9}],17:[function(t,e,r){e.exports={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encodeBinary:function(t){for(var e,r="",n=new Array(4),i=0,o=0,s=0;i>2,n[1]=(3&e[0])<<4|e[1]>>4,n[2]=(15&e[1])<<2|e[2]>>6,n[3]=63&e[2],s=i-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(o=0;o","Richard Davey "],main:"./src/index.js",homepage:"http://goodboydigital.com/",bugs:"https://github.com/GoodBoyDigital/pixi.js/issues",license:"MIT",repository:{type:"git",url:"https://github.com/GoodBoyDigital/pixi.js.git"},scripts:{start:"gulp && gulp watch",test:"gulp && testem ci",build:"gulp",docs:"jsdoc -c ./gulp/util/jsdoc.conf.json -R README.md"},files:["bin/","src/"],dependencies:{async:"^0.9.0",brfs:"^1.4.0",earcut:"^2.0.1",eventemitter3:"^1.1.0","object-assign":"^2.0.0","resource-loader":"^1.6.1"},devDependencies:{browserify:"^10.2.3",chai:"^3.0.0",del:"^1.2.0",gulp:"^3.9.0","gulp-cached":"^1.1.0","gulp-concat":"^2.5.2","gulp-debug":"^2.0.1","gulp-jshint":"^1.11.0","gulp-mirror":"^0.4.0","gulp-plumber":"^1.0.1","gulp-rename":"^1.2.2","gulp-sourcemaps":"^1.5.2","gulp-uglify":"^1.2.0","gulp-util":"^3.0.5","jaguarjs-jsdoc":"git+https://github.com/davidshimjs/jaguarjs-jsdoc.git",jsdoc:"^3.3.0","jshint-summary":"^0.4.0",minimist:"^1.1.1",mocha:"^2.2.5","require-dir":"^0.3.0","run-sequence":"^1.1.0",testem:"^0.8.3","vinyl-buffer":"^1.0.0","vinyl-source-stream":"^1.1.0",watchify:"^3.2.1"},browserify:{transform:["brfs"]}}},{}],22:[function(t,e,r){var n={VERSION:t("../../package.json").version,PI_2:2*Math.PI,RAD_TO_DEG:180/Math.PI,DEG_TO_RAD:Math.PI/180,TARGET_FPMS:.06,RENDERER_TYPE:{UNKNOWN:0,WEBGL:1,CANVAS:2},BLEND_MODES:{NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},DRAW_MODES:{POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},SCALE_MODES:{DEFAULT:0,LINEAR:0,NEAREST:1},RETINA_PREFIX:/@(.+)x/,RESOLUTION:1,FILTER_RESOLUTION:1,DEFAULT_RENDER_OPTIONS:{view:null,resolution:1,antialias:!1,forceFXAA:!1,autoResize:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1},SHAPES:{POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},SPRITE_BATCH_SIZE:2e3};e.exports=n},{"../../package.json":21}],23:[function(t,e,r){function n(){o.call(this),this.children=[]}var i=t("../math"),o=t("./DisplayObject"),s=t("../textures/RenderTexture"),a=new i.Matrix;n.prototype=Object.create(o.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{width:{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t}},height:{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t}}}),n.prototype.addChild=function(t){return this.addChildAt(t,this.children.length)},n.prototype.addChildAt=function(t,e){if(t===this)return t;if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),t.emit("added",this),t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},n.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),n=this.getChildIndex(e);if(0>r||0>n)throw new Error("swapChildren: Both the supplied DisplayObjects must be children of the caller.");this.children[r]=e,this.children[n]=t}},n.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},n.prototype.setChildIndex=function(t,e){if(0>e||e>=this.children.length)throw new Error("The supplied index is out of bounds");var r=this.getChildIndex(t);this.children.splice(r,1),this.children.splice(e,0,t)},n.prototype.getChildAt=function(t){if(0>t||t>=this.children.length)throw new Error("getChildAt: Supplied index "+t+" does not exist in the child list, or the supplied DisplayObject is not a child of the caller");return this.children[t]},n.prototype.removeChild=function(t){var e=this.children.indexOf(t);return-1!==e?this.removeChildAt(e):void 0},n.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,this.children.splice(t,1),e.emit("removed",this),e},n.prototype.removeChildren=function(t,e){var r=t||0,n="number"==typeof e?e:this.children.length,i=n-r;if(i>0&&n>=i){for(var o=this.children.splice(r,i),s=0;st;++t)this.children[t].updateTransform()}},n.prototype.containerUpdateTransform=n.prototype.updateTransform,n.prototype.getBounds=function(){if(!this._currentBounds){if(0===this.children.length)return i.Rectangle.EMPTY;for(var t,e,r,n=1/0,o=1/0,s=-(1/0),a=-(1/0),l=!1,u=0,h=this.children.length;h>u;++u){var c=this.children[u];c.visible&&(l=!0,t=this.children[u].getBounds(),n=ne?s:e,a=a>r?a:r)}if(!l)return i.Rectangle.EMPTY;var f=this._bounds;f.x=n,f.y=o,f.width=s-n,f.height=a-o,this._currentBounds=f}return this._currentBounds},n.prototype.containerGetBounds=n.prototype.getBounds,n.prototype.getLocalBounds=function(){var t=this.worldTransform;this.worldTransform=i.Matrix.IDENTITY;for(var e=0,r=this.children.length;r>e;++e)this.children[e].updateTransform();return this.worldTransform=t,this._currentBounds=null,this.getBounds(i.Matrix.IDENTITY)},n.prototype.renderWebGL=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var e,r;if(this._mask||this._filters){for(t.currentRenderer.flush(),this._filters&&t.filterManager.pushFilter(this,this._filters),this._mask&&t.maskManager.pushMask(this,this._mask),t.currentRenderer.start(),this._renderWebGL(t),e=0,r=this.children.length;r>e;e++)this.children[e].renderWebGL(t);t.currentRenderer.flush(),this._mask&&t.maskManager.popMask(this,this._mask),this._filters&&t.filterManager.popFilter(),t.currentRenderer.start()}else for(this._renderWebGL(t),e=0,r=this.children.length;r>e;++e)this.children[e].renderWebGL(t)}},n.prototype._renderWebGL=function(t){},n.prototype._renderCanvas=function(t){},n.prototype.renderCanvas=function(t){if(this.visible&&!(this.alpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask,t),this._renderCanvas(t);for(var e=0,r=this.children.length;r>e;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},n.prototype.destroy=function(t){if(o.prototype.destroy.call(this),t)for(var e=0,r=this.children.length;r>e;++e)this.children[e].destroy(t);this.removeChildren(),this.children=null}},{"../math":32,"../textures/RenderTexture":70,"./DisplayObject":24}],24:[function(t,e,r){function n(){s.call(this),this.position=new i.Point,this.scale=new i.Point(1,1),this.pivot=new i.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this.worldTransform=new i.Matrix,this.filterArea=null,this._sr=0,this._cr=1,this._bounds=new i.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cachedObject=null}var i=t("../math"),o=t("../textures/RenderTexture"),s=t("eventemitter3"),a=t("../const"),l=new i.Matrix;n.prototype=Object.create(s.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},worldVisible:{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},mask:{get:function(){return this._mask},set:function(t){this._mask&&(this._mask.renderable=!0),this._mask=t,this._mask&&(this._mask.renderable=!1)}},filters:{get:function(){return this._filters&&this._filters.slice()},set:function(t){this._filters=t&&t.slice()}}}),n.prototype.updateTransform=function(){var t,e,r,n,i,o,s=this.parent.worldTransform,l=this.worldTransform;this.rotation%a.PI_2?(this.rotation!==this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation)),t=this._cr*this.scale.x,e=this._sr*this.scale.x,r=-this._sr*this.scale.y,n=this._cr*this.scale.y,i=this.position.x,o=this.position.y,(this.pivot.x||this.pivot.y)&&(i-=this.pivot.x*t+this.pivot.y*r,o-=this.pivot.x*e+this.pivot.y*n),l.a=t*s.a+e*s.c,l.b=t*s.b+e*s.d,l.c=r*s.a+n*s.c,l.d=r*s.b+n*s.d,l.tx=i*s.a+o*s.c+s.tx,l.ty=i*s.b+o*s.d+s.ty):(t=this.scale.x,n=this.scale.y,i=this.position.x-this.pivot.x*t,o=this.position.y-this.pivot.y*n,l.a=t*s.a,l.b=t*s.b,l.c=n*s.c,l.d=n*s.d,l.tx=i*s.a+o*s.c+s.tx,l.ty=i*s.b+o*s.d+s.ty),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._currentBounds=null},n.prototype.displayObjectUpdateTransform=n.prototype.updateTransform,n.prototype.getBounds=function(t){return i.Rectangle.EMPTY},n.prototype.getLocalBounds=function(){return this.getBounds(i.Matrix.IDENTITY)},n.prototype.toGlobal=function(t){return this.displayObjectUpdateTransform(),this.worldTransform.apply(t)},n.prototype.toLocal=function(t,e){return e&&(t=e.toGlobal(t)),this.displayObjectUpdateTransform(),this.worldTransform.applyInverse(t)},n.prototype.renderWebGL=function(t){},n.prototype.renderCanvas=function(t){},n.prototype.generateTexture=function(t,e,r){var n=this.getLocalBounds(),i=new o(t,0|n.width,0|n.height,e,r);return l.tx=-n.x,l.ty=-n.y,i.render(this,l),i},n.prototype.destroy=function(){this.position=null,this.scale=null,this.pivot=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.worldTransform=null,this.filterArea=null}},{"../const":22,"../math":32,"../textures/RenderTexture":70,eventemitter3:11}],25:[function(t,e,r){function n(){i.call(this),this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this._prevTint=16777215,this.blendMode=h.BLEND_MODES.NORMAL,this.currentPath=null,this._webGL={},this.isMask=!1,this.boundsPadding=0,this._localBounds=new u.Rectangle(0,0,1,1),this.dirty=!0,this.glDirty=!1,this.boundsDirty=!0,this.cachedSpriteDirty=!1}var i=t("../display/Container"),o=t("../textures/Texture"),s=t("../renderers/canvas/utils/CanvasBuffer"),a=t("../renderers/canvas/utils/CanvasGraphics"),l=t("./GraphicsData"),u=t("../math"),h=t("../const"),c=new u.Point;n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{}),n.prototype.clone=function(){var t=new n;t.renderable=this.renderable,t.fillAlpha=this.fillAlpha,t.lineWidth=this.lineWidth,t.lineColor=this.lineColor,t.tint=this.tint,t.blendMode=this.blendMode,t.isMask=this.isMask,t.boundsPadding=this.boundsPadding,t.dirty=this.dirty,t.glDirty=this.glDirty,t.cachedSpriteDirty=this.cachedSpriteDirty;for(var e=0;e=c;++c)h=c/s,i=l+(t-l)*h,o=u+(e-u)*h,a.push(i+(t+(r-t)*h-i)*h,o+(e+(n-e)*h-o)*h);return this.dirty=this.boundsDirty=!0,this},n.prototype.bezierCurveTo=function(t,e,r,n,i,o){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var s,a,l,u,h,c=20,f=this.currentPath.shape.points,d=f[f.length-2],p=f[f.length-1],g=0,A=1;c>=A;++A)g=A/c,s=1-g,a=s*s,l=a*s,u=g*g,h=u*g,f.push(l*d+3*a*g*t+3*s*u*r+h*i,l*p+3*a*g*e+3*s*u*n+h*o);return this.dirty=this.boundsDirty=!0,this},n.prototype.arcTo=function(t,e,r,n,i){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var o=this.currentPath.shape.points,s=o[o.length-2],a=o[o.length-1],l=a-e,u=s-t,h=n-e,c=r-t,f=Math.abs(l*c-u*h);if(1e-8>f||0===i)(o[o.length-2]!==t||o[o.length-1]!==e)&&o.push(t,e);else{var d=l*l+u*u,p=h*h+c*c,g=l*h+u*c,A=i*Math.sqrt(d)/f,v=i*Math.sqrt(p)/f,m=A*g/d,y=v*g/p,x=A*c+v*u,w=A*h+v*l,E=u*(v+m),C=l*(v+m),b=c*(A+y),B=h*(A+y),T=Math.atan2(C-w,E-x),D=Math.atan2(B-w,b-x);this.arc(x+t,w+e,i,T,D,u*h>c*l)}return this.dirty=this.boundsDirty=!0,this},n.prototype.arc=function(t,e,r,n,i,o){if(o=o||!1,n===i)return this;!o&&n>=i?i+=2*Math.PI:o&&i>=n&&(n+=2*Math.PI);var s=o?-1*(n-i):i-n,a=40*Math.ceil(Math.abs(s)/(2*Math.PI));if(0===s)return this;var l=t+Math.cos(n)*r,u=e+Math.sin(n)*r;this.currentPath?o&&this.filling?this.currentPath.shape.points.push(t,e):this.currentPath.shape.points.push(l,u):o&&this.filling?this.moveTo(t,e):this.moveTo(l,u);for(var h=this.currentPath.shape.points,c=s/(2*a),f=2*c,d=Math.cos(c),p=Math.sin(c),g=a-1,A=g%1/g,v=0;g>=v;v++){var m=v+A*v,y=c+n+f*m,x=Math.cos(y),w=-Math.sin(y);h.push((d*x+p*w)*r+t,(d*-w+p*x)*r+e)}return this.dirty=this.boundsDirty=!0,this},n.prototype.beginFill=function(t,e){return this.filling=!0,this.fillColor=t||0,this.fillAlpha=void 0===e?1:e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},n.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},n.prototype.drawRect=function(t,e,r,n){return this.drawShape(new u.Rectangle(t,e,r,n)),this},n.prototype.drawRoundedRect=function(t,e,r,n,i){return this.drawShape(new u.RoundedRectangle(t,e,r,n,i)),this},n.prototype.drawCircle=function(t,e,r){return this.drawShape(new u.Circle(t,e,r)),this},n.prototype.drawEllipse=function(t,e,r,n){return this.drawShape(new u.Ellipse(t,e,r,n)),this},n.prototype.drawPolygon=function(t){var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;rA?A:b,b=b>m?m:b,b=b>x?x:b,B=B>v?v:B,B=B>y?y:B,B=B>w?w:B,E=A>E?A:E,E=m>E?m:E,E=x>E?x:E,C=v>C?v:C,C=y>C?y:C,C=w>C?w:C,this._bounds.x=b,this._bounds.width=E-b,this._bounds.y=B,this._bounds.height=C-B,this._currentBounds=this._bounds}return this._currentBounds},n.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,c);for(var e=this.graphicsData,r=0;rs?s:t,e=s+l>e?s+l:e,r=r>a?a:r,n=a+u>n?a+u:n;else if(d===h.SHAPES.CIRC)s=i.x,a=i.y,l=i.radius+p/2,u=i.radius+p/2,t=t>s-l?s-l:t,e=s+l>e?s+l:e,r=r>a-u?a-u:r,n=a+u>n?a+u:n;else if(d===h.SHAPES.ELIP)s=i.x,a=i.y,l=i.width+p/2,u=i.height+p/2,t=t>s-l?s-l:t,e=s+l>e?s+l:e,r=r>a-u?a-u:r,n=a+u>n?a+u:n;else{o=i.points;for(var g=0;gs-p?s-p:t,e=s+p>e?s+p:e,r=r>a-p?a-p:r,n=a+p>n?a+p:n}}else t=0,e=0,r=0,n=0;var A=this.boundsPadding;this._localBounds.x=t-A,this._localBounds.width=e-t+2*A,this._localBounds.y=r-A,this._localBounds.height=n-r+2*A},n.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var e=new l(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,t);return this.graphicsData.push(e),e.type===h.SHAPES.POLY&&(e.shape.closed=e.shape.closed||this.filling,this.currentPath=e),this.dirty=this.boundsDirty=!0,e},n.prototype.destroy=function(){i.prototype.destroy.apply(this,arguments);for(var t=0;t=6)if(a.points.length<2*this.maximumSimplePolySize){o=this.switchMode(r,0);var l=this.buildPoly(a,o);l||(o=this.switchMode(r,1),this.buildComplexPoly(a,o))}else o=this.switchMode(r,1),this.buildComplexPoly(a,o);a.lineWidth>0&&(o=this.switchMode(r,0),this.buildLine(a,o))}else o=this.switchMode(r,0),a.type===s.SHAPES.RECT?this.buildRectangle(a,o):a.type===s.SHAPES.CIRC||a.type===s.SHAPES.ELIP?this.buildCircle(a,o):a.type===s.SHAPES.RREC&&this.buildRoundedRectangle(a,o);r.lastIndex++}for(n=0;n32e4||r.mode!==e||1===e)&&(r=this.graphicsDataPool.pop()||new u(t.gl),r.mode=e,t.data.push(r))):(r=this.graphicsDataPool.pop()||new u(t.gl),r.mode=e,t.data.push(r)),r.dirty=!0,r},n.prototype.buildRectangle=function(t,e){var r=t.shape,n=r.x,o=r.y,s=r.width,a=r.height;if(t.fill){var l=i.hex2rgb(t.fillColor),u=t.fillAlpha,h=l[0]*u,c=l[1]*u,f=l[2]*u,d=e.points,p=e.indices,g=d.length/6;d.push(n,o),d.push(h,c,f,u),d.push(n+s,o),d.push(h,c,f,u),d.push(n,o+a),d.push(h,c,f,u),d.push(n+s,o+a),d.push(h,c,f,u),p.push(g,g,g+1,g+2,g+3,g+3)}if(t.lineWidth){var A=t.points;t.points=[n,o,n+s,o,n+s,o+a,n,o+a,n,o],this.buildLine(t,e),t.points=A}},n.prototype.buildRoundedRectangle=function(t,e){var r=t.shape,n=r.x,o=r.y,s=r.width,a=r.height,l=r.radius,u=[];if(u.push(n,o+l),this.quadraticBezierCurve(n,o+a-l,n,o+a,n+l,o+a,u),this.quadraticBezierCurve(n+s-l,o+a,n+s,o+a,n+s,o+a-l,u),this.quadraticBezierCurve(n+s,o+l,n+s,o,n+s-l,o,u),this.quadraticBezierCurve(n+l,o,n,o,n,o+l+1e-10,u),t.fill){var c=i.hex2rgb(t.fillColor),f=t.fillAlpha,d=c[0]*f,p=c[1]*f,g=c[2]*f,A=e.points,v=e.indices,m=A.length/6,y=h(u,null,2),x=0;for(x=0;x=v;v++)A=v/p,l=a(t,r,A),u=a(e,n,A),h=a(r,i,A),c=a(n,o,A),f=a(l,h,A),d=a(u,c,A),g.push(f,d);return g},n.prototype.buildCircle=function(t,e){var r,n,o=t.shape,a=o.x,l=o.y;t.type===s.SHAPES.CIRC?(r=o.radius,n=o.radius):(r=o.width,n=o.height);var u=40,h=2*Math.PI/u,c=0;if(t.fill){var f=i.hex2rgb(t.fillColor),d=t.fillAlpha,p=f[0]*d,g=f[1]*d,A=f[2]*d,v=e.points,m=e.indices,y=v.length/6;for(m.push(y),c=0;u+1>c;c++)v.push(a,l,p,g,A,d),v.push(a+Math.sin(h*c)*r,l+Math.cos(h*c)*n,p,g,A,d),m.push(y++,y++);m.push(y-1)}if(t.lineWidth){var x=t.points;for(t.points=[],c=0;u+1>c;c++)t.points.push(a+Math.sin(h*c)*r,l+Math.cos(h*c)*n);this.buildLine(t,e),t.points=x}},n.prototype.buildLine=function(t,e){var r=0,n=t.points;if(0!==n.length){if(t.lineWidth%2)for(r=0;rr;r++)f=n[2*(r-1)],d=n[2*(r-1)+1],p=n[2*r],g=n[2*r+1],A=n[2*(r+1)],v=n[2*(r+1)+1],m=-(d-g),y=f-p,S=Math.sqrt(m*m+y*y),m/=S,y/=S,m*=H,y*=H,x=-(g-v),w=p-A,S=Math.sqrt(x*x+w*w),x/=S,w/=S,x*=H,w*=H,b=-y+d-(-y+g),B=-m+p-(-m+f),T=(-m+f)*(-y+g)-(-m+p)*(-y+d),D=-w+v-(-w+g),M=-x+p-(-x+A),P=(-x+A)*(-w+g)-(-x+p)*(-w+v),R=b*M-D*B,Math.abs(R)<.1?(R+=10.1,O.push(p-m,g-y,Y,j,z,G),O.push(p+m,g+y,Y,j,z,G)):(h=(B*P-M*T)/R,c=(D*T-b*P)/R,I=(h-p)*(h-p)+(c-g)+(c-g),I>19600?(E=m-x,C=y-w,S=Math.sqrt(E*E+C*C),E/=S, +C/=S,E*=H,C*=H,O.push(p-E,g-C),O.push(Y,j,z,G),O.push(p+E,g+C),O.push(Y,j,z,G),O.push(p-E,g-C),O.push(Y,j,z,G),L++):(O.push(h,c),O.push(Y,j,z,G),O.push(p-(h-p),g-(c-g)),O.push(Y,j,z,G)));for(f=n[2*(Q-2)],d=n[2*(Q-2)+1],p=n[2*(Q-1)],g=n[2*(Q-1)+1],m=-(d-g),y=f-p,S=Math.sqrt(m*m+y*y),m/=S,y/=S,m*=H,y*=H,O.push(p-m,g-y),O.push(Y,j,z,G),O.push(p+m,g+y),O.push(Y,j,z,G),F.push(N),r=0;L>r;r++)F.push(N++);F.push(N-1)}},n.prototype.buildComplexPoly=function(t,e){var r=t.points.slice();if(!(r.length<6)){var n=e.indices;e.points=r,e.alpha=t.fillAlpha,e.color=i.hex2rgb(t.fillColor);for(var o,s,a=1/0,l=-(1/0),u=1/0,h=-(1/0),c=0;co?o:a,l=o>l?o:l,u=u>s?s:u,h=s>h?s:h;r.push(a,u,l,u,l,h,a,h);var f=r.length/2;for(c=0;f>c;c++)n.push(c)}},n.prototype.buildPoly=function(t,e){var r=t.points;if(!(r.length<6)){var n=e.points,o=e.indices,s=r.length/2,a=i.hex2rgb(t.fillColor),l=t.fillAlpha,u=a[0]*l,c=a[1]*l,f=a[2]*l,d=h(r,null,2);if(!d)return!1;var p=n.length/6,g=0;for(g=0;gg;g++)n.push(r[2*g],r[2*g+1],u,c,f,l);return!0}}},{"../../const":22,"../../math":32,"../../renderers/webgl/WebGLRenderer":48,"../../renderers/webgl/utils/ObjectRenderer":62,"../../utils":76,"./WebGLGraphicsData":28,earcut:10}],28:[function(t,e,r){function n(t){this.gl=t,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0,this.glPoints=null,this.glIndices=null}n.prototype.constructor=n,e.exports=n,n.prototype.reset=function(){this.points.length=0,this.indices.length=0},n.prototype.upload=function(){var t=this.gl;this.glPoints=new Float32Array(this.points),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.bufferData(t.ARRAY_BUFFER,this.glPoints,t.STATIC_DRAW),this.glIndices=new Uint16Array(this.indices),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.glIndices,t.STATIC_DRAW),this.dirty=!1},n.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.gl.deleteBuffer(this.buffer),this.gl.deleteBuffer(this.indexBuffer),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null}},{}],29:[function(t,e,r){var n=e.exports=Object.assign(t("./const"),t("./math"),{utils:t("./utils"),ticker:t("./ticker"),DisplayObject:t("./display/DisplayObject"),Container:t("./display/Container"),Sprite:t("./sprites/Sprite"),ParticleContainer:t("./particles/ParticleContainer"),SpriteRenderer:t("./sprites/webgl/SpriteRenderer"),ParticleRenderer:t("./particles/webgl/ParticleRenderer"),Text:t("./text/Text"),Graphics:t("./graphics/Graphics"),GraphicsData:t("./graphics/GraphicsData"),GraphicsRenderer:t("./graphics/webgl/GraphicsRenderer"),Texture:t("./textures/Texture"),BaseTexture:t("./textures/BaseTexture"),RenderTexture:t("./textures/RenderTexture"),VideoBaseTexture:t("./textures/VideoBaseTexture"),TextureUvs:t("./textures/TextureUvs"),CanvasRenderer:t("./renderers/canvas/CanvasRenderer"),CanvasGraphics:t("./renderers/canvas/utils/CanvasGraphics"),CanvasBuffer:t("./renderers/canvas/utils/CanvasBuffer"),WebGLRenderer:t("./renderers/webgl/WebGLRenderer"),ShaderManager:t("./renderers/webgl/managers/ShaderManager"),Shader:t("./renderers/webgl/shaders/Shader"),ObjectRenderer:t("./renderers/webgl/utils/ObjectRenderer"),RenderTarget:t("./renderers/webgl/utils/RenderTarget"),AbstractFilter:t("./renderers/webgl/filters/AbstractFilter"),FXAAFilter:t("./renderers/webgl/filters/FXAAFilter"),SpriteMaskFilter:t("./renderers/webgl/filters/SpriteMaskFilter"),autoDetectRenderer:function(t,e,r,i){return t=t||800,e=e||600,!i&&n.utils.isWebGLSupported()?new n.WebGLRenderer(t,e,r):new n.CanvasRenderer(t,e,r)}})},{"./const":22,"./display/Container":23,"./display/DisplayObject":24,"./graphics/Graphics":25,"./graphics/GraphicsData":26,"./graphics/webgl/GraphicsRenderer":27,"./math":32,"./particles/ParticleContainer":38,"./particles/webgl/ParticleRenderer":40,"./renderers/canvas/CanvasRenderer":43,"./renderers/canvas/utils/CanvasBuffer":44,"./renderers/canvas/utils/CanvasGraphics":45,"./renderers/webgl/WebGLRenderer":48,"./renderers/webgl/filters/AbstractFilter":49,"./renderers/webgl/filters/FXAAFilter":50,"./renderers/webgl/filters/SpriteMaskFilter":51,"./renderers/webgl/managers/ShaderManager":55,"./renderers/webgl/shaders/Shader":60,"./renderers/webgl/utils/ObjectRenderer":62,"./renderers/webgl/utils/RenderTarget":64,"./sprites/Sprite":66,"./sprites/webgl/SpriteRenderer":67,"./text/Text":68,"./textures/BaseTexture":69,"./textures/RenderTexture":70,"./textures/Texture":71,"./textures/TextureUvs":72,"./textures/VideoBaseTexture":73,"./ticker":75,"./utils":76}],30:[function(t,e,r){function n(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0}var i=t("./Point");n.prototype.constructor=n,e.exports=n,n.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},n.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},n.prototype.apply=function(t,e){e=e||new i;var r=t.x,n=t.y;return e.x=this.a*r+this.c*n+this.tx,e.y=this.b*r+this.d*n+this.ty,e},n.prototype.applyInverse=function(t,e){e=e||new i;var r=1/(this.a*this.d+this.c*-this.b),n=t.x,o=t.y;return e.x=this.d*r*n+-this.c*r*o+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*o+-this.b*r*n+(-this.ty*this.a+this.tx*this.b)*r,e},n.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},n.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},n.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),n=this.a,i=this.c,o=this.tx;return this.a=n*e-this.b*r,this.b=n*r+this.b*e,this.c=i*e-this.d*r,this.d=i*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},n.prototype.append=function(t){var e=this.a,r=this.b,n=this.c,i=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*r+t.b*i,this.c=t.c*e+t.d*n,this.d=t.c*r+t.d*i,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*r+t.ty*i+this.ty,this},n.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,n=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},n.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,n=this.d,i=this.tx,o=t*n-e*r;return this.a=n/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-n*i)/o,this.ty=-(t*this.ty-e*i)/o,this},n.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},n.prototype.clone=function(){var t=new n;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},n.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},n.IDENTITY=new n,n.TEMP_MATRIX=new n},{"./Point":31}],31:[function(t,e,r){function n(t,e){this.x=t||0,this.y=e||0}n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.x,this.y)},n.prototype.copy=function(t){this.set(t.x,t.y)},n.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},n.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)}},{}],32:[function(t,e,r){e.exports={Point:t("./Point"),Matrix:t("./Matrix"),Circle:t("./shapes/Circle"),Ellipse:t("./shapes/Ellipse"),Polygon:t("./shapes/Polygon"),Rectangle:t("./shapes/Rectangle"),RoundedRectangle:t("./shapes/RoundedRectangle")}},{"./Matrix":30,"./Point":31,"./shapes/Circle":33,"./shapes/Ellipse":34,"./shapes/Polygon":35,"./shapes/Rectangle":36,"./shapes/RoundedRectangle":37}],33:[function(t,e,r){function n(t,e,r){this.x=t||0,this.y=e||0,this.radius=r||0,this.type=o.SHAPES.CIRC}var i=t("./Rectangle"),o=t("../../const");n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.x,this.y,this.radius)},n.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.x-t,n=this.y-e,i=this.radius*this.radius;return r*=r,n*=n,i>=r+n},n.prototype.getBounds=function(){return new i(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}},{"../../const":22,"./Rectangle":36}],34:[function(t,e,r){function n(t,e,r,n){this.x=t||0,this.y=e||0,this.width=r||0,this.height=n||0,this.type=o.SHAPES.ELIP}var i=t("./Rectangle"),o=t("../../const");n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.x,this.y,this.width,this.height)},n.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,n=(e-this.y)/this.height;return r*=r,n*=n,1>=r+n},n.prototype.getBounds=function(){return new i(this.x-this.width,this.y-this.height,this.width,this.height)}},{"../../const":22,"./Rectangle":36}],35:[function(t,e,r){function n(t){var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;rs;s++)n.push(e[s].x,e[s].y);e=n}this.closed=!0,this.points=e,this.type=o.SHAPES.POLY}var i=t("../Point"),o=t("../../const");n.prototype.constructor=n,e.exports=n,n.prototype.clone=function(){return new n(this.points.slice())},n.prototype.contains=function(t,e){for(var r=!1,n=this.points.length/2,i=0,o=n-1;n>i;o=i++){var s=this.points[2*i],a=this.points[2*i+1],l=this.points[2*o],u=this.points[2*o+1],h=a>e!=u>e&&(l-s)*(e-a)/(u-a)+s>t;h&&(r=!r)}return r}},{"../../const":22,"../Point":31}],36:[function(t,e,r){function n(t,e,r,n){this.x=t||0,this.y=e||0,this.width=r||0,this.height=n||0,this.type=i.SHAPES.RECT}var i=t("../../const");n.prototype.constructor=n,e.exports=n,n.EMPTY=new n(0,0,0,0),n.prototype.clone=function(){return new n(this.x,this.y,this.width,this.height)},n.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&e=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height?!0:!1}},{"../../const":22}],38:[function(t,e,r){function n(t,e){i.call(this),this._properties=[!1,!0,!1,!1,!1],this._size=t||15e3,this._buffers=null,this._updateStatic=!1,this.interactiveChildren=!1,this.blendMode=o.BLEND_MODES.NORMAL,this.roundPixels=!0,this.setProperties(e)}var i=t("../display/Container"),o=t("../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.setProperties=function(t){t&&(this._properties[0]="scale"in t?!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="alpha"in t?!!t.alpha:this._properties[4])},n.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},n.prototype.renderWebGL=function(t){this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(t.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},n.prototype.addChildAt=function(t,e){if(t===this)return t;if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),this._updateStatic=!0,t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},n.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,this.children.splice(t,1),this._updateStatic=!0,e},n.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,n=!0,i=0,o=0,s=0,a=0;e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var l=0;lr;r+=6,n+=4)this.indices[r+0]=n+0,this.indices[r+1]=n+1,this.indices[r+2]=n+2,this.indices[r+3]=n+0,this.indices[r+4]=n+2,this.indices[r+5]=n+3;this.shader=null,this.indexBuffer=null,this.properties=null,this.tempMatrix=new l.Matrix}var i=t("../../renderers/webgl/utils/ObjectRenderer"),o=t("../../renderers/webgl/WebGLRenderer"),s=t("./ParticleShader"),a=t("./ParticleBuffer"),l=t("../../math");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,o.registerPlugin("particle",n),n.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=new s(this.renderer.shaderManager),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.properties=[{attribute:this.shader.attributes.aVertexPosition,dynamic:!1,size:2,uploadFunction:this.uploadVertices,offset:0},{attribute:this.shader.attributes.aPositionCoord,dynamic:!0,size:2,uploadFunction:this.uploadPosition,offset:0},{attribute:this.shader.attributes.aRotation,dynamic:!1,size:1,uploadFunction:this.uploadRotation,offset:0},{attribute:this.shader.attributes.aTextureCoord,dynamic:!1,size:2,uploadFunction:this.uploadUvs,offset:0},{attribute:this.shader.attributes.aColor,dynamic:!1,size:1,uploadFunction:this.uploadAlpha,offset:0}]},n.prototype.start=function(){var t=this.renderer.gl;t.activeTexture(t.TEXTURE0),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.shader;this.renderer.shaderManager.setShader(e)},n.prototype.render=function(t){var e=t.children,r=e.length,n=t._size;if(0!==r){r>n&&(r=n),t._buffers||(t._buffers=this.generateBuffers(t)),this.renderer.blendModeManager.setBlendMode(t.blendMode);var i=this.renderer.gl,o=t.worldTransform.copy(this.tempMatrix);o.prepend(this.renderer.currentRenderTarget.projectionMatrix),i.uniformMatrix3fv(this.shader.uniforms.projectionMatrix._location,!1,o.toArray(!0)),i.uniform1f(this.shader.uniforms.uAlpha._location,t.worldAlpha);var s=t._updateStatic,a=e[0]._texture.baseTexture;if(a._glTextures[i.id])i.bindTexture(i.TEXTURE_2D,a._glTextures[i.id]);else{if(!this.renderer.updateTexture(a))return;this.properties[0].dynamic&&this.properties[3].dynamic||(s=!0)}for(var l=0,u=0;r>u;u+=this.size){var h=r-u;h>this.size&&(h=this.size);var c=t._buffers[l++];c.uploadDynamic(e,u,h),s&&c.uploadStatic(e,u,h),c.bind(this.shader),i.drawElements(i.TRIANGLES,6*h,i.UNSIGNED_SHORT,0),this.renderer.drawCount++}t._updateStatic=!1}},n.prototype.generateBuffers=function(t){var e,r=this.renderer.gl,n=[],i=t._size;for(e=0;ee;e+=this.size)n.push(new a(r,this.properties,this.size,this.shader));return n},n.prototype.uploadVertices=function(t,e,r,n,i,o){for(var s,a,l,u,h,c,f,d,p,g=0;r>g;g++)s=t[e+g],a=s._texture,u=s.scale.x,h=s.scale.y,a.trim?(l=a.trim,f=l.x-s.anchor.x*l.width,c=f+a.crop.width,p=l.y-s.anchor.y*l.height,d=p+a.crop.height):(c=a._frame.width*(1-s.anchor.x),f=a._frame.width*-s.anchor.x,d=a._frame.height*(1-s.anchor.y),p=a._frame.height*-s.anchor.y),n[o]=f*u,n[o+1]=p*h,n[o+i]=c*u,n[o+i+1]=p*h,n[o+2*i]=c*u,n[o+2*i+1]=d*h,n[o+3*i]=f*u,n[o+3*i+1]=d*h,o+=4*i},n.prototype.uploadPosition=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s].position;n[o]=a.x,n[o+1]=a.y,n[o+i]=a.x,n[o+i+1]=a.y,n[o+2*i]=a.x,n[o+2*i+1]=a.y,n[o+3*i]=a.x,n[o+3*i+1]=a.y,o+=4*i}},n.prototype.uploadRotation=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s].rotation;n[o]=a,n[o+i]=a,n[o+2*i]=a,n[o+3*i]=a,o+=4*i}},n.prototype.uploadUvs=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s]._texture._uvs;a?(n[o]=a.x0,n[o+1]=a.y0,n[o+i]=a.x1,n[o+i+1]=a.y1,n[o+2*i]=a.x2,n[o+2*i+1]=a.y2,n[o+3*i]=a.x3,n[o+3*i+1]=a.y3,o+=4*i):(n[o]=0,n[o+1]=0,n[o+i]=0,n[o+i+1]=0,n[o+2*i]=0,n[o+2*i+1]=0,n[o+3*i]=0,n[o+3*i+1]=0,o+=4*i)}},n.prototype.uploadAlpha=function(t,e,r,n,i,o){for(var s=0;r>s;s++){var a=t[e+s].alpha;n[o]=a,n[o+i]=a,n[o+2*i]=a,n[o+3*i]=a,o+=4*i}},n.prototype.destroy=function(){this.renderer.gl&&this.renderer.gl.deleteBuffer(this.indexBuffer),i.prototype.destroy.apply(this,arguments),this.shader.destroy(),this.indices=null,this.tempMatrix=null}},{"../../math":32,"../../renderers/webgl/WebGLRenderer":48,"../../renderers/webgl/utils/ObjectRenderer":62,"./ParticleBuffer":39,"./ParticleShader":41}],41:[function(t,e,r){function n(t){i.call(this,t,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void){"," vec2 v = aVertexPosition;"," v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);"," v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);"," v = v + aPositionCoord;"," gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","uniform float uAlpha;","void main(void){"," vec4 color = texture2D(uSampler, vTextureCoord) * vColor * uAlpha;"," if (color.a == 0.0) discard;"," gl_FragColor = color;","}"].join("\n"),{uAlpha:{type:"1f",value:1}},{aPositionCoord:0,aRotation:0})}var i=t("../../renderers/webgl/shaders/TextureShader");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n},{"../../renderers/webgl/shaders/TextureShader":61}],42:[function(t,e,r){function n(t,e,r,n){if(a.call(this),i.sayHello(t),n)for(var l in s.DEFAULT_RENDER_OPTIONS)"undefined"==typeof n[l]&&(n[l]=s.DEFAULT_RENDER_OPTIONS[l]);else n=s.DEFAULT_RENDER_OPTIONS;this.type=s.RENDERER_TYPE.UNKNOWN,this.width=e||800,this.height=r||600,this.view=n.view||document.createElement("canvas"),this.resolution=n.resolution,this.transparent=n.transparent,this.autoResize=n.autoResize||!1,this.blendModes=null,this.preserveDrawingBuffer=n.preserveDrawingBuffer,this.clearBeforeRender=n.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgb=[0,0,0],this._backgroundColorString="#000000",this.backgroundColor=n.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent={worldTransform:new o.Matrix,worldAlpha:1,children:[]},this._lastObjectRendered=this._tempDisplayObjectParent}var i=t("../utils"),o=t("../math"),s=t("../const"),a=t("eventemitter3");n.prototype=Object.create(a.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{backgroundColor:{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=i.hex2string(t),i.hex2rgb(t,this._backgroundColorRgb)}}}),n.prototype.resize=function(t,e){this.width=t*this.resolution,this.height=e*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px")},n.prototype.destroy=function(t){t&&this.view.parent&&this.view.parent.removeChild(this.view),this.type=s.RENDERER_TYPE.UNKNOWN,this.width=0,this.height=0,this.view=null,this.resolution=0,this.transparent=!1,this.autoResize=!1,this.blendModes=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgb=null,this._backgroundColorString=null}},{"../const":22,"../math":32,"../utils":76,eventemitter3:11}],43:[function(t,e,r){function n(t,e,r){i.call(this,"Canvas",t,e,r),this.type=l.RENDERER_TYPE.CANVAS,this.context=this.view.getContext("2d",{alpha:this.transparent}),this.refresh=!0,this.maskManager=new o,this.roundPixels=!1,this.currentScaleMode=l.SCALE_MODES.DEFAULT,this.currentBlendMode=l.BLEND_MODES.NORMAL,this.smoothProperty="imageSmoothingEnabled",this.context.imageSmoothingEnabled||(this.context.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.context.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.context.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.context.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(),this._mapBlendModes(),this._tempDisplayObjectParent={worldTransform:new a.Matrix,worldAlpha:1},this.resize(t,e)}var i=t("../SystemRenderer"),o=t("./utils/CanvasMaskManager"),s=t("../../utils"),a=t("../../math"),l=t("../../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,s.pluginTarget.mixin(n),n.prototype.render=function(t){var e=t.parent;this._lastObjectRendered=t,t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=e,this.context.setTransform(1,0,0,1,0,0),this.context.globalAlpha=1,this.currentBlendMode=l.BLEND_MODES.NORMAL,this.context.globalCompositeOperation=this.blendModes[l.BLEND_MODES.NORMAL],navigator.isCocoonJS&&this.view.screencanvas&&(this.context.fillStyle="black",this.context.clear()),this.clearBeforeRender&&(this.transparent?this.context.clearRect(0,0,this.width,this.height):(this.context.fillStyle=this._backgroundColorString,this.context.fillRect(0,0,this.width,this.height))),this.renderDisplayObject(t,this.context)},n.prototype.destroy=function(t){this.destroyPlugins(),i.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.roundPixels=!1,this.currentScaleMode=0,this.currentBlendMode=0,this.smoothProperty=null},n.prototype.renderDisplayObject=function(t,e){var r=this.context;this.context=e,t.renderCanvas(this),this.context=r},n.prototype.resize=function(t,e){i.prototype.resize.call(this,t,e),this.currentScaleMode=l.SCALE_MODES.DEFAULT,this.smoothProperty&&(this.context[this.smoothProperty]=this.currentScaleMode===l.SCALE_MODES.LINEAR)},n.prototype._mapBlendModes=function(){this.blendModes||(this.blendModes={},s.canUseNewCanvasBlendModes()?(this.blendModes[l.BLEND_MODES.NORMAL]="source-over",this.blendModes[l.BLEND_MODES.ADD]="lighter",this.blendModes[l.BLEND_MODES.MULTIPLY]="multiply",this.blendModes[l.BLEND_MODES.SCREEN]="screen",this.blendModes[l.BLEND_MODES.OVERLAY]="overlay",this.blendModes[l.BLEND_MODES.DARKEN]="darken",this.blendModes[l.BLEND_MODES.LIGHTEN]="lighten",this.blendModes[l.BLEND_MODES.COLOR_DODGE]="color-dodge",this.blendModes[l.BLEND_MODES.COLOR_BURN]="color-burn",this.blendModes[l.BLEND_MODES.HARD_LIGHT]="hard-light",this.blendModes[l.BLEND_MODES.SOFT_LIGHT]="soft-light",this.blendModes[l.BLEND_MODES.DIFFERENCE]="difference",this.blendModes[l.BLEND_MODES.EXCLUSION]="exclusion",this.blendModes[l.BLEND_MODES.HUE]="hue",this.blendModes[l.BLEND_MODES.SATURATION]="saturate",this.blendModes[l.BLEND_MODES.COLOR]="color",this.blendModes[l.BLEND_MODES.LUMINOSITY]="luminosity"):(this.blendModes[l.BLEND_MODES.NORMAL]="source-over",this.blendModes[l.BLEND_MODES.ADD]="lighter",this.blendModes[l.BLEND_MODES.MULTIPLY]="source-over",this.blendModes[l.BLEND_MODES.SCREEN]="source-over",this.blendModes[l.BLEND_MODES.OVERLAY]="source-over",this.blendModes[l.BLEND_MODES.DARKEN]="source-over",this.blendModes[l.BLEND_MODES.LIGHTEN]="source-over",this.blendModes[l.BLEND_MODES.COLOR_DODGE]="source-over",this.blendModes[l.BLEND_MODES.COLOR_BURN]="source-over",this.blendModes[l.BLEND_MODES.HARD_LIGHT]="source-over",this.blendModes[l.BLEND_MODES.SOFT_LIGHT]="source-over",this.blendModes[l.BLEND_MODES.DIFFERENCE]="source-over",this.blendModes[l.BLEND_MODES.EXCLUSION]="source-over",this.blendModes[l.BLEND_MODES.HUE]="source-over",this.blendModes[l.BLEND_MODES.SATURATION]="source-over",this.blendModes[l.BLEND_MODES.COLOR]="source-over",this.blendModes[l.BLEND_MODES.LUMINOSITY]="source-over"))}},{"../../const":22,"../../math":32,"../../utils":76,"../SystemRenderer":42,"./utils/CanvasMaskManager":46}],44:[function(t,e,r){function n(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=t,this.canvas.height=e}n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{width:{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t}},height:{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t}}}),n.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},n.prototype.resize=function(t,e){this.canvas.width=t,this.canvas.height=e},n.prototype.destroy=function(){this.context=null,this.canvas=null}},{}],45:[function(t,e,r){var n=t("../../../const"),i={};e.exports=i,i.renderGraphics=function(t,e){var r=t.worldAlpha;t.dirty&&(this.updateGraphicsTint(t),t.dirty=!1);for(var i=0;iD?D:T,e.beginPath(),e.moveTo(E,C+T),e.lineTo(E,C+B-T),e.quadraticCurveTo(E,C+B,E+T,C+B),e.lineTo(E+b-T,C+B),e.quadraticCurveTo(E+b,C+B,E+b,C+B-T),e.lineTo(E+b,C+T),e.quadraticCurveTo(E+b,C,E+b-T,C),e.lineTo(E+T,C),e.quadraticCurveTo(E,C,E,C+T),e.closePath(),(o.fillColor||0===o.fillColor)&&(e.globalAlpha=o.fillAlpha*r,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fill()),o.lineWidth&&(e.globalAlpha=o.lineAlpha*r,e.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),e.stroke())}}},i.renderGraphicsMask=function(t,e){var r=t.graphicsData.length;if(0!==r){e.beginPath();for(var i=0;r>i;i++){var o=t.graphicsData[i],s=o.shape;if(o.type===n.SHAPES.POLY){var a=s.points;e.moveTo(a[0],a[1]);for(var l=1;lB?B:b,e.moveTo(x,w+b),e.lineTo(x,w+C-b),e.quadraticCurveTo(x,w+C,x+b,w+C),e.lineTo(x+E-b,w+C),e.quadraticCurveTo(x+E,w+C,x+E,w+C-b),e.lineTo(x+E,w+b),e.quadraticCurveTo(x+E,w,x+E-b,w),e.lineTo(x+b,w),e.quadraticCurveTo(x,w,x,w+b), +e.closePath()}}}},i.updateGraphicsTint=function(t){if(16777215!==t.tint)for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,n=(255&t.tint)/255,i=0;i>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*n*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*n*255}}},{"../../../const":22}],46:[function(t,e,r){function n(){}var i=t("./CanvasGraphics");n.prototype.constructor=n,e.exports=n,n.prototype.pushMask=function(t,e){e.context.save();var r=t.alpha,n=t.worldTransform,o=e.resolution;e.context.setTransform(n.a*o,n.b*o,n.c*o,n.d*o,n.tx*o,n.ty*o),t.texture||(i.renderGraphicsMask(t,e.context),e.context.clip()),t.worldAlpha=r},n.prototype.popMask=function(t){t.context.restore()},n.prototype.destroy=function(){}},{"./CanvasGraphics":45}],47:[function(t,e,r){var n=t("../../../utils"),i={};e.exports=i,i.getTintedTexture=function(t,e){var r=t.texture;e=i.roundColor(e);var n="#"+("00000"+(0|e).toString(16)).substr(-6);if(r.tintCache=r.tintCache||{},r.tintCache[n])return r.tintCache[n];var o=i.canvas||document.createElement("canvas");if(i.tintMethod(r,e,o),i.convertTintToImage){var s=new Image;s.src=o.toDataURL(),r.tintCache[n]=s}else r.tintCache[n]=o,i.canvas=null;return o},i.tintWithMultiply=function(t,e,r){var n=r.getContext("2d"),i=t.crop;r.width=i.width,r.height=i.height,n.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),n.fillRect(0,0,i.width,i.height),n.globalCompositeOperation="multiply",n.drawImage(t.baseTexture.source,i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.globalCompositeOperation="destination-atop",n.drawImage(t.baseTexture.source,i.x,i.y,i.width,i.height,0,0,i.width,i.height)},i.tintWithOverlay=function(t,e,r){var n=r.getContext("2d"),i=t.crop;r.width=i.width,r.height=i.height,n.globalCompositeOperation="copy",n.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),n.fillRect(0,0,i.width,i.height),n.globalCompositeOperation="destination-atop",n.drawImage(t.baseTexture.source,i.x,i.y,i.width,i.height,0,0,i.width,i.height)},i.tintWithPerPixel=function(t,e,r){var i=r.getContext("2d"),o=t.crop;r.width=o.width,r.height=o.height,i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.source,o.x,o.y,o.width,o.height,0,0,o.width,o.height);for(var s=n.hex2rgb(e),a=s[0],l=s[1],u=s[2],h=i.getImageData(0,0,o.width,o.height),c=h.data,f=0;fe;++e)this.shaders[e].syncUniform(t)}},{"../shaders/TextureShader":61}],50:[function(t,e,r){function n(){i.call(this,"\nprecision mediump float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform vec2 resolution;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\n\nvoid texcoords(vec2 fragCoord, vec2 resolution,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n vec2 inverseVP = 1.0 / resolution.xy;\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 gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n vResolution = resolution;\n\n //compute the texture coords and send them to varyings\n texcoords(aTextureCoord * resolution, resolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'precision lowp float;\n\n\n/**\nBasic FXAA implementation based on the code on geeks3d.com with the\nmodification that the texture2DLod stuff was removed since it\'s\nunsupported by WebGL.\n\n--\n\nFrom:\nhttps://github.com/mitsuhiko/webgl-meincraft\n\nCopyright (c) 2011 by Armin Ronacher.\n\nSome rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\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\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF 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 resolution,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);\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\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nuniform sampler2D uSampler;\n\n\nvoid main(void){\n\n gl_FragColor = fxaa(uSampler, vTextureCoord * vResolution, vResolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n}\n',{resolution:{type:"v2",value:{x:1,y:1}}})}var i=t("./AbstractFilter");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager,i=this.getShader(t);n.applyFilter(i,e,r)}},{"./AbstractFilter":49}],51:[function(t,e,r){function n(t){var e=new o.Matrix;i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform sampler2D mask;\n\nvoid main(void)\n{\n // check clip! this will stop the mask bleeding out from the edges\n vec2 text = abs( vMaskCoord - 0.5 );\n text = step(0.5, text);\n float clip = 1.0 - max(text.y, text.x);\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n original *= (masky.r * masky.a * alpha * clip);\n gl_FragColor = original;\n}\n",{mask:{type:"sampler2D",value:t._texture},alpha:{type:"f",value:1},otherMatrix:{type:"mat3",value:e.toArray(!0)}}),this.maskSprite=t,this.maskMatrix=e}var i=t("./AbstractFilter"),o=t("../../../math");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager;this.uniforms.mask.value=this.maskSprite._texture,n.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.alpha.value=this.maskSprite.worldAlpha;var i=this.getShader(t);n.applyFilter(i,e,r)},Object.defineProperties(n.prototype,{map:{get:function(){return this.uniforms.mask.value},set:function(t){this.uniforms.mask.value=t}},offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}}})},{"../../../math":32,"./AbstractFilter":49}],52:[function(t,e,r){function n(t){i.call(this,t),this.currentBlendMode=99999}var i=t("./WebGLManager");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.setBlendMode=function(t){if(this.currentBlendMode===t)return!1;this.currentBlendMode=t;var e=this.renderer.blendModes[this.currentBlendMode];return this.renderer.gl.blendFunc(e[0],e[1]),!0}},{"./WebGLManager":57}],53:[function(t,e,r){function n(t){i.call(this,t),this.filterStack=[],this.filterStack.push({renderTarget:t.currentRenderTarget,filter:[],bounds:null}),this.texturePool=[],this.textureSize=new l.Rectangle(0,0,t.width,t.height),this.currentFrame=null}var i=t("./WebGLManager"),o=t("../utils/RenderTarget"),s=t("../../../const"),a=t("../utils/Quad"),l=t("../../../math");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.onContextChange=function(){this.texturePool.length=0;var t=this.renderer.gl;this.quad=new a(t)},n.prototype.setFilterStack=function(t){this.filterStack=t},n.prototype.pushFilter=function(t,e){var r=t.filterArea?t.filterArea.clone():t.getBounds();r.x=0|r.x,r.y=0|r.y,r.width=0|r.width,r.height=0|r.height;var n=0|e[0].padding;if(r.x-=n,r.y-=n,r.width+=2*n,r.height+=2*n,this.renderer.currentRenderTarget.transform){var i=this.renderer.currentRenderTarget.transform;r.x+=i.tx,r.y+=i.ty,this.capFilterArea(r),r.x-=i.tx,r.y-=i.ty}else this.capFilterArea(r);if(r.width>0&&r.height>0){this.currentFrame=r;var o=this.getRenderTarget();this.renderer.setRenderTarget(o),o.clear(),this.filterStack.push({renderTarget:o,filter:e})}else this.filterStack.push({renderTarget:null,filter:e})},n.prototype.popFilter=function(){var t=this.filterStack.pop(),e=this.filterStack[this.filterStack.length-1],r=t.renderTarget;if(t.renderTarget){var n=e.renderTarget,i=this.renderer.gl;this.currentFrame=r.frame,this.quad.map(this.textureSize,r.frame),i.bindBuffer(i.ARRAY_BUFFER,this.quad.vertexBuffer),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,this.quad.indexBuffer);var o=t.filter;if(i.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aVertexPosition,2,i.FLOAT,!1,0,0),i.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aTextureCoord,2,i.FLOAT,!1,0,32),i.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aColor,4,i.FLOAT,!1,0,64),this.renderer.blendModeManager.setBlendMode(s.BLEND_MODES.NORMAL),1===o.length)o[0].uniforms.dimensions&&(o[0].uniforms.dimensions.value[0]=this.renderer.width,o[0].uniforms.dimensions.value[1]=this.renderer.height,o[0].uniforms.dimensions.value[2]=this.quad.vertices[0],o[0].uniforms.dimensions.value[3]=this.quad.vertices[5]),o[0].applyFilter(this.renderer,r,n),this.returnRenderTarget(r);else{for(var a=r,l=this.getRenderTarget(!0),u=0;uthis.textureSize.width&&(t.width=this.textureSize.width-t.x),t.y+t.height>this.textureSize.height&&(t.height=this.textureSize.height-t.y)},n.prototype.resize=function(t,e){this.textureSize.width=t,this.textureSize.height=e;for(var r=0;re;++e)t._array[2*e]=o[e].x,t._array[2*e+1]=o[e].y;s.uniform2fv(n,t._array);break;case"v3v":for(t._array||(t._array=new Float32Array(3*o.length)),e=0,r=o.length;r>e;++e)t._array[3*e]=o[e].x,t._array[3*e+1]=o[e].y,t._array[3*e+2]=o[e].z;s.uniform3fv(n,t._array);break;case"v4v":for(t._array||(t._array=new Float32Array(4*o.length)),e=0,r=o.length;r>e;++e)t._array[4*e]=o[e].x,t._array[4*e+1]=o[e].y,t._array[4*e+2]=o[e].z,t._array[4*e+3]=o[e].w;s.uniform4fv(n,t._array);break;case"t":case"sampler2D":if(!t.value||!t.value.baseTexture.hasLoaded)break;s.activeTexture(s["TEXTURE"+this.textureCount]);var a=t.value.baseTexture._glTextures[s.id];a||(this.initSampler2D(t),a=t.value.baseTexture._glTextures[s.id]),s.bindTexture(s.TEXTURE_2D,a),s.uniform1i(t._location,this.textureCount),this.textureCount++;break;default:console.warn("Pixi.js Shader Warning: Unknown uniform type: "+t.type)}},n.prototype.syncUniforms=function(){this.textureCount=1;for(var t in this.uniforms)this.syncUniform(this.uniforms[t])},n.prototype.initSampler2D=function(t){var e=this.gl,r=t.value.baseTexture;if(r.hasLoaded)if(t.textureData){var n=t.textureData;r._glTextures[e.id]=e.createTexture(),e.bindTexture(e.TEXTURE_2D,r._glTextures[e.id]),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultipliedAlpha),e.texImage2D(e.TEXTURE_2D,0,n.luminance?e.LUMINANCE:e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n.magFilter?n.magFilter:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n.wrapS?n.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,n.wrapS?n.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,n.wrapT?n.wrapT:e.CLAMP_TO_EDGE)}else this.shaderManager.renderer.updateTexture(r)},n.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.gl=null,this.uniforms=null,this.attributes=null,this.vertexSrc=null,this.fragmentSrc=null},n.prototype._glCompile=function(t,e){var r=this.gl.createShader(t);return this.gl.shaderSource(r,e),this.gl.compileShader(r),this.gl.getShaderParameter(r,this.gl.COMPILE_STATUS)?r:(console.log(this.gl.getShaderInfoLog(r)),null)}},{"../../../utils":76}],61:[function(t,e,r){function n(t,e,r,o,s){var a={uSampler:{type:"sampler2D",value:0},projectionMatrix:{type:"mat3",value:new Float32Array([1,0,0,0,1,0,0,0,1])}};if(o)for(var l in o)a[l]=o[l];var u={aVertexPosition:0,aTextureCoord:0,aColor:0};if(s)for(var h in s)u[h]=s[h];e=e||n.defaultVertexSrc,r=r||n.defaultFragmentSrc,i.call(this,t,e,r,a,u)}var i=t("./Shader");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.defaultVertexSrc=["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"].join("\n"),n.defaultFragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"].join("\n")},{"./Shader":60}],62:[function(t,e,r){function n(t){i.call(this,t)}var i=t("../managers/WebGLManager");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.start=function(){},n.prototype.stop=function(){this.flush()},n.prototype.flush=function(){},n.prototype.render=function(t){}},{"../managers/WebGLManager":57}],63:[function(t,e,r){function n(t){this.gl=t,this.vertices=new Float32Array([0,0,200,0,200,200,0,200]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.colors=new Float32Array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]),this.indices=new Uint16Array([0,1,2,0,3,2]),this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,128,t.DYNAMIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.upload()}n.prototype.constructor=n,n.prototype.map=function(t,e){var r=0,n=0;this.uvs[0]=r,this.uvs[1]=n,this.uvs[2]=r+e.width/t.width,this.uvs[3]=n,this.uvs[4]=r+e.width/t.width,this.uvs[5]=n+e.height/t.height,this.uvs[6]=r,this.uvs[7]=n+e.height/t.height,r=e.x,n=e.y,this.vertices[0]=r,this.vertices[1]=n,this.vertices[2]=r+e.width,this.vertices[3]=n,this.vertices[4]=r+e.width,this.vertices[5]=n+e.height,this.vertices[6]=r,this.vertices[7]=n+e.height,this.upload()},n.prototype.upload=function(){var t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferSubData(t.ARRAY_BUFFER,0,this.vertices),t.bufferSubData(t.ARRAY_BUFFER,32,this.uvs),t.bufferSubData(t.ARRAY_BUFFER,64,this.colors)},e.exports=n},{}],64:[function(t,e,r){var n=t("../../../math"),i=t("../../../utils"),o=t("../../../const"),s=t("./StencilMaskStack"),a=function(t,e,r,a,l,u){if(this.gl=t,this.frameBuffer=null,this.texture=null,this.size=new n.Rectangle(0,0,1,1),this.resolution=l||o.RESOLUTION,this.projectionMatrix=new n.Matrix,this.transform=null,this.frame=null,this.stencilBuffer=null,this.stencilMaskStack=new s,this.filterStack=[{renderTarget:this,filter:[],bounds:this.size}],this.scaleMode=a||o.SCALE_MODES.DEFAULT,this.root=u,!this.root){this.frameBuffer=t.createFramebuffer(),this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,a===o.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,a===o.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST);var h=i.isPowerOfTwo(e,r);h?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0)}this.resize(e,r)};a.prototype.constructor=a,e.exports=a,a.prototype.clear=function(t){var e=this.gl;t&&e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},a.prototype.attachStencilBuffer=function(){if(!this.stencilBuffer&&!this.root){var t=this.gl;this.stencilBuffer=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.stencilBuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,this.stencilBuffer),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.size.width*this.resolution,this.size.height*this.resolution)}},a.prototype.activate=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer);var e=this.frame||this.size;this.calculateProjection(e),this.transform&&this.projectionMatrix.append(this.transform),t.viewport(0,0,e.width*this.resolution,e.height*this.resolution)},a.prototype.calculateProjection=function(t){var e=this.projectionMatrix;e.identity(),this.root?(e.a=1/t.width*2,e.d=-1/t.height*2,e.tx=-1-t.x*e.a,e.ty=1-t.y*e.d):(e.a=1/t.width*2,e.d=1/t.height*2,e.tx=-1-t.x*e.a,e.ty=-1-t.y*e.d)},a.prototype.resize=function(t,e){if(t=0|t,e=0|e,this.size.width!==t||this.size.height!==e){if(this.size.width=t,this.size.height=e,!this.root){var r=this.gl;r.bindTexture(r.TEXTURE_2D,this.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,t*this.resolution,e*this.resolution,0,r.RGBA,r.UNSIGNED_BYTE,null),this.stencilBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencilBuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t*this.resolution,e*this.resolution))}var n=this.frame||this.size;this.calculateProjection(n)}},a.prototype.destroy=function(){var t=this.gl;t.deleteFramebuffer(this.frameBuffer),t.deleteTexture(this.texture),this.frameBuffer=null,this.texture=null}},{"../../../const":22,"../../../math":32,"../../../utils":76,"./StencilMaskStack":65}],65:[function(t,e,r){function n(){this.stencilStack=[],this.reverse=!0,this.count=0}n.prototype.constructor=n,e.exports=n},{}],66:[function(t,e,r){function n(t){s.call(this),this.anchor=new i.Point,this._texture=null,this._width=0,this._height=0,this.tint=16777215,this.blendMode=u.BLEND_MODES.NORMAL,this.shader=null,this.cachedTint=16777215,this.texture=t||o.EMPTY}var i=t("../math"),o=t("../textures/Texture"),s=t("../display/Container"),a=t("../renderers/canvas/utils/CanvasTinter"),l=t("../utils"),u=t("../const"),h=new i.Point;n.prototype=Object.create(s.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{width:{get:function(){return this.scale.x*this.texture._frame.width},set:function(t){this.scale.x=t/this.texture._frame.width,this._width=t}},height:{get:function(){return this.scale.y*this.texture._frame.height},set:function(t){this.scale.y=t/this.texture._frame.height,this._height=t}},texture:{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t,this.cachedTint=16777215,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}}),n.prototype._onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height)},n.prototype._renderWebGL=function(t){t.setObjectRenderer(t.plugins.sprite),t.plugins.sprite.render(this)},n.prototype.getBounds=function(t){if(!this._currentBounds){var e,r,n,i,o=this._texture._frame.width,s=this._texture._frame.height,a=o*(1-this.anchor.x),l=o*-this.anchor.x,u=s*(1-this.anchor.y),h=s*-this.anchor.y,c=t||this.worldTransform,f=c.a,d=c.b,p=c.c,g=c.d,A=c.tx,v=c.ty;if(0===d&&0===p)0>f&&(f*=-1),0>g&&(g*=-1),e=f*l+A,r=f*a+A,n=g*h+v,i=g*u+v;else{var m=f*l+p*h+A,y=g*h+d*l+v,x=f*a+p*h+A,w=g*h+d*a+v,E=f*a+p*u+A,C=g*u+d*a+v,b=f*l+p*u+A,B=g*u+d*l+v;e=m,e=e>x?x:e,e=e>E?E:e,e=e>b?b:e,n=y,n=n>w?w:n,n=n>C?C:n,n=n>B?B:n,r=m,r=x>r?x:r,r=E>r?E:r,r=b>r?b:r,i=y,i=w>i?w:i,i=C>i?C:i,i=B>i?B:i}if(this.children.length){var T=this.containerGetBounds();a=T.x,l=T.x+T.width,u=T.y,h=T.y+T.height,e=a>e?e:a,n=u>n?n:u,r=r>l?r:l,i=i>h?i:h}var D=this._bounds;D.x=e,D.width=r-e,D.y=n,D.height=i-n,this._currentBounds=D}return this._currentBounds},n.prototype.getLocalBounds=function(){return this._bounds.x=-this._texture._frame.width*this.anchor.x,this._bounds.y=-this._texture._frame.height*this.anchor.y,this._bounds.width=this._texture._frame.width,this._bounds.height=this._texture._frame.height,this._bounds},n.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,h);var e,r=this._texture._frame.width,n=this._texture._frame.height,i=-r*this.anchor.x;return h.x>i&&h.xe&&h.yn;n+=6,o+=4)this.indices[n+0]=o+0,this.indices[n+1]=o+1,this.indices[n+2]=o+2,this.indices[n+3]=o+0,this.indices[n+4]=o+2,this.indices[n+5]=o+3;this.currentBatchSize=0,this.sprites=[],this.shader=null}var i=t("../../renderers/webgl/utils/ObjectRenderer"),o=t("../../renderers/webgl/WebGLRenderer"),s=t("../../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,o.registerPlugin("sprite",n),n.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=this.renderer.shaderManager.defaultShader,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices,t.DYNAMIC_DRAW),this.currentBlendMode=99999},n.prototype.render=function(t){var e=t._texture;this.currentBatchSize>=this.size&&this.flush();var r=e._uvs;if(r){var n,i,o,s,a=t.anchor.x,l=t.anchor.y;if(e.trim){var u=e.trim;i=u.x-a*u.width,n=i+e.crop.width,s=u.y-l*u.height,o=s+e.crop.height}else n=e._frame.width*(1-a),i=e._frame.width*-a,o=e._frame.height*(1-l),s=e._frame.height*-l;var h=this.currentBatchSize*this.vertByteSize,c=t.worldTransform,f=c.a,d=c.b,p=c.c,g=c.d,A=c.tx,v=c.ty,m=this.colors,y=this.positions;this.renderer.roundPixels?(y[h]=f*i+p*s+A|0,y[h+1]=g*s+d*i+v|0,y[h+5]=f*n+p*s+A|0,y[h+6]=g*s+d*n+v|0,y[h+10]=f*n+p*o+A|0,y[h+11]=g*o+d*n+v|0,y[h+15]=f*i+p*o+A|0,y[h+16]=g*o+d*i+v|0):(y[h]=f*i+p*s+A,y[h+1]=g*s+d*i+v,y[h+5]=f*n+p*s+A,y[h+6]=g*s+d*n+v,y[h+10]=f*n+p*o+A,y[h+11]=g*o+d*n+v,y[h+15]=f*i+p*o+A,y[h+16]=g*o+d*i+v),y[h+2]=r.x0,y[h+3]=r.y0,y[h+7]=r.x1,y[h+8]=r.y1,y[h+12]=r.x2,y[h+13]=r.y2,y[h+17]=r.x3,y[h+18]=r.y3;var x=t.tint;m[h+4]=m[h+9]=m[h+14]=m[h+19]=(x>>16)+(65280&x)+((255&x)<<16)+(255*t.worldAlpha<<24),this.sprites[this.currentBatchSize++]=t}},n.prototype.flush=function(){if(0!==this.currentBatchSize){var t,e=this.renderer.gl;if(this.currentBatchSize>.5*this.size)e.bufferSubData(e.ARRAY_BUFFER,0,this.vertices);else{var r=this.positions.subarray(0,this.currentBatchSize*this.vertByteSize);e.bufferSubData(e.ARRAY_BUFFER,0,r)}for(var n,i,o,s,a=0,l=0,u=null,h=this.renderer.blendModeManager.currentBlendMode,c=null,f=!1,d=!1,p=0,g=this.currentBatchSize;g>p;p++)s=this.sprites[p],n=s._texture.baseTexture,i=s.blendMode,o=s.shader||this.shader,f=h!==i,d=c!==o,(u!==n||f||d)&&(this.renderBatch(u,a,l),l=p,a=0,u=n,f&&(h=i,this.renderer.blendModeManager.setBlendMode(h)),d&&(c=o,t=c.shaders?c.shaders[e.id]:c,t||(t=c.getShader(this.renderer)),this.renderer.shaderManager.setShader(t),t.uniforms.projectionMatrix.value=this.renderer.currentRenderTarget.projectionMatrix.toArray(!0),t.syncUniforms(),e.activeTexture(e.TEXTURE0))),a++;this.renderBatch(u,a,l),this.currentBatchSize=0}},n.prototype.renderBatch=function(t,e,r){if(0!==e){var n=this.renderer.gl;t._glTextures[n.id]?n.bindTexture(n.TEXTURE_2D,t._glTextures[n.id]):this.renderer.updateTexture(t),n.drawElements(n.TRIANGLES,6*e,n.UNSIGNED_SHORT,6*r*2),this.renderer.drawCount++}},n.prototype.start=function(){var t=this.renderer.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.vertByteSize;t.vertexAttribPointer(this.shader.attributes.aVertexPosition,2,t.FLOAT,!1,e,0),t.vertexAttribPointer(this.shader.attributes.aTextureCoord,2,t.FLOAT,!1,e,8),t.vertexAttribPointer(this.shader.attributes.aColor,4,t.UNSIGNED_BYTE,!0,e,16)},n.prototype.destroy=function(){this.renderer.gl.deleteBuffer(this.vertexBuffer),this.renderer.gl.deleteBuffer(this.indexBuffer),this.shader.destroy(),this.renderer=null,this.vertices=null,this.positions=null,this.colors=null,this.indices=null,this.vertexBuffer=null,this.indexBuffer=null,this.sprites=null,this.shader=null}},{"../../const":22,"../../renderers/webgl/WebGLRenderer":48,"../../renderers/webgl/utils/ObjectRenderer":62}],68:[function(t,e,r){function n(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||l.RESOLUTION,this._text=null,this._style=null;var n=o.fromCanvas(this.canvas);n.trim=new s.Rectangle,i.call(this,n),this.text=t,this.style=e}var i=t("../sprites/Sprite"),o=t("../textures/Texture"),s=t("../math"),a=t("../utils"),l=t("../const");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.fontPropertiesCache={},n.fontPropertiesCanvas=document.createElement("canvas"),n.fontPropertiesContext=n.fontPropertiesCanvas.getContext("2d"),Object.defineProperties(n.prototype,{width:{get:function(){return this.dirty&&this.updateText(),this.scale.x*this._texture._frame.width},set:function(t){this.scale.x=t/this._texture._frame.width,this._width=t}},height:{get:function(){return this.dirty&&this.updateText(),this.scale.y*this._texture._frame.height},set:function(t){this.scale.y=t/this._texture._frame.height,this._height=t}},style:{get:function(){return this._style},set:function(t){t=t||{},"number"==typeof t.fill&&(t.fill=a.hex2string(t.fill)),"number"==typeof t.stroke&&(t.stroke=a.hex2string(t.stroke)),"number"==typeof t.dropShadowColor&&(t.dropShadowColor=a.hex2string(t.dropShadowColor)),t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,t.dropShadow=t.dropShadow||!1,t.dropShadowColor=t.dropShadowColor||"#000000",t.dropShadowAngle=t.dropShadowAngle||Math.PI/6,t.dropShadowDistance=t.dropShadowDistance||5,t.padding=t.padding||0,t.textBaseline=t.textBaseline||"alphabetic",t.lineJoin=t.lineJoin||"miter",t.miterLimit=t.miterLimit||10,this._style=t,this.dirty=!0}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),n.prototype.updateText=function(){var t=this._style;this.context.font=t.font;for(var e=t.wordWrap?this.wordWrap(this._text):this._text,r=e.split(/(?:\r\n|\r|\n)/),n=new Array(r.length),i=0,o=this.determineFontProperties(t.font),s=0;sl;l++){for(u=0;f>u;u+=4)if(255!==h[d+u]){p=!0;break}if(p)break;d+=f}for(e.ascent=s-l,d=c-f,p=!1,l=a;l>s;l--){for(u=0;f>u;u+=4)if(255!==h[d+u]){p=!0;break}if(p)break;d-=f}e.descent=l-s,e.fontSize=e.ascent+e.descent,n.fontPropertiesCache[t]=e}return e},n.prototype.wordWrap=function(t){for(var e="",r=t.split("\n"),n=this._style.wordWrapWidth,i=0;io?(a>0&&(e+="\n"),e+=s[a],o=n-l):(o-=u,e+=" "+s[a])}i0&&e>0,this.width=this._frame.width=this.crop.width=t,this.height=this._frame.height=this.crop.height=e,r&&(this.baseTexture.width=this.width,this.baseTexture.height=this.height),this.valid&&(this.textureBuffer.resize(this.width,this.height),this.filterManager&&this.filterManager.resize(this.width,this.height)))},n.prototype.clear=function(){this.valid&&(this.renderer.type===h.RENDERER_TYPE.WEBGL&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear()); +},n.prototype.renderWebGL=function(t,e,r,n){if(this.valid){if(n=void 0!==n?n:!0,this.textureBuffer.transform=e,this.textureBuffer.activate(),t.worldAlpha=1,n){t.worldTransform.identity(),t.currentBounds=null;var i,o,s=t.children;for(i=0,o=s.length;o>i;++i)s[i].updateTransform()}var a=this.renderer.filterManager;this.renderer.filterManager=this.filterManager,this.renderer.renderDisplayObject(t,this.textureBuffer,r),this.renderer.filterManager=a}},n.prototype.renderCanvas=function(t,e,r,n){if(this.valid){n=!!n;var i=t.worldTransform,o=c;o.identity(),e&&o.append(e),t.worldTransform=o,t.worldAlpha=1;var s,a,l=t.children;for(s=0,a=l.length;a>s;++s)l[s].updateTransform();r&&this.textureBuffer.clear(),t.worldTransform=i;var u=this.textureBuffer.context,h=this.renderer.resolution;this.renderer.resolution=this.resolution,this.renderer.renderDisplayObject(t,u),this.renderer.resolution=h}},n.prototype.destroy=function(){o.prototype.destroy.call(this,!0),this.textureBuffer.destroy(),this.filterManager&&this.filterManager.destroy(),this.renderer=null},n.prototype.getImage=function(){var t=new Image;return t.src=this.getBase64(),t},n.prototype.getBase64=function(){return this.getCanvas().toDataURL()},n.prototype.getCanvas=function(){if(this.renderer.type===h.RENDERER_TYPE.WEBGL){var t=this.renderer.gl,e=this.textureBuffer.size.width,r=this.textureBuffer.size.height,n=new Uint8Array(4*e*r);t.bindFramebuffer(t.FRAMEBUFFER,this.textureBuffer.frameBuffer),t.readPixels(0,0,e,r,t.RGBA,t.UNSIGNED_BYTE,n),t.bindFramebuffer(t.FRAMEBUFFER,null);var i=new l(e,r),o=i.context.getImageData(0,0,e,r);return o.data.set(n),i.context.putImageData(o,0,0),i.canvas}return this.textureBuffer.canvas},n.prototype.getPixels=function(){var t,e;if(this.renderer.type===h.RENDERER_TYPE.WEBGL){var r=this.renderer.gl;t=this.textureBuffer.size.width,e=this.textureBuffer.size.height;var n=new Uint8Array(4*t*e);return r.bindFramebuffer(r.FRAMEBUFFER,this.textureBuffer.frameBuffer),r.readPixels(0,0,t,e,r.RGBA,r.UNSIGNED_BYTE,n),r.bindFramebuffer(r.FRAMEBUFFER,null),n}return t=this.textureBuffer.canvas.width,e=this.textureBuffer.canvas.height,this.textureBuffer.canvas.getContext("2d").getImageData(0,0,t,e).data},n.prototype.getPixel=function(t,e){if(this.renderer.type===h.RENDERER_TYPE.WEBGL){var r=this.renderer.gl,n=new Uint8Array(4);return r.bindFramebuffer(r.FRAMEBUFFER,this.textureBuffer.frameBuffer),r.readPixels(t,e,1,1,r.RGBA,r.UNSIGNED_BYTE,n),r.bindFramebuffer(r.FRAMEBUFFER,null),n}return this.textureBuffer.canvas.getContext("2d").getImageData(t,e,1,1).data}},{"../const":22,"../math":32,"../renderers/canvas/utils/CanvasBuffer":44,"../renderers/webgl/managers/FilterManager":53,"../renderers/webgl/utils/RenderTarget":64,"./BaseTexture":69,"./Texture":71}],71:[function(t,e,r){function n(t,e,r,i,o){a.call(this),this.noFrame=!1,e||(this.noFrame=!0,e=new l.Rectangle(0,0,1,1)),t instanceof n&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=i,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.width=0,this.height=0,this.crop=r||e,this.rotate=!!o,t.hasLoaded?(this.noFrame&&(e=new l.Rectangle(0,0,t.width,t.height),t.on("update",this.onBaseTextureUpdated,this)),this.frame=e):t.once("loaded",this.onBaseTextureLoaded,this)}var i=t("./BaseTexture"),o=t("./VideoBaseTexture"),s=t("./TextureUvs"),a=t("eventemitter3"),l=t("../math"),u=t("../utils");n.prototype=Object.create(a.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{frame:{get:function(){return this._frame},set:function(t){if(this._frame=t,this.noFrame=!1,this.width=t.width,this.height=t.height,!this.trim&&!this.rotate&&(t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height))throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=t&&t.width&&t.height&&this.baseTexture.hasLoaded,this.trim?(this.width=this.trim.width,this.height=this.trim.height,this._frame.width=this.trim.width,this._frame.height=this.trim.height):this.crop=t,this.valid&&this._updateUvs()}}}),n.prototype.update=function(){this.baseTexture.update()},n.prototype.onBaseTextureLoaded=function(t){this.frame=this.noFrame?new l.Rectangle(0,0,t.width,t.height):this._frame,this.emit("update",this)},n.prototype.onBaseTextureUpdated=function(t){this._frame.width=t.width,this._frame.height=t.height,this.emit("update",this)},n.prototype.destroy=function(t){this.baseTexture&&(t&&this.baseTexture.destroy(),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture.off("loaded",this.onBaseTextureLoaded,this),this.baseTexture=null),this._frame=null,this._uvs=null,this.trim=null,this.crop=null,this.valid=!1},n.prototype.clone=function(){return new n(this.baseTexture,this.frame,this.crop,this.trim,this.rotate)},n.prototype._updateUvs=function(){this._uvs||(this._uvs=new s),this._uvs.set(this.crop,this.baseTexture,this.rotate)},n.fromImage=function(t,e,r){var o=u.TextureCache[t];return o||(o=new n(i.fromImage(t,e,r)),u.TextureCache[t]=o),o},n.fromFrame=function(t){var e=u.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return e},n.fromCanvas=function(t,e){return new n(i.fromCanvas(t,e))},n.fromVideo=function(t,e){return"string"==typeof t?n.fromVideoUrl(t,e):new n(o.fromVideo(t,e))},n.fromVideoUrl=function(t,e){return new n(o.fromUrl(t,e))},n.addTextureToCache=function(t,e){u.TextureCache[e]=t},n.removeTextureFromCache=function(t){var e=u.TextureCache[t];return delete u.TextureCache[t],delete u.BaseTextureCache[t],e},n.EMPTY=new n(new i)},{"../math":32,"../utils":76,"./BaseTexture":69,"./TextureUvs":72,"./VideoBaseTexture":73,eventemitter3:11}],72:[function(t,e,r){function n(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1}e.exports=n,n.prototype.set=function(t,e,r){var n=e.width,i=e.height;r?(this.x0=(t.x+t.height)/n,this.y0=t.y/i,this.x1=(t.x+t.height)/n,this.y1=(t.y+t.width)/i,this.x2=t.x/n,this.y2=(t.y+t.width)/i,this.x3=t.x/n,this.y3=t.y/i):(this.x0=t.x/n,this.y0=t.y/i,this.x1=(t.x+t.width)/n,this.y1=t.y/i,this.x2=(t.x+t.width)/n,this.y2=(t.y+t.height)/i,this.x3=t.x/n,this.y3=(t.y+t.height)/i)}},{}],73:[function(t,e,r){function n(t,e){if(!t)throw new Error("No video source element specified.");(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),o.call(this,t,e),this.autoUpdate=!1,this._onUpdate=this._onUpdate.bind(this),this._onCanPlay=this._onCanPlay.bind(this),t.complete||(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this))),this.__loaded=!1}function i(t,e){e||(e="video/"+t.substr(t.lastIndexOf(".")+1));var r=document.createElement("source");return r.src=t,r.type=e,r}var o=t("./BaseTexture"),s=t("../utils");n.prototype=Object.create(o.prototype),n.prototype.constructor=n,e.exports=n,n.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this._onUpdate),this.update())},n.prototype._onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this._onUpdate),this.autoUpdate=!0)},n.prototype._onPlayStop=function(){this.autoUpdate=!1},n.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.source.play(),this.__loaded||(this.__loaded=!0,this.emit("loaded",this)))},n.prototype.destroy=function(){this.source&&this.source._pixiId&&(delete s.BaseTextureCache[this.source._pixiId],delete this.source._pixiId),o.prototype.destroy.call(this)},n.fromVideo=function(t,e){t._pixiId||(t._pixiId="video_"+s.uid());var r=s.BaseTextureCache[t._pixiId];return r||(r=new n(t,e),s.BaseTextureCache[t._pixiId]=r),r},n.fromUrl=function(t,e){var r=document.createElement("video");if(Array.isArray(t))for(var o=0;othis._maxElapsedMS&&(e=this._maxElapsedMS),this.deltaTime=e*i.TARGET_FPMS*this.speed,this._emitter.emit(s,this.deltaTime),this.lastTime=t},e.exports=n},{"../const":22,eventemitter3:11}],75:[function(t,e,r){var n=t("./Ticker"),i=new n;i.autoStart=!0,e.exports={shared:i,Ticker:n}},{"./Ticker":74}],76:[function(t,e,r){var n=t("../const"),i=e.exports={_uid:0,_saidHello:!1,pluginTarget:t("./pluginTarget"),async:t("async"),uid:function(){return++i._uid},hex2rgb:function(t,e){return e=e||[],e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},hex2string:function(t){return t=t.toString(16),t="000000".substr(0,6-t.length)+t,"#"+t},rgb2hex:function(t){return(255*t[0]<<16)+(255*t[1]<<8)+255*t[2]},canUseNewCanvasBlendModes:function(){if("undefined"==typeof document)return!1;var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",e="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",r=new Image;r.src=t+"AP804Oa6"+e;var n=new Image;n.src=t+"/wCKxvRF"+e;var i=document.createElement("canvas");i.width=6,i.height=1;var o=i.getContext("2d");o.globalCompositeOperation="multiply",o.drawImage(r,0,0),o.drawImage(n,2,0);var s=o.getImageData(2,0,1,1).data;return 255===s[0]&&0===s[1]&&0===s[2]},getNextPowerOfTwo:function(t){if(t>0&&0===(t&t-1))return t;for(var e=1;t>e;)e<<=1;return e},isPowerOfTwo:function(t,e){return t>0&&0===(t&t-1)&&e>0&&0===(e&e-1)},getResolutionOfUrl:function(t){var e=n.RETINA_PREFIX.exec(t);return e?parseFloat(e[1]):1},sayHello:function(t){if(!i._saidHello){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c Pixi.js "+n.VERSION+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("Pixi.js "+n.VERSION+" - "+t+" - http://www.pixijs.com/");i._saidHello=!0}},isWebGLSupported:function(){var t={stencil:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);return!(!r||!r.getContextAttributes().stencil)}catch(n){return!1}},TextureCache:{},BaseTextureCache:{}}},{"../const":22,"./pluginTarget":77,async:2}],77:[function(t,e,r){function n(t){t.__plugins={},t.registerPlugin=function(e,r){t.__plugins[e]=r},t.prototype.initPlugins=function(){this.plugins=this.plugins||{};for(var e in t.__plugins)this.plugins[e]=new t.__plugins[e](this)},t.prototype.destroyPlugins=function(){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;this.plugins=null}}e.exports={mixin:function(t){n(t)}}},{}],78:[function(t,e,r){var n=t("./core"),i=t("./mesh"),o=t("./extras"),s=t("./filters");n.SpriteBatch=function(){throw new ReferenceError("SpriteBatch does not exist any more, please use the new ParticleContainer instead.")},n.AssetLoader=function(){throw new ReferenceError("The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.")},Object.defineProperties(n,{Stage:{get:function(){return console.warn("You do not need to use a PIXI Stage any more, you can simply render any container."),n.Container}},DisplayObjectContainer:{get:function(){return console.warn("DisplayObjectContainer has been shortened to Container, please use Container from now on."),n.Container}},Strip:{get:function(){return console.warn("The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on."),i.Mesh}},Rope:{get:function(){return console.warn("The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on."),i.Rope}},MovieClip:{get:function(){return console.warn("The MovieClip class has been moved to extras.MovieClip, please use extras.MovieClip from now on."),o.MovieClip}},TilingSprite:{get:function(){return console.warn("The TilingSprite class has been moved to extras.TilingSprite, please use extras.TilingSprite from now on."),o.TilingSprite}},BitmapText:{get:function(){return console.warn("The BitmapText class has been moved to extras.BitmapText, please use extras.BitmapText from now on."),o.BitmapText}},blendModes:{get:function(){return console.warn("The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on."),n.BLEND_MODES}},scaleModes:{get:function(){return console.warn("The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on."),n.SCALE_MODES}},BaseTextureCache:{get:function(){return console.warn("The BaseTextureCache class has been moved to utils.BaseTextureCache, please use utils.BaseTextureCache from now on."),n.utils.BaseTextureCache}},TextureCache:{get:function(){return console.warn("The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on."),n.utils.TextureCache}},math:{get:function(){return console.warn("The math namespace is deprecated, please access members already accessible on PIXI."),n}}}),n.Sprite.prototype.setTexture=function(t){this.texture=t,console.warn("setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;")},o.BitmapText.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myBitmapText.text = 'my text';")},n.Text.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myText.text = 'my text';")},n.Text.prototype.setStyle=function(t){this.style=t,console.warn("setStyle is now deprecated, please use the style property, e.g : myText.style = style;")},n.Texture.prototype.setFrame=function(t){this.frame=t,console.warn("setFrame is now deprecated, please use the frame property, e.g : myTexture.frame = frame;")},Object.defineProperties(s,{AbstractFilter:{get:function(){return console.warn("filters.AbstractFilter is an undocumented alias, please use AbstractFilter from now on."),n.AbstractFilter}},FXAAFilter:{get:function(){return console.warn("filters.FXAAFilter is an undocumented alias, please use FXAAFilter from now on."),n.FXAAFilter}},SpriteMaskFilter:{get:function(){return console.warn("filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on."),n.SpriteMaskFilter}}}),n.utils.uuid=function(){return console.warn("utils.uuid() is deprecated, please use utils.uid() from now on."),n.utils.uid()}},{"./core":29,"./extras":85,"./filters":102,"./mesh":126}],79:[function(t,e,r){function n(t,e){i.Container.call(this),e=e||{},this.textWidth=0,this.textHeight=0,this._glyphs=[],this._font={tint:void 0!==e.tint?e.tint:16777215,align:e.align||"left",name:null,size:0},this.font=e.font,this._text=t,this.maxWidth=0,this.dirty=!1,this.updateText()}var i=t("../core");n.prototype=Object.create(i.Container.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{tint:{get:function(){return this._font.tint},set:function(t){this._font.tint="number"==typeof t&&t>=0?t:16777215,this.dirty=!0}},align:{get:function(){return this._font.align},set:function(t){this._font.align=t||"left",this.dirty=!0}},font:{get:function(){return this._font},set:function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):n.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),n.prototype.updateText=function(){for(var t=n.fonts[this._font.name],e=new i.Point,r=null,o=[],s=0,a=0,l=[],u=0,h=this._font.size/t.size,c=-1,f=0;f0&&e.x*h>this.maxWidth)o.splice(c,f-c),f=c,c=-1,l.push(s),a=Math.max(a,s),u++,e.x=0,e.y+=t.lineHeight,r=null;else{var p=t.chars[d];p&&(r&&p.kerning[r]&&(e.x+=p.kerning[r]),o.push({texture:p.texture,line:u,charCode:d,position:new i.Point(e.x+p.xOffset,e.y+p.yOffset)}),s=e.x+(p.texture.width+p.xOffset),e.x+=p.xAdvance,r=d)}}l.push(s),a=Math.max(a,s);var g=[];for(f=0;u>=f;f++){var A=0;"right"===this._font.align?A=a-l[f]:"center"===this._font.align&&(A=(a-l[f])/2),g.push(A)}var v=o.length,m=this.tint;for(f=0;v>f;f++){var y=this._glyphs[f];y?y.texture=o[f].texture:(y=new i.Sprite(o[f].texture),this._glyphs.push(y)),y.position.x=(o[f].position.x+g[o[f].line])*h,y.position.y=o[f].position.y*h,y.scale.x=y.scale.y=h,y.tint=m,y.parent||this.addChild(y)}for(f=v;fe?this.loop?this._texture=this._textures[this._textures.length-1+e%this._textures.length]:(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this.loop||e=this._textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())},n.prototype.destroy=function(){this.stop(),i.Sprite.prototype.destroy.call(this)},n.fromFrames=function(t){for(var e=[],r=0;ry?y:t,t=t>w?w:t,t=t>C?C:t,r=m,r=r>x?x:r,r=r>E?E:r,r=r>b?b:r,e=v,e=y>e?y:e,e=w>e?w:e,e=C>e?C:e,n=m,n=x>n?x:n,n=E>n?E:n,n=b>n?b:n;var B=this._bounds;return B.x=t,B.width=e-t,B.y=r,B.height=n-r,this._currentBounds=B,B},n.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,o);var e,r=this._width,n=this._height,i=-r*this.anchor.x;return o.x>i&&o.xe&&o.y 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 vec2 p = mod( uv / ( pixelSize * 0.5 ), 2.0) - vec2(1.0);\n col = col * character(n, p);\n\n gl_FragColor = vec4(col, 1.0);\n}\n",{dimensions:{type:"4fv",value:new Float32Array([0,0,0,0])},pixelSize:{type:"1f",value:8}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{size:{get:function(){return this.uniforms.pixelSize.value},set:function(t){this.uniforms.pixelSize.value=t}}})},{"../../core":29}],87:[function(t,e,r){function n(){i.AbstractFilter.call(this),this.blurXFilter=new o,this.blurYFilter=new s,this.defaultFilter=new i.AbstractFilter}var i=t("../../core"),o=t("../blur/BlurXFilter"),s=t("../blur/BlurYFilter");n.prototype=Object.create(i.AbstractFilter.prototype), +n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager.getRenderTarget(!0);this.defaultFilter.applyFilter(t,e,r),this.blurXFilter.applyFilter(t,e,n),t.blendModeManager.setBlendMode(i.BLEND_MODES.SCREEN),this.blurYFilter.applyFilter(t,n,r),t.blendModeManager.setBlendMode(i.BLEND_MODES.NORMAL),t.filterManager.returnRenderTarget(n)},Object.defineProperties(n.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t}},blurX:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t}},blurY:{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t}}})},{"../../core":29,"../blur/BlurXFilter":90,"../blur/BlurYFilter":91}],88:[function(t,e,r){function n(t,e){i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform float strength;\nuniform float dirX;\nuniform float dirY;\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vBlurTexCoords[3];\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n\n vBlurTexCoords[0] = aTextureCoord + vec2( (0.004 * strength) * dirX, (0.004 * strength) * dirY );\n vBlurTexCoords[1] = aTextureCoord + vec2( (0.008 * strength) * dirX, (0.008 * strength) * dirY );\n vBlurTexCoords[2] = aTextureCoord + vec2( (0.012 * strength) * dirX, (0.012 * strength) * dirY );\n\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vBlurTexCoords[3];\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = vec4(0.0);\n\n gl_FragColor += texture2D(uSampler, vTextureCoord ) * 0.3989422804014327;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 0]) * 0.2419707245191454;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 1]) * 0.05399096651318985;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 2]) * 0.004431848411938341;\n}\n",{strength:{type:"1f",value:1},dirX:{type:"1f",value:t||0},dirY:{type:"1f",value:e||0}}),this.defaultFilter=new i.AbstractFilter,this.passes=1,this.dirX=t||0,this.dirY=e||0,this.strength=4}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r,n){var i=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.width/e.size.width),1===this.passes)t.filterManager.applyFilter(i,e,r,n);else{var o=t.filterManager.getRenderTarget(!0);t.filterManager.applyFilter(i,e,o,n);for(var s=0;s>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,l=(n>>16&255)/255,u=(n>>8&255)/255,h=(255&n)/255,c=[.3,.59,.11,0,0,o,s,a,t,0,l,u,h,e,0,o-l,s-u,a-h,0,0];this._loadMatrix(c,i)},n.prototype.night=function(t,e){t=t||.1;var r=[-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},n.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)},n.prototype.lsd=function(t){var e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(e,t)},n.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)},Object.defineProperties(n.prototype,{matrix:{get:function(){return this.uniforms.m.value},set:function(t){this.uniforms.m.value=t}}})},{"../../core":29}],94:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float step;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n color = floor(color * step) / step;\n\n gl_FragColor = color;\n}\n",{step:{type:"1f",value:5}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{step:{get:function(){return this.uniforms.step.value},set:function(t){this.uniforms.step.value=t}}})},{"../../core":29}],95:[function(t,e,r){function n(t,e,r){i.AbstractFilter.call(this,null,"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",{matrix:{type:"1fv",value:new Float32Array(t)},texelSize:{type:"v2",value:{x:1/e,y:1/r}}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{matrix:{get:function(){return this.uniforms.matrix.value},set:function(t){this.uniforms.matrix.value=new Float32Array(t)}},width:{get:function(){return 1/this.uniforms.texelSize.value.x},set:function(t){this.uniforms.texelSize.value.x=1/t}},height:{get:function(){return 1/this.uniforms.texelSize.value.y},set:function(t){this.uniforms.texelSize.value.y=1/t}}})},{"../../core":29}],96:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"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")}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n},{"../../core":29}],97:[function(t,e,r){function n(t){var e=new i.Matrix;t.renderable=!1,i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMapCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec2 scale;\n\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nvoid main(void)\n{\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 map = texture2D(mapSampler, vMapCoord);\n\n map -= 0.5;\n map.xy *= scale;\n\n gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y));\n}\n",{mapSampler:{type:"sampler2D",value:t.texture},otherMatrix:{type:"mat3",value:e.toArray(!0)},scale:{type:"v2",value:{x:1,y:1}}}),this.maskSprite=t,this.maskMatrix=e,this.scale=new i.Point(20,20)}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager;n.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.scale.value.x=this.scale.x*(1/e.frame.width),this.uniforms.scale.value.y=this.scale.y*(1/e.frame.height);var i=this.getShader(t);n.applyFilter(i,e,r)},Object.defineProperties(n.prototype,{map:{get:function(){return this.uniforms.mapSampler.value},set:function(t){this.uniforms.mapSampler.value=t}}})},{"../../core":29}],98:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 dimensions;\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 * dimensions.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",{scale:{type:"1f",value:1},angle:{type:"1f",value:5},dimensions:{type:"4fv",value:[0,0,0,0]}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{scale:{get:function(){return this.uniforms.scale.value},set:function(t){this.uniforms.scale.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},{"../../core":29}],99:[function(t,e,r){function n(){i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform float strength;\nuniform vec2 offset;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vBlurTexCoords[6];\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3((aVertexPosition+offset), 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n\n vBlurTexCoords[ 0] = aTextureCoord + vec2(0.0, -0.012 * strength);\n vBlurTexCoords[ 1] = aTextureCoord + vec2(0.0, -0.008 * strength);\n vBlurTexCoords[ 2] = aTextureCoord + vec2(0.0, -0.004 * strength);\n vBlurTexCoords[ 3] = aTextureCoord + vec2(0.0, 0.004 * strength);\n vBlurTexCoords[ 4] = aTextureCoord + vec2(0.0, 0.008 * strength);\n vBlurTexCoords[ 5] = aTextureCoord + vec2(0.0, 0.012 * strength);\n\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vBlurTexCoords[6];\nvarying vec4 vColor;\n\nuniform vec3 color;\nuniform float alpha;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n vec4 sum = vec4(0.0);\n\n sum += texture2D(uSampler, vBlurTexCoords[ 0])*0.004431848411938341;\n sum += texture2D(uSampler, vBlurTexCoords[ 1])*0.05399096651318985;\n sum += texture2D(uSampler, vBlurTexCoords[ 2])*0.2419707245191454;\n sum += texture2D(uSampler, vTextureCoord )*0.3989422804014327;\n sum += texture2D(uSampler, vBlurTexCoords[ 3])*0.2419707245191454;\n sum += texture2D(uSampler, vBlurTexCoords[ 4])*0.05399096651318985;\n sum += texture2D(uSampler, vBlurTexCoords[ 5])*0.004431848411938341;\n\n gl_FragColor = vec4( color.rgb * sum.a * alpha, sum.a * alpha );\n}\n",{blur:{type:"1f",value:1/512},color:{type:"c",value:[0,0,0]},alpha:{type:"1f",value:.7},offset:{type:"2f",value:[5,5]},strength:{type:"1f",value:1}}),this.passes=1,this.strength=4}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r,n){var i=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.height/e.size.height),1===this.passes)t.filterManager.applyFilter(i,e,r,n);else{for(var o=t.filterManager.getRenderTarget(!0),s=e,a=o,l=0;l= (time - params.z)) )\n {\n float diff = (dist - time);\n float powDiff = 1.0 - pow(abs(diff*params.x), params.y);\n\n float diffTime = diff * powDiff;\n vec2 diffUV = normalize(uv - center);\n texCoord = uv + (diffUV * diffTime);\n }\n\n gl_FragColor = texture2D(uSampler, texCoord);\n}\n",{center:{type:"v2",value:{x:.5,y:.5}},params:{type:"v3",value:{x:10,y:.8,z:.1}},time:{type:"1f",value:0}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{center:{get:function(){return this.uniforms.center.value},set:function(t){this.uniforms.center.value=t}},params:{get:function(){return this.uniforms.params.value},set:function(t){this.uniforms.params.value=t}},time:{get:function(){return this.uniforms.time.value},set:function(t){this.uniforms.time.value=t}}})},{"../../core":29}],110:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying 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 gl_FragColor = color / total;\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n}\n",{blur:{type:"1f",value:100},gradientBlur:{type:"1f",value:600},start:{type:"v2",value:{x:0,y:window.innerHeight/2}},end:{type:"v2",value:{x:600,y:window.innerHeight/2}},delta:{type:"v2",value:{x:30,y:30}},texSize:{type:"v2",value:{x:window.innerWidth,y:window.innerHeight}}}),this.updateDelta()}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.updateDelta=function(){this.uniforms.delta.value.x=0,this.uniforms.delta.value.y=0},Object.defineProperties(n.prototype,{blur:{get:function(){return this.uniforms.blur.value},set:function(t){this.uniforms.blur.value=t}},gradientBlur:{get:function(){return this.uniforms.gradientBlur.value},set:function(t){this.uniforms.gradientBlur.value=t}},start:{get:function(){return this.uniforms.start.value},set:function(t){this.uniforms.start.value=t,this.updateDelta()}},end:{get:function(){return this.uniforms.end.value},set:function(t){this.uniforms.end.value=t,this.updateDelta()}}})},{"../../core":29}],111:[function(t,e,r){function n(){i.AbstractFilter.call(this),this.tiltShiftXFilter=new o,this.tiltShiftYFilter=new s}var i=t("../../core"),o=t("./TiltShiftXFilter"),s=t("./TiltShiftYFilter");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.applyFilter=function(t,e,r){var n=t.filterManager.getRenderTarget(!0);this.tiltShiftXFilter.applyFilter(t,e,n),this.tiltShiftYFilter.applyFilter(t,n,r),t.filterManager.returnRenderTarget(n)},Object.defineProperties(n.prototype,{blur:{get:function(){return this.tiltShiftXFilter.blur},set:function(t){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=t}},gradientBlur:{get:function(){return this.tiltShiftXFilter.gradientBlur},set:function(t){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=t}},start:{get:function(){return this.tiltShiftXFilter.start},set:function(t){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=t}},end:{get:function(){return this.tiltShiftXFilter.end},set:function(t){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=t}}})},{"../../core":29,"./TiltShiftXFilter":112,"./TiltShiftYFilter":113}],112:[function(t,e,r){function n(){i.call(this)}var i=t("./TiltShiftAxisFilter");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=t/r,this.uniforms.delta.value.y=e/r}},{"./TiltShiftAxisFilter":110}],113:[function(t,e,r){function n(){i.call(this)}var i=t("./TiltShiftAxisFilter");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=-e/r,this.uniforms.delta.value.y=t/r}},{"./TiltShiftAxisFilter":110}],114:[function(t,e,r){function n(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord - offset;\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratio = (radius - dist) / radius;\n float angleMod = ratio * ratio * 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 gl_FragColor = texture2D(uSampler, coord+offset);\n}\n",{radius:{type:"1f",value:.5},angle:{type:"1f",value:5},offset:{type:"v2",value:{x:.5,y:.5}}})}var i=t("../../core");n.prototype=Object.create(i.AbstractFilter.prototype),n.prototype.constructor=n,e.exports=n,Object.defineProperties(n.prototype,{offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}},radius:{get:function(){return this.uniforms.radius.value},set:function(t){this.uniforms.radius.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},{"../../core":29}],115:[function(t,e,r){function n(){this.global=new i.Point,this.target=null,this.originalEvent=null}var i=t("../core");n.prototype.constructor=n,e.exports=n,n.prototype.getLocalPosition=function(t,e,r){var n=t.worldTransform,o=r?r:this.global,s=n.a,a=n.c,l=n.tx,u=n.b,h=n.d,c=n.ty,f=1/(s*h+a*-u);return e=e||new i.Point,e.x=h*f*o.x+-a*f*o.x+(c*a-l*h)*f,e.y=s*f*o.y+-u*f*o.y+(-c*s+l*u)*f,e}},{"../core":29}],116:[function(t,e,r){function n(t,e){e=e||{},this.renderer=t,this.autoPreventDefault=void 0!==e.autoPreventDefault?e.autoPreventDefault:!0,this.interactionFrequency=e.interactionFrequency||10,this.mouse=new o,this.eventData={stopped:!1,target:null,type:null,data:this.mouse,stopPropagation:function(){this.stopped=!0}},this.interactiveDataPool=[],this.interactionDOMElement=null,this.eventsAdded=!1,this.onMouseUp=this.onMouseUp.bind(this),this.processMouseUp=this.processMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.processMouseDown=this.processMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.processMouseMove=this.processMouseMove.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.processMouseOverOut=this.processMouseOverOut.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.processTouchStart=this.processTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.processTouchEnd=this.processTouchEnd.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.processTouchMove=this.processTouchMove.bind(this),this.last=0,this.currentCursorStyle="inherit",this._tempPoint=new i.Point,this.resolution=1,this.setTargetElement(this.renderer.view,this.renderer.resolution)}var i=t("../core"),o=t("./InteractionData");Object.assign(i.DisplayObject.prototype,t("./interactiveTarget")),n.prototype.constructor=n,e.exports=n,n.prototype.setTargetElement=function(t,e){this.removeEvents(),this.interactionDOMElement=t,this.resolution=e||1,this.addEvents()},n.prototype.addEvents=function(){this.interactionDOMElement&&(i.ticker.shared.add(this.update,this),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"),window.document.addEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.addEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.addEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!0)},n.prototype.removeEvents=function(){this.interactionDOMElement&&(i.ticker.shared.remove(this.update),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""),window.document.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!1)},n.prototype.update=function(t){if(this._deltaTime+=t,!(this._deltaTime=0;a--)!s&&n?s=this.processInteractive(t,o[a],r,!0,i):this.processInteractive(t,o[a],r,!1,!1);return i&&(n&&(e.hitArea?(e.worldTransform.applyInverse(t,this._tempPoint),s=e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)):e.containsPoint&&(s=e.containsPoint(t))),e.interactive&&r(e,s)),s},n.prototype.onMouseDown=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.autoPreventDefault&&this.mouse.originalEvent.preventDefault(),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseDown,!0)},n.prototype.processMouseDown=function(t,e){var r=this.mouse.originalEvent,n=2===r.button||3===r.which;e&&(t[n?"_isRightDown":"_isLeftDown"]=!0,this.dispatchEvent(t,n?"rightdown":"mousedown",this.eventData))},n.prototype.onMouseUp=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseUp,!0)},n.prototype.processMouseUp=function(t,e){var r=this.mouse.originalEvent,n=2===r.button||3===r.which,i=n?"_isRightDown":"_isLeftDown";e?(this.dispatchEvent(t,n?"rightup":"mouseup",this.eventData),t[i]&&(t[i]=!1,this.dispatchEvent(t,n?"rightclick":"click",this.eventData))):t[i]&&(t[i]=!1,this.dispatchEvent(t,n?"rightupoutside":"mouseupoutside",this.eventData))},n.prototype.onMouseMove=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.didMove=!0,this.cursor="inherit",this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseMove,!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor)},n.prototype.processMouseMove=function(t,e){this.dispatchEvent(t,"mousemove",this.eventData),this.processMouseOverOut(t,e)},n.prototype.onMouseOut=function(t){this.mouse.originalEvent=t,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.interactionDOMElement.style.cursor="inherit",this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut,!1)},n.prototype.processMouseOverOut=function(t,e){e?(t._over||(t._over=!0,this.dispatchEvent(t,"mouseover",this.eventData)),t.buttonMode&&(this.cursor=t.defaultCursor)):t._over&&(t._over=!1,this.dispatchEvent(t,"mouseout",this.eventData))},n.prototype.onTouchStart=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,n=0;r>n;n++){var i=e[n],o=this.getTouchData(i);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchStart,!0),this.returnTouchData(o)}},n.prototype.processTouchStart=function(t,e){e&&(t._touchDown=!0,this.dispatchEvent(t,"touchstart",this.eventData))},n.prototype.onTouchEnd=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,n=0;r>n;n++){var i=e[n],o=this.getTouchData(i);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchEnd,!0),this.returnTouchData(o)}},n.prototype.processTouchEnd=function(t,e){e?(this.dispatchEvent(t,"touchend",this.eventData),t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"tap",this.eventData))):t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"touchendoutside",this.eventData))},n.prototype.onTouchMove=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,n=0;r>n;n++){var i=e[n],o=this.getTouchData(i);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchMove,!1),this.returnTouchData(o)}},n.prototype.processTouchMove=function(t,e){e=e,this.dispatchEvent(t,"touchmove",this.eventData)},n.prototype.getTouchData=function(t){var e=this.interactiveDataPool.pop();return e||(e=new o),e.identifier=t.identifier,this.mapPositionToPoint(e.global,t.clientX,t.clientY),navigator.isCocoonJS&&(e.global.x=e.global.x/this.resolution,e.global.y=e.global.y/this.resolution),t.globalX=e.global.x,t.globalY=e.global.y,e},n.prototype.returnTouchData=function(t){this.interactiveDataPool.push(t)},n.prototype.destroy=function(){this.removeEvents(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactiveDataPool=null,this.interactionDOMElement=null,this.onMouseUp=null,this.processMouseUp=null,this.onMouseDown=null,this.processMouseDown=null,this.onMouseMove=null,this.processMouseMove=null,this.onMouseOut=null,this.processMouseOverOut=null,this.onTouchStart=null,this.processTouchStart=null,this.onTouchEnd=null,this.processTouchEnd=null,this.onTouchMove=null,this.processTouchMove=null,this._tempPoint=null},i.WebGLRenderer.registerPlugin("interaction",n),i.CanvasRenderer.registerPlugin("interaction",n)},{"../core":29,"./InteractionData":115,"./interactiveTarget":118}],117:[function(t,e,r){e.exports={InteractionData:t("./InteractionData"),InteractionManager:t("./InteractionManager"),interactiveTarget:t("./interactiveTarget")}},{"./InteractionData":115,"./InteractionManager":116,"./interactiveTarget":118}],118:[function(t,e,r){var n={interactive:!1,buttonMode:!1,interactiveChildren:!0,defaultCursor:"pointer",_over:!1,_touchDown:!1};e.exports=n},{}],119:[function(t,e,r){function n(t,e){var r={},n=t.data.getElementsByTagName("info")[0],i=t.data.getElementsByTagName("common")[0];r.font=n.getAttribute("face"),r.size=parseInt(n.getAttribute("size"),10),r.lineHeight=parseInt(i.getAttribute("lineHeight"),10),r.chars={};for(var a=t.data.getElementsByTagName("char"),l=0;li;i++){var o=2*i;this._renderCanvasDrawTriangle(t,e,r,o,o+2,o+4)}},n.prototype._renderCanvasTriangles=function(t){for(var e=this.vertices,r=this.uvs,n=this.indices,i=n.length,o=0;i>o;o+=3){var s=2*n[o],a=2*n[o+1],l=2*n[o+2];this._renderCanvasDrawTriangle(t,e,r,s,a,l)}},n.prototype._renderCanvasDrawTriangle=function(t,e,r,n,i,o){var s=this._texture.baseTexture.source,a=this._texture.baseTexture.width,l=this._texture.baseTexture.height,u=e[n],h=e[i],c=e[o],f=e[n+1],d=e[i+1],p=e[o+1],g=r[n]*a,A=r[i]*a,v=r[o]*a,m=r[n+1]*l,y=r[i+1]*l,x=r[o+1]*l;if(this.canvasPadding>0){var w=this.canvasPadding/this.worldTransform.a,E=this.canvasPadding/this.worldTransform.d,C=(u+h+c)/3,b=(f+d+p)/3,B=u-C,T=f-b,D=Math.sqrt(B*B+T*T);u=C+B/D*(D+w),f=b+T/D*(D+E),B=h-C,T=d-b,D=Math.sqrt(B*B+T*T),h=C+B/D*(D+w),d=b+T/D*(D+E),B=c-C,T=p-b,D=Math.sqrt(B*B+T*T),c=C+B/D*(D+w),p=b+T/D*(D+E)}t.save(),t.beginPath(),t.moveTo(u,f),t.lineTo(h,d),t.lineTo(c,p),t.closePath(),t.clip();var M=g*y+m*v+A*x-y*v-m*A-g*x,P=u*y+m*c+h*x-y*c-m*h-u*x,R=g*h+u*v+A*c-h*v-u*A-g*c,I=g*y*c+m*h*v+u*A*x-u*y*v-m*A*c-g*h*x,S=f*y+m*p+d*x-y*p-m*d-f*x,O=g*d+f*v+A*p-d*v-f*A-g*p,F=g*y*p+m*d*v+f*A*x-f*y*v-m*A*p-g*d*x;t.transform(P/M,S/M,R/M,O/M,I/M,F/M),t.drawImage(s,0,0),t.restore()},n.prototype.renderMeshFlat=function(t){var e=this.context,r=t.vertices,n=r.length/2;e.beginPath();for(var i=1;n-2>i;i++){var o=2*i,s=r[o],a=r[o+2],l=r[o+4],u=r[o+1],h=r[o+3],c=r[o+5];e.moveTo(s,u),e.lineTo(a,h),e.lineTo(l,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},n.prototype._onTextureUpdate=function(){this.updateFrame=!0},n.prototype.getBounds=function(t){if(!this._currentBounds){for(var e=t||this.worldTransform,r=e.a,n=e.b,o=e.c,s=e.d,a=e.tx,l=e.ty,u=-(1/0),h=-(1/0),c=1/0,f=1/0,d=this.vertices,p=0,g=d.length;g>p;p+=2){var A=d[p],v=d[p+1],m=r*A+o*v+a,y=s*v+n*A+l;c=c>m?m:c,f=f>y?y:f,u=m>u?m:u,h=y>h?y:h}if(c===-(1/0)||h===1/0)return i.Rectangle.EMPTY;var x=this._bounds;x.x=c,x.width=u-c,x.y=f,x.height=h-f,this._currentBounds=x}return this._currentBounds},n.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,o);var e,r,i=this.vertices,a=s.points;if(this.drawMode===n.DRAW_MODES.TRIANGLES){var l=this.indices;for(r=this.indices.length,e=0;r>e;e+=3){var u=2*l[e],h=2*l[e+1],c=2*l[e+2];if(a[0]=i[u],a[1]=i[u+1],a[2]=i[h],a[3]=i[h+1],a[4]=i[c],a[5]=i[c+1],s.contains(o.x,o.y))return!0}}else for(r=i.length,e=0;r>e;e+=6)if(a[0]=i[e],a[1]=i[e+1],a[2]=i[e+2],a[3]=i[e+3],a[4]=i[e+4],a[5]=i[e+5],s.contains(o.x,o.y))return!0;return!1},n.DRAW_MODES={TRIANGLE_MESH:0,TRIANGLES:1}},{"../core":29}],125:[function(t,e,r){function n(t,e){i.call(this,t),this.points=e,this.vertices=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length), +this.indices=new Uint16Array(2*e.length),this._ready=!0,this.refresh()}var i=t("./Mesh"),o=t("../core");n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e.exports=n,n.prototype.refresh=function(){var t=this.points;if(!(t.length<1)&&this._texture._uvs){var e=this.uvs,r=this.indices,n=this.colors,i=this._texture._uvs,s=new o.Point(i.x0,i.y0),a=new o.Point(i.x2-i.x0,i.y2-i.y0);e[0]=0+s.x,e[1]=0+s.y,e[2]=0+s.x,e[3]=1*a.y+s.y,n[0]=1,n[1]=1,r[0]=0,r[1]=1;for(var l,u,h,c=t.length,f=1;c>f;f++)l=t[f],u=4*f,h=f/(c-1),e[u]=h*a.x+s.x,e[u+1]=0+s.y,e[u+2]=h*a.x+s.x,e[u+3]=1*a.y+s.y,u=2*f,n[u]=1,n[u+1]=1,u=2*f,r[u]=u,r[u+1]=u+1;this.dirty=!0}},n.prototype._onTextureUpdate=function(){i.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()},n.prototype.updateTransform=function(){var t=this.points;if(!(t.length<1)){for(var e,r,n,i,o,s,a=t[0],l=0,u=0,h=this.vertices,c=t.length,f=0;c>f;f++)r=t[f],n=4*f,e=f1&&(i=1),o=Math.sqrt(l*l+u*u),s=this._texture.height/2,l/=o,u/=o,l*=s,u*=s,h[n]=r.x+l,h[n+1]=r.y+u,h[n+2]=r.x-l,h[n+3]=r.y-u,a=r;this.containerUpdateTransform()}}},{"../core":29,"./Mesh":124}],126:[function(t,e,r){e.exports={Mesh:t("./Mesh"),Rope:t("./Rope"),MeshRenderer:t("./webgl/MeshRenderer"),MeshShader:t("./webgl/MeshShader")}},{"./Mesh":124,"./Rope":125,"./webgl/MeshRenderer":127,"./webgl/MeshShader":128}],127:[function(t,e,r){function n(t){i.ObjectRenderer.call(this,t),this.indices=new Uint16Array(15e3);for(var e=0,r=0;15e3>e;e+=6,r+=4)this.indices[e+0]=r+0,this.indices[e+1]=r+1,this.indices[e+2]=r+2,this.indices[e+3]=r+0,this.indices[e+4]=r+2,this.indices[e+5]=r+3}var i=t("../../core"),o=t("../Mesh");n.prototype=Object.create(i.ObjectRenderer.prototype),n.prototype.constructor=n,e.exports=n,i.WebGLRenderer.registerPlugin("mesh",n),n.prototype.onContextChange=function(){},n.prototype.render=function(t){t._vertexBuffer||this._initWebGL(t);var e=this.renderer,r=e.gl,n=t._texture.baseTexture,i=e.shaderManager.plugins.meshShader,s=t.drawMode===o.DRAW_MODES.TRIANGLE_MESH?r.TRIANGLE_STRIP:r.TRIANGLES;e.blendModeManager.setBlendMode(t.blendMode),r.uniformMatrix3fv(i.uniforms.translationMatrix._location,!1,t.worldTransform.toArray(!0)),r.uniformMatrix3fv(i.uniforms.projectionMatrix._location,!1,e.currentRenderTarget.projectionMatrix.toArray(!0)),r.uniform1f(i.uniforms.alpha._location,t.worldAlpha),t.dirty?(t.dirty=!1,r.bindBuffer(r.ARRAY_BUFFER,t._vertexBuffer),r.bufferData(r.ARRAY_BUFFER,t.vertices,r.STATIC_DRAW),r.vertexAttribPointer(i.attributes.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,t._uvBuffer),r.bufferData(r.ARRAY_BUFFER,t.uvs,r.STATIC_DRAW),r.vertexAttribPointer(i.attributes.aTextureCoord,2,r.FLOAT,!1,0,0),r.activeTexture(r.TEXTURE0),n._glTextures[r.id]?r.bindTexture(r.TEXTURE_2D,n._glTextures[r.id]):this.renderer.updateTexture(n),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._indexBuffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.indices,r.STATIC_DRAW)):(r.bindBuffer(r.ARRAY_BUFFER,t._vertexBuffer),r.bufferSubData(r.ARRAY_BUFFER,0,t.vertices),r.vertexAttribPointer(i.attributes.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,t._uvBuffer),r.vertexAttribPointer(i.attributes.aTextureCoord,2,r.FLOAT,!1,0,0),r.activeTexture(r.TEXTURE0),n._glTextures[r.id]?r.bindTexture(r.TEXTURE_2D,n._glTextures[r.id]):this.renderer.updateTexture(n),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._indexBuffer),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,t.indices)),r.drawElements(s,t.indices.length,r.UNSIGNED_SHORT,0)},n.prototype._initWebGL=function(t){var e=this.renderer.gl;t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.vertices,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),t.colors&&(t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW)),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},n.prototype.flush=function(){},n.prototype.start=function(){var t=this.renderer.shaderManager.plugins.meshShader;this.renderer.shaderManager.setShader(t)},n.prototype.destroy=function(){}},{"../../core":29,"../Mesh":124}],128:[function(t,e,r){function n(t){i.Shader.call(this,t,["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * alpha ;","}"].join("\n"),{alpha:{type:"1f",value:0},translationMatrix:{type:"mat3",value:new Float32Array(9)},projectionMatrix:{type:"mat3",value:new Float32Array(9)}},{aVertexPosition:0,aTextureCoord:0})}var i=t("../../core");n.prototype=Object.create(i.Shader.prototype),n.prototype.constructor=n,e.exports=n,i.ShaderManager.registerPlugin("meshShader",n)},{"../../core":29}],129:[function(t,e,r){Object.assign||(Object.assign=t("object-assign"))},{"object-assign":12}],130:[function(t,e,r){t("./Object.assign"),t("./requestAnimationFrame")},{"./Object.assign":129,"./requestAnimationFrame":131}],131:[function(t,e,r){(function(t){if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var r=Date.now(),n=["ms","moz","webkit","o"],i=0;in&&(n=0),r=e,setTimeout(function(){r=Date.now(),t(performance.now())},n)}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.html2canvas=t()}}(function(){var t;return function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[s]={exports:{}};t[s][0].call(h.exports,function(e){var r=t[s][1][e];return i(r?r:e)},h,h.exports,e,t,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;st;t+=2){var e=rt[t],r=rt[t+1];e(r),rt[t]=void 0,rt[t+1]=void 0}V=0}function A(){try{var t=e,r=t("vertx");return J=r.runOnLoop||r.runOnContext,c()}catch(n){return p()}}function v(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function y(){return new TypeError("A promises callback cannot return that same promise.")}function x(t){try{return t.then}catch(e){return st.error=e,st}}function w(t,e,r,n){try{t.call(e,r,n)}catch(i){return i}}function E(t,e,r){Z(function(t){var n=!1,i=w(r,e,function(r){n||(n=!0,e!==r?B(t,r):D(t,r))},function(e){n||(n=!0,M(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&i&&(n=!0,M(t,i))},t)}function C(t,e){e._state===it?D(t,e._result):e._state===ot?M(t,e._result):P(e,void 0,function(e){B(t,e)},function(e){M(t,e)})}function b(t,e){if(e.constructor===t.constructor)C(t,e);else{var r=x(e);r===st?M(t,st.error):void 0===r?D(t,e):s(r)?E(t,e,r):D(t,e)}}function B(t,e){t===e?M(t,m()):o(e)?b(t,e):D(t,e)}function T(t){t._onerror&&t._onerror(t._result),R(t)}function D(t,e){t._state===nt&&(t._result=e,t._state=it,0!==t._subscribers.length&&Z(R,t))}function M(t,e){t._state===nt&&(t._state=ot,t._result=e,Z(T,t))}function P(t,e,r,n){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+it]=r,i[o+ot]=n,0===o&&t._state&&Z(R,t)}function R(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n,i,o=t._result,s=0;ss;s++)P(n.resolve(t[s]),void 0,e,r);return i}function H(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(v);return B(r,t),r}function k(t){var e=this,r=new e(v);return M(r,t),r}function G(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Y(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function j(t){this._id=dt++,this._state=void 0,this._result=void 0,this._subscribers=[],v!==t&&(s(t)||G(),this instanceof j||Y(),F(this,t))}function z(){var t;if("undefined"!=typeof i)t=i;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=t.Promise;(!r||"[object Promise]"!==Object.prototype.toString.call(r.resolve())||r.cast)&&(t.Promise=pt)}var U;U=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var J,X,W,K=U,V=0,Z=({}.toString,function(t,e){rt[V]=t,rt[V+1]=e,V+=2,2===V&&(X?X(g):W())}),q="undefined"!=typeof window?window:void 0,_=q||{},$=_.MutationObserver||_.WebKitMutationObserver,tt="undefined"!=typeof n&&"[object process]"==={}.toString.call(n),et="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,rt=new Array(1e3);W=tt?h():$?f():et?d():void 0===q&&"function"==typeof e?A():p();var nt=void 0,it=1,ot=2,st=new I,at=new I;Q.prototype._validateInput=function(t){return K(t)},Q.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},Q.prototype._init=function(){this._result=new Array(this.length)};var lt=Q;Q.prototype._enumerate=function(){for(var t=this,e=t.length,r=t.promise,n=t._input,i=0;r._state===nt&&e>i;i++)t._eachEntry(n[i],i)},Q.prototype._eachEntry=function(t,e){var r=this,n=r._instanceConstructor;a(t)?t.constructor===n&&t._state!==nt?(t._onerror=null,r._settledAt(t._state,e,t._result)):r._willSettleAt(n.resolve(t),e):(r._remaining--,r._result[e]=t)},Q.prototype._settledAt=function(t,e,r){var n=this,i=n.promise;i._state===nt&&(n._remaining--,t===ot?M(i,r):n._result[e]=r),0===n._remaining&&D(i,n._result)},Q.prototype._willSettleAt=function(t,e){var r=this;P(t,void 0,function(t){r._settledAt(it,e,t)},function(t){r._settledAt(ot,e,t)})};var ut=L,ht=N,ct=H,ft=k,dt=0,pt=j;j.all=ut,j.race=ht,j.resolve=ct,j.reject=ft,j._setScheduler=l,j._setAsap=u,j._asap=Z,j.prototype={constructor:j,then:function(t,e){var r=this,n=r._state;if(n===it&&!t||n===ot&&!e)return this;var i=new this.constructor(v),o=r._result;if(n){var s=arguments[n-1];Z(function(){O(n,i,s,o)})}else P(r,i,t,e);return i},"catch":function(t){return this.then(null,t)}};var gt=z,At={Promise:pt,polyfill:gt};"function"==typeof t&&t.amd?t(function(){return At}):"undefined"!=typeof r&&r.exports?r.exports=At:"undefined"!=typeof this&&(this.ES6Promise=At),gt()}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:2}],2:[function(t,e,r){function n(){h=!1,a.length?u=a.concat(u):c=-1,u.length&&i()}function i(){if(!h){var t=setTimeout(n);h=!0;for(var e=u.length;e;){for(a=u,u=[];++c1)for(var r=1;r1&&(n=r[0]+"@",t=r[1]),t=t.replace(O,".");var i=t.split("."),o=s(i,e).join(".");return n+o}function l(t){for(var e,r,n=[],i=0,o=t.length;o>i;)e=t.charCodeAt(i++),e>=55296&&56319>=e&&o>i?(r=t.charCodeAt(i++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--)):n.push(e);return n}function u(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=N(t>>>10&1023|55296),t=56320|1023&t),e+=N(t)}).join("")}function h(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:C}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?L(t/D):t>>1,t+=L(t/e);t>Q*B>>1;n+=C)t=L(t/Q);return L(n+(Q+1)*t/(t+T))}function d(t){var e,r,n,i,s,a,l,c,d,p,g=[],A=t.length,v=0,m=P,y=M;for(r=t.lastIndexOf(R),0>r&&(r=0),n=0;r>n;++n)t.charCodeAt(n)>=128&&o("not-basic"),g.push(t.charCodeAt(n));for(i=r>0?r+1:0;A>i;){for(s=v,a=1,l=C;i>=A&&o("invalid-input"),c=h(t.charCodeAt(i++)),(c>=C||c>L((E-v)/a))&&o("overflow"),v+=c*a,d=y>=l?b:l>=y+B?B:l-y,!(d>c);l+=C)p=C-d,a>L(E/p)&&o("overflow"),a*=p;e=g.length+1,y=f(v-s,e,0==s),L(v/e)>E-m&&o("overflow"),m+=L(v/e),v%=e,g.splice(v++,0,m)}return u(g)}function p(t){var e,r,n,i,s,a,u,h,d,p,g,A,v,m,y,x=[];for(t=l(t),A=t.length,e=P,r=0,s=M,a=0;A>a;++a)g=t[a],128>g&&x.push(N(g));for(n=i=x.length,i&&x.push(R);A>n;){for(u=E,a=0;A>a;++a)g=t[a],g>=e&&u>g&&(u=g);for(v=n+1,u-e>L((E-r)/v)&&o("overflow"),r+=(u-e)*v,e=u,a=0;A>a;++a)if(g=t[a],e>g&&++r>E&&o("overflow"),g==e){for(h=r,d=C;p=s>=d?b:d>=s+B?B:d-s,!(p>h);d+=C)y=h-p,m=C-p,x.push(N(c(p+y%m,0))),h=L(y/m);x.push(N(c(h,0))),s=f(r,v,n==i),r=0,++n}++r,++e}return x.join("")}function g(t){return a(t,function(t){return I.test(t)?d(t.slice(4).toLowerCase()):t})}function A(t){return a(t,function(t){return S.test(t)?"xn--"+p(t):t})}var v="object"==typeof n&&n&&!n.nodeType&&n,m="object"==typeof r&&r&&!r.nodeType&&r,y="object"==typeof e&&e;(y.global===y||y.window===y||y.self===y)&&(i=y);var x,w,E=2147483647,C=36,b=1,B=26,T=38,D=700,M=72,P=128,R="-",I=/^xn--/,S=/[^\x20-\x7E]/,O=/[\x2E\u3002\uFF0E\uFF61]/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Q=C-b,L=Math.floor,N=String.fromCharCode;if(x={version:"1.3.2",ucs2:{decode:l,encode:u},decode:d,encode:p,toASCII:A,toUnicode:g},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return x});else if(v&&m)if(r.exports==v)m.exports=x;else for(w in x)x.hasOwnProperty(w)&&(v[w]=x[w]);else i.punycode=x}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(t,e,r){function n(t,e,r){!t.defaultView||e===t.defaultView.pageXOffset&&r===t.defaultView.pageYOffset||t.defaultView.scrollTo(e,r)}function i(t,e){try{e&&(e.width=t.width,e.height=t.height,e.getContext("2d").putImageData(t.getContext("2d").getImageData(0,0,t.width,t.height),0,0))}catch(r){a("Unable to copy canvas content from",t,r)}}function o(t,e){for(var r=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),n=t.firstChild;n;)(e===!0||1!==n.nodeType||"SCRIPT"!==n.nodeName)&&r.appendChild(o(n,e)),n=n.nextSibling;return 1===t.nodeType&&"BODY"!==t.tagName&&(r._scrollTop=t.scrollTop,r._scrollLeft=t.scrollLeft,"CANVAS"===t.nodeName?i(t,r):("TEXTAREA"===t.nodeName||"SELECT"===t.nodeName)&&(r.value=t.value)),r}function s(t){if(1===t.nodeType){t.scrollTop=t._scrollTop,t.scrollLeft=t._scrollLeft;for(var e=t.firstChild;e;)s(e),e=e.nextSibling}}var a=t("./log"),l=t("./promise");e.exports=function(t,e,r,i,a,u,h){var c=o(t.documentElement,a.javascriptEnabled),f=e.createElement("iframe");return f.className="html2canvas-container",f.style.visibility="hidden",f.style.position="fixed",f.style.left="-10000px",f.style.top="0px",f.style.border="0",f.style.border="0",f.width=r,f.height=i,f.scrolling="no",e.body.appendChild(f),new l(function(e){var r=f.contentWindow.document;f.contentWindow.onload=f.onload=function(){var t=setInterval(function(){r.body.childNodes.length>0&&(s(r.documentElement),clearInterval(t),"view"===a.type&&(f.contentWindow.scrollTo(u,h),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||f.contentWindow.scrollY===h&&f.contentWindow.scrollX===u||(r.documentElement.style.top=-h+"px",r.documentElement.style.left=-u+"px",r.documentElement.style.position="absolute")),e(f))},50)},r.open(),r.write(""),n(t,u,h),r.replaceChild(r.adoptNode(c),r.documentElement),r.close()})}},{"./log":15,"./promise":18}],5:[function(t,e,r){function n(t){this.r=0,this.g=0,this.b=0,this.a=null;this.fromArray(t)||this.namedColor(t)||this.rgb(t)||this.rgba(t)||this.hex6(t)||this.hex3(t)}n.prototype.darken=function(t){var e=1-t;return new n([Math.round(this.r*e),Math.round(this.g*e),Math.round(this.b*e),this.a])},n.prototype.isTransparent=function(){return 0===this.a},n.prototype.isBlack=function(){return 0===this.r&&0===this.g&&0===this.b},n.prototype.fromArray=function(t){return Array.isArray(t)&&(this.r=Math.min(t[0],255),this.g=Math.min(t[1],255),this.b=Math.min(t[2],255),t.length>3&&(this.a=t[3])),Array.isArray(t)};var i=/^#([a-f0-9]{3})$/i;n.prototype.hex3=function(t){var e=null;return null!==(e=t.match(i))&&(this.r=parseInt(e[1][0]+e[1][0],16),this.g=parseInt(e[1][1]+e[1][1],16),this.b=parseInt(e[1][2]+e[1][2],16)),null!==e};var o=/^#([a-f0-9]{6})$/i;n.prototype.hex6=function(t){var e=null;return null!==(e=t.match(o))&&(this.r=parseInt(e[1].substring(0,2),16),this.g=parseInt(e[1].substring(2,4),16),this.b=parseInt(e[1].substring(4,6),16)),null!==e};var s=/^rgb\((\d{1,3}) *, *(\d{1,3}) *, *(\d{1,3})\)$/;n.prototype.rgb=function(t){var e=null;return null!==(e=t.match(s))&&(this.r=Number(e[1]),this.g=Number(e[2]),this.b=Number(e[3])),null!==e};var a=/^rgba\((\d{1,3}) *, *(\d{1,3}) *, *(\d{1,3}) *, *(\d+\.?\d*)\)$/;n.prototype.rgba=function(t){var e=null;return null!==(e=t.match(a))&&(this.r=Number(e[1]),this.g=Number(e[2]),this.b=Number(e[3]),this.a=Number(e[4])),null!==e},n.prototype.toString=function(){return null!==this.a&&1!==this.a?"rgba("+[this.r,this.g,this.b,this.a].join(",")+")":"rgb("+[this.r,this.g,this.b].join(",")+")"},n.prototype.namedColor=function(t){var e=l[t.toLowerCase()];if(e)this.r=e[0],this.g=e[1],this.b=e[2];else if("transparent"===t.toLowerCase())return this.r=this.g=this.b=this.a=0,!0;return!!e},n.prototype.isColor=!0;var l={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};e.exports=n},{}],6:[function(t,e,r){function n(t,e){var r=C++;if(e=e||{},e.logging&&(window.html2canvas.logging=!0,window.html2canvas.start=Date.now()),e.async="undefined"==typeof e.async?!0:e.async,e.allowTaint="undefined"==typeof e.allowTaint?!1:e.allowTaint,e.removeContainer="undefined"==typeof e.removeContainer?!0:e.removeContainer,e.javascriptEnabled="undefined"==typeof e.javascriptEnabled?!1:e.javascriptEnabled,e.imageTimeout="undefined"==typeof e.imageTimeout?1e4:e.imageTimeout,e.renderer="function"==typeof e.renderer?e.renderer:d,e.strict=!!e.strict,"string"==typeof t){if("string"!=typeof e.proxy)return c.reject("Proxy must be used when rendering url");var n=null!=e.width?e.width:window.innerWidth,s=null!=e.height?e.height:window.innerHeight;return x(h(t),e.proxy,document,n,s,e).then(function(t){return o(t.contentWindow.document.documentElement,t,e,n,s)})}var a=(void 0===t?[document.documentElement]:t.length?t:[t])[0];return a.setAttribute(E+r,r),i(a.ownerDocument,e,a.ownerDocument.defaultView.innerWidth,a.ownerDocument.defaultView.innerHeight,r).then(function(t){return"function"==typeof e.onrendered&&(v("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas"),e.onrendered(t)),t})}function i(t,e,r,n,i){return y(t,t,r,n,e,t.defaultView.pageXOffset,t.defaultView.pageYOffset).then(function(s){v("Document cloned");var a=E+i,l="["+a+"='"+i+"']";t.querySelector(l).removeAttribute(a);var u=s.contentWindow,h=u.document.querySelector(l);"0"===h.style.opacity&&"webgl"===h.getAttribute("renderer")?h.style.opacity=1:null;var f="function"==typeof e.onclone?c.resolve(e.onclone(u.document)):c.resolve(!0);return f.then(function(){return o(h,s,e,r,n)})})}function o(t,e,r,n,i){var o=e.contentWindow,h=new f(o.document),c=new p(r,h),d=w(t),A="view"===r.type?n:l(o.document),m="view"===r.type?i:u(o.document),y=new r.renderer(A,m,c,r,document),x=new g(t,y,h,c,r);return x.ready.then(function(){v("Finished rendering");var n;return"view"===r.type?n=a(y.canvas,{width:y.canvas.width,height:y.canvas.height,top:0,left:0,x:0,y:0}):t===o.document.body||t===o.document.documentElement||null!=r.canvas?n=y.canvas:(1!==window.devicePixelRatio&&(d.top=d.top*window.devicePixelRatio,d.left=d.left*window.devicePixelRatio,d.right=d.right*window.devicePixelRatio,d.bottom=d.bottom*window.devicePixelRatio),n=a(y.canvas,{width:null!=r.width?r.width:d.width,height:null!=r.height?r.height:d.height,top:d.top,left:d.left,x:o.pageXOffset,y:o.pageYOffset})),s(e,r),n})}function s(t,e){e.removeContainer&&(t.parentNode.removeChild(t),v("Cleaned up container"))}function a(t,e){var r=document.createElement("canvas"),n=Math.min(t.width-1,Math.max(0,e.left)),i=Math.min(t.width,Math.max(1,e.left+e.width)),o=Math.min(t.height-1,Math.max(0,e.top)),s=Math.min(t.height,Math.max(1,e.top+e.height));return r.width=e.width,r.height=e.height,v("Cropping canvas at:","left:",e.left,"top:",e.top,"width:",i-n,"height:",s-o),v("Resulting crop with width",e.width,"and height",e.height," with x",n,"and y",o),r.getContext("2d").drawImage(t,n,o,i-n,s-o,e.x,e.y,i-n,s-o),r}function l(t){return Math.max(Math.max(t.body.scrollWidth,t.documentElement.scrollWidth),Math.max(t.body.offsetWidth,t.documentElement.offsetWidth),Math.max(t.body.clientWidth,t.documentElement.clientWidth))}function u(t){return Math.max(Math.max(t.body.scrollHeight,t.documentElement.scrollHeight),Math.max(t.body.offsetHeight,t.documentElement.offsetHeight),Math.max(t.body.clientHeight,t.documentElement.clientHeight))}function h(t){var e=document.createElement("a");return e.href=t,e.href=e.href,e}var c=t("./promise"),f=t("./support"),d=t("./renderers/canvas"),p=t("./imageloader"),g=t("./nodeparser"),A=t("./nodecontainer"),v=t("./log"),m=t("./utils"),y=t("./clone"),x=t("./proxy").loadUrlDocument,w=m.getBounds,E="data-html2canvas-node",C=0;n.Promise=c,n.CanvasRenderer=d,n.NodeContainer=A,n.log=v,n.utils=m,e.exports="undefined"==typeof document||"function"!=typeof Object.create||"function"!=typeof document.createElement("canvas").getContext?function(){return c.reject("No canvas support")}:n},{"./clone":4,"./imageloader":13,"./log":15,"./nodecontainer":16,"./nodeparser":17,"./promise":18,"./proxy":19,"./renderers/canvas":23,"./support":25,"./utils":29}],7:[function(t,e,r){function n(t){if(this.src=t,o("DummyImageContainer for",t),!this.promise||!this.image){o("Initiating DummyImageContainer"),n.prototype.image=new Image;var e=this.image;n.prototype.promise=new i(function(t,r){e.onload=t,e.onerror=r,e.src=s(),e.complete===!0&&t(e)})}}var i=t("./promise"),o=t("./log"),s=t("./utils").smallImage;e.exports=n},{"./log":15,"./promise":18,"./utils":29}],8:[function(t,e,r){function n(t,e){var r,n,o=document.createElement("div"),s=document.createElement("img"),a=document.createElement("span"),l="Hidden Text";o.style.visibility="hidden",o.style.fontFamily=t,o.style.fontSize=e,o.style.margin=0,o.style.padding=0,document.body.appendChild(o),s.src=i(),s.width=1,s.height=1,s.style.margin=0,s.style.padding=0,s.style.verticalAlign="baseline",a.style.fontFamily=t,a.style.fontSize=e,a.style.margin=0,a.style.padding=0,a.appendChild(document.createTextNode(l)),o.appendChild(a),o.appendChild(s),r=s.offsetTop-a.offsetTop+1,o.removeChild(a),o.appendChild(document.createTextNode(l)),o.style.lineHeight="normal",s.style.verticalAlign="super",n=s.offsetTop-o.offsetTop+1,document.body.removeChild(o),this.baseline=r,this.lineWidth=1,this.middle=n}var i=t("./utils").smallImage;e.exports=n},{"./utils":29}],9:[function(t,e,r){function n(){this.data={}}var i=t("./font");n.prototype.getMetrics=function(t,e){return void 0===this.data[t+"-"+e]&&(this.data[t+"-"+e]=new i(t,e)),this.data[t+"-"+e]},e.exports=n},{"./font":8}],10:[function(t,e,r){function n(e,r,n){this.image=null,this.src=e;var i=this,a=s(e);this.promise=(r?new o(function(t){"about:blank"===e.contentWindow.document.URL||null==e.contentWindow.document.documentElement?e.contentWindow.onload=e.onload=function(){t(e)}:t(e)}):this.proxyLoad(n.proxy,a,n)).then(function(e){var r=t("./core");return r(e.contentWindow.document.documentElement,{type:"view",width:e.width,height:e.height,proxy:n.proxy,javascriptEnabled:n.javascriptEnabled,removeContainer:n.removeContainer,allowTaint:n.allowTaint,imageTimeout:n.imageTimeout/2})}).then(function(t){return i.image=t})}var i=t("./utils"),o=t("./promise"),s=i.getBounds,a=t("./proxy").loadUrlDocument;n.prototype.proxyLoad=function(t,e,r){var n=this.src;return a(n.src,t,n.ownerDocument,e.width,e.height,r)},e.exports=n},{"./core":6,"./promise":18,"./proxy":19,"./utils":29}],11:[function(t,e,r){function n(t){this.src=t.value,this.colorStops=[],this.type=null,this.x0=.5,this.y0=.5,this.x1=.5,this.y1=.5,this.promise=i.resolve(!0)}var i=t("./promise");n.prototype.TYPES={LINEAR:1,RADIAL:2},e.exports=n},{"./promise":18}],12:[function(t,e,r){function n(t,e){this.src=t,this.image=new Image;var r=this;this.tainted=null,this.promise=new i(function(n,i){r.image.onload=n,r.image.onerror=i,e&&(r.image.crossOrigin="anonymous"),r.image.src=t,r.image.complete===!0&&n(r.image)})}var i=t("./promise");e.exports=n},{"./promise":18}],13:[function(t,e,r){function n(t,e){this.link=null,this.options=t,this.support=e,this.origin=this.getOrigin(window.location.href)}var i=t("./promise"),o=t("./log"),s=t("./imagecontainer"),a=t("./dummyimagecontainer"),l=t("./proxyimagecontainer"),u=t("./framecontainer"),h=t("./svgcontainer"),c=t("./svgnodecontainer"),f=t("./lineargradientcontainer"),d=t("./webkitgradientcontainer"),p=t("./utils").bind; +n.prototype.findImages=function(t){var e=[];return t.reduce(function(t,e){switch(e.node.nodeName){case"IMG":return t.concat([{args:[e.node.src],method:"url"}]);case"svg":case"IFRAME":return t.concat([{args:[e.node],method:e.node.nodeName}])}return t},[]).forEach(this.addImage(e,this.loadImage),this),e},n.prototype.findBackgroundImage=function(t,e){return e.parseBackgroundImages().filter(this.hasImageBackground).forEach(this.addImage(t,this.loadImage),this),t},n.prototype.addImage=function(t,e){return function(r){r.args.forEach(function(n){this.imageExists(t,n)||(t.splice(0,0,e.call(this,r)),o("Added image #"+t.length,"string"==typeof n?n.substring(0,100):n))},this)}},n.prototype.hasImageBackground=function(t){return"none"!==t.method},n.prototype.loadImage=function(t){if("url"===t.method){var e=t.args[0];return!this.isSVG(e)||this.support.svg||this.options.allowTaint?e.match(/data:image\/.*;base64,/i)?new s(e.replace(/url\(['"]{0,}|['"]{0,}\)$/gi,""),!1):this.isSameOrigin(e)||this.options.allowTaint===!0||this.isSVG(e)?new s(e,!1):this.support.cors&&!this.options.allowTaint&&this.options.useCORS?new s(e,!0):this.options.proxy?new l(e,this.options.proxy):new a(e):new h(e)}return"linear-gradient"===t.method?new f(t):"gradient"===t.method?new d(t):"svg"===t.method?new c(t.args[0],this.support.svg):"IFRAME"===t.method?new u(t.args[0],this.isSameOrigin(t.args[0].src),this.options):new a(t)},n.prototype.isSVG=function(t){return"svg"===t.substring(t.length-3).toLowerCase()||h.prototype.isInline(t)},n.prototype.imageExists=function(t,e){return t.some(function(t){return t.src===e})},n.prototype.isSameOrigin=function(t){return this.getOrigin(t)===this.origin},n.prototype.getOrigin=function(t){var e=this.link||(this.link=document.createElement("a"));return e.href=t,e.href=e.href,e.protocol+e.hostname+e.port},n.prototype.getPromise=function(t){return this.timeout(t,this.options.imageTimeout)["catch"](function(){var e=new a(t.src);return e.promise.then(function(e){t.image=e})})},n.prototype.get=function(t){var e=null;return this.images.some(function(r){return(e=r).src===t})?e:null},n.prototype.fetch=function(t){return this.images=t.reduce(p(this.findBackgroundImage,this),this.findImages(t)),this.images.forEach(function(t,e){t.promise.then(function(){o("Succesfully loaded image #"+(e+1),t)},function(r){o("Failed loading image #"+(e+1),t,r)})}),this.ready=i.all(this.images.map(this.getPromise,this)),o("Finished searching images"),this},n.prototype.timeout=function(t,e){var r,n=i.race([t.promise,new i(function(n,i){r=setTimeout(function(){o("Timed out loading image",t),i(t)},e)})]).then(function(t){return clearTimeout(r),t});return n["catch"](function(){clearTimeout(r)}),n},e.exports=n},{"./dummyimagecontainer":7,"./framecontainer":10,"./imagecontainer":12,"./lineargradientcontainer":14,"./log":15,"./promise":18,"./proxyimagecontainer":20,"./svgcontainer":26,"./svgnodecontainer":27,"./utils":29,"./webkitgradientcontainer":30}],14:[function(t,e,r){function n(t){i.apply(this,arguments),this.type=this.TYPES.LINEAR;var e=null===t.args[0].match(this.stepRegExp);e?t.args[0].split(" ").reverse().forEach(function(t){switch(t){case"left":this.x0=0,this.x1=1;break;case"top":this.y0=0,this.y1=1;break;case"right":this.x0=1,this.x1=0;break;case"bottom":this.y0=1,this.y1=0;break;case"to":var e=this.y0,r=this.x0;this.y0=this.y1,this.x0=this.x1,this.x1=r,this.y1=e}},this):(this.y0=0,this.y1=1),this.colorStops=t.args.slice(e?1:0).map(function(t){var e=t.match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)|\w+)\s*(\d{1,3})?(%|px)?/);return{color:new o(e[1]),stop:"%"===e[3]?e[2]/100:null}},this),null===this.colorStops[0].stop&&(this.colorStops[0].stop=0),null===this.colorStops[this.colorStops.length-1].stop&&(this.colorStops[this.colorStops.length-1].stop=1),this.colorStops.forEach(function(t,e){null===t.stop&&this.colorStops.slice(e).some(function(r,n){return null!==r.stop?(t.stop=(r.stop-this.colorStops[e-1].stop)/(n+1)+this.colorStops[e-1].stop,!0):!1},this)},this)}var i=t("./gradientcontainer"),o=t("./color");n.prototype=Object.create(i.prototype),n.prototype.stepRegExp=/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/,e.exports=n},{"./color":5,"./gradientcontainer":11}],15:[function(t,e,r){e.exports=function(){window.html2canvas.logging&&window.console&&window.console.log&&Function.prototype.bind.call(window.console.log,window.console).apply(window.console,[Date.now()-window.html2canvas.start+"ms","html2canvas:"].concat([].slice.call(arguments,0)))}},{}],16:[function(t,e,r){function n(t,e){this.node=t,this.parent=e,this.stack=null,this.bounds=null,this.borders=null,this.clip=[],this.backgroundClip=[],this.offsetBounds=null,this.visible=null,this.computedStyles=null,this.colors={},this.styles={},this.backgroundImages=null,this.transformData=null,this.transformMatrix=null,this.isPseudoElement=!1,this.opacity=null}function i(t){var e=t.options[t.selectedIndex||0];return e?e.text||"":""}function o(t){if(t&&"matrix"===t[1])return t[2].split(",").map(function(t){return parseFloat(t.trim())});if(t&&"matrix3d"===t[1]){var e=t[2].split(",").map(function(t){return parseFloat(t.trim())});return[e[0],e[1],e[4],e[5],e[12],e[13]]}}function s(t){return-1!==t.toString().indexOf("%")}function a(t){return t.replace("px","")}function l(t){return parseFloat(t)}var u=t("./color"),h=t("./utils"),c=h.getBounds,f=h.parseBackgrounds,d=h.offsetBounds;n.prototype.cloneTo=function(t){t.visible=this.visible,t.borders=this.borders,t.bounds=this.bounds,t.clip=this.clip,t.backgroundClip=this.backgroundClip,t.computedStyles=this.computedStyles,t.styles=this.styles,t.backgroundImages=this.backgroundImages,t.opacity=this.opacity},n.prototype.getOpacity=function(){return null===this.opacity?this.opacity=this.cssFloat("opacity"):this.opacity},n.prototype.assignStack=function(t){this.stack=t,t.children.push(this)},n.prototype.isElementVisible=function(){return this.node.nodeType===Node.TEXT_NODE?this.parent.visible:"none"!==this.css("display")&&"hidden"!==this.css("visibility")&&!this.node.hasAttribute("data-html2canvas-ignore")&&("INPUT"!==this.node.nodeName||"hidden"!==this.node.getAttribute("type"))},n.prototype.css=function(t){return this.computedStyles||(this.computedStyles=this.isPseudoElement?this.parent.computedStyle(this.before?":before":":after"):this.computedStyle(null)),this.styles[t]||(this.styles[t]=this.computedStyles[t])},n.prototype.prefixedCss=function(t){var e=["webkit","moz","ms","o"],r=this.css(t);return void 0===r&&e.some(function(e){return r=this.css(e+t.substr(0,1).toUpperCase()+t.substr(1)),void 0!==r},this),void 0===r?null:r},n.prototype.computedStyle=function(t){return this.node.ownerDocument.defaultView.getComputedStyle(this.node,t)},n.prototype.cssInt=function(t){var e=parseInt(this.css(t),10);return isNaN(e)?0:e},n.prototype.color=function(t){return this.colors[t]||(this.colors[t]=new u(this.css(t)))},n.prototype.cssFloat=function(t){var e=parseFloat(this.css(t));return isNaN(e)?0:e},n.prototype.fontWeight=function(){var t=this.css("fontWeight");switch(parseInt(t,10)){case 401:t="bold";break;case 400:t="normal"}return t},n.prototype.parseClip=function(){var t=this.css("clip").match(this.CLIP);return t?{top:parseInt(t[1],10),right:parseInt(t[2],10),bottom:parseInt(t[3],10),left:parseInt(t[4],10)}:null},n.prototype.parseBackgroundImages=function(){return this.backgroundImages||(this.backgroundImages=f(this.css("backgroundImage")))},n.prototype.cssList=function(t,e){var r=(this.css(t)||"").split(",");return r=r[e||0]||r[0]||"auto",r=r.trim().split(" "),1===r.length&&(r=[r[0],s(r[0])?"auto":r[0]]),r},n.prototype.parseBackgroundSize=function(t,e,r){var n,i,o=this.cssList("backgroundSize",r);if(s(o[0]))n=t.width*parseFloat(o[0])/100;else{if(/contain|cover/.test(o[0])){var a=t.width/t.height,l=e.width/e.height;return l>a^"contain"===o[0]?{width:t.height*l,height:t.height}:{width:t.width,height:t.width/l}}n=parseInt(o[0],10)}return i="auto"===o[0]&&"auto"===o[1]?e.height:"auto"===o[1]?n/e.width*e.height:s(o[1])?t.height*parseFloat(o[1])/100:parseInt(o[1],10),"auto"===o[0]&&(n=i/e.height*e.width),{width:n,height:i}},n.prototype.parseBackgroundPosition=function(t,e,r,n){var i,o,a=this.cssList("backgroundPosition",r);return i=s(a[0])?(t.width-(n||e).width)*(parseFloat(a[0])/100):parseInt(a[0],10),o="auto"===a[1]?i/e.width*e.height:s(a[1])?(t.height-(n||e).height)*parseFloat(a[1])/100:parseInt(a[1],10),"auto"===a[0]&&(i=o/e.height*e.width),{left:i,top:o}},n.prototype.parseBackgroundRepeat=function(t){return this.cssList("backgroundRepeat",t)[0]},n.prototype.parseTextShadows=function(){var t=this.css("textShadow"),e=[];if(t&&"none"!==t)for(var r=t.match(this.TEXT_SHADOW_PROPERTY),n=0;r&&n0?(this.renderIndex=0,this.asyncRenderer(this.renderQueue,t)):t():(this.renderQueue.forEach(this.paint,this),t())},this))},this))}function i(t){return t.parent&&t.parent.clip.length}function o(t){return t.replace(/(\-[a-z])/g,function(t){return t.toUpperCase().replace("-","")})}function s(){}function a(t,e,r,n){return t.map(function(i,o){if(i.width>0){var s=e.left,a=e.top,l=e.width,u=e.height-t[2].width;switch(o){case 0:u=t[0].width,i.args=c({c1:[s,a],c2:[s+l,a],c3:[s+l-t[1].width,a+u],c4:[s+t[3].width,a+u]},n[0],n[1],r.topLeftOuter,r.topLeftInner,r.topRightOuter,r.topRightInner);break;case 1:s=e.left+e.width-t[1].width,l=t[1].width,i.args=c({c1:[s+l,a],c2:[s+l,a+u+t[2].width],c3:[s,a+u],c4:[s,a+t[0].width]},n[1],n[2],r.topRightOuter,r.topRightInner,r.bottomRightOuter,r.bottomRightInner);break;case 2:a=a+e.height-t[2].width,u=t[2].width,i.args=c({c1:[s+l,a+u],c2:[s,a+u],c3:[s+t[3].width,a],c4:[s+l-t[3].width,a]},n[2],n[3],r.bottomRightOuter,r.bottomRightInner,r.bottomLeftOuter,r.bottomLeftInner);break;case 3:l=t[3].width,i.args=c({c1:[s,a+u+t[2].width],c2:[s,a],c3:[s+l,a+t[0].width],c4:[s+l,a+u]},n[3],n[0],r.bottomLeftOuter,r.bottomLeftInner,r.topLeftOuter,r.topLeftInner)}}return i})}function l(t,e,r,n){var i=4*((Math.sqrt(2)-1)/3),o=r*i,s=n*i,a=t+r,l=e+n;return{topLeft:h({x:t,y:l},{x:t,y:l-s},{x:a-o,y:e},{x:a,y:e}),topRight:h({x:t,y:e},{x:t+o,y:e},{x:a,y:l-s},{x:a,y:l}),bottomRight:h({x:a,y:e},{x:a,y:e+s},{x:t+o,y:l},{x:t,y:l}),bottomLeft:h({x:a,y:l},{x:a-o,y:l},{x:t,y:e+s},{x:t,y:e})}}function u(t,e,r){var n=t.left,i=t.top,o=t.width,s=t.height,a=e[0][0],u=e[0][1],h=e[1][0],c=e[1][1],f=e[2][0],d=e[2][1],p=e[3][0],g=e[3][1],A=Math.floor(s/2);a=a>A?A:a,u=u>A?A:u,h=h>A?A:h,c=c>A?A:c,f=f>A?A:f,d=d>A?A:d,p=p>A?A:p,g=g>A?A:g;var v=o-h,m=s-d,y=o-f,x=s-g;return{topLeftOuter:l(n,i,a,u).topLeft.subdivide(.5),topLeftInner:l(n+r[3].width,i+r[0].width,Math.max(0,a-r[3].width),Math.max(0,u-r[0].width)).topLeft.subdivide(.5),topRightOuter:l(n+v,i,h,c).topRight.subdivide(.5),topRightInner:l(n+Math.min(v,o+r[3].width),i+r[0].width,v>o+r[3].width?0:h-r[3].width,c-r[0].width).topRight.subdivide(.5),bottomRightOuter:l(n+y,i+m,f,d).bottomRight.subdivide(.5),bottomRightInner:l(n+Math.min(y,o-r[3].width),i+Math.min(m,s+r[0].width),Math.max(0,f-r[1].width),d-r[2].width).bottomRight.subdivide(.5),bottomLeftOuter:l(n,i+x,p,g).bottomLeft.subdivide(.5),bottomLeftInner:l(n+r[3].width,i+x,Math.max(0,p-r[3].width),g-r[2].width).bottomLeft.subdivide(.5)}}function h(t,e,r,n){var i=function(t,e,r){return{x:t.x+(e.x-t.x)*r,y:t.y+(e.y-t.y)*r}};return{start:t,startControl:e,endControl:r,end:n,subdivide:function(o){var s=i(t,e,o),a=i(e,r,o),l=i(r,n,o),u=i(s,a,o),c=i(a,l,o),f=i(u,c,o);return[h(t,s,u,f),h(f,c,l,n)]},curveTo:function(t){t.push(["bezierCurve",e.x,e.y,r.x,r.y,n.x,n.y])},curveToReversed:function(n){n.push(["bezierCurve",r.x,r.y,e.x,e.y,t.x,t.y])}}}function c(t,e,r,n,i,o,s){var a=[];return e[0]>0||e[1]>0?(a.push(["line",n[1].start.x,n[1].start.y]),n[1].curveTo(a)):a.push(["line",t.c1[0],t.c1[1]]),r[0]>0||r[1]>0?(a.push(["line",o[0].start.x,o[0].start.y]),o[0].curveTo(a),a.push(["line",s[0].end.x,s[0].end.y]),s[0].curveToReversed(a)):(a.push(["line",t.c2[0],t.c2[1]]),a.push(["line",t.c3[0],t.c3[1]])),e[0]>0||e[1]>0?(a.push(["line",i[1].end.x,i[1].end.y]),i[1].curveToReversed(a)):a.push(["line",t.c4[0],t.c4[1]]),a}function f(t,e,r,n,i,o,s){e[0]>0||e[1]>0?(t.push(["line",n[0].start.x,n[0].start.y]),n[0].curveTo(t),n[1].curveTo(t)):t.push(["line",o,s]),(r[0]>0||r[1]>0)&&t.push(["line",i[0].start.x,i[0].start.y])}function d(t){return t.cssInt("zIndex")<0}function p(t){return t.cssInt("zIndex")>0}function g(t){return 0===t.cssInt("zIndex")}function A(t){return-1!==["inline","inline-block","inline-table"].indexOf(t.css("display"))}function v(t){return t instanceof K}function m(t){return t.node.data.trim().length>0}function y(t){return/^(normal|none|0px)$/.test(t.parent.css("letterSpacing"))}function x(t){return["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(e){var r=t.css("border"+e+"Radius"),n=r.split(" ");return n.length<=1&&(n[1]=n[0]),n.map(S)})}function w(t){return t.nodeType===Node.TEXT_NODE||t.nodeType===Node.ELEMENT_NODE}function E(t){var e=t.css("position"),r=-1!==["absolute","relative","fixed"].indexOf(e)?t.css("zIndex"):"auto";return"auto"!==r}function C(t){return"static"!==t.css("position")}function b(t){return"none"!==t.css("float")}function B(t){return-1!==["inline-block","inline-table"].indexOf(t.css("display"))}function T(t){var e=this;return function(){return!t.apply(e,arguments)}}function D(t){return t.node.nodeType===Node.ELEMENT_NODE}function M(t){return t.isPseudoElement===!0}function P(t){return t.node.nodeType===Node.TEXT_NODE}function R(t){return function(e,r){return e.cssInt("zIndex")+t.indexOf(e)/t.length-(r.cssInt("zIndex")+t.indexOf(r)/t.length)}}function I(t){return t.getOpacity()<1}function S(t){return parseInt(t,10)}function O(t){return t.width}function F(t){return t.node.nodeType!==Node.ELEMENT_NODE||-1===["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"].indexOf(t.node.nodeName)}function Q(t){return[].concat.apply([],t)}function L(t){var e=t.substr(0,1);return e===t.substr(t.length-1)&&e.match(/'|"/)?t.substr(1,t.length-2):t}function N(t){for(var e,r=[],n=0,i=!1;t.length;)H(t[n])===i?(e=t.splice(0,n),e.length&&r.push(Y.ucs2.encode(e)),i=!i,n=0):n++,n>=t.length&&(e=t.splice(0,n),e.length&&r.push(Y.ucs2.encode(e)));return r}function H(t){return-1!==[32,13,10,9,45].indexOf(t)}function k(t){return/[^\u0000-\u00ff]/.test(t)}var G=t("./log"),Y=t("punycode"),j=t("./nodecontainer"),z=t("./textcontainer"),U=t("./pseudoelementcontainer"),J=t("./fontmetrics"),X=t("./color"),W=t("./promise"),K=t("./stackingcontext"),V=t("./utils"),Z=V.bind,q=V.getBounds,_=V.parseBackgrounds,$=V.offsetBounds;n.prototype.calculateOverflowClips=function(){this.nodes.forEach(function(t){if(D(t)){M(t)&&t.appendToDOM(),t.borders=this.parseBorders(t);var e="hidden"===t.css("overflow")?[t.borders.clip]:[],r=t.parseClip();r&&-1!==["absolute","fixed"].indexOf(t.css("position"))&&e.push([["rect",t.bounds.left+r.left,t.bounds.top+r.top,r.right-r.left,r.bottom-r.top]]),t.clip=i(t)?t.parent.clip.concat(e):e,t.backgroundClip="hidden"!==t.css("overflow")?t.clip.concat([t.borders.clip]):t.clip,M(t)&&t.cleanDOM()}else P(t)&&(t.clip=i(t)?t.parent.clip:[]);M(t)||(t.bounds=null)},this)},n.prototype.asyncRenderer=function(t,e,r){r=r||Date.now(),this.paint(t[this.renderIndex++]),t.length===this.renderIndex?e():r+20>Date.now()?this.asyncRenderer(t,e,r):setTimeout(Z(function(){this.asyncRenderer(t,e)},this),0)},n.prototype.createPseudoHideStyles=function(t){this.createStyles(t,"."+U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+':before { content: "" !important; display: none !important; }.'+U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER+':after { content: "" !important; display: none !important; }')},n.prototype.disableAnimations=function(t){this.createStyles(t,"* { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; animation: none !important; -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; transition: none !important;}")},n.prototype.createStyles=function(t,e){var r=t.createElement("style");r.innerHTML=e,t.body.appendChild(r)},n.prototype.getPseudoElements=function(t){var e=[[t]];if(t.node.nodeType===Node.ELEMENT_NODE){var r=this.getPseudoElement(t,":before"),n=this.getPseudoElement(t,":after");r&&e.push(r),n&&e.push(n)}return Q(e)},n.prototype.getPseudoElement=function(t,e){var r=t.computedStyle(e);if(!r||!r.content||"none"===r.content||"-moz-alt-content"===r.content||"none"===r.display)return null;for(var n=L(r.content),i="url"===n.substr(0,3),s=document.createElement(i?"img":"html2canvaspseudoelement"),a=new U(s,t,e),l=r.length-1;l>=0;l--){var u=o(r.item(l));s.style[u]=r[u]}if(s.className=U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+" "+U.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER,i)return s.src=_(n)[0].args[0],[a];var h=document.createTextNode(n);return s.appendChild(h),[a,new z(h,a)]},n.prototype.getChildren=function(t){return Q([].filter.call(t.node.childNodes,w).map(function(e){var r=[e.nodeType===Node.TEXT_NODE?new z(e,t):new j(e,t)].filter(F);return e.nodeType===Node.ELEMENT_NODE&&r.length&&"TEXTAREA"!==e.tagName?r[0].isElementVisible()?r.concat(this.getChildren(r[0])):[]:r},this))},n.prototype.newStackingContext=function(t,e){var r=new K(e,t.getOpacity(),t.node,t.parent);t.cloneTo(r);var n=e?r.getParentStack(this):r.parent.stack;n.contexts.push(r),t.stack=r},n.prototype.createStackingContexts=function(){this.nodes.forEach(function(t){D(t)&&(this.isRootElement(t)||I(t)||E(t)||this.isBodyWithTransparentRoot(t)||t.hasTransform())?this.newStackingContext(t,!0):D(t)&&(C(t)&&g(t)||B(t)||b(t))?this.newStackingContext(t,!1):t.assignStack(t.parent.stack)},this)},n.prototype.isBodyWithTransparentRoot=function(t){return"BODY"===t.node.nodeName&&t.parent.color("backgroundColor").isTransparent()},n.prototype.isRootElement=function(t){return null===t.parent},n.prototype.sortStackingContexts=function(t){t.contexts.sort(R(t.contexts.slice(0))),t.contexts.forEach(this.sortStackingContexts,this)},n.prototype.parseTextBounds=function(t){return function(e,r,n){if("none"!==t.parent.css("textDecoration").substr(0,4)||0!==e.trim().length){if(this.support.rangeBounds&&!t.parent.hasTransform()){var i=n.slice(0,r).join("").length;return this.getRangeBounds(t.node,i,e.length)}if(t.node&&"string"==typeof t.node.data){var o=t.node.splitText(e.length),s=this.getWrapperBounds(t.node,t.parent.hasTransform());return t.node=o,s}}else(!this.support.rangeBounds||t.parent.hasTransform())&&(t.node=t.node.splitText(e.length));return{}}},n.prototype.getWrapperBounds=function(t,e){var r=t.ownerDocument.createElement("html2canvaswrapper"),n=t.parentNode,i=t.cloneNode(!0);r.appendChild(t.cloneNode(!0)),n.replaceChild(r,t);var o=e?$(r):q(r);return n.replaceChild(i,r),o},n.prototype.getRangeBounds=function(t,e,r){var n=this.range||(this.range=t.ownerDocument.createRange());return n.setStart(t,e),n.setEnd(t,e+r),n.getBoundingClientRect()},n.prototype.parse=function(t){var e=t.contexts.filter(d),r=t.children.filter(D),n=r.filter(T(b)),i=n.filter(T(C)).filter(T(A)),o=r.filter(T(C)).filter(b),a=n.filter(T(C)).filter(A),l=t.contexts.concat(n.filter(C)).filter(g),u=t.children.filter(P).filter(m),h=t.contexts.filter(p);e.concat(i).concat(o).concat(a).concat(l).concat(u).concat(h).forEach(function(t){this.renderQueue.push(t),v(t)&&(this.parse(t),this.renderQueue.push(new s))},this)},n.prototype.paint=function(t){try{t instanceof s?this.renderer.ctx.restore():P(t)?(M(t.parent)&&t.parent.appendToDOM(),this.paintText(t),M(t.parent)&&t.parent.cleanDOM()):this.paintNode(t)}catch(e){if(G(e),this.options.strict)throw e}},n.prototype.paintNode=function(t){v(t)&&(this.renderer.setOpacity(t.opacity),this.renderer.ctx.save(),t.hasTransform()&&this.renderer.setTransform(t.parseTransform())),"INPUT"===t.node.nodeName&&"checkbox"===t.node.type?this.paintCheckbox(t):"INPUT"===t.node.nodeName&&"radio"===t.node.type?this.paintRadio(t):this.paintElement(t)},n.prototype.paintElement=function(t){var e=t.parseBounds();this.renderer.clip(t.backgroundClip,function(){this.renderer.renderBackground(t,e,t.borders.borders.map(O))},this),this.renderer.clip(t.clip,function(){this.renderer.renderBorders(t.borders.borders)},this),this.renderer.clip(t.backgroundClip,function(){switch(t.node.nodeName){case"svg":case"IFRAME":var r=this.images.get(t.node);r?this.renderer.renderImage(t,e,t.borders,r):G("Error loading <"+t.node.nodeName+">",t.node);break;case"IMG":var n=this.images.get(t.node.src);n?this.renderer.renderImage(t,e,t.borders,n):G("Error loading ",t.node.src);break;case"CANVAS":this.renderer.renderImage(t,e,t.borders,{image:t.node});break;case"SELECT":case"INPUT":case"TEXTAREA":this.paintFormValue(t)}},this)},n.prototype.paintCheckbox=function(t){var e=t.parseBounds(),r=Math.min(e.width,e.height),n={width:r-1,height:r-1,top:e.top,left:e.left},i=[3,3],o=[i,i,i,i],s=[1,1,1,1].map(function(t){return{color:new X("#A5A5A5"),width:t}}),l=u(n,o,s);this.renderer.clip(t.backgroundClip,function(){this.renderer.rectangle(n.left+1,n.top+1,n.width-2,n.height-2,new X("#DEDEDE")),this.renderer.renderBorders(a(s,n,l,o)),t.node.checked&&(this.renderer.font(new X("#424242"),"normal","normal","bold",r-3+"px","arial"),this.renderer.text("✔",n.left+r/6,n.top+r-1))},this)},n.prototype.paintRadio=function(t){var e=t.parseBounds(),r=Math.min(e.width,e.height)-2;this.renderer.clip(t.backgroundClip,function(){this.renderer.circleStroke(e.left+1,e.top+1,r,new X("#DEDEDE"),1,new X("#A5A5A5")),t.node.checked&&this.renderer.circle(Math.ceil(e.left+r/4)+1,Math.ceil(e.top+r/4)+1,Math.floor(r/2),new X("#424242"))},this)},n.prototype.paintFormValue=function(t){var e=t.getValue();if(e.length>0){var r=t.node.ownerDocument,n=r.createElement("html2canvaswrapper"),i=["lineHeight","textAlign","fontFamily","fontWeight","fontSize","color","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","borderLeftStyle","borderTopStyle","borderLeftWidth","borderTopWidth","boxSizing","whiteSpace","wordWrap"];i.forEach(function(e){try{n.style[e]=t.css(e)}catch(r){G("html2canvas: Parse: Exception caught in renderFormValue: "+r.message)}});var o=t.parseBounds();n.style.position="fixed",n.style.left=o.left+"px",n.style.top=o.top+"px",n.textContent=e,r.body.appendChild(n),this.paintText(new z(n.firstChild,t)),r.body.removeChild(n)}},n.prototype.paintText=function(t){t.applyTextTransform();var e=Y.ucs2.decode(t.node.data),r=this.options.letterRendering&&!y(t)||k(t.node.data)?e.map(function(t){return Y.ucs2.encode([t])}):N(e),n=t.parent.fontWeight(),i=t.parent.css("fontSize"),o=t.parent.css("fontFamily"),s=t.parent.parseTextShadows();this.renderer.font(t.parent.color("color"),t.parent.css("fontStyle"),t.parent.css("fontVariant"),n,i,o),s.length?this.renderer.fontShadow(s[0].color,s[0].offsetX,s[0].offsetY,s[0].blur):this.renderer.clearShadow(),this.renderer.clip(t.parent.clip,function(){r.map(this.parseTextBounds(t),this).forEach(function(e,n){e&&(this.renderer.text(r[n],e.left,e.bottom),this.renderTextDecoration(t.parent,e,this.fontMetrics.getMetrics(o,i)))},this)},this)},n.prototype.renderTextDecoration=function(t,e,r){switch(t.css("textDecoration").split(" ")[0]){case"underline":this.renderer.rectangle(e.left,Math.round(e.top+r.baseline+r.lineWidth),e.width,1,t.color("color"));break;case"overline":this.renderer.rectangle(e.left,Math.round(e.top),e.width,1,t.color("color"));break;case"line-through":this.renderer.rectangle(e.left,Math.ceil(e.top+r.middle+r.lineWidth),e.width,1,t.color("color"))}};var tt={inset:[["darken",.6],["darken",.1],["darken",.1],["darken",.6]]};n.prototype.parseBorders=function(t){var e=t.parseBounds(),r=x(t),n=["Top","Right","Bottom","Left"].map(function(e,r){var n=t.css("border"+e+"Style"),i=t.color("border"+e+"Color");"inset"===n&&i.isBlack()&&(i=new X([255,255,255,i.a]));var o=tt[n]?tt[n][r]:null;return{width:t.cssInt("border"+e+"Width"),color:o?i[o[0]](o[1]):i,args:null}}),i=u(e,r,n);return{clip:this.parseBackgroundClip(t,i,n,r,e),borders:a(n,e,i,r)}},n.prototype.parseBackgroundClip=function(t,e,r,n,i){var o=t.css("backgroundClip"),s=[];switch(o){case"content-box":case"padding-box":f(s,n[0],n[1],e.topLeftInner,e.topRightInner,i.left+r[3].width,i.top+r[0].width),f(s,n[1],n[2],e.topRightInner,e.bottomRightInner,i.left+i.width-r[1].width,i.top+r[0].width),f(s,n[2],n[3],e.bottomRightInner,e.bottomLeftInner,i.left+i.width-r[1].width,i.top+i.height-r[2].width),f(s,n[3],n[0],e.bottomLeftInner,e.topLeftInner,i.left+r[3].width,i.top+i.height-r[2].width);break;default:f(s,n[0],n[1],e.topLeftOuter,e.topRightOuter,i.left,i.top),f(s,n[1],n[2],e.topRightOuter,e.bottomRightOuter,i.left+i.width,i.top),f(s,n[2],n[3],e.bottomRightOuter,e.bottomLeftOuter,i.left+i.width,i.top+i.height),f(s,n[3],n[0],e.bottomLeftOuter,e.topLeftOuter,i.left,i.top+i.height)}return s},e.exports=n},{"./color":5,"./fontmetrics":9,"./log":15,"./nodecontainer":16,"./promise":18,"./pseudoelementcontainer":21,"./stackingcontext":24,"./textcontainer":28,"./utils":29,punycode:3}],18:[function(t,e,r){e.exports=t("es6-promise").Promise},{"es6-promise":1}],19:[function(t,e,r){function n(t,e,r){var n="withCredentials"in new XMLHttpRequest;if(!e)return h.reject("No proxy configured");var i=s(n),l=a(e,t,i);return n?c(l):o(r,l,i).then(function(t){return g(t.content)})}function i(t,e,r){var n="crossOrigin"in new Image,i=s(n),l=a(e,t,i);return n?h.resolve(l):o(r,l,i).then(function(t){return"data:"+t.type+";base64,"+t.content})}function o(t,e,r){return new h(function(n,i){var o=t.createElement("script"),s=function(){delete window.html2canvas.proxy[r],t.body.removeChild(o)};window.html2canvas.proxy[r]=function(t){s(),n(t)},o.src=e,o.onerror=function(t){s(),i(t)},t.body.appendChild(o)})}function s(t){return t?"":"html2canvas_"+Date.now()+"_"+ ++A+"_"+Math.round(1e5*Math.random())}function a(t,e,r){return t+"?url="+encodeURIComponent(e)+(r.length?"&callback=html2canvas.proxy."+r:"")}function l(t){return function(e){var r,n=new DOMParser;try{r=n.parseFromString(e,"text/html")}catch(i){d("DOMParser not supported, falling back to createHTMLDocument"),r=document.implementation.createHTMLDocument("");try{r.open(),r.write(e),r.close()}catch(o){d("createHTMLDocument write not supported, falling back to document.body.innerHTML"),r.body.innerHTML=e}}var s=r.querySelector("base");if(!s||!s.href.host){var a=r.createElement("base");a.href=t,r.head.insertBefore(a,r.head.firstChild)}return r}}function u(t,e,r,i,o,s){return new n(t,e,window.document).then(l(t)).then(function(t){return p(t,r,i,o,s,0,0)})}var h=t("./promise"),c=t("./xhr"),f=t("./utils"),d=t("./log"),p=t("./clone"),g=f.decode64,A=0;r.Proxy=n,r.ProxyURL=i,r.loadUrlDocument=u},{"./clone":4,"./log":15,"./promise":18,"./utils":29,"./xhr":31}],20:[function(t,e,r){function n(t,e){var r=document.createElement("a");r.href=t,t=r.href,this.src=t,this.image=new Image;var n=this;this.promise=new o(function(r,o){n.image.crossOrigin="Anonymous",n.image.onload=r,n.image.onerror=o,new i(t,e,document).then(function(t){n.image.src=t})["catch"](o)})}var i=t("./proxy").ProxyURL,o=t("./promise");e.exports=n},{"./promise":18,"./proxy":19}],21:[function(t,e,r){function n(t,e,r){i.call(this,t,e),this.isPseudoElement=!0,this.before=":before"===r}var i=t("./nodecontainer");n.prototype.cloneTo=function(t){n.prototype.cloneTo.call(this,t),t.isPseudoElement=!0,t.before=this.before},n.prototype=Object.create(i.prototype),n.prototype.appendToDOM=function(){this.before?this.parent.node.insertBefore(this.node,this.parent.node.firstChild):this.parent.node.appendChild(this.node),this.parent.node.className+=" "+this.getHideClass()},n.prototype.cleanDOM=function(){this.node.parentNode.removeChild(this.node),this.parent.node.className=this.parent.node.className.replace(this.getHideClass(),"")},n.prototype.getHideClass=function(){return this["PSEUDO_HIDE_ELEMENT_CLASS_"+(this.before?"BEFORE":"AFTER")]},n.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE="___html2canvas___pseudoelement_before",n.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER="___html2canvas___pseudoelement_after",e.exports=n},{"./nodecontainer":16}],22:[function(t,e,r){function n(t,e,r,n,i){this.width=t,this.height=e,this.images=r,this.options=n,this.document=i}var i=t("./log");n.prototype.renderImage=function(t,e,r,n){var i=t.cssInt("paddingLeft"),o=t.cssInt("paddingTop"),s=t.cssInt("paddingRight"),a=t.cssInt("paddingBottom"),l=r.borders,u=e.width-(l[1].width+l[3].width+i+s),h=e.height-(l[0].width+l[2].width+o+a);this.drawImage(n,0,0,n.image.width||u,n.image.height||h,e.left+i+l[3].width,e.top+o+l[0].width,u,h)},n.prototype.renderBackground=function(t,e,r){e.height>0&&e.width>0&&(this.renderBackgroundColor(t,e),this.renderBackgroundImage(t,e,r))},n.prototype.renderBackgroundColor=function(t,e){var r=t.color("backgroundColor");r.isTransparent()||this.rectangle(e.left,e.top,e.width,e.height,r)},n.prototype.renderBorders=function(t){t.forEach(this.renderBorder,this)},n.prototype.renderBorder=function(t){t.color.isTransparent()||null===t.args||this.drawShape(t.args,t.color)},n.prototype.renderBackgroundImage=function(t,e,r){ +var n=t.parseBackgroundImages();n.reverse().forEach(function(n,o,s){switch(n.method){case"url":var a=this.images.get(n.args[0]);a?this.renderBackgroundRepeating(t,e,a,s.length-(o+1),r):i("Error loading background-image",n.args[0]);break;case"linear-gradient":case"gradient":var l=this.images.get(n.value);l?this.renderBackgroundGradient(l,e,r):i("Error loading background-image",n.args[0]);break;case"none":break;default:i("Unknown background-image type",n.args[0])}},this)},n.prototype.renderBackgroundRepeating=function(t,e,r,n,i){var o=t.parseBackgroundSize(e,r.image,n),s=t.parseBackgroundPosition(e,r.image,n,o),a=t.parseBackgroundRepeat(n);switch(a){case"repeat-x":case"repeat no-repeat":this.backgroundRepeatShape(r,s,o,e,e.left+i[3],e.top+s.top+i[0],99999,o.height,i);break;case"repeat-y":case"no-repeat repeat":this.backgroundRepeatShape(r,s,o,e,e.left+s.left+i[3],e.top+i[0],o.width,99999,i);break;case"no-repeat":this.backgroundRepeatShape(r,s,o,e,e.left+s.left+i[3],e.top+s.top+i[0],o.width,o.height,i);break;default:this.renderBackgroundRepeat(r,s,o,{top:e.top,left:e.left},i[3],i[0])}},e.exports=n},{"./log":15}],23:[function(t,e,r){function n(t,e){if(this.ratio=a.getDeviceRatio(),t=a.applyRatio(t),e=a.applyRatio(e),o.apply(this,arguments),this.canvas=this.options.canvas||this.document.createElement("canvas"),!this.options.canvas&&(this.canvas.width=t,this.canvas.height=e,1!==this.ratio)){var r=1/this.ratio;this.canvas.style.transform="scaleX("+r+") scaleY("+r+")",this.canvas.style.transformOrigin="0 0"}this.ctx=this.canvas.getContext("2d"),this.taintCtx=this.document.createElement("canvas").getContext("2d"),this.ctx.textBaseline="bottom",this.variables={},l("Initialized CanvasRenderer with size",t,"x",e)}function i(t){return t.length>0}var o=t("../renderer"),s=t("../lineargradientcontainer"),a=t("../utils"),l=t("../log");n.prototype=Object.create(o.prototype),n.prototype.setFillStyle=function(t){return this.ctx.fillStyle="object"==typeof t&&t.isColor?t.toString():t,this.ctx},n.prototype.rectangle=function(t,e,r,n,i){t=a.applyRatio(t),e=a.applyRatio(e),r=a.applyRatio(r),n=a.applyRatio(n),this.setFillStyle(i).fillRect(t,e,r,n)},n.prototype.circle=function(t,e,r,n){this.setFillStyle(n),this.ctx.beginPath(),this.ctx.arc(t+r/2,e+r/2,r/2,0,2*Math.PI,!0),this.ctx.closePath(),this.ctx.fill()},n.prototype.circleStroke=function(t,e,r,n,i,o){t=a.applyRatio(t),e=a.applyRatio(e),r=a.applyRatio(r),this.circle(t,e,r,n),this.ctx.strokeStyle=o.toString(),this.ctx.stroke()},n.prototype.drawShape=function(t,e){t=a.applyRatioToShape(t),this.shape(t),this.setFillStyle(e).fill()},n.prototype.taints=function(t){if(null===t.tainted){this.taintCtx.drawImage(t.image,0,0);try{this.taintCtx.getImageData(0,0,1,1),t.tainted=!1}catch(e){this.taintCtx=document.createElement("canvas").getContext("2d"),t.tainted=!0}}return t.tainted},n.prototype.drawImage=function(t,e,r,n,i,o,s,l,u){o=a.applyRatio(o),s=a.applyRatio(s),l=a.applyRatio(l),u=a.applyRatio(u),(!this.taints(t)||this.options.allowTaint)&&this.ctx.drawImage(t.image,e,r,n,i,o,s,l,u)},n.prototype.clip=function(t,e,r){this.ctx.save(),t.filter(i).forEach(function(t){t=a.applyRatioToShape(t),this.shape(t)},this),e.call(r),this.ctx.restore()},n.prototype.shape=function(t){return this.ctx.beginPath(),t.forEach(function(t,e){"rect"===t[0]?this.ctx.rect.apply(this.ctx,t.slice(1)):this.ctx[0===e?"moveTo":t[0]+"To"].apply(this.ctx,t.slice(1))},this),this.ctx.closePath(),this.ctx},n.prototype.font=function(t,e,r,n,i,o){i=a.applyRatioToFontSize(i),this.setFillStyle(t).font=[e,r,n,i,o].join(" ").split(",")[0]},n.prototype.fontShadow=function(t,e,r,n){e=a.applyRatio(e),r=a.applyRatio(r),this.setVariable("shadowColor",t.toString()).setVariable("shadowOffsetY",e).setVariable("shadowOffsetX",r).setVariable("shadowBlur",n)},n.prototype.clearShadow=function(){this.setVariable("shadowColor","rgba(0,0,0,0)")},n.prototype.setOpacity=function(t){this.ctx.globalAlpha=t},n.prototype.setTransform=function(t){this.ctx.translate(t.origin[0],t.origin[1]),this.ctx.transform.apply(this.ctx,t.matrix),this.ctx.translate(-t.origin[0],-t.origin[1])},n.prototype.setVariable=function(t,e){return this.variables[t]!==e&&(this.variables[t]=this.ctx[t]=e),this},n.prototype.text=function(t,e,r){e=a.applyRatio(e),r=a.applyRatio(r),this.ctx.fillText(t,e,r)},n.prototype.backgroundRepeatShape=function(t,e,r,n,i,o,s,l,u){r=a.applyRatio(r),n=a.applyRatioToBounds(n),i=a.applyRatio(i),o=a.applyRatio(o),s=a.applyRatio(s),l=a.applyRatio(l);var h=[["line",Math.round(i),Math.round(o)],["line",Math.round(i+s),Math.round(o)],["line",Math.round(i+s),Math.round(l+o)],["line",Math.round(i),Math.round(l+o)]];this.clip([h],function(){this.renderBackgroundRepeat(t,e,r,n,u[3],u[0])},this)},n.prototype.renderBackgroundRepeat=function(t,e,r,n,i,o){n=a.applyRatioToBounds(n),r=a.applyRatioToBounds(r),e=a.applyRatioToBounds(e),i=a.applyRatio(i),o=a.applyRatio(o);var s=Math.round(n.left+e.left+i),l=Math.round(n.top+e.top+o);this.setFillStyle(this.ctx.createPattern(this.resizeImage(t,r),"repeat")),this.ctx.translate(s,l),this.ctx.fill(),this.ctx.translate(-s,-l)},n.prototype.renderBackgroundGradient=function(t,e){if(e=a.applyRatioToBounds(e),t instanceof s){var r=this.ctx.createLinearGradient(e.left+e.width*t.x0,e.top+e.height*t.y0,e.left+e.width*t.x1,e.top+e.height*t.y1);t.colorStops.forEach(function(t){r.addColorStop(t.stop,t.color.toString())}),this.rectangle(e.left,e.top,e.width,e.height,r)}},n.prototype.resizeImage=function(t,e){e=a.applyRatioToBounds(e);var r=t.image;if(r.width===e.width&&r.height===e.height)return r;var n,i=document.createElement("canvas");return i.width=e.width,i.height=e.height,n=i.getContext("2d"),n.drawImage(r,0,0,r.width,r.height,0,0,e.width,e.height),i},e.exports=n},{"../lineargradientcontainer":14,"../log":15,"../renderer":22,"../utils":29}],24:[function(t,e,r){function n(t,e,r,n){i.call(this,r,n),this.ownStacking=t,this.contexts=[],this.children=[],this.opacity=(this.parent?this.parent.stack.opacity:1)*e}var i=t("./nodecontainer");n.prototype=Object.create(i.prototype),n.prototype.getParentStack=function(t){var e=this.parent?this.parent.stack:null;return e?e.ownStacking?e:e.getParentStack(t):t.stack},e.exports=n},{"./nodecontainer":16}],25:[function(t,e,r){function n(t){this.rangeBounds=this.testRangeBounds(t),this.cors=this.testCORS(),this.svg=this.testSVG()}n.prototype.testRangeBounds=function(t){var e,r,n,i,o=!1;return t.createRange&&(e=t.createRange(),e.getBoundingClientRect&&(r=t.createElement("boundtest"),r.style.height="123px",r.style.display="block",t.body.appendChild(r),e.selectNode(r),n=e.getBoundingClientRect(),i=n.height,123===i&&(o=!0),t.body.removeChild(r))),o},n.prototype.testCORS=function(){return"undefined"!=typeof(new Image).crossOrigin},n.prototype.testSVG=function(){var t=new Image,e=document.createElement("canvas"),r=e.getContext("2d");t.src="data:image/svg+xml,";try{r.drawImage(t,0,0),e.toDataURL()}catch(n){return!1}return!0},e.exports=n},{}],26:[function(t,e,r){function n(t){this.src=t,this.image=null;var e=this;this.promise=this.hasFabric().then(function(){return e.isInline(t)?i.resolve(e.inlineFormatting(t)):o(t)}).then(function(t){return new i(function(r){window.html2canvas.svg.fabric.loadSVGFromString(t,e.createCanvas.call(e,r))})})}var i=t("./promise"),o=t("./xhr"),s=t("./utils").decode64;n.prototype.hasFabric=function(){return window.html2canvas.svg&&window.html2canvas.svg.fabric?i.resolve():i.reject(new Error("html2canvas.svg.js is not loaded, cannot render svg"))},n.prototype.inlineFormatting=function(t){return/^data:image\/svg\+xml;base64,/.test(t)?this.decode64(this.removeContentType(t)):this.removeContentType(t)},n.prototype.removeContentType=function(t){return t.replace(/^data:image\/svg\+xml(;base64)?,/,"")},n.prototype.isInline=function(t){return/^data:image\/svg\+xml/i.test(t)},n.prototype.createCanvas=function(t){var e=this;return function(r,n){var i=new window.html2canvas.svg.fabric.StaticCanvas("c");e.image=i.lowerCanvasEl,i.setWidth(n.width).setHeight(n.height).add(window.html2canvas.svg.fabric.util.groupSVGElements(r,n)).renderAll(),t(i.lowerCanvasEl)}},n.prototype.decode64=function(t){return"function"==typeof window.atob?window.atob(t):s(t)},e.exports=n},{"./promise":18,"./utils":29,"./xhr":31}],27:[function(t,e,r){function n(t,e){this.src=t,this.image=null;var r=this;this.promise=e?new o(function(e,n){r.image=new Image,r.image.onload=e,r.image.onerror=n,r.image.src="data:image/svg+xml,"+(new XMLSerializer).serializeToString(t),r.image.complete===!0&&e(r.image)}):this.hasFabric().then(function(){return new o(function(e){window.html2canvas.svg.fabric.parseSVGDocument(t,r.createCanvas.call(r,e))})})}var i=t("./svgcontainer"),o=t("./promise");n.prototype=Object.create(i.prototype),e.exports=n},{"./promise":18,"./svgcontainer":26}],28:[function(t,e,r){function n(t,e){o.call(this,t,e)}function i(t,e,r){return t.length>0?e+r.toUpperCase():void 0}var o=t("./nodecontainer");n.prototype=Object.create(o.prototype),n.prototype.applyTextTransform=function(){this.node.data=this.transform(this.parent.css("textTransform"))},n.prototype.transform=function(t){var e=this.node.data;switch(t){case"lowercase":return e.toLowerCase();case"capitalize":return e.replace(/(^|\s|:|-|\(|\))([a-z])/g,i);case"uppercase":return e.toUpperCase();default:return e}},e.exports=n},{"./nodecontainer":16}],29:[function(t,e,r){r.smallImage=function(){return"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"},r.bind=function(t,e){return function(){return t.apply(e,arguments)}},r.decode64=function(t){var e,r,n,i,o,s,a,l,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=t.length,c="";for(e=0;h>e;e+=4)r=u.indexOf(t[e]),n=u.indexOf(t[e+1]),i=u.indexOf(t[e+2]),o=u.indexOf(t[e+3]),s=r<<2|n>>4,a=(15&n)<<4|i>>2,l=(3&i)<<6|o,c+=64===i?String.fromCharCode(s):64===o||-1===o?String.fromCharCode(s,a):String.fromCharCode(s,a,l);return c},r.getBounds=function(t){if(t.getBoundingClientRect){var e=t.getBoundingClientRect(),r=null==t.offsetWidth?e.width:t.offsetWidth;return{top:e.top,bottom:e.bottom||e.top+e.height,right:e.left+r,left:e.left,width:r,height:null==t.offsetHeight?e.height:t.offsetHeight}}return{}},r.offsetBounds=function(t){var e=t.offsetParent?r.offsetBounds(t.offsetParent):{top:0,left:0};return{top:t.offsetTop+e.top,bottom:t.offsetTop+t.offsetHeight+e.top,right:t.offsetLeft+e.left+t.offsetWidth,left:t.offsetLeft+e.left,width:t.offsetWidth,height:t.offsetHeight}},r.parseBackgrounds=function(t){var e,r,n,i,o,s,a,l=" \r\n ",u=[],h=0,c=0,f=function(){e&&('"'===r.substr(0,1)&&(r=r.substr(1,r.length-2)),r&&a.push(r),"-"===e.substr(0,1)&&(i=e.indexOf("-",1)+1)>0&&(n=e.substr(0,i),e=e.substr(i)),u.push({prefix:n,method:e.toLowerCase(),value:o,args:a,image:null})),a=[],e=n=r=o=""};return a=[],e=n=r=o="",t.split("").forEach(function(t){if(!(0===h&&l.indexOf(t)>-1)){switch(t){case'"':s?s===t&&(s=null):s=t;break;case"(":if(s)break;if(0===h)return h=1,void(o+=t);c++;break;case")":if(s)break;if(1===h){if(0===c)return h=0,o+=t,void f();c--}break;case",":if(s)break;if(0===h)return void f();if(1===h&&0===c&&!e.match(/^url$/i))return a.push(r),r="",void(o+=t)}o+=t,0===h?e+=t:r+=t}}),f(),u},r.getDeviceRatio=function(){return window.devicePixelRatio},r.applyRatio=function(t){return t*r.getDeviceRatio()},r.applyRatioToBounds=function(t){t.width=t.width*r.getDeviceRatio(),t.top=t.top*r.getDeviceRatio();try{t.left=t.left*r.getDeviceRatio(),t.height=t.height*r.getDeviceRatio()}catch(e){}return t},r.applyRatioToPosition=function(t){return t.left=t.left*r.getDeviceRatio(),t.height=t.height*r.getDeviceRatio(),bounds},r.applyRatioToShape=function(t){for(var e=0;e0&&e-1 in t}if(!t.jQuery){var r=function(t,e){return new r.fn.init(t,e)};r.isWindow=function(t){return null!=t&&t==t.window},r.type=function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?i[s.call(t)]||"object":typeof t},r.isArray=Array.isArray||function(t){return"array"===r.type(t)},r.isPlainObject=function(t){var e;if(!t||"object"!==r.type(t)||t.nodeType||r.isWindow(t))return!1;try{if(t.constructor&&!o.call(t,"constructor")&&!o.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}for(e in t);return void 0===e||o.call(t,e)},r.each=function(t,r,n){var i,o=0,s=t.length,a=e(t);if(n){if(a)for(;s>o&&(i=r.apply(t[o],n),i!==!1);o++);else for(o in t)if(i=r.apply(t[o],n),i===!1)break}else if(a)for(;s>o&&(i=r.call(t[o],o,t[o]),i!==!1);o++);else for(o in t)if(i=r.call(t[o],o,t[o]),i===!1)break;return t},r.data=function(t,e,i){if(void 0===i){var o=t[r.expando],s=o&&n[o];if(void 0===e)return s;if(s&&e in s)return s[e]}else if(void 0!==e){var o=t[r.expando]||(t[r.expando]=++r.uuid);return n[o]=n[o]||{},n[o][e]=i,i}},r.removeData=function(t,e){var i=t[r.expando],o=i&&n[i];o&&r.each(e,function(t,e){delete o[e]})},r.extend=function(){var t,e,n,i,o,s,a=arguments[0]||{},l=1,u=arguments.length,h=!1;for("boolean"==typeof a&&(h=a,a=arguments[l]||{},l++),"object"!=typeof a&&"function"!==r.type(a)&&(a={}),l===u&&(a=this,l--);u>l;l++)if(null!=(o=arguments[l]))for(i in o)t=a[i],n=o[i],a!==n&&(h&&n&&(r.isPlainObject(n)||(e=r.isArray(n)))?(e?(e=!1,s=t&&r.isArray(t)?t:[]):s=t&&r.isPlainObject(t)?t:{},a[i]=r.extend(h,s,n)):void 0!==n&&(a[i]=n));return a},r.queue=function(t,n,i){function o(t,r){var n=r||[];return null!=t&&(e(Object(t))?!function(t,e){for(var r=+e.length,n=0,i=t.length;r>n;)t[i++]=e[n++];if(r!==r)for(;void 0!==e[n];)t[i++]=e[n++];return t.length=i,t}(n,"string"==typeof t?[t]:t):[].push.call(n,t)),n}if(t){n=(n||"fx")+"queue";var s=r.data(t,n);return i?(!s||r.isArray(i)?s=r.data(t,n,o(i)):s.push(i),s):s||[]}},r.dequeue=function(t,e){r.each(t.nodeType?[t]:t,function(t,n){e=e||"fx";var i=r.queue(n,e),o=i.shift();"inprogress"===o&&(o=i.shift()),o&&("fx"===e&&i.unshift("inprogress"),o.call(n,function(){r.dequeue(n,e)}))})},r.fn=r.prototype={init:function(t){if(t.nodeType)return this[0]=t,this;throw new Error("Not a DOM node.")},offset:function(){var e=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:e.top+(t.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:e.left+(t.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function t(){for(var t=this.offsetParent||document;t&&"html"===!t.nodeType.toLowerCase&&"static"===t.style.position;)t=t.offsetParent;return t||document}var e=this[0],t=t.apply(e),n=this.offset(),i=/^(?:body|html)$/i.test(t.nodeName)?{top:0,left:0}:r(t).offset();return n.top-=parseFloat(e.style.marginTop)||0,n.left-=parseFloat(e.style.marginLeft)||0,t.style&&(i.top+=parseFloat(t.style.borderTopWidth)||0,i.left+=parseFloat(t.style.borderLeftWidth)||0),{top:n.top-i.top,left:n.left-i.left}}};var n={};r.expando="velocity"+(new Date).getTime(),r.uuid=0;for(var i={},o=i.hasOwnProperty,s=i.toString,a="Boolean Number String Function Array Date RegExp Object Error".split(" "),l=0;li;++i){var o=u(r,t,n);if(0===o)return r;var s=l(r,t,n)-e;r-=s/o}return r}function c(){for(var e=0;y>e;++e)C[e]=l(e*x,t,n)}function f(e,r,i){var o,s,a=0;do s=r+(i-r)/2,o=l(s,t,n)-e,o>0?i=s:r=s;while(Math.abs(o)>v&&++a=A?h(e,a):0==l?a:f(e,r,r+x)}function p(){b=!0,(t!=r||n!=i)&&c()}var g=4,A=.001,v=1e-7,m=10,y=11,x=1/(y-1),w="Float32Array"in e;if(4!==arguments.length)return!1;for(var E=0;4>E;++E)if("number"!=typeof arguments[E]||isNaN(arguments[E])||!isFinite(arguments[E]))return!1;t=Math.min(t,1),n=Math.min(n,1),t=Math.max(t,0),n=Math.max(n,0);var C=w?new Float32Array(y):new Array(y),b=!1,B=function(e){return b||p(),t===r&&n===i?e:0===e?0:1===e?1:l(d(e),r,i)};B.getControlPoints=function(){return[{x:t,y:r},{x:n,y:i}]};var T="generateBezier("+[t,r,n,i]+")";return B.toString=function(){return T},B}function u(t,e){var r=t;return g.isString(t)?y.Easings[t]||(r=!1):r=g.isArray(t)&&1===t.length?a.apply(null,t):g.isArray(t)&&2===t.length?x.apply(null,t.concat([e])):g.isArray(t)&&4===t.length?l.apply(null,t):!1,r===!1&&(r=y.Easings[y.defaults.easing]?y.defaults.easing:m),r}function h(t){if(t){var e=(new Date).getTime(),r=y.State.calls.length;r>1e4&&(y.State.calls=i(y.State.calls));for(var o=0;r>o;o++)if(y.State.calls[o]){var a=y.State.calls[o],l=a[0],u=a[2],d=a[3],p=!!d,A=null;d||(d=y.State.calls[o][3]=e-16);for(var v=Math.min((e-d)/u.duration,1),m=0,x=l.length;x>m;m++){var E=l[m],b=E.element;if(s(b)){var B=!1;if(u.display!==n&&null!==u.display&&"none"!==u.display){if("flex"===u.display){var T=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];f.each(T,function(t,e){w.setPropertyValue(b,"display",e)})}w.setPropertyValue(b,"display",u.display)}u.visibility!==n&&"hidden"!==u.visibility&&w.setPropertyValue(b,"visibility",u.visibility);for(var D in E)if("element"!==D){var M,P=E[D],R=g.isString(P.easing)?y.Easings[P.easing]:P.easing;if(1===v)M=P.endValue;else{var I=P.endValue-P.startValue;if(M=P.startValue+I*R(v,u,I),!p&&M===P.currentValue)continue}if(P.currentValue=M,"tween"===D)A=M;else{if(w.Hooks.registered[D]){var S=w.Hooks.getRoot(D),O=s(b).rootPropertyValueCache[S];O&&(P.rootPropertyValue=O)}var F=w.setPropertyValue(b,D,P.currentValue+(0===parseFloat(M)?"":P.unitType),P.rootPropertyValue,P.scrollData);w.Hooks.registered[D]&&(w.Normalizations.registered[S]?s(b).rootPropertyValueCache[S]=w.Normalizations.registered[S]("extract",null,F[1]):s(b).rootPropertyValueCache[S]=F[1]),"transform"===F[0]&&(B=!0)}}u.mobileHA&&s(b).transformCache.translate3d===n&&(s(b).transformCache.translate3d="(0px, 0px, 0px)",B=!0),B&&w.flushTransformCache(b)}}u.display!==n&&"none"!==u.display&&(y.State.calls[o][2].display=!1),u.visibility!==n&&"hidden"!==u.visibility&&(y.State.calls[o][2].visibility=!1),u.progress&&u.progress.call(a[1],a[1],v,Math.max(0,d+u.duration-e),d,A),1===v&&c(o)}}y.State.isTicking&&C(h)}function c(t,e){if(!y.State.calls[t])return!1;for(var r=y.State.calls[t][0],i=y.State.calls[t][1],o=y.State.calls[t][2],a=y.State.calls[t][4],l=!1,u=0,h=r.length;h>u;u++){var c=r[u].element;if(e||o.loop||("none"===o.display&&w.setPropertyValue(c,"display",o.display),"hidden"===o.visibility&&w.setPropertyValue(c,"visibility",o.visibility)),o.loop!==!0&&(f.queue(c)[1]===n||!/\.velocityQueueEntryFlag/i.test(f.queue(c)[1]))&&s(c)){s(c).isAnimating=!1,s(c).rootPropertyValueCache={};var d=!1;f.each(w.Lists.transforms3D,function(t,e){var r=/^scale/.test(e)?1:0,i=s(c).transformCache[e];s(c).transformCache[e]!==n&&new RegExp("^\\("+r+"[^.]").test(i)&&(d=!0,delete s(c).transformCache[e])}),o.mobileHA&&(d=!0,delete s(c).transformCache.translate3d),d&&w.flushTransformCache(c),w.Values.removeClass(c,"velocity-animating")}if(!e&&o.complete&&!o.loop&&u===h-1)try{o.complete.call(i,i)}catch(p){setTimeout(function(){throw p},1)}a&&o.loop!==!0&&a(i),s(c)&&o.loop===!0&&!e&&(f.each(s(c).tweensContainer,function(t,e){/^rotate/.test(t)&&360===parseFloat(e.endValue)&&(e.endValue=0,e.startValue=360),/^backgroundPosition/.test(t)&&100===parseFloat(e.endValue)&&"%"===e.unitType&&(e.endValue=0,e.startValue=100)}),y(c,"reverse",{loop:!0,delay:o.delay})),o.queue!==!1&&f.dequeue(c,o.queue)}y.State.calls[t]=!1;for(var g=0,A=y.State.calls.length;A>g;g++)if(y.State.calls[g]!==!1){l=!0;break}l===!1&&(y.State.isTicking=!1,delete y.State.calls,y.State.calls=[])}var f,d=function(){if(r.documentMode)return r.documentMode;for(var t=7;t>4;t--){var e=r.createElement("div");if(e.innerHTML="",e.getElementsByTagName("span").length)return e=null,t}return n}(),p=function(){var t=0;return e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||function(e){var r,n=(new Date).getTime();return r=Math.max(0,16-(n-t)),t=n+r,setTimeout(function(){e(n+r)},r)}}(),g={isString:function(t){return"string"==typeof t},isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},isFunction:function(t){return"[object Function]"===Object.prototype.toString.call(t)},isNode:function(t){return t&&t.nodeType},isNodeList:function(t){return"object"==typeof t&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(t))&&t.length!==n&&(0===t.length||"object"==typeof t[0]&&t[0].nodeType>0)},isWrapped:function(t){return t&&(t.jquery||e.Zepto&&e.Zepto.zepto.isZ(t))},isSVG:function(t){return e.SVGElement&&t instanceof e.SVGElement},isEmptyObject:function(t){for(var e in t)return!1;return!0}},A=!1;if(t.fn&&t.fn.jquery?(f=t,A=!0):f=e.Velocity.Utilities,8>=d&&!A)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(7>=d)return void(jQuery.fn.velocity=jQuery.fn.animate);var v=400,m="swing",y={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:e.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:r.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:f,Redirects:{},Easings:{},Promise:e.Promise,defaults:{queue:"",duration:v,easing:m,begin:n,complete:n,progress:n,display:n,visibility:n,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},init:function(t){f.data(t,"velocity",{isSVG:g.isSVG(t),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:2,patch:2},debug:!1};e.pageYOffset!==n?(y.State.scrollAnchor=e,y.State.scrollPropertyLeft="pageXOffset",y.State.scrollPropertyTop="pageYOffset"):(y.State.scrollAnchor=r.documentElement||r.body.parentNode||r.body,y.State.scrollPropertyLeft="scrollLeft",y.State.scrollPropertyTop="scrollTop");var x=function(){function t(t){return-t.tension*t.x-t.friction*t.v}function e(e,r,n){var i={x:e.x+n.dx*r,v:e.v+n.dv*r,tension:e.tension,friction:e.friction};return{dx:i.v,dv:t(i)}}function r(r,n){var i={dx:r.v,dv:t(r)},o=e(r,.5*n,i),s=e(r,.5*n,o),a=e(r,n,s),l=1/6*(i.dx+2*(o.dx+s.dx)+a.dx),u=1/6*(i.dv+2*(o.dv+s.dv)+a.dv);return r.x=r.x+l*n,r.v=r.v+u*n,r}return function n(t,e,i){var o,s,a,l={x:-1,v:0,tension:null,friction:null},u=[0],h=0,c=1e-4,f=.016;for(t=parseFloat(t)||500,e=parseFloat(e)||20,i=i||null,l.tension=t,l.friction=e,o=null!==i,o?(h=n(t,e),s=h/i*f):s=f;;)if(a=r(a||l,s),u.push(1+a.x),h+=16,!(Math.abs(a.x)>c&&Math.abs(a.v)>c))break;return o?function(t){return u[t*(u.length-1)|0]}:h}}();y.Easings={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},spring:function(t){return 1-Math.cos(4.5*t*Math.PI)*Math.exp(6*-t)}},f.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(t,e){y.Easings[e[0]]=l.apply(null,e[1])});var w=y.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var t=0;t=d)switch(t){case"name":return"filter";case"extract":var n=r.toString().match(/alpha\(opacity=(.*)\)/i);return r=n?n[1]/100:1;case"inject":return e.style.zoom=1,parseFloat(r)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(r),10)+")"}else switch(t){case"name":return"opacity";case"extract":return r;case"inject":return r}}},register:function(){9>=d||y.State.isGingerbread||(w.Lists.transformsBase=w.Lists.transformsBase.concat(w.Lists.transforms3D));for(var t=0;ti&&(i=1),o=!/(\d)$/i.test(i);break;case"skew":o=!/(deg|\d)$/i.test(i);break;case"rotate":o=!/(deg|\d)$/i.test(i)}return o||(s(r).transformCache[e]="("+i+")"),s(r).transformCache[e]}}}();for(var t=0;t=d||3!==o.split(" ").length||(o+=" 1"),o;case"inject":return 8>=d?4===i.split(" ").length&&(i=i.split(/\s+/).slice(0,3).join(" ")):3===i.split(" ").length&&(i+=" 1"),(8>=d?"rgb":"rgba")+"("+i.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})},SVGAttribute:function(t){var e="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(d||y.State.isAndroid&&!y.State.isChrome)&&(e+="|transform"),new RegExp("^("+e+")$","i").test(t)},prefixCheck:function(t){if(y.State.prefixMatches[t])return[y.State.prefixMatches[t],!0];for(var e=["","Webkit","Moz","ms","O"],r=0,n=e.length;n>r;r++){var i;if(i=0===r?t:e[r]+t.replace(/^\w/,function(t){return t.toUpperCase()}),g.isString(y.State.prefixElement.style[i]))return y.State.prefixMatches[t]=i,[i,!0]}return[t,!1]}},Values:{hexToRgb:function(t){var e,r=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;return t=t.replace(r,function(t,e,r,n){return e+e+r+r+n+n}),e=n.exec(t),e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:[0,0,0]},isCSSNullValue:function(t){return 0==t||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(t)},getUnitType:function(t){return/^(rotate|skew)/i.test(t)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(t)?"":"px"},getDisplayType:function(t){var e=t&&t.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(e)?"inline":/^(li)$/i.test(e)?"list-item":/^(tr)$/i.test(e)?"table-row":/^(table)$/i.test(e)?"table":/^(tbody)$/i.test(e)?"table-row-group":"block"},addClass:function(t,e){t.classList?t.classList.add(e):t.className+=(t.className.length?" ":"")+e},removeClass:function(t,e){t.classList?t.classList.remove(e):t.className=t.className.toString().replace(new RegExp("(^|\\s)"+e.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(t,r,i,o){function a(t,r){function i(){u&&w.setPropertyValue(t,"display","none")}var l=0;if(8>=d)l=f.css(t,r);else{var u=!1;if(/^(width|height)$/.test(r)&&0===w.getPropertyValue(t,"display")&&(u=!0,w.setPropertyValue(t,"display",w.Values.getDisplayType(t))), +!o){if("height"===r&&"border-box"!==w.getPropertyValue(t,"boxSizing").toString().toLowerCase()){var h=t.offsetHeight-(parseFloat(w.getPropertyValue(t,"borderTopWidth"))||0)-(parseFloat(w.getPropertyValue(t,"borderBottomWidth"))||0)-(parseFloat(w.getPropertyValue(t,"paddingTop"))||0)-(parseFloat(w.getPropertyValue(t,"paddingBottom"))||0);return i(),h}if("width"===r&&"border-box"!==w.getPropertyValue(t,"boxSizing").toString().toLowerCase()){var c=t.offsetWidth-(parseFloat(w.getPropertyValue(t,"borderLeftWidth"))||0)-(parseFloat(w.getPropertyValue(t,"borderRightWidth"))||0)-(parseFloat(w.getPropertyValue(t,"paddingLeft"))||0)-(parseFloat(w.getPropertyValue(t,"paddingRight"))||0);return i(),c}}var p;p=s(t)===n?e.getComputedStyle(t,null):s(t).computedStyle?s(t).computedStyle:s(t).computedStyle=e.getComputedStyle(t,null),"borderColor"===r&&(r="borderTopColor"),l=9===d&&"filter"===r?p.getPropertyValue(r):p[r],(""===l||null===l)&&(l=t.style[r]),i()}if("auto"===l&&/^(top|right|bottom|left)$/i.test(r)){var g=a(t,"position");("fixed"===g||"absolute"===g&&/top|left/i.test(r))&&(l=f(t).position()[r]+"px")}return l}var l;if(w.Hooks.registered[r]){var u=r,h=w.Hooks.getRoot(u);i===n&&(i=w.getPropertyValue(t,w.Names.prefixCheck(h)[0])),w.Normalizations.registered[h]&&(i=w.Normalizations.registered[h]("extract",t,i)),l=w.Hooks.extractValue(u,i)}else if(w.Normalizations.registered[r]){var c,p;c=w.Normalizations.registered[r]("name",t),"transform"!==c&&(p=a(t,w.Names.prefixCheck(c)[0]),w.Values.isCSSNullValue(p)&&w.Hooks.templates[r]&&(p=w.Hooks.templates[r][1])),l=w.Normalizations.registered[r]("extract",t,p)}if(!/^[\d-]/.test(l))if(s(t)&&s(t).isSVG&&w.Names.SVGAttribute(r))if(/^(height|width)$/i.test(r))try{l=t.getBBox()[r]}catch(g){l=0}else l=t.getAttribute(r);else l=a(t,w.Names.prefixCheck(r)[0]);return w.Values.isCSSNullValue(l)&&(l=0),y.debug>=2&&console.log("Get "+r+": "+l),l},setPropertyValue:function(t,r,n,i,o){var a=r;if("scroll"===r)o.container?o.container["scroll"+o.direction]=n:"Left"===o.direction?e.scrollTo(n,o.alternateValue):e.scrollTo(o.alternateValue,n);else if(w.Normalizations.registered[r]&&"transform"===w.Normalizations.registered[r]("name",t))w.Normalizations.registered[r]("inject",t,n),a="transform",n=s(t).transformCache[r];else{if(w.Hooks.registered[r]){var l=r,u=w.Hooks.getRoot(r);i=i||w.getPropertyValue(t,u),n=w.Hooks.injectValue(l,n,i),r=u}if(w.Normalizations.registered[r]&&(n=w.Normalizations.registered[r]("inject",t,n),r=w.Normalizations.registered[r]("name",t)),a=w.Names.prefixCheck(r)[0],8>=d)try{t.style[a]=n}catch(h){y.debug&&console.log("Browser does not support ["+n+"] for ["+a+"]")}else if(s(t)&&s(t).isSVG&&w.Names.SVGAttribute(r))t.setAttribute(r,n);else{var c="webgl"===t.renderer?t.styleGL:t.style;c[a]=n}y.debug>=2&&console.log("Set "+r+" ("+a+"): "+n)}return[a,n]},flushTransformCache:function(t){function e(e){return parseFloat(w.getPropertyValue(t,e))}var r="";if((d||y.State.isAndroid&&!y.State.isChrome)&&s(t).isSVG){var n={translate:[e("translateX"),e("translateY")],skewX:[e("skewX")],skewY:[e("skewY")],scale:1!==e("scale")?[e("scale"),e("scale")]:[e("scaleX"),e("scaleY")],rotate:[e("rotateZ"),0,0]};f.each(s(t).transformCache,function(t){/^translate/i.test(t)?t="translate":/^scale/i.test(t)?t="scale":/^rotate/i.test(t)&&(t="rotate"),n[t]&&(r+=t+"("+n[t].join(" ")+") ",delete n[t])})}else{var i,o;f.each(s(t).transformCache,function(e){return i=s(t).transformCache[e],"transformPerspective"===e?(o=i,!0):(9===d&&"rotateZ"===e&&(e="rotate"),void(r+=e+i+" "))}),o&&(r="perspective"+o+" "+r)}w.setPropertyValue(t,"transform",r)}};w.Hooks.register(),w.Normalizations.register(),y.hook=function(t,e,r){var i=n;return t=o(t),f.each(t,function(t,o){if(s(o)===n&&y.init(o),r===n)i===n&&(i=y.CSS.getPropertyValue(o,e));else{var a=y.CSS.setPropertyValue(o,e,r);"transform"===a[0]&&y.CSS.flushTransformCache(o),i=a}}),i};var E=function(){function t(){return a?D.promise||null:l}function i(){function t(t){function c(t,e){var r=n,i=n,s=n;return g.isArray(t)?(r=t[0],!g.isArray(t[1])&&/^[\d-]/.test(t[1])||g.isFunction(t[1])||w.RegEx.isHex.test(t[1])?s=t[1]:(g.isString(t[1])&&!w.RegEx.isHex.test(t[1])||g.isArray(t[1]))&&(i=e?t[1]:u(t[1],a.duration),t[2]!==n&&(s=t[2]))):r=t,e||(i=i||a.easing),g.isFunction(r)&&(r=r.call(o,b,C)),g.isFunction(s)&&(s=s.call(o,b,C)),[r||0,i,s]}function d(t,e){var r,n;return n=(e||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(t){return r=t,""}),r||(r=w.Values.getUnitType(t)),[n,r]}function v(){var t={myParent:o.parentNode||r.body,position:w.getPropertyValue(o,"position"),fontSize:w.getPropertyValue(o,"fontSize")},n=t.position===F.lastPosition&&t.myParent===F.lastParent,i=t.fontSize===F.lastFontSize;F.lastParent=t.myParent,F.lastPosition=t.position,F.lastFontSize=t.fontSize;var a=100,l={};if(i&&n)l.emToPx=F.lastEmToPx,l.percentToPxWidth=F.lastPercentToPxWidth,l.percentToPxHeight=F.lastPercentToPxHeight;else{var u=s(o).isSVG?r.createElementNS("http://www.w3.org/2000/svg","rect"):r.createElement("div");y.init(u),t.myParent.appendChild(u),f.each(["overflow","overflowX","overflowY"],function(t,e){y.CSS.setPropertyValue(u,e,"hidden")}),y.CSS.setPropertyValue(u,"position",t.position),y.CSS.setPropertyValue(u,"fontSize",t.fontSize),y.CSS.setPropertyValue(u,"boxSizing","content-box"),f.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(t,e){y.CSS.setPropertyValue(u,e,a+"%")}),y.CSS.setPropertyValue(u,"paddingLeft",a+"em"),l.percentToPxWidth=F.lastPercentToPxWidth=(parseFloat(w.getPropertyValue(u,"width",null,!0))||1)/a,l.percentToPxHeight=F.lastPercentToPxHeight=(parseFloat(w.getPropertyValue(u,"height",null,!0))||1)/a,l.emToPx=F.lastEmToPx=(parseFloat(w.getPropertyValue(u,"paddingLeft"))||1)/a,t.myParent.removeChild(u)}return null===F.remToPx&&(F.remToPx=parseFloat(w.getPropertyValue(r.body,"fontSize"))||16),null===F.vwToPx&&(F.vwToPx=parseFloat(e.innerWidth)/100,F.vhToPx=parseFloat(e.innerHeight)/100),l.remToPx=F.remToPx,l.vwToPx=F.vwToPx,l.vhToPx=F.vhToPx,y.debug>=1&&console.log("Unit ratios: "+JSON.stringify(l),o),l}if(a.begin&&0===b)try{a.begin.call(p,p)}catch(x){setTimeout(function(){throw x},1)}if("scroll"===M){var E,B,T,P=/^x$/i.test(a.axis)?"Left":"Top",R=parseFloat(a.offset)||0;a.container?g.isWrapped(a.container)||g.isNode(a.container)?(a.container=a.container[0]||a.container,E=a.container["scroll"+P],T=E+f(o).position()[P.toLowerCase()]+R):a.container=null:(E=y.State.scrollAnchor[y.State["scrollProperty"+P]],B=y.State.scrollAnchor[y.State["scrollProperty"+("Left"===P?"Top":"Left")]],T=f(o).offset()[P.toLowerCase()]+R),l={scroll:{rootPropertyValue:!1,startValue:E,currentValue:E,endValue:T,unitType:"",easing:a.easing,scrollData:{container:a.container,direction:P,alternateValue:B}},element:o},y.debug&&console.log("tweensContainer (scroll): ",l.scroll,o)}else if("reverse"===M){if(!s(o).tweensContainer)return void f.dequeue(o,a.queue);"none"===s(o).opts.display&&(s(o).opts.display="auto"),"hidden"===s(o).opts.visibility&&(s(o).opts.visibility="visible"),s(o).opts.loop=!1,s(o).opts.begin=null,s(o).opts.complete=null,m.easing||delete a.easing,m.duration||delete a.duration,a=f.extend({},s(o).opts,a);var I=f.extend(!0,{},s(o).tweensContainer);for(var S in I)if("element"!==S){var O=I[S].startValue;I[S].startValue=I[S].currentValue=I[S].endValue,I[S].endValue=O,g.isEmptyObject(m)||(I[S].easing=a.easing),y.debug&&console.log("reverse tweensContainer ("+S+"): "+JSON.stringify(I[S]),o)}l=I}else if("start"===M){var I;s(o).tweensContainer&&s(o).isAnimating===!0&&(I=s(o).tweensContainer),f.each(A,function(t,e){if(RegExp("^"+w.Lists.colors.join("$|^")+"$").test(t)){var r=c(e,!0),i=r[0],o=r[1],s=r[2];if(w.RegEx.isHex.test(i)){for(var a=["Red","Green","Blue"],l=w.Values.hexToRgb(i),u=s?w.Values.hexToRgb(s):n,h=0;hN;N++){var H={delay:R.delay,progress:R.progress};N===L-1&&(H.display=R.display,H.visibility=R.visibility,H.complete=R.complete),E(p,"reverse",H)}return t()}};y=f.extend(E,y),y.animate=E;var C=e.requestAnimationFrame||p;return y.State.isMobile||r.hidden===n||r.addEventListener("visibilitychange",function(){r.hidden?(C=function(t){return setTimeout(function(){t(!0)},16)},h()):C=e.requestAnimationFrame||p}),t.Velocity=y,t!==e&&(t.fn.velocity=E,t.fn.velocity.defaults=y.defaults),f.each(["Down","Up"],function(t,e){y.Redirects["slide"+e]=function(t,r,i,o,s,a){var l=f.extend({},r),u=l.begin,h=l.complete,c={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""},d={};l.display===n&&(l.display="Down"===e?"inline"===y.CSS.Values.getDisplayType(t)?"inline-block":"block":"none"),l.begin=function(){var r="webgl"===t.renderer?t.styleGL:t.style;u&&u.call(s,s);for(var n in c){d[n]=r[n];var i=y.CSS.getPropertyValue(t,n);c[n]="Down"===e?[i,0]:[0,i]}d.overflow=r.overflow,r.overflow="hidden"},l.complete=function(){for(var t in d)style[t]=d[t];h&&h.call(s,s),a&&a.resolver(s)},y(t,c,l)}}),f.each(["In","Out"],function(t,e){y.Redirects["fade"+e]=function(t,r,i,o,s,a){var l=f.extend({},r),u={opacity:"In"===e?1:0},h=l.complete;i!==o-1?l.complete=l.begin=null:l.complete=function(){h&&h.call(s,s),a&&a.resolver(s)},l.display===n&&(l.display="In"===e?"auto":"none"),y(this,u,l)}}),y}(window.jQuery||window.Zepto||window,window,document)}),function(t){t.HTMLGL=t.HTMLGL||{},t.HTMLGL.util={getterSetter:function(t,e,r,n){Object.defineProperty?Object.defineProperty(t,e,{get:r,set:n}):document.__defineGetter__&&(t.__defineGetter__(e,r),t.__defineSetter__(e,n)),t["get"+e]=r,t["set"+e]=n},emitEvent:function(t,e){var r=new MouseEvent(e.type,e);r.dispatcher="html-gl",e.stopPropagation(),t.dispatchEvent(r)},debounce:function(t,e,r){var n;return function(){var i=this,o=arguments,s=function(){n=null,r||t.apply(i,o)},a=r&&!n;clearTimeout(n),n=setTimeout(s,e),a&&t.apply(i,o)}}}}(window),function(t){var e=function(t){},r=e.prototype;r.getElementByCoordinates=function(e,r){var n,i,o=this;return t.HTMLGL.elements.forEach(function(t){n=document.elementFromPoint(e-parseInt(t.transformObject.translateX||0),r-parseInt(t.transformObject.translateY||0)),o.isChildOf(n,t)&&(i=n)}),i},r.isChildOf=function(t,e){for(var r=t;r;){if(r===e)return!0;r=r.parentNode}return!1},t.HTMLGL.GLElementResolver=e}(window),function(t){HTMLGL=t.HTMLGL=t.HTMLGL||{},HTMLGL.JQ_PLUGIN_NAME="htmlgl",HTMLGL.CUSTOM_ELEMENT_TAG_NAME="html-gl",HTMLGL.READY_EVENT="htmlglReady",HTMLGL.context=void 0,HTMLGL.stage=void 0,HTMLGL.renderer=void 0,HTMLGL.elements=[],HTMLGL.pixelRatio=null,HTMLGL.oldPixelRatio=null,HTMLGL.enabled=!0,HTMLGL.scrollX=0,HTMLGL.scrollY=0;var e=function(){t.HTMLGL.context=this,this.createStage(),this.updateScrollPosition(),this.initListeners(),this.elementResolver=new t.HTMLGL.GLElementResolver(this),document.body?this.initViewer():document.addEventListener("DOMContentLoaded",this.initViewer.bind(this))},r=e.prototype;r.initViewer=function(){this.createViewer(),this.resizeViewer(),this.appendViewer()},r.createViewer=function(){t.HTMLGL.renderer=this.renderer=PIXI.autoDetectRenderer(0,0,{transparent:!0}),this.renderer.view.style.position="fixed",this.renderer.view.style.top="0px",this.renderer.view.style.left="0px",this.renderer.view.style["pointer-events"]="none",this.renderer.view.style.pointerEvents="none"},r.appendViewer=function(){document.body.appendChild(this.renderer.view),requestAnimationFrame(this.redrawStage.bind(this))},r.resizeViewer=function(){var e=this,r=t.innerWidth,n=t.innerHeight;HTMLGL.pixelRatio=window.devicePixelRatio||1,console.log(HTMLGL.pixelRatio),r*=HTMLGL.pixelRatio,n*=HTMLGL.pixelRatio,HTMLGL.pixelRatio!==HTMLGL.oldPixelRatio?(this.disable(),this.updateTextures().then(function(){e.updateScrollPosition(),e.updateElementsPositions();var i=1/HTMLGL.pixelRatio;e.renderer.view.style.transformOrigin="0 0",e.renderer.view.style.webkitTransformOrigin="0 0",e.renderer.view.style.transform="scaleX("+i+") scaleY("+i+")",e.renderer.view.style.webkitTransform="scaleX("+i+") scaleY("+i+")",e.renderer.resize(r,n),this.enable(),t.HTMLGL.renderer.render(t.HTMLGL.stage)})):(this.renderer.view.parentNode&&this.updateTextures(),this.updateElementsPositions(),this.markStageAsChanged()),HTMLGL.oldPixelRatio=HTMLGL.pixelRatio},r.initListeners=function(){t.addEventListener("scroll",this.updateScrollPosition.bind(this)),t.addEventListener("resize",t.HTMLGL.util.debounce(this.resizeViewer,500).bind(this)),t.addEventListener("resize",this.updateElementsPositions.bind(this)),document.addEventListener("click",this.onMouseEvent.bind(this),!0),document.addEventListener("mousemove",this.onMouseEvent.bind(this),!0),document.addEventListener("mouseup",this.onMouseEvent.bind(this),!0),document.addEventListener("mousedown",this.onMouseEvent.bind(this),!0),document.addEventListener("touchstart",this.onMouseEvent.bind(this)),document.addEventListener("touchend",this.onMouseEvent.bind(this))},r.updateScrollPosition=function(){var e={};if(void 0!=window.pageYOffset)e={left:pageXOffset,top:pageYOffset};else{var r,n,i=document,o=i.documentElement,s=i.body;r=o.scrollLeft||s.scrollLeft||0,n=o.scrollTop||s.scrollTop||0,e={left:r,top:n}}this.document.x=-e.left*HTMLGL.pixelRatio,this.document.y=-e.top*HTMLGL.pixelRatio,t.HTMLGL.scrollX=e.left,t.HTMLGL.scrollY=e.top,this.markStageAsChanged()},r.createStage=function(){t.HTMLGL.stage=this.stage=new PIXI.Stage(16777215),t.HTMLGL.document=this.document=new PIXI.DisplayObjectContainer,this.stage.addChild(t.HTMLGL.document)},r.redrawStage=function(){t.HTMLGL.stage.changed&&t.HTMLGL.renderer&&t.HTMLGL.enabled&&(t.HTMLGL.renderer.render(t.HTMLGL.stage),t.HTMLGL.stage.changed=!1)},r.updateTextures=function(){var e=[];return t.HTMLGL.elements.forEach(function(t){e.push(t.updateTexture())}),Promise.all(e)},r.initElements=function(){t.HTMLGL.elements.forEach(function(t){t.init()})},r.updateElementsPositions=function(){t.HTMLGL.elements.forEach(function(t){t.updateBoundingRect(),t.updatePivot(),t.updateSpriteTransform()})},r.onMouseEvent=function(e){var r=e.x||e.pageX,n=e.y||e.pageY,i="html-gl"!==e.dispatcher?this.elementResolver.getElementByCoordinates(r,n):null;i?t.HTMLGL.util.emitEvent(i,e):null},r.markStageAsChanged=function(){t.HTMLGL.stage&&!t.HTMLGL.stage.changed&&(requestAnimationFrame(this.redrawStage),t.HTMLGL.stage.changed=!0)},r.disable=function(){t.HTMLGL.enabled=!0},r.enable=function(){t.HTMLGL.enabled=!1},t.HTMLGL.pixelRatio=window.devicePixelRatio||1,t.HTMLGL.GLContext=e,new e}(window),function(t){var e=function(t,e){this.element=t,this.images=this.element.querySelectorAll("img"),this.callback=e,this.imagesLoaded=this.getImagesLoaded(),this.images.length===this.imagesLoaded?this.onImageLoaded():this.addListeners()},r=e.prototype;r.getImagesLoaded=function(){for(var t=0,e=0;e